commit
stringlengths
40
40
old_file
stringlengths
4
184
new_file
stringlengths
4
184
old_contents
stringlengths
1
3.6k
new_contents
stringlengths
5
3.38k
subject
stringlengths
15
778
message
stringlengths
16
6.74k
lang
stringclasses
201 values
license
stringclasses
13 values
repos
stringlengths
6
116k
config
stringclasses
201 values
content
stringlengths
137
7.24k
diff
stringlengths
26
5.55k
diff_length
int64
1
123
relative_diff_length
float64
0.01
89
n_lines_added
int64
0
108
n_lines_deleted
int64
0
106
2544803764a300492a3d3d5373d503c1989112b9
README.md
README.md
This repository is meant to be used with the [Rules Codelab](https://firebase.google.com/learn/codelabs/firebase-rules#0), which is also dupicated in this [repo](https://github.com/firebase/codelab-rules/blob/main/index.lab.md). There are two folders in this respository, `initial-state` and `final-state`. To walk through the codelab, clone down the project, `git clone github.com/firebase/rules-codelab`, `cd initial-state`, and then follow along with the [codelab steps](). If you get stuck or want to see the final rules, check out `final-state`, instead. ## How to make contributions? Please read and follow the steps in the [CONTRIBUTING.md](CONTRIBUTING.md) ## License See [LICENSE](LICENSE)
This repository is meant to be used with the [Rules Codelab](https://firebase.google.com/learn/codelabs/firebase-rules#0), which is also dupicated in this [repo](https://github.com/firebase/codelab-rules/blob/main/index.lab.md). There are two folders in this respository, `initial-state` and `final-state`. To walk through the codelab, clone down the project, `git clone github.com/firebase/rules-codelab`, `cd initial-state`, and then follow along with the [codelab steps](). If you get stuck or want to see the final rules, check out `final-state`, instead. ## How to make contributions? Please read and follow the steps in the [CONTRIBUTING.md](CONTRIBUTING.md) ## License See [LICENSE](LICENSE) This is not an officially supported Google product
Add "not an official product"
Add "not an official product"
Markdown
apache-2.0
FirebaseExtended/codelab-rules
markdown
## Code Before: This repository is meant to be used with the [Rules Codelab](https://firebase.google.com/learn/codelabs/firebase-rules#0), which is also dupicated in this [repo](https://github.com/firebase/codelab-rules/blob/main/index.lab.md). There are two folders in this respository, `initial-state` and `final-state`. To walk through the codelab, clone down the project, `git clone github.com/firebase/rules-codelab`, `cd initial-state`, and then follow along with the [codelab steps](). If you get stuck or want to see the final rules, check out `final-state`, instead. ## How to make contributions? Please read and follow the steps in the [CONTRIBUTING.md](CONTRIBUTING.md) ## License See [LICENSE](LICENSE) ## Instruction: Add "not an official product" ## Code After: This repository is meant to be used with the [Rules Codelab](https://firebase.google.com/learn/codelabs/firebase-rules#0), which is also dupicated in this [repo](https://github.com/firebase/codelab-rules/blob/main/index.lab.md). There are two folders in this respository, `initial-state` and `final-state`. To walk through the codelab, clone down the project, `git clone github.com/firebase/rules-codelab`, `cd initial-state`, and then follow along with the [codelab steps](). If you get stuck or want to see the final rules, check out `final-state`, instead. ## How to make contributions? Please read and follow the steps in the [CONTRIBUTING.md](CONTRIBUTING.md) ## License See [LICENSE](LICENSE) This is not an officially supported Google product
This repository is meant to be used with the [Rules Codelab](https://firebase.google.com/learn/codelabs/firebase-rules#0), which is also dupicated in this [repo](https://github.com/firebase/codelab-rules/blob/main/index.lab.md). There are two folders in this respository, `initial-state` and `final-state`. To walk through the codelab, clone down the project, `git clone github.com/firebase/rules-codelab`, `cd initial-state`, and then follow along with the [codelab steps](). If you get stuck or want to see the final rules, check out `final-state`, instead. ## How to make contributions? Please read and follow the steps in the [CONTRIBUTING.md](CONTRIBUTING.md) ## License See [LICENSE](LICENSE) + + This is not an officially supported Google product
2
0.117647
2
0
0ec30da9fc13087cef25bc60d117ca5da19f63ba
lib/vmdb/loggers/audit_logger.rb
lib/vmdb/loggers/audit_logger.rb
module Vmdb::Loggers class AuditLogger < VMDBLogger def success(msg) info("Success") { msg } $log.info("<AuditSuccess> #{msg}") if $log end def failure(msg) warn("Failure") { msg } $log.warn("<AuditFailure> #{msg}") if $log end end end
module Vmdb::Loggers class AuditLogger < VMDBLogger def success(msg) msg = "<AuditSuccess> #{msg}" info(msg) $log.info(msg) if $log end def failure(msg) msg = "<AuditFailure> #{msg}" warn(msg) $log.warn(msg) if $log end end end
Remove progname override from audit log
Remove progname override from audit log
Ruby
apache-2.0
mzazrivec/manageiq,mzazrivec/manageiq,jrafanie/manageiq,agrare/manageiq,kbrock/manageiq,kbrock/manageiq,NickLaMuro/manageiq,chessbyte/manageiq,ManageIQ/manageiq,agrare/manageiq,agrare/manageiq,mzazrivec/manageiq,ManageIQ/manageiq,jrafanie/manageiq,jrafanie/manageiq,kbrock/manageiq,jrafanie/manageiq,agrare/manageiq,mzazrivec/manageiq,kbrock/manageiq,ManageIQ/manageiq,chessbyte/manageiq,ManageIQ/manageiq,chessbyte/manageiq,NickLaMuro/manageiq,chessbyte/manageiq,NickLaMuro/manageiq,NickLaMuro/manageiq
ruby
## Code Before: module Vmdb::Loggers class AuditLogger < VMDBLogger def success(msg) info("Success") { msg } $log.info("<AuditSuccess> #{msg}") if $log end def failure(msg) warn("Failure") { msg } $log.warn("<AuditFailure> #{msg}") if $log end end end ## Instruction: Remove progname override from audit log ## Code After: module Vmdb::Loggers class AuditLogger < VMDBLogger def success(msg) msg = "<AuditSuccess> #{msg}" info(msg) $log.info(msg) if $log end def failure(msg) msg = "<AuditFailure> #{msg}" warn(msg) $log.warn(msg) if $log end end end
module Vmdb::Loggers class AuditLogger < VMDBLogger def success(msg) - info("Success") { msg } - $log.info("<AuditSuccess> #{msg}") if $log + msg = "<AuditSuccess> #{msg}" + info(msg) + $log.info(msg) if $log end def failure(msg) - warn("Failure") { msg } - $log.warn("<AuditFailure> #{msg}") if $log + msg = "<AuditFailure> #{msg}" + warn(msg) + $log.warn(msg) if $log end end end
10
0.769231
6
4
250714b769a5554d2f9065f29ce78030dc30517f
.scrutinizer.yml
.scrutinizer.yml
filter: excluded_paths: - 'tests/*' - 'examples/*' tools: php_sim: min_mass: 30 checks: php: duplication: false coding_style: php: spaces: around_operators: concatenation: true other: after_type_cast: false build: tests: override: - command: 'vendor/bin/phpunit --coverage-clover=log/coverage.xml' coverage: file: 'log/coverage.xml' format: 'clover' environment: mysql: false postgresql: false mongodb: false elasticsearch: false redis: false memcached: false neo4j: false rabbitmq: false
filter: excluded_paths: - 'tests/*' - 'tests-integration/*' - 'examples/*' tools: php_sim: min_mass: 30 checks: php: duplication: false coding_style: php: spaces: around_operators: concatenation: true other: after_type_cast: false build: tests: override: - command: 'vendor/bin/phpunit --coverage-clover=log/coverage.xml' coverage: file: 'log/coverage.xml' format: 'clover' environment: mysql: false postgresql: false mongodb: false elasticsearch: false redis: false memcached: false neo4j: false rabbitmq: false
Exclude integration test code from code analysis
Exclude integration test code from code analysis
YAML
mit
fathomminds/php-rest-models
yaml
## Code Before: filter: excluded_paths: - 'tests/*' - 'examples/*' tools: php_sim: min_mass: 30 checks: php: duplication: false coding_style: php: spaces: around_operators: concatenation: true other: after_type_cast: false build: tests: override: - command: 'vendor/bin/phpunit --coverage-clover=log/coverage.xml' coverage: file: 'log/coverage.xml' format: 'clover' environment: mysql: false postgresql: false mongodb: false elasticsearch: false redis: false memcached: false neo4j: false rabbitmq: false ## Instruction: Exclude integration test code from code analysis ## Code After: filter: excluded_paths: - 'tests/*' - 'tests-integration/*' - 'examples/*' tools: php_sim: min_mass: 30 checks: php: duplication: false coding_style: php: spaces: around_operators: concatenation: true other: after_type_cast: false build: tests: override: - command: 'vendor/bin/phpunit --coverage-clover=log/coverage.xml' coverage: file: 'log/coverage.xml' format: 'clover' environment: mysql: false postgresql: false mongodb: false elasticsearch: false redis: false memcached: false neo4j: false rabbitmq: false
filter: excluded_paths: - 'tests/*' + - 'tests-integration/*' - 'examples/*' tools: php_sim: min_mass: 30 checks: php: duplication: false coding_style: php: spaces: around_operators: concatenation: true other: after_type_cast: false build: tests: override: - command: 'vendor/bin/phpunit --coverage-clover=log/coverage.xml' coverage: file: 'log/coverage.xml' format: 'clover' environment: mysql: false postgresql: false mongodb: false elasticsearch: false redis: false memcached: false neo4j: false rabbitmq: false
1
0.029412
1
0
e0318d6136366712300741b36e0c6b8fe40f04e3
app/views/file.blade.php
app/views/file.blade.php
@extends('layout') @section('title')File - {{$file}}@stop @section('content') <h1>{{SourceController::linkedPath($path)}}</h1> <h2>Query</h2> <?php $source = file_get_contents(base_path() . "/query/" . $file . ".sql"); $geshi = new GeSHi($source, 'sql'); echo $geshi->parse_code(); ?> <h2>Output</h2> @stop
@extends('layout') @section('title')File - {{$file}}@stop @section('content') <h1>{{SourceController::linkedPath($path)}}</h1> <h2>Query</h2> <?php $source = file_get_contents(base_path() . "/query/" . $file . ".sql"); $geshi = new GeSHi($source, 'sql'); echo $geshi->parse_code(); ?> <h2>Output</h2> <?php $outputs = SourceController::getDir("output/" . $path); $filename = $outputs[sizeof($outputs) - 1]; $source = file_get_contents(base_path() . "/output/" . $file . "/" . $filename); $geshi = new GeSHi($source, 'sql'); echo $geshi->parse_code(); ?> @stop
Make possibe to output the last output of the query
Make possibe to output the last output of the query
PHP
agpl-3.0
wikimedia/labs-tools-lists,wikimedia/labs-tools-lists,wikimedia/labs-tools-lists
php
## Code Before: @extends('layout') @section('title')File - {{$file}}@stop @section('content') <h1>{{SourceController::linkedPath($path)}}</h1> <h2>Query</h2> <?php $source = file_get_contents(base_path() . "/query/" . $file . ".sql"); $geshi = new GeSHi($source, 'sql'); echo $geshi->parse_code(); ?> <h2>Output</h2> @stop ## Instruction: Make possibe to output the last output of the query ## Code After: @extends('layout') @section('title')File - {{$file}}@stop @section('content') <h1>{{SourceController::linkedPath($path)}}</h1> <h2>Query</h2> <?php $source = file_get_contents(base_path() . "/query/" . $file . ".sql"); $geshi = new GeSHi($source, 'sql'); echo $geshi->parse_code(); ?> <h2>Output</h2> <?php $outputs = SourceController::getDir("output/" . $path); $filename = $outputs[sizeof($outputs) - 1]; $source = file_get_contents(base_path() . "/output/" . $file . "/" . $filename); $geshi = new GeSHi($source, 'sql'); echo $geshi->parse_code(); ?> @stop
@extends('layout') @section('title')File - {{$file}}@stop @section('content') <h1>{{SourceController::linkedPath($path)}}</h1> <h2>Query</h2> <?php $source = file_get_contents(base_path() . "/query/" . $file . ".sql"); $geshi = new GeSHi($source, 'sql'); echo $geshi->parse_code(); ?> <h2>Output</h2> + <?php + $outputs = SourceController::getDir("output/" . $path); + $filename = $outputs[sizeof($outputs) - 1]; + + $source = file_get_contents(base_path() . "/output/" . $file . "/" . $filename); + $geshi = new GeSHi($source, 'sql'); + echo $geshi->parse_code(); + ?> + @stop
9
0.5625
9
0
b9440b7825c52cdb29dd45b1feeea0fd5827cb21
README.md
README.md
An entirely const_expr string class in C++. Similar to string_view, most useful for compile-time constants This header-only class is meant to be an entirely compile-time string wrapper, specifically as a replacement for static-const char and #define X string constants. It emulates string_view as close as possible. Compatible with C++14 AND C++11 (though separate implementations for each for a few functions). Tested on G++4.9 and 5.2, and clang++ 3.5 and 3.6.1. To compile the main test, just do one of the following: g++ -std=c++14 -O3 -Wextra -Wall -Werror main.cpp g++ -std=c++11 -O3 -Wextra -Wall -Werror main.cpp clang++ -std=c++14 -O3 -Wextra -Wall -Werror main.cpp clang++ -std=c++11 -O3 -Wextra -Wall -Werror main.cpp
An entirely const_expr string class in C++. Similar to string_view, most useful for compile-time constants This header-only class is meant to be an entirely compile-time string wrapper, specifically as a replacement for static-const char and #define X string constants. It emulates string_view as close as possible. Compatible with C++14 AND C++11 (though separate implementations for each for a few functions). Tested on G++4.9 and 5.2, and clang++ 3.5 and 3.6.1. To compile the main test, just do one of the following: ```shell g++ -std=c++14 -O3 -Wextra -Wall -Werror main.cpp ``` ```shell g++ -std=c++11 -O3 -Wextra -Wall -Werror main.cpp ``` ```shell clang++ -std=c++14 -O3 -Wextra -Wall -Werror main.cpp ``` ```shell clang++ -std=c++11 -O3 -Wextra -Wall -Werror main.cpp ```
Add syntax highlighting to shell commands
Add syntax highlighting to shell commands
Markdown
apache-2.0
erichkeane/const_expr_string
markdown
## Code Before: An entirely const_expr string class in C++. Similar to string_view, most useful for compile-time constants This header-only class is meant to be an entirely compile-time string wrapper, specifically as a replacement for static-const char and #define X string constants. It emulates string_view as close as possible. Compatible with C++14 AND C++11 (though separate implementations for each for a few functions). Tested on G++4.9 and 5.2, and clang++ 3.5 and 3.6.1. To compile the main test, just do one of the following: g++ -std=c++14 -O3 -Wextra -Wall -Werror main.cpp g++ -std=c++11 -O3 -Wextra -Wall -Werror main.cpp clang++ -std=c++14 -O3 -Wextra -Wall -Werror main.cpp clang++ -std=c++11 -O3 -Wextra -Wall -Werror main.cpp ## Instruction: Add syntax highlighting to shell commands ## Code After: An entirely const_expr string class in C++. Similar to string_view, most useful for compile-time constants This header-only class is meant to be an entirely compile-time string wrapper, specifically as a replacement for static-const char and #define X string constants. It emulates string_view as close as possible. Compatible with C++14 AND C++11 (though separate implementations for each for a few functions). Tested on G++4.9 and 5.2, and clang++ 3.5 and 3.6.1. To compile the main test, just do one of the following: ```shell g++ -std=c++14 -O3 -Wextra -Wall -Werror main.cpp ``` ```shell g++ -std=c++11 -O3 -Wextra -Wall -Werror main.cpp ``` ```shell clang++ -std=c++14 -O3 -Wextra -Wall -Werror main.cpp ``` ```shell clang++ -std=c++11 -O3 -Wextra -Wall -Werror main.cpp ```
An entirely const_expr string class in C++. Similar to string_view, most useful for compile-time constants This header-only class is meant to be an entirely compile-time string wrapper, specifically as a replacement for static-const char and #define X string constants. It emulates string_view as close as possible. Compatible with C++14 AND C++11 (though separate implementations for each for a few functions). Tested on G++4.9 and 5.2, and clang++ 3.5 and 3.6.1. To compile the main test, just do one of the following: + ```shell g++ -std=c++14 -O3 -Wextra -Wall -Werror main.cpp - + ``` + ```shell g++ -std=c++11 -O3 -Wextra -Wall -Werror main.cpp - + ``` + ```shell clang++ -std=c++14 -O3 -Wextra -Wall -Werror main.cpp - + ``` + ```shell clang++ -std=c++11 -O3 -Wextra -Wall -Werror main.cpp + ```
11
0.611111
8
3
0219649507c50f0812ed43a3b181e5ea3667ec6d
README.md
README.md
![Opps Open Source Content Management Platform](docs/source/_static/opps.jpg "Opps Open Source Content Management Platform") An *Open Source Content Management Platform* for the **magazine** websites and **high-traffic**, using the Django Framework. [![Build Status](https://travis-ci.org/opps/opps.png)](https://travis-ci.org/opps/opps "Opps Travis") # Contacts The place to create issues is [opps's github issues](https://github.com/opps/opps/issues). The more information you send about an issue, the greater the chance it will get fixed fast. If you are not sure about something, have a doubt or feedback, or just want to ask for a feature, feel free to join our mailing list, or, if you're on Freenode (IRC), you can join the [#opps](irc://irc.freenode.net/opps) chat. # Run example $ git clone [email protected]:opps/opps.git $ cd opps $ python setup.py develop $ opps-admin.py startproject PROJECT_NAME $ cd PROJECT_NAME $ python manage.py runserver # Sponsor * [YACOWS](http://yacows.com.br/) # License Copyright 2013 Opps Project and other contributors. Licensed under the [`MIT License`](http://www.oppsproject.org/en/latest/#license)
![Opps Open Source Content Management Platform](docs/source/_static/opps.jpg "Opps Open Source Content Management Platform") An *Open Source Content Management Platform* for the **magazine** websites and **high-traffic**, using the Django Framework. [![Build Status](https://travis-ci.org/opps/opps.png?branch=master)](https://travis-ci.org/opps/opps "Opps Travis") # Contacts The place to create issues is [opps's github issues](https://github.com/opps/opps/issues). The more information you send about an issue, the greater the chance it will get fixed fast. If you are not sure about something, have a doubt or feedback, or just want to ask for a feature, feel free to join our mailing list, or, if you're on Freenode (IRC), you can join the [#opps](irc://irc.freenode.net/opps) chat. # Run example $ git clone [email protected]:opps/opps.git $ cd opps $ python setup.py develop $ opps-admin.py startproject PROJECT_NAME $ cd PROJECT_NAME $ python manage.py runserver # Sponsor * [YACOWS](http://yacows.com.br/) # License Copyright 2013 Opps Project and other contributors. Licensed under the [`MIT License`](http://www.oppsproject.org/en/latest/#license)
Set branch on Travis image
Set branch on Travis image
Markdown
mit
YACOWS/opps,williamroot/opps,YACOWS/opps,opps/opps,opps/opps,jeanmask/opps,williamroot/opps,jeanmask/opps,opps/opps,williamroot/opps,YACOWS/opps,jeanmask/opps,jeanmask/opps,YACOWS/opps,williamroot/opps,opps/opps
markdown
## Code Before: ![Opps Open Source Content Management Platform](docs/source/_static/opps.jpg "Opps Open Source Content Management Platform") An *Open Source Content Management Platform* for the **magazine** websites and **high-traffic**, using the Django Framework. [![Build Status](https://travis-ci.org/opps/opps.png)](https://travis-ci.org/opps/opps "Opps Travis") # Contacts The place to create issues is [opps's github issues](https://github.com/opps/opps/issues). The more information you send about an issue, the greater the chance it will get fixed fast. If you are not sure about something, have a doubt or feedback, or just want to ask for a feature, feel free to join our mailing list, or, if you're on Freenode (IRC), you can join the [#opps](irc://irc.freenode.net/opps) chat. # Run example $ git clone [email protected]:opps/opps.git $ cd opps $ python setup.py develop $ opps-admin.py startproject PROJECT_NAME $ cd PROJECT_NAME $ python manage.py runserver # Sponsor * [YACOWS](http://yacows.com.br/) # License Copyright 2013 Opps Project and other contributors. Licensed under the [`MIT License`](http://www.oppsproject.org/en/latest/#license) ## Instruction: Set branch on Travis image ## Code After: ![Opps Open Source Content Management Platform](docs/source/_static/opps.jpg "Opps Open Source Content Management Platform") An *Open Source Content Management Platform* for the **magazine** websites and **high-traffic**, using the Django Framework. [![Build Status](https://travis-ci.org/opps/opps.png?branch=master)](https://travis-ci.org/opps/opps "Opps Travis") # Contacts The place to create issues is [opps's github issues](https://github.com/opps/opps/issues). The more information you send about an issue, the greater the chance it will get fixed fast. If you are not sure about something, have a doubt or feedback, or just want to ask for a feature, feel free to join our mailing list, or, if you're on Freenode (IRC), you can join the [#opps](irc://irc.freenode.net/opps) chat. # Run example $ git clone [email protected]:opps/opps.git $ cd opps $ python setup.py develop $ opps-admin.py startproject PROJECT_NAME $ cd PROJECT_NAME $ python manage.py runserver # Sponsor * [YACOWS](http://yacows.com.br/) # License Copyright 2013 Opps Project and other contributors. Licensed under the [`MIT License`](http://www.oppsproject.org/en/latest/#license)
![Opps Open Source Content Management Platform](docs/source/_static/opps.jpg "Opps Open Source Content Management Platform") An *Open Source Content Management Platform* for the **magazine** websites and **high-traffic**, using the Django Framework. - [![Build Status](https://travis-ci.org/opps/opps.png)](https://travis-ci.org/opps/opps "Opps Travis") + [![Build Status](https://travis-ci.org/opps/opps.png?branch=master)](https://travis-ci.org/opps/opps "Opps Travis") ? ++++++++++++++ # Contacts The place to create issues is [opps's github issues](https://github.com/opps/opps/issues). The more information you send about an issue, the greater the chance it will get fixed fast. If you are not sure about something, have a doubt or feedback, or just want to ask for a feature, feel free to join our mailing list, or, if you're on Freenode (IRC), you can join the [#opps](irc://irc.freenode.net/opps) chat. # Run example $ git clone [email protected]:opps/opps.git $ cd opps $ python setup.py develop $ opps-admin.py startproject PROJECT_NAME $ cd PROJECT_NAME $ python manage.py runserver # Sponsor * [YACOWS](http://yacows.com.br/) # License Copyright 2013 Opps Project and other contributors. Licensed under the [`MIT License`](http://www.oppsproject.org/en/latest/#license)
2
0.057143
1
1
224da9fab825a41932f1e9bf3fce196c5c49377b
spec/scss_lint/linter/disable_linter_reason_spec.rb
spec/scss_lint/linter/disable_linter_reason_spec.rb
require 'spec_helper' describe SCSSLint::Linter::DisableLinterReason do context 'when no disabling instructions exist' do let(:scss) { <<-SCSS } // Comment. p { margin: 0; } SCSS it { should_not report_lint } end context 'when no reason accompanies a disabling comment' do let(:scss) { <<-SCSS } // scss-lint:disable BorderZero p { margin: 0; } SCSS it { should report_lint line: 1 } end context 'when a reason immediately precedes a disabling comment' do let(:scss) { <<-SCSS } // We like using `border: none` in our CSS. // scss-lint:disable BorderZero p { margin: 0; } SCSS it { should_not report_lint } end context 'when a reason precedes a disabling comment, at a distance' do let(:scss) { <<-SCSS } // We like using `border: none` in our CSS. // scss-lint:disable BorderZero p { margin: 0; } SCSS it { should_not report_lint } end end
require 'spec_helper' describe SCSSLint::Linter::DisableLinterReason do context 'when no disabling instructions exist' do let(:scss) { <<-SCSS } // Comment. p { margin: 0; } SCSS it { should_not report_lint } end context 'when no reason accompanies a disabling comment' do let(:scss) { <<-SCSS } // scss-lint:disable BorderZero p { margin: 0; } SCSS it { should report_lint line: 1 } end context 'when a reason immediately precedes a disabling comment' do let(:scss) { <<-SCSS } // We like using `border: none` in our CSS. // scss-lint:disable BorderZero p { margin: 0; } SCSS it { should_not report_lint } end context 'when a reason precedes a disabling comment, at a distance' do let(:scss) { <<-SCSS } // We like using `border: none` in our CSS. // scss-lint:disable BorderZero p { margin: 0; } SCSS it { should_not report_lint } end context 'when no reason precedes an enabling comment' do let(:scss) { <<-SCSS } // Disable for now // scss-lint:disable BorderZero p { border: none; } // scss-lint:enable BorderZero SCSS it { should_not report_lint } end end
Add spec ensuring only disables are checked
Add spec ensuring only disables are checked We only want to enforce reasons for disabling of a linter, since when disabling over a range you don't want to have to justify both control comments.
Ruby
mit
davecarter/scss-lint,cih/scss-lint,bkeepers/scss-lint,philipgiuliani/scss-lint,chatzipan/scss-lint,leseulsteve/scss-lint,teoljungberg/scss-lint,dwayhs/scss-lint,gatero/scss-lint,ingdir/scss-lint,gajus/scss-lint,baileyparker/scss-lint
ruby
## Code Before: require 'spec_helper' describe SCSSLint::Linter::DisableLinterReason do context 'when no disabling instructions exist' do let(:scss) { <<-SCSS } // Comment. p { margin: 0; } SCSS it { should_not report_lint } end context 'when no reason accompanies a disabling comment' do let(:scss) { <<-SCSS } // scss-lint:disable BorderZero p { margin: 0; } SCSS it { should report_lint line: 1 } end context 'when a reason immediately precedes a disabling comment' do let(:scss) { <<-SCSS } // We like using `border: none` in our CSS. // scss-lint:disable BorderZero p { margin: 0; } SCSS it { should_not report_lint } end context 'when a reason precedes a disabling comment, at a distance' do let(:scss) { <<-SCSS } // We like using `border: none` in our CSS. // scss-lint:disable BorderZero p { margin: 0; } SCSS it { should_not report_lint } end end ## Instruction: Add spec ensuring only disables are checked We only want to enforce reasons for disabling of a linter, since when disabling over a range you don't want to have to justify both control comments. ## Code After: require 'spec_helper' describe SCSSLint::Linter::DisableLinterReason do context 'when no disabling instructions exist' do let(:scss) { <<-SCSS } // Comment. p { margin: 0; } SCSS it { should_not report_lint } end context 'when no reason accompanies a disabling comment' do let(:scss) { <<-SCSS } // scss-lint:disable BorderZero p { margin: 0; } SCSS it { should report_lint line: 1 } end context 'when a reason immediately precedes a disabling comment' do let(:scss) { <<-SCSS } // We like using `border: none` in our CSS. // scss-lint:disable BorderZero p { margin: 0; } SCSS it { should_not report_lint } end context 'when a reason precedes a disabling comment, at a distance' do let(:scss) { <<-SCSS } // We like using `border: none` in our CSS. // scss-lint:disable BorderZero p { margin: 0; } SCSS it { should_not report_lint } end context 'when no reason precedes an enabling comment' do let(:scss) { <<-SCSS } // Disable for now // scss-lint:disable BorderZero p { border: none; } // scss-lint:enable BorderZero SCSS it { should_not report_lint } end end
require 'spec_helper' describe SCSSLint::Linter::DisableLinterReason do context 'when no disabling instructions exist' do let(:scss) { <<-SCSS } // Comment. p { margin: 0; } SCSS it { should_not report_lint } end context 'when no reason accompanies a disabling comment' do let(:scss) { <<-SCSS } // scss-lint:disable BorderZero p { margin: 0; } SCSS it { should report_lint line: 1 } end context 'when a reason immediately precedes a disabling comment' do let(:scss) { <<-SCSS } // We like using `border: none` in our CSS. // scss-lint:disable BorderZero p { margin: 0; } SCSS it { should_not report_lint } end context 'when a reason precedes a disabling comment, at a distance' do let(:scss) { <<-SCSS } // We like using `border: none` in our CSS. // scss-lint:disable BorderZero p { margin: 0; } SCSS it { should_not report_lint } end + + context 'when no reason precedes an enabling comment' do + let(:scss) { <<-SCSS } + // Disable for now + // scss-lint:disable BorderZero + p { + border: none; + } + // scss-lint:enable BorderZero + SCSS + + it { should_not report_lint } + end end
13
0.26
13
0
bff61be70a5ee73c69de92c72b65475e471de445
.travis.yml
.travis.yml
language: java addons: sonarcloud: organization: "hobynye" token: ${SONAR_TOKEN} before_cache: - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock - rm -f $HOME/.gradle/caches/*/plugin-resolution cache: directories: - $HOME/.gradle/caches - $HOME/.gradle/wrapper before_install: - git fetch origin - chmod +x ./gradlew jobs: include: - stage: "Quality Checks" name: "Quality checking" - script: ./gradlew sonarqube - stage: "Deploy" name: "Deploy" script: skip deploy: provider: releases token: ${GITHUB_TOKEN} on: tags: true
language: java addons: sonarcloud: organization: "hobynye" token: ${SONAR_TOKEN} before_cache: - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock - rm -f $HOME/.gradle/caches/*/plugin-resolution cache: directories: - $HOME/.gradle/caches - $HOME/.gradle/wrapper before_install: - chmod +x ./gradlew jobs: include: - stage: "Quality Checks" name: "Quality checking" - script: ./gradlew sonarqube - stage: "Deploy" name: "Deploy" script: skip deploy: provider: releases token: ${GITHUB_TOKEN} on: tags: true
Revert "Testing sonar warning about refs/head not containing main"
Revert "Testing sonar warning about refs/head not containing main" This reverts commit 49d6f940
YAML
epl-1.0
HOBY-NYE/thank-you-matcher
yaml
## Code Before: language: java addons: sonarcloud: organization: "hobynye" token: ${SONAR_TOKEN} before_cache: - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock - rm -f $HOME/.gradle/caches/*/plugin-resolution cache: directories: - $HOME/.gradle/caches - $HOME/.gradle/wrapper before_install: - git fetch origin - chmod +x ./gradlew jobs: include: - stage: "Quality Checks" name: "Quality checking" - script: ./gradlew sonarqube - stage: "Deploy" name: "Deploy" script: skip deploy: provider: releases token: ${GITHUB_TOKEN} on: tags: true ## Instruction: Revert "Testing sonar warning about refs/head not containing main" This reverts commit 49d6f940 ## Code After: language: java addons: sonarcloud: organization: "hobynye" token: ${SONAR_TOKEN} before_cache: - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock - rm -f $HOME/.gradle/caches/*/plugin-resolution cache: directories: - $HOME/.gradle/caches - $HOME/.gradle/wrapper before_install: - chmod +x ./gradlew jobs: include: - stage: "Quality Checks" name: "Quality checking" - script: ./gradlew sonarqube - stage: "Deploy" name: "Deploy" script: skip deploy: provider: releases token: ${GITHUB_TOKEN} on: tags: true
language: java addons: sonarcloud: organization: "hobynye" token: ${SONAR_TOKEN} before_cache: - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock - rm -f $HOME/.gradle/caches/*/plugin-resolution cache: directories: - $HOME/.gradle/caches - $HOME/.gradle/wrapper before_install: - - git fetch origin - chmod +x ./gradlew jobs: include: - stage: "Quality Checks" name: "Quality checking" - script: ./gradlew sonarqube - stage: "Deploy" name: "Deploy" script: skip deploy: provider: releases token: ${GITHUB_TOKEN} on: tags: true
1
0.030303
0
1
9c3fdfb4670a4568e0729dadc81ccbe3e5d20149
tests/standalone/io/console_test.dart
tests/standalone/io/console_test.dart
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. import "dart:convert"; import "dart:io"; import "package:expect/expect.dart"; void main() { var script = Platform.script.resolve("console_script.dart").toFilePath(); Process.run(Platform.executable, ['--checked', script], stdoutEncoding: ASCII, stderrEncoding: ASCII).then((result) { print(result.stdout); print(result.stderr); Expect.equals(1, result.exitCode); Expect.equals('stdout\ntuodts\nABCDEFGHIJKLM\n', result.stdout); Expect.equals('stderr\nrredts\nABCDEFGHIJKLM\n', result.stderr); }); }
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. import "dart:convert"; import "dart:io"; import "package:expect/expect.dart"; void main() { var script = Platform.script.resolve("console_script.dart").toFilePath(); Process.run(Platform.executable, ['--checked', script], stdoutEncoding: ASCII, stderrEncoding: ASCII).then((result) { print(result.stdout); print(result.stderr); Expect.equals(1, result.exitCode); if (Platform.isWindows) { Expect.equals('stdout\r\ntuodts\r\nABCDEFGHIJKLM\r\n', result.stdout); Expect.equals('stderr\r\nrredts\r\nABCDEFGHIJKLM\r\n', result.stderr); } else { Expect.equals('stdout\ntuodts\nABCDEFGHIJKLM\n', result.stdout); Expect.equals('stderr\nrredts\nABCDEFGHIJKLM\n', result.stderr); } }); }
Fix console test for Windows
Fix console test for Windows [email protected] BUG= Review URL: https://codereview.chromium.org//736733002 git-svn-id: c93d8a2297af3b929165606efe145742a534bc71@41804 260f80e4-7a28-3924-810f-c04153c831b5
Dart
bsd-3-clause
dartino/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dart-lang/sdk
dart
## Code Before: // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. import "dart:convert"; import "dart:io"; import "package:expect/expect.dart"; void main() { var script = Platform.script.resolve("console_script.dart").toFilePath(); Process.run(Platform.executable, ['--checked', script], stdoutEncoding: ASCII, stderrEncoding: ASCII).then((result) { print(result.stdout); print(result.stderr); Expect.equals(1, result.exitCode); Expect.equals('stdout\ntuodts\nABCDEFGHIJKLM\n', result.stdout); Expect.equals('stderr\nrredts\nABCDEFGHIJKLM\n', result.stderr); }); } ## Instruction: Fix console test for Windows [email protected] BUG= Review URL: https://codereview.chromium.org//736733002 git-svn-id: c93d8a2297af3b929165606efe145742a534bc71@41804 260f80e4-7a28-3924-810f-c04153c831b5 ## Code After: // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. import "dart:convert"; import "dart:io"; import "package:expect/expect.dart"; void main() { var script = Platform.script.resolve("console_script.dart").toFilePath(); Process.run(Platform.executable, ['--checked', script], stdoutEncoding: ASCII, stderrEncoding: ASCII).then((result) { print(result.stdout); print(result.stderr); Expect.equals(1, result.exitCode); if (Platform.isWindows) { Expect.equals('stdout\r\ntuodts\r\nABCDEFGHIJKLM\r\n', result.stdout); Expect.equals('stderr\r\nrredts\r\nABCDEFGHIJKLM\r\n', result.stderr); } else { Expect.equals('stdout\ntuodts\nABCDEFGHIJKLM\n', result.stdout); Expect.equals('stderr\nrredts\nABCDEFGHIJKLM\n', result.stderr); } }); }
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. import "dart:convert"; import "dart:io"; import "package:expect/expect.dart"; void main() { var script = Platform.script.resolve("console_script.dart").toFilePath(); Process.run(Platform.executable, ['--checked', script], stdoutEncoding: ASCII, stderrEncoding: ASCII).then((result) { print(result.stdout); print(result.stderr); Expect.equals(1, result.exitCode); + if (Platform.isWindows) { + Expect.equals('stdout\r\ntuodts\r\nABCDEFGHIJKLM\r\n', result.stdout); + Expect.equals('stderr\r\nrredts\r\nABCDEFGHIJKLM\r\n', result.stderr); + } else { - Expect.equals('stdout\ntuodts\nABCDEFGHIJKLM\n', result.stdout); + Expect.equals('stdout\ntuodts\nABCDEFGHIJKLM\n', result.stdout); ? ++ - Expect.equals('stderr\nrredts\nABCDEFGHIJKLM\n', result.stderr); + Expect.equals('stderr\nrredts\nABCDEFGHIJKLM\n', result.stderr); ? ++ + } }); }
9
0.409091
7
2
0683758dd69fd6bc2ea534941fe8d60d94bccbfa
readme.md
readme.md
Nsproxy ======= [![Build Status (Travis)](https://travis-ci.org/unixvoid/nsproxy.svg?branch=develop)](https://travis-ci.org/unixvoid/nsproxy) Nsproxy is a DNS proxy and cluster manager written in go. This project acts as a normal DNS server (in addition to the cluster managment) and allows the use of custom DNS entries. Currently nsproxy fully supports A, AAAA, and CNAME entries. Documentation ============= All documentation is in the [github wiki](https://github.com/unixvoid/nsproxy/wiki) * [Configuration](https://github.com/unixvoid/nsproxy/wiki/Configuration) * [API](https://github.com/unixvoid/nsproxy/wiki/API) * [Basic Usage](https://github.com/unixvoid/nsproxy/wiki/Basic-Usage) * [Building](https://github.com/unixvoid/nsproxy/wiki/Building) * [Redis Usage](https://github.com/unixvoid/nsproxy/wiki/Redis-data-structures) Quickstart ========== To quickly get nsproxy up and running check out our page on [dockerhub](https://hub.docker.com/r/unixvoid/nsproxy/) Or make sure you have [Golang](https://golang.org) and make installed, and use the following make commands: * `make deps` to pull down all the 'go gets' * `make run` to run nsproxy!
Nsproxy ======= [![Build Status (Travis)](https://travis-ci.org/unixvoid/nsproxy.svg?branch=develop)](https://travis-ci.org/unixvoid/nsproxy) Nsproxy is a DNS proxy and cluster manager written in go. This project acts as a normal DNS server (in addition to the cluster managment) and allows the use of custom DNS entries. Currently nsproxy fully supports A, AAAA, and CNAME entries. Documentation ============= All documentation is in the [github wiki](https://unixvoid.github.io/nsproxy) * [Configuration](https://unixvoid.github.io/nsproxy/configuration/) * [API](https://unixvoid.github.io/nsproxy/api/) * [Basic Usage](https://unixvoid.github.io/nsproxy/basic_usage/) * [Building](https://unixvoid.github.io/nsproxy/building/) * [Redis Usage](https://unixvoid.github.io/nsproxy/redis_data_structures/) Quickstart ========== To quickly get nsproxy up and running check out our page on [dockerhub](https://hub.docker.com/r/unixvoid/nsproxy/) Or make sure you have [Golang](https://golang.org) and make installed, and use the following make commands: * `make deps` to pull down all the 'go gets' * `make run` to run nsproxy!
Update docs to new site
Update docs to new site
Markdown
mit
unixvoid/nsproxy
markdown
## Code Before: Nsproxy ======= [![Build Status (Travis)](https://travis-ci.org/unixvoid/nsproxy.svg?branch=develop)](https://travis-ci.org/unixvoid/nsproxy) Nsproxy is a DNS proxy and cluster manager written in go. This project acts as a normal DNS server (in addition to the cluster managment) and allows the use of custom DNS entries. Currently nsproxy fully supports A, AAAA, and CNAME entries. Documentation ============= All documentation is in the [github wiki](https://github.com/unixvoid/nsproxy/wiki) * [Configuration](https://github.com/unixvoid/nsproxy/wiki/Configuration) * [API](https://github.com/unixvoid/nsproxy/wiki/API) * [Basic Usage](https://github.com/unixvoid/nsproxy/wiki/Basic-Usage) * [Building](https://github.com/unixvoid/nsproxy/wiki/Building) * [Redis Usage](https://github.com/unixvoid/nsproxy/wiki/Redis-data-structures) Quickstart ========== To quickly get nsproxy up and running check out our page on [dockerhub](https://hub.docker.com/r/unixvoid/nsproxy/) Or make sure you have [Golang](https://golang.org) and make installed, and use the following make commands: * `make deps` to pull down all the 'go gets' * `make run` to run nsproxy! ## Instruction: Update docs to new site ## Code After: Nsproxy ======= [![Build Status (Travis)](https://travis-ci.org/unixvoid/nsproxy.svg?branch=develop)](https://travis-ci.org/unixvoid/nsproxy) Nsproxy is a DNS proxy and cluster manager written in go. This project acts as a normal DNS server (in addition to the cluster managment) and allows the use of custom DNS entries. Currently nsproxy fully supports A, AAAA, and CNAME entries. Documentation ============= All documentation is in the [github wiki](https://unixvoid.github.io/nsproxy) * [Configuration](https://unixvoid.github.io/nsproxy/configuration/) * [API](https://unixvoid.github.io/nsproxy/api/) * [Basic Usage](https://unixvoid.github.io/nsproxy/basic_usage/) * [Building](https://unixvoid.github.io/nsproxy/building/) * [Redis Usage](https://unixvoid.github.io/nsproxy/redis_data_structures/) Quickstart ========== To quickly get nsproxy up and running check out our page on [dockerhub](https://hub.docker.com/r/unixvoid/nsproxy/) Or make sure you have [Golang](https://golang.org) and make installed, and use the following make commands: * `make deps` to pull down all the 'go gets' * `make run` to run nsproxy!
Nsproxy ======= [![Build Status (Travis)](https://travis-ci.org/unixvoid/nsproxy.svg?branch=develop)](https://travis-ci.org/unixvoid/nsproxy) Nsproxy is a DNS proxy and cluster manager written in go. This project acts as a normal DNS server (in addition to the cluster managment) and allows the use of custom DNS entries. Currently nsproxy fully supports A, AAAA, and CNAME entries. Documentation ============= - All documentation is in the [github wiki](https://github.com/unixvoid/nsproxy/wiki) ? ----------- ----- + All documentation is in the [github wiki](https://unixvoid.github.io/nsproxy) ? ++++++++++ - * [Configuration](https://github.com/unixvoid/nsproxy/wiki/Configuration) ? ----------- ^^^^^^ + * [Configuration](https://unixvoid.github.io/nsproxy/configuration/) ? ++++++++++ ^ + - * [API](https://github.com/unixvoid/nsproxy/wiki/API) + * [API](https://unixvoid.github.io/nsproxy/api/) - * [Basic Usage](https://github.com/unixvoid/nsproxy/wiki/Basic-Usage) ? ----------- ^^^^^^ ^^ + * [Basic Usage](https://unixvoid.github.io/nsproxy/basic_usage/) ? ++++++++++ ^ ^^ + - * [Building](https://github.com/unixvoid/nsproxy/wiki/Building) ? ----------- ^^^^^^ + * [Building](https://unixvoid.github.io/nsproxy/building/) ? ++++++++++ ^ + - * [Redis Usage](https://github.com/unixvoid/nsproxy/wiki/Redis-data-structures) ? ----------- ^^^^^^ ^ ^ + * [Redis Usage](https://unixvoid.github.io/nsproxy/redis_data_structures/) ? ++++++++++ ^ ^ ^ + Quickstart ========== To quickly get nsproxy up and running check out our page on [dockerhub](https://hub.docker.com/r/unixvoid/nsproxy/) Or make sure you have [Golang](https://golang.org) and make installed, and use the following make commands: * `make deps` to pull down all the 'go gets' * `make run` to run nsproxy!
12
0.521739
6
6
ab9caa459f236a7c921042e9044859340829ea9e
app.ts
app.ts
/// <reference path="MonitoredSocket.ts" /> import MonitoredSocket = require("./MonitoredSocket"); import http = require("http"); import fs = require("fs"); var config = require("./config"); var listenIp: string = config["serv"].ip; var listenPort: number = config["serv"].port; var responseData: string = fs.readFileSync("index.html", "utf-8"); var monitoredSocks: Array<MonitoredSocket>; function init(): void { for (var service in config["services"]) { monitoredSocks.push( new MonitoredSocket(service.endpoint, service.port) ); } } function processResponse(): string { var output: string = ""; for (var sock in monitoredSocks) { sock.connect(); output += sock.isUp; } return output; } init(); http.createServer(function (request, response) { response.write(processResponse()); response.end(); }).listen(listenPort, listenIp);
/// <reference path="MonitoredSocket.ts" /> import MonitoredSocket = require("./MonitoredSocket"); import http = require("http"); import fs = require("fs"); var config = require("./config"); var listenIp: string = config["serv"].ip; var listenPort: number = config["serv"].port; var responseData: string = fs.readFileSync("index.html", "utf-8"); var monitoredSocks: Array<MonitoredSocket> = []; function init(): void { for (var service in config["services"]) { monitoredSocks.push( new MonitoredSocket(service.endpoint, service.port) ); console.log("Monitoring: " + service.endpoint + ":" + service.port); } } function processResponse(): string { var output: string = ""; for (var sock in monitoredSocks) { sock.connect(); output += sock.isUp; } return output; } init(); http.createServer(function (request, response) { response.write(processResponse()); response.end(); }).listen(listenPort, listenIp); console.log("Now listening on " + listenIp + ":" + listenPort);
Fix push to undefined + up logging
Fix push to undefined + up logging
TypeScript
mit
OzuYatamutsu/is-my-server-up,OzuYatamutsu/is-my-server-up,OzuYatamutsu/is-my-server-up
typescript
## Code Before: /// <reference path="MonitoredSocket.ts" /> import MonitoredSocket = require("./MonitoredSocket"); import http = require("http"); import fs = require("fs"); var config = require("./config"); var listenIp: string = config["serv"].ip; var listenPort: number = config["serv"].port; var responseData: string = fs.readFileSync("index.html", "utf-8"); var monitoredSocks: Array<MonitoredSocket>; function init(): void { for (var service in config["services"]) { monitoredSocks.push( new MonitoredSocket(service.endpoint, service.port) ); } } function processResponse(): string { var output: string = ""; for (var sock in monitoredSocks) { sock.connect(); output += sock.isUp; } return output; } init(); http.createServer(function (request, response) { response.write(processResponse()); response.end(); }).listen(listenPort, listenIp); ## Instruction: Fix push to undefined + up logging ## Code After: /// <reference path="MonitoredSocket.ts" /> import MonitoredSocket = require("./MonitoredSocket"); import http = require("http"); import fs = require("fs"); var config = require("./config"); var listenIp: string = config["serv"].ip; var listenPort: number = config["serv"].port; var responseData: string = fs.readFileSync("index.html", "utf-8"); var monitoredSocks: Array<MonitoredSocket> = []; function init(): void { for (var service in config["services"]) { monitoredSocks.push( new MonitoredSocket(service.endpoint, service.port) ); console.log("Monitoring: " + service.endpoint + ":" + service.port); } } function processResponse(): string { var output: string = ""; for (var sock in monitoredSocks) { sock.connect(); output += sock.isUp; } return output; } init(); http.createServer(function (request, response) { response.write(processResponse()); response.end(); }).listen(listenPort, listenIp); console.log("Now listening on " + listenIp + ":" + listenPort);
/// <reference path="MonitoredSocket.ts" /> import MonitoredSocket = require("./MonitoredSocket"); import http = require("http"); import fs = require("fs"); var config = require("./config"); var listenIp: string = config["serv"].ip; var listenPort: number = config["serv"].port; var responseData: string = fs.readFileSync("index.html", "utf-8"); - var monitoredSocks: Array<MonitoredSocket>; + var monitoredSocks: Array<MonitoredSocket> = []; ? +++++ function init(): void { for (var service in config["services"]) { monitoredSocks.push( new MonitoredSocket(service.endpoint, service.port) ); + + console.log("Monitoring: " + service.endpoint + ":" + service.port); } } function processResponse(): string { var output: string = ""; for (var sock in monitoredSocks) { sock.connect(); output += sock.isUp; } return output; } init(); http.createServer(function (request, response) { response.write(processResponse()); response.end(); }).listen(listenPort, listenIp); + + console.log("Now listening on " + listenIp + ":" + listenPort);
6
0.166667
5
1
ca2df37c796a5b3abf7567b0b9b6a10add83c22c
appveyor.yml
appveyor.yml
version: "{build}" # Operating system (build VM template) os: Windows Server 2012 R2 clone_folder: c:\gopath\src\github.com\maputnik\desktop # environment variables environment: GOPATH: c:\gopath GO15VENDOREXPERIMENT: 1 # scripts that run after cloning repository install: - set PATH=%GOPATH%\bin;c:\go\bin;%PATH% - go version - go env - go get # to run your custom scripts instead of automatic MSBuild build_script: - go vet ./... - gofmt -s -l . - make # to disable automatic tests test: off # to disable deployment deploy: off
version: "{build}" # Operating system (build VM template) os: Windows Server 2012 R2 clone_folder: c:\gopath\src\github.com\maputnik\desktop # environment variables environment: GOPATH: c:\gopath GO15VENDOREXPERIMENT: 1 # scripts that run after cloning repository install: - set PATH=%GOPATH%\bin;c:\go\bin;%PATH% - go version - go env - go get github.com/gorilla/handlers - go get github.com/gorilla/mux - go get github.com/gorilla/websocket - go get github.com/urfave/cli # to run your custom scripts instead of automatic MSBuild build_script: - go vet ./... - gofmt -s -l . - make # to disable automatic tests test: off # to disable deployment deploy: off
Fix go get in AppVeyor
Fix go get in AppVeyor
YAML
mit
maputnik/desktop
yaml
## Code Before: version: "{build}" # Operating system (build VM template) os: Windows Server 2012 R2 clone_folder: c:\gopath\src\github.com\maputnik\desktop # environment variables environment: GOPATH: c:\gopath GO15VENDOREXPERIMENT: 1 # scripts that run after cloning repository install: - set PATH=%GOPATH%\bin;c:\go\bin;%PATH% - go version - go env - go get # to run your custom scripts instead of automatic MSBuild build_script: - go vet ./... - gofmt -s -l . - make # to disable automatic tests test: off # to disable deployment deploy: off ## Instruction: Fix go get in AppVeyor ## Code After: version: "{build}" # Operating system (build VM template) os: Windows Server 2012 R2 clone_folder: c:\gopath\src\github.com\maputnik\desktop # environment variables environment: GOPATH: c:\gopath GO15VENDOREXPERIMENT: 1 # scripts that run after cloning repository install: - set PATH=%GOPATH%\bin;c:\go\bin;%PATH% - go version - go env - go get github.com/gorilla/handlers - go get github.com/gorilla/mux - go get github.com/gorilla/websocket - go get github.com/urfave/cli # to run your custom scripts instead of automatic MSBuild build_script: - go vet ./... - gofmt -s -l . - make # to disable automatic tests test: off # to disable deployment deploy: off
version: "{build}" # Operating system (build VM template) os: Windows Server 2012 R2 clone_folder: c:\gopath\src\github.com\maputnik\desktop # environment variables environment: GOPATH: c:\gopath GO15VENDOREXPERIMENT: 1 # scripts that run after cloning repository install: - - set PATH=%GOPATH%\bin;c:\go\bin;%PATH% ? -- + - set PATH=%GOPATH%\bin;c:\go\bin;%PATH% - - go version ? -- + - go version - - go env ? -- + - go env - - go get + - go get github.com/gorilla/handlers + - go get github.com/gorilla/mux + - go get github.com/gorilla/websocket + - go get github.com/urfave/cli # to run your custom scripts instead of automatic MSBuild build_script: - - go vet ./... ? -- + - go vet ./... - - gofmt -s -l . ? -- + - gofmt -s -l . - - make ? -- + - make # to disable automatic tests test: off # to disable deployment deploy: off
17
0.566667
10
7
f8a8cf18a4477e035882a7308326b9b49dbe5789
README.rst
README.rst
======== Polycomp ======== This package provides a set of Python bindings to the libpolycomp library, as well as a stand-alone program which can be used to compress/decompress FITS files into polycomp files (still FITS files in disguise). Requirements ------------ 1. Either Python 2.7 or 3.4 will work 2. libpolycomp must already be installed 3. The following Python libraries are required: - `docopt`; - `pyfits`. Basic usage ----------- To use the bindings in your code, simply import ``pypolycomp`` in your project:: import pypolycomp This package provides also a standalone program, ``polycomp``. Use the ``--help`` flag to get some help about how to use it:: $ polycomp --help
======== Polycomp ======== This package provides a set of Python bindings to the libpolycomp library, as well as a stand-alone program which can be used to compress/decompress FITS files into polycomp files (still FITS files in disguise). Requirements ------------ 1. Either Python 2.7 or 3.4 will work 2. Libpolycomp (https://github.com/ziotom78/libpolycomp) must already be installed 3. The following Python libraries are required: - `docopt`; - `pyfits`. Basic usage ----------- To use the bindings in your code, simply import ``pypolycomp`` in your project:: import pypolycomp This package provides also a standalone program, ``polycomp``. Use the ``--help`` flag to get some help about how to use it:: $ polycomp --help
Add link to libpolycomp's repository
Add link to libpolycomp's repository
reStructuredText
bsd-3-clause
ziotom78/polycomp
restructuredtext
## Code Before: ======== Polycomp ======== This package provides a set of Python bindings to the libpolycomp library, as well as a stand-alone program which can be used to compress/decompress FITS files into polycomp files (still FITS files in disguise). Requirements ------------ 1. Either Python 2.7 or 3.4 will work 2. libpolycomp must already be installed 3. The following Python libraries are required: - `docopt`; - `pyfits`. Basic usage ----------- To use the bindings in your code, simply import ``pypolycomp`` in your project:: import pypolycomp This package provides also a standalone program, ``polycomp``. Use the ``--help`` flag to get some help about how to use it:: $ polycomp --help ## Instruction: Add link to libpolycomp's repository ## Code After: ======== Polycomp ======== This package provides a set of Python bindings to the libpolycomp library, as well as a stand-alone program which can be used to compress/decompress FITS files into polycomp files (still FITS files in disguise). Requirements ------------ 1. Either Python 2.7 or 3.4 will work 2. Libpolycomp (https://github.com/ziotom78/libpolycomp) must already be installed 3. The following Python libraries are required: - `docopt`; - `pyfits`. Basic usage ----------- To use the bindings in your code, simply import ``pypolycomp`` in your project:: import pypolycomp This package provides also a standalone program, ``polycomp``. Use the ``--help`` flag to get some help about how to use it:: $ polycomp --help
======== Polycomp ======== This package provides a set of Python bindings to the libpolycomp library, as well as a stand-alone program which can be used to compress/decompress FITS files into polycomp files (still FITS files in disguise). Requirements ------------ 1. Either Python 2.7 or 3.4 will work - 2. libpolycomp must already be installed + 2. Libpolycomp (https://github.com/ziotom78/libpolycomp) must already + be installed 3. The following Python libraries are required: - `docopt`; - `pyfits`. Basic usage ----------- To use the bindings in your code, simply import ``pypolycomp`` in your project:: import pypolycomp This package provides also a standalone program, ``polycomp``. Use the ``--help`` flag to get some help about how to use it:: $ polycomp --help
3
0.09375
2
1
89857c0d7976766e51f238cea576a95020b20640
src/extensions/default/PrefsCodeHints/styles/brackets-prefs-hints.css
src/extensions/default/PrefsCodeHints/styles/brackets-prefs-hints.css
.brackets-pref-hints .matched-hint { font-weight: 500; } .dark .brackets-pref-hints .matched-hint { color: #ccc; } .brackets-pref-hints .hint-obj { display: inline-block; } .brackets-pref-hints .hint-description { line-height: 1.3; display: none; width: 250px; padding-bottom: 3px; padding-left: 14px; white-space: pre-wrap; color: #6e6e64; } .dark .brackets-pref-hints .hint-description { color: #ccc; } .highlight .brackets-pref-hints .hint-description { display: block; }
.brackets-pref-hints .matched-hint { font-weight: 500; } .dark .brackets-pref-hints .matched-hint { color: #ccc; } .brackets-pref-hints .hint-obj { display: inline-block; min-width: 250px; } .brackets-pref-hints .hint-description { line-height: 1.3; display: none; width: 250px; padding-bottom: 3px; padding-left: 14px; white-space: pre-wrap; color: #6e6e64; } .dark .brackets-pref-hints .hint-description { color: #ccc; } .highlight .brackets-pref-hints .hint-description { display: block; }
Add minimum width to code hints
Add minimum width to code hints
CSS
mit
keir-rex/brackets,alexkid64/brackets,rlugojr/brackets,abhisekp/brackets,veveykocute/brackets,Fcmam5/brackets,iamchathu/brackets,chambej/brackets,fvntr/brackets,ficristo/brackets,fabricadeaplicativos/brackets,brianjking/brackets,alexkid64/brackets,Jonavin/brackets,thr0w/brackets,rafaelstz/brackets,emanziano/brackets,kolipka/brackets,falcon1812/brackets,fashionsun/brackets,siddharta1337/brackets,udhayam/brackets,ChaofengZhou/brackets,sprintr/brackets,sprintr/brackets,xantage/brackets,falcon1812/brackets,CapeSepias/brackets,m66n/brackets,fcjailybo/brackets,gupta-tarun/brackets,fvntr/brackets,Real-Currents/brackets,NKcentinel/brackets,MantisWare/brackets,chrismoulton/brackets,CapeSepias/brackets,Mosoc/brackets,massimiliano76/brackets,michaeljayt/brackets,MahadevanSrinivasan/brackets,NKcentinel/brackets,phillipalexander/brackets,youprofit/brackets,sprintr/brackets,rlugojr/brackets,82488059/brackets,thr0w/brackets,sophiacaspar/brackets,fashionsun/brackets,revi/brackets,RobertJGabriel/brackets,ChaofengZhou/brackets,TylerL-uxai/brackets,adrianhartanto0/brackets,robertkarlsson/brackets,zaggino/brackets-electron,chrismoulton/brackets,wakermahmud/brackets,thehogfather/brackets,keir-rex/brackets,sophiacaspar/brackets,Wikunia/brackets,Fcmam5/brackets,iamchathu/brackets,thehogfather/brackets,lunode/brackets,emanziano/brackets,lunode/brackets,RamirezWillow/brackets,chinnyannieb/brackets,alexkid64/brackets,revi/brackets,keir-rex/brackets,Cartman0/brackets,netlams/brackets,alexkid64/brackets,fastrde/brackets,NKcentinel/brackets,karevn/brackets,revi/brackets,jiawenbo/brackets,sophiacaspar/brackets,andrewnc/brackets,albertinad/brackets,hanmichael/brackets,petetnt/brackets,hanmichael/brackets,shiyamkumar/brackets,netlams/brackets,gupta-tarun/brackets,zaggino/brackets-electron,ficristo/brackets,srhbinion/brackets,lovewitty/brackets,brianjking/brackets,xantage/brackets,Free-Technology-Guild/brackets,fastrde/brackets,jmarkina/brackets,robertkarlsson/brackets,chinnyannieb/brackets,chambej/brackets,emanziano/brackets,resir014/brackets,massimiliano76/brackets,xantage/brackets,wakermahmud/brackets,karevn/brackets,robertkarlsson/brackets,MarcelGerber/brackets,IAmAnubhavSaini/brackets,FTG-003/brackets,zaggino/brackets-electron,udhayam/brackets,wangjun/brackets,Fcmam5/brackets,Rynaro/brackets,TylerL-uxai/brackets,Mosoc/brackets,revi/brackets,GHackAnonymous/brackets,fashionsun/brackets,Lojsan123/brackets,IAmAnubhavSaini/brackets,jacobnash/brackets,ficristo/brackets,busykai/brackets,MarcelGerber/brackets,revi/brackets,treejames/brackets,wakermahmud/brackets,TylerL-uxai/brackets,Lojsan123/brackets,fabricadeaplicativos/brackets,uwsd/brackets,wesleifreitas/brackets,pratts/brackets,kilroy23/brackets,Mosoc/brackets,jiawenbo/brackets,eric-stanley/brackets,shal1y/brackets,siddharta1337/brackets,stowball/brackets,chinnyannieb/brackets,rafaelstz/brackets,m66n/brackets,Cartman0/brackets,albertinad/brackets,macdg/brackets,mjurczyk/brackets,richmondgozarin/brackets,veveykocute/brackets,Real-Currents/brackets,michaeljayt/brackets,hanmichael/brackets,siddharta1337/brackets,robertkarlsson/brackets,ChaofengZhou/brackets,michaeljayt/brackets,amrelnaggar/brackets,xantage/brackets,phillipalexander/brackets,wangjun/brackets,amrelnaggar/brackets,youprofit/brackets,kilroy23/brackets,srinivashappy/brackets,chambej/brackets,fvntr/brackets,iamchathu/brackets,gcommetti/brackets,abhisekp/brackets,RobertJGabriel/brackets,MarcelGerber/brackets,Free-Technology-Guild/brackets,treejames/brackets,Andrey-Pavlov/brackets,keir-rex/brackets,mjurczyk/brackets,tan9/brackets,tan9/brackets,jiawenbo/brackets,gupta-tarun/brackets,Andrey-Pavlov/brackets,jmarkina/brackets,fcjailybo/brackets,zhukaixy/brackets,falcon1812/brackets,lunode/brackets,pratts/brackets,FTG-003/brackets,Free-Technology-Guild/brackets,siddharta1337/brackets,youprofit/brackets,fabricadeaplicativos/brackets,srinivashappy/brackets,eric-stanley/brackets,thr0w/brackets,srhbinion/brackets,phillipalexander/brackets,eric-stanley/brackets,rlugojr/brackets,NGHGithub/brackets,TylerL-uxai/brackets,82488059/brackets,TylerL-uxai/brackets,adobe/brackets,Mosoc/brackets,busykai/brackets,ecwebservices/brackets,adrianhartanto0/brackets,RobertJGabriel/brackets,tan9/brackets,kolipka/brackets,emanziano/brackets,gupta-tarun/brackets,Jonavin/brackets,pomadgw/brackets,chrisle/brackets,gcommetti/brackets,adobe/brackets,sophiacaspar/brackets,82488059/brackets,ralic/brackets,Jonavin/brackets,NGHGithub/brackets,shiyamkumar/brackets,netlams/brackets,shiyamkumar/brackets,mjurczyk/brackets,richmondgozarin/brackets,rafaelstz/brackets,jiimaho/brackets,busykai/brackets,pratts/brackets,thehogfather/brackets,pomadgw/brackets,iamchathu/brackets,tan9/brackets,thr0w/brackets,pratts/brackets,RobertJGabriel/brackets,macdg/brackets,Rynaro/brackets,GHackAnonymous/brackets,fronzec/brackets,michaeljayt/brackets,falcon1812/brackets,treejames/brackets,mcanthony/brackets,shal1y/brackets,phillipalexander/brackets,hanmichael/brackets,FTG-003/brackets,amrelnaggar/brackets,MantisWare/brackets,mjurczyk/brackets,adrianhartanto0/brackets,rafaelstz/brackets,andrewnc/brackets,NKcentinel/brackets,falcon1812/brackets,lovewitty/brackets,chrismoulton/brackets,Jonavin/brackets,petetnt/brackets,wesleifreitas/brackets,mcanthony/brackets,IAmAnubhavSaini/brackets,m66n/brackets,fastrde/brackets,Fcmam5/brackets,Wikunia/brackets,kilroy23/brackets,macdg/brackets,gcommetti/brackets,udhayam/brackets,sprintr/brackets,ecwebservices/brackets,Wikunia/brackets,petetnt/brackets,fronzec/brackets,rlugojr/brackets,RamirezWillow/brackets,lovewitty/brackets,michaeljayt/brackets,fastrde/brackets,zaggino/brackets-electron,stowball/brackets,ChaofengZhou/brackets,zhukaixy/brackets,pkdevbox/brackets,chrisle/brackets,MahadevanSrinivasan/brackets,veveykocute/brackets,Real-Currents/brackets,jacobnash/brackets,CapeSepias/brackets,fashionsun/brackets,thehogfather/brackets,abhisekp/brackets,udhayam/brackets,busykai/brackets,macdg/brackets,busykai/brackets,massimiliano76/brackets,phillipalexander/brackets,jacobnash/brackets,jmarkina/brackets,alexkid64/brackets,Cartman0/brackets,gcommetti/brackets,jacobnash/brackets,thehogfather/brackets,uwsd/brackets,fronzec/brackets,ralic/brackets,chinnyannieb/brackets,emanziano/brackets,resir014/brackets,pkdevbox/brackets,adobe/brackets,MantisWare/brackets,Real-Currents/brackets,jmarkina/brackets,tan9/brackets,keir-rex/brackets,kilroy23/brackets,karevn/brackets,fronzec/brackets,ricciozhang/brackets,lovewitty/brackets,ralic/brackets,uwsd/brackets,zhukaixy/brackets,hanmichael/brackets,eric-stanley/brackets,jiawenbo/brackets,adrianhartanto0/brackets,shal1y/brackets,pkdevbox/brackets,fabricadeaplicativos/brackets,ricciozhang/brackets,amrelnaggar/brackets,youprofit/brackets,brianjking/brackets,abhisekp/brackets,stowball/brackets,thr0w/brackets,chrismoulton/brackets,chambej/brackets,MantisWare/brackets,NKcentinel/brackets,srinivashappy/brackets,GHackAnonymous/brackets,GHackAnonymous/brackets,veveykocute/brackets,massimiliano76/brackets,xantage/brackets,ricciozhang/brackets,srinivashappy/brackets,shal1y/brackets,StephanieMak/brackets,ls2uper/brackets,MantisWare/brackets,chrismoulton/brackets,MarcelGerber/brackets,andrewnc/brackets,Fcmam5/brackets,chrisle/brackets,mcanthony/brackets,m66n/brackets,Real-Currents/brackets,resir014/brackets,sprintr/brackets,richmondgozarin/brackets,Lojsan123/brackets,albertinad/brackets,pomadgw/brackets,amrelnaggar/brackets,macdg/brackets,jiimaho/brackets,Rynaro/brackets,ralic/brackets,richmondgozarin/brackets,zaggino/brackets-electron,uwsd/brackets,karevn/brackets,wakermahmud/brackets,jiimaho/brackets,petetnt/brackets,Lojsan123/brackets,sophiacaspar/brackets,jacobnash/brackets,82488059/brackets,ls2uper/brackets,shal1y/brackets,eric-stanley/brackets,Rynaro/brackets,RamirezWillow/brackets,GHackAnonymous/brackets,Andrey-Pavlov/brackets,karevn/brackets,MarcelGerber/brackets,zaggino/brackets-electron,uwsd/brackets,srinivashappy/brackets,StephanieMak/brackets,FTG-003/brackets,RamirezWillow/brackets,fabricadeaplicativos/brackets,pratts/brackets,stowball/brackets,StephanieMak/brackets,chinnyannieb/brackets,albertinad/brackets,wesleifreitas/brackets,resir014/brackets,abhisekp/brackets,adrianhartanto0/brackets,RamirezWillow/brackets,siddharta1337/brackets,ChaofengZhou/brackets,StephanieMak/brackets,Andrey-Pavlov/brackets,NGHGithub/brackets,srhbinion/brackets,MahadevanSrinivasan/brackets,brianjking/brackets,jiimaho/brackets,lovewitty/brackets,albertinad/brackets,udhayam/brackets,treejames/brackets,wesleifreitas/brackets,m66n/brackets,ecwebservices/brackets,kolipka/brackets,fcjailybo/brackets,ls2uper/brackets,Real-Currents/brackets,Cartman0/brackets,andrewnc/brackets,richmondgozarin/brackets,stowball/brackets,ecwebservices/brackets,ficristo/brackets,fvntr/brackets,zhukaixy/brackets,fastrde/brackets,jiawenbo/brackets,ficristo/brackets,resir014/brackets,ricciozhang/brackets,srhbinion/brackets,NGHGithub/brackets,jiimaho/brackets,kolipka/brackets,chambej/brackets,wangjun/brackets,pomadgw/brackets,brianjking/brackets,chrisle/brackets,jmarkina/brackets,ricciozhang/brackets,Free-Technology-Guild/brackets,IAmAnubhavSaini/brackets,adobe/brackets,Andrey-Pavlov/brackets,rlugojr/brackets,MahadevanSrinivasan/brackets,pkdevbox/brackets,wesleifreitas/brackets,netlams/brackets,ls2uper/brackets,fashionsun/brackets,Free-Technology-Guild/brackets,gupta-tarun/brackets,pomadgw/brackets,IAmAnubhavSaini/brackets,RobertJGabriel/brackets,andrewnc/brackets,ecwebservices/brackets,fcjailybo/brackets,kilroy23/brackets,netlams/brackets,mcanthony/brackets,wangjun/brackets,ls2uper/brackets,CapeSepias/brackets,ralic/brackets,FTG-003/brackets,82488059/brackets,youprofit/brackets,chrisle/brackets,lunode/brackets,massimiliano76/brackets,rafaelstz/brackets,Mosoc/brackets,CapeSepias/brackets,gcommetti/brackets,fcjailybo/brackets,pkdevbox/brackets,lunode/brackets,Wikunia/brackets,Jonavin/brackets,veveykocute/brackets,wakermahmud/brackets,shiyamkumar/brackets,wangjun/brackets,NGHGithub/brackets,fronzec/brackets,robertkarlsson/brackets,fvntr/brackets,StephanieMak/brackets,Cartman0/brackets,Lojsan123/brackets,iamchathu/brackets,adobe/brackets,Wikunia/brackets,treejames/brackets,MahadevanSrinivasan/brackets,shiyamkumar/brackets,zhukaixy/brackets,petetnt/brackets,kolipka/brackets,srhbinion/brackets,mjurczyk/brackets,Rynaro/brackets,mcanthony/brackets
css
## Code Before: .brackets-pref-hints .matched-hint { font-weight: 500; } .dark .brackets-pref-hints .matched-hint { color: #ccc; } .brackets-pref-hints .hint-obj { display: inline-block; } .brackets-pref-hints .hint-description { line-height: 1.3; display: none; width: 250px; padding-bottom: 3px; padding-left: 14px; white-space: pre-wrap; color: #6e6e64; } .dark .brackets-pref-hints .hint-description { color: #ccc; } .highlight .brackets-pref-hints .hint-description { display: block; } ## Instruction: Add minimum width to code hints ## Code After: .brackets-pref-hints .matched-hint { font-weight: 500; } .dark .brackets-pref-hints .matched-hint { color: #ccc; } .brackets-pref-hints .hint-obj { display: inline-block; min-width: 250px; } .brackets-pref-hints .hint-description { line-height: 1.3; display: none; width: 250px; padding-bottom: 3px; padding-left: 14px; white-space: pre-wrap; color: #6e6e64; } .dark .brackets-pref-hints .hint-description { color: #ccc; } .highlight .brackets-pref-hints .hint-description { display: block; }
.brackets-pref-hints .matched-hint { font-weight: 500; } .dark .brackets-pref-hints .matched-hint { color: #ccc; } .brackets-pref-hints .hint-obj { display: inline-block; + min-width: 250px; } .brackets-pref-hints .hint-description { line-height: 1.3; display: none; width: 250px; padding-bottom: 3px; padding-left: 14px; white-space: pre-wrap; color: #6e6e64; } .dark .brackets-pref-hints .hint-description { color: #ccc; } .highlight .brackets-pref-hints .hint-description { display: block; }
1
0.035714
1
0
7733f72e6857d32f2275efdb87bde4b5790a392b
doc_assets/css/style.css
doc_assets/css/style.css
.exampleOutput { display: flex; border: 1px solid rgb(224, 224, 224); padding: 2rem; border-top-left-radius: 4px; border-top-right-radius: 4px; } .codeBlock pre { border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; max-height: 250px; overflow: auto; } .example-grid-content { background: rgb(224, 224, 224); display: flex; padding: 5px; } .exampleOutput .btn + .btn { margin-left: 1rem; } .example-color { width: 12em; line-height: 50px; text-align: center; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; }
.exampleOutput { display: flex; border: 1px solid rgb(224, 224, 224); padding: 2rem; border-top-left-radius: 4px; border-top-right-radius: 4px; max-height: 640px; overflow: auto; } .codeBlock pre { border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; max-height: 250px; overflow: auto; } .example-grid-content { background: rgb(224, 224, 224); display: flex; padding: 5px; } .exampleOutput .btn + .btn { margin-left: 1rem; } .example-color { width: 12em; line-height: 50px; text-align: center; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; }
Set max overflow of demo to 640px
Set max overflow of demo to 640px
CSS
mit
adfinis-sygroup/adcssy,topaxi/adcssy,adfinis-sygroup/adcssy,topaxi/adcssy
css
## Code Before: .exampleOutput { display: flex; border: 1px solid rgb(224, 224, 224); padding: 2rem; border-top-left-radius: 4px; border-top-right-radius: 4px; } .codeBlock pre { border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; max-height: 250px; overflow: auto; } .example-grid-content { background: rgb(224, 224, 224); display: flex; padding: 5px; } .exampleOutput .btn + .btn { margin-left: 1rem; } .example-color { width: 12em; line-height: 50px; text-align: center; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; } ## Instruction: Set max overflow of demo to 640px ## Code After: .exampleOutput { display: flex; border: 1px solid rgb(224, 224, 224); padding: 2rem; border-top-left-radius: 4px; border-top-right-radius: 4px; max-height: 640px; overflow: auto; } .codeBlock pre { border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; max-height: 250px; overflow: auto; } .example-grid-content { background: rgb(224, 224, 224); display: flex; padding: 5px; } .exampleOutput .btn + .btn { margin-left: 1rem; } .example-color { width: 12em; line-height: 50px; text-align: center; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; }
.exampleOutput { display: flex; border: 1px solid rgb(224, 224, 224); padding: 2rem; border-top-left-radius: 4px; border-top-right-radius: 4px; + max-height: 640px; + overflow: auto; } .codeBlock pre { border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; max-height: 250px; overflow: auto; } .example-grid-content { background: rgb(224, 224, 224); display: flex; padding: 5px; } .exampleOutput .btn + .btn { margin-left: 1rem; } .example-color { width: 12em; line-height: 50px; text-align: center; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; }
2
0.064516
2
0
41dca838bd0a9abf7039423c4dfe4ee9edf6b205
styleguide/docs/react/toggle.js
styleguide/docs/react/toggle.js
/*doc --- title: Toggle name: toggle_react parent: form_react --- <code class="pam"> <i class="fa fa-download" alt="Install the Component"> npm install pui-react-toggle --save </i> </code> Require the subcomponent: ``` var Toggle = require('pui-react-toggle').Toggle; ``` The Toggle component takes an `onChange` callback. ```react_example <Toggle onChange={() => console.log('I have been toggled!')}/> ``` */
/*doc --- title: Toggle name: toggle_react parent: form_react --- <code class="pam"> <i class="fa fa-download" alt="Install the Component"> npm install pui-react-toggle --save </i> </code> Require the subcomponent: ``` var Toggle = require('pui-react-toggle').Toggle; ``` The Toggle component takes an `onChange` callback. ```react_example <Toggle onChange={() => console.log('I have been toggled!')}/> ``` Toggles accept a `checked` prop that turns on the switch. ```react_example <Toggle checked/> ``` */
Document Toggle checked prop in styleguide
feat(styleguide): Document Toggle checked prop in styleguide [#114690205]
JavaScript
mit
sjolicoeur/pivotal-ui,sjolicoeur/pivotal-ui,sjolicoeur/pivotal-ui,pivotal-cf/pivotal-ui,pivotal-cf/pivotal-ui,sjolicoeur/pivotal-ui,pivotal-cf/pivotal-ui
javascript
## Code Before: /*doc --- title: Toggle name: toggle_react parent: form_react --- <code class="pam"> <i class="fa fa-download" alt="Install the Component"> npm install pui-react-toggle --save </i> </code> Require the subcomponent: ``` var Toggle = require('pui-react-toggle').Toggle; ``` The Toggle component takes an `onChange` callback. ```react_example <Toggle onChange={() => console.log('I have been toggled!')}/> ``` */ ## Instruction: feat(styleguide): Document Toggle checked prop in styleguide [#114690205] ## Code After: /*doc --- title: Toggle name: toggle_react parent: form_react --- <code class="pam"> <i class="fa fa-download" alt="Install the Component"> npm install pui-react-toggle --save </i> </code> Require the subcomponent: ``` var Toggle = require('pui-react-toggle').Toggle; ``` The Toggle component takes an `onChange` callback. ```react_example <Toggle onChange={() => console.log('I have been toggled!')}/> ``` Toggles accept a `checked` prop that turns on the switch. ```react_example <Toggle checked/> ``` */
/*doc --- title: Toggle name: toggle_react parent: form_react --- <code class="pam"> <i class="fa fa-download" alt="Install the Component"> npm install pui-react-toggle --save </i> </code> Require the subcomponent: ``` var Toggle = require('pui-react-toggle').Toggle; ``` The Toggle component takes an `onChange` callback. ```react_example <Toggle onChange={() => console.log('I have been toggled!')}/> ``` + Toggles accept a `checked` prop that turns on the switch. + + ```react_example + <Toggle checked/> + ``` + */
6
0.230769
6
0
c64d635600de303a51cc723aac560bcfe886b16a
.travis.yml
.travis.yml
language: php php: - 5.4 - 5.5 notifications: irc: use_notice: true skip_join: true channels: ["irc.freenode.org#imbo"] before_script: - composer self-update - composer --dev install --prefer-source script: phpunit -c tests
language: php php: - 5.4 - 5.5 notifications: irc: use_notice: true skip_join: true channels: ["irc.freenode.org#imbo"] before_script: - composer self-update - composer -n --dev install --prefer-source script: - ./vendor/bin/phpunit -c tests
Use the PHPUnit installed by composer
Use the PHPUnit installed by composer
YAML
mit
imbo/imbo-zf2-module,imbo/imbo-zf2-module
yaml
## Code Before: language: php php: - 5.4 - 5.5 notifications: irc: use_notice: true skip_join: true channels: ["irc.freenode.org#imbo"] before_script: - composer self-update - composer --dev install --prefer-source script: phpunit -c tests ## Instruction: Use the PHPUnit installed by composer ## Code After: language: php php: - 5.4 - 5.5 notifications: irc: use_notice: true skip_join: true channels: ["irc.freenode.org#imbo"] before_script: - composer self-update - composer -n --dev install --prefer-source script: - ./vendor/bin/phpunit -c tests
language: php php: - 5.4 - 5.5 notifications: irc: use_notice: true skip_join: true channels: ["irc.freenode.org#imbo"] before_script: - composer self-update - - composer --dev install --prefer-source + - composer -n --dev install --prefer-source ? +++ - script: phpunit -c tests + script: + - ./vendor/bin/phpunit -c tests
5
0.333333
3
2
d0eadafeb50edddf47237c980c8ecb39e01c8ab9
docs/editor_manual/administrator_tasks/index.rst
docs/editor_manual/administrator_tasks/index.rst
Administrator tasks =================== This section of the guide documents how to perform common tasks as an administrator of a Wagtail site. .. toctree:: :maxdepth: 3 managing_users promoted_search_results .. redirects
Administrator tasks =================== This section of the guide documents how to perform common tasks as an administrator of a Wagtail site. .. toctree:: :maxdepth: 3 managing_users promoted_search_results
Remove reference to non-existant page in docs
Remove reference to non-existant page in docs
reStructuredText
bsd-3-clause
kaedroho/wagtail,zerolab/wagtail,JoshBarr/wagtail,rsalmaso/wagtail,mixxorz/wagtail,JoshBarr/wagtail,quru/wagtail,kurtrwall/wagtail,torchbox/wagtail,kaedroho/wagtail,takeflight/wagtail,nilnvoid/wagtail,rv816/wagtail,timorieber/wagtail,Tivix/wagtail,zerolab/wagtail,Tivix/wagtail,rjsproxy/wagtail,kurtw/wagtail,mjec/wagtail,nealtodd/wagtail,jnns/wagtail,Klaudit/wagtail,inonit/wagtail,kurtrwall/wagtail,tangentlabs/wagtail,serzans/wagtail,wagtail/wagtail,jnns/wagtail,takeflight/wagtail,nimasmi/wagtail,quru/wagtail,FlipperPA/wagtail,rsalmaso/wagtail,Toshakins/wagtail,tangentlabs/wagtail,wagtail/wagtail,kaedroho/wagtail,mjec/wagtail,rsalmaso/wagtail,quru/wagtail,mayapurmedia/wagtail,WQuanfeng/wagtail,wagtail/wagtail,JoshBarr/wagtail,serzans/wagtail,davecranwell/wagtail,nutztherookie/wagtail,kurtrwall/wagtail,mikedingjan/wagtail,serzans/wagtail,mayapurmedia/wagtail,wagtail/wagtail,tangentlabs/wagtail,Tivix/wagtail,Pennebaker/wagtail,nilnvoid/wagtail,hamsterbacke23/wagtail,kurtw/wagtail,nutztherookie/wagtail,mixxorz/wagtail,gogobook/wagtail,kurtw/wagtail,mjec/wagtail,thenewguy/wagtail,nimasmi/wagtail,nimasmi/wagtail,nilnvoid/wagtail,FlipperPA/wagtail,mayapurmedia/wagtail,davecranwell/wagtail,Pennebaker/wagtail,thenewguy/wagtail,rsalmaso/wagtail,Klaudit/wagtail,wagtail/wagtail,Klaudit/wagtail,zerolab/wagtail,hamsterbacke23/wagtail,torchbox/wagtail,Tivix/wagtail,Toshakins/wagtail,rv816/wagtail,FlipperPA/wagtail,Klaudit/wagtail,WQuanfeng/wagtail,thenewguy/wagtail,chrxr/wagtail,hamsterbacke23/wagtail,timorieber/wagtail,inonit/wagtail,gogobook/wagtail,gogobook/wagtail,mikedingjan/wagtail,torchbox/wagtail,inonit/wagtail,timorieber/wagtail,hanpama/wagtail,nutztherookie/wagtail,nealtodd/wagtail,nrsimha/wagtail,hanpama/wagtail,inonit/wagtail,FlipperPA/wagtail,Toshakins/wagtail,chrxr/wagtail,thenewguy/wagtail,takeshineshiro/wagtail,zerolab/wagtail,iansprice/wagtail,mixxorz/wagtail,torchbox/wagtail,timorieber/wagtail,takeflight/wagtail,davecranwell/wagtail,mikedingjan/wagtail,iansprice/wagtail,JoshBarr/wagtail,mjec/wagtail,nimasmi/wagtail,gasman/wagtail,kurtrwall/wagtail,nrsimha/wagtail,thenewguy/wagtail,iansprice/wagtail,jnns/wagtail,rv816/wagtail,hamsterbacke23/wagtail,Toshakins/wagtail,nealtodd/wagtail,takeshineshiro/wagtail,takeflight/wagtail,chrxr/wagtail,mixxorz/wagtail,jnns/wagtail,hanpama/wagtail,Pennebaker/wagtail,takeshineshiro/wagtail,rjsproxy/wagtail,rjsproxy/wagtail,mikedingjan/wagtail,quru/wagtail,zerolab/wagtail,gogobook/wagtail,nealtodd/wagtail,iansprice/wagtail,nilnvoid/wagtail,mayapurmedia/wagtail,rv816/wagtail,davecranwell/wagtail,hanpama/wagtail,gasman/wagtail,takeshineshiro/wagtail,chrxr/wagtail,tangentlabs/wagtail,gasman/wagtail,nutztherookie/wagtail,Pennebaker/wagtail,gasman/wagtail,nrsimha/wagtail,kaedroho/wagtail,rjsproxy/wagtail,WQuanfeng/wagtail,WQuanfeng/wagtail,mixxorz/wagtail,gasman/wagtail,nrsimha/wagtail,kaedroho/wagtail,serzans/wagtail,kurtw/wagtail,rsalmaso/wagtail
restructuredtext
## Code Before: Administrator tasks =================== This section of the guide documents how to perform common tasks as an administrator of a Wagtail site. .. toctree:: :maxdepth: 3 managing_users promoted_search_results .. redirects ## Instruction: Remove reference to non-existant page in docs ## Code After: Administrator tasks =================== This section of the guide documents how to perform common tasks as an administrator of a Wagtail site. .. toctree:: :maxdepth: 3 managing_users promoted_search_results
Administrator tasks =================== This section of the guide documents how to perform common tasks as an administrator of a Wagtail site. .. toctree:: :maxdepth: 3 managing_users promoted_search_results - .. redirects
1
0.090909
0
1
b316b8c3c411de4d9878000848d6624401f5f46e
public/signup/index.html
public/signup/index.html
<html> <head> <title> Stop Trump's Nominees </title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <div id="header-container"> <div id="header"> <span class="header-item">A project of Advocacy Commons</span> </div> </div> <div id="form-container"> <noscript><span id="no_js_warning"><br />It looks like you have JavaScript disabled. You'll need it to use this site. <a href="http://enable-javascript.com/" target="_blank">Here</a> are some instructions.</span></noscript> <div id='can-form-area-lets-stop-trumps-nominees' style='width: 100%'><!-- this div is the target for our HTML insertion --></div> </div> <link rel="stylesheet" type="text/css" href="/call/style/style.css" /><script data-main="/signup/main.js" src="/call/app/require.js"></script> </body> </html>
<html> <head> <title> Stop Trump's Nominees </title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" type="text/css" href="/call/style/style.css" /> <script data-main="/signup/main.js" src="/call/app/require.js"></script> </head> <body> <div id="header-container"> <div id="header"> <span class="header-item">A project of Advocacy Commons</span> </div> </div> <div id="form-container"> <noscript><span id="no_js_warning"><br />It looks like you have JavaScript disabled. You'll need it to use this site. <a href="http://enable-javascript.com/" target="_blank">Here</a> are some instructions.</span></noscript> <div id='can-form-area-lets-stop-trumps-nominees' style='width: 100%'><!-- this div is the target for our HTML insertion --></div> </div> </body> </html>
Move stylesheet & script back to <head>
Move stylesheet & script back to <head> Let's see if this fixes the page-not-loading on iOS
HTML
agpl-3.0
agustinrhcp/advocacycommons,advocacycommons/advocacycommons,matinieves/advocacycommons,matinieves/advocacycommons,matinieves/advocacycommons,agustinrhcp/advocacycommons,agustinrhcp/advocacycommons,advocacycommons/advocacycommons,advocacycommons/advocacycommons
html
## Code Before: <html> <head> <title> Stop Trump's Nominees </title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <div id="header-container"> <div id="header"> <span class="header-item">A project of Advocacy Commons</span> </div> </div> <div id="form-container"> <noscript><span id="no_js_warning"><br />It looks like you have JavaScript disabled. You'll need it to use this site. <a href="http://enable-javascript.com/" target="_blank">Here</a> are some instructions.</span></noscript> <div id='can-form-area-lets-stop-trumps-nominees' style='width: 100%'><!-- this div is the target for our HTML insertion --></div> </div> <link rel="stylesheet" type="text/css" href="/call/style/style.css" /><script data-main="/signup/main.js" src="/call/app/require.js"></script> </body> </html> ## Instruction: Move stylesheet & script back to <head> Let's see if this fixes the page-not-loading on iOS ## Code After: <html> <head> <title> Stop Trump's Nominees </title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" type="text/css" href="/call/style/style.css" /> <script data-main="/signup/main.js" src="/call/app/require.js"></script> </head> <body> <div id="header-container"> <div id="header"> <span class="header-item">A project of Advocacy Commons</span> </div> </div> <div id="form-container"> <noscript><span id="no_js_warning"><br />It looks like you have JavaScript disabled. You'll need it to use this site. <a href="http://enable-javascript.com/" target="_blank">Here</a> are some instructions.</span></noscript> <div id='can-form-area-lets-stop-trumps-nominees' style='width: 100%'><!-- this div is the target for our HTML insertion --></div> </div> </body> </html>
<html> <head> <title> Stop Trump's Nominees </title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <link rel="stylesheet" type="text/css" href="/call/style/style.css" /> + <script data-main="/signup/main.js" src="/call/app/require.js"></script> </head> <body> <div id="header-container"> <div id="header"> <span class="header-item">A project of Advocacy Commons</span> </div> </div> <div id="form-container"> <noscript><span id="no_js_warning"><br />It looks like you have JavaScript disabled. You'll need it to use this site. <a href="http://enable-javascript.com/" target="_blank">Here</a> are some instructions.</span></noscript> <div id='can-form-area-lets-stop-trumps-nominees' style='width: 100%'><!-- this div is the target for our HTML insertion --></div> </div> - <link rel="stylesheet" type="text/css" href="/call/style/style.css" /><script data-main="/signup/main.js" src="/call/app/require.js"></script> </body> </html>
3
0.15
2
1
c5a2bed3a95d43862a1750e9b8af556cd02268e3
.ci/install-silo-on-github.sh
.ci/install-silo-on-github.sh
sudo apt update sudo apt install libsilo-dev curl -L -O https://wci.llnl.gov/content/assets/docs/simulation/computer-codes/silo/silo-4.10.2/silo-4.10.2-bsd-smalltest.tar.gz tar xfz silo-4.10.2-bsd-smalltest.tar.gz sudo cp silo-4.10.2-bsd/src/silo/silo_exports.h /usr/include sudo chmod a+rX /usr/include/silo_exports.h
sudo apt update sudo apt install libsilo-dev # As of 2021-01-04, the download links at https://wci.llnl.gov/simulation/computer-codes/silo are dead. curl -L -O https://deb.debian.org/debian/pool/main/s/silo-llnl/silo-llnl_4.10.2.real.orig.tar.xz tar xfa silo-llnl_4.10.2.real.orig.tar.xz sudo cp silo-llnl-4.10.2.real/src/silo/silo_exports.h /usr/include sudo chmod a+rX /usr/include/silo_exports.h
Fix libsilo download URL for Github CI
Fix libsilo download URL for Github CI
Shell
mit
inducer/pyvisfile,inducer/pyvisfile,inducer/pyvisfile
shell
## Code Before: sudo apt update sudo apt install libsilo-dev curl -L -O https://wci.llnl.gov/content/assets/docs/simulation/computer-codes/silo/silo-4.10.2/silo-4.10.2-bsd-smalltest.tar.gz tar xfz silo-4.10.2-bsd-smalltest.tar.gz sudo cp silo-4.10.2-bsd/src/silo/silo_exports.h /usr/include sudo chmod a+rX /usr/include/silo_exports.h ## Instruction: Fix libsilo download URL for Github CI ## Code After: sudo apt update sudo apt install libsilo-dev # As of 2021-01-04, the download links at https://wci.llnl.gov/simulation/computer-codes/silo are dead. curl -L -O https://deb.debian.org/debian/pool/main/s/silo-llnl/silo-llnl_4.10.2.real.orig.tar.xz tar xfa silo-llnl_4.10.2.real.orig.tar.xz sudo cp silo-llnl-4.10.2.real/src/silo/silo_exports.h /usr/include sudo chmod a+rX /usr/include/silo_exports.h
sudo apt update sudo apt install libsilo-dev - curl -L -O https://wci.llnl.gov/content/assets/docs/simulation/computer-codes/silo/silo-4.10.2/silo-4.10.2-bsd-smalltest.tar.gz - tar xfz silo-4.10.2-bsd-smalltest.tar.gz + # As of 2021-01-04, the download links at https://wci.llnl.gov/simulation/computer-codes/silo are dead. + curl -L -O https://deb.debian.org/debian/pool/main/s/silo-llnl/silo-llnl_4.10.2.real.orig.tar.xz + tar xfa silo-llnl_4.10.2.real.orig.tar.xz - sudo cp silo-4.10.2-bsd/src/silo/silo_exports.h /usr/include ? ^^^^ + sudo cp silo-llnl-4.10.2.real/src/silo/silo_exports.h /usr/include ? +++++ ^^^^^ sudo chmod a+rX /usr/include/silo_exports.h
7
1
4
3
a84c02b4369bf698c82be22b6231fe412ad67c63
Cauldron/ext/click/__init__.py
Cauldron/ext/click/__init__.py
try: import click except ImportError: raise ImportError("Cauldron.ext.click requires the click package.") from ...api import use __all__ = ['backend', 'service'] def select_backend(ctx, param, value): """Callback to set the Cauldron backend.""" if not value or ctx.resilient_parsing: return use(str(value)) def backend(default=None): """Click options to set up a Cauldron backend.""" option = click.option("-k", "--backend", expose_value=False, is_eager=True, callback=select_backend, help="Set the Cauldron backend.", default=default) def decorate(func): return option(func) return decorate backend_option = backend def construct_service(ctx, param, value): """Construct a service.""" if not value: return from Cauldron import ktl return ktl.Service(str(value)) def service(default=None, backend=True): """Add a service argument which returns a ktl.Service class.""" option = click.option("-s", "--service", callback=construct_service, help="KTL Service name to use.", default=default) backend_default = None if backend and isinstance(backend, str): backend_default = backend def decorate(func): if backend: func = backend_option(default=backend_default)(func) return option(func)
try: import click except ImportError: raise ImportError("Cauldron.ext.click requires the click package.") from ...api import use __all__ = ['backend', 'service'] def select_backend(ctx, param, value): """Callback to set the Cauldron backend.""" if not value or ctx.resilient_parsing: return use(str(value)) def backend(default=None): """Click options to set up a Cauldron backend.""" option = click.option("-k", "--backend", expose_value=False, is_eager=True, callback=select_backend, help="Set the Cauldron backend.", default=default) def decorate(func): return option(func) return decorate backend_option = backend def construct_service(ctx, param, value): """Construct a service.""" if not value: return from Cauldron import ktl return ktl.Service(str(value)) def service(default=None, backend=True): """Add a service argument which returns a ktl.Service class.""" option = click.option("-s", "--service", callback=construct_service, help="KTL Service name to use.", default=default) backend_default = None if backend and isinstance(backend, str): backend_default = backend def decorate(func): if backend: func = backend_option(default=backend_default)(func) return option(func) return decorate
Fix a bug in Cauldron click extension
Fix a bug in Cauldron click extension
Python
bsd-3-clause
alexrudy/Cauldron
python
## Code Before: try: import click except ImportError: raise ImportError("Cauldron.ext.click requires the click package.") from ...api import use __all__ = ['backend', 'service'] def select_backend(ctx, param, value): """Callback to set the Cauldron backend.""" if not value or ctx.resilient_parsing: return use(str(value)) def backend(default=None): """Click options to set up a Cauldron backend.""" option = click.option("-k", "--backend", expose_value=False, is_eager=True, callback=select_backend, help="Set the Cauldron backend.", default=default) def decorate(func): return option(func) return decorate backend_option = backend def construct_service(ctx, param, value): """Construct a service.""" if not value: return from Cauldron import ktl return ktl.Service(str(value)) def service(default=None, backend=True): """Add a service argument which returns a ktl.Service class.""" option = click.option("-s", "--service", callback=construct_service, help="KTL Service name to use.", default=default) backend_default = None if backend and isinstance(backend, str): backend_default = backend def decorate(func): if backend: func = backend_option(default=backend_default)(func) return option(func) ## Instruction: Fix a bug in Cauldron click extension ## Code After: try: import click except ImportError: raise ImportError("Cauldron.ext.click requires the click package.") from ...api import use __all__ = ['backend', 'service'] def select_backend(ctx, param, value): """Callback to set the Cauldron backend.""" if not value or ctx.resilient_parsing: return use(str(value)) def backend(default=None): """Click options to set up a Cauldron backend.""" option = click.option("-k", "--backend", expose_value=False, is_eager=True, callback=select_backend, help="Set the Cauldron backend.", default=default) def decorate(func): return option(func) return decorate backend_option = backend def construct_service(ctx, param, value): """Construct a service.""" if not value: return from Cauldron import ktl return ktl.Service(str(value)) def service(default=None, backend=True): """Add a service argument which returns a ktl.Service class.""" option = click.option("-s", "--service", callback=construct_service, help="KTL Service name to use.", default=default) backend_default = None if backend and isinstance(backend, str): backend_default = backend def decorate(func): if backend: func = backend_option(default=backend_default)(func) return option(func) return decorate
try: import click except ImportError: raise ImportError("Cauldron.ext.click requires the click package.") from ...api import use __all__ = ['backend', 'service'] def select_backend(ctx, param, value): """Callback to set the Cauldron backend.""" if not value or ctx.resilient_parsing: return use(str(value)) def backend(default=None): """Click options to set up a Cauldron backend.""" option = click.option("-k", "--backend", expose_value=False, is_eager=True, callback=select_backend, help="Set the Cauldron backend.", default=default) def decorate(func): return option(func) return decorate backend_option = backend def construct_service(ctx, param, value): """Construct a service.""" if not value: return from Cauldron import ktl return ktl.Service(str(value)) def service(default=None, backend=True): """Add a service argument which returns a ktl.Service class.""" option = click.option("-s", "--service", callback=construct_service, help="KTL Service name to use.", default=default) backend_default = None if backend and isinstance(backend, str): backend_default = backend def decorate(func): if backend: func = backend_option(default=backend_default)(func) return option(func) + return decorate
1
0.020408
1
0
e5d641a0a0da3af931d271867b1f367c90227a7c
.travis.yml
.travis.yml
language: java cache: directories: - $HOME/.m2 jdk: oraclejdk8 sudo: required install: - chmod +x .travis/install-mariadb.sh - sudo .travis/install-mariadb.sh before_script: mysql -uroot < .travis/create-db.sql script: mvn -Dspring.datasource.password= verify
language: java cache: directories: - $HOME/.m2 jdk: oraclejdk8 sudo: required install: sudo -s source .travis/install-mariadb.sh before_script: mysql -uroot < .travis/create-db.sql script: mvn -Dspring.datasource.password= verify
Use source instead of chmod and execute
Use source instead of chmod and execute
YAML
apache-2.0
zjnu-acm/judge,zjnu-acm/judge,zjnu-acm/judge,zjnu-acm/judge,zjnu-acm/judge
yaml
## Code Before: language: java cache: directories: - $HOME/.m2 jdk: oraclejdk8 sudo: required install: - chmod +x .travis/install-mariadb.sh - sudo .travis/install-mariadb.sh before_script: mysql -uroot < .travis/create-db.sql script: mvn -Dspring.datasource.password= verify ## Instruction: Use source instead of chmod and execute ## Code After: language: java cache: directories: - $HOME/.m2 jdk: oraclejdk8 sudo: required install: sudo -s source .travis/install-mariadb.sh before_script: mysql -uroot < .travis/create-db.sql script: mvn -Dspring.datasource.password= verify
language: java cache: directories: - $HOME/.m2 jdk: oraclejdk8 sudo: required - install: - - chmod +x .travis/install-mariadb.sh - - sudo .travis/install-mariadb.sh ? ^^^ + install: sudo -s source .travis/install-mariadb.sh ? ^^^^^^^^ ++++++++++ before_script: mysql -uroot < .travis/create-db.sql script: mvn -Dspring.datasource.password= verify
4
0.363636
1
3
428fd0c9db5b5a6a837695ab4afd74db8c504800
spec/views/projects/index.html.erb_spec.rb
spec/views/projects/index.html.erb_spec.rb
require 'rails_helper' RSpec.describe 'projects/index', type: :view do before(:each) do assign(:projects, [ FactoryGirl.create(:project), FactoryGirl.create(:project) ]) @user = FactoryGirl.create(:user) login_as @user end it 'renders a list of projects' do render end end
require 'rails_helper' RSpec.describe 'projects/index.html.erb', type: :view do before(:each) do assign(:projects, [ FactoryGirl.create(:project), FactoryGirl.create(:project) ]) @user = FactoryGirl.create(:user) login_as @user end it 'renders a list of projects' do render end it 'shows all details about a project' do chair = FactoryGirl.create(:chair) project = FactoryGirl.create(:project, chair_id: chair.id) project.update(status:true) project.update(public:true) visit projects_path expect(page).to have_content(project.title) expect(page).to have_content(l(project.created_at)) expect(page).to have_content(chair.name) expect(page).to have_content(I18n.t('.public', default:'public')) expect(page).to have_content(I18n.t('.active', default:'active')) project.update(status:false) project.update(public:false) visit projects_path expect(page).to have_content(I18n.t('.inactive', default:'inactive')) expect(page).to have_content(I18n.t('.private', default:'private')) end end
Add test for all details on the project side
Add test for all details on the project side
Ruby
mit
hpi-swt2/wimi-portal,hpi-swt2/wimi-portal,hpi-swt2/wimi-portal
ruby
## Code Before: require 'rails_helper' RSpec.describe 'projects/index', type: :view do before(:each) do assign(:projects, [ FactoryGirl.create(:project), FactoryGirl.create(:project) ]) @user = FactoryGirl.create(:user) login_as @user end it 'renders a list of projects' do render end end ## Instruction: Add test for all details on the project side ## Code After: require 'rails_helper' RSpec.describe 'projects/index.html.erb', type: :view do before(:each) do assign(:projects, [ FactoryGirl.create(:project), FactoryGirl.create(:project) ]) @user = FactoryGirl.create(:user) login_as @user end it 'renders a list of projects' do render end it 'shows all details about a project' do chair = FactoryGirl.create(:chair) project = FactoryGirl.create(:project, chair_id: chair.id) project.update(status:true) project.update(public:true) visit projects_path expect(page).to have_content(project.title) expect(page).to have_content(l(project.created_at)) expect(page).to have_content(chair.name) expect(page).to have_content(I18n.t('.public', default:'public')) expect(page).to have_content(I18n.t('.active', default:'active')) project.update(status:false) project.update(public:false) visit projects_path expect(page).to have_content(I18n.t('.inactive', default:'inactive')) expect(page).to have_content(I18n.t('.private', default:'private')) end end
require 'rails_helper' - RSpec.describe 'projects/index', type: :view do + RSpec.describe 'projects/index.html.erb', type: :view do ? +++++++++ before(:each) do assign(:projects, [ FactoryGirl.create(:project), FactoryGirl.create(:project) ]) @user = FactoryGirl.create(:user) login_as @user end it 'renders a list of projects' do render end + it 'shows all details about a project' do + chair = FactoryGirl.create(:chair) + project = FactoryGirl.create(:project, chair_id: chair.id) + + project.update(status:true) + project.update(public:true) + + visit projects_path + + expect(page).to have_content(project.title) + expect(page).to have_content(l(project.created_at)) + expect(page).to have_content(chair.name) + + expect(page).to have_content(I18n.t('.public', default:'public')) + expect(page).to have_content(I18n.t('.active', default:'active')) + + project.update(status:false) + project.update(public:false) + visit projects_path + + expect(page).to have_content(I18n.t('.inactive', default:'inactive')) + expect(page).to have_content(I18n.t('.private', default:'private')) + end end
25
1.470588
24
1
b7b05178a4f4aeb752a02fa0c7e937b2289ec83f
lib/wpclient/paginated_collection.rb
lib/wpclient/paginated_collection.rb
module Wpclient class PaginatedCollection include Enumerable attr_reader :total, :current_page, :per_page def initialize(entries, total:, current_page:, per_page:) @entries = entries @total = total @current_page = current_page @per_page = per_page end def each if block_given? @entries.each { |e| yield e } else @entries.each end end def replace(new_list) @entries.replace(new_list) end # # Pagination methods. Fulfilling will_paginate protocol # def total_pages if total.zero? || per_page.zero? 0 else (total / per_page.to_f).ceil end end def next_page if current_page < total_pages current_page + 1 end end def previous_page if current_page > 1 current_page - 1 end end def out_of_bounds? current_page < 1 || current_page > total_pages end # # Array-like behavior # def size @entries.size end def empty? @entries.empty? end def to_a @entries end # Allow PaginatedCollection to be coerced into an array alias to_ary to_a end end
module Wpclient class PaginatedCollection include Enumerable attr_reader :total, :current_page, :per_page def initialize(entries, total:, current_page:, per_page:) @entries = entries @total = total @current_page = current_page @per_page = per_page end alias total_entires total def each if block_given? @entries.each { |e| yield e } else @entries.each end end def replace(new_list) @entries.replace(new_list) end # # Pagination methods. Fulfilling will_paginate protocol # def total_pages if total.zero? || per_page.zero? 0 else (total / per_page.to_f).ceil end end def next_page if current_page < total_pages current_page + 1 end end def previous_page if current_page > 1 current_page - 1 end end def out_of_bounds? current_page < 1 || current_page > total_pages end # # Array-like behavior # def size @entries.size end def empty? @entries.empty? end def to_a @entries end # Allow PaginatedCollection to be coerced into an array alias to_ary to_a end end
Add alias for total_entries to total
Add alias for total_entries to total
Ruby
mit
hemnet/wordpress_client,hemnet/wordpress_client
ruby
## Code Before: module Wpclient class PaginatedCollection include Enumerable attr_reader :total, :current_page, :per_page def initialize(entries, total:, current_page:, per_page:) @entries = entries @total = total @current_page = current_page @per_page = per_page end def each if block_given? @entries.each { |e| yield e } else @entries.each end end def replace(new_list) @entries.replace(new_list) end # # Pagination methods. Fulfilling will_paginate protocol # def total_pages if total.zero? || per_page.zero? 0 else (total / per_page.to_f).ceil end end def next_page if current_page < total_pages current_page + 1 end end def previous_page if current_page > 1 current_page - 1 end end def out_of_bounds? current_page < 1 || current_page > total_pages end # # Array-like behavior # def size @entries.size end def empty? @entries.empty? end def to_a @entries end # Allow PaginatedCollection to be coerced into an array alias to_ary to_a end end ## Instruction: Add alias for total_entries to total ## Code After: module Wpclient class PaginatedCollection include Enumerable attr_reader :total, :current_page, :per_page def initialize(entries, total:, current_page:, per_page:) @entries = entries @total = total @current_page = current_page @per_page = per_page end alias total_entires total def each if block_given? @entries.each { |e| yield e } else @entries.each end end def replace(new_list) @entries.replace(new_list) end # # Pagination methods. Fulfilling will_paginate protocol # def total_pages if total.zero? || per_page.zero? 0 else (total / per_page.to_f).ceil end end def next_page if current_page < total_pages current_page + 1 end end def previous_page if current_page > 1 current_page - 1 end end def out_of_bounds? current_page < 1 || current_page > total_pages end # # Array-like behavior # def size @entries.size end def empty? @entries.empty? end def to_a @entries end # Allow PaginatedCollection to be coerced into an array alias to_ary to_a end end
module Wpclient class PaginatedCollection include Enumerable attr_reader :total, :current_page, :per_page def initialize(entries, total:, current_page:, per_page:) @entries = entries @total = total @current_page = current_page @per_page = per_page end + + alias total_entires total def each if block_given? @entries.each { |e| yield e } else @entries.each end end def replace(new_list) @entries.replace(new_list) end # # Pagination methods. Fulfilling will_paginate protocol # def total_pages if total.zero? || per_page.zero? 0 else (total / per_page.to_f).ceil end end def next_page if current_page < total_pages current_page + 1 end end def previous_page if current_page > 1 current_page - 1 end end def out_of_bounds? current_page < 1 || current_page > total_pages end # # Array-like behavior # def size @entries.size end def empty? @entries.empty? end def to_a @entries end # Allow PaginatedCollection to be coerced into an array alias to_ary to_a end end
2
0.027778
2
0
48adecb05d7f659b6c4da22b86668761069ce38f
single_node/init_accumulo.sh
single_node/init_accumulo.sh
su - hdfs -c '/usr/lib/hadoop/bin/hdfs dfs -mkdir /accumulo' su - hdfs -c '/usr/lib/hadoop/bin/hdfs dfs -mkdir -p /user/accumulo' su - hdfs -c '/usr/lib/hadoop/bin/hdfs dfs -chown accumulo:accumulo /accumulo' su - hdfs -c '/usr/lib/hadoop/bin/hdfs dfs -chown accumulo:accumulo /user/accumulo' su - accumulo -c '/usr/lib/accumulo/bin/accumulo init --instance-name accumulo --password secret' cp -vu /docker/supervisord-accumulo.conf /etc/supervisor/conf.d/accumulo.conf
su - hdfs -c '/usr/lib/hadoop/bin/hdfs dfs -mkdir /accumulo' su - hdfs -c '/usr/lib/hadoop/bin/hdfs dfs -mkdir -p /user/accumulo' su - hdfs -c '/usr/lib/hadoop/bin/hdfs dfs -chown accumulo:accumulo /accumulo' su - hdfs -c '/usr/lib/hadoop/bin/hdfs dfs -chown accumulo:accumulo /user/accumulo' su - accumulo -c '/usr/lib/accumulo/bin/accumulo init --instance-name accumulo --password secret' # # Now that accumulo has been initialized, we can add the supervisor configuration file. cp -vu /docker/supervisord-accumulo.conf /etc/supervisor/conf.d/accumulo.conf
Add comment why accumulo supervisor configuration is done last.
Add comment why accumulo supervisor configuration is done last.
Shell
mit
medined/docker-accumulo
shell
## Code Before: su - hdfs -c '/usr/lib/hadoop/bin/hdfs dfs -mkdir /accumulo' su - hdfs -c '/usr/lib/hadoop/bin/hdfs dfs -mkdir -p /user/accumulo' su - hdfs -c '/usr/lib/hadoop/bin/hdfs dfs -chown accumulo:accumulo /accumulo' su - hdfs -c '/usr/lib/hadoop/bin/hdfs dfs -chown accumulo:accumulo /user/accumulo' su - accumulo -c '/usr/lib/accumulo/bin/accumulo init --instance-name accumulo --password secret' cp -vu /docker/supervisord-accumulo.conf /etc/supervisor/conf.d/accumulo.conf ## Instruction: Add comment why accumulo supervisor configuration is done last. ## Code After: su - hdfs -c '/usr/lib/hadoop/bin/hdfs dfs -mkdir /accumulo' su - hdfs -c '/usr/lib/hadoop/bin/hdfs dfs -mkdir -p /user/accumulo' su - hdfs -c '/usr/lib/hadoop/bin/hdfs dfs -chown accumulo:accumulo /accumulo' su - hdfs -c '/usr/lib/hadoop/bin/hdfs dfs -chown accumulo:accumulo /user/accumulo' su - accumulo -c '/usr/lib/accumulo/bin/accumulo init --instance-name accumulo --password secret' # # Now that accumulo has been initialized, we can add the supervisor configuration file. cp -vu /docker/supervisord-accumulo.conf /etc/supervisor/conf.d/accumulo.conf
su - hdfs -c '/usr/lib/hadoop/bin/hdfs dfs -mkdir /accumulo' su - hdfs -c '/usr/lib/hadoop/bin/hdfs dfs -mkdir -p /user/accumulo' su - hdfs -c '/usr/lib/hadoop/bin/hdfs dfs -chown accumulo:accumulo /accumulo' su - hdfs -c '/usr/lib/hadoop/bin/hdfs dfs -chown accumulo:accumulo /user/accumulo' su - accumulo -c '/usr/lib/accumulo/bin/accumulo init --instance-name accumulo --password secret' + # + # Now that accumulo has been initialized, we can add the supervisor configuration file. cp -vu /docker/supervisord-accumulo.conf /etc/supervisor/conf.d/accumulo.conf
2
0.333333
2
0
77881252e2e5a3510094ebd51badf2ebd8d60e20
minitests/roi_harness/arty.sh
minitests/roi_harness/arty.sh
export XRAY_PART=xc7a35tcsg324-1 export XRAY_PINCFG=ARTY-A7-SWBUT
export XRAY_PART=xc7a35tcsg324-1 export XRAY_PINCFG=ARTY-A7-SWBUT # For generating DB export XRAY_PIN_00="G13" export XRAY_PIN_01="B11" export XRAY_PIN_02="E15" export XRAY_PIN_03="U12" export XRAY_PIN_04="D13" export XRAY_PIN_05="J17" export XRAY_PIN_06="U14" source $XRAY_DIR/utils/environment.sh
Add XRAY_PIN values valid for Arty.
minitests/roi_harness: Add XRAY_PIN values valid for Arty. Allows generating the fuzzers/001-part-yaml for the Arty part. Signed-off-by: Tim 'mithro' Ansell <[email protected]>
Shell
isc
SymbiFlow/prjxray,SymbiFlow/prjxray,SymbiFlow/prjxray,SymbiFlow/prjxray,SymbiFlow/prjxray
shell
## Code Before: export XRAY_PART=xc7a35tcsg324-1 export XRAY_PINCFG=ARTY-A7-SWBUT ## Instruction: minitests/roi_harness: Add XRAY_PIN values valid for Arty. Allows generating the fuzzers/001-part-yaml for the Arty part. Signed-off-by: Tim 'mithro' Ansell <[email protected]> ## Code After: export XRAY_PART=xc7a35tcsg324-1 export XRAY_PINCFG=ARTY-A7-SWBUT # For generating DB export XRAY_PIN_00="G13" export XRAY_PIN_01="B11" export XRAY_PIN_02="E15" export XRAY_PIN_03="U12" export XRAY_PIN_04="D13" export XRAY_PIN_05="J17" export XRAY_PIN_06="U14" source $XRAY_DIR/utils/environment.sh
export XRAY_PART=xc7a35tcsg324-1 export XRAY_PINCFG=ARTY-A7-SWBUT + # For generating DB + export XRAY_PIN_00="G13" + export XRAY_PIN_01="B11" + export XRAY_PIN_02="E15" + export XRAY_PIN_03="U12" + export XRAY_PIN_04="D13" + export XRAY_PIN_05="J17" + export XRAY_PIN_06="U14" + + source $XRAY_DIR/utils/environment.sh
10
3.333333
10
0
9b2b8b59c1c3c20eba006f478a87e2404a837988
_config.yml
_config.yml
full_rebuild: true title: vlau.me url: http://vlau.me description: '' permalink: /:title exclude: - 'node_modules' - '*.sublime-workspace' gems: - jekyll-sitemap kramdown: input: GFM auto_ids: false sass: style: compressed color: text: ffe0e7 background: 28143d ui: 8f2400 author: mail: '[email protected]' # compress.html by Anatol Broder (http://jch.penibelst.de) compress_html: clippings: all comments: ["<!--", "-->"] endings: all ignore: envs: [local] defaults: - scope: path: "" values: layout: "default" - scope: path: "redirects" values: layout: "redirect"
full_rebuild: true title: vlau.me url: http://vlau.me description: '' permalink: /:title include: - '_data' exclude: - 'node_modules' - '*.sublime-workspace' gems: - jekyll-sitemap kramdown: input: GFM auto_ids: false sass: style: compressed color: text: ffe0e7 background: 28143d ui: 8f2400 author: mail: '[email protected]' # compress.html by Anatol Broder (http://jch.penibelst.de) compress_html: clippings: all comments: ["<!--", "-->"] endings: all ignore: envs: [local] defaults: - scope: path: "" values: layout: "default" - scope: path: "redirects" values: layout: "redirect"
Make it so that _data/ is included
Make it so that _data/ is included
YAML
mit
kleinfreund/hyperlink.cool,kleinfreund/hyperlink.cool,kleinfreund/vlau.me,kleinfreund/vlau.me
yaml
## Code Before: full_rebuild: true title: vlau.me url: http://vlau.me description: '' permalink: /:title exclude: - 'node_modules' - '*.sublime-workspace' gems: - jekyll-sitemap kramdown: input: GFM auto_ids: false sass: style: compressed color: text: ffe0e7 background: 28143d ui: 8f2400 author: mail: '[email protected]' # compress.html by Anatol Broder (http://jch.penibelst.de) compress_html: clippings: all comments: ["<!--", "-->"] endings: all ignore: envs: [local] defaults: - scope: path: "" values: layout: "default" - scope: path: "redirects" values: layout: "redirect" ## Instruction: Make it so that _data/ is included ## Code After: full_rebuild: true title: vlau.me url: http://vlau.me description: '' permalink: /:title include: - '_data' exclude: - 'node_modules' - '*.sublime-workspace' gems: - jekyll-sitemap kramdown: input: GFM auto_ids: false sass: style: compressed color: text: ffe0e7 background: 28143d ui: 8f2400 author: mail: '[email protected]' # compress.html by Anatol Broder (http://jch.penibelst.de) compress_html: clippings: all comments: ["<!--", "-->"] endings: all ignore: envs: [local] defaults: - scope: path: "" values: layout: "default" - scope: path: "redirects" values: layout: "redirect"
full_rebuild: true title: vlau.me url: http://vlau.me description: '' permalink: /:title + + include: + - '_data' exclude: - 'node_modules' - '*.sublime-workspace' gems: - jekyll-sitemap kramdown: input: GFM auto_ids: false sass: style: compressed color: text: ffe0e7 background: 28143d ui: 8f2400 author: mail: '[email protected]' # compress.html by Anatol Broder (http://jch.penibelst.de) compress_html: clippings: all comments: ["<!--", "-->"] endings: all ignore: envs: [local] defaults: - scope: path: "" values: layout: "default" - scope: path: "redirects" values: layout: "redirect"
3
0.057692
3
0
21a4d7b4c90b8420fbf37ec7d602c1f4975a332e
callback/src/main/java/com/iluwatar/callback/SimpleTask.java
callback/src/main/java/com/iluwatar/callback/SimpleTask.java
package com.iluwatar.callback; /** * * Implementation of task that need to be executed * */ public class SimpleTask extends Task { @Override public void execute() { System.out.println("Perform some important activity."); } }
package com.iluwatar.callback; /** * * Implementation of task that need to be executed * */ public class SimpleTask extends Task { @Override public void execute() { System.out.println("Perform some important activity and after call the callback method."); } }
Add unit test to show that the callback method is called.
Add unit test to show that the callback method is called.
Java
mit
zafarella/java-design-patterns,fluxw42/java-design-patterns,javaseeds/java-design-patterns,xl0139/player,miguelvelezmj25/java-design-patterns,coverxiaoeye/java-design-patterns,nake226/kouenji,colinbut/java-design-patterns,StefanHeimberg/java-design-patterns,alreadydead/testo,mookkiah/java-design-patterns,zik43/java-design-patterns,geniusgeek/java-design-patterns,mikulucky/java-design-patterns,mookkiah/java-design-patterns,nake226/kouenji,sunrenjie/java-design-patterns,ouyangxiangshao/java-design-patterns,janzoner/java-design-patterns,dlee0113/java-design-patterns,GeorgeMe/java-design-patterns,alreadydead/testo,DevFactory/java-design-patterns,SerhatSurguvec/java-design-patterns,sunrenjie/java-design-patterns,xl0139/player,Crossy147/java-design-patterns,SerhatSurguvec/java-design-patterns,mikulucky/java-design-patterns,ahujamoh/java-design-patterns,sunrenjie/java-design-patterns,geniusgeek/java-design-patterns,Crossy147/java-design-patterns,ahujamoh/java-design-patterns,hoswey/java-design-patterns,mikulucky/java-design-patterns,amit2103/java-design-patterns,colinbut/java-design-patterns,amit2103/java-design-patterns,GeorgeMe/java-design-patterns,miguelvelezmj25/java-design-patterns,DevFactory/java-design-patterns,SerhatSurguvec/java-design-patterns,krishansharma91/java-design-patterns,nake226/kouenji,mikulucky/java-design-patterns,cnswan/java-design-patterns,amit2103/java-design-patterns,xl0139/player,GeorgeMe/java-design-patterns,prakashd1/java-design-patterns,dlee0113/java-design-patterns,nake226/kouenji,javaseeds/java-design-patterns,WeRockStar/java-design-patterns,coverxiaoeye/java-design-patterns,keygod/java-design-patterns,inbreak/java-design-patterns,alreadydead/testo,prakashd1/java-design-patterns,cnswan/java-design-patterns,zik43/java-design-patterns,StefanHeimberg/java-design-patterns,radkrish/java-design-patterns,keygod/java-design-patterns,zik43/java-design-patterns,radkrish/java-design-patterns,radkrish/java-design-patterns,SerhatSurguvec/java-design-patterns,sunrenjie/java-design-patterns,krishansharma91/java-design-patterns,javaseeds/java-design-patterns,fluxw42/java-design-patterns,Crossy147/java-design-patterns,janzoner/java-design-patterns,kingland/java-design-patterns,DevFactory/java-design-patterns,kingland/java-design-patterns,mookkiah/java-design-patterns,janzoner/java-design-patterns,fluxw42/java-design-patterns,colinbut/java-design-patterns,ahujamoh/java-design-patterns,radkrish/java-design-patterns,prakashd1/java-design-patterns,Sumu-Ning/java-design-patterns,keygod/java-design-patterns,ouyangxiangshao/java-design-patterns,ouyangxiangshao/java-design-patterns,ouyangxiangshao/java-design-patterns,alreadydead/testo,hoswey/java-design-patterns,fluxw42/java-design-patterns,WeRockStar/java-design-patterns,StefanHeimberg/java-design-patterns,radkrish/java-design-patterns,inbreak/java-design-patterns,keygod/java-design-patterns,xl0139/player,Sumu-Ning/java-design-patterns,prakashd1/java-design-patterns,inbreak/java-design-patterns,zik43/java-design-patterns,zik43/java-design-patterns,Sumu-Ning/java-design-patterns,inbreak/java-design-patterns,geniusgeek/java-design-patterns,zafarella/java-design-patterns,hoswey/java-design-patterns,janzoner/java-design-patterns,geniusgeek/java-design-patterns,ahujamoh/java-design-patterns,hoswey/java-design-patterns,javaseeds/java-design-patterns,Crossy147/java-design-patterns,colinbut/java-design-patterns,dlee0113/java-design-patterns,kingland/java-design-patterns,miguelvelezmj25/java-design-patterns,1genius/java-design-patterns,coverxiaoeye/java-design-patterns,StefanHeimberg/java-design-patterns,Sumu-Ning/java-design-patterns,zafarella/java-design-patterns,Crossy147/java-design-patterns,amit2103/java-design-patterns,cnswan/java-design-patterns,WeRockStar/java-design-patterns,mikulucky/java-design-patterns,inbreak/java-design-patterns,mookkiah/java-design-patterns,kingland/java-design-patterns,GeorgeMe/java-design-patterns,geniusgeek/java-design-patterns,coverxiaoeye/java-design-patterns,dlee0113/java-design-patterns,krishansharma91/java-design-patterns,krishansharma91/java-design-patterns,zafarella/java-design-patterns,cnswan/java-design-patterns,nake226/kouenji,ahujamoh/java-design-patterns,miguelvelezmj25/java-design-patterns,DevFactory/java-design-patterns
java
## Code Before: package com.iluwatar.callback; /** * * Implementation of task that need to be executed * */ public class SimpleTask extends Task { @Override public void execute() { System.out.println("Perform some important activity."); } } ## Instruction: Add unit test to show that the callback method is called. ## Code After: package com.iluwatar.callback; /** * * Implementation of task that need to be executed * */ public class SimpleTask extends Task { @Override public void execute() { System.out.println("Perform some important activity and after call the callback method."); } }
package com.iluwatar.callback; /** * * Implementation of task that need to be executed * */ public class SimpleTask extends Task { @Override public void execute() { - System.out.println("Perform some important activity."); + System.out.println("Perform some important activity and after call the callback method."); ? +++++++++++++++++++++++++++++++++++ } }
2
0.133333
1
1
b2808409016b17b25f3c77cce9d567cd33aad904
test/everypolitician_index_test.rb
test/everypolitician_index_test.rb
require 'test_helper' class EverypoliticianIndexTest < Minitest::Test def test_country VCR.use_cassette('countries_json') do index = Everypolitician::Index.new australia = index.country('Australia') assert_equal 'Australia', australia.name assert_equal 'AU', australia.code assert_equal 2, australia.legislatures.size end end def test_country_with_sha VCR.use_cassette('countries_json@bc95a4a') do index = Everypolitician::Index.new('bc95a4a') sweden = index.country('Sweden') assert_equal 96_236, sweden.legislature('Riksdag').statement_count end end end
require 'test_helper' class EverypoliticianIndexTest < Minitest::Test def test_country VCR.use_cassette('countries_json') do index = Everypolitician::Index.new sweden = index.country('Sweden') assert_equal 94_415, sweden.legislature('Riksdag').statement_count end end def test_country_with_sha VCR.use_cassette('countries_json@bc95a4a') do index = Everypolitician::Index.new('bc95a4a') sweden = index.country('Sweden') assert_equal 96_236, sweden.legislature('Riksdag').statement_count end end end
Make it clear we're expecting different data for different SHAs
Make it clear we're expecting different data for different SHAs This makes the tests in everypolitician_index_test.rb similar to each other, so it's clearer that we're testing for the same thing against different version of the data.
Ruby
mit
everypolitician/everypolitician-ruby,everypolitician/everypolitician-ruby
ruby
## Code Before: require 'test_helper' class EverypoliticianIndexTest < Minitest::Test def test_country VCR.use_cassette('countries_json') do index = Everypolitician::Index.new australia = index.country('Australia') assert_equal 'Australia', australia.name assert_equal 'AU', australia.code assert_equal 2, australia.legislatures.size end end def test_country_with_sha VCR.use_cassette('countries_json@bc95a4a') do index = Everypolitician::Index.new('bc95a4a') sweden = index.country('Sweden') assert_equal 96_236, sweden.legislature('Riksdag').statement_count end end end ## Instruction: Make it clear we're expecting different data for different SHAs This makes the tests in everypolitician_index_test.rb similar to each other, so it's clearer that we're testing for the same thing against different version of the data. ## Code After: require 'test_helper' class EverypoliticianIndexTest < Minitest::Test def test_country VCR.use_cassette('countries_json') do index = Everypolitician::Index.new sweden = index.country('Sweden') assert_equal 94_415, sweden.legislature('Riksdag').statement_count end end def test_country_with_sha VCR.use_cassette('countries_json@bc95a4a') do index = Everypolitician::Index.new('bc95a4a') sweden = index.country('Sweden') assert_equal 96_236, sweden.legislature('Riksdag').statement_count end end end
require 'test_helper' class EverypoliticianIndexTest < Minitest::Test def test_country VCR.use_cassette('countries_json') do index = Everypolitician::Index.new + sweden = index.country('Sweden') + assert_equal 94_415, sweden.legislature('Riksdag').statement_count - australia = index.country('Australia') - assert_equal 'Australia', australia.name - assert_equal 'AU', australia.code - assert_equal 2, australia.legislatures.size end end def test_country_with_sha VCR.use_cassette('countries_json@bc95a4a') do index = Everypolitician::Index.new('bc95a4a') sweden = index.country('Sweden') assert_equal 96_236, sweden.legislature('Riksdag').statement_count end end end
6
0.285714
2
4
3040e1421007929b37bcacf73d1e585acc904249
spec/sse_spec.rb
spec/sse_spec.rb
$:.unshift "." require File.join(File.dirname(__FILE__), 'spec_helper') require 'sparql/spec' describe SPARQL::Grammar::Parser do describe "w3c dawg SPARQL evaluation tests" do SPARQL::Spec.load_sparql1_0_tests.group_by(&:manifest).each do |man, tests| describe man.to_s.split("/")[-2] do tests.each do |t| case t.type when MF.QueryEvaluationTest it "parses #{t.name} to correct SSE" do query = SPARQL::Grammar.parse(t.action.query_string) sse = SPARQL::Algebra.parse(t.action.sse_string) query.should == sse end else it "??? #{t.name}" do puts t.inspect fail "Unknown test type #{t.type}" end end end end end end end
$:.unshift "." require File.join(File.dirname(__FILE__), 'spec_helper') require 'sparql/spec' describe SPARQL::Grammar::Parser do describe "w3c dawg SPARQL tests to SSE" do SPARQL::Spec.load_sparql1_0_tests.group_by(&:manifest).each do |man, tests| describe man.to_s.split("/")[-2] do tests.each do |t| case t.type when MF.QueryEvaluationTest it "parses #{t.name} to correct SSE" do query = SPARQL::Grammar.parse(t.action.query_string) sse = SPARQL::Algebra.parse(t.action.sse_string) query.should == sse end it "parses #{t.name} to lexically equivalent SSE" do query = SPARQL::Grammar.parse(t.action.query_string) normalized_query = query.to_sxp. gsub(/\s+/m, " "). gsub(/\(\s+\(/, '(('). gsub(/\)\s+\)/, '))'). strip normalized_result = t.action.sse_string. gsub(/\s+/m, " "). gsub(/\(\s+\(/, '(('). gsub(/\)\s+\)/, '))'). strip normalized_query.should == normalized_result rescue pending("Lexical equivalence") end else it "??? #{t.name}" do puts t.inspect fail "Unknown test type #{t.type}" end end end end end end end
Test both lexical and object translation to SSE. Lexical tests that fail are made pending.
Test both lexical and object translation to SSE. Lexical tests that fail are made pending.
Ruby
unlicense
gkellogg/sparql-grammar
ruby
## Code Before: $:.unshift "." require File.join(File.dirname(__FILE__), 'spec_helper') require 'sparql/spec' describe SPARQL::Grammar::Parser do describe "w3c dawg SPARQL evaluation tests" do SPARQL::Spec.load_sparql1_0_tests.group_by(&:manifest).each do |man, tests| describe man.to_s.split("/")[-2] do tests.each do |t| case t.type when MF.QueryEvaluationTest it "parses #{t.name} to correct SSE" do query = SPARQL::Grammar.parse(t.action.query_string) sse = SPARQL::Algebra.parse(t.action.sse_string) query.should == sse end else it "??? #{t.name}" do puts t.inspect fail "Unknown test type #{t.type}" end end end end end end end ## Instruction: Test both lexical and object translation to SSE. Lexical tests that fail are made pending. ## Code After: $:.unshift "." require File.join(File.dirname(__FILE__), 'spec_helper') require 'sparql/spec' describe SPARQL::Grammar::Parser do describe "w3c dawg SPARQL tests to SSE" do SPARQL::Spec.load_sparql1_0_tests.group_by(&:manifest).each do |man, tests| describe man.to_s.split("/")[-2] do tests.each do |t| case t.type when MF.QueryEvaluationTest it "parses #{t.name} to correct SSE" do query = SPARQL::Grammar.parse(t.action.query_string) sse = SPARQL::Algebra.parse(t.action.sse_string) query.should == sse end it "parses #{t.name} to lexically equivalent SSE" do query = SPARQL::Grammar.parse(t.action.query_string) normalized_query = query.to_sxp. gsub(/\s+/m, " "). gsub(/\(\s+\(/, '(('). gsub(/\)\s+\)/, '))'). strip normalized_result = t.action.sse_string. gsub(/\s+/m, " "). gsub(/\(\s+\(/, '(('). gsub(/\)\s+\)/, '))'). strip normalized_query.should == normalized_result rescue pending("Lexical equivalence") end else it "??? #{t.name}" do puts t.inspect fail "Unknown test type #{t.type}" end end end end end end end
$:.unshift "." require File.join(File.dirname(__FILE__), 'spec_helper') require 'sparql/spec' describe SPARQL::Grammar::Parser do - describe "w3c dawg SPARQL evaluation tests" do ? ----------- + describe "w3c dawg SPARQL tests to SSE" do ? +++++++ SPARQL::Spec.load_sparql1_0_tests.group_by(&:manifest).each do |man, tests| describe man.to_s.split("/")[-2] do tests.each do |t| case t.type when MF.QueryEvaluationTest it "parses #{t.name} to correct SSE" do query = SPARQL::Grammar.parse(t.action.query_string) sse = SPARQL::Algebra.parse(t.action.sse_string) query.should == sse + end + + it "parses #{t.name} to lexically equivalent SSE" do + query = SPARQL::Grammar.parse(t.action.query_string) + normalized_query = query.to_sxp. + gsub(/\s+/m, " "). + gsub(/\(\s+\(/, '(('). + gsub(/\)\s+\)/, '))'). + strip + normalized_result = t.action.sse_string. + gsub(/\s+/m, " "). + gsub(/\(\s+\(/, '(('). + gsub(/\)\s+\)/, '))'). + strip + normalized_query.should == normalized_result rescue pending("Lexical equivalence") end else it "??? #{t.name}" do puts t.inspect fail "Unknown test type #{t.type}" end end end end end end end
17
0.62963
16
1
6f9a2ef636c8ac5272de15ddfeb7c80b3bd00246
test/test_arena.py
test/test_arena.py
from support import lib,ffi from qcgc_test import QCGCTest class ArenaTestCase(QCGCTest): def test_size_calculations(self): exp = lib.QCGC_ARENA_SIZE_EXP size = 2**exp bitmap = size / 128 cells = (size - 2 * bitmap) / 16 self.assertEqual(size, lib.qcgc_arena_size) self.assertEqual(bitmap, lib.qcgc_arena_bitmap_size) self.assertEqual(cells, lib.qcgc_arena_cells_count)
from support import lib,ffi from qcgc_test import QCGCTest class ArenaTestCase(QCGCTest): def test_size_calculations(self): exp = lib.QCGC_ARENA_SIZE_EXP size = 2**exp bitmap = size / 128 cells = size / 16 self.assertEqual(size, lib.qcgc_arena_size) self.assertEqual(bitmap, lib.qcgc_arena_bitmap_size) self.assertEqual(cells, lib.qcgc_arena_cells_count)
Fix wrong cell count calculation
Fix wrong cell count calculation
Python
mit
ntruessel/qcgc,ntruessel/qcgc,ntruessel/qcgc
python
## Code Before: from support import lib,ffi from qcgc_test import QCGCTest class ArenaTestCase(QCGCTest): def test_size_calculations(self): exp = lib.QCGC_ARENA_SIZE_EXP size = 2**exp bitmap = size / 128 cells = (size - 2 * bitmap) / 16 self.assertEqual(size, lib.qcgc_arena_size) self.assertEqual(bitmap, lib.qcgc_arena_bitmap_size) self.assertEqual(cells, lib.qcgc_arena_cells_count) ## Instruction: Fix wrong cell count calculation ## Code After: from support import lib,ffi from qcgc_test import QCGCTest class ArenaTestCase(QCGCTest): def test_size_calculations(self): exp = lib.QCGC_ARENA_SIZE_EXP size = 2**exp bitmap = size / 128 cells = size / 16 self.assertEqual(size, lib.qcgc_arena_size) self.assertEqual(bitmap, lib.qcgc_arena_bitmap_size) self.assertEqual(cells, lib.qcgc_arena_cells_count)
from support import lib,ffi from qcgc_test import QCGCTest class ArenaTestCase(QCGCTest): def test_size_calculations(self): exp = lib.QCGC_ARENA_SIZE_EXP size = 2**exp bitmap = size / 128 - cells = (size - 2 * bitmap) / 16 ? - -------------- + cells = size / 16 self.assertEqual(size, lib.qcgc_arena_size) self.assertEqual(bitmap, lib.qcgc_arena_bitmap_size) self.assertEqual(cells, lib.qcgc_arena_cells_count)
2
0.166667
1
1
d510fed53a550fb73540d402eadd0508d8f0db39
src/render.js
src/render.js
export default function render(vnode, parent) { if (typeof vnode==='string') return document.createTextNode(vnode); let n = document.createElement(vnode.nodeName); let a = vnode.attributes || {}; Object.keys(a).forEach( k => n.setAttribute(k, a[k]) ); (vnode.children || []).forEach( c => n.appendChild(render(c)) ); parent.appendChild(n); return n; }
export default function render(vnode, parent) { if (typeof vnode==='string') return document.createTextNode(vnode); if (typeof vnode === 'function') vnode = vnode(); let n = document.createElement(vnode.nodeName); let a = vnode.attributes || {}; Object.keys(a).forEach( k => n.setAttribute(k, a[k]) ); (vnode.children || []).forEach( c => n.appendChild(render(c)) ); parent.appendChild(n); return n; }
Check if vnode is function
Check if vnode is function
JavaScript
mit
liferay-labs-br/fiber
javascript
## Code Before: export default function render(vnode, parent) { if (typeof vnode==='string') return document.createTextNode(vnode); let n = document.createElement(vnode.nodeName); let a = vnode.attributes || {}; Object.keys(a).forEach( k => n.setAttribute(k, a[k]) ); (vnode.children || []).forEach( c => n.appendChild(render(c)) ); parent.appendChild(n); return n; } ## Instruction: Check if vnode is function ## Code After: export default function render(vnode, parent) { if (typeof vnode==='string') return document.createTextNode(vnode); if (typeof vnode === 'function') vnode = vnode(); let n = document.createElement(vnode.nodeName); let a = vnode.attributes || {}; Object.keys(a).forEach( k => n.setAttribute(k, a[k]) ); (vnode.children || []).forEach( c => n.appendChild(render(c)) ); parent.appendChild(n); return n; }
export default function render(vnode, parent) { if (typeof vnode==='string') return document.createTextNode(vnode); + + if (typeof vnode === 'function') vnode = vnode(); let n = document.createElement(vnode.nodeName); let a = vnode.attributes || {}; Object.keys(a).forEach( k => n.setAttribute(k, a[k]) ); (vnode.children || []).forEach( c => n.appendChild(render(c)) ); parent.appendChild(n); return n; }
2
0.142857
2
0
7fc818339a2a8591df035c45664a4162cb0108d7
bika/lims/skins/bika/bika_widgets/datetimewidget.js
bika/lims/skins/bika/bika_widgets/datetimewidget.js
jQuery( function($) { $(document).ready(function(){ dateFormat = window.jsi18n_bika('date_format_short_datepicker'); $('[datepicker=1]').datepicker({ dateFormat: dateFormat, changeMonth:true, changeYear:true }); }); });
jQuery( function($) { $(document).ready(function(){ dateFormat = window.jsi18n_bika('date_format_short_datepicker'); $('[datepicker=1]').datepicker({ dateFormat: dateFormat, changeMonth:true, changeYear:true, yearRange: "-100:+1" }); }); });
Add Month/Year selectors to default datetime widget
Add Month/Year selectors to default datetime widget
JavaScript
agpl-3.0
labsanmartin/Bika-LIMS,rockfruit/bika.lims,anneline/Bika-LIMS,veroc/Bika-LIMS,veroc/Bika-LIMS,rockfruit/bika.lims,veroc/Bika-LIMS,DeBortoliWines/Bika-LIMS,anneline/Bika-LIMS,anneline/Bika-LIMS,DeBortoliWines/Bika-LIMS,labsanmartin/Bika-LIMS,labsanmartin/Bika-LIMS,DeBortoliWines/Bika-LIMS
javascript
## Code Before: jQuery( function($) { $(document).ready(function(){ dateFormat = window.jsi18n_bika('date_format_short_datepicker'); $('[datepicker=1]').datepicker({ dateFormat: dateFormat, changeMonth:true, changeYear:true }); }); }); ## Instruction: Add Month/Year selectors to default datetime widget ## Code After: jQuery( function($) { $(document).ready(function(){ dateFormat = window.jsi18n_bika('date_format_short_datepicker'); $('[datepicker=1]').datepicker({ dateFormat: dateFormat, changeMonth:true, changeYear:true, yearRange: "-100:+1" }); }); });
jQuery( function($) { $(document).ready(function(){ dateFormat = window.jsi18n_bika('date_format_short_datepicker'); $('[datepicker=1]').datepicker({ dateFormat: dateFormat, changeMonth:true, - changeYear:true + changeYear:true, ? + + yearRange: "-100:+1" }); }); });
3
0.3
2
1
8b90fccf0a40ee30b2bad5eac21275d9a841760b
app/views/proof_attempts/index.html.haml
app/views/proof_attempts/index.html.haml
= repository_nav ontology.repository, :ontologies = ontology_nav ontology, :theorems %h3 = link_to theorem, locid_for(theorem) = render partial: 'theorems/proof_status', locals: {proof_status: theorem.proof_status} %h4 Proof Attempts = link_to t('theorems.show.prove'), [*resource_chain, theorem, :proofs, :new], class: 'btn btn-primary' - if collection.empty? = t('theorems.show.proof_attemps_empty') - else %table %thead %tr %th Number %th Status %th Date %th Time taken %th Prover %th State - collection.latest.each do |proof_attempt| %tr %td= link_to proof_attempt.number, proof_attempt.locid %td= render partial: 'theorems/proof_status', locals: {proof_status: proof_attempt.proof_status} %td = link_to proof_attempt.locid do %span.timestamp= proof_attempt.created_at %td = proof_attempt.time_taken = t('proof_attempts.show.seconds') %td= proof_attempt.prover %td= state_tag(proof_attempt)
= repository_nav ontology.repository, :ontologies = ontology_nav ontology, :theorems %h3 = link_to theorem, locid_for(theorem) = render partial: 'theorems/proof_status', locals: {proof_status: theorem.proof_status} %h4 Proof Attempts = link_to t('theorems.show.prove'), [*resource_chain, theorem, :proofs, :new], class: 'btn btn-primary' - if collection.empty? = t('theorems.show.proof_attemps_empty') - else %table %thead %tr %th Number %th Date %th Time taken %th Prover %th Status %th State - collection.latest.each do |proof_attempt| %tr %td= link_to proof_attempt.number, proof_attempt.locid %td = link_to proof_attempt.locid do %span.timestamp= proof_attempt.created_at %td = proof_attempt.time_taken = t('proof_attempts.show.seconds') %td= proof_attempt.prover %td= render partial: 'theorems/proof_status', locals: {proof_status: proof_attempt.proof_status} %td= state_tag(proof_attempt)
Move status column to the right
Move status column to the right Now we are consistent with the theorems index view.
Haml
agpl-3.0
ontohub/ontohub,ontohub/ontohub,ontohub/ontohub,ontohub/ontohub,ontohub/ontohub,ontohub/ontohub
haml
## Code Before: = repository_nav ontology.repository, :ontologies = ontology_nav ontology, :theorems %h3 = link_to theorem, locid_for(theorem) = render partial: 'theorems/proof_status', locals: {proof_status: theorem.proof_status} %h4 Proof Attempts = link_to t('theorems.show.prove'), [*resource_chain, theorem, :proofs, :new], class: 'btn btn-primary' - if collection.empty? = t('theorems.show.proof_attemps_empty') - else %table %thead %tr %th Number %th Status %th Date %th Time taken %th Prover %th State - collection.latest.each do |proof_attempt| %tr %td= link_to proof_attempt.number, proof_attempt.locid %td= render partial: 'theorems/proof_status', locals: {proof_status: proof_attempt.proof_status} %td = link_to proof_attempt.locid do %span.timestamp= proof_attempt.created_at %td = proof_attempt.time_taken = t('proof_attempts.show.seconds') %td= proof_attempt.prover %td= state_tag(proof_attempt) ## Instruction: Move status column to the right Now we are consistent with the theorems index view. ## Code After: = repository_nav ontology.repository, :ontologies = ontology_nav ontology, :theorems %h3 = link_to theorem, locid_for(theorem) = render partial: 'theorems/proof_status', locals: {proof_status: theorem.proof_status} %h4 Proof Attempts = link_to t('theorems.show.prove'), [*resource_chain, theorem, :proofs, :new], class: 'btn btn-primary' - if collection.empty? = t('theorems.show.proof_attemps_empty') - else %table %thead %tr %th Number %th Date %th Time taken %th Prover %th Status %th State - collection.latest.each do |proof_attempt| %tr %td= link_to proof_attempt.number, proof_attempt.locid %td = link_to proof_attempt.locid do %span.timestamp= proof_attempt.created_at %td = proof_attempt.time_taken = t('proof_attempts.show.seconds') %td= proof_attempt.prover %td= render partial: 'theorems/proof_status', locals: {proof_status: proof_attempt.proof_status} %td= state_tag(proof_attempt)
= repository_nav ontology.repository, :ontologies = ontology_nav ontology, :theorems %h3 = link_to theorem, locid_for(theorem) = render partial: 'theorems/proof_status', locals: {proof_status: theorem.proof_status} %h4 Proof Attempts = link_to t('theorems.show.prove'), [*resource_chain, theorem, :proofs, :new], class: 'btn btn-primary' - if collection.empty? = t('theorems.show.proof_attemps_empty') - else %table %thead %tr %th Number - %th Status %th Date %th Time taken %th Prover + %th Status %th State - collection.latest.each do |proof_attempt| %tr %td= link_to proof_attempt.number, proof_attempt.locid - %td= render partial: 'theorems/proof_status', locals: {proof_status: proof_attempt.proof_status} %td = link_to proof_attempt.locid do %span.timestamp= proof_attempt.created_at %td = proof_attempt.time_taken = t('proof_attempts.show.seconds') %td= proof_attempt.prover + %td= render partial: 'theorems/proof_status', locals: {proof_status: proof_attempt.proof_status} %td= state_tag(proof_attempt)
4
0.117647
2
2
5bb4c61e9950de4c8c000a4ab02b0c901e0b06ff
version.py
version.py
import imp import os import subprocess def get_project_version(version_file): version_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), version_file) try: module = imp.load_source("verfile", version_file) file_ver = module.__version__ except: # pylint: disable=bare-except file_ver = None try: proc = subprocess.Popen(["git", "describe", "--always"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, _ = proc.communicate() if stdout: git_ver = stdout.splitlines()[0].strip().decode("utf-8") if git_ver and ((git_ver != file_ver) or not file_ver): open(version_file, "w").write("__version__ = '%s'\n" % git_ver) return git_ver except OSError: pass if not file_ver: raise Exception("version not available from git or from file %r" % version_file) return file_ver if __name__ == "__main__": import sys get_project_version(sys.argv[1])
import importlib import os import subprocess def get_project_version(version_file): version_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), version_file) try: module = importlib.load_module(version_file) file_ver = module.__version__ except: # pylint: disable=bare-except file_ver = None try: proc = subprocess.Popen(["git", "describe", "--always"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, _ = proc.communicate() if stdout: git_ver = stdout.splitlines()[0].strip().decode("utf-8") if git_ver and ((git_ver != file_ver) or not file_ver): open(version_file, "w").write("__version__ = '%s'\n" % git_ver) return git_ver except OSError: pass if not file_ver: raise Exception("version not available from git or from file %r" % version_file) return file_ver if __name__ == "__main__": import sys get_project_version(sys.argv[1])
Migrate from deprecated imp to importlib
Migrate from deprecated imp to importlib
Python
apache-2.0
aiven/aiven-client
python
## Code Before: import imp import os import subprocess def get_project_version(version_file): version_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), version_file) try: module = imp.load_source("verfile", version_file) file_ver = module.__version__ except: # pylint: disable=bare-except file_ver = None try: proc = subprocess.Popen(["git", "describe", "--always"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, _ = proc.communicate() if stdout: git_ver = stdout.splitlines()[0].strip().decode("utf-8") if git_ver and ((git_ver != file_ver) or not file_ver): open(version_file, "w").write("__version__ = '%s'\n" % git_ver) return git_ver except OSError: pass if not file_ver: raise Exception("version not available from git or from file %r" % version_file) return file_ver if __name__ == "__main__": import sys get_project_version(sys.argv[1]) ## Instruction: Migrate from deprecated imp to importlib ## Code After: import importlib import os import subprocess def get_project_version(version_file): version_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), version_file) try: module = importlib.load_module(version_file) file_ver = module.__version__ except: # pylint: disable=bare-except file_ver = None try: proc = subprocess.Popen(["git", "describe", "--always"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, _ = proc.communicate() if stdout: git_ver = stdout.splitlines()[0].strip().decode("utf-8") if git_ver and ((git_ver != file_ver) or not file_ver): open(version_file, "w").write("__version__ = '%s'\n" % git_ver) return git_ver except OSError: pass if not file_ver: raise Exception("version not available from git or from file %r" % version_file) return file_ver if __name__ == "__main__": import sys get_project_version(sys.argv[1])
- import imp + import importlib ? ++++++ import os import subprocess def get_project_version(version_file): version_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), version_file) try: - module = imp.load_source("verfile", version_file) ? ^ ^^ ----------- + module = importlib.load_module(version_file) ? ++++++ ^ + ^ file_ver = module.__version__ except: # pylint: disable=bare-except file_ver = None try: proc = subprocess.Popen(["git", "describe", "--always"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, _ = proc.communicate() if stdout: git_ver = stdout.splitlines()[0].strip().decode("utf-8") if git_ver and ((git_ver != file_ver) or not file_ver): open(version_file, "w").write("__version__ = '%s'\n" % git_ver) return git_ver except OSError: pass if not file_ver: raise Exception("version not available from git or from file %r" % version_file) return file_ver if __name__ == "__main__": import sys get_project_version(sys.argv[1])
4
0.108108
2
2
b61679efce39841120fcdb921acefbc729f4c4fd
tests/test_kmeans.py
tests/test_kmeans.py
import numpy as np import milk.unsupervised def test_kmeans(): features = np.r_[np.random.rand(20,3)-.5,.5+np.random.rand(20,3)] centroids, _ = milk.unsupervised.kmeans(features,2) positions = [0]*20 + [1]*20 correct = (centroids == positions).sum() assert correct >= 38 or correct <= 2
import numpy as np import milk.unsupervised def test_kmeans(): np.random.seed(132) features = np.r_[np.random.rand(20,3)-.5,.5+np.random.rand(20,3)] centroids, _ = milk.unsupervised.kmeans(features,2) positions = [0]*20 + [1]*20 correct = (centroids == positions).sum() assert correct >= 38 or correct <= 2 def test_kmeans_centroids(): np.random.seed(132) features = np.random.rand(201,30) for k in [2,3,5,10]: indices,centroids = milk.unsupervised.kmeans(features, k) for i in xrange(k): assert np.allclose(centroids[i], features[indices == i].mean(0))
Make sure results make sense
Make sure results make sense
Python
mit
luispedro/milk,pombredanne/milk,luispedro/milk,pombredanne/milk,luispedro/milk,pombredanne/milk
python
## Code Before: import numpy as np import milk.unsupervised def test_kmeans(): features = np.r_[np.random.rand(20,3)-.5,.5+np.random.rand(20,3)] centroids, _ = milk.unsupervised.kmeans(features,2) positions = [0]*20 + [1]*20 correct = (centroids == positions).sum() assert correct >= 38 or correct <= 2 ## Instruction: Make sure results make sense ## Code After: import numpy as np import milk.unsupervised def test_kmeans(): np.random.seed(132) features = np.r_[np.random.rand(20,3)-.5,.5+np.random.rand(20,3)] centroids, _ = milk.unsupervised.kmeans(features,2) positions = [0]*20 + [1]*20 correct = (centroids == positions).sum() assert correct >= 38 or correct <= 2 def test_kmeans_centroids(): np.random.seed(132) features = np.random.rand(201,30) for k in [2,3,5,10]: indices,centroids = milk.unsupervised.kmeans(features, k) for i in xrange(k): assert np.allclose(centroids[i], features[indices == i].mean(0))
import numpy as np import milk.unsupervised def test_kmeans(): + np.random.seed(132) features = np.r_[np.random.rand(20,3)-.5,.5+np.random.rand(20,3)] centroids, _ = milk.unsupervised.kmeans(features,2) positions = [0]*20 + [1]*20 correct = (centroids == positions).sum() assert correct >= 38 or correct <= 2 + + def test_kmeans_centroids(): + np.random.seed(132) + features = np.random.rand(201,30) + for k in [2,3,5,10]: + indices,centroids = milk.unsupervised.kmeans(features, k) + for i in xrange(k): + assert np.allclose(centroids[i], features[indices == i].mean(0)) +
10
1.111111
10
0
eff6a854a078928b3534c57726000629cc644c56
src/uxbox/data/core.cljs
src/uxbox/data/core.cljs
;; This Source Code Form is subject to the terms of the Mozilla Public ;; License, v. 2.0. If a copy of the MPL was not distributed with this ;; file, You can obtain one at http://mozilla.org/MPL/2.0/. ;; ;; Copyright (c) 2016 Andrey Antukh <[email protected]> (ns uxbox.data.core "Worker related api and initialization events." (:require [beicon.core :as rx] [uxbox.rstore :as rs] [uxbox.constants :as c] [uxbox.util.workers :as uw])) (defonce worker (uw/init "/js/worker.js"))
;; This Source Code Form is subject to the terms of the Mozilla Public ;; License, v. 2.0. If a copy of the MPL was not distributed with this ;; file, You can obtain one at http://mozilla.org/MPL/2.0/. ;; ;; Copyright (c) 2016 Andrey Antukh <[email protected]> (ns uxbox.data.core "Worker related api and initialization events." (:require [beicon.core :as rx] [uxbox.rstore :as rs] [uxbox.constants :as c] [uxbox.util.workers :as uw])) ;; This excludes webworker instantiation on nodejs where ;; the tests are run. (when (not= *target* "nodejs") (defonce worker (uw/init "/js/worker.js")))
Initialize webworker only on browser environment.
Initialize webworker only on browser environment.
Clojure
mpl-2.0
studiospring/uxbox,studiospring/uxbox,studiospring/uxbox,uxbox/uxbox,uxbox/uxbox,uxbox/uxbox
clojure
## Code Before: ;; This Source Code Form is subject to the terms of the Mozilla Public ;; License, v. 2.0. If a copy of the MPL was not distributed with this ;; file, You can obtain one at http://mozilla.org/MPL/2.0/. ;; ;; Copyright (c) 2016 Andrey Antukh <[email protected]> (ns uxbox.data.core "Worker related api and initialization events." (:require [beicon.core :as rx] [uxbox.rstore :as rs] [uxbox.constants :as c] [uxbox.util.workers :as uw])) (defonce worker (uw/init "/js/worker.js")) ## Instruction: Initialize webworker only on browser environment. ## Code After: ;; This Source Code Form is subject to the terms of the Mozilla Public ;; License, v. 2.0. If a copy of the MPL was not distributed with this ;; file, You can obtain one at http://mozilla.org/MPL/2.0/. ;; ;; Copyright (c) 2016 Andrey Antukh <[email protected]> (ns uxbox.data.core "Worker related api and initialization events." (:require [beicon.core :as rx] [uxbox.rstore :as rs] [uxbox.constants :as c] [uxbox.util.workers :as uw])) ;; This excludes webworker instantiation on nodejs where ;; the tests are run. (when (not= *target* "nodejs") (defonce worker (uw/init "/js/worker.js")))
;; This Source Code Form is subject to the terms of the Mozilla Public ;; License, v. 2.0. If a copy of the MPL was not distributed with this ;; file, You can obtain one at http://mozilla.org/MPL/2.0/. ;; ;; Copyright (c) 2016 Andrey Antukh <[email protected]> (ns uxbox.data.core "Worker related api and initialization events." (:require [beicon.core :as rx] [uxbox.rstore :as rs] [uxbox.constants :as c] [uxbox.util.workers :as uw])) - (defonce worker (uw/init "/js/worker.js")) + ;; This excludes webworker instantiation on nodejs where + ;; the tests are run. + (when (not= *target* "nodejs") + (defonce worker (uw/init "/js/worker.js"))) +
6
0.4
5
1
6bde609df776fbee05e8e3d42199f38004db2a18
README.md
README.md
Provides a browser-based artisan console for your application. ## Warning! **This addon is insecure by default! You need to secure the endpoints or strangers _will_ execute commands on your application.** ## Configuration Add the ServiceProvider to `config/app.php`: ```php CedricZiel\Webartisan\WebartisanServiceProvider:class, ``` Now you need to override the routes shipped by the plugin, to secure them with a middleware of your choice. Here's an example to secure the endpoints with the `auth` middleware: ```php use CedricZiel\Webartisan\Http\Controllers\WebartisanController; // Application routes ... /** * Maintenance routes. */ Route::get('artisan', [ 'as' => 'artisan', 'middleware' => 'auth', 'uses' => WebartisanController::class . '@show' ]); Route::post('artisan', [ 'as' => 'artisan', 'middleware' => 'auth', 'uses' => WebartisanController::class . '@execute' ]); ``` ## License & Credits This library is based on the work of Ron Shpasser (https://github.com/shpasser/GaeSupportL5). This library is licensed under the MIT License.
Provides a browser-based artisan console for your application. ## Warning! **This addon is insecure by default! You need to secure the endpoints or strangers _will_ execute commands on your application.** ## Configuration Add the ServiceProvider to `config/app.php`: ```php CedricZiel\Webartisan\WebartisanServiceProvider:class, ``` Now you need to override the routes shipped by the plugin, to secure them with a middleware of your choice. Here's an example to secure the endpoints with the `auth` middleware (`app/Providers/RouteServiceProvider`): ```php /** * Define the routes for the application. * * @param \Illuminate\Routing\Router $router * * @return void */ public function map(Router $router) { $router->group(['namespace' => $this->namespace], function ($router) { require app_path('Http/routes.php'); }); /** * Webartisan routes */ $router->group([ 'namespace' => '\CedricZiel\Webartisan\Http\Controllers', 'middleware' => ['web', 'auth'] ], function ($router) { Route::get('artisan', [ 'as' => 'artisan', 'middleware' => 'auth', 'uses' => 'WebartisanController@show' ]); Route::post('artisan', [ 'as' => 'artisan', 'middleware' => 'auth', 'uses' => 'WebartisanController@execute' ]); }); } ``` ## License & Credits This library is based on the work of Ron Shpasser (https://github.com/shpasser/GaeSupportL5). This library is licensed under the MIT License.
Add correct instructions for installing the library
[TASK] Add correct instructions for installing the library
Markdown
mit
cedricziel/l5-webartisan
markdown
## Code Before: Provides a browser-based artisan console for your application. ## Warning! **This addon is insecure by default! You need to secure the endpoints or strangers _will_ execute commands on your application.** ## Configuration Add the ServiceProvider to `config/app.php`: ```php CedricZiel\Webartisan\WebartisanServiceProvider:class, ``` Now you need to override the routes shipped by the plugin, to secure them with a middleware of your choice. Here's an example to secure the endpoints with the `auth` middleware: ```php use CedricZiel\Webartisan\Http\Controllers\WebartisanController; // Application routes ... /** * Maintenance routes. */ Route::get('artisan', [ 'as' => 'artisan', 'middleware' => 'auth', 'uses' => WebartisanController::class . '@show' ]); Route::post('artisan', [ 'as' => 'artisan', 'middleware' => 'auth', 'uses' => WebartisanController::class . '@execute' ]); ``` ## License & Credits This library is based on the work of Ron Shpasser (https://github.com/shpasser/GaeSupportL5). This library is licensed under the MIT License. ## Instruction: [TASK] Add correct instructions for installing the library ## Code After: Provides a browser-based artisan console for your application. ## Warning! **This addon is insecure by default! You need to secure the endpoints or strangers _will_ execute commands on your application.** ## Configuration Add the ServiceProvider to `config/app.php`: ```php CedricZiel\Webartisan\WebartisanServiceProvider:class, ``` Now you need to override the routes shipped by the plugin, to secure them with a middleware of your choice. Here's an example to secure the endpoints with the `auth` middleware (`app/Providers/RouteServiceProvider`): ```php /** * Define the routes for the application. * * @param \Illuminate\Routing\Router $router * * @return void */ public function map(Router $router) { $router->group(['namespace' => $this->namespace], function ($router) { require app_path('Http/routes.php'); }); /** * Webartisan routes */ $router->group([ 'namespace' => '\CedricZiel\Webartisan\Http\Controllers', 'middleware' => ['web', 'auth'] ], function ($router) { Route::get('artisan', [ 'as' => 'artisan', 'middleware' => 'auth', 'uses' => 'WebartisanController@show' ]); Route::post('artisan', [ 'as' => 'artisan', 'middleware' => 'auth', 'uses' => 'WebartisanController@execute' ]); }); } ``` ## License & Credits This library is based on the work of Ron Shpasser (https://github.com/shpasser/GaeSupportL5). This library is licensed under the MIT License.
Provides a browser-based artisan console for your application. ## Warning! **This addon is insecure by default! You need to secure the endpoints or strangers _will_ execute commands on your application.** ## Configuration Add the ServiceProvider to `config/app.php`: ```php CedricZiel\Webartisan\WebartisanServiceProvider:class, ``` Now you need to override the routes shipped by the plugin, to secure them with a middleware of your choice. - Here's an example to secure the endpoints with the `auth` middleware: + Here's an example to secure the endpoints with the `auth` middleware (`app/Providers/RouteServiceProvider`): ? +++++++++++++++++++++++++++++++++++++++ ```php - use CedricZiel\Webartisan\Http\Controllers\WebartisanController; + /** + * Define the routes for the application. + * + * @param \Illuminate\Routing\Router $router + * + * @return void + */ + public function map(Router $router) + { + $router->group(['namespace' => $this->namespace], function ($router) { + require app_path('Http/routes.php'); + }); - // Application routes ... + /** + * Webartisan routes + */ + $router->group([ + 'namespace' => '\CedricZiel\Webartisan\Http\Controllers', + 'middleware' => ['web', 'auth'] + ], function ($router) { + Route::get('artisan', [ + 'as' => 'artisan', + 'middleware' => 'auth', + 'uses' => 'WebartisanController@show' + ]); + Route::post('artisan', [ + 'as' => 'artisan', - /** - * Maintenance routes. - */ - Route::get('artisan', [ - 'as' => 'artisan', - 'middleware' => 'auth', + 'middleware' => 'auth', ? ++++++++++++ + 'uses' => 'WebartisanController@execute' + ]); + }); + } - 'uses' => WebartisanController::class . '@show' - ]); - - Route::post('artisan', [ - 'as' => 'artisan', - 'middleware' => 'auth', - 'uses' => WebartisanController::class . '@execute' - ]); ``` ## License & Credits This library is based on the work of Ron Shpasser (https://github.com/shpasser/GaeSupportL5). This library is licensed under the MIT License.
49
1.065217
32
17
e5d9bf133118d4b2952af6d029c3af5313737778
lib/nearest_time_zone.rb
lib/nearest_time_zone.rb
require "csv" require "kdtree" require "require_all" require_rel "./nearest_time_zone" module NearestTimeZone def self.to(latitude, longitude) nearest_city = City.nearest(latitude, longitude) nearest_city.time_zone.name end def self.dump Dump.dump puts "dumped!" end end # load the kdtree so that everything is fast NearestTimeZone::City.kdtree
require "csv" require "kdtree" require "require_all" require_rel "./nearest_time_zone" module NearestTimeZone def self.to(latitude, longitude) nearest_city = City.nearest(latitude, longitude) if nearest_city.present? nearest_city.time_zone.name end end def self.dump Dump.dump puts "dumped!" end end # load the kdtree so that everything is fast NearestTimeZone::City.kdtree
Check if values are nil
Check if values are nil
Ruby
mit
togglepro/nearest_time_zone
ruby
## Code Before: require "csv" require "kdtree" require "require_all" require_rel "./nearest_time_zone" module NearestTimeZone def self.to(latitude, longitude) nearest_city = City.nearest(latitude, longitude) nearest_city.time_zone.name end def self.dump Dump.dump puts "dumped!" end end # load the kdtree so that everything is fast NearestTimeZone::City.kdtree ## Instruction: Check if values are nil ## Code After: require "csv" require "kdtree" require "require_all" require_rel "./nearest_time_zone" module NearestTimeZone def self.to(latitude, longitude) nearest_city = City.nearest(latitude, longitude) if nearest_city.present? nearest_city.time_zone.name end end def self.dump Dump.dump puts "dumped!" end end # load the kdtree so that everything is fast NearestTimeZone::City.kdtree
require "csv" require "kdtree" require "require_all" require_rel "./nearest_time_zone" module NearestTimeZone def self.to(latitude, longitude) nearest_city = City.nearest(latitude, longitude) + if nearest_city.present? - nearest_city.time_zone.name + nearest_city.time_zone.name ? ++ + end end def self.dump Dump.dump puts "dumped!" end end # load the kdtree so that everything is fast NearestTimeZone::City.kdtree
4
0.190476
3
1
4d29682dd17cf2e3103377ee4db42a648d4e1d79
grooves-api/src/main/groovy/com/github/rahulsom/grooves/api/EventsDsl.groovy
grooves-api/src/main/groovy/com/github/rahulsom/grooves/api/EventsDsl.groovy
package com.github.rahulsom.grooves.api import java.util.concurrent.atomic.AtomicLong import java.util.function.Consumer import java.util.function.Supplier /** * DSL to simplify writing code with Events */ class EventsDsl { static AtomicLong defaultPositionSupplier = new AtomicLong() static class OnSpec<A extends AggregateType, E extends BaseEvent<A, E>> { A aggregate Consumer<E> eventConsumer Supplier<Date> dateSupplier Supplier<String> userSupplier Supplier<Long> positionSupplier void apply(E event) { event.aggregate = aggregate event.createdBy = userSupplier.get() event.position = positionSupplier.get() event.date = dateSupplier.get() eventConsumer.accept(event) } } static <A extends AggregateType, E extends BaseEvent<A, E>> void on( A aggregate, Consumer<E> eventConsumer, Supplier<Long> positionSupplier = { defaultPositionSupplier.incrementAndGet() }, Supplier<String> userSupplier = { 'anonymous' }, Supplier<Date> dateSupplier = { new Date() }, @DelegatesTo(OnSpec) Closure closure) { closure.resolveStrategy = Closure.DELEGATE_FIRST closure.delegate = new OnSpec( aggregate: aggregate, eventConsumer: eventConsumer, userSupplier: userSupplier, dateSupplier: dateSupplier, positionSupplier: positionSupplier ) closure.call() } }
package com.github.rahulsom.grooves.api import java.util.concurrent.atomic.AtomicLong import java.util.function.Consumer import java.util.function.Supplier /** * DSL to simplify writing code with Events */ class EventsDsl { static AtomicLong defaultPositionSupplier = new AtomicLong() static class OnSpec<A extends AggregateType, E extends BaseEvent<A, E>> { A aggregate Consumer<E> eventConsumer Supplier<Date> dateSupplier Supplier<String> userSupplier Supplier<Long> positionSupplier void apply(E event) { event.aggregate = aggregate if (!event.createdBy) event.createdBy = userSupplier.get() if (!event.position) event.position = positionSupplier.get() if (!event.date) event.date = dateSupplier.get() eventConsumer.accept(event) } } static <A extends AggregateType, E extends BaseEvent<A, E>> void on( A aggregate, Consumer<E> eventConsumer, Supplier<Long> positionSupplier = { defaultPositionSupplier.incrementAndGet() }, Supplier<String> userSupplier = { 'anonymous' }, Supplier<Date> dateSupplier = { new Date() }, @DelegatesTo(OnSpec) Closure closure) { closure.resolveStrategy = Closure.DELEGATE_FIRST closure.delegate = new OnSpec( aggregate: aggregate, eventConsumer: eventConsumer, userSupplier: userSupplier, dateSupplier: dateSupplier, positionSupplier: positionSupplier ) closure.call() } }
Allow override in event dsl
Allow override in event dsl
Groovy
apache-2.0
rahulsom/grooves,rahulsom/grooves,rahulsom/grooves
groovy
## Code Before: package com.github.rahulsom.grooves.api import java.util.concurrent.atomic.AtomicLong import java.util.function.Consumer import java.util.function.Supplier /** * DSL to simplify writing code with Events */ class EventsDsl { static AtomicLong defaultPositionSupplier = new AtomicLong() static class OnSpec<A extends AggregateType, E extends BaseEvent<A, E>> { A aggregate Consumer<E> eventConsumer Supplier<Date> dateSupplier Supplier<String> userSupplier Supplier<Long> positionSupplier void apply(E event) { event.aggregate = aggregate event.createdBy = userSupplier.get() event.position = positionSupplier.get() event.date = dateSupplier.get() eventConsumer.accept(event) } } static <A extends AggregateType, E extends BaseEvent<A, E>> void on( A aggregate, Consumer<E> eventConsumer, Supplier<Long> positionSupplier = { defaultPositionSupplier.incrementAndGet() }, Supplier<String> userSupplier = { 'anonymous' }, Supplier<Date> dateSupplier = { new Date() }, @DelegatesTo(OnSpec) Closure closure) { closure.resolveStrategy = Closure.DELEGATE_FIRST closure.delegate = new OnSpec( aggregate: aggregate, eventConsumer: eventConsumer, userSupplier: userSupplier, dateSupplier: dateSupplier, positionSupplier: positionSupplier ) closure.call() } } ## Instruction: Allow override in event dsl ## Code After: package com.github.rahulsom.grooves.api import java.util.concurrent.atomic.AtomicLong import java.util.function.Consumer import java.util.function.Supplier /** * DSL to simplify writing code with Events */ class EventsDsl { static AtomicLong defaultPositionSupplier = new AtomicLong() static class OnSpec<A extends AggregateType, E extends BaseEvent<A, E>> { A aggregate Consumer<E> eventConsumer Supplier<Date> dateSupplier Supplier<String> userSupplier Supplier<Long> positionSupplier void apply(E event) { event.aggregate = aggregate if (!event.createdBy) event.createdBy = userSupplier.get() if (!event.position) event.position = positionSupplier.get() if (!event.date) event.date = dateSupplier.get() eventConsumer.accept(event) } } static <A extends AggregateType, E extends BaseEvent<A, E>> void on( A aggregate, Consumer<E> eventConsumer, Supplier<Long> positionSupplier = { defaultPositionSupplier.incrementAndGet() }, Supplier<String> userSupplier = { 'anonymous' }, Supplier<Date> dateSupplier = { new Date() }, @DelegatesTo(OnSpec) Closure closure) { closure.resolveStrategy = Closure.DELEGATE_FIRST closure.delegate = new OnSpec( aggregate: aggregate, eventConsumer: eventConsumer, userSupplier: userSupplier, dateSupplier: dateSupplier, positionSupplier: positionSupplier ) closure.call() } }
package com.github.rahulsom.grooves.api import java.util.concurrent.atomic.AtomicLong import java.util.function.Consumer import java.util.function.Supplier /** * DSL to simplify writing code with Events */ class EventsDsl { static AtomicLong defaultPositionSupplier = new AtomicLong() static class OnSpec<A extends AggregateType, E extends BaseEvent<A, E>> { A aggregate Consumer<E> eventConsumer Supplier<Date> dateSupplier Supplier<String> userSupplier Supplier<Long> positionSupplier void apply(E event) { event.aggregate = aggregate + + if (!event.createdBy) - event.createdBy = userSupplier.get() + event.createdBy = userSupplier.get() ? ++++ + if (!event.position) - event.position = positionSupplier.get() + event.position = positionSupplier.get() ? ++++ + if (!event.date) - event.date = dateSupplier.get() + event.date = dateSupplier.get() ? ++++ eventConsumer.accept(event) } } static <A extends AggregateType, E extends BaseEvent<A, E>> void on( A aggregate, Consumer<E> eventConsumer, Supplier<Long> positionSupplier = { defaultPositionSupplier.incrementAndGet() }, Supplier<String> userSupplier = { 'anonymous' }, Supplier<Date> dateSupplier = { new Date() }, @DelegatesTo(OnSpec) Closure closure) { closure.resolveStrategy = Closure.DELEGATE_FIRST closure.delegate = new OnSpec( aggregate: aggregate, eventConsumer: eventConsumer, userSupplier: userSupplier, dateSupplier: dateSupplier, positionSupplier: positionSupplier ) closure.call() } }
10
0.208333
7
3
585bb1fad0cefbed1c7467b7c5febfc674dc2074
es-app/src/NetworkThread.cpp
es-app/src/NetworkThread.cpp
/* * File: NetworkThread.cpp * Author: matthieu * * Created on 6 février 2015, 11:40 */ #include "NetworkThread.h" #include "RecalboxSystem.h" #include "guis/GuiMsgBox.h" NetworkThread::NetworkThread(Window* window) : mWindow(window){ // creer le thread mFirstRun = true; mRunning = true; mThreadHandle = new boost::thread(boost::bind(&NetworkThread::run, this)); } NetworkThread::~NetworkThread() { mThreadHandle->join(); } void NetworkThread::run(){ while(mRunning){ if(mFirstRun){ boost::this_thread::sleep(boost::posix_time::seconds(15)); mFirstRun = false; }else { boost::this_thread::sleep(boost::posix_time::hours(1)); } if(RecalboxSystem::getInstance()->canUpdate()){ if(RecalboxSystem::getInstance()->canUpdate()){ mWindow->displayMessage("AN UPDATE IS AVAILABLE FOR YOUR RECALBOX"); mRunning = false; } } } }
/* * File: NetworkThread.cpp * Author: matthieu * * Created on 6 février 2015, 11:40 */ #include "NetworkThread.h" #include "RecalboxSystem.h" #include "guis/GuiMsgBox.h" NetworkThread::NetworkThread(Window* window) : mWindow(window){ // creer le thread mFirstRun = true; mRunning = true; mThreadHandle = new boost::thread(boost::bind(&NetworkThread::run, this)); } NetworkThread::~NetworkThread() { mThreadHandle->join(); } void NetworkThread::run(){ while(mRunning){ if(mFirstRun){ boost::this_thread::sleep(boost::posix_time::seconds(15)); mFirstRun = false; }else { boost::this_thread::sleep(boost::posix_time::hours(1)); } if(RecalboxConf::getInstance()->get("updates.enabled") == "1") { if(RecalboxSystem::getInstance()->canUpdate()){ mWindow->displayMessage("AN UPDATE IS AVAILABLE FOR YOUR RECALBOX"); mRunning = false; } } } }
Update : make the updates.enabled switch usefull
Update : make the updates.enabled switch usefull Signed-off-by: Nicolas Adenis-Lamarre <[email protected]>
C++
mit
rockaddicted/recalbox-emulationstation,recalbox/recalbox-emulationstation,emerrepengo/recalbox-emulationstation,rockaddicted/recalbox-emulationstation,rockaddicted/recalbox-emulationstation,pmoran13800/recalbox-emulationstation,digitalLumberjack/recalbox-emulationstation,igungor/recalbox-emulationstation,igungor/recalbox-emulationstation,emerrepengo/recalbox-emulationstation,recalbox/recalbox-emulationstation,digitalLumberjack/recalbox-emulationstation,pmoran13800/recalbox-emulationstation,digitalLumberjack/recalbox-emulationstation,pmoran13800/recalbox-emulationstation,emerrepengo/recalbox-emulationstation,recalbox/recalbox-emulationstation,igungor/recalbox-emulationstation
c++
## Code Before: /* * File: NetworkThread.cpp * Author: matthieu * * Created on 6 février 2015, 11:40 */ #include "NetworkThread.h" #include "RecalboxSystem.h" #include "guis/GuiMsgBox.h" NetworkThread::NetworkThread(Window* window) : mWindow(window){ // creer le thread mFirstRun = true; mRunning = true; mThreadHandle = new boost::thread(boost::bind(&NetworkThread::run, this)); } NetworkThread::~NetworkThread() { mThreadHandle->join(); } void NetworkThread::run(){ while(mRunning){ if(mFirstRun){ boost::this_thread::sleep(boost::posix_time::seconds(15)); mFirstRun = false; }else { boost::this_thread::sleep(boost::posix_time::hours(1)); } if(RecalboxSystem::getInstance()->canUpdate()){ if(RecalboxSystem::getInstance()->canUpdate()){ mWindow->displayMessage("AN UPDATE IS AVAILABLE FOR YOUR RECALBOX"); mRunning = false; } } } } ## Instruction: Update : make the updates.enabled switch usefull Signed-off-by: Nicolas Adenis-Lamarre <[email protected]> ## Code After: /* * File: NetworkThread.cpp * Author: matthieu * * Created on 6 février 2015, 11:40 */ #include "NetworkThread.h" #include "RecalboxSystem.h" #include "guis/GuiMsgBox.h" NetworkThread::NetworkThread(Window* window) : mWindow(window){ // creer le thread mFirstRun = true; mRunning = true; mThreadHandle = new boost::thread(boost::bind(&NetworkThread::run, this)); } NetworkThread::~NetworkThread() { mThreadHandle->join(); } void NetworkThread::run(){ while(mRunning){ if(mFirstRun){ boost::this_thread::sleep(boost::posix_time::seconds(15)); mFirstRun = false; }else { boost::this_thread::sleep(boost::posix_time::hours(1)); } if(RecalboxConf::getInstance()->get("updates.enabled") == "1") { if(RecalboxSystem::getInstance()->canUpdate()){ mWindow->displayMessage("AN UPDATE IS AVAILABLE FOR YOUR RECALBOX"); mRunning = false; } } } }
/* * File: NetworkThread.cpp * Author: matthieu * * Created on 6 février 2015, 11:40 */ #include "NetworkThread.h" #include "RecalboxSystem.h" #include "guis/GuiMsgBox.h" NetworkThread::NetworkThread(Window* window) : mWindow(window){ // creer le thread mFirstRun = true; mRunning = true; mThreadHandle = new boost::thread(boost::bind(&NetworkThread::run, this)); } NetworkThread::~NetworkThread() { mThreadHandle->join(); } void NetworkThread::run(){ while(mRunning){ if(mFirstRun){ boost::this_thread::sleep(boost::posix_time::seconds(15)); mFirstRun = false; }else { boost::this_thread::sleep(boost::posix_time::hours(1)); } + if(RecalboxConf::getInstance()->get("updates.enabled") == "1") { - if(RecalboxSystem::getInstance()->canUpdate()){ ? ^^^^^^ + if(RecalboxSystem::getInstance()->canUpdate()){ ? ^ - if(RecalboxSystem::getInstance()->canUpdate()){ - mWindow->displayMessage("AN UPDATE IS AVAILABLE FOR YOUR RECALBOX"); ? ^^^^^^^^^^^^ + mWindow->displayMessage("AN UPDATE IS AVAILABLE FOR YOUR RECALBOX"); ? ^ - mRunning = false; ? ^^^^^^^^^^^^ + mRunning = false; ? ^ - } - } + } + } } }
12
0.27907
6
6
d317cea826ad8021e2ec979fb596bebae66cc83e
.forestry/front_matter/templates/team.yml
.forestry/front_matter/templates/team.yml
--- pages: - _team/martin-murphy.markdown - _team/daniel-walsh.markdown - _team/cody-winton.markdown hide_body: false is_partial: false fields: - name: title label: Title type: text hidden: false default: '' - name: date label: Date type: datetime hidden: false default: '' - name: tags label: Tags type: tag_list hidden: false default: '' - name: position label: Position type: text hidden: false default: '' - name: image label: Image type: text hidden: false default: - name: subtitle label: Subtitle type: text hidden: false default: - name: is_board_member label: Is board member type: boolean hidden: false default: false - name: is_teacher label: Is teacher type: boolean hidden: false default: false - name: layout label: Layout type: text hidden: false default: page
--- pages: - _team/martin-murphy.markdown - _team/daniel-walsh.markdown - _team/cody-winton.markdown hide_body: false is_partial: false fields: - name: title label: Name type: text hidden: false default: '' description: e.g. John Smith config: required: true - name: date label: Date type: datetime hidden: false default: '' - name: tags label: Tags type: tag_list hidden: false default: '' - name: position label: Position type: text hidden: false default: '' - name: image label: Image type: text hidden: false default: - name: subtitle label: Subtitle type: text hidden: false default: - name: is_board_member label: Is board member type: boolean hidden: false default: false - name: is_teacher label: Is teacher type: boolean hidden: false default: false - name: layout label: Layout type: text hidden: false default: page
Update from Forestry.io - Updated Forestry configuration
Update from Forestry.io - Updated Forestry configuration
YAML
mit
truecodersio/truecoders.io,truecodersio/truecoders.io,truecodersio/truecoders.io
yaml
## Code Before: --- pages: - _team/martin-murphy.markdown - _team/daniel-walsh.markdown - _team/cody-winton.markdown hide_body: false is_partial: false fields: - name: title label: Title type: text hidden: false default: '' - name: date label: Date type: datetime hidden: false default: '' - name: tags label: Tags type: tag_list hidden: false default: '' - name: position label: Position type: text hidden: false default: '' - name: image label: Image type: text hidden: false default: - name: subtitle label: Subtitle type: text hidden: false default: - name: is_board_member label: Is board member type: boolean hidden: false default: false - name: is_teacher label: Is teacher type: boolean hidden: false default: false - name: layout label: Layout type: text hidden: false default: page ## Instruction: Update from Forestry.io - Updated Forestry configuration ## Code After: --- pages: - _team/martin-murphy.markdown - _team/daniel-walsh.markdown - _team/cody-winton.markdown hide_body: false is_partial: false fields: - name: title label: Name type: text hidden: false default: '' description: e.g. John Smith config: required: true - name: date label: Date type: datetime hidden: false default: '' - name: tags label: Tags type: tag_list hidden: false default: '' - name: position label: Position type: text hidden: false default: '' - name: image label: Image type: text hidden: false default: - name: subtitle label: Subtitle type: text hidden: false default: - name: is_board_member label: Is board member type: boolean hidden: false default: false - name: is_teacher label: Is teacher type: boolean hidden: false default: false - name: layout label: Layout type: text hidden: false default: page
--- pages: - _team/martin-murphy.markdown - _team/daniel-walsh.markdown - _team/cody-winton.markdown hide_body: false is_partial: false fields: - name: title - label: Title + label: Name type: text hidden: false default: '' + description: e.g. John Smith + config: + required: true - name: date label: Date type: datetime hidden: false default: '' - name: tags label: Tags type: tag_list hidden: false default: '' - name: position label: Position type: text hidden: false default: '' - name: image label: Image type: text hidden: false default: - name: subtitle label: Subtitle type: text hidden: false default: - name: is_board_member label: Is board member type: boolean hidden: false default: false - name: is_teacher label: Is teacher type: boolean hidden: false default: false - name: layout label: Layout type: text hidden: false default: page
5
0.09434
4
1
7e257420baec4f1a1e03f876a06766bf6b0d4064
.travis.yml
.travis.yml
sudo: false dist: xenial language: php services: - mysql php: - 7.3 - 7.2 - 7.1 env: - SYMFONY_VERSION=4.3.* - SYMFONY_VERSION=4.2.* - SYMFONY_VERSION=4.1.* - SYMFONY_VERSION=4.0.* - SYMFONY_VERSION=3.4.* matrix: fast_finish: true before_script: - echo 'memory_limit=-1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini - mysql -e "CREATE DATABASE symfony; GRANT ALL ON symfony.* TO 'aimeos'@'127.0.0.1' IDENTIFIED BY 'aimeos'" - mysql -e "set global wait_timeout=600" - rm composer.lock # Prevent dependency problems - COMPOSER_MEMORY_LIMIT=-1 travis_retry composer require "symfony/symfony:${SYMFONY_VERSION}" script: - vendor/bin/phpunit --coverage-clover coverage.xml after_success: - php vendor/bin/coveralls
sudo: false dist: xenial language: php services: - mysql php: - 7.3 - 7.2 - 7.1 env: - SYMFONY_VERSION=5.0.* - SYMFONY_VERSION=4.4.* - SYMFONY_VERSION=3.4.* matrix: fast_finish: true before_script: - echo 'memory_limit=-1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini - mysql -e "CREATE DATABASE symfony; GRANT ALL ON symfony.* TO 'aimeos'@'127.0.0.1' IDENTIFIED BY 'aimeos'" - mysql -e "set global wait_timeout=600" - rm composer.lock # Prevent dependency problems - COMPOSER_MEMORY_LIMIT=-1 travis_retry composer require "symfony/symfony:${SYMFONY_VERSION}" script: - vendor/bin/phpunit --coverage-clover coverage.xml after_success: - php vendor/bin/coveralls
Test Symfony 5.0 and LTS versions
Test Symfony 5.0 and LTS versions
YAML
mit
aimeos/aimeos-symfony2,aimeos/aimeos-symfony,aimeos/aimeos-symfony2,aimeos/aimeos-symfony2
yaml
## Code Before: sudo: false dist: xenial language: php services: - mysql php: - 7.3 - 7.2 - 7.1 env: - SYMFONY_VERSION=4.3.* - SYMFONY_VERSION=4.2.* - SYMFONY_VERSION=4.1.* - SYMFONY_VERSION=4.0.* - SYMFONY_VERSION=3.4.* matrix: fast_finish: true before_script: - echo 'memory_limit=-1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini - mysql -e "CREATE DATABASE symfony; GRANT ALL ON symfony.* TO 'aimeos'@'127.0.0.1' IDENTIFIED BY 'aimeos'" - mysql -e "set global wait_timeout=600" - rm composer.lock # Prevent dependency problems - COMPOSER_MEMORY_LIMIT=-1 travis_retry composer require "symfony/symfony:${SYMFONY_VERSION}" script: - vendor/bin/phpunit --coverage-clover coverage.xml after_success: - php vendor/bin/coveralls ## Instruction: Test Symfony 5.0 and LTS versions ## Code After: sudo: false dist: xenial language: php services: - mysql php: - 7.3 - 7.2 - 7.1 env: - SYMFONY_VERSION=5.0.* - SYMFONY_VERSION=4.4.* - SYMFONY_VERSION=3.4.* matrix: fast_finish: true before_script: - echo 'memory_limit=-1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini - mysql -e "CREATE DATABASE symfony; GRANT ALL ON symfony.* TO 'aimeos'@'127.0.0.1' IDENTIFIED BY 'aimeos'" - mysql -e "set global wait_timeout=600" - rm composer.lock # Prevent dependency problems - COMPOSER_MEMORY_LIMIT=-1 travis_retry composer require "symfony/symfony:${SYMFONY_VERSION}" script: - vendor/bin/phpunit --coverage-clover coverage.xml after_success: - php vendor/bin/coveralls
sudo: false dist: xenial language: php services: - mysql php: - 7.3 - 7.2 - 7.1 env: - - SYMFONY_VERSION=4.3.* - - SYMFONY_VERSION=4.2.* - - SYMFONY_VERSION=4.1.* - - SYMFONY_VERSION=4.0.* ? ^ + - SYMFONY_VERSION=5.0.* ? ^ + - SYMFONY_VERSION=4.4.* - SYMFONY_VERSION=3.4.* matrix: fast_finish: true before_script: - echo 'memory_limit=-1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini - mysql -e "CREATE DATABASE symfony; GRANT ALL ON symfony.* TO 'aimeos'@'127.0.0.1' IDENTIFIED BY 'aimeos'" - mysql -e "set global wait_timeout=600" - rm composer.lock # Prevent dependency problems - COMPOSER_MEMORY_LIMIT=-1 travis_retry composer require "symfony/symfony:${SYMFONY_VERSION}" script: - vendor/bin/phpunit --coverage-clover coverage.xml after_success: - php vendor/bin/coveralls
6
0.176471
2
4
ba2350bab89eae7ec85970b832bb8c1788b45435
src/main/webapp/js/main.js
src/main/webapp/js/main.js
(function() { var TextAsLabelInput = new Class({ inputClass: 'defaultText', labelClass: 'textAsLabel', initialize: function(el) { this.el = document.id(el); this.label = $$('label[for=' + this.el.get('id') + ']'); this.defaultText = this.label.get('text'); this.el.set('value',this.defaultText).addClass(this.inputClass) .addEvents({focus:this.focus.bind(this),blur:this.blur.bind(this)}); this.label.addClass(this.labelClass); }, blur: function() { if (this.el.get('value') == '') { this.el.set('value',this.defaultText).addClass(this.inputClass); } }, focus: function() { if (this.el.get('value') == this.defaultText) { this.el.set('value','').removeClass(this.inputClass); } } }); var ExpandingTextarea = new Class({ initialize: function(el) { this.el = document.id(el); } }); var text = new TextAsLabelInput('text'); var source = new TextAsLabelInput('source'); var context = new TextAsLabelInput('context'); })();
(function() { var $ = document.id; var TextAsLabelInput = new Class({ inputClass: 'defaultText', labelClass: 'textAsLabel', initialize: function(el) { this.el = el.el ? el.el : $(el); this.label = $$('label[for=' + this.el.get('id') + ']'); this.defaultText = this.label.get('text'); this.el.set('value',this.defaultText).addClass(this.inputClass) .addEvents({focus:this.focus.bind(this),blur:this.blur.bind(this)}); this.label.addClass(this.labelClass); }, blur: function() { if (this.el.get('value') == '') { this.el.set('value',this.defaultText).addClass(this.inputClass); } }, focus: function() { if (this.el.get('value') == this.defaultText) { this.el.set('value','').removeClass(this.inputClass); } } }); var ExpandingTextarea = new Class({ initialize: function(el) { this.el = document.id(el); } }); var text = new TextAsLabelInput('text'); var source = new TextAsLabelInput('source'); var context = new TextAsLabelInput('context'); function redrawElement() { var el = $(this); el.setStyle('height',el.getSize().y - 1); el.removeAttribute.delay(25,el,['style']); } addEvent('domready',redrawElement.bind('primary')); })();
Add a way to redraw misbehaving elements
Add a way to redraw misbehaving elements
JavaScript
mit
bryanjswift/quotidian,bryanjswift/quotidian
javascript
## Code Before: (function() { var TextAsLabelInput = new Class({ inputClass: 'defaultText', labelClass: 'textAsLabel', initialize: function(el) { this.el = document.id(el); this.label = $$('label[for=' + this.el.get('id') + ']'); this.defaultText = this.label.get('text'); this.el.set('value',this.defaultText).addClass(this.inputClass) .addEvents({focus:this.focus.bind(this),blur:this.blur.bind(this)}); this.label.addClass(this.labelClass); }, blur: function() { if (this.el.get('value') == '') { this.el.set('value',this.defaultText).addClass(this.inputClass); } }, focus: function() { if (this.el.get('value') == this.defaultText) { this.el.set('value','').removeClass(this.inputClass); } } }); var ExpandingTextarea = new Class({ initialize: function(el) { this.el = document.id(el); } }); var text = new TextAsLabelInput('text'); var source = new TextAsLabelInput('source'); var context = new TextAsLabelInput('context'); })(); ## Instruction: Add a way to redraw misbehaving elements ## Code After: (function() { var $ = document.id; var TextAsLabelInput = new Class({ inputClass: 'defaultText', labelClass: 'textAsLabel', initialize: function(el) { this.el = el.el ? el.el : $(el); this.label = $$('label[for=' + this.el.get('id') + ']'); this.defaultText = this.label.get('text'); this.el.set('value',this.defaultText).addClass(this.inputClass) .addEvents({focus:this.focus.bind(this),blur:this.blur.bind(this)}); this.label.addClass(this.labelClass); }, blur: function() { if (this.el.get('value') == '') { this.el.set('value',this.defaultText).addClass(this.inputClass); } }, focus: function() { if (this.el.get('value') == this.defaultText) { this.el.set('value','').removeClass(this.inputClass); } } }); var ExpandingTextarea = new Class({ initialize: function(el) { this.el = document.id(el); } }); var text = new TextAsLabelInput('text'); var source = new TextAsLabelInput('source'); var context = new TextAsLabelInput('context'); function redrawElement() { var el = $(this); el.setStyle('height',el.getSize().y - 1); el.removeAttribute.delay(25,el,['style']); } addEvent('domready',redrawElement.bind('primary')); })();
(function() { + var $ = document.id; var TextAsLabelInput = new Class({ inputClass: 'defaultText', labelClass: 'textAsLabel', initialize: function(el) { - this.el = document.id(el); + this.el = el.el ? el.el : $(el); this.label = $$('label[for=' + this.el.get('id') + ']'); this.defaultText = this.label.get('text'); this.el.set('value',this.defaultText).addClass(this.inputClass) .addEvents({focus:this.focus.bind(this),blur:this.blur.bind(this)}); this.label.addClass(this.labelClass); }, blur: function() { if (this.el.get('value') == '') { this.el.set('value',this.defaultText).addClass(this.inputClass); } }, focus: function() { if (this.el.get('value') == this.defaultText) { this.el.set('value','').removeClass(this.inputClass); } } }); var ExpandingTextarea = new Class({ initialize: function(el) { this.el = document.id(el); } }); var text = new TextAsLabelInput('text'); var source = new TextAsLabelInput('source'); var context = new TextAsLabelInput('context'); + function redrawElement() { + var el = $(this); + el.setStyle('height',el.getSize().y - 1); + el.removeAttribute.delay(25,el,['style']); + } + addEvent('domready',redrawElement.bind('primary')); })();
9
0.321429
8
1
5fd79551cf0bbfcabb3cfd4838a61aaf0d4ea270
lib/chef/resource/machine.rb
lib/chef/resource/machine.rb
require 'chef/resource/lwrp_base' require 'cheffish' require 'chef_metal' class Chef::Resource::Machine < Chef::Resource::LWRPBase self.resource_name = 'machine' def initialize(*args) super @chef_environment = Cheffish.enclosing_environment @provisioner = ChefMetal.enclosing_provisioner @provisioner_options = ChefMetal.enclosing_provisioner_options end actions :create, :delete, :converge, :nothing default_action :create # Provisioner attributes attribute :provisioner, :kind_of => Symbol attribute :provisioner_options # Node attributes Cheffish.node_attributes(self) # Client attributes attribute :public_key_path, :kind_of => String attribute :private_key_path, :kind_of => String attribute :admin, :kind_of => [TrueClass, FalseClass] attribute :validator, :kind_of => [TrueClass, FalseClass] # Allows you to turn convergence off in the :create action by writing "converge false" # or force it with "true" attribute :converge, :kind_of => [TrueClass, FalseClass] # chef client version and omnibus # chef-zero boot method? # chef-client -z boot method? # pushy boot method? end
require 'chef/resource/lwrp_base' require 'cheffish' require 'chef_metal' class Chef::Resource::Machine < Chef::Resource::LWRPBase self.resource_name = 'machine' def initialize(*args) super @chef_environment = Cheffish.enclosing_environment @chef_server = Cheffish.enclosing_chef_server @provisioner = ChefMetal.enclosing_provisioner @provisioner_options = ChefMetal.enclosing_provisioner_options end actions :create, :delete, :converge, :nothing default_action :create # Provisioner attributes attribute :provisioner, :kind_of => Symbol attribute :provisioner_options # Node attributes Cheffish.node_attributes(self) # Client attributes attribute :public_key_path, :kind_of => String attribute :private_key_path, :kind_of => String attribute :admin, :kind_of => [TrueClass, FalseClass] attribute :validator, :kind_of => [TrueClass, FalseClass] # Allows you to turn convergence off in the :create action by writing "converge false" # or force it with "true" attribute :converge, :kind_of => [TrueClass, FalseClass] # chef client version and omnibus # chef-zero boot method? # chef-client -z boot method? # pushy boot method? end
Add enclosing_chef_server to work with cheffish
Add enclosing_chef_server to work with cheffish
Ruby
apache-2.0
BharathNikesh/chef-provisioning,gravitystorm/chef-provisioning,emiddleton/chef-provisioning,gabelazo/chef-provisioning,poliva83/chef-provisioning,marc-/chef-provisioning,http-418/chef-provisioning,zakeeruddin21/chef-provisioning,chef/chef-provisioning,causton81/chef-provisioning,keen99/chef-provisioning,miguelcnf/chef-provisioning,mikenairn/chef-provisioning,tarak/chef-provisioning,dcallao/chef-provisioning,glennmatthews/chef-provisioning,hh/chef-provisioning,chef/chef-provisioning,bbbco/chef-provisioning,vulk/chef-metal
ruby
## Code Before: require 'chef/resource/lwrp_base' require 'cheffish' require 'chef_metal' class Chef::Resource::Machine < Chef::Resource::LWRPBase self.resource_name = 'machine' def initialize(*args) super @chef_environment = Cheffish.enclosing_environment @provisioner = ChefMetal.enclosing_provisioner @provisioner_options = ChefMetal.enclosing_provisioner_options end actions :create, :delete, :converge, :nothing default_action :create # Provisioner attributes attribute :provisioner, :kind_of => Symbol attribute :provisioner_options # Node attributes Cheffish.node_attributes(self) # Client attributes attribute :public_key_path, :kind_of => String attribute :private_key_path, :kind_of => String attribute :admin, :kind_of => [TrueClass, FalseClass] attribute :validator, :kind_of => [TrueClass, FalseClass] # Allows you to turn convergence off in the :create action by writing "converge false" # or force it with "true" attribute :converge, :kind_of => [TrueClass, FalseClass] # chef client version and omnibus # chef-zero boot method? # chef-client -z boot method? # pushy boot method? end ## Instruction: Add enclosing_chef_server to work with cheffish ## Code After: require 'chef/resource/lwrp_base' require 'cheffish' require 'chef_metal' class Chef::Resource::Machine < Chef::Resource::LWRPBase self.resource_name = 'machine' def initialize(*args) super @chef_environment = Cheffish.enclosing_environment @chef_server = Cheffish.enclosing_chef_server @provisioner = ChefMetal.enclosing_provisioner @provisioner_options = ChefMetal.enclosing_provisioner_options end actions :create, :delete, :converge, :nothing default_action :create # Provisioner attributes attribute :provisioner, :kind_of => Symbol attribute :provisioner_options # Node attributes Cheffish.node_attributes(self) # Client attributes attribute :public_key_path, :kind_of => String attribute :private_key_path, :kind_of => String attribute :admin, :kind_of => [TrueClass, FalseClass] attribute :validator, :kind_of => [TrueClass, FalseClass] # Allows you to turn convergence off in the :create action by writing "converge false" # or force it with "true" attribute :converge, :kind_of => [TrueClass, FalseClass] # chef client version and omnibus # chef-zero boot method? # chef-client -z boot method? # pushy boot method? end
require 'chef/resource/lwrp_base' require 'cheffish' require 'chef_metal' class Chef::Resource::Machine < Chef::Resource::LWRPBase self.resource_name = 'machine' def initialize(*args) super @chef_environment = Cheffish.enclosing_environment + @chef_server = Cheffish.enclosing_chef_server @provisioner = ChefMetal.enclosing_provisioner @provisioner_options = ChefMetal.enclosing_provisioner_options end actions :create, :delete, :converge, :nothing default_action :create # Provisioner attributes attribute :provisioner, :kind_of => Symbol attribute :provisioner_options # Node attributes Cheffish.node_attributes(self) # Client attributes attribute :public_key_path, :kind_of => String attribute :private_key_path, :kind_of => String attribute :admin, :kind_of => [TrueClass, FalseClass] attribute :validator, :kind_of => [TrueClass, FalseClass] # Allows you to turn convergence off in the :create action by writing "converge false" # or force it with "true" attribute :converge, :kind_of => [TrueClass, FalseClass] # chef client version and omnibus # chef-zero boot method? # chef-client -z boot method? # pushy boot method? end
1
0.025641
1
0
ea48d59c4e4073de940b394d2bc99e411cfbd3fb
example_of_usage.py
example_of_usage.py
import urllib.request from pprint import pprint from html_table_parser import HTMLTableParser def url_get_contents(url): """ Opens a website and read its binary contents (HTTP Response Body) """ req = urllib.request.Request(url=url) f = urllib.request.urlopen(req) return f.read() def main(): url = 'http://www.twitter.com' xhtml = url_get_contents(url).decode('utf-8') p = HTMLTableParser() p.feed(xhtml) pprint(p.tables) if __name__ == '__main__': main()
import urllib.request from pprint import pprint from html_table_parser import HTMLTableParser def url_get_contents(url): """ Opens a website and read its binary contents (HTTP Response Body) """ req = urllib.request.Request(url=url) f = urllib.request.urlopen(req) return f.read() def main(): url = 'https://w3schools.com/html/html_tables.asp' xhtml = url_get_contents(url).decode('utf-8') p = HTMLTableParser() p.feed(xhtml) # Get all tables pprint(p.tables) # Get tables with id attribute pprint(p.named_tables) if __name__ == '__main__': main()
Add named tables to the examples
Add named tables to the examples
Python
agpl-3.0
schmijos/html-table-parser-python3,schmijos/html-table-parser-python3
python
## Code Before: import urllib.request from pprint import pprint from html_table_parser import HTMLTableParser def url_get_contents(url): """ Opens a website and read its binary contents (HTTP Response Body) """ req = urllib.request.Request(url=url) f = urllib.request.urlopen(req) return f.read() def main(): url = 'http://www.twitter.com' xhtml = url_get_contents(url).decode('utf-8') p = HTMLTableParser() p.feed(xhtml) pprint(p.tables) if __name__ == '__main__': main() ## Instruction: Add named tables to the examples ## Code After: import urllib.request from pprint import pprint from html_table_parser import HTMLTableParser def url_get_contents(url): """ Opens a website and read its binary contents (HTTP Response Body) """ req = urllib.request.Request(url=url) f = urllib.request.urlopen(req) return f.read() def main(): url = 'https://w3schools.com/html/html_tables.asp' xhtml = url_get_contents(url).decode('utf-8') p = HTMLTableParser() p.feed(xhtml) # Get all tables pprint(p.tables) # Get tables with id attribute pprint(p.named_tables) if __name__ == '__main__': main()
import urllib.request from pprint import pprint from html_table_parser import HTMLTableParser def url_get_contents(url): """ Opens a website and read its binary contents (HTTP Response Body) """ req = urllib.request.Request(url=url) f = urllib.request.urlopen(req) return f.read() def main(): - url = 'http://www.twitter.com' + url = 'https://w3schools.com/html/html_tables.asp' xhtml = url_get_contents(url).decode('utf-8') p = HTMLTableParser() p.feed(xhtml) + + # Get all tables pprint(p.tables) + + # Get tables with id attribute + pprint(p.named_tables) if __name__ == '__main__': main()
7
0.291667
6
1
d7277c09da485a6a625cafcd16d4ce054d6ed321
test/factories/team_members.rb
test/factories/team_members.rb
FactoryBot.define do factory :team_member do event after(:build) do |team_member| team_member.user_con_profile ||= build(:user_con_profile, convention: team_member.event.convention) end end end
FactoryBot.define do factory :team_member do event display { true } after(:build) do |team_member| team_member.user_con_profile ||= build(:user_con_profile, convention: team_member.event.convention) end end end
Set more reasonable defaults for team members in test
Set more reasonable defaults for team members in test
Ruby
mit
neinteractiveliterature/intercode,neinteractiveliterature/intercode,neinteractiveliterature/intercode,neinteractiveliterature/intercode,neinteractiveliterature/intercode
ruby
## Code Before: FactoryBot.define do factory :team_member do event after(:build) do |team_member| team_member.user_con_profile ||= build(:user_con_profile, convention: team_member.event.convention) end end end ## Instruction: Set more reasonable defaults for team members in test ## Code After: FactoryBot.define do factory :team_member do event display { true } after(:build) do |team_member| team_member.user_con_profile ||= build(:user_con_profile, convention: team_member.event.convention) end end end
FactoryBot.define do factory :team_member do event + display { true } after(:build) do |team_member| team_member.user_con_profile ||= build(:user_con_profile, convention: team_member.event.convention) end end end
1
0.1
1
0
110db4497b1312ed1fcf3f934d6f46f3cab642d6
.travis.yml
.travis.yml
language: ruby bundler_args: --without development rvm: - 1.9.2 - 1.9.3 - 2.0.0 - rbx-19mode env: - DB=sqlite - DB=mysql - DB=postgresql before_script: - mv config/database.yml.template config/database.yml - rake generate_secret_token - mysql -e 'create database powerdns_test;' - psql -c 'create database powerdns_test;' -U postgres - bundle exec rake db:migrate - bundle exec rake db:seed script: "bundle exec rake spec" matrix: allow_failures: - rvm: jruby-19mode - rvm: rbx-19mode - rvm: 2.0.0 - env: DB=sqlite
language: ruby bundler_args: --without development rvm: - 1.9.2 - 1.9.3 - 2.0.0 - rbx-19mode env: - DB=sqlite - DB=mysql - DB=postgresql before_script: - mv config/database.yml.template config/database.yml - rake generate_secret_token - mysql -e 'create database powerdns_test;' - psql -c 'create database powerdns_test;' -U postgres - bundle exec rake db:migrate - bundle exec rake db:seed script: "bundle exec rake spec" matrix: allow_failures: - rvm: jruby-19mode - rvm: rbx-19mode - env: DB=sqlite
Make Ruby 2.0.0 a first class citizen
Make Ruby 2.0.0 a first class citizen
YAML
mit
kennethkalmer/powerdns-on-rails,Hermanverschooten/powerdns-on-rails,Hermanverschooten/powerdns-on-rails,kennethkalmer/powerdns-on-rails,Hermanverschooten/powerdns-on-rails,jfqd/powerdns-on-rails,kennethkalmer/powerdns-on-rails,kennethkalmer/powerdns-on-rails,Hermanverschooten/powerdns-on-rails,Hermanverschooten/powerdns-on-rails,jfqd/powerdns-on-rails,jfqd/powerdns-on-rails,kennethkalmer/powerdns-on-rails,jfqd/powerdns-on-rails
yaml
## Code Before: language: ruby bundler_args: --without development rvm: - 1.9.2 - 1.9.3 - 2.0.0 - rbx-19mode env: - DB=sqlite - DB=mysql - DB=postgresql before_script: - mv config/database.yml.template config/database.yml - rake generate_secret_token - mysql -e 'create database powerdns_test;' - psql -c 'create database powerdns_test;' -U postgres - bundle exec rake db:migrate - bundle exec rake db:seed script: "bundle exec rake spec" matrix: allow_failures: - rvm: jruby-19mode - rvm: rbx-19mode - rvm: 2.0.0 - env: DB=sqlite ## Instruction: Make Ruby 2.0.0 a first class citizen ## Code After: language: ruby bundler_args: --without development rvm: - 1.9.2 - 1.9.3 - 2.0.0 - rbx-19mode env: - DB=sqlite - DB=mysql - DB=postgresql before_script: - mv config/database.yml.template config/database.yml - rake generate_secret_token - mysql -e 'create database powerdns_test;' - psql -c 'create database powerdns_test;' -U postgres - bundle exec rake db:migrate - bundle exec rake db:seed script: "bundle exec rake spec" matrix: allow_failures: - rvm: jruby-19mode - rvm: rbx-19mode - env: DB=sqlite
language: ruby bundler_args: --without development rvm: - 1.9.2 - 1.9.3 - 2.0.0 - rbx-19mode env: - DB=sqlite - DB=mysql - DB=postgresql before_script: - mv config/database.yml.template config/database.yml - rake generate_secret_token - mysql -e 'create database powerdns_test;' - psql -c 'create database powerdns_test;' -U postgres - bundle exec rake db:migrate - bundle exec rake db:seed script: "bundle exec rake spec" matrix: allow_failures: - rvm: jruby-19mode - rvm: rbx-19mode - - rvm: 2.0.0 - env: DB=sqlite
1
0.04
0
1
7756efd754fdb65774042d33d9733b93a0a996e0
thali/thalilogger.js
thali/thalilogger.js
'use strict'; var winston = require('winston'); module.exports = function (tag){ if (!tag || typeof tag !== 'string' || tag.length < 3) { throw new Error('All logging must have a tag that is at least 3 ' + 'characters long!'); } var logger = new winston.Logger({ transports: [ new winston.transports.Console({ formatter: function (options) { return options.level.toUpperCase() + ' ' + options.meta.tag + ' ' + (undefined !== options.message ? options.message : ''); }, level: 'silly' }) ] }); logger.addRewriter(function (level, msg, meta) { if (!meta.tag) { meta.tag = tag; } return meta; }); return logger; };
'use strict'; var util = require('util'); var winston = require('winston'); var EventEmitter = require('events').EventEmitter; var Thalilogger = function () { EventEmitter.call(this); }; util.inherits(Thalilogger, EventEmitter); Thalilogger.prototype.name = 'thalilogger'; Thalilogger.prototype.log = function (level, msg, meta, callback) { jxcore.utils.console.log(level.toUpperCase() + ' ' + meta.tag + ': ' + msg); // // Emit the `logged` event immediately because the event loop // will not exit until `process.stdout` has drained anyway. // this.emit('logged'); callback(null, true); }; module.exports = function (tag) { if (!tag || typeof tag !== 'string' || tag.length < 3) { throw new Error('All logging must have a tag that is at least 3 ' + 'characters long!'); } var logger = new winston.Logger({ transports: [ new Thalilogger() ] }); logger.addRewriter(function (level, msg, meta) { if (!meta.tag) { meta.tag = tag; } return meta; }); return logger; };
Use a logger that uses jxcore.utils.console
Use a logger that uses jxcore.utils.console We had sometimes issues with the logging that uses console.log in jxcore environment, which seem to be going away with jxcore.utils.console.
JavaScript
mit
thaliproject/Thali_CordovaPlugin,thaliproject/Thali_CordovaPlugin,thaliproject/Thali_CordovaPlugin,thaliproject/Thali_CordovaPlugin,thaliproject/Thali_CordovaPlugin
javascript
## Code Before: 'use strict'; var winston = require('winston'); module.exports = function (tag){ if (!tag || typeof tag !== 'string' || tag.length < 3) { throw new Error('All logging must have a tag that is at least 3 ' + 'characters long!'); } var logger = new winston.Logger({ transports: [ new winston.transports.Console({ formatter: function (options) { return options.level.toUpperCase() + ' ' + options.meta.tag + ' ' + (undefined !== options.message ? options.message : ''); }, level: 'silly' }) ] }); logger.addRewriter(function (level, msg, meta) { if (!meta.tag) { meta.tag = tag; } return meta; }); return logger; }; ## Instruction: Use a logger that uses jxcore.utils.console We had sometimes issues with the logging that uses console.log in jxcore environment, which seem to be going away with jxcore.utils.console. ## Code After: 'use strict'; var util = require('util'); var winston = require('winston'); var EventEmitter = require('events').EventEmitter; var Thalilogger = function () { EventEmitter.call(this); }; util.inherits(Thalilogger, EventEmitter); Thalilogger.prototype.name = 'thalilogger'; Thalilogger.prototype.log = function (level, msg, meta, callback) { jxcore.utils.console.log(level.toUpperCase() + ' ' + meta.tag + ': ' + msg); // // Emit the `logged` event immediately because the event loop // will not exit until `process.stdout` has drained anyway. // this.emit('logged'); callback(null, true); }; module.exports = function (tag) { if (!tag || typeof tag !== 'string' || tag.length < 3) { throw new Error('All logging must have a tag that is at least 3 ' + 'characters long!'); } var logger = new winston.Logger({ transports: [ new Thalilogger() ] }); logger.addRewriter(function (level, msg, meta) { if (!meta.tag) { meta.tag = tag; } return meta; }); return logger; };
'use strict'; + var util = require('util'); var winston = require('winston'); + var EventEmitter = require('events').EventEmitter; + var Thalilogger = function () { + EventEmitter.call(this); + }; + + util.inherits(Thalilogger, EventEmitter); + + Thalilogger.prototype.name = 'thalilogger'; + + Thalilogger.prototype.log = function (level, msg, meta, callback) { + jxcore.utils.console.log(level.toUpperCase() + ' ' + meta.tag + ': ' + msg); + // + // Emit the `logged` event immediately because the event loop + // will not exit until `process.stdout` has drained anyway. + // + this.emit('logged'); + callback(null, true); + }; + - module.exports = function (tag){ + module.exports = function (tag) { ? + if (!tag || typeof tag !== 'string' || tag.length < 3) { throw new Error('All logging must have a tag that is at least 3 ' + - 'characters long!'); + 'characters long!'); ? ++++++++++++++ } - var logger = new winston.Logger({ + var logger = new winston.Logger({ ? + transports: [ + new Thalilogger() - new winston.transports.Console({ - formatter: function (options) { - return options.level.toUpperCase() + ' ' + - options.meta.tag + ' ' + - (undefined !== options.message ? options.message : ''); - }, - level: 'silly' - }) ] }); logger.addRewriter(function (level, msg, meta) { if (!meta.tag) { meta.tag = tag; } return meta; }); return logger; };
35
1.206897
24
11
6c317a2b30bbac6a6f47e8e618320891ac559824
app/src/main/res/values/dimens.xml
app/src/main/res/values/dimens.xml
<resources> <!-- Default screen margins, per the Android Design guidelines. --> <dimen name="activity_horizontal_margin">16dp</dimen> <dimen name="activity_vertical_margin">16dp</dimen> <dimen name="fab_margin">12dp</dimen> <dimen name="big_text">18sp</dimen> </resources>
<resources> <!-- Default screen margins, per the Android Design guidelines. --> <dimen name="activity_horizontal_margin">16dp</dimen> <dimen name="activity_vertical_margin">16dp</dimen> <dimen name="fab_margin">12dp</dimen> <dimen name="fab_margin_big">18dp</dimen> <dimen name="big_text">18sp</dimen> </resources>
Add new margin value 'fab_margin_big'
Add new margin value 'fab_margin_big'
XML
apache-2.0
asadkhan777/sunshine
xml
## Code Before: <resources> <!-- Default screen margins, per the Android Design guidelines. --> <dimen name="activity_horizontal_margin">16dp</dimen> <dimen name="activity_vertical_margin">16dp</dimen> <dimen name="fab_margin">12dp</dimen> <dimen name="big_text">18sp</dimen> </resources> ## Instruction: Add new margin value 'fab_margin_big' ## Code After: <resources> <!-- Default screen margins, per the Android Design guidelines. --> <dimen name="activity_horizontal_margin">16dp</dimen> <dimen name="activity_vertical_margin">16dp</dimen> <dimen name="fab_margin">12dp</dimen> <dimen name="fab_margin_big">18dp</dimen> <dimen name="big_text">18sp</dimen> </resources>
<resources> <!-- Default screen margins, per the Android Design guidelines. --> <dimen name="activity_horizontal_margin">16dp</dimen> <dimen name="activity_vertical_margin">16dp</dimen> <dimen name="fab_margin">12dp</dimen> + <dimen name="fab_margin_big">18dp</dimen> <dimen name="big_text">18sp</dimen> </resources>
1
0.125
1
0
ee6e7828e38e6a70c9b6b58d10b10538bcafa8c3
package.json
package.json
{ "name": "angular-state", "version": "1.0.0", "description": "Reactive state for Angular directives", "main": "index.js", "dependencies": { "angular": "^1.3.5", "node-static": "^0.7.6" }, "devDependencies": { "karma": "^0.12.26", "karma-chrome-launcher": "^0.1.5", "karma-jasmine": "^0.2.2" }, "scripts": { "test": "node ./node_modules/karma/bin/karma start ./karma.conf.js --single-run", "watch": "node ./node_modules/karma/bin/karma start ./karma.conf.js --auto-watch" }, "keywords": [ "angular", "directive", "state", "reactive" ], "author": "Nik Butenko <[email protected]>", "license": "ISC" }
{ "name": "rx-state", "version": "1.0.0", "description": "Reactive state for custom Angular directives", "main": "index.js", "dependencies": { "angular": "^1.3.5", "node-static": "^0.7.6" }, "devDependencies": { "karma": "^0.12.26", "karma-chrome-launcher": "^0.1.5", "karma-jasmine": "^0.2.2" }, "scripts": { "test": "node ./node_modules/karma/bin/karma start ./karma.conf.js --single-run", "watch": "node ./node_modules/karma/bin/karma start ./karma.conf.js --auto-watch" }, "keywords": [ "angular", "directive", "state", "reactive" ], "author": "Nik Butenko <[email protected]>", "license": "MIT" }
Update module name and license
Update module name and license
JSON
mit
packetloop/rx-state
json
## Code Before: { "name": "angular-state", "version": "1.0.0", "description": "Reactive state for Angular directives", "main": "index.js", "dependencies": { "angular": "^1.3.5", "node-static": "^0.7.6" }, "devDependencies": { "karma": "^0.12.26", "karma-chrome-launcher": "^0.1.5", "karma-jasmine": "^0.2.2" }, "scripts": { "test": "node ./node_modules/karma/bin/karma start ./karma.conf.js --single-run", "watch": "node ./node_modules/karma/bin/karma start ./karma.conf.js --auto-watch" }, "keywords": [ "angular", "directive", "state", "reactive" ], "author": "Nik Butenko <[email protected]>", "license": "ISC" } ## Instruction: Update module name and license ## Code After: { "name": "rx-state", "version": "1.0.0", "description": "Reactive state for custom Angular directives", "main": "index.js", "dependencies": { "angular": "^1.3.5", "node-static": "^0.7.6" }, "devDependencies": { "karma": "^0.12.26", "karma-chrome-launcher": "^0.1.5", "karma-jasmine": "^0.2.2" }, "scripts": { "test": "node ./node_modules/karma/bin/karma start ./karma.conf.js --single-run", "watch": "node ./node_modules/karma/bin/karma start ./karma.conf.js --auto-watch" }, "keywords": [ "angular", "directive", "state", "reactive" ], "author": "Nik Butenko <[email protected]>", "license": "MIT" }
{ - "name": "angular-state", ? ------ + "name": "rx-state", ? + "version": "1.0.0", - "description": "Reactive state for Angular directives", + "description": "Reactive state for custom Angular directives", ? +++++++ "main": "index.js", "dependencies": { "angular": "^1.3.5", "node-static": "^0.7.6" }, "devDependencies": { "karma": "^0.12.26", "karma-chrome-launcher": "^0.1.5", "karma-jasmine": "^0.2.2" }, "scripts": { "test": "node ./node_modules/karma/bin/karma start ./karma.conf.js --single-run", "watch": "node ./node_modules/karma/bin/karma start ./karma.conf.js --auto-watch" }, "keywords": [ "angular", "directive", "state", "reactive" ], "author": "Nik Butenko <[email protected]>", - "license": "ISC" ? ^^ + "license": "MIT" ? + ^ }
6
0.222222
3
3
3aa58fa7d8accd7410460574e02adac80631aa94
test/testAssets.js
test/testAssets.js
'use strict'; const assert = require('assert'); const assets = require('../lib/assets.js'); describe('assets', function() { it('Returns a valid promise', async function() { // This test is, so far, just to test wiring up async/await syntax in tests. const src = '.'; const dest = '.'; await assets(src, dest, {}); assert.ok(true); }); });
'use strict'; const assert = require('assert'); const vfs = require('vinyl-fs'); const sinon = require('sinon'); const assets = require('../lib/assets.js'); describe('assets', function() { it('Runs the vfs pipeline', async function() { const src = '.'; const dest = 'dest'; const destSpy = sinon.spy(vfs, 'dest'); // Complete the promise chain, then let's check side-effects: await assets(src, dest, {}); assert(destSpy.calledWith(dest)); }); });
Test something with the Assets test
Test something with the Assets test
JavaScript
mit
oddbird/sassdoc-theme-herman,oddbird/sassdoc-theme-herman
javascript
## Code Before: 'use strict'; const assert = require('assert'); const assets = require('../lib/assets.js'); describe('assets', function() { it('Returns a valid promise', async function() { // This test is, so far, just to test wiring up async/await syntax in tests. const src = '.'; const dest = '.'; await assets(src, dest, {}); assert.ok(true); }); }); ## Instruction: Test something with the Assets test ## Code After: 'use strict'; const assert = require('assert'); const vfs = require('vinyl-fs'); const sinon = require('sinon'); const assets = require('../lib/assets.js'); describe('assets', function() { it('Runs the vfs pipeline', async function() { const src = '.'; const dest = 'dest'; const destSpy = sinon.spy(vfs, 'dest'); // Complete the promise chain, then let's check side-effects: await assets(src, dest, {}); assert(destSpy.calledWith(dest)); }); });
'use strict'; const assert = require('assert'); + const vfs = require('vinyl-fs'); + const sinon = require('sinon'); + const assets = require('../lib/assets.js'); describe('assets', function() { - it('Returns a valid promise', async function() { ? -- - ^ ^ ^^^^^^^^ + it('Runs the vfs pipeline', async function() { ? ^^^ ^^^^^^^ ^ - // This test is, so far, just to test wiring up async/await syntax in tests. const src = '.'; - const dest = '.'; ? ^ + const dest = 'dest'; ? ^^^^ + const destSpy = sinon.spy(vfs, 'dest'); + // Complete the promise chain, then let's check side-effects: await assets(src, dest, {}); - assert.ok(true); + assert(destSpy.calledWith(dest)); }); });
12
0.857143
8
4
c8a3a2a79a85f4f455fe07c17392647851439c3e
IRC/plugins/Happy/table_set.txt
IRC/plugins/Happy/table_set.txt
┣ヘ(^▽^ヘ)Ξ(゚▽゚*)ノ┳━┳ There we go~♪ ┬──┬ ノ( ゜-゜ノ) ┬──┬ ¯\_(ツ) (ヘ・_・)ヘ┳━┳ ヘ(´° □°)ヘ┳━┳ ┣ヘ(≧∇≦ヘ)… (≧∇≦)/┳━┳ ┳━┳
┣ヘ(^▽^ヘ)Ξ(゚▽゚*)ノ┳━┳ There we go~♪ ┬──┬ ノ( ゜-゜ノ) ┬──┬ ¯\_(ツ) (ヘ・_・)ヘ┳━┳ ヘ(´° □°)ヘ┳━┳ ┣ヘ(≧∇≦ヘ)… (≧∇≦)/┳━┳ ┳━┳ ┬──┬◡ノ(° -°ノ)
Add some more smilies in Happy
Add some more smilies in Happy
Text
agpl-3.0
k5bot/k5bot,k5bot/k5bot,k5bot/k5bot
text
## Code Before: ┣ヘ(^▽^ヘ)Ξ(゚▽゚*)ノ┳━┳ There we go~♪ ┬──┬ ノ( ゜-゜ノ) ┬──┬ ¯\_(ツ) (ヘ・_・)ヘ┳━┳ ヘ(´° □°)ヘ┳━┳ ┣ヘ(≧∇≦ヘ)… (≧∇≦)/┳━┳ ┳━┳ ## Instruction: Add some more smilies in Happy ## Code After: ┣ヘ(^▽^ヘ)Ξ(゚▽゚*)ノ┳━┳ There we go~♪ ┬──┬ ノ( ゜-゜ノ) ┬──┬ ¯\_(ツ) (ヘ・_・)ヘ┳━┳ ヘ(´° □°)ヘ┳━┳ ┣ヘ(≧∇≦ヘ)… (≧∇≦)/┳━┳ ┳━┳ ┬──┬◡ノ(° -°ノ)
┣ヘ(^▽^ヘ)Ξ(゚▽゚*)ノ┳━┳ There we go~♪ ┬──┬ ノ( ゜-゜ノ) ┬──┬ ¯\_(ツ) (ヘ・_・)ヘ┳━┳ ヘ(´° □°)ヘ┳━┳ ┣ヘ(≧∇≦ヘ)… (≧∇≦)/┳━┳ ┳━┳ + ┬──┬◡ノ(° -°ノ)
1
0.142857
1
0
0fb1928b38abb6529d4ea6b53cee8106613ba4d9
django_zoook/payment/cashondelivery/templates/cashondelivery/cashondelivery.html
django_zoook/payment/cashondelivery/templates/cashondelivery/cashondelivery.html
{% extends "layout.html" %} {% load i18n %} {% load modules %} {% block head %}<link href="{{ MEDIA_URL }}css/{{ THEME }}/user.css" rel="stylesheet" type="text/css" media="screen">{% endblock %} {% block pathway %}{% endblock %} {% block content %} <div id="page-wrap" class="clearfix"> {% include 'partner/menu.html' %} <div id="sidebar"> <div class="block border5"> {% module catalog.right_sale %} </div> </div> <div id="content" class="payment"> <p>{% blocktrans %}Your order {{order}} is created successfully. Remember do payment when receive delivery:{% endblocktrans %}</p> <p class="payment-type"><strong>{% if payment_type.payment_type_id.note %}{{ payment_type.payment_type_id.note }}{% else %}{{ payment_type.payment_type_id.name }}{% endif %}</strong></p> <p><b>&gt;&nbsp;&nbsp;</b><a href="{{ LOCALE_URI }}/sale/" title="{% trans "Orders" %}">{% blocktrans %}Go Orders for more details and status order{% endblocktrans %}</a></p> </div> </div> {% endblock %}
{% extends "layout.html" %} {% load i18n %} {% load modules %} {% block head %}<link href="{{ MEDIA_URL }}css/{{ THEME }}/user.css" rel="stylesheet" type="text/css" media="screen">{% endblock %} {% block pathway %}{% endblock %} {% block content %} <div id="page-wrap" class="clearfix"> {% include 'partner/menu.html' %} {% module sale.right_payment id="sidebar" class="block border5" %} <div id="content" class="payment"> <p>{% blocktrans %}Your order {{order}} is created successfully. Remember do payment when receive delivery:{% endblocktrans %}</p> <p class="payment-type"><strong>{% if payment_type.payment_type_id.note %}{{ payment_type.payment_type_id.note }}{% else %}{{ payment_type.payment_type_id.name }}{% endif %}</strong></p> <p><b>&gt;&nbsp;&nbsp;</b><a href="{{ LOCALE_URI }}/sale/" title="{% trans "Orders" %}">{% blocktrans %}Go Orders for more details and status order{% endblocktrans %}</a></p> </div> </div> {% endblock %}
Fix sale right payment module tag
Fix sale right payment module tag
HTML
agpl-3.0
eoconsulting/django-zoook,eoconsulting/django-zoook
html
## Code Before: {% extends "layout.html" %} {% load i18n %} {% load modules %} {% block head %}<link href="{{ MEDIA_URL }}css/{{ THEME }}/user.css" rel="stylesheet" type="text/css" media="screen">{% endblock %} {% block pathway %}{% endblock %} {% block content %} <div id="page-wrap" class="clearfix"> {% include 'partner/menu.html' %} <div id="sidebar"> <div class="block border5"> {% module catalog.right_sale %} </div> </div> <div id="content" class="payment"> <p>{% blocktrans %}Your order {{order}} is created successfully. Remember do payment when receive delivery:{% endblocktrans %}</p> <p class="payment-type"><strong>{% if payment_type.payment_type_id.note %}{{ payment_type.payment_type_id.note }}{% else %}{{ payment_type.payment_type_id.name }}{% endif %}</strong></p> <p><b>&gt;&nbsp;&nbsp;</b><a href="{{ LOCALE_URI }}/sale/" title="{% trans "Orders" %}">{% blocktrans %}Go Orders for more details and status order{% endblocktrans %}</a></p> </div> </div> {% endblock %} ## Instruction: Fix sale right payment module tag ## Code After: {% extends "layout.html" %} {% load i18n %} {% load modules %} {% block head %}<link href="{{ MEDIA_URL }}css/{{ THEME }}/user.css" rel="stylesheet" type="text/css" media="screen">{% endblock %} {% block pathway %}{% endblock %} {% block content %} <div id="page-wrap" class="clearfix"> {% include 'partner/menu.html' %} {% module sale.right_payment id="sidebar" class="block border5" %} <div id="content" class="payment"> <p>{% blocktrans %}Your order {{order}} is created successfully. Remember do payment when receive delivery:{% endblocktrans %}</p> <p class="payment-type"><strong>{% if payment_type.payment_type_id.note %}{{ payment_type.payment_type_id.note }}{% else %}{{ payment_type.payment_type_id.name }}{% endif %}</strong></p> <p><b>&gt;&nbsp;&nbsp;</b><a href="{{ LOCALE_URI }}/sale/" title="{% trans "Orders" %}">{% blocktrans %}Go Orders for more details and status order{% endblocktrans %}</a></p> </div> </div> {% endblock %}
{% extends "layout.html" %} {% load i18n %} {% load modules %} {% block head %}<link href="{{ MEDIA_URL }}css/{{ THEME }}/user.css" rel="stylesheet" type="text/css" media="screen">{% endblock %} {% block pathway %}{% endblock %} {% block content %} <div id="page-wrap" class="clearfix"> {% include 'partner/menu.html' %} + {% module sale.right_payment id="sidebar" class="block border5" %} + - <div id="sidebar"> - <div class="block border5"> - {% module catalog.right_sale %} - </div> - </div> <div id="content" class="payment"> <p>{% blocktrans %}Your order {{order}} is created successfully. Remember do payment when receive delivery:{% endblocktrans %}</p> <p class="payment-type"><strong>{% if payment_type.payment_type_id.note %}{{ payment_type.payment_type_id.note }}{% else %}{{ payment_type.payment_type_id.name }}{% endif %}</strong></p> <p><b>&gt;&nbsp;&nbsp;</b><a href="{{ LOCALE_URI }}/sale/" title="{% trans "Orders" %}">{% blocktrans %}Go Orders for more details and status order{% endblocktrans %}</a></p> </div> </div> {% endblock %}
7
0.318182
2
5
b56316eb374aee0b5f5044525d80d3047449fbb6
app/less/main.less
app/less/main.less
@charset "UTF-8"; @import "variables"; html, body { background-color: @white; color: @black; font-size: @base-font-size; font-family: @base-font; font-weight: 400; }
@charset "UTF-8"; @import "variables"; @import "fonts"; html, body { background-color: @white; color: @black; font-size: @base-font-size; font-family: @base-font; font-weight: 400; }
Include fonts in less file
Include fonts in less file
Less
mit
lukevers/converse,lukevers/converse,lukevers/converse
less
## Code Before: @charset "UTF-8"; @import "variables"; html, body { background-color: @white; color: @black; font-size: @base-font-size; font-family: @base-font; font-weight: 400; } ## Instruction: Include fonts in less file ## Code After: @charset "UTF-8"; @import "variables"; @import "fonts"; html, body { background-color: @white; color: @black; font-size: @base-font-size; font-family: @base-font; font-weight: 400; }
@charset "UTF-8"; @import "variables"; + @import "fonts"; html, body { background-color: @white; color: @black; font-size: @base-font-size; font-family: @base-font; font-weight: 400; }
1
0.083333
1
0
b734f100b57a08849db3ab71a24a55a0bc12d919
.travis.yml
.travis.yml
language: ruby cache: bundler sudo: false rvm: - 2.3.0 - 2.2.4 - 2.1.8 gemfile: - gemfiles/rails_3.2.gemfile - gemfiles/rails_4.0.gemfile - gemfiles/rails_4.1.gemfile - gemfiles/rails_4.2.gemfile - gemfiles/rails_5.0.gemfile
language: ruby cache: bundler sudo: false rvm: - 2.3.0 - 2.2.4 - 2.1.8 gemfile: - gemfiles/rails_3.2.gemfile - gemfiles/rails_4.0.gemfile - gemfiles/rails_4.1.gemfile - gemfiles/rails_4.2.gemfile - gemfiles/rails_5.0.gemfile matrix: exclude: - rvm: 2.1.8 gemfile: gemfiles/rails_5.0.gemfile
Exclude Ruby 2.1 from Rails 5 run
Exclude Ruby 2.1 from Rails 5 run
YAML
mit
enova/obvious_data,enova/obvious_data
yaml
## Code Before: language: ruby cache: bundler sudo: false rvm: - 2.3.0 - 2.2.4 - 2.1.8 gemfile: - gemfiles/rails_3.2.gemfile - gemfiles/rails_4.0.gemfile - gemfiles/rails_4.1.gemfile - gemfiles/rails_4.2.gemfile - gemfiles/rails_5.0.gemfile ## Instruction: Exclude Ruby 2.1 from Rails 5 run ## Code After: language: ruby cache: bundler sudo: false rvm: - 2.3.0 - 2.2.4 - 2.1.8 gemfile: - gemfiles/rails_3.2.gemfile - gemfiles/rails_4.0.gemfile - gemfiles/rails_4.1.gemfile - gemfiles/rails_4.2.gemfile - gemfiles/rails_5.0.gemfile matrix: exclude: - rvm: 2.1.8 gemfile: gemfiles/rails_5.0.gemfile
language: ruby cache: bundler sudo: false rvm: - 2.3.0 - 2.2.4 - 2.1.8 gemfile: - gemfiles/rails_3.2.gemfile - gemfiles/rails_4.0.gemfile - gemfiles/rails_4.1.gemfile - gemfiles/rails_4.2.gemfile - gemfiles/rails_5.0.gemfile + + matrix: + exclude: + - rvm: 2.1.8 + gemfile: gemfiles/rails_5.0.gemfile
5
0.333333
5
0
0d0accfb7a9cb2b2fd138de1199c34ae8b2ca0e2
src/CashflowBundle/Resources/config/services.yml
src/CashflowBundle/Resources/config/services.yml
services: app.wallet_repository: class: Doctrine\ORM\EntityRepository factory_service: doctrine.orm.default_entity_manager factory_method: getRepository arguments: - CashflowBundle\Entity\Wallet
services: app.wallet_repository: class: Doctrine\ORM\EntityRepository factory_service: doctrine.orm.default_entity_manager factory_method: getRepository arguments: - CashflowBundle\Entity\Wallet app.wallets_controller: class: CashflowBundle\Controller\WalletsController arguments: - @templating - @app.wallet_repository
Add wallets_controller as a service
Add wallets_controller as a service
YAML
mit
stolarz92/cashflow,stolarz92/cashflow,stolarz92/cashflow
yaml
## Code Before: services: app.wallet_repository: class: Doctrine\ORM\EntityRepository factory_service: doctrine.orm.default_entity_manager factory_method: getRepository arguments: - CashflowBundle\Entity\Wallet ## Instruction: Add wallets_controller as a service ## Code After: services: app.wallet_repository: class: Doctrine\ORM\EntityRepository factory_service: doctrine.orm.default_entity_manager factory_method: getRepository arguments: - CashflowBundle\Entity\Wallet app.wallets_controller: class: CashflowBundle\Controller\WalletsController arguments: - @templating - @app.wallet_repository
services: app.wallet_repository: class: Doctrine\ORM\EntityRepository factory_service: doctrine.orm.default_entity_manager factory_method: getRepository arguments: - CashflowBundle\Entity\Wallet + + app.wallets_controller: + class: CashflowBundle\Controller\WalletsController + arguments: + - @templating + - @app.wallet_repository
6
0.857143
6
0
8dd760a989ab222ea623517df4351653c763b39c
lib/mechanic/server/documentation/views/rss.builder
lib/mechanic/server/documentation/views/rss.builder
xml.instruct! :xml, version: "1.0" xml.rss version: "2.0" do xml.channel do xml.title "Robofont Mechanic" xml.description "A feed of Robofont extensions managed by Mechanic" xml.link request.url @extensions.each do |extension| xml.item do xml.title extension.name xml.author extension.author xml.pubDate Time.parse(extension.created_at.to_s).rfc822 xml.link 'http://github.com/' + extension.repository xml.guid('robofont-mechanic-' + extension.id.to_s, { isPermaLink: false }) xml.description 'By %s: %s' % [extension.author, extension.description] end end end end
xml.instruct! :xml, version: "1.0" xml.rss version: "2.0" do xml.channel do xml.title "Robofont Mechanic" xml.description "A feed of Robofont extensions managed by Mechanic" xml.link request.url @extensions.each do |extension| xml.item do xml.title "#{extension.name} by #{extension.author}" xml.pubDate Time.parse(extension.created_at.to_s).rfc822 xml.link 'http://github.com/' + extension.repository xml.guid('robofont-mechanic-' + extension.id.to_s, { isPermaLink: false }) xml.description 'By %s: %s' % [extension.author, extension.description] end end end end
Remove author field to pass RSS validation
Remove author field to pass RSS validation
Ruby
mit
jackjennings/mechanic-server
ruby
## Code Before: xml.instruct! :xml, version: "1.0" xml.rss version: "2.0" do xml.channel do xml.title "Robofont Mechanic" xml.description "A feed of Robofont extensions managed by Mechanic" xml.link request.url @extensions.each do |extension| xml.item do xml.title extension.name xml.author extension.author xml.pubDate Time.parse(extension.created_at.to_s).rfc822 xml.link 'http://github.com/' + extension.repository xml.guid('robofont-mechanic-' + extension.id.to_s, { isPermaLink: false }) xml.description 'By %s: %s' % [extension.author, extension.description] end end end end ## Instruction: Remove author field to pass RSS validation ## Code After: xml.instruct! :xml, version: "1.0" xml.rss version: "2.0" do xml.channel do xml.title "Robofont Mechanic" xml.description "A feed of Robofont extensions managed by Mechanic" xml.link request.url @extensions.each do |extension| xml.item do xml.title "#{extension.name} by #{extension.author}" xml.pubDate Time.parse(extension.created_at.to_s).rfc822 xml.link 'http://github.com/' + extension.repository xml.guid('robofont-mechanic-' + extension.id.to_s, { isPermaLink: false }) xml.description 'By %s: %s' % [extension.author, extension.description] end end end end
xml.instruct! :xml, version: "1.0" xml.rss version: "2.0" do xml.channel do xml.title "Robofont Mechanic" xml.description "A feed of Robofont extensions managed by Mechanic" xml.link request.url @extensions.each do |extension| xml.item do + xml.title "#{extension.name} by #{extension.author}" - xml.title extension.name - xml.author extension.author xml.pubDate Time.parse(extension.created_at.to_s).rfc822 xml.link 'http://github.com/' + extension.repository xml.guid('robofont-mechanic-' + extension.id.to_s, { isPermaLink: false }) xml.description 'By %s: %s' % [extension.author, extension.description] end end end end
3
0.166667
1
2
b7144cc2a0de8555ae507172f35223b0f312271f
migrations/m160622_095150_create_profile.php
migrations/m160622_095150_create_profile.php
<?php use yii\db\Migration; /** * Handles the creation for table `profile`. */ class m160622_095150_create_profile extends Migration { /** * @inheritdoc */ public function up() { $tableOptions = null; if ($this->db->driverName === 'mysql') { // http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'; } $this->createTable('profile', [ 'id' => $this->primaryKey(), 'sex' => $this->string(), 'email' => $this->string()->notNull()->unique(), ], $tableOptions); $this->addForeignKey('FK_profile_user', 'profile', 'email', 'user', 'email'); } /** * @inheritdoc */ public function down() { // drops foreign key for table `profile` $this->dropForeignKey( 'FK_profile_user', 'profile' ); $this->dropTable('profile'); } }
<?php use yii\db\Migration; /** * Handles the creation for table `profile`. */ class m160622_095150_create_profile extends Migration { /** * @inheritdoc */ public function up() { $tableOptions = null; if ($this->db->driverName === 'mysql') { // http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'; } $this->createTable('profile', [ 'id' => $this->primaryKey(), 'sex' => $this->string(), 'email' => $this->string()->notNull()->unique(), 'firstname' => $this->string()->notNull(), 'surname' => $this->string()->notNull(), ], $tableOptions); $this->addForeignKey('FK_profile_user', 'profile', 'email', 'user', 'email'); } /** * @inheritdoc */ public function down() { // drops foreign key for table `profile` $this->dropForeignKey( 'FK_profile_user', 'profile' ); $this->dropTable('profile'); } }
Add first and surname fields for profile table
Add first and surname fields for profile table
PHP
bsd-3-clause
nkmathew/intern-portal,nkmathew/intern-portal
php
## Code Before: <?php use yii\db\Migration; /** * Handles the creation for table `profile`. */ class m160622_095150_create_profile extends Migration { /** * @inheritdoc */ public function up() { $tableOptions = null; if ($this->db->driverName === 'mysql') { // http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'; } $this->createTable('profile', [ 'id' => $this->primaryKey(), 'sex' => $this->string(), 'email' => $this->string()->notNull()->unique(), ], $tableOptions); $this->addForeignKey('FK_profile_user', 'profile', 'email', 'user', 'email'); } /** * @inheritdoc */ public function down() { // drops foreign key for table `profile` $this->dropForeignKey( 'FK_profile_user', 'profile' ); $this->dropTable('profile'); } } ## Instruction: Add first and surname fields for profile table ## Code After: <?php use yii\db\Migration; /** * Handles the creation for table `profile`. */ class m160622_095150_create_profile extends Migration { /** * @inheritdoc */ public function up() { $tableOptions = null; if ($this->db->driverName === 'mysql') { // http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'; } $this->createTable('profile', [ 'id' => $this->primaryKey(), 'sex' => $this->string(), 'email' => $this->string()->notNull()->unique(), 'firstname' => $this->string()->notNull(), 'surname' => $this->string()->notNull(), ], $tableOptions); $this->addForeignKey('FK_profile_user', 'profile', 'email', 'user', 'email'); } /** * @inheritdoc */ public function down() { // drops foreign key for table `profile` $this->dropForeignKey( 'FK_profile_user', 'profile' ); $this->dropTable('profile'); } }
<?php use yii\db\Migration; /** * Handles the creation for table `profile`. */ class m160622_095150_create_profile extends Migration { /** * @inheritdoc */ public function up() { $tableOptions = null; if ($this->db->driverName === 'mysql') { // http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'; } $this->createTable('profile', [ 'id' => $this->primaryKey(), 'sex' => $this->string(), 'email' => $this->string()->notNull()->unique(), + 'firstname' => $this->string()->notNull(), + 'surname' => $this->string()->notNull(), ], $tableOptions); $this->addForeignKey('FK_profile_user', 'profile', 'email', 'user', 'email'); } /** * @inheritdoc */ public function down() { // drops foreign key for table `profile` $this->dropForeignKey( 'FK_profile_user', 'profile' ); + $this->dropTable('profile'); } }
3
0.069767
3
0
4f84482803049b40d7b7da26d9d624a6a63b4820
core/utils.py
core/utils.py
from django.utils import timezone def duration_string(duration, precision='s'): """Format hours, minutes and seconds as a human-friendly string (e.g. "2 hours, 25 minutes, 31 seconds") with precision to h = hours, m = minutes or s = seconds. """ h, m, s = duration_parts(duration) duration = '' if h > 0: duration = '{} hour{}'.format(h, 's' if h > 1 else '') if m > 0 and precision != 'h': duration += '{}{} minute{}'.format( '' if duration == '' else ', ', m, 's' if m > 1 else '') if s > 0 and precision != 'h' and precision != 'm': duration += '{}{} second{}'.format( '' if duration == '' else ', ', s, 's' if s > 1 else '') return duration def duration_parts(duration): """Get hours, minutes and seconds from a timedelta. """ if not isinstance(duration, timezone.timedelta): raise TypeError('Duration provided must be a timedetla') h, remainder = divmod(duration.seconds, 3600) h += duration.days * 24 m, s = divmod(remainder, 60) return h, m, s
from django.utils import timezone from django.utils.translation import ngettext def duration_string(duration, precision='s'): """Format hours, minutes and seconds as a human-friendly string (e.g. "2 hours, 25 minutes, 31 seconds") with precision to h = hours, m = minutes or s = seconds. """ h, m, s = duration_parts(duration) duration = '' if h > 0: duration = ngettext('%(hours)s hour', '%(hours)s hours', h) % { 'hours': h } if m > 0 and precision != 'h': if duration != '': duration += ', ' duration += ngettext('%(minutes)s minute', '%(minutes)s minutes', m) % { 'minutes': m } if s > 0 and precision != 'h' and precision != 'm': if duration != '': duration += ', ' duration += ngettext('%(seconds)s second', '%(seconds)s seconds', s) % { 'seconds': s } return duration def duration_parts(duration): """Get hours, minutes and seconds from a timedelta. """ if not isinstance(duration, timezone.timedelta): raise TypeError('Duration provided must be a timedetla') h, remainder = divmod(duration.seconds, 3600) h += duration.days * 24 m, s = divmod(remainder, 60) return h, m, s
Add translation support to `duration_string` utility
Add translation support to `duration_string` utility
Python
bsd-2-clause
cdubz/babybuddy,cdubz/babybuddy,cdubz/babybuddy
python
## Code Before: from django.utils import timezone def duration_string(duration, precision='s'): """Format hours, minutes and seconds as a human-friendly string (e.g. "2 hours, 25 minutes, 31 seconds") with precision to h = hours, m = minutes or s = seconds. """ h, m, s = duration_parts(duration) duration = '' if h > 0: duration = '{} hour{}'.format(h, 's' if h > 1 else '') if m > 0 and precision != 'h': duration += '{}{} minute{}'.format( '' if duration == '' else ', ', m, 's' if m > 1 else '') if s > 0 and precision != 'h' and precision != 'm': duration += '{}{} second{}'.format( '' if duration == '' else ', ', s, 's' if s > 1 else '') return duration def duration_parts(duration): """Get hours, minutes and seconds from a timedelta. """ if not isinstance(duration, timezone.timedelta): raise TypeError('Duration provided must be a timedetla') h, remainder = divmod(duration.seconds, 3600) h += duration.days * 24 m, s = divmod(remainder, 60) return h, m, s ## Instruction: Add translation support to `duration_string` utility ## Code After: from django.utils import timezone from django.utils.translation import ngettext def duration_string(duration, precision='s'): """Format hours, minutes and seconds as a human-friendly string (e.g. "2 hours, 25 minutes, 31 seconds") with precision to h = hours, m = minutes or s = seconds. """ h, m, s = duration_parts(duration) duration = '' if h > 0: duration = ngettext('%(hours)s hour', '%(hours)s hours', h) % { 'hours': h } if m > 0 and precision != 'h': if duration != '': duration += ', ' duration += ngettext('%(minutes)s minute', '%(minutes)s minutes', m) % { 'minutes': m } if s > 0 and precision != 'h' and precision != 'm': if duration != '': duration += ', ' duration += ngettext('%(seconds)s second', '%(seconds)s seconds', s) % { 'seconds': s } return duration def duration_parts(duration): """Get hours, minutes and seconds from a timedelta. """ if not isinstance(duration, timezone.timedelta): raise TypeError('Duration provided must be a timedetla') h, remainder = divmod(duration.seconds, 3600) h += duration.days * 24 m, s = divmod(remainder, 60) return h, m, s
from django.utils import timezone + from django.utils.translation import ngettext def duration_string(duration, precision='s'): """Format hours, minutes and seconds as a human-friendly string (e.g. "2 hours, 25 minutes, 31 seconds") with precision to h = hours, m = minutes or s = seconds. """ h, m, s = duration_parts(duration) duration = '' if h > 0: - duration = '{} hour{}'.format(h, 's' if h > 1 else '') + duration = ngettext('%(hours)s hour', '%(hours)s hours', h) % { + 'hours': h + } if m > 0 and precision != 'h': - duration += '{}{} minute{}'.format( - '' if duration == '' else ', ', m, 's' if m > 1 else '') + if duration != '': + duration += ', ' + duration += ngettext('%(minutes)s minute', '%(minutes)s minutes', m) % { + 'minutes': m + } if s > 0 and precision != 'h' and precision != 'm': - duration += '{}{} second{}'.format( - '' if duration == '' else ', ', s, 's' if s > 1 else '') + if duration != '': + duration += ', ' + duration += ngettext('%(seconds)s second', '%(seconds)s seconds', s) % { + 'seconds': s + } return duration def duration_parts(duration): """Get hours, minutes and seconds from a timedelta. """ if not isinstance(duration, timezone.timedelta): raise TypeError('Duration provided must be a timedetla') h, remainder = divmod(duration.seconds, 3600) h += duration.days * 24 m, s = divmod(remainder, 60) return h, m, s
19
0.59375
14
5
7d79e6f0404b04ababaca3d8c50b1e682fd64222
chainer/initializer.py
chainer/initializer.py
import typing as tp # NOQA from chainer import types # NOQA from chainer import utils class Initializer(object): """Initializes array. It initializes the given array. Attributes: dtype: Data type specifier. It is for type check in ``__call__`` function. """ def __init__(self, dtype=None): # type: (tp.Optional[types.DTypeSpec]) -> None self.dtype = dtype # type: types.DTypeSpec def __call__(self, array): # type: (types.NdArray) -> None """Initializes given array. This method destructively changes the value of array. The derived class is required to implement this method. The algorithms used to make the new values depend on the concrete derived classes. Args: array (:ref:`ndarray`): An array to be initialized by this initializer. """ raise NotImplementedError() # Original code forked from MIT licensed keras project # https://github.com/fchollet/keras/blob/master/keras/initializations.py def get_fans(shape): if not isinstance(shape, tuple): raise ValueError('shape must be tuple') if len(shape) < 2: raise ValueError('shape must be of length >= 2: shape={}', shape) receptive_field_size = utils.size_of_shape(shape[2:]) fan_in = shape[1] * receptive_field_size fan_out = shape[0] * receptive_field_size return fan_in, fan_out
import typing as tp # NOQA from chainer import types # NOQA from chainer import utils class Initializer(object): """Initializes array. It initializes the given array. Attributes: dtype: Data type specifier. It is for type check in ``__call__`` function. """ def __init__(self, dtype=None): # type: (tp.Optional[types.DTypeSpec]) -> None self.dtype = dtype # type: types.DTypeSpec def __call__(self, array): # type: (types.NdArray) -> None """Initializes given array. This method destructively changes the value of array. The derived class is required to implement this method. The algorithms used to make the new values depend on the concrete derived classes. Args: array (:ref:`ndarray`): An array to be initialized by this initializer. """ raise NotImplementedError() # Original code forked from MIT licensed keras project # https://github.com/fchollet/keras/blob/master/keras/initializations.py def get_fans(shape): if not isinstance(shape, tuple): raise ValueError( 'shape must be tuple. Actual type: {}'.format(type(shape))) if len(shape) < 2: raise ValueError( 'shape must be of length >= 2. Actual shape: {}'.format(shape)) receptive_field_size = utils.size_of_shape(shape[2:]) fan_in = shape[1] * receptive_field_size fan_out = shape[0] * receptive_field_size return fan_in, fan_out
Fix error messages in get_fans
Fix error messages in get_fans
Python
mit
niboshi/chainer,tkerola/chainer,niboshi/chainer,keisuke-umezawa/chainer,okuta/chainer,chainer/chainer,wkentaro/chainer,niboshi/chainer,okuta/chainer,okuta/chainer,wkentaro/chainer,pfnet/chainer,okuta/chainer,hvy/chainer,wkentaro/chainer,keisuke-umezawa/chainer,keisuke-umezawa/chainer,keisuke-umezawa/chainer,chainer/chainer,chainer/chainer,hvy/chainer,wkentaro/chainer,chainer/chainer,niboshi/chainer,hvy/chainer,hvy/chainer
python
## Code Before: import typing as tp # NOQA from chainer import types # NOQA from chainer import utils class Initializer(object): """Initializes array. It initializes the given array. Attributes: dtype: Data type specifier. It is for type check in ``__call__`` function. """ def __init__(self, dtype=None): # type: (tp.Optional[types.DTypeSpec]) -> None self.dtype = dtype # type: types.DTypeSpec def __call__(self, array): # type: (types.NdArray) -> None """Initializes given array. This method destructively changes the value of array. The derived class is required to implement this method. The algorithms used to make the new values depend on the concrete derived classes. Args: array (:ref:`ndarray`): An array to be initialized by this initializer. """ raise NotImplementedError() # Original code forked from MIT licensed keras project # https://github.com/fchollet/keras/blob/master/keras/initializations.py def get_fans(shape): if not isinstance(shape, tuple): raise ValueError('shape must be tuple') if len(shape) < 2: raise ValueError('shape must be of length >= 2: shape={}', shape) receptive_field_size = utils.size_of_shape(shape[2:]) fan_in = shape[1] * receptive_field_size fan_out = shape[0] * receptive_field_size return fan_in, fan_out ## Instruction: Fix error messages in get_fans ## Code After: import typing as tp # NOQA from chainer import types # NOQA from chainer import utils class Initializer(object): """Initializes array. It initializes the given array. Attributes: dtype: Data type specifier. It is for type check in ``__call__`` function. """ def __init__(self, dtype=None): # type: (tp.Optional[types.DTypeSpec]) -> None self.dtype = dtype # type: types.DTypeSpec def __call__(self, array): # type: (types.NdArray) -> None """Initializes given array. This method destructively changes the value of array. The derived class is required to implement this method. The algorithms used to make the new values depend on the concrete derived classes. Args: array (:ref:`ndarray`): An array to be initialized by this initializer. """ raise NotImplementedError() # Original code forked from MIT licensed keras project # https://github.com/fchollet/keras/blob/master/keras/initializations.py def get_fans(shape): if not isinstance(shape, tuple): raise ValueError( 'shape must be tuple. Actual type: {}'.format(type(shape))) if len(shape) < 2: raise ValueError( 'shape must be of length >= 2. Actual shape: {}'.format(shape)) receptive_field_size = utils.size_of_shape(shape[2:]) fan_in = shape[1] * receptive_field_size fan_out = shape[0] * receptive_field_size return fan_in, fan_out
import typing as tp # NOQA from chainer import types # NOQA from chainer import utils class Initializer(object): """Initializes array. It initializes the given array. Attributes: dtype: Data type specifier. It is for type check in ``__call__`` function. """ def __init__(self, dtype=None): # type: (tp.Optional[types.DTypeSpec]) -> None self.dtype = dtype # type: types.DTypeSpec def __call__(self, array): # type: (types.NdArray) -> None """Initializes given array. This method destructively changes the value of array. The derived class is required to implement this method. The algorithms used to make the new values depend on the concrete derived classes. Args: array (:ref:`ndarray`): An array to be initialized by this initializer. """ raise NotImplementedError() # Original code forked from MIT licensed keras project # https://github.com/fchollet/keras/blob/master/keras/initializations.py def get_fans(shape): if not isinstance(shape, tuple): - raise ValueError('shape must be tuple') + raise ValueError( + 'shape must be tuple. Actual type: {}'.format(type(shape))) if len(shape) < 2: - raise ValueError('shape must be of length >= 2: shape={}', shape) + raise ValueError( + 'shape must be of length >= 2. Actual shape: {}'.format(shape)) receptive_field_size = utils.size_of_shape(shape[2:]) fan_in = shape[1] * receptive_field_size fan_out = shape[0] * receptive_field_size return fan_in, fan_out
6
0.113208
4
2
8affa076745248fe78b5fd3cc37394321a86125e
.travis.yml
.travis.yml
language: rust rust: - nightly matrix: allow_failure: - rust: nightly before_install: - sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded -y - sudo apt-get update -qq - sudo apt-get install -qq gcc-arm-none-eabi - mkdir -p build/apps script: make build/main.elf
language: rust rust: - nightly matrix: allow_failure: - rust: nightly before_install: - sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded -y - sudo apt-get update -qq - sudo apt-get install -qq gcc-arm-none-eabi - mkdir -p build/apps script: - make build/main.elf - make clean-all - make PLATFORM=nrf_pca10001 CHIP=nrf51822 APPS=c_blinky
Update Travis-CI configuration file for nRF51822
Update Travis-CI configuration file for nRF51822 Make sure code specific to the newly added platform is built on CI.
YAML
apache-2.0
google/tock-on-titan,google/tock-on-titan,lizardo/tock-devel,google/tock-on-titan,lizardo/tock-devel,lizardo/tock-devel
yaml
## Code Before: language: rust rust: - nightly matrix: allow_failure: - rust: nightly before_install: - sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded -y - sudo apt-get update -qq - sudo apt-get install -qq gcc-arm-none-eabi - mkdir -p build/apps script: make build/main.elf ## Instruction: Update Travis-CI configuration file for nRF51822 Make sure code specific to the newly added platform is built on CI. ## Code After: language: rust rust: - nightly matrix: allow_failure: - rust: nightly before_install: - sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded -y - sudo apt-get update -qq - sudo apt-get install -qq gcc-arm-none-eabi - mkdir -p build/apps script: - make build/main.elf - make clean-all - make PLATFORM=nrf_pca10001 CHIP=nrf51822 APPS=c_blinky
language: rust rust: - nightly matrix: allow_failure: - rust: nightly before_install: - sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded -y - sudo apt-get update -qq - sudo apt-get install -qq gcc-arm-none-eabi - mkdir -p build/apps + script: - script: make build/main.elf ? ^^^^^^^ + - make build/main.elf ? ^^^ + - make clean-all + - make PLATFORM=nrf_pca10001 CHIP=nrf51822 APPS=c_blinky
5
0.357143
4
1
17b6711cd6615ccec2674c3c03ef6c09f7cb9f89
layouts/all-content/list.html
layouts/all-content/list.html
<!DOCTYPE html> <html lang="en"> <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# product: http://ogp.me/ns/product#"> <!--<meta charset="utf-8">--> <!--[>[><xbase href="file:///mnt/websites/xxxxxxxx/public"><]<]--> <!--<title>All the Posts!</title>--> <!--<style>--> <!--</style>--> {{ partial "head.html" . }} <link rel="stylesheet" href="{{ "/css/all-content.css" | relURL }}"/> </head> <body> <h1>Table of Contents:</h1> <ul> {{ range where .Site.Pages "Section" "docs" }} <li><a href="#{{ substr .RelPermalink 1 -1 }}">{{ .Title }}</a></li> {{ end }} </ul> <!--<div class="pagebreak"> </div>--> {{ range where .Site.Pages "Section" "docs" }} <h1 id="{{ substr .RelPermalink 1 -1 }}">{{ .Title }}</h1> <!--<p style=""><a href="{{ .Permalink }}">{{ .Permalink }}</a> - {{ .Params.sdate }}</p>--> {{ .Content }} {{ end }} </body> </html>
<!DOCTYPE html> <html lang="en"> <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# product: http://ogp.me/ns/product#"> <!--<meta charset="utf-8">--> <!--[>[><xbase href="file:///mnt/websites/xxxxxxxx/public"><]<]--> <!--<title>All the Posts!</title>--> <!--<style>--> <!--</style>--> {{ partial "head.html" . }} <link rel="stylesheet" href="{{ "/css/all-content.css" | relURL }}"/> </head> <body> <h1>Table of Contents:</h1> <ul> {{ range where .Site.Pages "Section" "docs" }} {{ if not (eq .Params.draft true) }} <li><a href="#{{ substr .RelPermalink 1 -1 }}">{{ .Title }}</a></li> {{ end }} {{ end }} </ul> <!--<div class="pagebreak"> </div>--> {{ range where .Site.Pages "Section" "docs" }} {{ if not (eq .Params.draft true) }} <h1 id="{{ substr .RelPermalink 1 -1 }}">{{ .Title }}</h1> <!--<p style=""><a href="{{ .Permalink }}">{{ .Permalink }}</a> - {{ .Params.sdate }}</p>--> {{ .Content }} {{ end }} {{ end }} </body> </html>
Change all-content to ignore draft pages
Change all-content to ignore draft pages
HTML
apache-2.0
gchq/stroom-docs,gchq/stroom-docs,gchq/stroom-docs
html
## Code Before: <!DOCTYPE html> <html lang="en"> <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# product: http://ogp.me/ns/product#"> <!--<meta charset="utf-8">--> <!--[>[><xbase href="file:///mnt/websites/xxxxxxxx/public"><]<]--> <!--<title>All the Posts!</title>--> <!--<style>--> <!--</style>--> {{ partial "head.html" . }} <link rel="stylesheet" href="{{ "/css/all-content.css" | relURL }}"/> </head> <body> <h1>Table of Contents:</h1> <ul> {{ range where .Site.Pages "Section" "docs" }} <li><a href="#{{ substr .RelPermalink 1 -1 }}">{{ .Title }}</a></li> {{ end }} </ul> <!--<div class="pagebreak"> </div>--> {{ range where .Site.Pages "Section" "docs" }} <h1 id="{{ substr .RelPermalink 1 -1 }}">{{ .Title }}</h1> <!--<p style=""><a href="{{ .Permalink }}">{{ .Permalink }}</a> - {{ .Params.sdate }}</p>--> {{ .Content }} {{ end }} </body> </html> ## Instruction: Change all-content to ignore draft pages ## Code After: <!DOCTYPE html> <html lang="en"> <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# product: http://ogp.me/ns/product#"> <!--<meta charset="utf-8">--> <!--[>[><xbase href="file:///mnt/websites/xxxxxxxx/public"><]<]--> <!--<title>All the Posts!</title>--> <!--<style>--> <!--</style>--> {{ partial "head.html" . }} <link rel="stylesheet" href="{{ "/css/all-content.css" | relURL }}"/> </head> <body> <h1>Table of Contents:</h1> <ul> {{ range where .Site.Pages "Section" "docs" }} {{ if not (eq .Params.draft true) }} <li><a href="#{{ substr .RelPermalink 1 -1 }}">{{ .Title }}</a></li> {{ end }} {{ end }} </ul> <!--<div class="pagebreak"> </div>--> {{ range where .Site.Pages "Section" "docs" }} {{ if not (eq .Params.draft true) }} <h1 id="{{ substr .RelPermalink 1 -1 }}">{{ .Title }}</h1> <!--<p style=""><a href="{{ .Permalink }}">{{ .Permalink }}</a> - {{ .Params.sdate }}</p>--> {{ .Content }} {{ end }} {{ end }} </body> </html>
<!DOCTYPE html> <html lang="en"> <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# product: http://ogp.me/ns/product#"> <!--<meta charset="utf-8">--> <!--[>[><xbase href="file:///mnt/websites/xxxxxxxx/public"><]<]--> <!--<title>All the Posts!</title>--> <!--<style>--> <!--</style>--> {{ partial "head.html" . }} <link rel="stylesheet" href="{{ "/css/all-content.css" | relURL }}"/> </head> <body> <h1>Table of Contents:</h1> <ul> {{ range where .Site.Pages "Section" "docs" }} + {{ if not (eq .Params.draft true) }} + <li><a href="#{{ substr .RelPermalink 1 -1 }}">{{ .Title }}</a></li> + {{ end }} {{ end }} </ul> <!--<div class="pagebreak"> </div>--> {{ range where .Site.Pages "Section" "docs" }} + {{ if not (eq .Params.draft true) }} <h1 id="{{ substr .RelPermalink 1 -1 }}">{{ .Title }}</h1> <!--<p style=""><a href="{{ .Permalink }}">{{ .Permalink }}</a> - {{ .Params.sdate }}</p>--> {{ .Content }} + {{ end }} {{ end }} </body> </html>
5
0.116279
5
0
e2c53b348a69093cc770ba827a6bdd5191f2a830
aldryn_faq/cms_toolbar.py
aldryn_faq/cms_toolbar.py
from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from cms.toolbar_pool import toolbar_pool from cms.toolbar_base import CMSToolbar from aldryn_blog import request_post_identifier from aldryn_faq import request_faq_category_identifier @toolbar_pool.register class FaqToolbar(CMSToolbar): def populate(self): def can(action, model): perm = 'aldryn_faq.%(action)s_%(model)s' % {'action': action, 'model': model} return self.request.user.has_perm(perm) if self.is_current_app and (can('add', 'category') or can('change', 'category')): menu = self.toolbar.get_or_create_menu('faq-app', _('FAQ')) if can('add', 'category'): menu.add_modal_item(_('Add category'), reverse('admin:aldryn_faq_category_add') + '?_popup') category = getattr(self.request, request_faq_category_identifier, None) if category and can('change', 'category'): url = reverse('admin:aldryn_faq_category_change', args=(category.pk,)) + '?_popup' menu.add_modal_item(_('Edit category'), url, active=True)
from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _, get_language from cms.toolbar_pool import toolbar_pool from cms.toolbar_base import CMSToolbar from aldryn_faq import request_faq_category_identifier @toolbar_pool.register class FaqToolbar(CMSToolbar): def populate(self): def can(action, model): perm = 'aldryn_faq.%(action)s_%(model)s' % {'action': action, 'model': model} return self.request.user.has_perm(perm) if self.is_current_app and (can('add', 'category') or can('change', 'category')): menu = self.toolbar.get_or_create_menu('faq-app', _('FAQ')) if can('add', 'category'): menu.add_modal_item(_('Add category'), reverse('admin:aldryn_faq_category_add') + '?_popup') category = getattr(self.request, request_faq_category_identifier, None) if category and can('add', 'question'): params = ('?_popup&category=%s&language=%s' % (category.pk, self.request.LANGUAGE_CODE)) menu.add_modal_item(_('Add question'), reverse('admin:aldryn_faq_question_add') + params) if category and can('change', 'category'): url = reverse('admin:aldryn_faq_category_change', args=(category.pk,)) + '?_popup' menu.add_modal_item(_('Edit category'), url, active=True)
Add ability to create question from toolbar
Add ability to create question from toolbar
Python
bsd-3-clause
czpython/aldryn-faq,mkoistinen/aldryn-faq,czpython/aldryn-faq,czpython/aldryn-faq,czpython/aldryn-faq
python
## Code Before: from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from cms.toolbar_pool import toolbar_pool from cms.toolbar_base import CMSToolbar from aldryn_blog import request_post_identifier from aldryn_faq import request_faq_category_identifier @toolbar_pool.register class FaqToolbar(CMSToolbar): def populate(self): def can(action, model): perm = 'aldryn_faq.%(action)s_%(model)s' % {'action': action, 'model': model} return self.request.user.has_perm(perm) if self.is_current_app and (can('add', 'category') or can('change', 'category')): menu = self.toolbar.get_or_create_menu('faq-app', _('FAQ')) if can('add', 'category'): menu.add_modal_item(_('Add category'), reverse('admin:aldryn_faq_category_add') + '?_popup') category = getattr(self.request, request_faq_category_identifier, None) if category and can('change', 'category'): url = reverse('admin:aldryn_faq_category_change', args=(category.pk,)) + '?_popup' menu.add_modal_item(_('Edit category'), url, active=True) ## Instruction: Add ability to create question from toolbar ## Code After: from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _, get_language from cms.toolbar_pool import toolbar_pool from cms.toolbar_base import CMSToolbar from aldryn_faq import request_faq_category_identifier @toolbar_pool.register class FaqToolbar(CMSToolbar): def populate(self): def can(action, model): perm = 'aldryn_faq.%(action)s_%(model)s' % {'action': action, 'model': model} return self.request.user.has_perm(perm) if self.is_current_app and (can('add', 'category') or can('change', 'category')): menu = self.toolbar.get_or_create_menu('faq-app', _('FAQ')) if can('add', 'category'): menu.add_modal_item(_('Add category'), reverse('admin:aldryn_faq_category_add') + '?_popup') category = getattr(self.request, request_faq_category_identifier, None) if category and can('add', 'question'): params = ('?_popup&category=%s&language=%s' % (category.pk, self.request.LANGUAGE_CODE)) menu.add_modal_item(_('Add question'), reverse('admin:aldryn_faq_question_add') + params) if category and can('change', 'category'): url = reverse('admin:aldryn_faq_category_change', args=(category.pk,)) + '?_popup' menu.add_modal_item(_('Edit category'), url, active=True)
from django.core.urlresolvers import reverse - from django.utils.translation import ugettext_lazy as _ + from django.utils.translation import ugettext_lazy as _, get_language ? ++++++++++++++ from cms.toolbar_pool import toolbar_pool from cms.toolbar_base import CMSToolbar - from aldryn_blog import request_post_identifier from aldryn_faq import request_faq_category_identifier @toolbar_pool.register class FaqToolbar(CMSToolbar): def populate(self): def can(action, model): perm = 'aldryn_faq.%(action)s_%(model)s' % {'action': action, 'model': model} return self.request.user.has_perm(perm) if self.is_current_app and (can('add', 'category') or can('change', 'category')): menu = self.toolbar.get_or_create_menu('faq-app', _('FAQ')) if can('add', 'category'): menu.add_modal_item(_('Add category'), reverse('admin:aldryn_faq_category_add') + '?_popup') category = getattr(self.request, request_faq_category_identifier, None) + if category and can('add', 'question'): + params = ('?_popup&category=%s&language=%s' % + (category.pk, self.request.LANGUAGE_CODE)) + menu.add_modal_item(_('Add question'), reverse('admin:aldryn_faq_question_add') + params) if category and can('change', 'category'): url = reverse('admin:aldryn_faq_category_change', args=(category.pk,)) + '?_popup' menu.add_modal_item(_('Edit category'), url, active=True)
7
0.25
5
2
5e9c2165f0bfd6e1373475c9cc744ea9b6d6ff59
RoadTripPlanner/FriendUserCell.swift
RoadTripPlanner/FriendUserCell.swift
// // FriendUserCell.swift // RoadTripPlanner // // Created by Diana Fisher on 10/23/17. // Copyright © 2017 RoadTripPlanner. All rights reserved. // import UIKit import Parse class FriendUserCell: UITableViewCell { @IBOutlet weak var avatarImageView: UIImageView! @IBOutlet weak var usernameLabel: UILabel! @IBOutlet weak var addRemoveButton: UIButton! var avatarFile: PFFile? var user: PFUser! { didSet { usernameLabel.text = user.username avatarFile = user.avatarFile } } override func awakeFromNib() { super.awakeFromNib() guard let avatarFile = self.avatarFile else { return } Utils.fileToImage(file: avatarFile) { (image) in self.avatarImageView.image = image } } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) // Configure the view for the selected state } @IBAction func addRemoveButtonPressed(_ sender: Any) { } }
// // FriendUserCell.swift // RoadTripPlanner // // Created by Diana Fisher on 10/23/17. // Copyright © 2017 RoadTripPlanner. All rights reserved. // import UIKit import Parse class FriendUserCell: UITableViewCell { @IBOutlet weak var avatarImageView: UIImageView! @IBOutlet weak var usernameLabel: UILabel! @IBOutlet weak var addRemoveButton: UIButton! var user: PFUser! { didSet { usernameLabel.text = user.username guard let avatarFile = user.avatarFile else { return } Utils.fileToImage(file: avatarFile) { (image) in self.avatarImageView.image = image } } } override func awakeFromNib() { super.awakeFromNib() avatarImageView.layer.cornerRadius = avatarImageView.frame.size.height / 2 avatarImageView.clipsToBounds = true } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) // Configure the view for the selected state } @IBAction func addRemoveButtonPressed(_ sender: Any) { } }
Load user avatar file and display it as a circle.
Load user avatar file and display it as a circle.
Swift
mit
CodePath2017Group4/travel-app,CodePath2017Group4/travel-app,CodePath2017Group4/travel-app,CodePath2017Group4/travel-app
swift
## Code Before: // // FriendUserCell.swift // RoadTripPlanner // // Created by Diana Fisher on 10/23/17. // Copyright © 2017 RoadTripPlanner. All rights reserved. // import UIKit import Parse class FriendUserCell: UITableViewCell { @IBOutlet weak var avatarImageView: UIImageView! @IBOutlet weak var usernameLabel: UILabel! @IBOutlet weak var addRemoveButton: UIButton! var avatarFile: PFFile? var user: PFUser! { didSet { usernameLabel.text = user.username avatarFile = user.avatarFile } } override func awakeFromNib() { super.awakeFromNib() guard let avatarFile = self.avatarFile else { return } Utils.fileToImage(file: avatarFile) { (image) in self.avatarImageView.image = image } } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) // Configure the view for the selected state } @IBAction func addRemoveButtonPressed(_ sender: Any) { } } ## Instruction: Load user avatar file and display it as a circle. ## Code After: // // FriendUserCell.swift // RoadTripPlanner // // Created by Diana Fisher on 10/23/17. // Copyright © 2017 RoadTripPlanner. All rights reserved. // import UIKit import Parse class FriendUserCell: UITableViewCell { @IBOutlet weak var avatarImageView: UIImageView! @IBOutlet weak var usernameLabel: UILabel! @IBOutlet weak var addRemoveButton: UIButton! var user: PFUser! { didSet { usernameLabel.text = user.username guard let avatarFile = user.avatarFile else { return } Utils.fileToImage(file: avatarFile) { (image) in self.avatarImageView.image = image } } } override func awakeFromNib() { super.awakeFromNib() avatarImageView.layer.cornerRadius = avatarImageView.frame.size.height / 2 avatarImageView.clipsToBounds = true } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) // Configure the view for the selected state } @IBAction func addRemoveButtonPressed(_ sender: Any) { } }
// // FriendUserCell.swift // RoadTripPlanner // // Created by Diana Fisher on 10/23/17. // Copyright © 2017 RoadTripPlanner. All rights reserved. // import UIKit import Parse class FriendUserCell: UITableViewCell { @IBOutlet weak var avatarImageView: UIImageView! @IBOutlet weak var usernameLabel: UILabel! @IBOutlet weak var addRemoveButton: UIButton! - var avatarFile: PFFile? - var user: PFUser! { didSet { usernameLabel.text = user.username - avatarFile = user.avatarFile + guard let avatarFile = user.avatarFile else { return } ? ++++++++++ ++++++++++++++++ + + Utils.fileToImage(file: avatarFile) { (image) in + self.avatarImageView.image = image + } } } override func awakeFromNib() { super.awakeFromNib() + avatarImageView.layer.cornerRadius = avatarImageView.frame.size.height / 2 + avatarImageView.clipsToBounds = true - guard let avatarFile = self.avatarFile else { return } - Utils.fileToImage(file: avatarFile) { (image) in - self.avatarImageView.image = image - } } override func setSelected(_ selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) // Configure the view for the selected state } @IBAction func addRemoveButtonPressed(_ sender: Any) { } }
14
0.311111
7
7
b7e463b4b7cf28f9c10e9b81e33f6a56369b0919
.drone.yml
.drone.yml
cache: mount: - node_modules build: image: node:wheezy commands: - npm install --unsafe-perm - npm run build branches: - master - develop
cache: mount: - node_modules build: image: node:wheezy commands: - npm install --unsafe-perm - npm run build deploy: ssh: host: hoogit.ca user: use port: 22 commands: - echo docker restart powerhour-staging when: branch: develop ssh: host: hoogit.ca user: use port: 22 commands: - echo docker restart powerhour when: branch: master branches: - master - develop
Add deploy to build file
Add deploy to build file
YAML
mit
jordond/powerhour-site,jordond/powerhour-site,jordond/powerhour-site
yaml
## Code Before: cache: mount: - node_modules build: image: node:wheezy commands: - npm install --unsafe-perm - npm run build branches: - master - develop ## Instruction: Add deploy to build file ## Code After: cache: mount: - node_modules build: image: node:wheezy commands: - npm install --unsafe-perm - npm run build deploy: ssh: host: hoogit.ca user: use port: 22 commands: - echo docker restart powerhour-staging when: branch: develop ssh: host: hoogit.ca user: use port: 22 commands: - echo docker restart powerhour when: branch: master branches: - master - develop
cache: mount: - node_modules build: image: node:wheezy commands: - npm install --unsafe-perm - npm run build + + deploy: + ssh: + host: hoogit.ca + user: use + port: 22 + commands: + - echo docker restart powerhour-staging + when: + branch: develop + ssh: + host: hoogit.ca + user: use + port: 22 + commands: + - echo docker restart powerhour + when: + branch: master branches: - master - develop
18
1.636364
18
0
9646ce40f5b9cbdb5c40359a43c89274734df68d
doc/contents.rst
doc/contents.rst
====================== Salt Table of Contents ====================== .. toctree:: :maxdepth: 2 :glob: :numbered: topics/index topics/installation/index topics/tutorials/index topics/targeting/index topics/pillar/index topics/reactor/index topics/mine/index topics/eauth/index topics/jobs/index topics/event/index topics/topology/index topics/windows/index topics/cloud/index topics/virt/index topics/yaml/index topics/master_tops/index topics/ssh/* ref/index topics/troubleshooting/index topics/development/index topics/releases/index topics/projects/index faq glossary
====================== Salt Table of Contents ====================== .. toctree:: :maxdepth: 2 :glob: :numbered: topics/index topics/installation/index topics/tutorials/index topics/targeting/index topics/pillar/index topics/reactor/index topics/mine/index topics/eauth/index topics/jobs/index topics/event/index topics/topology/index topics/windows/index topics/cloud/index topics/virt/index topics/yaml/index topics/master_tops/index topics/ssh/* ref/index topics/best_practices topics/troubleshooting/index topics/development/index topics/releases/index topics/projects/index faq glossary
Add best_practices page to docs
Add best_practices page to docs
reStructuredText
apache-2.0
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
restructuredtext
## Code Before: ====================== Salt Table of Contents ====================== .. toctree:: :maxdepth: 2 :glob: :numbered: topics/index topics/installation/index topics/tutorials/index topics/targeting/index topics/pillar/index topics/reactor/index topics/mine/index topics/eauth/index topics/jobs/index topics/event/index topics/topology/index topics/windows/index topics/cloud/index topics/virt/index topics/yaml/index topics/master_tops/index topics/ssh/* ref/index topics/troubleshooting/index topics/development/index topics/releases/index topics/projects/index faq glossary ## Instruction: Add best_practices page to docs ## Code After: ====================== Salt Table of Contents ====================== .. toctree:: :maxdepth: 2 :glob: :numbered: topics/index topics/installation/index topics/tutorials/index topics/targeting/index topics/pillar/index topics/reactor/index topics/mine/index topics/eauth/index topics/jobs/index topics/event/index topics/topology/index topics/windows/index topics/cloud/index topics/virt/index topics/yaml/index topics/master_tops/index topics/ssh/* ref/index topics/best_practices topics/troubleshooting/index topics/development/index topics/releases/index topics/projects/index faq glossary
====================== Salt Table of Contents ====================== .. toctree:: :maxdepth: 2 :glob: :numbered: topics/index topics/installation/index topics/tutorials/index topics/targeting/index topics/pillar/index topics/reactor/index topics/mine/index topics/eauth/index topics/jobs/index topics/event/index topics/topology/index topics/windows/index topics/cloud/index topics/virt/index topics/yaml/index topics/master_tops/index topics/ssh/* ref/index + topics/best_practices topics/troubleshooting/index topics/development/index topics/releases/index topics/projects/index faq glossary
1
0.030303
1
0
21c240f162e5eb3ea636f67b5b4161d811b839b9
.travis.yml
.travis.yml
language: go go: - 1.8 install: - mkdir -p $HOME/gopath/src/k8s.io - mv $TRAVIS_BUILD_DIR $HOME/gopath/src/k8s.io/kube-state-metrics script: - make test-unit - make
language: go go: - 1.8 install: - mkdir -p $HOME/gopath/src/k8s.io - mv $TRAVIS_BUILD_DIR $HOME/gopath/src/k8s.io/kube-state-metrics jobs: include: - stage: Unit Test script: make test-unit - stage: Build script: make
Split the UT and Build in different Stages
Split the UT and Build in different Stages
YAML
apache-2.0
kubernetes/kube-state-metrics,kubernetes/kube-state-metrics
yaml
## Code Before: language: go go: - 1.8 install: - mkdir -p $HOME/gopath/src/k8s.io - mv $TRAVIS_BUILD_DIR $HOME/gopath/src/k8s.io/kube-state-metrics script: - make test-unit - make ## Instruction: Split the UT and Build in different Stages ## Code After: language: go go: - 1.8 install: - mkdir -p $HOME/gopath/src/k8s.io - mv $TRAVIS_BUILD_DIR $HOME/gopath/src/k8s.io/kube-state-metrics jobs: include: - stage: Unit Test script: make test-unit - stage: Build script: make
language: go go: - 1.8 install: - mkdir -p $HOME/gopath/src/k8s.io - mv $TRAVIS_BUILD_DIR $HOME/gopath/src/k8s.io/kube-state-metrics - script: - - make test-unit - - make + jobs: + include: + - stage: Unit Test + script: make test-unit + - stage: Build + script: make
9
1
6
3
b9fcd270f520f49fcbe85bcbc53940326f556fdf
Lib/test/test_import.py
Lib/test/test_import.py
from test_support import TESTFN import os import random source = TESTFN + ".py" pyc = TESTFN + ".pyc" pyo = TESTFN + ".pyo" f = open(source, "w") print >> f, "# This will test Python's ability to import a .py file" a = random.randrange(1000) b = random.randrange(1000) print >> f, "a =", a print >> f, "b =", b f.close() try: try: mod = __import__(TESTFN) except ImportError, err: raise ValueError, "import from .py failed: %s" % err if mod.a != a or mod.b != b: print a, "!=", mod.a print b, "!=", mod.b raise ValueError, "module loaded (%s) but contents invalid" % mod finally: os.unlink(source) try: try: reload(mod) except ImportError, err: raise ValueError, "import from .pyc/.pyo failed: %s" % err finally: try: os.unlink(pyc) except os.error: pass try: os.unlink(pyo) except os.error: pass
from test_support import TESTFN import os import random import sys sys.path.insert(0, os.curdir) source = TESTFN + ".py" pyc = TESTFN + ".pyc" pyo = TESTFN + ".pyo" f = open(source, "w") print >> f, "# This will test Python's ability to import a .py file" a = random.randrange(1000) b = random.randrange(1000) print >> f, "a =", a print >> f, "b =", b f.close() try: try: mod = __import__(TESTFN) except ImportError, err: raise ValueError, "import from .py failed: %s" % err if mod.a != a or mod.b != b: print a, "!=", mod.a print b, "!=", mod.b raise ValueError, "module loaded (%s) but contents invalid" % mod finally: os.unlink(source) try: try: reload(mod) except ImportError, err: raise ValueError, "import from .pyc/.pyo failed: %s" % err finally: try: os.unlink(pyc) except os.error: pass try: os.unlink(pyo) except os.error: pass del sys.path[0]
Insert the current directory to the front of sys.path -- and remove it at the end. This fixes a problem where
Insert the current directory to the front of sys.path -- and remove it at the end. This fixes a problem where python Lib/test/test_import.py failed while "make test" succeeded.
Python
mit
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
python
## Code Before: from test_support import TESTFN import os import random source = TESTFN + ".py" pyc = TESTFN + ".pyc" pyo = TESTFN + ".pyo" f = open(source, "w") print >> f, "# This will test Python's ability to import a .py file" a = random.randrange(1000) b = random.randrange(1000) print >> f, "a =", a print >> f, "b =", b f.close() try: try: mod = __import__(TESTFN) except ImportError, err: raise ValueError, "import from .py failed: %s" % err if mod.a != a or mod.b != b: print a, "!=", mod.a print b, "!=", mod.b raise ValueError, "module loaded (%s) but contents invalid" % mod finally: os.unlink(source) try: try: reload(mod) except ImportError, err: raise ValueError, "import from .pyc/.pyo failed: %s" % err finally: try: os.unlink(pyc) except os.error: pass try: os.unlink(pyo) except os.error: pass ## Instruction: Insert the current directory to the front of sys.path -- and remove it at the end. This fixes a problem where python Lib/test/test_import.py failed while "make test" succeeded. ## Code After: from test_support import TESTFN import os import random import sys sys.path.insert(0, os.curdir) source = TESTFN + ".py" pyc = TESTFN + ".pyc" pyo = TESTFN + ".pyo" f = open(source, "w") print >> f, "# This will test Python's ability to import a .py file" a = random.randrange(1000) b = random.randrange(1000) print >> f, "a =", a print >> f, "b =", b f.close() try: try: mod = __import__(TESTFN) except ImportError, err: raise ValueError, "import from .py failed: %s" % err if mod.a != a or mod.b != b: print a, "!=", mod.a print b, "!=", mod.b raise ValueError, "module loaded (%s) but contents invalid" % mod finally: os.unlink(source) try: try: reload(mod) except ImportError, err: raise ValueError, "import from .pyc/.pyo failed: %s" % err finally: try: os.unlink(pyc) except os.error: pass try: os.unlink(pyo) except os.error: pass del sys.path[0]
from test_support import TESTFN import os import random + import sys + + sys.path.insert(0, os.curdir) source = TESTFN + ".py" pyc = TESTFN + ".pyc" pyo = TESTFN + ".pyo" f = open(source, "w") print >> f, "# This will test Python's ability to import a .py file" a = random.randrange(1000) b = random.randrange(1000) print >> f, "a =", a print >> f, "b =", b f.close() try: try: mod = __import__(TESTFN) except ImportError, err: raise ValueError, "import from .py failed: %s" % err if mod.a != a or mod.b != b: print a, "!=", mod.a print b, "!=", mod.b raise ValueError, "module loaded (%s) but contents invalid" % mod finally: os.unlink(source) try: try: reload(mod) except ImportError, err: raise ValueError, "import from .pyc/.pyo failed: %s" % err finally: try: os.unlink(pyc) except os.error: pass try: os.unlink(pyo) except os.error: pass + + del sys.path[0]
5
0.113636
5
0
f7bee4fa77ed4d294a646044296f7f999b3a0d21
pawn.json
pawn.json
{ "user": "JaTochNietDan", "repo": "SA-MP-FileManager", "resources": [ { "name": "^FileManager_1.5.Linux.zip$", "platform": "linux", "archive": true, "includes": ["filemanager.inc"], "plugins": ["FileManager.so"] }, { "name": "^FileManager_1.5.Linux.zip$", "platform": "windows", "archive": true, "includes": ["filemanager.inc"], "plugins": ["FileManager.dll"] } ], "runtime": { "plugins": ["JaTochNietDan/SA-MP-FileManager"] } }
{ "user": "ICJefferson", "repo": "SA-MP-FileManager", "resources": [ { "name": "^FileManager_1.5.Linux.zip$", "platform": "linux", "archive": true, "includes": ["filemanager.inc"], "plugins": ["FileManager.so"] }, { "name": "^FileManager_1.5.Linux.zip$", "platform": "windows", "archive": true, "includes": ["filemanager.inc"], "plugins": ["FileManager.dll"] } ], "runtime": { "plugins": ["ICJefferson/SA-MP-FileManager"] } }
Change in values to test it
Change in values to test it
JSON
mit
JaTochNietDan/SA-MP-FileManager,JaTochNietDan/SA-MP-FileManager
json
## Code Before: { "user": "JaTochNietDan", "repo": "SA-MP-FileManager", "resources": [ { "name": "^FileManager_1.5.Linux.zip$", "platform": "linux", "archive": true, "includes": ["filemanager.inc"], "plugins": ["FileManager.so"] }, { "name": "^FileManager_1.5.Linux.zip$", "platform": "windows", "archive": true, "includes": ["filemanager.inc"], "plugins": ["FileManager.dll"] } ], "runtime": { "plugins": ["JaTochNietDan/SA-MP-FileManager"] } } ## Instruction: Change in values to test it ## Code After: { "user": "ICJefferson", "repo": "SA-MP-FileManager", "resources": [ { "name": "^FileManager_1.5.Linux.zip$", "platform": "linux", "archive": true, "includes": ["filemanager.inc"], "plugins": ["FileManager.so"] }, { "name": "^FileManager_1.5.Linux.zip$", "platform": "windows", "archive": true, "includes": ["filemanager.inc"], "plugins": ["FileManager.dll"] } ], "runtime": { "plugins": ["ICJefferson/SA-MP-FileManager"] } }
{ - "user": "JaTochNietDan", + "user": "ICJefferson", "repo": "SA-MP-FileManager", "resources": [ { "name": "^FileManager_1.5.Linux.zip$", "platform": "linux", "archive": true, "includes": ["filemanager.inc"], "plugins": ["FileManager.so"] }, { "name": "^FileManager_1.5.Linux.zip$", "platform": "windows", "archive": true, "includes": ["filemanager.inc"], "plugins": ["FileManager.dll"] } ], "runtime": { - "plugins": ["JaTochNietDan/SA-MP-FileManager"] ? ^^ -------- + "plugins": ["ICJefferson/SA-MP-FileManager"] ? ++ ^^^^^^ } }
4
0.173913
2
2
9c09f5c8143d57deafe898cc4004215ca86f9b2a
0.17.0-release-notes.md
0.17.0-release-notes.md
This is the draft release notes for 0.17.0, scheduled to be released on 2022-01-01.
This is the draft release notes for 0.17.0, scheduled to be released on 2022-01-01. # Notable new features New features in the interactive editor: - Editor modes now form a stack, instead of being mutually exclusive. For example, it is now possible to start a minibuf mode within a completion mode, and vice versa.
Document stackable modes in 0.17.0 release notes.
Document stackable modes in 0.17.0 release notes.
Markdown
bsd-2-clause
elves/elvish,elves/elvish,elves/elvish,elves/elvish,elves/elvish
markdown
## Code Before: This is the draft release notes for 0.17.0, scheduled to be released on 2022-01-01. ## Instruction: Document stackable modes in 0.17.0 release notes. ## Code After: This is the draft release notes for 0.17.0, scheduled to be released on 2022-01-01. # Notable new features New features in the interactive editor: - Editor modes now form a stack, instead of being mutually exclusive. For example, it is now possible to start a minibuf mode within a completion mode, and vice versa.
This is the draft release notes for 0.17.0, scheduled to be released on 2022-01-01. + + # Notable new features + + New features in the interactive editor: + + - Editor modes now form a stack, instead of being mutually exclusive. For + example, it is now possible to start a minibuf mode within a completion + mode, and vice versa.
8
4
8
0
cf3299b4a7621128279ec8a6ab928e95fd5848b3
ldso/ldso/sh/dl-syscalls.h
ldso/ldso/sh/dl-syscalls.h
/* We can't use the real errno in ldso, since it has not yet * been dynamicly linked in yet. */ #include "sys/syscall.h" extern int _dl_errno; #undef __set_errno #define __set_errno(X) {(_dl_errno) = (X);}
/* We can't use the real errno in ldso, since it has not yet * been dynamicly linked in yet. */ #include "sys/syscall.h" extern int _dl_errno; #undef __set_errno #define __set_errno(X) {(_dl_errno) = (X);} #warning !!! __always_inline redefined waiting for the fixed gcc #ifdef __always_inline #undef __always_inline #define __always_inline inline #endif
Make sh4 build works again adding a temporary work-around iby redefining __always_inline to inline until gcc 4.x.x will get fixed.
Make sh4 build works again adding a temporary work-around iby redefining __always_inline to inline until gcc 4.x.x will get fixed. Signed-off-by: Carmelo Amoroso <[email protected]>
C
lgpl-2.1
hjl-tools/uClibc,kraj/uClibc,waweber/uclibc-clang,foss-xtensa/uClibc,atgreen/uClibc-moxie,OpenInkpot-archive/iplinux-uclibc,gittup/uClibc,kraj/uClibc,m-labs/uclibc-lm32,mephi42/uClibc,groundwater/uClibc,atgreen/uClibc-moxie,OpenInkpot-archive/iplinux-uclibc,ysat0/uClibc,brgl/uclibc-ng,ysat0/uClibc,ndmsystems/uClibc,groundwater/uClibc,mephi42/uClibc,foss-for-synopsys-dwc-arc-processors/uClibc,groundwater/uClibc,foss-xtensa/uClibc,hwoarang/uClibc,majek/uclibc-vx32,hjl-tools/uClibc,atgreen/uClibc-moxie,hjl-tools/uClibc,groundwater/uClibc,OpenInkpot-archive/iplinux-uclibc,brgl/uclibc-ng,m-labs/uclibc-lm32,kraj/uClibc,skristiansson/uClibc-or1k,mephi42/uClibc,brgl/uclibc-ng,kraj/uclibc-ng,m-labs/uclibc-lm32,atgreen/uClibc-moxie,wbx-github/uclibc-ng,majek/uclibc-vx32,majek/uclibc-vx32,ddcc/klee-uclibc-0.9.33.2,skristiansson/uClibc-or1k,foss-for-synopsys-dwc-arc-processors/uClibc,brgl/uclibc-ng,OpenInkpot-archive/iplinux-uclibc,ddcc/klee-uclibc-0.9.33.2,ddcc/klee-uclibc-0.9.33.2,foss-for-synopsys-dwc-arc-processors/uClibc,waweber/uclibc-clang,skristiansson/uClibc-or1k,kraj/uclibc-ng,groundwater/uClibc,kraj/uClibc,skristiansson/uClibc-or1k,kraj/uclibc-ng,waweber/uclibc-clang,kraj/uclibc-ng,mephi42/uClibc,hwoarang/uClibc,foss-xtensa/uClibc,hjl-tools/uClibc,gittup/uClibc,ffainelli/uClibc,ffainelli/uClibc,czankel/xtensa-uclibc,ndmsystems/uClibc,ddcc/klee-uclibc-0.9.33.2,hjl-tools/uClibc,ysat0/uClibc,czankel/xtensa-uclibc,m-labs/uclibc-lm32,foss-xtensa/uClibc,ffainelli/uClibc,czankel/xtensa-uclibc,wbx-github/uclibc-ng,gittup/uClibc,ysat0/uClibc,wbx-github/uclibc-ng,ndmsystems/uClibc,hwoarang/uClibc,czankel/xtensa-uclibc,ffainelli/uClibc,foss-for-synopsys-dwc-arc-processors/uClibc,ffainelli/uClibc,hwoarang/uClibc,ndmsystems/uClibc,waweber/uclibc-clang,wbx-github/uclibc-ng,gittup/uClibc,majek/uclibc-vx32
c
## Code Before: /* We can't use the real errno in ldso, since it has not yet * been dynamicly linked in yet. */ #include "sys/syscall.h" extern int _dl_errno; #undef __set_errno #define __set_errno(X) {(_dl_errno) = (X);} ## Instruction: Make sh4 build works again adding a temporary work-around iby redefining __always_inline to inline until gcc 4.x.x will get fixed. Signed-off-by: Carmelo Amoroso <[email protected]> ## Code After: /* We can't use the real errno in ldso, since it has not yet * been dynamicly linked in yet. */ #include "sys/syscall.h" extern int _dl_errno; #undef __set_errno #define __set_errno(X) {(_dl_errno) = (X);} #warning !!! __always_inline redefined waiting for the fixed gcc #ifdef __always_inline #undef __always_inline #define __always_inline inline #endif
/* We can't use the real errno in ldso, since it has not yet * been dynamicly linked in yet. */ #include "sys/syscall.h" extern int _dl_errno; #undef __set_errno #define __set_errno(X) {(_dl_errno) = (X);} + #warning !!! __always_inline redefined waiting for the fixed gcc + #ifdef __always_inline + #undef __always_inline + #define __always_inline inline + #endif
5
0.833333
5
0
dc6ac594e3dda30aed2087f4ed63d651eff1f36c
system/path.bash
system/path.bash
PATH=/usr/local/bin:$PATH # .dotfiles bin PATH=$DOT/bin:$PATH
PATH=/usr/local/bin:/usr/local/sbin:$PATH # .dotfiles bin PATH=$DOT/bin:$PATH
Add homebrew's sbin to PATH
Add homebrew's sbin to PATH
Shell
mit
crystal1009/dotfiles,crystal1009/dotfiles,crystal1009/dotfiles
shell
## Code Before: PATH=/usr/local/bin:$PATH # .dotfiles bin PATH=$DOT/bin:$PATH ## Instruction: Add homebrew's sbin to PATH ## Code After: PATH=/usr/local/bin:/usr/local/sbin:$PATH # .dotfiles bin PATH=$DOT/bin:$PATH
- PATH=/usr/local/bin:$PATH + PATH=/usr/local/bin:/usr/local/sbin:$PATH ? ++++++++++++++++ # .dotfiles bin PATH=$DOT/bin:$PATH
2
0.5
1
1
76c3fbd6510374e8eff83259dc51e094015d4b31
java/src/main/java/org/rocksdb/ReadTier.java
java/src/main/java/org/rocksdb/ReadTier.java
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved. // This source code is licensed under both the GPLv2 (found in the // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). package org.rocksdb; /** * RocksDB {@link ReadOptions} read tiers. */ public enum ReadTier { READ_ALL_TIER((byte)0), BLOCK_CACHE_TIER((byte)1), PERSISTED_TIER((byte)2); private final byte value; ReadTier(final byte value) { this.value = value; } /** * Returns the byte value of the enumerations value * * @return byte representation */ public byte getValue() { return value; } /** * Get ReadTier by byte value. * * @param value byte representation of ReadTier. * * @return {@link org.rocksdb.ReadTier} instance or null. * @throws java.lang.IllegalArgumentException if an invalid * value is provided. */ public static ReadTier getReadTier(final byte value) { for (final ReadTier readTier : ReadTier.values()) { if (readTier.getValue() == value){ return readTier; } } throw new IllegalArgumentException("Illegal value provided for ReadTier."); } }
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved. // This source code is licensed under both the GPLv2 (found in the // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). package org.rocksdb; /** * RocksDB {@link ReadOptions} read tiers. */ public enum ReadTier { READ_ALL_TIER((byte)0), BLOCK_CACHE_TIER((byte)1), PERSISTED_TIER((byte)2), MEMTABLE_TIER((byte)3); private final byte value; ReadTier(final byte value) { this.value = value; } /** * Returns the byte value of the enumerations value * * @return byte representation */ public byte getValue() { return value; } /** * Get ReadTier by byte value. * * @param value byte representation of ReadTier. * * @return {@link org.rocksdb.ReadTier} instance or null. * @throws java.lang.IllegalArgumentException if an invalid * value is provided. */ public static ReadTier getReadTier(final byte value) { for (final ReadTier readTier : ReadTier.values()) { if (readTier.getValue() == value){ return readTier; } } throw new IllegalArgumentException("Illegal value provided for ReadTier."); } }
Add Memtable Read Tier to RocksJava
Add Memtable Read Tier to RocksJava Summary: This options was introduced in the C++ API in #1953 . Closes https://github.com/facebook/rocksdb/pull/3064 Differential Revision: D6139010 Pulled By: sagar0 fbshipit-source-id: 164de11d539d174cf3afe7cd40e667049f44b0bc
Java
bsd-3-clause
SunguckLee/RocksDB,Andymic/rocksdb,bbiao/rocksdb,bbiao/rocksdb,Andymic/rocksdb,SunguckLee/RocksDB,SunguckLee/RocksDB,SunguckLee/RocksDB,Andymic/rocksdb,SunguckLee/RocksDB,SunguckLee/RocksDB,SunguckLee/RocksDB,SunguckLee/RocksDB,bbiao/rocksdb,Andymic/rocksdb,bbiao/rocksdb,bbiao/rocksdb,Andymic/rocksdb,Andymic/rocksdb,bbiao/rocksdb,bbiao/rocksdb,Andymic/rocksdb,bbiao/rocksdb,Andymic/rocksdb
java
## Code Before: // Copyright (c) 2011-present, Facebook, Inc. All rights reserved. // This source code is licensed under both the GPLv2 (found in the // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). package org.rocksdb; /** * RocksDB {@link ReadOptions} read tiers. */ public enum ReadTier { READ_ALL_TIER((byte)0), BLOCK_CACHE_TIER((byte)1), PERSISTED_TIER((byte)2); private final byte value; ReadTier(final byte value) { this.value = value; } /** * Returns the byte value of the enumerations value * * @return byte representation */ public byte getValue() { return value; } /** * Get ReadTier by byte value. * * @param value byte representation of ReadTier. * * @return {@link org.rocksdb.ReadTier} instance or null. * @throws java.lang.IllegalArgumentException if an invalid * value is provided. */ public static ReadTier getReadTier(final byte value) { for (final ReadTier readTier : ReadTier.values()) { if (readTier.getValue() == value){ return readTier; } } throw new IllegalArgumentException("Illegal value provided for ReadTier."); } } ## Instruction: Add Memtable Read Tier to RocksJava Summary: This options was introduced in the C++ API in #1953 . Closes https://github.com/facebook/rocksdb/pull/3064 Differential Revision: D6139010 Pulled By: sagar0 fbshipit-source-id: 164de11d539d174cf3afe7cd40e667049f44b0bc ## Code After: // Copyright (c) 2011-present, Facebook, Inc. All rights reserved. // This source code is licensed under both the GPLv2 (found in the // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). package org.rocksdb; /** * RocksDB {@link ReadOptions} read tiers. */ public enum ReadTier { READ_ALL_TIER((byte)0), BLOCK_CACHE_TIER((byte)1), PERSISTED_TIER((byte)2), MEMTABLE_TIER((byte)3); private final byte value; ReadTier(final byte value) { this.value = value; } /** * Returns the byte value of the enumerations value * * @return byte representation */ public byte getValue() { return value; } /** * Get ReadTier by byte value. * * @param value byte representation of ReadTier. * * @return {@link org.rocksdb.ReadTier} instance or null. * @throws java.lang.IllegalArgumentException if an invalid * value is provided. */ public static ReadTier getReadTier(final byte value) { for (final ReadTier readTier : ReadTier.values()) { if (readTier.getValue() == value){ return readTier; } } throw new IllegalArgumentException("Illegal value provided for ReadTier."); } }
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved. // This source code is licensed under both the GPLv2 (found in the // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). package org.rocksdb; /** * RocksDB {@link ReadOptions} read tiers. */ public enum ReadTier { READ_ALL_TIER((byte)0), BLOCK_CACHE_TIER((byte)1), - PERSISTED_TIER((byte)2); ? ^ + PERSISTED_TIER((byte)2), ? ^ + MEMTABLE_TIER((byte)3); private final byte value; ReadTier(final byte value) { this.value = value; } /** * Returns the byte value of the enumerations value * * @return byte representation */ public byte getValue() { return value; } /** * Get ReadTier by byte value. * * @param value byte representation of ReadTier. * * @return {@link org.rocksdb.ReadTier} instance or null. * @throws java.lang.IllegalArgumentException if an invalid * value is provided. */ public static ReadTier getReadTier(final byte value) { for (final ReadTier readTier : ReadTier.values()) { if (readTier.getValue() == value){ return readTier; } } throw new IllegalArgumentException("Illegal value provided for ReadTier."); } }
3
0.0625
2
1
fa495f9f2f887533f870ddedef3a1aea0a699419
oscar/management/commands/oscar_fork_statics.py
oscar/management/commands/oscar_fork_statics.py
import logging import os import shutil from django.db.models import get_model from django.conf import settings from django.core.management.base import BaseCommand, CommandError ProductAlert = get_model('customer', 'ProductAlert') logger = logging.getLogger(__name__) class Command(BaseCommand): """ Copy Oscar's statics into local project so they can be used as a base for styling a new site. """ args = '<destination folder>' help = "Copy Oscar's static files" def handle(self, *args, **options): # Determine where to copy to folder = args[0] if args else 'static' if not folder.startswith('/'): destination = os.path.join(os.getcwd(), folder) else: destination = folder if os.path.exists(destination): raise CommandError( "The folder %s already exists - aborting!" % destination) source = os.path.realpath( os.path.join(os.path.dirname(__file__), '../../static')) print "Copying Oscar's static files to %s" % (source, destination) shutil.copytree(source, destination) # Check if this new folder is in STATICFILES_DIRS if destination not in settings.STATICFILES_DIRS: print ("You need to add %s to STATICFILES_DIRS in order for your " "local overrides to be picked up") % destination
import logging import os import shutil from django.conf import settings from django.core.management.base import BaseCommand, CommandError logger = logging.getLogger(__name__) class Command(BaseCommand): """ Copy Oscar's statics into local project so they can be used as a base for styling a new site. """ args = '<destination folder>' help = "Copy Oscar's static files" def handle(self, *args, **options): # Determine where to copy to folder = args[0] if args else 'static' if not folder.startswith('/'): destination = os.path.join(os.getcwd(), folder) else: destination = folder if os.path.exists(destination): raise CommandError( "The folder %s already exists - aborting!" % destination) source = os.path.realpath( os.path.join(os.path.dirname(__file__), '../../static')) print "Copying Oscar's static files to %s" % (destination,) shutil.copytree(source, destination) # Check if this new folder is in STATICFILES_DIRS if destination not in settings.STATICFILES_DIRS: print ("You need to add %s to STATICFILES_DIRS in order for your " "local overrides to be picked up") % destination
Fix string formatting bug in fork_statics man. command
Fix string formatting bug in fork_statics man. command
Python
bsd-3-clause
amirrpp/django-oscar,kapt/django-oscar,ademuk/django-oscar,nickpack/django-oscar,eddiep1101/django-oscar,bschuon/django-oscar,vovanbo/django-oscar,pasqualguerrero/django-oscar,Jannes123/django-oscar,elliotthill/django-oscar,taedori81/django-oscar,marcoantoniooliveira/labweb,sonofatailor/django-oscar,ahmetdaglarbas/e-commerce,ademuk/django-oscar,okfish/django-oscar,manevant/django-oscar,mexeniz/django-oscar,ademuk/django-oscar,jinnykoo/christmas,QLGu/django-oscar,bnprk/django-oscar,bschuon/django-oscar,ka7eh/django-oscar,WadeYuChen/django-oscar,john-parton/django-oscar,binarydud/django-oscar,WillisXChen/django-oscar,kapari/django-oscar,lijoantony/django-oscar,thechampanurag/django-oscar,sasha0/django-oscar,anentropic/django-oscar,anentropic/django-oscar,taedori81/django-oscar,kapt/django-oscar,eddiep1101/django-oscar,john-parton/django-oscar,MatthewWilkes/django-oscar,rocopartners/django-oscar,pdonadeo/django-oscar,elliotthill/django-oscar,django-oscar/django-oscar,jinnykoo/wuyisj.com,pasqualguerrero/django-oscar,solarissmoke/django-oscar,mexeniz/django-oscar,elliotthill/django-oscar,ka7eh/django-oscar,manevant/django-oscar,solarissmoke/django-oscar,rocopartners/django-oscar,kapari/django-oscar,jinnykoo/wuyisj.com,nfletton/django-oscar,makielab/django-oscar,bschuon/django-oscar,dongguangming/django-oscar,sonofatailor/django-oscar,ahmetdaglarbas/e-commerce,MatthewWilkes/django-oscar,dongguangming/django-oscar,saadatqadri/django-oscar,machtfit/django-oscar,eddiep1101/django-oscar,dongguangming/django-oscar,nickpack/django-oscar,jmt4/django-oscar,Jannes123/django-oscar,amirrpp/django-oscar,binarydud/django-oscar,lijoantony/django-oscar,WadeYuChen/django-oscar,itbabu/django-oscar,QLGu/django-oscar,michaelkuty/django-oscar,jlmadurga/django-oscar,bschuon/django-oscar,okfish/django-oscar,bnprk/django-oscar,vovanbo/django-oscar,faratro/django-oscar,sasha0/django-oscar,faratro/django-oscar,solarissmoke/django-oscar,monikasulik/django-oscar,Jannes123/django-oscar,nfletton/django-oscar,manevant/django-oscar,josesanch/django-oscar,eddiep1101/django-oscar,mexeniz/django-oscar,adamend/django-oscar,jinnykoo/wuyisj,lijoantony/django-oscar,jinnykoo/wuyisj.com,jlmadurga/django-oscar,ademuk/django-oscar,jinnykoo/christmas,nickpack/django-oscar,makielab/django-oscar,dongguangming/django-oscar,itbabu/django-oscar,Jannes123/django-oscar,pdonadeo/django-oscar,django-oscar/django-oscar,vovanbo/django-oscar,josesanch/django-oscar,Idematica/django-oscar,thechampanurag/django-oscar,adamend/django-oscar,jinnykoo/wuyisj,bnprk/django-oscar,ahmetdaglarbas/e-commerce,pdonadeo/django-oscar,WillisXChen/django-oscar,nfletton/django-oscar,michaelkuty/django-oscar,marcoantoniooliveira/labweb,DrOctogon/unwash_ecom,monikasulik/django-oscar,django-oscar/django-oscar,amirrpp/django-oscar,WillisXChen/django-oscar,ka7eh/django-oscar,sonofatailor/django-oscar,manevant/django-oscar,WillisXChen/django-oscar,MatthewWilkes/django-oscar,okfish/django-oscar,jinnykoo/wuyisj,lijoantony/django-oscar,saadatqadri/django-oscar,WillisXChen/django-oscar,spartonia/django-oscar,nfletton/django-oscar,taedori81/django-oscar,Bogh/django-oscar,john-parton/django-oscar,binarydud/django-oscar,spartonia/django-oscar,machtfit/django-oscar,Idematica/django-oscar,makielab/django-oscar,jmt4/django-oscar,anentropic/django-oscar,sonofatailor/django-oscar,jlmadurga/django-oscar,spartonia/django-oscar,itbabu/django-oscar,spartonia/django-oscar,QLGu/django-oscar,binarydud/django-oscar,kapari/django-oscar,DrOctogon/unwash_ecom,rocopartners/django-oscar,DrOctogon/unwash_ecom,jinnykoo/christmas,ka7eh/django-oscar,pasqualguerrero/django-oscar,jmt4/django-oscar,michaelkuty/django-oscar,pasqualguerrero/django-oscar,Bogh/django-oscar,taedori81/django-oscar,Idematica/django-oscar,jinnykoo/wuyisj.com,MatthewWilkes/django-oscar,jinnykoo/wuyisj,adamend/django-oscar,Bogh/django-oscar,solarissmoke/django-oscar,kapt/django-oscar,WillisXChen/django-oscar,saadatqadri/django-oscar,michaelkuty/django-oscar,Bogh/django-oscar,pdonadeo/django-oscar,faratro/django-oscar,mexeniz/django-oscar,kapari/django-oscar,thechampanurag/django-oscar,monikasulik/django-oscar,itbabu/django-oscar,bnprk/django-oscar,nickpack/django-oscar,sasha0/django-oscar,saadatqadri/django-oscar,josesanch/django-oscar,WadeYuChen/django-oscar,sasha0/django-oscar,vovanbo/django-oscar,monikasulik/django-oscar,jmt4/django-oscar,adamend/django-oscar,john-parton/django-oscar,thechampanurag/django-oscar,machtfit/django-oscar,marcoantoniooliveira/labweb,jlmadurga/django-oscar,QLGu/django-oscar,django-oscar/django-oscar,rocopartners/django-oscar,makielab/django-oscar,faratro/django-oscar,okfish/django-oscar,anentropic/django-oscar,WadeYuChen/django-oscar,marcoantoniooliveira/labweb,amirrpp/django-oscar,ahmetdaglarbas/e-commerce
python
## Code Before: import logging import os import shutil from django.db.models import get_model from django.conf import settings from django.core.management.base import BaseCommand, CommandError ProductAlert = get_model('customer', 'ProductAlert') logger = logging.getLogger(__name__) class Command(BaseCommand): """ Copy Oscar's statics into local project so they can be used as a base for styling a new site. """ args = '<destination folder>' help = "Copy Oscar's static files" def handle(self, *args, **options): # Determine where to copy to folder = args[0] if args else 'static' if not folder.startswith('/'): destination = os.path.join(os.getcwd(), folder) else: destination = folder if os.path.exists(destination): raise CommandError( "The folder %s already exists - aborting!" % destination) source = os.path.realpath( os.path.join(os.path.dirname(__file__), '../../static')) print "Copying Oscar's static files to %s" % (source, destination) shutil.copytree(source, destination) # Check if this new folder is in STATICFILES_DIRS if destination not in settings.STATICFILES_DIRS: print ("You need to add %s to STATICFILES_DIRS in order for your " "local overrides to be picked up") % destination ## Instruction: Fix string formatting bug in fork_statics man. command ## Code After: import logging import os import shutil from django.conf import settings from django.core.management.base import BaseCommand, CommandError logger = logging.getLogger(__name__) class Command(BaseCommand): """ Copy Oscar's statics into local project so they can be used as a base for styling a new site. """ args = '<destination folder>' help = "Copy Oscar's static files" def handle(self, *args, **options): # Determine where to copy to folder = args[0] if args else 'static' if not folder.startswith('/'): destination = os.path.join(os.getcwd(), folder) else: destination = folder if os.path.exists(destination): raise CommandError( "The folder %s already exists - aborting!" % destination) source = os.path.realpath( os.path.join(os.path.dirname(__file__), '../../static')) print "Copying Oscar's static files to %s" % (destination,) shutil.copytree(source, destination) # Check if this new folder is in STATICFILES_DIRS if destination not in settings.STATICFILES_DIRS: print ("You need to add %s to STATICFILES_DIRS in order for your " "local overrides to be picked up") % destination
import logging import os import shutil - from django.db.models import get_model from django.conf import settings from django.core.management.base import BaseCommand, CommandError - ProductAlert = get_model('customer', 'ProductAlert') logger = logging.getLogger(__name__) class Command(BaseCommand): """ Copy Oscar's statics into local project so they can be used as a base for styling a new site. """ args = '<destination folder>' help = "Copy Oscar's static files" def handle(self, *args, **options): # Determine where to copy to folder = args[0] if args else 'static' if not folder.startswith('/'): destination = os.path.join(os.getcwd(), folder) else: destination = folder if os.path.exists(destination): raise CommandError( "The folder %s already exists - aborting!" % destination) source = os.path.realpath( os.path.join(os.path.dirname(__file__), '../../static')) - print "Copying Oscar's static files to %s" % (source, destination) ? -------- + print "Copying Oscar's static files to %s" % (destination,) ? + shutil.copytree(source, destination) # Check if this new folder is in STATICFILES_DIRS if destination not in settings.STATICFILES_DIRS: print ("You need to add %s to STATICFILES_DIRS in order for your " "local overrides to be picked up") % destination
4
0.097561
1
3
b401e07df06e88dc144a5ebb8e01ac70d84baf5c
test/CodeGenCXX/DynArrayInit.cpp
test/CodeGenCXX/DynArrayInit.cpp
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s // PR7490 int main() { // CHECK: {{for.cond:|:4}} // CHECK: %{{.*}} = icmp ult i64 %{{.*}}, 1133 // CHECK: {{for.body:|:6}} // CHECK: store i8 0 // CHECK: br label %{{for.inc|7}} // CHECK: {{for.inc:|:7}} // CHECK: %{{.*}} = add i64 %{{.*}}, 1 // CHECK: store i64 %{{.*}} // CHECK: br label %{{for.cond|4}} // CHECK: {{for.end:|:12}} volatile char *buckets = new char[1133](); }
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -O3 -emit-llvm -o - %s | FileCheck %s // PR7490 // CHECK: define signext i8 @_Z2f0v // CHECK: ret i8 0 // CHECK: } inline void* operator new[](unsigned long, void* __p) { return __p; } static void f0_a(char *a) { new (a) char[4](); } char f0() { char a[4]; f0_a(a); return a[0] + a[1] + a[2] + a[3]; }
Rewrite test to check intent instead of implementation.
tests: Rewrite test to check intent instead of implementation. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@107024 91177308-0d34-0410-b5e6-96231b3b80d8
C++
apache-2.0
apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang
c++
## Code Before: // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s // PR7490 int main() { // CHECK: {{for.cond:|:4}} // CHECK: %{{.*}} = icmp ult i64 %{{.*}}, 1133 // CHECK: {{for.body:|:6}} // CHECK: store i8 0 // CHECK: br label %{{for.inc|7}} // CHECK: {{for.inc:|:7}} // CHECK: %{{.*}} = add i64 %{{.*}}, 1 // CHECK: store i64 %{{.*}} // CHECK: br label %{{for.cond|4}} // CHECK: {{for.end:|:12}} volatile char *buckets = new char[1133](); } ## Instruction: tests: Rewrite test to check intent instead of implementation. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@107024 91177308-0d34-0410-b5e6-96231b3b80d8 ## Code After: // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -O3 -emit-llvm -o - %s | FileCheck %s // PR7490 // CHECK: define signext i8 @_Z2f0v // CHECK: ret i8 0 // CHECK: } inline void* operator new[](unsigned long, void* __p) { return __p; } static void f0_a(char *a) { new (a) char[4](); } char f0() { char a[4]; f0_a(a); return a[0] + a[1] + a[2] + a[3]; }
- // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s + // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -O3 -emit-llvm -o - %s | FileCheck %s ? ++++ // PR7490 + // CHECK: define signext i8 @_Z2f0v - int main() { - // CHECK: {{for.cond:|:4}} - // CHECK: %{{.*}} = icmp ult i64 %{{.*}}, 1133 - // CHECK: {{for.body:|:6}} - // CHECK: store i8 0 ? -- --- + // CHECK: ret i8 0 ? + + // CHECK: } + inline void* operator new[](unsigned long, void* __p) { return __p; } + static void f0_a(char *a) { + new (a) char[4](); - // CHECK: br label %{{for.inc|7}} - // CHECK: {{for.inc:|:7}} - // CHECK: %{{.*}} = add i64 %{{.*}}, 1 - // CHECK: store i64 %{{.*}} - // CHECK: br label %{{for.cond|4}} - // CHECK: {{for.end:|:12}} - volatile char *buckets = new char[1133](); } + char f0() { + char a[4]; + f0_a(a); + return a[0] + a[1] + a[2] + a[3]; + }
25
1.5625
12
13
ea58be95a20ca3d4fe5599ccc67a65da59ea584f
index.js
index.js
'use strict'; module.exports = function (actions, context) { return input => { const promise = new Promise(resolve => resolve(input)); return decoratePromise(promise, actions); } }; function decoratePromise(promise, actions) { Object.keys(actions).forEach(name => { promise[name] = function () { const args = [].slice.call(arguments); const newPromise = new Promise((resolve, reject) => { promise.then(output => { args.unshift(output); const result = actions[name].apply(null, args); if (result instanceof Promise) { result.then(resolve, reject); } else { resolve(result); } }) .catch(reject); }); return decoratePromise(newPromise, actions); }; }); return promise; };
'use strict'; module.exports = function (actions, options) { options = Object.assign({ Promise: Promise }, options); return input => { const promise = new options.Promise(resolve => resolve(input)); return decoratePromise(promise, actions, options); } }; function decoratePromise(promise, actions, options) { Object.keys(actions).forEach(name => { promise[name] = function () { const args = [].slice.call(arguments); const newPromise = new options.Promise((resolve, reject) => { promise.then(output => { args.unshift(output); const result = actions[name].apply(null, args); if (isPromise(result)) { result.then(resolve, reject); } else { resolve(result); } }) .catch(reject); }); return decoratePromise(newPromise, actions, options); }; }); return promise; }; function isPromise(obj) { return typeof obj.then === 'function'; }
Support third party Promise library
Support third party Promise library
JavaScript
mit
compulim/promise-pipe
javascript
## Code Before: 'use strict'; module.exports = function (actions, context) { return input => { const promise = new Promise(resolve => resolve(input)); return decoratePromise(promise, actions); } }; function decoratePromise(promise, actions) { Object.keys(actions).forEach(name => { promise[name] = function () { const args = [].slice.call(arguments); const newPromise = new Promise((resolve, reject) => { promise.then(output => { args.unshift(output); const result = actions[name].apply(null, args); if (result instanceof Promise) { result.then(resolve, reject); } else { resolve(result); } }) .catch(reject); }); return decoratePromise(newPromise, actions); }; }); return promise; }; ## Instruction: Support third party Promise library ## Code After: 'use strict'; module.exports = function (actions, options) { options = Object.assign({ Promise: Promise }, options); return input => { const promise = new options.Promise(resolve => resolve(input)); return decoratePromise(promise, actions, options); } }; function decoratePromise(promise, actions, options) { Object.keys(actions).forEach(name => { promise[name] = function () { const args = [].slice.call(arguments); const newPromise = new options.Promise((resolve, reject) => { promise.then(output => { args.unshift(output); const result = actions[name].apply(null, args); if (isPromise(result)) { result.then(resolve, reject); } else { resolve(result); } }) .catch(reject); }); return decoratePromise(newPromise, actions, options); }; }); return promise; }; function isPromise(obj) { return typeof obj.then === 'function'; }
'use strict'; - module.exports = function (actions, context) { ? ^ ^^^^ + module.exports = function (actions, options) { ? ^^^^ ^ + options = Object.assign({ Promise: Promise }, options); + return input => { - const promise = new Promise(resolve => resolve(input)); + const promise = new options.Promise(resolve => resolve(input)); ? ++++++++ - return decoratePromise(promise, actions); + return decoratePromise(promise, actions, options); ? +++++++++ } }; - function decoratePromise(promise, actions) { + function decoratePromise(promise, actions, options) { ? +++++++++ Object.keys(actions).forEach(name => { promise[name] = function () { const args = [].slice.call(arguments); - const newPromise = new Promise((resolve, reject) => { + const newPromise = new options.Promise((resolve, reject) => { ? ++++++++ promise.then(output => { args.unshift(output); const result = actions[name].apply(null, args); - if (result instanceof Promise) { + if (isPromise(result)) { result.then(resolve, reject); } else { resolve(result); } }) .catch(reject); }); - return decoratePromise(newPromise, actions); + return decoratePromise(newPromise, actions, options); ? +++++++++ }; }); return promise; }; + + function isPromise(obj) { + return typeof obj.then === 'function'; + }
20
0.555556
13
7
5d193f997cf525a7aa494435f85ca49393c0a8db
karma/default.config.js
karma/default.config.js
// Default karma configuration var _ = require('lodash'); var sharedConfig = require('./shared.config'); var webpackPreprocessorLibrary = 'webpack'; module.exports = function (karma, globalFiles, testFiles) { globalFiles = arrayify(globalFiles); testFiles = arrayify(testFiles); var options = sharedConfig(karma); options.files = globalFiles.concat(testFiles); _.each(testFiles, function(file) { addPreprocessor(options, file); }); karma.set(options); return options; }; function arrayify(maybeArray) { if (_.isArray(maybeArray)) { return maybeArray; } else if (maybeArray) { return [maybeArray]; } else { return []; } } function addPreprocessor(options, path) { options.preprocessors = options.preprocessors || {}; options.preprocessors[path] = [webpackPreprocessorLibrary]; }
// Default karma configuration var _ = require('lodash'); var sharedConfig = require('./shared.config'); var webpackPreprocessorLibrary = 'webpack'; module.exports = function (karma, testFiles, globalFiles, externals) { globalFiles = arrayify(globalFiles); testFiles = arrayify(testFiles); var options = sharedConfig(karma); options.files = globalFiles.concat(testFiles); _.each(testFiles, function(file) { addPreprocessor(options, file); }); options.webpack.externals = externals; karma.set(options); return options; }; function arrayify(maybeArray) { if (_.isArray(maybeArray)) { return maybeArray; } else if (maybeArray) { return [maybeArray]; } else { return []; } } function addPreprocessor(options, path) { options.preprocessors = options.preprocessors || {}; options.preprocessors[path] = [webpackPreprocessorLibrary]; }
Allow the external webpack bundles to be specified with the global file list.
Allow the external webpack bundles to be specified with the global file list.
JavaScript
mit
RenovoSolutions/Gulp-Typescript-Utilities
javascript
## Code Before: // Default karma configuration var _ = require('lodash'); var sharedConfig = require('./shared.config'); var webpackPreprocessorLibrary = 'webpack'; module.exports = function (karma, globalFiles, testFiles) { globalFiles = arrayify(globalFiles); testFiles = arrayify(testFiles); var options = sharedConfig(karma); options.files = globalFiles.concat(testFiles); _.each(testFiles, function(file) { addPreprocessor(options, file); }); karma.set(options); return options; }; function arrayify(maybeArray) { if (_.isArray(maybeArray)) { return maybeArray; } else if (maybeArray) { return [maybeArray]; } else { return []; } } function addPreprocessor(options, path) { options.preprocessors = options.preprocessors || {}; options.preprocessors[path] = [webpackPreprocessorLibrary]; } ## Instruction: Allow the external webpack bundles to be specified with the global file list. ## Code After: // Default karma configuration var _ = require('lodash'); var sharedConfig = require('./shared.config'); var webpackPreprocessorLibrary = 'webpack'; module.exports = function (karma, testFiles, globalFiles, externals) { globalFiles = arrayify(globalFiles); testFiles = arrayify(testFiles); var options = sharedConfig(karma); options.files = globalFiles.concat(testFiles); _.each(testFiles, function(file) { addPreprocessor(options, file); }); options.webpack.externals = externals; karma.set(options); return options; }; function arrayify(maybeArray) { if (_.isArray(maybeArray)) { return maybeArray; } else if (maybeArray) { return [maybeArray]; } else { return []; } } function addPreprocessor(options, path) { options.preprocessors = options.preprocessors || {}; options.preprocessors[path] = [webpackPreprocessorLibrary]; }
// Default karma configuration var _ = require('lodash'); var sharedConfig = require('./shared.config'); var webpackPreprocessorLibrary = 'webpack'; - module.exports = function (karma, globalFiles, testFiles) { ? ^^^^ - + module.exports = function (karma, testFiles, globalFiles, externals) { ? +++++++++++ ++ ^^^ globalFiles = arrayify(globalFiles); testFiles = arrayify(testFiles); var options = sharedConfig(karma); options.files = globalFiles.concat(testFiles); _.each(testFiles, function(file) { addPreprocessor(options, file); }); + + options.webpack.externals = externals; karma.set(options); return options; }; function arrayify(maybeArray) { if (_.isArray(maybeArray)) { return maybeArray; } else if (maybeArray) { return [maybeArray]; } else { return []; } } function addPreprocessor(options, path) { options.preprocessors = options.preprocessors || {}; options.preprocessors[path] = [webpackPreprocessorLibrary]; }
4
0.108108
3
1
7365e48ad1c9422127ed6edae9b5bba8412bd109
demos/simple/index.html
demos/simple/index.html
<!DOCTYPE html> <html> <head> <script type="text/javascript" src="../../src/coquette-min.js"></script> <script type="text/javascript" src="game.js"></script> </head> <body><canvas id="canvas"></canvas></body> </html>
<!DOCTYPE html> <html> <head> <script type="text/javascript" src="../../src/coquette-min.js"></script> <script type="text/javascript" src="game.js"></script> </head> <body><canvas id="canvas"></canvas></body> <div>Press the up arrow key.</div> </html>
Add instructions for simple game.
Add instructions for simple game.
HTML
mit
maryrosecook/coquette,matthewsimo/coquette,matthewsimo/coquette,maryrosecook/coquette,cdosborn/coquette,cdosborn/coquette
html
## Code Before: <!DOCTYPE html> <html> <head> <script type="text/javascript" src="../../src/coquette-min.js"></script> <script type="text/javascript" src="game.js"></script> </head> <body><canvas id="canvas"></canvas></body> </html> ## Instruction: Add instructions for simple game. ## Code After: <!DOCTYPE html> <html> <head> <script type="text/javascript" src="../../src/coquette-min.js"></script> <script type="text/javascript" src="game.js"></script> </head> <body><canvas id="canvas"></canvas></body> <div>Press the up arrow key.</div> </html>
<!DOCTYPE html> <html> <head> <script type="text/javascript" src="../../src/coquette-min.js"></script> <script type="text/javascript" src="game.js"></script> </head> <body><canvas id="canvas"></canvas></body> + + <div>Press the up arrow key.</div> </html>
2
0.25
2
0
73d49ad830e028c64d5a68754757dcfc38d34792
source/test/authenticate-flow-test.js
source/test/authenticate-flow-test.js
import { describe } from 'riteway'; import dsm from '../dsm'; const SIGNED_OUT = 'signed_out'; const AUTHENTICATING = 'authenticating'; const actionStates = [ ['initialize', SIGNED_OUT, ['sign in', AUTHENTICATING // ['report error', 'error', // ['handle error', 'signed out'] // ], // ['sign-in success', 'signed in'] ] ] ]; const { reducer, actionCreators: { initialize, signIn } } = dsm({ component: 'user-authentication', description: 'authenticate user', actionStates }); const createState = ({ status = SIGNED_OUT, payload = { type: 'empty' } } = {}) => ({ status, payload }); describe('userAuthenticationReducer', async should => { { const {assert} = should('use "signed out" as initialized state'); assert({ given: '["initialize", "signed out", /*...*/', actual: reducer(), expected: createState() }); } { const {assert} = should('transition into authenticating state'); const initialState = reducer(undefined, initialize()); assert({ given: 'signed out initial state & signIn action', actual: reducer(initialState, signIn()), expected: createState({ status: 'authenticating' }) }); } });
import { describe } from 'riteway'; import dsm from '../dsm'; const SIGNED_OUT = 'signed_out'; const AUTHENTICATING = 'authenticating'; const actionStates = [ ['initialize', SIGNED_OUT, ['sign in', AUTHENTICATING // ['report error', 'error', // ['handle error', 'signed out'] // ], // ['sign-in success', 'signed in'] ] ] ]; const { reducer, actionCreators: { initialize, signIn } } = dsm({ component: 'user-authentication', description: 'authenticate user', actionStates }); describe('userAuthenticationReducer', async should => { { const {assert} = should('use "signed out" as initialized state'); assert({ given: '["initialize", "signed out", /*...*/', actual: reducer().status, expected: SIGNED_OUT }); } { const {assert} = should('transition into authenticating state'); const initialState = reducer(undefined, initialize()); assert({ given: 'signed out initial state & signIn action', actual: reducer(initialState, signIn()).status, expected: AUTHENTICATING }); } });
Fix test to use main unit test files standards
Fix test to use main unit test files standards The main unit test file tested action creators against `reducer().status` instead of the full state. There seems to be inconsistencies in the payload for action creators which caused these tests to fail. I have updated the tests to only check the status instead of the entire state.
JavaScript
mit
ericelliott/redux-dsm
javascript
## Code Before: import { describe } from 'riteway'; import dsm from '../dsm'; const SIGNED_OUT = 'signed_out'; const AUTHENTICATING = 'authenticating'; const actionStates = [ ['initialize', SIGNED_OUT, ['sign in', AUTHENTICATING // ['report error', 'error', // ['handle error', 'signed out'] // ], // ['sign-in success', 'signed in'] ] ] ]; const { reducer, actionCreators: { initialize, signIn } } = dsm({ component: 'user-authentication', description: 'authenticate user', actionStates }); const createState = ({ status = SIGNED_OUT, payload = { type: 'empty' } } = {}) => ({ status, payload }); describe('userAuthenticationReducer', async should => { { const {assert} = should('use "signed out" as initialized state'); assert({ given: '["initialize", "signed out", /*...*/', actual: reducer(), expected: createState() }); } { const {assert} = should('transition into authenticating state'); const initialState = reducer(undefined, initialize()); assert({ given: 'signed out initial state & signIn action', actual: reducer(initialState, signIn()), expected: createState({ status: 'authenticating' }) }); } }); ## Instruction: Fix test to use main unit test files standards The main unit test file tested action creators against `reducer().status` instead of the full state. There seems to be inconsistencies in the payload for action creators which caused these tests to fail. I have updated the tests to only check the status instead of the entire state. ## Code After: import { describe } from 'riteway'; import dsm from '../dsm'; const SIGNED_OUT = 'signed_out'; const AUTHENTICATING = 'authenticating'; const actionStates = [ ['initialize', SIGNED_OUT, ['sign in', AUTHENTICATING // ['report error', 'error', // ['handle error', 'signed out'] // ], // ['sign-in success', 'signed in'] ] ] ]; const { reducer, actionCreators: { initialize, signIn } } = dsm({ component: 'user-authentication', description: 'authenticate user', actionStates }); describe('userAuthenticationReducer', async should => { { const {assert} = should('use "signed out" as initialized state'); assert({ given: '["initialize", "signed out", /*...*/', actual: reducer().status, expected: SIGNED_OUT }); } { const {assert} = should('transition into authenticating state'); const initialState = reducer(undefined, initialize()); assert({ given: 'signed out initial state & signIn action', actual: reducer(initialState, signIn()).status, expected: AUTHENTICATING }); } });
import { describe } from 'riteway'; import dsm from '../dsm'; const SIGNED_OUT = 'signed_out'; const AUTHENTICATING = 'authenticating'; const actionStates = [ ['initialize', SIGNED_OUT, ['sign in', AUTHENTICATING // ['report error', 'error', // ['handle error', 'signed out'] // ], // ['sign-in success', 'signed in'] ] ] ]; const { reducer, actionCreators: { initialize, signIn } } = dsm({ component: 'user-authentication', description: 'authenticate user', actionStates }); - const createState = ({ - status = SIGNED_OUT, - payload = { type: 'empty' } - } = {}) => ({ status, payload }); - describe('userAuthenticationReducer', async should => { { const {assert} = should('use "signed out" as initialized state'); assert({ given: '["initialize", "signed out", /*...*/', - actual: reducer(), + actual: reducer().status, ? +++++++ - expected: createState() + expected: SIGNED_OUT }); } { const {assert} = should('transition into authenticating state'); const initialState = reducer(undefined, initialize()); assert({ given: 'signed out initial state & signIn action', - actual: reducer(initialState, signIn()), + actual: reducer(initialState, signIn()).status, ? +++++++ - expected: createState({ status: 'authenticating' }) + expected: AUTHENTICATING }); } });
13
0.25
4
9
43d33cbdf3e99a8466cdde410198a71ab4ad9bc8
lib/facter/classroom_vm_version.rb
lib/facter/classroom_vm_version.rb
Facter.add('classroom_vm_release') do setcode do case Facter.value(:osfamily) when 'windows' path = 'C:\\puppetlabs-release' else path = '/etc/puppetlabs-release' end next unless File.file? path version = File.read(path).match(/Puppet Labs Training VM (\d+\.\d+) .*$/) version[1] if version end end
Facter.add('classroom_vm_release') do setcode do case Facter.value(:osfamily) when 'windows' path = 'C:\\puppetlabs-release' else path = '/etc/puppetlabs-release' end next unless File.file? path version = File.read(path).match(/\d+\.\d+/) version[1] if version end end
Fix classroom vm version fact
Fix classroom vm version fact
Ruby
apache-2.0
fnaard/pltraining-classroom,joshsamuelson/pltraining-classroom,samuelson/pltraining-classroom,carthik/pltraining-classroom,puppetlabs/pltraining-classroom,binford2k/pltraining-classroom,binford2k/pltraining-classroom,joshsamuelson/pltraining-classroom,carthik/pltraining-classroom,puppetlabs/pltraining-classroom,fnaard/pltraining-classroom,samuelson/pltraining-classroom,samuelson/pltraining-classroom,carthik/pltraining-classroom,binford2k/pltraining-classroom,puppetlabs/pltraining-classroom,fnaard/pltraining-classroom,joshsamuelson/pltraining-classroom
ruby
## Code Before: Facter.add('classroom_vm_release') do setcode do case Facter.value(:osfamily) when 'windows' path = 'C:\\puppetlabs-release' else path = '/etc/puppetlabs-release' end next unless File.file? path version = File.read(path).match(/Puppet Labs Training VM (\d+\.\d+) .*$/) version[1] if version end end ## Instruction: Fix classroom vm version fact ## Code After: Facter.add('classroom_vm_release') do setcode do case Facter.value(:osfamily) when 'windows' path = 'C:\\puppetlabs-release' else path = '/etc/puppetlabs-release' end next unless File.file? path version = File.read(path).match(/\d+\.\d+/) version[1] if version end end
Facter.add('classroom_vm_release') do setcode do case Facter.value(:osfamily) when 'windows' path = 'C:\\puppetlabs-release' else path = '/etc/puppetlabs-release' end next unless File.file? path - version = File.read(path).match(/Puppet Labs Training VM (\d+\.\d+) .*$/) ? ------------------------- ----- + version = File.read(path).match(/\d+\.\d+/) version[1] if version end end
2
0.142857
1
1
0419d9dd12030e764359b6f19b06e7a332f2a4e4
README.md
README.md
Illuminator is a simple Reflection library for Java. It is both an attempt to avoid the verboseness of the standard Reflection library and an exercise in learning for the author.
Illuminator is a simple Reflection library for Java. It is both an attempt to avoid the verboseness of the standard Reflection library and an exercise in learning for the author. # Getting started with Illuminator Illuminator is in an extremely early form right now. To get ahold of, and to test the code please follow these instructions. First, clone this repository: git clone https://github.com/williammartin/illuminator.git Then, navigate into the illuminator project directory and run: mvn test You must have maven installed and available on your path or the previous step will fail. Good luck!
Add some instructions for how to get started with illuminator
Add some instructions for how to get started with illuminator
Markdown
apache-2.0
ThomWright/illuminator,williammartin/illuminator,ThomWright/illuminator,williammartin/illuminator
markdown
## Code Before: Illuminator is a simple Reflection library for Java. It is both an attempt to avoid the verboseness of the standard Reflection library and an exercise in learning for the author. ## Instruction: Add some instructions for how to get started with illuminator ## Code After: Illuminator is a simple Reflection library for Java. It is both an attempt to avoid the verboseness of the standard Reflection library and an exercise in learning for the author. # Getting started with Illuminator Illuminator is in an extremely early form right now. To get ahold of, and to test the code please follow these instructions. First, clone this repository: git clone https://github.com/williammartin/illuminator.git Then, navigate into the illuminator project directory and run: mvn test You must have maven installed and available on your path or the previous step will fail. Good luck!
Illuminator is a simple Reflection library for Java. It is both an attempt to avoid the verboseness of the standard Reflection library and an exercise in learning for the author. + + # Getting started with Illuminator + + Illuminator is in an extremely early form right now. To get ahold of, and to test the code please follow these instructions. + + First, clone this repository: + + git clone https://github.com/williammartin/illuminator.git + + Then, navigate into the illuminator project directory and run: + + mvn test + + You must have maven installed and available on your path or the previous step will fail. + + Good luck! + + +
19
19
19
0
04300f6b5f25707f30ddfb45fd79417ce72b7234
app/Template/board/popover_category.php
app/Template/board/popover_category.php
<section id="main"> <section> <h3><?= t('Change category for the task "%s"', $values['title']) ?></h3> <form method="post" action="<?= $this->url->href('board', 'updateCategory', array('task_id' => $values['id'], 'project_id' => $values['project_id'])) ?>"> <?= $this->form->csrf() ?> <?= $this->form->hidden('id', $values) ?> <?= $this->form->hidden('project_id', $values) ?> <?= $this->form->label(t('Category'), 'category_id') ?> <?= $this->form->select('category_id', $categories_list, $values) ?><br/> <div class="form-actions"> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <?= t('or') ?> <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $project['id']), false, 'close-popover') ?> </div> </form> </section> </section>
<section id="main"> <section> <h3><?= t('Change category for the task "%s"', $values['title']) ?></h3> <form method="post" action="<?= $this->url->href('board', 'updateCategory', array('task_id' => $values['id'], 'project_id' => $values['project_id'])) ?>"> <?= $this->form->csrf() ?> <?= $this->form->hidden('id', $values) ?> <?= $this->form->hidden('project_id', $values) ?> <?= $this->form->label(t('Category'), 'category_id') ?> <?= $this->form->select('category_id', $categories_list, $values, array(), array('autofocus')) ?><br/> <div class="form-actions"> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <?= t('or') ?> <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $project['id']), false, 'close-popover') ?> </div> </form> </section> </section>
Set focus on the dropdown for category popover
Set focus on the dropdown for category popover
PHP
mit
kanboard/kanboard,renothing/kanboard,cranca/kanboard,vjscjp09/kanboard-1,cHolzberger/kanboard,manishlad/kanboard,oliviermaridat/kanboard,filhocf/kanboard,vjscjp09/kanboard-1,leangjia/kanboard,creador30/kanboard,alu0100502114/kanboard,cHolzberger/kanboard,vjscjp/kanboard,wiebkem/kanboard,djpadz/kanboard,BlueTeck/kanboard,filhocf/kanboard,kanboard/kanboard,wtmmac/kanboard,creador30/kanboard,Nerdingher/kanboard,vaikan/kanboard,cdgeelen/kanboard,vaikan/kanboard,patoi/kanboard,mbrzuchalski/kanboard,BlueTeck/kanboard,ChMat/kanboard,renothing/kanboard,thylo/kanboard,EpocDotFr/kanboard,markmarco16/kanboard,jmptrader/kanboard,mcfog/kanboard,onedal88/kanboard,goofy-bz/kanboard,patoi/kanboard,cogumm/kanboard,Nerdingher/kanboard,jtourt/kanboard,kasunf/KanboardBOI,kasunf/KanboardBOI,dromek/kanboard,JeroenKnoops/kanboard,Shaxine/kanboard,wepika/kanboard,arcanneero/kanboard,Shaxine/kanboard,wiebkem/kanboard,stinnux/kanboard,jtourt/kanboard,skobeo/kanboard,julesverhaeren/kanboard,onedal88/kanboard,cHolzberger/kanboard,leangjia/kanboard,lianguan/kanboard,wepika/kanboard,goofy-bz/kanboard,fguillot/kanboard,manishlad/kanboard,markmarco16/kanboard,hussam789/kanboard,vjscjp09/kanboard-1,mcorteel/kanboard,hussam789/kanboard,cHolzberger/kanboard,Busfreak/kanboard,dromek/kanboard,kclabrador/kan-test,wepika/kanboard,wepika/kanboard,eSkiSo/kanboard,vaikan/kanboard,arcanneero/kanboard,jvizueta/kanboard,skobeo/kanboard,vjscjp/kanboard,stinnux/kanboard,SamuelMoraesF/kanboard,kanbantestnew/kanban,jclafuente/kanboard,lianguan/kanboard,dromek/kanboard,marienfressinaud/kanboard,thylo/kanboard,lianguan/kanboard,xavividal/kanboard,cdgeelen/kanboard,BlueTeck/kanboard,julesverhaeren/kanboard,jclafuente/kanboard,libin/kanboard,alu0100502114/kanboard,kasunf/KanboardBOI,corretgecom/kanboard,eSkiSo/kanboard,ChMat/kanboard,mbrzuchalski/kanboard,djpadz/kanboard,jmptrader/kanboard,oliviermaridat/kanboard,Nerdingher/kanboard,erwang/kanboard,stinnux/kanboard,cranca/kanboard,jmptrader/kanboard,xavividal/kanboard,renothing/kanboard,marienfressinaud/kanboard,oliviermaridat/kanboard,kanboard/kanboard,Shaxine/kanboard,jvizueta/kanboard,mcfog/kanboard,djpadz/kanboard,kanbantestnew/kanban,fguillot/kanboard,SamuelMoraesF/kanboard,Busfreak/kanboard,eSkiSo/kanboard,kclabrador/kan-test,eSkiSo/kanboard,onedal88/kanboard,onedal88/kanboard,corretgecom/kanboard,sanbiv/kanboard,mcorteel/kanboard,mcorteel/kanboard,cdgeelen/kanboard,patoi/kanboard,cogumm/kanboard,filhocf/kanboard,jtourt/kanboard,erwang/kanboard,wtmmac/kanboard,thylo/kanboard,jmptrader/kanboard,JeroenKnoops/kanboard,libin/kanboard,jclafuente/kanboard,sanbiv/kanboard,julesverhaeren/kanboard,xavividal/kanboard,Busfreak/kanboard,fabiano-pereira/kanboard,fguillot/kanboard,EpocDotFr/kanboard,fabiano-pereira/kanboard
php
## Code Before: <section id="main"> <section> <h3><?= t('Change category for the task "%s"', $values['title']) ?></h3> <form method="post" action="<?= $this->url->href('board', 'updateCategory', array('task_id' => $values['id'], 'project_id' => $values['project_id'])) ?>"> <?= $this->form->csrf() ?> <?= $this->form->hidden('id', $values) ?> <?= $this->form->hidden('project_id', $values) ?> <?= $this->form->label(t('Category'), 'category_id') ?> <?= $this->form->select('category_id', $categories_list, $values) ?><br/> <div class="form-actions"> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <?= t('or') ?> <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $project['id']), false, 'close-popover') ?> </div> </form> </section> </section> ## Instruction: Set focus on the dropdown for category popover ## Code After: <section id="main"> <section> <h3><?= t('Change category for the task "%s"', $values['title']) ?></h3> <form method="post" action="<?= $this->url->href('board', 'updateCategory', array('task_id' => $values['id'], 'project_id' => $values['project_id'])) ?>"> <?= $this->form->csrf() ?> <?= $this->form->hidden('id', $values) ?> <?= $this->form->hidden('project_id', $values) ?> <?= $this->form->label(t('Category'), 'category_id') ?> <?= $this->form->select('category_id', $categories_list, $values, array(), array('autofocus')) ?><br/> <div class="form-actions"> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <?= t('or') ?> <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $project['id']), false, 'close-popover') ?> </div> </form> </section> </section>
<section id="main"> <section> <h3><?= t('Change category for the task "%s"', $values['title']) ?></h3> <form method="post" action="<?= $this->url->href('board', 'updateCategory', array('task_id' => $values['id'], 'project_id' => $values['project_id'])) ?>"> <?= $this->form->csrf() ?> <?= $this->form->hidden('id', $values) ?> <?= $this->form->hidden('project_id', $values) ?> <?= $this->form->label(t('Category'), 'category_id') ?> - <?= $this->form->select('category_id', $categories_list, $values) ?><br/> + <?= $this->form->select('category_id', $categories_list, $values, array(), array('autofocus')) ?><br/> ? +++++++++++++++++++++++++++++ <div class="form-actions"> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <?= t('or') ?> <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $project['id']), false, 'close-popover') ?> </div> </form> </section> - </section>
3
0.136364
1
2
276e199391e467650c90892f7d0d904b8d328ac7
app/helpers/forms_helper.rb
app/helpers/forms_helper.rb
module FormsHelper # rubocop:disable Metrics/MethodLength def breadcrumbs content_tag(:ol, class: 'breadcrumb') do wizard_steps.collect do |every_step| class_str = if every_step == step "active" elsif past_step?(every_step) "past" else "future" end concat( content_tag(:li, class: class_str) do link_to I18n.t(every_step), wizard_path(every_step) end ) end end end end
module FormsHelper # rubocop:disable Metrics/MethodLength def breadcrumbs content_tag(:ol, class: 'breadcrumb') do wizard_steps.collect do |every_step| concat( content_tag(:li, class: breadcrumb_class(every_step)) do breadcrumb(every_step) end ) end end end def breadcrumb(every_step) if step == every_step I18n.t(every_step) else link_to I18n.t(every_step), wizard_path(every_step) end end def breadcrumb_class(every_step) if every_step == step "active" elsif past_step?(every_step) "past" else "future" end end end
Fix breadcrumbs to indicate which one we're on
Fix breadcrumbs to indicate which one we're on
Ruby
mit
on-site/Grantzilla,on-site/Grantzilla,on-site/Grantzilla
ruby
## Code Before: module FormsHelper # rubocop:disable Metrics/MethodLength def breadcrumbs content_tag(:ol, class: 'breadcrumb') do wizard_steps.collect do |every_step| class_str = if every_step == step "active" elsif past_step?(every_step) "past" else "future" end concat( content_tag(:li, class: class_str) do link_to I18n.t(every_step), wizard_path(every_step) end ) end end end end ## Instruction: Fix breadcrumbs to indicate which one we're on ## Code After: module FormsHelper # rubocop:disable Metrics/MethodLength def breadcrumbs content_tag(:ol, class: 'breadcrumb') do wizard_steps.collect do |every_step| concat( content_tag(:li, class: breadcrumb_class(every_step)) do breadcrumb(every_step) end ) end end end def breadcrumb(every_step) if step == every_step I18n.t(every_step) else link_to I18n.t(every_step), wizard_path(every_step) end end def breadcrumb_class(every_step) if every_step == step "active" elsif past_step?(every_step) "past" else "future" end end end
module FormsHelper # rubocop:disable Metrics/MethodLength def breadcrumbs content_tag(:ol, class: 'breadcrumb') do wizard_steps.collect do |every_step| - class_str = - if every_step == step - "active" - elsif past_step?(every_step) - "past" - else - "future" - end - concat( - content_tag(:li, class: class_str) do ? ^ + content_tag(:li, class: breadcrumb_class(every_step)) do ? +++++++++++ ++++++ ^^^ - link_to I18n.t(every_step), wizard_path(every_step) + breadcrumb(every_step) end ) end end end + + def breadcrumb(every_step) + if step == every_step + I18n.t(every_step) + else + link_to I18n.t(every_step), wizard_path(every_step) + end + end + + def breadcrumb_class(every_step) + if every_step == step + "active" + elsif past_step?(every_step) + "past" + else + "future" + end + end end
31
1.347826
20
11
3197c3d3c66f16cc190b5de38c5eea13cdb1dd48
lib/scorm/errors.rb
lib/scorm/errors.rb
module Scorm module Errors class InvalidManifest < RuntimeError; end class NoMetadataError < InvalidManifest; end class DuplicateMetadataError < InvalidManifest; end class NoOrganizationsError < InvalidManifest; end class DuplicateOrganizationsError < InvalidManifest; end class UnsupportedSCORMVersion < RuntimeError; end class InvalidSCORMVersion < InvalidManifest; end end end
module Scorm module Errors class InvalidManifest < RuntimeError; end class RequiredItemMissing < InvalidManifest; end class DuplicateItem < InvalidManifest; end class NoMetadataError < RequiredItemMissing; end class DuplicateMetadataError < DuplicateItem; end class NoOrganizationsError < RequiredItemMissing; end class DuplicateOrganizationsError < DuplicateItem; end class UnsupportedSCORMVersion < RuntimeError; end class InvalidSCORMVersion < InvalidManifest; end end end
Add RequiredItemMissing and DuplicateItem exceptions.
Add RequiredItemMissing and DuplicateItem exceptions. NoMetadataError/NoOrganizationsError and their related "too-many" exceptions is too specific, and we would like to avoid adding those kinds of exceptions every time the standard requires one, and only one, of some kind of element. Therefore, introduce the RequiredItemMissing and DuplicateItem, and have the more specific inherit from these
Ruby
mit
PerfectlyNormal/scorm
ruby
## Code Before: module Scorm module Errors class InvalidManifest < RuntimeError; end class NoMetadataError < InvalidManifest; end class DuplicateMetadataError < InvalidManifest; end class NoOrganizationsError < InvalidManifest; end class DuplicateOrganizationsError < InvalidManifest; end class UnsupportedSCORMVersion < RuntimeError; end class InvalidSCORMVersion < InvalidManifest; end end end ## Instruction: Add RequiredItemMissing and DuplicateItem exceptions. NoMetadataError/NoOrganizationsError and their related "too-many" exceptions is too specific, and we would like to avoid adding those kinds of exceptions every time the standard requires one, and only one, of some kind of element. Therefore, introduce the RequiredItemMissing and DuplicateItem, and have the more specific inherit from these ## Code After: module Scorm module Errors class InvalidManifest < RuntimeError; end class RequiredItemMissing < InvalidManifest; end class DuplicateItem < InvalidManifest; end class NoMetadataError < RequiredItemMissing; end class DuplicateMetadataError < DuplicateItem; end class NoOrganizationsError < RequiredItemMissing; end class DuplicateOrganizationsError < DuplicateItem; end class UnsupportedSCORMVersion < RuntimeError; end class InvalidSCORMVersion < InvalidManifest; end end end
module Scorm module Errors class InvalidManifest < RuntimeError; end + class RequiredItemMissing < InvalidManifest; end - class NoMetadataError < InvalidManifest; end ? ^^^^^^^ ^^^^^^ + class DuplicateItem < InvalidManifest; end ? ^^^^^^ ^^^^^^^ + + class NoMetadataError < RequiredItemMissing; end - class DuplicateMetadataError < InvalidManifest; end ? ^^^^ ^^ ^^^ ^ + class DuplicateMetadataError < DuplicateItem; end ? ^^^ ^ ^ ^ ++ - class NoOrganizationsError < InvalidManifest; end + class NoOrganizationsError < RequiredItemMissing; end - class DuplicateOrganizationsError < InvalidManifest; end ? ^^^^ ^^ ^^^ ^ + class DuplicateOrganizationsError < DuplicateItem; end ? ^^^ ^ ^ ^ ++ + class UnsupportedSCORMVersion < RuntimeError; end class InvalidSCORMVersion < InvalidManifest; end end end
12
1.090909
8
4
4ca5af44cb26e7b24dfa18d8ccb9a35616e311a8
impeller/archivist/archivist_fixture.cc
impeller/archivist/archivist_fixture.cc
// Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "impeller/archivist/archivist_fixture.h" #include "flutter/fml/paths.h" namespace impeller { namespace testing { ArchivistFixture::ArchivistFixture() { std::stringstream stream; stream << flutter::testing::GetCurrentTestName() << ".db"; archive_file_name_ = fml::paths::JoinPaths( {flutter::testing::GetFixturesPath(), stream.str()}); } ArchivistFixture::~ArchivistFixture() = default; const std::string ArchivistFixture::GetArchiveFileName() const { return archive_file_name_; } void ArchivistFixture::SetUp() { DeleteArchiveFile(); } void ArchivistFixture::TearDown() { // TODO: Tear this down. For now, I am inspecting the files for readability of // schema. // DeleteArchiveFile(); } void ArchivistFixture::DeleteArchiveFile() const { fml::UnlinkFile(archive_file_name_.c_str()); } } // namespace testing } // namespace impeller
// Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "impeller/archivist/archivist_fixture.h" #include "flutter/fml/paths.h" namespace impeller { namespace testing { ArchivistFixture::ArchivistFixture() { std::stringstream stream; stream << "Test" << flutter::testing::GetCurrentTestName() << ".db"; archive_file_name_ = stream.str(); } ArchivistFixture::~ArchivistFixture() = default; const std::string ArchivistFixture::GetArchiveFileName() const { return fml::paths::JoinPaths( {flutter::testing::GetFixturesPath(), archive_file_name_}); } void ArchivistFixture::SetUp() { DeleteArchiveFile(); } void ArchivistFixture::TearDown() { DeleteArchiveFile(); } void ArchivistFixture::DeleteArchiveFile() const { auto fixtures = flutter::testing::OpenFixturesDirectory(); if (fml::FileExists(fixtures, archive_file_name_.c_str())) { fml::UnlinkFile(fixtures, archive_file_name_.c_str()); } } } // namespace testing } // namespace impeller
Fix temporary database file deletion.
Fix temporary database file deletion.
C++
bsd-3-clause
flutter/engine,rmacnak-google/engine,chinmaygarde/flutter_engine,chinmaygarde/flutter_engine,rmacnak-google/engine,chinmaygarde/flutter_engine,flutter/engine,flutter/engine,rmacnak-google/engine,rmacnak-google/engine,rmacnak-google/engine,flutter/engine,rmacnak-google/engine,devoncarew/engine,devoncarew/engine,devoncarew/engine,devoncarew/engine,flutter/engine,flutter/engine,rmacnak-google/engine,chinmaygarde/flutter_engine,chinmaygarde/flutter_engine,flutter/engine,chinmaygarde/flutter_engine,flutter/engine,chinmaygarde/flutter_engine,devoncarew/engine,devoncarew/engine,devoncarew/engine
c++
## Code Before: // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "impeller/archivist/archivist_fixture.h" #include "flutter/fml/paths.h" namespace impeller { namespace testing { ArchivistFixture::ArchivistFixture() { std::stringstream stream; stream << flutter::testing::GetCurrentTestName() << ".db"; archive_file_name_ = fml::paths::JoinPaths( {flutter::testing::GetFixturesPath(), stream.str()}); } ArchivistFixture::~ArchivistFixture() = default; const std::string ArchivistFixture::GetArchiveFileName() const { return archive_file_name_; } void ArchivistFixture::SetUp() { DeleteArchiveFile(); } void ArchivistFixture::TearDown() { // TODO: Tear this down. For now, I am inspecting the files for readability of // schema. // DeleteArchiveFile(); } void ArchivistFixture::DeleteArchiveFile() const { fml::UnlinkFile(archive_file_name_.c_str()); } } // namespace testing } // namespace impeller ## Instruction: Fix temporary database file deletion. ## Code After: // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "impeller/archivist/archivist_fixture.h" #include "flutter/fml/paths.h" namespace impeller { namespace testing { ArchivistFixture::ArchivistFixture() { std::stringstream stream; stream << "Test" << flutter::testing::GetCurrentTestName() << ".db"; archive_file_name_ = stream.str(); } ArchivistFixture::~ArchivistFixture() = default; const std::string ArchivistFixture::GetArchiveFileName() const { return fml::paths::JoinPaths( {flutter::testing::GetFixturesPath(), archive_file_name_}); } void ArchivistFixture::SetUp() { DeleteArchiveFile(); } void ArchivistFixture::TearDown() { DeleteArchiveFile(); } void ArchivistFixture::DeleteArchiveFile() const { auto fixtures = flutter::testing::OpenFixturesDirectory(); if (fml::FileExists(fixtures, archive_file_name_.c_str())) { fml::UnlinkFile(fixtures, archive_file_name_.c_str()); } } } // namespace testing } // namespace impeller
// Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "impeller/archivist/archivist_fixture.h" #include "flutter/fml/paths.h" namespace impeller { namespace testing { ArchivistFixture::ArchivistFixture() { std::stringstream stream; - stream << flutter::testing::GetCurrentTestName() << ".db"; + stream << "Test" << flutter::testing::GetCurrentTestName() << ".db"; ? ++++++++++ + archive_file_name_ = stream.str(); - archive_file_name_ = fml::paths::JoinPaths( - {flutter::testing::GetFixturesPath(), stream.str()}); } ArchivistFixture::~ArchivistFixture() = default; const std::string ArchivistFixture::GetArchiveFileName() const { - return archive_file_name_; + return fml::paths::JoinPaths( + {flutter::testing::GetFixturesPath(), archive_file_name_}); } void ArchivistFixture::SetUp() { DeleteArchiveFile(); } void ArchivistFixture::TearDown() { - // TODO: Tear this down. For now, I am inspecting the files for readability of - // schema. - // DeleteArchiveFile(); ? --- + DeleteArchiveFile(); } void ArchivistFixture::DeleteArchiveFile() const { + auto fixtures = flutter::testing::OpenFixturesDirectory(); + if (fml::FileExists(fixtures, archive_file_name_.c_str())) { - fml::UnlinkFile(archive_file_name_.c_str()); + fml::UnlinkFile(fixtures, archive_file_name_.c_str()); ? ++ ++++++++++ + } } } // namespace testing } // namespace impeller
17
0.425
9
8
69acd79f8d09e25986caa531850476d58f0e77df
sql/update-payday-numbers.sql
sql/update-payday-numbers.sql
-- Reset post-Gratipocalypse values UPDATE paydays p SET nactive = (SELECT DISTINCT count(*) FROM ( SELECT participant FROM payments WHERE payday=p.id ) AS foo) , volume = (SELECT COALESCE(sum(amount), 0) FROM payments WHERE payday=p.id) WHERE ts_start > '2015-05-07'::timestamptz;
-- Reset post-Gratipocalypse values UPDATE paydays p SET nactive = (SELECT DISTINCT count(*) FROM ( SELECT participant FROM payments WHERE payday=p.id ) AS foo) , volume = (SELECT COALESCE(sum(amount), 0) FROM payments WHERE payday=p.id AND direction='to-team') WHERE ts_start > '2015-05-07'::timestamptz;
Make the volume stats accurate
Make the volume stats accurate They were doubled because we were counting both sides, payment and payroll. We should just count payment.
SQL
mit
studio666/gratipay.com,studio666/gratipay.com,eXcomm/gratipay.com,eXcomm/gratipay.com,gratipay/gratipay.com,studio666/gratipay.com,gratipay/gratipay.com,eXcomm/gratipay.com,gratipay/gratipay.com,gratipay/gratipay.com,eXcomm/gratipay.com,studio666/gratipay.com
sql
## Code Before: -- Reset post-Gratipocalypse values UPDATE paydays p SET nactive = (SELECT DISTINCT count(*) FROM ( SELECT participant FROM payments WHERE payday=p.id ) AS foo) , volume = (SELECT COALESCE(sum(amount), 0) FROM payments WHERE payday=p.id) WHERE ts_start > '2015-05-07'::timestamptz; ## Instruction: Make the volume stats accurate They were doubled because we were counting both sides, payment and payroll. We should just count payment. ## Code After: -- Reset post-Gratipocalypse values UPDATE paydays p SET nactive = (SELECT DISTINCT count(*) FROM ( SELECT participant FROM payments WHERE payday=p.id ) AS foo) , volume = (SELECT COALESCE(sum(amount), 0) FROM payments WHERE payday=p.id AND direction='to-team') WHERE ts_start > '2015-05-07'::timestamptz;
-- Reset post-Gratipocalypse values UPDATE paydays p SET nactive = (SELECT DISTINCT count(*) FROM ( SELECT participant FROM payments WHERE payday=p.id ) AS foo) - , volume = (SELECT COALESCE(sum(amount), 0) FROM payments WHERE payday=p.id) + , volume = (SELECT COALESCE(sum(amount), 0) + FROM payments + WHERE payday=p.id AND direction='to-team') WHERE ts_start > '2015-05-07'::timestamptz;
4
0.571429
3
1
922ceb670323eb0c89de16b62a8e579c4cb5de1a
features/org.wso2.carbon.analytics.http.feature/src/main/capp/GadgetPieChartVizGrammar_1.0.0/pie-chart-vizgrammar/css/custom.css
features/org.wso2.carbon.analytics.http.feature/src/main/capp/GadgetPieChartVizGrammar_1.0.0/pie-chart-vizgrammar/css/custom.css
body.dark svg.marks .mark-group .background { fill: #121822 !important; } body.dark svg.marks .mark-group .mark-text text { fill: #c3cbdb !important; } body.dark svg.marks .mark-group .mark-rule line { stroke: #E3E5E6 !important; }
body.dark svg.marks .mark-group .mark-text text { fill: #c3cbdb !important; } body.dark svg.marks .mark-group .mark-rule line { stroke: #E3E5E6 !important; }
Remove black background in pie charts
Remove black background in pie charts
CSS
apache-2.0
callkalpa/analytics-http,callkalpa/analytics-http,callkalpa/analytics-http,callkalpa/analytics-http,callkalpa/analytics-http
css
## Code Before: body.dark svg.marks .mark-group .background { fill: #121822 !important; } body.dark svg.marks .mark-group .mark-text text { fill: #c3cbdb !important; } body.dark svg.marks .mark-group .mark-rule line { stroke: #E3E5E6 !important; } ## Instruction: Remove black background in pie charts ## Code After: body.dark svg.marks .mark-group .mark-text text { fill: #c3cbdb !important; } body.dark svg.marks .mark-group .mark-rule line { stroke: #E3E5E6 !important; }
- body.dark svg.marks .mark-group .background { - fill: #121822 !important; - } - body.dark svg.marks .mark-group .mark-text text { fill: #c3cbdb !important; } body.dark svg.marks .mark-group .mark-rule line { stroke: #E3E5E6 !important; }
4
0.363636
0
4
48e0abe9bd2538bf19cf6930c15d4fc73536af3b
lib/netsuite/records/inter_company_journal_entry_line.rb
lib/netsuite/records/inter_company_journal_entry_line.rb
module NetSuite module Records class InterCompanyJournalEntryLine include Support::Fields include Support::RecordRefs include Support::Records include Namespaces::TranGeneral fields :credit, :debit, :eliminate, :end_date, :gross_amt, :memo, :residual, :start_date, :tax1_amt, :tax_rate1 field :custom_field_list, CustomFieldList record_refs :account, :department, :entity, :klass, :location, :schedule, :schedule_num, :tax1_acct, :tax_code def initialize(attributes = {}) initialize_from_attributes_hash(attributes) end def to_record rec = super if rec["#{record_namespace}:customFieldList"] rec["#{record_namespace}:customFieldList!"] = rec.delete("#{record_namespace}:customFieldList") end rec end end end end
module NetSuite module Records class InterCompanyJournalEntryLine include Support::Fields include Support::RecordRefs include Support::Records include Namespaces::TranGeneral fields :credit, :debit, :eliminate, :end_date, :gross_amt, :memo, :residual, :start_date, :tax1_amt, :tax_rate1 field :custom_field_list, CustomFieldList record_refs :account, :department, :entity, :klass, :line_subsidiary, :location, :schedule, :schedule_num, :tax1_acct, :tax_code def initialize(attributes = {}) initialize_from_attributes_hash(attributes) end def to_record rec = super if rec["#{record_namespace}:customFieldList"] rec["#{record_namespace}:customFieldList!"] = rec.delete("#{record_namespace}:customFieldList") end rec end end end end
Add line level subsidiary field
Add line level subsidiary field
Ruby
mit
dropstream/netsuite,NetSweet/netsuite,jeperkins4/netsuite,charitywater/netsuite
ruby
## Code Before: module NetSuite module Records class InterCompanyJournalEntryLine include Support::Fields include Support::RecordRefs include Support::Records include Namespaces::TranGeneral fields :credit, :debit, :eliminate, :end_date, :gross_amt, :memo, :residual, :start_date, :tax1_amt, :tax_rate1 field :custom_field_list, CustomFieldList record_refs :account, :department, :entity, :klass, :location, :schedule, :schedule_num, :tax1_acct, :tax_code def initialize(attributes = {}) initialize_from_attributes_hash(attributes) end def to_record rec = super if rec["#{record_namespace}:customFieldList"] rec["#{record_namespace}:customFieldList!"] = rec.delete("#{record_namespace}:customFieldList") end rec end end end end ## Instruction: Add line level subsidiary field ## Code After: module NetSuite module Records class InterCompanyJournalEntryLine include Support::Fields include Support::RecordRefs include Support::Records include Namespaces::TranGeneral fields :credit, :debit, :eliminate, :end_date, :gross_amt, :memo, :residual, :start_date, :tax1_amt, :tax_rate1 field :custom_field_list, CustomFieldList record_refs :account, :department, :entity, :klass, :line_subsidiary, :location, :schedule, :schedule_num, :tax1_acct, :tax_code def initialize(attributes = {}) initialize_from_attributes_hash(attributes) end def to_record rec = super if rec["#{record_namespace}:customFieldList"] rec["#{record_namespace}:customFieldList!"] = rec.delete("#{record_namespace}:customFieldList") end rec end end end end
module NetSuite module Records class InterCompanyJournalEntryLine include Support::Fields include Support::RecordRefs include Support::Records include Namespaces::TranGeneral fields :credit, :debit, :eliminate, :end_date, :gross_amt, :memo, :residual, :start_date, :tax1_amt, :tax_rate1 field :custom_field_list, CustomFieldList - record_refs :account, :department, :entity, :klass, :location, :schedule, :schedule_num, :tax1_acct, :tax_code + record_refs :account, :department, :entity, :klass, :line_subsidiary, :location, :schedule, :schedule_num, :tax1_acct, :tax_code ? ++++++++++++++++++ def initialize(attributes = {}) initialize_from_attributes_hash(attributes) end def to_record rec = super if rec["#{record_namespace}:customFieldList"] rec["#{record_namespace}:customFieldList!"] = rec.delete("#{record_namespace}:customFieldList") end rec end end end end
2
0.074074
1
1
fc93261c1551b09932f8e24a705698a416d0e63d
test/Driver/linker-args-order-linux.swift
test/Driver/linker-args-order-linux.swift
// Statically link a "hello world" program // REQUIRES: OS=linux-gnu // REQUIRES: static_stdlib print("hello world!") // RUN: %empty-directory(%t) // RUN: %target-swiftc_driver -v -static-stdlib -o %t/static-stdlib %s -Xlinker --no-allow-multiple-definition 2>&1| %FileCheck %s // CHECK: Swift version // CHECK: Target: x86_64-unknown-linux-gnu // CHECK: {{.*}}/swift -frontend -c -primary-file {{.*}}/linker-args-order-linux.swift -target x86_64-unknown-linux-gnu -disable-objc-interop // CHECK: {{.*}}/swift-autolink-extract{{.*}} // CHECK: {{.*}}swift_begin.o /{{.*}}/linker-args-order-linux-{{[a-z0-9]+}}.o @/{{.*}}/linker-args-order-linux-{{[a-z0-9]+}}.autolink {{.*}} @{{.*}}/static-stdlib-args.lnk {{.*}} -Xlinker --no-allow-multiple-definition {{.*}}/swift_end.o
// Statically link a "hello world" program // REQUIRES: static_stdlib print("hello world!") // RUN: %empty-directory(%t) // RUN: %target-swiftc_driver -driver-print-jobs -static-stdlib -o %t/static-stdlib %s -Xlinker --no-allow-multiple-definition 2>&1| %FileCheck %s // CHECK: {{.*}}/swift -frontend -c -primary-file {{.*}}/linker-args-order-linux.swift -target x86_64-unknown-linux-gnu -disable-objc-interop // CHECK: {{.*}}/swift-autolink-extract{{.*}} // CHECK: {{.*}}swift_begin.o /{{.*}}/linker-args-order-linux-{{[a-z0-9]+}}.o @/{{.*}}/linker-args-order-linux-{{[a-z0-9]+}}.autolink {{.*}} @{{.*}}/static-stdlib-args.lnk {{.*}} -Xlinker --no-allow-multiple-definition {{.*}}/swift_end.o
Update the linker -Xlinker argument reordering test.
Update the linker -Xlinker argument reordering test. - Use -driver-print-jobs to avoid actually building the test file.
Swift
apache-2.0
apple/swift,zisko/swift,nathawes/swift,atrick/swift,rudkx/swift,harlanhaskins/swift,milseman/swift,milseman/swift,milseman/swift,ahoppen/swift,roambotics/swift,danielmartin/swift,austinzheng/swift,hooman/swift,devincoughlin/swift,stephentyrone/swift,glessard/swift,danielmartin/swift,alblue/swift,brentdax/swift,tkremenek/swift,deyton/swift,jckarter/swift,natecook1000/swift,lorentey/swift,jmgc/swift,gribozavr/swift,stephentyrone/swift,lorentey/swift,uasys/swift,atrick/swift,ahoppen/swift,lorentey/swift,austinzheng/swift,nathawes/swift,harlanhaskins/swift,danielmartin/swift,JGiola/swift,amraboelela/swift,practicalswift/swift,shajrawi/swift,amraboelela/swift,tkremenek/swift,milseman/swift,airspeedswift/swift,shahmishal/swift,benlangmuir/swift,ahoppen/swift,shahmishal/swift,airspeedswift/swift,benlangmuir/swift,danielmartin/swift,karwa/swift,gribozavr/swift,xwu/swift,xedin/swift,sschiau/swift,jmgc/swift,CodaFi/swift,amraboelela/swift,return/swift,tjw/swift,karwa/swift,jopamer/swift,shahmishal/swift,CodaFi/swift,roambotics/swift,nathawes/swift,shajrawi/swift,xwu/swift,parkera/swift,lorentey/swift,frootloops/swift,hooman/swift,JGiola/swift,glessard/swift,airspeedswift/swift,gregomni/swift,swiftix/swift,huonw/swift,deyton/swift,gregomni/swift,jckarter/swift,alblue/swift,return/swift,shahmishal/swift,gribozavr/swift,aschwaighofer/swift,return/swift,shahmishal/swift,glessard/swift,danielmartin/swift,huonw/swift,austinzheng/swift,zisko/swift,xwu/swift,shahmishal/swift,practicalswift/swift,deyton/swift,tkremenek/swift,airspeedswift/swift,shajrawi/swift,parkera/swift,glessard/swift,practicalswift/swift,CodaFi/swift,stephentyrone/swift,uasys/swift,harlanhaskins/swift,tjw/swift,brentdax/swift,CodaFi/swift,danielmartin/swift,nathawes/swift,frootloops/swift,zisko/swift,tjw/swift,stephentyrone/swift,sschiau/swift,swiftix/swift,sschiau/swift,hooman/swift,jmgc/swift,jckarter/swift,tjw/swift,parkera/swift,tkremenek/swift,brentdax/swift,return/swift,jopamer/swift,harlanhaskins/swift,jckarter/swift,parkera/swift,atrick/swift,uasys/swift,OscarSwanros/swift,shajrawi/swift,return/swift,alblue/swift,alblue/swift,amraboelela/swift,roambotics/swift,karwa/swift,jmgc/swift,tkremenek/swift,natecook1000/swift,shajrawi/swift,roambotics/swift,devincoughlin/swift,JGiola/swift,jmgc/swift,harlanhaskins/swift,deyton/swift,shahmishal/swift,benlangmuir/swift,ahoppen/swift,apple/swift,glessard/swift,allevato/swift,hooman/swift,xedin/swift,allevato/swift,jopamer/swift,gregomni/swift,OscarSwanros/swift,shajrawi/swift,tjw/swift,tkremenek/swift,benlangmuir/swift,rudkx/swift,austinzheng/swift,JGiola/swift,huonw/swift,lorentey/swift,brentdax/swift,karwa/swift,tjw/swift,jopamer/swift,xwu/swift,natecook1000/swift,OscarSwanros/swift,amraboelela/swift,hooman/swift,return/swift,devincoughlin/swift,allevato/swift,frootloops/swift,JGiola/swift,apple/swift,gribozavr/swift,jopamer/swift,benlangmuir/swift,karwa/swift,swiftix/swift,nathawes/swift,gregomni/swift,gregomni/swift,apple/swift,natecook1000/swift,xwu/swift,lorentey/swift,xedin/swift,huonw/swift,gribozavr/swift,devincoughlin/swift,roambotics/swift,huonw/swift,uasys/swift,OscarSwanros/swift,aschwaighofer/swift,benlangmuir/swift,practicalswift/swift,austinzheng/swift,gribozavr/swift,nathawes/swift,uasys/swift,airspeedswift/swift,sschiau/swift,harlanhaskins/swift,swiftix/swift,deyton/swift,devincoughlin/swift,rudkx/swift,natecook1000/swift,aschwaighofer/swift,devincoughlin/swift,nathawes/swift,parkera/swift,deyton/swift,OscarSwanros/swift,rudkx/swift,huonw/swift,jckarter/swift,practicalswift/swift,devincoughlin/swift,alblue/swift,gregomni/swift,aschwaighofer/swift,natecook1000/swift,aschwaighofer/swift,stephentyrone/swift,jckarter/swift,ahoppen/swift,zisko/swift,jopamer/swift,xedin/swift,OscarSwanros/swift,karwa/swift,zisko/swift,glessard/swift,zisko/swift,brentdax/swift,frootloops/swift,rudkx/swift,stephentyrone/swift,milseman/swift,xedin/swift,sschiau/swift,atrick/swift,airspeedswift/swift,JGiola/swift,devincoughlin/swift,allevato/swift,jckarter/swift,rudkx/swift,milseman/swift,frootloops/swift,danielmartin/swift,aschwaighofer/swift,practicalswift/swift,hooman/swift,tkremenek/swift,apple/swift,sschiau/swift,shajrawi/swift,sschiau/swift,brentdax/swift,austinzheng/swift,frootloops/swift,lorentey/swift,huonw/swift,parkera/swift,brentdax/swift,karwa/swift,jopamer/swift,gribozavr/swift,swiftix/swift,practicalswift/swift,uasys/swift,amraboelela/swift,swiftix/swift,uasys/swift,stephentyrone/swift,airspeedswift/swift,karwa/swift,natecook1000/swift,sschiau/swift,return/swift,harlanhaskins/swift,roambotics/swift,shahmishal/swift,swiftix/swift,zisko/swift,xwu/swift,lorentey/swift,milseman/swift,practicalswift/swift,jmgc/swift,xedin/swift,shajrawi/swift,OscarSwanros/swift,xwu/swift,allevato/swift,xedin/swift,austinzheng/swift,atrick/swift,hooman/swift,amraboelela/swift,frootloops/swift,parkera/swift,jmgc/swift,alblue/swift,alblue/swift,aschwaighofer/swift,deyton/swift,ahoppen/swift,allevato/swift,CodaFi/swift,allevato/swift,parkera/swift,xedin/swift,CodaFi/swift,atrick/swift,apple/swift,CodaFi/swift,tjw/swift,gribozavr/swift
swift
## Code Before: // Statically link a "hello world" program // REQUIRES: OS=linux-gnu // REQUIRES: static_stdlib print("hello world!") // RUN: %empty-directory(%t) // RUN: %target-swiftc_driver -v -static-stdlib -o %t/static-stdlib %s -Xlinker --no-allow-multiple-definition 2>&1| %FileCheck %s // CHECK: Swift version // CHECK: Target: x86_64-unknown-linux-gnu // CHECK: {{.*}}/swift -frontend -c -primary-file {{.*}}/linker-args-order-linux.swift -target x86_64-unknown-linux-gnu -disable-objc-interop // CHECK: {{.*}}/swift-autolink-extract{{.*}} // CHECK: {{.*}}swift_begin.o /{{.*}}/linker-args-order-linux-{{[a-z0-9]+}}.o @/{{.*}}/linker-args-order-linux-{{[a-z0-9]+}}.autolink {{.*}} @{{.*}}/static-stdlib-args.lnk {{.*}} -Xlinker --no-allow-multiple-definition {{.*}}/swift_end.o ## Instruction: Update the linker -Xlinker argument reordering test. - Use -driver-print-jobs to avoid actually building the test file. ## Code After: // Statically link a "hello world" program // REQUIRES: static_stdlib print("hello world!") // RUN: %empty-directory(%t) // RUN: %target-swiftc_driver -driver-print-jobs -static-stdlib -o %t/static-stdlib %s -Xlinker --no-allow-multiple-definition 2>&1| %FileCheck %s // CHECK: {{.*}}/swift -frontend -c -primary-file {{.*}}/linker-args-order-linux.swift -target x86_64-unknown-linux-gnu -disable-objc-interop // CHECK: {{.*}}/swift-autolink-extract{{.*}} // CHECK: {{.*}}swift_begin.o /{{.*}}/linker-args-order-linux-{{[a-z0-9]+}}.o @/{{.*}}/linker-args-order-linux-{{[a-z0-9]+}}.autolink {{.*}} @{{.*}}/static-stdlib-args.lnk {{.*}} -Xlinker --no-allow-multiple-definition {{.*}}/swift_end.o
// Statically link a "hello world" program - // REQUIRES: OS=linux-gnu // REQUIRES: static_stdlib print("hello world!") // RUN: %empty-directory(%t) - // RUN: %target-swiftc_driver -v -static-stdlib -o %t/static-stdlib %s -Xlinker --no-allow-multiple-definition 2>&1| %FileCheck %s + // RUN: %target-swiftc_driver -driver-print-jobs -static-stdlib -o %t/static-stdlib %s -Xlinker --no-allow-multiple-definition 2>&1| %FileCheck %s ? +++ +++++++++++++ - // CHECK: Swift version - // CHECK: Target: x86_64-unknown-linux-gnu // CHECK: {{.*}}/swift -frontend -c -primary-file {{.*}}/linker-args-order-linux.swift -target x86_64-unknown-linux-gnu -disable-objc-interop // CHECK: {{.*}}/swift-autolink-extract{{.*}} // CHECK: {{.*}}swift_begin.o /{{.*}}/linker-args-order-linux-{{[a-z0-9]+}}.o @/{{.*}}/linker-args-order-linux-{{[a-z0-9]+}}.autolink {{.*}} @{{.*}}/static-stdlib-args.lnk {{.*}} -Xlinker --no-allow-multiple-definition {{.*}}/swift_end.o
5
0.454545
1
4
180cc033a15dcaedf40be8107363b7f4086d1b66
Server/src/main/webapp/WEB-INF/faces-config.xml
Server/src/main/webapp/WEB-INF/faces-config.xml
<?xml version="1.0" encoding="UTF-8"?> <faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd" version="2.2"> <application> <locale-config> <default-locale>en</default-locale> <supported-locale>bg</supported-locale> <supported-locale>de</supported-locale> <supported-locale>en</supported-locale> <supported-locale>es</supported-locale> <supported-locale>fr</supported-locale> <supported-locale>it</supported-locale> <supported-locale>ru</supported-locale> <supported-locale>tr</supported-locale> </locale-config> <resource-bundle> <base-name>org.gluu.oxauth.i18n.CustomResourceBundle</base-name> <var>msgs</var> </resource-bundle> <message-bundle> validation_messages </message-bundle> </application> <factory> <exception-handler-factory> org.gluu.oxauth.exception.GlobalExceptionHandlerFactory </exception-handler-factory> </factory> </faces-config>
<?xml version="1.0" encoding="UTF-8"?> <faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd" version="2.2"> <application> <locale-config> <default-locale>en</default-locale> <supported-locale>bg</supported-locale> <supported-locale>de</supported-locale> <supported-locale>en</supported-locale> <supported-locale>es</supported-locale> <supported-locale>fr</supported-locale> <supported-locale>it</supported-locale> <supported-locale>ru</supported-locale> <supported-locale>tr</supported-locale> </locale-config> <resource-bundle> <base-name>org.gluu.oxauth.i18n.CustomResourceBundle</base-name> <var>msgs</var> </resource-bundle> <!-- <resource-bundle> <base-name>org.gluu.oxauth.i18n.CustomMessageBundle</base-name> <var>validation_messages</var> </resource-bundle> <message-bundle> oxauth </message-bundle> --> </application> <factory> <exception-handler-factory> org.gluu.oxauth.exception.GlobalExceptionHandlerFactory </exception-handler-factory> </factory> </faces-config>
Fix JSF validation messages customizations
Fix JSF validation messages customizations
XML
mit
GluuFederation/oxAuth,GluuFederation/oxAuth,GluuFederation/oxAuth,GluuFederation/oxAuth,GluuFederation/oxAuth
xml
## Code Before: <?xml version="1.0" encoding="UTF-8"?> <faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd" version="2.2"> <application> <locale-config> <default-locale>en</default-locale> <supported-locale>bg</supported-locale> <supported-locale>de</supported-locale> <supported-locale>en</supported-locale> <supported-locale>es</supported-locale> <supported-locale>fr</supported-locale> <supported-locale>it</supported-locale> <supported-locale>ru</supported-locale> <supported-locale>tr</supported-locale> </locale-config> <resource-bundle> <base-name>org.gluu.oxauth.i18n.CustomResourceBundle</base-name> <var>msgs</var> </resource-bundle> <message-bundle> validation_messages </message-bundle> </application> <factory> <exception-handler-factory> org.gluu.oxauth.exception.GlobalExceptionHandlerFactory </exception-handler-factory> </factory> </faces-config> ## Instruction: Fix JSF validation messages customizations ## Code After: <?xml version="1.0" encoding="UTF-8"?> <faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd" version="2.2"> <application> <locale-config> <default-locale>en</default-locale> <supported-locale>bg</supported-locale> <supported-locale>de</supported-locale> <supported-locale>en</supported-locale> <supported-locale>es</supported-locale> <supported-locale>fr</supported-locale> <supported-locale>it</supported-locale> <supported-locale>ru</supported-locale> <supported-locale>tr</supported-locale> </locale-config> <resource-bundle> <base-name>org.gluu.oxauth.i18n.CustomResourceBundle</base-name> <var>msgs</var> </resource-bundle> <!-- <resource-bundle> <base-name>org.gluu.oxauth.i18n.CustomMessageBundle</base-name> <var>validation_messages</var> </resource-bundle> <message-bundle> oxauth </message-bundle> --> </application> <factory> <exception-handler-factory> org.gluu.oxauth.exception.GlobalExceptionHandlerFactory </exception-handler-factory> </factory> </faces-config>
<?xml version="1.0" encoding="UTF-8"?> <faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd" version="2.2"> <application> <locale-config> <default-locale>en</default-locale> <supported-locale>bg</supported-locale> <supported-locale>de</supported-locale> <supported-locale>en</supported-locale> <supported-locale>es</supported-locale> <supported-locale>fr</supported-locale> <supported-locale>it</supported-locale> <supported-locale>ru</supported-locale> <supported-locale>tr</supported-locale> </locale-config> <resource-bundle> <base-name>org.gluu.oxauth.i18n.CustomResourceBundle</base-name> <var>msgs</var> </resource-bundle> + <!-- + <resource-bundle> + <base-name>org.gluu.oxauth.i18n.CustomMessageBundle</base-name> + <var>validation_messages</var> + </resource-bundle> - <message-bundle> + <message-bundle> ? + - validation_messages + oxauth </message-bundle> + --> - </application> + </application> ? + <factory> <exception-handler-factory> org.gluu.oxauth.exception.GlobalExceptionHandlerFactory </exception-handler-factory> </factory> </faces-config>
12
0.363636
9
3
9810df42ef0257955a84896470ee0e06ccd2499f
app/views/home/_event.html.slim
app/views/home/_event.html.slim
.event-info - if @event.present? ul.small-block-grid-1.medium-block-grid-2.large-block-grid-2 li i.fa.fa-map-marker #{@event.location.name} li i.fa.fa-calendar #{@event.date} /li /i.fa.fa-microphone 4 Ponentes /li /i.fa.fa-ticket 50 tickets h1= @event.theme p #{@event.description}
.event-info - if @event.present? ul.small-block-grid-1.medium-block-grid-2.large-block-grid-3 li i.fa.fa-map-marker #{@event.location.name} li i.fa.fa-calendar #{@event.date} li i.fa.fa-microphone #{@event.speakers.count} Ponentes /li /i.fa.fa-ticket 50 tickets h1= @event.theme p #{@event.description}
Add speakers count to event description
Add speakers count to event description
Slim
mit
webdevtalks/www,webdevtalks/www,webdevtalks/www
slim
## Code Before: .event-info - if @event.present? ul.small-block-grid-1.medium-block-grid-2.large-block-grid-2 li i.fa.fa-map-marker #{@event.location.name} li i.fa.fa-calendar #{@event.date} /li /i.fa.fa-microphone 4 Ponentes /li /i.fa.fa-ticket 50 tickets h1= @event.theme p #{@event.description} ## Instruction: Add speakers count to event description ## Code After: .event-info - if @event.present? ul.small-block-grid-1.medium-block-grid-2.large-block-grid-3 li i.fa.fa-map-marker #{@event.location.name} li i.fa.fa-calendar #{@event.date} li i.fa.fa-microphone #{@event.speakers.count} Ponentes /li /i.fa.fa-ticket 50 tickets h1= @event.theme p #{@event.description}
.event-info - if @event.present? - ul.small-block-grid-1.medium-block-grid-2.large-block-grid-2 ? ^ + ul.small-block-grid-1.medium-block-grid-2.large-block-grid-3 ? ^ li i.fa.fa-map-marker #{@event.location.name} li i.fa.fa-calendar #{@event.date} - /li ? - + li - /i.fa.fa-microphone 4 Ponentes + i.fa.fa-microphone #{@event.speakers.count} Ponentes /li /i.fa.fa-ticket 50 tickets h1= @event.theme p #{@event.description}
6
0.461538
3
3
6a3fcecea2cdaec6243022d712d0838a923e78cd
app/templates/admin/upload.html
app/templates/admin/upload.html
{% extends "admin/index.html" %} {% import "bootstrap/wtf.html" as wtf %} {% block content_main %} <div class="col-md-10" id="content"> {% include "_warnings.html" %} <div class="panel"> <div class="panel-heading">Stjórnborð</div> <div class="panel-body"> <h1> Bæta við auglýsingu </h1> <form action="{{ request.path }}" method="post" enctype="multipart/form-data" class="form" role="form"> {% if request.path == url_for('admin.ad_upload') %} {{ wtf.form_field(form.ad) }} {% endif %} {{ wtf.form_field(form.placement) }} {{ wtf.form_field(form.active) }} {{ wtf.form_field(form.submit) }} </form> </div> <!-- ./panel-body --> </div> <!-- ./panel --> </div> <!-- ./col-md-7 --> {% endblock %}
{% extends "admin/index.html" %} {% import "bootstrap/wtf.html" as wtf %} {% block content_main %} <div class="col-md-10" id="content"> {% include "_warnings.html" %} <div class="panel"> <div class="panel-heading">Stjórnborð</div> <div class="panel-body"> <h1> Bæta við auglýsingu </h1> <form action="{{ request.path }}" method="post" enctype="multipart/form-data" class="form" role="form"> {% if request.path == url_for('admin.ad_upload') %} {{ wtf.form_field(form.ad) }} {% endif %} {{ wtf.form_field(form.placement) }} {{ wtf.form_field(form.url) }} {{ wtf.form_field(form.active) }} {{ wtf.form_field(form.submit) }} </form> </div> <!-- ./panel-body --> </div> <!-- ./panel --> </div> <!-- ./col-md-7 --> {% endblock %}
Add url form to template
Add url form to template
HTML
mit
finnurtorfa/aflafrettir.is,finnurtorfa/aflafrettir.is,finnurtorfa/aflafrettir.is,finnurtorfa/aflafrettir.is
html
## Code Before: {% extends "admin/index.html" %} {% import "bootstrap/wtf.html" as wtf %} {% block content_main %} <div class="col-md-10" id="content"> {% include "_warnings.html" %} <div class="panel"> <div class="panel-heading">Stjórnborð</div> <div class="panel-body"> <h1> Bæta við auglýsingu </h1> <form action="{{ request.path }}" method="post" enctype="multipart/form-data" class="form" role="form"> {% if request.path == url_for('admin.ad_upload') %} {{ wtf.form_field(form.ad) }} {% endif %} {{ wtf.form_field(form.placement) }} {{ wtf.form_field(form.active) }} {{ wtf.form_field(form.submit) }} </form> </div> <!-- ./panel-body --> </div> <!-- ./panel --> </div> <!-- ./col-md-7 --> {% endblock %} ## Instruction: Add url form to template ## Code After: {% extends "admin/index.html" %} {% import "bootstrap/wtf.html" as wtf %} {% block content_main %} <div class="col-md-10" id="content"> {% include "_warnings.html" %} <div class="panel"> <div class="panel-heading">Stjórnborð</div> <div class="panel-body"> <h1> Bæta við auglýsingu </h1> <form action="{{ request.path }}" method="post" enctype="multipart/form-data" class="form" role="form"> {% if request.path == url_for('admin.ad_upload') %} {{ wtf.form_field(form.ad) }} {% endif %} {{ wtf.form_field(form.placement) }} {{ wtf.form_field(form.url) }} {{ wtf.form_field(form.active) }} {{ wtf.form_field(form.submit) }} </form> </div> <!-- ./panel-body --> </div> <!-- ./panel --> </div> <!-- ./col-md-7 --> {% endblock %}
{% extends "admin/index.html" %} {% import "bootstrap/wtf.html" as wtf %} {% block content_main %} <div class="col-md-10" id="content"> {% include "_warnings.html" %} <div class="panel"> <div class="panel-heading">Stjórnborð</div> <div class="panel-body"> <h1> Bæta við auglýsingu </h1> <form action="{{ request.path }}" method="post" enctype="multipart/form-data" class="form" role="form"> {% if request.path == url_for('admin.ad_upload') %} {{ wtf.form_field(form.ad) }} {% endif %} {{ wtf.form_field(form.placement) }} + {{ wtf.form_field(form.url) }} {{ wtf.form_field(form.active) }} {{ wtf.form_field(form.submit) }} </form> </div> <!-- ./panel-body --> </div> <!-- ./panel --> </div> <!-- ./col-md-7 --> {% endblock %}
1
0.04
1
0
ddb5ed1fad38e6c2f90be8862f3f28c9d2561726
app/config/production.js
app/config/production.js
/* * App config for production. */ module.exports = { environment: 'production', db: 'data/dsw-dashboard.sqlite', startDate: '2014-07-01' };
/* * App config for production. */ module.exports = { environment: 'production', connection: { }, db: 'data/dsw-dashboard.sqlite', startDate: '2014-07-01' };
Add empty connection object so Heroku can set the port and host
Add empty connection object so Heroku can set the port and host
JavaScript
bsd-2-clause
evidenceaction/Dispensers-Dashboard-API
javascript
## Code Before: /* * App config for production. */ module.exports = { environment: 'production', db: 'data/dsw-dashboard.sqlite', startDate: '2014-07-01' }; ## Instruction: Add empty connection object so Heroku can set the port and host ## Code After: /* * App config for production. */ module.exports = { environment: 'production', connection: { }, db: 'data/dsw-dashboard.sqlite', startDate: '2014-07-01' };
/* * App config for production. */ module.exports = { environment: 'production', + connection: { + }, db: 'data/dsw-dashboard.sqlite', startDate: '2014-07-01' };
2
0.25
2
0
5c538abc830092a3fda4087ecd2e254f57b1a1a8
wasp-web/src/main/webapp/scripts/extjs/wasp/Portlet.js
wasp-web/src/main/webapp/scripts/extjs/wasp/Portlet.js
/** * @class Wasp.Portlet * @extends Ext.panel.Panel A {@link Ext.panel.Panel Panel} class that is * managed by {@link Wasp.PortalPanel}. */ Ext.define('Wasp.Portlet', { extend : 'Ext.panel.Panel', alias : 'widget.portlet', layout : 'fit', anchor : '100%', frame : true, closable : true, collapsible : true, animCollapse : true, draggable : { moveOnDrag : false }, cls : 'x-portlet', // Override Panel's default doClose to provide a custom fade out // effect // when a portlet is removed from the portal doClose : function() { if (!this.closing) { this.closing = true; if (this.el !== undefined) { this.el.animate({ opacity : 0, callback : function() { var closeAction = this.closeAction; this.closing = false; this.fireEvent('close', this); this[closeAction](); if (closeAction == 'hide') { this.el.setOpacity(1); } }, scope : this }); } } } });
/** * @class Wasp.Portlet * @extends Ext.panel.Panel A {@link Ext.panel.Panel Panel} class that is * managed by {@link Wasp.PortalPanel}. */ Ext.define('Wasp.Portlet', { extend : 'Ext.panel.Panel', alias : 'widget.portlet', layout : 'fit', anchor : '100%', frame : true, closable : true, collapsible : true, animCollapse : true, autoScroll: true, draggable : { moveOnDrag : false }, cls : 'x-portlet', // Override Panel's default doClose to provide a custom fade out // effect // when a portlet is removed from the portal doClose : function() { if (!this.closing) { this.closing = true; if (this.el !== undefined) { this.el.animate({ opacity : 0, callback : function() { var closeAction = this.closeAction; this.closing = false; this.fireEvent('close', this); this[closeAction](); if (closeAction == 'hide') { this.el.setOpacity(1); } }, scope : this }); } } } });
Add scroll bar to the file view window
Add scroll bar to the file view window
JavaScript
agpl-3.0
WASP-System/central,WASP-System/central,WASP-System/central,WASP-System/central,WASP-System/central,WASP-System/central
javascript
## Code Before: /** * @class Wasp.Portlet * @extends Ext.panel.Panel A {@link Ext.panel.Panel Panel} class that is * managed by {@link Wasp.PortalPanel}. */ Ext.define('Wasp.Portlet', { extend : 'Ext.panel.Panel', alias : 'widget.portlet', layout : 'fit', anchor : '100%', frame : true, closable : true, collapsible : true, animCollapse : true, draggable : { moveOnDrag : false }, cls : 'x-portlet', // Override Panel's default doClose to provide a custom fade out // effect // when a portlet is removed from the portal doClose : function() { if (!this.closing) { this.closing = true; if (this.el !== undefined) { this.el.animate({ opacity : 0, callback : function() { var closeAction = this.closeAction; this.closing = false; this.fireEvent('close', this); this[closeAction](); if (closeAction == 'hide') { this.el.setOpacity(1); } }, scope : this }); } } } }); ## Instruction: Add scroll bar to the file view window ## Code After: /** * @class Wasp.Portlet * @extends Ext.panel.Panel A {@link Ext.panel.Panel Panel} class that is * managed by {@link Wasp.PortalPanel}. */ Ext.define('Wasp.Portlet', { extend : 'Ext.panel.Panel', alias : 'widget.portlet', layout : 'fit', anchor : '100%', frame : true, closable : true, collapsible : true, animCollapse : true, autoScroll: true, draggable : { moveOnDrag : false }, cls : 'x-portlet', // Override Panel's default doClose to provide a custom fade out // effect // when a portlet is removed from the portal doClose : function() { if (!this.closing) { this.closing = true; if (this.el !== undefined) { this.el.animate({ opacity : 0, callback : function() { var closeAction = this.closeAction; this.closing = false; this.fireEvent('close', this); this[closeAction](); if (closeAction == 'hide') { this.el.setOpacity(1); } }, scope : this }); } } } });
/** * @class Wasp.Portlet * @extends Ext.panel.Panel A {@link Ext.panel.Panel Panel} class that is * managed by {@link Wasp.PortalPanel}. */ Ext.define('Wasp.Portlet', { extend : 'Ext.panel.Panel', alias : 'widget.portlet', layout : 'fit', anchor : '100%', frame : true, closable : true, collapsible : true, animCollapse : true, + autoScroll: true, draggable : { moveOnDrag : false }, cls : 'x-portlet', // Override Panel's default doClose to provide a custom fade out // effect // when a portlet is removed from the portal doClose : function() { if (!this.closing) { this.closing = true; if (this.el !== undefined) { this.el.animate({ opacity : 0, callback : function() { var closeAction = this.closeAction; this.closing = false; this.fireEvent('close', this); this[closeAction](); if (closeAction == 'hide') { this.el.setOpacity(1); } }, scope : this }); } } } });
1
0.023256
1
0
0dcc2a5865ed31618f63e9b152501cf8fbc201ac
doorman/main.py
doorman/main.py
import argparse import os from doorman import Doorman parser = argparse.ArgumentParser(description='Doorman keeps your secret things') parser.add_argument('-s', '--secret', action="store_true", dest="status", help='Hide all secret things') parser.add_argument('-u', '--unsecret', action="store_false", dest="status", help='Unhide all secret things') parser.add_argument('-c', '--config', action="store", dest="config_file", type=file, help='Config file') args = parser.parse_args() def main(): doorman = Doorman(args.status, os.path.abspath(args.config_file.name)) doorman.run() if __name__ == "__main__": main()
import argparse import os from doorman import Doorman DEFAULT_CONFIG_PATH = os.path.join(os.path.expanduser("~"), ".doormanrc") DEFAULT_CONFIG = """[secrets] test_secret = [files] test_secret = """ if not os.path.exists(DEFAULT_CONFIG_PATH): with open(DEFAULT_CONFIG_PATH, "w") as f: f.write(DEFAULT_CONFIG) parser = argparse.ArgumentParser(description='Doorman keeps your secret things') parser.add_argument('-s', '--secret', action="store_true", dest="status", help='Hide all secret things') parser.add_argument('-u', '--unsecret', action="store_false", dest="status", help='Unhide all secret things') parser.add_argument('-c', '--config', action="store", dest="config_file", default=DEFAULT_CONFIG_PATH, type=file, help='Config file') args = parser.parse_args() def main(): """ Main function """ if args.config_file.name is DEFAULT_CONFIG_PATH: parser.print_help() else: doorman = Doorman(args.status, os.path.abspath(args.config_file.name)) doorman.run() if __name__ == "__main__": main()
Add default parameter and default config
Add default parameter and default config
Python
mit
halitalptekin/doorman
python
## Code Before: import argparse import os from doorman import Doorman parser = argparse.ArgumentParser(description='Doorman keeps your secret things') parser.add_argument('-s', '--secret', action="store_true", dest="status", help='Hide all secret things') parser.add_argument('-u', '--unsecret', action="store_false", dest="status", help='Unhide all secret things') parser.add_argument('-c', '--config', action="store", dest="config_file", type=file, help='Config file') args = parser.parse_args() def main(): doorman = Doorman(args.status, os.path.abspath(args.config_file.name)) doorman.run() if __name__ == "__main__": main() ## Instruction: Add default parameter and default config ## Code After: import argparse import os from doorman import Doorman DEFAULT_CONFIG_PATH = os.path.join(os.path.expanduser("~"), ".doormanrc") DEFAULT_CONFIG = """[secrets] test_secret = [files] test_secret = """ if not os.path.exists(DEFAULT_CONFIG_PATH): with open(DEFAULT_CONFIG_PATH, "w") as f: f.write(DEFAULT_CONFIG) parser = argparse.ArgumentParser(description='Doorman keeps your secret things') parser.add_argument('-s', '--secret', action="store_true", dest="status", help='Hide all secret things') parser.add_argument('-u', '--unsecret', action="store_false", dest="status", help='Unhide all secret things') parser.add_argument('-c', '--config', action="store", dest="config_file", default=DEFAULT_CONFIG_PATH, type=file, help='Config file') args = parser.parse_args() def main(): """ Main function """ if args.config_file.name is DEFAULT_CONFIG_PATH: parser.print_help() else: doorman = Doorman(args.status, os.path.abspath(args.config_file.name)) doorman.run() if __name__ == "__main__": main()
import argparse import os from doorman import Doorman + DEFAULT_CONFIG_PATH = os.path.join(os.path.expanduser("~"), ".doormanrc") + DEFAULT_CONFIG = """[secrets] + test_secret = + + [files] + test_secret = + """ + + if not os.path.exists(DEFAULT_CONFIG_PATH): + with open(DEFAULT_CONFIG_PATH, "w") as f: + f.write(DEFAULT_CONFIG) + parser = argparse.ArgumentParser(description='Doorman keeps your secret things') parser.add_argument('-s', '--secret', action="store_true", dest="status", help='Hide all secret things') parser.add_argument('-u', '--unsecret', action="store_false", dest="status", help='Unhide all secret things') - parser.add_argument('-c', '--config', action="store", dest="config_file", type=file, help='Config file') ? ------------------------------- + parser.add_argument('-c', '--config', action="store", dest="config_file", - + default=DEFAULT_CONFIG_PATH, type=file, help='Config file') args = parser.parse_args() def main(): + """ + Main function + """ + if args.config_file.name is DEFAULT_CONFIG_PATH: + parser.print_help() + else: - doorman = Doorman(args.status, os.path.abspath(args.config_file.name)) + doorman = Doorman(args.status, os.path.abspath(args.config_file.name)) ? ++++ - doorman.run() + doorman.run() ? ++++ + if __name__ == "__main__": main()
27
1.5
23
4
5df17c9f37e863b5c3252db94112af29df9f77d5
Henrard_PHP/vues/menu_header_footer/menu.php
Henrard_PHP/vues/menu_header_footer/menu.php
<nav class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <!--Bouton home (efface les headers GET)--> <div class="navbar-header"> <a class="navbar-brand" href="./">Gilles Henrard</a> </div> <!--Barre de navigation (liens, ajoutent un header GET 'page')--> <!--ul class="nav navbar-nav"> <li><a href="?page=list_car">Véhicules</a></li> </ul--> <!--Encart de connexion--> <div id="navbar" class="navbar-collapse collapse"> <form class="navbar-form navbar-right"> <div class="form-group"> <input type="text" placeholder="Email" class="form-control" /> </div> <div class="form-group"> <input type="password" placeholder="Password" class="form-control" /> </div> <button type="submit" class="btn btn-success">Connexion</button> </form> </div> </div> </nav>
<nav class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <!--Bouton home (efface les headers GET)--> <div class="navbar-header"> <a class="navbar-brand" href="./"> <span class="glyphicon glyphicon-home"> HENRARD</span> </a> </div> <!--Encart de connexion--> <div id="navbar" class="navbar-collapse collapse"> <form class="navbar-form navbar-right"> <div class="form-group"> <input type="text" placeholder="Email" class="form-control" /> </div> <div class="form-group"> <input type="password" placeholder="Password" class="form-control" /> </div> <button type="submit" class="btn btn-success">Connexion</button> </form> </div> </div> </nav>
Add home icon to the nav bar
Add home icon to the nav bar
PHP
mit
gilleshenrard/ISFCE-webdev,gilleshenrard/ISFCE-webdev,gilleshenrard/ISFCE-webdev
php
## Code Before: <nav class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <!--Bouton home (efface les headers GET)--> <div class="navbar-header"> <a class="navbar-brand" href="./">Gilles Henrard</a> </div> <!--Barre de navigation (liens, ajoutent un header GET 'page')--> <!--ul class="nav navbar-nav"> <li><a href="?page=list_car">Véhicules</a></li> </ul--> <!--Encart de connexion--> <div id="navbar" class="navbar-collapse collapse"> <form class="navbar-form navbar-right"> <div class="form-group"> <input type="text" placeholder="Email" class="form-control" /> </div> <div class="form-group"> <input type="password" placeholder="Password" class="form-control" /> </div> <button type="submit" class="btn btn-success">Connexion</button> </form> </div> </div> </nav> ## Instruction: Add home icon to the nav bar ## Code After: <nav class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <!--Bouton home (efface les headers GET)--> <div class="navbar-header"> <a class="navbar-brand" href="./"> <span class="glyphicon glyphicon-home"> HENRARD</span> </a> </div> <!--Encart de connexion--> <div id="navbar" class="navbar-collapse collapse"> <form class="navbar-form navbar-right"> <div class="form-group"> <input type="text" placeholder="Email" class="form-control" /> </div> <div class="form-group"> <input type="password" placeholder="Password" class="form-control" /> </div> <button type="submit" class="btn btn-success">Connexion</button> </form> </div> </div> </nav>
<nav class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <!--Bouton home (efface les headers GET)--> <div class="navbar-header"> - <a class="navbar-brand" href="./">Gilles Henrard</a> ? ------------------ + <a class="navbar-brand" href="./"> + <span class="glyphicon glyphicon-home"> HENRARD</span> + </a> </div> - - <!--Barre de navigation (liens, ajoutent un header GET 'page')--> - <!--ul class="nav navbar-nav"> - <li><a href="?page=list_car">Véhicules</a></li> - </ul--> <!--Encart de connexion--> <div id="navbar" class="navbar-collapse collapse"> <form class="navbar-form navbar-right"> <div class="form-group"> <input type="text" placeholder="Email" class="form-control" /> </div> <div class="form-group"> <input type="password" placeholder="Password" class="form-control" /> </div> <button type="submit" class="btn btn-success">Connexion</button> </form> </div> </div> </nav>
9
0.333333
3
6
5a6fd6023253b37ce2f8e42f4068678fac0e859b
circle.yml
circle.yml
machine: services: - docker dependencies: override: - docker info - docker pull insighttoolkit/morphologicalcontourinterpolation-test - ~/ITKMorphologicalContourInterpolation/test/Docker/build.sh test: override: - mkdir ~/ITKMorphologicalContourInterpolation-build - docker run -v ~/ITKMorphologicalContourInterpolation:/usr/src/ITKMorphologicalContourInterpolation -v ~/ITKMorphologicalContourInterpolation-build:/usr/src/ITKMorphologicalContourInterpolation-build insighttoolkit/morphologicalcontourinterpolation-test /usr/src/ITKMorphologicalContourInterpolation/test/Docker/test.sh
machine: services: - docker dependencies: override: - docker info - docker pull insighttoolkit/morphologicalcontourinterpolation-test - ~/ITKMorphologicalContourInterpolation/test/Docker/build.sh test: override: - mkdir ~/ITKMorphologicalContourInterpolation-build - docker run -v ~/ITKMorphologicalContourInterpolation:/usr/src/ITKMorphologicalContourInterpolation -v ~/ITKMorphologicalContourInterpolation-build:/usr/src/ITKMorphologicalContourInterpolation-build insighttoolkit/morphologicalcontourinterpolation-test /usr/src/ITKMorphologicalContourInterpolation/test/Docker/test.sh deployment: hub: branch: master commands: - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS - docker push insighttoolkit/morphologicalcontourinterpolation-test
Add CircleCI / Docker test image deployment step.
ENH: Add CircleCI / Docker test image deployment step.
YAML
apache-2.0
thewtex/MorphologicalContourInterpolation,KitwareMedical/ITKMorphologicalContourInterpolation,KitwareMedical/ITKMorphologicalContourInterpolation,KitwareMedical/MorphologicalContourInterpolation,thewtex/MorphologicalContourInterpolation,dzenanz/MorphologicalContourInterpolation,dzenanz/MorphologicalContourInterpolation,KitwareMedical/MorphologicalContourInterpolation
yaml
## Code Before: machine: services: - docker dependencies: override: - docker info - docker pull insighttoolkit/morphologicalcontourinterpolation-test - ~/ITKMorphologicalContourInterpolation/test/Docker/build.sh test: override: - mkdir ~/ITKMorphologicalContourInterpolation-build - docker run -v ~/ITKMorphologicalContourInterpolation:/usr/src/ITKMorphologicalContourInterpolation -v ~/ITKMorphologicalContourInterpolation-build:/usr/src/ITKMorphologicalContourInterpolation-build insighttoolkit/morphologicalcontourinterpolation-test /usr/src/ITKMorphologicalContourInterpolation/test/Docker/test.sh ## Instruction: ENH: Add CircleCI / Docker test image deployment step. ## Code After: machine: services: - docker dependencies: override: - docker info - docker pull insighttoolkit/morphologicalcontourinterpolation-test - ~/ITKMorphologicalContourInterpolation/test/Docker/build.sh test: override: - mkdir ~/ITKMorphologicalContourInterpolation-build - docker run -v ~/ITKMorphologicalContourInterpolation:/usr/src/ITKMorphologicalContourInterpolation -v ~/ITKMorphologicalContourInterpolation-build:/usr/src/ITKMorphologicalContourInterpolation-build insighttoolkit/morphologicalcontourinterpolation-test /usr/src/ITKMorphologicalContourInterpolation/test/Docker/test.sh deployment: hub: branch: master commands: - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS - docker push insighttoolkit/morphologicalcontourinterpolation-test
machine: services: - docker dependencies: override: - docker info - docker pull insighttoolkit/morphologicalcontourinterpolation-test - ~/ITKMorphologicalContourInterpolation/test/Docker/build.sh test: override: - mkdir ~/ITKMorphologicalContourInterpolation-build - docker run -v ~/ITKMorphologicalContourInterpolation:/usr/src/ITKMorphologicalContourInterpolation -v ~/ITKMorphologicalContourInterpolation-build:/usr/src/ITKMorphologicalContourInterpolation-build insighttoolkit/morphologicalcontourinterpolation-test /usr/src/ITKMorphologicalContourInterpolation/test/Docker/test.sh + + deployment: + hub: + branch: master + commands: + - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS + - docker push insighttoolkit/morphologicalcontourinterpolation-test
7
0.5
7
0
3b7505194724837cd23c1978dd664d6059b2c396
README.md
README.md
WinAppDriver - WebDriver for Windows Applications ================================================= WinAppDriver is a WebDriver implementation for Windows applications, including desktop applications and store apps (formerly known as Metro-style apps). The support for Windows Phone apps is also planned. Status ------ Currently, this project is at the early stage of development. * For an overview of what it is, refer to [Windows Store Apps Test Automation](http://www.slideshare.net/jeremykao92/winappdriver-windows-store-apps-test-automation). * For how to contribute, refer to [WinAppDriver Developemnt](http://www.slideshare.net/jeremykao92/winappdriver-development). License ------- WinAppDriver is licensed under MIT. Refer to [LICENSE](LICENSE) for more information.
WinAppDriver - WebDriver for Windows Applications ================================================= WinAppDriver is a WebDriver implementation for Windows applications, including desktop applications and store apps (formerly known as Metro-style apps). Support of CEF-based desktop applications and Windows Phone apps is also planned. Status ------ Currently, this project is at the early stage of development. * For an overview of what it is, refer to [Windows Store Apps Test Automation](http://www.slideshare.net/jeremykao92/winappdriver-windows-store-apps-test-automation). * For how to contribute, refer to [WinAppDriver Developemnt](http://www.slideshare.net/jeremykao92/winappdriver-development). License ------- WinAppDriver is licensed under MIT. Refer to [LICENSE](LICENSE) for more information.
Support of CEF-based applications in the future
Support of CEF-based applications in the future
Markdown
mit
imsardine/winappdriver,shaunstanislaus/winappdriver
markdown
## Code Before: WinAppDriver - WebDriver for Windows Applications ================================================= WinAppDriver is a WebDriver implementation for Windows applications, including desktop applications and store apps (formerly known as Metro-style apps). The support for Windows Phone apps is also planned. Status ------ Currently, this project is at the early stage of development. * For an overview of what it is, refer to [Windows Store Apps Test Automation](http://www.slideshare.net/jeremykao92/winappdriver-windows-store-apps-test-automation). * For how to contribute, refer to [WinAppDriver Developemnt](http://www.slideshare.net/jeremykao92/winappdriver-development). License ------- WinAppDriver is licensed under MIT. Refer to [LICENSE](LICENSE) for more information. ## Instruction: Support of CEF-based applications in the future ## Code After: WinAppDriver - WebDriver for Windows Applications ================================================= WinAppDriver is a WebDriver implementation for Windows applications, including desktop applications and store apps (formerly known as Metro-style apps). Support of CEF-based desktop applications and Windows Phone apps is also planned. Status ------ Currently, this project is at the early stage of development. * For an overview of what it is, refer to [Windows Store Apps Test Automation](http://www.slideshare.net/jeremykao92/winappdriver-windows-store-apps-test-automation). * For how to contribute, refer to [WinAppDriver Developemnt](http://www.slideshare.net/jeremykao92/winappdriver-development). License ------- WinAppDriver is licensed under MIT. Refer to [LICENSE](LICENSE) for more information.
WinAppDriver - WebDriver for Windows Applications ================================================= - WinAppDriver is a WebDriver implementation for Windows applications, including desktop applications and store apps (formerly known as Metro-style apps). The support for Windows Phone apps is also planned. ? ^^^^^ ^^ + WinAppDriver is a WebDriver implementation for Windows applications, including desktop applications and store apps (formerly known as Metro-style apps). Support of CEF-based desktop applications and Windows Phone apps is also planned. ? ^ + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Status ------ Currently, this project is at the early stage of development. * For an overview of what it is, refer to [Windows Store Apps Test Automation](http://www.slideshare.net/jeremykao92/winappdriver-windows-store-apps-test-automation). * For how to contribute, refer to [WinAppDriver Developemnt](http://www.slideshare.net/jeremykao92/winappdriver-development). License ------- WinAppDriver is licensed under MIT. Refer to [LICENSE](LICENSE) for more information.
2
0.117647
1
1
a9ee7490bed6a52352ae2fe4507c2d337b8ba6c6
modules/mixins/scroll-spy.js
modules/mixins/scroll-spy.js
var spyCallbacks = []; var spySetState = []; var currentPositionY = function() { var supportPageOffset = window.pageXOffset !== undefined; var isCSS1Compat = ((document.compatMode || "") === "CSS1Compat"); return supportPageOffset ? window.pageYOffset : isCSS1Compat ? document.documentElement.scrollTop : document.body.scrollTop; }; if (typeof document !== 'undefined') { document.addEventListener('scroll', function() { for(var i = 0; i < spyCallbacks.length; i = i + 1) { spyCallbacks[i](currentPositionY()); } }); } module.exports = { unmount: function(){ spySetState = []; spyCallbacks = []; }, addStateHandler: function(handler){ spySetState.push(handler); }, addSpyHandler: function(handler){ spyCallbacks.push(handler); }, updateStates: function(){ var length = spySetState.length; for(var i = 0; i < length; i = i + 1) { spySetState[i](); } } };
var spyCallbacks = []; var spySetState = []; var currentPositionY = function() { var supportPageOffset = window.pageXOffset !== undefined; var isCSS1Compat = ((document.compatMode || "") === "CSS1Compat"); return supportPageOffset ? window.pageYOffset : isCSS1Compat ? document.documentElement.scrollTop : document.body.scrollTop; }; var scrollHandler = function() { for(var i = 0; i < spyCallbacks.length; i = i + 1) { spyCallbacks[i](currentPositionY()); } }; if (typeof document !== 'undefined') { document.addEventListener('scroll', scrollHandler); } module.exports = { unmount: function(){ document.removeEventListener('scroll', scrollHandler); spySetState = []; spyCallbacks = []; }, addStateHandler: function(handler){ spySetState.push(handler); }, addSpyHandler: function(handler){ spyCallbacks.push(handler); }, updateStates: function(){ var length = spySetState.length; for(var i = 0; i < length; i = i + 1) { spySetState[i](); } } };
Clean up events bound on window, otherwise this will induce a memory leak.
Clean up events bound on window, otherwise this will induce a memory leak.
JavaScript
mit
wearableintelligence/react-scroll,slashtu/react-scroll,synapsestudios/react-scroll,vanderlin/react-scroll,ntdb/react-scroll,fisshy/react-scroll,daviferreira/react-scroll,dandelany/react-scroll
javascript
## Code Before: var spyCallbacks = []; var spySetState = []; var currentPositionY = function() { var supportPageOffset = window.pageXOffset !== undefined; var isCSS1Compat = ((document.compatMode || "") === "CSS1Compat"); return supportPageOffset ? window.pageYOffset : isCSS1Compat ? document.documentElement.scrollTop : document.body.scrollTop; }; if (typeof document !== 'undefined') { document.addEventListener('scroll', function() { for(var i = 0; i < spyCallbacks.length; i = i + 1) { spyCallbacks[i](currentPositionY()); } }); } module.exports = { unmount: function(){ spySetState = []; spyCallbacks = []; }, addStateHandler: function(handler){ spySetState.push(handler); }, addSpyHandler: function(handler){ spyCallbacks.push(handler); }, updateStates: function(){ var length = spySetState.length; for(var i = 0; i < length; i = i + 1) { spySetState[i](); } } }; ## Instruction: Clean up events bound on window, otherwise this will induce a memory leak. ## Code After: var spyCallbacks = []; var spySetState = []; var currentPositionY = function() { var supportPageOffset = window.pageXOffset !== undefined; var isCSS1Compat = ((document.compatMode || "") === "CSS1Compat"); return supportPageOffset ? window.pageYOffset : isCSS1Compat ? document.documentElement.scrollTop : document.body.scrollTop; }; var scrollHandler = function() { for(var i = 0; i < spyCallbacks.length; i = i + 1) { spyCallbacks[i](currentPositionY()); } }; if (typeof document !== 'undefined') { document.addEventListener('scroll', scrollHandler); } module.exports = { unmount: function(){ document.removeEventListener('scroll', scrollHandler); spySetState = []; spyCallbacks = []; }, addStateHandler: function(handler){ spySetState.push(handler); }, addSpyHandler: function(handler){ spyCallbacks.push(handler); }, updateStates: function(){ var length = spySetState.length; for(var i = 0; i < length; i = i + 1) { spySetState[i](); } } };
var spyCallbacks = []; var spySetState = []; var currentPositionY = function() { var supportPageOffset = window.pageXOffset !== undefined; var isCSS1Compat = ((document.compatMode || "") === "CSS1Compat"); return supportPageOffset ? window.pageYOffset : isCSS1Compat ? document.documentElement.scrollTop : document.body.scrollTop; }; + var scrollHandler = function() { + for(var i = 0; i < spyCallbacks.length; i = i + 1) { + spyCallbacks[i](currentPositionY()); + } + }; + if (typeof document !== 'undefined') { - document.addEventListener('scroll', function() { ? ^^ ^^^^^^ ^^ + document.addEventListener('scroll', scrollHandler); ? ^^^^^^^^ ^^^^ ^ - for(var i = 0; i < spyCallbacks.length; i = i + 1) { - spyCallbacks[i](currentPositionY()); - } - }); } module.exports = { unmount: function(){ + document.removeEventListener('scroll', scrollHandler); spySetState = []; spyCallbacks = []; }, addStateHandler: function(handler){ spySetState.push(handler); }, addSpyHandler: function(handler){ spyCallbacks.push(handler); }, updateStates: function(){ var length = spySetState.length; for(var i = 0; i < length; i = i + 1) { spySetState[i](); } - } };
14
0.333333
8
6