commit
stringlengths 40
40
| old_file
stringlengths 4
237
| new_file
stringlengths 4
237
| old_contents
stringlengths 1
4.24k
| new_contents
stringlengths 5
4.84k
| subject
stringlengths 15
778
| message
stringlengths 16
6.86k
| lang
stringlengths 1
30
| license
stringclasses 13
values | repos
stringlengths 5
116k
| config
stringlengths 1
30
| content
stringlengths 105
8.72k
|
---|---|---|---|---|---|---|---|---|---|---|---|
aabbb695224bb56197ec35983e8513446b9d100d | types/index.ts | types/index.ts | export type CookieAttributes = object & {
path?: string
domain?: string
expires?: number | Date
sameSite?: string
secure?: boolean
[property: string]: any
}
export type ReadConverter = (value: string, name?: string) => any
export type WriteConverter = (value: any, name?: string) => string
export type CookieConverter = object & {
read?: ReadConverter
write?: WriteConverter
}
type CookiesConfig = object & {
readonly converter: CookieConverter
readonly attributes: CookieAttributes
}
type CookiesApi = object & {
set: (
name: string,
value: any,
attributes?: CookieAttributes
) => string | undefined
get: (
name?: string | undefined | null
) => string | undefined | (object & { [property: string]: any })
remove: (name: string, attributes?: CookieAttributes) => void
withAttributes: (attributes: CookieAttributes) => Cookies
withConverter: (converter: CookieConverter) => Cookies
}
export type Cookies = CookiesConfig & CookiesApi
| export type CookieAttributes = object & {
path?: string
domain?: string
expires?: number | Date
sameSite?: string
secure?: boolean
[property: string]: any
}
export type ReadConverter = (value: string, name?: string) => any
export type WriteConverter = (value: any, name?: string) => string
export type CookieConverter = object & {
read: ReadConverter
write: WriteConverter
}
type CookiesConfig = object & {
readonly converter: CookieConverter
readonly attributes: CookieAttributes
}
type CookiesApi = object & {
set: (
name: string,
value: any,
attributes?: CookieAttributes
) => string | undefined
get: (
name?: string | undefined | null
) => string | undefined | (object & { [property: string]: any })
remove: (name: string, attributes?: CookieAttributes) => void
withAttributes: (attributes: CookieAttributes) => Cookies
withConverter: (converter: { write?: WriteConverter, read?: ReadConverter }) => Cookies
}
export type Cookies = CookiesConfig & CookiesApi
| Make converter props optional where necessary | Make converter props optional where necessary
| TypeScript | mit | carhartl/js-cookie,carhartl/js-cookie | typescript | ## Code Before:
export type CookieAttributes = object & {
path?: string
domain?: string
expires?: number | Date
sameSite?: string
secure?: boolean
[property: string]: any
}
export type ReadConverter = (value: string, name?: string) => any
export type WriteConverter = (value: any, name?: string) => string
export type CookieConverter = object & {
read?: ReadConverter
write?: WriteConverter
}
type CookiesConfig = object & {
readonly converter: CookieConverter
readonly attributes: CookieAttributes
}
type CookiesApi = object & {
set: (
name: string,
value: any,
attributes?: CookieAttributes
) => string | undefined
get: (
name?: string | undefined | null
) => string | undefined | (object & { [property: string]: any })
remove: (name: string, attributes?: CookieAttributes) => void
withAttributes: (attributes: CookieAttributes) => Cookies
withConverter: (converter: CookieConverter) => Cookies
}
export type Cookies = CookiesConfig & CookiesApi
## Instruction:
Make converter props optional where necessary
## Code After:
export type CookieAttributes = object & {
path?: string
domain?: string
expires?: number | Date
sameSite?: string
secure?: boolean
[property: string]: any
}
export type ReadConverter = (value: string, name?: string) => any
export type WriteConverter = (value: any, name?: string) => string
export type CookieConverter = object & {
read: ReadConverter
write: WriteConverter
}
type CookiesConfig = object & {
readonly converter: CookieConverter
readonly attributes: CookieAttributes
}
type CookiesApi = object & {
set: (
name: string,
value: any,
attributes?: CookieAttributes
) => string | undefined
get: (
name?: string | undefined | null
) => string | undefined | (object & { [property: string]: any })
remove: (name: string, attributes?: CookieAttributes) => void
withAttributes: (attributes: CookieAttributes) => Cookies
withConverter: (converter: { write?: WriteConverter, read?: ReadConverter }) => Cookies
}
export type Cookies = CookiesConfig & CookiesApi
|
381ac62d0a196f090bcfd3689cb650e5b466b559 | core/spec/lib/spree/core/testing_support/factories/customer_return_factory_spec.rb | core/spec/lib/spree/core/testing_support/factories/customer_return_factory_spec.rb | require 'spec_helper'
require 'spree/testing_support/factories/customer_return_factory'
RSpec.describe 'customer return factory' do
let(:factory_class) { Spree::CustomerReturn }
describe 'customer return' do
let(:factory) { :customer_return }
it_behaves_like 'a working factory'
end
describe 'customer return with accepted items' do
let(:factory) { :customer_return_with_accepted_items }
it_behaves_like 'a working factory'
end
describe 'customer return without return items' do
let(:factory) { :customer_return_without_return_items }
it "builds successfully" do
expect(build factory).to be_a(factory_class)
end
# No create test, because this factory is (intentionally) invalid
end
end
| require 'spec_helper'
require 'spree/testing_support/factories/customer_return_factory'
RSpec.describe 'customer return factory' do
let(:factory_class) { Spree::CustomerReturn }
describe 'customer return' do
let(:factory) { :customer_return }
it_behaves_like 'a working factory'
# Regression test for https://github.com/solidusio/solidus/pull/697
it "creates only one of dependent records" do
create(:customer_return, line_items_count: 2)
aggregate_failures "items created" do
expect(Spree::Order.count).to eq(1)
expect(Spree::ReturnAuthorization.count).to eq(1)
end
end
end
describe 'customer return with accepted items' do
let(:factory) { :customer_return_with_accepted_items }
it_behaves_like 'a working factory'
end
describe 'customer return without return items' do
let(:factory) { :customer_return_without_return_items }
it "builds successfully" do
expect(build factory).to be_a(factory_class)
end
# No create test, because this factory is (intentionally) invalid
end
end
| Test objects created by customer_return factory | Test objects created by customer_return factory
Test for issue fixed by https://github.com/solidusio/solidus/pull/697
| Ruby | bsd-3-clause | jordan-brough/solidus,pervino/solidus,jordan-brough/solidus,pervino/solidus,pervino/solidus,jordan-brough/solidus,Arpsara/solidus,jordan-brough/solidus,pervino/solidus,Arpsara/solidus,Arpsara/solidus,Arpsara/solidus | ruby | ## Code Before:
require 'spec_helper'
require 'spree/testing_support/factories/customer_return_factory'
RSpec.describe 'customer return factory' do
let(:factory_class) { Spree::CustomerReturn }
describe 'customer return' do
let(:factory) { :customer_return }
it_behaves_like 'a working factory'
end
describe 'customer return with accepted items' do
let(:factory) { :customer_return_with_accepted_items }
it_behaves_like 'a working factory'
end
describe 'customer return without return items' do
let(:factory) { :customer_return_without_return_items }
it "builds successfully" do
expect(build factory).to be_a(factory_class)
end
# No create test, because this factory is (intentionally) invalid
end
end
## Instruction:
Test objects created by customer_return factory
Test for issue fixed by https://github.com/solidusio/solidus/pull/697
## Code After:
require 'spec_helper'
require 'spree/testing_support/factories/customer_return_factory'
RSpec.describe 'customer return factory' do
let(:factory_class) { Spree::CustomerReturn }
describe 'customer return' do
let(:factory) { :customer_return }
it_behaves_like 'a working factory'
# Regression test for https://github.com/solidusio/solidus/pull/697
it "creates only one of dependent records" do
create(:customer_return, line_items_count: 2)
aggregate_failures "items created" do
expect(Spree::Order.count).to eq(1)
expect(Spree::ReturnAuthorization.count).to eq(1)
end
end
end
describe 'customer return with accepted items' do
let(:factory) { :customer_return_with_accepted_items }
it_behaves_like 'a working factory'
end
describe 'customer return without return items' do
let(:factory) { :customer_return_without_return_items }
it "builds successfully" do
expect(build factory).to be_a(factory_class)
end
# No create test, because this factory is (intentionally) invalid
end
end
|
621787d3a202377bb4edbdbc919de7af87e7ff89 | Cargo.toml | Cargo.toml | [package]
name = "wtf8"
version = "0.0.1"
authors = ["Simon Sapin <simon.sapin@exyr.org>"]
[lib]
name = "wtf8"
doctest = false
| [package]
name = "wtf8"
version = "0.0.2"
authors = ["Simon Sapin <simon.sapin@exyr.org>"]
description = "Implementation of the WTF-8 encoding. https://simonsapin.github.io/wtf-8/"
documentation = "https://simonsapin.github.io/rust-wtf8/wtf8/index.html"
repository = "https://github.com/SimonSapin/rust-wtf8"
readme = "README.md"
keywords = ["unicode", "encoding", "surrogate"]
license = "MIT"
[lib]
name = "wtf8"
doctest = false
| Add some metadata for crates.io. | Add some metadata for crates.io.
| TOML | mit | SimonSapin/rust-wtf8 | toml | ## Code Before:
[package]
name = "wtf8"
version = "0.0.1"
authors = ["Simon Sapin <simon.sapin@exyr.org>"]
[lib]
name = "wtf8"
doctest = false
## Instruction:
Add some metadata for crates.io.
## Code After:
[package]
name = "wtf8"
version = "0.0.2"
authors = ["Simon Sapin <simon.sapin@exyr.org>"]
description = "Implementation of the WTF-8 encoding. https://simonsapin.github.io/wtf-8/"
documentation = "https://simonsapin.github.io/rust-wtf8/wtf8/index.html"
repository = "https://github.com/SimonSapin/rust-wtf8"
readme = "README.md"
keywords = ["unicode", "encoding", "surrogate"]
license = "MIT"
[lib]
name = "wtf8"
doctest = false
|
acd7abd4160a1449f4eb8919fa54efcdc9338f18 | client/login.php | client/login.php | <?php
/*
* This is just a dummy page pretending to log a user in.
* The idea is to test sessions on the server
*/
require(__DIR__ . '/../vendor/autoload.php');
use \Socketty\ErrorHandler;
use \Symfony\Component\HttpFoundation\Session\Session;
use \Symfony\Component\HttpFoundation\Session\Storage\Handler\MemcachedSessionHandler;
use \Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
ErrorHandler::setErrorHandler();
try{
$memcached = new Memcached();
$memcached->addServer('localhost', 11211);
$handler = new MemcachedSessionHandler($memcached);
$storage = new NativeSessionStorage(array(), $handler);
$session = new Session($storage);
$session->setName('CUSTOM_NAME');
$session->start();
if($session->has('username')){
echo "Already logged in";
}else{
$session->set('username', 'Mister hoba loba loba');
echo "Logged in!";
}
}catch(Exception $e){
echo $e->getMessage();
} | <?php
/*
* This is just a dummy page pretending to log a user in.
* The idea is to test sessions on the server
*/
require(__DIR__ . '/../vendor/autoload.php');
use \Symfony\Component\HttpFoundation\Session\Session;
use \Symfony\Component\HttpFoundation\Session\Storage\Handler\MemcachedSessionHandler;
use \Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
try{
$memcached = new Memcached();
$memcached->addServer('localhost', 11211);
$handler = new MemcachedSessionHandler($memcached);
$storage = new NativeSessionStorage(array(), $handler);
$session = new Session($storage);
$session->setName('CUSTOM_NAME');
$session->start();
if($session->has('username')){
echo "Already logged in";
}else{
$session->set('username', 'Mister hoba loba loba');
echo "Logged in!";
}
}catch(Exception $e){
echo $e->getMessage();
} | Remove error handler here as well | Remove error handler here as well
| PHP | mit | magnusjt/socketty,magnusjt/socketty,magnusjt/socketty,magnusjt/socketty,magnusjt/socketty,magnusjt/socketty | php | ## Code Before:
<?php
/*
* This is just a dummy page pretending to log a user in.
* The idea is to test sessions on the server
*/
require(__DIR__ . '/../vendor/autoload.php');
use \Socketty\ErrorHandler;
use \Symfony\Component\HttpFoundation\Session\Session;
use \Symfony\Component\HttpFoundation\Session\Storage\Handler\MemcachedSessionHandler;
use \Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
ErrorHandler::setErrorHandler();
try{
$memcached = new Memcached();
$memcached->addServer('localhost', 11211);
$handler = new MemcachedSessionHandler($memcached);
$storage = new NativeSessionStorage(array(), $handler);
$session = new Session($storage);
$session->setName('CUSTOM_NAME');
$session->start();
if($session->has('username')){
echo "Already logged in";
}else{
$session->set('username', 'Mister hoba loba loba');
echo "Logged in!";
}
}catch(Exception $e){
echo $e->getMessage();
}
## Instruction:
Remove error handler here as well
## Code After:
<?php
/*
* This is just a dummy page pretending to log a user in.
* The idea is to test sessions on the server
*/
require(__DIR__ . '/../vendor/autoload.php');
use \Symfony\Component\HttpFoundation\Session\Session;
use \Symfony\Component\HttpFoundation\Session\Storage\Handler\MemcachedSessionHandler;
use \Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
try{
$memcached = new Memcached();
$memcached->addServer('localhost', 11211);
$handler = new MemcachedSessionHandler($memcached);
$storage = new NativeSessionStorage(array(), $handler);
$session = new Session($storage);
$session->setName('CUSTOM_NAME');
$session->start();
if($session->has('username')){
echo "Already logged in";
}else{
$session->set('username', 'Mister hoba loba loba');
echo "Logged in!";
}
}catch(Exception $e){
echo $e->getMessage();
} |
5ba8c8b47a5f6f72b73de8abf20520769b404566 | docs/content/feature/traffic-shaping.md | docs/content/feature/traffic-shaping.md | ---
title: "Traffic Shaping"
since: "1.0"
---
fabio allows to control the amount of traffic a set of service instances will
receive. You can use this feature to direct a fixed percentage of traffic to a
newer version of an existing service for testing ("Canary testing"). See
[Manual Overrides](./Routing#manual-overrides) for a complete description of the `route
weight` command.
The following command will allocate 5% of traffic to `www.kjca.dev/auth/` to
all instances of `service-b` which match tags `version-15` and `dc-fra`. This
is independent of the number of actual instances running. The remaining 95%
of the traffic will be distributed evenly across the remaining instances
publishing the same prefix.
```
route weight service-b www.kjca.dev/auth/ weight 0.05 tags "version-15,dc-fra"
```
| ---
title: "Traffic Shaping"
since: "1.0"
---
fabio allows to control the amount of traffic a set of service instances will
receive. You can use this feature to direct a fixed percentage of traffic to a
newer version of an existing service for testing ("Canary testing"). See
[Manual Overrides](./Routing#manual-overrides) for a complete description of the `route
weight` command.
The following command will allocate 5% of traffic to `www.kjca.dev/auth/` to
all instances of `service-b` which match tags `version-15` and `dc-fra`. This
is independent of the number of actual instances running. The remaining 95%
of the traffic will be distributed evenly across the remaining instances
publishing the same prefix.
```
route weight service-b www.kjca.dev/auth/ weight 0.05 tags "version-15,dc-fra"
```
### Vault Example
[Vault](https://www.vaultproject.io) is a tool by [HashiCorp](https://www.hashicorp.com/) for managing secrets and protecting sensitive data. When running in HA mode, Vault will have a single active node which is responsible for responding the API requests. Fabio can be used to ensure traffic is routed to the correct server via traffic shaping.
The following command will allocate 100% of traffic to `vault.company.com` to the instance of `vault` which is registered with the tag `active`.
```
route weight vault vault.company.com weight 1.00 tags "active"
```
| Add Vault example to the traffic shaping section. | Add Vault example to the traffic shaping section.
Add a small section to the Traffic Shaping documentation detailing how to use Fabio to route traffic for Vault to the active node.
Ref: https://twitter.com/jrasell/status/1100724689767485440 | Markdown | mit | fabiolb/fabio,fabiolb/fabio | markdown | ## Code Before:
---
title: "Traffic Shaping"
since: "1.0"
---
fabio allows to control the amount of traffic a set of service instances will
receive. You can use this feature to direct a fixed percentage of traffic to a
newer version of an existing service for testing ("Canary testing"). See
[Manual Overrides](./Routing#manual-overrides) for a complete description of the `route
weight` command.
The following command will allocate 5% of traffic to `www.kjca.dev/auth/` to
all instances of `service-b` which match tags `version-15` and `dc-fra`. This
is independent of the number of actual instances running. The remaining 95%
of the traffic will be distributed evenly across the remaining instances
publishing the same prefix.
```
route weight service-b www.kjca.dev/auth/ weight 0.05 tags "version-15,dc-fra"
```
## Instruction:
Add Vault example to the traffic shaping section.
Add a small section to the Traffic Shaping documentation detailing how to use Fabio to route traffic for Vault to the active node.
Ref: https://twitter.com/jrasell/status/1100724689767485440
## Code After:
---
title: "Traffic Shaping"
since: "1.0"
---
fabio allows to control the amount of traffic a set of service instances will
receive. You can use this feature to direct a fixed percentage of traffic to a
newer version of an existing service for testing ("Canary testing"). See
[Manual Overrides](./Routing#manual-overrides) for a complete description of the `route
weight` command.
The following command will allocate 5% of traffic to `www.kjca.dev/auth/` to
all instances of `service-b` which match tags `version-15` and `dc-fra`. This
is independent of the number of actual instances running. The remaining 95%
of the traffic will be distributed evenly across the remaining instances
publishing the same prefix.
```
route weight service-b www.kjca.dev/auth/ weight 0.05 tags "version-15,dc-fra"
```
### Vault Example
[Vault](https://www.vaultproject.io) is a tool by [HashiCorp](https://www.hashicorp.com/) for managing secrets and protecting sensitive data. When running in HA mode, Vault will have a single active node which is responsible for responding the API requests. Fabio can be used to ensure traffic is routed to the correct server via traffic shaping.
The following command will allocate 100% of traffic to `vault.company.com` to the instance of `vault` which is registered with the tag `active`.
```
route weight vault vault.company.com weight 1.00 tags "active"
```
|
3e812032da7246f4056190dbef88fb0c85e0be7f | console/src/app/core/services/charts-provider-service/charts-provider.service.ts | console/src/app/core/services/charts-provider-service/charts-provider.service.ts | import { Injectable } from '@angular/core';
import { PrometheusApiService } from '../prometheus-api/prometheus-api.service';
import { MongooseChartDao } from '../../models/chart/mongoose-chart-interface/mongoose-chart-dao.model';
@Injectable({
providedIn: 'root'
})
export class ChartsProviderService {
private mongooseChartDao: MongooseChartDao;
constructor(prometheusApiService: PrometheusApiService) {
// NOTE: Prometheus API service is data provider for Mongoose Charts.
this.mongooseChartDao = new MongooseChartDao(prometheusApiService);
}
}
| import { Injectable } from '@angular/core';
import { PrometheusApiService } from '../prometheus-api/prometheus-api.service';
import { MongooseChartDao } from '../../models/chart/mongoose-chart-interface/mongoose-chart-dao.model';
import { MongooseMetric } from '../../models/chart/mongoose-metric.model';
import { MongooseChartsRepository } from '../../models/chart/mongoose-charts-repository';
import { MongooseDurationChart } from '../../models/chart/duration/mongoose-duration-chart.model';
import { MongooseLatencyChart } from '../../models/chart/latency/mongoose-latency-chart.model';
import { MongooseBandwidthChart } from '../../models/chart/bandwidth/mongoose-bandwidth-chart.model';
import { MongooseThroughputChart } from '../../models/chart/throughput/mongoose-throughput-chart.model';
@Injectable({
providedIn: 'root'
})
export class ChartsProviderService {
private mongooseChartDao: MongooseChartDao;
private durationChart: MongooseDurationChart;
private latencyChart: MongooseLatencyChart;
private bandwidthChart: MongooseBandwidthChart;
private throughputChart: MongooseThroughputChart;
constructor(prometheusApiService: PrometheusApiService) {
// NOTE: Prometheus API service is data provider for Mongoose Charts.
this.mongooseChartDao = new MongooseChartDao(prometheusApiService);
this.configureMongooseCharts();
}
// MARK: - Public
// MARK: - Private
private updateLatencyChart(perdiodOfLatencyUpdateMs: number, recordLoadStepId: string) {
this.mongooseChartDao.getLatencyMax(perdiodOfLatencyUpdateMs, recordLoadStepId).subscribe((maxLatencyResult: MongooseMetric) => {
this.mongooseChartDao.getLatencyMin(perdiodOfLatencyUpdateMs, recordLoadStepId).subscribe((minLatencyResult: MongooseMetric) => {
let latencyRelatedMetrics = [maxLatencyResult, minLatencyResult];
this.latencyChart.updateChart(recordLoadStepId, latencyRelatedMetrics);
});
});
}
private configureMongooseCharts() {
let mongooseChartRepository = new MongooseChartsRepository(this.mongooseChartDao);
this.durationChart = mongooseChartRepository.getDurationChart();
this.latencyChart = mongooseChartRepository.getLatencyChart();
this.bandwidthChart = mongooseChartRepository.getBandwidthChart();
this.throughputChart = mongooseChartRepository.getThoughputChart();
}
}
| Add charts to ChartsProviderService. Add larency chart updation method to it. | Add charts to ChartsProviderService. Add larency chart updation method to it.
| TypeScript | mit | emc-mongoose/console,emc-mongoose/console,emc-mongoose/console | typescript | ## Code Before:
import { Injectable } from '@angular/core';
import { PrometheusApiService } from '../prometheus-api/prometheus-api.service';
import { MongooseChartDao } from '../../models/chart/mongoose-chart-interface/mongoose-chart-dao.model';
@Injectable({
providedIn: 'root'
})
export class ChartsProviderService {
private mongooseChartDao: MongooseChartDao;
constructor(prometheusApiService: PrometheusApiService) {
// NOTE: Prometheus API service is data provider for Mongoose Charts.
this.mongooseChartDao = new MongooseChartDao(prometheusApiService);
}
}
## Instruction:
Add charts to ChartsProviderService. Add larency chart updation method to it.
## Code After:
import { Injectable } from '@angular/core';
import { PrometheusApiService } from '../prometheus-api/prometheus-api.service';
import { MongooseChartDao } from '../../models/chart/mongoose-chart-interface/mongoose-chart-dao.model';
import { MongooseMetric } from '../../models/chart/mongoose-metric.model';
import { MongooseChartsRepository } from '../../models/chart/mongoose-charts-repository';
import { MongooseDurationChart } from '../../models/chart/duration/mongoose-duration-chart.model';
import { MongooseLatencyChart } from '../../models/chart/latency/mongoose-latency-chart.model';
import { MongooseBandwidthChart } from '../../models/chart/bandwidth/mongoose-bandwidth-chart.model';
import { MongooseThroughputChart } from '../../models/chart/throughput/mongoose-throughput-chart.model';
@Injectable({
providedIn: 'root'
})
export class ChartsProviderService {
private mongooseChartDao: MongooseChartDao;
private durationChart: MongooseDurationChart;
private latencyChart: MongooseLatencyChart;
private bandwidthChart: MongooseBandwidthChart;
private throughputChart: MongooseThroughputChart;
constructor(prometheusApiService: PrometheusApiService) {
// NOTE: Prometheus API service is data provider for Mongoose Charts.
this.mongooseChartDao = new MongooseChartDao(prometheusApiService);
this.configureMongooseCharts();
}
// MARK: - Public
// MARK: - Private
private updateLatencyChart(perdiodOfLatencyUpdateMs: number, recordLoadStepId: string) {
this.mongooseChartDao.getLatencyMax(perdiodOfLatencyUpdateMs, recordLoadStepId).subscribe((maxLatencyResult: MongooseMetric) => {
this.mongooseChartDao.getLatencyMin(perdiodOfLatencyUpdateMs, recordLoadStepId).subscribe((minLatencyResult: MongooseMetric) => {
let latencyRelatedMetrics = [maxLatencyResult, minLatencyResult];
this.latencyChart.updateChart(recordLoadStepId, latencyRelatedMetrics);
});
});
}
private configureMongooseCharts() {
let mongooseChartRepository = new MongooseChartsRepository(this.mongooseChartDao);
this.durationChart = mongooseChartRepository.getDurationChart();
this.latencyChart = mongooseChartRepository.getLatencyChart();
this.bandwidthChart = mongooseChartRepository.getBandwidthChart();
this.throughputChart = mongooseChartRepository.getThoughputChart();
}
}
|
b4fc8d9be51abf42d9889052e6311ef49f628ad7 | .travis.yml | .travis.yml | language: node_js
node_js:
- "4.4.4"
- "6.2.0"
sudo: false
cache:
directories:
- node_modules
script:
- |
if [ "$TEST_TYPE" = unit_test ]; then
set -e
npm test
elif [ "$TEST_TYPE" = integration_test ]; then
set -e
SAGUI_DIR="${pwd}"
PROJECT_DIR="${mktemp -d}"
cd $PROJECT_DIR
# Create a new project and install Sagui
npm init -y .
npm install --save-dev file://$SAGUI_DIR
# Run some basic scripts
npm test
npm run build
npm run dist
env:
matrix:
- TEST_TYPE=unit_test
- TEST_TYPE=integration_test
| language: node_js
node_js:
- "4.4.4"
- "6.2.0"
sudo: false
cache:
directories:
- node_modules
script:
- |
if [ "$TEST_TYPE" = unit_test ]; then
set -e
npm test
elif [ "$TEST_TYPE" = integration_test ]; then
set -e
SAGUI_DIR=`pwd`
PROJECT_DIR=`mktemp -d`
cd $PROJECT_DIR
# Create a new project and install Sagui
npm init -y .
npm install --save-dev file://$SAGUI_DIR
# Run some basic scripts
npm test
npm run build
npm run dist
fi
env:
matrix:
- TEST_TYPE=unit_test
- TEST_TYPE=integration_test
| Fix issues in Travis build scripts | Fix issues in Travis build scripts | YAML | mit | saguijs/sagui,saguijs/sagui | yaml | ## Code Before:
language: node_js
node_js:
- "4.4.4"
- "6.2.0"
sudo: false
cache:
directories:
- node_modules
script:
- |
if [ "$TEST_TYPE" = unit_test ]; then
set -e
npm test
elif [ "$TEST_TYPE" = integration_test ]; then
set -e
SAGUI_DIR="${pwd}"
PROJECT_DIR="${mktemp -d}"
cd $PROJECT_DIR
# Create a new project and install Sagui
npm init -y .
npm install --save-dev file://$SAGUI_DIR
# Run some basic scripts
npm test
npm run build
npm run dist
env:
matrix:
- TEST_TYPE=unit_test
- TEST_TYPE=integration_test
## Instruction:
Fix issues in Travis build scripts
## Code After:
language: node_js
node_js:
- "4.4.4"
- "6.2.0"
sudo: false
cache:
directories:
- node_modules
script:
- |
if [ "$TEST_TYPE" = unit_test ]; then
set -e
npm test
elif [ "$TEST_TYPE" = integration_test ]; then
set -e
SAGUI_DIR=`pwd`
PROJECT_DIR=`mktemp -d`
cd $PROJECT_DIR
# Create a new project and install Sagui
npm init -y .
npm install --save-dev file://$SAGUI_DIR
# Run some basic scripts
npm test
npm run build
npm run dist
fi
env:
matrix:
- TEST_TYPE=unit_test
- TEST_TYPE=integration_test
|
cd29012a652cb672b8e87dbb60aebe1e12012276 | app/styles/main.scss | app/styles/main.scss | /* Libraries */
@import 'compass/support';
@import 'compass/css3';
@import 'compass/typography';
/* Modules */
@import 'base';
@import 'application';
@import 'groups-view';
@import 'group-view';
@import 'group-edit-view';
@import 'items-view';
@import 'item-view';
@import 'item-edit-view';
| /* Base breakpoints */
$screen-small: 0px 719px;
$screen-medium: 720px;
$screen-large: 1024px;
$screen-xtra-large: 1200px;
/* Media Queries */
$hidpi: min-resolution 1.5dppx;
$lodpi: max-resolution 1dppx;
$screen-portrait: (orientation portrait);
$screen-landscape: (orientation landscape);
$screen-small-portrait: $screen-small (orientation portrait);
$screen-small-landscape: $screen-small (orientation landscape);
$screen-medium-portrait: $screen-medium (orientation portrait);
$screen-medium-landscape: $screen-medium (orientation landscape);
$screen-large-portrait: $screen-large (orientation portrait);
$screen-large-landscape: $screen-large (orientation landscape);
$screen-large-landscape-hidpi: $screen-large (orientation landscape) $hidpi;
$screen-large-lodpi: $screen-large $lodpi;
/* Libraries */
@import 'normalize'; // via Bower
@import 'breakpoint'; // via Bower
@import 'font-awesome';
@import 'compass/support';
@import 'compass/css3';
@import 'compass/typography';
/* Modules */
@import 'base';
@import 'application';
@import 'groups-view';
@import 'group-view';
@import 'group-edit-view';
@import 'items-view';
@import 'item-view';
@import 'item-edit-view';
| Add Sass breakpoints and libraries | Add Sass breakpoints and libraries
| SCSS | mit | darvelo/wishlist,darvelo/wishlist | scss | ## Code Before:
/* Libraries */
@import 'compass/support';
@import 'compass/css3';
@import 'compass/typography';
/* Modules */
@import 'base';
@import 'application';
@import 'groups-view';
@import 'group-view';
@import 'group-edit-view';
@import 'items-view';
@import 'item-view';
@import 'item-edit-view';
## Instruction:
Add Sass breakpoints and libraries
## Code After:
/* Base breakpoints */
$screen-small: 0px 719px;
$screen-medium: 720px;
$screen-large: 1024px;
$screen-xtra-large: 1200px;
/* Media Queries */
$hidpi: min-resolution 1.5dppx;
$lodpi: max-resolution 1dppx;
$screen-portrait: (orientation portrait);
$screen-landscape: (orientation landscape);
$screen-small-portrait: $screen-small (orientation portrait);
$screen-small-landscape: $screen-small (orientation landscape);
$screen-medium-portrait: $screen-medium (orientation portrait);
$screen-medium-landscape: $screen-medium (orientation landscape);
$screen-large-portrait: $screen-large (orientation portrait);
$screen-large-landscape: $screen-large (orientation landscape);
$screen-large-landscape-hidpi: $screen-large (orientation landscape) $hidpi;
$screen-large-lodpi: $screen-large $lodpi;
/* Libraries */
@import 'normalize'; // via Bower
@import 'breakpoint'; // via Bower
@import 'font-awesome';
@import 'compass/support';
@import 'compass/css3';
@import 'compass/typography';
/* Modules */
@import 'base';
@import 'application';
@import 'groups-view';
@import 'group-view';
@import 'group-edit-view';
@import 'items-view';
@import 'item-view';
@import 'item-edit-view';
|
8306cdfc3fa1b755e02ba0328926da7c4752564a | edocs-app/src/main/java/com/github/aureliano/edocs/app/gui/AppFrame.java | edocs-app/src/main/java/com/github/aureliano/edocs/app/gui/AppFrame.java | package com.github.aureliano.edocs.app.gui;
import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.JFrame;
import javax.swing.JPanel;
import com.github.aureliano.edocs.app.gui.menu.MenuBar;
public class AppFrame extends JFrame {
private static final long serialVersionUID = 7618501026967569839L;
private TabbedPane tabbedPane;
public AppFrame() {
this.buildGui();
}
private void buildGui() {
super.setTitle("e-Docs");
super.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel panel = new JPanel(new BorderLayout());
panel.setOpaque(true);
panel.add(new VerticalToolBar(), BorderLayout.WEST);
this.tabbedPane = new TabbedPane();
panel.add(this.tabbedPane, BorderLayout.CENTER);
super.setContentPane(panel);
super.setJMenuBar(new MenuBar());
}
public void showFrame() {
super.pack();
super.setVisible(true);
super.setSize(new Dimension(500, 500));
}
} | package com.github.aureliano.edocs.app.gui;
import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.JFrame;
import javax.swing.JPanel;
import com.github.aureliano.edocs.app.gui.menu.MenuBar;
public class AppFrame extends JFrame {
private static final long serialVersionUID = 7618501026967569839L;
private TabbedPane tabbedPane;
public AppFrame() {
this.buildGui();
}
private void buildGui() {
super.setTitle("e-Docs");
super.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel panel = new JPanel(new BorderLayout());
panel.setOpaque(true);
panel.add(new VerticalToolBar(), BorderLayout.WEST);
this.tabbedPane = new TabbedPane();
panel.add(this.tabbedPane, BorderLayout.CENTER);
super.setContentPane(panel);
super.setJMenuBar(new MenuBar());
}
public void showFrame() {
super.pack();
super.setSize(new Dimension(500, 500));
super.setLocationRelativeTo(null);
super.setVisible(true);
}
} | Set main frame default location. | Set main frame default location.
| Java | mit | aureliano/e-docs | java | ## Code Before:
package com.github.aureliano.edocs.app.gui;
import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.JFrame;
import javax.swing.JPanel;
import com.github.aureliano.edocs.app.gui.menu.MenuBar;
public class AppFrame extends JFrame {
private static final long serialVersionUID = 7618501026967569839L;
private TabbedPane tabbedPane;
public AppFrame() {
this.buildGui();
}
private void buildGui() {
super.setTitle("e-Docs");
super.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel panel = new JPanel(new BorderLayout());
panel.setOpaque(true);
panel.add(new VerticalToolBar(), BorderLayout.WEST);
this.tabbedPane = new TabbedPane();
panel.add(this.tabbedPane, BorderLayout.CENTER);
super.setContentPane(panel);
super.setJMenuBar(new MenuBar());
}
public void showFrame() {
super.pack();
super.setVisible(true);
super.setSize(new Dimension(500, 500));
}
}
## Instruction:
Set main frame default location.
## Code After:
package com.github.aureliano.edocs.app.gui;
import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.JFrame;
import javax.swing.JPanel;
import com.github.aureliano.edocs.app.gui.menu.MenuBar;
public class AppFrame extends JFrame {
private static final long serialVersionUID = 7618501026967569839L;
private TabbedPane tabbedPane;
public AppFrame() {
this.buildGui();
}
private void buildGui() {
super.setTitle("e-Docs");
super.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel panel = new JPanel(new BorderLayout());
panel.setOpaque(true);
panel.add(new VerticalToolBar(), BorderLayout.WEST);
this.tabbedPane = new TabbedPane();
panel.add(this.tabbedPane, BorderLayout.CENTER);
super.setContentPane(panel);
super.setJMenuBar(new MenuBar());
}
public void showFrame() {
super.pack();
super.setSize(new Dimension(500, 500));
super.setLocationRelativeTo(null);
super.setVisible(true);
}
} |
f1b67d11f9e092a6686041cce16519793d0c5d25 | tests/sanity.rs | tests/sanity.rs | extern crate pandoc;
use std::path::PathBuf;
#[test]
fn creation() {
use pandoc::PandocOption::*;
use pandoc::OutputKind;
let mut pandoc = pandoc::new();
pandoc.add_input("cake");
pandoc.set_output(OutputKind::File(String::from("lie")));
pandoc.set_chapters();
pandoc.set_number_sections();
pandoc.set_latex_template("template.tex");
pandoc.set_output_format(pandoc::OutputFormat::Beamer);
pandoc.add_latex_path_hint("D:\\texlive\\2015\\bin\\win32");
pandoc.set_slide_level(3);
pandoc.set_toc();
pandoc.add_option(Strict);
pandoc.add_option(IndentedCodeClasses("cake".to_string()));
let path = PathBuf::new();
pandoc.add_option(Filter(path));
}
| extern crate pandoc;
use std::path::PathBuf;
#[test]
fn creation() {
use pandoc::PandocOption::*;
use pandoc::OutputKind;
let mut pandoc = pandoc::new();
pandoc.add_input("cake");
pandoc.set_output(OutputKind::File(String::from("lie")));
pandoc.set_chapters();
pandoc.set_number_sections();
pandoc.set_latex_template("template.tex");
pandoc.set_output_format(pandoc::OutputFormat::Beamer, Vec::new());
pandoc.add_latex_path_hint("D:\\texlive\\2015\\bin\\win32");
pandoc.set_slide_level(3);
pandoc.set_toc();
pandoc.add_option(Strict);
pandoc.add_option(IndentedCodeClasses("cake".to_string()));
let path = PathBuf::new();
pandoc.add_option(Filter(path));
}
| Adjust test to new API | Adjust test to new API | Rust | apache-2.0 | oli-obk/rust-pandoc | rust | ## Code Before:
extern crate pandoc;
use std::path::PathBuf;
#[test]
fn creation() {
use pandoc::PandocOption::*;
use pandoc::OutputKind;
let mut pandoc = pandoc::new();
pandoc.add_input("cake");
pandoc.set_output(OutputKind::File(String::from("lie")));
pandoc.set_chapters();
pandoc.set_number_sections();
pandoc.set_latex_template("template.tex");
pandoc.set_output_format(pandoc::OutputFormat::Beamer);
pandoc.add_latex_path_hint("D:\\texlive\\2015\\bin\\win32");
pandoc.set_slide_level(3);
pandoc.set_toc();
pandoc.add_option(Strict);
pandoc.add_option(IndentedCodeClasses("cake".to_string()));
let path = PathBuf::new();
pandoc.add_option(Filter(path));
}
## Instruction:
Adjust test to new API
## Code After:
extern crate pandoc;
use std::path::PathBuf;
#[test]
fn creation() {
use pandoc::PandocOption::*;
use pandoc::OutputKind;
let mut pandoc = pandoc::new();
pandoc.add_input("cake");
pandoc.set_output(OutputKind::File(String::from("lie")));
pandoc.set_chapters();
pandoc.set_number_sections();
pandoc.set_latex_template("template.tex");
pandoc.set_output_format(pandoc::OutputFormat::Beamer, Vec::new());
pandoc.add_latex_path_hint("D:\\texlive\\2015\\bin\\win32");
pandoc.set_slide_level(3);
pandoc.set_toc();
pandoc.add_option(Strict);
pandoc.add_option(IndentedCodeClasses("cake".to_string()));
let path = PathBuf::new();
pandoc.add_option(Filter(path));
}
|
bb6d7a4edd7942ff772639a782a8d47dba9ce066 | lib/server/transport/http/middleware/checkContentType.js | lib/server/transport/http/middleware/checkContentType.js | "use strict";
function abortRequest(res) {
res.statusCode = 415;
res.end();
}
function checkContentType(acceptedTypes, encoding) {
var actualType,
acceptedType,
i, l;
for (i = 0, l = acceptedTypes.length; i < l; i++) {
acceptedTypes[i] = acceptedTypes[i].toLowerCase();
}
return function checkContentType(req, res, next) {
actualType = req.headers['content-type'];
if (req.method === 'POST' || req.method === 'PUT') {
actualType = actualType.toLowerCase();
if (encoding && actualType.search(encoding) === -1) {
abortRequest(res);
next(new Error("(alamid) Invalid request type: " + req.headers['content-type']));
return;
}
actualType = actualType.replace(/; *charset *=.*/gi, '');
for (i = 0, l = acceptedTypes.length; i < l; i++) {
acceptedType = acceptedTypes[i];
if (acceptedType === actualType) {
next();
return;
}
}
abortRequest(res);
next(new Error("(alamid) Invalid request type: " + req.headers['content-type']));
return;
}
next();
};
}
module.exports = checkContentType; | "use strict";
function abortRequest(res) {
res.statusCode = 415;
res.end();
}
function checkContentType(acceptedTypes, encoding) {
var actualType,
acceptedType,
i, l;
for (i = 0, l = acceptedTypes.length; i < l; i++) {
acceptedTypes[i] = acceptedTypes[i].toLowerCase();
}
return function checkContentType(req, res, next) {
actualType = req.headers["content-type"] || "";
if (req.method === "POST" || req.method === "PUT") {
actualType = actualType.toLowerCase();
if (encoding && actualType.search(encoding) === -1) {
abortRequest(res);
next(new Error("(alamid) Invalid request type: " + req.headers['content-type']));
return;
}
actualType = actualType.replace(/; *charset *=.*/gi, '');
for (i = 0, l = acceptedTypes.length; i < l; i++) {
acceptedType = acceptedTypes[i];
if (acceptedType === actualType) {
next();
return;
}
}
abortRequest(res);
next(new Error("(alamid) Invalid request type: " + req.headers["content-type"]));
return;
}
next();
};
}
module.exports = checkContentType; | Fix check for content type | Fix check for content type
| JavaScript | mit | peerigon/alamid,peerigon/alamid | javascript | ## Code Before:
"use strict";
function abortRequest(res) {
res.statusCode = 415;
res.end();
}
function checkContentType(acceptedTypes, encoding) {
var actualType,
acceptedType,
i, l;
for (i = 0, l = acceptedTypes.length; i < l; i++) {
acceptedTypes[i] = acceptedTypes[i].toLowerCase();
}
return function checkContentType(req, res, next) {
actualType = req.headers['content-type'];
if (req.method === 'POST' || req.method === 'PUT') {
actualType = actualType.toLowerCase();
if (encoding && actualType.search(encoding) === -1) {
abortRequest(res);
next(new Error("(alamid) Invalid request type: " + req.headers['content-type']));
return;
}
actualType = actualType.replace(/; *charset *=.*/gi, '');
for (i = 0, l = acceptedTypes.length; i < l; i++) {
acceptedType = acceptedTypes[i];
if (acceptedType === actualType) {
next();
return;
}
}
abortRequest(res);
next(new Error("(alamid) Invalid request type: " + req.headers['content-type']));
return;
}
next();
};
}
module.exports = checkContentType;
## Instruction:
Fix check for content type
## Code After:
"use strict";
function abortRequest(res) {
res.statusCode = 415;
res.end();
}
function checkContentType(acceptedTypes, encoding) {
var actualType,
acceptedType,
i, l;
for (i = 0, l = acceptedTypes.length; i < l; i++) {
acceptedTypes[i] = acceptedTypes[i].toLowerCase();
}
return function checkContentType(req, res, next) {
actualType = req.headers["content-type"] || "";
if (req.method === "POST" || req.method === "PUT") {
actualType = actualType.toLowerCase();
if (encoding && actualType.search(encoding) === -1) {
abortRequest(res);
next(new Error("(alamid) Invalid request type: " + req.headers['content-type']));
return;
}
actualType = actualType.replace(/; *charset *=.*/gi, '');
for (i = 0, l = acceptedTypes.length; i < l; i++) {
acceptedType = acceptedTypes[i];
if (acceptedType === actualType) {
next();
return;
}
}
abortRequest(res);
next(new Error("(alamid) Invalid request type: " + req.headers["content-type"]));
return;
}
next();
};
}
module.exports = checkContentType; |
8874f3cee689e61cacd34b02df7162c6414b0f96 | CHANGELOG.md | CHANGELOG.md | All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
-
## [1.4.0] - 2018-03-21
### Added
- Partial HTTP 2 support within `%H` and `%r`
### Modified
- Update supported PHP versions (PHP5.6+ only, no HHVM)
## [1.3.1] - 2017-06-25
### Added
- Tests for issue #30
### Fixed
- `%u` was not matching usernames with dots (issue #30)
## [1.3.0] - 2017-04-24
### Added
- Now we have a change log!
- `scheme` property (nginx-only): https://github.com/kassner/log-parser/pull/27
- `LogParser::createEntry` allowing overwrite the `\stdClass`: https://github.com/kassner/log-parser/pull/28/files
| All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
-
## [1.5.] - 2019-02-04
### Added
- PHP 7.3/PRCE2 support
## [1.4.0] - 2018-03-21
### Added
- Partial HTTP 2 support within `%H` and `%r`
### Modified
- Update supported PHP versions (PHP5.6+ only, no HHVM)
## [1.3.1] - 2017-06-25
### Added
- Tests for issue #30
### Fixed
- `%u` was not matching usernames with dots (issue #30)
## [1.3.0] - 2017-04-24
### Added
- Now we have a change log!
- `scheme` property (nginx-only): https://github.com/kassner/log-parser/pull/27
- `LogParser::createEntry` allowing overwrite the `\stdClass`: https://github.com/kassner/log-parser/pull/28/files
| Update changelog for 1.5.0 release | Update changelog for 1.5.0 release | Markdown | apache-2.0 | kassner/log-parser | markdown | ## Code Before:
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
-
## [1.4.0] - 2018-03-21
### Added
- Partial HTTP 2 support within `%H` and `%r`
### Modified
- Update supported PHP versions (PHP5.6+ only, no HHVM)
## [1.3.1] - 2017-06-25
### Added
- Tests for issue #30
### Fixed
- `%u` was not matching usernames with dots (issue #30)
## [1.3.0] - 2017-04-24
### Added
- Now we have a change log!
- `scheme` property (nginx-only): https://github.com/kassner/log-parser/pull/27
- `LogParser::createEntry` allowing overwrite the `\stdClass`: https://github.com/kassner/log-parser/pull/28/files
## Instruction:
Update changelog for 1.5.0 release
## Code After:
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
-
## [1.5.] - 2019-02-04
### Added
- PHP 7.3/PRCE2 support
## [1.4.0] - 2018-03-21
### Added
- Partial HTTP 2 support within `%H` and `%r`
### Modified
- Update supported PHP versions (PHP5.6+ only, no HHVM)
## [1.3.1] - 2017-06-25
### Added
- Tests for issue #30
### Fixed
- `%u` was not matching usernames with dots (issue #30)
## [1.3.0] - 2017-04-24
### Added
- Now we have a change log!
- `scheme` property (nginx-only): https://github.com/kassner/log-parser/pull/27
- `LogParser::createEntry` allowing overwrite the `\stdClass`: https://github.com/kassner/log-parser/pull/28/files
|
1dbafcbbeb77b3be3c00292f022a3526f3e60b75 | spec/first_letters_spec.rb | spec/first_letters_spec.rb | require 'spec_helper'
require_relative '../lib/abcing/first_letters'
describe ABCing::FirstLetters do
it 'collects 2 letters' do
matcher = ABCing::FirstLetters.new ['Bar', 'Foo']
expect(matcher.letters).to eq(['B', 'F'])
end
it 'Only collects unique letters' do
matcher = ABCing::FirstLetters.new(['Zoo', 'Zebra'])
expect(matcher.letters).to eq(['Z'])
end
it 'Orders letter results alphabetically' do
matcher = ABCing::FirstLetters.new(['Cobra', 'Acid', 'Bee'])
expect(matcher.letters).to eq(['A', 'B', 'C'])
end
end
| require 'spec_helper'
require_relative '../lib/abcing/first_letters'
describe ABCing::FirstLetters do
it 'collects 2 letters' do
matcher = ABCing::FirstLetters.new ['Bar', 'Foo']
expect(matcher.letters).to eq(['B', 'F'])
end
it 'Only collects unique letters' do
matcher = ABCing::FirstLetters.new(['Zoo', 'Zebra'])
expect(matcher.letters).to eq(['Z'])
end
it 'Orders letter results alphabetically' do
matcher = ABCing::FirstLetters.new(['Cobra', 'Acid', 'Bee'])
expect(matcher.letters).to eq(['A', 'B', 'C'])
end
it 'Returns an empty result' do
matcher = ABCing::FirstLetters.new([])
expect(matcher.letters).to eq([])
end
end
| Test edgecase where an empty result is returned for FirstLetters | Test edgecase where an empty result is returned for FirstLetters
| Ruby | mit | emileswarts/abcing | ruby | ## Code Before:
require 'spec_helper'
require_relative '../lib/abcing/first_letters'
describe ABCing::FirstLetters do
it 'collects 2 letters' do
matcher = ABCing::FirstLetters.new ['Bar', 'Foo']
expect(matcher.letters).to eq(['B', 'F'])
end
it 'Only collects unique letters' do
matcher = ABCing::FirstLetters.new(['Zoo', 'Zebra'])
expect(matcher.letters).to eq(['Z'])
end
it 'Orders letter results alphabetically' do
matcher = ABCing::FirstLetters.new(['Cobra', 'Acid', 'Bee'])
expect(matcher.letters).to eq(['A', 'B', 'C'])
end
end
## Instruction:
Test edgecase where an empty result is returned for FirstLetters
## Code After:
require 'spec_helper'
require_relative '../lib/abcing/first_letters'
describe ABCing::FirstLetters do
it 'collects 2 letters' do
matcher = ABCing::FirstLetters.new ['Bar', 'Foo']
expect(matcher.letters).to eq(['B', 'F'])
end
it 'Only collects unique letters' do
matcher = ABCing::FirstLetters.new(['Zoo', 'Zebra'])
expect(matcher.letters).to eq(['Z'])
end
it 'Orders letter results alphabetically' do
matcher = ABCing::FirstLetters.new(['Cobra', 'Acid', 'Bee'])
expect(matcher.letters).to eq(['A', 'B', 'C'])
end
it 'Returns an empty result' do
matcher = ABCing::FirstLetters.new([])
expect(matcher.letters).to eq([])
end
end
|
9f0f6e56d2ffb5e39453e90665cb7ba8bf233f5c | source/js/feature/logEditor/logEditorWordCount.js | source/js/feature/logEditor/logEditorWordCount.js | function runLogEditorWordCount(){
var common = LogEditorCommon.getInstance(),
previewDiv = $("div.mdd_editor_wrap textarea");
common.toolbar.append("<li id='geoachingUtilsWordCount'>Hallo<li/>");
previewDiv.on("input", function(e){
var currentText = $(e.currentTarget).val(),
currentWordCount = countWords(currentText);
$("#geoachingUtilsWordCount").text(currentWordCount);
});
// from http://stackoverflow.com/a/18679657/527718, but slightly improved
function countWords(s){
s = s.replace(/\n /, "\n"); // exclude newline with a start spacing
s = s.replace(/\n/g, " ") // replace newline with space
s = s.replace(/(^\s*)|(\s*$)/gi, "");//exclude start and end white-space
s = s.replace(/[ ]{2,}/gi, " ");//2 or more space to 1
return s.split(' ').length;
}
} | function runLogEditorWordCount(){
var common = LogEditorCommon.getInstance(),
previewDiv = $("div.mdd_editor_wrap textarea");
common.toolbar.append("<li id='geoachingUtilsWordCount'>Hallo<li/>");
previewDiv.on("input", function(e){
var currentText = $(e.currentTarget).val(),
currentWordCount = countWords(currentText);
$("#geoachingUtilsWordCount").text(currentWordCount);
});
// from http://stackoverflow.com/a/18679657/527718, but slightly improved
function countWords(s){
s = s.replace(/\n /, "\n"); // exclude newline with a start spacing
s = s.replace(/\n/g, " ") // replace newline with space
s = s.replace(/(^\s*)|(\s*$)/gi, ""); //exclude start and end white-space
s = s.replace(/[ ]{2,}/gi, " "); //2 or more space to 1
if(s===""){
return 0;
} else {
return s.split(" ").length;
}
}
} | Fix word count if the altered string ends up empty | Fix word count if the altered string ends up empty
| JavaScript | mpl-2.0 | ControlTheBit/geocachingUtils,ControlTheBit/geocachingUtils | javascript | ## Code Before:
function runLogEditorWordCount(){
var common = LogEditorCommon.getInstance(),
previewDiv = $("div.mdd_editor_wrap textarea");
common.toolbar.append("<li id='geoachingUtilsWordCount'>Hallo<li/>");
previewDiv.on("input", function(e){
var currentText = $(e.currentTarget).val(),
currentWordCount = countWords(currentText);
$("#geoachingUtilsWordCount").text(currentWordCount);
});
// from http://stackoverflow.com/a/18679657/527718, but slightly improved
function countWords(s){
s = s.replace(/\n /, "\n"); // exclude newline with a start spacing
s = s.replace(/\n/g, " ") // replace newline with space
s = s.replace(/(^\s*)|(\s*$)/gi, "");//exclude start and end white-space
s = s.replace(/[ ]{2,}/gi, " ");//2 or more space to 1
return s.split(' ').length;
}
}
## Instruction:
Fix word count if the altered string ends up empty
## Code After:
function runLogEditorWordCount(){
var common = LogEditorCommon.getInstance(),
previewDiv = $("div.mdd_editor_wrap textarea");
common.toolbar.append("<li id='geoachingUtilsWordCount'>Hallo<li/>");
previewDiv.on("input", function(e){
var currentText = $(e.currentTarget).val(),
currentWordCount = countWords(currentText);
$("#geoachingUtilsWordCount").text(currentWordCount);
});
// from http://stackoverflow.com/a/18679657/527718, but slightly improved
function countWords(s){
s = s.replace(/\n /, "\n"); // exclude newline with a start spacing
s = s.replace(/\n/g, " ") // replace newline with space
s = s.replace(/(^\s*)|(\s*$)/gi, ""); //exclude start and end white-space
s = s.replace(/[ ]{2,}/gi, " "); //2 or more space to 1
if(s===""){
return 0;
} else {
return s.split(" ").length;
}
}
} |
486cb9a7b451de300f6bc8d0672f06598aea2a54 | modules/serverless-deprecated-removed-features.adoc | modules/serverless-deprecated-removed-features.adoc | // Module included in the following assemblies:
//
// * serverless/serverless-release-notes.adoc
:_content-type: REFERENCE
[id="serverless-deprecated-removed-features_{context}"]
= Deprecated and removed features
Some features available in previous releases have been deprecated or removed.
Deprecated functionality is still included in {ServerlessProductName} and continues to be supported; however, it will be removed in a future release of this product and is not recommended for new deployments. For the most recent list of major functionality deprecated and removed within {ServerlessProductName}, refer to the table below.
In the table, features are marked with the following statuses:
* *-*: _Not yet available_
* *TP*: _Technology Preview_
* *GA*: _General Availability_
* *DEP*: _Deprecated_
* *REM*: _Removed_
.Deprecated and removed features tracker
[cols="3,1,1,1",options="header"]
|====
|Feature |1.18|1.19|1.20
|`kn func emit` (`kn func invoke` in 1.21+)
|TP
|TP
|TP
|mTLS
|GA
|GA
|GA
|`kn func` TypeScript templates
|TP
|TP
|TP
|`kn func` Rust templates
|TP
|TP
|TP
|`emptyDir` volumes
|GA
|GA
|GA
|`KafkaBinding` API
|GA
|DEP
|DEP
|HTTPS redirection
|-
|GA
|GA
|Kafka broker
|-
|-
|TP
|====
| // Module included in the following assemblies:
//
// * serverless/serverless-release-notes.adoc
:_content-type: REFERENCE
[id="serverless-deprecated-removed-features_{context}"]
= Deprecated and removed features
Some features available in previous releases have been deprecated or removed.
Deprecated functionality is still included in {ServerlessProductName} and continues to be supported; however, it will be removed in a future release of this product and is not recommended for new deployments. For the most recent list of major functionality deprecated and removed within {ServerlessProductName}, refer to the table below.
In the table, features are marked with the following statuses:
* *-*: _Not yet available_
* *TP*: _Technology Preview_
* *GA*: _General Availability_
* *DEP*: _Deprecated_
* *REM*: _Removed_
.Deprecated and removed features tracker
[cols="3,1,1,1",options="header"]
|====
|Feature |1.18|1.19|1.20
|`kn func emit` (`kn func invoke` in 1.21+)
|TP
|TP
|TP
|Service Mesh mTLS
|GA
|GA
|GA
|`kn func` TypeScript templates
|TP
|TP
|TP
|`kn func` Rust templates
|TP
|TP
|TP
|`emptyDir` volumes
|GA
|GA
|GA
|`KafkaBinding` API
|GA
|DEP
|DEP
|HTTPS redirection
|-
|GA
|GA
|Kafka broker
|-
|-
|TP
|====
| Fix the mTLS entry in the feature matrix | Fix the mTLS entry in the feature matrix
| AsciiDoc | apache-2.0 | vikram-redhat/openshift-docs,vikram-redhat/openshift-docs,vikram-redhat/openshift-docs,vikram-redhat/openshift-docs,vikram-redhat/openshift-docs | asciidoc | ## Code Before:
// Module included in the following assemblies:
//
// * serverless/serverless-release-notes.adoc
:_content-type: REFERENCE
[id="serverless-deprecated-removed-features_{context}"]
= Deprecated and removed features
Some features available in previous releases have been deprecated or removed.
Deprecated functionality is still included in {ServerlessProductName} and continues to be supported; however, it will be removed in a future release of this product and is not recommended for new deployments. For the most recent list of major functionality deprecated and removed within {ServerlessProductName}, refer to the table below.
In the table, features are marked with the following statuses:
* *-*: _Not yet available_
* *TP*: _Technology Preview_
* *GA*: _General Availability_
* *DEP*: _Deprecated_
* *REM*: _Removed_
.Deprecated and removed features tracker
[cols="3,1,1,1",options="header"]
|====
|Feature |1.18|1.19|1.20
|`kn func emit` (`kn func invoke` in 1.21+)
|TP
|TP
|TP
|mTLS
|GA
|GA
|GA
|`kn func` TypeScript templates
|TP
|TP
|TP
|`kn func` Rust templates
|TP
|TP
|TP
|`emptyDir` volumes
|GA
|GA
|GA
|`KafkaBinding` API
|GA
|DEP
|DEP
|HTTPS redirection
|-
|GA
|GA
|Kafka broker
|-
|-
|TP
|====
## Instruction:
Fix the mTLS entry in the feature matrix
## Code After:
// Module included in the following assemblies:
//
// * serverless/serverless-release-notes.adoc
:_content-type: REFERENCE
[id="serverless-deprecated-removed-features_{context}"]
= Deprecated and removed features
Some features available in previous releases have been deprecated or removed.
Deprecated functionality is still included in {ServerlessProductName} and continues to be supported; however, it will be removed in a future release of this product and is not recommended for new deployments. For the most recent list of major functionality deprecated and removed within {ServerlessProductName}, refer to the table below.
In the table, features are marked with the following statuses:
* *-*: _Not yet available_
* *TP*: _Technology Preview_
* *GA*: _General Availability_
* *DEP*: _Deprecated_
* *REM*: _Removed_
.Deprecated and removed features tracker
[cols="3,1,1,1",options="header"]
|====
|Feature |1.18|1.19|1.20
|`kn func emit` (`kn func invoke` in 1.21+)
|TP
|TP
|TP
|Service Mesh mTLS
|GA
|GA
|GA
|`kn func` TypeScript templates
|TP
|TP
|TP
|`kn func` Rust templates
|TP
|TP
|TP
|`emptyDir` volumes
|GA
|GA
|GA
|`KafkaBinding` API
|GA
|DEP
|DEP
|HTTPS redirection
|-
|GA
|GA
|Kafka broker
|-
|-
|TP
|====
|
44df0682b368c7ce9562536f176fefbcf0f068dd | process_barcode.php | process_barcode.php | <?php
function processBarcode($barcode) {
} | <?php
define('BARCODE_ENDPOINT', 'http://library2.udayton.edu/ray/ohss/barcode_search.php?barcode=%s');
function processBarcode($barcode) {
if (preg_match('/^[A-Z][0-9]+$/', $barcode)) {
$result = file_get_contents(sprintf(BARCODE_ENDPOINT, $barcode));
if ($result) {
return json_decode($result, true);
}
}
return false;
}
| Add function body for processBarcode. | Add function body for processBarcode.
| PHP | mit | AndrewSWA/OHSS | php | ## Code Before:
<?php
function processBarcode($barcode) {
}
## Instruction:
Add function body for processBarcode.
## Code After:
<?php
define('BARCODE_ENDPOINT', 'http://library2.udayton.edu/ray/ohss/barcode_search.php?barcode=%s');
function processBarcode($barcode) {
if (preg_match('/^[A-Z][0-9]+$/', $barcode)) {
$result = file_get_contents(sprintf(BARCODE_ENDPOINT, $barcode));
if ($result) {
return json_decode($result, true);
}
}
return false;
}
|
5110ad60400703d11dedc37096f9112050d765c5 | laravel/mvc-basics/step-by-step/04_run_the_database_migration.sh | laravel/mvc-basics/step-by-step/04_run_the_database_migration.sh | cd ~/Sites/presentation/mvc-basics
# You can review the migrations before they've run using the following command
php artisan migrate:status
# Use artisan to run your database migrations
php artisan migrate
# You can review the migrations after they've run using the following command
php artisan migrate:status
# You can now use Sequel Pro (Mac) or your favorite SQL editor to refresh the
# mvc_basics database and see the newly created `event_tickets` table.
| cd ~/Sites/presentation/mvc-basics
# You can review the migrations before they've run using the following command
php artisan migrate:install
php artisan migrate:status
# Use artisan to run your database migrations
php artisan migrate
# You can review the migrations after they've run using the following command
php artisan migrate:status
# You can now use Sequel Pro (Mac) or your favorite SQL editor to refresh the
# mvc_basics database and see the newly created `event_tickets` table.
| Update laravel/mvc-basics/step-by-step/04 to perform migrate install first | Update laravel/mvc-basics/step-by-step/04 to perform migrate install first
| Shell | mit | jeffersonmartin/code-examples,jeffersonmartin/code-examples,jeffersonmartin/code-examples,jeffersonmartin/code-examples | shell | ## Code Before:
cd ~/Sites/presentation/mvc-basics
# You can review the migrations before they've run using the following command
php artisan migrate:status
# Use artisan to run your database migrations
php artisan migrate
# You can review the migrations after they've run using the following command
php artisan migrate:status
# You can now use Sequel Pro (Mac) or your favorite SQL editor to refresh the
# mvc_basics database and see the newly created `event_tickets` table.
## Instruction:
Update laravel/mvc-basics/step-by-step/04 to perform migrate install first
## Code After:
cd ~/Sites/presentation/mvc-basics
# You can review the migrations before they've run using the following command
php artisan migrate:install
php artisan migrate:status
# Use artisan to run your database migrations
php artisan migrate
# You can review the migrations after they've run using the following command
php artisan migrate:status
# You can now use Sequel Pro (Mac) or your favorite SQL editor to refresh the
# mvc_basics database and see the newly created `event_tickets` table.
|
10a5c2de2241ad8b0e524dbb95f1c2eb26254693 | .travis/install-dependencies/r-install-dependencies.sh | .travis/install-dependencies/r-install-dependencies.sh |
echo 'R install'
(
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E084DAB9
echo 'deb http://cran.rstudio.com/bin/linux/ubuntu trusty/' | sudo tee -a /etc/apt/sources.list
sudo apt-get update && sudo apt-get install r-base r-base-dev -y
sudo Rscript -e "install.packages('optparse', repos='http://cran.rstudio.org')"
sudo Rscript -e "install.packages('seqinr', repos='http://cran.rstudio.org')"
) > /dev/null 2>&1
|
echo 'R install'
(
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E084DAB9
echo 'deb http://cran.rstudio.com/bin/linux/ubuntu trusty/' | sudo tee -a /etc/apt/sources.list
sudo apt-get update && sudo apt-get install r-base r-base-dev -y
sudo Rscript -e "install.packages('optparse', repos='http://cran.rstudio.org')"
cd r
sudo R CMD INSTALL biotool
) > /dev/null 2>&1
| Add install R package to travis install dependencies | Add install R package to travis install dependencies
| Shell | mit | lonsbio/biotool,drpowell/biotool,lonsbio/biotool,drpowell/biotool,biotool-paper/biotool,lonsbio/biotool,biotool-paper/biotool,drpowell/biotool,drpowell/biotool,drpowell/biotool,biotool-paper/biotool,drpowell/biotool,drpowell/biotool,biotool-paper/biotool,biotool-paper/biotool,lonsbio/biotool,biotool-paper/biotool,drpowell/biotool,biotool-paper/biotool,biotool-paper/biotool,bionitio-team/bionitio,biotool-paper/biotool,drpowell/biotool,drpowell/biotool,biotool-paper/biotool | shell | ## Code Before:
echo 'R install'
(
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E084DAB9
echo 'deb http://cran.rstudio.com/bin/linux/ubuntu trusty/' | sudo tee -a /etc/apt/sources.list
sudo apt-get update && sudo apt-get install r-base r-base-dev -y
sudo Rscript -e "install.packages('optparse', repos='http://cran.rstudio.org')"
sudo Rscript -e "install.packages('seqinr', repos='http://cran.rstudio.org')"
) > /dev/null 2>&1
## Instruction:
Add install R package to travis install dependencies
## Code After:
echo 'R install'
(
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E084DAB9
echo 'deb http://cran.rstudio.com/bin/linux/ubuntu trusty/' | sudo tee -a /etc/apt/sources.list
sudo apt-get update && sudo apt-get install r-base r-base-dev -y
sudo Rscript -e "install.packages('optparse', repos='http://cran.rstudio.org')"
cd r
sudo R CMD INSTALL biotool
) > /dev/null 2>&1
|
7f3314d58bb457a3742d6ab1b0336d13450ddffa | prepare.rb | prepare.rb |
require "eregex"
require "fileutils"
version = "200"
prepared_dir = "../Tiles_#{version}"
FileUtils.rm_r("#{prepared_dir}", :verbose => true)
FileUtils.cp_r("./", "#{prepared_dir}", :verbose => true)
FileUtils.rm_r(Dir.glob("#{prepared_dir}/**/*.{psd}"), :verbose => true)
FileUtils.rm(Dir.glob("#{prepared_dir}/**/.DS_Store"), :verbose => true)
FileUtils.rm_r(["#{prepared_dir}/.git", "#{prepared_dir}/promos", "#{prepared_dir}/.gitignore", "#{prepared_dir}/prepare.rb", "#{prepared_dir}/tests"], :verbose => true)
Dir.glob("#{prepared_dir}/**/*.{js}").each do |file|
new_name = File.dirname(file) + "/" + File.basename(file, ".js") + "_" + version + ".js"
File.rename(file, new_name)
end
match = Regexp.escape("\\.js")
replace = Regexp.escape("_#{version}.js")
exec("find #{prepared_dir} -type f -name '*.html' -exec sed -i '' s/#{match}/#{replace}/g {} +") |
require "eregex"
require "fileutils"
version = "200"
prepared_dir = "../Tiles_#{version}"
FileUtils.rm_r("#{prepared_dir}", :verbose => true)
FileUtils.cp_r("./", "#{prepared_dir}", :verbose => true)
FileUtils.rm_r(Dir.glob("#{prepared_dir}/**/*.{psd}"), :verbose => true)
FileUtils.rm(Dir.glob("#{prepared_dir}/**/.DS_Store"), :verbose => true)
FileUtils.rm_r(["#{prepared_dir}/.git", "#{prepared_dir}/promos", "#{prepared_dir}/.gitignore", "#{prepared_dir}/prepare.rb", "#{prepared_dir}/tests"], :verbose => true)
Dir.glob("#{prepared_dir}/**/*.{js}").each do |file|
new_name = File.dirname(file) + "/" + File.basename(file, ".js") + "_" + version + ".js"
File.rename(file, new_name)
end
match = Regexp.escape("\\.js")
replace = Regexp.escape("_#{version}.js")
exec("find -E #{prepared_dir} -type f -iregex '.*\.(html|json)' -exec sed -i '' s/#{match}/#{replace}/g {} +") | Replace JavaScript references in HTML and JSON files. | Replace JavaScript references in HTML and JSON files.
| Ruby | mit | AntarcticApps/Tiles,AntarcticApps/Tiles | ruby | ## Code Before:
require "eregex"
require "fileutils"
version = "200"
prepared_dir = "../Tiles_#{version}"
FileUtils.rm_r("#{prepared_dir}", :verbose => true)
FileUtils.cp_r("./", "#{prepared_dir}", :verbose => true)
FileUtils.rm_r(Dir.glob("#{prepared_dir}/**/*.{psd}"), :verbose => true)
FileUtils.rm(Dir.glob("#{prepared_dir}/**/.DS_Store"), :verbose => true)
FileUtils.rm_r(["#{prepared_dir}/.git", "#{prepared_dir}/promos", "#{prepared_dir}/.gitignore", "#{prepared_dir}/prepare.rb", "#{prepared_dir}/tests"], :verbose => true)
Dir.glob("#{prepared_dir}/**/*.{js}").each do |file|
new_name = File.dirname(file) + "/" + File.basename(file, ".js") + "_" + version + ".js"
File.rename(file, new_name)
end
match = Regexp.escape("\\.js")
replace = Regexp.escape("_#{version}.js")
exec("find #{prepared_dir} -type f -name '*.html' -exec sed -i '' s/#{match}/#{replace}/g {} +")
## Instruction:
Replace JavaScript references in HTML and JSON files.
## Code After:
require "eregex"
require "fileutils"
version = "200"
prepared_dir = "../Tiles_#{version}"
FileUtils.rm_r("#{prepared_dir}", :verbose => true)
FileUtils.cp_r("./", "#{prepared_dir}", :verbose => true)
FileUtils.rm_r(Dir.glob("#{prepared_dir}/**/*.{psd}"), :verbose => true)
FileUtils.rm(Dir.glob("#{prepared_dir}/**/.DS_Store"), :verbose => true)
FileUtils.rm_r(["#{prepared_dir}/.git", "#{prepared_dir}/promos", "#{prepared_dir}/.gitignore", "#{prepared_dir}/prepare.rb", "#{prepared_dir}/tests"], :verbose => true)
Dir.glob("#{prepared_dir}/**/*.{js}").each do |file|
new_name = File.dirname(file) + "/" + File.basename(file, ".js") + "_" + version + ".js"
File.rename(file, new_name)
end
match = Regexp.escape("\\.js")
replace = Regexp.escape("_#{version}.js")
exec("find -E #{prepared_dir} -type f -iregex '.*\.(html|json)' -exec sed -i '' s/#{match}/#{replace}/g {} +") |
8cac33e893a87a72b3e30ef82b522de23884a3af | README.md | README.md |
![Unzip Extension for iOS 8](demo.gif)
This was going to become a real product until I found out that [iOS 7 added native support for ZIP files](http://www.macworld.com/article/2049370/ios-7-adds-support-for-zipped-attachments-in-mail-messages-with-quick-look.html). Nonetheless, it's a good example of how action extensions can be used to not only extend the functionality of standalone apps, but to extend the functionality of the OS as well.
### Getting Started
Requires [CocoaPods](http://cocoapods.org) to manage dependencies.
```
$ cd Unzip
$ pod install
```
Open **Unzip.xcworkspace**. The **Unzip** app itself doesn't contain anything, everything is implemented in **UnzipAction**.
### Contact
* Indragie Karunaratne
* [@indragie](http://twitter.com/indragie)
* [http://indragie.com](http://indragie.com)
### License
Unzip is licensed under the MIT License. |
![Unzip Extension for iOS 8](demo.gif)
This was going to become a real product until I found out that [iOS 7 added native support for ZIP files](http://www.macworld.com/article/2049370/ios-7-adds-support-for-zipped-attachments-in-mail-messages-with-quick-look.html). Nonetheless, it's a good example of how action extensions can be used to not only extend the functionality of standalone apps, but to extend the functionality of the OS as well.
### Getting Started
Requires [CocoaPods](http://cocoapods.org) to manage dependencies.
```
$ cd Unzip
$ pod install
```
Open **Unzip.xcworkspace**. The **Unzip** app itself doesn't contain anything, everything is implemented in **UnzipAction**.
### Icons
The icons shown in the image above are from the [Glyphish 8](http://www.glyphish.com) icon set. They could not be included in this repository due to license incompatibility.
### Contact
* Indragie Karunaratne
* [@indragie](http://twitter.com/indragie)
* [http://indragie.com](http://indragie.com)
### License
Unzip is licensed under the MIT License. | Add a note about the icons | Add a note about the icons
| Markdown | mit | indragiek/Unzip | markdown | ## Code Before:
![Unzip Extension for iOS 8](demo.gif)
This was going to become a real product until I found out that [iOS 7 added native support for ZIP files](http://www.macworld.com/article/2049370/ios-7-adds-support-for-zipped-attachments-in-mail-messages-with-quick-look.html). Nonetheless, it's a good example of how action extensions can be used to not only extend the functionality of standalone apps, but to extend the functionality of the OS as well.
### Getting Started
Requires [CocoaPods](http://cocoapods.org) to manage dependencies.
```
$ cd Unzip
$ pod install
```
Open **Unzip.xcworkspace**. The **Unzip** app itself doesn't contain anything, everything is implemented in **UnzipAction**.
### Contact
* Indragie Karunaratne
* [@indragie](http://twitter.com/indragie)
* [http://indragie.com](http://indragie.com)
### License
Unzip is licensed under the MIT License.
## Instruction:
Add a note about the icons
## Code After:
![Unzip Extension for iOS 8](demo.gif)
This was going to become a real product until I found out that [iOS 7 added native support for ZIP files](http://www.macworld.com/article/2049370/ios-7-adds-support-for-zipped-attachments-in-mail-messages-with-quick-look.html). Nonetheless, it's a good example of how action extensions can be used to not only extend the functionality of standalone apps, but to extend the functionality of the OS as well.
### Getting Started
Requires [CocoaPods](http://cocoapods.org) to manage dependencies.
```
$ cd Unzip
$ pod install
```
Open **Unzip.xcworkspace**. The **Unzip** app itself doesn't contain anything, everything is implemented in **UnzipAction**.
### Icons
The icons shown in the image above are from the [Glyphish 8](http://www.glyphish.com) icon set. They could not be included in this repository due to license incompatibility.
### Contact
* Indragie Karunaratne
* [@indragie](http://twitter.com/indragie)
* [http://indragie.com](http://indragie.com)
### License
Unzip is licensed under the MIT License. |
0f88370195bd68d45fdaa30b7c108018bde04e96 | lib/ar_transaction_changes.rb | lib/ar_transaction_changes.rb | require "ar_transaction_changes/version"
module ArTransactionChanges
if (ActiveRecord::VERSION::MAJOR == 4 && ActiveRecord::VERSION::MINOR >= 2) || ActiveRecord::VERSION::MAJOR > 4
def _run_create_callbacks
ret = super
store_transaction_changed_attributes if ret != false
ret
end
def _run_update_callbacks
ret = super
store_transaction_changed_attributes if ret != false
ret
end
def _run_commit_callbacks
super
ensure
@transaction_changed_attributes = nil
end
def _run_rollback_callbacks
super
ensure
@transaction_changed_attributes = nil
end
else
def run_callbacks(kind, *args)
ret = super
case kind.to_sym
when :create, :update
store_transaction_changed_attributes if ret != false
when :commit, :rollback
@transaction_changed_attributes = nil
end
ret
end
end
def transaction_changed_attributes
changed_attributes.merge(@transaction_changed_attributes || {})
end
private
def store_transaction_changed_attributes
@transaction_changed_attributes = transaction_changed_attributes
end
end
| require "ar_transaction_changes/version"
module ArTransactionChanges
if ActiveRecord::VERSION::MAJOR == 4 && ActiveRecord::VERSION::MINOR == 2 && ActiveRecord::VERSION::TINY != 3
def _run_create_callbacks
ret = super
store_transaction_changed_attributes if ret != false
ret
end
def _run_update_callbacks
ret = super
store_transaction_changed_attributes if ret != false
ret
end
def _run_commit_callbacks
super
ensure
@transaction_changed_attributes = nil
end
def _run_rollback_callbacks
super
ensure
@transaction_changed_attributes = nil
end
else
def run_callbacks(kind, *args)
ret = super
case kind.to_sym
when :create, :update
store_transaction_changed_attributes if ret != false
when :commit, :rollback
@transaction_changed_attributes = nil
end
ret
end
end
def transaction_changed_attributes
changed_attributes.merge(@transaction_changed_attributes || {})
end
private
def store_transaction_changed_attributes
@transaction_changed_attributes = transaction_changed_attributes
end
end
| Fix compatibility with rails 4.2.3 | Fix compatibility with rails 4.2.3
| Ruby | mit | dylanahsmith/ar_transaction_changes | ruby | ## Code Before:
require "ar_transaction_changes/version"
module ArTransactionChanges
if (ActiveRecord::VERSION::MAJOR == 4 && ActiveRecord::VERSION::MINOR >= 2) || ActiveRecord::VERSION::MAJOR > 4
def _run_create_callbacks
ret = super
store_transaction_changed_attributes if ret != false
ret
end
def _run_update_callbacks
ret = super
store_transaction_changed_attributes if ret != false
ret
end
def _run_commit_callbacks
super
ensure
@transaction_changed_attributes = nil
end
def _run_rollback_callbacks
super
ensure
@transaction_changed_attributes = nil
end
else
def run_callbacks(kind, *args)
ret = super
case kind.to_sym
when :create, :update
store_transaction_changed_attributes if ret != false
when :commit, :rollback
@transaction_changed_attributes = nil
end
ret
end
end
def transaction_changed_attributes
changed_attributes.merge(@transaction_changed_attributes || {})
end
private
def store_transaction_changed_attributes
@transaction_changed_attributes = transaction_changed_attributes
end
end
## Instruction:
Fix compatibility with rails 4.2.3
## Code After:
require "ar_transaction_changes/version"
module ArTransactionChanges
if ActiveRecord::VERSION::MAJOR == 4 && ActiveRecord::VERSION::MINOR == 2 && ActiveRecord::VERSION::TINY != 3
def _run_create_callbacks
ret = super
store_transaction_changed_attributes if ret != false
ret
end
def _run_update_callbacks
ret = super
store_transaction_changed_attributes if ret != false
ret
end
def _run_commit_callbacks
super
ensure
@transaction_changed_attributes = nil
end
def _run_rollback_callbacks
super
ensure
@transaction_changed_attributes = nil
end
else
def run_callbacks(kind, *args)
ret = super
case kind.to_sym
when :create, :update
store_transaction_changed_attributes if ret != false
when :commit, :rollback
@transaction_changed_attributes = nil
end
ret
end
end
def transaction_changed_attributes
changed_attributes.merge(@transaction_changed_attributes || {})
end
private
def store_transaction_changed_attributes
@transaction_changed_attributes = transaction_changed_attributes
end
end
|
b117902c174ab0ee21150163d00d3d23ddb7b29d | tests/draft4/pattern.json | tests/draft4/pattern.json | [
{
"description": "pattern validation",
"schema": {"pattern": "^a*$"},
"tests": [
{
"description": "a matching pattern is valid",
"data": "aaa",
"valid": true
},
{
"description": "a non-matching pattern is invalid",
"data": "abc",
"valid": false
},
{
"description": "ignores non-strings",
"data": true,
"valid": true
}
]
}
]
| [
{
"description": "pattern validation",
"schema": {"pattern": "^a*$"},
"tests": [
{
"description": "a matching pattern is valid",
"data": "aaa",
"valid": true
},
{
"description": "a non-matching pattern is invalid",
"data": "abc",
"valid": false
},
{
"description": "ignores non-strings",
"data": true,
"valid": true
}
]
},
{
"description": "pattern is not anchored",
"schema": {"pattern": "a+"},
"tests": [
{
"description": "matches a substring",
"data": "xxaayy",
"valid": true
}
]
}
]
| Add a test that checks for implicit anchoring | Add a test that checks for implicit anchoring | JSON | mit | neomadara/JSON-Schema-Test-Suite,epoberezkin/JSON-Schema-Test-Suite,Relequestual/JSON-Schema-Test-Suite,atomiqio/json-schema-test-suite,moander/JSON-Schema-Test-Suite,atomiqio/json-schema-test-suite,json-schema-org/JSON-Schema-Test-Suite,WHenderson/ex-json-schema,epoberezkin/JSON-Schema-Test-Suite,WHenderson/ex-json-schema,json-schema/JSON-Schema-Test-Suite | json | ## Code Before:
[
{
"description": "pattern validation",
"schema": {"pattern": "^a*$"},
"tests": [
{
"description": "a matching pattern is valid",
"data": "aaa",
"valid": true
},
{
"description": "a non-matching pattern is invalid",
"data": "abc",
"valid": false
},
{
"description": "ignores non-strings",
"data": true,
"valid": true
}
]
}
]
## Instruction:
Add a test that checks for implicit anchoring
## Code After:
[
{
"description": "pattern validation",
"schema": {"pattern": "^a*$"},
"tests": [
{
"description": "a matching pattern is valid",
"data": "aaa",
"valid": true
},
{
"description": "a non-matching pattern is invalid",
"data": "abc",
"valid": false
},
{
"description": "ignores non-strings",
"data": true,
"valid": true
}
]
},
{
"description": "pattern is not anchored",
"schema": {"pattern": "a+"},
"tests": [
{
"description": "matches a substring",
"data": "xxaayy",
"valid": true
}
]
}
]
|
fc3bcf708ca9882877c670792f93ca2d1c6cd69c | rocketmq-example/src/main/java/com/alibaba/rocketmq/example/verify/SelectPartition.java | rocketmq-example/src/main/java/com/alibaba/rocketmq/example/verify/SelectPartition.java | package com.alibaba.rocketmq.example.verify;
import com.alibaba.rocketmq.common.UtilAll;
import org.apache.commons.cli.*;
public class SelectPartition {
public static void main(String[] args) throws ParseException {
Options options = new Options();
Option option = new Option("p", "path", true, "Paths in CSV");
options.addOption(option);
CommandLineParser parser = new DefaultParser();
CommandLine commandLine = parser.parse(options, args);
if (!commandLine.hasOption('p')) {
HelpFormatter helpFormatter = new HelpFormatter();
helpFormatter.printHelp("Select Partition", options);
return;
}
String pathCSV = commandLine.getOptionValue("p");
UtilAll.selectPath(pathCSV);
UtilAll.getDiskPartitionSpaceUsedPercent(pathCSV);
}
}
| package com.alibaba.rocketmq.example.verify;
import com.alibaba.rocketmq.common.UtilAll;
import org.apache.commons.cli.*;
public class SelectPartition {
public static void main(String[] args) throws ParseException {
Options options = new Options();
Option option = new Option("p", "path", true, "Paths in CSV");
options.addOption(option);
CommandLineParser parser = new DefaultParser();
CommandLine commandLine = parser.parse(options, args);
if (!commandLine.hasOption('p')) {
HelpFormatter helpFormatter = new HelpFormatter();
helpFormatter.printHelp("Select Partition", options);
return;
}
String pathCSV = commandLine.getOptionValue("p");
UtilAll.selectPath(pathCSV);
double ratio = UtilAll.getDiskPartitionSpaceUsedPercent(pathCSV);
System.out.println(ratio);
}
}
| Add test to show disk usage ratio per partition. | Add test to show disk usage ratio per partition.
| Java | apache-2.0 | lizhanhui/Alibaba_RocketMQ,lizhanhui/Alibaba_RocketMQ,lizhanhui/Alibaba_RocketMQ | java | ## Code Before:
package com.alibaba.rocketmq.example.verify;
import com.alibaba.rocketmq.common.UtilAll;
import org.apache.commons.cli.*;
public class SelectPartition {
public static void main(String[] args) throws ParseException {
Options options = new Options();
Option option = new Option("p", "path", true, "Paths in CSV");
options.addOption(option);
CommandLineParser parser = new DefaultParser();
CommandLine commandLine = parser.parse(options, args);
if (!commandLine.hasOption('p')) {
HelpFormatter helpFormatter = new HelpFormatter();
helpFormatter.printHelp("Select Partition", options);
return;
}
String pathCSV = commandLine.getOptionValue("p");
UtilAll.selectPath(pathCSV);
UtilAll.getDiskPartitionSpaceUsedPercent(pathCSV);
}
}
## Instruction:
Add test to show disk usage ratio per partition.
## Code After:
package com.alibaba.rocketmq.example.verify;
import com.alibaba.rocketmq.common.UtilAll;
import org.apache.commons.cli.*;
public class SelectPartition {
public static void main(String[] args) throws ParseException {
Options options = new Options();
Option option = new Option("p", "path", true, "Paths in CSV");
options.addOption(option);
CommandLineParser parser = new DefaultParser();
CommandLine commandLine = parser.parse(options, args);
if (!commandLine.hasOption('p')) {
HelpFormatter helpFormatter = new HelpFormatter();
helpFormatter.printHelp("Select Partition", options);
return;
}
String pathCSV = commandLine.getOptionValue("p");
UtilAll.selectPath(pathCSV);
double ratio = UtilAll.getDiskPartitionSpaceUsedPercent(pathCSV);
System.out.println(ratio);
}
}
|
b7d22e096ceb462a6b71f9ae99bbbf01d96c102a | install.html | install.html | <html>
<body>
<p>Farsi Flash Cards Installation Page</p>
<script>
// This URL must be a full url.
var manifestUrl = 'http://thomshutt.github.io/farsi-flash-cards/manifest.webapp';
var req = navigator.mozApps.installPackage(manifestUrl);
req.onsuccess = function() {
alert("App Installed!");
};
req.onerror = function() {
alert("Whoops, something went wrong!");
};
</script>
</body>
</html>
| <html>
<body>
<p>Farsi Flash Cards Installation Page</p>
<p id="error_msg"></p>
<script>
// This URL must be a full url.
var manifestUrl = 'http://thomshutt.github.io/farsi-flash-cards/manifest.webapp';
var req = navigator.mozApps.installPackage(manifestUrl);
req.onsuccess = function() {
alert("App Installed!");
};
req.onerror = function() {
var node = document.getElementById('error_msg');
node.innerHTML("Error: " + this.error.name);
alert("Whoops, something went wrong!");
};
</script>
</body>
</html>
| Write out actual error message to document | Write out actual error message to document | HTML | apache-2.0 | thomshutt/farsi-flash-cards,thomshutt/farsi-flash-cards,thomshutt/farsi-flash-cards | html | ## Code Before:
<html>
<body>
<p>Farsi Flash Cards Installation Page</p>
<script>
// This URL must be a full url.
var manifestUrl = 'http://thomshutt.github.io/farsi-flash-cards/manifest.webapp';
var req = navigator.mozApps.installPackage(manifestUrl);
req.onsuccess = function() {
alert("App Installed!");
};
req.onerror = function() {
alert("Whoops, something went wrong!");
};
</script>
</body>
</html>
## Instruction:
Write out actual error message to document
## Code After:
<html>
<body>
<p>Farsi Flash Cards Installation Page</p>
<p id="error_msg"></p>
<script>
// This URL must be a full url.
var manifestUrl = 'http://thomshutt.github.io/farsi-flash-cards/manifest.webapp';
var req = navigator.mozApps.installPackage(manifestUrl);
req.onsuccess = function() {
alert("App Installed!");
};
req.onerror = function() {
var node = document.getElementById('error_msg');
node.innerHTML("Error: " + this.error.name);
alert("Whoops, something went wrong!");
};
</script>
</body>
</html>
|
d9130541f3e1d53422a9cb89a8829e178e41398b | app/views/users/show.html.erb | app/views/users/show.html.erb | <p id='us_name'><%= @user.name %></p>
<div class="user_show">
<ul>
<li><%= image_tag @user.avatar, :id => 'us_avatar' %></li>
<li class='user_info'><%= @user.age %></li>
<li class='user_info'><%= @user.location %></li>
</ul>
</div>
<p class='us_title'>Questions</p>
<div class="user_show">
<% @user.questions.each do |question| %>
<ul>
<li><%= question.title %></li>
<li><%= question.content %></li>
</ul>
<%end%>
</div>
<p class='us_title'>Answers</p>
<div class="user_show">
<% @user.answers.each do |answer| %>
<ul>
<li><%= answer.content %></li>
</ul>
<%end%>
</div>
<% if session[:user_id] == @user.id %>
<%= link_to "Edit my profile", edit_user_path %>
<%= link_to "Delete my profile", @user, method: :delete, data: {confirm: "Are you sure?"} %>
<% end %>
| <p id='us_name'><%= @user.name %></p>
<div class="user_show">
<ul>
<li><%= image_tag @user.avatar, :id => 'us_avatar' %></li>
<li class='user_info'><%= @user.age %></li>
<li class='user_info'><%= @user.location %></li>
</ul>
</div>
<p class='us_title'>Questions</p>
<div class="user_show">
<% @user.questions.each do |question| %>
<ul>
<li><%= link_to "#{question.title}", question_path(question.id) %></li>
<li><%= question.content %></li>
</ul>
<%end%>
</div>
<p class='us_title'>Answers</p>
<div class="user_show">
<% @user.answers.each do |answer| %>
<ul>
<li><%= link_to "#{answer.content}", question_path(answer.question_id) %></li>
</ul>
<%end%>
</div>
<% if session[:user_id] == @user.id %>
<%= link_to "Edit my profile", edit_user_path %>
<%= link_to "Delete my profile", @user, method: :delete, data: {confirm: "Are you sure?"} %>
<% end %>
| Put question and answer links on user_index page | Put question and answer links on user_index page
| HTML+ERB | mit | kevalwell/StackOverflow,kevalwell/StackOverflow,kevalwell/StackOverflow | html+erb | ## Code Before:
<p id='us_name'><%= @user.name %></p>
<div class="user_show">
<ul>
<li><%= image_tag @user.avatar, :id => 'us_avatar' %></li>
<li class='user_info'><%= @user.age %></li>
<li class='user_info'><%= @user.location %></li>
</ul>
</div>
<p class='us_title'>Questions</p>
<div class="user_show">
<% @user.questions.each do |question| %>
<ul>
<li><%= question.title %></li>
<li><%= question.content %></li>
</ul>
<%end%>
</div>
<p class='us_title'>Answers</p>
<div class="user_show">
<% @user.answers.each do |answer| %>
<ul>
<li><%= answer.content %></li>
</ul>
<%end%>
</div>
<% if session[:user_id] == @user.id %>
<%= link_to "Edit my profile", edit_user_path %>
<%= link_to "Delete my profile", @user, method: :delete, data: {confirm: "Are you sure?"} %>
<% end %>
## Instruction:
Put question and answer links on user_index page
## Code After:
<p id='us_name'><%= @user.name %></p>
<div class="user_show">
<ul>
<li><%= image_tag @user.avatar, :id => 'us_avatar' %></li>
<li class='user_info'><%= @user.age %></li>
<li class='user_info'><%= @user.location %></li>
</ul>
</div>
<p class='us_title'>Questions</p>
<div class="user_show">
<% @user.questions.each do |question| %>
<ul>
<li><%= link_to "#{question.title}", question_path(question.id) %></li>
<li><%= question.content %></li>
</ul>
<%end%>
</div>
<p class='us_title'>Answers</p>
<div class="user_show">
<% @user.answers.each do |answer| %>
<ul>
<li><%= link_to "#{answer.content}", question_path(answer.question_id) %></li>
</ul>
<%end%>
</div>
<% if session[:user_id] == @user.id %>
<%= link_to "Edit my profile", edit_user_path %>
<%= link_to "Delete my profile", @user, method: :delete, data: {confirm: "Are you sure?"} %>
<% end %>
|
92cb3dabae59087046862e623f56421b65c97161 | app/controllers/travel_advice_controller.rb | app/controllers/travel_advice_controller.rb | class TravelAdviceController < ApplicationController
before_filter :set_expiry
def country
@country = params[:slug].dup
@publication = fetch_artefact_for_country(@country)
part = params.fetch(:part) { @publication.parts.first.slug }
@part = @publication.find_part(part)
unless @part
redirect_to travel_advice_country_path(@country) and return
end
respond_to do |format|
format.html { render "country" }
end
rescue RecordNotFound
set_expiry(10.minutes)
error 404
end
private
def fetch_artefact_for_country(country)
params[:slug] = "travel-advice/" + params[:slug]
@artefact = fetch_artefact
@publication = PublicationPresenter.new(@artefact)
raise RecordNotFound unless @publication
return @publication
end
end
| class TravelAdviceController < ApplicationController
before_filter :set_expiry
def country
@country = params[:slug].dup
@publication, @artefact = fetch_artefact_and_publication_for_country(@country)
part = params.fetch(:part) { @publication.parts.first.slug }
@part = @publication.find_part(part)
unless @part
redirect_to travel_advice_country_path(@country) and return
end
respond_to do |format|
format.html { render "country" }
end
rescue RecordNotFound
set_expiry(10.minutes)
error 404
end
private
def fetch_artefact_and_publication_for_country(country)
params[:slug] = "travel-advice/" + params[:slug]
artefact = fetch_artefact
publication = PublicationPresenter.new(artefact)
raise RecordNotFound unless publication
return [publication, artefact]
end
end
| Change fetch method to return both artefact and publication | Change fetch method to return both artefact and publication | Ruby | mit | alphagov/frontend,alphagov/frontend,alphagov/frontend,alphagov/frontend | ruby | ## Code Before:
class TravelAdviceController < ApplicationController
before_filter :set_expiry
def country
@country = params[:slug].dup
@publication = fetch_artefact_for_country(@country)
part = params.fetch(:part) { @publication.parts.first.slug }
@part = @publication.find_part(part)
unless @part
redirect_to travel_advice_country_path(@country) and return
end
respond_to do |format|
format.html { render "country" }
end
rescue RecordNotFound
set_expiry(10.minutes)
error 404
end
private
def fetch_artefact_for_country(country)
params[:slug] = "travel-advice/" + params[:slug]
@artefact = fetch_artefact
@publication = PublicationPresenter.new(@artefact)
raise RecordNotFound unless @publication
return @publication
end
end
## Instruction:
Change fetch method to return both artefact and publication
## Code After:
class TravelAdviceController < ApplicationController
before_filter :set_expiry
def country
@country = params[:slug].dup
@publication, @artefact = fetch_artefact_and_publication_for_country(@country)
part = params.fetch(:part) { @publication.parts.first.slug }
@part = @publication.find_part(part)
unless @part
redirect_to travel_advice_country_path(@country) and return
end
respond_to do |format|
format.html { render "country" }
end
rescue RecordNotFound
set_expiry(10.minutes)
error 404
end
private
def fetch_artefact_and_publication_for_country(country)
params[:slug] = "travel-advice/" + params[:slug]
artefact = fetch_artefact
publication = PublicationPresenter.new(artefact)
raise RecordNotFound unless publication
return [publication, artefact]
end
end
|
1889e1c5485a8e1994a2ee72046830891fb61f63 | app/views/welcome/_upcoming_work.html.haml | app/views/welcome/_upcoming_work.html.haml | %h2 Upcoming Work
.row
.small-12.columns
%p
These are the items which we plan on working on very soon.
%ul
%li Set up logrotate
%li Set up https encryption as the default/only
%li automatic e-mail to Robin whenever new translations are stored by translators (so that they can be reviewed and deployed)
%li Improve the "Expert Heat" competiton-choosing experience for 100m/etc
%li Improve ability to import/export results/scores
%li Improve Code Quality using rubocop
| %h2 Upcoming Work
.row
.small-12.columns
%p
These are the items which we plan on working on very soon.
%ul
%li Set up https encryption as the default/only
%li automatic e-mail to Robin whenever new translations are stored by translators (so that they can be reviewed and deployed)
%li Improve the "Expert Heat" competiton-choosing experience for 100m/etc
%li Improve ability to import/export results/scores
%li Improve Code Quality using rubocop
| Allow Sign-Up to redirect to Sign-in if we already know this user | Allow Sign-Up to redirect to Sign-in if we already know this user
| Haml | mit | rdunlop/unicycling-registration,rdunlop/unicycling-registration,rdunlop/unicycling-registration,rdunlop/unicycling-registration | haml | ## Code Before:
%h2 Upcoming Work
.row
.small-12.columns
%p
These are the items which we plan on working on very soon.
%ul
%li Set up logrotate
%li Set up https encryption as the default/only
%li automatic e-mail to Robin whenever new translations are stored by translators (so that they can be reviewed and deployed)
%li Improve the "Expert Heat" competiton-choosing experience for 100m/etc
%li Improve ability to import/export results/scores
%li Improve Code Quality using rubocop
## Instruction:
Allow Sign-Up to redirect to Sign-in if we already know this user
## Code After:
%h2 Upcoming Work
.row
.small-12.columns
%p
These are the items which we plan on working on very soon.
%ul
%li Set up https encryption as the default/only
%li automatic e-mail to Robin whenever new translations are stored by translators (so that they can be reviewed and deployed)
%li Improve the "Expert Heat" competiton-choosing experience for 100m/etc
%li Improve ability to import/export results/scores
%li Improve Code Quality using rubocop
|
f70155c435841c98a93c1f14cadaf54d4d47a98b | test-integration/default.yml | test-integration/default.yml | - description: Command help should display help information
command: ../../../../../bin/roombox --help
exitcode: 0
output: 'Usage: roombox'
| - params:
roombox: ../../../../../bin/roombox
- description: Command help should display help information
command: '{roombox} --help'
exitcode: 0
output: 'Usage: roombox'
| Simplify integration test by using params. | Simplify integration test by using params.
| YAML | mit | cliffano/roombox | yaml | ## Code Before:
- description: Command help should display help information
command: ../../../../../bin/roombox --help
exitcode: 0
output: 'Usage: roombox'
## Instruction:
Simplify integration test by using params.
## Code After:
- params:
roombox: ../../../../../bin/roombox
- description: Command help should display help information
command: '{roombox} --help'
exitcode: 0
output: 'Usage: roombox'
|
924593fd2c8eccad6c3896462185c6f79e1814af | lib/browser-update/index.js | lib/browser-update/index.js | /**
* Module dependencies.
*/
var config = require('lib/config');
var jade = require('jade');
var path = require('path');
var resolve = path.resolve;
var t = require('t-component');
var html = jade.renderFile(resolve(__dirname, 'index.jade'), { config: config, t: t });
var express = require('express');
var app = module.exports = express();
var bowser = require('bowser');
app.get('/browser-update', function (req, res, next) {
res.send(200, html);
});
app.get('*', function (req, res, next) {
//Check the user agent, and if is invalid, redirect to the page
// for browser update.
var userAgent = bowser.browser._detect(req.headers['user-agent']);
if (userAgent.msie && userAgent.version <= 9) {
res.redirect(302, '/browser-update');
} else {
next();
}
});
| /**
* Module dependencies.
*/
var config = require('lib/config');
var jade = require('jade');
var path = require('path');
var resolve = path.resolve;
var t = require('t-component');
var html = jade.renderFile(resolve(__dirname, 'index.jade'), { config: config, t: t });
var express = require('express');
var app = module.exports = express();
var bowser = require('bowser');
app.get('/browser-update', function (req, res, next) {
res.send(200, html);
});
app.get('*', function (req, res, next) {
//Check the user agent, and if is invalid, redirect to the page
// for browser update.
var userAgent = bowser.browser._detect(typeof req.headers['user-agent'] !== 'undefined' ? req.headers['user-agent'] : '');
if (userAgent.msie && userAgent.version <= 9) {
res.redirect(302, '/browser-update');
} else {
next();
}
});
| Fix ISE if the UA header is missing | Fix ISE if the UA header is missing
| JavaScript | mit | atlatszo/evoks,atlatszo/evoks | javascript | ## Code Before:
/**
* Module dependencies.
*/
var config = require('lib/config');
var jade = require('jade');
var path = require('path');
var resolve = path.resolve;
var t = require('t-component');
var html = jade.renderFile(resolve(__dirname, 'index.jade'), { config: config, t: t });
var express = require('express');
var app = module.exports = express();
var bowser = require('bowser');
app.get('/browser-update', function (req, res, next) {
res.send(200, html);
});
app.get('*', function (req, res, next) {
//Check the user agent, and if is invalid, redirect to the page
// for browser update.
var userAgent = bowser.browser._detect(req.headers['user-agent']);
if (userAgent.msie && userAgent.version <= 9) {
res.redirect(302, '/browser-update');
} else {
next();
}
});
## Instruction:
Fix ISE if the UA header is missing
## Code After:
/**
* Module dependencies.
*/
var config = require('lib/config');
var jade = require('jade');
var path = require('path');
var resolve = path.resolve;
var t = require('t-component');
var html = jade.renderFile(resolve(__dirname, 'index.jade'), { config: config, t: t });
var express = require('express');
var app = module.exports = express();
var bowser = require('bowser');
app.get('/browser-update', function (req, res, next) {
res.send(200, html);
});
app.get('*', function (req, res, next) {
//Check the user agent, and if is invalid, redirect to the page
// for browser update.
var userAgent = bowser.browser._detect(typeof req.headers['user-agent'] !== 'undefined' ? req.headers['user-agent'] : '');
if (userAgent.msie && userAgent.version <= 9) {
res.redirect(302, '/browser-update');
} else {
next();
}
});
|
c297483328ab0b4c77c87ee51b86112c364c4407 | src/app/move-popup/press-tip.directive.js | src/app/move-popup/press-tip.directive.js | import Tooltip from 'tooltip.js';
import './press-tip.scss';
export function PressTip() {
'ngInject';
return {
restrict: 'A',
link($scope, $element, $attrs) {
let tooltip = null;
function showTip() {
if (!tooltip) {
let title = $attrs.pressTip;
if ($attrs.pressTipTitle) {
title = `<h2>${$attrs.pressTipTitle}</h2>${title}`;
}
tooltip = new Tooltip($element[0], {
placement: 'top', // or bottom, left, right, and variations
title,
html: true,
trigger: 'manual',
container: 'body'
});
}
tooltip.show();
}
$element.on('mousedown touchstart', (e) => {
e.preventDefault();
showTip();
});
$element.on('mouseup mouseleave touchend', (e) => {
e.preventDefault();
if (tooltip) {
tooltip.hide();
}
});
$scope.$on('$destroy', () => {
if (tooltip) {
tooltip.dispose();
tooltip = null;
}
});
}
};
}
| import Tooltip from 'tooltip.js';
import './press-tip.scss';
export function PressTip() {
'ngInject';
return {
restrict: 'A',
link($scope, $element, $attrs) {
let tooltip = null;
let timer = null;
function showTip() {
if (!tooltip) {
let title = $attrs.pressTip;
if ($attrs.pressTipTitle) {
title = `<h2>${$attrs.pressTipTitle}</h2>${title}`;
}
tooltip = new Tooltip($element[0], {
placement: 'top', // or bottom, left, right, and variations
title,
html: true,
trigger: 'manual',
container: 'body'
});
}
tooltip.show();
}
$element.on('mouseenter', (e) => {
timer = setTimeout(() => {
showTip();
}, 300);
});
$element.on('mousedown touchstart', (e) => {
e.preventDefault();
showTip();
});
$element.on('mouseup mouseleave touchend', (e) => {
e.preventDefault();
if (tooltip) {
tooltip.hide();
}
clearTimeout(timer);
});
$scope.$on('$destroy', () => {
if (tooltip) {
tooltip.dispose();
tooltip = null;
}
});
}
};
}
| Make press-tip work on hover | Make press-tip work on hover
| JavaScript | mit | chrisfried/DIM,delphiactual/DIM,delphiactual/DIM,bhollis/DIM,delphiactual/DIM,bhollis/DIM,delphiactual/DIM,chrisfried/DIM,DestinyItemManager/DIM,bhollis/DIM,DestinyItemManager/DIM,chrisfried/DIM,DestinyItemManager/DIM,chrisfried/DIM,DestinyItemManager/DIM,bhollis/DIM | javascript | ## Code Before:
import Tooltip from 'tooltip.js';
import './press-tip.scss';
export function PressTip() {
'ngInject';
return {
restrict: 'A',
link($scope, $element, $attrs) {
let tooltip = null;
function showTip() {
if (!tooltip) {
let title = $attrs.pressTip;
if ($attrs.pressTipTitle) {
title = `<h2>${$attrs.pressTipTitle}</h2>${title}`;
}
tooltip = new Tooltip($element[0], {
placement: 'top', // or bottom, left, right, and variations
title,
html: true,
trigger: 'manual',
container: 'body'
});
}
tooltip.show();
}
$element.on('mousedown touchstart', (e) => {
e.preventDefault();
showTip();
});
$element.on('mouseup mouseleave touchend', (e) => {
e.preventDefault();
if (tooltip) {
tooltip.hide();
}
});
$scope.$on('$destroy', () => {
if (tooltip) {
tooltip.dispose();
tooltip = null;
}
});
}
};
}
## Instruction:
Make press-tip work on hover
## Code After:
import Tooltip from 'tooltip.js';
import './press-tip.scss';
export function PressTip() {
'ngInject';
return {
restrict: 'A',
link($scope, $element, $attrs) {
let tooltip = null;
let timer = null;
function showTip() {
if (!tooltip) {
let title = $attrs.pressTip;
if ($attrs.pressTipTitle) {
title = `<h2>${$attrs.pressTipTitle}</h2>${title}`;
}
tooltip = new Tooltip($element[0], {
placement: 'top', // or bottom, left, right, and variations
title,
html: true,
trigger: 'manual',
container: 'body'
});
}
tooltip.show();
}
$element.on('mouseenter', (e) => {
timer = setTimeout(() => {
showTip();
}, 300);
});
$element.on('mousedown touchstart', (e) => {
e.preventDefault();
showTip();
});
$element.on('mouseup mouseleave touchend', (e) => {
e.preventDefault();
if (tooltip) {
tooltip.hide();
}
clearTimeout(timer);
});
$scope.$on('$destroy', () => {
if (tooltip) {
tooltip.dispose();
tooltip = null;
}
});
}
};
}
|
d5866009d60c768b5d0579de528868193c31c62e | Tests/MediaTestCase.php | Tests/MediaTestCase.php | <?php namespace Modules\Media\Tests;
use Orchestra\Testbench\TestCase;
abstract class MediaTestCase extends TestCase
{
protected function getPackageProviders($app)
{
return [
'Modules\Media\Providers\MediaServiceProvider',
'Pingpong\Modules\ModulesServiceProvider',
'Intervention\Image\ImageServiceProvider',
];
}
}
| <?php namespace Modules\Media\Tests;
use Orchestra\Testbench\TestCase;
abstract class MediaTestCase extends TestCase
{
protected function getPackageProviders($app)
{
return [
'Modules\Media\Providers\MediaServiceProvider',
'Pingpong\Modules\ModulesServiceProvider',
'Intervention\Image\ImageServiceProvider',
];
}
protected function getEnvironmentSetUp($app)
{
$app['path.base'] = __DIR__ . '/..';
$app->setBasePath(__DIR__ . '/..');
}
}
| Set the app base path | Set the app base path
| PHP | mit | zedee/Media,oimken/Media,oimken/Media,pixelfusion/Media,MentallyFriendly/Media,AsgardCms/Media,ruscon/Media,AsgardCms/Media,ruscon/Media,zedee/Media,gabva/Media,clemir/Media,mikemand/Media,pixelfusion/Media,oimken/Media,mikemand/Media,MentallyFriendly/Media,pixelfusion/Media,gabva/Media,mikemand/Media,zedee/Media,clemir/Media,AsgardCms/Media | php | ## Code Before:
<?php namespace Modules\Media\Tests;
use Orchestra\Testbench\TestCase;
abstract class MediaTestCase extends TestCase
{
protected function getPackageProviders($app)
{
return [
'Modules\Media\Providers\MediaServiceProvider',
'Pingpong\Modules\ModulesServiceProvider',
'Intervention\Image\ImageServiceProvider',
];
}
}
## Instruction:
Set the app base path
## Code After:
<?php namespace Modules\Media\Tests;
use Orchestra\Testbench\TestCase;
abstract class MediaTestCase extends TestCase
{
protected function getPackageProviders($app)
{
return [
'Modules\Media\Providers\MediaServiceProvider',
'Pingpong\Modules\ModulesServiceProvider',
'Intervention\Image\ImageServiceProvider',
];
}
protected function getEnvironmentSetUp($app)
{
$app['path.base'] = __DIR__ . '/..';
$app->setBasePath(__DIR__ . '/..');
}
}
|
0701e34c76a4ea55b1334c9b48c88fd346f49fa2 | nazs/apps.py | nazs/apps.py |
from django.apps import AppConfig
import os
import pkg_resources
class NAZSConfig(AppConfig):
name = 'nazs'
def ready(self):
from django.core import management
from django.conf import settings
from .sudo import set_euid
set_euid()
# Sync volatile db and set permissions
volatile_db = settings.DATABASES['volatile']['NAME']
management.call_command('syncdb',
database='volatile',
interactive=False,
verbosity=0)
os.chmod(volatile_db, 0600)
# Load all modules
for app in pkg_resources.iter_entry_points('nazs.app'):
__import__(app.module_name + '.module')
|
from django.apps import AppConfig
import pkg_resources
class NAZSConfig(AppConfig):
name = 'nazs'
def ready(self):
from .sudo import set_euid
set_euid()
# Load all modules
for app in pkg_resources.iter_entry_points('nazs.app'):
__import__(app.module_name + '.module')
| Stop auto creation of shm database | Stop auto creation of shm database
| Python | agpl-3.0 | exekias/droplet,exekias/droplet,exekias/droplet | python | ## Code Before:
from django.apps import AppConfig
import os
import pkg_resources
class NAZSConfig(AppConfig):
name = 'nazs'
def ready(self):
from django.core import management
from django.conf import settings
from .sudo import set_euid
set_euid()
# Sync volatile db and set permissions
volatile_db = settings.DATABASES['volatile']['NAME']
management.call_command('syncdb',
database='volatile',
interactive=False,
verbosity=0)
os.chmod(volatile_db, 0600)
# Load all modules
for app in pkg_resources.iter_entry_points('nazs.app'):
__import__(app.module_name + '.module')
## Instruction:
Stop auto creation of shm database
## Code After:
from django.apps import AppConfig
import pkg_resources
class NAZSConfig(AppConfig):
name = 'nazs'
def ready(self):
from .sudo import set_euid
set_euid()
# Load all modules
for app in pkg_resources.iter_entry_points('nazs.app'):
__import__(app.module_name + '.module')
|
ee042653dee9feda76cdd509396aa22686fb2e3c | src/Components/ContextMenu.css | src/Components/ContextMenu.css | .context-menu {
position: absolute;
top: 5px;
right: -10px;
cursor: pointer;
font-size: 25px;
color: green;
} | .context-menu {
position: relative;
cursor: pointer;
font-size: 25px;
color: green;
position: absolute;
top: 5px;
right: -10px;
}
.context-menu ul {
position: absolute;
top: 5px;
right: 0px;
list-style-type: none;
font-size: 15px;
color: white;
z-index: 99;
}
.context-menu li {
background-color: black;
position: absolute;
width: 125px;
} | Add some very basic styling for menu entries | Add some very basic styling for menu entries
| CSS | mit | schultyy/spreadsheet,schultyy/spreadsheet | css | ## Code Before:
.context-menu {
position: absolute;
top: 5px;
right: -10px;
cursor: pointer;
font-size: 25px;
color: green;
}
## Instruction:
Add some very basic styling for menu entries
## Code After:
.context-menu {
position: relative;
cursor: pointer;
font-size: 25px;
color: green;
position: absolute;
top: 5px;
right: -10px;
}
.context-menu ul {
position: absolute;
top: 5px;
right: 0px;
list-style-type: none;
font-size: 15px;
color: white;
z-index: 99;
}
.context-menu li {
background-color: black;
position: absolute;
width: 125px;
} |
832078efd47a5a43463bf554110075f8b3a68384 | setup.cfg | setup.cfg | [build_sphinx]
source-dir = docs
build-dir = docs/_build
all_files = 1
[upload_docs]
upload-dir = docs/_build/html
show-response = 1
[pytest]
minversion = 2.2
norecursedirs = build docs/_build
doctest_plus = enabled
[ah_bootstrap]
auto_use = False
[metadata]
package_name = extruder
description = A couple of scripts for automating conda builds.
long_description = Build conda packages.
author = Matthew Craig
author_email = mattwcraig@gmail.com
license = BSD
url = https://github.com/astropy/conda-build-tools
edit_on_github = False
github_project = astropy/conda-build-tools
[entry_points]
astropy-package-template-example = packagename.example_mod:main
| [build_sphinx]
source-dir = docs
build-dir = docs/_build
all_files = 1
[upload_docs]
upload-dir = docs/_build/html
show-response = 1
[pytest]
minversion = 2.2
norecursedirs = build docs/_build
doctest_plus = enabled
[ah_bootstrap]
auto_use = False
[metadata]
package_name = extruder
description = A couple of scripts for automating conda builds.
long_description = Build conda packages.
author = Matthew Craig
author_email = mattwcraig@gmail.com
license = BSD
url = https://github.com/astropy/conda-build-tools
edit_on_github = False
github_project = astropy/conda-build-tools
[entry_points]
extrude_packages = extruder.prepare_packages:main
extrude_template = extruder.extrude_template:main
| Add entry points for scripts | Add entry points for scripts
| INI | bsd-3-clause | astropy/conda-build-tools,astropy/conda-build-tools | ini | ## Code Before:
[build_sphinx]
source-dir = docs
build-dir = docs/_build
all_files = 1
[upload_docs]
upload-dir = docs/_build/html
show-response = 1
[pytest]
minversion = 2.2
norecursedirs = build docs/_build
doctest_plus = enabled
[ah_bootstrap]
auto_use = False
[metadata]
package_name = extruder
description = A couple of scripts for automating conda builds.
long_description = Build conda packages.
author = Matthew Craig
author_email = mattwcraig@gmail.com
license = BSD
url = https://github.com/astropy/conda-build-tools
edit_on_github = False
github_project = astropy/conda-build-tools
[entry_points]
astropy-package-template-example = packagename.example_mod:main
## Instruction:
Add entry points for scripts
## Code After:
[build_sphinx]
source-dir = docs
build-dir = docs/_build
all_files = 1
[upload_docs]
upload-dir = docs/_build/html
show-response = 1
[pytest]
minversion = 2.2
norecursedirs = build docs/_build
doctest_plus = enabled
[ah_bootstrap]
auto_use = False
[metadata]
package_name = extruder
description = A couple of scripts for automating conda builds.
long_description = Build conda packages.
author = Matthew Craig
author_email = mattwcraig@gmail.com
license = BSD
url = https://github.com/astropy/conda-build-tools
edit_on_github = False
github_project = astropy/conda-build-tools
[entry_points]
extrude_packages = extruder.prepare_packages:main
extrude_template = extruder.extrude_template:main
|
d5e066b87d6fed214666c95118cdb84e101f873c | .travis.yml | .travis.yml | language: csharp
solution: Rexcfnghk.MarkSixParser.sln
script:
- ./build.sh Pack -ev ci
before_install:
- chmod +x ./build.sh
notifications:
slack: voyagers:oZDhMiQge4pAZ6hCEHvvLCMA | language: csharp
script:
- ./build.sh Pack -ev ci
before_install:
- chmod +x ./build.sh
notifications:
slack: voyagers:oZDhMiQge4pAZ6hCEHvvLCMA | Remove solution value from Travis config | Remove solution value from Travis config
| YAML | mit | rexcfnghk/marksix-parser | yaml | ## Code Before:
language: csharp
solution: Rexcfnghk.MarkSixParser.sln
script:
- ./build.sh Pack -ev ci
before_install:
- chmod +x ./build.sh
notifications:
slack: voyagers:oZDhMiQge4pAZ6hCEHvvLCMA
## Instruction:
Remove solution value from Travis config
## Code After:
language: csharp
script:
- ./build.sh Pack -ev ci
before_install:
- chmod +x ./build.sh
notifications:
slack: voyagers:oZDhMiQge4pAZ6hCEHvvLCMA |
c82360f076fa3c900a230232e8cae54305318c8b | app/views/custom/projects/project_faqs/new.html.slim | app/views/custom/projects/project_faqs/new.html.slim | .bootstrap-form
= semantic_form_for [@project, ProjectFaq.new] do |form|
= form.inputs do
= form.input :title, as: :string
= form.input :answer, as: :text, input_html: {rows: 10}
= render partial: 'projects/formatting_tips'
= form.actions do
= form.submit 'Create', class: "btn"
| .bootstrap-form
= semantic_form_for [@project, ProjectFaq.new] do |form|
= form.inputs do
= form.input :title, as: :string
= form.input :answer, as: :text, input_html: {rows: 10}
= form.actions do
= form.submit 'Create', class: "btn"
| Remove formatting tips on project faqs page | Remove formatting tips on project faqs page
| Slim | mit | jinutm/silvfinal,jinutm/silverclass,MicroPasts/micropasts-crowdfunding,MicroPasts/micropasts-crowdfunding,raksonibs/raimcrowd,jinutm/silveralms.com,raksonibs/raimcrowd,gustavoguichard/neighborly,jinutm/silveralms.com,jinutm/silverme,jinutm/silverme,jinutm/silverclass,raksonibs/raimcrowd,jinutm/silverprod,jinutm/silverme,MicroPasts/micropasts-crowdfunding,rockkhuya/taydantay,jinutm/silverprod,jinutm/silverpro,raksonibs/raimcrowd,MicroPasts/micropasts-crowdfunding,jinutm/silvfinal,rockkhuya/taydantay,gustavoguichard/neighborly,jinutm/silverpro,jinutm/silvfinal,jinutm/silverpro,jinutm/silveralms.com,jinutm/silverprod,rockkhuya/taydantay,gustavoguichard/neighborly,jinutm/silverclass | slim | ## Code Before:
.bootstrap-form
= semantic_form_for [@project, ProjectFaq.new] do |form|
= form.inputs do
= form.input :title, as: :string
= form.input :answer, as: :text, input_html: {rows: 10}
= render partial: 'projects/formatting_tips'
= form.actions do
= form.submit 'Create', class: "btn"
## Instruction:
Remove formatting tips on project faqs page
## Code After:
.bootstrap-form
= semantic_form_for [@project, ProjectFaq.new] do |form|
= form.inputs do
= form.input :title, as: :string
= form.input :answer, as: :text, input_html: {rows: 10}
= form.actions do
= form.submit 'Create', class: "btn"
|
3912afaf9e069ae914c535af21155d10da930494 | tests/unit/utils/test_translations.py | tests/unit/utils/test_translations.py | import subprocess
import os
from flask import current_app
from babel.support import Translations, NullTranslations
from flaskbb.utils.translations import FlaskBBDomain
from flaskbb.extensions import plugin_manager
def _compile_translations():
PLUGINS_FOLDER = os.path.join(current_app.root_path, "plugins")
translations_folder = os.path.join(current_app.root_path, "translations")
subprocess.call(["pybabel", "compile", "-d", translations_folder])
for plugin in plugin_manager.all_plugins:
plugin_folder = os.path.join(PLUGINS_FOLDER, plugin)
translations_folder = os.path.join(plugin_folder, "translations")
subprocess.call(["pybabel", "compile", "-d", translations_folder])
def test_flaskbbdomain_translations(default_settings):
domain = FlaskBBDomain(current_app)
with current_app.test_request_context():
assert domain.get_translations_cache() == {}
# no compiled translations are available
assert isinstance(domain.get_translations(), NullTranslations)
# lets compile them and test again
_compile_translations()
# now there should be translations :)
assert isinstance(domain.get_translations(), Translations)
| import subprocess
import os
from flask import current_app
from babel.support import Translations, NullTranslations
from flaskbb.utils.translations import FlaskBBDomain
from flaskbb.extensions import plugin_manager
def _remove_compiled_translations():
translations_folder = os.path.join(current_app.root_path, "translations")
# walks through the translations folder and deletes all files
# ending with .mo
for root, dirs, files in os.walk(translations_folder):
for name in files:
if name.endswith(".mo"):
os.unlink(os.path.join(root, name))
def _compile_translations():
PLUGINS_FOLDER = os.path.join(current_app.root_path, "plugins")
translations_folder = os.path.join(current_app.root_path, "translations")
subprocess.call(["pybabel", "compile", "-d", translations_folder])
for plugin in plugin_manager.all_plugins:
plugin_folder = os.path.join(PLUGINS_FOLDER, plugin)
translations_folder = os.path.join(plugin_folder, "translations")
subprocess.call(["pybabel", "compile", "-d", translations_folder])
def test_flaskbbdomain_translations(default_settings):
domain = FlaskBBDomain(current_app)
with current_app.test_request_context():
assert domain.get_translations_cache() == {}
# just to be on the safe side that there are really no compiled
# translations available
_remove_compiled_translations()
# no compiled translations are available
assert isinstance(domain.get_translations(), NullTranslations)
# lets compile them and test again
_compile_translations()
# now there should be translations :)
assert isinstance(domain.get_translations(), Translations)
| Remove the compiled translations for testing | Remove the compiled translations for testing
| Python | bsd-3-clause | zky001/flaskbb,realityone/flaskbb,dromanow/flaskbb,qitianchan/flaskbb,realityone/flaskbb,SeanChen0617/flaskbb,SeanChen0617/flaskbb-1,SeanChen0617/flaskbb,zky001/flaskbb,emile2016/flaskbb,China-jp/flaskbb,dromanow/flaskbb,lucius-feng/flaskbb,dromanow/flaskbb,SeanChen0617/flaskbb-1,qitianchan/flaskbb,emile2016/flaskbb,realityone/flaskbb,zky001/flaskbb,SeanChen0617/flaskbb-1,SeanChen0617/flaskbb,China-jp/flaskbb,China-jp/flaskbb,lucius-feng/flaskbb,lucius-feng/flaskbb,emile2016/flaskbb,qitianchan/flaskbb | python | ## Code Before:
import subprocess
import os
from flask import current_app
from babel.support import Translations, NullTranslations
from flaskbb.utils.translations import FlaskBBDomain
from flaskbb.extensions import plugin_manager
def _compile_translations():
PLUGINS_FOLDER = os.path.join(current_app.root_path, "plugins")
translations_folder = os.path.join(current_app.root_path, "translations")
subprocess.call(["pybabel", "compile", "-d", translations_folder])
for plugin in plugin_manager.all_plugins:
plugin_folder = os.path.join(PLUGINS_FOLDER, plugin)
translations_folder = os.path.join(plugin_folder, "translations")
subprocess.call(["pybabel", "compile", "-d", translations_folder])
def test_flaskbbdomain_translations(default_settings):
domain = FlaskBBDomain(current_app)
with current_app.test_request_context():
assert domain.get_translations_cache() == {}
# no compiled translations are available
assert isinstance(domain.get_translations(), NullTranslations)
# lets compile them and test again
_compile_translations()
# now there should be translations :)
assert isinstance(domain.get_translations(), Translations)
## Instruction:
Remove the compiled translations for testing
## Code After:
import subprocess
import os
from flask import current_app
from babel.support import Translations, NullTranslations
from flaskbb.utils.translations import FlaskBBDomain
from flaskbb.extensions import plugin_manager
def _remove_compiled_translations():
translations_folder = os.path.join(current_app.root_path, "translations")
# walks through the translations folder and deletes all files
# ending with .mo
for root, dirs, files in os.walk(translations_folder):
for name in files:
if name.endswith(".mo"):
os.unlink(os.path.join(root, name))
def _compile_translations():
PLUGINS_FOLDER = os.path.join(current_app.root_path, "plugins")
translations_folder = os.path.join(current_app.root_path, "translations")
subprocess.call(["pybabel", "compile", "-d", translations_folder])
for plugin in plugin_manager.all_plugins:
plugin_folder = os.path.join(PLUGINS_FOLDER, plugin)
translations_folder = os.path.join(plugin_folder, "translations")
subprocess.call(["pybabel", "compile", "-d", translations_folder])
def test_flaskbbdomain_translations(default_settings):
domain = FlaskBBDomain(current_app)
with current_app.test_request_context():
assert domain.get_translations_cache() == {}
# just to be on the safe side that there are really no compiled
# translations available
_remove_compiled_translations()
# no compiled translations are available
assert isinstance(domain.get_translations(), NullTranslations)
# lets compile them and test again
_compile_translations()
# now there should be translations :)
assert isinstance(domain.get_translations(), Translations)
|
eb5921ebe3848b5b3a33c3e2ce9c40847468167c | examples/04-custom-state/README.md | examples/04-custom-state/README.md |
If you want to use different state handling pattern (e.g. Flux stores)
than React component state then you also must handle the state propagation
manually. [LiveReactload API](https://www.npmjs.com/package/livereactload-api)
provides means to it. **TODO: update docs**
|
If you want to use different state handling pattern (e.g. Flux stores)
than React component state then you also must handle the state propagation
manually. [LiveReactload API](https://www.npmjs.com/package/livereactload-api)
provides means to it.
The basic idea is to store the most recent state with `setState` so
that `onReload` can use it during the next reload event.
```javascript
window.onload = function() {
initApp(window.INITIAL_MODEL)
}
function initApp(model) {
var modelStream = Bacon.combineTemplate({
items: items._items(model.items || []),
editedItem: items._editedItem()
})
modelStream.onValue(function(model) {
lrapi.setState(model)
React.render(<Application {...model} />, document.getElementById('app'))
})
}
// live reloading
lrapi.onReload(function() {
initApp(lrapi.getState() || window.INITIAL_MODEL)
})
```
In this example, React component don't have any own state - they are just
dummy components rendering whatever they are told to render. When events
occur, they modify the global state by using `items.js` global API.
The `Items` object handles all the business logic with BaconJS streams and
that stream will produce new values when the state changes. To store that
state, we use `.setState` just before re-render (in `site.js`).
`lrApi.onReload` method is used with `lrApi.getState` so that reloading event
can construct the proper stream from the latest state.
Note that this loop enables the isomorphic application development. In
this example the initial user interface is actually pre-rendered by the
server (confirm it by yourself by disabling JavaScript from you browser)!
## API
### .onReload(callback)
This is invoked each when next bundle is reloaded. You can register multiple
callbacks in you bundle. Callback takes no arguments
```javascript
window.onload = function() {
initApp()
}
lrAPI.onReload(function() {
initApp()
})
function initApp() {
// do something
React.render(...)
}
```
### .setState([name], state)
This sets the state that can be used when next bundle is reloaded. You can set
multiple state by using name as a first argument. Name is not mandatory.
```javascript
lrAPI.setState(myGlobalState)
lrAPI.setState('socket', socket)
```
### .getState([name])
Restores the state. You can also retrieve named state objects by giving an
optional name argument.
```javascript
var global = lrAPI.getState()
var socket = lrAPI.getState('socket')
```
| Update custom state example docs | Update custom state example docs | Markdown | mit | megalithic/livereactload,milankinen/livereactload,michaelBenin/livereactload,rofrol/livereactload,michaelBenin/livereactload | markdown | ## Code Before:
If you want to use different state handling pattern (e.g. Flux stores)
than React component state then you also must handle the state propagation
manually. [LiveReactload API](https://www.npmjs.com/package/livereactload-api)
provides means to it. **TODO: update docs**
## Instruction:
Update custom state example docs
## Code After:
If you want to use different state handling pattern (e.g. Flux stores)
than React component state then you also must handle the state propagation
manually. [LiveReactload API](https://www.npmjs.com/package/livereactload-api)
provides means to it.
The basic idea is to store the most recent state with `setState` so
that `onReload` can use it during the next reload event.
```javascript
window.onload = function() {
initApp(window.INITIAL_MODEL)
}
function initApp(model) {
var modelStream = Bacon.combineTemplate({
items: items._items(model.items || []),
editedItem: items._editedItem()
})
modelStream.onValue(function(model) {
lrapi.setState(model)
React.render(<Application {...model} />, document.getElementById('app'))
})
}
// live reloading
lrapi.onReload(function() {
initApp(lrapi.getState() || window.INITIAL_MODEL)
})
```
In this example, React component don't have any own state - they are just
dummy components rendering whatever they are told to render. When events
occur, they modify the global state by using `items.js` global API.
The `Items` object handles all the business logic with BaconJS streams and
that stream will produce new values when the state changes. To store that
state, we use `.setState` just before re-render (in `site.js`).
`lrApi.onReload` method is used with `lrApi.getState` so that reloading event
can construct the proper stream from the latest state.
Note that this loop enables the isomorphic application development. In
this example the initial user interface is actually pre-rendered by the
server (confirm it by yourself by disabling JavaScript from you browser)!
## API
### .onReload(callback)
This is invoked each when next bundle is reloaded. You can register multiple
callbacks in you bundle. Callback takes no arguments
```javascript
window.onload = function() {
initApp()
}
lrAPI.onReload(function() {
initApp()
})
function initApp() {
// do something
React.render(...)
}
```
### .setState([name], state)
This sets the state that can be used when next bundle is reloaded. You can set
multiple state by using name as a first argument. Name is not mandatory.
```javascript
lrAPI.setState(myGlobalState)
lrAPI.setState('socket', socket)
```
### .getState([name])
Restores the state. You can also retrieve named state objects by giving an
optional name argument.
```javascript
var global = lrAPI.getState()
var socket = lrAPI.getState('socket')
```
|
8a89ea553494c0ca429a57f792a097adb1f25ce2 | Sources/ObjectiveChain.h | Sources/ObjectiveChain.h | //
// ObjectiveChain.h
// Objective-Chain
//
// Created by Martin Kiss on 30.12.13.
//
//
| //
// ObjectiveChain.h
// Objective-Chain
//
// Created by Martin Kiss on 30.12.13.
//
//
#import "OCAConnection.h"
#import "OCAProducer.h"
| Add first classes to umbrella header | Add first classes to umbrella header
| C | mit | Tricertops/Objective-Chain,iMartinKiss/Objective-Chain | c | ## Code Before:
//
// ObjectiveChain.h
// Objective-Chain
//
// Created by Martin Kiss on 30.12.13.
//
//
## Instruction:
Add first classes to umbrella header
## Code After:
//
// ObjectiveChain.h
// Objective-Chain
//
// Created by Martin Kiss on 30.12.13.
//
//
#import "OCAConnection.h"
#import "OCAProducer.h"
|
3938bdc27da1b389f452aff8a19f317322f11fe6 | src/views/live.html | src/views/live.html | {% extends 'base.html' %}
{% block content %}
<div class="live-container">
<div class="live-bar">
<div class="live-spotify-widget-cropper">
<iframe class="live-spotify-widget" src="https://embed.spotify.com/?uri=spotify:user:11124594727:playlist:5ZsAzB4swZL2Et1yaOlKAJ" width="300" height="80" frameborder="0" allowtransparency="true"></iframe>
</div>
<div class="live-sponsors">
{% for sponsorTierName, sponsorTier in sponsors %}
{% if sponsorTierName == 'tera' %}
{% for sponsor in sponsorTier %}
<img src="{{ asset('images/logos/' + sponsor.logo) }}" alt="{{ sponsor.name }}"/>
{% endfor %}
{% endif %}
{% endfor %}
</div>
</div>
<div class="event-countdown"></div>
<div class="live-cohost">
<img class="improbable-logo" src="{{ asset('images/logos/improbable-logo-white.svg') }}" alt="Improbable"/>
</div>
</div>
{% endblock %}
{% block local_scripts %}
window.addEventListener('error', event => {
setTimeout(() => location.reload(true), 5000);
});
{% endblock %} | {% extends 'base.html' %}
{% block content %}
<div class="live-container">
<div class="live-bar">
<div class="live-spotify-widget-cropper">
<iframe class="live-spotify-widget" src="https://embed.spotify.com/?uri=spotify:user:11124594727:playlist:5ZsAzB4swZL2Et1yaOlKAJ" width="300" height="80" frameborder="0" allowtransparency="true"></iframe>
</div>
<div class="live-sponsors">
{% for sponsorTierName, sponsorTier in sponsors %}
{% if sponsorTierName == 'tera' %}
{% for sponsor in sponsorTier %}
<img src="{{ asset('images/logos/' + sponsor.logo) }}" alt="{{ sponsor.name }}"/>
{% endfor %}
{% endif %}
{% endfor %}
</div>
</div>
<div class="event-countdown"></div>
<div class="live-cohost">
<img class="improbable-logo" src="{{ asset('images/logos/improbable-logo-white.svg') }}" alt="Improbable"/>
</div>
</div>
<script>
window.addEventListener('error', event => {
setTimeout(() => location.reload(true), 5000);
});
</script>
{% endblock %} | Fix a missing <script> tag | Fix a missing <script> tag
| HTML | mit | hackcambridge/hack-cambridge-website,hackcambridge/hack-cambridge-website,hackcambridge/hack-cambridge-website,hackcambridge/hack-cambridge-website | html | ## Code Before:
{% extends 'base.html' %}
{% block content %}
<div class="live-container">
<div class="live-bar">
<div class="live-spotify-widget-cropper">
<iframe class="live-spotify-widget" src="https://embed.spotify.com/?uri=spotify:user:11124594727:playlist:5ZsAzB4swZL2Et1yaOlKAJ" width="300" height="80" frameborder="0" allowtransparency="true"></iframe>
</div>
<div class="live-sponsors">
{% for sponsorTierName, sponsorTier in sponsors %}
{% if sponsorTierName == 'tera' %}
{% for sponsor in sponsorTier %}
<img src="{{ asset('images/logos/' + sponsor.logo) }}" alt="{{ sponsor.name }}"/>
{% endfor %}
{% endif %}
{% endfor %}
</div>
</div>
<div class="event-countdown"></div>
<div class="live-cohost">
<img class="improbable-logo" src="{{ asset('images/logos/improbable-logo-white.svg') }}" alt="Improbable"/>
</div>
</div>
{% endblock %}
{% block local_scripts %}
window.addEventListener('error', event => {
setTimeout(() => location.reload(true), 5000);
});
{% endblock %}
## Instruction:
Fix a missing <script> tag
## Code After:
{% extends 'base.html' %}
{% block content %}
<div class="live-container">
<div class="live-bar">
<div class="live-spotify-widget-cropper">
<iframe class="live-spotify-widget" src="https://embed.spotify.com/?uri=spotify:user:11124594727:playlist:5ZsAzB4swZL2Et1yaOlKAJ" width="300" height="80" frameborder="0" allowtransparency="true"></iframe>
</div>
<div class="live-sponsors">
{% for sponsorTierName, sponsorTier in sponsors %}
{% if sponsorTierName == 'tera' %}
{% for sponsor in sponsorTier %}
<img src="{{ asset('images/logos/' + sponsor.logo) }}" alt="{{ sponsor.name }}"/>
{% endfor %}
{% endif %}
{% endfor %}
</div>
</div>
<div class="event-countdown"></div>
<div class="live-cohost">
<img class="improbable-logo" src="{{ asset('images/logos/improbable-logo-white.svg') }}" alt="Improbable"/>
</div>
</div>
<script>
window.addEventListener('error', event => {
setTimeout(() => location.reload(true), 5000);
});
</script>
{% endblock %} |
e15e73cdb04d63497e4341403a7cc0a2641114b8 | views/header.jade | views/header.jade | script(src="http://code.jquery.com/jquery-2.0.3.min.js")
script(src="/bootstrap/js/bootstrap.js")
script(src="/javascripts/ga.js")
script(src="/javascripts/twitter-share.js")
script(src="/javascripts/holder.js")
script(src="/javascripts/cloudcv.js")
span(id="forkongithub")
a(href="https://github.com/BloodAxe/CloudCV") Fork me on GitHub
div.navbar.navbar-fixed-top.navbar-inverse
div.container
a.navbar-brand(href="/") CloudCV
ul.nav.navbar-nav.navbar-right
li
a(href="http://ua.linkedin.com/in/cvtalks/")
i.icon-linkedin-sign
| Ievgen Khvedchenia
li
a(href="http://github.com/BloodAxe/CloudCV")
i.icon-github-alt
| CloudCV
li
a(href="http://twitter.com/cvtalks")
i.icon-twitter
| @cvtalks
| span(id="forkongithub")
a(href="https://github.com/BloodAxe/CloudCV") Fork me on GitHub
div.navbar.navbar-fixed-top.navbar-inverse
div.container
a.navbar-brand(href="/") CloudCV
ul.nav.navbar-nav.navbar-right
li
a(href="http://ua.linkedin.com/in/cvtalks/")
i.icon-linkedin-sign
| Ievgen Khvedchenia
li
a(href="http://github.com/BloodAxe/CloudCV")
i.icon-github-alt
| CloudCV
li
a(href="http://twitter.com/cvtalks")
i.icon-twitter
| @cvtalks
| Move scripts to the end of the page | Move scripts to the end of the page
| Jade | bsd-3-clause | BloodAxe/CloudCV,BloodAxe/CloudCV | jade | ## Code Before:
script(src="http://code.jquery.com/jquery-2.0.3.min.js")
script(src="/bootstrap/js/bootstrap.js")
script(src="/javascripts/ga.js")
script(src="/javascripts/twitter-share.js")
script(src="/javascripts/holder.js")
script(src="/javascripts/cloudcv.js")
span(id="forkongithub")
a(href="https://github.com/BloodAxe/CloudCV") Fork me on GitHub
div.navbar.navbar-fixed-top.navbar-inverse
div.container
a.navbar-brand(href="/") CloudCV
ul.nav.navbar-nav.navbar-right
li
a(href="http://ua.linkedin.com/in/cvtalks/")
i.icon-linkedin-sign
| Ievgen Khvedchenia
li
a(href="http://github.com/BloodAxe/CloudCV")
i.icon-github-alt
| CloudCV
li
a(href="http://twitter.com/cvtalks")
i.icon-twitter
| @cvtalks
## Instruction:
Move scripts to the end of the page
## Code After:
span(id="forkongithub")
a(href="https://github.com/BloodAxe/CloudCV") Fork me on GitHub
div.navbar.navbar-fixed-top.navbar-inverse
div.container
a.navbar-brand(href="/") CloudCV
ul.nav.navbar-nav.navbar-right
li
a(href="http://ua.linkedin.com/in/cvtalks/")
i.icon-linkedin-sign
| Ievgen Khvedchenia
li
a(href="http://github.com/BloodAxe/CloudCV")
i.icon-github-alt
| CloudCV
li
a(href="http://twitter.com/cvtalks")
i.icon-twitter
| @cvtalks
|
d02dc294009d7d0037922938605e7da41416f54a | build/dependencies/gradle.properties | build/dependencies/gradle.properties | kotlinPluginBuild=1.1.2-eap-69-IJ2017.2-1:EAP-1.1
jetSignBuild=42.30
jdkBuild=u152b819.1
| kotlinPluginBuild=1.1.1-release-IJ2017.1-1
jetSignBuild=42.30
jdkBuild=u152b819.1
| Revert to investigate why compilation fails | Revert to investigate why compilation fails
| INI | apache-2.0 | apixandru/intellij-community,asedunov/intellij-community,allotria/intellij-community,allotria/intellij-community,ibinti/intellij-community,vvv1559/intellij-community,xfournet/intellij-community,xfournet/intellij-community,vvv1559/intellij-community,mglukhikh/intellij-community,allotria/intellij-community,ThiagoGarciaAlves/intellij-community,da1z/intellij-community,apixandru/intellij-community,xfournet/intellij-community,vvv1559/intellij-community,apixandru/intellij-community,FHannes/intellij-community,mglukhikh/intellij-community,vvv1559/intellij-community,mglukhikh/intellij-community,ibinti/intellij-community,vvv1559/intellij-community,semonte/intellij-community,da1z/intellij-community,FHannes/intellij-community,vvv1559/intellij-community,xfournet/intellij-community,vvv1559/intellij-community,ThiagoGarciaAlves/intellij-community,ibinti/intellij-community,FHannes/intellij-community,signed/intellij-community,apixandru/intellij-community,allotria/intellij-community,suncycheng/intellij-community,suncycheng/intellij-community,FHannes/intellij-community,allotria/intellij-community,mglukhikh/intellij-community,ThiagoGarciaAlves/intellij-community,da1z/intellij-community,vvv1559/intellij-community,apixandru/intellij-community,suncycheng/intellij-community,signed/intellij-community,semonte/intellij-community,suncycheng/intellij-community,signed/intellij-community,mglukhikh/intellij-community,mglukhikh/intellij-community,allotria/intellij-community,vvv1559/intellij-community,ThiagoGarciaAlves/intellij-community,ibinti/intellij-community,ThiagoGarciaAlves/intellij-community,xfournet/intellij-community,xfournet/intellij-community,suncycheng/intellij-community,xfournet/intellij-community,signed/intellij-community,suncycheng/intellij-community,FHannes/intellij-community,mglukhikh/intellij-community,allotria/intellij-community,da1z/intellij-community,signed/intellij-community,semonte/intellij-community,ibinti/intellij-community,asedunov/intellij-community,xfournet/intellij-community,FHannes/intellij-community,asedunov/intellij-community,vvv1559/intellij-community,apixandru/intellij-community,signed/intellij-community,asedunov/intellij-community,xfournet/intellij-community,signed/intellij-community,da1z/intellij-community,apixandru/intellij-community,ibinti/intellij-community,suncycheng/intellij-community,apixandru/intellij-community,ibinti/intellij-community,FHannes/intellij-community,apixandru/intellij-community,apixandru/intellij-community,asedunov/intellij-community,xfournet/intellij-community,da1z/intellij-community,asedunov/intellij-community,allotria/intellij-community,apixandru/intellij-community,signed/intellij-community,suncycheng/intellij-community,vvv1559/intellij-community,mglukhikh/intellij-community,signed/intellij-community,semonte/intellij-community,semonte/intellij-community,ThiagoGarciaAlves/intellij-community,ThiagoGarciaAlves/intellij-community,apixandru/intellij-community,ibinti/intellij-community,suncycheng/intellij-community,ThiagoGarciaAlves/intellij-community,mglukhikh/intellij-community,asedunov/intellij-community,asedunov/intellij-community,FHannes/intellij-community,xfournet/intellij-community,FHannes/intellij-community,xfournet/intellij-community,asedunov/intellij-community,mglukhikh/intellij-community,FHannes/intellij-community,da1z/intellij-community,allotria/intellij-community,ThiagoGarciaAlves/intellij-community,ibinti/intellij-community,suncycheng/intellij-community,signed/intellij-community,apixandru/intellij-community,asedunov/intellij-community,ThiagoGarciaAlves/intellij-community,semonte/intellij-community,da1z/intellij-community,asedunov/intellij-community,semonte/intellij-community,vvv1559/intellij-community,mglukhikh/intellij-community,allotria/intellij-community,da1z/intellij-community,asedunov/intellij-community,FHannes/intellij-community,ibinti/intellij-community,semonte/intellij-community,da1z/intellij-community,semonte/intellij-community,apixandru/intellij-community,ThiagoGarciaAlves/intellij-community,allotria/intellij-community,allotria/intellij-community,ibinti/intellij-community,signed/intellij-community,da1z/intellij-community,da1z/intellij-community,xfournet/intellij-community,signed/intellij-community,ThiagoGarciaAlves/intellij-community,FHannes/intellij-community,FHannes/intellij-community,semonte/intellij-community,suncycheng/intellij-community,mglukhikh/intellij-community,suncycheng/intellij-community,da1z/intellij-community,ibinti/intellij-community,semonte/intellij-community,signed/intellij-community,asedunov/intellij-community,vvv1559/intellij-community,mglukhikh/intellij-community,semonte/intellij-community,semonte/intellij-community,ibinti/intellij-community,allotria/intellij-community | ini | ## Code Before:
kotlinPluginBuild=1.1.2-eap-69-IJ2017.2-1:EAP-1.1
jetSignBuild=42.30
jdkBuild=u152b819.1
## Instruction:
Revert to investigate why compilation fails
## Code After:
kotlinPluginBuild=1.1.1-release-IJ2017.1-1
jetSignBuild=42.30
jdkBuild=u152b819.1
|
1e0e180c569366def74863d95a98bd147d7bc4d9 | public/js/controllers/createpage.js | public/js/controllers/createpage.js | angular.module('createPageController.controller', [])
.controller('createPageController', function($scope, $http, $routeParams, $location, pageService) {
$scope.message = "first";
$scope.name = $routeParams.name;
$scope.createPage = function(pass) {
pageService.createPage($routeParams.name, pass).success(function(res) {
$location.path('/' + $routeParams.name);
});
};
});
| angular.module('createPageController.controller', [])
.controller('createPageController', function($scope, $http, $routeParams, $location, pageService) {
$scope.message = "first";
$scope.name = $routeParams.name;
pageService.getPage($routeParams.name).success(function() {
$location.path('/' + $routeParams.name);
});
$scope.createPage = function(pass) {
pageService.createPage($routeParams.name, pass).success(function(res) {
$location.path('/' + $routeParams.name);
});
};
});
| Create page will redirect to full page if already created | Create page will redirect to full page if already created
| JavaScript | mit | coffee-cup/pintical,coffee-cup/pintical,coffee-cup/pintical | javascript | ## Code Before:
angular.module('createPageController.controller', [])
.controller('createPageController', function($scope, $http, $routeParams, $location, pageService) {
$scope.message = "first";
$scope.name = $routeParams.name;
$scope.createPage = function(pass) {
pageService.createPage($routeParams.name, pass).success(function(res) {
$location.path('/' + $routeParams.name);
});
};
});
## Instruction:
Create page will redirect to full page if already created
## Code After:
angular.module('createPageController.controller', [])
.controller('createPageController', function($scope, $http, $routeParams, $location, pageService) {
$scope.message = "first";
$scope.name = $routeParams.name;
pageService.getPage($routeParams.name).success(function() {
$location.path('/' + $routeParams.name);
});
$scope.createPage = function(pass) {
pageService.createPage($routeParams.name, pass).success(function(res) {
$location.path('/' + $routeParams.name);
});
};
});
|
8d2b35f374a8ce09a47449ecb48e90900a6a789d | portfolio/frontend/src/containers/SGonksPlatform/Competition/Competition.module.css | portfolio/frontend/src/containers/SGonksPlatform/Competition/Competition.module.css | .Competition {
width: 100%;
height: 100%;
}
.RankingInfoContainer {
}
| .Competition {
margin: auto;
width: 97%;
height: 97%;
display: flex;
flex-direction: row;
align-items: space-between;
justify-content: center;
}
.RankingInfoContainer {
width: 68%;
height: 100%;
margin-right: 1.5%;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.CompInfoContainer {
width: 30%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.RankingsContainer {
background-color: aliceblue;
height: 52%;
border-radius: 7px;
}
.RankingChartContainer {
background-color: orange;
height: 45%;
border-radius: 7px;
}
.UserRankContainer {
height: 45%;
background-color: pink;
border-radius: 7px;
}
.CompDetailsContainer {
height: 52%;
background-color: brown;
border-radius: 7px;
}
| Write overall layout of competition page | Write overall layout of competition page
| CSS | apache-2.0 | googleinterns/sgonks,googleinterns/sgonks,googleinterns/sgonks,googleinterns/sgonks | css | ## Code Before:
.Competition {
width: 100%;
height: 100%;
}
.RankingInfoContainer {
}
## Instruction:
Write overall layout of competition page
## Code After:
.Competition {
margin: auto;
width: 97%;
height: 97%;
display: flex;
flex-direction: row;
align-items: space-between;
justify-content: center;
}
.RankingInfoContainer {
width: 68%;
height: 100%;
margin-right: 1.5%;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.CompInfoContainer {
width: 30%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.RankingsContainer {
background-color: aliceblue;
height: 52%;
border-radius: 7px;
}
.RankingChartContainer {
background-color: orange;
height: 45%;
border-radius: 7px;
}
.UserRankContainer {
height: 45%;
background-color: pink;
border-radius: 7px;
}
.CompDetailsContainer {
height: 52%;
background-color: brown;
border-radius: 7px;
}
|
e9d3dbf38aa4e46ecf3628f5f5d30f78dc8559d0 | .travis.yml | .travis.yml | sudo: false
language: node_js
before_install:
- npm install npm -g
node_js:
- "4"
- "5"
- "6"
- "7"
env:
- TEST_SUITE=test
script: npm run-script $TEST_SUITE
| sudo: false
language: node_js
before_install:
- npm install npm -g
node_js:
- "lts/*"
- "9"
- "10"
env:
- TEST_SUITE=test
script: npm run-script $TEST_SUITE
| Fix Travis by removing v4 and v5 | Fix Travis by removing v4 and v5
| YAML | isc | weilu/bip39,bitcoinjs/bip39,bitcoinjs/bip39 | yaml | ## Code Before:
sudo: false
language: node_js
before_install:
- npm install npm -g
node_js:
- "4"
- "5"
- "6"
- "7"
env:
- TEST_SUITE=test
script: npm run-script $TEST_SUITE
## Instruction:
Fix Travis by removing v4 and v5
## Code After:
sudo: false
language: node_js
before_install:
- npm install npm -g
node_js:
- "lts/*"
- "9"
- "10"
env:
- TEST_SUITE=test
script: npm run-script $TEST_SUITE
|
7b3e6a03279e775974dd43f7ff643f170fc08d1c | Stripe/STPLocalizationUtils.h | Stripe/STPLocalizationUtils.h | //
// STPLocalizedStringUtils.h
// Stripe
//
// Created by Brian Dorfman on 8/11/16.
// Copyright © 2016 Stripe, Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
#define STPLocalizedString(key, comment) \
[STPLocalizationUtils localizedStripeStringForKey:(key)]
@interface STPLocalizationUtils : NSObject
/**
Acts like NSLocalizedString but tries to find the string in the Stripe
bundle first if possible.
*/
+ (nonnull NSString *)localizedStripeStringForKey:(nonnull NSString *)key;
@end
| //
// STPLocalizationUtils.h
// Stripe
//
// Created by Brian Dorfman on 8/11/16.
// Copyright © 2016 Stripe, Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface STPLocalizationUtils : NSObject
/**
Acts like NSLocalizedString but tries to find the string in the Stripe
bundle first if possible.
*/
+ (nonnull NSString *)localizedStripeStringForKey:(nonnull NSString *)key;
@end
static inline NSString * _Nonnull STPLocalizedString(NSString* _Nonnull key, NSString * _Nullable __unused comment) {
return [STPLocalizationUtils localizedStripeStringForKey:key];
}
| Change to use inline function instead of macro. | Change to use inline function instead of macro.
This makes FauxPas's localization checks work properly.
| C | mit | stripe/stripe-ios,NewAmsterdamLabs/stripe-ios,stripe/stripe-ios,fbernardo/stripe-ios,fbernardo/stripe-ios,stripe/stripe-ios,stripe/stripe-ios,stripe/stripe-ios,NewAmsterdamLabs/stripe-ios,fbernardo/stripe-ios,NewAmsterdamLabs/stripe-ios,stripe/stripe-ios,NewAmsterdamLabs/stripe-ios,fbernardo/stripe-ios | c | ## Code Before:
//
// STPLocalizedStringUtils.h
// Stripe
//
// Created by Brian Dorfman on 8/11/16.
// Copyright © 2016 Stripe, Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
#define STPLocalizedString(key, comment) \
[STPLocalizationUtils localizedStripeStringForKey:(key)]
@interface STPLocalizationUtils : NSObject
/**
Acts like NSLocalizedString but tries to find the string in the Stripe
bundle first if possible.
*/
+ (nonnull NSString *)localizedStripeStringForKey:(nonnull NSString *)key;
@end
## Instruction:
Change to use inline function instead of macro.
This makes FauxPas's localization checks work properly.
## Code After:
//
// STPLocalizationUtils.h
// Stripe
//
// Created by Brian Dorfman on 8/11/16.
// Copyright © 2016 Stripe, Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface STPLocalizationUtils : NSObject
/**
Acts like NSLocalizedString but tries to find the string in the Stripe
bundle first if possible.
*/
+ (nonnull NSString *)localizedStripeStringForKey:(nonnull NSString *)key;
@end
static inline NSString * _Nonnull STPLocalizedString(NSString* _Nonnull key, NSString * _Nullable __unused comment) {
return [STPLocalizationUtils localizedStripeStringForKey:key];
}
|
0fd61e28b2977c1e4cdbbb99ae69671ba747c561 | app/Models/Player.php | app/Models/Player.php | <?php
namespace App\Models;
class Player extends \Pragma\ORM\Model
{
const GENOME_HOST = 0;
const GENOME_NORMAL = 1;
const GENOME_RESISTANT = 2;
private $name;
private $keyId;
private $genome;
private $role;
private $paralysed;
private $mutated;
private $alive;
public function __construct($name)
{
return parent::__construct('player');
$this->name = $name;
}
public function setGenome($genome)
{
if ($genome > 0) {
$genome = 1;
} elseif ($genome < 0) {
$genome = -1;
} else {
$genome = 0;
}
$this->genome = $genome;
}
public function mutate()
{
if ($this->genome != self::GENOME_RESISTANT) {
$this->mutated = 1;
}
return $this->mutated;
}
public function cure()
{
if ($this->genome != self::GENOME_HOST) {
$this->mutated = 0;
}
return !$this->mutated;
}
}
| <?php
namespace App\Models;
class Player extends \Pragma\ORM\Model
{
const GENOME_HOST = 0;
const GENOME_NORMAL = 1;
const GENOME_RESISTANT = 2;
private $name;
private $keyId;
private $genome;
private $role;
private $paralysed;
private $mutated;
private $alive;
public function __construct($name)
{
return parent::__construct('player');
$this->name = $name;
}
public function setGenome($genome)
{
if (!in_array($genome, [self::GENOME_HOST, self::GENOME_RESISTANT, self::GENOME_NORMAL])) {
$genome = self::GENOME_NORMAL;
}
$this->genome = $genome;
}
public function mutate()
{
if ($this->genome != self::GENOME_RESISTANT) {
$this->mutated = 1;
}
return $this->mutated;
}
public function cure()
{
if ($this->genome != self::GENOME_HOST) {
$this->mutated = 0;
}
return !$this->mutated;
}
}
| Test genome param against class constants | Test genome param against class constants
| PHP | mit | gitus/sporz,pips-/sporz | php | ## Code Before:
<?php
namespace App\Models;
class Player extends \Pragma\ORM\Model
{
const GENOME_HOST = 0;
const GENOME_NORMAL = 1;
const GENOME_RESISTANT = 2;
private $name;
private $keyId;
private $genome;
private $role;
private $paralysed;
private $mutated;
private $alive;
public function __construct($name)
{
return parent::__construct('player');
$this->name = $name;
}
public function setGenome($genome)
{
if ($genome > 0) {
$genome = 1;
} elseif ($genome < 0) {
$genome = -1;
} else {
$genome = 0;
}
$this->genome = $genome;
}
public function mutate()
{
if ($this->genome != self::GENOME_RESISTANT) {
$this->mutated = 1;
}
return $this->mutated;
}
public function cure()
{
if ($this->genome != self::GENOME_HOST) {
$this->mutated = 0;
}
return !$this->mutated;
}
}
## Instruction:
Test genome param against class constants
## Code After:
<?php
namespace App\Models;
class Player extends \Pragma\ORM\Model
{
const GENOME_HOST = 0;
const GENOME_NORMAL = 1;
const GENOME_RESISTANT = 2;
private $name;
private $keyId;
private $genome;
private $role;
private $paralysed;
private $mutated;
private $alive;
public function __construct($name)
{
return parent::__construct('player');
$this->name = $name;
}
public function setGenome($genome)
{
if (!in_array($genome, [self::GENOME_HOST, self::GENOME_RESISTANT, self::GENOME_NORMAL])) {
$genome = self::GENOME_NORMAL;
}
$this->genome = $genome;
}
public function mutate()
{
if ($this->genome != self::GENOME_RESISTANT) {
$this->mutated = 1;
}
return $this->mutated;
}
public function cure()
{
if ($this->genome != self::GENOME_HOST) {
$this->mutated = 0;
}
return !$this->mutated;
}
}
|
78e7c80d4c6ace44896ab77f1025b8ce7f9f1368 | app/Http/Controllers/TaxOfficeNameTrait.php | app/Http/Controllers/TaxOfficeNameTrait.php | <?php
/*
* This file is part of Bens Penhorados, an undergraduate capstone project.
*
* (c) Fábio Santos <ffsantos92@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Http\Controllers;
use App\Models\Attributes\Generic\Municipality;
/**
* This is the tax office name trait.
*
* @author Fábio Santos <ffsantos92@gmail.com>
*/
trait TaxOfficeNameTrait
{
/**
* Get the tax office name.
*
* @param \Illuminate\Database\Eloquent\Collection $generic
*
* @return string
*/
public static function getTaxOfficeName($office)
{
$name = $office->code.' - ';
$name .= $office->municipality->name;
if ($office->number) {
$name .= ' ('.$office->number.')';
}
return $name;
}
}
| <?php
/*
* This file is part of Bens Penhorados, an undergraduate capstone project.
*
* (c) Fábio Santos <ffsantos92@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Http\Controllers;
/**
* This is the tax office name trait.
*
* @author Fábio Santos <ffsantos92@gmail.com>
*/
trait TaxOfficeNameTrait
{
/**
* Get the tax office name.
*
* @param \Illuminate\Database\Eloquent\Collection $office
*
* @return string
*/
public static function getTaxOfficeName($office)
{
$name = $office->code.' - ';
$name .= $office->municipality->name;
if ($office->number) {
$name .= ' ('.$office->number.')';
}
return $name;
}
}
| Fix phpdocs; Remove unused import | Fix phpdocs; Remove unused import
| PHP | mit | ffsantos92/bens-penhorados,ffsantos92/bens-penhorados,ffsantos92/bens-penhorados | php | ## Code Before:
<?php
/*
* This file is part of Bens Penhorados, an undergraduate capstone project.
*
* (c) Fábio Santos <ffsantos92@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Http\Controllers;
use App\Models\Attributes\Generic\Municipality;
/**
* This is the tax office name trait.
*
* @author Fábio Santos <ffsantos92@gmail.com>
*/
trait TaxOfficeNameTrait
{
/**
* Get the tax office name.
*
* @param \Illuminate\Database\Eloquent\Collection $generic
*
* @return string
*/
public static function getTaxOfficeName($office)
{
$name = $office->code.' - ';
$name .= $office->municipality->name;
if ($office->number) {
$name .= ' ('.$office->number.')';
}
return $name;
}
}
## Instruction:
Fix phpdocs; Remove unused import
## Code After:
<?php
/*
* This file is part of Bens Penhorados, an undergraduate capstone project.
*
* (c) Fábio Santos <ffsantos92@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Http\Controllers;
/**
* This is the tax office name trait.
*
* @author Fábio Santos <ffsantos92@gmail.com>
*/
trait TaxOfficeNameTrait
{
/**
* Get the tax office name.
*
* @param \Illuminate\Database\Eloquent\Collection $office
*
* @return string
*/
public static function getTaxOfficeName($office)
{
$name = $office->code.' - ';
$name .= $office->municipality->name;
if ($office->number) {
$name .= ' ('.$office->number.')';
}
return $name;
}
}
|
e29d5b8858ae12f4ddf8a3b1d04fc631fc1ddec1 | src/iota/lib.rs | src/iota/lib.rs | //! Iota
//!
//! A highly customisable text editor built with modern hardware in mind.
//!
//! This module contains all you need to create an `iota` executable.
#![cfg_attr(feature="clippy", feature(plugin))]
#![cfg_attr(feature="clippy", plugin(clippy))]
#![warn(missing_docs)]
#![feature(concat_idents)]
#![feature(stmt_expr_attributes)]
#[cfg(feature="syntax-highlighting")] extern crate syntect;
extern crate rustbox;
extern crate gapbuffer;
extern crate tempdir;
extern crate regex;
extern crate unicode_width;
#[macro_use] extern crate lazy_static;
pub use editor::Editor;
pub use input::Input;
pub use frontends::RustboxFrontend;
pub use modes::{StandardMode, NormalMode, Mode};
mod input;
mod utils;
mod buffer;
mod editor;
mod keyboard;
mod keymap;
mod view;
mod uibuf;
mod log;
mod frontends;
mod modes;
mod overlay;
mod command;
mod textobject;
mod iterators;
| //! Iota
//!
//! A highly customisable text editor built with modern hardware in mind.
//!
//! This module contains all you need to create an `iota` executable.
#![cfg_attr(feature="clippy", feature(plugin))]
#![cfg_attr(feature="clippy", plugin(clippy))]
#![warn(missing_docs)]
#[cfg(feature="syntax-highlighting")] extern crate syntect;
extern crate rustbox;
extern crate gapbuffer;
extern crate tempdir;
extern crate regex;
extern crate unicode_width;
#[macro_use] extern crate lazy_static;
pub use editor::Editor;
pub use input::Input;
pub use frontends::RustboxFrontend;
pub use modes::{StandardMode, NormalMode, Mode};
mod input;
mod utils;
mod buffer;
mod editor;
mod keyboard;
mod keymap;
mod view;
mod uibuf;
mod log;
mod frontends;
mod modes;
mod overlay;
mod command;
mod textobject;
mod iterators;
| Move back to stable rust | Move back to stable rust
| Rust | mit | gchp/iota | rust | ## Code Before:
//! Iota
//!
//! A highly customisable text editor built with modern hardware in mind.
//!
//! This module contains all you need to create an `iota` executable.
#![cfg_attr(feature="clippy", feature(plugin))]
#![cfg_attr(feature="clippy", plugin(clippy))]
#![warn(missing_docs)]
#![feature(concat_idents)]
#![feature(stmt_expr_attributes)]
#[cfg(feature="syntax-highlighting")] extern crate syntect;
extern crate rustbox;
extern crate gapbuffer;
extern crate tempdir;
extern crate regex;
extern crate unicode_width;
#[macro_use] extern crate lazy_static;
pub use editor::Editor;
pub use input::Input;
pub use frontends::RustboxFrontend;
pub use modes::{StandardMode, NormalMode, Mode};
mod input;
mod utils;
mod buffer;
mod editor;
mod keyboard;
mod keymap;
mod view;
mod uibuf;
mod log;
mod frontends;
mod modes;
mod overlay;
mod command;
mod textobject;
mod iterators;
## Instruction:
Move back to stable rust
## Code After:
//! Iota
//!
//! A highly customisable text editor built with modern hardware in mind.
//!
//! This module contains all you need to create an `iota` executable.
#![cfg_attr(feature="clippy", feature(plugin))]
#![cfg_attr(feature="clippy", plugin(clippy))]
#![warn(missing_docs)]
#[cfg(feature="syntax-highlighting")] extern crate syntect;
extern crate rustbox;
extern crate gapbuffer;
extern crate tempdir;
extern crate regex;
extern crate unicode_width;
#[macro_use] extern crate lazy_static;
pub use editor::Editor;
pub use input::Input;
pub use frontends::RustboxFrontend;
pub use modes::{StandardMode, NormalMode, Mode};
mod input;
mod utils;
mod buffer;
mod editor;
mod keyboard;
mod keymap;
mod view;
mod uibuf;
mod log;
mod frontends;
mod modes;
mod overlay;
mod command;
mod textobject;
mod iterators;
|
cb0db8a40c43b6f863efe1e14e5d1ff9cdf81e3c | server/nlp.js | server/nlp.js | var service=require('./services/service.js');
var Client = require('node-rest-client').Client;
module.exports= {
getResponse :function(message,callback){
processMessage(message,function(processed){
if(processed){
if(processed.intent!='none'){
service[processed.intent](processed.entities,function(message){
callback(message);
});
}
}
else { callback("Sorry.I don't know.")}
});
//if(processed.
}
}
processMessage= function(message,callback){
var client = new Client();
var args={
parameters : {id: "104ea5b9-50ad-4b90-8c54-6bd8c27a391f",'subscription-key': "cd3ab42d747b45cb9ecf0c1796ed32ef",q:message}
}
var req=client.get("https://api.projectoxford.ai/luis/v1/application",args,
function(data,response){
callback({intent:data.intents[0].intent,entities:data.entities});
});
req.on('error', function (err) {
console.log('request error', err);
callback({intent:'error'});
});
}
//console.log(processMessage("send me ppmc url")); | var service=require('./services/service.js');
var Client = require('node-rest-client').Client;
module.exports= {
getResponse :function(message,callback){
processMessage(message,function(processed){
if(processed){
if(processed.intent!='none'){
service[processed.intent](processed.entities,function(message){
callback(message);
});
}
}
else { callback("Sorry.I don't know.")}
});
//if(processed.
}
}
processMessage= function(message,callback){
var client = new Client();
var args={
parameters : {id: "Application.ID",'subscription-key': "Application.KEY",q:message}
}
var req=client.get("https://api.projectoxford.ai/luis/v1/application",args,
function(data,response){
callback({intent:data.intents[0].intent,entities:data.entities});
});
req.on('error', function (err) {
console.log('request error', err);
callback({intent:'error'});
});
}
//console.log(processMessage("send me ppmc url"));
| Remove id,subscription key for LUIS | Remove id,subscription key for LUIS | JavaScript | apache-2.0 | thayumaanavan/electron-chatbot-template,thayumaanavan/electron-chatbot-template | javascript | ## Code Before:
var service=require('./services/service.js');
var Client = require('node-rest-client').Client;
module.exports= {
getResponse :function(message,callback){
processMessage(message,function(processed){
if(processed){
if(processed.intent!='none'){
service[processed.intent](processed.entities,function(message){
callback(message);
});
}
}
else { callback("Sorry.I don't know.")}
});
//if(processed.
}
}
processMessage= function(message,callback){
var client = new Client();
var args={
parameters : {id: "104ea5b9-50ad-4b90-8c54-6bd8c27a391f",'subscription-key': "cd3ab42d747b45cb9ecf0c1796ed32ef",q:message}
}
var req=client.get("https://api.projectoxford.ai/luis/v1/application",args,
function(data,response){
callback({intent:data.intents[0].intent,entities:data.entities});
});
req.on('error', function (err) {
console.log('request error', err);
callback({intent:'error'});
});
}
//console.log(processMessage("send me ppmc url"));
## Instruction:
Remove id,subscription key for LUIS
## Code After:
var service=require('./services/service.js');
var Client = require('node-rest-client').Client;
module.exports= {
getResponse :function(message,callback){
processMessage(message,function(processed){
if(processed){
if(processed.intent!='none'){
service[processed.intent](processed.entities,function(message){
callback(message);
});
}
}
else { callback("Sorry.I don't know.")}
});
//if(processed.
}
}
processMessage= function(message,callback){
var client = new Client();
var args={
parameters : {id: "Application.ID",'subscription-key': "Application.KEY",q:message}
}
var req=client.get("https://api.projectoxford.ai/luis/v1/application",args,
function(data,response){
callback({intent:data.intents[0].intent,entities:data.entities});
});
req.on('error', function (err) {
console.log('request error', err);
callback({intent:'error'});
});
}
//console.log(processMessage("send me ppmc url"));
|
5232d2fd4ef1e90fa328d3851925a9d20e8d34fc | tests/dummy/app/templates/index.hbs | tests/dummy/app/templates/index.hbs | <h1 class="page-header">ivy-codemirror</h1>
<div class="row">
<div class="col-sm-9">
{{ivy-codemirror lineNumbers=lineNumbers lineWrapping=lineWrapping mode=mode readOnly=readOnly smartIndent=smartIndent theme=theme value=value}}
</div>
<div class="col-sm-3">
<div class="form-group">
<label class="control-label" for="mode">Mode</label>
{{view Ember.Select class="form-control" content=modes id="mode" value=mode}}
</div>
<div class="form-group">
<label class="control-label" for="theme">Theme</label>
{{view Ember.Select class="form-control" content=themes id="theme" value=theme}}
</div>
<div class="checkbox">
<label>
{{input checked=lineNumbers type="checkbox"}} Line numbers
</label>
</div>
<div class="checkbox">
<label>
{{input checked=lineWrapping type="checkbox"}} Line wrapping
</label>
</div>
<div class="checkbox">
<label>
{{input checked=readOnly type="checkbox"}} Read-only
</label>
</div>
<div class="checkbox">
<label>
{{input checked=smartIndent type="checkbox"}} Smart indent
</label>
</div>
</div>
</div>
| <h1 class="page-header">ivy-codemirror</h1>
<div class="row">
<div class="col-sm-9">
{{ivy-codemirror lineNumbers=lineNumbers lineWrapping=lineWrapping mode=mode readOnly=readOnly smartIndent=smartIndent theme=theme value=value}}
</div>
<div class="col-sm-3">
<div class="form-group">
<label class="control-label" for="mode">Mode</label>
{{view "select" class="form-control" content=modes id="mode" value=mode}}
</div>
<div class="form-group">
<label class="control-label" for="theme">Theme</label>
{{view "select" class="form-control" content=themes id="theme" value=theme}}
</div>
<div class="checkbox">
<label>
{{input checked=lineNumbers type="checkbox"}} Line numbers
</label>
</div>
<div class="checkbox">
<label>
{{input checked=lineWrapping type="checkbox"}} Line wrapping
</label>
</div>
<div class="checkbox">
<label>
{{input checked=readOnly type="checkbox"}} Read-only
</label>
</div>
<div class="checkbox">
<label>
{{input checked=smartIndent type="checkbox"}} Smart indent
</label>
</div>
</div>
</div>
| Fix deprecation warnings in dummy app. | Fix deprecation warnings in dummy app.
| Handlebars | mit | HeroicEric/ivy-codemirror,IvyApp/ivy-codemirror,IvyApp/ivy-codemirror,HeroicEric/ivy-codemirror,mshafir/ivy-codemirror,mshafir/ivy-codemirror,mshafir/ivy-codemirror,HeroicEric/ivy-codemirror | handlebars | ## Code Before:
<h1 class="page-header">ivy-codemirror</h1>
<div class="row">
<div class="col-sm-9">
{{ivy-codemirror lineNumbers=lineNumbers lineWrapping=lineWrapping mode=mode readOnly=readOnly smartIndent=smartIndent theme=theme value=value}}
</div>
<div class="col-sm-3">
<div class="form-group">
<label class="control-label" for="mode">Mode</label>
{{view Ember.Select class="form-control" content=modes id="mode" value=mode}}
</div>
<div class="form-group">
<label class="control-label" for="theme">Theme</label>
{{view Ember.Select class="form-control" content=themes id="theme" value=theme}}
</div>
<div class="checkbox">
<label>
{{input checked=lineNumbers type="checkbox"}} Line numbers
</label>
</div>
<div class="checkbox">
<label>
{{input checked=lineWrapping type="checkbox"}} Line wrapping
</label>
</div>
<div class="checkbox">
<label>
{{input checked=readOnly type="checkbox"}} Read-only
</label>
</div>
<div class="checkbox">
<label>
{{input checked=smartIndent type="checkbox"}} Smart indent
</label>
</div>
</div>
</div>
## Instruction:
Fix deprecation warnings in dummy app.
## Code After:
<h1 class="page-header">ivy-codemirror</h1>
<div class="row">
<div class="col-sm-9">
{{ivy-codemirror lineNumbers=lineNumbers lineWrapping=lineWrapping mode=mode readOnly=readOnly smartIndent=smartIndent theme=theme value=value}}
</div>
<div class="col-sm-3">
<div class="form-group">
<label class="control-label" for="mode">Mode</label>
{{view "select" class="form-control" content=modes id="mode" value=mode}}
</div>
<div class="form-group">
<label class="control-label" for="theme">Theme</label>
{{view "select" class="form-control" content=themes id="theme" value=theme}}
</div>
<div class="checkbox">
<label>
{{input checked=lineNumbers type="checkbox"}} Line numbers
</label>
</div>
<div class="checkbox">
<label>
{{input checked=lineWrapping type="checkbox"}} Line wrapping
</label>
</div>
<div class="checkbox">
<label>
{{input checked=readOnly type="checkbox"}} Read-only
</label>
</div>
<div class="checkbox">
<label>
{{input checked=smartIndent type="checkbox"}} Smart indent
</label>
</div>
</div>
</div>
|
07fec59c45da5f8d6582fb15da3368c19c955a0a | test/test_json.cpp | test/test_json.cpp | //#include "../pb2json.h"
#include <pb2json.h>
using namespace std;
int main(int argc,char *argv[])
{
// Test 1: read binary PB from a file and convert it to JSON
ifstream fin("dump",ios::binary);
fin.seekg(0,ios_base::end);
size_t len = fin.tellg();
fin.seekg(0,ios_base::beg);
char *buf = new char [len];
fin.read(buf,len);
google::protobuf::Message *p = new Person();
char *json = pb2json(p,buf,len);
cout<<json<<endl;
free(json);
delete p;
// Test 2: convert PB to JSON directly
Person p2;
char *json2 = pb2json(p2);
cout<<json2<<endl;
free(json2);
return 0;
}
| //#include "../pb2json.h"
#include <pb2json.h>
using namespace std;
int main(int argc,char *argv[])
{
// Test 1: read binary PB from a file and convert it to JSON
ifstream fin("dump",ios::binary);
fin.seekg(0,ios_base::end);
size_t len = fin.tellg();
fin.seekg(0,ios_base::beg);
char *buf = new char [len];
fin.read(buf,len);
google::protobuf::Message *p = new Person();
char *json = pb2json(p,buf,len);
cout<<json<<endl;
free(json);
delete p;
// Test 2: convert PB to JSON directly
Person p2;
p2.set_name("Shafreeck Sea");
p2.set_id(2);
p2.set_email("renenglish@gmail.com");
Person_PhoneNumber *pn1 = p2.add_phone();
pn1->set_number("1234567");
pn1->set_type(Person::HOME);
char *json2 = pb2json(p2);
cout<<json2<<endl;
free(json2);
return 0;
}
| Add test translate protobuf object to json directly | Add test translate protobuf object to json directly
| C++ | mit | iguchunhui/pb2json,iguchunhui/pb2json,shafreeck/pb2json,shafreeck/pb2json | c++ | ## Code Before:
//#include "../pb2json.h"
#include <pb2json.h>
using namespace std;
int main(int argc,char *argv[])
{
// Test 1: read binary PB from a file and convert it to JSON
ifstream fin("dump",ios::binary);
fin.seekg(0,ios_base::end);
size_t len = fin.tellg();
fin.seekg(0,ios_base::beg);
char *buf = new char [len];
fin.read(buf,len);
google::protobuf::Message *p = new Person();
char *json = pb2json(p,buf,len);
cout<<json<<endl;
free(json);
delete p;
// Test 2: convert PB to JSON directly
Person p2;
char *json2 = pb2json(p2);
cout<<json2<<endl;
free(json2);
return 0;
}
## Instruction:
Add test translate protobuf object to json directly
## Code After:
//#include "../pb2json.h"
#include <pb2json.h>
using namespace std;
int main(int argc,char *argv[])
{
// Test 1: read binary PB from a file and convert it to JSON
ifstream fin("dump",ios::binary);
fin.seekg(0,ios_base::end);
size_t len = fin.tellg();
fin.seekg(0,ios_base::beg);
char *buf = new char [len];
fin.read(buf,len);
google::protobuf::Message *p = new Person();
char *json = pb2json(p,buf,len);
cout<<json<<endl;
free(json);
delete p;
// Test 2: convert PB to JSON directly
Person p2;
p2.set_name("Shafreeck Sea");
p2.set_id(2);
p2.set_email("renenglish@gmail.com");
Person_PhoneNumber *pn1 = p2.add_phone();
pn1->set_number("1234567");
pn1->set_type(Person::HOME);
char *json2 = pb2json(p2);
cout<<json2<<endl;
free(json2);
return 0;
}
|
d02e7d7d7685a7a8ba1e7ebf32913e8f503e98d1 | TWLight/emails/templates/emails/comment_notification_editors-body-html.html | TWLight/emails/templates/emails/comment_notification_editors-body-html.html | {% load i18n %}
{% comment %} Translator: This email is sent to users when they receive a comment on their application. Don't translate {{ partner }} or {{ app_url }}.{% endcomment %}
{% blocktrans trimmed with partner=app.partner user=app.user %}
Dear {{ user }},
Thank you for applying for access to {{ partner }} resources through The Wikipedia Library. There are one or more comments on your application that require a response from you. Please reply to these at {{ app_url }} so we can evaluate your application.
Best,
The Wikipedia Library
{% endblocktrans %}
| {% load i18n %}
{% comment %} Translator: This email is sent to users when they receive a comment on their application. Don't translate {{ user }}, {{ partner }} or {{ app_url }}.{% endcomment %}
{% blocktrans trimmed with partner=app.partner user=app.user %}
Dear {{ user }},
Thank you for applying for access to {{ partner }} resources through The Wikipedia Library. There are one or more comments on your application that require a response from you. Please reply to these at {{ app_url }} so we can evaluate your application.
Best,
The Wikipedia Library
{% endblocktrans %}
| Add another tag not to be translated | Add another tag not to be translated | HTML | mit | WikipediaLibrary/TWLight,WikipediaLibrary/TWLight,WikipediaLibrary/TWLight,WikipediaLibrary/TWLight,WikipediaLibrary/TWLight | html | ## Code Before:
{% load i18n %}
{% comment %} Translator: This email is sent to users when they receive a comment on their application. Don't translate {{ partner }} or {{ app_url }}.{% endcomment %}
{% blocktrans trimmed with partner=app.partner user=app.user %}
Dear {{ user }},
Thank you for applying for access to {{ partner }} resources through The Wikipedia Library. There are one or more comments on your application that require a response from you. Please reply to these at {{ app_url }} so we can evaluate your application.
Best,
The Wikipedia Library
{% endblocktrans %}
## Instruction:
Add another tag not to be translated
## Code After:
{% load i18n %}
{% comment %} Translator: This email is sent to users when they receive a comment on their application. Don't translate {{ user }}, {{ partner }} or {{ app_url }}.{% endcomment %}
{% blocktrans trimmed with partner=app.partner user=app.user %}
Dear {{ user }},
Thank you for applying for access to {{ partner }} resources through The Wikipedia Library. There are one or more comments on your application that require a response from you. Please reply to these at {{ app_url }} so we can evaluate your application.
Best,
The Wikipedia Library
{% endblocktrans %}
|
03365dc3bf0f0d3a8bed074b8212a83092148325 | CHANGELOG.md | CHANGELOG.md | All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## [0.0.3] - 2015-03-11
### Added
- include into payload the URI of the build for Semaphore
### Fixed
- fix spec helper ENV allowing to update ENV for a test | All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## [0.0.4] - 2015-04-18
### Fixed
- fix SSL error on some platform by embedding bundle of root certs
## [0.0.3] - 2015-03-11
### Added
- include into payload the URI of the build for Semaphore
### Fixed
- fix spec helper ENV allowing to update ENV for a test
| Add forgotten update of changelog for 0.0.4 | Add forgotten update of changelog for 0.0.4
| Markdown | mit | 8thcolor/pullreview-coverage | markdown | ## Code Before:
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## [0.0.3] - 2015-03-11
### Added
- include into payload the URI of the build for Semaphore
### Fixed
- fix spec helper ENV allowing to update ENV for a test
## Instruction:
Add forgotten update of changelog for 0.0.4
## Code After:
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## [0.0.4] - 2015-04-18
### Fixed
- fix SSL error on some platform by embedding bundle of root certs
## [0.0.3] - 2015-03-11
### Added
- include into payload the URI of the build for Semaphore
### Fixed
- fix spec helper ENV allowing to update ENV for a test
|
24821b5195d25be204d46971aaa1e5dd5af83477 | tests/CMakeLists.txt | tests/CMakeLists.txt | file(GLOB TEST_SOURCE_PATHS "*.cpp")
foreach(TEST_SOURCE_PATH ${TEST_SOURCE_PATHS})
get_filename_component(TEST_SOURCE_NAME ${TEST_SOURCE_PATH} NAME)
string(REPLACE ".cpp" "" TEST_NAME ${TEST_SOURCE_NAME})
add_executable(${TEST_NAME} ${TEST_SOURCE_PATH})
target_link_libraries(${TEST_NAME} PRIVATE autocheck::autocheck)
target_link_libraries(${TEST_NAME} PRIVATE GTest::Main)
add_test(NAME ${TEST_NAME} COMMAND ${TEST_NAME})
endforeach(TEST_SOURCE_PATH ${TEST_SOURCE_PATHS})
| function(add_test_from_target TARGET)
add_test(
NAME ${TARGET}_build
COMMAND
${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target ${TARGET}
)
add_test(NAME ${TARGET} COMMAND ${TARGET})
set_tests_properties(${TARGET} PROPERTIES DEPENDS ${TARGET}_build)
endfunction(add_test_from_target TARGET)
# file(GLOB TEST_SOURCE_PATHS "*.cpp" CONFIGURE_DEPENDS)
file(GLOB TEST_SOURCE_PATHS "*.cpp")
foreach(TEST_SOURCE_PATH ${TEST_SOURCE_PATHS})
get_filename_component(TEST_SOURCE_NAME ${TEST_SOURCE_PATH} NAME)
string(REPLACE ".cpp" "" TARGET ${TEST_SOURCE_NAME})
add_executable(${TARGET} EXCLUDE_FROM_ALL ${TEST_SOURCE_PATH})
target_link_libraries(${TARGET} PRIVATE autocheck::autocheck)
target_link_libraries(${TARGET} PRIVATE GTest::Main)
add_test_from_target(${TARGET})
endforeach(TEST_SOURCE_PATH ${TEST_SOURCE_PATHS})
| Build tests only for ctest | Build tests only for ctest
| Text | isc | thejohnfreeman/autocheck,thejohnfreeman/autocheck | text | ## Code Before:
file(GLOB TEST_SOURCE_PATHS "*.cpp")
foreach(TEST_SOURCE_PATH ${TEST_SOURCE_PATHS})
get_filename_component(TEST_SOURCE_NAME ${TEST_SOURCE_PATH} NAME)
string(REPLACE ".cpp" "" TEST_NAME ${TEST_SOURCE_NAME})
add_executable(${TEST_NAME} ${TEST_SOURCE_PATH})
target_link_libraries(${TEST_NAME} PRIVATE autocheck::autocheck)
target_link_libraries(${TEST_NAME} PRIVATE GTest::Main)
add_test(NAME ${TEST_NAME} COMMAND ${TEST_NAME})
endforeach(TEST_SOURCE_PATH ${TEST_SOURCE_PATHS})
## Instruction:
Build tests only for ctest
## Code After:
function(add_test_from_target TARGET)
add_test(
NAME ${TARGET}_build
COMMAND
${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target ${TARGET}
)
add_test(NAME ${TARGET} COMMAND ${TARGET})
set_tests_properties(${TARGET} PROPERTIES DEPENDS ${TARGET}_build)
endfunction(add_test_from_target TARGET)
# file(GLOB TEST_SOURCE_PATHS "*.cpp" CONFIGURE_DEPENDS)
file(GLOB TEST_SOURCE_PATHS "*.cpp")
foreach(TEST_SOURCE_PATH ${TEST_SOURCE_PATHS})
get_filename_component(TEST_SOURCE_NAME ${TEST_SOURCE_PATH} NAME)
string(REPLACE ".cpp" "" TARGET ${TEST_SOURCE_NAME})
add_executable(${TARGET} EXCLUDE_FROM_ALL ${TEST_SOURCE_PATH})
target_link_libraries(${TARGET} PRIVATE autocheck::autocheck)
target_link_libraries(${TARGET} PRIVATE GTest::Main)
add_test_from_target(${TARGET})
endforeach(TEST_SOURCE_PATH ${TEST_SOURCE_PATHS})
|
f1c14152364acd1bcadb775f622c7f3de6936b97 | .github/workflows/awstest.yml | .github/workflows/awstest.yml | name: AWS Megatests
# This workflow is triggered on PRs to the master branch.
# It runs the -profile 'test' on AWS batch
on:
pull_request:
branches:
- 'master'
release:
types: [published]
jobs:
run-awstest:
name: Run AWS test
runs-on: ubuntu-latest
steps:
- name: Setup Miniconda
uses: goanpeca/setup-miniconda@v1.0.2
with:
auto-update-conda: true
python-version: 3.7
- name: Install awscli
run: conda install -c conda-forge awscli
- name: Start AWS batch job
env:
AWS_ACCESS_KEY_ID: ${{secrets.AWS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_KEY_SECRET}}
TOWER_ACCESS_TOKEN: ${{secrets.TOWER_ACCESS_TOKEN}}
run: |
aws batch submit-job --region eu-west-1 --job-name nf-core-sarek --job-queue 'default-8b3836e0-5eda-11ea-96e5-0a2c3f6a2a32' --job-definition nextflow --container-overrides command=nf-core/sarek,"-r ${GITHUB_SHA} -profile test --outdir s3://nf-core-awsmegatests/sarek/results-${GITHUB_SHA} -w s3://nf-core-awsmegatests/sarek/work-${GITHUB_SHA}"
| name: AWS Megatests
# This workflow is triggered on PRs to the master branch.
# It runs the -profile 'test' on AWS batch
on:
pull_request:
branches:
- master
release:
types: [published]
jobs:
run-awstest:
name: Run AWS test
runs-on: ubuntu-latest
steps:
- name: Setup Miniconda
uses: goanpeca/setup-miniconda@v1.0.2
with:
auto-update-conda: true
python-version: 3.7
- name: Install awscli
run: conda install -c conda-forge awscli
- name: Start AWS batch job
env:
AWS_ACCESS_KEY_ID: ${{secrets.AWS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_KEY_SECRET}}
TOWER_ACCESS_TOKEN: ${{secrets.TOWER_ACCESS_TOKEN}}
run: |
aws batch submit-job --region eu-west-1 --job-name nf-core-sarek --job-queue 'default-8b3836e0-5eda-11ea-96e5-0a2c3f6a2a32' --job-definition nextflow --container-overrides '{"command": ["nf-core/sarek", "-r ${GITHUB_SHA} -profile test --outdir s3://nf-core-awsmegatests/sarek/results-${GITHUB_SHA} -w s3://nf-core-awsmegatests/sarek/work-${GITHUB_SHA} -with-tower"], "environment": [{"name": "TOWER_ACCESS_TOKEN", "value": "'"$TOWER_ACCESS_TOKEN"'"}]}'
| Add nextflow tower properly as suggested | Add nextflow tower properly as suggested
| YAML | mit | MaxUlysse/CAW,MaxUlysse/CAW,MaxUlysse/CAW | yaml | ## Code Before:
name: AWS Megatests
# This workflow is triggered on PRs to the master branch.
# It runs the -profile 'test' on AWS batch
on:
pull_request:
branches:
- 'master'
release:
types: [published]
jobs:
run-awstest:
name: Run AWS test
runs-on: ubuntu-latest
steps:
- name: Setup Miniconda
uses: goanpeca/setup-miniconda@v1.0.2
with:
auto-update-conda: true
python-version: 3.7
- name: Install awscli
run: conda install -c conda-forge awscli
- name: Start AWS batch job
env:
AWS_ACCESS_KEY_ID: ${{secrets.AWS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_KEY_SECRET}}
TOWER_ACCESS_TOKEN: ${{secrets.TOWER_ACCESS_TOKEN}}
run: |
aws batch submit-job --region eu-west-1 --job-name nf-core-sarek --job-queue 'default-8b3836e0-5eda-11ea-96e5-0a2c3f6a2a32' --job-definition nextflow --container-overrides command=nf-core/sarek,"-r ${GITHUB_SHA} -profile test --outdir s3://nf-core-awsmegatests/sarek/results-${GITHUB_SHA} -w s3://nf-core-awsmegatests/sarek/work-${GITHUB_SHA}"
## Instruction:
Add nextflow tower properly as suggested
## Code After:
name: AWS Megatests
# This workflow is triggered on PRs to the master branch.
# It runs the -profile 'test' on AWS batch
on:
pull_request:
branches:
- master
release:
types: [published]
jobs:
run-awstest:
name: Run AWS test
runs-on: ubuntu-latest
steps:
- name: Setup Miniconda
uses: goanpeca/setup-miniconda@v1.0.2
with:
auto-update-conda: true
python-version: 3.7
- name: Install awscli
run: conda install -c conda-forge awscli
- name: Start AWS batch job
env:
AWS_ACCESS_KEY_ID: ${{secrets.AWS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_KEY_SECRET}}
TOWER_ACCESS_TOKEN: ${{secrets.TOWER_ACCESS_TOKEN}}
run: |
aws batch submit-job --region eu-west-1 --job-name nf-core-sarek --job-queue 'default-8b3836e0-5eda-11ea-96e5-0a2c3f6a2a32' --job-definition nextflow --container-overrides '{"command": ["nf-core/sarek", "-r ${GITHUB_SHA} -profile test --outdir s3://nf-core-awsmegatests/sarek/results-${GITHUB_SHA} -w s3://nf-core-awsmegatests/sarek/work-${GITHUB_SHA} -with-tower"], "environment": [{"name": "TOWER_ACCESS_TOKEN", "value": "'"$TOWER_ACCESS_TOKEN"'"}]}'
|
13e96fced0341dfa2002c6de9a17ff241fa9cc81 | packages/linter/src/rules/AmpImgUsesSrcSet.ts | packages/linter/src/rules/AmpImgUsesSrcSet.ts | import { Context } from "../index";
import { Rule } from "../rule";
const SVG_URL_PATTERN = /^[^?]+\.svg(\?.*)?$/i
export class AmpImgUsesSrcSet extends Rule {
async run(context: Context) {
const $ = context.$;
const incorrectImages = $("amp-img")
.filter((_, e) => {
const src = $(e).attr("src");
const layout = $(e).attr("layout");
const srcset = $(e).attr("srcset");
return (
!SVG_URL_PATTERN.exec(src)
&& layout && layout !== 'fixed' && layout != 'fixed-height'
&& !srcset
)
});
if (incorrectImages.length > 0) {
return this.warn(
"Not all responsive <amp-img> define a srcset. Using AMP Optimizer might help."
);
}
return this.pass();
}
meta() {
return {
url: "https://amp.dev/documentation/guides-and-tutorials/optimize-and-measure/amp-optimizer-guide/explainer/?format=websites#image-optimization",
title: "Responsive <amp-img> uses srcset",
info: "",
};
}
}
| import { Context } from "../index";
import { Rule } from "../rule";
const SVG_URL_PATTERN = /^[^?]+\.svg(\?.*)?$/i
const CHECKED_IMG_LAYOUTS = ["fill", "flex-item", "intrinsic", "responsive"];
export class AmpImgUsesSrcSet extends Rule {
async run(context: Context) {
const $ = context.$;
const incorrectImages = $("amp-img")
.filter((_, e) => {
const src = $(e).attr("src");
const layout = $(e).attr("layout");
const srcset = $(e).attr("srcset");
return (
!SVG_URL_PATTERN.exec(src)
&& layout && CHECKED_IMG_LAYOUTS.includes(layout)
&& !srcset
)
});
if (incorrectImages.length > 0) {
return this.warn(
"Not all <amp-img> with non-fixed layout define a srcset. Using AMP Optimizer might help."
);
}
return this.pass();
}
meta() {
return {
url: "https://amp.dev/documentation/guides-and-tutorials/optimize-and-measure/amp-optimizer-guide/explainer/?format=websites#image-optimization",
title: "<amp-img> with non-fixed layout uses srcset",
info: "",
};
}
}
| Change img srcset check messages and checked layouts | Change img srcset check messages and checked layouts
| TypeScript | apache-2.0 | ampproject/amp-toolbox,ampproject/amp-toolbox,ampproject/amp-toolbox,ampproject/amp-toolbox | typescript | ## Code Before:
import { Context } from "../index";
import { Rule } from "../rule";
const SVG_URL_PATTERN = /^[^?]+\.svg(\?.*)?$/i
export class AmpImgUsesSrcSet extends Rule {
async run(context: Context) {
const $ = context.$;
const incorrectImages = $("amp-img")
.filter((_, e) => {
const src = $(e).attr("src");
const layout = $(e).attr("layout");
const srcset = $(e).attr("srcset");
return (
!SVG_URL_PATTERN.exec(src)
&& layout && layout !== 'fixed' && layout != 'fixed-height'
&& !srcset
)
});
if (incorrectImages.length > 0) {
return this.warn(
"Not all responsive <amp-img> define a srcset. Using AMP Optimizer might help."
);
}
return this.pass();
}
meta() {
return {
url: "https://amp.dev/documentation/guides-and-tutorials/optimize-and-measure/amp-optimizer-guide/explainer/?format=websites#image-optimization",
title: "Responsive <amp-img> uses srcset",
info: "",
};
}
}
## Instruction:
Change img srcset check messages and checked layouts
## Code After:
import { Context } from "../index";
import { Rule } from "../rule";
const SVG_URL_PATTERN = /^[^?]+\.svg(\?.*)?$/i
const CHECKED_IMG_LAYOUTS = ["fill", "flex-item", "intrinsic", "responsive"];
export class AmpImgUsesSrcSet extends Rule {
async run(context: Context) {
const $ = context.$;
const incorrectImages = $("amp-img")
.filter((_, e) => {
const src = $(e).attr("src");
const layout = $(e).attr("layout");
const srcset = $(e).attr("srcset");
return (
!SVG_URL_PATTERN.exec(src)
&& layout && CHECKED_IMG_LAYOUTS.includes(layout)
&& !srcset
)
});
if (incorrectImages.length > 0) {
return this.warn(
"Not all <amp-img> with non-fixed layout define a srcset. Using AMP Optimizer might help."
);
}
return this.pass();
}
meta() {
return {
url: "https://amp.dev/documentation/guides-and-tutorials/optimize-and-measure/amp-optimizer-guide/explainer/?format=websites#image-optimization",
title: "<amp-img> with non-fixed layout uses srcset",
info: "",
};
}
}
|
e4a24f8c0c74d8b64c900441d3354afc9522a5b2 | README.markdown | README.markdown | These files are inspired by Zach Holman's dotfiles, with slight modifications.
To learn more, [fork Zach's dotfiles](https://github.com/holman/dotfiles) and [read Zach's post about his thoughts on dotfiles](http://zachholman.com/2010/08/dotfiles-are-meant-to-be-forked/).
## Requirements
Requires vundle by gmarik [https://github.com/gmarik/vundle](https://github.com/gmarik/vundle)
## Install
1. Download dotfiles:
`$ git clone git://github.com/dplarson/dotfiles ~/.dotfiles`
2. Browse to dotfiles directory:
`$ cd ~/.dotfiles`
3. Install symlinks
`$ rake install`
The install rake task will symlink the appropriate files in `.dotfiles` to your
home directory. Everything is configured and tweaked within `~/.dotfiles`,
though.
The main file you'll want to change right off the bat is `zsh/zshrc.symlink`,
which sets up a few paths that'll be different on your particular machine.
| These files are inspired by Zach Holman's dotfiles, with slight modifications.
To learn more, [fork Zach's dotfiles](https://github.com/holman/dotfiles) and [read Zach's post about his thoughts on dotfiles](http://zachholman.com/2010/08/dotfiles-are-meant-to-be-forked/).
## Requirements
Requires vundle by gmarik [https://github.com/gmarik/vundle](https://github.com/gmarik/vundle)
## Install
1. Download dotfiles:
```
`$ git clone git://github.com/dplarson/dotfiles ~/.dotfiles`
```
2. Browse to dotfiles directory:
```
`$ cd ~/.dotfiles`
```
3. Install symlinks
`$ rake install`
The install rake task will symlink the appropriate files in `.dotfiles` to your
home directory. Everything is configured and tweaked within `~/.dotfiles`,
though.
The main file you'll want to change right off the bat is `zsh/zshrc.symlink`,
which sets up a few paths that'll be different on your particular machine.
| Include links to Zach Holman dotfiles | Include links to Zach Holman dotfiles
| Markdown | mit | dplarson/dotfiles,dplarson/dotfiles | markdown | ## Code Before:
These files are inspired by Zach Holman's dotfiles, with slight modifications.
To learn more, [fork Zach's dotfiles](https://github.com/holman/dotfiles) and [read Zach's post about his thoughts on dotfiles](http://zachholman.com/2010/08/dotfiles-are-meant-to-be-forked/).
## Requirements
Requires vundle by gmarik [https://github.com/gmarik/vundle](https://github.com/gmarik/vundle)
## Install
1. Download dotfiles:
`$ git clone git://github.com/dplarson/dotfiles ~/.dotfiles`
2. Browse to dotfiles directory:
`$ cd ~/.dotfiles`
3. Install symlinks
`$ rake install`
The install rake task will symlink the appropriate files in `.dotfiles` to your
home directory. Everything is configured and tweaked within `~/.dotfiles`,
though.
The main file you'll want to change right off the bat is `zsh/zshrc.symlink`,
which sets up a few paths that'll be different on your particular machine.
## Instruction:
Include links to Zach Holman dotfiles
## Code After:
These files are inspired by Zach Holman's dotfiles, with slight modifications.
To learn more, [fork Zach's dotfiles](https://github.com/holman/dotfiles) and [read Zach's post about his thoughts on dotfiles](http://zachholman.com/2010/08/dotfiles-are-meant-to-be-forked/).
## Requirements
Requires vundle by gmarik [https://github.com/gmarik/vundle](https://github.com/gmarik/vundle)
## Install
1. Download dotfiles:
```
`$ git clone git://github.com/dplarson/dotfiles ~/.dotfiles`
```
2. Browse to dotfiles directory:
```
`$ cd ~/.dotfiles`
```
3. Install symlinks
`$ rake install`
The install rake task will symlink the appropriate files in `.dotfiles` to your
home directory. Everything is configured and tweaked within `~/.dotfiles`,
though.
The main file you'll want to change right off the bat is `zsh/zshrc.symlink`,
which sets up a few paths that'll be different on your particular machine.
|
c71f6d3aa4807e6d384846519f266a8bdb4c8e72 | create-user.js | create-user.js | 'use strict';
const path = require('path');
const encryptor = require('./src/encryptor');
const argv = process.argv.slice(2);
if(argv.length != 2) {
console.log('Usage: node create-user.js USERNAME PASSWORD');
process.exit(1);
}
encryptor
.encrypt('{}', path.join('./data', `${argv[0]}.dat`), argv[1])
.then(() => {
console.log('User file created!');
process.exit(0);
})
.catch(err => {
console.log('Error: ', e);
process.exit(1);
});
| 'use strict';
const path = require('path');
const encryptor = require('./src/encryptor');
const argv = process.argv.slice(2);
if(argv.length != 2) {
console.log('Usage: node create-user.js USERNAME PASSWORD');
process.exit(1);
}
encryptor
.encrypt(JSON.stringify({
services: []
}), path.join('./data', `${argv[0]}.dat`), argv[1])
.then(() => {
console.log('User file created!');
process.exit(0);
})
.catch(err => {
console.log('Error: ', e);
process.exit(1);
});
| Create user adiciona json básico no arquivo | Create user adiciona json básico no arquivo
| JavaScript | mit | gustavopaes/password-manager,gustavopaes/password-manager,gustavopaes/password-manager | javascript | ## Code Before:
'use strict';
const path = require('path');
const encryptor = require('./src/encryptor');
const argv = process.argv.slice(2);
if(argv.length != 2) {
console.log('Usage: node create-user.js USERNAME PASSWORD');
process.exit(1);
}
encryptor
.encrypt('{}', path.join('./data', `${argv[0]}.dat`), argv[1])
.then(() => {
console.log('User file created!');
process.exit(0);
})
.catch(err => {
console.log('Error: ', e);
process.exit(1);
});
## Instruction:
Create user adiciona json básico no arquivo
## Code After:
'use strict';
const path = require('path');
const encryptor = require('./src/encryptor');
const argv = process.argv.slice(2);
if(argv.length != 2) {
console.log('Usage: node create-user.js USERNAME PASSWORD');
process.exit(1);
}
encryptor
.encrypt(JSON.stringify({
services: []
}), path.join('./data', `${argv[0]}.dat`), argv[1])
.then(() => {
console.log('User file created!');
process.exit(0);
})
.catch(err => {
console.log('Error: ', e);
process.exit(1);
});
|
1efdebe5af597b5773ddd276c5b67c1d4f5e26be | Envoy.blade.php | Envoy.blade.php | @servers(['demo' => 'timegrid'])
@task('check', ['on' => 'demo'])
cd /var/www/timegrid.io/dev/htdocs
phpunit
@endtask
@task('deploy', ['on' => 'demo'])
sudo /usr/local/bin/deploy.sh development
@endtask
@task('seed', ['on' => 'demo'])
{{-- Target the project directory --}}
cd /var/www/timegrid.io/demo/htdocs
{{-- If there is anything to migrate, migrate it --}}
php artisan db:seed --class="CategoriesSeeder"
@endtask
@task('refresh', ['on' => 'demo'])
{{-- Target the project directory --}}
cd /var/www/timegrid.io/dev/htdocs
{{-- If there is anything to migrate, migrate it --}}
php artisan migrate:refresh --seed
@endtask | @servers(['moongate' => 'timegrid'])
@task('deploy', ['on' => 'moongate'])
sudo /usr/local/bin/deploy.sh {{ $environment }}
@endtask
| Update deploy process and cleanup | Update deploy process and cleanup
| PHP | agpl-3.0 | alariva/timegrid,timegridio/timegrid,timegridio/timegrid,timegridio/timegrid,alariva/timegrid,alariva/timegrid,alariva/timegrid | php | ## Code Before:
@servers(['demo' => 'timegrid'])
@task('check', ['on' => 'demo'])
cd /var/www/timegrid.io/dev/htdocs
phpunit
@endtask
@task('deploy', ['on' => 'demo'])
sudo /usr/local/bin/deploy.sh development
@endtask
@task('seed', ['on' => 'demo'])
{{-- Target the project directory --}}
cd /var/www/timegrid.io/demo/htdocs
{{-- If there is anything to migrate, migrate it --}}
php artisan db:seed --class="CategoriesSeeder"
@endtask
@task('refresh', ['on' => 'demo'])
{{-- Target the project directory --}}
cd /var/www/timegrid.io/dev/htdocs
{{-- If there is anything to migrate, migrate it --}}
php artisan migrate:refresh --seed
@endtask
## Instruction:
Update deploy process and cleanup
## Code After:
@servers(['moongate' => 'timegrid'])
@task('deploy', ['on' => 'moongate'])
sudo /usr/local/bin/deploy.sh {{ $environment }}
@endtask
|
cd6738fd9d90b6ab14ac89582f65d174f6f89bd6 | main.js | main.js | var LOCK = false;
function print(text, nextAction) {
if (text) {
LOCK = true;
var display = document.getElementById("display");
display.innerHTML = display.innerHTML + text.substr(0, 1);
display.scrollTop = display.scrollHeight;
var newText = text.substring(1, text.length);
window.setTimeout(function () {
print(newText, nextAction);
}, 50);
} else {
LOCK = false;
if (nextAction) {
nextAction();
}
}
}
function generateTask() {
var randomChar = String.fromCharCode(Math.floor(Math.random() * 27) + 65);
window.setTimeout(function () {
var message = "\nPlease, press key '" + randomChar + "'\n"
print(message, function () {
document.onkeydown = function (e) {
e = e || event;
var ch = String.fromCharCode(e.keyCode);
if (ch >= 'A' && ch <= 'Z') {
if (!LOCK) {
if (ch == randomChar) {
document.onkeydown = undefined;
print("OK... \n", generateTask);
} else {
print("Wrong!!! \n" + message);
}
}
return false;
}
return true;
}
});
}, Math.floor(Math.random() * 10000));
} | var LOCK = false;
function print(text, nextAction) {
if (text) {
LOCK = true;
var display = document.getElementById("display");
display.innerHTML = display.innerHTML + text.substr(0, 1);
display.scrollTop = display.scrollHeight;
var newText = text.substring(1, text.length);
window.setTimeout(function () {
print(newText, nextAction);
}, 50);
} else {
LOCK = false;
if (nextAction) {
nextAction();
}
}
}
function generateTask() {
var randomChar = String.fromCharCode(Math.floor(Math.random() * 26) + 65);
window.setTimeout(function () {
var message = "\nPlease, press key '" + randomChar + "'\n"
print(message, function () {
document.onkeydown = function (e) {
var keyCode = (e || event).keyCode;
var ch = String.fromCharCode(keyCode);
if (keyCode >= 0 && keyCode <= 127) {
if (!LOCK) {
if (ch == randomChar) {
document.onkeydown = undefined;
print("OK... \n", generateTask);
} else {
print("Wrong!!! \n" + message);
}
}
return false;
}
return true;
}
});
}, Math.floor(Math.random() * 10000));
}
| Change symbols generation and checks | Change symbols generation and checks | JavaScript | bsd-3-clause | dev-brutus/427,dev-brutus/427 | javascript | ## Code Before:
var LOCK = false;
function print(text, nextAction) {
if (text) {
LOCK = true;
var display = document.getElementById("display");
display.innerHTML = display.innerHTML + text.substr(0, 1);
display.scrollTop = display.scrollHeight;
var newText = text.substring(1, text.length);
window.setTimeout(function () {
print(newText, nextAction);
}, 50);
} else {
LOCK = false;
if (nextAction) {
nextAction();
}
}
}
function generateTask() {
var randomChar = String.fromCharCode(Math.floor(Math.random() * 27) + 65);
window.setTimeout(function () {
var message = "\nPlease, press key '" + randomChar + "'\n"
print(message, function () {
document.onkeydown = function (e) {
e = e || event;
var ch = String.fromCharCode(e.keyCode);
if (ch >= 'A' && ch <= 'Z') {
if (!LOCK) {
if (ch == randomChar) {
document.onkeydown = undefined;
print("OK... \n", generateTask);
} else {
print("Wrong!!! \n" + message);
}
}
return false;
}
return true;
}
});
}, Math.floor(Math.random() * 10000));
}
## Instruction:
Change symbols generation and checks
## Code After:
var LOCK = false;
function print(text, nextAction) {
if (text) {
LOCK = true;
var display = document.getElementById("display");
display.innerHTML = display.innerHTML + text.substr(0, 1);
display.scrollTop = display.scrollHeight;
var newText = text.substring(1, text.length);
window.setTimeout(function () {
print(newText, nextAction);
}, 50);
} else {
LOCK = false;
if (nextAction) {
nextAction();
}
}
}
function generateTask() {
var randomChar = String.fromCharCode(Math.floor(Math.random() * 26) + 65);
window.setTimeout(function () {
var message = "\nPlease, press key '" + randomChar + "'\n"
print(message, function () {
document.onkeydown = function (e) {
var keyCode = (e || event).keyCode;
var ch = String.fromCharCode(keyCode);
if (keyCode >= 0 && keyCode <= 127) {
if (!LOCK) {
if (ch == randomChar) {
document.onkeydown = undefined;
print("OK... \n", generateTask);
} else {
print("Wrong!!! \n" + message);
}
}
return false;
}
return true;
}
});
}, Math.floor(Math.random() * 10000));
}
|
98f3e5cc45c10073185124663a4a2dccae28f138 | update.sh | update.sh | echo -n "Update started at "
date
echo "Running market updater" &&
timeout 10m ./market-stuff.py 4-07MU EX6-AO && \
echo "Market updater finished" &&
scp id_list.js market.css *.html sound_market:
| echo -n "Update started at "
date
echo "Running market updater" &&
timeout 10m ./market-stuff.py I-CUVX && \
echo "Market updater finished" &&
scp id_list.js market.css *.html sound_market:
| Update to new market hub | Update to new market hub
| Shell | mit | eve-val/market-site,eve-val/market-site,eve-val/market-site,eve-val/market-site | shell | ## Code Before:
echo -n "Update started at "
date
echo "Running market updater" &&
timeout 10m ./market-stuff.py 4-07MU EX6-AO && \
echo "Market updater finished" &&
scp id_list.js market.css *.html sound_market:
## Instruction:
Update to new market hub
## Code After:
echo -n "Update started at "
date
echo "Running market updater" &&
timeout 10m ./market-stuff.py I-CUVX && \
echo "Market updater finished" &&
scp id_list.js market.css *.html sound_market:
|
5c94497e9bd58dac8a3b9471bcf74a81d4f76e46 | app/assets/javascripts/modules/IE11ImageLabelFix.js | app/assets/javascripts/modules/IE11ImageLabelFix.js | define(["module"], function (module) {
"use strict";
function getInternetExplorerVersion() {
var rv = -1;
if (navigator.appName == "Microsoft Internet Explorer") {
var ua = navigator.userAgent;
var re = new RegExp("MSIE ([0-9]{1,}[\\.0-9]{0,})");
if (re.exec(ua) != null) rv = parseFloat(RegExp.$1);
} else if (navigator.appName == "Netscape") {
var ua = navigator.userAgent;
var re = new RegExp("Trident/.*rv:([0-9]{1,}[\\.0-9]{0,})");
if (re.exec(ua) != null) rv = parseFloat(RegExp.$1);
}
return rv;
}
window.onload = function () {
if (getInternetExplorerVersion()) {
var labels = document.getElementsByTagName("label");
for (var i = 0; i < labels.length; i++) {
var label = labels[i];
var labelImages = label.getElementsByTagName("img");
for (var a = 0; a < labelImages.length; a++) {
var labelImage = labelImages[a];
labelImage.forid = label.htmlFor;
labelImage.onclick = function () {
var e = document.getElementById(this.forid);
switch (e.type) {
case "radio":
e.checked |= 1;
break;
case "checkbox":
e.checked = !e.checked;
break;
case "text":
case "password":
case "textarea":
e.focus();
break;
}
};
}
}
}
};
});
| define(["module"], function (module) {
"use strict";
function getInternetExplorerVersion() {
// https://stackoverflow.com/questions/21825157/internet-explorer-11-detection
var isIE11 = !!window.MSInputMethodContext && !!document.documentMode;
return isIE11;
}
function ready(fn) {
if (document.readyState != "loading") {
fn();
} else {
document.addEventListener("DOMContentLoaded", fn);
}
}
function bindImageClickEvents() {
document.addEventListener(
"click",
function (e) {
if (e.target.tagName === "IMG") {
var parent = e.target.parentNode;
while (true) {
if (!parent) {
return;
} else if (parent.tagName === "LABEL") {
return parent.click();
}
parent = parent.parentNode;
}
}
},
false
);
}
if (getInternetExplorerVersion()) {
ready(function () {
bindImageClickEvents();
});
}
});
| Refactor IE11 image label fix | Refactor IE11 image label fix
| JavaScript | mit | moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend | javascript | ## Code Before:
define(["module"], function (module) {
"use strict";
function getInternetExplorerVersion() {
var rv = -1;
if (navigator.appName == "Microsoft Internet Explorer") {
var ua = navigator.userAgent;
var re = new RegExp("MSIE ([0-9]{1,}[\\.0-9]{0,})");
if (re.exec(ua) != null) rv = parseFloat(RegExp.$1);
} else if (navigator.appName == "Netscape") {
var ua = navigator.userAgent;
var re = new RegExp("Trident/.*rv:([0-9]{1,}[\\.0-9]{0,})");
if (re.exec(ua) != null) rv = parseFloat(RegExp.$1);
}
return rv;
}
window.onload = function () {
if (getInternetExplorerVersion()) {
var labels = document.getElementsByTagName("label");
for (var i = 0; i < labels.length; i++) {
var label = labels[i];
var labelImages = label.getElementsByTagName("img");
for (var a = 0; a < labelImages.length; a++) {
var labelImage = labelImages[a];
labelImage.forid = label.htmlFor;
labelImage.onclick = function () {
var e = document.getElementById(this.forid);
switch (e.type) {
case "radio":
e.checked |= 1;
break;
case "checkbox":
e.checked = !e.checked;
break;
case "text":
case "password":
case "textarea":
e.focus();
break;
}
};
}
}
}
};
});
## Instruction:
Refactor IE11 image label fix
## Code After:
define(["module"], function (module) {
"use strict";
function getInternetExplorerVersion() {
// https://stackoverflow.com/questions/21825157/internet-explorer-11-detection
var isIE11 = !!window.MSInputMethodContext && !!document.documentMode;
return isIE11;
}
function ready(fn) {
if (document.readyState != "loading") {
fn();
} else {
document.addEventListener("DOMContentLoaded", fn);
}
}
function bindImageClickEvents() {
document.addEventListener(
"click",
function (e) {
if (e.target.tagName === "IMG") {
var parent = e.target.parentNode;
while (true) {
if (!parent) {
return;
} else if (parent.tagName === "LABEL") {
return parent.click();
}
parent = parent.parentNode;
}
}
},
false
);
}
if (getInternetExplorerVersion()) {
ready(function () {
bindImageClickEvents();
});
}
});
|
2dfca3ad7c97a59ccc2f37f71c8c9ea94c74b06f | addon/templates/components/power-select-with-create.hbs | addon/templates/components/power-select-with-create.hbs | {{#component powerSelectComponentName
ariaDescribedBy=ariaDescribedBy
ariaInvalid=ariaInvalid
ariaLabel=ariaLabel
ariaLabelledBy=ariaLabelledBy
options=optionsArray
selected=selected
onchange=(action selectOrCreate)
onkeydown=onkeydown
oninput=oninput
onfocus=onfocus
onopen=onopen
onclose=onclose
registerAPI=registerAPI
search=(action searchAndSuggest)
disabled=disabled
placeholder=placeholder
searchEnabled=searchEnabled
searchPlaceholder=searchPlaceholder
searchField=searchField
matcher=matcher
loadingMessage=loadingMessage
noMatchesMessage=noMatchesMessage
onblur=onblur
searchMessage=searchMessage
triggerComponent=triggerComponent
selectedItemComponent=selectedItemComponent
afterOptionsComponent=afterOptionsComponent
beforeOptionsComponent=beforeOptionsComponent
optionsComponent=optionsComponent
renderInPlace=renderInPlace
closeOnSelect=closeOnSelect
allowClear=allowClear
verticalPosition=verticalPosition
horizontalPosition=horizontalPosition
class=class
triggerClass=triggerClass
dropdownClass=dropdownClass
triggerId=triggerId
extra=extra
initiallyOpened=initiallyOpened
matchTriggerWidth=matchTriggerWidth
destination=destination
tabindex=tabindex
dir=dir
defaultHighlighted=defaultHighlighted
as |option term|
}}
{{#if option.__isSuggestion__}}
{{component suggestedOptionComponent option=option term=term}}
{{else}}
{{yield option term}}
{{/if}}
{{/component}}
| {{#component powerSelectComponentName
afterOptionsComponent=afterOptionsComponent
allowClear=allowClear
ariaDescribedBy=ariaDescribedBy
ariaInvalid=ariaInvalid
ariaLabel=ariaLabel
ariaLabelledBy=ariaLabelledBy
beforeOptionsComponent=beforeOptionsComponent
buildSelection=buildSelection
calculatePosition=calculatePosition
class=class
closeOnSelect=closeOnSelect
defaultHighlighted=defaultHighlighted
destination=destination
dir=dir
disabled=disabled
dropdownClass=dropdownClass
extra=extra
groupComponent=groupComponent
horizontalPosition=horizontalPosition
initiallyOpened=initiallyOpened
loadingMessage=loadingMessage
matchTriggerWidth=matchTriggerWidth
matcher=matcher
noMatchesMessage=noMatchesMessage
onblur=onblur
onchange=(action selectOrCreate)
onclose=onclose
onfocus=onfocus
oninput=oninput
onkeydown=onkeydown
onopen=onopen
options=optionsArray
optionsComponent=optionsComponent
placeholder=placeholder
placeholderComponent=placeholderComponent
preventScroll=preventScroll
registerAPI=registerAPI
renderInPlace=renderInPlace
scrollTo=scrollTo
search=(action searchAndSuggest)
searchEnabled=searchEnabled
searchField=searchField
searchMessage=searchMessage
searchPlaceholder=searchPlaceholder
selected=selected
selectedItemComponent=selectedItemComponent
tabindex=tabindex
triggerClass=triggerClass
triggerComponent=triggerComponent
triggerId=triggerId
triggerRole=triggerRole
typeAheadMatcher=typeAheadMatcher
verticalPosition=verticalPosition
as |option term|
}}
{{#if option.__isSuggestion__}}
{{component suggestedOptionComponent option=option term=term}}
{{else}}
{{yield option term}}
{{/if}}
{{/component}}
| Add missing options and sort alphabetically | Add missing options and sort alphabetically
| Handlebars | mit | cibernox/ember-power-select-with-create,cibernox/ember-power-select-with-create | handlebars | ## Code Before:
{{#component powerSelectComponentName
ariaDescribedBy=ariaDescribedBy
ariaInvalid=ariaInvalid
ariaLabel=ariaLabel
ariaLabelledBy=ariaLabelledBy
options=optionsArray
selected=selected
onchange=(action selectOrCreate)
onkeydown=onkeydown
oninput=oninput
onfocus=onfocus
onopen=onopen
onclose=onclose
registerAPI=registerAPI
search=(action searchAndSuggest)
disabled=disabled
placeholder=placeholder
searchEnabled=searchEnabled
searchPlaceholder=searchPlaceholder
searchField=searchField
matcher=matcher
loadingMessage=loadingMessage
noMatchesMessage=noMatchesMessage
onblur=onblur
searchMessage=searchMessage
triggerComponent=triggerComponent
selectedItemComponent=selectedItemComponent
afterOptionsComponent=afterOptionsComponent
beforeOptionsComponent=beforeOptionsComponent
optionsComponent=optionsComponent
renderInPlace=renderInPlace
closeOnSelect=closeOnSelect
allowClear=allowClear
verticalPosition=verticalPosition
horizontalPosition=horizontalPosition
class=class
triggerClass=triggerClass
dropdownClass=dropdownClass
triggerId=triggerId
extra=extra
initiallyOpened=initiallyOpened
matchTriggerWidth=matchTriggerWidth
destination=destination
tabindex=tabindex
dir=dir
defaultHighlighted=defaultHighlighted
as |option term|
}}
{{#if option.__isSuggestion__}}
{{component suggestedOptionComponent option=option term=term}}
{{else}}
{{yield option term}}
{{/if}}
{{/component}}
## Instruction:
Add missing options and sort alphabetically
## Code After:
{{#component powerSelectComponentName
afterOptionsComponent=afterOptionsComponent
allowClear=allowClear
ariaDescribedBy=ariaDescribedBy
ariaInvalid=ariaInvalid
ariaLabel=ariaLabel
ariaLabelledBy=ariaLabelledBy
beforeOptionsComponent=beforeOptionsComponent
buildSelection=buildSelection
calculatePosition=calculatePosition
class=class
closeOnSelect=closeOnSelect
defaultHighlighted=defaultHighlighted
destination=destination
dir=dir
disabled=disabled
dropdownClass=dropdownClass
extra=extra
groupComponent=groupComponent
horizontalPosition=horizontalPosition
initiallyOpened=initiallyOpened
loadingMessage=loadingMessage
matchTriggerWidth=matchTriggerWidth
matcher=matcher
noMatchesMessage=noMatchesMessage
onblur=onblur
onchange=(action selectOrCreate)
onclose=onclose
onfocus=onfocus
oninput=oninput
onkeydown=onkeydown
onopen=onopen
options=optionsArray
optionsComponent=optionsComponent
placeholder=placeholder
placeholderComponent=placeholderComponent
preventScroll=preventScroll
registerAPI=registerAPI
renderInPlace=renderInPlace
scrollTo=scrollTo
search=(action searchAndSuggest)
searchEnabled=searchEnabled
searchField=searchField
searchMessage=searchMessage
searchPlaceholder=searchPlaceholder
selected=selected
selectedItemComponent=selectedItemComponent
tabindex=tabindex
triggerClass=triggerClass
triggerComponent=triggerComponent
triggerId=triggerId
triggerRole=triggerRole
typeAheadMatcher=typeAheadMatcher
verticalPosition=verticalPosition
as |option term|
}}
{{#if option.__isSuggestion__}}
{{component suggestedOptionComponent option=option term=term}}
{{else}}
{{yield option term}}
{{/if}}
{{/component}}
|
88ddbaf1fcb9cf55cbdaee8a1cc8b99f92c56941 | .travis.yml | .travis.yml | language: cpp
compiler: g++
before_install:
# CMake
- echo "yes" | sudo add-apt-repository ppa:kalakris/cmake
- echo "yes" | sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
- sudo apt-get update -qq
- sudo apt-get install -qq
- sudo apt-get install cmake
# g++ 4.8
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update -qq
# sfml
- sudo apt-get install libsfml-dev
- sudo apt-get install libopenal-dev
- sudo apt-get install libsndfile-dev
install:
# g++4.8
- sudo apt-get install -qq g++-4.8
- export CXX="g++-4.8"
before_script: cmake CMakeLists.txt
script:
- make
notifications:
email:
recipients: swang927@gmail.com
on_success: change
on_failure: always
| language: cpp
compiler: g++
before_install:
# CMake
- echo "yes" | sudo add-apt-repository ppa:kalakris/cmake
- echo "yes" | sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
- sudo apt-get update -qq
- sudo apt-get install -qq
- sudo apt-get install cmake
# g++ 4.8
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update -qq
# sfml
- sudo apt-get install libsfml-dev
- sudo apt-get update -qq
install:
# g++4.8
- sudo apt-get install -qq g++-4.8
- export CXX="g++-4.8"
before_script: cmake CMakeLists.txt
script:
- make
notifications:
email:
recipients: swang927@gmail.com
on_success: change
on_failure: always
| Fix the cmake file for linking sfml | Fix the cmake file for linking sfml
| YAML | mit | swang927/CS585-Shaokang-Wang,swang927/CS585-Shaokang-Wang,swang927/CS585-Shaokang-Wang,swang927/CS585-Shaokang-Wang,swang927/CS585-Shaokang-Wang | yaml | ## Code Before:
language: cpp
compiler: g++
before_install:
# CMake
- echo "yes" | sudo add-apt-repository ppa:kalakris/cmake
- echo "yes" | sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
- sudo apt-get update -qq
- sudo apt-get install -qq
- sudo apt-get install cmake
# g++ 4.8
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update -qq
# sfml
- sudo apt-get install libsfml-dev
- sudo apt-get install libopenal-dev
- sudo apt-get install libsndfile-dev
install:
# g++4.8
- sudo apt-get install -qq g++-4.8
- export CXX="g++-4.8"
before_script: cmake CMakeLists.txt
script:
- make
notifications:
email:
recipients: swang927@gmail.com
on_success: change
on_failure: always
## Instruction:
Fix the cmake file for linking sfml
## Code After:
language: cpp
compiler: g++
before_install:
# CMake
- echo "yes" | sudo add-apt-repository ppa:kalakris/cmake
- echo "yes" | sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
- sudo apt-get update -qq
- sudo apt-get install -qq
- sudo apt-get install cmake
# g++ 4.8
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update -qq
# sfml
- sudo apt-get install libsfml-dev
- sudo apt-get update -qq
install:
# g++4.8
- sudo apt-get install -qq g++-4.8
- export CXX="g++-4.8"
before_script: cmake CMakeLists.txt
script:
- make
notifications:
email:
recipients: swang927@gmail.com
on_success: change
on_failure: always
|
a58fa000b43250c99061303107c4b0beee72d51d | contrib/start.lisp | contrib/start.lisp | (ql:quickload "quicklisp-slime-helper")
(let ((swank::*loopback-interface* (sb-unix:unix-gethostname)))
(swank:create-server :dont-close t))
(load "/piserv/piserv.asd")
(ql:quickload "piserv")
(piserv:start-server 8080)
(loop (sleep 5))
| (ql:quickload "quicklisp-slime-helper")
(let ((swank::*loopback-interface* (sb-unix:unix-gethostname)))
(swank:create-server :dont-close t))
(sb-posix:chdir #P"/piserv/")
(load "/piserv/piserv.asd")
(ql:quickload "piserv")
(piserv:start-server 8080)
(loop (sleep 5))
| Add chdir to enable git | Add chdir to enable git
| Common Lisp | bsd-2-clause | rayslava/site,rayslava/site | common-lisp | ## Code Before:
(ql:quickload "quicklisp-slime-helper")
(let ((swank::*loopback-interface* (sb-unix:unix-gethostname)))
(swank:create-server :dont-close t))
(load "/piserv/piserv.asd")
(ql:quickload "piserv")
(piserv:start-server 8080)
(loop (sleep 5))
## Instruction:
Add chdir to enable git
## Code After:
(ql:quickload "quicklisp-slime-helper")
(let ((swank::*loopback-interface* (sb-unix:unix-gethostname)))
(swank:create-server :dont-close t))
(sb-posix:chdir #P"/piserv/")
(load "/piserv/piserv.asd")
(ql:quickload "piserv")
(piserv:start-server 8080)
(loop (sleep 5))
|
a6725e61e25a91fa39c0f9731c3acbaff20e5dac | README.md | README.md |
[![Build Status](https://travis-ci.org/suitupalex/dotfiles.svg?branch=master)](https://travis-ci.org/suitupalex/dotfiles)
My personal dotfiles.
|
[![Build Status](https://travis-ci.org/suitupalex/dotfiles.svg?branch=master)](https://travis-ci.org/suitupalex/dotfiles)
My personal dotfiles.
## WSL Init
Compatible with Ubuntu v20.04+
```
> sudo --preserve-env=HOME USER=$USER ./apt-init-wsl
```
| Add WSL init command info. | readme: Add WSL init command info.
| Markdown | mit | suitupalex/dotfiles | markdown | ## Code Before:
[![Build Status](https://travis-ci.org/suitupalex/dotfiles.svg?branch=master)](https://travis-ci.org/suitupalex/dotfiles)
My personal dotfiles.
## Instruction:
readme: Add WSL init command info.
## Code After:
[![Build Status](https://travis-ci.org/suitupalex/dotfiles.svg?branch=master)](https://travis-ci.org/suitupalex/dotfiles)
My personal dotfiles.
## WSL Init
Compatible with Ubuntu v20.04+
```
> sudo --preserve-env=HOME USER=$USER ./apt-init-wsl
```
|
10efd8d8d3ccea5fd4a92485079ffa116bf8bfad | README.md | README.md | <p align="center">
<img alt="Redactor Logo" src="https://testthedocs.org/img/redactor-logo.png" height="140" />
<h3 align="center">REDACTOR</h3>
</p>
---
[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/testthedocs/Lobby)
A work in progress editor-in-chief to highlight potential linguistic and structural issues with your text. You can watch progress in the [poc](https://github.com/testthedocs/redactor/tree/poc) branch.
## Features
User enabled and overridable documentation checks, planned for inclusion in beta release:
- Check Markdown best practices
- Check RST best practices
- Check generated HTML best practices
- Validate links
- Spelling, Grammar, style and readability
## Dependencies
- [Docker](https://docker.com/)
## Documentation
Full documentation for end users can be found in the "[docs](./docs)" folder.
## Installation
None right now.
## Usage
None right now.
## Contribute
Pull requests are welcome.
For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
- [Issue Tracker](https://github.com/testthedocs/redactor/issues/)
- [Source Code](https://github.com/testthedocs/redactor/)
## License
[MIT](https://choosealicense.com/licenses/mit/)
| <p align="center">
<img alt="Redactor Logo" src="https://testthedocs.org/img/redactor-logo.png" height="140" />
<h3 align="center">REDACTOR</h3>
</p>
---
[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/testthedocs/Lobby)
A work in progress editor-in-chief to highlight potential linguistic and structural issues with your text.
## Features
User enabled and overridable documentation checks, planned for inclusion in beta release:
- Check Markdown best practices
- Check RST best practices
- Check generated HTML best practices
- Validate links
- Spelling, Grammar, style and readability
## Dependencies
- [Docker](https://docker.com/)
## Documentation
Full documentation for end users can be found in the "[docs](./docs)" folder.
## Installation
None right now.
## Usage
None right now.
## Contribute
Pull requests are welcome.
For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
- [Issue Tracker](https://github.com/testthedocs/redactor/issues/)
- [Source Code](https://github.com/testthedocs/redactor/)
## License
[MIT](https://choosealicense.com/licenses/mit/)
| Remove old link to poc branch | docs: Remove old link to poc branch
| Markdown | mit | testthedocs/redactor,testthedocs/redactor | markdown | ## Code Before:
<p align="center">
<img alt="Redactor Logo" src="https://testthedocs.org/img/redactor-logo.png" height="140" />
<h3 align="center">REDACTOR</h3>
</p>
---
[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/testthedocs/Lobby)
A work in progress editor-in-chief to highlight potential linguistic and structural issues with your text. You can watch progress in the [poc](https://github.com/testthedocs/redactor/tree/poc) branch.
## Features
User enabled and overridable documentation checks, planned for inclusion in beta release:
- Check Markdown best practices
- Check RST best practices
- Check generated HTML best practices
- Validate links
- Spelling, Grammar, style and readability
## Dependencies
- [Docker](https://docker.com/)
## Documentation
Full documentation for end users can be found in the "[docs](./docs)" folder.
## Installation
None right now.
## Usage
None right now.
## Contribute
Pull requests are welcome.
For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
- [Issue Tracker](https://github.com/testthedocs/redactor/issues/)
- [Source Code](https://github.com/testthedocs/redactor/)
## License
[MIT](https://choosealicense.com/licenses/mit/)
## Instruction:
docs: Remove old link to poc branch
## Code After:
<p align="center">
<img alt="Redactor Logo" src="https://testthedocs.org/img/redactor-logo.png" height="140" />
<h3 align="center">REDACTOR</h3>
</p>
---
[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/testthedocs/Lobby)
A work in progress editor-in-chief to highlight potential linguistic and structural issues with your text.
## Features
User enabled and overridable documentation checks, planned for inclusion in beta release:
- Check Markdown best practices
- Check RST best practices
- Check generated HTML best practices
- Validate links
- Spelling, Grammar, style and readability
## Dependencies
- [Docker](https://docker.com/)
## Documentation
Full documentation for end users can be found in the "[docs](./docs)" folder.
## Installation
None right now.
## Usage
None right now.
## Contribute
Pull requests are welcome.
For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
- [Issue Tracker](https://github.com/testthedocs/redactor/issues/)
- [Source Code](https://github.com/testthedocs/redactor/)
## License
[MIT](https://choosealicense.com/licenses/mit/)
|
c12146a840b8da7457ce373605629981e168acd9 | t/File-Object/04-new.t | t/File-Object/04-new.t | use strict;
use warnings;
# Modules.
use English qw(-no_match_vars);
use File::Object;
use Test::More 'tests' => 3;
# Test.
eval {
File::Object->new('');
};
is($EVAL_ERROR, "Unknown parameter ''.\n");
# Test.
eval {
File::Object->new(
'something' => 'value',
);
};
is($EVAL_ERROR, "Unknown parameter 'something'.\n");
# Test.
my $obj = File::Object->new;
isa_ok($obj, 'File::Object');
| use strict;
use warnings;
# Modules.
use English qw(-no_match_vars);
use File::Object;
use Test::More 'tests' => 5;
# Test.
eval {
File::Object->new('');
};
is($EVAL_ERROR, "Unknown parameter ''.\n", 'Bad \'\' parameter.');
# Test.
eval {
File::Object->new(
'something' => 'value',
);
};
is($EVAL_ERROR, "Unknown parameter 'something'.\n",
'Bad \'something\' parameter.');
# Test.
eval {
File::Object->new(
'type' => 'XXX',
);
};
is($EVAL_ERROR, "Bad 'type' parameter.\n", 'Bad \'type\' parameter.');
# Test.
eval {
File::Object->new(
'dir' => 'BAD_ARRAY',
);
};
is($EVAL_ERROR, "'dir' parameter must be a reference to array.\n",
'Bad \'dir\' parameter.');
# Test.
my $obj = File::Object->new;
isa_ok($obj, 'File::Object');
| Add test comments. Add two new tests. | Add test comments. Add two new tests.
| Perl | bsd-2-clause | tupinek/File-Object | perl | ## Code Before:
use strict;
use warnings;
# Modules.
use English qw(-no_match_vars);
use File::Object;
use Test::More 'tests' => 3;
# Test.
eval {
File::Object->new('');
};
is($EVAL_ERROR, "Unknown parameter ''.\n");
# Test.
eval {
File::Object->new(
'something' => 'value',
);
};
is($EVAL_ERROR, "Unknown parameter 'something'.\n");
# Test.
my $obj = File::Object->new;
isa_ok($obj, 'File::Object');
## Instruction:
Add test comments. Add two new tests.
## Code After:
use strict;
use warnings;
# Modules.
use English qw(-no_match_vars);
use File::Object;
use Test::More 'tests' => 5;
# Test.
eval {
File::Object->new('');
};
is($EVAL_ERROR, "Unknown parameter ''.\n", 'Bad \'\' parameter.');
# Test.
eval {
File::Object->new(
'something' => 'value',
);
};
is($EVAL_ERROR, "Unknown parameter 'something'.\n",
'Bad \'something\' parameter.');
# Test.
eval {
File::Object->new(
'type' => 'XXX',
);
};
is($EVAL_ERROR, "Bad 'type' parameter.\n", 'Bad \'type\' parameter.');
# Test.
eval {
File::Object->new(
'dir' => 'BAD_ARRAY',
);
};
is($EVAL_ERROR, "'dir' parameter must be a reference to array.\n",
'Bad \'dir\' parameter.');
# Test.
my $obj = File::Object->new;
isa_ok($obj, 'File::Object');
|
3f8c853e2d97e058491a38fc6f6bb701d6f1c590 | filerv7/www/html/staticView.html | filerv7/www/html/staticView.html | <html>
<!--
staticView.html
-->
<body>
<div class="ui-container" style="display: table; height: 100%; width: 100%;">
<div style="vertical-align:middle; display: table-cell; text-align: center;">
%PICK_A_NOTE%
</div>
</div>
</body>
</html> | <html>
<!--
staticView.html
-->
<body>
<div class="ui-container" style="display: table; height: 100%; width: 100%;">
<div class="ui-navigation-bar">
</div>
<div style="vertical-align:middle; display: table-cell; text-align: center;">
%PICK_A_NOTE%
</div>
</div>
</body>
</html> | Add navigation bar; looks better | Add navigation bar; looks better
| HTML | mit | kerrishotts/PhoneGap-HotShot-3-x-Code-Bundle,kerrishotts/PhoneGap-HotShot-3-x-Code-Bundle | html | ## Code Before:
<html>
<!--
staticView.html
-->
<body>
<div class="ui-container" style="display: table; height: 100%; width: 100%;">
<div style="vertical-align:middle; display: table-cell; text-align: center;">
%PICK_A_NOTE%
</div>
</div>
</body>
</html>
## Instruction:
Add navigation bar; looks better
## Code After:
<html>
<!--
staticView.html
-->
<body>
<div class="ui-container" style="display: table; height: 100%; width: 100%;">
<div class="ui-navigation-bar">
</div>
<div style="vertical-align:middle; display: table-cell; text-align: center;">
%PICK_A_NOTE%
</div>
</div>
</body>
</html> |
e6e5376a9951a8ca8e2773321fd3460d57036619 | app/templates/app/styles/application.scss | app/templates/app/styles/application.scss | /*
* This file should only comprise of @imports.
* Place all styles in appropriately named files.
* See the ToC in _application.scss
*/
/* Bourbon & Neat
* -----------------------------------------------------------------------------*/
@import "bourbon";
@import "base/grid-settings";
@import "neat";
@import "base/base";
/* Components
* -----------------------------------------------------------------------------*/
// @import "component/modal";
/* Pages
* -----------------------------------------------------------------------------*/
// @import "page/home";
| /* Bourbon & Neat
* -----------------------------------------------------------------------------*/
@import "bourbon/dist/bourbon";
@import "base/grid-settings";
@import "neat/app/assets/stylesheets/neat";
@import "base/base";
/* Components
* -----------------------------------------------------------------------------*/
// @import "component/modal";
/* Pages
* -----------------------------------------------------------------------------*/
// @import "page/home";
| Remove erroneous code comments. Update Bourbon/Neat imports to be correct for Bower installations | Remove erroneous code comments. Update Bourbon/Neat imports to be correct for Bower installations
| SCSS | mit | centresource/generator-playbook,centresource/generator-playbook,centresource/generator-playbook | scss | ## Code Before:
/*
* This file should only comprise of @imports.
* Place all styles in appropriately named files.
* See the ToC in _application.scss
*/
/* Bourbon & Neat
* -----------------------------------------------------------------------------*/
@import "bourbon";
@import "base/grid-settings";
@import "neat";
@import "base/base";
/* Components
* -----------------------------------------------------------------------------*/
// @import "component/modal";
/* Pages
* -----------------------------------------------------------------------------*/
// @import "page/home";
## Instruction:
Remove erroneous code comments. Update Bourbon/Neat imports to be correct for Bower installations
## Code After:
/* Bourbon & Neat
* -----------------------------------------------------------------------------*/
@import "bourbon/dist/bourbon";
@import "base/grid-settings";
@import "neat/app/assets/stylesheets/neat";
@import "base/base";
/* Components
* -----------------------------------------------------------------------------*/
// @import "component/modal";
/* Pages
* -----------------------------------------------------------------------------*/
// @import "page/home";
|
e78f242cf7adadb5c545d7f1718ba98c8ff80d71 | recipes/labjackpython/meta.yaml | recipes/labjackpython/meta.yaml | {% set name = "LabJackPython" %}
{% set org = "labjack" %}
{% set upstreamversion = "4-24-2014" %}
{% set version = "20140424" %}
{% set sha256 = "f886ade2a29c21c233d339b0f6d00be94bcf8e5a57a5b6bac7e40bad758a5898" %}
package:
name: {{ name|lower }}
version: {{ version }}
source:
fn: {{ name|lower }}-{{version}}-{{ sha256 }}.zip
url: https://github.com/{{ org }}/{{ name }}/archive/{{ upstreamversion }}.zip
sha256: {{ sha256 }}
build:
number: 0
skip: True # [py34]
script: python setup.py install --single-version-externally-managed --record record.txt
requirements:
build:
- python
run:
- python
test:
imports:
- u3
- u6
- ue9
- u12
about:
home: http://labjack.com/support/labjackpython
summary: "Python module for communicating with the LabJack U3/U6/UE9/U12."
license: MIT X-11
license_family: MIT
extra:
recipe-maintainers:
- kastman
| {% set name = "LabJackPython" %}
{% set org = "labjack" %}
{% set upstreamversion = "4-24-2014" %}
{% set version = "20140424" %}
{% set sha256 = "9cf7a6fca9f1308b60a4442dd1410af216fb1d38e49aa5c1ca1e670958c4bcf5" %}
package:
name: {{ name|lower }}
version: {{ version }}
source:
fn: {{ name|lower }}-{{version}}-{{ sha256 }}.zip
url: https://github.com/{{ org }}/{{ name }}/archive/{{ upstreamversion }}.zip
sha256: {{ sha256 }}
build:
number: 0
skip: True # [py34]
script: python setup.py install --single-version-externally-managed --record record.txt
requirements:
build:
- python
run:
- python
test:
imports:
- u3
- u6
- ue9
- u12
about:
home: http://labjack.com/support/labjackpython
summary: "Python module for communicating with the LabJack U3/U6/UE9/U12."
license: MIT X-11
license_family: MIT
extra:
recipe-maintainers:
- kastman
| Fix new sha256 from zip instead of tar.gz | Fix new sha256 from zip instead of tar.gz | YAML | bsd-3-clause | synapticarbors/staged-recipes,shadowwalkersb/staged-recipes,jakirkham/staged-recipes,chohner/staged-recipes,isuruf/staged-recipes,jjhelmus/staged-recipes,mariusvniekerk/staged-recipes,ceholden/staged-recipes,scopatz/staged-recipes,guillochon/staged-recipes,stuertz/staged-recipes,basnijholt/staged-recipes,sodre/staged-recipes,birdsarah/staged-recipes,basnijholt/staged-recipes,sodre/staged-recipes,jochym/staged-recipes,pmlandwehr/staged-recipes,petrushy/staged-recipes,SylvainCorlay/staged-recipes,larray-project/staged-recipes,jochym/staged-recipes,goanpeca/staged-recipes,johanneskoester/staged-recipes,rvalieris/staged-recipes,Juanlu001/staged-recipes,igortg/staged-recipes,sodre/staged-recipes,jjhelmus/staged-recipes,ReimarBauer/staged-recipes,conda-forge/staged-recipes,dschreij/staged-recipes,hadim/staged-recipes,kwilcox/staged-recipes,igortg/staged-recipes,Juanlu001/staged-recipes,NOAA-ORR-ERD/staged-recipes,larray-project/staged-recipes,sannykr/staged-recipes,mcs07/staged-recipes,synapticarbors/staged-recipes,chohner/staged-recipes,Cashalow/staged-recipes,cpaulik/staged-recipes,petrushy/staged-recipes,scopatz/staged-recipes,SylvainCorlay/staged-recipes,mariusvniekerk/staged-recipes,ReimarBauer/staged-recipes,jakirkham/staged-recipes,glemaitre/staged-recipes,chrisburr/staged-recipes,kwilcox/staged-recipes,stuertz/staged-recipes,patricksnape/staged-recipes,hadim/staged-recipes,NOAA-ORR-ERD/staged-recipes,pmlandwehr/staged-recipes,glemaitre/staged-recipes,conda-forge/staged-recipes,dschreij/staged-recipes,chrisburr/staged-recipes,barkls/staged-recipes,rmcgibbo/staged-recipes,ceholden/staged-recipes,mcs07/staged-recipes,barkls/staged-recipes,Cashalow/staged-recipes,goanpeca/staged-recipes,ocefpaf/staged-recipes,rmcgibbo/staged-recipes,birdsarah/staged-recipes,ocefpaf/staged-recipes,cpaulik/staged-recipes,patricksnape/staged-recipes,sannykr/staged-recipes,asmeurer/staged-recipes,shadowwalkersb/staged-recipes,johanneskoester/staged-recipes,rvalieris/staged-recipes,asmeurer/staged-recipes,isuruf/staged-recipes,guillochon/staged-recipes | yaml | ## Code Before:
{% set name = "LabJackPython" %}
{% set org = "labjack" %}
{% set upstreamversion = "4-24-2014" %}
{% set version = "20140424" %}
{% set sha256 = "f886ade2a29c21c233d339b0f6d00be94bcf8e5a57a5b6bac7e40bad758a5898" %}
package:
name: {{ name|lower }}
version: {{ version }}
source:
fn: {{ name|lower }}-{{version}}-{{ sha256 }}.zip
url: https://github.com/{{ org }}/{{ name }}/archive/{{ upstreamversion }}.zip
sha256: {{ sha256 }}
build:
number: 0
skip: True # [py34]
script: python setup.py install --single-version-externally-managed --record record.txt
requirements:
build:
- python
run:
- python
test:
imports:
- u3
- u6
- ue9
- u12
about:
home: http://labjack.com/support/labjackpython
summary: "Python module for communicating with the LabJack U3/U6/UE9/U12."
license: MIT X-11
license_family: MIT
extra:
recipe-maintainers:
- kastman
## Instruction:
Fix new sha256 from zip instead of tar.gz
## Code After:
{% set name = "LabJackPython" %}
{% set org = "labjack" %}
{% set upstreamversion = "4-24-2014" %}
{% set version = "20140424" %}
{% set sha256 = "9cf7a6fca9f1308b60a4442dd1410af216fb1d38e49aa5c1ca1e670958c4bcf5" %}
package:
name: {{ name|lower }}
version: {{ version }}
source:
fn: {{ name|lower }}-{{version}}-{{ sha256 }}.zip
url: https://github.com/{{ org }}/{{ name }}/archive/{{ upstreamversion }}.zip
sha256: {{ sha256 }}
build:
number: 0
skip: True # [py34]
script: python setup.py install --single-version-externally-managed --record record.txt
requirements:
build:
- python
run:
- python
test:
imports:
- u3
- u6
- ue9
- u12
about:
home: http://labjack.com/support/labjackpython
summary: "Python module for communicating with the LabJack U3/U6/UE9/U12."
license: MIT X-11
license_family: MIT
extra:
recipe-maintainers:
- kastman
|
e137a8eb37b52c56ee81828af553f9c2d845ef00 | CI/travis.linux.install.deps.sh | CI/travis.linux.install.deps.sh | set -ev
sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/tpokorra:/mono/xUbuntu_12.04/ /' >> /etc/apt/sources.list.d/mono-opt.list"
curl http://download.opensuse.org/repositories/home:/tpokorra:/mono/xUbuntu_12.04/Release.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install mono-opt cmake
| set -ev
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
echo "deb http://download.mono-project.com/repo/debian wheezy-libtiff-compat main" | sudo tee -a /etc/apt/sources.list.d/mono-xamarin.list
sudo apt-get update
sudo apt-get install mono-devel cmake
| Change source location of Mono packages | Change source location of Mono packages
| Shell | mit | dlsteuer/libgit2sharp,rcorre/libgit2sharp,GeertvanHorrik/libgit2sharp,OidaTiftla/libgit2sharp,libgit2/libgit2sharp,dlsteuer/libgit2sharp,ethomson/libgit2sharp,AArnott/libgit2sharp,vorou/libgit2sharp,oliver-feng/libgit2sharp,Zoxive/libgit2sharp,rcorre/libgit2sharp,jorgeamado/libgit2sharp,github/libgit2sharp,oliver-feng/libgit2sharp,AMSadek/libgit2sharp,sushihangover/libgit2sharp,OidaTiftla/libgit2sharp,jorgeamado/libgit2sharp,Skybladev2/libgit2sharp,red-gate/libgit2sharp,Zoxive/libgit2sharp,xoofx/libgit2sharp,github/libgit2sharp,shana/libgit2sharp,mono/libgit2sharp,whoisj/libgit2sharp,xoofx/libgit2sharp,shana/libgit2sharp,GeertvanHorrik/libgit2sharp,PKRoma/libgit2sharp,sushihangover/libgit2sharp,vorou/libgit2sharp,Skybladev2/libgit2sharp,psawey/libgit2sharp,AArnott/libgit2sharp,whoisj/libgit2sharp,mono/libgit2sharp,jeffhostetler/public_libgit2sharp,red-gate/libgit2sharp,AMSadek/libgit2sharp,ethomson/libgit2sharp,psawey/libgit2sharp,jeffhostetler/public_libgit2sharp | shell | ## Code Before:
set -ev
sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/tpokorra:/mono/xUbuntu_12.04/ /' >> /etc/apt/sources.list.d/mono-opt.list"
curl http://download.opensuse.org/repositories/home:/tpokorra:/mono/xUbuntu_12.04/Release.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install mono-opt cmake
## Instruction:
Change source location of Mono packages
## Code After:
set -ev
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
echo "deb http://download.mono-project.com/repo/debian wheezy-libtiff-compat main" | sudo tee -a /etc/apt/sources.list.d/mono-xamarin.list
sudo apt-get update
sudo apt-get install mono-devel cmake
|
ba45795400f99580c7d0de04c1cafe41185c7c34 | configs/webpack.js | configs/webpack.js | // Webpack Configuration
// =====================
//
// Import Modules
// --------------
//
// ### NPM Modules
import {assign} from 'bound-native-methods/object';
import Webpack from 'webpack';
// Define Values
// -------------
const isProduction = process.env.NODE_ENV === 'production';
// Export Module
// -------------
export default {
// General Settings
// ----------------
entry: [
'webpack-hot-middleware/client',
'./source/scripts/main'
],
output: {
path: '/', // Required by Webpack Dev Middleware
filename: 'main.js'
},
module: {
loaders: [{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel'
}]
},
// ### [Plugins](http://webpack.github.io/docs/list-of-plugins.html)
plugins: [
new Webpack.NoErrorsPlugin(),
new Webpack.HotModuleReplacementPlugin(),
new Webpack.optimize.OccurrenceOrderPlugin(true)
]
}::assign(!isProduction && {
// Development Settings
// --------------------
devtool: 'eval'
});
| // Webpack Configuration
// =====================
//
// Import Modules
// --------------
//
// ### Node.js Modules
import path from 'path';
// ### NPM Modules
import {assign} from 'bound-native-methods/object';
import Webpack from 'webpack';
// Define Values
// -------------
const isProduction = process.env.NODE_ENV === 'production';
// Export Module
// -------------
export default {
// General Settings
// ----------------
entry: [
'webpack-hot-middleware/client',
'./source/scripts/main'
],
output: {
path: '/', // Required by Webpack Dev Middleware
filename: 'main.js'
},
module: {
loaders: [{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel'
}]
},
// ### [Module Resolution](http://webpack.github.io/docs/configuration.html#resolve)
//
// Set the `source` directory as the root when resolving local modules to eliminate the clutter associated with importing from a deeply nested directory structure
//
// #### Why not using `resolve.modulesDirectories`?
//
// See [https://github.com/webpack/webpack/issues/472](https://github.com/webpack/webpack/issues/472)
resolve: {
root: path.join(global.__projectRoot, 'source')
},
// ### [Plugins](http://webpack.github.io/docs/list-of-plugins.html)
plugins: [
new Webpack.NoErrorsPlugin(),
new Webpack.HotModuleReplacementPlugin(),
new Webpack.optimize.OccurrenceOrderPlugin(true)
]
}::assign(!isProduction && {
// Development Settings
// --------------------
devtool: 'eval'
});
| Enable better local module resolution within the app | Enable better local module resolution within the app
20a273a only works for the server-side; this commit adds the necessary config to enable the some effect on the client-side.
| JavaScript | mit | gsklee/cell,gsklee/frontier,gsklee/frontier,gsklee/cell,gsklee/cell,gsklee/frontier | javascript | ## Code Before:
// Webpack Configuration
// =====================
//
// Import Modules
// --------------
//
// ### NPM Modules
import {assign} from 'bound-native-methods/object';
import Webpack from 'webpack';
// Define Values
// -------------
const isProduction = process.env.NODE_ENV === 'production';
// Export Module
// -------------
export default {
// General Settings
// ----------------
entry: [
'webpack-hot-middleware/client',
'./source/scripts/main'
],
output: {
path: '/', // Required by Webpack Dev Middleware
filename: 'main.js'
},
module: {
loaders: [{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel'
}]
},
// ### [Plugins](http://webpack.github.io/docs/list-of-plugins.html)
plugins: [
new Webpack.NoErrorsPlugin(),
new Webpack.HotModuleReplacementPlugin(),
new Webpack.optimize.OccurrenceOrderPlugin(true)
]
}::assign(!isProduction && {
// Development Settings
// --------------------
devtool: 'eval'
});
## Instruction:
Enable better local module resolution within the app
20a273a only works for the server-side; this commit adds the necessary config to enable the some effect on the client-side.
## Code After:
// Webpack Configuration
// =====================
//
// Import Modules
// --------------
//
// ### Node.js Modules
import path from 'path';
// ### NPM Modules
import {assign} from 'bound-native-methods/object';
import Webpack from 'webpack';
// Define Values
// -------------
const isProduction = process.env.NODE_ENV === 'production';
// Export Module
// -------------
export default {
// General Settings
// ----------------
entry: [
'webpack-hot-middleware/client',
'./source/scripts/main'
],
output: {
path: '/', // Required by Webpack Dev Middleware
filename: 'main.js'
},
module: {
loaders: [{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel'
}]
},
// ### [Module Resolution](http://webpack.github.io/docs/configuration.html#resolve)
//
// Set the `source` directory as the root when resolving local modules to eliminate the clutter associated with importing from a deeply nested directory structure
//
// #### Why not using `resolve.modulesDirectories`?
//
// See [https://github.com/webpack/webpack/issues/472](https://github.com/webpack/webpack/issues/472)
resolve: {
root: path.join(global.__projectRoot, 'source')
},
// ### [Plugins](http://webpack.github.io/docs/list-of-plugins.html)
plugins: [
new Webpack.NoErrorsPlugin(),
new Webpack.HotModuleReplacementPlugin(),
new Webpack.optimize.OccurrenceOrderPlugin(true)
]
}::assign(!isProduction && {
// Development Settings
// --------------------
devtool: 'eval'
});
|
7c398a8a2fb5a6718c422361f483299db83cffae | app/templates/views/service-settings/set-email-branding.html | app/templates/views/service-settings/set-email-branding.html | {% extends "withnav_template.html" %}
{% from "components/radios.html" import radios, branding_radios %}
{% from "components/page-footer.html" import page_footer %}
{% block service_page_title %}
Set email branding
{% endblock %}
{% block maincolumn_content %}
<h1 class="heading-large">Set email branding</h1>
<form method="post">
<div class="grid-row">
<div class="column-one-half">
{{ radios(form.branding_type) }}
</div>
<div class="column-one-half">
{{ branding_radios(form.branding_style, branding_dict=branding_dict) }}
</div>
</div>
<div class="grid-row">
<div class="column-three-quarters">
{{ page_footer(
'Preview',
back_link=url_for('.service_settings', service_id=current_service.id),
back_link_text='Back to settings'
) }}
</div>
</div>
</form>
{% endblock %}
| {% extends "withnav_template.html" %}
{% from "components/radios.html" import radios %}
{% from "components/page-footer.html" import page_footer %}
{% block service_page_title %}
Set email branding
{% endblock %}
{% block maincolumn_content %}
<h1 class="heading-large">Set email branding</h1>
<form method="post">
<div class="grid-row">
<div class="column-one-half">
{{ radios(form.branding_type) }}
</div>
<div class="column-one-half">
{{ radios(form.branding_style) }}
</div>
</div>
<div class="grid-row">
<div class="column-three-quarters">
{{ page_footer(
'Preview',
back_link=url_for('.service_settings', service_id=current_service.id),
back_link_text='Back to settings'
) }}
</div>
</div>
</form>
{% endblock %}
| Update style radios for choosing brand combination | Update style radios for choosing brand combination
They were already using the 'name' field in their
label but we don't want any other part of the
branding to appear now.
| HTML | mit | alphagov/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin | html | ## Code Before:
{% extends "withnav_template.html" %}
{% from "components/radios.html" import radios, branding_radios %}
{% from "components/page-footer.html" import page_footer %}
{% block service_page_title %}
Set email branding
{% endblock %}
{% block maincolumn_content %}
<h1 class="heading-large">Set email branding</h1>
<form method="post">
<div class="grid-row">
<div class="column-one-half">
{{ radios(form.branding_type) }}
</div>
<div class="column-one-half">
{{ branding_radios(form.branding_style, branding_dict=branding_dict) }}
</div>
</div>
<div class="grid-row">
<div class="column-three-quarters">
{{ page_footer(
'Preview',
back_link=url_for('.service_settings', service_id=current_service.id),
back_link_text='Back to settings'
) }}
</div>
</div>
</form>
{% endblock %}
## Instruction:
Update style radios for choosing brand combination
They were already using the 'name' field in their
label but we don't want any other part of the
branding to appear now.
## Code After:
{% extends "withnav_template.html" %}
{% from "components/radios.html" import radios %}
{% from "components/page-footer.html" import page_footer %}
{% block service_page_title %}
Set email branding
{% endblock %}
{% block maincolumn_content %}
<h1 class="heading-large">Set email branding</h1>
<form method="post">
<div class="grid-row">
<div class="column-one-half">
{{ radios(form.branding_type) }}
</div>
<div class="column-one-half">
{{ radios(form.branding_style) }}
</div>
</div>
<div class="grid-row">
<div class="column-three-quarters">
{{ page_footer(
'Preview',
back_link=url_for('.service_settings', service_id=current_service.id),
back_link_text='Back to settings'
) }}
</div>
</div>
</form>
{% endblock %}
|
6ca1dd77a4177e105d5fa7dce75c16a228c70ba5 | README.md | README.md | hubot-fleep
===========
Hubot adapter for http://fleep.io
| hubot-fleep
===========
Hubot adapter for http://fleep.io
# Project status
The adapter works, but only for really straightforward usage. A lot of corner cases are as of yet unhandled: what happens when the bot joins with a conversation with previous history? What happens if the bot is present in multiple channels? What happens...
Anyhow. Feel free to build upon it (send pull requests!) and use it, but please, don't do it in production. I *might* find enough motivation to finish it, but I won't give any deadlines.
| Add project status notification to readme | Add project status notification to readme | Markdown | mit | anroots/hubot-fleep | markdown | ## Code Before:
hubot-fleep
===========
Hubot adapter for http://fleep.io
## Instruction:
Add project status notification to readme
## Code After:
hubot-fleep
===========
Hubot adapter for http://fleep.io
# Project status
The adapter works, but only for really straightforward usage. A lot of corner cases are as of yet unhandled: what happens when the bot joins with a conversation with previous history? What happens if the bot is present in multiple channels? What happens...
Anyhow. Feel free to build upon it (send pull requests!) and use it, but please, don't do it in production. I *might* find enough motivation to finish it, but I won't give any deadlines.
|
d5c43653473f94a606c8f6b1144d20e4a9fe0dd4 | examples/Tiny.hs | examples/Tiny.hs | {-# LANGUAGE ScopedTypeVariables #-}
import Criterion.Main
import Control.Parallel
import qualified Data.IntMap as I
import Data.List (foldl')
import Criterion.Config
main = defaultMainWith defaultConfig (return ()) [
bgroup "fib" [
bench "fib 10" $ whnf fib 10
, bench "fib 30" $ whnf fib 30
],
bgroup "intmap" [
bench "intmap 50k" $ whnf intmap 50000
, bench "intmap 75k" $ whnf intmap 75000
]
]
fib :: Int -> Int
fib 0 = 0
fib 1 = 1
fib n = fib (n-1) + fib (n-2)
intmap :: Int -> I.IntMap Int
intmap n = foldl' (\m k -> I.insert k 33 m) I.empty [0..n]
| {-# LANGUAGE ScopedTypeVariables #-}
import Criterion.Main
import Control.Parallel
import qualified Data.IntMap as I
import Data.List (foldl')
import Criterion.Config
main = defaultMainWith defaultConfig (return ()) [
bgroup "fib" [
bench "fib 10" $ whnf fib 10
, bench "fib 20" $ whnf fib 20
, bench "fib 30" $ whnf fib 30
],
bgroup "intmap" [
bench "intmap 25k" $ whnf intmap 25000
, bench "intmap 50k" $ whnf intmap 50000
, bench "intmap 75k" $ whnf intmap 75000
]
]
fib :: Int -> Int
fib 0 = 0
fib 1 = 1
fib n = fib (n-1) + fib (n-2)
intmap :: Int -> I.IntMap Int
intmap n = foldl' (\m k -> I.insert k 33 m) I.empty [0..n]
| Make the tiny example less tiny. | Make the tiny example less tiny.
| Haskell | bsd-2-clause | bos/criterion,osa1/criterion,rrnewton/criterion,iu-parfunc/criterion,paulolieuthier/criterion,bgamari/criterion,rrnewton/criterion,paulolieuthier/criterion,rrnewton/criterion,bgamari/criterion,iu-parfunc/criterion,osa1/criterion,bos/criterion,iu-parfunc/criterion,paulolieuthier/criterion,bgamari/criterion,bos/criterion | haskell | ## Code Before:
{-# LANGUAGE ScopedTypeVariables #-}
import Criterion.Main
import Control.Parallel
import qualified Data.IntMap as I
import Data.List (foldl')
import Criterion.Config
main = defaultMainWith defaultConfig (return ()) [
bgroup "fib" [
bench "fib 10" $ whnf fib 10
, bench "fib 30" $ whnf fib 30
],
bgroup "intmap" [
bench "intmap 50k" $ whnf intmap 50000
, bench "intmap 75k" $ whnf intmap 75000
]
]
fib :: Int -> Int
fib 0 = 0
fib 1 = 1
fib n = fib (n-1) + fib (n-2)
intmap :: Int -> I.IntMap Int
intmap n = foldl' (\m k -> I.insert k 33 m) I.empty [0..n]
## Instruction:
Make the tiny example less tiny.
## Code After:
{-# LANGUAGE ScopedTypeVariables #-}
import Criterion.Main
import Control.Parallel
import qualified Data.IntMap as I
import Data.List (foldl')
import Criterion.Config
main = defaultMainWith defaultConfig (return ()) [
bgroup "fib" [
bench "fib 10" $ whnf fib 10
, bench "fib 20" $ whnf fib 20
, bench "fib 30" $ whnf fib 30
],
bgroup "intmap" [
bench "intmap 25k" $ whnf intmap 25000
, bench "intmap 50k" $ whnf intmap 50000
, bench "intmap 75k" $ whnf intmap 75000
]
]
fib :: Int -> Int
fib 0 = 0
fib 1 = 1
fib n = fib (n-1) + fib (n-2)
intmap :: Int -> I.IntMap Int
intmap n = foldl' (\m k -> I.insert k 33 m) I.empty [0..n]
|
54b88e72d49087eadf7be69e9bf519276d9bca71 | spec/fixtures/connection.yml | spec/fixtures/connection.yml | :server: 'localhost'
:username: 'address@example.org'
:password: 'pass'
:connection_options:
:port: 8143
:ssl: false
| :server: 'localhost'
:username: 'address@example.org'
:password: 'pass'
:connection_options:
:port: 8993
:ssl:
:verify_mode: 0
| Make port match Docker configuration | Make port match Docker configuration
| YAML | mit | joeyates/imap-backup | yaml | ## Code Before:
:server: 'localhost'
:username: 'address@example.org'
:password: 'pass'
:connection_options:
:port: 8143
:ssl: false
## Instruction:
Make port match Docker configuration
## Code After:
:server: 'localhost'
:username: 'address@example.org'
:password: 'pass'
:connection_options:
:port: 8993
:ssl:
:verify_mode: 0
|
cc09da295d61965af1552b35b7ece0caf4e5a399 | accountant/interface/forms.py | accountant/interface/forms.py | from django import forms
from django.core.exceptions import NON_FIELD_ERRORS
from django.utils.translation import ugettext_lazy as _
from core import models
DUPLICATE_PLAYER_ERROR = \
_('There is already a player with this name in your game')
class CreateGameForm(forms.Form):
bank_cash = forms.IntegerField(required=False, initial=12000)
def clean_bank_cash(self):
data = self.cleaned_data['bank_cash']
if data == None:
data = 0
return data
class AddPlayerForm(forms.ModelForm):
class Meta:
model = models.Player
fields = ('game', 'name', 'cash')
error_messages = {
NON_FIELD_ERRORS: {'unique_together': DUPLICATE_PLAYER_ERROR},
}
| from django import forms
from django.core.exceptions import NON_FIELD_ERRORS
from django.utils.translation import ugettext_lazy as _
from core import models
DUPLICATE_PLAYER_ERROR = \
_('There is already a player with this name in your game')
class CreateGameForm(forms.Form):
bank_cash = forms.IntegerField(required=False, initial=12000)
def clean_bank_cash(self):
data = self.cleaned_data['bank_cash']
if data == None:
data = 0
return data
class AddPlayerForm(forms.ModelForm):
class Meta:
model = models.Player
fields = ('game', 'name', 'cash')
error_messages = {
NON_FIELD_ERRORS: {'unique_together': DUPLICATE_PLAYER_ERROR},
}
widgets = {
'game': forms.HiddenInput(),
}
| Hide Game ID input since it is automatically set | Hide Game ID input since it is automatically set
| Python | mit | XeryusTC/18xx-accountant,XeryusTC/18xx-accountant,XeryusTC/18xx-accountant,XeryusTC/18xx-accountant,XeryusTC/18xx-accountant | python | ## Code Before:
from django import forms
from django.core.exceptions import NON_FIELD_ERRORS
from django.utils.translation import ugettext_lazy as _
from core import models
DUPLICATE_PLAYER_ERROR = \
_('There is already a player with this name in your game')
class CreateGameForm(forms.Form):
bank_cash = forms.IntegerField(required=False, initial=12000)
def clean_bank_cash(self):
data = self.cleaned_data['bank_cash']
if data == None:
data = 0
return data
class AddPlayerForm(forms.ModelForm):
class Meta:
model = models.Player
fields = ('game', 'name', 'cash')
error_messages = {
NON_FIELD_ERRORS: {'unique_together': DUPLICATE_PLAYER_ERROR},
}
## Instruction:
Hide Game ID input since it is automatically set
## Code After:
from django import forms
from django.core.exceptions import NON_FIELD_ERRORS
from django.utils.translation import ugettext_lazy as _
from core import models
DUPLICATE_PLAYER_ERROR = \
_('There is already a player with this name in your game')
class CreateGameForm(forms.Form):
bank_cash = forms.IntegerField(required=False, initial=12000)
def clean_bank_cash(self):
data = self.cleaned_data['bank_cash']
if data == None:
data = 0
return data
class AddPlayerForm(forms.ModelForm):
class Meta:
model = models.Player
fields = ('game', 'name', 'cash')
error_messages = {
NON_FIELD_ERRORS: {'unique_together': DUPLICATE_PLAYER_ERROR},
}
widgets = {
'game': forms.HiddenInput(),
}
|
6668892ae0d711224e022a28883402663b1634f7 | js/saiku/routers/QueryRouter.js | js/saiku/routers/QueryRouter.js | /**
* Router for opening query when session is initialized
*/
var QueryRouter = Backbone.Router.extend({
routes: {
'query/open/:query_name': 'open_query'
},
open_query: function(query_name) {
Settings.ACTION = "OPEN_QUERY";
var query = new SavedQuery(_.extend({ name: query_name }, Settings.GET));
query.fetch({ success: query.move_query_to_workspace });
}
});
Saiku.routers.push(new QueryRouter()); | /**
* Router for opening query when session is initialized
*/
var QueryRouter = Backbone.Router.extend({
routes: {
'query/open/:query_name': 'open_query'
},
open_query: function(query_name) {
Settings.ACTION = "OPEN_QUERY";
var options = {
name: query_name,
solution: Settings.GET.SOLUTION || "",
path: Settings.GET.PATH || "",
action: Settings.GET.ACTION || "",
biplugin: true
};
var query = new SavedQuery(options);
query.fetch({ success: query.move_query_to_workspace });
}
});
Saiku.routers.push(new QueryRouter()); | Send parameters as lowercase. Can't test because demo server is unavailable. | Send parameters as lowercase. Can't test because demo server is
unavailable. | JavaScript | apache-2.0 | bisone/saiku,bisone/saiku,bisone/saiku,bisone/saiku,bisone/saiku,bisone/saiku | javascript | ## Code Before:
/**
* Router for opening query when session is initialized
*/
var QueryRouter = Backbone.Router.extend({
routes: {
'query/open/:query_name': 'open_query'
},
open_query: function(query_name) {
Settings.ACTION = "OPEN_QUERY";
var query = new SavedQuery(_.extend({ name: query_name }, Settings.GET));
query.fetch({ success: query.move_query_to_workspace });
}
});
Saiku.routers.push(new QueryRouter());
## Instruction:
Send parameters as lowercase. Can't test because demo server is
unavailable.
## Code After:
/**
* Router for opening query when session is initialized
*/
var QueryRouter = Backbone.Router.extend({
routes: {
'query/open/:query_name': 'open_query'
},
open_query: function(query_name) {
Settings.ACTION = "OPEN_QUERY";
var options = {
name: query_name,
solution: Settings.GET.SOLUTION || "",
path: Settings.GET.PATH || "",
action: Settings.GET.ACTION || "",
biplugin: true
};
var query = new SavedQuery(options);
query.fetch({ success: query.move_query_to_workspace });
}
});
Saiku.routers.push(new QueryRouter()); |
f40597b1bf776a01b64e8371e428085345c2174d | test/fixtures/wrap.js | test/fixtures/wrap.js | fs = require('fs');
util = require('util');
util.puts('module.exports=' + JSON.stringify(
fs.readFileSync(process.argv[2]).toString()));
| fs = require('fs');
console.log('module.exports=' + JSON.stringify(
fs.readFileSync(process.argv[2]).toString()));
| Fix call to deprecated util.puts | Fix call to deprecated util.puts
| JavaScript | mit | znerol/node-delta,znerol/node-delta,znerol/node-delta | javascript | ## Code Before:
fs = require('fs');
util = require('util');
util.puts('module.exports=' + JSON.stringify(
fs.readFileSync(process.argv[2]).toString()));
## Instruction:
Fix call to deprecated util.puts
## Code After:
fs = require('fs');
console.log('module.exports=' + JSON.stringify(
fs.readFileSync(process.argv[2]).toString()));
|
a5730ee548f39303f3e8925184861982d66e15b7 | locales/fa/experiments.ftl | locales/fa/experiments.ftl | tabcenterContributors0Title = تجربهکاربری فایرفاکس
tabcenterContributors1Title = تجربهکاربری فایرفاکس
tabcenterContributors2Title = تجربهکاربری فایرفاکس
tabcenterContributors3Title = تجربهکاربری فایرفاکس
| activitystreamDescription = یک فهرست غنی و بصری و یک صفحه خانگی باز طراحی شده که پیدا کردن چیزی که به دنبال آن در فایرفاکس هستید را از هر زمانی سادهتر میکند.
minvidDescription = ویدئوها را در مرکز توجه قرار میدهد. Min Vid به شما اجازه میدهد تا ویدئوهای YouTube و Vimeo را در یک چهارچوب کوچک که همیشه بالای صفحه باقی میماند قرار دهید تا همزمان بتوانید وب را مرور کنید.
nomore404sSubtitle = قدرت گرفته از Wayback Machine
nomore404sDescription = از بنبستها در وب خسته شدهاید. هر زمان که نسخهٔ ذخیره شدهای از یک صفحه در آرشیو اینترنتی Wayback Machine موجود باشد به شما اطلاع میدهیم.
tabcenterContributors0Title = تجربهکاربری فایرفاکس
tabcenterContributors1Title = تجربهکاربری فایرفاکس
tabcenterContributors2Title = تجربهکاربری فایرفاکس
tabcenterContributors3Title = تجربهکاربری فایرفاکس
| Update Persian (fa) localization of Test Pilot Website | Pontoon: Update Persian (fa) localization of Test Pilot Website
Localization authors:
- Arash Mousavi <mousavi.arash@gmail.com>
| FreeMarker | mpl-2.0 | 6a68/testpilot,flodolo/testpilot,mozilla/idea-town-server,flodolo/testpilot,6a68/idea-town,lmorchard/testpilot,mozilla/idea-town,lmorchard/idea-town-server,mathjazz/testpilot,mathjazz/testpilot,flodolo/testpilot,lmorchard/idea-town,lmorchard/testpilot,6a68/idea-town,dannycoates/testpilot,meandavejustice/testpilot,meandavejustice/testpilot,mozilla/idea-town,clouserw/testpilot,mathjazz/testpilot,6a68/testpilot,mozilla/idea-town-server,lmorchard/testpilot,fzzzy/testpilot,lmorchard/idea-town-server,6a68/testpilot,lmorchard/idea-town-server,mathjazz/testpilot,mozilla/idea-town-server,clouserw/testpilot,6a68/testpilot,mozilla/idea-town,fzzzy/testpilot,mozilla/idea-town,chuckharmston/testpilot,flodolo/testpilot,6a68/idea-town,meandavejustice/testpilot,dannycoates/testpilot,6a68/idea-town,clouserw/testpilot,lmorchard/idea-town,lmorchard/idea-town,fzzzy/testpilot,fzzzy/testpilot,dannycoates/testpilot,clouserw/testpilot,chuckharmston/testpilot,chuckharmston/testpilot,lmorchard/idea-town-server,meandavejustice/testpilot,lmorchard/idea-town,mozilla/idea-town-server,dannycoates/testpilot,chuckharmston/testpilot,lmorchard/testpilot | freemarker | ## Code Before:
tabcenterContributors0Title = تجربهکاربری فایرفاکس
tabcenterContributors1Title = تجربهکاربری فایرفاکس
tabcenterContributors2Title = تجربهکاربری فایرفاکس
tabcenterContributors3Title = تجربهکاربری فایرفاکس
## Instruction:
Pontoon: Update Persian (fa) localization of Test Pilot Website
Localization authors:
- Arash Mousavi <mousavi.arash@gmail.com>
## Code After:
activitystreamDescription = یک فهرست غنی و بصری و یک صفحه خانگی باز طراحی شده که پیدا کردن چیزی که به دنبال آن در فایرفاکس هستید را از هر زمانی سادهتر میکند.
minvidDescription = ویدئوها را در مرکز توجه قرار میدهد. Min Vid به شما اجازه میدهد تا ویدئوهای YouTube و Vimeo را در یک چهارچوب کوچک که همیشه بالای صفحه باقی میماند قرار دهید تا همزمان بتوانید وب را مرور کنید.
nomore404sSubtitle = قدرت گرفته از Wayback Machine
nomore404sDescription = از بنبستها در وب خسته شدهاید. هر زمان که نسخهٔ ذخیره شدهای از یک صفحه در آرشیو اینترنتی Wayback Machine موجود باشد به شما اطلاع میدهیم.
tabcenterContributors0Title = تجربهکاربری فایرفاکس
tabcenterContributors1Title = تجربهکاربری فایرفاکس
tabcenterContributors2Title = تجربهکاربری فایرفاکس
tabcenterContributors3Title = تجربهکاربری فایرفاکس
|
0b1cdfac668b15ab9d48b1eb8a4ac4bff7b8c98e | pylinks/main/templatetags/menu_li.py | pylinks/main/templatetags/menu_li.py | from django.template import Library
from django.template.defaulttags import URLNode, url
from django.utils.html import escape, mark_safe
register = Library()
class MenuLINode(URLNode):
def render(self, context):
# Pull out the match and hijack asvar
# to be used for the link title
request = context.get('request')
if self.asvar:
title = escape(self.asvar.strip('"\''))
elif request:
title = request.resolver_match.url_name
# Reset asvar and render to get the URL
self.asvar = None
menu_url = super(MenuLINode, self).render(context)
# Check if we're on the defined page
if request and str(self.view_name).strip('"\'') == \
request.resolver_match.url_name:
active_class = ' class="active"'
else:
active_class = ''
return mark_safe('<li%s><a href="%s">%s</a></li>' % \
(active_class, menu_url, title))
@register.tag
def menu_li(parser, token, node_cls=MenuLINode):
"""
Add a menu <li> for Twitter Bootstrap, checking
adding the "active" class as needed.
"""
node_instance = url(parser, token)
return node_cls(view_name=node_instance.view_name,
args=node_instance.args,
kwargs=node_instance.kwargs,
asvar=node_instance.asvar)
| from django.template import Library
from django.template.defaulttags import URLNode, url
from django.utils.html import escape, mark_safe
register = Library()
class MenuLINode(URLNode):
def render(self, context):
# Pull out the match and hijack asvar
# to be used for the link title
match = getattr(context.get('request'), 'resolver_match', None)
if self.asvar:
title = escape(self.asvar.strip('"\''))
elif match:
title = match.url_name
# Reset asvar and render to get the URL
self.asvar = None
menu_url = super(MenuLINode, self).render(context)
# Check if we're on the defined page
if match and str(self.view_name).strip('"\'') == match.url_name:
active_class = ' class="active"'
else:
active_class = ''
return mark_safe('<li%s><a href="%s">%s</a></li>' % \
(active_class, menu_url, title))
@register.tag
def menu_li(parser, token, node_cls=MenuLINode):
"""
Add a menu <li> for Twitter Bootstrap, checking
adding the "active" class as needed.
"""
node_instance = url(parser, token)
return node_cls(view_name=node_instance.view_name,
args=node_instance.args,
kwargs=node_instance.kwargs,
asvar=node_instance.asvar)
| Fix check for valid resolver_match | Fix check for valid resolver_match
| Python | mit | michaelmior/pylinks,michaelmior/pylinks,michaelmior/pylinks | python | ## Code Before:
from django.template import Library
from django.template.defaulttags import URLNode, url
from django.utils.html import escape, mark_safe
register = Library()
class MenuLINode(URLNode):
def render(self, context):
# Pull out the match and hijack asvar
# to be used for the link title
request = context.get('request')
if self.asvar:
title = escape(self.asvar.strip('"\''))
elif request:
title = request.resolver_match.url_name
# Reset asvar and render to get the URL
self.asvar = None
menu_url = super(MenuLINode, self).render(context)
# Check if we're on the defined page
if request and str(self.view_name).strip('"\'') == \
request.resolver_match.url_name:
active_class = ' class="active"'
else:
active_class = ''
return mark_safe('<li%s><a href="%s">%s</a></li>' % \
(active_class, menu_url, title))
@register.tag
def menu_li(parser, token, node_cls=MenuLINode):
"""
Add a menu <li> for Twitter Bootstrap, checking
adding the "active" class as needed.
"""
node_instance = url(parser, token)
return node_cls(view_name=node_instance.view_name,
args=node_instance.args,
kwargs=node_instance.kwargs,
asvar=node_instance.asvar)
## Instruction:
Fix check for valid resolver_match
## Code After:
from django.template import Library
from django.template.defaulttags import URLNode, url
from django.utils.html import escape, mark_safe
register = Library()
class MenuLINode(URLNode):
def render(self, context):
# Pull out the match and hijack asvar
# to be used for the link title
match = getattr(context.get('request'), 'resolver_match', None)
if self.asvar:
title = escape(self.asvar.strip('"\''))
elif match:
title = match.url_name
# Reset asvar and render to get the URL
self.asvar = None
menu_url = super(MenuLINode, self).render(context)
# Check if we're on the defined page
if match and str(self.view_name).strip('"\'') == match.url_name:
active_class = ' class="active"'
else:
active_class = ''
return mark_safe('<li%s><a href="%s">%s</a></li>' % \
(active_class, menu_url, title))
@register.tag
def menu_li(parser, token, node_cls=MenuLINode):
"""
Add a menu <li> for Twitter Bootstrap, checking
adding the "active" class as needed.
"""
node_instance = url(parser, token)
return node_cls(view_name=node_instance.view_name,
args=node_instance.args,
kwargs=node_instance.kwargs,
asvar=node_instance.asvar)
|
643aba1de85163b6dea972a9dc5324d8dc2065ef | src/renderer/views/Settings/Settings.tsx | src/renderer/views/Settings/Settings.tsx | import React from 'react';
import { Outlet, useMatch } from 'react-router';
import { Navigate } from 'react-router-dom';
import * as Nav from '../../elements/Nav/Nav';
import appStyles from '../../App.module.css';
import styles from './Settings.module.css';
const Settings: React.FC = () => {
const match = useMatch('/settings');
if (match) {
return <Navigate to='/settings/library' />;
}
return (
<div className={`${appStyles.view} ${styles.viewSettings}`}>
<div className={styles.settings__nav}>
<Nav.Wrap vertical>
<Nav.Link to='/settings/library'>Library</Nav.Link>
<Nav.Link to='/settings/audio'>Audio</Nav.Link>
<Nav.Link to='/settings/interface'>Interface</Nav.Link>
<Nav.Link to='/settings/about'>About</Nav.Link>
</Nav.Wrap>
</div>
<div className={styles.settings__content}>
<Outlet />
</div>
</div>
);
};
export default Settings;
| import React from 'react';
import { Outlet, useMatch } from 'react-router';
import { Navigate } from 'react-router-dom';
import * as Nav from '../../elements/Nav/Nav';
import appStyles from '../../App.module.css';
import styles from './Settings.module.css';
const Settings: React.FC = () => {
const match = useMatch('/settings');
return (
<div className={`${appStyles.view} ${styles.viewSettings}`}>
<div className={styles.settings__nav}>
<Nav.Wrap vertical>
<Nav.Link to='/settings/library'>Library</Nav.Link>
<Nav.Link to='/settings/audio'>Audio</Nav.Link>
<Nav.Link to='/settings/interface'>Interface</Nav.Link>
<Nav.Link to='/settings/about'>About</Nav.Link>
</Nav.Wrap>
</div>
<div className={styles.settings__content}>
<Outlet />
</div>
{match && <Navigate to='/settings/library' />}
</div>
);
};
export default Settings;
| Fix white flash when navigating to /settings | Fix white flash when navigating to /settings
| TypeScript | mit | KeitIG/museeks,KeitIG/museeks,KeitIG/museeks | typescript | ## Code Before:
import React from 'react';
import { Outlet, useMatch } from 'react-router';
import { Navigate } from 'react-router-dom';
import * as Nav from '../../elements/Nav/Nav';
import appStyles from '../../App.module.css';
import styles from './Settings.module.css';
const Settings: React.FC = () => {
const match = useMatch('/settings');
if (match) {
return <Navigate to='/settings/library' />;
}
return (
<div className={`${appStyles.view} ${styles.viewSettings}`}>
<div className={styles.settings__nav}>
<Nav.Wrap vertical>
<Nav.Link to='/settings/library'>Library</Nav.Link>
<Nav.Link to='/settings/audio'>Audio</Nav.Link>
<Nav.Link to='/settings/interface'>Interface</Nav.Link>
<Nav.Link to='/settings/about'>About</Nav.Link>
</Nav.Wrap>
</div>
<div className={styles.settings__content}>
<Outlet />
</div>
</div>
);
};
export default Settings;
## Instruction:
Fix white flash when navigating to /settings
## Code After:
import React from 'react';
import { Outlet, useMatch } from 'react-router';
import { Navigate } from 'react-router-dom';
import * as Nav from '../../elements/Nav/Nav';
import appStyles from '../../App.module.css';
import styles from './Settings.module.css';
const Settings: React.FC = () => {
const match = useMatch('/settings');
return (
<div className={`${appStyles.view} ${styles.viewSettings}`}>
<div className={styles.settings__nav}>
<Nav.Wrap vertical>
<Nav.Link to='/settings/library'>Library</Nav.Link>
<Nav.Link to='/settings/audio'>Audio</Nav.Link>
<Nav.Link to='/settings/interface'>Interface</Nav.Link>
<Nav.Link to='/settings/about'>About</Nav.Link>
</Nav.Wrap>
</div>
<div className={styles.settings__content}>
<Outlet />
</div>
{match && <Navigate to='/settings/library' />}
</div>
);
};
export default Settings;
|
2f45364580d1e93ad9c53ef51b929c49eeddcb92 | tests/Stubs/Controllers/UsersController.php | tests/Stubs/Controllers/UsersController.php | <?php
namespace Wnx\LaravelStats\Tests\Stubs\Controllers;
class UsersController extends Controller
{
public function index()
{
return [];
}
public function create()
{
return [];
}
public function store()
{
return [];
}
public function show()
{
return [];
}
public function edit()
{
return [];
}
public function update()
{
return [];
}
public function delete()
{
return [];
}
}
| <?php
namespace Wnx\LaravelStats\Tests\Stubs\Controllers;
class UsersController extends Controller
{
public function index()
{
return [];
}
public function create()
{
return [];
}
public function store()
{
return [];
}
public function show()
{
return [];
}
public function edit()
{
return [];
}
public function update()
{
return [];
}
public function delete()
{
return [];
}
private function thePrivateMethod()
{
//
}
protected function theProtectedMethod()
{
//
}
}
| Add private and protected Methods to stubs | Add private and protected Methods to stubs
| PHP | mit | stefanzweifel/laravel-stats | php | ## Code Before:
<?php
namespace Wnx\LaravelStats\Tests\Stubs\Controllers;
class UsersController extends Controller
{
public function index()
{
return [];
}
public function create()
{
return [];
}
public function store()
{
return [];
}
public function show()
{
return [];
}
public function edit()
{
return [];
}
public function update()
{
return [];
}
public function delete()
{
return [];
}
}
## Instruction:
Add private and protected Methods to stubs
## Code After:
<?php
namespace Wnx\LaravelStats\Tests\Stubs\Controllers;
class UsersController extends Controller
{
public function index()
{
return [];
}
public function create()
{
return [];
}
public function store()
{
return [];
}
public function show()
{
return [];
}
public function edit()
{
return [];
}
public function update()
{
return [];
}
public function delete()
{
return [];
}
private function thePrivateMethod()
{
//
}
protected function theProtectedMethod()
{
//
}
}
|
701de27b703d7f6f41b5b9654f7b0575737718bd | app/services/mailchimp_subscriber.rb | app/services/mailchimp_subscriber.rb | class MailchimpSubscriber
class Error < StandardError; end
def initialize(mailchimp_api)
@mailchimp_api = mailchimp_api
end
def subscribe(school, user)
list = @mailchimp_api.list_with_interests
config = mailchimp_signup_params(school, user, list)
if list && config.valid?
@mailchimp_api.subscribe(list.id, config)
else
raise Error.new('Mailchimp subscribe failed')
end
rescue MailchimpApi::Error => e
raise MailchimpSubscriber::Error.new(e)
end
def mailchimp_signup_params(school, user, list)
MailchimpSignupParams.new(
email_address: user.email,
tags: MailchimpTags.new(school).tags,
interests: find_interests(school, user, list),
merge_fields: {
'FULLNAME' => user.name,
'SCHOOL' => school.name,
}
)
end
def find_interests(school, user, list)
ret = {}
items = []
items << school.school_group.name if school.school_group
items << user.staff_role.title if user.staff_role
unless items.empty?
list.categories.each do |category|
category.interests.each do |interest|
if items.include?(interest.name)
ret[interest.id] = interest.id
end
end
end
end
ret
end
end
| class MailchimpSubscriber
class Error < StandardError; end
def initialize(mailchimp_api)
@mailchimp_api = mailchimp_api
end
def subscribe(school, user)
list = @mailchimp_api.list_with_interests
if list
config = mailchimp_signup_params(school, user, list)
if config.valid?
@mailchimp_api.subscribe(list.id, config)
else
raise MailchimpSubscriber::Error.new('Invalid newsletter subscription parameters')
end
else
raise MailchimpSubscriber::Error.new('Mailchimp API failed')
end
rescue MailchimpApi::Error => e
raise MailchimpSubscriber::Error.new(e)
end
def mailchimp_signup_params(school, user, list)
MailchimpSignupParams.new(
email_address: user.email,
tags: MailchimpTags.new(school).tags,
interests: find_interests(school, user, list),
merge_fields: {
'FULLNAME' => user.name,
'SCHOOL' => school.name,
}
)
end
def find_interests(school, user, list)
ret = {}
items = []
items << school.school_group.name if school.school_group
items << user.staff_role.title if user.staff_role
unless items.empty?
list.categories.each do |category|
category.interests.each do |interest|
if items.include?(interest.name)
ret[interest.id] = interest.id
end
end
end
end
ret
end
end
| Fix error handling and update user types | Fix error handling and update user types
| Ruby | mit | BathHacked/energy-sparks,BathHacked/energy-sparks,BathHacked/energy-sparks,BathHacked/energy-sparks | ruby | ## Code Before:
class MailchimpSubscriber
class Error < StandardError; end
def initialize(mailchimp_api)
@mailchimp_api = mailchimp_api
end
def subscribe(school, user)
list = @mailchimp_api.list_with_interests
config = mailchimp_signup_params(school, user, list)
if list && config.valid?
@mailchimp_api.subscribe(list.id, config)
else
raise Error.new('Mailchimp subscribe failed')
end
rescue MailchimpApi::Error => e
raise MailchimpSubscriber::Error.new(e)
end
def mailchimp_signup_params(school, user, list)
MailchimpSignupParams.new(
email_address: user.email,
tags: MailchimpTags.new(school).tags,
interests: find_interests(school, user, list),
merge_fields: {
'FULLNAME' => user.name,
'SCHOOL' => school.name,
}
)
end
def find_interests(school, user, list)
ret = {}
items = []
items << school.school_group.name if school.school_group
items << user.staff_role.title if user.staff_role
unless items.empty?
list.categories.each do |category|
category.interests.each do |interest|
if items.include?(interest.name)
ret[interest.id] = interest.id
end
end
end
end
ret
end
end
## Instruction:
Fix error handling and update user types
## Code After:
class MailchimpSubscriber
class Error < StandardError; end
def initialize(mailchimp_api)
@mailchimp_api = mailchimp_api
end
def subscribe(school, user)
list = @mailchimp_api.list_with_interests
if list
config = mailchimp_signup_params(school, user, list)
if config.valid?
@mailchimp_api.subscribe(list.id, config)
else
raise MailchimpSubscriber::Error.new('Invalid newsletter subscription parameters')
end
else
raise MailchimpSubscriber::Error.new('Mailchimp API failed')
end
rescue MailchimpApi::Error => e
raise MailchimpSubscriber::Error.new(e)
end
def mailchimp_signup_params(school, user, list)
MailchimpSignupParams.new(
email_address: user.email,
tags: MailchimpTags.new(school).tags,
interests: find_interests(school, user, list),
merge_fields: {
'FULLNAME' => user.name,
'SCHOOL' => school.name,
}
)
end
def find_interests(school, user, list)
ret = {}
items = []
items << school.school_group.name if school.school_group
items << user.staff_role.title if user.staff_role
unless items.empty?
list.categories.each do |category|
category.interests.each do |interest|
if items.include?(interest.name)
ret[interest.id] = interest.id
end
end
end
end
ret
end
end
|
081c217f307f290ab68669c15f4fc55da2ee73a6 | app/views/base_contents/_content.html.erb | app/views/base_contents/_content.html.erb | <li>
<div class="pull-left">
<div class="like">
<%= render partial: 'likes/like_status', locals: { item: content } %>
</div>
<div class="body">
<%= content.body %>
</div>
</div>
<br style="clear: both" />
</li>
| <li>
<div class="like">
<%= render partial: 'likes/like_status', locals: { item: content } %>
</div>
<div class="body">
<%= content.body %>
</div>
<% if current_user.try(:admin?) %>
<div class="delete-content">
<div class="pull-right">
Admin:
<%= link_to [content.link, content], method: :delete, class: 'no-decoration', data: { confirm: 'Are you sure you want to delete this content?' } do %>
<i class="icon-trash"></i>
<% end %>
</div>
</div>
<% end %>
<br style="clear: both" />
</li>
| Add link to delete content for admins, remove pull-left wrapper | Add link to delete content for admins, remove pull-left wrapper
| HTML+ERB | agpl-3.0 | Rootstrikers/vdash,Rootstrikers/vdash | html+erb | ## Code Before:
<li>
<div class="pull-left">
<div class="like">
<%= render partial: 'likes/like_status', locals: { item: content } %>
</div>
<div class="body">
<%= content.body %>
</div>
</div>
<br style="clear: both" />
</li>
## Instruction:
Add link to delete content for admins, remove pull-left wrapper
## Code After:
<li>
<div class="like">
<%= render partial: 'likes/like_status', locals: { item: content } %>
</div>
<div class="body">
<%= content.body %>
</div>
<% if current_user.try(:admin?) %>
<div class="delete-content">
<div class="pull-right">
Admin:
<%= link_to [content.link, content], method: :delete, class: 'no-decoration', data: { confirm: 'Are you sure you want to delete this content?' } do %>
<i class="icon-trash"></i>
<% end %>
</div>
</div>
<% end %>
<br style="clear: both" />
</li>
|
b5251dd951c0fc6f42c96c44810d539500fafd68 | app/views/pages/edit.html.erb | app/views/pages/edit.html.erb | <%= simple_form_for @page do |f| %>
<div class="row editor">
<div class="row-same-height row-full-height">
<div class="col-xs-6 col-xs-height col-full-height col-scan">
<div class="scanned-image-container">
<div class="scanned-image" style="background-image: url('<%= @page.scanned_image.url %>')"></div>
</div>
</div>
<div class="col-xs-6 col-xs-height col-full-height col-input">
<%= f.input :content, class: 'form-control input-lg', wrapper: false, label: false %>
</div>
</div>
</div>
<div class="pull-right bottom-bar">
<%= f.button :submit, "Envoyer cette page", class: 'btn-info' %>
</div>
<% end %> | <%= simple_form_for @page do |f| %>
<div class="row editor">
<div class="row-same-height row-full-height">
<div class="col-xs-6 col-xs-height col-full-height col-scan">
<div class="scanned-image-container">
<div class="scanned-image" style="background-image: url('<%= @page.scanned_image.url %>')"></div>
</div>
</div>
<div class="col-xs-6 col-xs-height col-full-height col-input">
<%= f.input :content, input_html: { class: 'input-lg' }, wrapper: false, label: false %>
</div>
</div>
</div>
<div class="pull-right bottom-bar">
<%= f.button :submit, "Envoyer cette page", class: 'btn-info' %>
</div>
<% end %> | Fix editor textarea font size | Fix editor textarea font size
| HTML+ERB | mit | francoisbruneau/kazimirski,francoisbruneau/kazimirski,francoisbruneau/kazimirski,francoisbruneau/kazimirski,francoisbruneau/kazimirski | html+erb | ## Code Before:
<%= simple_form_for @page do |f| %>
<div class="row editor">
<div class="row-same-height row-full-height">
<div class="col-xs-6 col-xs-height col-full-height col-scan">
<div class="scanned-image-container">
<div class="scanned-image" style="background-image: url('<%= @page.scanned_image.url %>')"></div>
</div>
</div>
<div class="col-xs-6 col-xs-height col-full-height col-input">
<%= f.input :content, class: 'form-control input-lg', wrapper: false, label: false %>
</div>
</div>
</div>
<div class="pull-right bottom-bar">
<%= f.button :submit, "Envoyer cette page", class: 'btn-info' %>
</div>
<% end %>
## Instruction:
Fix editor textarea font size
## Code After:
<%= simple_form_for @page do |f| %>
<div class="row editor">
<div class="row-same-height row-full-height">
<div class="col-xs-6 col-xs-height col-full-height col-scan">
<div class="scanned-image-container">
<div class="scanned-image" style="background-image: url('<%= @page.scanned_image.url %>')"></div>
</div>
</div>
<div class="col-xs-6 col-xs-height col-full-height col-input">
<%= f.input :content, input_html: { class: 'input-lg' }, wrapper: false, label: false %>
</div>
</div>
</div>
<div class="pull-right bottom-bar">
<%= f.button :submit, "Envoyer cette page", class: 'btn-info' %>
</div>
<% end %> |
e0db2033eaa5e00c40a7be02f2849887d2393364 | example/src/client.js | example/src/client.js | import 'babel-polyfill';
import React from 'react';
import { render } from 'express-react-router';
import routes from './routes';
// Turn on React Dev tools
window.React = React;
// Render react-router to page
render(
routes,
window.document.getElementById('reactContent'),
{
title: 'Express React Router Example Site'
},
() => {
return {
url: window.location.pathname
};
}
);
| import 'babel-polyfill';
import React from 'react';
import { render } from 'express-react-router';
import routes from './routes';
// Turn on React Dev tools
window.React = React;
// Render react-router to page
render(
routes,
window.document.getElementById('reactContent'),
{
title: 'Express React Router Example Site'
},
() => {
const url = window.location.pathname;
document.title = `Example Page - ${url}`;
return { url };
}
);
| Update Example to Change Title | Update Example to Change Title
Update the example site to show how to change the title of the page when the url changes.
| JavaScript | mit | nheyn/express-react-router | javascript | ## Code Before:
import 'babel-polyfill';
import React from 'react';
import { render } from 'express-react-router';
import routes from './routes';
// Turn on React Dev tools
window.React = React;
// Render react-router to page
render(
routes,
window.document.getElementById('reactContent'),
{
title: 'Express React Router Example Site'
},
() => {
return {
url: window.location.pathname
};
}
);
## Instruction:
Update Example to Change Title
Update the example site to show how to change the title of the page when the url changes.
## Code After:
import 'babel-polyfill';
import React from 'react';
import { render } from 'express-react-router';
import routes from './routes';
// Turn on React Dev tools
window.React = React;
// Render react-router to page
render(
routes,
window.document.getElementById('reactContent'),
{
title: 'Express React Router Example Site'
},
() => {
const url = window.location.pathname;
document.title = `Example Page - ${url}`;
return { url };
}
);
|
329a440103dd0f305159843e648e0bee3ebe873d | rock/data/runtime/python.yml | rock/data/runtime/python.yml | build: |
test -f ./requirements.txt
test -f ./venv/bin/activate || \
virtualenv --distribute --no-site-packages ./venv
source ./venv/bin/activate 2>/dev/null
pip install -r ./requirements.txt
test: |
source ./venv/bin/activate 2>/dev/null
./venv/bin/nosetests
run: |
source ./venv/bin/activate 2>/dev/null
{command}
| build: |
test -f ./requirements.txt
test -f ./venv/bin/activate || virtualenv --distribute ./venv
source ./venv/bin/activate 2>/dev/null
pip install -r ./requirements.txt
test: |
source ./venv/bin/activate 2>/dev/null
./venv/bin/nosetests
run: |
source ./venv/bin/activate 2>/dev/null
{command}
| Remove --no-site-packages from virtualenv setup | Remove --no-site-packages from virtualenv setup
| YAML | mit | silas/rock,silas/rock,silas/rock,silas/rock,silas/rock,silas/rock,silas/rock,silas/rock | yaml | ## Code Before:
build: |
test -f ./requirements.txt
test -f ./venv/bin/activate || \
virtualenv --distribute --no-site-packages ./venv
source ./venv/bin/activate 2>/dev/null
pip install -r ./requirements.txt
test: |
source ./venv/bin/activate 2>/dev/null
./venv/bin/nosetests
run: |
source ./venv/bin/activate 2>/dev/null
{command}
## Instruction:
Remove --no-site-packages from virtualenv setup
## Code After:
build: |
test -f ./requirements.txt
test -f ./venv/bin/activate || virtualenv --distribute ./venv
source ./venv/bin/activate 2>/dev/null
pip install -r ./requirements.txt
test: |
source ./venv/bin/activate 2>/dev/null
./venv/bin/nosetests
run: |
source ./venv/bin/activate 2>/dev/null
{command}
|
1550ea8bd2a89b42c6aabc16a95cb1be9a46d309 | README.md | README.md |
spec :mthd_name do
typesig "ANNOTATION"
end
## Annotation Syntax
"( arg0, arg1, … argN ) { Annotation } -> Type" ### Method Arguments, Block, and Return
## Argument Syntax
"Type …" ### Standard Argument
"typevar …" ### Lowercase Type Variable for Generic Types
"?Type …" ### Optional Argument
"*Type …" ### Variable Number of Arguments (Splat)
## Type Syntax
"… Class" ### Standard Type Definition
"… :sym" ### Symbol
"… %any" ### Type Placeholder (Any Type)
"… %bool" ### Boolean Value (TrueClass and FalseClass)
"… Type0 OR Type1" ### Union Types
|
spec :mthd_name do
typesig "ANNOTATION"
end
## Annotation Syntax
"( arg0, arg1, … argN ) { Annotation } -> Type" ### Method Arguments, Block, and Return
## Argument Syntax
"Type …" ### Standard Argument
"typevar …" ### Lowercase Type Variable for Generic Types
"?Type …" ### Optional Argument
"*Type …" ### Variable Number of Arguments (Splat)
## Type Syntax
"… Class" ### Standard Type Definition
"… :sym" ### Symbol
"… %any" ### Type Placeholder (Any Type)
"… %bool" ### Boolean Value (TrueClass and FalseClass)
"… Type0 OR Type1" ### Union Types
# RDL Quick Reference
| API call | Meaning |
| --- | --- |
| `spec` | a |
| `keyword` |
| `dsl` |
| `arg` |
| `pre_cond { block }` |
| `pre_task { block }` |
| `post_cond { block }` |
| `post_task { block }` |
| `dsl_from { block }` |
| `Spec.new` |
| `ret_dep` |
| Clean up formatting a bit | Clean up formatting a bit
| Markdown | bsd-3-clause | plum-umd/rdl | markdown | ## Code Before:
spec :mthd_name do
typesig "ANNOTATION"
end
## Annotation Syntax
"( arg0, arg1, … argN ) { Annotation } -> Type" ### Method Arguments, Block, and Return
## Argument Syntax
"Type …" ### Standard Argument
"typevar …" ### Lowercase Type Variable for Generic Types
"?Type …" ### Optional Argument
"*Type …" ### Variable Number of Arguments (Splat)
## Type Syntax
"… Class" ### Standard Type Definition
"… :sym" ### Symbol
"… %any" ### Type Placeholder (Any Type)
"… %bool" ### Boolean Value (TrueClass and FalseClass)
"… Type0 OR Type1" ### Union Types
## Instruction:
Clean up formatting a bit
## Code After:
spec :mthd_name do
typesig "ANNOTATION"
end
## Annotation Syntax
"( arg0, arg1, … argN ) { Annotation } -> Type" ### Method Arguments, Block, and Return
## Argument Syntax
"Type …" ### Standard Argument
"typevar …" ### Lowercase Type Variable for Generic Types
"?Type …" ### Optional Argument
"*Type …" ### Variable Number of Arguments (Splat)
## Type Syntax
"… Class" ### Standard Type Definition
"… :sym" ### Symbol
"… %any" ### Type Placeholder (Any Type)
"… %bool" ### Boolean Value (TrueClass and FalseClass)
"… Type0 OR Type1" ### Union Types
# RDL Quick Reference
| API call | Meaning |
| --- | --- |
| `spec` | a |
| `keyword` |
| `dsl` |
| `arg` |
| `pre_cond { block }` |
| `pre_task { block }` |
| `post_cond { block }` |
| `post_task { block }` |
| `dsl_from { block }` |
| `Spec.new` |
| `ret_dep` |
|
aa795e9572d21289f86d64db3e45bed7a199cf0b | src/main/java/com/sakamichi46/api/AbstractSakamichi46Resource.java | src/main/java/com/sakamichi46/api/AbstractSakamichi46Resource.java | package com.sakamichi46.api;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.sakamichi46.model.Member;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
/**
*
* @author kikuta
*/
public abstract class AbstractSakamichi46Resource {
protected static final ObjectMapper mapper = new ObjectMapper();
protected Map<String, Member> memberMap;
public abstract void init();
@GET
@Path("profile/{name}")
@Produces(MediaType.APPLICATION_JSON)
public Member getProfile(@PathParam("name") String name) {
return memberMap.get(name);
}
@GET
@Path("profile/all")
@Produces(MediaType.APPLICATION_JSON)
public List<Member> getAllProfiles() {
return memberMap.values().stream().collect(Collectors.toList());
}
@GET
@Path("member/count")
@Produces(MediaType.TEXT_PLAIN)
public int getMemberCount() {
return memberMap.values().size();
}
}
| package com.sakamichi46.api;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.sakamichi46.model.Member;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
/**
*
* @author kikuta
*/
public abstract class AbstractSakamichi46Resource {
protected static final ObjectMapper mapper = new ObjectMapper();
protected Map<String, Member> memberMap;
public abstract void init();
@GET
@Path("profile/{name}")
@Produces(MediaType.APPLICATION_JSON)
public Member getProfile(@PathParam("name") String name) {
return memberMap.get(name);
}
@GET
@Path("profile")
@Produces(MediaType.APPLICATION_JSON)
public List<Member> getAllProfiles() {
return memberMap.values().stream().collect(Collectors.toList());
}
@GET
@Path("count")
@Produces(MediaType.TEXT_PLAIN)
public int getMemberCount() {
return memberMap.values().size();
}
}
| Change url path for simplifying | Change url path for simplifying | Java | mit | kikutaro/Sakamichi46Api,kikutaro/Sakamichi46Api | java | ## Code Before:
package com.sakamichi46.api;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.sakamichi46.model.Member;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
/**
*
* @author kikuta
*/
public abstract class AbstractSakamichi46Resource {
protected static final ObjectMapper mapper = new ObjectMapper();
protected Map<String, Member> memberMap;
public abstract void init();
@GET
@Path("profile/{name}")
@Produces(MediaType.APPLICATION_JSON)
public Member getProfile(@PathParam("name") String name) {
return memberMap.get(name);
}
@GET
@Path("profile/all")
@Produces(MediaType.APPLICATION_JSON)
public List<Member> getAllProfiles() {
return memberMap.values().stream().collect(Collectors.toList());
}
@GET
@Path("member/count")
@Produces(MediaType.TEXT_PLAIN)
public int getMemberCount() {
return memberMap.values().size();
}
}
## Instruction:
Change url path for simplifying
## Code After:
package com.sakamichi46.api;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.sakamichi46.model.Member;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
/**
*
* @author kikuta
*/
public abstract class AbstractSakamichi46Resource {
protected static final ObjectMapper mapper = new ObjectMapper();
protected Map<String, Member> memberMap;
public abstract void init();
@GET
@Path("profile/{name}")
@Produces(MediaType.APPLICATION_JSON)
public Member getProfile(@PathParam("name") String name) {
return memberMap.get(name);
}
@GET
@Path("profile")
@Produces(MediaType.APPLICATION_JSON)
public List<Member> getAllProfiles() {
return memberMap.values().stream().collect(Collectors.toList());
}
@GET
@Path("count")
@Produces(MediaType.TEXT_PLAIN)
public int getMemberCount() {
return memberMap.values().size();
}
}
|
1d0585dcb1caaec8b9fbcc7eb8c4c31e6a382af4 | models/ras_220_genes/batch_doi_lookup.py | models/ras_220_genes/batch_doi_lookup.py | import csv
from indra.literature import pubmed_client, crossref_client
doi_cache = {}
with open('doi_cache.txt') as f:
csvreader = csv.reader(f, delimiter='\t')
for row in csvreader:
doi_cache[row[0]] = row[1]
with open('missing_dois.txt') as f:
missing_dois = [line.strip('\n') for line in f.readlines()]
for counter, ref in enumerate(missing_dois):
if doi_cache.get(ref):
print "Already got", ref
continue
title = pubmed_client.get_title(ref)
if not title:
print "No title, skipping", ref
continue
doi = crossref_client.doi_query(title)
doi_cache[ref] = doi
print "%d: %s --> %s" % (counter, ref, doi)
if counter % 100 == 0:
with open('doi_cache_%.5d.txt' % counter, 'w') as f:
print "Writing to doi cache"
csvwriter = csv.writer(f, delimiter='\t')
for k, v in doi_cache.iteritems():
csvwriter.writerow((k, v))
| import csv
from indra.literature import pubmed_client, crossref_client
doi_cache = {}
with open('doi_cache.txt') as f:
csvreader = csv.reader(f, delimiter='\t')
for row in csvreader:
doi_cache[row[0]] = row[1]
with open('missing_dois.txt') as f:
missing_dois = [line.strip('\n') for line in f.readlines()]
def save(doi_cache, counter):
with open('doi_cache_%.5d.txt' % counter, 'w') as f:
print "Writing to doi cache"
csvwriter = csv.writer(f, delimiter='\t')
for k, v in doi_cache.iteritems():
csvwriter.writerow((k, v))
for counter, ref in enumerate(missing_dois):
if doi_cache.get(ref):
print "Already got", ref
continue
title = pubmed_client.get_title(ref)
if not title:
print "No title, skipping", ref
continue
doi = crossref_client.doi_query(title)
doi_cache[ref] = doi
print "%d: %s --> %s" % (counter, ref, doi)
if counter % 100 == 0:
save(doi_cache, counter)
save(doi_cache, counter)
| Add final save to batch lookup | Add final save to batch lookup
| Python | bsd-2-clause | sorgerlab/indra,sorgerlab/indra,johnbachman/indra,jmuhlich/indra,johnbachman/indra,sorgerlab/belpy,jmuhlich/indra,johnbachman/belpy,jmuhlich/indra,pvtodorov/indra,sorgerlab/indra,pvtodorov/indra,sorgerlab/belpy,pvtodorov/indra,johnbachman/belpy,bgyori/indra,johnbachman/indra,pvtodorov/indra,bgyori/indra,sorgerlab/belpy,johnbachman/belpy,bgyori/indra | python | ## Code Before:
import csv
from indra.literature import pubmed_client, crossref_client
doi_cache = {}
with open('doi_cache.txt') as f:
csvreader = csv.reader(f, delimiter='\t')
for row in csvreader:
doi_cache[row[0]] = row[1]
with open('missing_dois.txt') as f:
missing_dois = [line.strip('\n') for line in f.readlines()]
for counter, ref in enumerate(missing_dois):
if doi_cache.get(ref):
print "Already got", ref
continue
title = pubmed_client.get_title(ref)
if not title:
print "No title, skipping", ref
continue
doi = crossref_client.doi_query(title)
doi_cache[ref] = doi
print "%d: %s --> %s" % (counter, ref, doi)
if counter % 100 == 0:
with open('doi_cache_%.5d.txt' % counter, 'w') as f:
print "Writing to doi cache"
csvwriter = csv.writer(f, delimiter='\t')
for k, v in doi_cache.iteritems():
csvwriter.writerow((k, v))
## Instruction:
Add final save to batch lookup
## Code After:
import csv
from indra.literature import pubmed_client, crossref_client
doi_cache = {}
with open('doi_cache.txt') as f:
csvreader = csv.reader(f, delimiter='\t')
for row in csvreader:
doi_cache[row[0]] = row[1]
with open('missing_dois.txt') as f:
missing_dois = [line.strip('\n') for line in f.readlines()]
def save(doi_cache, counter):
with open('doi_cache_%.5d.txt' % counter, 'w') as f:
print "Writing to doi cache"
csvwriter = csv.writer(f, delimiter='\t')
for k, v in doi_cache.iteritems():
csvwriter.writerow((k, v))
for counter, ref in enumerate(missing_dois):
if doi_cache.get(ref):
print "Already got", ref
continue
title = pubmed_client.get_title(ref)
if not title:
print "No title, skipping", ref
continue
doi = crossref_client.doi_query(title)
doi_cache[ref] = doi
print "%d: %s --> %s" % (counter, ref, doi)
if counter % 100 == 0:
save(doi_cache, counter)
save(doi_cache, counter)
|
a02b9e251832de703e514e474a824fdd75d84f03 | README.md | README.md |
Template based content generator
## Install
npm install --global congen
## Example usage
Make a congen template file called **_posts/_post.md.congen** with the following contents:
---
layout: post
title: <{ title }>
date: <{ date }>
categories: congen
---
<{ lorem.paragraphs }>
Then use congen to generate as many as you'd like:
$ congen
## References
- http://blog.npmjs.org/post/118810260230/building-a-simple-command-line-tool-with-npm
- https://nodejs.org/dist/latest-v4.x/docs/api/
- https://lodash.com/docs
- https://github.com/felixge/node-dateformat
- https://github.com/marak/Faker.js/
- https://github.com/tj/ejs/blob/master/ejs.js
|
Template based content generator
## Install
npm install --global congen
## Example usage
Make a congen template file called **_posts/_post.md.congen** with the following contents:
---
layout: post
title: <{ title }>
date: <{ date }>
categories: congen
---
<{ lorem.paragraphs }>
Then use congen to generate as many as you'd like:
$ congen
## License
[ISC](LICENSE)
## References
- http://blog.npmjs.org/post/118810260230/building-a-simple-command-line-tool-with-npm
- https://nodejs.org/dist/latest-v4.x/docs/api/
- https://lodash.com/docs
- https://github.com/felixge/node-dateformat
- https://github.com/marak/Faker.js/
- https://github.com/tj/ejs/blob/master/ejs.js
| Add license section to readme | Add license section to readme
| Markdown | isc | msmithgu/congen | markdown | ## Code Before:
Template based content generator
## Install
npm install --global congen
## Example usage
Make a congen template file called **_posts/_post.md.congen** with the following contents:
---
layout: post
title: <{ title }>
date: <{ date }>
categories: congen
---
<{ lorem.paragraphs }>
Then use congen to generate as many as you'd like:
$ congen
## References
- http://blog.npmjs.org/post/118810260230/building-a-simple-command-line-tool-with-npm
- https://nodejs.org/dist/latest-v4.x/docs/api/
- https://lodash.com/docs
- https://github.com/felixge/node-dateformat
- https://github.com/marak/Faker.js/
- https://github.com/tj/ejs/blob/master/ejs.js
## Instruction:
Add license section to readme
## Code After:
Template based content generator
## Install
npm install --global congen
## Example usage
Make a congen template file called **_posts/_post.md.congen** with the following contents:
---
layout: post
title: <{ title }>
date: <{ date }>
categories: congen
---
<{ lorem.paragraphs }>
Then use congen to generate as many as you'd like:
$ congen
## License
[ISC](LICENSE)
## References
- http://blog.npmjs.org/post/118810260230/building-a-simple-command-line-tool-with-npm
- https://nodejs.org/dist/latest-v4.x/docs/api/
- https://lodash.com/docs
- https://github.com/felixge/node-dateformat
- https://github.com/marak/Faker.js/
- https://github.com/tj/ejs/blob/master/ejs.js
|
bbac4885b16eb20507d4065be7fdb8a1d8d69ab7 | _drafts/Ultra-laptop-and-cds-dvds.md | _drafts/Ultra-laptop-and-cds-dvds.md | ---
layout: post
author:
name: Adrien Lecharpentier
email: adrien.lecharpentier@gmail.com
title: Ultra laptop and CDs/DVDs
tags: misc
---
| ---
layout: post
author:
name: Adrien Lecharpentier
email: adrien.lecharpentier@gmail.com
title: Ultra laptop and CDs/DVDs
tags: misc
---
Recently, my sister-in-law bought a new ultra laptop. First thing to notice, like Apple recent laptops, there is no CD / DVD input. That's fair, I mean, we download __legally__ everything now.
But when you need to re-install your laptop, how do you do this? Back in my youth (not that far away!), laptops were shipped with a CD or a DVD to be able to (re)install Windows. You could have a lot of reason to do so: you want to have both Windows and Linux, you changed the hard-drive (in favor to a SSD)..
As you don't have a CD/DVD input, manufacturer stop to do this. Where is your way to choose what to install on your brand new laptop now? What is the cost to ship a bootable USB stick to install Windows, or what ever OS that your laptop had?
Please, someone, explain this to me!
| Add initial version of the post | Add initial version of the post
| Markdown | mit | alecharp/blog.lecharpentier.org,alecharp/blog | markdown | ## Code Before:
---
layout: post
author:
name: Adrien Lecharpentier
email: adrien.lecharpentier@gmail.com
title: Ultra laptop and CDs/DVDs
tags: misc
---
## Instruction:
Add initial version of the post
## Code After:
---
layout: post
author:
name: Adrien Lecharpentier
email: adrien.lecharpentier@gmail.com
title: Ultra laptop and CDs/DVDs
tags: misc
---
Recently, my sister-in-law bought a new ultra laptop. First thing to notice, like Apple recent laptops, there is no CD / DVD input. That's fair, I mean, we download __legally__ everything now.
But when you need to re-install your laptop, how do you do this? Back in my youth (not that far away!), laptops were shipped with a CD or a DVD to be able to (re)install Windows. You could have a lot of reason to do so: you want to have both Windows and Linux, you changed the hard-drive (in favor to a SSD)..
As you don't have a CD/DVD input, manufacturer stop to do this. Where is your way to choose what to install on your brand new laptop now? What is the cost to ship a bootable USB stick to install Windows, or what ever OS that your laptop had?
Please, someone, explain this to me!
|
f39b9347162a43fe14b0f6372849bc1f7aba45c1 | exercises/practice/hello-world/src/hello_world.erl | exercises/practice/hello-world/src/hello_world.erl | -module(hello_world).
-export([hello/0]).
hello() -> undefined.
| -module(hello_world).
-export([hello/0]).
hello() ->
"Goodbye, Mars!".
| Simplify the `hello-world` exercise's stub. The goal of this is to make things easier for students to get started and to introduce as little syntax as possible. | Simplify the `hello-world` exercise's stub. The goal of this is to make things easier for students to get started and to introduce as little syntax as possible.
| Erlang | mit | NobbZ/xerlang | erlang | ## Code Before:
-module(hello_world).
-export([hello/0]).
hello() -> undefined.
## Instruction:
Simplify the `hello-world` exercise's stub. The goal of this is to make things easier for students to get started and to introduce as little syntax as possible.
## Code After:
-module(hello_world).
-export([hello/0]).
hello() ->
"Goodbye, Mars!".
|
c3327835827ccf841c0322a542cad24fe7f5e5e3 | src/components/code-select.vue | src/components/code-select.vue | <template>
<select class="form-control" v-model="myValue">
<option v-for="val in values" :value="val.id" :key="val.id">
{{val.digits}} {{val.label}}
</option>
</select>
</template>
<script lang="ts">
import { Component, Prop, Watch } from 'vue-property-decorator';
import Vue from "vue";
import {findWithAttr} from '../jmsml'
@Component({
})
export default class CodeSelect extends Vue {
myValue = null;
@Prop()
values;
@Prop()
value;
created() {
this.myValue = this.value.id;
}
@Watch('value')
onVChange(nn){
this.myValue = nn.id;
}
@Watch("myValue")
onValueChange(newValue) {
let obj = findWithAttr(this.values, 'id', newValue)
this.$emit('input', obj);
}
}
</script>
| <template>
<select class="form-control" v-model="myValue">
<option v-for="val in values" :value="val" :key="val.id">
{{val.digits}} {{val.label}}
</option>
</select>
</template>
<script lang="ts">
import { Component, Prop, Watch } from 'vue-property-decorator';
import Vue from "vue";
@Component({})
export default class CodeSelect extends Vue {
myValue = null;
@Prop()
values;
@Prop()
value;
created() {
this.myValue = this.value;
}
@Watch('value')
onVChange(nn) {
this.myValue = nn;
}
@Watch("myValue")
onValueChange(newValue) {
this.$emit('input', newValue);
}
}
</script>
| Use object instead of id as select value | Use object instead of id as select value
| Vue | apache-2.0 | kjellmf/military-symbology-explorer,kjellmf/military-symbology-explorer,kjellmf/military-symbology-explorer,kjellmf/military-symbology-explorer | vue | ## Code Before:
<template>
<select class="form-control" v-model="myValue">
<option v-for="val in values" :value="val.id" :key="val.id">
{{val.digits}} {{val.label}}
</option>
</select>
</template>
<script lang="ts">
import { Component, Prop, Watch } from 'vue-property-decorator';
import Vue from "vue";
import {findWithAttr} from '../jmsml'
@Component({
})
export default class CodeSelect extends Vue {
myValue = null;
@Prop()
values;
@Prop()
value;
created() {
this.myValue = this.value.id;
}
@Watch('value')
onVChange(nn){
this.myValue = nn.id;
}
@Watch("myValue")
onValueChange(newValue) {
let obj = findWithAttr(this.values, 'id', newValue)
this.$emit('input', obj);
}
}
</script>
## Instruction:
Use object instead of id as select value
## Code After:
<template>
<select class="form-control" v-model="myValue">
<option v-for="val in values" :value="val" :key="val.id">
{{val.digits}} {{val.label}}
</option>
</select>
</template>
<script lang="ts">
import { Component, Prop, Watch } from 'vue-property-decorator';
import Vue from "vue";
@Component({})
export default class CodeSelect extends Vue {
myValue = null;
@Prop()
values;
@Prop()
value;
created() {
this.myValue = this.value;
}
@Watch('value')
onVChange(nn) {
this.myValue = nn;
}
@Watch("myValue")
onValueChange(newValue) {
this.$emit('input', newValue);
}
}
</script>
|
a389a4e8807cabced1a08e4ee3c6798dd4e34ea9 | memory-store.js | memory-store.js | var SortedArray = require('sorted-array')
var compareTime = require('./compare-time')
function compareCreated (a, b) {
return compareTime(b[1].created, a[1].created)
}
function compareAdded (a, b) {
return b[1].added - a[1].added
}
/**
* Simpliest memory-based events store.
*
* It is good for tests, but not for server or client usage,
* because it doesn’t save events to file or localStorage.
*
* @example
* import { MemoryStore } from 'logux-core'
*
* var log = new Log({
* store: new MemoryStore(),
* timer: createTestTimer()
* })
*
* @class
*/
function MemoryStore () {
this.created = new SortedArray([], compareCreated)
this.added = new SortedArray([], compareAdded)
}
MemoryStore.prototype = {
get: function get (order) {
var data = order === 'added' ? this.added : this.created
return Promise.resolve({ data: data.array })
},
add: function add (entry) {
this.created.insert(entry)
this.added.insert(entry)
},
remove: function remove (entry) {
this.created.remove(entry)
this.added.remove(entry)
}
}
module.exports = MemoryStore
| var SortedArray = require('sorted-array')
var compareTime = require('./compare-time')
function compareCreated (a, b) {
return compareTime(b[1].created, a[1].created)
}
/**
* Simpliest memory-based events store.
*
* It is good for tests, but not for server or client usage,
* because it doesn’t save events to file or localStorage.
*
* @example
* import { MemoryStore } from 'logux-core'
*
* var log = new Log({
* store: new MemoryStore(),
* timer: createTestTimer()
* })
*
* @class
*/
function MemoryStore () {
this.created = new SortedArray([], compareCreated)
this.added = []
}
MemoryStore.prototype = {
get: function get (order) {
if (order === 'added') {
return Promise.resolve({ data: this.added })
} else {
return Promise.resolve({ data: this.created.array })
}
},
add: function add (entry) {
this.created.insert(entry)
this.added.unshift(entry)
},
remove: function remove (entry) {
this.created.remove(entry)
for (var i = this.added.length - 1; i >= 0; i--) {
if (compareTime(this.added[i][1].created, entry[1].created) === 0) {
this.added.splice(i, 1)
break
}
}
}
}
module.exports = MemoryStore
| Use simple array for added index in MemoryStore | Use simple array for added index in MemoryStore
| JavaScript | mit | logux/logux-core | javascript | ## Code Before:
var SortedArray = require('sorted-array')
var compareTime = require('./compare-time')
function compareCreated (a, b) {
return compareTime(b[1].created, a[1].created)
}
function compareAdded (a, b) {
return b[1].added - a[1].added
}
/**
* Simpliest memory-based events store.
*
* It is good for tests, but not for server or client usage,
* because it doesn’t save events to file or localStorage.
*
* @example
* import { MemoryStore } from 'logux-core'
*
* var log = new Log({
* store: new MemoryStore(),
* timer: createTestTimer()
* })
*
* @class
*/
function MemoryStore () {
this.created = new SortedArray([], compareCreated)
this.added = new SortedArray([], compareAdded)
}
MemoryStore.prototype = {
get: function get (order) {
var data = order === 'added' ? this.added : this.created
return Promise.resolve({ data: data.array })
},
add: function add (entry) {
this.created.insert(entry)
this.added.insert(entry)
},
remove: function remove (entry) {
this.created.remove(entry)
this.added.remove(entry)
}
}
module.exports = MemoryStore
## Instruction:
Use simple array for added index in MemoryStore
## Code After:
var SortedArray = require('sorted-array')
var compareTime = require('./compare-time')
function compareCreated (a, b) {
return compareTime(b[1].created, a[1].created)
}
/**
* Simpliest memory-based events store.
*
* It is good for tests, but not for server or client usage,
* because it doesn’t save events to file or localStorage.
*
* @example
* import { MemoryStore } from 'logux-core'
*
* var log = new Log({
* store: new MemoryStore(),
* timer: createTestTimer()
* })
*
* @class
*/
function MemoryStore () {
this.created = new SortedArray([], compareCreated)
this.added = []
}
MemoryStore.prototype = {
get: function get (order) {
if (order === 'added') {
return Promise.resolve({ data: this.added })
} else {
return Promise.resolve({ data: this.created.array })
}
},
add: function add (entry) {
this.created.insert(entry)
this.added.unshift(entry)
},
remove: function remove (entry) {
this.created.remove(entry)
for (var i = this.added.length - 1; i >= 0; i--) {
if (compareTime(this.added[i][1].created, entry[1].created) === 0) {
this.added.splice(i, 1)
break
}
}
}
}
module.exports = MemoryStore
|
f91c4e6021249f9d3f557855e52ebb6dad1d4ebc | zazu.yaml | zazu.yaml |
issueTracker:
type: jira
url: https://zazucli.atlassian.net/
project: ZZ
codeReviewer:
type: github
owner: stopthatcow
repo: zazu
style:
- include:
- setup.py
- docs/**.py
- tests/**.py
- zazu/**.py
stylers:
- type: autopep8
options:
- "--max-line-length=150"
- type: docformatter
options:
- "--wrap-summaries=0"
- "--wrap-descriptions=0"
- "--blank"
# Fix common misspellings.
- type: generic
command: sed
options:
- "s/responce/response/g"
|
issueTracker:
type: github
owner: stopthatcow
repo: zazu
#issueTracker:
# type: jira
# url: https://zazucli.atlassian.net/
# project: ZZ
codeReviewer:
type: github
owner: stopthatcow
repo: zazu
style:
- include:
- setup.py
- docs/**.py
- tests/**.py
- zazu/**.py
stylers:
- type: autopep8
options:
- "--max-line-length=150"
- type: docformatter
options:
- "--wrap-summaries=0"
- "--wrap-descriptions=0"
- "--blank"
# Fix common misspellings.
- type: generic
command: sed
options:
- "s/responce/response/g"
| Switch back to github issue tracker | Switch back to github issue tracker
(feature/89_autocompletion)
| YAML | mit | stopthatcow/zazu,stopthatcow/zazu | yaml | ## Code Before:
issueTracker:
type: jira
url: https://zazucli.atlassian.net/
project: ZZ
codeReviewer:
type: github
owner: stopthatcow
repo: zazu
style:
- include:
- setup.py
- docs/**.py
- tests/**.py
- zazu/**.py
stylers:
- type: autopep8
options:
- "--max-line-length=150"
- type: docformatter
options:
- "--wrap-summaries=0"
- "--wrap-descriptions=0"
- "--blank"
# Fix common misspellings.
- type: generic
command: sed
options:
- "s/responce/response/g"
## Instruction:
Switch back to github issue tracker
(feature/89_autocompletion)
## Code After:
issueTracker:
type: github
owner: stopthatcow
repo: zazu
#issueTracker:
# type: jira
# url: https://zazucli.atlassian.net/
# project: ZZ
codeReviewer:
type: github
owner: stopthatcow
repo: zazu
style:
- include:
- setup.py
- docs/**.py
- tests/**.py
- zazu/**.py
stylers:
- type: autopep8
options:
- "--max-line-length=150"
- type: docformatter
options:
- "--wrap-summaries=0"
- "--wrap-descriptions=0"
- "--blank"
# Fix common misspellings.
- type: generic
command: sed
options:
- "s/responce/response/g"
|
9858c56188f4d6c81daf6535e7cd58ff23e20712 | application/senic/nuimo_hub/tests/test_setup_wifi.py | application/senic/nuimo_hub/tests/test_setup_wifi.py | import pytest
from mock import patch
@pytest.fixture
def url(route_url):
return route_url('wifi_setup')
def test_get_scanned_wifi(browser, url):
assert browser.get_json(url).json == ['grandpausethisnetwork']
@pytest.fixture
def no_such_wifi(settings):
settings['wifi_networks_path'] = '/no/such/file'
return settings
def test_get_scanned_wifi_empty(no_such_wifi, browser, url):
assert browser.get_json(url).json == []
@pytest.yield_fixture(autouse=True)
def mocked_run(request):
"""don't run actual external commands during these tests
"""
with patch('senic.nuimo_hub.views.setup_wifi.run')\
as mocked_run:
yield mocked_run
def test_join_wifi(browser, url, mocked_run, settings):
browser.post_json(url, dict(
ssid='grandpausethisnetwork',
password='foobar',
device='wlan0')).json
mocked_run.assert_called_once_with(
[
'sudo',
'%s/join_wifi' % settings['bin_path'],
'-c {fs_config_ini}'.format(**settings),
'grandpausethisnetwork',
'foobar',
]
)
| import pytest
from mock import patch
@pytest.fixture
def setup_url(route_url):
return route_url('wifi_setup')
def test_get_scanned_wifi(browser, setup_url):
assert browser.get_json(setup_url).json == ['grandpausethisnetwork']
@pytest.fixture
def no_such_wifi(settings):
settings['wifi_networks_path'] = '/no/such/file'
return settings
def test_get_scanned_wifi_empty(no_such_wifi, browser, setup_url):
assert browser.get_json(setup_url).json == []
@pytest.yield_fixture(autouse=True)
def mocked_run(request):
"""don't run actual external commands during these tests
"""
with patch('senic.nuimo_hub.views.setup_wifi.run')\
as mocked_run:
yield mocked_run
def test_join_wifi(browser, setup_url, mocked_run, settings):
browser.post_json(setup_url, dict(
ssid='grandpausethisnetwork',
password='foobar',
device='wlan0')).json
mocked_run.assert_called_once_with(
[
'sudo',
'%s/join_wifi' % settings['bin_path'],
'-c {fs_config_ini}'.format(**settings),
'grandpausethisnetwork',
'foobar',
]
)
| Make `url` fixture less generic | Make `url` fixture less generic
in preparation for additional endpoints
| Python | mit | grunskis/nuimo-hub-backend,grunskis/nuimo-hub-backend,getsenic/senic-hub,grunskis/senic-hub,grunskis/senic-hub,grunskis/nuimo-hub-backend,grunskis/senic-hub,grunskis/senic-hub,getsenic/senic-hub,grunskis/senic-hub,grunskis/nuimo-hub-backend,grunskis/senic-hub,grunskis/nuimo-hub-backend | python | ## Code Before:
import pytest
from mock import patch
@pytest.fixture
def url(route_url):
return route_url('wifi_setup')
def test_get_scanned_wifi(browser, url):
assert browser.get_json(url).json == ['grandpausethisnetwork']
@pytest.fixture
def no_such_wifi(settings):
settings['wifi_networks_path'] = '/no/such/file'
return settings
def test_get_scanned_wifi_empty(no_such_wifi, browser, url):
assert browser.get_json(url).json == []
@pytest.yield_fixture(autouse=True)
def mocked_run(request):
"""don't run actual external commands during these tests
"""
with patch('senic.nuimo_hub.views.setup_wifi.run')\
as mocked_run:
yield mocked_run
def test_join_wifi(browser, url, mocked_run, settings):
browser.post_json(url, dict(
ssid='grandpausethisnetwork',
password='foobar',
device='wlan0')).json
mocked_run.assert_called_once_with(
[
'sudo',
'%s/join_wifi' % settings['bin_path'],
'-c {fs_config_ini}'.format(**settings),
'grandpausethisnetwork',
'foobar',
]
)
## Instruction:
Make `url` fixture less generic
in preparation for additional endpoints
## Code After:
import pytest
from mock import patch
@pytest.fixture
def setup_url(route_url):
return route_url('wifi_setup')
def test_get_scanned_wifi(browser, setup_url):
assert browser.get_json(setup_url).json == ['grandpausethisnetwork']
@pytest.fixture
def no_such_wifi(settings):
settings['wifi_networks_path'] = '/no/such/file'
return settings
def test_get_scanned_wifi_empty(no_such_wifi, browser, setup_url):
assert browser.get_json(setup_url).json == []
@pytest.yield_fixture(autouse=True)
def mocked_run(request):
"""don't run actual external commands during these tests
"""
with patch('senic.nuimo_hub.views.setup_wifi.run')\
as mocked_run:
yield mocked_run
def test_join_wifi(browser, setup_url, mocked_run, settings):
browser.post_json(setup_url, dict(
ssid='grandpausethisnetwork',
password='foobar',
device='wlan0')).json
mocked_run.assert_called_once_with(
[
'sudo',
'%s/join_wifi' % settings['bin_path'],
'-c {fs_config_ini}'.format(**settings),
'grandpausethisnetwork',
'foobar',
]
)
|