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
5e08f78da50518c38f7111af6bf4acc15dbc481f
app/modules/datasets/partials/step3.html
app/modules/datasets/partials/step3.html
<dataset-create-wrapper> <dataset-create-header step="3" before-next-step="nextStep()"></dataset-create-header> <hot-table settings="inputTable.settings" datarows="inputTable.items" height="500"></hot-table> <div class="dataset-filters-bottom"> <div class="dataset-filter clearfix"> <h5>Time Resolution</h5> <div class="dataset-select" isteven-multi-select input-model="timeResolution.input" output-model="timeResolution.output" selection-mode="single" button-label="name" item-label="name" tick-property="ticked"></div> </div> </div> <div class="dataset-filters-bottom" ng-if="timeResolution.output"> <div class="dataset-filter clearfix"> <div class="row"> <div class="col-lg-6"> <label>Start Date: </label> <input type="text" placeholder="{{ timeResolution.output[0].placeholder }}" ng-model="time.start"> </div> <div class="col-lg-6"> <label>End Date: </label> <input type="text" placeholder="{{ timeResolution.output[0].placeholder }}" ng-model="time.end"> </div> </div> </div> </div> </dataset-create-wrapper>
<dataset-create-wrapper> <dataset-create-header step="3" before-next-step="nextStep()"></dataset-create-header> <div> <div class="dataset-filter clearfix"> <h5>Time Resolution</h5> <div class="dataset-select" isteven-multi-select input-model="timeResolution.input" output-model="timeResolution.output" selection-mode="single" button-label="name" item-label="name" tick-property="ticked"></div> </div> </div> <div ng-if="timeResolution.output"> <div class="dataset-filter clearfix"> <div class="row"> <div class="col-lg-6"> <label>Start Date: </label> <input type="text" placeholder="{{ timeResolution.output[0].placeholder }}" ng-model="time.start"> </div> <div class="col-lg-6"> <label>End Date: </label> <input type="text" placeholder="{{ timeResolution.output[0].placeholder }}" ng-model="time.end"> </div> </div> </div> </div> <br /> <hot-table settings="inputTable.settings" datarows="inputTable.items" height="500"></hot-table> </dataset-create-wrapper>
Move Time Resolution Selection on Top
Move Time Resolution Selection on Top
HTML
agpl-3.0
cbotsikas/policycompass-frontend,policycompass/policycompass-frontend,mmilaprat/policycompass-frontend,bullz/policycompass-frontend,cbotsikas/policycompass-frontend,bullz/policycompass-frontend,mmilaprat/policycompass-frontend,policycompass/policycompass-frontend,policycompass/policycompass-frontend,cbotsikas/policycompass-frontend,bullz/policycompass-frontend,mmilaprat/policycompass-frontend
html
## Code Before: <dataset-create-wrapper> <dataset-create-header step="3" before-next-step="nextStep()"></dataset-create-header> <hot-table settings="inputTable.settings" datarows="inputTable.items" height="500"></hot-table> <div class="dataset-filters-bottom"> <div class="dataset-filter clearfix"> <h5>Time Resolution</h5> <div class="dataset-select" isteven-multi-select input-model="timeResolution.input" output-model="timeResolution.output" selection-mode="single" button-label="name" item-label="name" tick-property="ticked"></div> </div> </div> <div class="dataset-filters-bottom" ng-if="timeResolution.output"> <div class="dataset-filter clearfix"> <div class="row"> <div class="col-lg-6"> <label>Start Date: </label> <input type="text" placeholder="{{ timeResolution.output[0].placeholder }}" ng-model="time.start"> </div> <div class="col-lg-6"> <label>End Date: </label> <input type="text" placeholder="{{ timeResolution.output[0].placeholder }}" ng-model="time.end"> </div> </div> </div> </div> </dataset-create-wrapper> ## Instruction: Move Time Resolution Selection on Top ## Code After: <dataset-create-wrapper> <dataset-create-header step="3" before-next-step="nextStep()"></dataset-create-header> <div> <div class="dataset-filter clearfix"> <h5>Time Resolution</h5> <div class="dataset-select" isteven-multi-select input-model="timeResolution.input" output-model="timeResolution.output" selection-mode="single" button-label="name" item-label="name" tick-property="ticked"></div> </div> </div> <div ng-if="timeResolution.output"> <div class="dataset-filter clearfix"> <div class="row"> <div class="col-lg-6"> <label>Start Date: </label> <input type="text" placeholder="{{ timeResolution.output[0].placeholder }}" ng-model="time.start"> </div> <div class="col-lg-6"> <label>End Date: </label> <input type="text" placeholder="{{ timeResolution.output[0].placeholder }}" ng-model="time.end"> </div> </div> </div> </div> <br /> <hot-table settings="inputTable.settings" datarows="inputTable.items" height="500"></hot-table> </dataset-create-wrapper>
<dataset-create-wrapper> <dataset-create-header step="3" before-next-step="nextStep()"></dataset-create-header> + <div> - <hot-table settings="inputTable.settings" datarows="inputTable.items" height="500"></hot-table> - - <div class="dataset-filters-bottom"> <div class="dataset-filter clearfix"> <h5>Time Resolution</h5> <div class="dataset-select" isteven-multi-select input-model="timeResolution.input" output-model="timeResolution.output" selection-mode="single" button-label="name" item-label="name" tick-property="ticked"></div> </div> </div> - <div class="dataset-filters-bottom" ng-if="timeResolution.output"> + <div ng-if="timeResolution.output"> <div class="dataset-filter clearfix"> <div class="row"> <div class="col-lg-6"> <label>Start Date: </label> <input type="text" placeholder="{{ timeResolution.output[0].placeholder }}" ng-model="time.start"> - </div> <div class="col-lg-6"> <label>End Date: </label> <input type="text" placeholder="{{ timeResolution.output[0].placeholder }}" ng-model="time.end"> </div> </div> </div> </div> + <br /> + <hot-table settings="inputTable.settings" datarows="inputTable.items" height="500"></hot-table> </dataset-create-wrapper>
9
0.3
4
5
60e7c99cc7556e6dfe41096b61c8d83f71e5a489
templates/README.md.erb
templates/README.md.erb
After you have cloned this repo, run this setup script to set up your machine with the necessary dependencies to run and test this app: % ./bin/setup It assumes you have a machine equipped with Ruby, Postgres or MySQL, Node, Qt. To install Ruby, read the [rbenv guide](https://github.com/rbenv/rbenv#installation) or the [rvm guide](https://rvm.io/rvm/install). To install Postgres: $ brew install postgresql To install MySQL: $ brew tap homebrew/versions $ brew install mysql55 $ brew link --force mysql55 To install Node: $ brew install node To install Qt: $ brew install qt5 $ brew link --force qt5 After setting up, you can run the application using [Heroku Local]: % heroku local [Heroku Local]: https://devcenter.heroku.com/articles/heroku-local
After you have cloned this repo, run this setup script to set up your machine with the necessary dependencies to run and test this app: % ./bin/setup It assumes you have a machine equipped with Ruby, Postgres or MySQL, Node, Qt and ImageMagick. To install Ruby, read the [rbenv guide](https://github.com/rbenv/rbenv#installation) or the [rvm guide](https://rvm.io/rvm/install). To install Postgres: $ brew install postgresql To install MySQL: $ brew tap homebrew/versions $ brew install mysql55 $ brew link --force mysql55 To install Node: $ brew install node To install Qt: $ brew install qt5 $ brew link --force qt5 To install ImageMagick: $ brew install imagemagick After setting up, you can run the application using [Heroku Local]: % heroku local [Heroku Local]: https://devcenter.heroku.com/articles/heroku-local
Add info to install image magick
Add info to install image magick
HTML+ERB
mit
welaika/welaika-suspenders,mukkoo/welaika-suspenders,welaika/welaika-suspenders,mukkoo/welaika-suspenders,welaika/welaika-suspenders,mukkoo/welaika-suspenders
html+erb
## Code Before: After you have cloned this repo, run this setup script to set up your machine with the necessary dependencies to run and test this app: % ./bin/setup It assumes you have a machine equipped with Ruby, Postgres or MySQL, Node, Qt. To install Ruby, read the [rbenv guide](https://github.com/rbenv/rbenv#installation) or the [rvm guide](https://rvm.io/rvm/install). To install Postgres: $ brew install postgresql To install MySQL: $ brew tap homebrew/versions $ brew install mysql55 $ brew link --force mysql55 To install Node: $ brew install node To install Qt: $ brew install qt5 $ brew link --force qt5 After setting up, you can run the application using [Heroku Local]: % heroku local [Heroku Local]: https://devcenter.heroku.com/articles/heroku-local ## Instruction: Add info to install image magick ## Code After: After you have cloned this repo, run this setup script to set up your machine with the necessary dependencies to run and test this app: % ./bin/setup It assumes you have a machine equipped with Ruby, Postgres or MySQL, Node, Qt and ImageMagick. To install Ruby, read the [rbenv guide](https://github.com/rbenv/rbenv#installation) or the [rvm guide](https://rvm.io/rvm/install). To install Postgres: $ brew install postgresql To install MySQL: $ brew tap homebrew/versions $ brew install mysql55 $ brew link --force mysql55 To install Node: $ brew install node To install Qt: $ brew install qt5 $ brew link --force qt5 To install ImageMagick: $ brew install imagemagick After setting up, you can run the application using [Heroku Local]: % heroku local [Heroku Local]: https://devcenter.heroku.com/articles/heroku-local
After you have cloned this repo, run this setup script to set up your machine with the necessary dependencies to run and test this app: % ./bin/setup - It assumes you have a machine equipped with Ruby, Postgres or MySQL, Node, Qt. + It assumes you have a machine equipped with Ruby, Postgres or MySQL, Node, Qt and ImageMagick. ? ++++++++++++++++ To install Ruby, read the [rbenv guide](https://github.com/rbenv/rbenv#installation) or the [rvm guide](https://rvm.io/rvm/install). To install Postgres: $ brew install postgresql To install MySQL: $ brew tap homebrew/versions $ brew install mysql55 $ brew link --force mysql55 To install Node: $ brew install node To install Qt: $ brew install qt5 $ brew link --force qt5 + + To install ImageMagick: + + $ brew install imagemagick After setting up, you can run the application using [Heroku Local]: % heroku local [Heroku Local]: https://devcenter.heroku.com/articles/heroku-local
6
0.171429
5
1
743c59557e7b863bfdabc583f94d9b3dbc62f2be
bin/geocode_cita.rb
bin/geocode_cita.rb
require 'csv' require 'geocoder' require 'json' locations = [] # "REGION","DELIVERY BUREAU","PRIMARY CONTACT","POSTAL ADDRESS","Phone number" CSV.foreach('cita.csv', headers: true, return_headers: false) do |row| address = row.fields[3].gsub(/\n/, ', ').strip phone = row.fields.last.strip lat, lng = Geocoder.coordinates(address) locations << { title: 'Citizens Advice', address: address, phone: phone, lat: lat, lng: lng } #sleep(1) end puts JSON.pretty_generate(locations)
require 'csv' require 'geocoder' require 'json' locations = [] # "Pension Wise Delivery Centre ","Pension Wise Email ","Pension Wise Phone Number ","Pension Wise Contact Address" CSV.foreach('cita.csv', headers: true, return_headers: false) do |row| region = row.fields.first.strip address = row.fields.last.strip.gsub(/\n/, ', ') phone = row.fields[2].strip lat, lng = Geocoder.coordinates(address) locations << { title: "#{region} Citizens Advice", address: address, phone: phone, lat: lat, lng: lng } #sleep(1) end puts JSON.pretty_generate(locations)
Update CitA CSV parsing script
Update CitA CSV parsing script
Ruby
mit
guidance-guarantee-programme/locator,guidance-guarantee-programme/locator,guidance-guarantee-programme/locator,guidance-guarantee-programme/locator
ruby
## Code Before: require 'csv' require 'geocoder' require 'json' locations = [] # "REGION","DELIVERY BUREAU","PRIMARY CONTACT","POSTAL ADDRESS","Phone number" CSV.foreach('cita.csv', headers: true, return_headers: false) do |row| address = row.fields[3].gsub(/\n/, ', ').strip phone = row.fields.last.strip lat, lng = Geocoder.coordinates(address) locations << { title: 'Citizens Advice', address: address, phone: phone, lat: lat, lng: lng } #sleep(1) end puts JSON.pretty_generate(locations) ## Instruction: Update CitA CSV parsing script ## Code After: require 'csv' require 'geocoder' require 'json' locations = [] # "Pension Wise Delivery Centre ","Pension Wise Email ","Pension Wise Phone Number ","Pension Wise Contact Address" CSV.foreach('cita.csv', headers: true, return_headers: false) do |row| region = row.fields.first.strip address = row.fields.last.strip.gsub(/\n/, ', ') phone = row.fields[2].strip lat, lng = Geocoder.coordinates(address) locations << { title: "#{region} Citizens Advice", address: address, phone: phone, lat: lat, lng: lng } #sleep(1) end puts JSON.pretty_generate(locations)
require 'csv' require 'geocoder' require 'json' locations = [] - # "REGION","DELIVERY BUREAU","PRIMARY CONTACT","POSTAL ADDRESS","Phone number" + # "Pension Wise Delivery Centre ","Pension Wise Email ","Pension Wise Phone Number ","Pension Wise Contact Address" CSV.foreach('cita.csv', headers: true, return_headers: false) do |row| + region = row.fields.first.strip - address = row.fields[3].gsub(/\n/, ', ').strip ? ^^^ ------ + address = row.fields.last.strip.gsub(/\n/, ', ') ? ^^^^^^^^^^^ - phone = row.fields.last.strip ? ^^^^^ + phone = row.fields[2].strip ? ^^^ lat, lng = Geocoder.coordinates(address) locations << { - title: 'Citizens Advice', ? ^ ^ + title: "#{region} Citizens Advice", ? ^^^^^^^^^^^ ^ address: address, phone: phone, lat: lat, lng: lng } #sleep(1) end puts JSON.pretty_generate(locations)
9
0.375
5
4
2d04ffdf497c845502bc18ac3e3d7fb6834f7a8a
test/msan/chained_origin_with_signals.cc
test/msan/chained_origin_with_signals.cc
// Check that stores in signal handlers are not recorded in origin history. // This is, in fact, undesired behavior caused by our chained origins // implementation being not async-signal-safe. // RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -m64 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -mllvm -msan-instrumentation-with-call-threshold=0 -fsanitize-memory-track-origins=2 -m64 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out #include <signal.h> #include <stdio.h> #include <sys/types.h> #include <unistd.h> volatile int x, y; void SignalHandler(int signo) { y = x; } int main(int argc, char *argv[]) { int volatile z; x = z; signal(SIGUSR1, SignalHandler); kill(getpid(), SIGUSR1); signal(SIGUSR1, SIG_DFL); return y; } // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK-NOT: in SignalHandler
// Check that stores in signal handlers are not recorded in origin history. // This is, in fact, undesired behavior caused by our chained origins // implementation being not async-signal-safe. // RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -m64 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -mllvm -msan-instrumentation-with-call-threshold=0 -fsanitize-memory-track-origins=2 -m64 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out #include <signal.h> #include <stdio.h> #include <sys/types.h> #include <unistd.h> volatile int x, y; void SignalHandler(int signo) { y = x; } int main(int argc, char *argv[]) { int volatile z; x = z; signal(SIGHUP, SignalHandler); kill(getpid(), SIGHUP); signal(SIGHUP, SIG_DFL); return y; } // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK-NOT: in SignalHandler
Use SIGHUP instead of SIGUSR1 in test.
[msan] Use SIGHUP instead of SIGUSR1 in test. Apparently, SIGUSR1 does not work on x86_64+ArchLinux for some reason. For more details, see: https://groups.google.com/forum/#!topic/llvm-dev/4Ag1FF4M2Dw git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@214289 91177308-0d34-0410-b5e6-96231b3b80d8
C++
apache-2.0
llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt
c++
## Code Before: // Check that stores in signal handlers are not recorded in origin history. // This is, in fact, undesired behavior caused by our chained origins // implementation being not async-signal-safe. // RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -m64 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -mllvm -msan-instrumentation-with-call-threshold=0 -fsanitize-memory-track-origins=2 -m64 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out #include <signal.h> #include <stdio.h> #include <sys/types.h> #include <unistd.h> volatile int x, y; void SignalHandler(int signo) { y = x; } int main(int argc, char *argv[]) { int volatile z; x = z; signal(SIGUSR1, SignalHandler); kill(getpid(), SIGUSR1); signal(SIGUSR1, SIG_DFL); return y; } // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK-NOT: in SignalHandler ## Instruction: [msan] Use SIGHUP instead of SIGUSR1 in test. Apparently, SIGUSR1 does not work on x86_64+ArchLinux for some reason. For more details, see: https://groups.google.com/forum/#!topic/llvm-dev/4Ag1FF4M2Dw git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@214289 91177308-0d34-0410-b5e6-96231b3b80d8 ## Code After: // Check that stores in signal handlers are not recorded in origin history. // This is, in fact, undesired behavior caused by our chained origins // implementation being not async-signal-safe. // RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -m64 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -mllvm -msan-instrumentation-with-call-threshold=0 -fsanitize-memory-track-origins=2 -m64 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out #include <signal.h> #include <stdio.h> #include <sys/types.h> #include <unistd.h> volatile int x, y; void SignalHandler(int signo) { y = x; } int main(int argc, char *argv[]) { int volatile z; x = z; signal(SIGHUP, SignalHandler); kill(getpid(), SIGHUP); signal(SIGHUP, SIG_DFL); return y; } // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK-NOT: in SignalHandler
// Check that stores in signal handlers are not recorded in origin history. // This is, in fact, undesired behavior caused by our chained origins // implementation being not async-signal-safe. // RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -m64 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out // RUN: %clangxx_msan -mllvm -msan-instrumentation-with-call-threshold=0 -fsanitize-memory-track-origins=2 -m64 -O3 %s -o %t && \ // RUN: not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out #include <signal.h> #include <stdio.h> #include <sys/types.h> #include <unistd.h> volatile int x, y; void SignalHandler(int signo) { y = x; } int main(int argc, char *argv[]) { int volatile z; x = z; - signal(SIGUSR1, SignalHandler); ? ^^^ + signal(SIGHUP, SignalHandler); ? + ^ - kill(getpid(), SIGUSR1); ? ^^^ + kill(getpid(), SIGHUP); ? + ^ - signal(SIGUSR1, SIG_DFL); ? ^^^ + signal(SIGHUP, SIG_DFL); ? + ^ return y; } // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value // CHECK-NOT: in SignalHandler
6
0.166667
3
3
391ad553bcf620129128c6c90bbfcfc6b3b90024
loads/templates/loads/emails/assessment_updates.html
loads/templates/loads/emails/assessment_updates.html
<p>Dear Colleague,<br /> Your attention is drawn to this assessment sign off on module {{ signoff.module }}. Any previous history is shown for reference.</p> <p><a href="{{ base_url }}{% url 'modules_details' signoff.module.id %}">Further details are available online.</a></p> {% if assessment_history %} {% for signoff, resources in assessment_history %} {% if signoff %} <h3>{{ signoff.assessment_state }} by {{ signoff.signed_by.first_name }} {{ signoff.signed_by.last_name }} on {{ signoff.created }}</h3> {% endif %} {% if resources %} <table style="border-collapse: collapse; border-color: #ccc;" border="1"> <tr> <th>Resource Type</th><th>Name</th><th>Owner</th><th>Created</th> </tr> {% for resource in resources %} <tr style="background: {% cycle '#EDF3FE' '#FFFFFF' %};"> <td>{{ resource.resource_type }}</td> <td>{{ resource.name }}</td> <td>{{ resource.owner }}</td> <td>{{ resource.created }}</td> </tr> {% endfor %} </table> {% endif %} {% endfor %} {% else %} <p>Oh, something went wrong trying to send you an assessment update.</p> {% endif %}
<p>Dear Colleague,<br /> Your attention is drawn to this assessment sign off on module {{ signoff.module }}. Any previous history is shown for reference.</p> <p><a href="{{ base_url }}{% url 'modules_details' signoff.module.id %}">Further details are available online.</a></p> {% if assessment_history %} {% for signoff, resources in assessment_history %} {% if signoff %} <h3>{{ signoff.assessment_state }} by {{ signoff.signed_by.first_name }} {{ signoff.signed_by.last_name }} on {{ signoff.created }}</h3> {% endif %} {% if resources %} <table style="border-collapse: collapse; border-color: #ccc;" border="1"> <tr> <th style="text-align: left;">Resource Type</th> <th style="text-align: left;">Name</th> <th style="text-align: left;">Owner</th><th>Created</th> </tr> {% for resource in resources %} <tr style="background: {% cycle '#EDF3FE' '#FFFFFF' %};"> <td style="padding: 5px;">{{ resource.resource_type }}</td> <td style="padding: 5px;">{{ resource.name }}</td> <td style="padding: 5px;">{{ resource.owner }}</td> <td style="padding: 5px;">{{ resource.created }}</td> </tr> {% endfor %} </table> {% endif %} {% endfor %} {% else %} <p>Oh, something went wrong trying to send you an assessment update.</p> {% endif %}
Tweak HTML for readability of table.
Tweak HTML for readability of table.
HTML
agpl-3.0
profcturner/WAM,profcturner/WAM,profcturner/WAM
html
## Code Before: <p>Dear Colleague,<br /> Your attention is drawn to this assessment sign off on module {{ signoff.module }}. Any previous history is shown for reference.</p> <p><a href="{{ base_url }}{% url 'modules_details' signoff.module.id %}">Further details are available online.</a></p> {% if assessment_history %} {% for signoff, resources in assessment_history %} {% if signoff %} <h3>{{ signoff.assessment_state }} by {{ signoff.signed_by.first_name }} {{ signoff.signed_by.last_name }} on {{ signoff.created }}</h3> {% endif %} {% if resources %} <table style="border-collapse: collapse; border-color: #ccc;" border="1"> <tr> <th>Resource Type</th><th>Name</th><th>Owner</th><th>Created</th> </tr> {% for resource in resources %} <tr style="background: {% cycle '#EDF3FE' '#FFFFFF' %};"> <td>{{ resource.resource_type }}</td> <td>{{ resource.name }}</td> <td>{{ resource.owner }}</td> <td>{{ resource.created }}</td> </tr> {% endfor %} </table> {% endif %} {% endfor %} {% else %} <p>Oh, something went wrong trying to send you an assessment update.</p> {% endif %} ## Instruction: Tweak HTML for readability of table. ## Code After: <p>Dear Colleague,<br /> Your attention is drawn to this assessment sign off on module {{ signoff.module }}. Any previous history is shown for reference.</p> <p><a href="{{ base_url }}{% url 'modules_details' signoff.module.id %}">Further details are available online.</a></p> {% if assessment_history %} {% for signoff, resources in assessment_history %} {% if signoff %} <h3>{{ signoff.assessment_state }} by {{ signoff.signed_by.first_name }} {{ signoff.signed_by.last_name }} on {{ signoff.created }}</h3> {% endif %} {% if resources %} <table style="border-collapse: collapse; border-color: #ccc;" border="1"> <tr> <th style="text-align: left;">Resource Type</th> <th style="text-align: left;">Name</th> <th style="text-align: left;">Owner</th><th>Created</th> </tr> {% for resource in resources %} <tr style="background: {% cycle '#EDF3FE' '#FFFFFF' %};"> <td style="padding: 5px;">{{ resource.resource_type }}</td> <td style="padding: 5px;">{{ resource.name }}</td> <td style="padding: 5px;">{{ resource.owner }}</td> <td style="padding: 5px;">{{ resource.created }}</td> </tr> {% endfor %} </table> {% endif %} {% endfor %} {% else %} <p>Oh, something went wrong trying to send you an assessment update.</p> {% endif %}
<p>Dear Colleague,<br /> Your attention is drawn to this assessment sign off on module {{ signoff.module }}. Any previous history is shown for reference.</p> <p><a href="{{ base_url }}{% url 'modules_details' signoff.module.id %}">Further details are available online.</a></p> {% if assessment_history %} {% for signoff, resources in assessment_history %} {% if signoff %} <h3>{{ signoff.assessment_state }} by {{ signoff.signed_by.first_name }} {{ signoff.signed_by.last_name }} on {{ signoff.created }}</h3> {% endif %} {% if resources %} <table style="border-collapse: collapse; border-color: #ccc;" border="1"> <tr> - <th>Resource Type</th><th>Name</th><th>Owner</th><th>Created</th> + <th style="text-align: left;">Resource Type</th> + <th style="text-align: left;">Name</th> + <th style="text-align: left;">Owner</th><th>Created</th> + </tr> {% for resource in resources %} <tr style="background: {% cycle '#EDF3FE' '#FFFFFF' %};"> - <td>{{ resource.resource_type }}</td> + <td style="padding: 5px;">{{ resource.resource_type }}</td> ? ++++++++++++++++++++++ - <td>{{ resource.name }}</td> + <td style="padding: 5px;">{{ resource.name }}</td> ? ++++++++++++++++++++++ - <td>{{ resource.owner }}</td> + <td style="padding: 5px;">{{ resource.owner }}</td> ? ++++++++++++++++++++++ - <td>{{ resource.created }}</td> + <td style="padding: 5px;">{{ resource.created }}</td> ? ++++++++++++++++++++++ </tr> {% endfor %} </table> {% endif %} {% endfor %} {% else %} <p>Oh, something went wrong trying to send you an assessment update.</p> {% endif %}
13
0.361111
8
5
8a0497f6a51e7e57a73533492ede5ea7dab5013a
docs/source/use-cases/narrative-hub.rst
docs/source/use-cases/narrative-hub.rst
JupyterHub Narratives ===================== Description ----------- JupyterHub Narratives explore deployment and scaling of the Jupyter Notebook for a group of users. JupyterHub allows flexibility in configuration and deployment which makes JupyterHub a valuable to education, industry research teams, and service providers. In these Narratives, we will look at differences in deployment, deployment advantages, and best practices. Narratives ---------- - A Narrative about a basic JupyterHub deployment - A Narrative about a [reference deployment of JupyterHub using Docker](https://github.com/jupyterhub/jupyterhub-deploy-docker) - A Narrative about Teaching a Course with JupyterHub and nbgrader using a [reference deployment on a single server and Ansible scripts](https://github.com/jupyterhub/jupyterhub-deploy-teaching) to automate set up - A Narrative about Teaching a Course with JupyterHub, nbgrader, and containers - A Narrative about JupyterHub deployments using Containers including Docker .. note:: We're actively working on this section of the documentation to improve it for you. Thanks for your patience.
JupyterHub Narratives ===================== Description ----------- JupyterHub Narratives explore deployment and scaling of the Jupyter Notebook for a group of users. JupyterHub allows flexibility in configuration and deployment which makes JupyterHub a valuable to education, industry research teams, and service providers. In these Narratives, we will look at differences in deployment, deployment advantages, and best practices. Narratives ---------- - A Narrative about a basic JupyterHub deployment - A Narrative about a `reference deployment of JupyterHub using Docker <https://github.com/jupyterhub/jupyterhub-deploy-docker>`_ - A Narrative about Teaching a Course with JupyterHub and nbgrader using a `reference deployment on a single server and Ansible scripts <https://github.com/jupyterhub/jupyterhub-deploy-teaching>`_ to automate set up - A Narrative about Teaching a Course with JupyterHub, nbgrader, and containers - A Narrative about JupyterHub deployments using Containers including Docker .. note:: We're actively working on this section of the documentation to improve it for you. Thanks for your patience.
Fix link formatting from md to rst
Fix link formatting from md to rst
reStructuredText
bsd-3-clause
Carreau/jupyter,willingc/jupyter,minrk/jupyter,jupyter/jupyter
restructuredtext
## Code Before: JupyterHub Narratives ===================== Description ----------- JupyterHub Narratives explore deployment and scaling of the Jupyter Notebook for a group of users. JupyterHub allows flexibility in configuration and deployment which makes JupyterHub a valuable to education, industry research teams, and service providers. In these Narratives, we will look at differences in deployment, deployment advantages, and best practices. Narratives ---------- - A Narrative about a basic JupyterHub deployment - A Narrative about a [reference deployment of JupyterHub using Docker](https://github.com/jupyterhub/jupyterhub-deploy-docker) - A Narrative about Teaching a Course with JupyterHub and nbgrader using a [reference deployment on a single server and Ansible scripts](https://github.com/jupyterhub/jupyterhub-deploy-teaching) to automate set up - A Narrative about Teaching a Course with JupyterHub, nbgrader, and containers - A Narrative about JupyterHub deployments using Containers including Docker .. note:: We're actively working on this section of the documentation to improve it for you. Thanks for your patience. ## Instruction: Fix link formatting from md to rst ## Code After: JupyterHub Narratives ===================== Description ----------- JupyterHub Narratives explore deployment and scaling of the Jupyter Notebook for a group of users. JupyterHub allows flexibility in configuration and deployment which makes JupyterHub a valuable to education, industry research teams, and service providers. In these Narratives, we will look at differences in deployment, deployment advantages, and best practices. Narratives ---------- - A Narrative about a basic JupyterHub deployment - A Narrative about a `reference deployment of JupyterHub using Docker <https://github.com/jupyterhub/jupyterhub-deploy-docker>`_ - A Narrative about Teaching a Course with JupyterHub and nbgrader using a `reference deployment on a single server and Ansible scripts <https://github.com/jupyterhub/jupyterhub-deploy-teaching>`_ to automate set up - A Narrative about Teaching a Course with JupyterHub, nbgrader, and containers - A Narrative about JupyterHub deployments using Containers including Docker .. note:: We're actively working on this section of the documentation to improve it for you. Thanks for your patience.
JupyterHub Narratives ===================== Description ----------- JupyterHub Narratives explore deployment and scaling of the Jupyter Notebook for a group of users. JupyterHub allows flexibility in configuration and deployment which makes JupyterHub a valuable to education, industry research teams, and service providers. In these Narratives, we will look at differences in deployment, deployment advantages, and best practices. Narratives ---------- - A Narrative about a basic JupyterHub deployment - - A Narrative about a [reference deployment of JupyterHub using Docker](https://github.com/jupyterhub/jupyterhub-deploy-docker) ? ^ ^^ ^ + - A Narrative about a `reference deployment of JupyterHub using Docker <https://github.com/jupyterhub/jupyterhub-deploy-docker>`_ ? ^ ^^ ^^^ - A Narrative about Teaching a Course with JupyterHub and nbgrader using a - [reference deployment on a single server and Ansible scripts](https://github.com/jupyterhub/jupyterhub-deploy-teaching) ? ^ ^^ ^ + `reference deployment on a single server and Ansible scripts <https://github.com/jupyterhub/jupyterhub-deploy-teaching>`_ ? ^ ^^ ^^^ to automate set up - A Narrative about Teaching a Course with JupyterHub, nbgrader, and containers - A Narrative about JupyterHub deployments using Containers including Docker .. note:: We're actively working on this section of the documentation to improve it for you. Thanks for your patience.
4
0.153846
2
2
a048e1a8fc41dd6923daeda26c62b280048c792a
.travis.yml
.travis.yml
sudo: false language: ruby rvm: - 2.3.1 bundler_args: --without development doc before_install: gem install bundler -v 1.12.5 addons: code_climate: repo_token: 97786ceac8f7388a6ac89408a63f98454678567c780deef82377f8e66b9f7cd6
sudo: false language: ruby rvm: - 2.0.0 - 2.1 - 2.2 - 2.3.0 - 2.3.1 bundler_args: --without development doc before_install: gem install bundler -v 1.12.5 addons: code_climate: repo_token: 97786ceac8f7388a6ac89408a63f98454678567c780deef82377f8e66b9f7cd6
Add more Ruby versions to test in TravisCI
Add more Ruby versions to test in TravisCI
YAML
mit
Sharparam/chatrix,Sharparam/chatrix
yaml
## Code Before: sudo: false language: ruby rvm: - 2.3.1 bundler_args: --without development doc before_install: gem install bundler -v 1.12.5 addons: code_climate: repo_token: 97786ceac8f7388a6ac89408a63f98454678567c780deef82377f8e66b9f7cd6 ## Instruction: Add more Ruby versions to test in TravisCI ## Code After: sudo: false language: ruby rvm: - 2.0.0 - 2.1 - 2.2 - 2.3.0 - 2.3.1 bundler_args: --without development doc before_install: gem install bundler -v 1.12.5 addons: code_climate: repo_token: 97786ceac8f7388a6ac89408a63f98454678567c780deef82377f8e66b9f7cd6
sudo: false language: ruby rvm: + - 2.0.0 + - 2.1 + - 2.2 + - 2.3.0 - 2.3.1 bundler_args: --without development doc before_install: gem install bundler -v 1.12.5 addons: code_climate: repo_token: 97786ceac8f7388a6ac89408a63f98454678567c780deef82377f8e66b9f7cd6
4
0.285714
4
0
d914d2b6d2504f3a2ce579adf70f7b7a901bd66c
README.md
README.md
Telegram feed for promodescuentos rss ## Getting started ### Configure environments This project uses [config](https://docs.npmjs.com/cli/config) to load environment variables, under `config` folder create at least `default.json` following the structure in `default.example.json` In order to get responses from a telegram bot you will need to get the dev token from any owner of this project or create your own using BotFather in telegram directly ### Run the bot locally `npm run start:dev` ### Simulate production environment using ngrok Download and install [ngrok](https://ngrok.com/docs#getting-started) if you don't have it yet. Then run: ``` ngrok http <port> ``` Copy the forwarding value you will get, something like `Forwarding https://310f8e0f.ngrok.io -> localhost:<port>` and paste it in your configuration file in the URL section
Telegram feed for promodescuentos rss ## Getting started ### Configure environments This project uses [config](https://docs.npmjs.com/cli/config) to load environment variables, under `config` folder create at least `default.json` following the structure in `default.example.json` In order to get responses from a telegram bot you will need to get the dev token from any owner of this project or create your own using BotFather in telegram directly. Current telegram instances are: Production: @promodescuentos_bokbot Development: @promobot_dev_bot ### Run the bot locally `npm run start:dev` ### Simulate production environment using ngrok Download and install [ngrok](https://ngrok.com/docs#getting-started) if you don't have it yet. Then run: ``` ngrok http <port> ``` Copy the forwarding value you will get, something like `Forwarding https://310f8e0f.ngrok.io -> localhost:<port>` and paste it in your configuration file in the URL section
Update readme with telegram instances
Update readme with telegram instances
Markdown
mit
erikvilla/promo-bot,erikvilla/promo-bot
markdown
## Code Before: Telegram feed for promodescuentos rss ## Getting started ### Configure environments This project uses [config](https://docs.npmjs.com/cli/config) to load environment variables, under `config` folder create at least `default.json` following the structure in `default.example.json` In order to get responses from a telegram bot you will need to get the dev token from any owner of this project or create your own using BotFather in telegram directly ### Run the bot locally `npm run start:dev` ### Simulate production environment using ngrok Download and install [ngrok](https://ngrok.com/docs#getting-started) if you don't have it yet. Then run: ``` ngrok http <port> ``` Copy the forwarding value you will get, something like `Forwarding https://310f8e0f.ngrok.io -> localhost:<port>` and paste it in your configuration file in the URL section ## Instruction: Update readme with telegram instances ## Code After: Telegram feed for promodescuentos rss ## Getting started ### Configure environments This project uses [config](https://docs.npmjs.com/cli/config) to load environment variables, under `config` folder create at least `default.json` following the structure in `default.example.json` In order to get responses from a telegram bot you will need to get the dev token from any owner of this project or create your own using BotFather in telegram directly. Current telegram instances are: Production: @promodescuentos_bokbot Development: @promobot_dev_bot ### Run the bot locally `npm run start:dev` ### Simulate production environment using ngrok Download and install [ngrok](https://ngrok.com/docs#getting-started) if you don't have it yet. Then run: ``` ngrok http <port> ``` Copy the forwarding value you will get, something like `Forwarding https://310f8e0f.ngrok.io -> localhost:<port>` and paste it in your configuration file in the URL section
Telegram feed for promodescuentos rss ## Getting started ### Configure environments This project uses [config](https://docs.npmjs.com/cli/config) to load environment variables, under `config` folder create at least `default.json` following the structure in `default.example.json` - In order to get responses from a telegram bot you will need to get the dev token from any owner of this project or create your own using BotFather in telegram directly + In order to get responses from a telegram bot you will need to get the dev token from any owner of this project or create your own using BotFather in telegram directly. ? + + + Current telegram instances are: + Production: @promodescuentos_bokbot + Development: @promobot_dev_bot ### Run the bot locally `npm run start:dev` ### Simulate production environment using ngrok Download and install [ngrok](https://ngrok.com/docs#getting-started) if you don't have it yet. Then run: ``` ngrok http <port> ``` Copy the forwarding value you will get, something like `Forwarding https://310f8e0f.ngrok.io -> localhost:<port>` and paste it in your configuration file in the URL section
6
0.285714
5
1
f34a0484fd752fddd17475cf033c4178011203f6
bower.json
bower.json
{ "name": "eveindy", "version": "0.0.1", "authors": [ "Brad Ackerman <brad@facefault.org>" ], "description": "Industrial tools for EVE.", "keywords": [ "eveonline" ], "license": "Apache", "ignore": [ "**/.*", "node_modules", "bower_components", "test", "tests" ], "dependencies": { "angular": "~1.4.7", "bootstrap": "~3.3.1", "angular-route": "~1.4.7", "angular-mocks": "~1.4.7", "angular-bootstrap": "~0.14.3", "angular-datatables": "~0.5.1", "angular-promise-buttons": "~0.1.10" }, "devDependencies": { "less-elements": "*" } }
{ "name": "eveindy", "version": "0.0.1", "authors": [ "Brad Ackerman <brad@facefault.org>" ], "description": "Industrial tools for EVE.", "keywords": [ "eveonline" ], "license": "Apache", "ignore": [ "**/.*", "node_modules", "bower_components", "test", "tests" ], "dependencies": { "angular": "~1.4.7", "bootstrap": "~3.3.1", "angular-route": "~1.4.7", "angular-mocks": "~1.4.7", "angular-bootstrap": "~0.14.3", "angular-datatables": "~0.5.1", "angular-promise-buttons": "~0.1.10" }, "devDependencies": {} }
Remove dependency on less-elements (that we're not using)
Remove dependency on less-elements (that we're not using)
JSON
apache-2.0
backerman/eveindy,backerman/eveindy
json
## Code Before: { "name": "eveindy", "version": "0.0.1", "authors": [ "Brad Ackerman <brad@facefault.org>" ], "description": "Industrial tools for EVE.", "keywords": [ "eveonline" ], "license": "Apache", "ignore": [ "**/.*", "node_modules", "bower_components", "test", "tests" ], "dependencies": { "angular": "~1.4.7", "bootstrap": "~3.3.1", "angular-route": "~1.4.7", "angular-mocks": "~1.4.7", "angular-bootstrap": "~0.14.3", "angular-datatables": "~0.5.1", "angular-promise-buttons": "~0.1.10" }, "devDependencies": { "less-elements": "*" } } ## Instruction: Remove dependency on less-elements (that we're not using) ## Code After: { "name": "eveindy", "version": "0.0.1", "authors": [ "Brad Ackerman <brad@facefault.org>" ], "description": "Industrial tools for EVE.", "keywords": [ "eveonline" ], "license": "Apache", "ignore": [ "**/.*", "node_modules", "bower_components", "test", "tests" ], "dependencies": { "angular": "~1.4.7", "bootstrap": "~3.3.1", "angular-route": "~1.4.7", "angular-mocks": "~1.4.7", "angular-bootstrap": "~0.14.3", "angular-datatables": "~0.5.1", "angular-promise-buttons": "~0.1.10" }, "devDependencies": {} }
{ "name": "eveindy", "version": "0.0.1", "authors": [ "Brad Ackerman <brad@facefault.org>" ], "description": "Industrial tools for EVE.", "keywords": [ "eveonline" ], "license": "Apache", "ignore": [ "**/.*", "node_modules", "bower_components", "test", "tests" ], "dependencies": { "angular": "~1.4.7", "bootstrap": "~3.3.1", "angular-route": "~1.4.7", "angular-mocks": "~1.4.7", "angular-bootstrap": "~0.14.3", "angular-datatables": "~0.5.1", "angular-promise-buttons": "~0.1.10" }, - "devDependencies": { + "devDependencies": {} ? + - "less-elements": "*" - } }
4
0.129032
1
3
0bbb4358580ba36065c5e897288ec1cf7c6988f6
app/models/anonymous_block.rb
app/models/anonymous_block.rb
require "digest" class AnonymousBlock < ApplicationRecord belongs_to :user belongs_to :question, optional: true def self.get_identifier(ip) Digest::SHA2.new(512).hexdigest(Rails.application.secret_key_base + ip) end end
require "digest" class AnonymousBlock < ApplicationRecord belongs_to :user, optional: true belongs_to :question, optional: true def self.get_identifier(ip) Digest::SHA2.new(512).hexdigest(Rails.application.secret_key_base + ip) end end
Allow anonymous blocks without an owner
Allow anonymous blocks without an owner
Ruby
agpl-3.0
Retrospring/retrospring,Retrospring/retrospring,Retrospring/retrospring,Retrospring/retrospring,Retrospring/retrospring
ruby
## Code Before: require "digest" class AnonymousBlock < ApplicationRecord belongs_to :user belongs_to :question, optional: true def self.get_identifier(ip) Digest::SHA2.new(512).hexdigest(Rails.application.secret_key_base + ip) end end ## Instruction: Allow anonymous blocks without an owner ## Code After: require "digest" class AnonymousBlock < ApplicationRecord belongs_to :user, optional: true belongs_to :question, optional: true def self.get_identifier(ip) Digest::SHA2.new(512).hexdigest(Rails.application.secret_key_base + ip) end end
require "digest" class AnonymousBlock < ApplicationRecord - belongs_to :user + belongs_to :user, optional: true belongs_to :question, optional: true def self.get_identifier(ip) Digest::SHA2.new(512).hexdigest(Rails.application.secret_key_base + ip) end end
2
0.181818
1
1
7e9d4bd5f6a189458ce32da77291d0797f0195bf
config/schedule.rb
config/schedule.rb
job_type :rake_not_silent, 'export PATH=/usr/local/bin:$PATH; cd :path && :environment_variable=:environment bundle exec rake :task :output' every 1.minute do rake_not_silent 'main:rec_one' rake_not_silent 'main:rec_one' end every '3-50/3 * * * *' do rake_not_silent 'main:rec_ondemand' end every '0 15 * * *' do rake_not_silent 'main:ag_scrape' end every '4 10-22 * * *' do rake_not_silent 'main:onsen_scrape' end every '8 10-22 * * *' do rake_not_silent 'main:hibiki_scrape' end every '12 * * * *' do rake_not_silent 'main:radiko_scrape' end every '37 15 * * *' do rake_not_silent 'main:kill_zombie_process' end every '7 16 * * *' do rake_not_silent 'main:rm_working_files' end
job_type :rake_not_silent, 'export PATH=/usr/local/bin:$PATH; export LANG=en_US.UTF-8; cd :path && :environment_variable=:environment bundle exec rake :task :output' every 1.minute do rake_not_silent 'main:rec_one' rake_not_silent 'main:rec_one' end every '3-50/3 * * * *' do rake_not_silent 'main:rec_ondemand' end every '0 15 * * *' do rake_not_silent 'main:ag_scrape' end every '4 10-22 * * *' do rake_not_silent 'main:onsen_scrape' end every '8 10-22 * * *' do rake_not_silent 'main:hibiki_scrape' end every '12 * * * *' do rake_not_silent 'main:radiko_scrape' end every '37 15 * * *' do rake_not_silent 'main:kill_zombie_process' end every '7 16 * * *' do rake_not_silent 'main:rm_working_files' end
Add $LANG to fix cron mail mojibake
Add $LANG to fix cron mail mojibake
Ruby
mit
nm7/net-radio-archive,soramugi/net-radio-archive,yayugu/net-radio-archive,yayugu/net-radio-archive,t-ashula/net-radio-archive,t-ashula/net-radio-archive,soramugi/net-radio-archive,nm7/net-radio-archive,nm7/net-radio-archive,t-ashula/net-radio-archive,soramugi/net-radio-archive,yayugu/net-radio-archive
ruby
## Code Before: job_type :rake_not_silent, 'export PATH=/usr/local/bin:$PATH; cd :path && :environment_variable=:environment bundle exec rake :task :output' every 1.minute do rake_not_silent 'main:rec_one' rake_not_silent 'main:rec_one' end every '3-50/3 * * * *' do rake_not_silent 'main:rec_ondemand' end every '0 15 * * *' do rake_not_silent 'main:ag_scrape' end every '4 10-22 * * *' do rake_not_silent 'main:onsen_scrape' end every '8 10-22 * * *' do rake_not_silent 'main:hibiki_scrape' end every '12 * * * *' do rake_not_silent 'main:radiko_scrape' end every '37 15 * * *' do rake_not_silent 'main:kill_zombie_process' end every '7 16 * * *' do rake_not_silent 'main:rm_working_files' end ## Instruction: Add $LANG to fix cron mail mojibake ## Code After: job_type :rake_not_silent, 'export PATH=/usr/local/bin:$PATH; export LANG=en_US.UTF-8; cd :path && :environment_variable=:environment bundle exec rake :task :output' every 1.minute do rake_not_silent 'main:rec_one' rake_not_silent 'main:rec_one' end every '3-50/3 * * * *' do rake_not_silent 'main:rec_ondemand' end every '0 15 * * *' do rake_not_silent 'main:ag_scrape' end every '4 10-22 * * *' do rake_not_silent 'main:onsen_scrape' end every '8 10-22 * * *' do rake_not_silent 'main:hibiki_scrape' end every '12 * * * *' do rake_not_silent 'main:radiko_scrape' end every '37 15 * * *' do rake_not_silent 'main:kill_zombie_process' end every '7 16 * * *' do rake_not_silent 'main:rm_working_files' end
- job_type :rake_not_silent, 'export PATH=/usr/local/bin:$PATH; cd :path && :environment_variable=:environment bundle exec rake :task :output' + job_type :rake_not_silent, 'export PATH=/usr/local/bin:$PATH; export LANG=en_US.UTF-8; cd :path && :environment_variable=:environment bundle exec rake :task :output' ? +++++++++++++++++++++++++ every 1.minute do rake_not_silent 'main:rec_one' rake_not_silent 'main:rec_one' end every '3-50/3 * * * *' do rake_not_silent 'main:rec_ondemand' end every '0 15 * * *' do rake_not_silent 'main:ag_scrape' end every '4 10-22 * * *' do rake_not_silent 'main:onsen_scrape' end every '8 10-22 * * *' do rake_not_silent 'main:hibiki_scrape' end every '12 * * * *' do rake_not_silent 'main:radiko_scrape' end every '37 15 * * *' do rake_not_silent 'main:kill_zombie_process' end every '7 16 * * *' do rake_not_silent 'main:rm_working_files' end
2
0.057143
1
1
9f9fc9fc5143384c5661463661f98115cd6b0cb4
sclr.php
sclr.php
<?php if (!function_exists('s')) { function s($value) { $inst = null; if (is_array($value)) { } elseif (is_object($value)) { } elseif (is_float($value)) { } elseif (is_int($value)) { } elseif (is_bool($value)) { } else { $inst = new Sclr\String($value); } return $inst; } }
<?php if (!function_exists('s')) { function s($value) { $inst = null; if (is_array($value)) { $inst = new Sclr\SclrArray($value); } elseif (is_object($value)) { } elseif (is_float($value)) { } elseif (is_int($value)) { } elseif (is_bool($value)) { } else { $inst = new Sclr\SclrString($value); } return $inst; } }
Update with Array and new prefixes
Update with Array and new prefixes
PHP
mit
gilbitron/Sclr
php
## Code Before: <?php if (!function_exists('s')) { function s($value) { $inst = null; if (is_array($value)) { } elseif (is_object($value)) { } elseif (is_float($value)) { } elseif (is_int($value)) { } elseif (is_bool($value)) { } else { $inst = new Sclr\String($value); } return $inst; } } ## Instruction: Update with Array and new prefixes ## Code After: <?php if (!function_exists('s')) { function s($value) { $inst = null; if (is_array($value)) { $inst = new Sclr\SclrArray($value); } elseif (is_object($value)) { } elseif (is_float($value)) { } elseif (is_int($value)) { } elseif (is_bool($value)) { } else { $inst = new Sclr\SclrString($value); } return $inst; } }
<?php if (!function_exists('s')) { function s($value) { $inst = null; if (is_array($value)) { - + $inst = new Sclr\SclrArray($value); } elseif (is_object($value)) { } elseif (is_float($value)) { } elseif (is_int($value)) { } elseif (is_bool($value)) { } else { - $inst = new Sclr\String($value); + $inst = new Sclr\SclrString($value); ? ++++ } return $inst; } }
4
0.153846
2
2
37707744d8a8a9460108e1a26c7e4a7e56b44b27
puppet/modules/redmine/templates/activate-api-for-admin.sql.erb
puppet/modules/redmine/templates/activate-api-for-admin.sql.erb
SET @api_key="<%= @settings['issues_tracker_api_key'] %>"; UPDATE settings SET value='1' WHERE name='rest_api_enabled'; INSERT INTO tokens (user_id, action, value, created_on) VALUES('1', 'api', @api_key, CURRENT_TIMESTAMP());
SET @api_key="<%= @settings['issues_tracker_api_key'] %>"; INSERT INTO settings (name, value, updated_on) VALUES ('rest_api_enabled','1', CURRENT_TIMESTAMP()); INSERT INTO tokens (user_id, action, value, created_on) VALUES('1', 'api', @api_key, CURRENT_TIMESTAMP());
Fix Redmine API not activated.
Fix Redmine API not activated. Change-Id: I3aef42863992cb90d5e4e2f870ba300b0bf0e054
HTML+ERB
apache-2.0
enovance/software-factory,invenfantasy/software-factory,invenfantasy/software-factory,enovance/software-factory,invenfantasy/software-factory,invenfantasy/software-factory,enovance/software-factory,invenfantasy/software-factory,enovance/software-factory,enovance/software-factory
html+erb
## Code Before: SET @api_key="<%= @settings['issues_tracker_api_key'] %>"; UPDATE settings SET value='1' WHERE name='rest_api_enabled'; INSERT INTO tokens (user_id, action, value, created_on) VALUES('1', 'api', @api_key, CURRENT_TIMESTAMP()); ## Instruction: Fix Redmine API not activated. Change-Id: I3aef42863992cb90d5e4e2f870ba300b0bf0e054 ## Code After: SET @api_key="<%= @settings['issues_tracker_api_key'] %>"; INSERT INTO settings (name, value, updated_on) VALUES ('rest_api_enabled','1', CURRENT_TIMESTAMP()); INSERT INTO tokens (user_id, action, value, created_on) VALUES('1', 'api', @api_key, CURRENT_TIMESTAMP());
SET @api_key="<%= @settings['issues_tracker_api_key'] %>"; - UPDATE settings SET value='1' WHERE name='rest_api_enabled'; + INSERT INTO settings (name, value, updated_on) VALUES ('rest_api_enabled','1', CURRENT_TIMESTAMP()); INSERT INTO tokens (user_id, action, value, created_on) VALUES('1', 'api', @api_key, CURRENT_TIMESTAMP());
2
0.5
1
1
c862a4c40f17040017e9bb6f67f5b9fa293c23e5
mcb_interface/driver.py
mcb_interface/driver.py
from romi import Romi romi = Romi() from time import sleep # from math import pi while True: battery_millivolts = romi.read_battery_millivolts() v_x, v_theta, x, y, theta = romi.read_odometry() romi.velocity_command(0.1, 0) print "Battery Voltage: ", battery_millivolts[0], " Volts." print "Vx: ", v_x, " m/s" print "Vtheta: ", v_theta, "rad/s" sleep(0.01)
from romi import Romi romi = Romi() from time import sleep # from math import pi while True: battery_millivolts = romi.read_battery_millivolts() v_x, v_theta, x, y, theta = romi.read_odometry() romi.velocity_command(1.0, 0) print "Battery Voltage: ", battery_millivolts[0], " Volts." print "Vx: ", v_x, " m/s" print "Vtheta: ", v_theta, "rad/s" print "X: ", x, " Y: ", y, " Theta: ", theta sleep(0.01)
Add more output printing, increase velocity command.
Add more output printing, increase velocity command.
Python
mit
waddletown/sw
python
## Code Before: from romi import Romi romi = Romi() from time import sleep # from math import pi while True: battery_millivolts = romi.read_battery_millivolts() v_x, v_theta, x, y, theta = romi.read_odometry() romi.velocity_command(0.1, 0) print "Battery Voltage: ", battery_millivolts[0], " Volts." print "Vx: ", v_x, " m/s" print "Vtheta: ", v_theta, "rad/s" sleep(0.01) ## Instruction: Add more output printing, increase velocity command. ## Code After: from romi import Romi romi = Romi() from time import sleep # from math import pi while True: battery_millivolts = romi.read_battery_millivolts() v_x, v_theta, x, y, theta = romi.read_odometry() romi.velocity_command(1.0, 0) print "Battery Voltage: ", battery_millivolts[0], " Volts." print "Vx: ", v_x, " m/s" print "Vtheta: ", v_theta, "rad/s" print "X: ", x, " Y: ", y, " Theta: ", theta sleep(0.01)
from romi import Romi romi = Romi() from time import sleep # from math import pi while True: battery_millivolts = romi.read_battery_millivolts() v_x, v_theta, x, y, theta = romi.read_odometry() - romi.velocity_command(0.1, 0) ? -- + romi.velocity_command(1.0, 0) ? ++ print "Battery Voltage: ", battery_millivolts[0], " Volts." print "Vx: ", v_x, " m/s" print "Vtheta: ", v_theta, "rad/s" + print "X: ", x, " Y: ", y, " Theta: ", theta sleep(0.01)
3
0.176471
2
1
d8ba3f002cbed14ca48ba861eb5ff8792aae8ac6
tools/CMakeLists.txt
tools/CMakeLists.txt
INCLUDE_DIRECTORIES( ${GLIB2_INCLUDE_DIRS} ) SET( osyncdump_SRCS osyncdump.c ) ADD_EXECUTABLE( osyncdump ${osyncdump_SRCS} ) TARGET_LINK_LIBRARIES( osyncdump opensync ) SET( osyncbinary_SRCS osyncbinary.c ) ADD_EXECUTABLE( osyncbinary ${osyncbinary_SRCS} ) TARGET_LINK_LIBRARIES( osyncbinary opensync ) ###### INSTALL ################### INSTALL( TARGETS osyncdump osyncbinary DESTINATION ${BIN_INSTALL_DIR} )
INCLUDE_DIRECTORIES( ${SQLITE_INCLUDE_DIR} ${GLIB2_INCLUDE_DIRS} ) SET( osyncdump_SRCS osyncdump.c ) ADD_EXECUTABLE( osyncdump ${osyncdump_SRCS} ) TARGET_LINK_LIBRARIES( osyncdump opensync ) SET( osyncbinary_SRCS osyncbinary.c ) ADD_EXECUTABLE( osyncbinary ${osyncbinary_SRCS} ) TARGET_LINK_LIBRARIES( osyncbinary opensync ) ###### INSTALL ################### INSTALL( TARGETS osyncdump osyncbinary DESTINATION ${BIN_INSTALL_DIR} )
Add Sqlite include directory for osyncdump.
Add Sqlite include directory for osyncdump. git-svn-id: e31799a7ad59d6ea355ca047c69e0aee8a59fcd3@2894 53f5c7ee-bee3-0310-bbc5-ea0e15fffd5e
Text
lgpl-2.1
ianmartin/opensync,ianmartin/opensync
text
## Code Before: INCLUDE_DIRECTORIES( ${GLIB2_INCLUDE_DIRS} ) SET( osyncdump_SRCS osyncdump.c ) ADD_EXECUTABLE( osyncdump ${osyncdump_SRCS} ) TARGET_LINK_LIBRARIES( osyncdump opensync ) SET( osyncbinary_SRCS osyncbinary.c ) ADD_EXECUTABLE( osyncbinary ${osyncbinary_SRCS} ) TARGET_LINK_LIBRARIES( osyncbinary opensync ) ###### INSTALL ################### INSTALL( TARGETS osyncdump osyncbinary DESTINATION ${BIN_INSTALL_DIR} ) ## Instruction: Add Sqlite include directory for osyncdump. git-svn-id: e31799a7ad59d6ea355ca047c69e0aee8a59fcd3@2894 53f5c7ee-bee3-0310-bbc5-ea0e15fffd5e ## Code After: INCLUDE_DIRECTORIES( ${SQLITE_INCLUDE_DIR} ${GLIB2_INCLUDE_DIRS} ) SET( osyncdump_SRCS osyncdump.c ) ADD_EXECUTABLE( osyncdump ${osyncdump_SRCS} ) TARGET_LINK_LIBRARIES( osyncdump opensync ) SET( osyncbinary_SRCS osyncbinary.c ) ADD_EXECUTABLE( osyncbinary ${osyncbinary_SRCS} ) TARGET_LINK_LIBRARIES( osyncbinary opensync ) ###### INSTALL ################### INSTALL( TARGETS osyncdump osyncbinary DESTINATION ${BIN_INSTALL_DIR} )
- INCLUDE_DIRECTORIES( ${GLIB2_INCLUDE_DIRS} ) + INCLUDE_DIRECTORIES( ${SQLITE_INCLUDE_DIR} ${GLIB2_INCLUDE_DIRS} ) ? ++++++++++++++++++++++ SET( osyncdump_SRCS osyncdump.c ) ADD_EXECUTABLE( osyncdump ${osyncdump_SRCS} ) TARGET_LINK_LIBRARIES( osyncdump opensync ) SET( osyncbinary_SRCS osyncbinary.c ) ADD_EXECUTABLE( osyncbinary ${osyncbinary_SRCS} ) TARGET_LINK_LIBRARIES( osyncbinary opensync ) ###### INSTALL ################### INSTALL( TARGETS osyncdump osyncbinary DESTINATION ${BIN_INSTALL_DIR} )
2
0.090909
1
1
24223a5f55a9ce4e5159c5db911371ac6f95cb28
demo/config/pod.yaml
demo/config/pod.yaml
apiVersion: v1 kind: Pod metadata: labels: name: blog name: blog-pod spec: containers: - name: git-sync image: gcr.io/google_containers/git-sync imagePullPolicy: Always volumeMounts: - name: markdown mountPath: /git env: - name: GIT_SYNC_REPO value: https://github.com/GoogleCloudPlatform/kubernetes.git - name: GIT_SYNC_DEST value: git - name: hugo image: gcr.io/google_containers/hugo imagePullPolicy: Always volumeMounts: - name: markdown mountPath: /src - name: html mountPath: /dest env: - name: HUGO_SRC value: /src/git-sync/demo/blog - name: HUGO_BUILD_DRAFT value: "true" - name: HUGO_BASE_URL value: example.com - name: nginx image: nginx volumeMounts: - name: html mountPath: /usr/share/nginx/html ports: - containerPort: 80 volumes: - name: markdown emptyDir: {} - name: html emptyDir: {}
apiVersion: v1 kind: Pod metadata: labels: name: blog name: blog-pod spec: containers: - name: git-sync image: gcr.io/google_containers/git-sync imagePullPolicy: Always volumeMounts: - name: markdown mountPath: /git env: - name: GIT_SYNC_REPO value: https://github.com/GoogleCloudPlatform/kubernetes.git - name: GIT_SYNC_DEST value: git - name: hugo image: gcr.io/google_containers/hugo imagePullPolicy: Always securityContext: runAsUser: 0 volumeMounts: - name: markdown mountPath: /src - name: html mountPath: /dest env: - name: HUGO_SRC value: /src/git-sync/demo/blog - name: HUGO_BUILD_DRAFT value: "true" - name: HUGO_BASE_URL value: example.com - name: nginx image: nginx volumeMounts: - name: html mountPath: /usr/share/nginx/html ports: - containerPort: 80 volumes: - name: markdown emptyDir: {} - name: html emptyDir: {}
Add runAsUser to demo example
Add runAsUser to demo example Fixes #32
YAML
apache-2.0
kubernetes/git-sync,kubernetes/git-sync
yaml
## Code Before: apiVersion: v1 kind: Pod metadata: labels: name: blog name: blog-pod spec: containers: - name: git-sync image: gcr.io/google_containers/git-sync imagePullPolicy: Always volumeMounts: - name: markdown mountPath: /git env: - name: GIT_SYNC_REPO value: https://github.com/GoogleCloudPlatform/kubernetes.git - name: GIT_SYNC_DEST value: git - name: hugo image: gcr.io/google_containers/hugo imagePullPolicy: Always volumeMounts: - name: markdown mountPath: /src - name: html mountPath: /dest env: - name: HUGO_SRC value: /src/git-sync/demo/blog - name: HUGO_BUILD_DRAFT value: "true" - name: HUGO_BASE_URL value: example.com - name: nginx image: nginx volumeMounts: - name: html mountPath: /usr/share/nginx/html ports: - containerPort: 80 volumes: - name: markdown emptyDir: {} - name: html emptyDir: {} ## Instruction: Add runAsUser to demo example Fixes #32 ## Code After: apiVersion: v1 kind: Pod metadata: labels: name: blog name: blog-pod spec: containers: - name: git-sync image: gcr.io/google_containers/git-sync imagePullPolicy: Always volumeMounts: - name: markdown mountPath: /git env: - name: GIT_SYNC_REPO value: https://github.com/GoogleCloudPlatform/kubernetes.git - name: GIT_SYNC_DEST value: git - name: hugo image: gcr.io/google_containers/hugo imagePullPolicy: Always securityContext: runAsUser: 0 volumeMounts: - name: markdown mountPath: /src - name: html mountPath: /dest env: - name: HUGO_SRC value: /src/git-sync/demo/blog - name: HUGO_BUILD_DRAFT value: "true" - name: HUGO_BASE_URL value: example.com - name: nginx image: nginx volumeMounts: - name: html mountPath: /usr/share/nginx/html ports: - containerPort: 80 volumes: - name: markdown emptyDir: {} - name: html emptyDir: {}
apiVersion: v1 kind: Pod metadata: labels: name: blog name: blog-pod spec: containers: - name: git-sync image: gcr.io/google_containers/git-sync imagePullPolicy: Always volumeMounts: - name: markdown mountPath: /git env: - name: GIT_SYNC_REPO value: https://github.com/GoogleCloudPlatform/kubernetes.git - name: GIT_SYNC_DEST value: git - name: hugo image: gcr.io/google_containers/hugo imagePullPolicy: Always + securityContext: + runAsUser: 0 volumeMounts: - name: markdown mountPath: /src - name: html mountPath: /dest env: - name: HUGO_SRC value: /src/git-sync/demo/blog - name: HUGO_BUILD_DRAFT value: "true" - name: HUGO_BASE_URL value: example.com - name: nginx image: nginx volumeMounts: - name: html mountPath: /usr/share/nginx/html ports: - containerPort: 80 volumes: - name: markdown emptyDir: {} - name: html emptyDir: {}
2
0.043478
2
0
db4f0e6f05f56acd13ece9dfba79eef00ce535ef
examples/snapshots/snapshot16/README.md
examples/snapshots/snapshot16/README.md
Using params to dynamically passing data Key points: - mixins - params
Using params to dynamically passing data Key points: - mixins - params Router.State is simply a proxy for `this.context.router`. Note: there is no support for mixins when using React with **ES6** classes. In that case, we have to resort to context.
Update descriptions for example 16
Update descriptions for example 16
Markdown
mit
seanlin0800/intro_react,seanlin0800/intro_react
markdown
## Code Before: Using params to dynamically passing data Key points: - mixins - params ## Instruction: Update descriptions for example 16 ## Code After: Using params to dynamically passing data Key points: - mixins - params Router.State is simply a proxy for `this.context.router`. Note: there is no support for mixins when using React with **ES6** classes. In that case, we have to resort to context.
Using params to dynamically passing data Key points: - mixins - params + + Router.State is simply a proxy for `this.context.router`. + + Note: there is no support for mixins when using React with **ES6** classes. In that case, we have to resort to context.
4
0.666667
4
0
ce4b65684cdce34201144e58087c4fbeda0fee0a
week-4/calculate-grade/my-solution.rb
week-4/calculate-grade/my-solution.rb
def get_grade(average) if average >= 90 p "A" elsif average >= 80 p "B" elsif average >= 70 p "C" elsif average >= 60 p "D" else average < 60 p "F" end end #get_grade(100) # I worked on this challenge [with: Mason Pierce]. # Your Solution Below
=begin INPUT: Obtain the average IF average is >= 90 THEN return a letter grade of A IF average is >= 80 THEN return a letter grade of B IF average is >= 70 THEN return a letter grade of C IF average is >= 60 THEN return a letter grade of D IF average is < 60 THEN return a letter grade of F END IF OUTPUT: Return the corresponding letter grade to that average =end #get_grade(100) # I worked on this challenge [with: Mason Pierce]. # Your Solution Below def get_grade(average) if average >= 90 return "A" elsif average >= 80 return "B" elsif average >= 70 return "C" elsif average >= 60 return "D" else average < 60 return "F" end end
Add pseudocode to the get_grade method solution
Add pseudocode to the get_grade method solution
Ruby
mit
nchambe2/phase-0,nchambe2/phase-0,nchambe2/phase-0
ruby
## Code Before: def get_grade(average) if average >= 90 p "A" elsif average >= 80 p "B" elsif average >= 70 p "C" elsif average >= 60 p "D" else average < 60 p "F" end end #get_grade(100) # I worked on this challenge [with: Mason Pierce]. # Your Solution Below ## Instruction: Add pseudocode to the get_grade method solution ## Code After: =begin INPUT: Obtain the average IF average is >= 90 THEN return a letter grade of A IF average is >= 80 THEN return a letter grade of B IF average is >= 70 THEN return a letter grade of C IF average is >= 60 THEN return a letter grade of D IF average is < 60 THEN return a letter grade of F END IF OUTPUT: Return the corresponding letter grade to that average =end #get_grade(100) # I worked on this challenge [with: Mason Pierce]. # Your Solution Below def get_grade(average) if average >= 90 return "A" elsif average >= 80 return "B" elsif average >= 70 return "C" elsif average >= 60 return "D" else average < 60 return "F" end end
- def get_grade(average) + =begin + INPUT: Obtain the average + IF average is >= 90 THEN + return a letter grade of A + IF average is >= 80 THEN + return a letter grade of B + IF average is >= 70 THEN + return a letter grade of C + IF average is >= 60 THEN + return a letter grade of D + IF average is < 60 THEN + return a letter grade of F + END IF - if average >= 90 - p "A" - elsif average >= 80 - p "B" - elsif average >= 70 - p "C" - elsif average >= 60 - p "D" - else average < 60 - p "F" - end - end + OUTPUT: Return the corresponding letter grade to that average + =end #get_grade(100) # I worked on this challenge [with: Mason Pierce]. # Your Solution Below + + def get_grade(average) + + if average >= 90 + return "A" + elsif average >= 80 + return "B" + elsif average >= 70 + return "C" + elsif average >= 60 + return "D" + else average < 60 + return "F" + end + end
43
1.869565
30
13
4ed3ce7adea1278fcab2ea257a95bf793c19bedf
src/app/code/local/SPM/ShopyMind/DataMapper/OrderItem.php
src/app/code/local/SPM/ShopyMind/DataMapper/OrderItem.php
<?php class SPM_ShopyMind_DataMapper_OrderItem { public function format(Mage_Sales_Model_Order_Item $orderItem) { $product = $orderItem->getProduct(); $combinationId = $this->getCombinationId($orderItem, $product); return array( 'id_product' => $product->getId(), 'id_combination' => $combinationId, 'id_manufacturer' => Mage::helper('shopymind')->manufacturerIdOf($product), 'price' => $orderItem->getPriceInclTax(), 'qty' => $orderItem->getQtyOrdered() ); } private function getCombinationId(Mage_Sales_Model_Order_Item $orderItem) { $Product = Mage::getModel('catalog/product'); $combinationId = $orderItem->getHasChildren() ? $Product->getIdBySku($orderItem->getSku()) : $orderItem->getProductId(); return $combinationId; } }
<?php class SPM_ShopyMind_DataMapper_OrderItem { public function format(Mage_Sales_Model_Order_Item $orderItem) { $product = $orderItem->getProduct(); $combinationId = $this->getCombinationId($orderItem, $product); return array( 'id_product' => $orderItem->getProductId(), 'id_combination' => $combinationId, 'id_manufacturer' => Mage::helper('shopymind')->manufacturerIdOf($product), 'price' => $orderItem->getPriceInclTax(), 'qty' => $orderItem->getQtyOrdered() ); } private function getCombinationId(Mage_Sales_Model_Order_Item $orderItem) { $Product = Mage::getModel('catalog/product'); $combinationId = $orderItem->getHasChildren() ? $Product->getIdBySku($orderItem->getSku()) : $orderItem->getProductId(); return $combinationId; } }
Use product_id stored in order item instead of getting it from product instance.
Use product_id stored in order item instead of getting it from product instance.
PHP
bsd-3-clause
occitech/Occitech_ShopyMind,occitech/Occitech_ShopyMind,occitech/Occitech_ShopyMind
php
## Code Before: <?php class SPM_ShopyMind_DataMapper_OrderItem { public function format(Mage_Sales_Model_Order_Item $orderItem) { $product = $orderItem->getProduct(); $combinationId = $this->getCombinationId($orderItem, $product); return array( 'id_product' => $product->getId(), 'id_combination' => $combinationId, 'id_manufacturer' => Mage::helper('shopymind')->manufacturerIdOf($product), 'price' => $orderItem->getPriceInclTax(), 'qty' => $orderItem->getQtyOrdered() ); } private function getCombinationId(Mage_Sales_Model_Order_Item $orderItem) { $Product = Mage::getModel('catalog/product'); $combinationId = $orderItem->getHasChildren() ? $Product->getIdBySku($orderItem->getSku()) : $orderItem->getProductId(); return $combinationId; } } ## Instruction: Use product_id stored in order item instead of getting it from product instance. ## Code After: <?php class SPM_ShopyMind_DataMapper_OrderItem { public function format(Mage_Sales_Model_Order_Item $orderItem) { $product = $orderItem->getProduct(); $combinationId = $this->getCombinationId($orderItem, $product); return array( 'id_product' => $orderItem->getProductId(), 'id_combination' => $combinationId, 'id_manufacturer' => Mage::helper('shopymind')->manufacturerIdOf($product), 'price' => $orderItem->getPriceInclTax(), 'qty' => $orderItem->getQtyOrdered() ); } private function getCombinationId(Mage_Sales_Model_Order_Item $orderItem) { $Product = Mage::getModel('catalog/product'); $combinationId = $orderItem->getHasChildren() ? $Product->getIdBySku($orderItem->getSku()) : $orderItem->getProductId(); return $combinationId; } }
<?php class SPM_ShopyMind_DataMapper_OrderItem { public function format(Mage_Sales_Model_Order_Item $orderItem) { $product = $orderItem->getProduct(); $combinationId = $this->getCombinationId($orderItem, $product); return array( - 'id_product' => $product->getId(), ? ^ ----- + 'id_product' => $orderItem->getProductId(), ? ^^^^^^^^^^^^^^^ 'id_combination' => $combinationId, 'id_manufacturer' => Mage::helper('shopymind')->manufacturerIdOf($product), 'price' => $orderItem->getPriceInclTax(), 'qty' => $orderItem->getQtyOrdered() ); } private function getCombinationId(Mage_Sales_Model_Order_Item $orderItem) { $Product = Mage::getModel('catalog/product'); $combinationId = $orderItem->getHasChildren() ? $Product->getIdBySku($orderItem->getSku()) : $orderItem->getProductId(); return $combinationId; } }
2
0.076923
1
1
ff008b6009f42d58738510a111af3f565878737b
cmake/projects/xproto/hunter.cmake
cmake/projects/xproto/hunter.cmake
include(hunter_add_version) include(hunter_cacheable) include(hunter_configuration_types) include(hunter_download) include(hunter_pick_scheme) # http://www.x.org/releases/X11R7.7/src/proto/ hunter_add_version( PACKAGE_NAME xproto VERSION "7.0.23" URL "http://www.x.org/releases/X11R7.7/src/proto/xproto-7.0.23.tar.bz2" SHA1 5d7f00d1dbe6cf8e725841ef663f0ee2491ba5b2 ) hunter_configuration_types(xproto CONFIGURATION_TYPES Release) hunter_pick_scheme(DEFAULT url_sha1_autotools) hunter_cacheable(xproto) hunter_download( PACKAGE_NAME xproto PACKAGE_INTERNAL_DEPS_ID "1" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/xproto.pc" )
include(hunter_add_version) include(hunter_cacheable) include(hunter_cmake_args) include(hunter_configuration_types) include(hunter_download) include(hunter_pick_scheme) # http://www.x.org/releases/X11R7.7/src/proto/ hunter_add_version( PACKAGE_NAME xproto VERSION "7.0.23" URL "http://www.x.org/releases/X11R7.7/src/proto/xproto-7.0.23.tar.bz2" SHA1 5d7f00d1dbe6cf8e725841ef663f0ee2491ba5b2 ) hunter_configuration_types(xproto CONFIGURATION_TYPES Release) hunter_pick_scheme(DEFAULT url_sha1_autotools) hunter_cmake_args( xproto CMAKE_ARGS DEPENDS_ON_PACKAGES=xorg-macros ) hunter_cacheable(xproto) hunter_download( PACKAGE_NAME xproto PACKAGE_INTERNAL_DEPS_ID "2" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/xproto.pc" )
Package xproto: added dependency for xorg-macros
Package xproto: added dependency for xorg-macros
CMake
bsd-2-clause
dvirtz/hunter,pretyman/hunter,ErniBrown/hunter,madmongo1/hunter,ruslo/hunter,xsacha/hunter,fwinnen/hunter,xsacha/hunter,caseymcc/hunter,NeroBurner/hunter,ikliashchou/hunter,mchiasson/hunter,ruslo/hunter,shekharhimanshu/hunter,dmpriso/hunter,ingenue/hunter,fwinnen/hunter,xsacha/hunter,dan-42/hunter,ErniBrown/hunter,akalsi87/hunter,tatraian/hunter,zhuhaow/hunter,shekharhimanshu/hunter,dvirtz/hunter,mchiasson/hunter,stohrendorf/hunter,madmongo1/hunter,isaachier/hunter,vdsrd/hunter,dvirtz/hunter,RomanYudintsev/hunter,pretyman/hunter,zhuhaow/hunter,x10mind/hunter,NeroBurner/hunter,RomanYudintsev/hunter,alamaison/hunter,ErniBrown/hunter,Knitschi/hunter,tatraian/hunter,designerror/hunter,Knitschi/hunter,ingenue/hunter,ingenue/hunter,designerror/hunter,NeroBurner/hunter,ruslo/hunter,NeroBurner/hunter,ruslo/hunter,Knitschi/hunter,madmongo1/hunter,RomanYudintsev/hunter,madmongo1/hunter,tatraian/hunter,mchiasson/hunter,caseymcc/hunter,alamaison/hunter,mchiasson/hunter,designerror/hunter,x10mind/hunter,fwinnen/hunter,dmpriso/hunter,akalsi87/hunter,ikliashchou/hunter,dan-42/hunter,pretyman/hunter,zhuhaow/hunter,ledocc/hunter,ikliashchou/hunter,isaachier/hunter,akalsi87/hunter,xsacha/hunter,vdsrd/hunter,ledocc/hunter,ledocc/hunter,dan-42/hunter,alamaison/hunter,isaachier/hunter,isaachier/hunter,ikliashchou/hunter,shekharhimanshu/hunter,x10mind/hunter,ingenue/hunter,caseymcc/hunter,vdsrd/hunter,ErniBrown/hunter,pretyman/hunter,dmpriso/hunter,stohrendorf/hunter,stohrendorf/hunter,dan-42/hunter
cmake
## Code Before: include(hunter_add_version) include(hunter_cacheable) include(hunter_configuration_types) include(hunter_download) include(hunter_pick_scheme) # http://www.x.org/releases/X11R7.7/src/proto/ hunter_add_version( PACKAGE_NAME xproto VERSION "7.0.23" URL "http://www.x.org/releases/X11R7.7/src/proto/xproto-7.0.23.tar.bz2" SHA1 5d7f00d1dbe6cf8e725841ef663f0ee2491ba5b2 ) hunter_configuration_types(xproto CONFIGURATION_TYPES Release) hunter_pick_scheme(DEFAULT url_sha1_autotools) hunter_cacheable(xproto) hunter_download( PACKAGE_NAME xproto PACKAGE_INTERNAL_DEPS_ID "1" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/xproto.pc" ) ## Instruction: Package xproto: added dependency for xorg-macros ## Code After: include(hunter_add_version) include(hunter_cacheable) include(hunter_cmake_args) include(hunter_configuration_types) include(hunter_download) include(hunter_pick_scheme) # http://www.x.org/releases/X11R7.7/src/proto/ hunter_add_version( PACKAGE_NAME xproto VERSION "7.0.23" URL "http://www.x.org/releases/X11R7.7/src/proto/xproto-7.0.23.tar.bz2" SHA1 5d7f00d1dbe6cf8e725841ef663f0ee2491ba5b2 ) hunter_configuration_types(xproto CONFIGURATION_TYPES Release) hunter_pick_scheme(DEFAULT url_sha1_autotools) hunter_cmake_args( xproto CMAKE_ARGS DEPENDS_ON_PACKAGES=xorg-macros ) hunter_cacheable(xproto) hunter_download( PACKAGE_NAME xproto PACKAGE_INTERNAL_DEPS_ID "2" PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/xproto.pc" )
include(hunter_add_version) include(hunter_cacheable) + include(hunter_cmake_args) include(hunter_configuration_types) include(hunter_download) include(hunter_pick_scheme) # http://www.x.org/releases/X11R7.7/src/proto/ hunter_add_version( PACKAGE_NAME xproto VERSION "7.0.23" URL "http://www.x.org/releases/X11R7.7/src/proto/xproto-7.0.23.tar.bz2" SHA1 5d7f00d1dbe6cf8e725841ef663f0ee2491ba5b2 ) hunter_configuration_types(xproto CONFIGURATION_TYPES Release) hunter_pick_scheme(DEFAULT url_sha1_autotools) + hunter_cmake_args( + xproto + CMAKE_ARGS + DEPENDS_ON_PACKAGES=xorg-macros + ) hunter_cacheable(xproto) hunter_download( PACKAGE_NAME xproto - PACKAGE_INTERNAL_DEPS_ID "1" ? ^ + PACKAGE_INTERNAL_DEPS_ID "2" ? ^ PACKAGE_UNRELOCATABLE_TEXT_FILES "lib/pkgconfig/xproto.pc" )
8
0.296296
7
1
37971507cc9a5c9ad7c9bad59ecd7f2e4a7f0db1
test/defineFields.js
test/defineFields.js
var assert = require('assert') var ethUtil = require('../index.js') describe('define', function () { const fields = [{ word: true, default: new Buffer([]) }, { name: 'empty', allowZero: true, length: 20, default: new Buffer([]) }, { name: 'value', default: new Buffer([]) }, { name: 'r', length: 32, allowLess: true, default: ethUtil.zeros(32) }] var someOb = {} ethUtil.defineProperties(someOb, fields) it('should trim zeros', function () { // Define Properties someOb.r = '0x00004' assert.equal(someOb.r.toString('hex'), '04') someOb.r = new Buffer([0, 0, 0, 0, 4]) assert.equal(someOb.r.toString('hex'), '04') }) })
var assert = require('assert') var ethUtil = require('../index.js') describe('define', function () { const fields = [{ word: true, default: new Buffer([]) }, { name: 'empty', allowZero: true, length: 20, default: new Buffer([]) }, { name: 'cannotBeZero', allowZero: false, default: new Buffer([ 0 ]) }, { name: 'value', default: new Buffer([]) }, { name: 'r', length: 32, allowLess: true, default: ethUtil.zeros(32) }] var someOb = {} ethUtil.defineProperties(someOb, fields) it('should trim zeros', function () { // Define Properties someOb.r = '0x00004' assert.equal(someOb.r.toString('hex'), '04') someOb.r = new Buffer([0, 0, 0, 0, 4]) assert.equal(someOb.r.toString('hex'), '04') }) it('shouldn\'t allow wrong size for exact size requirements', function () { assert.throws(function () { const tmp = [{ name: 'mustBeExactSize', allowZero: false, length: 20, default: new Buffer([1, 2, 3, 4]) }] ethUtil.defineProperties(someOb, tmp) }) }) })
Add two more tests for defaultFields
Add two more tests for defaultFields
JavaScript
mpl-2.0
ethereum/ethereumjs-vm,ethereumjs/ethereumjs-util,ethereumjs/ethereumjs-util,ethereumjs/ethereumjs-vm,ethereumjs/ethereumjs-vm,ethereumjs/ethereumjs-vm,ethereumjs/ethereumjs-vm,ethereumjs/ethereumjs-vm
javascript
## Code Before: var assert = require('assert') var ethUtil = require('../index.js') describe('define', function () { const fields = [{ word: true, default: new Buffer([]) }, { name: 'empty', allowZero: true, length: 20, default: new Buffer([]) }, { name: 'value', default: new Buffer([]) }, { name: 'r', length: 32, allowLess: true, default: ethUtil.zeros(32) }] var someOb = {} ethUtil.defineProperties(someOb, fields) it('should trim zeros', function () { // Define Properties someOb.r = '0x00004' assert.equal(someOb.r.toString('hex'), '04') someOb.r = new Buffer([0, 0, 0, 0, 4]) assert.equal(someOb.r.toString('hex'), '04') }) }) ## Instruction: Add two more tests for defaultFields ## Code After: var assert = require('assert') var ethUtil = require('../index.js') describe('define', function () { const fields = [{ word: true, default: new Buffer([]) }, { name: 'empty', allowZero: true, length: 20, default: new Buffer([]) }, { name: 'cannotBeZero', allowZero: false, default: new Buffer([ 0 ]) }, { name: 'value', default: new Buffer([]) }, { name: 'r', length: 32, allowLess: true, default: ethUtil.zeros(32) }] var someOb = {} ethUtil.defineProperties(someOb, fields) it('should trim zeros', function () { // Define Properties someOb.r = '0x00004' assert.equal(someOb.r.toString('hex'), '04') someOb.r = new Buffer([0, 0, 0, 0, 4]) assert.equal(someOb.r.toString('hex'), '04') }) it('shouldn\'t allow wrong size for exact size requirements', function () { assert.throws(function () { const tmp = [{ name: 'mustBeExactSize', allowZero: false, length: 20, default: new Buffer([1, 2, 3, 4]) }] ethUtil.defineProperties(someOb, tmp) }) }) })
var assert = require('assert') var ethUtil = require('../index.js') describe('define', function () { const fields = [{ word: true, default: new Buffer([]) }, { name: 'empty', allowZero: true, length: 20, default: new Buffer([]) + }, { + name: 'cannotBeZero', + allowZero: false, + default: new Buffer([ 0 ]) }, { name: 'value', default: new Buffer([]) }, { name: 'r', length: 32, allowLess: true, default: ethUtil.zeros(32) }] var someOb = {} ethUtil.defineProperties(someOb, fields) it('should trim zeros', function () { // Define Properties someOb.r = '0x00004' assert.equal(someOb.r.toString('hex'), '04') someOb.r = new Buffer([0, 0, 0, 0, 4]) assert.equal(someOb.r.toString('hex'), '04') }) + it('shouldn\'t allow wrong size for exact size requirements', function () { + assert.throws(function () { + const tmp = [{ + name: 'mustBeExactSize', + allowZero: false, + length: 20, + default: new Buffer([1, 2, 3, 4]) + }] + ethUtil.defineProperties(someOb, tmp) + }) + }) })
15
0.454545
15
0
ab3b59d9246a25ef3cbb174d23ca64c1b609fddc
cla_public/templates/income.html
cla_public/templates/income.html
{% extends "base.html" %} {% import "macros/form.html" as Form %} {% import "macros/element.html" as Element %} {% block page_heading %} Your income and tax {% endblock %} {% block inner_content %} <p> We need to know how much money you have coming in, because this affects whether or not you can get legal aid. Please answer these questions as fully and accurately as you can. </p> <form method="POST" action="{{ url_for('.income') }}"> {{ form.csrf_token }} {{ Form.handle_errors(form) }} {% set is_hidden = not (session.is_employed or session.is_self_employed) %} {{ Form.money_interval_field(form.earnings, is_hidden) }} {{ Form.money_interval_field(form.income_tax, is_hidden) }} {{ Form.money_interval_field(form.national_insurance, is_hidden) }} {{ Form.money_interval_field(form.working_tax_credit, is_hidden) }} {{ Form.money_interval_field(form.maintenance) }} {{ Form.money_interval_field(form.pension) }} {{ Form.money_interval_field(form.other_income) }} {{ Form.actions('Continue') }} </form> {% endblock %}
{% extends "base.html" %} {% import "macros/form.html" as Form %} {% import "macros/element.html" as Element %} {% block page_heading %} Your income and tax {% endblock %} {% block inner_content %} <p> We need to know how much money you have coming in, because this affects whether or not you can get legal aid. Please answer these questions as fully and accurately as you can. </p> <form method="POST" action="{{ url_for('.income') }}"> {{ form.csrf_token }} {{ Form.handle_errors(form) }} {% set is_hidden = not (session.is_employed or session.is_self_employed) %} {% for set in form.sets %} {% if loop.index == 1 or session.has_partner and loop.index > 1 %} <fieldset> {% if session.has_partner %} <h3>{{set.title}}</h3> {% if set.name == 'you' %} <p> This section is for any money that is paid to you personally - for example, your wages. You should record income for your partner, if you have one, in the next section. </p> {% endif %} {% endif %} {% for field in set.fields %} {% if field in ( 'earnings', 'income_tax', 'national_insurance', 'working_tax_credit' ) %} {{ Form.money_interval_field(form[field], is_hidden) }} {% else %} {{ Form.money_interval_field(form[field]) }} {% endif %} {% endfor %} </fieldset> {% endif %} {% endfor %} {{ Form.actions('Continue') }} </form> {% endblock %}
Create form field sets for Income form
Create form field sets for Income form
HTML
mit
ministryofjustice/cla_public,ministryofjustice/cla_public,ministryofjustice/cla_public,ministryofjustice/cla_public
html
## Code Before: {% extends "base.html" %} {% import "macros/form.html" as Form %} {% import "macros/element.html" as Element %} {% block page_heading %} Your income and tax {% endblock %} {% block inner_content %} <p> We need to know how much money you have coming in, because this affects whether or not you can get legal aid. Please answer these questions as fully and accurately as you can. </p> <form method="POST" action="{{ url_for('.income') }}"> {{ form.csrf_token }} {{ Form.handle_errors(form) }} {% set is_hidden = not (session.is_employed or session.is_self_employed) %} {{ Form.money_interval_field(form.earnings, is_hidden) }} {{ Form.money_interval_field(form.income_tax, is_hidden) }} {{ Form.money_interval_field(form.national_insurance, is_hidden) }} {{ Form.money_interval_field(form.working_tax_credit, is_hidden) }} {{ Form.money_interval_field(form.maintenance) }} {{ Form.money_interval_field(form.pension) }} {{ Form.money_interval_field(form.other_income) }} {{ Form.actions('Continue') }} </form> {% endblock %} ## Instruction: Create form field sets for Income form ## Code After: {% extends "base.html" %} {% import "macros/form.html" as Form %} {% import "macros/element.html" as Element %} {% block page_heading %} Your income and tax {% endblock %} {% block inner_content %} <p> We need to know how much money you have coming in, because this affects whether or not you can get legal aid. Please answer these questions as fully and accurately as you can. </p> <form method="POST" action="{{ url_for('.income') }}"> {{ form.csrf_token }} {{ Form.handle_errors(form) }} {% set is_hidden = not (session.is_employed or session.is_self_employed) %} {% for set in form.sets %} {% if loop.index == 1 or session.has_partner and loop.index > 1 %} <fieldset> {% if session.has_partner %} <h3>{{set.title}}</h3> {% if set.name == 'you' %} <p> This section is for any money that is paid to you personally - for example, your wages. You should record income for your partner, if you have one, in the next section. </p> {% endif %} {% endif %} {% for field in set.fields %} {% if field in ( 'earnings', 'income_tax', 'national_insurance', 'working_tax_credit' ) %} {{ Form.money_interval_field(form[field], is_hidden) }} {% else %} {{ Form.money_interval_field(form[field]) }} {% endif %} {% endfor %} </fieldset> {% endif %} {% endfor %} {{ Form.actions('Continue') }} </form> {% endblock %}
{% extends "base.html" %} {% import "macros/form.html" as Form %} {% import "macros/element.html" as Element %} {% block page_heading %} Your income and tax {% endblock %} {% block inner_content %} <p> We need to know how much money you have coming in, because this affects whether or not you can get legal aid. Please answer these questions as fully and accurately as you can. </p> <form method="POST" action="{{ url_for('.income') }}"> {{ form.csrf_token }} {{ Form.handle_errors(form) }} {% set is_hidden = not (session.is_employed or session.is_self_employed) %} - {{ Form.money_interval_field(form.earnings, is_hidden) }} + + {% for set in form.sets %} + {% if loop.index == 1 or session.has_partner and loop.index > 1 %} + <fieldset> + {% if session.has_partner %} + <h3>{{set.title}}</h3> + {% if set.name == 'you' %} + <p> + This section is for any money that is paid to you personally + - for example, your wages. You should record income for your + partner, if you have one, in the next section. + </p> + {% endif %} + {% endif %} + {% for field in set.fields %} + {% if field in ( + 'earnings', + 'income_tax', + 'national_insurance', + 'working_tax_credit' + ) %} - {{ Form.money_interval_field(form.income_tax, is_hidden) }} ? ^ ---- ^^^^ + {{ Form.money_interval_field(form[field], is_hidden) }} ? ++++++++++ ^^ ^^^ + {% else %} - {{ Form.money_interval_field(form.national_insurance, is_hidden) }} - {{ Form.money_interval_field(form.working_tax_credit, is_hidden) }} - {{ Form.money_interval_field(form.maintenance) }} - {{ Form.money_interval_field(form.pension) }} ? ^^ ^^^^^ + {{ Form.money_interval_field(form[field]) }} ? ++++++++++ ^^^ ^^^ - {{ Form.money_interval_field(form.other_income) }} + {% endif %} + {% endfor %} + </fieldset> + {% endif %} + {% endfor %} {{ Form.actions('Continue') }} </form> {% endblock %}
36
1.16129
29
7
1f983bf7ad5967d782a6c008362e77d97858fea6
.travis.yml
.travis.yml
language: rust rust: - 1.12.0 - stable - beta - nightly script: - cargo build --verbose - cargo doc - cargo test --verbose - cargo test --verbose --no-default-features --lib - if [ "$TRAVIS_RUST_VERSION" = "nightly" ]; then cargo test --verbose --features i128; cargo test --verbose --no-default-features --features i128 --lib; cargo bench --verbose --no-run; cargo bench --verbose --no-run --no-default-features; cargo bench --verbose --no-run --features i128; cargo bench --verbose --no-run --no-default-features --features i128; fi branches: only: - master
language: rust matrix: include: - rust: 1.12.0 - rust: stable - rust: beta - rust: nightly - env: CROSS_TARGET=mips64-unknown-linux-gnuabi64 rust: stable services: docker sudo: required before_script: - if [ ! -z "$CROSS_TARGET" ]; then rustup target add $CROSS_TARGET; cargo install cross --force; export CARGO_CMD="cross"; export TARGET_PARAM="--target $CROSS_TARGET"; else export CARGO_CMD=cargo; export TARGET_PARAM=""; fi script: - $CARGO_CMD build $TARGET_PARAM --verbose - $CARGO_CMD doc $TARGET_PARAM - $CARGO_CMD test $TARGET_PARAM --verbose - $CARGO_CMD test $TARGET_PARAM --verbose --no-default-features --lib - if [ "$TRAVIS_RUST_VERSION" = "nightly" ]; then $CARGO_CMD test $TARGET_PARAM --verbose --features i128; $CARGO_CMD test $TARGET_PARAM --verbose --no-default-features --features i128 --lib; $CARGO_CMD bench $TARGET_PARAM --verbose --no-run; $CARGO_CMD bench $TARGET_PARAM --verbose --no-run --no-default-features; $CARGO_CMD bench $TARGET_PARAM --verbose --no-run --features i128; $CARGO_CMD bench $TARGET_PARAM --verbose --no-run --no-default-features --features i128; fi branches: only: - master
Add MIPS64 cross-compliation target to Travis
Add MIPS64 cross-compliation target to Travis
YAML
unlicense
BurntSushi/byteorder
yaml
## Code Before: language: rust rust: - 1.12.0 - stable - beta - nightly script: - cargo build --verbose - cargo doc - cargo test --verbose - cargo test --verbose --no-default-features --lib - if [ "$TRAVIS_RUST_VERSION" = "nightly" ]; then cargo test --verbose --features i128; cargo test --verbose --no-default-features --features i128 --lib; cargo bench --verbose --no-run; cargo bench --verbose --no-run --no-default-features; cargo bench --verbose --no-run --features i128; cargo bench --verbose --no-run --no-default-features --features i128; fi branches: only: - master ## Instruction: Add MIPS64 cross-compliation target to Travis ## Code After: language: rust matrix: include: - rust: 1.12.0 - rust: stable - rust: beta - rust: nightly - env: CROSS_TARGET=mips64-unknown-linux-gnuabi64 rust: stable services: docker sudo: required before_script: - if [ ! -z "$CROSS_TARGET" ]; then rustup target add $CROSS_TARGET; cargo install cross --force; export CARGO_CMD="cross"; export TARGET_PARAM="--target $CROSS_TARGET"; else export CARGO_CMD=cargo; export TARGET_PARAM=""; fi script: - $CARGO_CMD build $TARGET_PARAM --verbose - $CARGO_CMD doc $TARGET_PARAM - $CARGO_CMD test $TARGET_PARAM --verbose - $CARGO_CMD test $TARGET_PARAM --verbose --no-default-features --lib - if [ "$TRAVIS_RUST_VERSION" = "nightly" ]; then $CARGO_CMD test $TARGET_PARAM --verbose --features i128; $CARGO_CMD test $TARGET_PARAM --verbose --no-default-features --features i128 --lib; $CARGO_CMD bench $TARGET_PARAM --verbose --no-run; $CARGO_CMD bench $TARGET_PARAM --verbose --no-run --no-default-features; $CARGO_CMD bench $TARGET_PARAM --verbose --no-run --features i128; $CARGO_CMD bench $TARGET_PARAM --verbose --no-run --no-default-features --features i128; fi branches: only: - master
language: rust - rust: - - 1.12.0 - - stable - - beta - - nightly + + matrix: + include: + - rust: 1.12.0 + - rust: stable + - rust: beta + - rust: nightly + - env: CROSS_TARGET=mips64-unknown-linux-gnuabi64 + rust: stable + services: docker + sudo: required + + before_script: + - if [ ! -z "$CROSS_TARGET" ]; then + rustup target add $CROSS_TARGET; + cargo install cross --force; + export CARGO_CMD="cross"; + export TARGET_PARAM="--target $CROSS_TARGET"; + else + export CARGO_CMD=cargo; + export TARGET_PARAM=""; + fi + script: - - cargo build --verbose - - cargo doc - - cargo test --verbose + - $CARGO_CMD build $TARGET_PARAM --verbose + - $CARGO_CMD doc $TARGET_PARAM + - $CARGO_CMD test $TARGET_PARAM --verbose - - cargo test --verbose --no-default-features --lib ? ^^^^^ + - $CARGO_CMD test $TARGET_PARAM --verbose --no-default-features --lib ? ^^^^^^^^^^ ++++++++++++++ - if [ "$TRAVIS_RUST_VERSION" = "nightly" ]; then - cargo test --verbose --features i128; + $CARGO_CMD test $TARGET_PARAM --verbose --features i128; - cargo test --verbose --no-default-features --features i128 --lib; ? ^^^^^ + $CARGO_CMD test $TARGET_PARAM --verbose --no-default-features --features i128 --lib; ? ^^^^^^^^^^ ++++++++++++++ - cargo bench --verbose --no-run; + $CARGO_CMD bench $TARGET_PARAM --verbose --no-run; - cargo bench --verbose --no-run --no-default-features; ? ^^^^^ + $CARGO_CMD bench $TARGET_PARAM --verbose --no-run --no-default-features; ? ^^^^^^^^^^ ++++++++++++++ - cargo bench --verbose --no-run --features i128; ? ^^^^^ + $CARGO_CMD bench $TARGET_PARAM --verbose --no-run --features i128; ? ^^^^^^^^^^ ++++++++++++++ - cargo bench --verbose --no-run --no-default-features --features i128; ? ^^^^^ + $CARGO_CMD bench $TARGET_PARAM --verbose --no-run --no-default-features --features i128; ? ^^^^^^^^^^ ++++++++++++++ fi branches: only: - master
48
2.181818
33
15
67c4e83370c5f96ae6dfce1901aa2e7200d45eed
.github/workflows/main.yml
.github/workflows/main.yml
name: CI on: [push, pull_request] jobs: industrial_ci: strategy: matrix: env: - {ROS_DISTRO: kinetic, ROS_REPO: testing} - {ROS_DISTRO: kinetic, ROS_REPO: main} - {ROS_DISTRO: melodic, ROS_REPO: testing} - {ROS_DISTRO: melodic, ROS_REPO: main} - {ROS_DISTRO: noetic, ROS_REPO: testing} - {ROS_DISTRO: noetic, ROS_REPO: main} - {ROS_DISTRO: dashing, ROS_REPO: testing} - {ROS_DISTRO: dashing, ROS_REPO: main} - {ROS_DISTRO: eloquent, ROS_REPO: testing} - {ROS_DISTRO: eloquent, ROS_REPO: main} - {ROS_DISTRO: foxy, ROS_REPO: testing} - {ROS_DISTRO: foxy, ROS_REPO: main} runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - uses: 'ros-industrial/industrial_ci@master' env: ${{matrix.env}}
name: CI on: [push, pull_request] jobs: industrial_ci: strategy: matrix: env: - {ROS_DISTRO: kinetic, ROS_REPO: testing} - {ROS_DISTRO: kinetic, ROS_REPO: main} - {ROS_DISTRO: melodic, ROS_REPO: testing} - {ROS_DISTRO: melodic, ROS_REPO: main} - {ROS_DISTRO: noetic, ROS_REPO: testing} - {ROS_DISTRO: noetic, ROS_REPO: main} # - {ROS_DISTRO: dashing, ROS_REPO: testing} # - {ROS_DISTRO: dashing, ROS_REPO: main} # - {ROS_DISTRO: eloquent, ROS_REPO: testing} # - {ROS_DISTRO: eloquent, ROS_REPO: main} # - {ROS_DISTRO: foxy, ROS_REPO: testing} # - {ROS_DISTRO: foxy, ROS_REPO: main} runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - uses: 'ros-industrial/industrial_ci@master' env: ${{matrix.env}}
Comment out ROS2 for now
Comment out ROS2 for now Signed-off-by: P. J. Reed <b4e3b694db1cddfe64481aab280498df5d31ec6b@swri.org>
YAML
bsd-3-clause
swri-robotics/swri_profiler,swri-robotics/swri_profiler,swri-robotics/swri_profiler,swri-robotics/swri_profiler
yaml
## Code Before: name: CI on: [push, pull_request] jobs: industrial_ci: strategy: matrix: env: - {ROS_DISTRO: kinetic, ROS_REPO: testing} - {ROS_DISTRO: kinetic, ROS_REPO: main} - {ROS_DISTRO: melodic, ROS_REPO: testing} - {ROS_DISTRO: melodic, ROS_REPO: main} - {ROS_DISTRO: noetic, ROS_REPO: testing} - {ROS_DISTRO: noetic, ROS_REPO: main} - {ROS_DISTRO: dashing, ROS_REPO: testing} - {ROS_DISTRO: dashing, ROS_REPO: main} - {ROS_DISTRO: eloquent, ROS_REPO: testing} - {ROS_DISTRO: eloquent, ROS_REPO: main} - {ROS_DISTRO: foxy, ROS_REPO: testing} - {ROS_DISTRO: foxy, ROS_REPO: main} runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - uses: 'ros-industrial/industrial_ci@master' env: ${{matrix.env}} ## Instruction: Comment out ROS2 for now Signed-off-by: P. J. Reed <b4e3b694db1cddfe64481aab280498df5d31ec6b@swri.org> ## Code After: name: CI on: [push, pull_request] jobs: industrial_ci: strategy: matrix: env: - {ROS_DISTRO: kinetic, ROS_REPO: testing} - {ROS_DISTRO: kinetic, ROS_REPO: main} - {ROS_DISTRO: melodic, ROS_REPO: testing} - {ROS_DISTRO: melodic, ROS_REPO: main} - {ROS_DISTRO: noetic, ROS_REPO: testing} - {ROS_DISTRO: noetic, ROS_REPO: main} # - {ROS_DISTRO: dashing, ROS_REPO: testing} # - {ROS_DISTRO: dashing, ROS_REPO: main} # - {ROS_DISTRO: eloquent, ROS_REPO: testing} # - {ROS_DISTRO: eloquent, ROS_REPO: main} # - {ROS_DISTRO: foxy, ROS_REPO: testing} # - {ROS_DISTRO: foxy, ROS_REPO: main} runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - uses: 'ros-industrial/industrial_ci@master' env: ${{matrix.env}}
name: CI on: [push, pull_request] jobs: industrial_ci: strategy: matrix: env: - {ROS_DISTRO: kinetic, ROS_REPO: testing} - {ROS_DISTRO: kinetic, ROS_REPO: main} - - {ROS_DISTRO: melodic, ROS_REPO: testing} + - {ROS_DISTRO: melodic, ROS_REPO: testing} ? + - - {ROS_DISTRO: melodic, ROS_REPO: main} + - {ROS_DISTRO: melodic, ROS_REPO: main} ? + - - {ROS_DISTRO: noetic, ROS_REPO: testing} ? -- + - {ROS_DISTRO: noetic, ROS_REPO: testing} - - {ROS_DISTRO: noetic, ROS_REPO: main} ? -- + - {ROS_DISTRO: noetic, ROS_REPO: main} - - {ROS_DISTRO: dashing, ROS_REPO: testing} + # - {ROS_DISTRO: dashing, ROS_REPO: testing} ? + - - {ROS_DISTRO: dashing, ROS_REPO: main} + # - {ROS_DISTRO: dashing, ROS_REPO: main} ? + - - {ROS_DISTRO: eloquent, ROS_REPO: testing} + # - {ROS_DISTRO: eloquent, ROS_REPO: testing} ? + - - {ROS_DISTRO: eloquent, ROS_REPO: main} + # - {ROS_DISTRO: eloquent, ROS_REPO: main} ? + - - {ROS_DISTRO: foxy, ROS_REPO: testing} + # - {ROS_DISTRO: foxy, ROS_REPO: testing} ? + - - {ROS_DISTRO: foxy, ROS_REPO: main} + # - {ROS_DISTRO: foxy, ROS_REPO: main} ? + runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - uses: 'ros-industrial/industrial_ci@master' env: ${{matrix.env}}
20
0.769231
10
10
5fbb5350ce3b377a51da93fa03e08bfeae517f2f
lib/tty/prompt/reader/win_api.rb
lib/tty/prompt/reader/win_api.rb
require 'fiddle' module TTY class Prompt class Reader module WinAPI include Fiddle Handle = RUBY_VERSION >= "2.0.0" ? Fiddle::Handle : DL::Handle CRT_HANDLE = Handle.new("msvcrt") rescue Handle.new("crtdll") def getch @@getch ||= Fiddle::Function.new(CRT_HANDLE["_getch"], [], TYPE_INT) @@getch.call end module_function :getch def getche @@getche ||= Fiddle::Function.new(CRT_HANDLE["_getche"], [], TYPE_INT) @@getche.call end module_function :getche # Check the console for recent keystroke. If the function # returns a nonzero value, a keystroke is waiting in the buffer. # # @return [Integer] # return a nonzero value if a key has been pressed. Otherwirse, # it returns 0. # # @api public def kbhit @@kbhit ||= Fiddle::Function.new(CRT_HANDLE["_kbhit"], [], TYPE_INT) @@kbhit.call end module_function :kbhit end # WinAPI end # Reader end # Prompt end # TTY
require 'fiddle' module TTY class Prompt class Reader module WinAPI include Fiddle Handle = RUBY_VERSION >= "2.0.0" ? Fiddle::Handle : DL::Handle CRT_HANDLE = Handle.new("msvcrt") rescue Handle.new("crtdll") # Get a character from the console without echo. # # @return [String] # return the character read # # @api public def getch @@getch ||= Fiddle::Function.new(CRT_HANDLE["_getch"], [], TYPE_INT) @@getch.call end module_function :getch # Gets a character from the console with echo. # # @return [String] # return the character read # # @api public def getche @@getche ||= Fiddle::Function.new(CRT_HANDLE["_getche"], [], TYPE_INT) @@getche.call end module_function :getche # Check the console for recent keystroke. If the function # returns a nonzero value, a keystroke is waiting in the buffer. # # @return [Integer] # return a nonzero value if a key has been pressed. Otherwirse, # it returns 0. # # @api public def kbhit @@kbhit ||= Fiddle::Function.new(CRT_HANDLE["_kbhit"], [], TYPE_INT) @@kbhit.call end module_function :kbhit end # WinAPI end # Reader end # Prompt end # TTY
Change to document windows api calls
Change to document windows api calls
Ruby
mit
peter-murach/tty-prompt,piotrmurach/tty-prompt
ruby
## Code Before: require 'fiddle' module TTY class Prompt class Reader module WinAPI include Fiddle Handle = RUBY_VERSION >= "2.0.0" ? Fiddle::Handle : DL::Handle CRT_HANDLE = Handle.new("msvcrt") rescue Handle.new("crtdll") def getch @@getch ||= Fiddle::Function.new(CRT_HANDLE["_getch"], [], TYPE_INT) @@getch.call end module_function :getch def getche @@getche ||= Fiddle::Function.new(CRT_HANDLE["_getche"], [], TYPE_INT) @@getche.call end module_function :getche # Check the console for recent keystroke. If the function # returns a nonzero value, a keystroke is waiting in the buffer. # # @return [Integer] # return a nonzero value if a key has been pressed. Otherwirse, # it returns 0. # # @api public def kbhit @@kbhit ||= Fiddle::Function.new(CRT_HANDLE["_kbhit"], [], TYPE_INT) @@kbhit.call end module_function :kbhit end # WinAPI end # Reader end # Prompt end # TTY ## Instruction: Change to document windows api calls ## Code After: require 'fiddle' module TTY class Prompt class Reader module WinAPI include Fiddle Handle = RUBY_VERSION >= "2.0.0" ? Fiddle::Handle : DL::Handle CRT_HANDLE = Handle.new("msvcrt") rescue Handle.new("crtdll") # Get a character from the console without echo. # # @return [String] # return the character read # # @api public def getch @@getch ||= Fiddle::Function.new(CRT_HANDLE["_getch"], [], TYPE_INT) @@getch.call end module_function :getch # Gets a character from the console with echo. # # @return [String] # return the character read # # @api public def getche @@getche ||= Fiddle::Function.new(CRT_HANDLE["_getche"], [], TYPE_INT) @@getche.call end module_function :getche # Check the console for recent keystroke. If the function # returns a nonzero value, a keystroke is waiting in the buffer. # # @return [Integer] # return a nonzero value if a key has been pressed. Otherwirse, # it returns 0. # # @api public def kbhit @@kbhit ||= Fiddle::Function.new(CRT_HANDLE["_kbhit"], [], TYPE_INT) @@kbhit.call end module_function :kbhit end # WinAPI end # Reader end # Prompt end # TTY
require 'fiddle' module TTY class Prompt class Reader module WinAPI include Fiddle Handle = RUBY_VERSION >= "2.0.0" ? Fiddle::Handle : DL::Handle CRT_HANDLE = Handle.new("msvcrt") rescue Handle.new("crtdll") + # Get a character from the console without echo. + # + # @return [String] + # return the character read + # + # @api public def getch @@getch ||= Fiddle::Function.new(CRT_HANDLE["_getch"], [], TYPE_INT) @@getch.call end module_function :getch + # Gets a character from the console with echo. + # + # @return [String] + # return the character read + # + # @api public def getche @@getche ||= Fiddle::Function.new(CRT_HANDLE["_getche"], [], TYPE_INT) @@getche.call end module_function :getche # Check the console for recent keystroke. If the function # returns a nonzero value, a keystroke is waiting in the buffer. # # @return [Integer] # return a nonzero value if a key has been pressed. Otherwirse, # it returns 0. # # @api public def kbhit @@kbhit ||= Fiddle::Function.new(CRT_HANDLE["_kbhit"], [], TYPE_INT) @@kbhit.call end module_function :kbhit end # WinAPI end # Reader end # Prompt end # TTY
12
0.285714
12
0
b469cf8312304e9fa77955d67e44eea71960c08d
views/chat.jade
views/chat.jade
extend layout block content div#chat div.row div.welcome.top-buffer div.top-buffer#setYourName label(for="name", autocomplete="off") Enter your chat name div.input-group input#name.form-control(name="name", type="text") span.input-group-btn button#setName.btn.btn-default(type="button") Set Name div#chatbox div.input-group input#message(type="text", autocomplete="off").form-control span.input-group-btn button#sendMessage(type="button").btn.btn-default Send script(src="//ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js") script(src="/javascripts/socket.io.js") script(src="/javascripts/chat.js")
extend layout block content div#chat div.row div.welcome.top-buffer div.top-buffer#setYourName label(for="name", autocomplete="off") Enter your chat name div.input-group input#name.form-control(name="name", type="text") span.input-group-btn button#setName.btn.btn-default(type="button") Set Name div#chatbox div.input-group input#message(type="text", autocomplete="off").form-control span.input-group-btn button#sendMessage(type="button").btn.btn-default Send p.user-typing script(src="//ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js") script(src="/javascripts/socket.io.js") script(src="/javascripts/chat.js")
Add paragraph item to use for when user is typing message
Add paragraph item to use for when user is typing message
Jade
mit
lukecahill/Echo-Music,lukecahill/Echo-Music
jade
## Code Before: extend layout block content div#chat div.row div.welcome.top-buffer div.top-buffer#setYourName label(for="name", autocomplete="off") Enter your chat name div.input-group input#name.form-control(name="name", type="text") span.input-group-btn button#setName.btn.btn-default(type="button") Set Name div#chatbox div.input-group input#message(type="text", autocomplete="off").form-control span.input-group-btn button#sendMessage(type="button").btn.btn-default Send script(src="//ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js") script(src="/javascripts/socket.io.js") script(src="/javascripts/chat.js") ## Instruction: Add paragraph item to use for when user is typing message ## Code After: extend layout block content div#chat div.row div.welcome.top-buffer div.top-buffer#setYourName label(for="name", autocomplete="off") Enter your chat name div.input-group input#name.form-control(name="name", type="text") span.input-group-btn button#setName.btn.btn-default(type="button") Set Name div#chatbox div.input-group input#message(type="text", autocomplete="off").form-control span.input-group-btn button#sendMessage(type="button").btn.btn-default Send p.user-typing script(src="//ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js") script(src="/javascripts/socket.io.js") script(src="/javascripts/chat.js")
extend layout block content div#chat div.row div.welcome.top-buffer div.top-buffer#setYourName label(for="name", autocomplete="off") Enter your chat name div.input-group input#name.form-control(name="name", type="text") span.input-group-btn button#setName.btn.btn-default(type="button") Set Name div#chatbox div.input-group input#message(type="text", autocomplete="off").form-control span.input-group-btn button#sendMessage(type="button").btn.btn-default Send + p.user-typing script(src="//ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js") script(src="/javascripts/socket.io.js") script(src="/javascripts/chat.js")
1
0.047619
1
0
2bebbbfc12e1013e3c5c0a42329bac520c574b9b
tests/test_settings.py
tests/test_settings.py
import pytest import npc import os from tests.util import fixture_dir @pytest.fixture def settings(): return npc.settings.Settings() def test_creation(settings): assert settings is not None def test_override(settings): override_path = fixture_dir(['settings/settings-vim.json']) old_editor = settings.get('editor') settings.load_more(override_path) assert settings.get('editor') != old_editor def test_nested_get(settings): assert settings.get('paths.characters') == 'Characters' def test_get_settings_path(settings): assert settings.get_settings_path('default') == os.path.join(settings.default_settings_path, 'settings-default.json') assert settings.get_settings_path('campaign') == os.path.join(settings.campaign_settings_path, 'settings.json') def test_support_paths(settings): """Paths loaded from additional files should be expanded relative to that file""" override_path = fixture_dir(['settings/settings-paths.json']) settings.load_more(override_path) assert settings.get('support.testpath') == fixture_dir(['settings/nothing.json'])
import pytest import npc import os from tests.util import fixture_dir def test_creation(prefs): assert prefs is not None def test_override(prefs): override_path = fixture_dir(['settings/settings-vim.json']) old_editor = prefs.get('editor') prefs.load_more(override_path) assert prefs.get('editor') != old_editor def test_nested_get(prefs): assert prefs.get('paths.characters') == 'Characters' def test_get_settings_path(prefs): assert prefs.get_settings_path('default') == os.path.join(prefs.default_settings_path, 'settings-default.json') assert prefs.get_settings_path('campaign') == os.path.join(prefs.campaign_settings_path, 'settings.json') def test_support_paths(prefs): """Paths loaded from additional files should be expanded relative to that file""" override_path = fixture_dir(['settings/settings-paths.json']) prefs.load_more(override_path) assert prefs.get('support.testpath') == fixture_dir(['settings/nothing.json'])
Refactor settings tests to use global fixture
Refactor settings tests to use global fixture
Python
mit
aurule/npc,aurule/npc
python
## Code Before: import pytest import npc import os from tests.util import fixture_dir @pytest.fixture def settings(): return npc.settings.Settings() def test_creation(settings): assert settings is not None def test_override(settings): override_path = fixture_dir(['settings/settings-vim.json']) old_editor = settings.get('editor') settings.load_more(override_path) assert settings.get('editor') != old_editor def test_nested_get(settings): assert settings.get('paths.characters') == 'Characters' def test_get_settings_path(settings): assert settings.get_settings_path('default') == os.path.join(settings.default_settings_path, 'settings-default.json') assert settings.get_settings_path('campaign') == os.path.join(settings.campaign_settings_path, 'settings.json') def test_support_paths(settings): """Paths loaded from additional files should be expanded relative to that file""" override_path = fixture_dir(['settings/settings-paths.json']) settings.load_more(override_path) assert settings.get('support.testpath') == fixture_dir(['settings/nothing.json']) ## Instruction: Refactor settings tests to use global fixture ## Code After: import pytest import npc import os from tests.util import fixture_dir def test_creation(prefs): assert prefs is not None def test_override(prefs): override_path = fixture_dir(['settings/settings-vim.json']) old_editor = prefs.get('editor') prefs.load_more(override_path) assert prefs.get('editor') != old_editor def test_nested_get(prefs): assert prefs.get('paths.characters') == 'Characters' def test_get_settings_path(prefs): assert prefs.get_settings_path('default') == os.path.join(prefs.default_settings_path, 'settings-default.json') assert prefs.get_settings_path('campaign') == os.path.join(prefs.campaign_settings_path, 'settings.json') def test_support_paths(prefs): """Paths loaded from additional files should be expanded relative to that file""" override_path = fixture_dir(['settings/settings-paths.json']) prefs.load_more(override_path) assert prefs.get('support.testpath') == fixture_dir(['settings/nothing.json'])
import pytest import npc import os from tests.util import fixture_dir + def test_creation(prefs): + assert prefs is not None - @pytest.fixture - def settings(): - return npc.settings.Settings() - def test_creation(settings): - assert settings is not None + def test_override(prefs): + override_path = fixture_dir(['settings/settings-vim.json']) + old_editor = prefs.get('editor') + prefs.load_more(override_path) + assert prefs.get('editor') != old_editor + def test_nested_get(prefs): + assert prefs.get('paths.characters') == 'Characters' - def test_override(settings): - override_path = fixture_dir(['settings/settings-vim.json']) - old_editor = settings.get('editor') - settings.load_more(override_path) - assert settings.get('editor') != old_editor - def test_nested_get(settings): - assert settings.get('paths.characters') == 'Characters' + def test_get_settings_path(prefs): + assert prefs.get_settings_path('default') == os.path.join(prefs.default_settings_path, 'settings-default.json') + assert prefs.get_settings_path('campaign') == os.path.join(prefs.campaign_settings_path, 'settings.json') - def test_get_settings_path(settings): - assert settings.get_settings_path('default') == os.path.join(settings.default_settings_path, 'settings-default.json') - assert settings.get_settings_path('campaign') == os.path.join(settings.campaign_settings_path, 'settings.json') - - def test_support_paths(settings): ? ^ ^^^^^ + def test_support_paths(prefs): ? ^^ ^ """Paths loaded from additional files should be expanded relative to that file""" override_path = fixture_dir(['settings/settings-paths.json']) - settings.load_more(override_path) ? ^ ^^^^^ + prefs.load_more(override_path) ? ^^ ^ - assert settings.get('support.testpath') == fixture_dir(['settings/nothing.json']) ? ^ ^^^^^ + assert prefs.get('support.testpath') == fixture_dir(['settings/nothing.json']) ? ^^ ^
34
1.133333
15
19
2509badb90a23c7c8b85c146f960bcc7bb8d57aa
postgresql/protocol/version.py
postgresql/protocol/version.py
'PQ version class' from struct import Struct version_struct = Struct('!HH') class Version(tuple): """Version((major, minor)) -> Version Version serializer and parser. """ major = property(fget = lambda s: s[0]) minor = property(fget = lambda s: s[1]) def __new__(subtype, major_minor : '(major, minor)'): (major, minor) = major_minor major = int(major) minor = int(minor) # If it can't be packed like this, it's not a valid version. try: version_struct.pack(major, minor) except Exception as e: raise ValueError("unpackable major and minor") from e return tuple.__new__(subtype, (major, minor)) def __int__(self): return (self[0] << 16) | self[1] def bytes(self): return version_struct.pack(self[0], self[1]) def __repr__(self): return '%d.%d' %(self[0], self[1]) def parse(self, data): return self(version_struct.unpack(data)) parse = classmethod(parse) CancelRequestCode = Version((1234, 5678)) NegotiateSSLCode = Version((1234, 5679)) V2_0 = Version((2, 0)) V3_0 = Version((3, 0))
from struct import Struct version_struct = Struct('!HH') class Version(tuple): """ Version((major, minor)) -> Version Version serializer and parser. """ major = property(fget = lambda s: s[0]) minor = property(fget = lambda s: s[1]) def __new__(subtype, major_minor): (major, minor) = major_minor major = int(major) minor = int(minor) # If it can't be packed like this, it's not a valid version. try: version_struct.pack(major, minor) except Exception as e: raise ValueError("unpackable major and minor") from e return tuple.__new__(subtype, (major, minor)) def __int__(self): return (self[0] << 16) | self[1] def bytes(self): return version_struct.pack(self[0], self[1]) def __repr__(self): return '%d.%d' %(self[0], self[1]) def parse(self, data): return self(version_struct.unpack(data)) parse = classmethod(parse) CancelRequestCode = Version((1234, 5678)) NegotiateSSLCode = Version((1234, 5679)) V2_0 = Version((2, 0)) V3_0 = Version((3, 0))
Remove string annotation (likely incomprehensible to mypy) and minor doc-string formatting.
Remove string annotation (likely incomprehensible to mypy) and minor doc-string formatting.
Python
bsd-3-clause
python-postgres/fe,python-postgres/fe
python
## Code Before: 'PQ version class' from struct import Struct version_struct = Struct('!HH') class Version(tuple): """Version((major, minor)) -> Version Version serializer and parser. """ major = property(fget = lambda s: s[0]) minor = property(fget = lambda s: s[1]) def __new__(subtype, major_minor : '(major, minor)'): (major, minor) = major_minor major = int(major) minor = int(minor) # If it can't be packed like this, it's not a valid version. try: version_struct.pack(major, minor) except Exception as e: raise ValueError("unpackable major and minor") from e return tuple.__new__(subtype, (major, minor)) def __int__(self): return (self[0] << 16) | self[1] def bytes(self): return version_struct.pack(self[0], self[1]) def __repr__(self): return '%d.%d' %(self[0], self[1]) def parse(self, data): return self(version_struct.unpack(data)) parse = classmethod(parse) CancelRequestCode = Version((1234, 5678)) NegotiateSSLCode = Version((1234, 5679)) V2_0 = Version((2, 0)) V3_0 = Version((3, 0)) ## Instruction: Remove string annotation (likely incomprehensible to mypy) and minor doc-string formatting. ## Code After: from struct import Struct version_struct = Struct('!HH') class Version(tuple): """ Version((major, minor)) -> Version Version serializer and parser. """ major = property(fget = lambda s: s[0]) minor = property(fget = lambda s: s[1]) def __new__(subtype, major_minor): (major, minor) = major_minor major = int(major) minor = int(minor) # If it can't be packed like this, it's not a valid version. try: version_struct.pack(major, minor) except Exception as e: raise ValueError("unpackable major and minor") from e return tuple.__new__(subtype, (major, minor)) def __int__(self): return (self[0] << 16) | self[1] def bytes(self): return version_struct.pack(self[0], self[1]) def __repr__(self): return '%d.%d' %(self[0], self[1]) def parse(self, data): return self(version_struct.unpack(data)) parse = classmethod(parse) CancelRequestCode = Version((1234, 5678)) NegotiateSSLCode = Version((1234, 5679)) V2_0 = Version((2, 0)) V3_0 = Version((3, 0))
- 'PQ version class' from struct import Struct version_struct = Struct('!HH') class Version(tuple): + """ - """Version((major, minor)) -> Version ? --- + Version((major, minor)) -> Version Version serializer and parser. """ major = property(fget = lambda s: s[0]) minor = property(fget = lambda s: s[1]) - def __new__(subtype, major_minor : '(major, minor)'): ? ------------------- + def __new__(subtype, major_minor): (major, minor) = major_minor major = int(major) minor = int(minor) # If it can't be packed like this, it's not a valid version. try: version_struct.pack(major, minor) except Exception as e: raise ValueError("unpackable major and minor") from e return tuple.__new__(subtype, (major, minor)) def __int__(self): return (self[0] << 16) | self[1] def bytes(self): return version_struct.pack(self[0], self[1]) def __repr__(self): return '%d.%d' %(self[0], self[1]) def parse(self, data): return self(version_struct.unpack(data)) parse = classmethod(parse) CancelRequestCode = Version((1234, 5678)) NegotiateSSLCode = Version((1234, 5679)) V2_0 = Version((2, 0)) V3_0 = Version((3, 0))
6
0.146341
3
3
b370de88793a2f59aee61db30df6f320944d8781
src/main/java/com/github/pedrovgs/problem62/PalindromeList.java
src/main/java/com/github/pedrovgs/problem62/PalindromeList.java
/* * Copyright (C) 2014 Pedro Vicente Gómez Sánchez. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.pedrovgs.problem62; /** * Implement a function to check if a linked list is a palindrome, * * @author Pedro Vicente Gómez Sánchez. */ public class PalindromeList { }
/* * Copyright (C) 2014 Pedro Vicente Gómez Sánchez. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.pedrovgs.problem62; import com.github.pedrovgs.linkedlist.ListNode; import com.github.pedrovgs.problem22.ReverseLinkedList; /** * Implement a function to check if a linked list is a palindrome, * * @author Pedro Vicente Gómez Sánchez. */ public class PalindromeList { private final ReverseLinkedList reverseLinkedList; public PalindromeList() { this.reverseLinkedList = new ReverseLinkedList(); } /** * Iterative algorithm to solve this problem. If a List is a palindrome the reverse list has to * be equals to the original list. This is the base of this algorithm. The complexity order is * the same than reverse list algorithm - O(N) in time terms - because * this is the most expensive operation. In space terms, the complexity order of this algorithm * is * O(N). */ public boolean checkReversing(ListNode list) { validateInput(list); ListNode<Integer> reversedList = reverseLinkedList.reverseIterative(list); boolean isPalindrome = true; while (list != null) { isPalindrome = list.equals(reversedList); if (!isPalindrome) { break; } reversedList = reversedList.getNext(); list = list.getNext(); } return isPalindrome; } private void validateInput(ListNode<Integer> list) { if (list == null) { throw new IllegalArgumentException("You can't pass a null list as parameter."); } } }
Add solution to problem 62
Add solution to problem 62
Java
apache-2.0
JeffreyWei/Algorithms,pedrovgs/Algorithms,ArlenLiu/Algorithms,Ariloum/Algorithms,sridhar-newsdistill/Algorithms,VeskoI/Algorithms,mrgenco/Algorithms-1,inexistence/Algorithms,007slm/Algorithms,Arkar-Aung/Algorithms,zmywly8866/Algorithms,AppScientist/Algorithms,chengjinqian/Algorithms,jibaro/Algorithms,zhdh2008/Algorithms,ajinkyakolhe112/Algorithms
java
## Code Before: /* * Copyright (C) 2014 Pedro Vicente Gómez Sánchez. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.pedrovgs.problem62; /** * Implement a function to check if a linked list is a palindrome, * * @author Pedro Vicente Gómez Sánchez. */ public class PalindromeList { } ## Instruction: Add solution to problem 62 ## Code After: /* * Copyright (C) 2014 Pedro Vicente Gómez Sánchez. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.pedrovgs.problem62; import com.github.pedrovgs.linkedlist.ListNode; import com.github.pedrovgs.problem22.ReverseLinkedList; /** * Implement a function to check if a linked list is a palindrome, * * @author Pedro Vicente Gómez Sánchez. */ public class PalindromeList { private final ReverseLinkedList reverseLinkedList; public PalindromeList() { this.reverseLinkedList = new ReverseLinkedList(); } /** * Iterative algorithm to solve this problem. If a List is a palindrome the reverse list has to * be equals to the original list. This is the base of this algorithm. The complexity order is * the same than reverse list algorithm - O(N) in time terms - because * this is the most expensive operation. In space terms, the complexity order of this algorithm * is * O(N). */ public boolean checkReversing(ListNode list) { validateInput(list); ListNode<Integer> reversedList = reverseLinkedList.reverseIterative(list); boolean isPalindrome = true; while (list != null) { isPalindrome = list.equals(reversedList); if (!isPalindrome) { break; } reversedList = reversedList.getNext(); list = list.getNext(); } return isPalindrome; } private void validateInput(ListNode<Integer> list) { if (list == null) { throw new IllegalArgumentException("You can't pass a null list as parameter."); } } }
/* * Copyright (C) 2014 Pedro Vicente Gómez Sánchez. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.pedrovgs.problem62; + import com.github.pedrovgs.linkedlist.ListNode; + import com.github.pedrovgs.problem22.ReverseLinkedList; + /** * Implement a function to check if a linked list is a palindrome, * * @author Pedro Vicente Gómez Sánchez. */ public class PalindromeList { + private final ReverseLinkedList reverseLinkedList; + + public PalindromeList() { + this.reverseLinkedList = new ReverseLinkedList(); + } + + /** + * Iterative algorithm to solve this problem. If a List is a palindrome the reverse list has to + * be equals to the original list. This is the base of this algorithm. The complexity order is + * the same than reverse list algorithm - O(N) in time terms - because + * this is the most expensive operation. In space terms, the complexity order of this algorithm + * is + * O(N). + */ + public boolean checkReversing(ListNode list) { + validateInput(list); + + ListNode<Integer> reversedList = reverseLinkedList.reverseIterative(list); + + boolean isPalindrome = true; + while (list != null) { + isPalindrome = list.equals(reversedList); + if (!isPalindrome) { + break; + } + reversedList = reversedList.getNext(); + list = list.getNext(); + } + return isPalindrome; + } + + private void validateInput(ListNode<Integer> list) { + if (list == null) { + throw new IllegalArgumentException("You can't pass a null list as parameter."); + } + } }
39
1.56
39
0
03e525da987a103d301a71928072ce4ca37a385c
lib/netsuite/support/fields.rb
lib/netsuite/support/fields.rb
module NetSuite module Support module Fields include Attributes def self.included(base) base.send(:extend, ClassMethods) end module ClassMethods def fields(*args) if args.empty? @fields ||= Set.new else args.each do |arg| field arg end end end def field(name, klass = nil) name_sym = name.to_sym fields << name_sym if klass define_method(name_sym) do attributes[name_sym] ||= klass.new end define_method("#{name_sym}=") do |value| if value.nil? attributes.delete(name_sym) else attributes[name_sym] = value.kind_of?(klass) ? value : klass.new(value) end end else define_method(name_sym) do attributes[name_sym] end define_method("#{name_sym}=") do |value| attributes[name_sym] = value end end end def read_only_fields(*args) if args.empty? @read_only_fields ||= Set.new else args.each do |arg| read_only_field arg end end end def read_only_field(name) name_sym = name.to_sym read_only_fields << name_sym field name end # a bit of trickery: this is for classes which inherit from other classes # i.e. the AssemblyItem, KitItem, etc; this copies the superclass's fields over def inherited(klass) klass.instance_variable_set("@fields", self.fields) klass.instance_variable_set("@read_only_fields", self.read_only_fields) end end end end end
module NetSuite module Support module Fields include Attributes def self.included(base) base.send(:extend, ClassMethods) end module ClassMethods def fields(*args) if args.empty? @fields ||= Set.new else args.each do |arg| field arg end end end def field(name, klass = nil) name_sym = name.to_sym fields << name_sym if klass define_method(name_sym) do attributes[name_sym] ||= klass.new end define_method("#{name_sym}=") do |value| if value.nil? attributes.delete(name_sym) else attributes[name_sym] = value.kind_of?(klass) ? value : klass.new(value) end end else define_method(name_sym) do attributes[name_sym] end define_method("#{name_sym}=") do |value| attributes[name_sym] = value end end end def read_only_fields(*args) if args.empty? @read_only_fields ||= Set.new else args.each do |arg| read_only_field arg end end end def read_only_field(name) name_sym = name.to_sym read_only_fields << name_sym field name end end end end end
Remove class inheritance instance variable hack
Remove class inheritance instance variable hack
Ruby
mit
dropstream/netsuite,jeperkins4/netsuite,nurelm/netsuite,charitywater/netsuite,prburke/netsuite,sherriously/netsuite,greggroth/netsuite,NetSweet/netsuite
ruby
## Code Before: module NetSuite module Support module Fields include Attributes def self.included(base) base.send(:extend, ClassMethods) end module ClassMethods def fields(*args) if args.empty? @fields ||= Set.new else args.each do |arg| field arg end end end def field(name, klass = nil) name_sym = name.to_sym fields << name_sym if klass define_method(name_sym) do attributes[name_sym] ||= klass.new end define_method("#{name_sym}=") do |value| if value.nil? attributes.delete(name_sym) else attributes[name_sym] = value.kind_of?(klass) ? value : klass.new(value) end end else define_method(name_sym) do attributes[name_sym] end define_method("#{name_sym}=") do |value| attributes[name_sym] = value end end end def read_only_fields(*args) if args.empty? @read_only_fields ||= Set.new else args.each do |arg| read_only_field arg end end end def read_only_field(name) name_sym = name.to_sym read_only_fields << name_sym field name end # a bit of trickery: this is for classes which inherit from other classes # i.e. the AssemblyItem, KitItem, etc; this copies the superclass's fields over def inherited(klass) klass.instance_variable_set("@fields", self.fields) klass.instance_variable_set("@read_only_fields", self.read_only_fields) end end end end end ## Instruction: Remove class inheritance instance variable hack ## Code After: module NetSuite module Support module Fields include Attributes def self.included(base) base.send(:extend, ClassMethods) end module ClassMethods def fields(*args) if args.empty? @fields ||= Set.new else args.each do |arg| field arg end end end def field(name, klass = nil) name_sym = name.to_sym fields << name_sym if klass define_method(name_sym) do attributes[name_sym] ||= klass.new end define_method("#{name_sym}=") do |value| if value.nil? attributes.delete(name_sym) else attributes[name_sym] = value.kind_of?(klass) ? value : klass.new(value) end end else define_method(name_sym) do attributes[name_sym] end define_method("#{name_sym}=") do |value| attributes[name_sym] = value end end end def read_only_fields(*args) if args.empty? @read_only_fields ||= Set.new else args.each do |arg| read_only_field arg end end end def read_only_field(name) name_sym = name.to_sym read_only_fields << name_sym field name end end end end end
module NetSuite module Support module Fields include Attributes def self.included(base) base.send(:extend, ClassMethods) end module ClassMethods def fields(*args) if args.empty? @fields ||= Set.new else args.each do |arg| field arg end end end def field(name, klass = nil) name_sym = name.to_sym fields << name_sym if klass define_method(name_sym) do attributes[name_sym] ||= klass.new end define_method("#{name_sym}=") do |value| if value.nil? attributes.delete(name_sym) else attributes[name_sym] = value.kind_of?(klass) ? value : klass.new(value) end end else define_method(name_sym) do attributes[name_sym] end define_method("#{name_sym}=") do |value| attributes[name_sym] = value end end end def read_only_fields(*args) if args.empty? @read_only_fields ||= Set.new else args.each do |arg| read_only_field arg end end end def read_only_field(name) name_sym = name.to_sym read_only_fields << name_sym field name end - - # a bit of trickery: this is for classes which inherit from other classes - # i.e. the AssemblyItem, KitItem, etc; this copies the superclass's fields over - def inherited(klass) - klass.instance_variable_set("@fields", self.fields) - klass.instance_variable_set("@read_only_fields", self.read_only_fields) - end end end end end
7
0.094595
0
7
05a2ddbfddd59c9fca9263620555c16c16150e19
public/src/js/controllers/search.js
public/src/js/controllers/search.js
/** * public/src/js/controllers/search.js - delish * * Licensed under MIT license. * Copyright (C) 2017 Karim Alibhai. */ import sock from '../socket' import debounce from 'debounce' import getCurrentLocation from '../location' export default ['$scope', '$searchParams', ($scope, $searchParams) => { $scope.search = debounce(query => { if (!query) { $scope.hint = '' return $scope.$apply() } let { lat, lng } = getCurrentLocation() sock.emit('autocomplete', { query, lat, lng, radius: $searchParams.radius }) }, 500) $scope.prediction = () => { return $scope.hint && $scope.query ? $scope.query + $scope.hint.substr($scope.query.length) : '' } sock.on('autocomplete:results', result => { $scope.hint = result $scope.$apply() }) }]
/** * public/src/js/controllers/search.js - delish * * Licensed under MIT license. * Copyright (C) 2017 Karim Alibhai. */ import sock from '../socket' import debounce from 'debounce' import { getCurrentLocation } from '../location' import { getMap } from '../map' export default ['$scope', ($scope) => { $scope.search = debounce(query => { if (!query) { $scope.hint = '' return $scope.$apply() } let { lat, lng } = getCurrentLocation() sock.emit('autocomplete', { query, lat, lng, radius: getMap().radius() }) }, 500) $scope.prediction = () => { return $scope.hint && $scope.query ? $scope.query + $scope.hint.substr($scope.query.length) : '' } $scope.complete = evt => { if (evt.which === 39) { $scope.query = $scope.prediction() } } sock.on('autocomplete:results', result => { $scope.hint = result $scope.$apply() }) }]
Update autocomplete feature with API changes
Update autocomplete feature with API changes
JavaScript
mit
karimsa/delish,karimsa/delish,karimsa/delish
javascript
## Code Before: /** * public/src/js/controllers/search.js - delish * * Licensed under MIT license. * Copyright (C) 2017 Karim Alibhai. */ import sock from '../socket' import debounce from 'debounce' import getCurrentLocation from '../location' export default ['$scope', '$searchParams', ($scope, $searchParams) => { $scope.search = debounce(query => { if (!query) { $scope.hint = '' return $scope.$apply() } let { lat, lng } = getCurrentLocation() sock.emit('autocomplete', { query, lat, lng, radius: $searchParams.radius }) }, 500) $scope.prediction = () => { return $scope.hint && $scope.query ? $scope.query + $scope.hint.substr($scope.query.length) : '' } sock.on('autocomplete:results', result => { $scope.hint = result $scope.$apply() }) }] ## Instruction: Update autocomplete feature with API changes ## Code After: /** * public/src/js/controllers/search.js - delish * * Licensed under MIT license. * Copyright (C) 2017 Karim Alibhai. */ import sock from '../socket' import debounce from 'debounce' import { getCurrentLocation } from '../location' import { getMap } from '../map' export default ['$scope', ($scope) => { $scope.search = debounce(query => { if (!query) { $scope.hint = '' return $scope.$apply() } let { lat, lng } = getCurrentLocation() sock.emit('autocomplete', { query, lat, lng, radius: getMap().radius() }) }, 500) $scope.prediction = () => { return $scope.hint && $scope.query ? $scope.query + $scope.hint.substr($scope.query.length) : '' } $scope.complete = evt => { if (evt.which === 39) { $scope.query = $scope.prediction() } } sock.on('autocomplete:results', result => { $scope.hint = result $scope.$apply() }) }]
/** * public/src/js/controllers/search.js - delish * * Licensed under MIT license. * Copyright (C) 2017 Karim Alibhai. */ import sock from '../socket' import debounce from 'debounce' - import getCurrentLocation from '../location' + import { getCurrentLocation } from '../location' ? ++ ++ + import { getMap } from '../map' - export default ['$scope', '$searchParams', ($scope, $searchParams) => { + export default ['$scope', ($scope) => { $scope.search = debounce(query => { if (!query) { $scope.hint = '' return $scope.$apply() } let { lat, lng } = getCurrentLocation() sock.emit('autocomplete', { query, lat, lng, - radius: $searchParams.radius + radius: getMap().radius() }) }, 500) $scope.prediction = () => { return $scope.hint && $scope.query ? $scope.query + $scope.hint.substr($scope.query.length) : '' } + $scope.complete = evt => { + if (evt.which === 39) { + $scope.query = $scope.prediction() + } + } + sock.on('autocomplete:results', result => { $scope.hint = result $scope.$apply() }) }]
13
0.351351
10
3
93946479351bf4f2d5a34d818be7bad577b72e94
lib/paypal_processor.rb
lib/paypal_processor.rb
require 'devise' module PaypalProcessor def self.is_verified?(paypal_email) return false unless paypal_email =~ /#{Devise::email_regexp}/ @api = PayPal::SDK::AdaptiveAccounts::API.new @get_verified_status = @api.build_get_verified_status({ :emailAddress => paypal_email, :matchCriteria => "NONE" }) # Make API call & get response @account_info = @api.get_verified_status(@get_verified_status) # Access Response if @account_info.success? return @account_info.accountStatus == PayPal::SDK::Core::API::IPN::VERIFIED else return false end end end
require 'devise' module PaypalProcessor def self.is_verified?(paypal_email) return false unless paypal_email =~ /#{Devise::email_regexp}/ @api = PayPal::SDK::AdaptiveAccounts::API.new @get_verified_status = @api.build_get_verified_status({ :emailAddress => paypal_email, :matchCriteria => "NONE" }) # Make API call & get response @account_info = @api.get_verified_status(@get_verified_status) # Access Response if @account_info.success? return @account_info.accountStatus == PayPal::SDK::Core::API::IPN::VERIFIED else return false end end def self.request_preapproval_url(monthly_amount, cancel_url, return_url, ipn_url, member_name, club_name) return "" if monthly_amount.blank? return "" if cancel_url.blank? return "" if return_url.blank? return "" if ipn_url.blank? return "" if member_name.blank? return "" if club_name.blank? @api = PayPal::SDK::AdaptivePayments::API.new # Build request object @preapproval = @api.build_preapproval({ :clientDetails => { :applicationId => Settings.general[:default_application_name], :customerId => member_name, :customerType => "Member", :partnerName => Settings.general[:default_partner_name] }, :memo => "Membership To: #{club_name}", :cancelUrl => cancel_url, :currencyCode => "USD", :maxAmountPerPayment => monthly_amount, :maxNumberOfPaymentsPerPeriod => 1, :paymentPeriod => "MONTHLY", :returnUrl => return_url, :requireInstantFundingSource => true, :ipnNotificationUrl => ipn_url, :startingDate => DateTime.now, :feesPayer => "PRIMARYRECEIVER", :displayMaxTotalAmount => true }) # Make API call & get response @preapproval_response = @api.preapproval(@preapproval) # Access Response if @preapproval_response.success? @api.preapproval_url(@preapproval_response) # Url to complete payment else "" end end end
Update the PaypalProcessor Lib for preapproval_url
Update the PaypalProcessor Lib for preapproval_url Update the PaypalProcessor lib to include a method to return the preapproval URL (or blank string in the case of an error).
Ruby
mit
jekhokie/IfSimply,jekhokie/IfSimply,jekhokie/IfSimply
ruby
## Code Before: require 'devise' module PaypalProcessor def self.is_verified?(paypal_email) return false unless paypal_email =~ /#{Devise::email_regexp}/ @api = PayPal::SDK::AdaptiveAccounts::API.new @get_verified_status = @api.build_get_verified_status({ :emailAddress => paypal_email, :matchCriteria => "NONE" }) # Make API call & get response @account_info = @api.get_verified_status(@get_verified_status) # Access Response if @account_info.success? return @account_info.accountStatus == PayPal::SDK::Core::API::IPN::VERIFIED else return false end end end ## Instruction: Update the PaypalProcessor Lib for preapproval_url Update the PaypalProcessor lib to include a method to return the preapproval URL (or blank string in the case of an error). ## Code After: require 'devise' module PaypalProcessor def self.is_verified?(paypal_email) return false unless paypal_email =~ /#{Devise::email_regexp}/ @api = PayPal::SDK::AdaptiveAccounts::API.new @get_verified_status = @api.build_get_verified_status({ :emailAddress => paypal_email, :matchCriteria => "NONE" }) # Make API call & get response @account_info = @api.get_verified_status(@get_verified_status) # Access Response if @account_info.success? return @account_info.accountStatus == PayPal::SDK::Core::API::IPN::VERIFIED else return false end end def self.request_preapproval_url(monthly_amount, cancel_url, return_url, ipn_url, member_name, club_name) return "" if monthly_amount.blank? return "" if cancel_url.blank? return "" if return_url.blank? return "" if ipn_url.blank? return "" if member_name.blank? return "" if club_name.blank? @api = PayPal::SDK::AdaptivePayments::API.new # Build request object @preapproval = @api.build_preapproval({ :clientDetails => { :applicationId => Settings.general[:default_application_name], :customerId => member_name, :customerType => "Member", :partnerName => Settings.general[:default_partner_name] }, :memo => "Membership To: #{club_name}", :cancelUrl => cancel_url, :currencyCode => "USD", :maxAmountPerPayment => monthly_amount, :maxNumberOfPaymentsPerPeriod => 1, :paymentPeriod => "MONTHLY", :returnUrl => return_url, :requireInstantFundingSource => true, :ipnNotificationUrl => ipn_url, :startingDate => DateTime.now, :feesPayer => "PRIMARYRECEIVER", :displayMaxTotalAmount => true }) # Make API call & get response @preapproval_response = @api.preapproval(@preapproval) # Access Response if @preapproval_response.success? @api.preapproval_url(@preapproval_response) # Url to complete payment else "" end end end
require 'devise' module PaypalProcessor def self.is_verified?(paypal_email) return false unless paypal_email =~ /#{Devise::email_regexp}/ @api = PayPal::SDK::AdaptiveAccounts::API.new @get_verified_status = @api.build_get_verified_status({ :emailAddress => paypal_email, :matchCriteria => "NONE" }) # Make API call & get response @account_info = @api.get_verified_status(@get_verified_status) # Access Response if @account_info.success? return @account_info.accountStatus == PayPal::SDK::Core::API::IPN::VERIFIED else return false end end + + def self.request_preapproval_url(monthly_amount, cancel_url, return_url, ipn_url, member_name, club_name) + return "" if monthly_amount.blank? + return "" if cancel_url.blank? + return "" if return_url.blank? + return "" if ipn_url.blank? + return "" if member_name.blank? + return "" if club_name.blank? + + @api = PayPal::SDK::AdaptivePayments::API.new + + # Build request object + @preapproval = @api.build_preapproval({ + :clientDetails => { + :applicationId => Settings.general[:default_application_name], + :customerId => member_name, + :customerType => "Member", + :partnerName => Settings.general[:default_partner_name] + }, + :memo => "Membership To: #{club_name}", + :cancelUrl => cancel_url, + :currencyCode => "USD", + :maxAmountPerPayment => monthly_amount, + :maxNumberOfPaymentsPerPeriod => 1, + :paymentPeriod => "MONTHLY", + :returnUrl => return_url, + :requireInstantFundingSource => true, + :ipnNotificationUrl => ipn_url, + :startingDate => DateTime.now, + :feesPayer => "PRIMARYRECEIVER", + :displayMaxTotalAmount => true }) + + # Make API call & get response + @preapproval_response = @api.preapproval(@preapproval) + + # Access Response + if @preapproval_response.success? + @api.preapproval_url(@preapproval_response) # Url to complete payment + else + "" + end + end end
42
2
42
0
1c8533b3eb232710831d995f0d0509c0ffef2861
test/models/message_test.rb
test/models/message_test.rb
require 'test_helper' class MessageTest < ActiveSupport::TestCase test 'should mailboxer messages model work' do sender = FactoryGirl.create(:user) receiver = FactoryGirl.create(:user) receipt = sender.send_message(receiver, 'body', 'subject') assert_equal receipt.valid?, true end end
require 'test_helper' class MessageTest < ActiveSupport::TestCase test 'mailboxer messages are sent' do sender = FactoryGirl.create(:user) receiver = FactoryGirl.create(:user) receipt = sender.send_message(receiver, 'body', 'subject') assert_equal receipt.valid?, true end end
Reword test to drop should style
Reword test to drop should style
Ruby
agpl-3.0
alabs/nolotiro.org,alabs/nolotiro.org,alabs/nolotiro.org,alabs/nolotiro.org
ruby
## Code Before: require 'test_helper' class MessageTest < ActiveSupport::TestCase test 'should mailboxer messages model work' do sender = FactoryGirl.create(:user) receiver = FactoryGirl.create(:user) receipt = sender.send_message(receiver, 'body', 'subject') assert_equal receipt.valid?, true end end ## Instruction: Reword test to drop should style ## Code After: require 'test_helper' class MessageTest < ActiveSupport::TestCase test 'mailboxer messages are sent' do sender = FactoryGirl.create(:user) receiver = FactoryGirl.create(:user) receipt = sender.send_message(receiver, 'body', 'subject') assert_equal receipt.valid?, true end end
require 'test_helper' class MessageTest < ActiveSupport::TestCase - test 'should mailboxer messages model work' do ? ------- ^^^ - ^^^^ + test 'mailboxer messages are sent' do ? ^^ ^^^^ sender = FactoryGirl.create(:user) receiver = FactoryGirl.create(:user) receipt = sender.send_message(receiver, 'body', 'subject') assert_equal receipt.valid?, true end end
2
0.2
1
1
36c23b9b4e6611f1b64d86eb9921ac134fbd0998
lib/dolphy.rb
lib/dolphy.rb
$LOAD_PATH.unshift(File.dirname(__FILE__)) require 'dolphy/core' class DolphyApp # This returns a DolphyApplication defined by what is passed in the block. # # An application could for instance be defined in this way # # DolphyApp.app do # DolphyApp.router do # get '/hello' do # haml :index, body: "Hello" # end # end # end.serve! # def self.app(&block) Dolphy::Core.new(&block) end def self.router(&block) yield end end
$LOAD_PATH.unshift(File.dirname(__FILE__)) require 'dolphy/core' class DolphyApp def self.app(&block) Dolphy::Core.new(&block) end def self.router(&block) yield end end
Remove app example from code.
Remove app example from code.
Ruby
mit
majjoha/dolphy
ruby
## Code Before: $LOAD_PATH.unshift(File.dirname(__FILE__)) require 'dolphy/core' class DolphyApp # This returns a DolphyApplication defined by what is passed in the block. # # An application could for instance be defined in this way # # DolphyApp.app do # DolphyApp.router do # get '/hello' do # haml :index, body: "Hello" # end # end # end.serve! # def self.app(&block) Dolphy::Core.new(&block) end def self.router(&block) yield end end ## Instruction: Remove app example from code. ## Code After: $LOAD_PATH.unshift(File.dirname(__FILE__)) require 'dolphy/core' class DolphyApp def self.app(&block) Dolphy::Core.new(&block) end def self.router(&block) yield end end
$LOAD_PATH.unshift(File.dirname(__FILE__)) require 'dolphy/core' class DolphyApp - # This returns a DolphyApplication defined by what is passed in the block. - # - # An application could for instance be defined in this way - # - # DolphyApp.app do - # DolphyApp.router do - # get '/hello' do - # haml :index, body: "Hello" - # end - # end - # end.serve! - # def self.app(&block) Dolphy::Core.new(&block) end def self.router(&block) yield end end
12
0.5
0
12
4bf01c350744e8cbf00750ec85d825f22e06dd29
linter.py
linter.py
from SublimeLinter.lint import Linter class Shellcheck(Linter): """Provides an interface to shellcheck.""" syntax = 'shell-unix-generic' cmd = 'shellcheck --format gcc -' regex = ( r'^.+?:(?P<line>\d+):(?P<col>\d+): ' r'(?:(?P<error>error)|(?P<warning>(warning|note))): ' r'(?P<message>.+)$' ) defaults = { '--exclude=,': '' } inline_overrides = 'exclude' comment_re = r'\s*#'
from SublimeLinter.lint import Linter class Shellcheck(Linter): """Provides an interface to shellcheck.""" syntax = ('shell-unix-generic', 'bash') cmd = 'shellcheck --format gcc -' regex = ( r'^.+?:(?P<line>\d+):(?P<col>\d+): ' r'(?:(?P<error>error)|(?P<warning>(warning|note))): ' r'(?P<message>.+)$' ) defaults = { '--exclude=,': '' } inline_overrides = 'exclude' comment_re = r'\s*#'
Handle new sublime syntax: bash
Handle new sublime syntax: bash
Python
mit
SublimeLinter/SublimeLinter-shellcheck
python
## Code Before: from SublimeLinter.lint import Linter class Shellcheck(Linter): """Provides an interface to shellcheck.""" syntax = 'shell-unix-generic' cmd = 'shellcheck --format gcc -' regex = ( r'^.+?:(?P<line>\d+):(?P<col>\d+): ' r'(?:(?P<error>error)|(?P<warning>(warning|note))): ' r'(?P<message>.+)$' ) defaults = { '--exclude=,': '' } inline_overrides = 'exclude' comment_re = r'\s*#' ## Instruction: Handle new sublime syntax: bash ## Code After: from SublimeLinter.lint import Linter class Shellcheck(Linter): """Provides an interface to shellcheck.""" syntax = ('shell-unix-generic', 'bash') cmd = 'shellcheck --format gcc -' regex = ( r'^.+?:(?P<line>\d+):(?P<col>\d+): ' r'(?:(?P<error>error)|(?P<warning>(warning|note))): ' r'(?P<message>.+)$' ) defaults = { '--exclude=,': '' } inline_overrides = 'exclude' comment_re = r'\s*#'
from SublimeLinter.lint import Linter class Shellcheck(Linter): """Provides an interface to shellcheck.""" - syntax = 'shell-unix-generic' + syntax = ('shell-unix-generic', 'bash') ? + +++++++++ cmd = 'shellcheck --format gcc -' regex = ( r'^.+?:(?P<line>\d+):(?P<col>\d+): ' r'(?:(?P<error>error)|(?P<warning>(warning|note))): ' r'(?P<message>.+)$' ) defaults = { '--exclude=,': '' } inline_overrides = 'exclude' comment_re = r'\s*#'
2
0.1
1
1
ffb5e7bc0e7098c598539390de16baf51bbf6f6b
nubis/terraform/dns/outputs.tf
nubis/terraform/dns/outputs.tf
output "application_zone_id" { value = "${aws_route53_zone.master_zone.zone_id}" } output "route53_delegation_set" { value = "${var.route53_delegation_set}" } output "nameservers" { value = "${join(",",aws_route53_zone.master_zone.name_servers)}" }
output "application_zone_id" { value = "${aws_route53_zone.master_zone.zone_id}" } output "application_route53_delegation_set" { value = "${var.route53_delegation_set}" } output "application_nameservers" { value = "${join(",",aws_route53_zone.master_zone.name_servers)}" }
Rename remaining output as well
Rename remaining output as well
HCL
mpl-2.0
mozilla-it/haul,gozer/haul,gozer/haul,mozilla-it/haul,mozilla-it/haul,gozer/haul
hcl
## Code Before: output "application_zone_id" { value = "${aws_route53_zone.master_zone.zone_id}" } output "route53_delegation_set" { value = "${var.route53_delegation_set}" } output "nameservers" { value = "${join(",",aws_route53_zone.master_zone.name_servers)}" } ## Instruction: Rename remaining output as well ## Code After: output "application_zone_id" { value = "${aws_route53_zone.master_zone.zone_id}" } output "application_route53_delegation_set" { value = "${var.route53_delegation_set}" } output "application_nameservers" { value = "${join(",",aws_route53_zone.master_zone.name_servers)}" }
output "application_zone_id" { value = "${aws_route53_zone.master_zone.zone_id}" } - output "route53_delegation_set" { + output "application_route53_delegation_set" { ? ++++++++++++ value = "${var.route53_delegation_set}" } - output "nameservers" { + output "application_nameservers" { ? ++++++++++++ value = "${join(",",aws_route53_zone.master_zone.name_servers)}" }
4
0.363636
2
2
40415ce3605b611fb3f9d94a721e04a1505dcc55
README.md
README.md
Spinning ======== [![Screenshot][]][demo] [See it in action][demo] Running locally --------------- 1. Make sure Gesso is installed ```bash $ npm install -g gesso ``` 2. Install dependencies ```bash $ npm install ``` 3. Run the server ```bash $ gesso serve ``` Now visit [http://localhost:65330](http://localhost:65330/). Contributing ------------ 1. Check the open issues or open a new issue to start a discussion around your feature idea or the bug you found 2. Fork the repository, make your changes, and add yourself to [Authors.md][] 3. Send a pull request [screenshot]: screenshot.png [demo]: http://gameblog.gessojs.com/press-start/
Spinning ======== [![Screenshot][]][demo] [See it in action][demo] Running locally --------------- 1. Make sure [Gesso][] is installed ```bash $ npm install -g gesso ``` 2. Install dependencies ```bash $ npm install ``` 3. Run the server ```bash $ gesso serve ``` Now visit [http://localhost:65330](http://localhost:65330/). [screenshot]: screenshot.png [demo]: http://gameblog.gessojs.com/press-start/ [gesso]: http://github.com/gessojs/gessojs
Remove unused Contributing section and add Gesso.
Remove unused Contributing section and add Gesso.
Markdown
mit
thegameblog/spinning
markdown
## Code Before: Spinning ======== [![Screenshot][]][demo] [See it in action][demo] Running locally --------------- 1. Make sure Gesso is installed ```bash $ npm install -g gesso ``` 2. Install dependencies ```bash $ npm install ``` 3. Run the server ```bash $ gesso serve ``` Now visit [http://localhost:65330](http://localhost:65330/). Contributing ------------ 1. Check the open issues or open a new issue to start a discussion around your feature idea or the bug you found 2. Fork the repository, make your changes, and add yourself to [Authors.md][] 3. Send a pull request [screenshot]: screenshot.png [demo]: http://gameblog.gessojs.com/press-start/ ## Instruction: Remove unused Contributing section and add Gesso. ## Code After: Spinning ======== [![Screenshot][]][demo] [See it in action][demo] Running locally --------------- 1. Make sure [Gesso][] is installed ```bash $ npm install -g gesso ``` 2. Install dependencies ```bash $ npm install ``` 3. Run the server ```bash $ gesso serve ``` Now visit [http://localhost:65330](http://localhost:65330/). [screenshot]: screenshot.png [demo]: http://gameblog.gessojs.com/press-start/ [gesso]: http://github.com/gessojs/gessojs
Spinning ======== [![Screenshot][]][demo] [See it in action][demo] Running locally --------------- - 1. Make sure Gesso is installed + 1. Make sure [Gesso][] is installed ? + +++ ```bash $ npm install -g gesso ``` 2. Install dependencies ```bash $ npm install ``` 3. Run the server ```bash $ gesso serve ``` Now visit [http://localhost:65330](http://localhost:65330/). - Contributing - ------------ - - 1. Check the open issues or open a new issue to start a discussion around - your feature idea or the bug you found - 2. Fork the repository, make your changes, and add yourself to [Authors.md][] - 3. Send a pull request - - [screenshot]: screenshot.png [demo]: http://gameblog.gessojs.com/press-start/ + [gesso]: http://github.com/gessojs/gessojs
12
0.27907
2
10
2e1b91ed8e451a22f09848a4158e90e364fcd977
pkgs/development/python-modules/goobook/default.nix
pkgs/development/python-modules/goobook/default.nix
{ stdenv, buildPythonPackage, fetchPypi, isPy3k , google_api_python_client, simplejson, oauth2client }: buildPythonPackage rec { pname = "goobook"; version = "3.4"; disabled = !isPy3k; src = fetchPypi { inherit pname version; sha256 = "089a95s6g9izsy1fzpz48p6pz0wpngcbbrvsillm1n53492gfhjg"; }; propagatedBuildInputs = [ google_api_python_client simplejson oauth2client ]; meta = with stdenv.lib; { description = "Search your google contacts from the command-line or mutt"; homepage = https://pypi.python.org/pypi/goobook; license = licenses.gpl3; maintainers = with maintainers; [ primeos ]; platforms = platforms.unix; }; }
{ stdenv, buildPythonPackage, fetchPypi, isPy3k , google_api_python_client, simplejson, oauth2client, setuptools }: buildPythonPackage rec { pname = "goobook"; version = "3.4"; disabled = !isPy3k; src = fetchPypi { inherit pname version; sha256 = "089a95s6g9izsy1fzpz48p6pz0wpngcbbrvsillm1n53492gfhjg"; }; propagatedBuildInputs = [ google_api_python_client simplejson oauth2client setuptools ]; meta = with stdenv.lib; { description = "Search your google contacts from the command-line or mutt"; homepage = https://pypi.python.org/pypi/goobook; license = licenses.gpl3; maintainers = with maintainers; [ primeos ]; platforms = platforms.unix; }; }
Add the missing setuptools dependency
python37Packages.goobook: Add the missing setuptools dependency Querying resulted in the following error: $ goobook query test Traceback (most recent call last): File "/nix/store/y68w4wwx65yfck84vjsdvfwnii5594lc-python3.7-goobook-3.4/bin/.goobook-wrapped", line 7, in <module> from goobook.application import main File "/nix/store/y68w4wwx65yfck84vjsdvfwnii5594lc-python3.7-goobook-3.4/lib/python3.7/site-packages/goobook/application.py", line 18, in <module> import pkg_resources ModuleNotFoundError: No module named 'pkg_resources'
Nix
mit
NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs
nix
## Code Before: { stdenv, buildPythonPackage, fetchPypi, isPy3k , google_api_python_client, simplejson, oauth2client }: buildPythonPackage rec { pname = "goobook"; version = "3.4"; disabled = !isPy3k; src = fetchPypi { inherit pname version; sha256 = "089a95s6g9izsy1fzpz48p6pz0wpngcbbrvsillm1n53492gfhjg"; }; propagatedBuildInputs = [ google_api_python_client simplejson oauth2client ]; meta = with stdenv.lib; { description = "Search your google contacts from the command-line or mutt"; homepage = https://pypi.python.org/pypi/goobook; license = licenses.gpl3; maintainers = with maintainers; [ primeos ]; platforms = platforms.unix; }; } ## Instruction: python37Packages.goobook: Add the missing setuptools dependency Querying resulted in the following error: $ goobook query test Traceback (most recent call last): File "/nix/store/y68w4wwx65yfck84vjsdvfwnii5594lc-python3.7-goobook-3.4/bin/.goobook-wrapped", line 7, in <module> from goobook.application import main File "/nix/store/y68w4wwx65yfck84vjsdvfwnii5594lc-python3.7-goobook-3.4/lib/python3.7/site-packages/goobook/application.py", line 18, in <module> import pkg_resources ModuleNotFoundError: No module named 'pkg_resources' ## Code After: { stdenv, buildPythonPackage, fetchPypi, isPy3k , google_api_python_client, simplejson, oauth2client, setuptools }: buildPythonPackage rec { pname = "goobook"; version = "3.4"; disabled = !isPy3k; src = fetchPypi { inherit pname version; sha256 = "089a95s6g9izsy1fzpz48p6pz0wpngcbbrvsillm1n53492gfhjg"; }; propagatedBuildInputs = [ google_api_python_client simplejson oauth2client setuptools ]; meta = with stdenv.lib; { description = "Search your google contacts from the command-line or mutt"; homepage = https://pypi.python.org/pypi/goobook; license = licenses.gpl3; maintainers = with maintainers; [ primeos ]; platforms = platforms.unix; }; }
{ stdenv, buildPythonPackage, fetchPypi, isPy3k - , google_api_python_client, simplejson, oauth2client + , google_api_python_client, simplejson, oauth2client, setuptools ? ++++++++++++ }: buildPythonPackage rec { pname = "goobook"; version = "3.4"; disabled = !isPy3k; src = fetchPypi { inherit pname version; sha256 = "089a95s6g9izsy1fzpz48p6pz0wpngcbbrvsillm1n53492gfhjg"; }; - propagatedBuildInputs = [ google_api_python_client simplejson oauth2client ]; + propagatedBuildInputs = [ + google_api_python_client simplejson oauth2client setuptools + ]; meta = with stdenv.lib; { description = "Search your google contacts from the command-line or mutt"; homepage = https://pypi.python.org/pypi/goobook; license = licenses.gpl3; maintainers = with maintainers; [ primeos ]; platforms = platforms.unix; }; }
6
0.25
4
2
91c9276ef3020452c1607e26c423b7b2085d2716
modules/figurate-common/src/main/groovy/org/figurate/DelegateInvocationHandler.groovy
modules/figurate-common/src/main/groovy/org/figurate/DelegateInvocationHandler.groovy
package org.figurate import java.lang.reflect.InvocationHandler import java.lang.reflect.Method class DelegateInvocationHandler implements InvocationHandler { private final DelegateSelector<?> selector public DelegateInvocationHandler(DelegateSelector<?> selector) { this.selector = selector } /** * {@inheritDoc} */ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { return method.invoke(selector.delegate, args) } }
package org.figurate import groovy.transform.CompileStatic import java.lang.reflect.InvocationHandler import java.lang.reflect.Method @CompileStatic class DelegateInvocationHandler implements InvocationHandler { private final DelegateSelector<?> selector public DelegateInvocationHandler(DelegateSelector<?> selector) { this.selector = selector } /** * {@inheritDoc} */ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { return method.invoke(selector.delegate, args) } }
Use CompileStatic annotation for type checking
Use CompileStatic annotation for type checking
Groovy
apache-2.0
figurate/figurate-core
groovy
## Code Before: package org.figurate import java.lang.reflect.InvocationHandler import java.lang.reflect.Method class DelegateInvocationHandler implements InvocationHandler { private final DelegateSelector<?> selector public DelegateInvocationHandler(DelegateSelector<?> selector) { this.selector = selector } /** * {@inheritDoc} */ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { return method.invoke(selector.delegate, args) } } ## Instruction: Use CompileStatic annotation for type checking ## Code After: package org.figurate import groovy.transform.CompileStatic import java.lang.reflect.InvocationHandler import java.lang.reflect.Method @CompileStatic class DelegateInvocationHandler implements InvocationHandler { private final DelegateSelector<?> selector public DelegateInvocationHandler(DelegateSelector<?> selector) { this.selector = selector } /** * {@inheritDoc} */ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { return method.invoke(selector.delegate, args) } }
package org.figurate + + import groovy.transform.CompileStatic import java.lang.reflect.InvocationHandler import java.lang.reflect.Method + @CompileStatic class DelegateInvocationHandler implements InvocationHandler { private final DelegateSelector<?> selector public DelegateInvocationHandler(DelegateSelector<?> selector) { this.selector = selector } /** * {@inheritDoc} */ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { return method.invoke(selector.delegate, args) } }
3
0.142857
3
0
12ff8aed729f39d6b55c49a6c59b305049ae13bb
app/views/shared/_homepage_intro.html.erb
app/views/shared/_homepage_intro.html.erb
<div class="homepage-intro"> <h1><%= heading %></h1> <ul class="list--benefits"> <%= summary %> </ul> <div id="introduction-text"> <%= introduction %> </div> </div>
<div> <h1><%= heading %></h1> <ul class="list--benefits"> <%= summary %> </ul> <div id="introduction-text"> <%= introduction %> </div> </div>
Remove homepage intro class from view.
Remove homepage intro class from view.
HTML+ERB
mit
moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend
html+erb
## Code Before: <div class="homepage-intro"> <h1><%= heading %></h1> <ul class="list--benefits"> <%= summary %> </ul> <div id="introduction-text"> <%= introduction %> </div> </div> ## Instruction: Remove homepage intro class from view. ## Code After: <div> <h1><%= heading %></h1> <ul class="list--benefits"> <%= summary %> </ul> <div id="introduction-text"> <%= introduction %> </div> </div>
- <div class="homepage-intro"> + <div> <h1><%= heading %></h1> <ul class="list--benefits"> <%= summary %> </ul> <div id="introduction-text"> <%= introduction %> </div> </div>
2
0.222222
1
1
578141321d77109afde462e98fee439fbe13048d
.travis.yml
.travis.yml
language: java # Seems Travis CI no longer supports openjdk6 or oraclejdk7 # https://github.com/travis-ci/travis-ci/issues/7884#issuecomment-308451879 dist: trusty jdk: - openjdk7 - oraclejdk8 # - oraclejdk9 install: mvn install -DskipTests=true -Dgpg.skip=true script: - mvn clean verify -Dgpg.skip=true after_success: - mvn -Pcoverage clean cobertura:cobertura org.eluder.coveralls:coveralls-maven-plugin:report
language: java # Travis provides different sets of JDKs for different Ubuntu distributions: # # https://docs.travis-ci.com/user/languages/java/#testing-against-multiple-jdks matrix: include: - os: linux dist: precise jdk: openjdk6 - os: linux dist: precise jdk: oraclejdk7 - os: linux dist: trusty jdk: openjdk7 - os: linux dist: trusty jdk: oraclejdk8 - os: linux dist: trusty jdk: oraclejdk9 - os: linux dist: bionic jdk: openjdk10 - os: linux dist: bionic jdk: openjdk11 install: mvn install -DskipTests=true -Dgpg.skip=true script: - mvn clean verify -Dgpg.skip=true after_success: - mvn -Pcoverage clean cobertura:cobertura org.eluder.coveralls:coveralls-maven-plugin:report
Extend build matrix with more JDK versions
Extend build matrix with more JDK versions
YAML
apache-2.0
drewnoakes/metadata-extractor,rcketscientist/metadata-extractor
yaml
## Code Before: language: java # Seems Travis CI no longer supports openjdk6 or oraclejdk7 # https://github.com/travis-ci/travis-ci/issues/7884#issuecomment-308451879 dist: trusty jdk: - openjdk7 - oraclejdk8 # - oraclejdk9 install: mvn install -DskipTests=true -Dgpg.skip=true script: - mvn clean verify -Dgpg.skip=true after_success: - mvn -Pcoverage clean cobertura:cobertura org.eluder.coveralls:coveralls-maven-plugin:report ## Instruction: Extend build matrix with more JDK versions ## Code After: language: java # Travis provides different sets of JDKs for different Ubuntu distributions: # # https://docs.travis-ci.com/user/languages/java/#testing-against-multiple-jdks matrix: include: - os: linux dist: precise jdk: openjdk6 - os: linux dist: precise jdk: oraclejdk7 - os: linux dist: trusty jdk: openjdk7 - os: linux dist: trusty jdk: oraclejdk8 - os: linux dist: trusty jdk: oraclejdk9 - os: linux dist: bionic jdk: openjdk10 - os: linux dist: bionic jdk: openjdk11 install: mvn install -DskipTests=true -Dgpg.skip=true script: - mvn clean verify -Dgpg.skip=true after_success: - mvn -Pcoverage clean cobertura:cobertura org.eluder.coveralls:coveralls-maven-plugin:report
+ language: java - # Seems Travis CI no longer supports openjdk6 or oraclejdk7 - # https://github.com/travis-ci/travis-ci/issues/7884#issuecomment-308451879 + # Travis provides different sets of JDKs for different Ubuntu distributions: + # + # https://docs.travis-ci.com/user/languages/java/#testing-against-multiple-jdks + matrix: + include: + - os: linux + dist: precise + jdk: openjdk6 + - os: linux + dist: precise + jdk: oraclejdk7 + - os: linux - dist: trusty + dist: trusty ? ++++++ - - jdk: - - openjdk7 - - oraclejdk8 - # - oraclejdk9 + jdk: openjdk7 + - os: linux + dist: trusty + jdk: oraclejdk8 + - os: linux + dist: trusty + jdk: oraclejdk9 + - os: linux + dist: bionic + jdk: openjdk10 + - os: linux + dist: bionic + jdk: openjdk11 install: mvn install -DskipTests=true -Dgpg.skip=true script: - mvn clean verify -Dgpg.skip=true after_success: - mvn -Pcoverage clean cobertura:cobertura org.eluder.coveralls:coveralls-maven-plugin:report
35
1.842105
27
8
56f75487736a8b2f006a32993b0ab814aea7225d
README.md
README.md
hash.js ====== Chat bot used in the "Garry's Mod Coders" Steam group chat. (http://steamcommunity.com/groups/gmodcoders)
hash.js ====== Chat bot used in the "Garry's Mod Lua" Steam group chat. (http://steamcommunity.com/groups/glua)
Make readme link to the new group
Make readme link to the new group
Markdown
cc0-1.0
SwadicalRag/hash.js,meepdarknessmeep/hash.js
markdown
## Code Before: hash.js ====== Chat bot used in the "Garry's Mod Coders" Steam group chat. (http://steamcommunity.com/groups/gmodcoders) ## Instruction: Make readme link to the new group ## Code After: hash.js ====== Chat bot used in the "Garry's Mod Lua" Steam group chat. (http://steamcommunity.com/groups/glua)
hash.js ====== - Chat bot used in the "Garry's Mod Coders" Steam group chat. (http://steamcommunity.com/groups/gmodcoders) ? ^^^^^^ ^^^^^^^^^ + Chat bot used in the "Garry's Mod Lua" Steam group chat. (http://steamcommunity.com/groups/glua) ? ^^^ ^^^
2
0.666667
1
1
14f2fcf2b09ea0a2338009340499d66b0413ce36
source/blog/2015-11-20-unboxed-roundup-our-links-for-w-c-16th-november-2015.html.markdown
source/blog/2015-11-20-unboxed-roundup-our-links-for-w-c-16th-november-2015.html.markdown
--- weekly_roundup: true title: 'Unboxed Roundup: Our links for w/c 16th November 2015' date: '2015-11-20 14:30:00 UTC' author: 'Murray Steele' tags: # (Delete as appropriate) - Culture --- ## A conversation about HTTP2 - [Patrick V](http://www.unboxedconsulting.com/people/patrick-vine) http://www.se-radio.net/2015/07/episode-232-mark-nottingham-on-http2/ An interesting podcast conversation with one of the people involved in making HTTP2 happen. They talk through some of the history and some of the technical details. If you know very little about http2 and want to know more, this is a great listen to understand the basics of the whys, the whats and possibly a little about what it might mean to you. ## Track of the Week - []()
--- weekly_roundup: true title: 'Unboxed Roundup: Our links for w/c 16th November 2015' date: '2015-11-20 14:30:00 UTC' author: 'Murray Steele' tags: # (Delete as appropriate) - Culture --- ## A conversation about HTTP2 - [Patrick V](http://www.unboxedconsulting.com/people/patrick-vine) http://www.se-radio.net/2015/07/episode-232-mark-nottingham-on-http2/ An interesting podcast conversation with one of the people involved in making HTTP2 happen. They talk through some of the history and some of the technical details. If you know very little about http2 and want to know more, this is a great listen to understand the basics of the whys, the whats and possibly a little about what it might mean to you. ## Track of the Week - [Steve L](https://www.unboxedconsulting.com/people/steve-lennon) <iframe width="420" height="315" src="https://www.youtube.com/embed/PvXHYHyCuM8" frameborder="0" allowfullscreen></iframe> ["How 'Bout I Love You More" by Colin MacIntyre aka Mull Historical Society](https://www.youtube.com/watch?v=PvXHYHyCuM8) Reminds me of my first weekend at T in the Park in Scotland when I was working in Scotland back when Richard and I first met.
Add Track of the Week
Add Track of the Week
Markdown
mit
unboxed/ubxd_web_refresh,unboxed/unboxed.co,unboxed/unboxed.co,unboxed/unboxed.co,unboxed/ubxd_web_refresh,unboxed/ubxd_web_refresh
markdown
## Code Before: --- weekly_roundup: true title: 'Unboxed Roundup: Our links for w/c 16th November 2015' date: '2015-11-20 14:30:00 UTC' author: 'Murray Steele' tags: # (Delete as appropriate) - Culture --- ## A conversation about HTTP2 - [Patrick V](http://www.unboxedconsulting.com/people/patrick-vine) http://www.se-radio.net/2015/07/episode-232-mark-nottingham-on-http2/ An interesting podcast conversation with one of the people involved in making HTTP2 happen. They talk through some of the history and some of the technical details. If you know very little about http2 and want to know more, this is a great listen to understand the basics of the whys, the whats and possibly a little about what it might mean to you. ## Track of the Week - []() ## Instruction: Add Track of the Week ## Code After: --- weekly_roundup: true title: 'Unboxed Roundup: Our links for w/c 16th November 2015' date: '2015-11-20 14:30:00 UTC' author: 'Murray Steele' tags: # (Delete as appropriate) - Culture --- ## A conversation about HTTP2 - [Patrick V](http://www.unboxedconsulting.com/people/patrick-vine) http://www.se-radio.net/2015/07/episode-232-mark-nottingham-on-http2/ An interesting podcast conversation with one of the people involved in making HTTP2 happen. They talk through some of the history and some of the technical details. If you know very little about http2 and want to know more, this is a great listen to understand the basics of the whys, the whats and possibly a little about what it might mean to you. ## Track of the Week - [Steve L](https://www.unboxedconsulting.com/people/steve-lennon) <iframe width="420" height="315" src="https://www.youtube.com/embed/PvXHYHyCuM8" frameborder="0" allowfullscreen></iframe> ["How 'Bout I Love You More" by Colin MacIntyre aka Mull Historical Society](https://www.youtube.com/watch?v=PvXHYHyCuM8) Reminds me of my first weekend at T in the Park in Scotland when I was working in Scotland back when Richard and I first met.
--- weekly_roundup: true title: 'Unboxed Roundup: Our links for w/c 16th November 2015' date: '2015-11-20 14:30:00 UTC' author: 'Murray Steele' tags: # (Delete as appropriate) - Culture --- ## A conversation about HTTP2 - [Patrick V](http://www.unboxedconsulting.com/people/patrick-vine) http://www.se-radio.net/2015/07/episode-232-mark-nottingham-on-http2/ An interesting podcast conversation with one of the people involved in making HTTP2 happen. They talk through some of the history and some of the technical details. If you know very little about http2 and want to know more, this is a great listen to understand the basics of the whys, the whats and possibly a little about what it might mean to you. - ## Track of the Week - []() + ## Track of the Week - [Steve L](https://www.unboxedconsulting.com/people/steve-lennon) + <iframe width="420" height="315" src="https://www.youtube.com/embed/PvXHYHyCuM8" frameborder="0" allowfullscreen></iframe> + ["How 'Bout I Love You More" by Colin MacIntyre aka Mull Historical Society](https://www.youtube.com/watch?v=PvXHYHyCuM8) + + Reminds me of my first weekend at T in the Park in Scotland when I was working in Scotland back when Richard and I first met. +
7
0.388889
6
1
d1b4b921ec9dc8bccb1e9b9fe1efa79a04dc9c48
data/en/deserialize.json
data/en/deserialize.json
{ "name":"deserialize", "type":"function", "syntax":"deserialize( String StringToBeDeserialized, String type, boolean useCustomSerializer );", "returns":"string", "related":[], "description":"Deserializes a string.", "params": [ {"name":"StringToBeDeserialized","description":"A string that needs to be deserialized.","required":true,"default":"","type":"","values":[]}, {"name":"type","description":"String. The type of the data to be deserialized. ColdFusion by default supports XML and JSON formats. You can also implement support for other types in the CustomSerializer CFC.","required":true,"default":"","type":"","values":[]}, {"name":"useCustomSerializer","description":"Boolean. Whether to use the custom serializer or not. The default value is true. The custom serializer will be always used for deserialization. If false, the XML/JSON deserialization will be done using the default ColdFusion behavior. If any other type is passed with useCustomSerializer as false, then TypeNotSupportedException will be thrown.","required":true,"default":"","type":"","values":[]} ], "engines": { "coldfusion": {"minimum_version":"11", "notes":"", "docs":"https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-c-d/deserialize.html"} }, "links": [ ], "examples": [ ] }
{ "name":"deserialize", "type":"function", "syntax":"deserialize( StringToBeDeserialized, type, useCustomSerializer );", "returns":"string", "related":[], "description":"Deserializes a string.", "params": [ {"name":"StringToBeDeserialized","description":"A string that needs to be deserialized.","required":true,"default":"","type":"string","values":[]}, {"name":"type","description":"The type of the data to be deserialized. ColdFusion by default supports XML and JSON formats. You can also implement support for other types in the CustomSerializer CFC.","required":true,"default":"","type":"string","values":[]}, {"name":"useCustomSerializer","description":"Whether to use the custom serializer or not. The custom serializer will be always used for deserialization.\nIf false, the XML/JSON deserialization will be done using the default ColdFusion behavior.\nIf any other type is passed with useCustomSerializer as false, then TypeNotSupportedException will be thrown.","required":true,"default":"true","type":"boolean","values":[]} ], "engines": { "coldfusion": {"minimum_version":"11", "notes":"", "docs":"https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-c-d/deserialize.html"} }, "links": [ ], "examples": [ ] }
Move information from inside strings to their keys
Move information from inside strings to their keys
JSON
mit
mjhagen/cfdocs,mjhagen/cfdocs
json
## Code Before: { "name":"deserialize", "type":"function", "syntax":"deserialize( String StringToBeDeserialized, String type, boolean useCustomSerializer );", "returns":"string", "related":[], "description":"Deserializes a string.", "params": [ {"name":"StringToBeDeserialized","description":"A string that needs to be deserialized.","required":true,"default":"","type":"","values":[]}, {"name":"type","description":"String. The type of the data to be deserialized. ColdFusion by default supports XML and JSON formats. You can also implement support for other types in the CustomSerializer CFC.","required":true,"default":"","type":"","values":[]}, {"name":"useCustomSerializer","description":"Boolean. Whether to use the custom serializer or not. The default value is true. The custom serializer will be always used for deserialization. If false, the XML/JSON deserialization will be done using the default ColdFusion behavior. If any other type is passed with useCustomSerializer as false, then TypeNotSupportedException will be thrown.","required":true,"default":"","type":"","values":[]} ], "engines": { "coldfusion": {"minimum_version":"11", "notes":"", "docs":"https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-c-d/deserialize.html"} }, "links": [ ], "examples": [ ] } ## Instruction: Move information from inside strings to their keys ## Code After: { "name":"deserialize", "type":"function", "syntax":"deserialize( StringToBeDeserialized, type, useCustomSerializer );", "returns":"string", "related":[], "description":"Deserializes a string.", "params": [ {"name":"StringToBeDeserialized","description":"A string that needs to be deserialized.","required":true,"default":"","type":"string","values":[]}, {"name":"type","description":"The type of the data to be deserialized. ColdFusion by default supports XML and JSON formats. You can also implement support for other types in the CustomSerializer CFC.","required":true,"default":"","type":"string","values":[]}, {"name":"useCustomSerializer","description":"Whether to use the custom serializer or not. The custom serializer will be always used for deserialization.\nIf false, the XML/JSON deserialization will be done using the default ColdFusion behavior.\nIf any other type is passed with useCustomSerializer as false, then TypeNotSupportedException will be thrown.","required":true,"default":"true","type":"boolean","values":[]} ], "engines": { "coldfusion": {"minimum_version":"11", "notes":"", "docs":"https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-c-d/deserialize.html"} }, "links": [ ], "examples": [ ] }
{ "name":"deserialize", "type":"function", - "syntax":"deserialize( String StringToBeDeserialized, String type, boolean useCustomSerializer );", ? ------- ------- -------- + "syntax":"deserialize( StringToBeDeserialized, type, useCustomSerializer );", "returns":"string", "related":[], "description":"Deserializes a string.", "params": [ - {"name":"StringToBeDeserialized","description":"A string that needs to be deserialized.","required":true,"default":"","type":"","values":[]}, + {"name":"StringToBeDeserialized","description":"A string that needs to be deserialized.","required":true,"default":"","type":"string","values":[]}, ? ++++++ - {"name":"type","description":"String. The type of the data to be deserialized. ColdFusion by default supports XML and JSON formats. You can also implement support for other types in the CustomSerializer CFC.","required":true,"default":"","type":"","values":[]}, ? -------- + {"name":"type","description":"The type of the data to be deserialized. ColdFusion by default supports XML and JSON formats. You can also implement support for other types in the CustomSerializer CFC.","required":true,"default":"","type":"string","values":[]}, ? ++++++ - {"name":"useCustomSerializer","description":"Boolean. Whether to use the custom serializer or not. The default value is true. The custom serializer will be always used for deserialization. If false, the XML/JSON deserialization will be done using the default ColdFusion behavior. If any other type is passed with useCustomSerializer as false, then TypeNotSupportedException will be thrown.","required":true,"default":"","type":"","values":[]} + {"name":"useCustomSerializer","description":"Whether to use the custom serializer or not. The custom serializer will be always used for deserialization.\nIf false, the XML/JSON deserialization will be done using the default ColdFusion behavior.\nIf any other type is passed with useCustomSerializer as false, then TypeNotSupportedException will be thrown.","required":true,"default":"true","type":"boolean","values":[]} ], "engines": { "coldfusion": {"minimum_version":"11", "notes":"", "docs":"https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-functions/functions-c-d/deserialize.html"} }, "links": [ ], "examples": [ ] }
8
0.347826
4
4
3806710d5653918feaa3946b774b668f61654254
.travis.yml
.travis.yml
language: python python: - "2.7" - "3.4" - "3.5" - "3.6" - "3.7" - "3.8" - "3.9" - "3.9-dev" # 3.6 development branch # command to install dependencies install: - pip install pycodestyle # command to run tests script: - pycodestyle HujiBot/*.py - pycodestyle Rezabot/*.py - pycodestyle webcite.py - pycodestyle categorize.py
language: python python: - "3.4" - "3.5" - "3.6" - "3.7" - "3.8" - "3.9" - "3.9-dev" # 3.6 development branch # command to install dependencies install: - pip install flake8 # command to run tests script: - pycodestyle HujiBot/*.py - pycodestyle Rezabot/*.py - pycodestyle webcite.py - python -m flake8 categorize.py
Drop python 2, start using flake8
Drop python 2, start using flake8
YAML
mit
PersianWikipedia/fawikibot,PersianWikipedia/fawikibot
yaml
## Code Before: language: python python: - "2.7" - "3.4" - "3.5" - "3.6" - "3.7" - "3.8" - "3.9" - "3.9-dev" # 3.6 development branch # command to install dependencies install: - pip install pycodestyle # command to run tests script: - pycodestyle HujiBot/*.py - pycodestyle Rezabot/*.py - pycodestyle webcite.py - pycodestyle categorize.py ## Instruction: Drop python 2, start using flake8 ## Code After: language: python python: - "3.4" - "3.5" - "3.6" - "3.7" - "3.8" - "3.9" - "3.9-dev" # 3.6 development branch # command to install dependencies install: - pip install flake8 # command to run tests script: - pycodestyle HujiBot/*.py - pycodestyle Rezabot/*.py - pycodestyle webcite.py - python -m flake8 categorize.py
language: python python: - - "2.7" - "3.4" - "3.5" - "3.6" - "3.7" - "3.8" - "3.9" - "3.9-dev" # 3.6 development branch # command to install dependencies install: - - pip install pycodestyle + - pip install flake8 # command to run tests script: - pycodestyle HujiBot/*.py - pycodestyle Rezabot/*.py - pycodestyle webcite.py - - pycodestyle categorize.py + - python -m flake8 categorize.py
5
0.263158
2
3
234dbd768f136a560264594a480e0c06384a878a
api-docs/uceem_api.rb
api-docs/uceem_api.rb
require 'rubygems' require 'sinatra' require 'glorify' require 'sass' require 'compass' configure do Compass.configuration do |config| config.project_path = File.dirname(__FILE__) config.sass_dir = 'sass' end set :scss, Compass.sass_engine_options end set :erb, format: :html5 set :markdown, layout_engine: :erb, layout: :layout Tilt.prefer(Sinatra::Glorify::Template) get '/' do markdown(:introduction) end get '/introduction' do markdown(:introduction) end get '/authentication' do markdown(:authentication) end get '/accounts' do markdown(:accounts) end get '/users' do markdown(:users) end get '/routers' do markdown(:routers) end get '/clients' do markdown(:clients) end get '/activities' do markdown(:activities) end
require 'rubygems' require 'sinatra' require 'glorify' require 'sass' require 'compass' configure do Compass.configuration do |config| config.project_path = File.dirname(__FILE__) config.sass_dir = 'sass' end set :scss, Compass.sass_engine_options end set :erb, format: :html5 set :markdown, layout_engine: :erb, layout: :layout Tilt.prefer(Sinatra::Glorify::Template) get '/' do markdown(:introduction) end get '/introduction' do markdown(:introduction) end get '/authentication' do markdown(:authentication) end get '/accounts' do markdown(:accounts) end get '/users' do markdown(:users) end get '/routers' do markdown(:routers) end get '/clients' do markdown(:clients) end get '/activities' do markdown(:activities) end get '/all.css' do content_type 'text/css', charset: 'utf-8' scss(:'../public/scss/all') end
Create route for scss assets.
Create route for scss assets.
Ruby
mit
uceem/uceem-ruby,uceem/uceem-ruby
ruby
## Code Before: require 'rubygems' require 'sinatra' require 'glorify' require 'sass' require 'compass' configure do Compass.configuration do |config| config.project_path = File.dirname(__FILE__) config.sass_dir = 'sass' end set :scss, Compass.sass_engine_options end set :erb, format: :html5 set :markdown, layout_engine: :erb, layout: :layout Tilt.prefer(Sinatra::Glorify::Template) get '/' do markdown(:introduction) end get '/introduction' do markdown(:introduction) end get '/authentication' do markdown(:authentication) end get '/accounts' do markdown(:accounts) end get '/users' do markdown(:users) end get '/routers' do markdown(:routers) end get '/clients' do markdown(:clients) end get '/activities' do markdown(:activities) end ## Instruction: Create route for scss assets. ## Code After: require 'rubygems' require 'sinatra' require 'glorify' require 'sass' require 'compass' configure do Compass.configuration do |config| config.project_path = File.dirname(__FILE__) config.sass_dir = 'sass' end set :scss, Compass.sass_engine_options end set :erb, format: :html5 set :markdown, layout_engine: :erb, layout: :layout Tilt.prefer(Sinatra::Glorify::Template) get '/' do markdown(:introduction) end get '/introduction' do markdown(:introduction) end get '/authentication' do markdown(:authentication) end get '/accounts' do markdown(:accounts) end get '/users' do markdown(:users) end get '/routers' do markdown(:routers) end get '/clients' do markdown(:clients) end get '/activities' do markdown(:activities) end get '/all.css' do content_type 'text/css', charset: 'utf-8' scss(:'../public/scss/all') end
require 'rubygems' require 'sinatra' require 'glorify' require 'sass' require 'compass' configure do Compass.configuration do |config| config.project_path = File.dirname(__FILE__) config.sass_dir = 'sass' end set :scss, Compass.sass_engine_options end set :erb, format: :html5 set :markdown, layout_engine: :erb, layout: :layout Tilt.prefer(Sinatra::Glorify::Template) get '/' do markdown(:introduction) end get '/introduction' do markdown(:introduction) end get '/authentication' do markdown(:authentication) end get '/accounts' do markdown(:accounts) end get '/users' do markdown(:users) end get '/routers' do markdown(:routers) end get '/clients' do markdown(:clients) end get '/activities' do markdown(:activities) end + + get '/all.css' do + content_type 'text/css', charset: 'utf-8' + scss(:'../public/scss/all') + end
5
0.098039
5
0
f3544daf1725a21dea56f04c65bb877895a01b08
website/archiveEnvironment.sh
website/archiveEnvironment.sh
cd ../ zip -r HaliteEnvironment-Source environment/* mkdir website/downloads/environment mv HaliteEnvironment-Source.zip website/downloads/environment/
cd ../environment zip -r HaliteEnvironment-Source * mkdir ../website/downloads/environment mv HaliteEnvironment-Source.zip ../website/downloads/environment/
Archive env with no shell folder
Archive env with no shell folder
Shell
mit
lanyudhy/Halite-II,yangle/HaliteIO,HaliteChallenge/Halite-II,HaliteChallenge/Halite-II,lanyudhy/Halite-II,lanyudhy/Halite-II,HaliteChallenge/Halite-II,HaliteChallenge/Halite,HaliteChallenge/Halite,HaliteChallenge/Halite-II,HaliteChallenge/Halite,lanyudhy/Halite-II,HaliteChallenge/Halite-II,HaliteChallenge/Halite-II,lanyudhy/Halite-II,HaliteChallenge/Halite,lanyudhy/Halite-II,lanyudhy/Halite-II,yangle/HaliteIO,HaliteChallenge/Halite,HaliteChallenge/Halite-II,HaliteChallenge/Halite-II,yangle/HaliteIO,yangle/HaliteIO,lanyudhy/Halite-II,HaliteChallenge/Halite,HaliteChallenge/Halite,yangle/HaliteIO,HaliteChallenge/Halite-II,HaliteChallenge/Halite,yangle/HaliteIO,HaliteChallenge/Halite-II,HaliteChallenge/Halite-II,lanyudhy/Halite-II,HaliteChallenge/Halite-II,yangle/HaliteIO,HaliteChallenge/Halite-II,yangle/HaliteIO,lanyudhy/Halite-II,lanyudhy/Halite-II,yangle/HaliteIO,HaliteChallenge/Halite-II,HaliteChallenge/Halite,HaliteChallenge/Halite,HaliteChallenge/Halite-II,yangle/HaliteIO,HaliteChallenge/Halite,HaliteChallenge/Halite,HaliteChallenge/Halite-II,yangle/HaliteIO,yangle/HaliteIO
shell
## Code Before: cd ../ zip -r HaliteEnvironment-Source environment/* mkdir website/downloads/environment mv HaliteEnvironment-Source.zip website/downloads/environment/ ## Instruction: Archive env with no shell folder ## Code After: cd ../environment zip -r HaliteEnvironment-Source * mkdir ../website/downloads/environment mv HaliteEnvironment-Source.zip ../website/downloads/environment/
- cd ../ + cd ../environment - zip -r HaliteEnvironment-Source environment/* ? ------------ + zip -r HaliteEnvironment-Source * - mkdir website/downloads/environment + mkdir ../website/downloads/environment ? +++ - mv HaliteEnvironment-Source.zip website/downloads/environment/ + mv HaliteEnvironment-Source.zip ../website/downloads/environment/ ? +++
8
2
4
4
9a9fadc63ca711609a56a5f949d1cc5c0f2d202f
front/app/utils.jsx
front/app/utils.jsx
function getUrlParams() { var queryDict = {}; location.search.substr(1).split("&") .forEach(function(item) { queryDict[item.split("=")[0]] = decodeURIComponent(item.split("=")[1]); }); return queryDict; } function jsonPostRequest(url) { var request = new XMLHttpRequest(); request.open('POST', url, true); request.setRequestHeader("Content-type", "application/json"); return request; } function jsonRequestPromise(url, params, method) { return new Promise(function(resolve, reject) { var request = new XMLHttpRequest(); request.open(method, url, true); request.setRequestHeader("Content-type", "application/json"); request.onload = function() { if (request.status == 200){ resolve(JSON.parse(request.responseText)); } else { console.log(request.responseText); reject(request.responseText); } }; request.send(JSON.stringify(params)); }); }
function getUrlParams() { var queryDict = {}; location.search.substr(1).split("&") .forEach(function(item) { queryDict[item.split("=")[0]] = decodeURIComponent(item.split("=")[1].replace(/\+/g, " ")); }); return queryDict; } function jsonPostRequest(url) { var request = new XMLHttpRequest(); request.open('POST', url, true); request.setRequestHeader("Content-type", "application/json"); return request; } function jsonRequestPromise(url, params, method) { return new Promise(function(resolve, reject) { var request = new XMLHttpRequest(); request.open(method, url, true); request.setRequestHeader("Content-type", "application/json"); request.onload = function() { if (request.status == 200){ resolve(JSON.parse(request.responseText)); } else { console.log(request.responseText); reject(request.responseText); } }; request.send(JSON.stringify(params)); }); }
Fix problem with additional spaces
Fix problem with additional spaces
JSX
mit
otraczyk/gsevol-web,otraczyk/gsevol-web,otraczyk/gsevol-web,otraczyk/gsevol-web
jsx
## Code Before: function getUrlParams() { var queryDict = {}; location.search.substr(1).split("&") .forEach(function(item) { queryDict[item.split("=")[0]] = decodeURIComponent(item.split("=")[1]); }); return queryDict; } function jsonPostRequest(url) { var request = new XMLHttpRequest(); request.open('POST', url, true); request.setRequestHeader("Content-type", "application/json"); return request; } function jsonRequestPromise(url, params, method) { return new Promise(function(resolve, reject) { var request = new XMLHttpRequest(); request.open(method, url, true); request.setRequestHeader("Content-type", "application/json"); request.onload = function() { if (request.status == 200){ resolve(JSON.parse(request.responseText)); } else { console.log(request.responseText); reject(request.responseText); } }; request.send(JSON.stringify(params)); }); } ## Instruction: Fix problem with additional spaces ## Code After: function getUrlParams() { var queryDict = {}; location.search.substr(1).split("&") .forEach(function(item) { queryDict[item.split("=")[0]] = decodeURIComponent(item.split("=")[1].replace(/\+/g, " ")); }); return queryDict; } function jsonPostRequest(url) { var request = new XMLHttpRequest(); request.open('POST', url, true); request.setRequestHeader("Content-type", "application/json"); return request; } function jsonRequestPromise(url, params, method) { return new Promise(function(resolve, reject) { var request = new XMLHttpRequest(); request.open(method, url, true); request.setRequestHeader("Content-type", "application/json"); request.onload = function() { if (request.status == 200){ resolve(JSON.parse(request.responseText)); } else { console.log(request.responseText); reject(request.responseText); } }; request.send(JSON.stringify(params)); }); }
function getUrlParams() { var queryDict = {}; location.search.substr(1).split("&") .forEach(function(item) { - queryDict[item.split("=")[0]] = decodeURIComponent(item.split("=")[1]); + queryDict[item.split("=")[0]] = decodeURIComponent(item.split("=")[1].replace(/\+/g, " ")); ? +++++++++++++++++++++ }); return queryDict; } function jsonPostRequest(url) { var request = new XMLHttpRequest(); request.open('POST', url, true); request.setRequestHeader("Content-type", "application/json"); return request; } function jsonRequestPromise(url, params, method) { return new Promise(function(resolve, reject) { var request = new XMLHttpRequest(); request.open(method, url, true); request.setRequestHeader("Content-type", "application/json"); request.onload = function() { if (request.status == 200){ resolve(JSON.parse(request.responseText)); } else { console.log(request.responseText); reject(request.responseText); } }; request.send(JSON.stringify(params)); }); }
2
0.0625
1
1
7b67aba2318aae0f9934a9ce3a548f25f57cf03a
ckeditor/static/ckeditor/ckeditor-init.js
ckeditor/static/ckeditor/ckeditor-init.js
;(function() { var $ = $ || django.jQuery; $(function() { initialiseCKEditor(); initialiseCKEditorInInlinedForms(); function initialiseCKEditorInInlinedForms() { try { $(document).on("click", ".add-row a, .grp-add-handler", function () { initialiseCKEditor(); return true; }); } catch (e) { $(document).delegate(".add-row a, .grp-add-handler", "click", function () { initialiseCKEditor(); return true; }); } } function initialiseCKEditor() { $('textarea[data-type=ckeditortype]').each(function(){ if($(this).data('processed') == "0" && $(this).attr('id').indexOf('__prefix__') == -1){ $(this).data('processed',"1"); CKEDITOR.replace($(this).attr('id'), $(this).data('config')); } }); }; }); }());
(function() { var djangoJQuery; if (typeof jQuery == 'undefined' && typeof django == 'undefined') { console.error('ERROR django-ckeditor missing jQuery. Set CKEDITOR_JQUERY_URL or provide jQuery in the template.'); } else if (typeof django != 'undefined') { djangoJQuery = django.jQuery; } var $ = jQuery || djangoJQuery; $(function() { initialiseCKEditor(); initialiseCKEditorInInlinedForms(); function initialiseCKEditorInInlinedForms() { try { $(document).on("click", ".add-row a, .grp-add-handler", function () { initialiseCKEditor(); return true; }); } catch (e) { $(document).delegate(".add-row a, .grp-add-handler", "click", function () { initialiseCKEditor(); return true; }); } } function initialiseCKEditor() { $('textarea[data-type=ckeditortype]').each(function(){ if($(this).data('processed') == "0" && $(this).attr('id').indexOf('__prefix__') == -1){ $(this).data('processed',"1"); CKEDITOR.replace($(this).attr('id'), $(this).data('config')); } }); } }); }());
Check for jQuery presence correctly.
Check for jQuery presence correctly.
JavaScript
bsd-3-clause
BlastPy/django-ckeditor,gushedaoren/django-ckeditor,zatarus/django-ckeditor,Josephpaik/django-ckeditor,williamdev/django-ckeditor,uhuramedia/django-ckeditor,luzfcb/django-ckeditor,uhuramedia/django-ckeditor,stkrp/django-ckeditor,Josephpaik/django-ckeditor,williamdev/django-ckeditor,williamdev/django-ckeditor,williamdev/django-ckeditor,gushedaoren/django-ckeditor,jonny5532/django-ckeditor,BlastPy/django-ckeditor,BlastPy/django-ckeditor,zatarus/django-ckeditor,jonny5532/django-ckeditor,jonny5532/django-ckeditor,BlastPy/django-ckeditor,gushedaoren/django-ckeditor,MarcJoan/django-ckeditor,MarcJoan/django-ckeditor,zatarus/django-ckeditor,luzfcb/django-ckeditor,uhuramedia/django-ckeditor,stkrp/django-ckeditor,luzfcb/django-ckeditor,Josephpaik/django-ckeditor,stkrp/django-ckeditor,MarcJoan/django-ckeditor,uhuramedia/django-ckeditor
javascript
## Code Before: ;(function() { var $ = $ || django.jQuery; $(function() { initialiseCKEditor(); initialiseCKEditorInInlinedForms(); function initialiseCKEditorInInlinedForms() { try { $(document).on("click", ".add-row a, .grp-add-handler", function () { initialiseCKEditor(); return true; }); } catch (e) { $(document).delegate(".add-row a, .grp-add-handler", "click", function () { initialiseCKEditor(); return true; }); } } function initialiseCKEditor() { $('textarea[data-type=ckeditortype]').each(function(){ if($(this).data('processed') == "0" && $(this).attr('id').indexOf('__prefix__') == -1){ $(this).data('processed',"1"); CKEDITOR.replace($(this).attr('id'), $(this).data('config')); } }); }; }); }()); ## Instruction: Check for jQuery presence correctly. ## Code After: (function() { var djangoJQuery; if (typeof jQuery == 'undefined' && typeof django == 'undefined') { console.error('ERROR django-ckeditor missing jQuery. Set CKEDITOR_JQUERY_URL or provide jQuery in the template.'); } else if (typeof django != 'undefined') { djangoJQuery = django.jQuery; } var $ = jQuery || djangoJQuery; $(function() { initialiseCKEditor(); initialiseCKEditorInInlinedForms(); function initialiseCKEditorInInlinedForms() { try { $(document).on("click", ".add-row a, .grp-add-handler", function () { initialiseCKEditor(); return true; }); } catch (e) { $(document).delegate(".add-row a, .grp-add-handler", "click", function () { initialiseCKEditor(); return true; }); } } function initialiseCKEditor() { $('textarea[data-type=ckeditortype]').each(function(){ if($(this).data('processed') == "0" && $(this).attr('id').indexOf('__prefix__') == -1){ $(this).data('processed',"1"); CKEDITOR.replace($(this).attr('id'), $(this).data('config')); } }); } }); }());
- ;(function() { ? - + (function() { + var djangoJQuery; + if (typeof jQuery == 'undefined' && typeof django == 'undefined') { + console.error('ERROR django-ckeditor missing jQuery. Set CKEDITOR_JQUERY_URL or provide jQuery in the template.'); + } else if (typeof django != 'undefined') { + djangoJQuery = django.jQuery; + } + - var $ = $ || django.jQuery; ? ^ ^^ + var $ = jQuery || djangoJQuery; ? ^^^^^^ ^ $(function() { initialiseCKEditor(); initialiseCKEditorInInlinedForms(); function initialiseCKEditorInInlinedForms() { try { $(document).on("click", ".add-row a, .grp-add-handler", function () { initialiseCKEditor(); return true; }); } catch (e) { $(document).delegate(".add-row a, .grp-add-handler", "click", function () { initialiseCKEditor(); return true; }); } } function initialiseCKEditor() { $('textarea[data-type=ckeditortype]').each(function(){ if($(this).data('processed') == "0" && $(this).attr('id').indexOf('__prefix__') == -1){ $(this).data('processed',"1"); CKEDITOR.replace($(this).attr('id'), $(this).data('config')); } }); - }; ? - + } }); }());
13
0.433333
10
3
ef7dda9bf61092a0dd03c8981c894e94ff5660ff
scripts/slack.js
scripts/slack.js
module.exports = function(robot){ robot.slack = { baseApiUrl: 'https://slack.com/api/', createApiUrl: function (suffix){ return robot.slack.baseApiUrl + suffix; } }; robot.respond(/slack token/i, function(res){ if (robot.auth.isAdmin(res.message.user)){ res.reply(process.env.HUBOT_SLACK_TOKEN); } }); robot.respond(/channel list/i, function(res){ if (robot.auth.isAdmin(res.message.user)){ var data = { token: process.env.HUBOT_SLACK_TOKEN, exclude_archived: 1 }; robot.http(robot.slack.createApiUrl('channels.list' + robot.util.toQueryString(data))) .get()(function(err, response, body){ if (!!err){ res.reply('There was an error processing your request'); return; } var bodyJson = JSON.parse(body); res.send(robot.util.formatJson(bodyJson)); }); } }); }
var _ = require('underscore'); module.exports = function(robot){ robot.slack = { baseApiUrl: 'https://slack.com/api/', createApiUrl: function (suffix, queryString){ if (!!queryString){ if (_.isObject(queryString)) queryString = robot.util.toQueryString(queryString); return robot.slack.baseApiUrl + suffix + queryString; } return robot.slack.baseApiUrl + suffix; } }; robot.respond(/channel list/i, function(res){ if (robot.auth.isAdmin(res.message.user)){ var data = { token: process.env.HUBOT_SLACK_TOKEN, exclude_archived: 1 }; robot.http(robot.slack.createApiUrl('channels.list', data)) .get()(function(err, response, body){ if (!!err){ res.reply('There was an error processing your request'); return; } var bodyJson = JSON.parse(body); res.send(robot.util.formatJson(bodyJson)); }); } }); }
Make createApiUrl easier to use
Make createApiUrl easier to use
JavaScript
mit
BallinOuttaControl/bocbot,BallinOuttaControl/bocbot
javascript
## Code Before: module.exports = function(robot){ robot.slack = { baseApiUrl: 'https://slack.com/api/', createApiUrl: function (suffix){ return robot.slack.baseApiUrl + suffix; } }; robot.respond(/slack token/i, function(res){ if (robot.auth.isAdmin(res.message.user)){ res.reply(process.env.HUBOT_SLACK_TOKEN); } }); robot.respond(/channel list/i, function(res){ if (robot.auth.isAdmin(res.message.user)){ var data = { token: process.env.HUBOT_SLACK_TOKEN, exclude_archived: 1 }; robot.http(robot.slack.createApiUrl('channels.list' + robot.util.toQueryString(data))) .get()(function(err, response, body){ if (!!err){ res.reply('There was an error processing your request'); return; } var bodyJson = JSON.parse(body); res.send(robot.util.formatJson(bodyJson)); }); } }); } ## Instruction: Make createApiUrl easier to use ## Code After: var _ = require('underscore'); module.exports = function(robot){ robot.slack = { baseApiUrl: 'https://slack.com/api/', createApiUrl: function (suffix, queryString){ if (!!queryString){ if (_.isObject(queryString)) queryString = robot.util.toQueryString(queryString); return robot.slack.baseApiUrl + suffix + queryString; } return robot.slack.baseApiUrl + suffix; } }; robot.respond(/channel list/i, function(res){ if (robot.auth.isAdmin(res.message.user)){ var data = { token: process.env.HUBOT_SLACK_TOKEN, exclude_archived: 1 }; robot.http(robot.slack.createApiUrl('channels.list', data)) .get()(function(err, response, body){ if (!!err){ res.reply('There was an error processing your request'); return; } var bodyJson = JSON.parse(body); res.send(robot.util.formatJson(bodyJson)); }); } }); }
+ var _ = require('underscore'); + module.exports = function(robot){ robot.slack = { baseApiUrl: 'https://slack.com/api/', - createApiUrl: function (suffix){ + createApiUrl: function (suffix, queryString){ ? +++++++++++++ + if (!!queryString){ + if (_.isObject(queryString)) + queryString = robot.util.toQueryString(queryString); + return robot.slack.baseApiUrl + suffix + queryString; + } return robot.slack.baseApiUrl + suffix; } }; - - robot.respond(/slack token/i, function(res){ - if (robot.auth.isAdmin(res.message.user)){ - res.reply(process.env.HUBOT_SLACK_TOKEN); - } - }); robot.respond(/channel list/i, function(res){ if (robot.auth.isAdmin(res.message.user)){ var data = { token: process.env.HUBOT_SLACK_TOKEN, exclude_archived: 1 }; - robot.http(robot.slack.createApiUrl('channels.list' + robot.util.toQueryString(data))) ? --------------------------- - + robot.http(robot.slack.createApiUrl('channels.list', data)) ? + .get()(function(err, response, body){ if (!!err){ res.reply('There was an error processing your request'); return; } var bodyJson = JSON.parse(body); res.send(robot.util.formatJson(bodyJson)); }); } }); }
17
0.472222
9
8
b21c678e93aad97b8c939f741b30fd9ebfff44e0
lib/status-bar-view.coffee
lib/status-bar-view.coffee
{_, $, $$, View} = require 'atom' module.exports = class StatusBarView extends View @content: -> @div class: 'status-bar tool-panel panel-bottom', => @div outlet: 'rightPanel', class: 'status-bar-right pull-right' @div outlet: 'leftPanel', class: 'status-bar-left' initialize: -> @bufferSubscriptions = [] @subscribe atom.rootView, 'pane-container:active-pane-item-changed', => @unsubscribeAllFromBuffer() @storeActiveBuffer() @subscribeAllToBuffer() @trigger('active-buffer-changed') @storeActiveBuffer() attach: -> atom.rootView.vertical.append(this) unless @hasParent() appendLeft: (item) -> @leftPanel.append(item) appendRight: (item) -> @rightPanel.append(item) getActiveBuffer: -> @buffer getActiveItem: -> atom.rootView.getActivePaneItem() storeActiveBuffer: -> @buffer = @getActiveItem()?.getBuffer?() subscribeToBuffer: (event, callback) -> @bufferSubscriptions.push([event, callback]) @buffer.on(event, callback) if @buffer subscribeAllToBuffer: -> return unless @buffer for [event, callback] in @bufferSubscriptions @buffer.on(event, callback) unsubscribeAllFromBuffer: -> return unless @buffer for [event, callback] in @bufferSubscriptions @buffer.off(event, callback)
{_, $, $$, View} = require 'atom' module.exports = class StatusBarView extends View @content: -> @div class: 'status-bar tool-panel panel-bottom', => @div outlet: 'rightPanel', class: 'status-bar-right pull-right' @div outlet: 'leftPanel', class: 'status-bar-left' initialize: -> atom.rootView.statusBar = this @bufferSubscriptions = [] @subscribe atom.rootView, 'pane-container:active-pane-item-changed', => @unsubscribeAllFromBuffer() @storeActiveBuffer() @subscribeAllToBuffer() @trigger('active-buffer-changed') @storeActiveBuffer() attach: -> atom.rootView.vertical.append(this) unless @hasParent() appendLeft: (item) -> @leftPanel.append(item) appendRight: (item) -> @rightPanel.append(item) getActiveBuffer: -> @buffer getActiveItem: -> atom.rootView.getActivePaneItem() storeActiveBuffer: -> @buffer = @getActiveItem()?.getBuffer?() subscribeToBuffer: (event, callback) -> @bufferSubscriptions.push([event, callback]) @buffer.on(event, callback) if @buffer subscribeAllToBuffer: -> return unless @buffer for [event, callback] in @bufferSubscriptions @buffer.on(event, callback) unsubscribeAllFromBuffer: -> return unless @buffer for [event, callback] in @bufferSubscriptions @buffer.off(event, callback)
Add itself as a global on rootView
Add itself as a global on rootView
CoffeeScript
mit
pombredanne/status-bar,TShapinsky/status-bar,mertkahyaoglu/status-bar,ali/status-bar,devoncarew/status-bar,Abdillah/status-bar
coffeescript
## Code Before: {_, $, $$, View} = require 'atom' module.exports = class StatusBarView extends View @content: -> @div class: 'status-bar tool-panel panel-bottom', => @div outlet: 'rightPanel', class: 'status-bar-right pull-right' @div outlet: 'leftPanel', class: 'status-bar-left' initialize: -> @bufferSubscriptions = [] @subscribe atom.rootView, 'pane-container:active-pane-item-changed', => @unsubscribeAllFromBuffer() @storeActiveBuffer() @subscribeAllToBuffer() @trigger('active-buffer-changed') @storeActiveBuffer() attach: -> atom.rootView.vertical.append(this) unless @hasParent() appendLeft: (item) -> @leftPanel.append(item) appendRight: (item) -> @rightPanel.append(item) getActiveBuffer: -> @buffer getActiveItem: -> atom.rootView.getActivePaneItem() storeActiveBuffer: -> @buffer = @getActiveItem()?.getBuffer?() subscribeToBuffer: (event, callback) -> @bufferSubscriptions.push([event, callback]) @buffer.on(event, callback) if @buffer subscribeAllToBuffer: -> return unless @buffer for [event, callback] in @bufferSubscriptions @buffer.on(event, callback) unsubscribeAllFromBuffer: -> return unless @buffer for [event, callback] in @bufferSubscriptions @buffer.off(event, callback) ## Instruction: Add itself as a global on rootView ## Code After: {_, $, $$, View} = require 'atom' module.exports = class StatusBarView extends View @content: -> @div class: 'status-bar tool-panel panel-bottom', => @div outlet: 'rightPanel', class: 'status-bar-right pull-right' @div outlet: 'leftPanel', class: 'status-bar-left' initialize: -> atom.rootView.statusBar = this @bufferSubscriptions = [] @subscribe atom.rootView, 'pane-container:active-pane-item-changed', => @unsubscribeAllFromBuffer() @storeActiveBuffer() @subscribeAllToBuffer() @trigger('active-buffer-changed') @storeActiveBuffer() attach: -> atom.rootView.vertical.append(this) unless @hasParent() appendLeft: (item) -> @leftPanel.append(item) appendRight: (item) -> @rightPanel.append(item) getActiveBuffer: -> @buffer getActiveItem: -> atom.rootView.getActivePaneItem() storeActiveBuffer: -> @buffer = @getActiveItem()?.getBuffer?() subscribeToBuffer: (event, callback) -> @bufferSubscriptions.push([event, callback]) @buffer.on(event, callback) if @buffer subscribeAllToBuffer: -> return unless @buffer for [event, callback] in @bufferSubscriptions @buffer.on(event, callback) unsubscribeAllFromBuffer: -> return unless @buffer for [event, callback] in @bufferSubscriptions @buffer.off(event, callback)
{_, $, $$, View} = require 'atom' module.exports = class StatusBarView extends View @content: -> @div class: 'status-bar tool-panel panel-bottom', => @div outlet: 'rightPanel', class: 'status-bar-right pull-right' @div outlet: 'leftPanel', class: 'status-bar-left' initialize: -> + atom.rootView.statusBar = this + @bufferSubscriptions = [] @subscribe atom.rootView, 'pane-container:active-pane-item-changed', => @unsubscribeAllFromBuffer() @storeActiveBuffer() @subscribeAllToBuffer() @trigger('active-buffer-changed') @storeActiveBuffer() attach: -> atom.rootView.vertical.append(this) unless @hasParent() appendLeft: (item) -> @leftPanel.append(item) appendRight: (item) -> @rightPanel.append(item) getActiveBuffer: -> @buffer getActiveItem: -> atom.rootView.getActivePaneItem() storeActiveBuffer: -> @buffer = @getActiveItem()?.getBuffer?() subscribeToBuffer: (event, callback) -> @bufferSubscriptions.push([event, callback]) @buffer.on(event, callback) if @buffer subscribeAllToBuffer: -> return unless @buffer for [event, callback] in @bufferSubscriptions @buffer.on(event, callback) unsubscribeAllFromBuffer: -> return unless @buffer for [event, callback] in @bufferSubscriptions @buffer.off(event, callback)
2
0.039216
2
0
9f8d3efaf100441b33a37311097a32b87a531591
test/fixedcube-tests.cc
test/fixedcube-tests.cc
using namespace Rubik; class FixedCubeTests : public testing::Test { private: static int n; public: int generateInteger() { return n++; } Side::Data generateSideData() { Side::Data result; for(unsigned int i=0; i<result.size(); i++) result[i] = generateInteger(); return result; } }; int FixedCubeTests::n = 0; TEST_F(FixedCubeTests, Initialize) { CubeData data = top(generateSideData()). left(generateSideData()). front(generateSideData()). right(generateSideData()). bottom(generateSideData()). back(generateSideData()); FixedCube::Ptr cube = FixedCube::create(data); EXPECT_EQ(data, cube->data()); }
using namespace Rubik; class FixedCubeTests : public testing::Test { private: static int n; public: CubeData data; public: FixedCubeTests() : data(top(generateSideData()). left(generateSideData()). front(generateSideData()). right(generateSideData()). bottom(generateSideData()). back(generateSideData())) { } ~FixedCubeTests() { // Keep square values relatively small n=0; } int generateInteger() { return n++; } Side::Data generateSideData() { Side::Data result; for(unsigned int i=0; i<result.size(); i++) result[i] = generateInteger(); return result; } }; int FixedCubeTests::n = 0; TEST_F(FixedCubeTests, Initialize) { FixedCube::Ptr cube = FixedCube::create(data); EXPECT_EQ(data, cube->data()); } TEST_F(FixedCubeTests, InitializeWithFactory) { FixedCube::Ptr cube = FixedCube::create(data); EXPECT_EQ(data, cube->data()); }
Duplicate FixedCube test, move initializing cube data to fixture
Duplicate FixedCube test, move initializing cube data to fixture
C++
lgpl-2.1
kees-jan/rubik,kees-jan/rubik,kees-jan/rubik
c++
## Code Before: using namespace Rubik; class FixedCubeTests : public testing::Test { private: static int n; public: int generateInteger() { return n++; } Side::Data generateSideData() { Side::Data result; for(unsigned int i=0; i<result.size(); i++) result[i] = generateInteger(); return result; } }; int FixedCubeTests::n = 0; TEST_F(FixedCubeTests, Initialize) { CubeData data = top(generateSideData()). left(generateSideData()). front(generateSideData()). right(generateSideData()). bottom(generateSideData()). back(generateSideData()); FixedCube::Ptr cube = FixedCube::create(data); EXPECT_EQ(data, cube->data()); } ## Instruction: Duplicate FixedCube test, move initializing cube data to fixture ## Code After: using namespace Rubik; class FixedCubeTests : public testing::Test { private: static int n; public: CubeData data; public: FixedCubeTests() : data(top(generateSideData()). left(generateSideData()). front(generateSideData()). right(generateSideData()). bottom(generateSideData()). back(generateSideData())) { } ~FixedCubeTests() { // Keep square values relatively small n=0; } int generateInteger() { return n++; } Side::Data generateSideData() { Side::Data result; for(unsigned int i=0; i<result.size(); i++) result[i] = generateInteger(); return result; } }; int FixedCubeTests::n = 0; TEST_F(FixedCubeTests, Initialize) { FixedCube::Ptr cube = FixedCube::create(data); EXPECT_EQ(data, cube->data()); } TEST_F(FixedCubeTests, InitializeWithFactory) { FixedCube::Ptr cube = FixedCube::create(data); EXPECT_EQ(data, cube->data()); }
using namespace Rubik; class FixedCubeTests : public testing::Test { private: static int n; + + public: + CubeData data; public: + FixedCubeTests() + : data(top(generateSideData()). + left(generateSideData()). + front(generateSideData()). + right(generateSideData()). + bottom(generateSideData()). + back(generateSideData())) + { + } + + ~FixedCubeTests() + { + // Keep square values relatively small + n=0; + } + int generateInteger() { return n++; } Side::Data generateSideData() { Side::Data result; for(unsigned int i=0; i<result.size(); i++) result[i] = generateInteger(); return result; } }; int FixedCubeTests::n = 0; TEST_F(FixedCubeTests, Initialize) { - CubeData data = - top(generateSideData()). - left(generateSideData()). - front(generateSideData()). - right(generateSideData()). - bottom(generateSideData()). - back(generateSideData()); - FixedCube::Ptr cube = FixedCube::create(data); EXPECT_EQ(data, cube->data()); } + + TEST_F(FixedCubeTests, InitializeWithFactory) + { + FixedCube::Ptr cube = FixedCube::create(data); + + EXPECT_EQ(data, cube->data()); + }
34
0.829268
26
8
917431dc75947d99882d90debd1eb6723ead1ba3
app/views/admin/resources/show.html.erb
app/views/admin/resources/show.html.erb
<h1><%= @resource.to_s %></h1>
<div class="row"> <div class="col-xs-12"> <header class="page-header"> <div class="pull-right"> <%= link_to "Edit", [ :edit, :admin, @resource ], class: "btn btn-lg btn-default" %> <%= link_to "Destroy", [ :admin, @resource ], class: "btn btn-lg btn-danger", method: :delete %> </div> <h1><%= @resource.to_s %></h1> </header> </div> </div> <div class="row"> <div class="col-xs-12"> <div class="well"> <dl class="dl-horizontal"> <% @resource.attributes.each do |key, value| %> <dt><%= @resource_class.human_attribute_name key %></dt> <dd><%= value %></dd> <% end %> </dl> </div> </div> </div>
Create an epic show page for resources
Create an epic show page for resources
HTML+ERB
mit
hyperoslo/hyper_admin,hyperoslo/hyper_admin,hyperoslo/hyper_admin
html+erb
## Code Before: <h1><%= @resource.to_s %></h1> ## Instruction: Create an epic show page for resources ## Code After: <div class="row"> <div class="col-xs-12"> <header class="page-header"> <div class="pull-right"> <%= link_to "Edit", [ :edit, :admin, @resource ], class: "btn btn-lg btn-default" %> <%= link_to "Destroy", [ :admin, @resource ], class: "btn btn-lg btn-danger", method: :delete %> </div> <h1><%= @resource.to_s %></h1> </header> </div> </div> <div class="row"> <div class="col-xs-12"> <div class="well"> <dl class="dl-horizontal"> <% @resource.attributes.each do |key, value| %> <dt><%= @resource_class.human_attribute_name key %></dt> <dd><%= value %></dd> <% end %> </dl> </div> </div> </div>
+ <div class="row"> + <div class="col-xs-12"> + <header class="page-header"> + <div class="pull-right"> + <%= link_to "Edit", [ :edit, :admin, @resource ], class: "btn btn-lg btn-default" %> + <%= link_to "Destroy", [ :admin, @resource ], class: "btn btn-lg btn-danger", method: :delete %> + </div> + - <h1><%= @resource.to_s %></h1> + <h1><%= @resource.to_s %></h1> ? ++++++ + </header> + </div> + </div> + + <div class="row"> + <div class="col-xs-12"> + <div class="well"> + <dl class="dl-horizontal"> + <% @resource.attributes.each do |key, value| %> + <dt><%= @resource_class.human_attribute_name key %></dt> + <dd><%= value %></dd> + <% end %> + </dl> + </div> + </div> + </div>
26
26
25
1
6481e4f5b13e2c7bd4fe94722b492d27edd63535
doc/includes/examples_reveal_basic.html
doc/includes/examples_reveal_basic.html
<a href="#" data-reveal-id="firstModal" class="radius button">Example Modal&hellip;</a> <a href="#" data-reveal-id="videoModal" class="radius button">Example Modal w/Video&hellip;</a>
<a href="#" data-reveal-id="firstModal" class="radius button">Example Modal&hellip;</a> <a href="#" data-reveal-id="videoModal" class="radius button">Example Modal w/Video&hellip;</a>
Fix indentation in reveal partial
Fix indentation in reveal partial
HTML
mit
hboers/foundation,iwikmu/foundation,sitexa/foundation,gnepal7/foundation,birthdayalex/foundation,celsoyh/foundation,glizer/foundation,stanwmusic/foundation,claytonrodgers/foundation,sethkane/foundation-sites,barnyp/foundation,ysalmin/foundation,hummingbird-me/foundation-sites-6,adstyles/foundation,celsoyh/foundation,yohio/foundation-sites-6,jaylensoeur/foundation-sites-6,leo-guinan/foundation,abdullahsalem/foundation-sites,samuelmc/foundation-sites,karland/foundation-sites,Iamronan/foundation,adstyles/foundation,marcosvicente/foundation,designerno1/foundation-sites,andycochran/foundation-sites,JihemC/Foundation-Demo,ucla/foundation-sites,youprofit/foundation,sashaegorov/foundation-sites,pauleds/foundation,signal/foundation,anbestephen/foundation,getoutfitted/reaction-foundation-theme,getoutfitted/reaction-foundation-theme,vita10gy/foundation,zurb/foundation,adstyles/foundation,mbencharrada/foundation,Klaudit/foundation,JihemC/Foundation-Demo,colin-marshall/foundation-sites,walbo/foundation,ioanok/foundation,zurb/foundation-sites,stanwmusic/foundation,lizzwestman/foundation,walbo/foundation,Ilyes512/foundation,andycochran/foundation-sites,pdeffendol/foundation,pdeffendol/foundation,Iamronan/foundation,vrkansagara/foundation,BerndtGroup/TBG-foundation-sites,socketz/foundation-multilevel-offcanvas,joe-watkins/foundation,socketz/foundation-multilevel-offcanvas,r14r/fork_foundation_master,vrkansagara/foundation,youprofit/foundation,mbencharrada/foundation,sitexa/foundation,elkingtonmcb/foundation,dragthor/foundation-sites,denisahac/foundation-sites,glizer/foundation,celsoyh/foundation,karland/foundation-sites,joe-watkins/foundation,gnepal7/foundation,elkingtonmcb/foundation,ibroadfo/foundation,iwikmu/foundation,r14r-work/fork_foundation_master,zurb/foundation-sites-6,Owlbertz/foundation,youprofit/foundation,Mango-information-systems/foundation,atmmarketing/foundation-sites,laantorchaweb/foundation,zurb/foundation,oller/foundation,vita10gy/foundation,carey/foundation,anbestephen/foundation,brettsmason/foundation-sites,stanwmusic/foundation,jamesstoneco/foundation-sites,robottomw/foundation,barnyp/foundation,joe-watkins/foundation,joe-watkins/foundation,denisahac/foundation-sites,r14r/fork_foundation_master,NikhilKalige/foundation,robottomw/foundation,jeromelebleu/foundation-sites,karland/foundation-sites,Larzans/foundation,lizzwestman/foundation,0111001101111010/foundation,jxnblk/foundation,dimamedia/foundation-6-sites-simple-scss-and-js,claytonrodgers/foundation,MarcGuay/foundation,jxnblk/foundation,DouglasAllen/css-foundation,BerndtGroup/TBG-foundation-sites,MarcGuay/foundation,RichardLee1978/foundation,Ilyes512/foundation,pauleds/foundation,DaSchTour/foundation-sites,RichardLee1978/foundation,ibroadfo/foundation,anbestephen/foundation,laantorchaweb/foundation,denisahac/foundation-sites,BerndtGroup/TBG-foundation-sites,sitexa/foundation,NikhilKalige/foundation,RichardLee1978/foundation,ucla/foundation-sites,pauleds/foundation,pwnall/foundation-sites,walbo/foundation,mbarlock/foundation,vita10gy/foundation,brettsmason/foundation-sites,brettsmason/foundation-sites,zurb/foundation,DouglasAllen/css-foundation,dragthor/foundation-sites,r14r/fork_foundation_master,DaSchTour/foundation-sites,IamManchanda/foundation-sites,gnepal7/foundation,0111001101111010/foundation,djlotus/foundation,JihemC/Foundation-Demo,djlotus/foundation,vrkansagara/foundation,RichardLee1978/foundation,leo-guinan/foundation,DouglasAllen/css-foundation,Owlbertz/foundation,laantorchaweb/foundation,adstyles/foundation,marcosvicente/foundation,aoimedia/foundation,elkingtonmcb/foundation,claytonrodgers/foundation,jamesstoneco/foundation-sites,gnepal7/foundation,aoimedia/foundation,labr1005/foundation,sashaegorov/foundation-sites,lizzwestman/foundation,Klaudit/foundation,jamesstoneco/foundation-sites,natewiebe13/foundation-sites,samuelmc/foundation-sites,glizer/foundation,NeonWilderness/foundation,vita10gy/foundation,jaylensoeur/foundation-sites-6,themccallister/foundation,asommer70/foundation,atmmarketing/foundation-sites,Iamronan/foundation,andycochran/foundation-sites,ysalmin/foundation,labr1005/foundation,asommer70/foundation,iwikmu/foundation,dragthor/foundation-sites,zurb/foundation-sites,birthdayalex/foundation,sashaegorov/foundation-sites,designerno1/foundation-sites,NeonWilderness/foundation,mbarlock/foundation,a-dg/foundation,Larzans/foundation,carey/foundation,carey/foundation,robottomw/foundation,asommer70/foundation,lizzwestman/foundation,pwnall/foundation-sites,jlegendary/foundation,barnyp/foundation,pdeffendol/foundation,glunco/foundation,mbarlock/foundation,oller/foundation,colin-marshall/foundation-sites,r14r/fork_foundation_master,rxfork/foundation,designerno1/foundation-sites,getoutfitted/reaction-foundation-theme,samuelmc/foundation-sites,sethkane/foundation-sites,ioanok/foundation,Owlbertz/foundation,natewiebe13/foundation-sites,Teino1978-Corp/Teino1978-Corp-foundation,Larzans/foundation,sitexa/foundation,yohio/foundation-sites-6,asommer70/foundation,labr1005/foundation,jlegendary/foundation,natewiebe13/foundation-sites,PassKitInc/foundation-sites,Teino1978-Corp/Teino1978-Corp-foundation,abdullahsalem/foundation-sites,wikieswan/foundation,signal/foundation,zurb/foundation-sites,claytonrodgers/foundation,themccallister/foundation,pauleds/foundation,glunco/foundation,youprofit/foundation,r14r-work/fork_foundation_master,a-dg/foundation,r14r-work/fork_foundation_master,abdullahsalem/foundation-sites,Teino1978-Corp/Teino1978-Corp-foundation,dimamedia/foundation-6-sites-simple-scss-and-js,walbo/foundation,ysalmin/foundation,jlegendary/foundation,Klaudit/foundation,signal/foundation,anbestephen/foundation,ucla/foundation-sites,vrkansagara/foundation,Ilyes512/foundation,JihemC/Foundation-Demo,advisorwebsites/foundation-sites-6,Owlbertz/foundation,rxfork/foundation,carey/foundation,wikieswan/foundation,PassKitInc/foundation-sites,socketz/foundation-multilevel-offcanvas,a-dg/foundation,MarcGuay/foundation,glunco/foundation,Mango-information-systems/foundation,mbarlock/foundation,MarcGuay/foundation,Klaudit/foundation,robottomw/foundation,0111001101111010/foundation,pwnall/foundation-sites,atmmarketing/foundation-sites,jxnblk/foundation,jeromelebleu/foundation-sites,pdeffendol/foundation,NikhilKalige/foundation,themccallister/foundation,mbencharrada/foundation,djlotus/foundation,ibroadfo/foundation,mbencharrada/foundation,2fd/foundation-stylus,hummingbird-me/foundation-sites-6,wikieswan/foundation,labr1005/foundation,aoimedia/foundation,signal/foundation,stanwmusic/foundation,leo-guinan/foundation,a-dg/foundation,advisorwebsites/foundation-sites-6,colin-marshall/foundation-sites,Larzans/foundation,wikieswan/foundation,jxnblk/foundation,IamManchanda/foundation-sites,r14r-work/fork_foundation_master,iwikmu/foundation,jaylensoeur/foundation-sites-6,jeromelebleu/foundation-sites,glunco/foundation,glizer/foundation,PassKitInc/foundation-sites,barnyp/foundation,birthdayalex/foundation,marcosvicente/foundation,marcosvicente/foundation,oller/foundation,zurb/foundation-sites-6,NeonWilderness/foundation,sethkane/foundation-sites,NeonWilderness/foundation,jlegendary/foundation,birthdayalex/foundation,celsoyh/foundation,laantorchaweb/foundation,elkingtonmcb/foundation,Teino1978-Corp/Teino1978-Corp-foundation,IamManchanda/foundation-sites,ibroadfo/foundation,leo-guinan/foundation,djlotus/foundation,Mango-information-systems/foundation,hboers/foundation,ioanok/foundation,ysalmin/foundation,DouglasAllen/css-foundation
html
## Code Before: <a href="#" data-reveal-id="firstModal" class="radius button">Example Modal&hellip;</a> <a href="#" data-reveal-id="videoModal" class="radius button">Example Modal w/Video&hellip;</a> ## Instruction: Fix indentation in reveal partial ## Code After: <a href="#" data-reveal-id="firstModal" class="radius button">Example Modal&hellip;</a> <a href="#" data-reveal-id="videoModal" class="radius button">Example Modal w/Video&hellip;</a>
- <a href="#" data-reveal-id="firstModal" class="radius button">Example Modal&hellip;</a> ? -------- + <a href="#" data-reveal-id="firstModal" class="radius button">Example Modal&hellip;</a> - <a href="#" data-reveal-id="videoModal" class="radius button">Example Modal w/Video&hellip;</a> ? -------- + <a href="#" data-reveal-id="videoModal" class="radius button">Example Modal w/Video&hellip;</a>
4
2
2
2
bfb67d59f342f6b552b23a301b1f42f1d1b860af
lib/app/views/nav/nitpicker_languages.erb
lib/app/views/nav/nitpicker_languages.erb
<% if nitpicker_languages.any? %> <li class="dropdown"> <a class="dropdown-toggle" id="drop-nitpick" href="#" data-toggle="dropdown">Nitpick <b class="caret"></b></a> <ul class="dropdown-menu" id="menu-nitpick" role="menu" area-labelledby="drop-nitpick"> <% nitpicker_languages.each do |language| %> <li> <a role="menuitem" tabindex="-1" href="<%= path_for(language) %>"> <%= language.to_s.capitalize %></a> </li> <% end %> </ul> </li> <% end %>
<% if nitpicker_languages.any? %> <li class="dropdown"> <a class="dropdown-toggle" id="drop-nitpick" href="#" data-toggle="dropdown">Nitpick <b class="caret"></b></a> <ul class="dropdown-menu" id="menu-nitpick" role="menu" area-labelledby="drop-nitpick"> <% nitpicker_languages.each do |language| %> <li> <a role="menuitem" tabindex="-1" href="<%= path_for(language) %>"> <%= Language.of(language) || language %></a> </li> <% end %> </ul> </li> <% end %>
Fix language names in nitpick menu
Fix language names in nitpick menu
HTML+ERB
agpl-3.0
sheekap/exercism.io,jtigger/exercism.io,treiff/exercism.io,kangkyu/exercism.io,alexclarkofficial/exercism.io,bmulvihill/exercism.io,chastell/exercism.io,bmulvihill/exercism.io,jtigger/exercism.io,beni55/exercism.io,kangkyu/exercism.io,exercistas/exercism.io,colinrubbert/exercism.io,chinaowl/exercism.io,Tonkpils/exercism.io,kizerxl/exercism.io,chastell/exercism.io,jtigger/exercism.io,tejasbubane/exercism.io,emilyforst/exercism.io,mhelmetag/exercism.io,tejasbubane/exercism.io,bmulvihill/exercism.io,nathanbwright/exercism.io,tejasbubane/exercism.io,beni55/exercism.io,sheekap/exercism.io,copiousfreetime/exercism.io,hanumakanthvvn/exercism.io,MBGeoff/Exercism.io-mbgeoff,copiousfreetime/exercism.io,chastell/exercism.io,MBGeoff/Exercism.io-mbgeoff,amar47shah/exercism.io,praveenpuglia/exercism.io,sheekap/exercism.io,RaptorRCX/exercism.io,IanDCarroll/exercism.io,chinaowl/exercism.io,k4rtik/exercism.io,mhelmetag/exercism.io,sheekap/exercism.io,treiff/exercism.io,praveenpuglia/exercism.io,amar47shah/exercism.io,Tonkpils/exercism.io,Tonkpils/exercism.io,colinrubbert/exercism.io,hanumakanthvvn/exercism.io,exercistas/exercism.io,jtigger/exercism.io,emilyforst/exercism.io,IanDCarroll/exercism.io,RaptorRCX/exercism.io,IanDCarroll/exercism.io,copiousfreetime/exercism.io,amar47shah/exercism.io,k4rtik/exercism.io,MBGeoff/Exercism.io-mbgeoff,IanDCarroll/exercism.io,RaptorRCX/exercism.io,tejasbubane/exercism.io,copiousfreetime/exercism.io,alexclarkofficial/exercism.io,alexclarkofficial/exercism.io,colinrubbert/exercism.io,bmulvihill/exercism.io,exercistas/exercism.io,Tonkpils/exercism.io,emilyforst/exercism.io,nathanbwright/exercism.io,RaptorRCX/exercism.io,kizerxl/exercism.io,beni55/exercism.io,praveenpuglia/exercism.io,mhelmetag/exercism.io,treiff/exercism.io,nathanbwright/exercism.io,praveenpuglia/exercism.io,hanumakanthvvn/exercism.io,hanumakanthvvn/exercism.io,kangkyu/exercism.io,kizerxl/exercism.io,nathanbwright/exercism.io,treiff/exercism.io,mhelmetag/exercism.io,k4rtik/exercism.io,chinaowl/exercism.io
html+erb
## Code Before: <% if nitpicker_languages.any? %> <li class="dropdown"> <a class="dropdown-toggle" id="drop-nitpick" href="#" data-toggle="dropdown">Nitpick <b class="caret"></b></a> <ul class="dropdown-menu" id="menu-nitpick" role="menu" area-labelledby="drop-nitpick"> <% nitpicker_languages.each do |language| %> <li> <a role="menuitem" tabindex="-1" href="<%= path_for(language) %>"> <%= language.to_s.capitalize %></a> </li> <% end %> </ul> </li> <% end %> ## Instruction: Fix language names in nitpick menu ## Code After: <% if nitpicker_languages.any? %> <li class="dropdown"> <a class="dropdown-toggle" id="drop-nitpick" href="#" data-toggle="dropdown">Nitpick <b class="caret"></b></a> <ul class="dropdown-menu" id="menu-nitpick" role="menu" area-labelledby="drop-nitpick"> <% nitpicker_languages.each do |language| %> <li> <a role="menuitem" tabindex="-1" href="<%= path_for(language) %>"> <%= Language.of(language) || language %></a> </li> <% end %> </ul> </li> <% end %>
<% if nitpicker_languages.any? %> <li class="dropdown"> <a class="dropdown-toggle" id="drop-nitpick" href="#" data-toggle="dropdown">Nitpick <b class="caret"></b></a> <ul class="dropdown-menu" id="menu-nitpick" role="menu" area-labelledby="drop-nitpick"> <% nitpicker_languages.each do |language| %> <li> <a role="menuitem" tabindex="-1" href="<%= path_for(language) %>"> - <%= language.to_s.capitalize %></a> + <%= Language.of(language) || language %></a> </li> <% end %> </ul> </li> <% end %>
2
0.142857
1
1
8a2a564738450db158f22f07b0e4b5076d2e089a
app/views/home/_twitter.html.haml
app/views/home/_twitter.html.haml
%script(charset="utf-8" src="https://widgets.twimg.com/j/2/widget.js") :javascript new TWTR.Widget({ version: 2, type: 'profile', rpp: 2, interval: 30000, width: 'auto', height: 300, theme: { shell: { background: '#dedede', color: '#000000' }, tweets: { background: '#ffffff', color: '#000000', links: '#005e00' } }, features: { scrollbar: false, loop: false, live: false, behavior: 'all' } }).render().setUser('Cyclescape').start();
<a class="twitter-timeline" data-lang="en" data-height="1023" data-dnt="true" href="https://twitter.com/Cyclescape">Tweets by Cyclescape</a> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
Add twitter feed to front page
Add twitter feed to front page Closes #41
Haml
mit
cyclestreets/cyclescape,cyclestreets/cyclescape,cyclestreets/cyclescape
haml
## Code Before: %script(charset="utf-8" src="https://widgets.twimg.com/j/2/widget.js") :javascript new TWTR.Widget({ version: 2, type: 'profile', rpp: 2, interval: 30000, width: 'auto', height: 300, theme: { shell: { background: '#dedede', color: '#000000' }, tweets: { background: '#ffffff', color: '#000000', links: '#005e00' } }, features: { scrollbar: false, loop: false, live: false, behavior: 'all' } }).render().setUser('Cyclescape').start(); ## Instruction: Add twitter feed to front page Closes #41 ## Code After: <a class="twitter-timeline" data-lang="en" data-height="1023" data-dnt="true" href="https://twitter.com/Cyclescape">Tweets by Cyclescape</a> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
+ <a class="twitter-timeline" data-lang="en" data-height="1023" data-dnt="true" href="https://twitter.com/Cyclescape">Tweets by Cyclescape</a> + <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script> - %script(charset="utf-8" src="https://widgets.twimg.com/j/2/widget.js") - - :javascript - new TWTR.Widget({ - version: 2, - type: 'profile', - rpp: 2, - interval: 30000, - width: 'auto', - height: 300, - theme: { - shell: { - background: '#dedede', - color: '#000000' - }, - tweets: { - background: '#ffffff', - color: '#000000', - links: '#005e00' - } - }, - features: { - scrollbar: false, - loop: false, - live: false, - behavior: 'all' - } - }).render().setUser('Cyclescape').start();
30
1.071429
2
28
80179a9c0cb0f023da4642ab8cdccd441f77b719
lib/smart_answer_flows/calculate-your-holiday-entitlement/questions/basis_of_calculation.govspeak.erb
lib/smart_answer_flows/calculate-your-holiday-entitlement/questions/basis_of_calculation.govspeak.erb
<% content_for :title do %> Is the holiday entitlement based on: <% end %> <% options( "days-worked-per-week": "days worked per week", "hours-worked-per-week": "hours worked per week", "casual-or-irregular-hours": "casual or irregular hours", "annualised-hours": "annualised hours", "compressed-hours": "compressed hours", "shift-worker": "shifts" ) %> <% content_for :hint do %> Check the employment contract if you’re not sure about the holiday entitlement. <% end %>
<% content_for :title do %> Is the holiday entitlement based on: <% end %> <% options( "days-worked-per-week": "days worked per week", "hours-worked-per-week": "hours worked per week", "casual-or-irregular-hours": "casual or irregular hours", "annualised-hours": "annualised hours (hours worked per year)", "compressed-hours": "compressed hours (full-time hours over fewer days)", "shift-worker": "shifts" ) %> <% content_for :hint do %> Check the employment contract if you’re not sure about the holiday entitlement. <% end %>
Add text to holiday entitlement question
Add text to holiday entitlement question Plain English definitions have been requested by the content team
HTML+ERB
mit
alphagov/smart-answers,alphagov/smart-answers,alphagov/smart-answers,alphagov/smart-answers
html+erb
## Code Before: <% content_for :title do %> Is the holiday entitlement based on: <% end %> <% options( "days-worked-per-week": "days worked per week", "hours-worked-per-week": "hours worked per week", "casual-or-irregular-hours": "casual or irregular hours", "annualised-hours": "annualised hours", "compressed-hours": "compressed hours", "shift-worker": "shifts" ) %> <% content_for :hint do %> Check the employment contract if you’re not sure about the holiday entitlement. <% end %> ## Instruction: Add text to holiday entitlement question Plain English definitions have been requested by the content team ## Code After: <% content_for :title do %> Is the holiday entitlement based on: <% end %> <% options( "days-worked-per-week": "days worked per week", "hours-worked-per-week": "hours worked per week", "casual-or-irregular-hours": "casual or irregular hours", "annualised-hours": "annualised hours (hours worked per year)", "compressed-hours": "compressed hours (full-time hours over fewer days)", "shift-worker": "shifts" ) %> <% content_for :hint do %> Check the employment contract if you’re not sure about the holiday entitlement. <% end %>
<% content_for :title do %> Is the holiday entitlement based on: <% end %> <% options( "days-worked-per-week": "days worked per week", "hours-worked-per-week": "hours worked per week", "casual-or-irregular-hours": "casual or irregular hours", - "annualised-hours": "annualised hours", + "annualised-hours": "annualised hours (hours worked per year)", ? ++++++++++++++++++++++++ - "compressed-hours": "compressed hours", + "compressed-hours": "compressed hours (full-time hours over fewer days)", "shift-worker": "shifts" ) %> <% content_for :hint do %> Check the employment contract if you’re not sure about the holiday entitlement. <% end %>
4
0.25
2
2
c501ac55eae43e3132f12a7e07122d07f220011a
app/assets/javascripts/angular_app/templates/monitor.html.slim
app/assets/javascripts/angular_app/templates/monitor.html.slim
.row .span12 .year-navigation.pull-right[entity='entity' year='year'] .row .span4.value-box.positive-box h4 | Orçamento Autorizado br small[ng-cloak] | (referente à {{year}}) .large-number[title="{{entity.autorizado.total | currency:'R$ '}}" ng-bind="entity.autorizado.total | roundedCurrency"] .span4.value-box.negative-box h4 | Pagamentos br small | (Pago + RP Pago) .large-number[title="{{entity.pagamentos.total | currency:'R$ '}}" ng-bind="entity.pagamentos.total | roundedCurrency"] .span4.value-box.attention-box h4 | Não Executado br small | (Autorizado - Pagamentos) .large-number[title="{{entity.naoExecutado.total | currency:'R$ '}}" ng-bind="entity.naoExecutado.total | roundedCurrency"]
.row .span4.value-box.positive-box h4 | Orçamento Autorizado br small[ng-cloak] | (referente à {{year}}) .large-number[title="{{entity.autorizado.total | currency:'R$ '}}" ng-bind="entity.autorizado.total | roundedCurrency"] .span4.value-box.negative-box h4 | Pagamentos br small | (Pago + RP Pago) .large-number[title="{{entity.pagamentos.total | currency:'R$ '}}" ng-bind="entity.pagamentos.total | roundedCurrency"] .span4.value-box.attention-box h4 | Não Executado br small | (Autorizado - Pagamentos) .large-number[title="{{entity.naoExecutado.total | currency:'R$ '}}" ng-bind="entity.naoExecutado.total | roundedCurrency"]
Remove select de ano do monitor.
Remove select de ano do monitor.
Slim
mit
okfn-brasil/orcamento.inesc.org.br,okfn-brasil/orcamento.inesc.org.br,okfn-brasil/orcamento.inesc.org.br
slim
## Code Before: .row .span12 .year-navigation.pull-right[entity='entity' year='year'] .row .span4.value-box.positive-box h4 | Orçamento Autorizado br small[ng-cloak] | (referente à {{year}}) .large-number[title="{{entity.autorizado.total | currency:'R$ '}}" ng-bind="entity.autorizado.total | roundedCurrency"] .span4.value-box.negative-box h4 | Pagamentos br small | (Pago + RP Pago) .large-number[title="{{entity.pagamentos.total | currency:'R$ '}}" ng-bind="entity.pagamentos.total | roundedCurrency"] .span4.value-box.attention-box h4 | Não Executado br small | (Autorizado - Pagamentos) .large-number[title="{{entity.naoExecutado.total | currency:'R$ '}}" ng-bind="entity.naoExecutado.total | roundedCurrency"] ## Instruction: Remove select de ano do monitor. ## Code After: .row .span4.value-box.positive-box h4 | Orçamento Autorizado br small[ng-cloak] | (referente à {{year}}) .large-number[title="{{entity.autorizado.total | currency:'R$ '}}" ng-bind="entity.autorizado.total | roundedCurrency"] .span4.value-box.negative-box h4 | Pagamentos br small | (Pago + RP Pago) .large-number[title="{{entity.pagamentos.total | currency:'R$ '}}" ng-bind="entity.pagamentos.total | roundedCurrency"] .span4.value-box.attention-box h4 | Não Executado br small | (Autorizado - Pagamentos) .large-number[title="{{entity.naoExecutado.total | currency:'R$ '}}" ng-bind="entity.naoExecutado.total | roundedCurrency"]
- .row - .span12 - .year-navigation.pull-right[entity='entity' year='year'] .row .span4.value-box.positive-box h4 | Orçamento Autorizado br small[ng-cloak] | (referente à {{year}}) .large-number[title="{{entity.autorizado.total | currency:'R$ '}}" ng-bind="entity.autorizado.total | roundedCurrency"] .span4.value-box.negative-box h4 | Pagamentos br small | (Pago + RP Pago) .large-number[title="{{entity.pagamentos.total | currency:'R$ '}}" ng-bind="entity.pagamentos.total | roundedCurrency"] .span4.value-box.attention-box h4 | Não Executado br small | (Autorizado - Pagamentos) .large-number[title="{{entity.naoExecutado.total | currency:'R$ '}}" ng-bind="entity.naoExecutado.total | roundedCurrency"]
3
0.107143
0
3
95d8bf457c68e231f56a18353911334330c5cc57
config/viirs_awips.yml
config/viirs_awips.yml
driver: viirs2awips.sh configs: default: options: "--adaptive-dnb" grid: 203 save: "SSEC_AWIPS_VIIRS*" limits: processor: 2
driver: viirs2awips.sh configs: default: options: "-p ifog i01 i02 i03 i04 i05 adaptive_dnb dynamic_dnb" grid: 203 save: "UAF_AWIPS_VIIRS*" limits: processor: 2
Set defaults for new p2g
Set defaults for new p2g
YAML
apache-2.0
gina-alaska/sandy-utils,gina-alaska/sandy-utils,gina-alaska/sandy-utils
yaml
## Code Before: driver: viirs2awips.sh configs: default: options: "--adaptive-dnb" grid: 203 save: "SSEC_AWIPS_VIIRS*" limits: processor: 2 ## Instruction: Set defaults for new p2g ## Code After: driver: viirs2awips.sh configs: default: options: "-p ifog i01 i02 i03 i04 i05 adaptive_dnb dynamic_dnb" grid: 203 save: "UAF_AWIPS_VIIRS*" limits: processor: 2
driver: viirs2awips.sh configs: - default: ? - + default: - options: "--adaptive-dnb" + options: "-p ifog i01 i02 i03 i04 i05 adaptive_dnb dynamic_dnb" - grid: 203 + grid: 203 ? + - save: "SSEC_AWIPS_VIIRS*" ? ^^^^ + save: "UAF_AWIPS_VIIRS*" ? + ^^^ limits: processor: 2
8
1
4
4
77bb5632bd163cc1a610383d03d54f1722956651
bin/index.js
bin/index.js
const fetch = require('node-fetch'); const postmark = require('postmark'); const apiKey = process.env.POSTMARK_API_KEY; const client = new postmark.Client(apiKey); fetch('https://motd.today/data.json').then( function (response) { return response.json(); } ).then(function (body) { console.log('Name: ' + body.motds[0].name); console.log('Description: ' + body.motds[0].description); console.log('Number of player on each team: ' + body.motds[0].teamSize); console.log('Game mode: ' + body.motds[0].gameMode); const mailBody = 'Hello fellow god, here is the latest news!\n\n' + 'Name: ' + body.motds[0].name + '\n' + 'Description: ' + body.motds[0].description + '\n' + 'Number of player on each team: ' + body.motds[0].teamSize + '\n' + 'Game mode: ' + body.motds[0].gameMode; client.sendEmail({ "From": "juul@rudihagen.me", "To": "juularthur92@gmail.com", "Subject": "Smite MOTD", "TextBody": mailBody }); });
const fetch = require('node-fetch'); const postmark = require('postmark'); const apiKey = process.env.POSTMARK_API_KEY; const client = new postmark.Client(apiKey); fetch('https://motd.today/data.json').then( function (response) { return response.json(); } ).then(function (body) { const mailBody = 'Hello fellow god, here is the latest news about MOTD in Smite!\n\n' + 'Name: ' + body.motds[0].name + '\n' + 'Description: ' + body.motds[0].description + '\n' + 'Number of player on each team: ' + body.motds[0].teamSize + '\n' + 'Game mode: ' + body.motds[0].gameMode; client.sendEmail({ "From": "juul@rudihagen.me", "To": "juularthur92@gmail.com", "Subject": "Smite MOTD", "TextBody": mailBody }); client.sendEmail({ "From": "juul@rudihagen.me", "To": "JWintersto@gmail.com", "Subject": "Smite MOTD", "TextBody": mailBody }); });
Add Johannes to mailing list
Add Johannes to mailing list
JavaScript
mit
JuulArthur/smiteMOTD,JuulArthur/smiteMOTD
javascript
## Code Before: const fetch = require('node-fetch'); const postmark = require('postmark'); const apiKey = process.env.POSTMARK_API_KEY; const client = new postmark.Client(apiKey); fetch('https://motd.today/data.json').then( function (response) { return response.json(); } ).then(function (body) { console.log('Name: ' + body.motds[0].name); console.log('Description: ' + body.motds[0].description); console.log('Number of player on each team: ' + body.motds[0].teamSize); console.log('Game mode: ' + body.motds[0].gameMode); const mailBody = 'Hello fellow god, here is the latest news!\n\n' + 'Name: ' + body.motds[0].name + '\n' + 'Description: ' + body.motds[0].description + '\n' + 'Number of player on each team: ' + body.motds[0].teamSize + '\n' + 'Game mode: ' + body.motds[0].gameMode; client.sendEmail({ "From": "juul@rudihagen.me", "To": "juularthur92@gmail.com", "Subject": "Smite MOTD", "TextBody": mailBody }); }); ## Instruction: Add Johannes to mailing list ## Code After: const fetch = require('node-fetch'); const postmark = require('postmark'); const apiKey = process.env.POSTMARK_API_KEY; const client = new postmark.Client(apiKey); fetch('https://motd.today/data.json').then( function (response) { return response.json(); } ).then(function (body) { const mailBody = 'Hello fellow god, here is the latest news about MOTD in Smite!\n\n' + 'Name: ' + body.motds[0].name + '\n' + 'Description: ' + body.motds[0].description + '\n' + 'Number of player on each team: ' + body.motds[0].teamSize + '\n' + 'Game mode: ' + body.motds[0].gameMode; client.sendEmail({ "From": "juul@rudihagen.me", "To": "juularthur92@gmail.com", "Subject": "Smite MOTD", "TextBody": mailBody }); client.sendEmail({ "From": "juul@rudihagen.me", "To": "JWintersto@gmail.com", "Subject": "Smite MOTD", "TextBody": mailBody }); });
const fetch = require('node-fetch'); const postmark = require('postmark'); const apiKey = process.env.POSTMARK_API_KEY; const client = new postmark.Client(apiKey); fetch('https://motd.today/data.json').then( function (response) { return response.json(); } ).then(function (body) { - console.log('Name: ' + body.motds[0].name); - console.log('Description: ' + body.motds[0].description); - console.log('Number of player on each team: ' + body.motds[0].teamSize); - console.log('Game mode: ' + body.motds[0].gameMode); - const mailBody = 'Hello fellow god, here is the latest news!\n\n' + 'Name: ' + body.motds[0].name + '\n' + 'Description: ' + body.motds[0].description + '\n' + 'Number of player on each team: ' + body.motds[0].teamSize + '\n' + 'Game mode: ' + body.motds[0].gameMode; + const mailBody = 'Hello fellow god, here is the latest news about MOTD in Smite!\n\n' + 'Name: ' + body.motds[0].name + '\n' + 'Description: ' + body.motds[0].description + '\n' + 'Number of player on each team: ' + body.motds[0].teamSize + '\n' + 'Game mode: ' + body.motds[0].gameMode; ? ++++++++++++++++++++ client.sendEmail({ "From": "juul@rudihagen.me", "To": "juularthur92@gmail.com", "Subject": "Smite MOTD", "TextBody": mailBody }); + client.sendEmail({ + "From": "juul@rudihagen.me", + "To": "JWintersto@gmail.com", + "Subject": "Smite MOTD", + "TextBody": mailBody + }); });
12
0.521739
7
5
ead8d84df4db6e2c1f0b7cc5d5485870a73a393f
yang/yang-parser-spi/src/main/java/module-info.java
yang/yang-parser-spi/src/main/java/module-info.java
/* * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ module org.opendaylight.yangtools.yang.parser.spi { exports org.opendaylight.yangtools.yang.parser.spi; exports org.opendaylight.yangtools.yang.parser.spi.meta; exports org.opendaylight.yangtools.yang.parser.spi.source; exports org.opendaylight.yangtools.yang.parser.spi.validation; requires transitive org.opendaylight.yangtools.yang.model.api; requires org.slf4j; }
/* * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ module org.opendaylight.yangtools.yang.parser.spi { exports org.opendaylight.yangtools.yang.parser.spi; exports org.opendaylight.yangtools.yang.parser.spi.meta; exports org.opendaylight.yangtools.yang.parser.spi.source; exports org.opendaylight.yangtools.yang.parser.spi.validation; requires transitive org.opendaylight.yangtools.yang.model.api; requires org.slf4j; // Annotations requires static org.eclipse.jdt.annotation; }
Add a requirement on annotations
Add a requirement on annotations Do not rely to get these transitively, add a requires static. Change-Id: Ibf06934bcdf808e1bdc47cdb8097adc9d5650606 Signed-off-by: Robert Varga <91ae5aa8c7a9f7e57b701db766e23e544aaa6ae9@pantheon.tech>
Java
epl-1.0
opendaylight/yangtools,opendaylight/yangtools
java
## Code Before: /* * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ module org.opendaylight.yangtools.yang.parser.spi { exports org.opendaylight.yangtools.yang.parser.spi; exports org.opendaylight.yangtools.yang.parser.spi.meta; exports org.opendaylight.yangtools.yang.parser.spi.source; exports org.opendaylight.yangtools.yang.parser.spi.validation; requires transitive org.opendaylight.yangtools.yang.model.api; requires org.slf4j; } ## Instruction: Add a requirement on annotations Do not rely to get these transitively, add a requires static. Change-Id: Ibf06934bcdf808e1bdc47cdb8097adc9d5650606 Signed-off-by: Robert Varga <91ae5aa8c7a9f7e57b701db766e23e544aaa6ae9@pantheon.tech> ## Code After: /* * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ module org.opendaylight.yangtools.yang.parser.spi { exports org.opendaylight.yangtools.yang.parser.spi; exports org.opendaylight.yangtools.yang.parser.spi.meta; exports org.opendaylight.yangtools.yang.parser.spi.source; exports org.opendaylight.yangtools.yang.parser.spi.validation; requires transitive org.opendaylight.yangtools.yang.model.api; requires org.slf4j; // Annotations requires static org.eclipse.jdt.annotation; }
/* * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ module org.opendaylight.yangtools.yang.parser.spi { exports org.opendaylight.yangtools.yang.parser.spi; exports org.opendaylight.yangtools.yang.parser.spi.meta; exports org.opendaylight.yangtools.yang.parser.spi.source; exports org.opendaylight.yangtools.yang.parser.spi.validation; requires transitive org.opendaylight.yangtools.yang.model.api; requires org.slf4j; + + // Annotations + requires static org.eclipse.jdt.annotation; }
3
0.1875
3
0
40dc3b505bc039f9773b158e9f7266485f503995
spec/controllers/application_controller_spec.rb
spec/controllers/application_controller_spec.rb
require 'rails_helper' describe Localdoc::ApplicationController do it "GET /" do get :show, use_route: :localdoc expect(response).to be_success end it "GET /path/to/non-existent-doc.json" do get :show, path: "path/to/non-existent-doc.json", use_route: :localdoc expect(response).to be_success expect(assigns(:blocking_error)).to include("File Not Found") end end
require 'rails_helper' describe Localdoc::ApplicationController do it "GET /" do get :show, use_route: :localdoc expect(response).to be_success expect(assigns(:page_data)).to( include( :markdownOptions, model: include( :allDocs, :filePath, :savePath, :editable, :blockingError))) end it "GET /path/to/non-existent-doc.json" do get :show, path: "path/to/non-existent-doc.json", use_route: :localdoc expect(response).to be_success expect(assigns(:page_data)).to include(model: include(blockingError: "File Not Found")) end end
Fix and add more model data check
Fix and add more model data check
Ruby
bsd-3-clause
NoRedInk/localdoc,NoRedInk/localdoc,NoRedInk/localdoc
ruby
## Code Before: require 'rails_helper' describe Localdoc::ApplicationController do it "GET /" do get :show, use_route: :localdoc expect(response).to be_success end it "GET /path/to/non-existent-doc.json" do get :show, path: "path/to/non-existent-doc.json", use_route: :localdoc expect(response).to be_success expect(assigns(:blocking_error)).to include("File Not Found") end end ## Instruction: Fix and add more model data check ## Code After: require 'rails_helper' describe Localdoc::ApplicationController do it "GET /" do get :show, use_route: :localdoc expect(response).to be_success expect(assigns(:page_data)).to( include( :markdownOptions, model: include( :allDocs, :filePath, :savePath, :editable, :blockingError))) end it "GET /path/to/non-existent-doc.json" do get :show, path: "path/to/non-existent-doc.json", use_route: :localdoc expect(response).to be_success expect(assigns(:page_data)).to include(model: include(blockingError: "File Not Found")) end end
require 'rails_helper' describe Localdoc::ApplicationController do it "GET /" do get :show, use_route: :localdoc expect(response).to be_success + expect(assigns(:page_data)).to( + include( + :markdownOptions, + model: include( + :allDocs, + :filePath, + :savePath, + :editable, + :blockingError))) end it "GET /path/to/non-existent-doc.json" do get :show, path: "path/to/non-existent-doc.json", use_route: :localdoc expect(response).to be_success - expect(assigns(:blocking_error)).to include("File Not Found") + expect(assigns(:page_data)).to include(model: include(blockingError: "File Not Found")) end end
11
0.785714
10
1
3e6541df3f445f5110d4aeef0b26106a434078ca
dbsetup.js
dbsetup.js
let db; try { db = require("rethinkdbdash")(require("./config.json").connectionOpts); } catch (err) { console.error("You haven't installed rethinkdbdash npm module or you don't have configured the bot yet! Please do so."); } (async function () { if (!db) return; const dbs = await db.tableList(); if (!dbs.includes("blacklist")) await db.tableCreate("blacklist"); if (!dbs.includes("session")) await db.tableCreate("session"); if (!dbs.includes("configs")) await db.tableCreate("configs"); if (!dbs.includes("feedback")) await db.tableCreate("feedback"); if (!dbs.includes("tags")) await db.tableCreate("tags"); if (!dbs.includes("profile")) await db.tableCreate("profile"); if (!dbs.includes("modlog")) await db.tableCreate("modlog"); if (!dbs.includes("extensions")) await db.tableCreate("extensions"); return console.log("All set up!"); })();
let db; try { db = require("rethinkdbdash")(require("./config.json").connectionOpts); } catch (err) { console.error("You haven't installed rethinkdbdash npm module or you don't have configured the bot yet! Please do so."); } (async function () { if (!db) return; const dbs = await db.tableList(); if (!dbs.includes("blacklist")) await db.tableCreate("blacklist"); if (!dbs.includes("session")) await db.tableCreate("session"); if (!dbs.includes("configs")) await db.tableCreate("configs"); if (!dbs.includes("feedback")) await db.tableCreate("feedback"); if (!dbs.includes("tags")) await db.tableCreate("tags"); if (!dbs.includes("profile")) await db.tableCreate("profile"); if (!dbs.includes("modlog")) await db.tableCreate("modlog"); return console.log("All set up!"); })();
Revert the extension table reservation
Revert the extension table reservation
JavaScript
mit
TTtie/TTtie-Bot,TTtie/TTtie-Bot,TTtie/TTtie-Bot
javascript
## Code Before: let db; try { db = require("rethinkdbdash")(require("./config.json").connectionOpts); } catch (err) { console.error("You haven't installed rethinkdbdash npm module or you don't have configured the bot yet! Please do so."); } (async function () { if (!db) return; const dbs = await db.tableList(); if (!dbs.includes("blacklist")) await db.tableCreate("blacklist"); if (!dbs.includes("session")) await db.tableCreate("session"); if (!dbs.includes("configs")) await db.tableCreate("configs"); if (!dbs.includes("feedback")) await db.tableCreate("feedback"); if (!dbs.includes("tags")) await db.tableCreate("tags"); if (!dbs.includes("profile")) await db.tableCreate("profile"); if (!dbs.includes("modlog")) await db.tableCreate("modlog"); if (!dbs.includes("extensions")) await db.tableCreate("extensions"); return console.log("All set up!"); })(); ## Instruction: Revert the extension table reservation ## Code After: let db; try { db = require("rethinkdbdash")(require("./config.json").connectionOpts); } catch (err) { console.error("You haven't installed rethinkdbdash npm module or you don't have configured the bot yet! Please do so."); } (async function () { if (!db) return; const dbs = await db.tableList(); if (!dbs.includes("blacklist")) await db.tableCreate("blacklist"); if (!dbs.includes("session")) await db.tableCreate("session"); if (!dbs.includes("configs")) await db.tableCreate("configs"); if (!dbs.includes("feedback")) await db.tableCreate("feedback"); if (!dbs.includes("tags")) await db.tableCreate("tags"); if (!dbs.includes("profile")) await db.tableCreate("profile"); if (!dbs.includes("modlog")) await db.tableCreate("modlog"); return console.log("All set up!"); })();
let db; try { db = require("rethinkdbdash")(require("./config.json").connectionOpts); } catch (err) { console.error("You haven't installed rethinkdbdash npm module or you don't have configured the bot yet! Please do so."); } (async function () { if (!db) return; const dbs = await db.tableList(); if (!dbs.includes("blacklist")) await db.tableCreate("blacklist"); if (!dbs.includes("session")) await db.tableCreate("session"); if (!dbs.includes("configs")) await db.tableCreate("configs"); if (!dbs.includes("feedback")) await db.tableCreate("feedback"); if (!dbs.includes("tags")) await db.tableCreate("tags"); if (!dbs.includes("profile")) await db.tableCreate("profile"); if (!dbs.includes("modlog")) await db.tableCreate("modlog"); - if (!dbs.includes("extensions")) await db.tableCreate("extensions"); return console.log("All set up!"); })();
1
0.052632
0
1
e4710b6bf3d1704b9834ad22dba550940957edbb
app/models/concerns/statable.rb
app/models/concerns/statable.rb
module Statable def self.included(base) base.extend ClassMethods base.class_eval do scope :last_day, -> { where("#{@stats_column} >= ?", 1.day.ago) } scope :last_week, -> { where("#{@stats_column} >= ?", 1.week.ago) } scope :last_month, -> { where("#{@stats_column} >= ?", 1.month.ago) } scope :last_year, -> { where("#{@stats_column} >= ?", 1.year.ago) } end end module ClassMethods def counter_stats_for(column) @stats_column = column end end end
require 'active_support/concern' # # Funcionality related to model stats # module Statable extend ActiveSupport::Concern included do scope :last_day, -> { where("#{@stats_column} >= ?", 1.day.ago) } scope :last_week, -> { where("#{@stats_column} >= ?", 1.week.ago) } scope :last_month, -> { where("#{@stats_column} >= ?", 1.month.ago) } scope :last_year, -> { where("#{@stats_column} >= ?", 1.year.ago) } end class_methods do def counter_stats_for(column) @stats_column = column end end end
Use ActiveSupport::Concern to reduce complexity
Use ActiveSupport::Concern to reduce complexity
Ruby
agpl-3.0
alabs/nolotiro.org,alabs/nolotiro.org,alabs/nolotiro.org,alabs/nolotiro.org
ruby
## Code Before: module Statable def self.included(base) base.extend ClassMethods base.class_eval do scope :last_day, -> { where("#{@stats_column} >= ?", 1.day.ago) } scope :last_week, -> { where("#{@stats_column} >= ?", 1.week.ago) } scope :last_month, -> { where("#{@stats_column} >= ?", 1.month.ago) } scope :last_year, -> { where("#{@stats_column} >= ?", 1.year.ago) } end end module ClassMethods def counter_stats_for(column) @stats_column = column end end end ## Instruction: Use ActiveSupport::Concern to reduce complexity ## Code After: require 'active_support/concern' # # Funcionality related to model stats # module Statable extend ActiveSupport::Concern included do scope :last_day, -> { where("#{@stats_column} >= ?", 1.day.ago) } scope :last_week, -> { where("#{@stats_column} >= ?", 1.week.ago) } scope :last_month, -> { where("#{@stats_column} >= ?", 1.month.ago) } scope :last_year, -> { where("#{@stats_column} >= ?", 1.year.ago) } end class_methods do def counter_stats_for(column) @stats_column = column end end end
+ + require 'active_support/concern' + + # + # Funcionality related to model stats + # module Statable + extend ActiveSupport::Concern - def self.included(base) - base.extend ClassMethods - base.class_eval do + included do - scope :last_day, -> { where("#{@stats_column} >= ?", 1.day.ago) } ? -- + scope :last_day, -> { where("#{@stats_column} >= ?", 1.day.ago) } - scope :last_week, -> { where("#{@stats_column} >= ?", 1.week.ago) } ? -- + scope :last_week, -> { where("#{@stats_column} >= ?", 1.week.ago) } - scope :last_month, -> { where("#{@stats_column} >= ?", 1.month.ago) } ? -- + scope :last_month, -> { where("#{@stats_column} >= ?", 1.month.ago) } - scope :last_year, -> { where("#{@stats_column} >= ?", 1.year.ago) } ? -- + scope :last_year, -> { where("#{@stats_column} >= ?", 1.year.ago) } - end end - module ClassMethods + class_methods do def counter_stats_for(column) @stats_column = column end end end
22
1.222222
13
9
90471b9393cc025328bd25a28f5701318c03ac73
system/path.zsh
system/path.zsh
export PATH="./bin:$DOTFILES/bin:$HOME/bin:$HOME/.wp-cli/bin:$HOME/.cabal/bin:$PATH" # Maid export PATH="$PATH:$HOME/.maid/bin" export MANPATH="/usr/local/man:/usr/local/mysql/man:/usr/local/git/man:$MANPATH" export PATH="$PATH:/usr/local/bin:/usr/local/sbin"
export PATH="./bin:$DOTFILES/bin:$HOME/bin:$HOME/.wp-cli/bin:$HOME/.cabal/bin:$PATH" # Maid export PATH="$PATH:$HOME/.maid/bin" export MANPATH="/usr/local/man:/usr/local/mysql/man:/usr/local/git/man:$MANPATH" export PATH="$PATH:/usr/local/bin:/usr/local/sbin" # Use GNU coreutils first export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
Use GNU coreutils first in PATH
Use GNU coreutils first in PATH
Shell
mit
montchr/dotfiles,montchr/dotfiles,montchr/dotfiles,montchr/dotfiles
shell
## Code Before: export PATH="./bin:$DOTFILES/bin:$HOME/bin:$HOME/.wp-cli/bin:$HOME/.cabal/bin:$PATH" # Maid export PATH="$PATH:$HOME/.maid/bin" export MANPATH="/usr/local/man:/usr/local/mysql/man:/usr/local/git/man:$MANPATH" export PATH="$PATH:/usr/local/bin:/usr/local/sbin" ## Instruction: Use GNU coreutils first in PATH ## Code After: export PATH="./bin:$DOTFILES/bin:$HOME/bin:$HOME/.wp-cli/bin:$HOME/.cabal/bin:$PATH" # Maid export PATH="$PATH:$HOME/.maid/bin" export MANPATH="/usr/local/man:/usr/local/mysql/man:/usr/local/git/man:$MANPATH" export PATH="$PATH:/usr/local/bin:/usr/local/sbin" # Use GNU coreutils first export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
export PATH="./bin:$DOTFILES/bin:$HOME/bin:$HOME/.wp-cli/bin:$HOME/.cabal/bin:$PATH" # Maid export PATH="$PATH:$HOME/.maid/bin" + + export MANPATH="/usr/local/man:/usr/local/mysql/man:/usr/local/git/man:$MANPATH" + export PATH="$PATH:/usr/local/bin:/usr/local/sbin" - export PATH="$PATH:/usr/local/bin:/usr/local/sbin" + # Use GNU coreutils first + export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
6
0.857143
5
1
5110ad60400703d11dedc37096f9112050d765c5
laravel/mvc-basics/step-by-step/04_run_the_database_migration.sh
laravel/mvc-basics/step-by-step/04_run_the_database_migration.sh
cd ~/Sites/presentation/mvc-basics # You can review the migrations before they've run using the following command php artisan migrate:status # Use artisan to run your database migrations php artisan migrate # You can review the migrations after they've run using the following command php artisan migrate:status # You can now use Sequel Pro (Mac) or your favorite SQL editor to refresh the # mvc_basics database and see the newly created `event_tickets` table.
cd ~/Sites/presentation/mvc-basics # You can review the migrations before they've run using the following command php artisan migrate:install php artisan migrate:status # Use artisan to run your database migrations php artisan migrate # You can review the migrations after they've run using the following command php artisan migrate:status # You can now use Sequel Pro (Mac) or your favorite SQL editor to refresh the # mvc_basics database and see the newly created `event_tickets` table.
Update laravel/mvc-basics/step-by-step/04 to perform migrate install first
Update laravel/mvc-basics/step-by-step/04 to perform migrate install first
Shell
mit
jeffersonmartin/code-examples,jeffersonmartin/code-examples,jeffersonmartin/code-examples,jeffersonmartin/code-examples
shell
## Code Before: cd ~/Sites/presentation/mvc-basics # You can review the migrations before they've run using the following command php artisan migrate:status # Use artisan to run your database migrations php artisan migrate # You can review the migrations after they've run using the following command php artisan migrate:status # You can now use Sequel Pro (Mac) or your favorite SQL editor to refresh the # mvc_basics database and see the newly created `event_tickets` table. ## Instruction: Update laravel/mvc-basics/step-by-step/04 to perform migrate install first ## Code After: cd ~/Sites/presentation/mvc-basics # You can review the migrations before they've run using the following command php artisan migrate:install php artisan migrate:status # Use artisan to run your database migrations php artisan migrate # You can review the migrations after they've run using the following command php artisan migrate:status # You can now use Sequel Pro (Mac) or your favorite SQL editor to refresh the # mvc_basics database and see the newly created `event_tickets` table.
cd ~/Sites/presentation/mvc-basics # You can review the migrations before they've run using the following command + php artisan migrate:install php artisan migrate:status # Use artisan to run your database migrations php artisan migrate # You can review the migrations after they've run using the following command php artisan migrate:status # You can now use Sequel Pro (Mac) or your favorite SQL editor to refresh the # mvc_basics database and see the newly created `event_tickets` table.
1
0.076923
1
0
5e96495f5c22c4a5d3f9fcf902df48f53f415201
zsh/README.md
zsh/README.md
**WARNING: This config uses `bindkey -v` rather than the [emacs default](https://sgeb.io/posts/2014/04/zsh-zle-custom-widgets/).** This is a modular zsh config framework, originally built by [Andrew Brinker](https://github.com/AndrewBrinker/zsh). At the top level there is a simple `zshrc` that when loaded will find all of the files ending in `.sh` and load them in. The directory structure is pretty self explanatory - there's a folder for aliases, various config and some exports that contain handy functions. The `setup` script is called by the `install` script one level up. It checks that zsh is installed, and that it is the default shell. ## Plugin Manager We use https://github.com/tarjoilija/zgen for loading plugins.
**WARNING: This config uses `bindkey -v` rather than the [emacs default](https://sgeb.io/posts/2014/04/zsh-zle-custom-widgets/).** This is a modular zsh config framework, originally built by [Andrew Brinker](https://github.com/AndrewBrinker/zsh). At the top level there is a simple `zshrc` that when loaded will find all of the files ending in `.sh` and load them in. The directory structure is pretty self explanatory - there's a folder for aliases, various config and some exports that contain handy functions. The `setup` script is called by the `install` script one level up. It checks that zsh is installed, and that it is the default shell. ## Plugin Manager We use https://github.com/tarjoilija/zgen for loading plugins. You can see the list of plugins used in the `zshrc` file in this directory.
Add notes to zshrc readme regarding plugin location
Add notes to zshrc readme regarding plugin location
Markdown
mit
issmirnov/dotfiles,issmirnov/dotfiles,issmirnov/dotfiles,issmirnov/dotfiles
markdown
## Code Before: **WARNING: This config uses `bindkey -v` rather than the [emacs default](https://sgeb.io/posts/2014/04/zsh-zle-custom-widgets/).** This is a modular zsh config framework, originally built by [Andrew Brinker](https://github.com/AndrewBrinker/zsh). At the top level there is a simple `zshrc` that when loaded will find all of the files ending in `.sh` and load them in. The directory structure is pretty self explanatory - there's a folder for aliases, various config and some exports that contain handy functions. The `setup` script is called by the `install` script one level up. It checks that zsh is installed, and that it is the default shell. ## Plugin Manager We use https://github.com/tarjoilija/zgen for loading plugins. ## Instruction: Add notes to zshrc readme regarding plugin location ## Code After: **WARNING: This config uses `bindkey -v` rather than the [emacs default](https://sgeb.io/posts/2014/04/zsh-zle-custom-widgets/).** This is a modular zsh config framework, originally built by [Andrew Brinker](https://github.com/AndrewBrinker/zsh). At the top level there is a simple `zshrc` that when loaded will find all of the files ending in `.sh` and load them in. The directory structure is pretty self explanatory - there's a folder for aliases, various config and some exports that contain handy functions. The `setup` script is called by the `install` script one level up. It checks that zsh is installed, and that it is the default shell. ## Plugin Manager We use https://github.com/tarjoilija/zgen for loading plugins. You can see the list of plugins used in the `zshrc` file in this directory.
**WARNING: This config uses `bindkey -v` rather than the [emacs default](https://sgeb.io/posts/2014/04/zsh-zle-custom-widgets/).** This is a modular zsh config framework, originally built by [Andrew Brinker](https://github.com/AndrewBrinker/zsh). At the top level there is a simple `zshrc` that when loaded will find all of the files ending in `.sh` and load them in. The directory structure is pretty self explanatory - there's a folder for aliases, various config and some exports that contain handy functions. The `setup` script is called by the `install` script one level up. It checks that zsh is installed, and that it is the default shell. ## Plugin Manager We use https://github.com/tarjoilija/zgen for loading plugins. + You can see the list of plugins used in the `zshrc` file in this directory.
1
0.058824
1
0
c75282e796a4d21e9ab2458cb1dc7494cfe64265
src/index.coffee
src/index.coffee
'use strict' initSkeleton = require 'init-skeleton' sysPath = require 'path' watch = require './watch' logger = require 'loggy' create = (skeleton, path = '.') -> unless skeleton logger.error ''' You must specify skeleton (boilerplate) from which brunch will initialize new app: brunch new --skeleton <path-or-URI> You can specify directory on disk, Git URL or GitHub url (gh:user/repo). Some suggestions: * `gh:brunch/dead-simple` if you want no opinions. Just initializes configs and empty directories. * `gh:paulmillr/brunch-with-chaplin`: Brunch with Chaplin (Backbone, Chaplin, CoffeeScript). The most popular skeleton All other skeletons (40+) are available at http://git.io/skeletons ''' return initSkeleton skeleton, path module.exports = { new: create build: watch.bind(null, false) watch: watch.bind(null, true) }
'use strict' initSkeleton = require 'init-skeleton' sysPath = require 'path' watch = require './watch' logger = require 'loggy' create = (skeleton, path = '.') -> unless skeleton logger.error ''' You must specify skeleton (boilerplate) from which brunch will initialize new app. You can specify directory on disk, Git URL or GitHub uri (gh:user/repo): brunch new --skeleton <path-or-URI> Some suggestions: * gh:paulmillr/brunch-with-chaplin — Brunch with Chaplin (Backbone, Chaplin, CoffeeScript). The most popular skeleton * gh:brunch/dead-simple — if you want no opinions. Just initializes configs and empty directories. * gh:gcollazo/brunch-with-ember-reloaded — official Ember.js starter kit + Handlebars + CoffeeScript + Stylus * gh:scotch/angular-brunch-seed — Angular.js + CoffeeScript + Jade + stylus + Karma + Bootstrap.js All other skeletons (40+) are available at http://git.io/skeletons ''' return initSkeleton skeleton, path module.exports = { new: create build: watch.bind(null, false) watch: watch.bind(null, true) }
Add ember and angular skeletons to suggestions.
Add ember and angular skeletons to suggestions.
CoffeeScript
mit
kidaa/brunch,rlugojr/brunch,hayesgm/brunch,hellyeahllc/brunch,justinwoo/brunch,lalomartins/brunch,Flaise/brunch,ondreian/brunch,brunch/brunch,PeterDaveHello/brunch
coffeescript
## Code Before: 'use strict' initSkeleton = require 'init-skeleton' sysPath = require 'path' watch = require './watch' logger = require 'loggy' create = (skeleton, path = '.') -> unless skeleton logger.error ''' You must specify skeleton (boilerplate) from which brunch will initialize new app: brunch new --skeleton <path-or-URI> You can specify directory on disk, Git URL or GitHub url (gh:user/repo). Some suggestions: * `gh:brunch/dead-simple` if you want no opinions. Just initializes configs and empty directories. * `gh:paulmillr/brunch-with-chaplin`: Brunch with Chaplin (Backbone, Chaplin, CoffeeScript). The most popular skeleton All other skeletons (40+) are available at http://git.io/skeletons ''' return initSkeleton skeleton, path module.exports = { new: create build: watch.bind(null, false) watch: watch.bind(null, true) } ## Instruction: Add ember and angular skeletons to suggestions. ## Code After: 'use strict' initSkeleton = require 'init-skeleton' sysPath = require 'path' watch = require './watch' logger = require 'loggy' create = (skeleton, path = '.') -> unless skeleton logger.error ''' You must specify skeleton (boilerplate) from which brunch will initialize new app. You can specify directory on disk, Git URL or GitHub uri (gh:user/repo): brunch new --skeleton <path-or-URI> Some suggestions: * gh:paulmillr/brunch-with-chaplin — Brunch with Chaplin (Backbone, Chaplin, CoffeeScript). The most popular skeleton * gh:brunch/dead-simple — if you want no opinions. Just initializes configs and empty directories. * gh:gcollazo/brunch-with-ember-reloaded — official Ember.js starter kit + Handlebars + CoffeeScript + Stylus * gh:scotch/angular-brunch-seed — Angular.js + CoffeeScript + Jade + stylus + Karma + Bootstrap.js All other skeletons (40+) are available at http://git.io/skeletons ''' return initSkeleton skeleton, path module.exports = { new: create build: watch.bind(null, false) watch: watch.bind(null, true) }
'use strict' initSkeleton = require 'init-skeleton' sysPath = require 'path' watch = require './watch' logger = require 'loggy' create = (skeleton, path = '.') -> unless skeleton logger.error ''' - You must specify skeleton (boilerplate) from which brunch will initialize new app: ? ^ + You must specify skeleton (boilerplate) from which brunch will initialize new app. ? ^ + + You can specify directory on disk, Git URL or GitHub uri (gh:user/repo): brunch new --skeleton <path-or-URI> - You can specify directory on disk, Git URL or GitHub url (gh:user/repo). - Some suggestions: + * gh:paulmillr/brunch-with-chaplin — Brunch with Chaplin (Backbone, Chaplin, CoffeeScript). The most popular skeleton - * `gh:brunch/dead-simple` if you want no opinions. Just initializes configs and empty directories. ? - ^ + * gh:brunch/dead-simple — if you want no opinions. Just initializes configs and empty directories. ? ^^ - * `gh:paulmillr/brunch-with-chaplin`: Brunch with Chaplin (Backbone, Chaplin, CoffeeScript). The most popular skeleton + * gh:gcollazo/brunch-with-ember-reloaded — official Ember.js starter kit + Handlebars + CoffeeScript + Stylus + * gh:scotch/angular-brunch-seed — Angular.js + CoffeeScript + Jade + stylus + Karma + Bootstrap.js All other skeletons (40+) are available at http://git.io/skeletons ''' return initSkeleton skeleton, path module.exports = { new: create build: watch.bind(null, false) watch: watch.bind(null, true) }
12
0.375
7
5
634b2d2e52aad265fdbb2563a014e72cef5a5618
api/environment.php
api/environment.php
<?php // Copyright 2019 Peter Beverloo. All rights reserved. // Use of this source code is governed by the MIT license, a copy of which can // be found in the LICENSE file. error_reporting((E_ALL | E_STRICT) & ~E_WARNING); ini_set('display_errors', 1); require __DIR__ . '/../vendor/autoload.php'; require __DIR__ . '/error.php'; Header('Access-Control-Allow-Origin: *'); Header('Content-Type: application/json'); $environment = \Anime\Environment::createForHostname($_SERVER['HTTP_HOST']); if (!$environment->isValid()) dieWithError('Unrecognized volunteer portal environment.'); echo json_encode([ 'contactName' => 'Peter', 'contactTarget' => 'mailto:' . $environment->getContact(), 'title' => $environment->getName(), 'events' => [ [ 'name' => 'AnimeCon 2021', 'enablePortal' => false, 'enableRegistration' => false, 'timezone' => 'Europe/Amsterdam', 'website' => 'https://www.animecon.nl/', ], ], ]);
<?php // Copyright 2019 Peter Beverloo. All rights reserved. // Use of this source code is governed by the MIT license, a copy of which can // be found in the LICENSE file. error_reporting((E_ALL | E_STRICT) & ~E_WARNING); ini_set('display_errors', 1); require __DIR__ . '/../vendor/autoload.php'; require __DIR__ . '/error.php'; Header('Access-Control-Allow-Origin: *'); Header('Content-Type: application/json'); $environment = \Anime\Environment::createForHostname($_SERVER['HTTP_HOST']); if (!$environment->isValid()) dieWithError('Unrecognized volunteer portal environment.'); echo json_encode([ 'contactName' => 'Peter', 'contactTarget' => 'mailto:' . $environment->getContact(), 'title' => $environment->getName(), 'events' => [ [ 'name' => 'AnimeCon 2021', 'enablePortal' => false, 'enableRegistration' => false, 'slug' => '2021', 'timezone' => 'Europe/Amsterdam', 'website' => 'https://www.animecon.nl/', ], ], ]);
Include a slug for the upcoming event
Include a slug for the upcoming event
PHP
mit
AnimeNL/anime-2016,AnimeNL/anime-2016,AnimeNL/anime-2016
php
## Code Before: <?php // Copyright 2019 Peter Beverloo. All rights reserved. // Use of this source code is governed by the MIT license, a copy of which can // be found in the LICENSE file. error_reporting((E_ALL | E_STRICT) & ~E_WARNING); ini_set('display_errors', 1); require __DIR__ . '/../vendor/autoload.php'; require __DIR__ . '/error.php'; Header('Access-Control-Allow-Origin: *'); Header('Content-Type: application/json'); $environment = \Anime\Environment::createForHostname($_SERVER['HTTP_HOST']); if (!$environment->isValid()) dieWithError('Unrecognized volunteer portal environment.'); echo json_encode([ 'contactName' => 'Peter', 'contactTarget' => 'mailto:' . $environment->getContact(), 'title' => $environment->getName(), 'events' => [ [ 'name' => 'AnimeCon 2021', 'enablePortal' => false, 'enableRegistration' => false, 'timezone' => 'Europe/Amsterdam', 'website' => 'https://www.animecon.nl/', ], ], ]); ## Instruction: Include a slug for the upcoming event ## Code After: <?php // Copyright 2019 Peter Beverloo. All rights reserved. // Use of this source code is governed by the MIT license, a copy of which can // be found in the LICENSE file. error_reporting((E_ALL | E_STRICT) & ~E_WARNING); ini_set('display_errors', 1); require __DIR__ . '/../vendor/autoload.php'; require __DIR__ . '/error.php'; Header('Access-Control-Allow-Origin: *'); Header('Content-Type: application/json'); $environment = \Anime\Environment::createForHostname($_SERVER['HTTP_HOST']); if (!$environment->isValid()) dieWithError('Unrecognized volunteer portal environment.'); echo json_encode([ 'contactName' => 'Peter', 'contactTarget' => 'mailto:' . $environment->getContact(), 'title' => $environment->getName(), 'events' => [ [ 'name' => 'AnimeCon 2021', 'enablePortal' => false, 'enableRegistration' => false, 'slug' => '2021', 'timezone' => 'Europe/Amsterdam', 'website' => 'https://www.animecon.nl/', ], ], ]);
<?php // Copyright 2019 Peter Beverloo. All rights reserved. // Use of this source code is governed by the MIT license, a copy of which can // be found in the LICENSE file. error_reporting((E_ALL | E_STRICT) & ~E_WARNING); ini_set('display_errors', 1); require __DIR__ . '/../vendor/autoload.php'; require __DIR__ . '/error.php'; Header('Access-Control-Allow-Origin: *'); Header('Content-Type: application/json'); $environment = \Anime\Environment::createForHostname($_SERVER['HTTP_HOST']); if (!$environment->isValid()) dieWithError('Unrecognized volunteer portal environment.'); echo json_encode([ 'contactName' => 'Peter', 'contactTarget' => 'mailto:' . $environment->getContact(), 'title' => $environment->getName(), 'events' => [ [ 'name' => 'AnimeCon 2021', 'enablePortal' => false, 'enableRegistration' => false, + 'slug' => '2021', 'timezone' => 'Europe/Amsterdam', 'website' => 'https://www.animecon.nl/', ], ], ]);
1
0.030303
1
0
fe36e3381e6dffefaef727d8590b35f96780a128
CMakeLists.txt
CMakeLists.txt
cmake_minimum_required(VERSION 3.4 FATAL_ERROR) project(blue-sky-re) # set c++ standard set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) # add module path set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) # set bitness include(bitness) include(buildtype) # third party dir set(THIRD_PARTY_DIR ${CMAKE_SOURCE_DIR}/third_party) # output dir if(NOT BS_OUTPUT_DIR) set(BS_OUTPUT_DIR ${CMAKE_SOURCE_DIR}/exe/${CMAKE_BUILD_TYPE}${SYSTEM_BITNESS}-${CMAKE_SYSTEM_NAME}) endif() set(PLUGIN_OUTPUT_DIR ${BS_OUTPUT_DIR}/plugins) link_directories(${BS_OUTPUT_DIR}) # includes include(definitions) include(all) # subprojects if(NOT PY) set(PY 0) endif() if(UNIX) add_subdirectory(${THIRD_PARTY_DIR}/actor-framework) endif() add_subdirectory(kernel) if(PY EQUAL 1) add_subdirectory(python/bspy_loader) endif() add_subdir( ${CMAKE_SOURCE_DIR}/plugins/bs-hawk ${CMAKE_SOURCE_DIR}/plugins/smadopt ${CMAKE_SOURCE_DIR}/plugins/witsml ${CMAKE_SOURCE_DIR}/plugins/rnkin-fuse )
cmake_minimum_required(VERSION 3.4 FATAL_ERROR) project(blue-sky-re) # set c++ standard set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) # add module path set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) # set bitness include(bitness) include(buildtype) # third party dir set(THIRD_PARTY_DIR ${CMAKE_SOURCE_DIR}/third_party) # output dir if(NOT BS_OUTPUT_DIR) set(BS_OUTPUT_DIR ${CMAKE_SOURCE_DIR}/exe/${CMAKE_BUILD_TYPE}${SYSTEM_BITNESS}-${CMAKE_SYSTEM_NAME}) endif() set(PLUGIN_OUTPUT_DIR ${BS_OUTPUT_DIR}/plugins) link_directories(${BS_OUTPUT_DIR}) # includes include(definitions) include(all) # subprojects if(NOT PY) set(PY 0) endif() if(UNIX) add_subdirectory(${THIRD_PARTY_DIR}/actor-framework) endif() add_subdirectory(kernel) if(PY EQUAL 1) add_subdirectory(python/bspy_loader) endif() if(NOT AUTO_FIND_PLUGINS) set(AUTO_FIND_PLUGINS 0) endif() set(AUTO_FIND_PLUGINS 1) init_plugins(${AUTO_FIND_PLUGINS})
Remove hardcoded adding subdirectories of plugins.
build/CMake: Remove hardcoded adding subdirectories of plugins.
Text
mpl-2.0
uentity/blue-sky-re,uentity/blue-sky-re,uentity/blue-sky-re
text
## Code Before: cmake_minimum_required(VERSION 3.4 FATAL_ERROR) project(blue-sky-re) # set c++ standard set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) # add module path set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) # set bitness include(bitness) include(buildtype) # third party dir set(THIRD_PARTY_DIR ${CMAKE_SOURCE_DIR}/third_party) # output dir if(NOT BS_OUTPUT_DIR) set(BS_OUTPUT_DIR ${CMAKE_SOURCE_DIR}/exe/${CMAKE_BUILD_TYPE}${SYSTEM_BITNESS}-${CMAKE_SYSTEM_NAME}) endif() set(PLUGIN_OUTPUT_DIR ${BS_OUTPUT_DIR}/plugins) link_directories(${BS_OUTPUT_DIR}) # includes include(definitions) include(all) # subprojects if(NOT PY) set(PY 0) endif() if(UNIX) add_subdirectory(${THIRD_PARTY_DIR}/actor-framework) endif() add_subdirectory(kernel) if(PY EQUAL 1) add_subdirectory(python/bspy_loader) endif() add_subdir( ${CMAKE_SOURCE_DIR}/plugins/bs-hawk ${CMAKE_SOURCE_DIR}/plugins/smadopt ${CMAKE_SOURCE_DIR}/plugins/witsml ${CMAKE_SOURCE_DIR}/plugins/rnkin-fuse ) ## Instruction: build/CMake: Remove hardcoded adding subdirectories of plugins. ## Code After: cmake_minimum_required(VERSION 3.4 FATAL_ERROR) project(blue-sky-re) # set c++ standard set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) # add module path set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) # set bitness include(bitness) include(buildtype) # third party dir set(THIRD_PARTY_DIR ${CMAKE_SOURCE_DIR}/third_party) # output dir if(NOT BS_OUTPUT_DIR) set(BS_OUTPUT_DIR ${CMAKE_SOURCE_DIR}/exe/${CMAKE_BUILD_TYPE}${SYSTEM_BITNESS}-${CMAKE_SYSTEM_NAME}) endif() set(PLUGIN_OUTPUT_DIR ${BS_OUTPUT_DIR}/plugins) link_directories(${BS_OUTPUT_DIR}) # includes include(definitions) include(all) # subprojects if(NOT PY) set(PY 0) endif() if(UNIX) add_subdirectory(${THIRD_PARTY_DIR}/actor-framework) endif() add_subdirectory(kernel) if(PY EQUAL 1) add_subdirectory(python/bspy_loader) endif() if(NOT AUTO_FIND_PLUGINS) set(AUTO_FIND_PLUGINS 0) endif() set(AUTO_FIND_PLUGINS 1) init_plugins(${AUTO_FIND_PLUGINS})
cmake_minimum_required(VERSION 3.4 FATAL_ERROR) project(blue-sky-re) # set c++ standard set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) # add module path set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) # set bitness include(bitness) include(buildtype) # third party dir set(THIRD_PARTY_DIR ${CMAKE_SOURCE_DIR}/third_party) # output dir if(NOT BS_OUTPUT_DIR) set(BS_OUTPUT_DIR ${CMAKE_SOURCE_DIR}/exe/${CMAKE_BUILD_TYPE}${SYSTEM_BITNESS}-${CMAKE_SYSTEM_NAME}) endif() set(PLUGIN_OUTPUT_DIR ${BS_OUTPUT_DIR}/plugins) link_directories(${BS_OUTPUT_DIR}) # includes include(definitions) include(all) # subprojects if(NOT PY) set(PY 0) endif() if(UNIX) add_subdirectory(${THIRD_PARTY_DIR}/actor-framework) endif() add_subdirectory(kernel) if(PY EQUAL 1) add_subdirectory(python/bspy_loader) endif() - add_subdir( - ${CMAKE_SOURCE_DIR}/plugins/bs-hawk - ${CMAKE_SOURCE_DIR}/plugins/smadopt - ${CMAKE_SOURCE_DIR}/plugins/witsml - ${CMAKE_SOURCE_DIR}/plugins/rnkin-fuse - ) + if(NOT AUTO_FIND_PLUGINS) + set(AUTO_FIND_PLUGINS 0) + endif() + + set(AUTO_FIND_PLUGINS 1) + init_plugins(${AUTO_FIND_PLUGINS})
12
0.307692
6
6
648c871f388503578a17c5f03d838acd674bec93
README.md
README.md
Introduction ------------ Larasearch is a Laravel package that aims to seamlessly integrate Elasticsearch functionality with the Eloquent ORM. Features -------- - Plug 'n Play searching functionality for Eloquent models - Automatic creation/indexing based on Eloquent model properties and relations - Aggregations, Suggestions, Autocomplete, Highlighting, etc. It's all there! - Load Eloquent models based on Elasticsearch queries - Automatic reindexing on updates of (related) Eloquent models Installation ------------ Add Larasearch to your composer.json file: ```"iverberk/larasearch": "0.6.*"``` Add the service provider to your Laravel application config: ```PHP 'Iverberk\Larasearch\LarasearchServiceProvider' ``` Wiki ---- Please see the Github [wiki](https://github.com/iverberk/larasearch/wiki/Introduction) for the most up-to-date documentation. Credits ------- This package is very much inspired by these excellent packages that already exist for the Ruby/Rails ecosystem. * [Searchkick](https://github.com/ankane/searchkick) * [Elasticsearch Rails](https://github.com/elasticsearch/elasticsearch-rails) A lot of their ideas have been reused to work within a PHP/Laravel environment.
Introduction ------------ Larasearch is a Laravel package that aims to seamlessly integrate Elasticsearch functionality with the Eloquent ORM. Features -------- - Plug 'n Play searching functionality for Eloquent models - Automatic creation/indexing based on Eloquent model properties and relations - Aggregations, Suggestions, Autocomplete, Highlighting, etc. It's all there! - Load Eloquent models based on Elasticsearch queries - Automatic reindexing on updates of (related) Eloquent models Installation ------------ Add Larasearch to your composer.json file: ```"iverberk/larasearch": "0.6.*"``` Add the service provider to your Laravel application config: ```PHP 'Iverberk\Larasearch\LarasearchServiceProvider' ``` Wiki ---- Please see the Github [wiki](https://github.com/iverberk/larasearch/wiki/Introduction) for the most up-to-date documentation. Changelog --------- All releases are tracked and documented in the [changelog](https://github.com/iverberk/larasearch/wiki/Changelog). Credits ------- This package is very much inspired by these excellent packages that already exist for the Ruby/Rails ecosystem. * [Searchkick](https://github.com/ankane/searchkick) * [Elasticsearch Rails](https://github.com/elasticsearch/elasticsearch-rails) A lot of their ideas have been reused to work within a PHP/Laravel environment.
Document the location of the changelog
Document the location of the changelog
Markdown
mit
menthol/Flexible,Huthayfa-Malhas/larasearch,HammamSamara/larasearch,iverberk/larasearch,masterweb121/larasearch,aqlx86/larasearch,codecourse/larasearch
markdown
## Code Before: Introduction ------------ Larasearch is a Laravel package that aims to seamlessly integrate Elasticsearch functionality with the Eloquent ORM. Features -------- - Plug 'n Play searching functionality for Eloquent models - Automatic creation/indexing based on Eloquent model properties and relations - Aggregations, Suggestions, Autocomplete, Highlighting, etc. It's all there! - Load Eloquent models based on Elasticsearch queries - Automatic reindexing on updates of (related) Eloquent models Installation ------------ Add Larasearch to your composer.json file: ```"iverberk/larasearch": "0.6.*"``` Add the service provider to your Laravel application config: ```PHP 'Iverberk\Larasearch\LarasearchServiceProvider' ``` Wiki ---- Please see the Github [wiki](https://github.com/iverberk/larasearch/wiki/Introduction) for the most up-to-date documentation. Credits ------- This package is very much inspired by these excellent packages that already exist for the Ruby/Rails ecosystem. * [Searchkick](https://github.com/ankane/searchkick) * [Elasticsearch Rails](https://github.com/elasticsearch/elasticsearch-rails) A lot of their ideas have been reused to work within a PHP/Laravel environment. ## Instruction: Document the location of the changelog ## Code After: Introduction ------------ Larasearch is a Laravel package that aims to seamlessly integrate Elasticsearch functionality with the Eloquent ORM. Features -------- - Plug 'n Play searching functionality for Eloquent models - Automatic creation/indexing based on Eloquent model properties and relations - Aggregations, Suggestions, Autocomplete, Highlighting, etc. It's all there! - Load Eloquent models based on Elasticsearch queries - Automatic reindexing on updates of (related) Eloquent models Installation ------------ Add Larasearch to your composer.json file: ```"iverberk/larasearch": "0.6.*"``` Add the service provider to your Laravel application config: ```PHP 'Iverberk\Larasearch\LarasearchServiceProvider' ``` Wiki ---- Please see the Github [wiki](https://github.com/iverberk/larasearch/wiki/Introduction) for the most up-to-date documentation. Changelog --------- All releases are tracked and documented in the [changelog](https://github.com/iverberk/larasearch/wiki/Changelog). Credits ------- This package is very much inspired by these excellent packages that already exist for the Ruby/Rails ecosystem. * [Searchkick](https://github.com/ankane/searchkick) * [Elasticsearch Rails](https://github.com/elasticsearch/elasticsearch-rails) A lot of their ideas have been reused to work within a PHP/Laravel environment.
Introduction ------------ Larasearch is a Laravel package that aims to seamlessly integrate Elasticsearch functionality with the Eloquent ORM. Features -------- - Plug 'n Play searching functionality for Eloquent models - Automatic creation/indexing based on Eloquent model properties and relations - Aggregations, Suggestions, Autocomplete, Highlighting, etc. It's all there! - Load Eloquent models based on Elasticsearch queries - Automatic reindexing on updates of (related) Eloquent models Installation ------------ Add Larasearch to your composer.json file: ```"iverberk/larasearch": "0.6.*"``` Add the service provider to your Laravel application config: ```PHP 'Iverberk\Larasearch\LarasearchServiceProvider' ``` Wiki ---- Please see the Github [wiki](https://github.com/iverberk/larasearch/wiki/Introduction) for the most up-to-date documentation. + Changelog + --------- + All releases are tracked and documented in the [changelog](https://github.com/iverberk/larasearch/wiki/Changelog). + Credits ------- This package is very much inspired by these excellent packages that already exist for the Ruby/Rails ecosystem. * [Searchkick](https://github.com/ankane/searchkick) * [Elasticsearch Rails](https://github.com/elasticsearch/elasticsearch-rails) A lot of their ideas have been reused to work within a PHP/Laravel environment.
4
0.102564
4
0
da2b4f7e06bf240fef45e811595b96f2a9a72823
ovh/docker-compose.yml
ovh/docker-compose.yml
version: "3.2" services: lapi: build: context: . dockerfile: lapi.dockerfile restart: unless-stopped enviroment: - BROKER_HOST: mqtt.lambdaspace.gr - BROKER_PORT: 1883 - MQTT_TOPIC_HACKERS: "lambdaspace/spacestatus/hackers" - MQTT_TOPIC_STATS: "lambdaspace/spacestatus/stats" caddy: image: abiosoft/caddy restart: unless-stopped volumes: - ./Caddyfile:/etc/Caddyfile:ro ports: - 80:80 - 443:443 links: - lapi - rancher
version: "3.2" services: lapi: build: context: . dockerfile: lapi.dockerfile restart: unless-stopped enviroment: - BROKER_HOST: mqtt.lambdaspace.gr - BROKER_PORT: 1883 - MQTT_TOPIC_HACKERS: "lambdaspace/spacestatus/hackers" - MQTT_TOPIC_STATS: "lambdaspace/spacestatus/stats" caddy: image: abiosoft/caddy restart: unless-stopped volumes: - ./Caddyfile:/etc/Caddyfile:ro ports: - 80:80 - 443:443 links: - lapi
Remove link to deleted container
fix: Remove link to deleted container
YAML
mit
techministry/website-dockerfile
yaml
## Code Before: version: "3.2" services: lapi: build: context: . dockerfile: lapi.dockerfile restart: unless-stopped enviroment: - BROKER_HOST: mqtt.lambdaspace.gr - BROKER_PORT: 1883 - MQTT_TOPIC_HACKERS: "lambdaspace/spacestatus/hackers" - MQTT_TOPIC_STATS: "lambdaspace/spacestatus/stats" caddy: image: abiosoft/caddy restart: unless-stopped volumes: - ./Caddyfile:/etc/Caddyfile:ro ports: - 80:80 - 443:443 links: - lapi - rancher ## Instruction: fix: Remove link to deleted container ## Code After: version: "3.2" services: lapi: build: context: . dockerfile: lapi.dockerfile restart: unless-stopped enviroment: - BROKER_HOST: mqtt.lambdaspace.gr - BROKER_PORT: 1883 - MQTT_TOPIC_HACKERS: "lambdaspace/spacestatus/hackers" - MQTT_TOPIC_STATS: "lambdaspace/spacestatus/stats" caddy: image: abiosoft/caddy restart: unless-stopped volumes: - ./Caddyfile:/etc/Caddyfile:ro ports: - 80:80 - 443:443 links: - lapi
version: "3.2" services: lapi: build: context: . dockerfile: lapi.dockerfile restart: unless-stopped enviroment: - BROKER_HOST: mqtt.lambdaspace.gr - BROKER_PORT: 1883 - MQTT_TOPIC_HACKERS: "lambdaspace/spacestatus/hackers" - MQTT_TOPIC_STATS: "lambdaspace/spacestatus/stats" caddy: image: abiosoft/caddy restart: unless-stopped volumes: - ./Caddyfile:/etc/Caddyfile:ro ports: - 80:80 - 443:443 links: - lapi - - rancher
1
0.041667
0
1
4aeda431d8bc405074e9f3312360577d9c1f2f96
src/code/utils/scale-app.ts
src/code/utils/scale-app.ts
import * as screenfull from "screenfull"; import { DOMElement } from "react"; const getWindowTransforms = () => { const MAX_WIDTH = 2000; const width = Math.max(window.innerWidth, Math.min(MAX_WIDTH, screen.width)); const scale = window.innerWidth / width; const height = window.innerHeight / scale; return { scale, unscaledWidth: width, unscaledHeight: height }; }; const setScaling = (el: ElementCSSInlineStyle) => () => { if (!screenfull.isEnabled || !screenfull.isFullscreen) { const trans = getWindowTransforms(); el.style.width = trans.unscaledWidth + "px"; el.style.height = trans.unscaledHeight + "px"; el.style.transformOrigin = "top left"; el.style.transform = "scale3d(" + trans.scale + "," + trans.scale + ",1)"; } else { // Disable scaling in fullscreen mode. el.style.width = "100%"; el.style.height = "100%"; el.style.transform = "scale3d(1,1,1)"; } }; export default function scaleApp(el: ElementCSSInlineStyle) { const scaleElement = setScaling(el); scaleElement(); window.addEventListener("resize", scaleElement); }
import * as screenfull from "screenfull"; import { DOMElement } from "react"; const getWindowTransforms = () => { const MAX_WIDTH = 2000; const width = Math.max(window.innerWidth, Math.min(MAX_WIDTH, screen.width)); const scale = window.innerWidth / width; const height = window.innerHeight / scale; return { scale, unscaledWidth: width, unscaledHeight: height }; }; const setScaling = (el: ElementCSSInlineStyle) => () => { if (!screenfull.isEnabled || !screenfull.isFullscreen) { const trans = getWindowTransforms(); el.style.width = trans.unscaledWidth + "px"; el.style.height = trans.unscaledHeight + "px"; el.style.transformOrigin = "top left"; el.style.transform = "scale3d(" + trans.scale + "," + trans.scale + ",1)"; // if we have fullscreen help text, make it big const helpText = document.getElementsByClassName("fullscreen-help")[0] as unknown as ElementCSSInlineStyle; if (helpText) { helpText.style.fontSize = Math.round(Math.pow(Math.min(window.innerWidth, 500), 0.65)) + "px"; } } else { // Disable scaling in fullscreen mode. el.style.width = "100%"; el.style.height = "100%"; el.style.transform = "scale3d(1,1,1)"; } }; export default function scaleApp(el: ElementCSSInlineStyle) { const scaleElement = setScaling(el); scaleElement(); window.addEventListener("resize", scaleElement); }
Make help text big even at small scales
Make help text big even at small scales
TypeScript
mit
concord-consortium/building-models,concord-consortium/building-models,concord-consortium/building-models,concord-consortium/building-models,concord-consortium/building-models
typescript
## Code Before: import * as screenfull from "screenfull"; import { DOMElement } from "react"; const getWindowTransforms = () => { const MAX_WIDTH = 2000; const width = Math.max(window.innerWidth, Math.min(MAX_WIDTH, screen.width)); const scale = window.innerWidth / width; const height = window.innerHeight / scale; return { scale, unscaledWidth: width, unscaledHeight: height }; }; const setScaling = (el: ElementCSSInlineStyle) => () => { if (!screenfull.isEnabled || !screenfull.isFullscreen) { const trans = getWindowTransforms(); el.style.width = trans.unscaledWidth + "px"; el.style.height = trans.unscaledHeight + "px"; el.style.transformOrigin = "top left"; el.style.transform = "scale3d(" + trans.scale + "," + trans.scale + ",1)"; } else { // Disable scaling in fullscreen mode. el.style.width = "100%"; el.style.height = "100%"; el.style.transform = "scale3d(1,1,1)"; } }; export default function scaleApp(el: ElementCSSInlineStyle) { const scaleElement = setScaling(el); scaleElement(); window.addEventListener("resize", scaleElement); } ## Instruction: Make help text big even at small scales ## Code After: import * as screenfull from "screenfull"; import { DOMElement } from "react"; const getWindowTransforms = () => { const MAX_WIDTH = 2000; const width = Math.max(window.innerWidth, Math.min(MAX_WIDTH, screen.width)); const scale = window.innerWidth / width; const height = window.innerHeight / scale; return { scale, unscaledWidth: width, unscaledHeight: height }; }; const setScaling = (el: ElementCSSInlineStyle) => () => { if (!screenfull.isEnabled || !screenfull.isFullscreen) { const trans = getWindowTransforms(); el.style.width = trans.unscaledWidth + "px"; el.style.height = trans.unscaledHeight + "px"; el.style.transformOrigin = "top left"; el.style.transform = "scale3d(" + trans.scale + "," + trans.scale + ",1)"; // if we have fullscreen help text, make it big const helpText = document.getElementsByClassName("fullscreen-help")[0] as unknown as ElementCSSInlineStyle; if (helpText) { helpText.style.fontSize = Math.round(Math.pow(Math.min(window.innerWidth, 500), 0.65)) + "px"; } } else { // Disable scaling in fullscreen mode. el.style.width = "100%"; el.style.height = "100%"; el.style.transform = "scale3d(1,1,1)"; } }; export default function scaleApp(el: ElementCSSInlineStyle) { const scaleElement = setScaling(el); scaleElement(); window.addEventListener("resize", scaleElement); }
import * as screenfull from "screenfull"; import { DOMElement } from "react"; const getWindowTransforms = () => { const MAX_WIDTH = 2000; const width = Math.max(window.innerWidth, Math.min(MAX_WIDTH, screen.width)); const scale = window.innerWidth / width; const height = window.innerHeight / scale; return { scale, unscaledWidth: width, unscaledHeight: height }; }; const setScaling = (el: ElementCSSInlineStyle) => () => { if (!screenfull.isEnabled || !screenfull.isFullscreen) { const trans = getWindowTransforms(); el.style.width = trans.unscaledWidth + "px"; el.style.height = trans.unscaledHeight + "px"; el.style.transformOrigin = "top left"; el.style.transform = "scale3d(" + trans.scale + "," + trans.scale + ",1)"; + + // if we have fullscreen help text, make it big + const helpText = document.getElementsByClassName("fullscreen-help")[0] as unknown as ElementCSSInlineStyle; + if (helpText) { + helpText.style.fontSize = Math.round(Math.pow(Math.min(window.innerWidth, 500), 0.65)) + "px"; + } } else { // Disable scaling in fullscreen mode. el.style.width = "100%"; el.style.height = "100%"; el.style.transform = "scale3d(1,1,1)"; } }; export default function scaleApp(el: ElementCSSInlineStyle) { const scaleElement = setScaling(el); scaleElement(); window.addEventListener("resize", scaleElement); }
6
0.171429
6
0
66c78e89005a1493f354568a74e36e683cf1d375
week-4/nums-letter.md
week-4/nums-letter.md
* What does puts do? * What is an integer? What is a float? * What is the difference between float and integer division? How would you explain the difference to someone who doesn't know anything about programming? ```ruby hours_in_a_day = 365 * 24 puts hours_in_a_day ``` ```ruby minutes_in_a_decade = 365 * 24 * 60 * 10 puts minutes_in_a_decade ```
* What does puts do? * What is an integer? What is a float? * What is the difference between float and integer division? How would you explain the difference to someone who doesn't know anything about programming? The method puts (short for put string) prints a string of the output given to the console along with a new line. An integer is a whole number without any decimals. A float, on the other hand, is a number with decimals. Float division allows you to divide two float numbers--numbers with decimals--the output of which will include any decimal numbers (i.e. 5/2 => 2.5). Integer division divides whole numbers without the decimals, the output of which is also a whole number rounded down (i.e. 9/2 => 4). ## Release 2 ```ruby hours_in_a_day = 365 * 24 puts hours_in_a_day ``` ```ruby minutes_in_a_decade = 365 * 24 * 60 * 10 puts minutes_in_a_decade ``` ## Release 5 [4.2.1 Defining Variables](defining-variables.rb) [4.2.2 Simple String Methods](simple-string.rb) [4.2.3 Local Variables and Basic Arithmetic Operations](basic-math.rb)
Add release 1-5 to reflection and test links
Add release 1-5 to reflection and test links
Markdown
mit
countaight/phase-0,countaight/phase-0,countaight/phase-0
markdown
## Code Before: * What does puts do? * What is an integer? What is a float? * What is the difference between float and integer division? How would you explain the difference to someone who doesn't know anything about programming? ```ruby hours_in_a_day = 365 * 24 puts hours_in_a_day ``` ```ruby minutes_in_a_decade = 365 * 24 * 60 * 10 puts minutes_in_a_decade ``` ## Instruction: Add release 1-5 to reflection and test links ## Code After: * What does puts do? * What is an integer? What is a float? * What is the difference between float and integer division? How would you explain the difference to someone who doesn't know anything about programming? The method puts (short for put string) prints a string of the output given to the console along with a new line. An integer is a whole number without any decimals. A float, on the other hand, is a number with decimals. Float division allows you to divide two float numbers--numbers with decimals--the output of which will include any decimal numbers (i.e. 5/2 => 2.5). Integer division divides whole numbers without the decimals, the output of which is also a whole number rounded down (i.e. 9/2 => 4). ## Release 2 ```ruby hours_in_a_day = 365 * 24 puts hours_in_a_day ``` ```ruby minutes_in_a_decade = 365 * 24 * 60 * 10 puts minutes_in_a_decade ``` ## Release 5 [4.2.1 Defining Variables](defining-variables.rb) [4.2.2 Simple String Methods](simple-string.rb) [4.2.3 Local Variables and Basic Arithmetic Operations](basic-math.rb)
* What does puts do? * What is an integer? What is a float? * What is the difference between float and integer division? How would you explain the difference to someone who doesn't know anything about programming? + + The method puts (short for put string) prints a string of the output given to the console along with a new line. + + An integer is a whole number without any decimals. A float, on the other hand, is a number with decimals. + + Float division allows you to divide two float numbers--numbers with decimals--the output of which will include any decimal numbers (i.e. 5/2 => 2.5). Integer division divides whole numbers without the decimals, the output of which is also a whole number rounded down (i.e. 9/2 => 4). + + + ## Release 2 ```ruby hours_in_a_day = 365 * 24 puts hours_in_a_day ``` ```ruby minutes_in_a_decade = 365 * 24 * 60 * 10 puts minutes_in_a_decade ``` + + + ## Release 5 + + [4.2.1 Defining Variables](defining-variables.rb) + [4.2.2 Simple String Methods](simple-string.rb) + [4.2.3 Local Variables and Basic Arithmetic Operations](basic-math.rb) +
17
1.214286
17
0
1751ec356b78b0358abe3829159e084484f310b4
files/ansible_run_all.sh
files/ansible_run_all.sh
cd /etc/ansible for i in playbooks/deploy*.yml; do logger "Started run of $i in ansible_run_all.sh" ansible-playbook -D $i $* logger "Finished run of $i in ansible_run_all.sh" done
cd /etc/ansible for i in playbooks/deploy*.yml; do logger "Started run of $i in ansible_run_all.sh" timeout 1h ansible-playbook -D $i $* logger "Finished run of $i in ansible_run_all.sh" done
Add a timeout of 1h on the run
Add a timeout of 1h on the run I stumbled today on a blocked playbook running since a while. This prevented certificate renewal with LE, so not great.
Shell
mit
mscherer/ansible-role-ansible_bastion,mscherer/ansible-role-ansible_bastion
shell
## Code Before: cd /etc/ansible for i in playbooks/deploy*.yml; do logger "Started run of $i in ansible_run_all.sh" ansible-playbook -D $i $* logger "Finished run of $i in ansible_run_all.sh" done ## Instruction: Add a timeout of 1h on the run I stumbled today on a blocked playbook running since a while. This prevented certificate renewal with LE, so not great. ## Code After: cd /etc/ansible for i in playbooks/deploy*.yml; do logger "Started run of $i in ansible_run_all.sh" timeout 1h ansible-playbook -D $i $* logger "Finished run of $i in ansible_run_all.sh" done
cd /etc/ansible for i in playbooks/deploy*.yml; do logger "Started run of $i in ansible_run_all.sh" - ansible-playbook -D $i $* + timeout 1h ansible-playbook -D $i $* ? +++++++++++ logger "Finished run of $i in ansible_run_all.sh" done
2
0.285714
1
1
8e0afc06d221d86677a172fdb7d1388225504ba6
resp/__main__.py
resp/__main__.py
import sys import argparse from Parser import Parser def main(argv): # Arguments: parser = argparse.ArgumentParser() parser.add_argument('-r', '--redis_cmd', type=str, default='') parser.add_argument('-i', '--input', type=str, default='') parser.add_argument('-d', '--delimiter', type=str, default=',') parser.add_argument('-p', '--pipe', action='store_true') args = parser.parse_args() # Parser: Parser(args.input, args.redis_cmd, args.delimiter, args.pipe) if __name__ == "__main__": main(sys.argv[1:])
import argparse from Parser import Parser def main(): # Arguments: parser = argparse.ArgumentParser() parser.add_argument('-r', '--redis_cmd', type=str, default='', required=True) parser.add_argument('-i', '--input', type=str, default='', required=False) parser.add_argument('-d', '--delimiter', type=str, default=',', required=False) parser.add_argument('-p', '--pipe', action='store_true', required=False) args = parser.parse_args() # Parser: Parser(args.input, args.redis_cmd, args.delimiter, args.pipe) if __name__ == "__main__": main()
Add specific required-property to all arguments
Add specific required-property to all arguments
Python
mit
nok/resp,nok/resp
python
## Code Before: import sys import argparse from Parser import Parser def main(argv): # Arguments: parser = argparse.ArgumentParser() parser.add_argument('-r', '--redis_cmd', type=str, default='') parser.add_argument('-i', '--input', type=str, default='') parser.add_argument('-d', '--delimiter', type=str, default=',') parser.add_argument('-p', '--pipe', action='store_true') args = parser.parse_args() # Parser: Parser(args.input, args.redis_cmd, args.delimiter, args.pipe) if __name__ == "__main__": main(sys.argv[1:]) ## Instruction: Add specific required-property to all arguments ## Code After: import argparse from Parser import Parser def main(): # Arguments: parser = argparse.ArgumentParser() parser.add_argument('-r', '--redis_cmd', type=str, default='', required=True) parser.add_argument('-i', '--input', type=str, default='', required=False) parser.add_argument('-d', '--delimiter', type=str, default=',', required=False) parser.add_argument('-p', '--pipe', action='store_true', required=False) args = parser.parse_args() # Parser: Parser(args.input, args.redis_cmd, args.delimiter, args.pipe) if __name__ == "__main__": main()
- import sys import argparse from Parser import Parser - def main(argv): ? ---- + def main(): # Arguments: parser = argparse.ArgumentParser() - parser.add_argument('-r', '--redis_cmd', type=str, default='') + parser.add_argument('-r', '--redis_cmd', type=str, default='', required=True) ? +++++++++++++++ - parser.add_argument('-i', '--input', type=str, default='') + parser.add_argument('-i', '--input', type=str, default='', required=False) ? ++++++++++++++++ - parser.add_argument('-d', '--delimiter', type=str, default=',') + parser.add_argument('-d', '--delimiter', type=str, default=',', required=False) ? ++++++++++++++++ - parser.add_argument('-p', '--pipe', action='store_true') + parser.add_argument('-p', '--pipe', action='store_true', required=False) ? ++++++++++++++++ args = parser.parse_args() # Parser: Parser(args.input, args.redis_cmd, args.delimiter, args.pipe) if __name__ == "__main__": - main(sys.argv[1:]) + main()
13
0.590909
6
7
c651cdc356913e53b3b6c875ab0a496b6ddda8ee
README.md
README.md
![atom](https://f.cloud.github.com/assets/1300064/208230/4cefbca4-821a-11e2-8139-92c0328abf68.png) Check out our [documentation on the docs tab](https://github.com/github/atom/docs). ## Installing Download the latest Atom release from [speakeasy](https://speakeasy.githubapp.com/apps/27). It will automatically update when a new build is available. ## Building ### Requirements * Mountain Lion * The Setup™ or Boxen * Xcode (available in the App Store) ### Installation 1. `gh-setup atom` 2. `cd ~/github/atom && rake install`
![atom](https://s3.amazonaws.com/speakeasy/apps/icons/27/medium/7db16e44-ba57-11e2-8c6f-981faf658e00.png) Check out our [documentation on the docs tab](https://github.com/github/atom/docs). ## Installing Download the latest Atom release from [speakeasy](https://speakeasy.githubapp.com/apps/27). It will automatically update when a new build is available. ## Building ### Requirements * Mountain Lion * The Setup™ or Boxen * Xcode (available in the App Store) ### Installation 1. `gh-setup atom` 2. `cd ~/github/atom && rake install`
Update image to match current icon
Update image to match current icon
Markdown
mit
jordanbtucker/atom,seedtigo/atom,hpham04/atom,ReddTea/atom,brumm/atom,cyzn/atom,gabrielPeart/atom,kittens/atom,mostafaeweda/atom,jjz/atom,amine7536/atom,FoldingText/atom,dannyflax/atom,erikhakansson/atom,fscherwi/atom,yamhon/atom,RuiDGoncalves/atom,AlbertoBarrago/atom,jordanbtucker/atom,yangchenghu/atom,stinsonga/atom,0x73/atom,ali/atom,hakatashi/atom,ppamorim/atom,abe33/atom,daxlab/atom,Jdesk/atom,sotayamashita/atom,jacekkopecky/atom,darwin/atom,florianb/atom,gisenberg/atom,NunoEdgarGub1/atom,DiogoXRP/atom,bradgearon/atom,targeter21/atom,matthewclendening/atom,paulcbetts/atom,tony612/atom,rsvip/aTom,hharchani/atom,rookie125/atom,alfredxing/atom,xream/atom,abcP9110/atom,qskycolor/atom,ashneo76/atom,liuderchi/atom,Shekharrajak/atom,bj7/atom,erikhakansson/atom,bradgearon/atom,gisenberg/atom,gisenberg/atom,stuartquin/atom,Mokolea/atom,dsandstrom/atom,kjav/atom,brettle/atom,kjav/atom,KENJU/atom,qiujuer/atom,Abdillah/atom,charleswhchan/atom,basarat/atom,toqz/atom,Galactix/atom,lisonma/atom,sekcheong/atom,yangchenghu/atom,rookie125/atom,mrodalgaard/atom,daxlab/atom,Andrey-Pavlov/atom,sxgao3001/atom,MjAbuz/atom,johnhaley81/atom,dkfiresky/atom,seedtigo/atom,devoncarew/atom,folpindo/atom,kittens/atom,davideg/atom,prembasumatary/atom,AdrianVovk/substance-ide,tisu2tisu/atom,dannyflax/atom,Klozz/atom,me-benni/atom,lpommers/atom,amine7536/atom,dkfiresky/atom,Rychard/atom,ObviouslyGreen/atom,jtrose2/atom,RobinTec/atom,brumm/atom,dkfiresky/atom,ezeoleaf/atom,kaicataldo/atom,yalexx/atom,decaffeinate-examples/atom,hagb4rd/atom,bencolon/atom,avdg/atom,Jandersolutions/atom,florianb/atom,githubteacher/atom,FIT-CSE2410-A-Bombs/atom,dijs/atom,basarat/atom,helber/atom,atom/atom,alfredxing/atom,Neron-X5/atom,FoldingText/atom,johnhaley81/atom,FoldingText/atom,toqz/atom,mnquintana/atom,Jandersoft/atom,hagb4rd/atom,atom/atom,t9md/atom,dannyflax/atom,paulcbetts/atom,mostafaeweda/atom,dannyflax/atom,h0dgep0dge/atom,alexandergmann/atom,Shekharrajak/atom,Huaraz2/atom,me6iaton/atom,gontadu/atom,crazyquark/atom,john-kelly/atom,kevinrenaers/atom,Ju2ender/atom,tmunro/atom,jjz/atom,hagb4rd/atom,YunchengLiao/atom,woss/atom,woss/atom,GHackAnonymous/atom,avdg/atom,G-Baby/atom,PKRoma/atom,me-benni/atom,tony612/atom,omarhuanca/atom,bcoe/atom,vinodpanicker/atom,brettle/atom,folpindo/atom,bencolon/atom,paulcbetts/atom,tjkr/atom,mrodalgaard/atom,abe33/atom,isghe/atom,amine7536/atom,Arcanemagus/atom,rsvip/aTom,bryonwinger/atom,elkingtonmcb/atom,nvoron23/atom,chengky/atom,cyzn/atom,phord/atom,ezeoleaf/atom,001szymon/atom,splodingsocks/atom,decaffeinate-examples/atom,folpindo/atom,splodingsocks/atom,YunchengLiao/atom,AlexxNica/atom,CraZySacX/atom,qiujuer/atom,KENJU/atom,SlimeQ/atom,Jdesk/atom,Jandersoft/atom,lisonma/atom,nvoron23/atom,SlimeQ/atom,execjosh/atom,phord/atom,originye/atom,seedtigo/atom,t9md/atom,kdheepak89/atom,jlord/atom,deoxilix/atom,sxgao3001/atom,prembasumatary/atom,harshdattani/atom,Jandersoft/atom,pombredanne/atom,yomybaby/atom,pengshp/atom,omarhuanca/atom,jlord/atom,rsvip/aTom,jjz/atom,SlimeQ/atom,constanzaurzua/atom,gzzhanghao/atom,elkingtonmcb/atom,pkdevbox/atom,lovesnow/atom,darwin/atom,russlescai/atom,charleswhchan/atom,kdheepak89/atom,rsvip/aTom,omarhuanca/atom,vjeux/atom,Andrey-Pavlov/atom,ralphtheninja/atom,lpommers/atom,RuiDGoncalves/atom,fang-yufeng/atom,yomybaby/atom,toqz/atom,boomwaiza/atom,deoxilix/atom,hakatashi/atom,gisenberg/atom,lisonma/atom,Ingramz/atom,dkfiresky/atom,vcarrera/atom,nucked/atom,bencolon/atom,deepfox/atom,0x73/atom,codex8/atom,alexandergmann/atom,phord/atom,Huaraz2/atom,kdheepak89/atom,codex8/atom,isghe/atom,Dennis1978/atom,acontreras89/atom,me6iaton/atom,g2p/atom,MjAbuz/atom,BogusCurry/atom,abcP9110/atom,palita01/atom,devoncarew/atom,ilovezy/atom,batjko/atom,helber/atom,mnquintana/atom,Abdillah/atom,nvoron23/atom,synaptek/atom,daxlab/atom,fang-yufeng/atom,john-kelly/atom,Dennis1978/atom,chengky/atom,bj7/atom,g2p/atom,codex8/atom,jlord/atom,sxgao3001/atom,PKRoma/atom,devmario/atom,stinsonga/atom,decaffeinate-examples/atom,ReddTea/atom,sebmck/atom,Galactix/atom,Mokolea/atom,dijs/atom,ali/atom,omarhuanca/atom,hakatashi/atom,ppamorim/atom,fscherwi/atom,Jandersolutions/atom,john-kelly/atom,gontadu/atom,RobinTec/atom,jtrose2/atom,fang-yufeng/atom,lovesnow/atom,devmario/atom,bolinfest/atom,wiggzz/atom,mnquintana/atom,davideg/atom,sxgao3001/atom,rookie125/atom,gzzhanghao/atom,fedorov/atom,isghe/atom,001szymon/atom,yomybaby/atom,rmartin/atom,jtrose2/atom,MjAbuz/atom,Jdesk/atom,bj7/atom,dsandstrom/atom,transcranial/atom,johnrizzo1/atom,constanzaurzua/atom,ralphtheninja/atom,nrodriguez13/atom,gabrielPeart/atom,rmartin/atom,Austen-G/BlockBuilder,beni55/atom,abcP9110/atom,ykeisuke/atom,mertkahyaoglu/atom,Abdillah/atom,tony612/atom,efatsi/atom,charleswhchan/atom,crazyquark/atom,constanzaurzua/atom,rlugojr/atom,Austen-G/BlockBuilder,YunchengLiao/atom,GHackAnonymous/atom,Neron-X5/atom,SlimeQ/atom,acontreras89/atom,AdrianVovk/substance-ide,sillvan/atom,erikhakansson/atom,mostafaeweda/atom,DiogoXRP/atom,hellendag/atom,fang-yufeng/atom,NunoEdgarGub1/atom,kittens/atom,liuxiong332/atom,tmunro/atom,bsmr-x-script/atom,hagb4rd/atom,svanharmelen/atom,amine7536/atom,champagnez/atom,acontreras89/atom,jacekkopecky/atom,batjko/atom,rlugojr/atom,davideg/atom,liuderchi/atom,acontreras89/atom,Ju2ender/atom,Abdillah/atom,chengky/atom,jacekkopecky/atom,hharchani/atom,Hasimir/atom,hpham04/atom,ivoadf/atom,fedorov/atom,abcP9110/atom,ralphtheninja/atom,dannyflax/atom,Austen-G/BlockBuilder,basarat/atom,Jdesk/atom,qskycolor/atom,ashneo76/atom,pkdevbox/atom,Jonekee/atom,anuwat121/atom,ivoadf/atom,fredericksilva/atom,BogusCurry/atom,Andrey-Pavlov/atom,sotayamashita/atom,acontreras89/atom,codex8/atom,ReddTea/atom,mdumrauf/atom,execjosh/atom,AdrianVovk/substance-ide,n-riesco/atom,johnrizzo1/atom,abe33/atom,basarat/atom,kandros/atom,Sangaroonaom/atom,dijs/atom,DiogoXRP/atom,hellendag/atom,kc8wxm/atom,alexandergmann/atom,rxkit/atom,Shekharrajak/atom,lpommers/atom,Jonekee/atom,devmario/atom,rjattrill/atom,davideg/atom,h0dgep0dge/atom,bcoe/atom,Rodjana/atom,kaicataldo/atom,oggy/atom,rsvip/aTom,jeremyramin/atom,wiggzz/atom,liuxiong332/atom,deoxilix/atom,Galactix/atom,bradgearon/atom,andrewleverette/atom,lovesnow/atom,mnquintana/atom,qiujuer/atom,dannyflax/atom,splodingsocks/atom,bsmr-x-script/atom,yalexx/atom,jlord/atom,ali/atom,jacekkopecky/atom,sillvan/atom,hpham04/atom,champagnez/atom,john-kelly/atom,jacekkopecky/atom,ironbox360/atom,constanzaurzua/atom,vhutheesing/atom,NunoEdgarGub1/atom,Galactix/atom,devoncarew/atom,ivoadf/atom,prembasumatary/atom,YunchengLiao/atom,rjattrill/atom,FoldingText/atom,hellendag/atom,KENJU/atom,jeremyramin/atom,pombredanne/atom,yamhon/atom,basarat/atom,pengshp/atom,pombredanne/atom,constanzaurzua/atom,sillvan/atom,kevinrenaers/atom,vcarrera/atom,matthewclendening/atom,AlisaKiatkongkumthon/atom,einarmagnus/atom,Ingramz/atom,prembasumatary/atom,Locke23rus/atom,Shekharrajak/atom,niklabh/atom,lisonma/atom,mdumrauf/atom,scv119/atom,originye/atom,tisu2tisu/atom,nucked/atom,hagb4rd/atom,crazyquark/atom,ardeshirj/atom,FIT-CSE2410-A-Bombs/atom,stuartquin/atom,toqz/atom,Hasimir/atom,burodepeper/atom,Jdesk/atom,vcarrera/atom,sebmck/atom,mostafaeweda/atom,basarat/atom,yomybaby/atom,Arcanemagus/atom,bolinfest/atom,Ju2ender/atom,githubteacher/atom,andrewleverette/atom,russlescai/atom,devoncarew/atom,tmunro/atom,ilovezy/atom,targeter21/atom,ardeshirj/atom,Hasimir/atom,PKRoma/atom,scippio/atom,svanharmelen/atom,scippio/atom,chengky/atom,scippio/atom,ezeoleaf/atom,vinodpanicker/atom,ashneo76/atom,qiujuer/atom,fscherwi/atom,0x73/atom,hpham04/atom,fredericksilva/atom,davideg/atom,mertkahyaoglu/atom,Austen-G/BlockBuilder,vcarrera/atom,Huaraz2/atom,nrodriguez13/atom,Arcanemagus/atom,kc8wxm/atom,liuderchi/atom,vjeux/atom,targeter21/atom,panuchart/atom,bryonwinger/atom,AlexxNica/atom,bryonwinger/atom,ppamorim/atom,scv119/atom,gontadu/atom,lovesnow/atom,hpham04/atom,kittens/atom,liuxiong332/atom,GHackAnonymous/atom,rxkit/atom,ykeisuke/atom,stinsonga/atom,vjeux/atom,rjattrill/atom,boomwaiza/atom,hakatashi/atom,vinodpanicker/atom,jlord/atom,G-Baby/atom,bryonwinger/atom,ilovezy/atom,sillvan/atom,ilovezy/atom,woss/atom,niklabh/atom,rxkit/atom,FIT-CSE2410-A-Bombs/atom,sotayamashita/atom,yamhon/atom,splodingsocks/atom,Locke23rus/atom,sebmck/atom,qskycolor/atom,beni55/atom,tony612/atom,omarhuanca/atom,Neron-X5/atom,yalexx/atom,liuxiong332/atom,anuwat121/atom,mrodalgaard/atom,xream/atom,Jandersoft/atom,ezeoleaf/atom,ali/atom,gisenberg/atom,FoldingText/atom,vjeux/atom,synaptek/atom,fedorov/atom,targeter21/atom,devoncarew/atom,jjz/atom,decaffeinate-examples/atom,yomybaby/atom,me6iaton/atom,harshdattani/atom,panuchart/atom,dsandstrom/atom,beni55/atom,Jandersolutions/atom,liuxiong332/atom,harshdattani/atom,AlisaKiatkongkumthon/atom,KENJU/atom,prembasumatary/atom,Neron-X5/atom,mdumrauf/atom,atom/atom,Andrey-Pavlov/atom,AlbertoBarrago/atom,palita01/atom,ardeshirj/atom,me6iaton/atom,deepfox/atom,Austen-G/BlockBuilder,AlbertoBarrago/atom,BogusCurry/atom,G-Baby/atom,yangchenghu/atom,matthewclendening/atom,targeter21/atom,chengky/atom,Neron-X5/atom,GHackAnonymous/atom,pkdevbox/atom,andrewleverette/atom,mertkahyaoglu/atom,matthewclendening/atom,Ju2ender/atom,pombredanne/atom,fang-yufeng/atom,charleswhchan/atom,panuchart/atom,qiujuer/atom,crazyquark/atom,scv119/atom,jeremyramin/atom,sekcheong/atom,bcoe/atom,jacekkopecky/atom,t9md/atom,devmario/atom,Hasimir/atom,medovob/atom,jtrose2/atom,kc8wxm/atom,synaptek/atom,stuartquin/atom,synaptek/atom,KENJU/atom,russlescai/atom,nucked/atom,chfritz/atom,Rodjana/atom,wiggzz/atom,mostafaeweda/atom,g2p/atom,chfritz/atom,rmartin/atom,brumm/atom,kdheepak89/atom,Sangaroonaom/atom,hharchani/atom,Sangaroonaom/atom,tjkr/atom,palita01/atom,sebmck/atom,einarmagnus/atom,cyzn/atom,fredericksilva/atom,alfredxing/atom,paulcbetts/atom,Hasimir/atom,transcranial/atom,florianb/atom,CraZySacX/atom,ObviouslyGreen/atom,deepfox/atom,Locke23rus/atom,sekcheong/atom,yalexx/atom,efatsi/atom,githubteacher/atom,sxgao3001/atom,CraZySacX/atom,einarmagnus/atom,russlescai/atom,tanin47/atom,h0dgep0dge/atom,avdg/atom,scv119/atom,n-riesco/atom,einarmagnus/atom,me-benni/atom,kc8wxm/atom,tony612/atom,SlimeQ/atom,RuiDGoncalves/atom,isghe/atom,niklabh/atom,johnrizzo1/atom,001szymon/atom,rjattrill/atom,pengshp/atom,kandros/atom,russlescai/atom,hharchani/atom,woss/atom,jjz/atom,oggy/atom,Austen-G/BlockBuilder,AlisaKiatkongkumthon/atom,isghe/atom,champagnez/atom,vinodpanicker/atom,vcarrera/atom,RobinTec/atom,Klozz/atom,bsmr-x-script/atom,Rychard/atom,ReddTea/atom,florianb/atom,matthewclendening/atom,lovesnow/atom,bcoe/atom,darwin/atom,kittens/atom,kjav/atom,fedorov/atom,Shekharrajak/atom,0x73/atom,efatsi/atom,tjkr/atom,deepfox/atom,sebmck/atom,kjav/atom,NunoEdgarGub1/atom,MjAbuz/atom,gzzhanghao/atom,oggy/atom,einarmagnus/atom,charleswhchan/atom,nvoron23/atom,vhutheesing/atom,tisu2tisu/atom,jtrose2/atom,nvoron23/atom,kdheepak89/atom,NunoEdgarGub1/atom,execjosh/atom,vjeux/atom,mertkahyaoglu/atom,abcP9110/atom,ilovezy/atom,sekcheong/atom,ReddTea/atom,johnhaley81/atom,svanharmelen/atom,nrodriguez13/atom,Ju2ender/atom,qskycolor/atom,fredericksilva/atom,n-riesco/atom,dkfiresky/atom,originye/atom,ppamorim/atom,toqz/atom,Jonekee/atom,ykeisuke/atom,Andrey-Pavlov/atom,medovob/atom,bcoe/atom,oggy/atom,medovob/atom,deepfox/atom,qskycolor/atom,fredericksilva/atom,h0dgep0dge/atom,gabrielPeart/atom,kandros/atom,YunchengLiao/atom,codex8/atom,liuderchi/atom,ObviouslyGreen/atom,batjko/atom,helber/atom,RobinTec/atom,devmario/atom,rmartin/atom,burodepeper/atom,ironbox360/atom,Jandersolutions/atom,FoldingText/atom,mertkahyaoglu/atom,batjko/atom,lisonma/atom,stinsonga/atom,vinodpanicker/atom,amine7536/atom,vhutheesing/atom,bolinfest/atom,pombredanne/atom,Rychard/atom,dsandstrom/atom,woss/atom,n-riesco/atom,dsandstrom/atom,anuwat121/atom,ali/atom,yalexx/atom,rmartin/atom,kc8wxm/atom,RobinTec/atom,john-kelly/atom,crazyquark/atom,kaicataldo/atom,fedorov/atom,burodepeper/atom,transcranial/atom,Ingramz/atom,florianb/atom,jordanbtucker/atom,Jandersoft/atom,Klozz/atom,elkingtonmcb/atom,tanin47/atom,Rodjana/atom,synaptek/atom,mnquintana/atom,boomwaiza/atom,sillvan/atom,chfritz/atom,kjav/atom,hharchani/atom,batjko/atom,ironbox360/atom,Abdillah/atom,me6iaton/atom,kevinrenaers/atom,MjAbuz/atom,n-riesco/atom,Galactix/atom,xream/atom,Mokolea/atom,AlexxNica/atom,brettle/atom,Dennis1978/atom,rlugojr/atom,ppamorim/atom,sekcheong/atom,tanin47/atom,Jandersolutions/atom,oggy/atom,GHackAnonymous/atom
markdown
## Code Before: ![atom](https://f.cloud.github.com/assets/1300064/208230/4cefbca4-821a-11e2-8139-92c0328abf68.png) Check out our [documentation on the docs tab](https://github.com/github/atom/docs). ## Installing Download the latest Atom release from [speakeasy](https://speakeasy.githubapp.com/apps/27). It will automatically update when a new build is available. ## Building ### Requirements * Mountain Lion * The Setup™ or Boxen * Xcode (available in the App Store) ### Installation 1. `gh-setup atom` 2. `cd ~/github/atom && rake install` ## Instruction: Update image to match current icon ## Code After: ![atom](https://s3.amazonaws.com/speakeasy/apps/icons/27/medium/7db16e44-ba57-11e2-8c6f-981faf658e00.png) Check out our [documentation on the docs tab](https://github.com/github/atom/docs). ## Installing Download the latest Atom release from [speakeasy](https://speakeasy.githubapp.com/apps/27). It will automatically update when a new build is available. ## Building ### Requirements * Mountain Lion * The Setup™ or Boxen * Xcode (available in the App Store) ### Installation 1. `gh-setup atom` 2. `cd ~/github/atom && rake install`
- ![atom](https://f.cloud.github.com/assets/1300064/208230/4cefbca4-821a-11e2-8139-92c0328abf68.png) + ![atom](https://s3.amazonaws.com/speakeasy/apps/icons/27/medium/7db16e44-ba57-11e2-8c6f-981faf658e00.png) Check out our [documentation on the docs tab](https://github.com/github/atom/docs). ## Installing Download the latest Atom release from [speakeasy](https://speakeasy.githubapp.com/apps/27). It will automatically update when a new build is available. ## Building ### Requirements * Mountain Lion * The Setup™ or Boxen * Xcode (available in the App Store) ### Installation 1. `gh-setup atom` 2. `cd ~/github/atom && rake install`
2
0.083333
1
1
dac7f35be2ecdb4b0f1de40112cc4d59e9734ac8
fish/.config/fish/functions/check_vpn.fish
fish/.config/fish/functions/check_vpn.fish
function check_vpn --description="Return true if connected to VPN" command curl --silent https://am.i.mullvad.net/json | jq '.mullvad_exit_ip' end
function check_vpn --description="Return true if connected to VPN" argparse --name check_vpn 'h/help' 'b/barmode' -- $argv or return 1 # error function print_help echo "Usage: check_vpn [options]" echo "Options:" echo (set_color green)"-b"(set_color $fish_color_normal)": Output text for i3status-rs bar" end if set -lq _flag_help print help return end set MODE std if set -lq _flag_barmode set MODE bar end set val (curl --silent https://am.i.mullvad.net/json | jq '.mullvad_exit_ip') if test $MODE = bar if test $val = true printf "<span color='green'>VPN</span>" else printf "<span color='red' strikethrough='true'>VPN</span>" end else if test $val = true return 0 else return 1 end end end
Use pango formatting, add bar mode
Use pango formatting, add bar mode
fish
mit
ammgws/dotfiles,ammgws/dotfiles,ammgws/dotfiles
fish
## Code Before: function check_vpn --description="Return true if connected to VPN" command curl --silent https://am.i.mullvad.net/json | jq '.mullvad_exit_ip' end ## Instruction: Use pango formatting, add bar mode ## Code After: function check_vpn --description="Return true if connected to VPN" argparse --name check_vpn 'h/help' 'b/barmode' -- $argv or return 1 # error function print_help echo "Usage: check_vpn [options]" echo "Options:" echo (set_color green)"-b"(set_color $fish_color_normal)": Output text for i3status-rs bar" end if set -lq _flag_help print help return end set MODE std if set -lq _flag_barmode set MODE bar end set val (curl --silent https://am.i.mullvad.net/json | jq '.mullvad_exit_ip') if test $MODE = bar if test $val = true printf "<span color='green'>VPN</span>" else printf "<span color='red' strikethrough='true'>VPN</span>" end else if test $val = true return 0 else return 1 end end end
function check_vpn --description="Return true if connected to VPN" + argparse --name check_vpn 'h/help' 'b/barmode' -- $argv + or return 1 # error + + function print_help + echo "Usage: check_vpn [options]" + echo "Options:" + echo (set_color green)"-b"(set_color $fish_color_normal)": Output text for i3status-rs bar" + end + + if set -lq _flag_help + print help + return + end + + set MODE std + if set -lq _flag_barmode + set MODE bar + end + - command curl --silent https://am.i.mullvad.net/json | jq '.mullvad_exit_ip' ? ^^^^ ^^ + set val (curl --silent https://am.i.mullvad.net/json | jq '.mullvad_exit_ip') ? ^^^^^ ^ + + + if test $MODE = bar + if test $val = true + printf "<span color='green'>VPN</span>" + else + printf "<span color='red' strikethrough='true'>VPN</span>" + end + else + if test $val = true + return 0 + else + return 1 + end + end end
34
11.333333
33
1
c99cc71c053beae49682f5a95c8723377101d9f0
.kitchen.yml
.kitchen.yml
--- driver: name: docker require_chef_omnibus: false require_ruby_for_busser: false use_sudo: false volume: - $(pwd)/provisioning/scripts/:/usr/open-development-environment-devbox/provisioning/scripts/ platforms: - name: ubuntu-17.10 suites: - name: script-update-disabled provisioner: name: shell script: ./provisioning/scripts/update.sh verifier: inspec_tests: - path: test/integration/script-update/inspec controls: - open-development-environment-devbox-update - name: script-update-enabled provisioner: name: shell script: ./test/scripts/test-kitchen/script-update-enabled.sh verifier: inspec_tests: - path: test/integration/script-update/inspec controls: - open-development-environment-devbox-update - name: script-sshd provisioner: name: shell script: ./provisioning/scripts/sshd.sh - name: script-networking provisioner: name: shell script: ./provisioning/scripts/networking.sh - name: script-vagrant provisioner: name: shell script: ./test/scripts/test-kitchen/script-vagrant-enabled.sh - name: script-cleanup provisioner: name: shell script: ./test/scripts/test-kitchen/script-cleanup-zeroing-disabled.sh transport: max_ssh_sessions: 6 verifier: name: inspec
--- driver: provision_command: mkdir -p /run/sshd name: docker require_chef_omnibus: false require_ruby_for_busser: false use_sudo: false volume: - $(pwd)/provisioning/scripts/:/usr/open-development-environment-devbox/provisioning/scripts/ platforms: - name: ubuntu-17.10 suites: - name: script-update-disabled provisioner: name: shell script: ./provisioning/scripts/update.sh verifier: inspec_tests: - path: test/integration/script-update/inspec controls: - open-development-environment-devbox-update - name: script-update-enabled provisioner: name: shell script: ./test/scripts/test-kitchen/script-update-enabled.sh verifier: inspec_tests: - path: test/integration/script-update/inspec controls: - open-development-environment-devbox-update - name: script-sshd provisioner: name: shell script: ./provisioning/scripts/sshd.sh - name: script-networking provisioner: name: shell script: ./provisioning/scripts/networking.sh - name: script-vagrant provisioner: name: shell script: ./test/scripts/test-kitchen/script-vagrant-enabled.sh - name: script-cleanup provisioner: name: shell script: ./test/scripts/test-kitchen/script-cleanup-zeroing-disabled.sh transport: max_ssh_sessions: 6 verifier: name: inspec
Fix missing ssh privilege separation directory
Fix missing ssh privilege separation directory
YAML
apache-2.0
ferrarimarco/open-development-environment-devbox,ferrarimarco/open-development-environment-devbox
yaml
## Code Before: --- driver: name: docker require_chef_omnibus: false require_ruby_for_busser: false use_sudo: false volume: - $(pwd)/provisioning/scripts/:/usr/open-development-environment-devbox/provisioning/scripts/ platforms: - name: ubuntu-17.10 suites: - name: script-update-disabled provisioner: name: shell script: ./provisioning/scripts/update.sh verifier: inspec_tests: - path: test/integration/script-update/inspec controls: - open-development-environment-devbox-update - name: script-update-enabled provisioner: name: shell script: ./test/scripts/test-kitchen/script-update-enabled.sh verifier: inspec_tests: - path: test/integration/script-update/inspec controls: - open-development-environment-devbox-update - name: script-sshd provisioner: name: shell script: ./provisioning/scripts/sshd.sh - name: script-networking provisioner: name: shell script: ./provisioning/scripts/networking.sh - name: script-vagrant provisioner: name: shell script: ./test/scripts/test-kitchen/script-vagrant-enabled.sh - name: script-cleanup provisioner: name: shell script: ./test/scripts/test-kitchen/script-cleanup-zeroing-disabled.sh transport: max_ssh_sessions: 6 verifier: name: inspec ## Instruction: Fix missing ssh privilege separation directory ## Code After: --- driver: provision_command: mkdir -p /run/sshd name: docker require_chef_omnibus: false require_ruby_for_busser: false use_sudo: false volume: - $(pwd)/provisioning/scripts/:/usr/open-development-environment-devbox/provisioning/scripts/ platforms: - name: ubuntu-17.10 suites: - name: script-update-disabled provisioner: name: shell script: ./provisioning/scripts/update.sh verifier: inspec_tests: - path: test/integration/script-update/inspec controls: - open-development-environment-devbox-update - name: script-update-enabled provisioner: name: shell script: ./test/scripts/test-kitchen/script-update-enabled.sh verifier: inspec_tests: - path: test/integration/script-update/inspec controls: - open-development-environment-devbox-update - name: script-sshd provisioner: name: shell script: ./provisioning/scripts/sshd.sh - name: script-networking provisioner: name: shell script: ./provisioning/scripts/networking.sh - name: script-vagrant provisioner: name: shell script: ./test/scripts/test-kitchen/script-vagrant-enabled.sh - name: script-cleanup provisioner: name: shell script: ./test/scripts/test-kitchen/script-cleanup-zeroing-disabled.sh transport: max_ssh_sessions: 6 verifier: name: inspec
--- driver: + provision_command: mkdir -p /run/sshd name: docker require_chef_omnibus: false require_ruby_for_busser: false use_sudo: false volume: - $(pwd)/provisioning/scripts/:/usr/open-development-environment-devbox/provisioning/scripts/ platforms: - name: ubuntu-17.10 suites: - name: script-update-disabled provisioner: name: shell script: ./provisioning/scripts/update.sh verifier: inspec_tests: - path: test/integration/script-update/inspec controls: - open-development-environment-devbox-update - name: script-update-enabled provisioner: name: shell script: ./test/scripts/test-kitchen/script-update-enabled.sh verifier: inspec_tests: - path: test/integration/script-update/inspec controls: - open-development-environment-devbox-update - name: script-sshd provisioner: name: shell script: ./provisioning/scripts/sshd.sh - name: script-networking provisioner: name: shell script: ./provisioning/scripts/networking.sh - name: script-vagrant provisioner: name: shell script: ./test/scripts/test-kitchen/script-vagrant-enabled.sh - name: script-cleanup provisioner: name: shell script: ./test/scripts/test-kitchen/script-cleanup-zeroing-disabled.sh transport: max_ssh_sessions: 6 verifier: name: inspec
1
0.018868
1
0
be77108ef7359f1265ac9d9f260bbf88ab95ca3d
php/laravel-cheat_sheet.md
php/laravel-cheat_sheet.md
See https://laravel.com/ for details. Laravel is a PHP framework for web applications using MVC. Laravel uses the following components (among others): * Composer: A PHP dependencies manager * Symfony: A PHP development framework * Eloquent ORM: Object-oriented database management and migration * Blade: A templating engine
See https://laravel.com/ for details. Laravel is a PHP framework for web applications using MVC. Laravel uses the following components (among others): * Composer: A PHP dependencies manager * Symfony: A PHP development framework * Eloquent ORM: Object-oriented database management and migration * Blade: A templating engine ## Installation See https://laravel.com/docs for details.
Add a Brief Installation Section
Add a Brief Installation Section
Markdown
mit
dhurlburtusa/shortcuts,dhurlburtusa/shortcuts
markdown
## Code Before: See https://laravel.com/ for details. Laravel is a PHP framework for web applications using MVC. Laravel uses the following components (among others): * Composer: A PHP dependencies manager * Symfony: A PHP development framework * Eloquent ORM: Object-oriented database management and migration * Blade: A templating engine ## Instruction: Add a Brief Installation Section ## Code After: See https://laravel.com/ for details. Laravel is a PHP framework for web applications using MVC. Laravel uses the following components (among others): * Composer: A PHP dependencies manager * Symfony: A PHP development framework * Eloquent ORM: Object-oriented database management and migration * Blade: A templating engine ## Installation See https://laravel.com/docs for details.
See https://laravel.com/ for details. Laravel is a PHP framework for web applications using MVC. Laravel uses the following components (among others): * Composer: A PHP dependencies manager * Symfony: A PHP development framework * Eloquent ORM: Object-oriented database management and migration * Blade: A templating engine + + ## Installation + + See https://laravel.com/docs for details.
4
0.363636
4
0
c79a3d368b1727b02e97600b17ac3da28a2107b4
project/apps/forum/serializers.py
project/apps/forum/serializers.py
from __future__ import unicode_literals from machina.core.db.models import get_model from rest_framework import serializers Forum = get_model('forum', 'Forum') class ForumSerializer(serializers.ModelSerializer): description = serializers.SerializerMethodField() previous_sibling = serializers.SerializerMethodField() next_sibling = serializers.SerializerMethodField() class Meta: model = Forum fields = [ 'id', 'name', 'slug', 'type', 'description', 'image', 'link', 'link_redirects', 'posts_count', 'topics_count', 'link_redirects_count', 'last_post_on', 'display_sub_forum_list', 'lft', 'rght', 'tree_id', 'level', 'parent', 'previous_sibling', 'next_sibling', ] def get_description(self, obj): return obj.description.rendered def get_previous_sibling(self, obj): sibling = obj.get_previous_sibling() return sibling.pk if sibling else None def get_next_sibling(self, obj): sibling = obj.get_next_sibling() return sibling.pk if sibling else None
from __future__ import unicode_literals from machina.core.db.models import get_model from rest_framework import serializers Forum = get_model('forum', 'Forum') class ForumSerializer(serializers.ModelSerializer): description = serializers.SerializerMethodField() class Meta: model = Forum fields = [ 'id', 'name', 'slug', 'type', 'description', 'image', 'link', 'link_redirects', 'posts_count', 'topics_count', 'link_redirects_count', 'last_post_on', 'display_sub_forum_list', 'lft', 'rght', 'tree_id', 'level', 'parent', ] def get_description(self, obj): return obj.description.rendered
Remove forum siblings from forum serializer
Remove forum siblings from forum serializer
Python
mit
ellmetha/machina-singlepageapp,ellmetha/machina-singlepageapp
python
## Code Before: from __future__ import unicode_literals from machina.core.db.models import get_model from rest_framework import serializers Forum = get_model('forum', 'Forum') class ForumSerializer(serializers.ModelSerializer): description = serializers.SerializerMethodField() previous_sibling = serializers.SerializerMethodField() next_sibling = serializers.SerializerMethodField() class Meta: model = Forum fields = [ 'id', 'name', 'slug', 'type', 'description', 'image', 'link', 'link_redirects', 'posts_count', 'topics_count', 'link_redirects_count', 'last_post_on', 'display_sub_forum_list', 'lft', 'rght', 'tree_id', 'level', 'parent', 'previous_sibling', 'next_sibling', ] def get_description(self, obj): return obj.description.rendered def get_previous_sibling(self, obj): sibling = obj.get_previous_sibling() return sibling.pk if sibling else None def get_next_sibling(self, obj): sibling = obj.get_next_sibling() return sibling.pk if sibling else None ## Instruction: Remove forum siblings from forum serializer ## Code After: from __future__ import unicode_literals from machina.core.db.models import get_model from rest_framework import serializers Forum = get_model('forum', 'Forum') class ForumSerializer(serializers.ModelSerializer): description = serializers.SerializerMethodField() class Meta: model = Forum fields = [ 'id', 'name', 'slug', 'type', 'description', 'image', 'link', 'link_redirects', 'posts_count', 'topics_count', 'link_redirects_count', 'last_post_on', 'display_sub_forum_list', 'lft', 'rght', 'tree_id', 'level', 'parent', ] def get_description(self, obj): return obj.description.rendered
from __future__ import unicode_literals from machina.core.db.models import get_model from rest_framework import serializers Forum = get_model('forum', 'Forum') class ForumSerializer(serializers.ModelSerializer): description = serializers.SerializerMethodField() - previous_sibling = serializers.SerializerMethodField() - next_sibling = serializers.SerializerMethodField() class Meta: model = Forum fields = [ 'id', 'name', 'slug', 'type', 'description', 'image', 'link', 'link_redirects', 'posts_count', 'topics_count', 'link_redirects_count', 'last_post_on', 'display_sub_forum_list', 'lft', 'rght', 'tree_id', 'level', 'parent', - 'previous_sibling', 'next_sibling', ] def get_description(self, obj): return obj.description.rendered - - def get_previous_sibling(self, obj): - sibling = obj.get_previous_sibling() - return sibling.pk if sibling else None - - def get_next_sibling(self, obj): - sibling = obj.get_next_sibling() - return sibling.pk if sibling else None
11
0.333333
0
11
6da978071e9202926372dc1033883f3b7f173879
client/src/app/app.component.ts
client/src/app/app.component.ts
import { Component } from '@angular/core'; import { Router } from '@angular/router'; import { AuthenticationService } from './core/authentication.service'; @Component({ selector: 'my-app', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { title = 'Tour of Heroes'; constructor(private authenticationService: AuthenticationService, private router: Router) { } logout() { this.authenticationService.logout(); this.router.navigate(['/']); } isAuthenticated(): Boolean { return this.authenticationService.token !== null; } }
import { Component } from '@angular/core'; import { Router } from '@angular/router'; import { AuthenticationService } from './core/authentication.service'; @Component({ selector: 'my-app', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { title = 'Tour of Heroes'; constructor(private authenticationService: AuthenticationService, private router: Router) { } logout() { this.authenticationService.logout(); this.router.navigate(['/']); } isAuthenticated(): Boolean { return (typeof this.authenticationService.token != 'undefined' && this.authenticationService.token !== null); } }
Fix bug in isAuthenticated not checking for undefined value
Fix bug in isAuthenticated not checking for undefined value
TypeScript
mit
thinhpham/mean-docker,thinhpham/mean-docker,thinhpham/mean-docker,thinhpham/mean-docker
typescript
## Code Before: import { Component } from '@angular/core'; import { Router } from '@angular/router'; import { AuthenticationService } from './core/authentication.service'; @Component({ selector: 'my-app', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { title = 'Tour of Heroes'; constructor(private authenticationService: AuthenticationService, private router: Router) { } logout() { this.authenticationService.logout(); this.router.navigate(['/']); } isAuthenticated(): Boolean { return this.authenticationService.token !== null; } } ## Instruction: Fix bug in isAuthenticated not checking for undefined value ## Code After: import { Component } from '@angular/core'; import { Router } from '@angular/router'; import { AuthenticationService } from './core/authentication.service'; @Component({ selector: 'my-app', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { title = 'Tour of Heroes'; constructor(private authenticationService: AuthenticationService, private router: Router) { } logout() { this.authenticationService.logout(); this.router.navigate(['/']); } isAuthenticated(): Boolean { return (typeof this.authenticationService.token != 'undefined' && this.authenticationService.token !== null); } }
import { Component } from '@angular/core'; import { Router } from '@angular/router'; import { AuthenticationService } from './core/authentication.service'; @Component({ selector: 'my-app', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { title = 'Tour of Heroes'; constructor(private authenticationService: AuthenticationService, private router: Router) { } logout() { this.authenticationService.logout(); this.router.navigate(['/']); } isAuthenticated(): Boolean { - return this.authenticationService.token !== null; + return (typeof this.authenticationService.token != 'undefined' && this.authenticationService.token !== null); } }
2
0.086957
1
1
4ac95b4b0c277c261e01f27c1c7eb97d556fc594
check_prosody_update.sh
check_prosody_update.sh
apt-get update -qq apt-get -u -V -s upgrade | grep "Inst prosody${PROSODY_VERSION}"
( apt update -qq && apt list --upgradable ) 2> /dev/null | grep prosody
Use "apt" to check prosody update
Use "apt" to check prosody update
Shell
mit
unclev/prosody-docker-extended
shell
## Code Before: apt-get update -qq apt-get -u -V -s upgrade | grep "Inst prosody${PROSODY_VERSION}" ## Instruction: Use "apt" to check prosody update ## Code After: ( apt update -qq && apt list --upgradable ) 2> /dev/null | grep prosody
+ ( apt update -qq && apt list --upgradable ) 2> /dev/null | grep prosody - apt-get update -qq - apt-get -u -V -s upgrade | grep "Inst prosody${PROSODY_VERSION}"
3
1
1
2
e16a435fb81df35fb3f0ea2f0efef6d3b9c6b32f
get_modded_mars.sh
get_modded_mars.sh
SYSCALL_DIR=mars/mips/instructions/syscalls TOUCHED_FILE=__asdf.txt # double underscore for extra security MARS_DIR=mars-sockets JAR_NAME=Mars4_5.jar PATCH_NAME=mars-sockets.patch touch $TOUCHED_FILE rm -rf $MARS_DIR mkdir -p $MARS_DIR cd $MARS_DIR wget http://courses.missouristate.edu/KenVollmar/MARS/MARS_4_5_Aug2014/Mars4_5.jar jar xf $JAR_NAME rm -f $JAR_NAME patch -p1 < ../$PATCH_NAME cd .. for java_file in $(find $MARS_DIR/$SYSCALL_DIR -type f -newer $TOUCHED_FILE); do javac -cp $MARS_DIR $java_file done rm -f $TOUCHED_FILE
SYSCALL_DIR=mars/mips/instructions/syscalls TOUCHED_FILE=__asdf.txt # double underscore for extra security MARS_DIR=mars-sockets JAR_NAME=Mars4_5.jar PATCH_NAME=mars-sockets.patch touch $TOUCHED_FILE rm -rf $MARS_DIR mkdir -p $MARS_DIR cd $MARS_DIR wget http://courses.missouristate.edu/KenVollmar/MARS/MARS_4_5_Aug2014/Mars4_5.jar jar xf $JAR_NAME rm -f $JAR_NAME patch -p1 < ../$PATCH_NAME cd .. for java_file in $(find $MARS_DIR/$SYSCALL_DIR -type f -newer $TOUCHED_FILE); do javac -cp $MARS_DIR $java_file done rm -f $TOUCHED_FILE # Create a Jar! Reuse the script that comes with MARS. It says it's a bash # script, but it's really just a single command saved in a text file. cd $MARS_DIR sh CreateMarsJar.bat mv Mars.jar ../Mars4_5-SockMod.jar cd .. rm -rf $MARS_DIR
Update shell script to create a Jar and delete the code directory.
Update shell script to create a Jar and delete the code directory.
Shell
bsd-3-clause
brenns10/yams,brenns10/yams,brenns10/yams
shell
## Code Before: SYSCALL_DIR=mars/mips/instructions/syscalls TOUCHED_FILE=__asdf.txt # double underscore for extra security MARS_DIR=mars-sockets JAR_NAME=Mars4_5.jar PATCH_NAME=mars-sockets.patch touch $TOUCHED_FILE rm -rf $MARS_DIR mkdir -p $MARS_DIR cd $MARS_DIR wget http://courses.missouristate.edu/KenVollmar/MARS/MARS_4_5_Aug2014/Mars4_5.jar jar xf $JAR_NAME rm -f $JAR_NAME patch -p1 < ../$PATCH_NAME cd .. for java_file in $(find $MARS_DIR/$SYSCALL_DIR -type f -newer $TOUCHED_FILE); do javac -cp $MARS_DIR $java_file done rm -f $TOUCHED_FILE ## Instruction: Update shell script to create a Jar and delete the code directory. ## Code After: SYSCALL_DIR=mars/mips/instructions/syscalls TOUCHED_FILE=__asdf.txt # double underscore for extra security MARS_DIR=mars-sockets JAR_NAME=Mars4_5.jar PATCH_NAME=mars-sockets.patch touch $TOUCHED_FILE rm -rf $MARS_DIR mkdir -p $MARS_DIR cd $MARS_DIR wget http://courses.missouristate.edu/KenVollmar/MARS/MARS_4_5_Aug2014/Mars4_5.jar jar xf $JAR_NAME rm -f $JAR_NAME patch -p1 < ../$PATCH_NAME cd .. for java_file in $(find $MARS_DIR/$SYSCALL_DIR -type f -newer $TOUCHED_FILE); do javac -cp $MARS_DIR $java_file done rm -f $TOUCHED_FILE # Create a Jar! Reuse the script that comes with MARS. It says it's a bash # script, but it's really just a single command saved in a text file. cd $MARS_DIR sh CreateMarsJar.bat mv Mars.jar ../Mars4_5-SockMod.jar cd .. rm -rf $MARS_DIR
SYSCALL_DIR=mars/mips/instructions/syscalls TOUCHED_FILE=__asdf.txt # double underscore for extra security MARS_DIR=mars-sockets JAR_NAME=Mars4_5.jar PATCH_NAME=mars-sockets.patch touch $TOUCHED_FILE rm -rf $MARS_DIR mkdir -p $MARS_DIR cd $MARS_DIR wget http://courses.missouristate.edu/KenVollmar/MARS/MARS_4_5_Aug2014/Mars4_5.jar jar xf $JAR_NAME rm -f $JAR_NAME patch -p1 < ../$PATCH_NAME cd .. for java_file in $(find $MARS_DIR/$SYSCALL_DIR -type f -newer $TOUCHED_FILE); do javac -cp $MARS_DIR $java_file done rm -f $TOUCHED_FILE + + # Create a Jar! Reuse the script that comes with MARS. It says it's a bash + # script, but it's really just a single command saved in a text file. + cd $MARS_DIR + sh CreateMarsJar.bat + mv Mars.jar ../Mars4_5-SockMod.jar + cd .. + rm -rf $MARS_DIR
8
0.380952
8
0
686c9aff152631605a8e7ee680c0b9b08008f4b8
app/Auth/Repositories/ClientRepository.php
app/Auth/Repositories/ClientRepository.php
<?php namespace Northstar\Auth\Repositories; use League\OAuth2\Server\Repositories\ClientRepositoryInterface; use Northstar\Auth\Entities\ClientEntity; use Northstar\Models\Client; class ClientRepository implements ClientRepositoryInterface { /** * Get a client. * * @param string $clientIdentifier The client's identifier * @param string $grantType The grant type used * @param null|string $clientSecret The client's secret (if sent) * * @return \League\OAuth2\Server\Entities\ClientEntityInterface */ public function getClientEntity($clientIdentifier, $grantType, $clientSecret = null) { // Fetch client from the database & make OAuth2 entity $model = Client::where('app_id', $clientIdentifier)->first(); $client = new ClientEntity($model); return $client; } }
<?php namespace Northstar\Auth\Repositories; use League\OAuth2\Server\Repositories\ClientRepositoryInterface; use Northstar\Auth\Entities\ClientEntity; use Northstar\Models\Client; class ClientRepository implements ClientRepositoryInterface { /** * Get a client. * * @param string $clientIdentifier The client's identifier * @param string $grantType The grant type used * @param null|string $clientSecret The client's secret (if sent) * * @return \League\OAuth2\Server\Entities\ClientEntityInterface */ public function getClientEntity($clientIdentifier, $grantType, $clientSecret = null) { // Fetch client from the database & make OAuth2 entity $model = Client::where('app_id', $clientIdentifier)->first(); if(! $model) { return null; } return new ClientEntity($model); } }
Handle invalid client credentials properly.
Handle invalid client credentials properly.
PHP
mit
DoSomething/northstar,DoSomething/northstar,DoSomething/northstar
php
## Code Before: <?php namespace Northstar\Auth\Repositories; use League\OAuth2\Server\Repositories\ClientRepositoryInterface; use Northstar\Auth\Entities\ClientEntity; use Northstar\Models\Client; class ClientRepository implements ClientRepositoryInterface { /** * Get a client. * * @param string $clientIdentifier The client's identifier * @param string $grantType The grant type used * @param null|string $clientSecret The client's secret (if sent) * * @return \League\OAuth2\Server\Entities\ClientEntityInterface */ public function getClientEntity($clientIdentifier, $grantType, $clientSecret = null) { // Fetch client from the database & make OAuth2 entity $model = Client::where('app_id', $clientIdentifier)->first(); $client = new ClientEntity($model); return $client; } } ## Instruction: Handle invalid client credentials properly. ## Code After: <?php namespace Northstar\Auth\Repositories; use League\OAuth2\Server\Repositories\ClientRepositoryInterface; use Northstar\Auth\Entities\ClientEntity; use Northstar\Models\Client; class ClientRepository implements ClientRepositoryInterface { /** * Get a client. * * @param string $clientIdentifier The client's identifier * @param string $grantType The grant type used * @param null|string $clientSecret The client's secret (if sent) * * @return \League\OAuth2\Server\Entities\ClientEntityInterface */ public function getClientEntity($clientIdentifier, $grantType, $clientSecret = null) { // Fetch client from the database & make OAuth2 entity $model = Client::where('app_id', $clientIdentifier)->first(); if(! $model) { return null; } return new ClientEntity($model); } }
<?php namespace Northstar\Auth\Repositories; use League\OAuth2\Server\Repositories\ClientRepositoryInterface; use Northstar\Auth\Entities\ClientEntity; use Northstar\Models\Client; class ClientRepository implements ClientRepositoryInterface { /** * Get a client. * * @param string $clientIdentifier The client's identifier * @param string $grantType The grant type used * @param null|string $clientSecret The client's secret (if sent) * * @return \League\OAuth2\Server\Entities\ClientEntityInterface */ public function getClientEntity($clientIdentifier, $grantType, $clientSecret = null) { // Fetch client from the database & make OAuth2 entity $model = Client::where('app_id', $clientIdentifier)->first(); + + if(! $model) { + return null; + } + - $client = new ClientEntity($model); ? ^^^^ --- + return new ClientEntity($model); ? ^ +++ - - return $client; } }
9
0.321429
6
3
3bfe7de0ef06101e66edac019f00b7ce7a4ee525
config/environment.rb
config/environment.rb
require_relative 'application' # Initialize the Rails application. Rails.application.initialize! ENV['HOST_PORT'] ||= ":80"
require_relative 'application' # Initialize the Rails application. Rails.application.initialize! ENV['HOST_PORT'] ||= ":80" mylog = Logger.new(STDERR) mylog.info("environment.rb: The ExecJS runtime is #{ExecJS.runtime.name}")
Print a message saying what the ExecJS runtime is.
Print a message saying what the ExecJS runtime is.
Ruby
apache-2.0
jlm/maint,jlm/maint,jlm/maint,jlm/maint
ruby
## Code Before: require_relative 'application' # Initialize the Rails application. Rails.application.initialize! ENV['HOST_PORT'] ||= ":80" ## Instruction: Print a message saying what the ExecJS runtime is. ## Code After: require_relative 'application' # Initialize the Rails application. Rails.application.initialize! ENV['HOST_PORT'] ||= ":80" mylog = Logger.new(STDERR) mylog.info("environment.rb: The ExecJS runtime is #{ExecJS.runtime.name}")
require_relative 'application' # Initialize the Rails application. Rails.application.initialize! ENV['HOST_PORT'] ||= ":80" + mylog = Logger.new(STDERR) + mylog.info("environment.rb: The ExecJS runtime is #{ExecJS.runtime.name}")
2
0.4
2
0
d3c400106a317f1bf55b67223377683a96b1227d
app/views/layouts/application.html.erb
app/views/layouts/application.html.erb
<!DOCTYPE html> <html> <head> <title>Gov</title> <link rel="icon" type="image/png" href="/favicon.png"> <%= stylesheet_link_tag 'application', media: 'all' %> <%= javascript_include_tag 'modernizr' %> <%= csrf_meta_tags %> </head> <body> <%= yield %> <%= javascript_include_tag 'application' %> </body> </html>
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> <link rel="icon" type="image/png" href="/favicon.png"> <title>Общество - модерни, технологични подходи за България | Civic Hacking в България</title> <%= stylesheet_link_tag 'application', media: 'all' %> <%= javascript_include_tag 'modernizr' %> <%= csrf_meta_tags %> </head> <body> <%= yield %> <%= javascript_include_tag 'application' %> </body> </html>
Move meta and other head tags
Move meta and other head tags
HTML+ERB
mit
AlexVPopov/gov,obshtestvo/gov,obshtestvo/gov,obshtestvo/gov,AlexVPopov/gov
html+erb
## Code Before: <!DOCTYPE html> <html> <head> <title>Gov</title> <link rel="icon" type="image/png" href="/favicon.png"> <%= stylesheet_link_tag 'application', media: 'all' %> <%= javascript_include_tag 'modernizr' %> <%= csrf_meta_tags %> </head> <body> <%= yield %> <%= javascript_include_tag 'application' %> </body> </html> ## Instruction: Move meta and other head tags ## Code After: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> <link rel="icon" type="image/png" href="/favicon.png"> <title>Общество - модерни, технологични подходи за България | Civic Hacking в България</title> <%= stylesheet_link_tag 'application', media: 'all' %> <%= javascript_include_tag 'modernizr' %> <%= csrf_meta_tags %> </head> <body> <%= yield %> <%= javascript_include_tag 'application' %> </body> </html>
<!DOCTYPE html> <html> <head> - <title>Gov</title> + <meta charset="utf-8"> + <meta http-equiv="X-UA-Compatible" content="IE=edge"> + <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> <link rel="icon" type="image/png" href="/favicon.png"> + + <title>Общество - модерни, технологични подходи за България | Civic Hacking в България</title> + <%= stylesheet_link_tag 'application', media: 'all' %> <%= javascript_include_tag 'modernizr' %> <%= csrf_meta_tags %> </head> <body> <%= yield %> <%= javascript_include_tag 'application' %> </body> </html>
7
0.5
6
1
a4a6bee048a2be2edecdd1cd153180753a6e5d78
spec/controllers/concerns/jwt_token_spec.rb
spec/controllers/concerns/jwt_token_spec.rb
require "rails_helper" describe ApplicationController, type: :controller do controller do include Concerns::JwtToken before_action :validate_token respond_to :json def index render plain: "User: #{@user.display_name}" end def create render text: "I got created!" end end context "no authorization header" do it "should not be authorized" do get :index, format: :json expect(response).to have_http_status(:unauthorized) end end context "invalid authorization header" do it "should not be authorized" do request.headers["Authorization"] = "A fake header" get :index, format: :json expect(response).to have_http_status(:unauthorized) end end context "valid authorization header" do before do @user = FactoryGirl.create(:user) @user.confirm @user_token = AuthToken.issue_token({ user_id: @user.id }) request.headers["Authorization"] = @user_token end it "should be authorized" do get :index, format: :json expect(response).to have_http_status(:success) end end context "valid shared token" do it "should be authorized" do SharedAuth.create(secret: "shhhh im a secret") request.headers["SharedAuthorization"] = "shhhh im a secret" post :create, format: :json expect(response).to have_http_status(:success) end end context "invalid shared token" do it "should not be authorized" do SharedAuth.create(secret: "shhhh im a secret") request.headers["SharedAuthorization"] = "gar im a secret" post :create, format: :json expect(response).to have_http_status(:unauthorized) end end end
require "rails_helper" describe ApplicationController, type: :controller do controller do include Concerns::JwtToken before_action :validate_token respond_to :json def index render plain: "User: #{@user.display_name}" end def create render text: "I got created!" end end context "no authorization header" do it "should not be authorized" do get :index, format: :json expect(response).to have_http_status(:unauthorized) end end context "invalid authorization header" do it "should not be authorized" do request.headers["Authorization"] = "A fake header" get :index, format: :json expect(response).to have_http_status(:unauthorized) end end context "valid authorization header" do before do @user = FactoryGirl.create(:user) @user.confirm @user_token = AuthToken.issue_token({ user_id: @user.id }) request.headers["Authorization"] = @user_token end it "should be authorized" do get :index, format: :json expect(response).to have_http_status(:success) end end end
Remove old specs for SharedAuth jwt
Remove old specs for SharedAuth jwt
Ruby
mit
atomicjolt/adhesion,atomicjolt/adhesion,atomicjolt/adhesion,atomicjolt/adhesion
ruby
## Code Before: require "rails_helper" describe ApplicationController, type: :controller do controller do include Concerns::JwtToken before_action :validate_token respond_to :json def index render plain: "User: #{@user.display_name}" end def create render text: "I got created!" end end context "no authorization header" do it "should not be authorized" do get :index, format: :json expect(response).to have_http_status(:unauthorized) end end context "invalid authorization header" do it "should not be authorized" do request.headers["Authorization"] = "A fake header" get :index, format: :json expect(response).to have_http_status(:unauthorized) end end context "valid authorization header" do before do @user = FactoryGirl.create(:user) @user.confirm @user_token = AuthToken.issue_token({ user_id: @user.id }) request.headers["Authorization"] = @user_token end it "should be authorized" do get :index, format: :json expect(response).to have_http_status(:success) end end context "valid shared token" do it "should be authorized" do SharedAuth.create(secret: "shhhh im a secret") request.headers["SharedAuthorization"] = "shhhh im a secret" post :create, format: :json expect(response).to have_http_status(:success) end end context "invalid shared token" do it "should not be authorized" do SharedAuth.create(secret: "shhhh im a secret") request.headers["SharedAuthorization"] = "gar im a secret" post :create, format: :json expect(response).to have_http_status(:unauthorized) end end end ## Instruction: Remove old specs for SharedAuth jwt ## Code After: require "rails_helper" describe ApplicationController, type: :controller do controller do include Concerns::JwtToken before_action :validate_token respond_to :json def index render plain: "User: #{@user.display_name}" end def create render text: "I got created!" end end context "no authorization header" do it "should not be authorized" do get :index, format: :json expect(response).to have_http_status(:unauthorized) end end context "invalid authorization header" do it "should not be authorized" do request.headers["Authorization"] = "A fake header" get :index, format: :json expect(response).to have_http_status(:unauthorized) end end context "valid authorization header" do before do @user = FactoryGirl.create(:user) @user.confirm @user_token = AuthToken.issue_token({ user_id: @user.id }) request.headers["Authorization"] = @user_token end it "should be authorized" do get :index, format: :json expect(response).to have_http_status(:success) end end end
require "rails_helper" describe ApplicationController, type: :controller do controller do include Concerns::JwtToken before_action :validate_token respond_to :json def index render plain: "User: #{@user.display_name}" end def create render text: "I got created!" end end context "no authorization header" do it "should not be authorized" do get :index, format: :json expect(response).to have_http_status(:unauthorized) end end context "invalid authorization header" do it "should not be authorized" do request.headers["Authorization"] = "A fake header" get :index, format: :json expect(response).to have_http_status(:unauthorized) end end context "valid authorization header" do before do @user = FactoryGirl.create(:user) @user.confirm @user_token = AuthToken.issue_token({ user_id: @user.id }) request.headers["Authorization"] = @user_token end it "should be authorized" do get :index, format: :json expect(response).to have_http_status(:success) end end - - context "valid shared token" do - it "should be authorized" do - SharedAuth.create(secret: "shhhh im a secret") - request.headers["SharedAuthorization"] = "shhhh im a secret" - post :create, format: :json - expect(response).to have_http_status(:success) - end - end - - context "invalid shared token" do - it "should not be authorized" do - SharedAuth.create(secret: "shhhh im a secret") - request.headers["SharedAuthorization"] = "gar im a secret" - post :create, format: :json - expect(response).to have_http_status(:unauthorized) - end - end end
18
0.28125
0
18
6e09bfa080819103f6b19d2cdc9cbfdcc5f27ec9
src/lib.rs
src/lib.rs
//! An implementation of Google Protobuf's Variable-Length Integers
//! An implementation of Google Protobuf's Variable-Length Integers /// The maximum number of bytes used by a 32-bit Varint pub const VARINT_32_MAX_BYTES: u8 = 5; /// The maximum number of bytes used by a 32-bit Varint pub const VARINT_64_MAX_BYTES: u8 = 10; ///Checks to see if the most signifigant bit exists in the specified byte pub fn most_signifigant_bit_exists(input: u8) -> bool { input & 0b10000000 != 0 } #[cfg(test)] mod test { use super::*; #[test] fn test_most_signifigant_bit() { let mut value: u8 = 1; assert!(most_signifigant_bit_exists(value) == false); value = 120; assert!(most_signifigant_bit_exists(value) == false); value = 128; assert!(most_signifigant_bit_exists(value) == true); value = 129; assert!(most_signifigant_bit_exists(value) == true); } }
Check for most signifigant bit in a byte
Check for most signifigant bit in a byte
Rust
apache-2.0
Techern/Varint-rs
rust
## Code Before: //! An implementation of Google Protobuf's Variable-Length Integers ## Instruction: Check for most signifigant bit in a byte ## Code After: //! An implementation of Google Protobuf's Variable-Length Integers /// The maximum number of bytes used by a 32-bit Varint pub const VARINT_32_MAX_BYTES: u8 = 5; /// The maximum number of bytes used by a 32-bit Varint pub const VARINT_64_MAX_BYTES: u8 = 10; ///Checks to see if the most signifigant bit exists in the specified byte pub fn most_signifigant_bit_exists(input: u8) -> bool { input & 0b10000000 != 0 } #[cfg(test)] mod test { use super::*; #[test] fn test_most_signifigant_bit() { let mut value: u8 = 1; assert!(most_signifigant_bit_exists(value) == false); value = 120; assert!(most_signifigant_bit_exists(value) == false); value = 128; assert!(most_signifigant_bit_exists(value) == true); value = 129; assert!(most_signifigant_bit_exists(value) == true); } }
//! An implementation of Google Protobuf's Variable-Length Integers + + /// The maximum number of bytes used by a 32-bit Varint + pub const VARINT_32_MAX_BYTES: u8 = 5; + + /// The maximum number of bytes used by a 32-bit Varint + pub const VARINT_64_MAX_BYTES: u8 = 10; + + ///Checks to see if the most signifigant bit exists in the specified byte + pub fn most_signifigant_bit_exists(input: u8) -> bool { + input & 0b10000000 != 0 + } + + + + #[cfg(test)] + mod test { + + use super::*; + + #[test] + fn test_most_signifigant_bit() { + let mut value: u8 = 1; + + assert!(most_signifigant_bit_exists(value) == false); + + value = 120; + + assert!(most_signifigant_bit_exists(value) == false); + + value = 128; + + assert!(most_signifigant_bit_exists(value) == true); + + value = 129; + + assert!(most_signifigant_bit_exists(value) == true); + } + + }
39
39
39
0
1f3c9a469a96b8b80134a16f3843cda1a368f097
src/style_manager/view/PropertyColorView.js
src/style_manager/view/PropertyColorView.js
import PropertyIntegerView from './PropertyIntegerView'; import InputColor from 'domain_abstract/ui/InputColor'; export default PropertyIntegerView.extend({ setValue(value, opts = {}) { opts = { ...opts, silent: 1 }; this.inputInst.setValue(value, opts); }, remove() { PropertyIntegerView.prototype.remove.apply(this, arguments); this.inputInst.remove(); ['inputInst', '$color'].forEach(i => (this[i] = {})); }, onRender() { if (!this.input) { const ppfx = this.ppfx; const inputColor = new InputColor({ target: this.target, model: this.model, ppfx }); const input = inputColor.render(); this.el.querySelector(`.${ppfx}fields`).appendChild(input.el); this.$input = input.inputEl; this.$color = input.colorEl; this.input = this.$input.get(0); this.inputInst = input; } } });
import PropertyIntegerView from './PropertyIntegerView'; import InputColor from 'domain_abstract/ui/InputColor'; export default PropertyIntegerView.extend({ setValue(value, opts = {}) { opts = { ...opts, silent: 1 }; this.inputInst.setValue(value, opts); }, remove() { PropertyIntegerView.prototype.remove.apply(this, arguments); const inp = this.inputInst; inp && inp.remove(); ['inputInst', '$color'].forEach(i => (this[i] = {})); }, onRender() { if (!this.input) { const ppfx = this.ppfx; const inputColor = new InputColor({ target: this.target, model: this.model, ppfx }); const input = inputColor.render(); this.el.querySelector(`.${ppfx}fields`).appendChild(input.el); this.$input = input.inputEl; this.$color = input.colorEl; this.input = this.$input.get(0); this.inputInst = input; } } });
Check if input exists before remove
Check if input exists before remove
JavaScript
bsd-3-clause
artf/grapesjs,artf/grapesjs,artf/grapesjs
javascript
## Code Before: import PropertyIntegerView from './PropertyIntegerView'; import InputColor from 'domain_abstract/ui/InputColor'; export default PropertyIntegerView.extend({ setValue(value, opts = {}) { opts = { ...opts, silent: 1 }; this.inputInst.setValue(value, opts); }, remove() { PropertyIntegerView.prototype.remove.apply(this, arguments); this.inputInst.remove(); ['inputInst', '$color'].forEach(i => (this[i] = {})); }, onRender() { if (!this.input) { const ppfx = this.ppfx; const inputColor = new InputColor({ target: this.target, model: this.model, ppfx }); const input = inputColor.render(); this.el.querySelector(`.${ppfx}fields`).appendChild(input.el); this.$input = input.inputEl; this.$color = input.colorEl; this.input = this.$input.get(0); this.inputInst = input; } } }); ## Instruction: Check if input exists before remove ## Code After: import PropertyIntegerView from './PropertyIntegerView'; import InputColor from 'domain_abstract/ui/InputColor'; export default PropertyIntegerView.extend({ setValue(value, opts = {}) { opts = { ...opts, silent: 1 }; this.inputInst.setValue(value, opts); }, remove() { PropertyIntegerView.prototype.remove.apply(this, arguments); const inp = this.inputInst; inp && inp.remove(); ['inputInst', '$color'].forEach(i => (this[i] = {})); }, onRender() { if (!this.input) { const ppfx = this.ppfx; const inputColor = new InputColor({ target: this.target, model: this.model, ppfx }); const input = inputColor.render(); this.el.querySelector(`.${ppfx}fields`).appendChild(input.el); this.$input = input.inputEl; this.$color = input.colorEl; this.input = this.$input.get(0); this.inputInst = input; } } });
import PropertyIntegerView from './PropertyIntegerView'; import InputColor from 'domain_abstract/ui/InputColor'; export default PropertyIntegerView.extend({ setValue(value, opts = {}) { opts = { ...opts, silent: 1 }; this.inputInst.setValue(value, opts); }, remove() { PropertyIntegerView.prototype.remove.apply(this, arguments); - this.inputInst.remove(); + const inp = this.inputInst; + inp && inp.remove(); ['inputInst', '$color'].forEach(i => (this[i] = {})); }, onRender() { if (!this.input) { const ppfx = this.ppfx; const inputColor = new InputColor({ target: this.target, model: this.model, ppfx }); const input = inputColor.render(); this.el.querySelector(`.${ppfx}fields`).appendChild(input.el); this.$input = input.inputEl; this.$color = input.colorEl; this.input = this.$input.get(0); this.inputInst = input; } } });
3
0.09375
2
1
236aca020d200a7e12b8c4659928c79b95c464cd
setup.py
setup.py
import sys from setuptools import setup from ts3 import __version__ tests_require = ['mock'] if sys.version < '2.7': tests_require.append('unittest2') setup( name="python-ts3", version=__version__, description="TS3 ServerQuery library for Python", author="Andrew Willaims", author_email="andy@tensixtyone.com", url="https://github.com/nikdoof/python-ts3/", keywords="teamspeak ts3 voice serverquery teamspeak3", packages=['ts3'], scripts=['examples/gents3privkey.py'], test_suite='ts3.test.suite', tests_require=tests_require, classifiers=[ 'License :: OSI Approved :: BSD License', 'Topic :: Internet', 'Topic :: Communications', 'Intended Audience :: Developers', 'Development Status :: 3 - Alpha', ] )
import sys from setuptools import setup from ts3 import __version__ tests_require = ['mock'] if sys.version < '2.7': tests_require.append('unittest2') tests_require.append('ordereddict') setup( name="python-ts3", version=__version__, description="TS3 ServerQuery library for Python", author="Andrew Willaims", author_email="andy@tensixtyone.com", url="https://github.com/nikdoof/python-ts3/", keywords="teamspeak ts3 voice serverquery teamspeak3", packages=['ts3'], scripts=['examples/gents3privkey.py'], test_suite='ts3.test.suite', tests_require=tests_require, classifiers=[ 'License :: OSI Approved :: BSD License', 'Topic :: Internet', 'Topic :: Communications', 'Intended Audience :: Developers', 'Development Status :: 3 - Alpha', ] )
Add ordereddict package for Python 2.6
Add ordereddict package for Python 2.6
Python
bsd-3-clause
nikdoof/python-ts3,ryanbentley/python-ts3
python
## Code Before: import sys from setuptools import setup from ts3 import __version__ tests_require = ['mock'] if sys.version < '2.7': tests_require.append('unittest2') setup( name="python-ts3", version=__version__, description="TS3 ServerQuery library for Python", author="Andrew Willaims", author_email="andy@tensixtyone.com", url="https://github.com/nikdoof/python-ts3/", keywords="teamspeak ts3 voice serverquery teamspeak3", packages=['ts3'], scripts=['examples/gents3privkey.py'], test_suite='ts3.test.suite', tests_require=tests_require, classifiers=[ 'License :: OSI Approved :: BSD License', 'Topic :: Internet', 'Topic :: Communications', 'Intended Audience :: Developers', 'Development Status :: 3 - Alpha', ] ) ## Instruction: Add ordereddict package for Python 2.6 ## Code After: import sys from setuptools import setup from ts3 import __version__ tests_require = ['mock'] if sys.version < '2.7': tests_require.append('unittest2') tests_require.append('ordereddict') setup( name="python-ts3", version=__version__, description="TS3 ServerQuery library for Python", author="Andrew Willaims", author_email="andy@tensixtyone.com", url="https://github.com/nikdoof/python-ts3/", keywords="teamspeak ts3 voice serverquery teamspeak3", packages=['ts3'], scripts=['examples/gents3privkey.py'], test_suite='ts3.test.suite', tests_require=tests_require, classifiers=[ 'License :: OSI Approved :: BSD License', 'Topic :: Internet', 'Topic :: Communications', 'Intended Audience :: Developers', 'Development Status :: 3 - Alpha', ] )
import sys from setuptools import setup from ts3 import __version__ tests_require = ['mock'] if sys.version < '2.7': tests_require.append('unittest2') + tests_require.append('ordereddict') setup( name="python-ts3", version=__version__, description="TS3 ServerQuery library for Python", author="Andrew Willaims", author_email="andy@tensixtyone.com", url="https://github.com/nikdoof/python-ts3/", keywords="teamspeak ts3 voice serverquery teamspeak3", packages=['ts3'], scripts=['examples/gents3privkey.py'], test_suite='ts3.test.suite', tests_require=tests_require, classifiers=[ 'License :: OSI Approved :: BSD License', 'Topic :: Internet', 'Topic :: Communications', 'Intended Audience :: Developers', 'Development Status :: 3 - Alpha', ] )
1
0.034483
1
0
92d6c0b5d5d9533248727af3bcd607ba8eccd95a
models/user.js
models/user.js
module.exports = function(sequelize, DataTypes) { var User = sequelize.define('User', { username: { type: DataTypes.STRING, allowNull: false, unique: true }, password: { type: DataTypes.STRING, allowNull: false }, email: { type: DataTypes.STRING, allowNull: false }, level: { type: DataTypes.BIGINT, allowNull: false, defaultValue: 1 }, experience: { type: DataTypes.BIGINT, allowNull: false, defaultValue: 0 } }, { classMethods: { associate: function(models) { User.hasMany(models.Quest, {as: 'OwnedQuests', foreignKey: 'OwnerId'}); User.belongsToMany(models.Quest, {through: 'UsersQuests'}); } }, instanceMethods: { /** * Experience formula taken from HabitRPG * http://habitrpg.wikia.com/wiki/Experience_Points */ getExperienceForLevel: function() { return Math.round((0.25 * Math.pow(this.level, 2) + 10 * this.level + 139.75) / 10) * 10; }, /** * Increase experience by `amount` XP. * Level up if necessary. */ increaseExperience: function(amount) { this.experience += amount; while (this.experience >= this.getExperienceForLevel()) { this.experience -= this.getExperienceForLevel(); this.level++; } this.save(); } } }); return User; };
module.exports = function(sequelize, DataTypes) { var User = sequelize.define('User', { username: { type: DataTypes.STRING, allowNull: false, unique: true }, password: { type: DataTypes.STRING, allowNull: false }, email: { type: DataTypes.STRING, allowNull: false }, level: { type: DataTypes.INTEGER, allowNull: false, defaultValue: 1 }, experience: { type: DataTypes.INTEGER, allowNull: false, defaultValue: 0 } }, { classMethods: { associate: function(models) { User.hasMany(models.Quest, {as: 'OwnedQuests', foreignKey: 'OwnerId'}); User.belongsToMany(models.Quest, {through: 'UsersQuests'}); } }, instanceMethods: { /** * Experience formula taken from HabitRPG * http://habitrpg.wikia.com/wiki/Experience_Points */ getExperienceForLevel: function() { return Math.round((0.25 * Math.pow(this.level, 2) + 10 * this.level + 139.75) / 10) * 10; }, /** * Increase experience by `amount` XP. * Level up if necessary. */ increaseExperience: function(amount) { this.experience += amount; while (this.experience >= this.getExperienceForLevel()) { this.experience -= this.getExperienceForLevel(); this.level++; } this.save(); } } }); return User; };
Change level and experience to regular integers.
Change level and experience to regular integers.
JavaScript
mit
kevinwang/questkey
javascript
## Code Before: module.exports = function(sequelize, DataTypes) { var User = sequelize.define('User', { username: { type: DataTypes.STRING, allowNull: false, unique: true }, password: { type: DataTypes.STRING, allowNull: false }, email: { type: DataTypes.STRING, allowNull: false }, level: { type: DataTypes.BIGINT, allowNull: false, defaultValue: 1 }, experience: { type: DataTypes.BIGINT, allowNull: false, defaultValue: 0 } }, { classMethods: { associate: function(models) { User.hasMany(models.Quest, {as: 'OwnedQuests', foreignKey: 'OwnerId'}); User.belongsToMany(models.Quest, {through: 'UsersQuests'}); } }, instanceMethods: { /** * Experience formula taken from HabitRPG * http://habitrpg.wikia.com/wiki/Experience_Points */ getExperienceForLevel: function() { return Math.round((0.25 * Math.pow(this.level, 2) + 10 * this.level + 139.75) / 10) * 10; }, /** * Increase experience by `amount` XP. * Level up if necessary. */ increaseExperience: function(amount) { this.experience += amount; while (this.experience >= this.getExperienceForLevel()) { this.experience -= this.getExperienceForLevel(); this.level++; } this.save(); } } }); return User; }; ## Instruction: Change level and experience to regular integers. ## Code After: module.exports = function(sequelize, DataTypes) { var User = sequelize.define('User', { username: { type: DataTypes.STRING, allowNull: false, unique: true }, password: { type: DataTypes.STRING, allowNull: false }, email: { type: DataTypes.STRING, allowNull: false }, level: { type: DataTypes.INTEGER, allowNull: false, defaultValue: 1 }, experience: { type: DataTypes.INTEGER, allowNull: false, defaultValue: 0 } }, { classMethods: { associate: function(models) { User.hasMany(models.Quest, {as: 'OwnedQuests', foreignKey: 'OwnerId'}); User.belongsToMany(models.Quest, {through: 'UsersQuests'}); } }, instanceMethods: { /** * Experience formula taken from HabitRPG * http://habitrpg.wikia.com/wiki/Experience_Points */ getExperienceForLevel: function() { return Math.round((0.25 * Math.pow(this.level, 2) + 10 * this.level + 139.75) / 10) * 10; }, /** * Increase experience by `amount` XP. * Level up if necessary. */ increaseExperience: function(amount) { this.experience += amount; while (this.experience >= this.getExperienceForLevel()) { this.experience -= this.getExperienceForLevel(); this.level++; } this.save(); } } }); return User; };
module.exports = function(sequelize, DataTypes) { var User = sequelize.define('User', { username: { type: DataTypes.STRING, allowNull: false, unique: true }, password: { type: DataTypes.STRING, allowNull: false }, email: { type: DataTypes.STRING, allowNull: false }, level: { - type: DataTypes.BIGINT, ? --- + type: DataTypes.INTEGER, ? ++++ allowNull: false, defaultValue: 1 }, experience: { - type: DataTypes.BIGINT, ? --- + type: DataTypes.INTEGER, ? ++++ allowNull: false, defaultValue: 0 } }, { classMethods: { associate: function(models) { User.hasMany(models.Quest, {as: 'OwnedQuests', foreignKey: 'OwnerId'}); User.belongsToMany(models.Quest, {through: 'UsersQuests'}); } }, instanceMethods: { /** * Experience formula taken from HabitRPG * http://habitrpg.wikia.com/wiki/Experience_Points */ getExperienceForLevel: function() { return Math.round((0.25 * Math.pow(this.level, 2) + 10 * this.level + 139.75) / 10) * 10; }, /** * Increase experience by `amount` XP. * Level up if necessary. */ increaseExperience: function(amount) { this.experience += amount; while (this.experience >= this.getExperienceForLevel()) { this.experience -= this.getExperienceForLevel(); this.level++; } this.save(); } } }); return User; };
4
0.071429
2
2
806b2380315753f393eb2640bc8c97aab3948cbb
config/sota_implicit_prov_ca.toml
config/sota_implicit_prov_ca.toml
[tls] server_url_path = "/var/sota/gateway.url" [storage] type = "sqlite" sqldb_path = "/var/sota/sql.db" schemas_path = "/usr/lib/sota/schemas" [import] tls_cacert_path = "/var/sota/root.crt" tls_clientcert_path = "/var/sota/client.pem" tls_pkey_path = "/var/sota/pkey.pem"
[tls] server_url_path = "/var/sota/gateway.url" [storage] type = "sqlite" sqldb_path = "/var/sota/sql.db" schemas_path = "/usr/lib/sota/schemas" [import] tls_cacert_path = "/var/sota/import_root.crt" tls_clientcert_path = "/var/sota/import_client.pem" tls_pkey_path = "/var/sota/import_pkey.pem"
Change paths of imported data to not intersect with fsstorage data
Change paths of imported data to not intersect with fsstorage data
TOML
mpl-2.0
advancedtelematic/sota_client_cpp,advancedtelematic/aktualizr,advancedtelematic/aktualizr,advancedtelematic/aktualizr,advancedtelematic/aktualizr,advancedtelematic/sota_client_cpp
toml
## Code Before: [tls] server_url_path = "/var/sota/gateway.url" [storage] type = "sqlite" sqldb_path = "/var/sota/sql.db" schemas_path = "/usr/lib/sota/schemas" [import] tls_cacert_path = "/var/sota/root.crt" tls_clientcert_path = "/var/sota/client.pem" tls_pkey_path = "/var/sota/pkey.pem" ## Instruction: Change paths of imported data to not intersect with fsstorage data ## Code After: [tls] server_url_path = "/var/sota/gateway.url" [storage] type = "sqlite" sqldb_path = "/var/sota/sql.db" schemas_path = "/usr/lib/sota/schemas" [import] tls_cacert_path = "/var/sota/import_root.crt" tls_clientcert_path = "/var/sota/import_client.pem" tls_pkey_path = "/var/sota/import_pkey.pem"
[tls] server_url_path = "/var/sota/gateway.url" [storage] type = "sqlite" sqldb_path = "/var/sota/sql.db" schemas_path = "/usr/lib/sota/schemas" [import] - tls_cacert_path = "/var/sota/root.crt" + tls_cacert_path = "/var/sota/import_root.crt" ? +++++++ - tls_clientcert_path = "/var/sota/client.pem" + tls_clientcert_path = "/var/sota/import_client.pem" ? +++++++ - tls_pkey_path = "/var/sota/pkey.pem" + tls_pkey_path = "/var/sota/import_pkey.pem" ? +++++++
6
0.5
3
3
640ce1a3b4f9cca4ebcc10f3d62b1d4d995dd0c5
src/foremast/pipeline/create_pipeline_manual.py
src/foremast/pipeline/create_pipeline_manual.py
"""Create manual Pipeline for Spinnaker.""" from ..utils.lookups import FileLookup from .create_pipeline import SpinnakerPipeline class SpinnakerPipelineManual(SpinnakerPipeline): """Manual JSON configured Spinnaker Pipelines.""" def create_pipeline(self): """Use JSON files to create Pipelines.""" self.log.info('Uploading manual Pipelines: %s') lookup = FileLookup(git_short=self.generated.gitlab()['main'], runway_dir=self.runway_dir) for json_file in self.settings['pipeline']['pipeline_files']: json_dict = lookup.json(filename=json_file) json_dict['name'] = json_file self.post_pipeline(json_dict) return True
"""Create manual Pipeline for Spinnaker.""" from ..utils.lookups import FileLookup from .clean_pipelines import delete_pipeline from .create_pipeline import SpinnakerPipeline class SpinnakerPipelineManual(SpinnakerPipeline): """Manual JSON configured Spinnaker Pipelines.""" def create_pipeline(self): """Use JSON files to create Pipelines.""" self.log.info('Uploading manual Pipelines: %s') lookup = FileLookup(git_short=self.generated.gitlab()['main'], runway_dir=self.runway_dir) for json_file in self.settings['pipeline']['pipeline_files']: delete_pipeline(app=self.app_name, pipeline_name=json_file) json_dict = lookup.json(filename=json_file) json_dict['name'] = json_file self.post_pipeline(json_dict) return True
Delete manual Pipeline before creating
fix: Delete manual Pipeline before creating See also: #72
Python
apache-2.0
gogoair/foremast,gogoair/foremast
python
## Code Before: """Create manual Pipeline for Spinnaker.""" from ..utils.lookups import FileLookup from .create_pipeline import SpinnakerPipeline class SpinnakerPipelineManual(SpinnakerPipeline): """Manual JSON configured Spinnaker Pipelines.""" def create_pipeline(self): """Use JSON files to create Pipelines.""" self.log.info('Uploading manual Pipelines: %s') lookup = FileLookup(git_short=self.generated.gitlab()['main'], runway_dir=self.runway_dir) for json_file in self.settings['pipeline']['pipeline_files']: json_dict = lookup.json(filename=json_file) json_dict['name'] = json_file self.post_pipeline(json_dict) return True ## Instruction: fix: Delete manual Pipeline before creating See also: #72 ## Code After: """Create manual Pipeline for Spinnaker.""" from ..utils.lookups import FileLookup from .clean_pipelines import delete_pipeline from .create_pipeline import SpinnakerPipeline class SpinnakerPipelineManual(SpinnakerPipeline): """Manual JSON configured Spinnaker Pipelines.""" def create_pipeline(self): """Use JSON files to create Pipelines.""" self.log.info('Uploading manual Pipelines: %s') lookup = FileLookup(git_short=self.generated.gitlab()['main'], runway_dir=self.runway_dir) for json_file in self.settings['pipeline']['pipeline_files']: delete_pipeline(app=self.app_name, pipeline_name=json_file) json_dict = lookup.json(filename=json_file) json_dict['name'] = json_file self.post_pipeline(json_dict) return True
"""Create manual Pipeline for Spinnaker.""" from ..utils.lookups import FileLookup + from .clean_pipelines import delete_pipeline from .create_pipeline import SpinnakerPipeline class SpinnakerPipelineManual(SpinnakerPipeline): """Manual JSON configured Spinnaker Pipelines.""" def create_pipeline(self): """Use JSON files to create Pipelines.""" self.log.info('Uploading manual Pipelines: %s') lookup = FileLookup(git_short=self.generated.gitlab()['main'], runway_dir=self.runway_dir) for json_file in self.settings['pipeline']['pipeline_files']: + delete_pipeline(app=self.app_name, pipeline_name=json_file) + json_dict = lookup.json(filename=json_file) json_dict['name'] = json_file self.post_pipeline(json_dict) return True
3
0.157895
3
0
28c5889b5b0b1e3228de29e1e2019eedfa5eea4a
app/assets/javascripts/templates/categories.jst.skim.erb
app/assets/javascripts/templates/categories.jst.skim.erb
.categories-header-container .container .categories-header-row .categories-header-col .col-md-4 img src="<%= image_path('cocoa-tree-320.png') %>" .col-md-8 p.alert.alert-warning | We need your help to add missing categories. Just send us your ' a href="https://github.com/cocoa-tree/categories" | pull-request | . h1 CocoaTree p | The CocoaTree is a comprehensive catalog of open source Objective-C projects. In essence, it is based on the popular ' a href="http://cocoapods.org" CocoaPods repository | . Additionally, popularity and activity ratings are calculated using data provided by a href="https://github.com" GitHub | . .categories-container .container .row .col-xs-12 h1 = @categories.length ' | Categories .categories-row - columns = 3 - categoriesPerColumn = parseInt(@categories.length / columns) - if categoriesPerColumn * columns < @categories.length - categoriesPerColumn++ - column = 0 - while column < columns .categories-col - i = categoriesPerColumn * column - while i < (categoriesPerColumn * (column + 1)) && i < @categories.length - category = @categories[i] a href="#pods/#{category.get('name')}" span = category.displayName() ' span.badge.badge-yellow = category.get('podsCount') - i++ - column++
.categories-header-container .container .categories-header-row .categories-header-col .col-md-4 img src="<%= image_path('cocoa-tree-320.png') %>" .col-md-8 p.alert.alert-warning | We need your help to add missing categories. Just send us your ' a href="https://github.com/cocoa-tree/categories/edit/master/cocoa_pods_categories.json" | pull-request | . h1 CocoaTree p | The CocoaTree is a comprehensive catalog of open source Objective-C projects. In essence, it is based on the popular ' a href="http://cocoapods.org" CocoaPods repository | . Additionally, popularity and activity ratings are calculated using data provided by a href="https://github.com" GitHub | . .categories-container .container .row .col-xs-12 h1 = @categories.length ' | Categories .categories-row - columns = 3 - categoriesPerColumn = parseInt(@categories.length / columns) - if categoriesPerColumn * columns < @categories.length - categoriesPerColumn++ - column = 0 - while column < columns .categories-col - i = categoriesPerColumn * column - while i < (categoriesPerColumn * (column + 1)) && i < @categories.length - category = @categories[i] a href="#pods/#{category.get('name')}" span = category.displayName() ' span.badge.badge-yellow = category.get('podsCount') - i++ - column++
Fix pull-request link on categories.
Fix pull-request link on categories.
HTML+ERB
mit
bsingr/cocoa-tree,bsingr/cocoa-tree,bsingr/cocoa-tree
html+erb
## Code Before: .categories-header-container .container .categories-header-row .categories-header-col .col-md-4 img src="<%= image_path('cocoa-tree-320.png') %>" .col-md-8 p.alert.alert-warning | We need your help to add missing categories. Just send us your ' a href="https://github.com/cocoa-tree/categories" | pull-request | . h1 CocoaTree p | The CocoaTree is a comprehensive catalog of open source Objective-C projects. In essence, it is based on the popular ' a href="http://cocoapods.org" CocoaPods repository | . Additionally, popularity and activity ratings are calculated using data provided by a href="https://github.com" GitHub | . .categories-container .container .row .col-xs-12 h1 = @categories.length ' | Categories .categories-row - columns = 3 - categoriesPerColumn = parseInt(@categories.length / columns) - if categoriesPerColumn * columns < @categories.length - categoriesPerColumn++ - column = 0 - while column < columns .categories-col - i = categoriesPerColumn * column - while i < (categoriesPerColumn * (column + 1)) && i < @categories.length - category = @categories[i] a href="#pods/#{category.get('name')}" span = category.displayName() ' span.badge.badge-yellow = category.get('podsCount') - i++ - column++ ## Instruction: Fix pull-request link on categories. ## Code After: .categories-header-container .container .categories-header-row .categories-header-col .col-md-4 img src="<%= image_path('cocoa-tree-320.png') %>" .col-md-8 p.alert.alert-warning | We need your help to add missing categories. Just send us your ' a href="https://github.com/cocoa-tree/categories/edit/master/cocoa_pods_categories.json" | pull-request | . h1 CocoaTree p | The CocoaTree is a comprehensive catalog of open source Objective-C projects. In essence, it is based on the popular ' a href="http://cocoapods.org" CocoaPods repository | . Additionally, popularity and activity ratings are calculated using data provided by a href="https://github.com" GitHub | . .categories-container .container .row .col-xs-12 h1 = @categories.length ' | Categories .categories-row - columns = 3 - categoriesPerColumn = parseInt(@categories.length / columns) - if categoriesPerColumn * columns < @categories.length - categoriesPerColumn++ - column = 0 - while column < columns .categories-col - i = categoriesPerColumn * column - while i < (categoriesPerColumn * (column + 1)) && i < @categories.length - category = @categories[i] a href="#pods/#{category.get('name')}" span = category.displayName() ' span.badge.badge-yellow = category.get('podsCount') - i++ - column++
.categories-header-container .container .categories-header-row .categories-header-col .col-md-4 img src="<%= image_path('cocoa-tree-320.png') %>" .col-md-8 p.alert.alert-warning | We need your help to add missing categories. Just send us your ' - a href="https://github.com/cocoa-tree/categories" + a href="https://github.com/cocoa-tree/categories/edit/master/cocoa_pods_categories.json" ? +++++++++++++++++++++++++++++++++++++++ | pull-request | . h1 CocoaTree p | The CocoaTree is a comprehensive catalog of open source Objective-C projects. In essence, it is based on the popular ' a href="http://cocoapods.org" CocoaPods repository | . Additionally, popularity and activity ratings are calculated using data provided by a href="https://github.com" GitHub | . .categories-container .container .row .col-xs-12 h1 = @categories.length ' | Categories .categories-row - columns = 3 - categoriesPerColumn = parseInt(@categories.length / columns) - if categoriesPerColumn * columns < @categories.length - categoriesPerColumn++ - column = 0 - while column < columns .categories-col - i = categoriesPerColumn * column - while i < (categoriesPerColumn * (column + 1)) && i < @categories.length - category = @categories[i] a href="#pods/#{category.get('name')}" span = category.displayName() ' span.badge.badge-yellow = category.get('podsCount') - i++ - column++
2
0.043478
1
1
6f50d476c71fc6cd2542bd31a7f98df831b98e82
_posts/2017-02-12-test.md
_posts/2017-02-12-test.md
--- title: "test" layout: "default" date: 2017-02-12 23:43:04 +0300 --- You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `bundle exec jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated. To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works. LaTeX test: $$ 5 + 5 $$
--- title: "test" layout: "default" date: 2017-02-12 23:43:04 +0300 tags: test --- You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `bundle exec jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated. To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works. LaTeX test: $$ 5 + 5 $$
Add tag to the test post
Add tag to the test post
Markdown
mit
vpetrigo/electronics
markdown
## Code Before: --- title: "test" layout: "default" date: 2017-02-12 23:43:04 +0300 --- You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `bundle exec jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated. To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works. LaTeX test: $$ 5 + 5 $$ ## Instruction: Add tag to the test post ## Code After: --- title: "test" layout: "default" date: 2017-02-12 23:43:04 +0300 tags: test --- You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `bundle exec jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated. To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works. LaTeX test: $$ 5 + 5 $$
--- title: "test" layout: "default" date: 2017-02-12 23:43:04 +0300 + tags: test --- You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `bundle exec jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated. To add new posts, simply add a file in the `_posts` directory that follows the convention `YYYY-MM-DD-name-of-post.ext` and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works. LaTeX test: $$ 5 + 5 $$
1
0.076923
1
0
461f9517fc773f72d2e0fe5c5f9949e1b7dcc074
flow/net/net.rb
flow/net/net.rb
module Net USER_AGENT = "Net - https://bitbucket.org/hipbyte/flow" def self.session(base_url, &block) Session.build(base_url, &block) end class << self [:get, :post, :put, :delete, :patch, :options, :head].each do |http_medhod| define_method(http_medhod) do |base_url, *options, &callback| Request.send(http_medhod, base_url, options.shift || {}, &callback) end end end end
module Net USER_AGENT = "Net - https://bitbucket.org/hipbyte/flow" class << self def session(base_url, &block) Session.build(base_url, &block) end [:get, :post, :put, :delete, :patch, :options, :head].each do |http_medhod| define_method(http_medhod) do |base_url, *options, &callback| Request.send(http_medhod, base_url, options.shift || {}, &callback) end end end end
Move method in class methods
Move method in class methods
Ruby
bsd-2-clause
hboon/Flow,HipByte/Flow,hboon/Flow,HipByte/Flow,hboon/Flow,hboon/Flow,HipByte/Flow,HipByte/Flow
ruby
## Code Before: module Net USER_AGENT = "Net - https://bitbucket.org/hipbyte/flow" def self.session(base_url, &block) Session.build(base_url, &block) end class << self [:get, :post, :put, :delete, :patch, :options, :head].each do |http_medhod| define_method(http_medhod) do |base_url, *options, &callback| Request.send(http_medhod, base_url, options.shift || {}, &callback) end end end end ## Instruction: Move method in class methods ## Code After: module Net USER_AGENT = "Net - https://bitbucket.org/hipbyte/flow" class << self def session(base_url, &block) Session.build(base_url, &block) end [:get, :post, :put, :delete, :patch, :options, :head].each do |http_medhod| define_method(http_medhod) do |base_url, *options, &callback| Request.send(http_medhod, base_url, options.shift || {}, &callback) end end end end
module Net USER_AGENT = "Net - https://bitbucket.org/hipbyte/flow" + class << self - def self.session(base_url, &block) ? ----- + def session(base_url, &block) ? ++ - Session.build(base_url, &block) + Session.build(base_url, &block) ? ++ - end + end ? ++ - class << self [:get, :post, :put, :delete, :patch, :options, :head].each do |http_medhod| define_method(http_medhod) do |base_url, *options, &callback| Request.send(http_medhod, base_url, options.shift || {}, &callback) end end end end
8
0.533333
4
4
7326fd491776556f342d6fa80042ade9eadd466c
bot-src/bot/package.json
bot-src/bot/package.json
{ "name": "msks-bot", "version": "0.0.1", "description": "", "main": "index.js", "scripts": { "start": "node src/index.js", "repl": "node src/repl.js", "test": "echo \"Error: no test specified\" && exit 1" }, "license": "MIT", "dependencies": { "bluebird": "^3.4.7", "irc-framework": "^2.6.0", "joi": "^10.2.2", "lodash": "^4.17.4", "promise-queue": "^2.2.3", "rethinkdbdash": "^2.3.28", "uuid": "^3.0.1" } }
{ "name": "msks-bot", "version": "0.0.1", "description": "", "main": "index.js", "scripts": { "start": "node src/index.js", "repl": "node src/repl.js", "test": "echo \"Error: no test specified\" && exit 1", "deploy": "docker build -t msks-bot . && docker save -o ~/msks-bot.tar msks-bot && scp ~/msks-bot.tar root@dagrev.is:~ && ssh root@dagrev.is docker load -i msks-bot.tar" }, "license": "MIT", "dependencies": { "bluebird": "^3.4.7", "irc-framework": "^2.6.0", "joi": "^10.2.2", "lodash": "^4.17.4", "promise-queue": "^2.2.3", "rethinkdbdash": "^2.3.28", "uuid": "^3.0.1" } }
Add command for deploying image
Add command for deploying image
JSON
mit
daGrevis/msks,daGrevis/msks,daGrevis/msks
json
## Code Before: { "name": "msks-bot", "version": "0.0.1", "description": "", "main": "index.js", "scripts": { "start": "node src/index.js", "repl": "node src/repl.js", "test": "echo \"Error: no test specified\" && exit 1" }, "license": "MIT", "dependencies": { "bluebird": "^3.4.7", "irc-framework": "^2.6.0", "joi": "^10.2.2", "lodash": "^4.17.4", "promise-queue": "^2.2.3", "rethinkdbdash": "^2.3.28", "uuid": "^3.0.1" } } ## Instruction: Add command for deploying image ## Code After: { "name": "msks-bot", "version": "0.0.1", "description": "", "main": "index.js", "scripts": { "start": "node src/index.js", "repl": "node src/repl.js", "test": "echo \"Error: no test specified\" && exit 1", "deploy": "docker build -t msks-bot . && docker save -o ~/msks-bot.tar msks-bot && scp ~/msks-bot.tar root@dagrev.is:~ && ssh root@dagrev.is docker load -i msks-bot.tar" }, "license": "MIT", "dependencies": { "bluebird": "^3.4.7", "irc-framework": "^2.6.0", "joi": "^10.2.2", "lodash": "^4.17.4", "promise-queue": "^2.2.3", "rethinkdbdash": "^2.3.28", "uuid": "^3.0.1" } }
{ "name": "msks-bot", "version": "0.0.1", "description": "", "main": "index.js", "scripts": { "start": "node src/index.js", "repl": "node src/repl.js", - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\" && exit 1", ? + + "deploy": "docker build -t msks-bot . && docker save -o ~/msks-bot.tar msks-bot && scp ~/msks-bot.tar root@dagrev.is:~ && ssh root@dagrev.is docker load -i msks-bot.tar" }, "license": "MIT", "dependencies": { "bluebird": "^3.4.7", "irc-framework": "^2.6.0", "joi": "^10.2.2", "lodash": "^4.17.4", "promise-queue": "^2.2.3", "rethinkdbdash": "^2.3.28", "uuid": "^3.0.1" } }
3
0.142857
2
1
9c9319516875875707f1d922d9dd20d9f2c1ce6e
setup.py
setup.py
from setuptools import setup from util import __version__ setup( name="util", author="Olav Vahtras", author_email="olav.vahtras@gmail.com", version=__version__, url="https://github.com/vahtras/util", packages=["util"], install_requires=["numpy", "scipy"], )
from setuptools import setup from util import __version__ setup( name="blocked-matrix-utils", author="Olav Vahtras", author_email="olav.vahtras@gmail.com", version=__version__, url="https://github.com/vahtras/util", packages=["util"], install_requires=["numpy", "scipy"], )
Change name taken in pypi
Change name taken in pypi
Python
mit
vahtras/util
python
## Code Before: from setuptools import setup from util import __version__ setup( name="util", author="Olav Vahtras", author_email="olav.vahtras@gmail.com", version=__version__, url="https://github.com/vahtras/util", packages=["util"], install_requires=["numpy", "scipy"], ) ## Instruction: Change name taken in pypi ## Code After: from setuptools import setup from util import __version__ setup( name="blocked-matrix-utils", author="Olav Vahtras", author_email="olav.vahtras@gmail.com", version=__version__, url="https://github.com/vahtras/util", packages=["util"], install_requires=["numpy", "scipy"], )
from setuptools import setup from util import __version__ setup( - name="util", + name="blocked-matrix-utils", author="Olav Vahtras", author_email="olav.vahtras@gmail.com", version=__version__, url="https://github.com/vahtras/util", packages=["util"], install_requires=["numpy", "scipy"], )
2
0.166667
1
1
bb157def05e914c2100a807929a5d527b12ccad1
.travis.yml
.travis.yml
language: node_js node_js: - "node" notifications: slack: tgifhq:SgGGnVYdfHKGSBOKkuXxuhut
language: node_js node_js: - node notifications: slack: rooms: secure: nmRoHenM1CRQQ0/ZV4jX3Zv9k8enw9X/oBP2Ux/WOSgSm6RuY+c1j30/yxtA67r142Ql/uPhRDCZ6yl+MExPG+evwjJJv/bQyOdCvL+or51AOLBDllvB0dbFfD3b6R1m+AoJOuxIUQRfrsMVpiZIoWxrIzauM+0egFRUAcY5vaIbbNrA+U7ucngD33+XhMLSMLIb8/2EQOeKcyXBdMBARzcMhg2EvgKVk9G1VBxrU0rQHBNWsmPOMtas5Ai5+9oAtGYNcM7kquCZemzdOEI48UZCeFsDUug02vikTq4sdDeh7+9N9tZdfJ7VVv3rrJnQwaMB8OfhR+bWYLjfINyM67DRAlqaDKqC/JAY4WYubTJ7h6G7Ys3KlrO4XHWNYMzJVMNyYhdWmLsG3pw5ZGcWeVUwbx0jVuGAhzQLzn5BQKAGIHeq4cOAjGSnNU2CtzHzXoovZ1xqVdbIB1Wd0d9/tfwbR+kaB2r0gskuJyTOgrxvy0dbRW6gvE79chFDf580VCZ4qd8XlBpd7ea67aUb9xveQMAVkQb48AwLfGIIIApXK41qnmHXaWm+aTdBvHIhmlXf+y4op5kK1JxwWx2cMl8zxCMot6uumIiIWz5UzVrUrM8VpXuCpZgixjubAv7i2Hy/bwR7RGF3wzaff+X/mPA7WFOYP0bfX8bj8L1/qvo=
Change to use encryption token
Change to use encryption token
YAML
mit
na0ya/izakaya,na0ya/izakaya
yaml
## Code Before: language: node_js node_js: - "node" notifications: slack: tgifhq:SgGGnVYdfHKGSBOKkuXxuhut ## Instruction: Change to use encryption token ## Code After: language: node_js node_js: - node notifications: slack: rooms: secure: nmRoHenM1CRQQ0/ZV4jX3Zv9k8enw9X/oBP2Ux/WOSgSm6RuY+c1j30/yxtA67r142Ql/uPhRDCZ6yl+MExPG+evwjJJv/bQyOdCvL+or51AOLBDllvB0dbFfD3b6R1m+AoJOuxIUQRfrsMVpiZIoWxrIzauM+0egFRUAcY5vaIbbNrA+U7ucngD33+XhMLSMLIb8/2EQOeKcyXBdMBARzcMhg2EvgKVk9G1VBxrU0rQHBNWsmPOMtas5Ai5+9oAtGYNcM7kquCZemzdOEI48UZCeFsDUug02vikTq4sdDeh7+9N9tZdfJ7VVv3rrJnQwaMB8OfhR+bWYLjfINyM67DRAlqaDKqC/JAY4WYubTJ7h6G7Ys3KlrO4XHWNYMzJVMNyYhdWmLsG3pw5ZGcWeVUwbx0jVuGAhzQLzn5BQKAGIHeq4cOAjGSnNU2CtzHzXoovZ1xqVdbIB1Wd0d9/tfwbR+kaB2r0gskuJyTOgrxvy0dbRW6gvE79chFDf580VCZ4qd8XlBpd7ea67aUb9xveQMAVkQb48AwLfGIIIApXK41qnmHXaWm+aTdBvHIhmlXf+y4op5kK1JxwWx2cMl8zxCMot6uumIiIWz5UzVrUrM8VpXuCpZgixjubAv7i2Hy/bwR7RGF3wzaff+X/mPA7WFOYP0bfX8bj8L1/qvo=
language: node_js node_js: - - "node" ? -- - - + - node - notifications: - slack: tgifhq:SgGGnVYdfHKGSBOKkuXxuhut - - + slack: + rooms: + secure: nmRoHenM1CRQQ0/ZV4jX3Zv9k8enw9X/oBP2Ux/WOSgSm6RuY+c1j30/yxtA67r142Ql/uPhRDCZ6yl+MExPG+evwjJJv/bQyOdCvL+or51AOLBDllvB0dbFfD3b6R1m+AoJOuxIUQRfrsMVpiZIoWxrIzauM+0egFRUAcY5vaIbbNrA+U7ucngD33+XhMLSMLIb8/2EQOeKcyXBdMBARzcMhg2EvgKVk9G1VBxrU0rQHBNWsmPOMtas5Ai5+9oAtGYNcM7kquCZemzdOEI48UZCeFsDUug02vikTq4sdDeh7+9N9tZdfJ7VVv3rrJnQwaMB8OfhR+bWYLjfINyM67DRAlqaDKqC/JAY4WYubTJ7h6G7Ys3KlrO4XHWNYMzJVMNyYhdWmLsG3pw5ZGcWeVUwbx0jVuGAhzQLzn5BQKAGIHeq4cOAjGSnNU2CtzHzXoovZ1xqVdbIB1Wd0d9/tfwbR+kaB2r0gskuJyTOgrxvy0dbRW6gvE79chFDf580VCZ4qd8XlBpd7ea67aUb9xveQMAVkQb48AwLfGIIIApXK41qnmHXaWm+aTdBvHIhmlXf+y4op5kK1JxwWx2cMl8zxCMot6uumIiIWz5UzVrUrM8VpXuCpZgixjubAv7i2Hy/bwR7RGF3wzaff+X/mPA7WFOYP0bfX8bj8L1/qvo=
9
1.125
4
5