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
9be03ec02b0d5a98ef0b32fd66432dce06cbd079
README.md
README.md
Calorisaur ========== http://calorisaur.com A simple calorie tracker which uses a lovable but hungry dinosaur to guilt you into recording calorie counts Development ----------- The basic environment follows the guidance of http://angular-rails.com/, with deployment using Heroku. There are some slight deviations from angular-rails.com's guidance for Heroku compatibility and for compatibility with more recent versions of the assorted frameworks in use, but it's basically accurate and discrepencies should be identified in local comments. https://c9.io/dbjorge/calorisaur is the development environment I use. Start by creating a Ruby on Rails workspace from a clone of the calorisaur repository, which covers basic Ubuntu, RoR, and Node.js installation for you. From there, run SetupCloud9Workspace.sh, which sets up PostgreSQL and installs the required packages in the assorted package managers in use (Gems, NPM, Bower). At this point, Cloud9's "Auto" runner should Just Work.
**⚠️ This project was never finished and is not maintained. It has been archived and will not receive future updates. ⚠️** Calorisaur ========== http://calorisaur.com A simple calorie tracker which uses a lovable but hungry dinosaur to guilt you into recording calorie counts Development ----------- The basic environment follows the guidance of http://angular-rails.com/, with deployment using Heroku. There are some slight deviations from angular-rails.com's guidance for Heroku compatibility and for compatibility with more recent versions of the assorted frameworks in use, but it's basically accurate and discrepencies should be identified in local comments. https://c9.io/dbjorge/calorisaur is the development environment I use. Start by creating a Ruby on Rails workspace from a clone of the calorisaur repository, which covers basic Ubuntu, RoR, and Node.js installation for you. From there, run SetupCloud9Workspace.sh, which sets up PostgreSQL and installs the required packages in the assorted package managers in use (Gems, NPM, Bower). At this point, Cloud9's "Auto" runner should Just Work.
Add deprecation/archive notice to readme
Add deprecation/archive notice to readme
Markdown
apache-2.0
dbjorge/Calorisaur,dbjorge/Calorisaur,dbjorge/Calorisaur
markdown
## Code Before: Calorisaur ========== http://calorisaur.com A simple calorie tracker which uses a lovable but hungry dinosaur to guilt you into recording calorie counts Development ----------- The basic environment follows the guidance of http://angular-rails.com/, with deployment using Heroku. There are some slight deviations from angular-rails.com's guidance for Heroku compatibility and for compatibility with more recent versions of the assorted frameworks in use, but it's basically accurate and discrepencies should be identified in local comments. https://c9.io/dbjorge/calorisaur is the development environment I use. Start by creating a Ruby on Rails workspace from a clone of the calorisaur repository, which covers basic Ubuntu, RoR, and Node.js installation for you. From there, run SetupCloud9Workspace.sh, which sets up PostgreSQL and installs the required packages in the assorted package managers in use (Gems, NPM, Bower). At this point, Cloud9's "Auto" runner should Just Work. ## Instruction: Add deprecation/archive notice to readme ## Code After: **⚠️ This project was never finished and is not maintained. It has been archived and will not receive future updates. ⚠️** Calorisaur ========== http://calorisaur.com A simple calorie tracker which uses a lovable but hungry dinosaur to guilt you into recording calorie counts Development ----------- The basic environment follows the guidance of http://angular-rails.com/, with deployment using Heroku. There are some slight deviations from angular-rails.com's guidance for Heroku compatibility and for compatibility with more recent versions of the assorted frameworks in use, but it's basically accurate and discrepencies should be identified in local comments. https://c9.io/dbjorge/calorisaur is the development environment I use. Start by creating a Ruby on Rails workspace from a clone of the calorisaur repository, which covers basic Ubuntu, RoR, and Node.js installation for you. From there, run SetupCloud9Workspace.sh, which sets up PostgreSQL and installs the required packages in the assorted package managers in use (Gems, NPM, Bower). At this point, Cloud9's "Auto" runner should Just Work.
+ **⚠️ This project was never finished and is not maintained. It has been archived and will not receive future updates. ⚠️** + Calorisaur ========== http://calorisaur.com A simple calorie tracker which uses a lovable but hungry dinosaur to guilt you into recording calorie counts Development ----------- The basic environment follows the guidance of http://angular-rails.com/, with deployment using Heroku. There are some slight deviations from angular-rails.com's guidance for Heroku compatibility and for compatibility with more recent versions of the assorted frameworks in use, but it's basically accurate and discrepencies should be identified in local comments. https://c9.io/dbjorge/calorisaur is the development environment I use. Start by creating a Ruby on Rails workspace from a clone of the calorisaur repository, which covers basic Ubuntu, RoR, and Node.js installation for you. From there, run SetupCloud9Workspace.sh, which sets up PostgreSQL and installs the required packages in the assorted package managers in use (Gems, NPM, Bower). At this point, Cloud9's "Auto" runner should Just Work.
2
0.090909
2
0
ee6af762a832f2ec3e5416d4095e31bdb4d0ba65
adapters/sinatra_adapter.rb
adapters/sinatra_adapter.rb
require "forwardable" class SinatraAdapter extend Forwardable def initialize(sinatra_app) @sinatra_app = sinatra_app end def success(content) status(200) json_body(content) return_nil_so_sinatra_does_not_double_render end def created(content = "") status(201) json_body(content) return_nil_so_sinatra_does_not_double_render end private attr_reader :sinatra_app def_delegators :sinatra_app, :status, :params def json_body(content) sinatra_app.content_type :json sinatra_app.body(MultiJson.dump(content)) end def return_nil_so_sinatra_does_not_double_render return nil # so sinatra does not double render end end
require "forwardable" class SinatraAdapter extend Forwardable def initialize(sinatra_app) @sinatra_app = sinatra_app end def params sinatra_app.request.params end def success(content) status(200) json_body(content) return_nil_so_sinatra_does_not_double_render end def created(content = "") status(201) json_body(content) return_nil_so_sinatra_does_not_double_render end private attr_reader :sinatra_app def_delegators :sinatra_app, :status def json_body(content) sinatra_app.content_type :json sinatra_app.body(MultiJson.dump(content)) end def return_nil_so_sinatra_does_not_double_render return nil # so sinatra does not double render end end
Remove junk params added by Sinatra
Remove junk params added by Sinatra
Ruby
mit
gds-attic/finder-api,gds-attic/finder-api
ruby
## Code Before: require "forwardable" class SinatraAdapter extend Forwardable def initialize(sinatra_app) @sinatra_app = sinatra_app end def success(content) status(200) json_body(content) return_nil_so_sinatra_does_not_double_render end def created(content = "") status(201) json_body(content) return_nil_so_sinatra_does_not_double_render end private attr_reader :sinatra_app def_delegators :sinatra_app, :status, :params def json_body(content) sinatra_app.content_type :json sinatra_app.body(MultiJson.dump(content)) end def return_nil_so_sinatra_does_not_double_render return nil # so sinatra does not double render end end ## Instruction: Remove junk params added by Sinatra ## Code After: require "forwardable" class SinatraAdapter extend Forwardable def initialize(sinatra_app) @sinatra_app = sinatra_app end def params sinatra_app.request.params end def success(content) status(200) json_body(content) return_nil_so_sinatra_does_not_double_render end def created(content = "") status(201) json_body(content) return_nil_so_sinatra_does_not_double_render end private attr_reader :sinatra_app def_delegators :sinatra_app, :status def json_body(content) sinatra_app.content_type :json sinatra_app.body(MultiJson.dump(content)) end def return_nil_so_sinatra_does_not_double_render return nil # so sinatra does not double render end end
require "forwardable" class SinatraAdapter extend Forwardable def initialize(sinatra_app) @sinatra_app = sinatra_app + end + + def params + sinatra_app.request.params end def success(content) status(200) json_body(content) return_nil_so_sinatra_does_not_double_render end def created(content = "") status(201) json_body(content) return_nil_so_sinatra_does_not_double_render end private attr_reader :sinatra_app - def_delegators :sinatra_app, :status, :params ? --------- + def_delegators :sinatra_app, :status def json_body(content) sinatra_app.content_type :json sinatra_app.body(MultiJson.dump(content)) end def return_nil_so_sinatra_does_not_double_render return nil # so sinatra does not double render end end
6
0.157895
5
1
5d2098b0f087b2225a412812e9ce3f8e9b0822b9
src/third-party/bootstrap/plugins/echo-button.css
src/third-party/bootstrap/plugins/echo-button.css
.echo-sdk-ui .btn .echo-label { float: left; } .echo-sdk-ui .btn .echo-icon { height: 16px; width: 16px; float: left; margin-right: 2px; margin-top: 2px; }
.echo-sdk-ui .btn .echo-label { float: left; width: auto; height: auto; } .echo-sdk-ui .btn .echo-icon { height: 16px; width: 16px; float: left; margin-right: 2px; margin-top: 2px; }
Define default dimensions for button
Define default dimensions for button
CSS
apache-2.0
EchoAppsTeam/js-sdk,EchoAppsTeam/js-sdk
css
## Code Before: .echo-sdk-ui .btn .echo-label { float: left; } .echo-sdk-ui .btn .echo-icon { height: 16px; width: 16px; float: left; margin-right: 2px; margin-top: 2px; } ## Instruction: Define default dimensions for button ## Code After: .echo-sdk-ui .btn .echo-label { float: left; width: auto; height: auto; } .echo-sdk-ui .btn .echo-icon { height: 16px; width: 16px; float: left; margin-right: 2px; margin-top: 2px; }
.echo-sdk-ui .btn .echo-label { float: left; + width: auto; + height: auto; } .echo-sdk-ui .btn .echo-icon { height: 16px; width: 16px; float: left; margin-right: 2px; margin-top: 2px; }
2
0.2
2
0
691daf6865fd73d3ed52f94181b0c93e5b19aa50
lib/puppet-parse/puppet-parse.rb
lib/puppet-parse/puppet-parse.rb
require 'puppet-parse' require 'rake' require 'rake/tasklib' desc 'Run puppet-parse' task :parse do matched_files = FileList['**/*.pp'] run = PuppetParse::Runner.new puts run.run(matched_files.to_a).to_yaml end
require 'puppet-parse' require 'rake' require 'rake/tasklib' desc 'Run puppet-parse' task :parse do matched_files = FileList['**/*.pp'] if ignore_paths = PuppetParse.configuration.ignore_paths matched_files = matched_files.exclude(*ignore_paths) end run = PuppetParse::Runner.new puts run.run(matched_files.to_a).to_yaml end
Add support for excluding paths from rake task
Add support for excluding paths from rake task
Ruby
mit
johanek/puppet-parse
ruby
## Code Before: require 'puppet-parse' require 'rake' require 'rake/tasklib' desc 'Run puppet-parse' task :parse do matched_files = FileList['**/*.pp'] run = PuppetParse::Runner.new puts run.run(matched_files.to_a).to_yaml end ## Instruction: Add support for excluding paths from rake task ## Code After: require 'puppet-parse' require 'rake' require 'rake/tasklib' desc 'Run puppet-parse' task :parse do matched_files = FileList['**/*.pp'] if ignore_paths = PuppetParse.configuration.ignore_paths matched_files = matched_files.exclude(*ignore_paths) end run = PuppetParse::Runner.new puts run.run(matched_files.to_a).to_yaml end
require 'puppet-parse' require 'rake' require 'rake/tasklib' desc 'Run puppet-parse' task :parse do matched_files = FileList['**/*.pp'] + + if ignore_paths = PuppetParse.configuration.ignore_paths + matched_files = matched_files.exclude(*ignore_paths) + end + run = PuppetParse::Runner.new puts run.run(matched_files.to_a).to_yaml end
5
0.454545
5
0
7e88739d91cd7db35ffb36804ae59d1878eb2da3
setup.py
setup.py
import os from distutils.core import setup requirements = map(str.strip, open('requirements.txt').readlines()) setup( name='py_eventsocket', version='0.1.4', author="Aaron Westendorf", author_email="aaron@agoragames.com", packages = ['eventsocket'], url='https://github.com/agoragames/py-eventsocket', license='LICENSE.txt', description='Easy to use TCP socket based on libevent', install_requires = requirements, long_description=open('README.rst').read(), keywords=['socket', 'event'], classifiers=[ 'Development Status :: 4 - Beta', 'License :: OSI Approved :: BSD License', "Intended Audience :: Developers", "Operating System :: POSIX", "Topic :: Communications", "Topic :: Software Development :: Libraries :: Python Modules", 'Programming Language :: Python', 'Topic :: Software Development :: Libraries' ] )
import os from distutils.core import setup requirements = map(str.strip, open('requirements.txt').readlines()) setup( name='py_eventsocket', version='0.1.4', author="Aaron Westendorf", author_email="aaron@agoragames.com", url='https://github.com/agoragames/py-eventsocket', license='LICENSE.txt', py_modules = ['eventsocket'], description='Easy to use TCP socket based on libevent', install_requires = requirements, long_description=open('README.rst').read(), keywords=['socket', 'event'], classifiers=[ 'Development Status :: 4 - Beta', 'License :: OSI Approved :: BSD License', "Intended Audience :: Developers", "Operating System :: POSIX", "Topic :: Communications", "Topic :: Software Development :: Libraries :: Python Modules", 'Programming Language :: Python', 'Topic :: Software Development :: Libraries' ] )
Use py_modules and not packages
Use py_modules and not packages
Python
bsd-3-clause
agoragames/py-eventsocket
python
## Code Before: import os from distutils.core import setup requirements = map(str.strip, open('requirements.txt').readlines()) setup( name='py_eventsocket', version='0.1.4', author="Aaron Westendorf", author_email="aaron@agoragames.com", packages = ['eventsocket'], url='https://github.com/agoragames/py-eventsocket', license='LICENSE.txt', description='Easy to use TCP socket based on libevent', install_requires = requirements, long_description=open('README.rst').read(), keywords=['socket', 'event'], classifiers=[ 'Development Status :: 4 - Beta', 'License :: OSI Approved :: BSD License', "Intended Audience :: Developers", "Operating System :: POSIX", "Topic :: Communications", "Topic :: Software Development :: Libraries :: Python Modules", 'Programming Language :: Python', 'Topic :: Software Development :: Libraries' ] ) ## Instruction: Use py_modules and not packages ## Code After: import os from distutils.core import setup requirements = map(str.strip, open('requirements.txt').readlines()) setup( name='py_eventsocket', version='0.1.4', author="Aaron Westendorf", author_email="aaron@agoragames.com", url='https://github.com/agoragames/py-eventsocket', license='LICENSE.txt', py_modules = ['eventsocket'], description='Easy to use TCP socket based on libevent', install_requires = requirements, long_description=open('README.rst').read(), keywords=['socket', 'event'], classifiers=[ 'Development Status :: 4 - Beta', 'License :: OSI Approved :: BSD License', "Intended Audience :: Developers", "Operating System :: POSIX", "Topic :: Communications", "Topic :: Software Development :: Libraries :: Python Modules", 'Programming Language :: Python', 'Topic :: Software Development :: Libraries' ] )
import os from distutils.core import setup requirements = map(str.strip, open('requirements.txt').readlines()) setup( name='py_eventsocket', version='0.1.4', author="Aaron Westendorf", author_email="aaron@agoragames.com", - packages = ['eventsocket'], url='https://github.com/agoragames/py-eventsocket', license='LICENSE.txt', + py_modules = ['eventsocket'], description='Easy to use TCP socket based on libevent', install_requires = requirements, long_description=open('README.rst').read(), keywords=['socket', 'event'], classifiers=[ 'Development Status :: 4 - Beta', 'License :: OSI Approved :: BSD License', "Intended Audience :: Developers", "Operating System :: POSIX", "Topic :: Communications", "Topic :: Software Development :: Libraries :: Python Modules", 'Programming Language :: Python', 'Topic :: Software Development :: Libraries' ] )
2
0.071429
1
1
cf554b46362b3290256323cbb86473909b90ccdd
run.sh
run.sh
if [ -z "$LOGGLY_AUTH_TOKEN" ]; then echo "Missing \$LOGGLY_AUTH_TOKEN" exit 1 fi # Fail if LOGGLY_TAG is not set if [ -z "$LOGGLY_TAG" ]; then echo "Missing \$LOGGLY_TAG" exit 1 fi # Create spool directory mkdir -p /var/spool/rsyslog # Replace variables sed -i "s/LOGGLY_AUTH_TOKEN/$LOGGLY_AUTH_TOKEN/" /etc/rsyslog.conf sed -i "s/LOGGLY_TAG/$LOGGLY_TAG/" /etc/rsyslog.conf # Run RSyslog daemon exec /usr/sbin/rsyslogd -n
if [ -z "$LOGGLY_AUTH_TOKEN" ]; then echo "Missing \$LOGGLY_AUTH_TOKEN" exit 1 fi # Fail if LOGGLY_TAG is not set if [ -z "$LOGGLY_TAG" ]; then echo "Missing \$LOGGLY_TAG" exit 1 fi # Create spool directory mkdir -p /var/spool/rsyslog # Expand multiple tags, in the format of tag1:tag2:tag3, into several tag arguments LOGGLY_TAG=$(echo $LOGGLY_TAG | sed 's/:/\\\\" tag=\\\\"/g') # Replace variables sed -i "s/LOGGLY_AUTH_TOKEN/$LOGGLY_AUTH_TOKEN/" /etc/rsyslog.conf sed -i "s/LOGGLY_TAG/$LOGGLY_TAG/" /etc/rsyslog.conf # Run RSyslog daemon exec /usr/sbin/rsyslogd -n
Add support for multiple tags.
Add support for multiple tags.
Shell
mit
vladgh/loggly-docker,aalness/loggly-docker,sendgridlabs/loggly-docker
shell
## Code Before: if [ -z "$LOGGLY_AUTH_TOKEN" ]; then echo "Missing \$LOGGLY_AUTH_TOKEN" exit 1 fi # Fail if LOGGLY_TAG is not set if [ -z "$LOGGLY_TAG" ]; then echo "Missing \$LOGGLY_TAG" exit 1 fi # Create spool directory mkdir -p /var/spool/rsyslog # Replace variables sed -i "s/LOGGLY_AUTH_TOKEN/$LOGGLY_AUTH_TOKEN/" /etc/rsyslog.conf sed -i "s/LOGGLY_TAG/$LOGGLY_TAG/" /etc/rsyslog.conf # Run RSyslog daemon exec /usr/sbin/rsyslogd -n ## Instruction: Add support for multiple tags. ## Code After: if [ -z "$LOGGLY_AUTH_TOKEN" ]; then echo "Missing \$LOGGLY_AUTH_TOKEN" exit 1 fi # Fail if LOGGLY_TAG is not set if [ -z "$LOGGLY_TAG" ]; then echo "Missing \$LOGGLY_TAG" exit 1 fi # Create spool directory mkdir -p /var/spool/rsyslog # Expand multiple tags, in the format of tag1:tag2:tag3, into several tag arguments LOGGLY_TAG=$(echo $LOGGLY_TAG | sed 's/:/\\\\" tag=\\\\"/g') # Replace variables sed -i "s/LOGGLY_AUTH_TOKEN/$LOGGLY_AUTH_TOKEN/" /etc/rsyslog.conf sed -i "s/LOGGLY_TAG/$LOGGLY_TAG/" /etc/rsyslog.conf # Run RSyslog daemon exec /usr/sbin/rsyslogd -n
if [ -z "$LOGGLY_AUTH_TOKEN" ]; then echo "Missing \$LOGGLY_AUTH_TOKEN" exit 1 fi # Fail if LOGGLY_TAG is not set if [ -z "$LOGGLY_TAG" ]; then echo "Missing \$LOGGLY_TAG" exit 1 fi # Create spool directory mkdir -p /var/spool/rsyslog + # Expand multiple tags, in the format of tag1:tag2:tag3, into several tag arguments + LOGGLY_TAG=$(echo $LOGGLY_TAG | sed 's/:/\\\\" tag=\\\\"/g') + # Replace variables sed -i "s/LOGGLY_AUTH_TOKEN/$LOGGLY_AUTH_TOKEN/" /etc/rsyslog.conf sed -i "s/LOGGLY_TAG/$LOGGLY_TAG/" /etc/rsyslog.conf # Run RSyslog daemon exec /usr/sbin/rsyslogd -n
3
0.142857
3
0
f5640dc7378e72a226e393c5bde7f553d1cd4fe3
test/testzillians-compiler/CMakeLists.txt
test/testzillians-compiler/CMakeLists.txt
ADD_SUBDIRECTORY(SimpleGrammarTest) ADD_SUBDIRECTORY(TreeWalkerTest) ADD_SUBDIRECTORY(PTXCodeGenTest) ADD_SUBDIRECTORY(PTXParserTest) ADD_SUBDIRECTORY(LLVM_IR_Test) ADD_SUBDIRECTORY(PTXParserTest-RealExecute) ADD_SUBDIRECTORY(CodeGenCommonTest) ADD_SUBDIRECTORY(PTXFunctionMapperBasicTest) ADD_SUBDIRECTORY(PTXFunctionMapperAdvanceTest)
ADD_SUBDIRECTORY(SimpleGrammarTest) ADD_SUBDIRECTORY(TreeWalkerTest) ADD_SUBDIRECTORY(PTXCodeGenTest) ADD_SUBDIRECTORY(PTXParserTest) ADD_SUBDIRECTORY(LLVM_IR_Test) ADD_SUBDIRECTORY(PTXParserTest-RealExecute) ADD_SUBDIRECTORY(CodeGenCommonTest) ADD_SUBDIRECTORY(LLVMFunctionMapperBasicTest) ADD_SUBDIRECTORY(PTXFunctionMapperBasicTest) ADD_SUBDIRECTORY(PTXFunctionMapperAdvanceTest)
Fix compilation error for TypeHelper.h
Fix compilation error for TypeHelper.h
Text
agpl-3.0
zillians/supercell_language,zillians/supercell_language,zillians/supercell_language,zillians/supercell_language,zillians/supercell_language
text
## Code Before: ADD_SUBDIRECTORY(SimpleGrammarTest) ADD_SUBDIRECTORY(TreeWalkerTest) ADD_SUBDIRECTORY(PTXCodeGenTest) ADD_SUBDIRECTORY(PTXParserTest) ADD_SUBDIRECTORY(LLVM_IR_Test) ADD_SUBDIRECTORY(PTXParserTest-RealExecute) ADD_SUBDIRECTORY(CodeGenCommonTest) ADD_SUBDIRECTORY(PTXFunctionMapperBasicTest) ADD_SUBDIRECTORY(PTXFunctionMapperAdvanceTest) ## Instruction: Fix compilation error for TypeHelper.h ## Code After: ADD_SUBDIRECTORY(SimpleGrammarTest) ADD_SUBDIRECTORY(TreeWalkerTest) ADD_SUBDIRECTORY(PTXCodeGenTest) ADD_SUBDIRECTORY(PTXParserTest) ADD_SUBDIRECTORY(LLVM_IR_Test) ADD_SUBDIRECTORY(PTXParserTest-RealExecute) ADD_SUBDIRECTORY(CodeGenCommonTest) ADD_SUBDIRECTORY(LLVMFunctionMapperBasicTest) ADD_SUBDIRECTORY(PTXFunctionMapperBasicTest) ADD_SUBDIRECTORY(PTXFunctionMapperAdvanceTest)
ADD_SUBDIRECTORY(SimpleGrammarTest) ADD_SUBDIRECTORY(TreeWalkerTest) ADD_SUBDIRECTORY(PTXCodeGenTest) ADD_SUBDIRECTORY(PTXParserTest) ADD_SUBDIRECTORY(LLVM_IR_Test) ADD_SUBDIRECTORY(PTXParserTest-RealExecute) ADD_SUBDIRECTORY(CodeGenCommonTest) + ADD_SUBDIRECTORY(LLVMFunctionMapperBasicTest) ADD_SUBDIRECTORY(PTXFunctionMapperBasicTest) ADD_SUBDIRECTORY(PTXFunctionMapperAdvanceTest)
1
0.090909
1
0
18809ce25afa59e318ecf5ccab7e0d102fa982c9
chrome_extension/client.js
chrome_extension/client.js
(function($){ $.appendSolveButton = function () { var $solve = $(document.createElement('div')).text('solve').css({ cursor: 'pointer', position: 'fixed', left: 0, bottom: 0, padding: '1em 2em', color: 'white', backgroundColor: 'rgba(0, 0, 255, .4)', zIndex: 2147483647 }); $('body').append($solve); return $solve; }; $.solve = function(params) { $.post('http://localhost:4567/problem', params); }; })(jQuery);
(function($){ $.appendSolveButton = function () { var $solve = $(document.createElement('div')).text('solve').css({ cursor: 'pointer', position: 'fixed', left: 0, bottom: 0, padding: '1em 2em', color: 'white', backgroundColor: 'rgba(0, 0, 255, .4)', zIndex: 2147483647 }); $('body').append($solve); return $solve; }; $.solve = function(params) { $.post('http://localhost:4567/problem', params).fail(function(res){ if(res.status == 0) { alert('It seems that background server is not working'); } }); }; })(jQuery);
Add handler for extension's request error
Add handler for extension's request error
JavaScript
mit
en30/online-judge-helper,en30/online-judge-helper,en30/online-judge-helper
javascript
## Code Before: (function($){ $.appendSolveButton = function () { var $solve = $(document.createElement('div')).text('solve').css({ cursor: 'pointer', position: 'fixed', left: 0, bottom: 0, padding: '1em 2em', color: 'white', backgroundColor: 'rgba(0, 0, 255, .4)', zIndex: 2147483647 }); $('body').append($solve); return $solve; }; $.solve = function(params) { $.post('http://localhost:4567/problem', params); }; })(jQuery); ## Instruction: Add handler for extension's request error ## Code After: (function($){ $.appendSolveButton = function () { var $solve = $(document.createElement('div')).text('solve').css({ cursor: 'pointer', position: 'fixed', left: 0, bottom: 0, padding: '1em 2em', color: 'white', backgroundColor: 'rgba(0, 0, 255, .4)', zIndex: 2147483647 }); $('body').append($solve); return $solve; }; $.solve = function(params) { $.post('http://localhost:4567/problem', params).fail(function(res){ if(res.status == 0) { alert('It seems that background server is not working'); } }); }; })(jQuery);
(function($){ $.appendSolveButton = function () { var $solve = $(document.createElement('div')).text('solve').css({ cursor: 'pointer', position: 'fixed', left: 0, bottom: 0, padding: '1em 2em', color: 'white', backgroundColor: 'rgba(0, 0, 255, .4)', zIndex: 2147483647 }); $('body').append($solve); return $solve; }; $.solve = function(params) { - $.post('http://localhost:4567/problem', params); ? ^ + $.post('http://localhost:4567/problem', params).fail(function(res){ ? ^^^^^^^^^^^^^^^^^^^^ + if(res.status == 0) { + alert('It seems that background server is not working'); + } + }); }; })(jQuery);
6
0.3
5
1
f999d6c573136ded1ddc45854c3dfa430b0d22bd
test/koans/comprehensions_koans_test.exs
test/koans/comprehensions_koans_test.exs
defmodule ComprehensionsTests do use ExUnit.Case import TestHarness test "Comprehensions" do answers = [ [1, 4, 9, 16], [1, 4, 9, 16], ["Hello World", "Apple Pie"], ["little dogs", "little cats", "big dogs", "big cats"], [4, 5, 6], ["Apple Pie", "Pecan Pie", "Pumpkin Pie"], ] test_all(Comprehensions, answers) end end
defmodule ComprehensionsTests do use ExUnit.Case import TestHarness test "Comprehensions" do answers = [ [1, 4, 9, 16], [1, 4, 9, 16], ["Hello World", "Apple Pie"], ["little dogs", "little cats", "big dogs", "big cats"], [4, 5, 6], %{"Pecan" => "Pecan Pie", "Pumpkin" => "Pumpkin Pie"} ] test_all(Comprehensions, answers) end end
Update the comprehensions test to match the actual koan
Update the comprehensions test to match the actual koan
Elixir
mit
elixirkoans/elixir-koans
elixir
## Code Before: defmodule ComprehensionsTests do use ExUnit.Case import TestHarness test "Comprehensions" do answers = [ [1, 4, 9, 16], [1, 4, 9, 16], ["Hello World", "Apple Pie"], ["little dogs", "little cats", "big dogs", "big cats"], [4, 5, 6], ["Apple Pie", "Pecan Pie", "Pumpkin Pie"], ] test_all(Comprehensions, answers) end end ## Instruction: Update the comprehensions test to match the actual koan ## Code After: defmodule ComprehensionsTests do use ExUnit.Case import TestHarness test "Comprehensions" do answers = [ [1, 4, 9, 16], [1, 4, 9, 16], ["Hello World", "Apple Pie"], ["little dogs", "little cats", "big dogs", "big cats"], [4, 5, 6], %{"Pecan" => "Pecan Pie", "Pumpkin" => "Pumpkin Pie"} ] test_all(Comprehensions, answers) end end
defmodule ComprehensionsTests do use ExUnit.Case import TestHarness test "Comprehensions" do answers = [ [1, 4, 9, 16], [1, 4, 9, 16], ["Hello World", "Apple Pie"], ["little dogs", "little cats", "big dogs", "big cats"], [4, 5, 6], - ["Apple Pie", "Pecan Pie", "Pumpkin Pie"], + %{"Pecan" => "Pecan Pie", "Pumpkin" => "Pumpkin Pie"} ] test_all(Comprehensions, answers) end end
2
0.111111
1
1
409cce30a09d2554d1058a44c2b6e576417535da
README.md
README.md
TYPO3 Neos Blog Plugin ====================== This plugin provides a node-based plugin for TYPO3 Neos websites. Note: this package is still experimental and may change heavily in the near future.
TYPO3 Neos Blog Plugin ====================== This plugin provides a node-based plugin for TYPO3 Neos websites. Note: this package is still experimental and may change heavily in the near future. Quick start ----------- * include the Plugin's route definitions to your `Routes.yaml` file, just like ```yaml - name: 'RobertLemkeBlogPlugin' uriPattern: '<RobertLemkeBlogPluginSubroutes>' subRoutes: RobertLemkeBlogPlugin: package: RobertLemke.Plugin.Blog ``` * include the plugin's TypoScript definitions to your own one's (located in, for example, `Packages/Sites/Your.Site/Resources/Private/TypoScripts/Library/ContentElements.ts2`, with: ``` include: resource://RobertLemke.Plugin.Blog/Private/TypoScripts/Library/NodeTypes.ts2 ``` * add the plugin content element "Blog Post Overview" to the position of your choice.
Expand readme with a quick start
[FEATURE] Expand readme with a quick start This adds some lines how to get really started with the blog plugin. Closes #1
Markdown
mit
robertlemke/RobertLemke.Plugin.Blog,robertlemke/RobertLemke.Plugin.Blog,million12/Neos.Plugin.Blog,million12/Neos.Plugin.Blog,robertlemke/RobertLemke.Plugin.Blog
markdown
## Code Before: TYPO3 Neos Blog Plugin ====================== This plugin provides a node-based plugin for TYPO3 Neos websites. Note: this package is still experimental and may change heavily in the near future. ## Instruction: [FEATURE] Expand readme with a quick start This adds some lines how to get really started with the blog plugin. Closes #1 ## Code After: TYPO3 Neos Blog Plugin ====================== This plugin provides a node-based plugin for TYPO3 Neos websites. Note: this package is still experimental and may change heavily in the near future. Quick start ----------- * include the Plugin's route definitions to your `Routes.yaml` file, just like ```yaml - name: 'RobertLemkeBlogPlugin' uriPattern: '<RobertLemkeBlogPluginSubroutes>' subRoutes: RobertLemkeBlogPlugin: package: RobertLemke.Plugin.Blog ``` * include the plugin's TypoScript definitions to your own one's (located in, for example, `Packages/Sites/Your.Site/Resources/Private/TypoScripts/Library/ContentElements.ts2`, with: ``` include: resource://RobertLemke.Plugin.Blog/Private/TypoScripts/Library/NodeTypes.ts2 ``` * add the plugin content element "Blog Post Overview" to the position of your choice.
TYPO3 Neos Blog Plugin ====================== This plugin provides a node-based plugin for TYPO3 Neos websites. Note: this package is still experimental and may change heavily in the near future. + + Quick start + ----------- + * include the Plugin's route definitions to your `Routes.yaml` file, just like + + ```yaml + - + name: 'RobertLemkeBlogPlugin' + uriPattern: '<RobertLemkeBlogPluginSubroutes>' + subRoutes: + RobertLemkeBlogPlugin: + package: RobertLemke.Plugin.Blog + ``` + + * include the plugin's TypoScript definitions to your own one's (located in, for example, `Packages/Sites/Your.Site/Resources/Private/TypoScripts/Library/ContentElements.ts2`, with: + + ``` + include: resource://RobertLemke.Plugin.Blog/Private/TypoScripts/Library/NodeTypes.ts2 + ``` + + * add the plugin content element "Blog Post Overview" to the position of your choice.
21
3.5
21
0
5127fe15793fd2a35af77f7f57a71f905ddaf2a3
test/croonga.test.js
test/croonga.test.js
var http = require('http'); var should = require('should'); var spawn = require('child_process').spawn; function run(options, callback) { var command, commandPath, output; commandPath = __dirname + '/../bin/croonga'; command = spawn(commandPath, options); output = { stdout: '', stderr: '' }; command.stdout.on('data', function(data) { output.stdout += data; }); command.stderr.on('data', function(data) { output.stderr += data; }); callback(null, command, output); } describe('croonga command', function() { it('should output help for --help', function(done) { run(['--help'], function(error, command, output) { command.on('exit', function() { output.stdout.should.include("Usage:"); done(); }); }); }); });
var http = require('http'); var should = require('should'); var spawn = require('child_process').spawn; function run(options, callback) { var command, commandPath, output; commandPath = __dirname + '/../bin/croonga'; command = spawn(commandPath, options); output = { stdout: '', stderr: '' }; command.stdout.on('data', function(data) { output.stdout += data; }); command.stderr.on('data', function(data) { output.stderr += data; }); callback(null, command, output); } describe('croonga command', function() { it('should output help for --help', function(done) { run(['--help'], function(error, command, output) { command.on('exit', function(code) { code.should.equal(0); output.stdout.should.include("Usage:"); done(); }); }); }); });
Check status code returned from croonga command
Check status code returned from croonga command
JavaScript
mit
groonga/gcs,groonga/gcs
javascript
## Code Before: var http = require('http'); var should = require('should'); var spawn = require('child_process').spawn; function run(options, callback) { var command, commandPath, output; commandPath = __dirname + '/../bin/croonga'; command = spawn(commandPath, options); output = { stdout: '', stderr: '' }; command.stdout.on('data', function(data) { output.stdout += data; }); command.stderr.on('data', function(data) { output.stderr += data; }); callback(null, command, output); } describe('croonga command', function() { it('should output help for --help', function(done) { run(['--help'], function(error, command, output) { command.on('exit', function() { output.stdout.should.include("Usage:"); done(); }); }); }); }); ## Instruction: Check status code returned from croonga command ## Code After: var http = require('http'); var should = require('should'); var spawn = require('child_process').spawn; function run(options, callback) { var command, commandPath, output; commandPath = __dirname + '/../bin/croonga'; command = spawn(commandPath, options); output = { stdout: '', stderr: '' }; command.stdout.on('data', function(data) { output.stdout += data; }); command.stderr.on('data', function(data) { output.stderr += data; }); callback(null, command, output); } describe('croonga command', function() { it('should output help for --help', function(done) { run(['--help'], function(error, command, output) { command.on('exit', function(code) { code.should.equal(0); output.stdout.should.include("Usage:"); done(); }); }); }); });
var http = require('http'); var should = require('should'); var spawn = require('child_process').spawn; function run(options, callback) { var command, commandPath, output; commandPath = __dirname + '/../bin/croonga'; command = spawn(commandPath, options); output = { stdout: '', stderr: '' }; command.stdout.on('data', function(data) { output.stdout += data; }); command.stderr.on('data', function(data) { output.stderr += data; }); callback(null, command, output); } describe('croonga command', function() { it('should output help for --help', function(done) { run(['--help'], function(error, command, output) { - command.on('exit', function() { + command.on('exit', function(code) { ? ++++ + code.should.equal(0); output.stdout.should.include("Usage:"); done(); }); }); }); });
3
0.096774
2
1
b03d985cd1a43760c4acfc038e2b53502f43aa42
simul/app/components/story.js
simul/app/components/story.js
import React, { Component } from 'react'; import { StyleSheet, Text, View, TouchableHighlight, } from 'react-native'; class Story extends Component{ onProfilePressed() { this.props.navigator.push({ title: 'Story', component: Profile }) } render() { return ( <View style={styles.container}> <Text>Day 7</Text> <Text style={styles.title}> My neighbor Amira </Text> <Text style={styles.content}> Today I met another girl my age named Amira, her family is like mine...</Text> <TouchableHighlight onPress={this.onProfilePressed.bind(this)} style={styles.button}> <Text style={styles.buttonText}> Ahmeds Profile </Text> </TouchableHighlight> </View> ) } }; var styles = StyleSheet.create({ button: { height: 50, backgroundColor: '#48BBEC', alignSelf: 'stretch', marginTop: 10, justifyContent: 'center' }, buttonText: { textAlign: 'center', }, container: { flex: 1, justifyContent: 'center', alignItems: 'center', }, title: { fontSize: 20, alignSelf: 'center', margin: 40 }, content: { alignSelf: 'center', fontSize: 21, marginTop: 10, marginBottom: 5, }, }); module.exports = Story;
import React, { Component } from 'react'; import { StyleSheet, Text, View, TouchableHighlight, } from 'react-native'; class Story extends Component{ onProfilePressed() { this.props.navigator.push({ title: 'Story', component: Profile }) } render() { return ( <View style={styles.container}> <TouchableHighlight onPress={this.onProfilePressed.bind(this)} style={styles.button}> <Text style={styles.buttonText}> Ahmeds Profile </Text> </TouchableHighlight> <Text>Day 7</Text> <Text style={styles.title}> My neighbor Amira </Text> <Text style={styles.content}> Today I met another girl my age named Amira, her family is like mine...</Text> </View> ) } }; var styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', }, button: { height: 50, backgroundColor: '#48BBEC', alignSelf: 'flex-start', marginTop: 10, justifyContent: 'center' }, buttonText: { textAlign: 'center', }, title: { fontSize: 20, alignSelf: 'center', margin: 40 }, content: { alignSelf: 'center', fontSize: 21, marginTop: 10, marginBottom: 5, }, }); module.exports = Story;
Move button to top-left, need to adjust margins and padding
Move button to top-left, need to adjust margins and padding
JavaScript
mit
sf-red-pandas-2016/simul-react-native,sf-red-pandas-2016/simul-react-native,sf-red-pandas-2016/simul-react-native
javascript
## Code Before: import React, { Component } from 'react'; import { StyleSheet, Text, View, TouchableHighlight, } from 'react-native'; class Story extends Component{ onProfilePressed() { this.props.navigator.push({ title: 'Story', component: Profile }) } render() { return ( <View style={styles.container}> <Text>Day 7</Text> <Text style={styles.title}> My neighbor Amira </Text> <Text style={styles.content}> Today I met another girl my age named Amira, her family is like mine...</Text> <TouchableHighlight onPress={this.onProfilePressed.bind(this)} style={styles.button}> <Text style={styles.buttonText}> Ahmeds Profile </Text> </TouchableHighlight> </View> ) } }; var styles = StyleSheet.create({ button: { height: 50, backgroundColor: '#48BBEC', alignSelf: 'stretch', marginTop: 10, justifyContent: 'center' }, buttonText: { textAlign: 'center', }, container: { flex: 1, justifyContent: 'center', alignItems: 'center', }, title: { fontSize: 20, alignSelf: 'center', margin: 40 }, content: { alignSelf: 'center', fontSize: 21, marginTop: 10, marginBottom: 5, }, }); module.exports = Story; ## Instruction: Move button to top-left, need to adjust margins and padding ## Code After: import React, { Component } from 'react'; import { StyleSheet, Text, View, TouchableHighlight, } from 'react-native'; class Story extends Component{ onProfilePressed() { this.props.navigator.push({ title: 'Story', component: Profile }) } render() { return ( <View style={styles.container}> <TouchableHighlight onPress={this.onProfilePressed.bind(this)} style={styles.button}> <Text style={styles.buttonText}> Ahmeds Profile </Text> </TouchableHighlight> <Text>Day 7</Text> <Text style={styles.title}> My neighbor Amira </Text> <Text style={styles.content}> Today I met another girl my age named Amira, her family is like mine...</Text> </View> ) } }; var styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', }, button: { height: 50, backgroundColor: '#48BBEC', alignSelf: 'flex-start', marginTop: 10, justifyContent: 'center' }, buttonText: { textAlign: 'center', }, title: { fontSize: 20, alignSelf: 'center', margin: 40 }, content: { alignSelf: 'center', fontSize: 21, marginTop: 10, marginBottom: 5, }, }); module.exports = Story;
import React, { Component } from 'react'; import { StyleSheet, Text, View, TouchableHighlight, } from 'react-native'; class Story extends Component{ onProfilePressed() { this.props.navigator.push({ title: 'Story', component: Profile }) } render() { return ( <View style={styles.container}> - <Text>Day 7</Text> - <Text style={styles.title}> My neighbor Amira </Text> - <Text style={styles.content}> Today I met another girl my age named Amira, her family is like mine...</Text> - <TouchableHighlight onPress={this.onProfilePressed.bind(this)} style={styles.button}> <Text style={styles.buttonText}> Ahmeds Profile </Text> </TouchableHighlight> + + <Text>Day 7</Text> + <Text style={styles.title}> My neighbor Amira </Text> + <Text style={styles.content}> Today I met another girl my age named Amira, her family is like mine...</Text> + </View> ) } }; var styles = StyleSheet.create({ + + container: { + flex: 1, + justifyContent: 'center', + alignItems: 'center', + }, button: { height: 50, backgroundColor: '#48BBEC', - alignSelf: 'stretch', ? - -- + alignSelf: 'flex-start', ? +++++ + marginTop: 10, justifyContent: 'center' }, buttonText: { textAlign: 'center', - }, - container: { - flex: 1, - justifyContent: 'center', - alignItems: 'center', }, title: { fontSize: 20, alignSelf: 'center', margin: 40 }, content: { alignSelf: 'center', fontSize: 21, marginTop: 10, marginBottom: 5, }, }); module.exports = Story;
22
0.314286
12
10
5bcc4ae60f89fbcadad234e0d6b9a755d28aab5d
pavement.py
pavement.py
import subprocess from paver.easy import * def call(*args, **kwargs): return subprocess.call(args, **kwargs) @task def build(): """Package up the app.""" call('palm-package', '.') @task def halt(): call('palm-launch', '--device=emulator', '-c', 'org.markpasc.paperplain') @task @needs('halt') def uninstall(): call('palm-install', '--device=emulator', '-r', 'org.markpasc.paperplain') @task @needs('build', 'uninstall') def push(): """Reinstall the app and start it.""" call('palm-install', '--device=emulator', 'org.markpasc.paperplain_1.0.0_all.ipk') call('palm-launch', '--device=emulator', 'org.markpasc.paperplain') @task def tail(): """Follow the device's log.""" call('palm-log', '--device=emulator', '--system-log-level', 'info') call('palm-log', '--device=emulator', '-f', 'org.markpasc.paperplain')
import subprocess from paver.easy import * def call(*args, **kwargs): return subprocess.call(args, **kwargs) @task def build(): """Package up the app.""" call('palm-package', '.') @task def halt(): call('palm-launch', '--device=emulator', '-c', 'org.markpasc.paperplain') @task @needs('halt') def uninstall(): call('palm-install', '--device=emulator', '-r', 'org.markpasc.paperplain') @task @needs('build', 'uninstall') def push(): """Reinstall the app and start it.""" call('palm-install', '--device=emulator', 'org.markpasc.paperplain_1.0.0_all.ipk') call('palm-launch', '--device=emulator', 'org.markpasc.paperplain') @task def tail(): """Follow the device's log.""" call('palm-log', '--device=emulator', '--system-log-level', 'info') try: call('palm-log', '--device=emulator', '-f', 'org.markpasc.paperplain') except KeyboardInterrupt: print
Handle ctrl-C-ing out of palm-log
Handle ctrl-C-ing out of palm-log
Python
mit
markpasc/paperplain,markpasc/paperplain
python
## Code Before: import subprocess from paver.easy import * def call(*args, **kwargs): return subprocess.call(args, **kwargs) @task def build(): """Package up the app.""" call('palm-package', '.') @task def halt(): call('palm-launch', '--device=emulator', '-c', 'org.markpasc.paperplain') @task @needs('halt') def uninstall(): call('palm-install', '--device=emulator', '-r', 'org.markpasc.paperplain') @task @needs('build', 'uninstall') def push(): """Reinstall the app and start it.""" call('palm-install', '--device=emulator', 'org.markpasc.paperplain_1.0.0_all.ipk') call('palm-launch', '--device=emulator', 'org.markpasc.paperplain') @task def tail(): """Follow the device's log.""" call('palm-log', '--device=emulator', '--system-log-level', 'info') call('palm-log', '--device=emulator', '-f', 'org.markpasc.paperplain') ## Instruction: Handle ctrl-C-ing out of palm-log ## Code After: import subprocess from paver.easy import * def call(*args, **kwargs): return subprocess.call(args, **kwargs) @task def build(): """Package up the app.""" call('palm-package', '.') @task def halt(): call('palm-launch', '--device=emulator', '-c', 'org.markpasc.paperplain') @task @needs('halt') def uninstall(): call('palm-install', '--device=emulator', '-r', 'org.markpasc.paperplain') @task @needs('build', 'uninstall') def push(): """Reinstall the app and start it.""" call('palm-install', '--device=emulator', 'org.markpasc.paperplain_1.0.0_all.ipk') call('palm-launch', '--device=emulator', 'org.markpasc.paperplain') @task def tail(): """Follow the device's log.""" call('palm-log', '--device=emulator', '--system-log-level', 'info') try: call('palm-log', '--device=emulator', '-f', 'org.markpasc.paperplain') except KeyboardInterrupt: print
import subprocess from paver.easy import * def call(*args, **kwargs): return subprocess.call(args, **kwargs) @task def build(): """Package up the app.""" call('palm-package', '.') @task def halt(): call('palm-launch', '--device=emulator', '-c', 'org.markpasc.paperplain') @task @needs('halt') def uninstall(): call('palm-install', '--device=emulator', '-r', 'org.markpasc.paperplain') @task @needs('build', 'uninstall') def push(): """Reinstall the app and start it.""" call('palm-install', '--device=emulator', 'org.markpasc.paperplain_1.0.0_all.ipk') call('palm-launch', '--device=emulator', 'org.markpasc.paperplain') @task def tail(): """Follow the device's log.""" call('palm-log', '--device=emulator', '--system-log-level', 'info') + try: - call('palm-log', '--device=emulator', '-f', 'org.markpasc.paperplain') + call('palm-log', '--device=emulator', '-f', 'org.markpasc.paperplain') ? ++++ + except KeyboardInterrupt: + print
5
0.142857
4
1
c6cf49bba44bbc707f633d1f8bf060d721660f8d
features/spotlight.feature
features/spotlight.feature
Feature: spotlight @normal Scenario: I can access the homepage When I GET https://spotlight.{PP_FULL_APP_DOMAIN}/performance Then I should receive an HTTP 200 And I should see a strong ETag
Feature: spotlight @normal Scenario: I can access the homepage Given I am benchmarking When I GET https://spotlight.{PP_FULL_APP_DOMAIN}/performance Then I should receive an HTTP 200 And I should see a strong ETag And the elapsed time should be less than 2 second
Check that response times are not horrendous
Check that response times are not horrendous Ideally it would be less than 1 second, but being lenient for now. Once we have a webpagetest instance polling this, we’ll have more confidence in bringing this down.
Cucumber
mit
alphagov/pp-smokey,alphagov/pp-smokey,alphagov/pp-smokey
cucumber
## Code Before: Feature: spotlight @normal Scenario: I can access the homepage When I GET https://spotlight.{PP_FULL_APP_DOMAIN}/performance Then I should receive an HTTP 200 And I should see a strong ETag ## Instruction: Check that response times are not horrendous Ideally it would be less than 1 second, but being lenient for now. Once we have a webpagetest instance polling this, we’ll have more confidence in bringing this down. ## Code After: Feature: spotlight @normal Scenario: I can access the homepage Given I am benchmarking When I GET https://spotlight.{PP_FULL_APP_DOMAIN}/performance Then I should receive an HTTP 200 And I should see a strong ETag And the elapsed time should be less than 2 second
Feature: spotlight @normal Scenario: I can access the homepage + Given I am benchmarking When I GET https://spotlight.{PP_FULL_APP_DOMAIN}/performance Then I should receive an HTTP 200 And I should see a strong ETag + And the elapsed time should be less than 2 second
2
0.285714
2
0
a59d64c52c05e3afe9da86fc523ac2597f040cf5
src/app/components/players/player/player.controller.js
src/app/components/players/player/player.controller.js
export default class PlayerController { constructor($rootScope, $scope, $localStorage, $log, _, gameModel, playersStore, playerModel, websocket) { 'ngInject'; this.$rootScope = $rootScope; this.$scope = $scope; this.$log = $log; this._ = _; this.gameModel = gameModel.model; this.playerModel = playerModel; this.playersStore = playersStore; this.ws = websocket; this.$log.info('constructor()', this); } $onInit() { this.$log.info('$onInit()', this); } $onDestroy() { return () => { this.$log.info('destroy', this); }; } showStorage() { this.$log.info('showStorage()', this); } };
export default class PlayerController { constructor($rootScope, $scope, $localStorage, $log, _, playersApi, playersStore, playerModel, websocket) { 'ngInject'; this.$rootScope = $rootScope; this.$scope = $scope; this.$log = $log; this._ = _; this.playerModel = playerModel; this.playersApi = playersApi; this.playersStore = playersStore; this.ws = websocket; this.$log.info('constructor()', this); } $onInit() { this.$log.info('$onInit()', this); } $onDestroy() { return () => { this.$log.info('destroy', this); }; } onStorageClick(evt) { this.$log.info('onStorageClick()', evt, this); let cardsSelected = this.player.cardsSelected, cardsInStorage = this.player.cardsInStorage, cardsInHand = this.player.cardsInHand, onSuccess = (res => { if (res.status == 200) { this.$log.info(res); } }), onError = (err => { this.$log.error(err); }); if (this.player.isActive && cardsSelected.length === 3) { this.$log.info('Storing your cards: ', cardsSelected); cardsInStorage.push(cardsSelected[0]); this._.pullAll(cardsInHand, cardsSelected); let plData = { cardsInHand: cardsInHand, cardsInStorage: cardsInStorage, totalCards: cardsInHand.length }; this.playersApi .update(this.player.id, plData) .then(onSuccess, onError); this.player.cardsSelected = []; } else { this.showStorage(this.player); } } showStorage(pl) { this.$log.info('showStorage()', pl, this); } }
Add logic for player to 'store' cards before they discard
Add logic for player to 'store' cards before they discard
JavaScript
unlicense
ejwaibel/squarrels,ejwaibel/squarrels
javascript
## Code Before: export default class PlayerController { constructor($rootScope, $scope, $localStorage, $log, _, gameModel, playersStore, playerModel, websocket) { 'ngInject'; this.$rootScope = $rootScope; this.$scope = $scope; this.$log = $log; this._ = _; this.gameModel = gameModel.model; this.playerModel = playerModel; this.playersStore = playersStore; this.ws = websocket; this.$log.info('constructor()', this); } $onInit() { this.$log.info('$onInit()', this); } $onDestroy() { return () => { this.$log.info('destroy', this); }; } showStorage() { this.$log.info('showStorage()', this); } }; ## Instruction: Add logic for player to 'store' cards before they discard ## Code After: export default class PlayerController { constructor($rootScope, $scope, $localStorage, $log, _, playersApi, playersStore, playerModel, websocket) { 'ngInject'; this.$rootScope = $rootScope; this.$scope = $scope; this.$log = $log; this._ = _; this.playerModel = playerModel; this.playersApi = playersApi; this.playersStore = playersStore; this.ws = websocket; this.$log.info('constructor()', this); } $onInit() { this.$log.info('$onInit()', this); } $onDestroy() { return () => { this.$log.info('destroy', this); }; } onStorageClick(evt) { this.$log.info('onStorageClick()', evt, this); let cardsSelected = this.player.cardsSelected, cardsInStorage = this.player.cardsInStorage, cardsInHand = this.player.cardsInHand, onSuccess = (res => { if (res.status == 200) { this.$log.info(res); } }), onError = (err => { this.$log.error(err); }); if (this.player.isActive && cardsSelected.length === 3) { this.$log.info('Storing your cards: ', cardsSelected); cardsInStorage.push(cardsSelected[0]); this._.pullAll(cardsInHand, cardsSelected); let plData = { cardsInHand: cardsInHand, cardsInStorage: cardsInStorage, totalCards: cardsInHand.length }; this.playersApi .update(this.player.id, plData) .then(onSuccess, onError); this.player.cardsSelected = []; } else { this.showStorage(this.player); } } showStorage(pl) { this.$log.info('showStorage()', pl, this); } }
export default class PlayerController { - constructor($rootScope, $scope, $localStorage, $log, _, gameModel, playersStore, playerModel, websocket) { ? ^ ^ ^^^^^ + constructor($rootScope, $scope, $localStorage, $log, _, playersApi, playersStore, playerModel, websocket) { ? ^^ ^ ^^^^^ 'ngInject'; this.$rootScope = $rootScope; this.$scope = $scope; this.$log = $log; this._ = _; - this.gameModel = gameModel.model; this.playerModel = playerModel; + this.playersApi = playersApi; this.playersStore = playersStore; this.ws = websocket; this.$log.info('constructor()', this); } $onInit() { this.$log.info('$onInit()', this); } $onDestroy() { return () => { this.$log.info('destroy', this); }; } - showStorage() { + onStorageClick(evt) { - this.$log.info('showStorage()', this); ? -- ^ + this.$log.info('onStorageClick()', evt, this); ? ^ +++++ +++++ + + let cardsSelected = this.player.cardsSelected, + cardsInStorage = this.player.cardsInStorage, + cardsInHand = this.player.cardsInHand, + onSuccess = (res => { + if (res.status == 200) { + this.$log.info(res); + } + }), + onError = (err => { + this.$log.error(err); + }); + + if (this.player.isActive && cardsSelected.length === 3) { + this.$log.info('Storing your cards: ', cardsSelected); + + cardsInStorage.push(cardsSelected[0]); + this._.pullAll(cardsInHand, cardsSelected); + + let plData = { + cardsInHand: cardsInHand, + cardsInStorage: cardsInStorage, + totalCards: cardsInHand.length + }; + + this.playersApi + .update(this.player.id, plData) + .then(onSuccess, onError); + + this.player.cardsSelected = []; + } else { + this.showStorage(this.player); + } } - }; + + showStorage(pl) { + this.$log.info('showStorage()', pl, this); + } + }
47
1.46875
42
5
03a7507e13b84eb3ddd6fad31832e99825977895
Include/SQLiteDatabaseHelper/SQLiteDatabaseHelper.h
Include/SQLiteDatabaseHelper/SQLiteDatabaseHelper.h
// // SQLiteDatabaseHelper // Include/SQLiteDatabaseHelper.h // #ifndef __SQLITEDATABASEHELPER_H__ #define __SQLITEDATABASEHELPER_H__ #include <stdio.h> #include <sqlite3.h> #endif
// // SQLiteDatabaseHelper // Include/SQLiteDatabaseHelper.h // #ifndef __SQLITEDATABASEHELPER_H__ #define __SQLITEDATABASEHELPER_H__ #include <SQLiteDatabaseHelper/Operations/Read/DatabaseReader.h> #endif
Include database reader in main library header
Include database reader in main library header Signed-off-by: Gigabyte-Giant <a7441177296edab3db25b9cdf804d04c1ff0afbf@hotmail.com>
C
mit
Gigabyte-Giant/SQLiteDatabaseHelper
c
## Code Before: // // SQLiteDatabaseHelper // Include/SQLiteDatabaseHelper.h // #ifndef __SQLITEDATABASEHELPER_H__ #define __SQLITEDATABASEHELPER_H__ #include <stdio.h> #include <sqlite3.h> #endif ## Instruction: Include database reader in main library header Signed-off-by: Gigabyte-Giant <a7441177296edab3db25b9cdf804d04c1ff0afbf@hotmail.com> ## Code After: // // SQLiteDatabaseHelper // Include/SQLiteDatabaseHelper.h // #ifndef __SQLITEDATABASEHELPER_H__ #define __SQLITEDATABASEHELPER_H__ #include <SQLiteDatabaseHelper/Operations/Read/DatabaseReader.h> #endif
// // SQLiteDatabaseHelper // Include/SQLiteDatabaseHelper.h // #ifndef __SQLITEDATABASEHELPER_H__ #define __SQLITEDATABASEHELPER_H__ + #include <SQLiteDatabaseHelper/Operations/Read/DatabaseReader.h> - #include <stdio.h> - - #include <sqlite3.h> #endif
4
0.333333
1
3
de377608d9f18fd239e52d9357df67f0c228a509
app/assets/javascripts/components/app.es6.jsx
app/assets/javascripts/components/app.es6.jsx
class App extends React.Component { constructor(){ super(); this.state = { possibleVenues: [], midpoint: [], detailsView: {}, lat: 40.705116, lng: -74.00883, choices: [ { name: "freedomTower", lat: 40.713230, lng: -74.013367 }, { name: "freedomTower", lat: 40.759011, lng: -73.9884472 } ] } } componentDidMount(){ $.ajax({ url: "/users/1/events/1" }) .done((response) => { this.setState({possibleVenues: response}) }) } render() { const { choices, lat, lng, midpoint, possibleVenues, detailsView } = this.state return ( <div className="app-container"> <MapView choices={choices} lat={lat} lng={lng} /> <div className="venue-list-container"> <VenueList venues={ possibleVenues } /> </div> <div className="venue-details-container"> <VenueDetails details={detailsView}/> </div> </div> ) } }
class App extends React.Component { constructor(){ super(); this.state = { possibleVenues: [], midpoint: [], detailsView: {}, lat: 40.705116, lng: -74.00883, choices: [ { name: "freedomTower", lat: 40.713230, lng: -74.013367 }, { name: "freedomTower", lat: 40.759011, lng: -73.9884472 } ] this.handleClick = this.handleClick.bind(this); } } componentDidMount(){ $.ajax({ url: "/users/1/events/1" }) .done((response) => { this.setState({possibleVenues: response}) }) } render() { const { choices, lat, lng, midpoint, possibleVenues, detailsView } = this.state return ( <div className="app-container"> <MapView choices={choices} lat={lat} lng={lng} /> <div className="venue-list-container"> <VenueList venues={ possibleVenues } /> </div> <div className="venue-details-container"> <VenueDetails details={detailsView}/> </div> </div> ) } }
Add in handle click bind.
Add in handle click bind.
JSX
mit
nyc-wolves-2016/FrienDiagram,nyc-wolves-2016/FrienDiagram,nyc-wolves-2016/FrienDiagram
jsx
## Code Before: class App extends React.Component { constructor(){ super(); this.state = { possibleVenues: [], midpoint: [], detailsView: {}, lat: 40.705116, lng: -74.00883, choices: [ { name: "freedomTower", lat: 40.713230, lng: -74.013367 }, { name: "freedomTower", lat: 40.759011, lng: -73.9884472 } ] } } componentDidMount(){ $.ajax({ url: "/users/1/events/1" }) .done((response) => { this.setState({possibleVenues: response}) }) } render() { const { choices, lat, lng, midpoint, possibleVenues, detailsView } = this.state return ( <div className="app-container"> <MapView choices={choices} lat={lat} lng={lng} /> <div className="venue-list-container"> <VenueList venues={ possibleVenues } /> </div> <div className="venue-details-container"> <VenueDetails details={detailsView}/> </div> </div> ) } } ## Instruction: Add in handle click bind. ## Code After: class App extends React.Component { constructor(){ super(); this.state = { possibleVenues: [], midpoint: [], detailsView: {}, lat: 40.705116, lng: -74.00883, choices: [ { name: "freedomTower", lat: 40.713230, lng: -74.013367 }, { name: "freedomTower", lat: 40.759011, lng: -73.9884472 } ] this.handleClick = this.handleClick.bind(this); } } componentDidMount(){ $.ajax({ url: "/users/1/events/1" }) .done((response) => { this.setState({possibleVenues: response}) }) } render() { const { choices, lat, lng, midpoint, possibleVenues, detailsView } = this.state return ( <div className="app-container"> <MapView choices={choices} lat={lat} lng={lng} /> <div className="venue-list-container"> <VenueList venues={ possibleVenues } /> </div> <div className="venue-details-container"> <VenueDetails details={detailsView}/> </div> </div> ) } }
class App extends React.Component { constructor(){ super(); this.state = { possibleVenues: [], midpoint: [], detailsView: {}, lat: 40.705116, lng: -74.00883, choices: [ { name: "freedomTower", lat: 40.713230, lng: -74.013367 }, { name: "freedomTower", lat: 40.759011, lng: -73.9884472 } ] + this.handleClick = this.handleClick.bind(this); } } componentDidMount(){ $.ajax({ url: "/users/1/events/1" }) .done((response) => { this.setState({possibleVenues: response}) }) } render() { const { choices, lat, lng, midpoint, possibleVenues, detailsView } = this.state return ( <div className="app-container"> <MapView choices={choices} lat={lat} lng={lng} /> <div className="venue-list-container"> <VenueList venues={ possibleVenues } /> </div> <div className="venue-details-container"> <VenueDetails details={detailsView}/> </div> </div> ) } }
1
0.020833
1
0
9e7aed847c2d5fcd6e00bc787d8b3558b590f605
api/logs/urls.py
api/logs/urls.py
from django.conf.urls import url from api.logs import views urlpatterns = [ url(r'^(?P<log_id>\w+)/$', views.NodeLogDetail.as_view(), name=views.NodeLogDetail.view_name), url(r'^(?P<log_id>\w+)/nodes/$', views.LogNodeList.as_view(), name=views.LogNodeList.view_name), ]
from django.conf.urls import url from api.logs import views urlpatterns = [ url(r'^(?P<log_id>\w+)/$', views.NodeLogDetail.as_view(), name=views.NodeLogDetail.view_name), url(r'^(?P<log_id>\w+)/nodes/$', views.LogNodeList.as_view(), name=views.LogNodeList.view_name), url(r'^(?P<log_id>\w+)/added_contributors/$', views.NodeLogAddedContributors.as_view(), name=views.NodeLogAddedContributors.view_name), ]
Add /v2/logs/log_id/added_contributors/ to list of URL's.
Add /v2/logs/log_id/added_contributors/ to list of URL's.
Python
apache-2.0
abought/osf.io,mfraezz/osf.io,TomHeatwole/osf.io,chennan47/osf.io,RomanZWang/osf.io,alexschiller/osf.io,billyhunt/osf.io,crcresearch/osf.io,saradbowman/osf.io,acshi/osf.io,jnayak1/osf.io,RomanZWang/osf.io,emetsger/osf.io,KAsante95/osf.io,zachjanicki/osf.io,mattclark/osf.io,RomanZWang/osf.io,emetsger/osf.io,monikagrabowska/osf.io,laurenrevere/osf.io,TomBaxter/osf.io,samchrisinger/osf.io,emetsger/osf.io,billyhunt/osf.io,RomanZWang/osf.io,GageGaskins/osf.io,brandonPurvis/osf.io,zachjanicki/osf.io,kwierman/osf.io,samchrisinger/osf.io,TomBaxter/osf.io,aaxelb/osf.io,Nesiehr/osf.io,asanfilippo7/osf.io,SSJohns/osf.io,kch8qx/osf.io,asanfilippo7/osf.io,rdhyee/osf.io,cslzchen/osf.io,crcresearch/osf.io,HalcyonChimera/osf.io,mluo613/osf.io,hmoco/osf.io,erinspace/osf.io,doublebits/osf.io,felliott/osf.io,mfraezz/osf.io,cslzchen/osf.io,monikagrabowska/osf.io,zamattiac/osf.io,CenterForOpenScience/osf.io,abought/osf.io,leb2dg/osf.io,adlius/osf.io,Johnetordoff/osf.io,Nesiehr/osf.io,binoculars/osf.io,GageGaskins/osf.io,hmoco/osf.io,GageGaskins/osf.io,kwierman/osf.io,hmoco/osf.io,caneruguz/osf.io,SSJohns/osf.io,billyhunt/osf.io,DanielSBrown/osf.io,baylee-d/osf.io,mluo613/osf.io,rdhyee/osf.io,laurenrevere/osf.io,samchrisinger/osf.io,chennan47/osf.io,icereval/osf.io,rdhyee/osf.io,doublebits/osf.io,adlius/osf.io,caneruguz/osf.io,amyshi188/osf.io,jnayak1/osf.io,mluke93/osf.io,erinspace/osf.io,monikagrabowska/osf.io,KAsante95/osf.io,laurenrevere/osf.io,acshi/osf.io,Johnetordoff/osf.io,acshi/osf.io,crcresearch/osf.io,cwisecarver/osf.io,binoculars/osf.io,brianjgeiger/osf.io,sloria/osf.io,zachjanicki/osf.io,baylee-d/osf.io,KAsante95/osf.io,caseyrollins/osf.io,doublebits/osf.io,brandonPurvis/osf.io,chrisseto/osf.io,mattclark/osf.io,pattisdr/osf.io,baylee-d/osf.io,KAsante95/osf.io,brandonPurvis/osf.io,icereval/osf.io,wearpants/osf.io,aaxelb/osf.io,caseyrollins/osf.io,erinspace/osf.io,alexschiller/osf.io,brandonPurvis/osf.io,mluke93/osf.io,leb2dg/osf.io,Nesiehr/osf.io,amyshi188/osf.io,caneruguz/osf.io,Johnetordoff/osf.io,cslzchen/osf.io,sloria/osf.io,kwierman/osf.io,samchrisinger/osf.io,doublebits/osf.io,SSJohns/osf.io,Johnetordoff/osf.io,mluke93/osf.io,mfraezz/osf.io,saradbowman/osf.io,kch8qx/osf.io,KAsante95/osf.io,cwisecarver/osf.io,leb2dg/osf.io,TomHeatwole/osf.io,alexschiller/osf.io,chrisseto/osf.io,acshi/osf.io,amyshi188/osf.io,chrisseto/osf.io,DanielSBrown/osf.io,mattclark/osf.io,cslzchen/osf.io,Nesiehr/osf.io,wearpants/osf.io,CenterForOpenScience/osf.io,cwisecarver/osf.io,SSJohns/osf.io,DanielSBrown/osf.io,HalcyonChimera/osf.io,HalcyonChimera/osf.io,GageGaskins/osf.io,CenterForOpenScience/osf.io,mluke93/osf.io,acshi/osf.io,cwisecarver/osf.io,kwierman/osf.io,abought/osf.io,leb2dg/osf.io,CenterForOpenScience/osf.io,zachjanicki/osf.io,felliott/osf.io,adlius/osf.io,felliott/osf.io,jnayak1/osf.io,binoculars/osf.io,DanielSBrown/osf.io,zamattiac/osf.io,billyhunt/osf.io,abought/osf.io,mluo613/osf.io,zamattiac/osf.io,GageGaskins/osf.io,mluo613/osf.io,brandonPurvis/osf.io,amyshi188/osf.io,brianjgeiger/osf.io,caneruguz/osf.io,HalcyonChimera/osf.io,brianjgeiger/osf.io,aaxelb/osf.io,brianjgeiger/osf.io,hmoco/osf.io,wearpants/osf.io,TomBaxter/osf.io,aaxelb/osf.io,alexschiller/osf.io,caseyrollins/osf.io,mfraezz/osf.io,doublebits/osf.io,zamattiac/osf.io,sloria/osf.io,pattisdr/osf.io,pattisdr/osf.io,rdhyee/osf.io,asanfilippo7/osf.io,asanfilippo7/osf.io,felliott/osf.io,monikagrabowska/osf.io,wearpants/osf.io,jnayak1/osf.io,monikagrabowska/osf.io,adlius/osf.io,emetsger/osf.io,RomanZWang/osf.io,chrisseto/osf.io,kch8qx/osf.io,billyhunt/osf.io,chennan47/osf.io,kch8qx/osf.io,icereval/osf.io,TomHeatwole/osf.io,mluo613/osf.io,TomHeatwole/osf.io,alexschiller/osf.io,kch8qx/osf.io
python
## Code Before: from django.conf.urls import url from api.logs import views urlpatterns = [ url(r'^(?P<log_id>\w+)/$', views.NodeLogDetail.as_view(), name=views.NodeLogDetail.view_name), url(r'^(?P<log_id>\w+)/nodes/$', views.LogNodeList.as_view(), name=views.LogNodeList.view_name), ] ## Instruction: Add /v2/logs/log_id/added_contributors/ to list of URL's. ## Code After: from django.conf.urls import url from api.logs import views urlpatterns = [ url(r'^(?P<log_id>\w+)/$', views.NodeLogDetail.as_view(), name=views.NodeLogDetail.view_name), url(r'^(?P<log_id>\w+)/nodes/$', views.LogNodeList.as_view(), name=views.LogNodeList.view_name), url(r'^(?P<log_id>\w+)/added_contributors/$', views.NodeLogAddedContributors.as_view(), name=views.NodeLogAddedContributors.view_name), ]
from django.conf.urls import url from api.logs import views urlpatterns = [ url(r'^(?P<log_id>\w+)/$', views.NodeLogDetail.as_view(), name=views.NodeLogDetail.view_name), url(r'^(?P<log_id>\w+)/nodes/$', views.LogNodeList.as_view(), name=views.LogNodeList.view_name), + url(r'^(?P<log_id>\w+)/added_contributors/$', views.NodeLogAddedContributors.as_view(), name=views.NodeLogAddedContributors.view_name), ]
1
0.125
1
0
d1a447684650eb362bc8d4dfa9694b530d0111ca
example-apps/running/web-server/service.yml
example-apps/running/web-server/service.yml
name: test app web server description: serves simple HTML pages as part of the test app setup: npm install --loglevel error --depth 0 startup: command: node_modules/livescript/bin/lsc server.ls online-text: web server running at port messages: sends: - users.list - users.create receives: - users.listed - users.created
name: test app web server description: serves simple HTML pages as part of the test app setup: npm install --loglevel error --depth 0 startup: command: node_modules/.bin/lsc server.ls online-text: web server running at port messages: sends: - users.list - users.create receives: - users.listed - users.created
Use properly exported Livescript binary
Use properly exported Livescript binary
YAML
mit
Originate/exosphere,Originate/exosphere,Originate/exosphere,Originate/exosphere
yaml
## Code Before: name: test app web server description: serves simple HTML pages as part of the test app setup: npm install --loglevel error --depth 0 startup: command: node_modules/livescript/bin/lsc server.ls online-text: web server running at port messages: sends: - users.list - users.create receives: - users.listed - users.created ## Instruction: Use properly exported Livescript binary ## Code After: name: test app web server description: serves simple HTML pages as part of the test app setup: npm install --loglevel error --depth 0 startup: command: node_modules/.bin/lsc server.ls online-text: web server running at port messages: sends: - users.list - users.create receives: - users.listed - users.created
name: test app web server description: serves simple HTML pages as part of the test app setup: npm install --loglevel error --depth 0 startup: - command: node_modules/livescript/bin/lsc server.ls ? ^^^^^^^^^^^ + command: node_modules/.bin/lsc server.ls ? ^ online-text: web server running at port messages: sends: - users.list - users.create receives: - users.listed - users.created
2
0.125
1
1
322f07f6068ebdb0ede75090207e1e2f6023284f
src/livescript/components/Constants.ls
src/livescript/components/Constants.ls
module.exports = INACTIVE_ICON_PATH: \19 : 'assets/19-inactive.png' \38 : 'assets/19-inactive@2x.png' ACTIVE_ICON_PATH: \19 : 'assets/19-active.png' \38 : 'assets/19-active@2x.png'
module.exports = EXTENSION_ID: 'eeabdaneafdojlhagbcpiiplpmabhnhl' INACTIVE_ICON_PATH: \19 : 'assets/19-inactive.png' \38 : 'assets/19-inactive@2x.png' ACTIVE_ICON_PATH: \19 : 'assets/19-active.png' \38 : 'assets/19-active@2x.png'
Add EXTENSION_ID to app-wide constants.ls
Add EXTENSION_ID to app-wide constants.ls
LiveScript
mit
MrOrz/SeeSS
livescript
## Code Before: module.exports = INACTIVE_ICON_PATH: \19 : 'assets/19-inactive.png' \38 : 'assets/19-inactive@2x.png' ACTIVE_ICON_PATH: \19 : 'assets/19-active.png' \38 : 'assets/19-active@2x.png' ## Instruction: Add EXTENSION_ID to app-wide constants.ls ## Code After: module.exports = EXTENSION_ID: 'eeabdaneafdojlhagbcpiiplpmabhnhl' INACTIVE_ICON_PATH: \19 : 'assets/19-inactive.png' \38 : 'assets/19-inactive@2x.png' ACTIVE_ICON_PATH: \19 : 'assets/19-active.png' \38 : 'assets/19-active@2x.png'
module.exports = + EXTENSION_ID: 'eeabdaneafdojlhagbcpiiplpmabhnhl' INACTIVE_ICON_PATH: \19 : 'assets/19-inactive.png' \38 : 'assets/19-inactive@2x.png' ACTIVE_ICON_PATH: \19 : 'assets/19-active.png' \38 : 'assets/19-active@2x.png'
1
0.125
1
0
8f14d360064792b08887ae02a1493f7f19d4b2ff
README.rst
README.rst
========= pyrax-cmd ========= Rackspace `Pyrax <https://github.com/rackspace/pyrax>`_ cloud files command line client. Features: * ls - list object names in a container * status - show the container status * rename - rename an object in a container * upload - upload files/folders to your cloudfiles container It's pretty basic, but it made my life easier. :Code: https://github.com/willkg/pyrax-cmd/ :Issues: https://github.com/willkg/pyrax-cmd/issues :License: BSD 3-clause; See LICENSE :Contributors: See AUTHORS.rst Install ======= From PyPI --------- Run:: $ pip install pyrax-cmd For hacking ----------- Run:: $ git clone https://github.com/willkg/pyrax-cmd # Create a virtualenvironment $ pip install -e . Use === Run:: $ pyrax-cmd --help This will show you help for pyrax-cmd.
========= pyrax-cmd ========= Rackspace `Pyrax <https://github.com/rackspace/pyrax>`_ cloud files command line client. Features: * ls - list object names in a container * status - show the container status * rename - rename an object in a container * upload - upload files/folders to your cloudfiles container It's pretty basic, but it made my life easier. :Code: https://github.com/willkg/pyrax-cmd/ :Issues: https://github.com/willkg/pyrax-cmd/issues :License: BSD 3-clause; See LICENSE :Contributors: See AUTHORS.rst Note ==== This is **not** an official Rackspace pyrax cli. If you're a Rackspace person and you want me to rename this, I can. Just let me know. Install ======= From PyPI --------- **Note:** This isn't on PyPI, yet. so this doesn't work. Run:: $ pip install pyrax-cmd From git -------- Run:: $ pip install https://github.com/willkg/pyrax-cmd/zipball/master#egg=pyrax-cmd For hacking ----------- Run:: $ git clone https://github.com/willkg/pyrax-cmd # Create a virtualenvironment $ pip install -e . Use === Run:: $ pyrax-cmd --help This will show you help for pyrax-cmd.
Rework install docs; add note about officialness
Rework install docs; add note about officialness
reStructuredText
bsd-3-clause
willkg/pyrax-cmd
restructuredtext
## Code Before: ========= pyrax-cmd ========= Rackspace `Pyrax <https://github.com/rackspace/pyrax>`_ cloud files command line client. Features: * ls - list object names in a container * status - show the container status * rename - rename an object in a container * upload - upload files/folders to your cloudfiles container It's pretty basic, but it made my life easier. :Code: https://github.com/willkg/pyrax-cmd/ :Issues: https://github.com/willkg/pyrax-cmd/issues :License: BSD 3-clause; See LICENSE :Contributors: See AUTHORS.rst Install ======= From PyPI --------- Run:: $ pip install pyrax-cmd For hacking ----------- Run:: $ git clone https://github.com/willkg/pyrax-cmd # Create a virtualenvironment $ pip install -e . Use === Run:: $ pyrax-cmd --help This will show you help for pyrax-cmd. ## Instruction: Rework install docs; add note about officialness ## Code After: ========= pyrax-cmd ========= Rackspace `Pyrax <https://github.com/rackspace/pyrax>`_ cloud files command line client. Features: * ls - list object names in a container * status - show the container status * rename - rename an object in a container * upload - upload files/folders to your cloudfiles container It's pretty basic, but it made my life easier. :Code: https://github.com/willkg/pyrax-cmd/ :Issues: https://github.com/willkg/pyrax-cmd/issues :License: BSD 3-clause; See LICENSE :Contributors: See AUTHORS.rst Note ==== This is **not** an official Rackspace pyrax cli. If you're a Rackspace person and you want me to rename this, I can. Just let me know. Install ======= From PyPI --------- **Note:** This isn't on PyPI, yet. so this doesn't work. Run:: $ pip install pyrax-cmd From git -------- Run:: $ pip install https://github.com/willkg/pyrax-cmd/zipball/master#egg=pyrax-cmd For hacking ----------- Run:: $ git clone https://github.com/willkg/pyrax-cmd # Create a virtualenvironment $ pip install -e . Use === Run:: $ pyrax-cmd --help This will show you help for pyrax-cmd.
========= pyrax-cmd ========= Rackspace `Pyrax <https://github.com/rackspace/pyrax>`_ cloud files command line client. Features: * ls - list object names in a container * status - show the container status * rename - rename an object in a container * upload - upload files/folders to your cloudfiles container It's pretty basic, but it made my life easier. - :Code: https://github.com/willkg/pyrax-cmd/ :Issues: https://github.com/willkg/pyrax-cmd/issues :License: BSD 3-clause; See LICENSE :Contributors: See AUTHORS.rst + + + Note + ==== + + This is **not** an official Rackspace pyrax cli. + + If you're a Rackspace person and you want me to rename this, I + can. Just let me know. Install ======= From PyPI --------- + **Note:** This isn't on PyPI, yet. so this doesn't work. + Run:: $ pip install pyrax-cmd + + + From git + -------- + + Run:: + + $ pip install https://github.com/willkg/pyrax-cmd/zipball/master#egg=pyrax-cmd For hacking ----------- Run:: $ git clone https://github.com/willkg/pyrax-cmd # Create a virtualenvironment $ pip install -e . Use === Run:: $ pyrax-cmd --help This will show you help for pyrax-cmd.
20
0.384615
19
1
3ea7fde9641717aee807513f1df41f704a316347
README.md
README.md
Some tools for resiliency in ruby. ## Installation Add this line to your application's Gemfile: ```ruby gem "resiliency" ``` And then execute: $ bundle Or install it yourself as: $ gem install resiliency ## Usage ```ruby require "resiliency" circuit_breaker = Resiliency::CircuitBreaker.new circuit_breaker.run do # some database or flaky service end ``` ## Development ```bash script/bootstrap script/test ``` ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/jnunemaker/resiliency. ## License The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
Some tools for resiliency in ruby. ## Installation Add this line to your application's Gemfile: ```ruby gem "resiliency" ``` And then execute: $ bundle Or install it yourself as: $ gem install resiliency ## Usage ```ruby require "resiliency" circuit_breaker = Resiliency::CircuitBreaker.new if circuit_breaker.request_allowed? begin # do something expensive circuit_breaker.mark_success rescue => boom # do fallback end else # do fallback end ``` ## Development ```bash script/bootstrap script/test ``` ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/jnunemaker/resiliency. ## License The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
Update readme to be accurate with code
Update readme to be accurate with code
Markdown
mit
jnunemaker/resilient,jnunemaker/resilient
markdown
## Code Before: Some tools for resiliency in ruby. ## Installation Add this line to your application's Gemfile: ```ruby gem "resiliency" ``` And then execute: $ bundle Or install it yourself as: $ gem install resiliency ## Usage ```ruby require "resiliency" circuit_breaker = Resiliency::CircuitBreaker.new circuit_breaker.run do # some database or flaky service end ``` ## Development ```bash script/bootstrap script/test ``` ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/jnunemaker/resiliency. ## License The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT). ## Instruction: Update readme to be accurate with code ## Code After: Some tools for resiliency in ruby. ## Installation Add this line to your application's Gemfile: ```ruby gem "resiliency" ``` And then execute: $ bundle Or install it yourself as: $ gem install resiliency ## Usage ```ruby require "resiliency" circuit_breaker = Resiliency::CircuitBreaker.new if circuit_breaker.request_allowed? begin # do something expensive circuit_breaker.mark_success rescue => boom # do fallback end else # do fallback end ``` ## Development ```bash script/bootstrap script/test ``` ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/jnunemaker/resiliency. ## License The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
Some tools for resiliency in ruby. ## Installation Add this line to your application's Gemfile: ```ruby gem "resiliency" ``` And then execute: $ bundle Or install it yourself as: $ gem install resiliency ## Usage ```ruby require "resiliency" circuit_breaker = Resiliency::CircuitBreaker.new - circuit_breaker.run do - # some database or flaky service + if circuit_breaker.request_allowed? + begin + # do something expensive + circuit_breaker.mark_success + rescue => boom + # do fallback + end + else + # do fallback end ``` ## Development ```bash script/bootstrap script/test ``` ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/jnunemaker/resiliency. ## License The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
11
0.25
9
2
9a8b9d5a6d58ce748bdbffb8e41b9eebf36d4125
tasks/install.yml
tasks/install.yml
--- # task file for wildfly - name: Install OpenJDK yum: name=java-1.8.0-openjdk-headless state=present - name: Check if wildfly version file exists stat: path={{ wildfly_version_file }} register: wildfly_version_file_st changed_when: not wildfly_version_file_st.stat.exists - name: Check wildfly installation shell: grep -q "{{ wildfly_version }}" {{ wildfly_version_file }} && echo $? register: wildfly_installed when: wildfly_version_file_st.stat.exists and not wildfly_version_file_st.stat.isdir changed_when: wildfly_installed.rc == 1 - name: Download wildfly tar file get_url: dest={{ wildfly_download_dir }} url={{ wildfly_download_url }} when: wildfly_installed.stdout is not defined or not wildfly_installed.stdout - name: Create wildfly group group: name={{ wildfly_group }} state=present when: wildfly_installed.stdout is not defined or not wildfly_installed.stdout - name: Create wildfly user user: name={{ wildfly_user }} group={{ wildfly_group }} createhome=no state=present when: wildfly_installed.stdout is not defined or not wildfly_installed.stdout - name: Unarchive downloaded file unarchive: src={{ wildfly_download_dir }}/{{ wildfly_download_file }} dest={{ wildfly_install_dir }} copy=no owner={{ wildfly_user }} group={{ wildfly_group }} mode=0750 when: wildfly_installed.stdout is not defined or not wildfly_installed.stdout
--- # task file for wildfly - name: Install OpenJDK yum: name=java-1.8.0-openjdk-headless state=present - name: Check if wildfly version file exists stat: path={{ wildfly_version_file }} register: wildfly_version_file_st changed_when: not wildfly_version_file_st.stat.exists - name: Check wildfly installation shell: grep -q "{{ wildfly_version }}" {{ wildfly_version_file }} && echo $? register: wildfly_installed when: wildfly_version_file_st.stat.exists and not wildfly_version_file_st.stat.isdir changed_when: wildfly_installed.rc == 1 - block: - name: Download wildfly tar file get_url: dest={{ wildfly_download_dir }} url={{ wildfly_download_url }} - name: Create wildfly group group: name={{ wildfly_group }} state=present - name: Create wildfly user user: name={{ wildfly_user }} group={{ wildfly_group }} createhome=no state=present - name: Unarchive downloaded file unarchive: src={{ wildfly_download_dir }}/{{ wildfly_download_file }} dest={{ wildfly_install_dir }} copy=no owner={{ wildfly_user }} group={{ wildfly_group }} mode=0750 when: wildfly_installed.stdout is not defined or not wildfly_installed.stdout
Use conditional block to avoid repeated conditions
Use conditional block to avoid repeated conditions By using a block-construction we can avoid having a repeated condition for a set of tasks.
YAML
bsd-3-clause
inkatze/wildfly
yaml
## Code Before: --- # task file for wildfly - name: Install OpenJDK yum: name=java-1.8.0-openjdk-headless state=present - name: Check if wildfly version file exists stat: path={{ wildfly_version_file }} register: wildfly_version_file_st changed_when: not wildfly_version_file_st.stat.exists - name: Check wildfly installation shell: grep -q "{{ wildfly_version }}" {{ wildfly_version_file }} && echo $? register: wildfly_installed when: wildfly_version_file_st.stat.exists and not wildfly_version_file_st.stat.isdir changed_when: wildfly_installed.rc == 1 - name: Download wildfly tar file get_url: dest={{ wildfly_download_dir }} url={{ wildfly_download_url }} when: wildfly_installed.stdout is not defined or not wildfly_installed.stdout - name: Create wildfly group group: name={{ wildfly_group }} state=present when: wildfly_installed.stdout is not defined or not wildfly_installed.stdout - name: Create wildfly user user: name={{ wildfly_user }} group={{ wildfly_group }} createhome=no state=present when: wildfly_installed.stdout is not defined or not wildfly_installed.stdout - name: Unarchive downloaded file unarchive: src={{ wildfly_download_dir }}/{{ wildfly_download_file }} dest={{ wildfly_install_dir }} copy=no owner={{ wildfly_user }} group={{ wildfly_group }} mode=0750 when: wildfly_installed.stdout is not defined or not wildfly_installed.stdout ## Instruction: Use conditional block to avoid repeated conditions By using a block-construction we can avoid having a repeated condition for a set of tasks. ## Code After: --- # task file for wildfly - name: Install OpenJDK yum: name=java-1.8.0-openjdk-headless state=present - name: Check if wildfly version file exists stat: path={{ wildfly_version_file }} register: wildfly_version_file_st changed_when: not wildfly_version_file_st.stat.exists - name: Check wildfly installation shell: grep -q "{{ wildfly_version }}" {{ wildfly_version_file }} && echo $? register: wildfly_installed when: wildfly_version_file_st.stat.exists and not wildfly_version_file_st.stat.isdir changed_when: wildfly_installed.rc == 1 - block: - name: Download wildfly tar file get_url: dest={{ wildfly_download_dir }} url={{ wildfly_download_url }} - name: Create wildfly group group: name={{ wildfly_group }} state=present - name: Create wildfly user user: name={{ wildfly_user }} group={{ wildfly_group }} createhome=no state=present - name: Unarchive downloaded file unarchive: src={{ wildfly_download_dir }}/{{ wildfly_download_file }} dest={{ wildfly_install_dir }} copy=no owner={{ wildfly_user }} group={{ wildfly_group }} mode=0750 when: wildfly_installed.stdout is not defined or not wildfly_installed.stdout
--- # task file for wildfly - name: Install OpenJDK yum: name=java-1.8.0-openjdk-headless state=present - name: Check if wildfly version file exists stat: path={{ wildfly_version_file }} register: wildfly_version_file_st changed_when: not wildfly_version_file_st.stat.exists - name: Check wildfly installation shell: grep -q "{{ wildfly_version }}" {{ wildfly_version_file }} && echo $? register: wildfly_installed when: wildfly_version_file_st.stat.exists and not wildfly_version_file_st.stat.isdir changed_when: wildfly_installed.rc == 1 + - block: + - - name: Download wildfly tar file + - name: Download wildfly tar file ? ++ - get_url: dest={{ wildfly_download_dir }} url={{ wildfly_download_url }} + get_url: dest={{ wildfly_download_dir }} url={{ wildfly_download_url }} ? ++ + + - name: Create wildfly group + group: name={{ wildfly_group }} state=present + + - name: Create wildfly user + user: name={{ wildfly_user }} group={{ wildfly_group }} createhome=no + state=present + + - name: Unarchive downloaded file + unarchive: src={{ wildfly_download_dir }}/{{ wildfly_download_file }} + dest={{ wildfly_install_dir }} copy=no + owner={{ wildfly_user }} group={{ wildfly_group }} mode=0750 + when: wildfly_installed.stdout is not defined or not wildfly_installed.stdout - - - name: Create wildfly group - group: name={{ wildfly_group }} state=present - when: wildfly_installed.stdout is not defined or not wildfly_installed.stdout - - - name: Create wildfly user - user: name={{ wildfly_user }} group={{ wildfly_group }} createhome=no - state=present - when: wildfly_installed.stdout is not defined or not wildfly_installed.stdout - - - name: Unarchive downloaded file - unarchive: src={{ wildfly_download_dir }}/{{ wildfly_download_file }} - dest={{ wildfly_install_dir }} copy=no - owner={{ wildfly_user }} group={{ wildfly_group }} mode=0750 - when: wildfly_installed.stdout is not defined or not wildfly_installed.stdout
34
0.944444
17
17
d22f4c14d5f36fee412b41aacc1b5885259c0775
employee_tests.rb
employee_tests.rb
require 'minitest/autorun' require 'minitest/pride' require './department' require './employee' require './review' class EmployeeTest < Minitest::Test end
require 'minitest/autorun' require 'minitest/pride' require './department' require './employee' require './review' class EmployeeTest < Minitest::Test def david Employee.new(name: "David", salary: 40000, phone: "123", email: "david@test.com") end def blake Employee.new(name: "David", salary: 40001, phone: "321", email: "blake@test.com") end def test_new_employee david_employee = david assert david_employee assert_equal david_employee.class, Employee assert_equal david_employee.name, "David" assert_equal david_employee.salary, 40000 assert_equal david_employee.email, "david@test.com" assert_equal david_employee.phone, "123" end def test_add_employee_to_department dept = Department.new(name: "Hard Knocks", employees: [david]) assert dept refute_equal dept.employees.length, 2 dept.add_employee(blake) assert_equal dept.employees.length, 2 end end
Add 2 tests. Employee and adding to Department
Add 2 tests. Employee and adding to Department
Ruby
mit
dbernheisel/employee-reviews
ruby
## Code Before: require 'minitest/autorun' require 'minitest/pride' require './department' require './employee' require './review' class EmployeeTest < Minitest::Test end ## Instruction: Add 2 tests. Employee and adding to Department ## Code After: require 'minitest/autorun' require 'minitest/pride' require './department' require './employee' require './review' class EmployeeTest < Minitest::Test def david Employee.new(name: "David", salary: 40000, phone: "123", email: "david@test.com") end def blake Employee.new(name: "David", salary: 40001, phone: "321", email: "blake@test.com") end def test_new_employee david_employee = david assert david_employee assert_equal david_employee.class, Employee assert_equal david_employee.name, "David" assert_equal david_employee.salary, 40000 assert_equal david_employee.email, "david@test.com" assert_equal david_employee.phone, "123" end def test_add_employee_to_department dept = Department.new(name: "Hard Knocks", employees: [david]) assert dept refute_equal dept.employees.length, 2 dept.add_employee(blake) assert_equal dept.employees.length, 2 end end
require 'minitest/autorun' require 'minitest/pride' require './department' require './employee' require './review' class EmployeeTest < Minitest::Test + def david + Employee.new(name: "David", salary: 40000, phone: "123", email: "david@test.com") + end + + def blake + Employee.new(name: "David", salary: 40001, phone: "321", email: "blake@test.com") + end + + def test_new_employee + david_employee = david + assert david_employee + assert_equal david_employee.class, Employee + assert_equal david_employee.name, "David" + assert_equal david_employee.salary, 40000 + assert_equal david_employee.email, "david@test.com" + assert_equal david_employee.phone, "123" + end + + def test_add_employee_to_department + dept = Department.new(name: "Hard Knocks", employees: [david]) + assert dept + refute_equal dept.employees.length, 2 + dept.add_employee(blake) + assert_equal dept.employees.length, 2 + end + end
26
2.888889
26
0
bd16dc3df79434e1db050a14ca0acbea98fa5ce9
package.json
package.json
{ "name": "api-boilerplate", "version": "0.0.1", "description": "A boilerplate for Node, Express, ES6/7 API", "main": "index.js", "scripts": { "start": "nodemon server/index.js --exec babel-node", "test": "echo \"Error: no test specified\" && exit 1", "clean": "rm -rf dist", "build": "npm run clean && mkdir dist && babel server -s -d dist && npm run serve", "serve": "node dist/index.js", "lint": "esw -f simple-detail -w *.js server" }, "keywords": [ "api", "node", "express", "es6", "es7", "api" ], "author": "Olivers De Abreu <olivers@vensign.com> (http://vensign.com/)", "license": "MIT", "devDependencies": { "babel-cli": "^6.23.0", "babel-preset-env": "^1.2.0", "eslint": "^3.17.0", "eslint-config-airbnb-base": "11.1.1", "eslint-plugin-import": "2.2.0", "eslint-watch": "^3.0.1", "nodemon": "^1.11.0" } }
{ "name": "api-boilerplate", "version": "0.0.1", "description": "A boilerplate for Node, Express, ES6/7 API", "main": "index.js", "scripts": { "start": "nodemon server/index.js --exec babel-node", "test": "echo \"Error: no test specified\" && exit 1", "clean": "rm -rf dist", "build": "npm run lint && npm run clean && mkdir dist && babel server -s -d dist && npm run serve", "serve": "node dist/index.js", "lint": "esw -f simple-detail -w *.js server" }, "keywords": [ "api", "node", "express", "es6", "es7", "api" ], "author": "Olivers De Abreu <olivers@vensign.com> (http://vensign.com/)", "license": "MIT", "devDependencies": { "babel-cli": "^6.23.0", "babel-preset-env": "^1.2.0", "eslint": "^3.17.0", "eslint-config-airbnb-base": "11.1.1", "eslint-plugin-import": "2.2.0", "eslint-watch": "^3.0.1", "nodemon": "^1.11.0" } }
Add lint to build script
Add lint to build script
JSON
mit
oliversd/express-rest-api-boilerplate
json
## Code Before: { "name": "api-boilerplate", "version": "0.0.1", "description": "A boilerplate for Node, Express, ES6/7 API", "main": "index.js", "scripts": { "start": "nodemon server/index.js --exec babel-node", "test": "echo \"Error: no test specified\" && exit 1", "clean": "rm -rf dist", "build": "npm run clean && mkdir dist && babel server -s -d dist && npm run serve", "serve": "node dist/index.js", "lint": "esw -f simple-detail -w *.js server" }, "keywords": [ "api", "node", "express", "es6", "es7", "api" ], "author": "Olivers De Abreu <olivers@vensign.com> (http://vensign.com/)", "license": "MIT", "devDependencies": { "babel-cli": "^6.23.0", "babel-preset-env": "^1.2.0", "eslint": "^3.17.0", "eslint-config-airbnb-base": "11.1.1", "eslint-plugin-import": "2.2.0", "eslint-watch": "^3.0.1", "nodemon": "^1.11.0" } } ## Instruction: Add lint to build script ## Code After: { "name": "api-boilerplate", "version": "0.0.1", "description": "A boilerplate for Node, Express, ES6/7 API", "main": "index.js", "scripts": { "start": "nodemon server/index.js --exec babel-node", "test": "echo \"Error: no test specified\" && exit 1", "clean": "rm -rf dist", "build": "npm run lint && npm run clean && mkdir dist && babel server -s -d dist && npm run serve", "serve": "node dist/index.js", "lint": "esw -f simple-detail -w *.js server" }, "keywords": [ "api", "node", "express", "es6", "es7", "api" ], "author": "Olivers De Abreu <olivers@vensign.com> (http://vensign.com/)", "license": "MIT", "devDependencies": { "babel-cli": "^6.23.0", "babel-preset-env": "^1.2.0", "eslint": "^3.17.0", "eslint-config-airbnb-base": "11.1.1", "eslint-plugin-import": "2.2.0", "eslint-watch": "^3.0.1", "nodemon": "^1.11.0" } }
{ "name": "api-boilerplate", "version": "0.0.1", "description": "A boilerplate for Node, Express, ES6/7 API", "main": "index.js", "scripts": { "start": "nodemon server/index.js --exec babel-node", "test": "echo \"Error: no test specified\" && exit 1", "clean": "rm -rf dist", - "build": "npm run clean && mkdir dist && babel server -s -d dist && npm run serve", + "build": "npm run lint && npm run clean && mkdir dist && babel server -s -d dist && npm run serve", ? ++++++++++++++++ "serve": "node dist/index.js", "lint": "esw -f simple-detail -w *.js server" }, "keywords": [ "api", "node", "express", "es6", "es7", "api" ], "author": "Olivers De Abreu <olivers@vensign.com> (http://vensign.com/)", "license": "MIT", "devDependencies": { "babel-cli": "^6.23.0", "babel-preset-env": "^1.2.0", "eslint": "^3.17.0", "eslint-config-airbnb-base": "11.1.1", "eslint-plugin-import": "2.2.0", "eslint-watch": "^3.0.1", "nodemon": "^1.11.0" } }
2
0.060606
1
1
e47670f070165733332672b0e82318d7e3176fc6
talks.md
talks.md
--- layout: page title: Talks I've Given permalink: /talks/ --- I really enjoy giving talks at conferences and speaking to teams about engineering process, software development, the importance of culture, and innovation. I've spoken at several conferences and other settings, I've listed some of them below. # Upcoming * [Full Stack Toronto 2015](https://fsto.co/) - ["Enabling Autonomy"](https://fsto.co/schedule) # Previous * [Dreamforce](http://dreamforce.com) - [Building a Concierge-like Experience into any Mobile Application](#) * [Volta Labs](http://www.voltaeffect.com/) - ["Iterate."](http://www.slideshare.net/ianlivingstone1/iterate-40515194) * [JQueryTO 2014](http://jqueryto.com/) - ["The Rise of BaaS"](http://www.slideshare.net/ianlivingstone1/go-instant-baas09) * [NodeDay 2014](http://nodeday.com/2014-paypal/) - ["Node App Lifecycle"](http://youtu.be/ceQxrF6kso4)
--- layout: page title: Talks I've Given permalink: /talks/ --- I really enjoy giving talks at conferences and speaking to teams about engineering process, software development, the importance of culture, and innovation. I've spoken at several conferences and other settings, I've listed some of them below. * [Full Stack Toronto 2015](https://fsto.co/) - ["Enabling Autonomy"](http://www.slideshare.net/ianlivingstone1/enabling-autonomy) * [Dreamforce](http://dreamforce.com) - [Building a Concierge-like Experience into any Mobile Application](#) * [Volta Labs](http://www.voltaeffect.com/) - ["Iterate."](http://www.slideshare.net/ianlivingstone1/iterate-40515194) * [JQueryTO 2014](http://jqueryto.com/) - ["The Rise of BaaS"](http://www.slideshare.net/ianlivingstone1/go-instant-baas09) * [NodeDay 2014](http://nodeday.com/2014-paypal/) - ["Node App Lifecycle"](http://youtu.be/ceQxrF6kso4)
Add Enabling Autonomy slides to Talks page
Add Enabling Autonomy slides to Talks page
Markdown
mit
ianlivingstone/ianlivingstone.github.io,ianlivingstone/ianlivingstone.github.io
markdown
## Code Before: --- layout: page title: Talks I've Given permalink: /talks/ --- I really enjoy giving talks at conferences and speaking to teams about engineering process, software development, the importance of culture, and innovation. I've spoken at several conferences and other settings, I've listed some of them below. # Upcoming * [Full Stack Toronto 2015](https://fsto.co/) - ["Enabling Autonomy"](https://fsto.co/schedule) # Previous * [Dreamforce](http://dreamforce.com) - [Building a Concierge-like Experience into any Mobile Application](#) * [Volta Labs](http://www.voltaeffect.com/) - ["Iterate."](http://www.slideshare.net/ianlivingstone1/iterate-40515194) * [JQueryTO 2014](http://jqueryto.com/) - ["The Rise of BaaS"](http://www.slideshare.net/ianlivingstone1/go-instant-baas09) * [NodeDay 2014](http://nodeday.com/2014-paypal/) - ["Node App Lifecycle"](http://youtu.be/ceQxrF6kso4) ## Instruction: Add Enabling Autonomy slides to Talks page ## Code After: --- layout: page title: Talks I've Given permalink: /talks/ --- I really enjoy giving talks at conferences and speaking to teams about engineering process, software development, the importance of culture, and innovation. I've spoken at several conferences and other settings, I've listed some of them below. * [Full Stack Toronto 2015](https://fsto.co/) - ["Enabling Autonomy"](http://www.slideshare.net/ianlivingstone1/enabling-autonomy) * [Dreamforce](http://dreamforce.com) - [Building a Concierge-like Experience into any Mobile Application](#) * [Volta Labs](http://www.voltaeffect.com/) - ["Iterate."](http://www.slideshare.net/ianlivingstone1/iterate-40515194) * [JQueryTO 2014](http://jqueryto.com/) - ["The Rise of BaaS"](http://www.slideshare.net/ianlivingstone1/go-instant-baas09) * [NodeDay 2014](http://nodeday.com/2014-paypal/) - ["Node App Lifecycle"](http://youtu.be/ceQxrF6kso4)
--- layout: page title: Talks I've Given permalink: /talks/ --- I really enjoy giving talks at conferences and speaking to teams about engineering process, software development, the importance of culture, and innovation. I've spoken at several conferences and other settings, I've listed some of them below. - # Upcoming + * [Full Stack Toronto 2015](https://fsto.co/) - ["Enabling Autonomy"](http://www.slideshare.net/ianlivingstone1/enabling-autonomy) - * [Full Stack Toronto 2015](https://fsto.co/) - ["Enabling Autonomy"](https://fsto.co/schedule) - - # Previous - * [Dreamforce](http://dreamforce.com) - [Building a Concierge-like Experience into any Mobile Application](#) * [Volta Labs](http://www.voltaeffect.com/) - ["Iterate."](http://www.slideshare.net/ianlivingstone1/iterate-40515194) * [JQueryTO 2014](http://jqueryto.com/) - ["The Rise of BaaS"](http://www.slideshare.net/ianlivingstone1/go-instant-baas09) * [NodeDay 2014](http://nodeday.com/2014-paypal/) - ["Node App Lifecycle"](http://youtu.be/ceQxrF6kso4)
6
0.285714
1
5
c58ae2b825ce39cf6491af0d94bb0398d6f4fee6
frontend/app/views/spree/shared/_main_nav_bar.html.erb
frontend/app/views/spree/shared/_main_nav_bar.html.erb
<nav id="main-nav-bar" class="navbar"> <ul class="nav" data-hook> <li id="home-link" class="nav-item" data-hook> <%= link_to Spree.t(:home), spree.root_path, class: 'nav-link' %> </li> </ul> <ul class="nav" data-hook> <li id="link-to-cart" class="nav-item" data-hook> <noscript> <%= link_to_cart %> </noscript> &nbsp; </li> <script>Spree.fetch_cart()</script> </ul> </nav>
<nav id="main-nav-bar" class="navbar"> <ul class="nav" data-hook> <li id="home-link" class="nav-item" data-hook> <%= link_to Spree.t(:home), spree.root_path, class: 'nav-link' %> </li> </ul> <ul class="nav navbar-right" data-hook> <li id="link-to-cart" class="nav-item" data-hook> <noscript> <%= link_to_cart %> </noscript> &nbsp; </li> <script>Spree.fetch_cart()</script> </ul> </nav>
Bring back .navbar-right class for deface overrides from spree_i18n.
Bring back .navbar-right class for deface overrides from spree_i18n.
HTML+ERB
bsd-3-clause
ayb/spree,imella/spree,imella/spree,ayb/spree,ayb/spree,imella/spree,ayb/spree
html+erb
## Code Before: <nav id="main-nav-bar" class="navbar"> <ul class="nav" data-hook> <li id="home-link" class="nav-item" data-hook> <%= link_to Spree.t(:home), spree.root_path, class: 'nav-link' %> </li> </ul> <ul class="nav" data-hook> <li id="link-to-cart" class="nav-item" data-hook> <noscript> <%= link_to_cart %> </noscript> &nbsp; </li> <script>Spree.fetch_cart()</script> </ul> </nav> ## Instruction: Bring back .navbar-right class for deface overrides from spree_i18n. ## Code After: <nav id="main-nav-bar" class="navbar"> <ul class="nav" data-hook> <li id="home-link" class="nav-item" data-hook> <%= link_to Spree.t(:home), spree.root_path, class: 'nav-link' %> </li> </ul> <ul class="nav navbar-right" data-hook> <li id="link-to-cart" class="nav-item" data-hook> <noscript> <%= link_to_cart %> </noscript> &nbsp; </li> <script>Spree.fetch_cart()</script> </ul> </nav>
<nav id="main-nav-bar" class="navbar"> <ul class="nav" data-hook> <li id="home-link" class="nav-item" data-hook> <%= link_to Spree.t(:home), spree.root_path, class: 'nav-link' %> </li> </ul> - <ul class="nav" data-hook> + <ul class="nav navbar-right" data-hook> ? +++++++++++++ <li id="link-to-cart" class="nav-item" data-hook> <noscript> <%= link_to_cart %> </noscript> &nbsp; </li> <script>Spree.fetch_cart()</script> </ul> </nav>
2
0.125
1
1
f4e07b93ab81fd0a0dc59ec77fca596a2fcca738
froide/helper/form_utils.py
froide/helper/form_utils.py
import json from django.db import models class DjangoJSONEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, models.Model) and hasattr(obj, 'as_data'): return obj.as_data() return json.JSONEncoder.default(self, obj) class JSONMixin(object): def as_json(self): return json.dumps(self.as_data(), cls=DjangoJSONEncoder) def as_data(self): return { 'fields': { str(name): self.field_to_dict(name, field) for name, field in self.fields.items() }, 'errors': {f: e.get_json_data() for f, e in self.errors.items()}, 'nonFieldErrors': [e.get_json_data() for e in self.non_field_errors()] } def field_to_dict(self, name, field): return { "type": field.__class__.__name__, "widget_type": field.widget.__class__.__name__, "hidden": field.widget.is_hidden, "required": field.widget.is_required, "label": str(field.label), "help_text": str(field.help_text), "initial": self.get_initial_for_field(field, name), "placeholder": str(field.widget.attrs.get('placeholder', '')), "value": self[name].value() if self.is_bound else None }
import json from django.db import models class DjangoJSONEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, models.Model) and hasattr(obj, 'as_data'): return obj.as_data() return json.JSONEncoder.default(self, obj) def get_data(error): if isinstance(error, (dict, str)): return error return error.get_json_data() class JSONMixin(object): def as_json(self): return json.dumps(self.as_data(), cls=DjangoJSONEncoder) def as_data(self): return { 'fields': { str(name): self.field_to_dict(name, field) for name, field in self.fields.items() }, 'errors': {f: get_data(e) for f, e in self.errors.items()}, 'nonFieldErrors': [get_data(e) for e in self.non_field_errors()] } def field_to_dict(self, name, field): return { "type": field.__class__.__name__, "widget_type": field.widget.__class__.__name__, "hidden": field.widget.is_hidden, "required": field.widget.is_required, "label": str(field.label), "help_text": str(field.help_text), "initial": self.get_initial_for_field(field, name), "placeholder": str(field.widget.attrs.get('placeholder', '')), "value": self[name].value() if self.is_bound else None }
Fix serialization of form errors
Fix serialization of form errors
Python
mit
fin/froide,fin/froide,fin/froide,stefanw/froide,stefanw/froide,stefanw/froide,stefanw/froide,stefanw/froide,fin/froide
python
## Code Before: import json from django.db import models class DjangoJSONEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, models.Model) and hasattr(obj, 'as_data'): return obj.as_data() return json.JSONEncoder.default(self, obj) class JSONMixin(object): def as_json(self): return json.dumps(self.as_data(), cls=DjangoJSONEncoder) def as_data(self): return { 'fields': { str(name): self.field_to_dict(name, field) for name, field in self.fields.items() }, 'errors': {f: e.get_json_data() for f, e in self.errors.items()}, 'nonFieldErrors': [e.get_json_data() for e in self.non_field_errors()] } def field_to_dict(self, name, field): return { "type": field.__class__.__name__, "widget_type": field.widget.__class__.__name__, "hidden": field.widget.is_hidden, "required": field.widget.is_required, "label": str(field.label), "help_text": str(field.help_text), "initial": self.get_initial_for_field(field, name), "placeholder": str(field.widget.attrs.get('placeholder', '')), "value": self[name].value() if self.is_bound else None } ## Instruction: Fix serialization of form errors ## Code After: import json from django.db import models class DjangoJSONEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, models.Model) and hasattr(obj, 'as_data'): return obj.as_data() return json.JSONEncoder.default(self, obj) def get_data(error): if isinstance(error, (dict, str)): return error return error.get_json_data() class JSONMixin(object): def as_json(self): return json.dumps(self.as_data(), cls=DjangoJSONEncoder) def as_data(self): return { 'fields': { str(name): self.field_to_dict(name, field) for name, field in self.fields.items() }, 'errors': {f: get_data(e) for f, e in self.errors.items()}, 'nonFieldErrors': [get_data(e) for e in self.non_field_errors()] } def field_to_dict(self, name, field): return { "type": field.__class__.__name__, "widget_type": field.widget.__class__.__name__, "hidden": field.widget.is_hidden, "required": field.widget.is_required, "label": str(field.label), "help_text": str(field.help_text), "initial": self.get_initial_for_field(field, name), "placeholder": str(field.widget.attrs.get('placeholder', '')), "value": self[name].value() if self.is_bound else None }
import json from django.db import models class DjangoJSONEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, models.Model) and hasattr(obj, 'as_data'): return obj.as_data() return json.JSONEncoder.default(self, obj) + def get_data(error): + if isinstance(error, (dict, str)): + return error + return error.get_json_data() + + class JSONMixin(object): def as_json(self): return json.dumps(self.as_data(), cls=DjangoJSONEncoder) def as_data(self): return { 'fields': { str(name): self.field_to_dict(name, field) for name, field in self.fields.items() }, - 'errors': {f: e.get_json_data() for f, e in self.errors.items()}, ? -- ----- + 'errors': {f: get_data(e) for f, e in self.errors.items()}, ? + - 'nonFieldErrors': [e.get_json_data() for e in self.non_field_errors()] ? -- ----- + 'nonFieldErrors': [get_data(e) for e in self.non_field_errors()] ? + } def field_to_dict(self, name, field): return { "type": field.__class__.__name__, "widget_type": field.widget.__class__.__name__, "hidden": field.widget.is_hidden, "required": field.widget.is_required, "label": str(field.label), "help_text": str(field.help_text), "initial": self.get_initial_for_field(field, name), "placeholder": str(field.widget.attrs.get('placeholder', '')), "value": self[name].value() if self.is_bound else None }
10
0.27027
8
2
76b564a26d9102a041d1dccd52b1636e2f18e6a9
.drone.yml
.drone.yml
clone: git: image: plugins/git depth: 1 pipeline: signed-off-check: image: nextcloudci/php7.0:php7.0-2 environment: - APP_NAME=gallery - CORE_BRANCH=master - DB=sqlite commands: - wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh - bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB - cd ../server - php ./build/signed-off-checker.php when: matrix: TESTS: signed-off-check matrix: include: - TESTS: signed-off-check branches: [ master, stable* ]
clone: git: image: plugins/git depth: 1 pipeline: signed-off-check: image: nextcloudci/php7.0:php7.0-2 environment: - APP_NAME=gallery - CORE_BRANCH=master - DB=sqlite commands: - wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh - bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB - cd ../server - php ./build/signed-off-checker.php secrets: [ github_token ] when: matrix: TESTS: signed-off-check matrix: include: - TESTS: signed-off-check branches: [ master, stable* ]
Add auth token to GitHub requests
Add auth token to GitHub requests Signed-off-by: Daniel Calviño Sánchez <bd7629e975cc0e00ea7cda4ab6a120f2ee42ac1b@gmail.com>
YAML
agpl-3.0
desaintmartin/gallery,desaintmartin/gallery,desaintmartin/gallery
yaml
## Code Before: clone: git: image: plugins/git depth: 1 pipeline: signed-off-check: image: nextcloudci/php7.0:php7.0-2 environment: - APP_NAME=gallery - CORE_BRANCH=master - DB=sqlite commands: - wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh - bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB - cd ../server - php ./build/signed-off-checker.php when: matrix: TESTS: signed-off-check matrix: include: - TESTS: signed-off-check branches: [ master, stable* ] ## Instruction: Add auth token to GitHub requests Signed-off-by: Daniel Calviño Sánchez <bd7629e975cc0e00ea7cda4ab6a120f2ee42ac1b@gmail.com> ## Code After: clone: git: image: plugins/git depth: 1 pipeline: signed-off-check: image: nextcloudci/php7.0:php7.0-2 environment: - APP_NAME=gallery - CORE_BRANCH=master - DB=sqlite commands: - wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh - bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB - cd ../server - php ./build/signed-off-checker.php secrets: [ github_token ] when: matrix: TESTS: signed-off-check matrix: include: - TESTS: signed-off-check branches: [ master, stable* ]
clone: git: image: plugins/git depth: 1 pipeline: signed-off-check: image: nextcloudci/php7.0:php7.0-2 environment: - APP_NAME=gallery - CORE_BRANCH=master - DB=sqlite commands: - wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh - bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB - cd ../server - php ./build/signed-off-checker.php + secrets: [ github_token ] when: matrix: TESTS: signed-off-check matrix: include: - TESTS: signed-off-check branches: [ master, stable* ]
1
0.04
1
0
21fb32e038627c0b12094558c0eb06ba679b4278
lib/dataServiceController.js
lib/dataServiceController.js
'use strict'; var assert = require('assert') var dataServiceFactory = require('./dataService') function createDataServices(config) { var dataServices = {} config.forEach((dsConfig) => { dataServices[dsConfig.name] = dataServiceFactory(dsConfig) }) return dataServices } /** * DataService controller. * Provides a getDataServiceForLayer method to take a layer config and * return a predefined DataService */ class DataServiceController { /** * @constructor * @param {object} config */ constructor(config) { this.config = config this.dataServices = createDataServices(config) } /** * Convenience method to retrieve a dataSource for the given layerConfig definition * Also verifies that the layer references a known dataSource */ getDataServiceForLayer(layerConfig) { assert.ok(!!this.dataServices[layerConfig.dataSource], 'Layer ' + layerConfig.name + ' specifies a dataSource that doesn\'t exist') return this.dataServices[layerConfig.dataSource] } } /** * Module entry point. Validates config object input using asserts * @param {object} config * @return {DataServiceController} */ module.exports = (config) => { return new DataServiceController(config) }
'use strict'; var assert = require('assert') var dataServiceFactory = require('./dataService') function createDataServices(config) { var dataServices = {} config.forEach((dsConfig) => { dataServices[dsConfig.name] = dataServiceFactory(dsConfig) }) return dataServices } /** * DataService controller. * Provides a getDataServiceForLayer method to take a layer config and * return a predefined DataService */ class DataServiceController { /** * @constructor * @param {object} config */ constructor(config) { this.config = config || [] this.dataServices = createDataServices(this.config) } /** * Convenience method to retrieve a dataSource for the given layerConfig definition * Also verifies that the layer references a known dataSource */ getDataServiceForLayer(layerConfig) { assert.ok(!!this.dataServices[layerConfig.dataSource], 'Layer `' + layerConfig.name + '` specifies a dataSource that doesn\'t exist') return this.dataServices[layerConfig.dataSource] } } /** * Module entry point. Validates config object input using asserts * @param {object} config * @return {DataServiceController} */ module.exports = (config) => { return new DataServiceController(config) }
Fix default object and validation
Fix default object and validation
JavaScript
mit
mediasuitenz/mappy,mediasuitenz/mappy
javascript
## Code Before: 'use strict'; var assert = require('assert') var dataServiceFactory = require('./dataService') function createDataServices(config) { var dataServices = {} config.forEach((dsConfig) => { dataServices[dsConfig.name] = dataServiceFactory(dsConfig) }) return dataServices } /** * DataService controller. * Provides a getDataServiceForLayer method to take a layer config and * return a predefined DataService */ class DataServiceController { /** * @constructor * @param {object} config */ constructor(config) { this.config = config this.dataServices = createDataServices(config) } /** * Convenience method to retrieve a dataSource for the given layerConfig definition * Also verifies that the layer references a known dataSource */ getDataServiceForLayer(layerConfig) { assert.ok(!!this.dataServices[layerConfig.dataSource], 'Layer ' + layerConfig.name + ' specifies a dataSource that doesn\'t exist') return this.dataServices[layerConfig.dataSource] } } /** * Module entry point. Validates config object input using asserts * @param {object} config * @return {DataServiceController} */ module.exports = (config) => { return new DataServiceController(config) } ## Instruction: Fix default object and validation ## Code After: 'use strict'; var assert = require('assert') var dataServiceFactory = require('./dataService') function createDataServices(config) { var dataServices = {} config.forEach((dsConfig) => { dataServices[dsConfig.name] = dataServiceFactory(dsConfig) }) return dataServices } /** * DataService controller. * Provides a getDataServiceForLayer method to take a layer config and * return a predefined DataService */ class DataServiceController { /** * @constructor * @param {object} config */ constructor(config) { this.config = config || [] this.dataServices = createDataServices(this.config) } /** * Convenience method to retrieve a dataSource for the given layerConfig definition * Also verifies that the layer references a known dataSource */ getDataServiceForLayer(layerConfig) { assert.ok(!!this.dataServices[layerConfig.dataSource], 'Layer `' + layerConfig.name + '` specifies a dataSource that doesn\'t exist') return this.dataServices[layerConfig.dataSource] } } /** * Module entry point. Validates config object input using asserts * @param {object} config * @return {DataServiceController} */ module.exports = (config) => { return new DataServiceController(config) }
'use strict'; var assert = require('assert') var dataServiceFactory = require('./dataService') function createDataServices(config) { var dataServices = {} config.forEach((dsConfig) => { dataServices[dsConfig.name] = dataServiceFactory(dsConfig) }) return dataServices } /** * DataService controller. * Provides a getDataServiceForLayer method to take a layer config and * return a predefined DataService */ class DataServiceController { /** * @constructor * @param {object} config */ constructor(config) { - this.config = config + this.config = config || [] ? ++++++ - this.dataServices = createDataServices(config) + this.dataServices = createDataServices(this.config) ? +++++ } /** * Convenience method to retrieve a dataSource for the given layerConfig definition * Also verifies that the layer references a known dataSource */ getDataServiceForLayer(layerConfig) { - assert.ok(!!this.dataServices[layerConfig.dataSource], 'Layer ' + layerConfig.name + ' specifies a dataSource that doesn\'t exist') + assert.ok(!!this.dataServices[layerConfig.dataSource], 'Layer `' + layerConfig.name + '` specifies a dataSource that doesn\'t exist') ? + + return this.dataServices[layerConfig.dataSource] } } /** * Module entry point. Validates config object input using asserts * @param {object} config * @return {DataServiceController} */ module.exports = (config) => { return new DataServiceController(config) }
6
0.113208
3
3
e06410faf90f9beff1fbf9711be601416e9d95ac
tests/dummy/app/templates/snippets/the-nav-2.hbs
tests/dummy/app/templates/snippets/the-nav-2.hbs
{{#power-calendar class="demo-calendar-small" center=month onCenterChange=(action (mut month) value="date") as |calendar|}} <nav class="ember-power-calendar-nav"> <button class="ember-power-calendar-nav-control" onclick={{action calendar.actions.moveCenter -12 'month'}}>«</button> <button class="ember-power-calendar-nav-control" onclick={{action calendar.actions.moveCenter -1 'month'}}>‹</button> <div class="ember-power-calendar-nav-title"> {{moment-format calendar.center 'MMMM YYYY'}} </div> <button class="ember-power-calendar-nav-control" onclick={{action calendar.actions.moveCenter 1 'month'}}>›</button> <button class="ember-power-calendar-nav-control" onclick={{action calendar.actions.moveCenter 12 'month'}}>»</button> </nav> {{calendar.days}} {{/power-calendar}}
{{#power-calendar class="demo-calendar-small" center=month onCenterChange=(action (mut month) value="date") as |calendar|}} <nav class="ember-power-calendar-nav"> <button type="button" class="ember-power-calendar-nav-control" onclick={{action calendar.actions.moveCenter -12 'month'}}>«</button> <button type="button" class="ember-power-calendar-nav-control" onclick={{action calendar.actions.moveCenter -1 'month'}}>‹</button> <div class="ember-power-calendar-nav-title"> {{moment-format calendar.center 'MMMM YYYY'}} </div> <button class="ember-power-calendar-nav-control" onclick={{action calendar.actions.moveCenter 1 'month'}}>›</button> <button class="ember-power-calendar-nav-control" onclick={{action calendar.actions.moveCenter 12 'month'}}>»</button> </nav> {{calendar.days}} {{/power-calendar}}
Set button type in nav snippet
Set button type in nav snippet
Handlebars
mit
cibernox/ember-power-calendar,cibernox/ember-power-calendar,cibernox/ember-power-calendar
handlebars
## Code Before: {{#power-calendar class="demo-calendar-small" center=month onCenterChange=(action (mut month) value="date") as |calendar|}} <nav class="ember-power-calendar-nav"> <button class="ember-power-calendar-nav-control" onclick={{action calendar.actions.moveCenter -12 'month'}}>«</button> <button class="ember-power-calendar-nav-control" onclick={{action calendar.actions.moveCenter -1 'month'}}>‹</button> <div class="ember-power-calendar-nav-title"> {{moment-format calendar.center 'MMMM YYYY'}} </div> <button class="ember-power-calendar-nav-control" onclick={{action calendar.actions.moveCenter 1 'month'}}>›</button> <button class="ember-power-calendar-nav-control" onclick={{action calendar.actions.moveCenter 12 'month'}}>»</button> </nav> {{calendar.days}} {{/power-calendar}} ## Instruction: Set button type in nav snippet ## Code After: {{#power-calendar class="demo-calendar-small" center=month onCenterChange=(action (mut month) value="date") as |calendar|}} <nav class="ember-power-calendar-nav"> <button type="button" class="ember-power-calendar-nav-control" onclick={{action calendar.actions.moveCenter -12 'month'}}>«</button> <button type="button" class="ember-power-calendar-nav-control" onclick={{action calendar.actions.moveCenter -1 'month'}}>‹</button> <div class="ember-power-calendar-nav-title"> {{moment-format calendar.center 'MMMM YYYY'}} </div> <button class="ember-power-calendar-nav-control" onclick={{action calendar.actions.moveCenter 1 'month'}}>›</button> <button class="ember-power-calendar-nav-control" onclick={{action calendar.actions.moveCenter 12 'month'}}>»</button> </nav> {{calendar.days}} {{/power-calendar}}
{{#power-calendar class="demo-calendar-small" center=month onCenterChange=(action (mut month) value="date") as |calendar|}} <nav class="ember-power-calendar-nav"> - <button class="ember-power-calendar-nav-control" onclick={{action calendar.actions.moveCenter -12 'month'}}>«</button> + <button type="button" class="ember-power-calendar-nav-control" onclick={{action calendar.actions.moveCenter -12 'month'}}>«</button> ? ++++++++++++++ - <button class="ember-power-calendar-nav-control" onclick={{action calendar.actions.moveCenter -1 'month'}}>‹</button> + <button type="button" class="ember-power-calendar-nav-control" onclick={{action calendar.actions.moveCenter -1 'month'}}>‹</button> ? ++++++++++++++ <div class="ember-power-calendar-nav-title"> {{moment-format calendar.center 'MMMM YYYY'}} </div> <button class="ember-power-calendar-nav-control" onclick={{action calendar.actions.moveCenter 1 'month'}}>›</button> <button class="ember-power-calendar-nav-control" onclick={{action calendar.actions.moveCenter 12 'month'}}>»</button> </nav> {{calendar.days}} {{/power-calendar}}
4
0.25
2
2
f47f08b947acf7ea99abf6a75ed66115c8f0d009
web/__mocks__/firebase/app.js
web/__mocks__/firebase/app.js
/* eslint-env jest */ const firebaseApp = jest.genMockFromModule('firebase') // By default, return no user. var firebaseUser = null firebaseApp.auth = jest.fn(() => ({ onAuthStateChanged: jest.fn(callback => { // Return the Firebase user. callback(firebaseUser) }), signOut: jest.fn() })) firebaseApp.__setFirebaseUser = (user) => { firebaseUser = user } module.exports = firebaseApp
/* eslint-env jest */ const firebaseApp = jest.genMockFromModule('firebase') // By default, return no user. var firebaseUser = null const FirebaseAuthMock = () => { return { onAuthStateChanged: jest.fn(callback => { // Return the Firebase user. callback(firebaseUser) }), signOut: jest.fn() } } FirebaseAuthMock.EmailAuthProvider = { PROVIDER_ID: 'password' } FirebaseAuthMock.GoogleAuthProvider = { PROVIDER_ID: 'google.com' } FirebaseAuthMock.FacebookAuthProvider = { PROVIDER_ID: 'facebook.com' } firebaseApp.auth = FirebaseAuthMock firebaseApp.__setFirebaseUser = (user) => { firebaseUser = user } module.exports = firebaseApp
Fix mock for testing FirebaseAuthenticationUI component
Fix mock for testing FirebaseAuthenticationUI component
JavaScript
mpl-2.0
gladly-team/tab,gladly-team/tab,gladly-team/tab
javascript
## Code Before: /* eslint-env jest */ const firebaseApp = jest.genMockFromModule('firebase') // By default, return no user. var firebaseUser = null firebaseApp.auth = jest.fn(() => ({ onAuthStateChanged: jest.fn(callback => { // Return the Firebase user. callback(firebaseUser) }), signOut: jest.fn() })) firebaseApp.__setFirebaseUser = (user) => { firebaseUser = user } module.exports = firebaseApp ## Instruction: Fix mock for testing FirebaseAuthenticationUI component ## Code After: /* eslint-env jest */ const firebaseApp = jest.genMockFromModule('firebase') // By default, return no user. var firebaseUser = null const FirebaseAuthMock = () => { return { onAuthStateChanged: jest.fn(callback => { // Return the Firebase user. callback(firebaseUser) }), signOut: jest.fn() } } FirebaseAuthMock.EmailAuthProvider = { PROVIDER_ID: 'password' } FirebaseAuthMock.GoogleAuthProvider = { PROVIDER_ID: 'google.com' } FirebaseAuthMock.FacebookAuthProvider = { PROVIDER_ID: 'facebook.com' } firebaseApp.auth = FirebaseAuthMock firebaseApp.__setFirebaseUser = (user) => { firebaseUser = user } module.exports = firebaseApp
/* eslint-env jest */ const firebaseApp = jest.genMockFromModule('firebase') // By default, return no user. var firebaseUser = null - firebaseApp.auth = jest.fn(() => ({ + const FirebaseAuthMock = () => { + return { - onAuthStateChanged: jest.fn(callback => { + onAuthStateChanged: jest.fn(callback => { ? ++ - // Return the Firebase user. + // Return the Firebase user. ? ++ - callback(firebaseUser) + callback(firebaseUser) ? ++ - }), + }), ? ++ - signOut: jest.fn() + signOut: jest.fn() ? ++ - })) + } + } + + FirebaseAuthMock.EmailAuthProvider = { + PROVIDER_ID: 'password' + } + + FirebaseAuthMock.GoogleAuthProvider = { + PROVIDER_ID: 'google.com' + } + + FirebaseAuthMock.FacebookAuthProvider = { + PROVIDER_ID: 'facebook.com' + } + + firebaseApp.auth = FirebaseAuthMock firebaseApp.__setFirebaseUser = (user) => { firebaseUser = user } module.exports = firebaseApp
30
1.5
23
7
c0136099662f086b4b4efc2a53230c7d10eeedf8
lib/strut/report_builder.rb
lib/strut/report_builder.rb
require "strut/report" module Strut class ReportBuilder def build(responses, document) report = Report.new responses.each do |response| handle_response(response, document, report) end report end def handle_response(response, document, report) command_id, result = *response if command_id == "error" report.add_fail_for_line(1, result.to_s) else metadata = document.metadata_for_command_id(command_id) if metadata process_result(result, metadata, report) else report.add_fail_for_line(1, "unexpected response from Slim: #{response.inspect}") end end end def process_result(result, metadata, report) if exception_message = exceptional_result?(result) report.add_exception_for_line(metadata.line, exception_message) elsif failed_result?(result, metadata) fail_message = "Expected #{metadata.expected_value} but got #{result}" report.add_fail_for_line(metadata.line, fail_message) else report.add_ok_for_line(metadata.line) end end def exceptional_result?(result) result =~ /^__EXCEPTION__:message:(.+)/ ? $1 : nil end def failed_result?(result, metadata) metadata.expected_value && metadata.expected_value != result end end end
require "strut/report" module Strut class ReportBuilder def build(responses, document) report = Report.new responses.each do |response| handle_response(response, document, report) end report end def handle_response(response, document, report) command_id, result = *response if command_id == "error" report.add_fail_for_line(1, result.to_s) else metadata = document.metadata_for_command_id(command_id) if metadata process_result(result, metadata, report) else report.add_fail_for_line(1, "unexpected response from Slim: #{response.inspect}") end end end def process_result(result, metadata, report) if exception_message = exceptional_result?(result) report.add_exception_for_line(metadata.line, exception_message) elsif failed_result?(result, metadata) fail_message = "Expected #{metadata.expected_value} but got #{result}" report.add_fail_for_line(metadata.line, fail_message) else report.add_ok_for_line(metadata.line) end end def exceptional_result?(result) result =~ /^__EXCEPTION__:message:(.+)/ ? $1 : nil end def failed_result?(result, metadata) metadata.expected_value && metadata.expected_value.to_s != result.to_s end end end
Convert expected and returned values to strings before comparison so we can check bools, ints, etc.
Convert expected and returned values to strings before comparison so we can check bools, ints, etc.
Ruby
mit
dcutting/strut,dcutting/strut
ruby
## Code Before: require "strut/report" module Strut class ReportBuilder def build(responses, document) report = Report.new responses.each do |response| handle_response(response, document, report) end report end def handle_response(response, document, report) command_id, result = *response if command_id == "error" report.add_fail_for_line(1, result.to_s) else metadata = document.metadata_for_command_id(command_id) if metadata process_result(result, metadata, report) else report.add_fail_for_line(1, "unexpected response from Slim: #{response.inspect}") end end end def process_result(result, metadata, report) if exception_message = exceptional_result?(result) report.add_exception_for_line(metadata.line, exception_message) elsif failed_result?(result, metadata) fail_message = "Expected #{metadata.expected_value} but got #{result}" report.add_fail_for_line(metadata.line, fail_message) else report.add_ok_for_line(metadata.line) end end def exceptional_result?(result) result =~ /^__EXCEPTION__:message:(.+)/ ? $1 : nil end def failed_result?(result, metadata) metadata.expected_value && metadata.expected_value != result end end end ## Instruction: Convert expected and returned values to strings before comparison so we can check bools, ints, etc. ## Code After: require "strut/report" module Strut class ReportBuilder def build(responses, document) report = Report.new responses.each do |response| handle_response(response, document, report) end report end def handle_response(response, document, report) command_id, result = *response if command_id == "error" report.add_fail_for_line(1, result.to_s) else metadata = document.metadata_for_command_id(command_id) if metadata process_result(result, metadata, report) else report.add_fail_for_line(1, "unexpected response from Slim: #{response.inspect}") end end end def process_result(result, metadata, report) if exception_message = exceptional_result?(result) report.add_exception_for_line(metadata.line, exception_message) elsif failed_result?(result, metadata) fail_message = "Expected #{metadata.expected_value} but got #{result}" report.add_fail_for_line(metadata.line, fail_message) else report.add_ok_for_line(metadata.line) end end def exceptional_result?(result) result =~ /^__EXCEPTION__:message:(.+)/ ? $1 : nil end def failed_result?(result, metadata) metadata.expected_value && metadata.expected_value.to_s != result.to_s end end end
require "strut/report" module Strut class ReportBuilder def build(responses, document) report = Report.new responses.each do |response| handle_response(response, document, report) end report end def handle_response(response, document, report) command_id, result = *response if command_id == "error" report.add_fail_for_line(1, result.to_s) else metadata = document.metadata_for_command_id(command_id) if metadata process_result(result, metadata, report) else report.add_fail_for_line(1, "unexpected response from Slim: #{response.inspect}") end end end def process_result(result, metadata, report) if exception_message = exceptional_result?(result) report.add_exception_for_line(metadata.line, exception_message) elsif failed_result?(result, metadata) fail_message = "Expected #{metadata.expected_value} but got #{result}" report.add_fail_for_line(metadata.line, fail_message) else report.add_ok_for_line(metadata.line) end end def exceptional_result?(result) result =~ /^__EXCEPTION__:message:(.+)/ ? $1 : nil end def failed_result?(result, metadata) - metadata.expected_value && metadata.expected_value != result + metadata.expected_value && metadata.expected_value.to_s != result.to_s ? +++++ +++++ end end end
2
0.043478
1
1
5dc95f0731c183a1672aebed496b53d5581879e4
example/app.rb
example/app.rb
require 'sinatra' require 'vxod' require 'slim' require 'sass' require 'config_env' require 'mongoid' require 'omniauth' require 'omniauth-twitter' require 'omniauth-vkontakte' require 'omniauth-facebook' require 'omniauth-google-oauth2' require 'omniauth-github' require_relative 'config_env' require_relative 'config_app' helpers do def vxod @vxod = Vxod.api(self) end end get '/' do 'Hello please try protected page at <a id="secret" href="/secret">/secret</a>' end get '/secret' do vxod.required slim :secret end template :secret do %q( p | I am secret page for strong = vxod.user.email p: a id='logout' href='/logout' Logout ) end
require 'sinatra' require 'vxod' require 'slim' require 'sass' require 'config_env' require 'mongoid' require 'omniauth' require 'omniauth-twitter' require 'omniauth-vkontakte' require 'omniauth-facebook' require 'omniauth-google-oauth2' require 'omniauth-github' load "#{__dir__}/config_env" require_relative 'config_app' helpers do def vxod @vxod = Vxod.api(self) end end get '/' do 'Hello please try protected page at <a id="secret" href="/secret">/secret</a>' end get '/secret' do vxod.required slim :secret end template :secret do %q( p | I am secret page for strong = vxod.user.email p: a id='logout' href='/logout' Logout ) end
Prepare to CI Capybara.default_wait_time = 15
Prepare to CI Capybara.default_wait_time = 15
Ruby
mit
SergXIIIth/vxod
ruby
## Code Before: require 'sinatra' require 'vxod' require 'slim' require 'sass' require 'config_env' require 'mongoid' require 'omniauth' require 'omniauth-twitter' require 'omniauth-vkontakte' require 'omniauth-facebook' require 'omniauth-google-oauth2' require 'omniauth-github' require_relative 'config_env' require_relative 'config_app' helpers do def vxod @vxod = Vxod.api(self) end end get '/' do 'Hello please try protected page at <a id="secret" href="/secret">/secret</a>' end get '/secret' do vxod.required slim :secret end template :secret do %q( p | I am secret page for strong = vxod.user.email p: a id='logout' href='/logout' Logout ) end ## Instruction: Prepare to CI Capybara.default_wait_time = 15 ## Code After: require 'sinatra' require 'vxod' require 'slim' require 'sass' require 'config_env' require 'mongoid' require 'omniauth' require 'omniauth-twitter' require 'omniauth-vkontakte' require 'omniauth-facebook' require 'omniauth-google-oauth2' require 'omniauth-github' load "#{__dir__}/config_env" require_relative 'config_app' helpers do def vxod @vxod = Vxod.api(self) end end get '/' do 'Hello please try protected page at <a id="secret" href="/secret">/secret</a>' end get '/secret' do vxod.required slim :secret end template :secret do %q( p | I am secret page for strong = vxod.user.email p: a id='logout' href='/logout' Logout ) end
require 'sinatra' require 'vxod' require 'slim' require 'sass' require 'config_env' require 'mongoid' require 'omniauth' require 'omniauth-twitter' require 'omniauth-vkontakte' require 'omniauth-facebook' require 'omniauth-google-oauth2' require 'omniauth-github' - require_relative 'config_env' + load "#{__dir__}/config_env" require_relative 'config_app' helpers do def vxod @vxod = Vxod.api(self) end end get '/' do 'Hello please try protected page at <a id="secret" href="/secret">/secret</a>' end get '/secret' do vxod.required slim :secret end template :secret do %q( p | I am secret page for strong = vxod.user.email p: a id='logout' href='/logout' Logout ) end
2
0.04878
1
1
394b2c9b9967d6e461013a2e539d9ff06b7ca69f
.travis.yml
.travis.yml
before_install: gem install bundler --pre bundler_args: --without production language: ruby rvm: - 2.0.0
--- before_install: gem install bundler --pre bundler_args: --without production language: ruby rvm: - 2.0.0 deploy: api_key: secure: |- Uyzc8wJa/E2mEh47Yxlv2robX8guaqS7QfeGi+30TfOFCJAK6m1rqCqJEU1y uVD6tmRdxnr/ZoVfrrWQssm/OAc3eDlpVr1AKMTgxSDQetzUCaJY3UD+zhyH C/9VYGK0KxbTpnYBQ6F2Vqv/k/QuNqugdsdED0xH8CKSQ1qv5MM= on: rvm: 2.0.0 provider: heroku
Add continuous deployment to Heroku
Add continuous deployment to Heroku
YAML
bsd-3-clause
codeforamerica/follow-all,BryanH/follow-all,BryanH/follow-all,codeforamerica/follow-all,jasnow/follow-all,jasnow/follow-all,jasnow/follow-all,codeforamerica/follow-all,BryanH/follow-all
yaml
## Code Before: before_install: gem install bundler --pre bundler_args: --without production language: ruby rvm: - 2.0.0 ## Instruction: Add continuous deployment to Heroku ## Code After: --- before_install: gem install bundler --pre bundler_args: --without production language: ruby rvm: - 2.0.0 deploy: api_key: secure: |- Uyzc8wJa/E2mEh47Yxlv2robX8guaqS7QfeGi+30TfOFCJAK6m1rqCqJEU1y uVD6tmRdxnr/ZoVfrrWQssm/OAc3eDlpVr1AKMTgxSDQetzUCaJY3UD+zhyH C/9VYGK0KxbTpnYBQ6F2Vqv/k/QuNqugdsdED0xH8CKSQ1qv5MM= on: rvm: 2.0.0 provider: heroku
+ --- before_install: gem install bundler --pre bundler_args: --without production language: ruby rvm: - - 2.0.0 ? -- + - 2.0.0 + deploy: + api_key: + secure: |- + Uyzc8wJa/E2mEh47Yxlv2robX8guaqS7QfeGi+30TfOFCJAK6m1rqCqJEU1y + uVD6tmRdxnr/ZoVfrrWQssm/OAc3eDlpVr1AKMTgxSDQetzUCaJY3UD+zhyH + C/9VYGK0KxbTpnYBQ6F2Vqv/k/QuNqugdsdED0xH8CKSQ1qv5MM= + on: + rvm: 2.0.0 + provider: heroku
12
2.4
11
1
f478624ba029fe8da9d167885a90c6f0350db2b9
bin/inc_version.rb
bin/inc_version.rb
def shell(command) puts command stdout = `#{command}` error_code = $?.exitstatus if error_code != 0 puts stdout raise "#{command} exit with error #{error_code}" end stdout end # see http://stackoverflow.com/a/3545363 mvn_command = "mvn org.apache.maven.plugins:maven-help-plugin:evaluate -Dexpression=project.version" mvn_stdout = shell(mvn_command) version_pattern = /^(\d+.*-)(\d)$/ if mvn_stdout !~ version_pattern puts mvn_stdout raise "version number #{version_pattern} not found" end puts "found version #{$1}#{$2}" version = $1 build = $2.to_i new_build = (build + 1).to_s new_version = version + new_build puts "will set new version #{new_version}" mvn_command = "mvn versions:set -DnewVersion=#{new_version}" shell(mvn_command)
def shell(command) puts(command) stdout = `#{command}` error_code = $?.exitstatus if error_code != 0 puts(stdout) raise("#{command} exit with error #{error_code}") end stdout end # see http://stackoverflow.com/a/3545363 mvn_command = "mvn org.apache.maven.plugins:maven-help-plugin:evaluate -Dexpression=project.version" mvn_stdout = shell(mvn_command) version_pattern = /^(\d+.*-)(\d)$/ if mvn_stdout !~ version_pattern puts mvn_stdout raise("version number #{version_pattern} not found") end puts("found version #{$1}#{$2}") version = $1 build = $2.to_i new_build = (build + 1).to_s new_version = version + new_build puts("will set new version #{new_version}") mvn_command = "mvn versions:set -DnewVersion=#{new_version}" shell(mvn_command)
Remove poetry mode with function calls.
Remove poetry mode with function calls.
Ruby
bsd-2-clause
Hans-and-Peter/game-geography,Hans-and-Peter/game-geography,Hans-and-Peter/game-geography
ruby
## Code Before: def shell(command) puts command stdout = `#{command}` error_code = $?.exitstatus if error_code != 0 puts stdout raise "#{command} exit with error #{error_code}" end stdout end # see http://stackoverflow.com/a/3545363 mvn_command = "mvn org.apache.maven.plugins:maven-help-plugin:evaluate -Dexpression=project.version" mvn_stdout = shell(mvn_command) version_pattern = /^(\d+.*-)(\d)$/ if mvn_stdout !~ version_pattern puts mvn_stdout raise "version number #{version_pattern} not found" end puts "found version #{$1}#{$2}" version = $1 build = $2.to_i new_build = (build + 1).to_s new_version = version + new_build puts "will set new version #{new_version}" mvn_command = "mvn versions:set -DnewVersion=#{new_version}" shell(mvn_command) ## Instruction: Remove poetry mode with function calls. ## Code After: def shell(command) puts(command) stdout = `#{command}` error_code = $?.exitstatus if error_code != 0 puts(stdout) raise("#{command} exit with error #{error_code}") end stdout end # see http://stackoverflow.com/a/3545363 mvn_command = "mvn org.apache.maven.plugins:maven-help-plugin:evaluate -Dexpression=project.version" mvn_stdout = shell(mvn_command) version_pattern = /^(\d+.*-)(\d)$/ if mvn_stdout !~ version_pattern puts mvn_stdout raise("version number #{version_pattern} not found") end puts("found version #{$1}#{$2}") version = $1 build = $2.to_i new_build = (build + 1).to_s new_version = version + new_build puts("will set new version #{new_version}") mvn_command = "mvn versions:set -DnewVersion=#{new_version}" shell(mvn_command)
def shell(command) - puts command ? ^ + puts(command) ? ^ + stdout = `#{command}` error_code = $?.exitstatus if error_code != 0 - puts stdout ? ^ + puts(stdout) ? ^ + - raise "#{command} exit with error #{error_code}" ? ^ + raise("#{command} exit with error #{error_code}") ? ^ + end stdout end # see http://stackoverflow.com/a/3545363 mvn_command = "mvn org.apache.maven.plugins:maven-help-plugin:evaluate -Dexpression=project.version" mvn_stdout = shell(mvn_command) version_pattern = /^(\d+.*-)(\d)$/ if mvn_stdout !~ version_pattern puts mvn_stdout - raise "version number #{version_pattern} not found" ? ^ + raise("version number #{version_pattern} not found") ? ^ + end - puts "found version #{$1}#{$2}" ? ^ + puts("found version #{$1}#{$2}") ? ^ + version = $1 build = $2.to_i new_build = (build + 1).to_s new_version = version + new_build - puts "will set new version #{new_version}" ? ^ + puts("will set new version #{new_version}") ? ^ + mvn_command = "mvn versions:set -DnewVersion=#{new_version}" shell(mvn_command)
12
0.363636
6
6
74983cc059bc3480331b0815240c579b0b4517fc
bluebottle/assignments/filters.py
bluebottle/assignments/filters.py
from django.db.models import Q from rest_framework_json_api.django_filters import DjangoFilterBackend from bluebottle.assignments.transitions import ApplicantTransitions class ApplicantListFilter(DjangoFilterBackend): """ Filter that shows all applicant if user is owner, otherwise only show accepted applicants. """ def filter_queryset(self, request, queryset, view): if request.user.is_authenticated(): queryset = queryset.filter( Q(user=request.user) | Q(activity__owner=request.user) | Q(status__in=[ ApplicantTransitions.values.new, ApplicantTransitions.values.succeeded ]) ) else: queryset = queryset.filter(status__in=[ ApplicantTransitions.values.new, ApplicantTransitions.values.succeeded ]) return super(ApplicantListFilter, self).filter_queryset(request, queryset, view)
from django.db.models import Q from rest_framework_json_api.django_filters import DjangoFilterBackend from bluebottle.assignments.transitions import ApplicantTransitions class ApplicantListFilter(DjangoFilterBackend): """ Filter that shows all applicant if user is owner, otherwise only show accepted applicants. """ def filter_queryset(self, request, queryset, view): if request.user.is_authenticated(): queryset = queryset.filter( Q(user=request.user) | Q(activity__owner=request.user) | Q(activity__initiative__activity_manager=request.user) | Q(status__in=[ ApplicantTransitions.values.active, ApplicantTransitions.values.accepted, ApplicantTransitions.values.succeeded ]) ) else: queryset = queryset.filter(status__in=[ ApplicantTransitions.values.new, ApplicantTransitions.values.succeeded ]) return super(ApplicantListFilter, self).filter_queryset(request, queryset, view)
Tweak filtering of applicants on assignment
Tweak filtering of applicants on assignment
Python
bsd-3-clause
onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle
python
## Code Before: from django.db.models import Q from rest_framework_json_api.django_filters import DjangoFilterBackend from bluebottle.assignments.transitions import ApplicantTransitions class ApplicantListFilter(DjangoFilterBackend): """ Filter that shows all applicant if user is owner, otherwise only show accepted applicants. """ def filter_queryset(self, request, queryset, view): if request.user.is_authenticated(): queryset = queryset.filter( Q(user=request.user) | Q(activity__owner=request.user) | Q(status__in=[ ApplicantTransitions.values.new, ApplicantTransitions.values.succeeded ]) ) else: queryset = queryset.filter(status__in=[ ApplicantTransitions.values.new, ApplicantTransitions.values.succeeded ]) return super(ApplicantListFilter, self).filter_queryset(request, queryset, view) ## Instruction: Tweak filtering of applicants on assignment ## Code After: from django.db.models import Q from rest_framework_json_api.django_filters import DjangoFilterBackend from bluebottle.assignments.transitions import ApplicantTransitions class ApplicantListFilter(DjangoFilterBackend): """ Filter that shows all applicant if user is owner, otherwise only show accepted applicants. """ def filter_queryset(self, request, queryset, view): if request.user.is_authenticated(): queryset = queryset.filter( Q(user=request.user) | Q(activity__owner=request.user) | Q(activity__initiative__activity_manager=request.user) | Q(status__in=[ ApplicantTransitions.values.active, ApplicantTransitions.values.accepted, ApplicantTransitions.values.succeeded ]) ) else: queryset = queryset.filter(status__in=[ ApplicantTransitions.values.new, ApplicantTransitions.values.succeeded ]) return super(ApplicantListFilter, self).filter_queryset(request, queryset, view)
from django.db.models import Q from rest_framework_json_api.django_filters import DjangoFilterBackend from bluebottle.assignments.transitions import ApplicantTransitions class ApplicantListFilter(DjangoFilterBackend): """ Filter that shows all applicant if user is owner, otherwise only show accepted applicants. """ def filter_queryset(self, request, queryset, view): if request.user.is_authenticated(): queryset = queryset.filter( Q(user=request.user) | Q(activity__owner=request.user) | + Q(activity__initiative__activity_manager=request.user) | Q(status__in=[ - ApplicantTransitions.values.new, ? ^ - + ApplicantTransitions.values.active, ? ^^^^^ + ApplicantTransitions.values.accepted, ApplicantTransitions.values.succeeded ]) ) else: queryset = queryset.filter(status__in=[ ApplicantTransitions.values.new, ApplicantTransitions.values.succeeded ]) return super(ApplicantListFilter, self).filter_queryset(request, queryset, view)
4
0.142857
3
1
5761364149b3171521cb4f72f591dc5f5cbd77d6
temp-sensor02/main.py
temp-sensor02/main.py
from machine import Pin from ds18x20 import DS18X20 import onewire import time import machine import ujson import urequests def posttocloud(temperature): keystext = open("sparkfun_keys.json").read() keys = ujson.loads(keystext) url = keys['inputUrl'] + "?private_key=" + keys['privateKey'] + "&temp=" + str(temperature) #data = {'temp':temperature} #data['private_key'] = keys['privateKey'] #print (keys['inputUrl']) #print(keys['privateKey']) #datajson = ujson.dumps(data) #print (datajson) resp = urequests.request("POST", url) print (resp.text) while True: p = Pin(2) # Data Line is on GPIO2 aka D4 ow = onewire.OneWire(p) ds = DS18X20(ow) lstrom = ds.scan() #Assuming we have only 1 device connected rom = lstrom[0] ds.convert_temp() time.sleep_ms(750) temperature = round(float(ds.read_temp(rom)),1) #print("Temperature: {:02.1f}".format(temperature)) posttocloud(temperature) time.sleep(10)
from machine import Pin from ds18x20 import DS18X20 import onewire import time import ujson import urequests def posttocloud(temperature): keystext = open("sparkfun_keys.json").read() keys = ujson.loads(keystext) params = {} params['temp'] = temperature params['private_key'] = keys['privateKey'] #data.sparkfun doesn't support putting data into the POST Body. #We had to add the data to the query string #Copied the Dirty hack from #https://github.com/matze/python-phant/blob/24edb12a449b87700a4f736e43a5415b1d021823/phant/__init__.py payload_str = "&".join("%s=%s" % (k, v) for k, v in params.items()) url = keys['inputUrl'] + "?" + payload_str resp = urequests.request("POST", url) print (resp.text) while True: p = Pin(2) # Data Line is on GPIO2 aka D4 ow = onewire.OneWire(p) ds = DS18X20(ow) lstrom = ds.scan() #Assuming we have only 1 device connected rom = lstrom[0] ds.convert_temp() time.sleep_ms(750) temperature = round(float(ds.read_temp(rom)),1) #print("Temperature: {:02.1f}".format(temperature)) posttocloud(temperature) time.sleep(10)
Build a query string with params in a dictionary and append it to the URL. Makes the code readale. Remove commented code
Build a query string with params in a dictionary and append it to the URL. Makes the code readale. Remove commented code
Python
mit
fuzzyhandle/esp8266hangout,fuzzyhandle/esp8266hangout,fuzzyhandle/esp8266hangout
python
## Code Before: from machine import Pin from ds18x20 import DS18X20 import onewire import time import machine import ujson import urequests def posttocloud(temperature): keystext = open("sparkfun_keys.json").read() keys = ujson.loads(keystext) url = keys['inputUrl'] + "?private_key=" + keys['privateKey'] + "&temp=" + str(temperature) #data = {'temp':temperature} #data['private_key'] = keys['privateKey'] #print (keys['inputUrl']) #print(keys['privateKey']) #datajson = ujson.dumps(data) #print (datajson) resp = urequests.request("POST", url) print (resp.text) while True: p = Pin(2) # Data Line is on GPIO2 aka D4 ow = onewire.OneWire(p) ds = DS18X20(ow) lstrom = ds.scan() #Assuming we have only 1 device connected rom = lstrom[0] ds.convert_temp() time.sleep_ms(750) temperature = round(float(ds.read_temp(rom)),1) #print("Temperature: {:02.1f}".format(temperature)) posttocloud(temperature) time.sleep(10) ## Instruction: Build a query string with params in a dictionary and append it to the URL. Makes the code readale. Remove commented code ## Code After: from machine import Pin from ds18x20 import DS18X20 import onewire import time import ujson import urequests def posttocloud(temperature): keystext = open("sparkfun_keys.json").read() keys = ujson.loads(keystext) params = {} params['temp'] = temperature params['private_key'] = keys['privateKey'] #data.sparkfun doesn't support putting data into the POST Body. #We had to add the data to the query string #Copied the Dirty hack from #https://github.com/matze/python-phant/blob/24edb12a449b87700a4f736e43a5415b1d021823/phant/__init__.py payload_str = "&".join("%s=%s" % (k, v) for k, v in params.items()) url = keys['inputUrl'] + "?" + payload_str resp = urequests.request("POST", url) print (resp.text) while True: p = Pin(2) # Data Line is on GPIO2 aka D4 ow = onewire.OneWire(p) ds = DS18X20(ow) lstrom = ds.scan() #Assuming we have only 1 device connected rom = lstrom[0] ds.convert_temp() time.sleep_ms(750) temperature = round(float(ds.read_temp(rom)),1) #print("Temperature: {:02.1f}".format(temperature)) posttocloud(temperature) time.sleep(10)
from machine import Pin from ds18x20 import DS18X20 import onewire import time - import machine import ujson import urequests def posttocloud(temperature): + keystext = open("sparkfun_keys.json").read() keys = ujson.loads(keystext) - url = keys['inputUrl'] + "?private_key=" + keys['privateKey'] + "&temp=" + str(temperature) - #data = {'temp':temperature} + params = {} + params['temp'] = temperature - #data['private_key'] = keys['privateKey'] ? ^^ ^ + params['private_key'] = keys['privateKey'] ? ^ ^ ++ - #print (keys['inputUrl']) - #print(keys['privateKey']) - #datajson = ujson.dumps(data) - #print (datajson) + + #data.sparkfun doesn't support putting data into the POST Body. + #We had to add the data to the query string + #Copied the Dirty hack from + #https://github.com/matze/python-phant/blob/24edb12a449b87700a4f736e43a5415b1d021823/phant/__init__.py + payload_str = "&".join("%s=%s" % (k, v) for k, v in params.items()) + url = keys['inputUrl'] + "?" + payload_str resp = urequests.request("POST", url) print (resp.text) while True: p = Pin(2) # Data Line is on GPIO2 aka D4 ow = onewire.OneWire(p) ds = DS18X20(ow) lstrom = ds.scan() #Assuming we have only 1 device connected rom = lstrom[0] ds.convert_temp() time.sleep_ms(750) temperature = round(float(ds.read_temp(rom)),1) #print("Temperature: {:02.1f}".format(temperature)) posttocloud(temperature) time.sleep(10)
19
0.542857
11
8
5a2c35e13c3bea09388e9bb273a563def060c96c
docs/source/pynucastro.networks.rst
docs/source/pynucastro.networks.rst
pynucastro\.networks package ============================ .. automodule:: pynucastro.networks :members: :undoc-members: :show-inheritance: Submodules ---------- pynucastro\.networks\.base\_fortran\_network module --------------------------------------------------- .. automodule:: pynucastro.networks.base_fortran_network :members: :undoc-members: :show-inheritance: pynucastro\.networks\.python\_network module -------------------------------------------- .. automodule:: pynucastro.networks.python_network :members: :undoc-members: :show-inheritance: pynucastro\.networks\.rate\_collection module --------------------------------------------- .. automodule:: pynucastro.networks.rate_collection :members: :undoc-members: :show-inheritance: pynucastro\.networks\.starkiller\_network module ------------------------------------------------ .. automodule:: pynucastro.networks.starkiller_network :members: :undoc-members: :show-inheritance: pynucastro\.networks\.sundials\_network module ---------------------------------------------- .. automodule:: pynucastro.networks.sundials_network :members: :undoc-members: :show-inheritance:
pynucastro\.networks package ============================ .. automodule:: pynucastro.networks :members: :undoc-members: :show-inheritance: Submodules ---------- pynucastro\.networks\.rate\_collection module --------------------------------------------- .. automodule:: pynucastro.networks.rate_collection :members: :undoc-members: :show-inheritance: pynucastro\.networks\.python\_network module -------------------------------------------- .. automodule:: pynucastro.networks.python_network :members: :undoc-members: :show-inheritance: pynucastro\.networks\.base\_fortran\_network module --------------------------------------------------- .. automodule:: pynucastro.networks.base_fortran_network :members: :undoc-members: :show-inheritance: pynucastro\.networks\.starkiller\_network module ------------------------------------------------ .. automodule:: pynucastro.networks.starkiller_network :members: :undoc-members: :show-inheritance:
Order the network classes by inheritance.
Order the network classes by inheritance.
reStructuredText
bsd-3-clause
pyreaclib/pyreaclib
restructuredtext
## Code Before: pynucastro\.networks package ============================ .. automodule:: pynucastro.networks :members: :undoc-members: :show-inheritance: Submodules ---------- pynucastro\.networks\.base\_fortran\_network module --------------------------------------------------- .. automodule:: pynucastro.networks.base_fortran_network :members: :undoc-members: :show-inheritance: pynucastro\.networks\.python\_network module -------------------------------------------- .. automodule:: pynucastro.networks.python_network :members: :undoc-members: :show-inheritance: pynucastro\.networks\.rate\_collection module --------------------------------------------- .. automodule:: pynucastro.networks.rate_collection :members: :undoc-members: :show-inheritance: pynucastro\.networks\.starkiller\_network module ------------------------------------------------ .. automodule:: pynucastro.networks.starkiller_network :members: :undoc-members: :show-inheritance: pynucastro\.networks\.sundials\_network module ---------------------------------------------- .. automodule:: pynucastro.networks.sundials_network :members: :undoc-members: :show-inheritance: ## Instruction: Order the network classes by inheritance. ## Code After: pynucastro\.networks package ============================ .. automodule:: pynucastro.networks :members: :undoc-members: :show-inheritance: Submodules ---------- pynucastro\.networks\.rate\_collection module --------------------------------------------- .. automodule:: pynucastro.networks.rate_collection :members: :undoc-members: :show-inheritance: pynucastro\.networks\.python\_network module -------------------------------------------- .. automodule:: pynucastro.networks.python_network :members: :undoc-members: :show-inheritance: pynucastro\.networks\.base\_fortran\_network module --------------------------------------------------- .. automodule:: pynucastro.networks.base_fortran_network :members: :undoc-members: :show-inheritance: pynucastro\.networks\.starkiller\_network module ------------------------------------------------ .. automodule:: pynucastro.networks.starkiller_network :members: :undoc-members: :show-inheritance:
pynucastro\.networks package ============================ .. automodule:: pynucastro.networks :members: :undoc-members: :show-inheritance: Submodules ---------- - pynucastro\.networks\.base\_fortran\_network module ? ^ ^ ^ ^ ^^ --------- + pynucastro\.networks\.rate\_collection module ? ^ ^ ^ ^^^^ ^^ - --------------------------------------------------- ? ------ + --------------------------------------------- - .. automodule:: pynucastro.networks.base_fortran_network ? ^ ^ ^ ^ ^^ -------- + .. automodule:: pynucastro.networks.rate_collection ? ^ ^ ^ ^^^^ ^^ :members: :undoc-members: :show-inheritance: pynucastro\.networks\.python\_network module -------------------------------------------- .. automodule:: pynucastro.networks.python_network :members: :undoc-members: :show-inheritance: - pynucastro\.networks\.rate\_collection module ? ^ ^ ^ ^^ - ^ ^ + pynucastro\.networks\.base\_fortran\_network module ? ^ ^ ^ ^^^^^^^^ ^ ^^ - --------------------------------------------- + --------------------------------------------------- ? ++++++ - .. automodule:: pynucastro.networks.rate_collection + .. automodule:: pynucastro.networks.base_fortran_network :members: :undoc-members: :show-inheritance: pynucastro\.networks\.starkiller\_network module ------------------------------------------------ .. automodule:: pynucastro.networks.starkiller_network :members: :undoc-members: :show-inheritance: - - pynucastro\.networks\.sundials\_network module - ---------------------------------------------- - - .. automodule:: pynucastro.networks.sundials_network - :members: - :undoc-members: - :show-inheritance: - -
22
0.423077
6
16
b8b23b484554464d50c646515cfd0c5a07a2ef5f
Casks/nulloy.rb
Casks/nulloy.rb
cask 'nulloy' do version '0.8.2' sha256 '67acc5ada9b5245cda7da04456bc18ad6e9b49dbdcb1e2752ce988d4d3607b35' url "https://github.com/nulloy/nulloy/releases/download/#{version}/Nulloy-#{version}-x86_64.dmg" appcast 'https://github.com/nulloy/nulloy/releases.atom', checkpoint: '6b12d536ceefb813d7e269dc5943e5fa1efca77de4f1e9b9b5eb700ee9d0a3ff' name 'Nulloy' homepage 'http://nulloy.com/' license :gpl app 'Nulloy.app' end
cask 'nulloy' do version '0.8.2' sha256 '67acc5ada9b5245cda7da04456bc18ad6e9b49dbdcb1e2752ce988d4d3607b35' # github.com/nulloy/nulloy was verified as official when first introduced to the cask url "https://github.com/nulloy/nulloy/releases/download/#{version}/Nulloy-#{version}-x86_64.dmg" appcast 'https://github.com/nulloy/nulloy/releases.atom', checkpoint: '6b12d536ceefb813d7e269dc5943e5fa1efca77de4f1e9b9b5eb700ee9d0a3ff' name 'Nulloy' homepage 'http://nulloy.com/' license :gpl app 'Nulloy.app' end
Fix `url` stanza comment for Nulloy.
Fix `url` stanza comment for Nulloy.
Ruby
bsd-2-clause
uetchy/homebrew-cask,hyuna917/homebrew-cask,skatsuta/homebrew-cask,joschi/homebrew-cask,miccal/homebrew-cask,jasmas/homebrew-cask,shonjir/homebrew-cask,mchlrmrz/homebrew-cask,deanmorin/homebrew-cask,kpearson/homebrew-cask,Ngrd/homebrew-cask,okket/homebrew-cask,bosr/homebrew-cask,renaudguerin/homebrew-cask,timsutton/homebrew-cask,coeligena/homebrew-customized,maxnordlund/homebrew-cask,mauricerkelly/homebrew-cask,hristozov/homebrew-cask,sosedoff/homebrew-cask,xtian/homebrew-cask,a1russell/homebrew-cask,morganestes/homebrew-cask,cobyism/homebrew-cask,FredLackeyOfficial/homebrew-cask,chrisfinazzo/homebrew-cask,johndbritton/homebrew-cask,cblecker/homebrew-cask,decrement/homebrew-cask,leipert/homebrew-cask,sjackman/homebrew-cask,kesara/homebrew-cask,jawshooah/homebrew-cask,nshemonsky/homebrew-cask,cliffcotino/homebrew-cask,singingwolfboy/homebrew-cask,pacav69/homebrew-cask,franklouwers/homebrew-cask,renaudguerin/homebrew-cask,ianyh/homebrew-cask,cblecker/homebrew-cask,Amorymeltzer/homebrew-cask,colindunn/homebrew-cask,sanyer/homebrew-cask,stonehippo/homebrew-cask,kamilboratynski/homebrew-cask,claui/homebrew-cask,blogabe/homebrew-cask,kingthorin/homebrew-cask,n0ts/homebrew-cask,alebcay/homebrew-cask,timsutton/homebrew-cask,gerrypower/homebrew-cask,jedahan/homebrew-cask,dvdoliveira/homebrew-cask,janlugt/homebrew-cask,jaredsampson/homebrew-cask,xcezx/homebrew-cask,stonehippo/homebrew-cask,bdhess/homebrew-cask,vitorgalvao/homebrew-cask,BenjaminHCCarr/homebrew-cask,cobyism/homebrew-cask,sanchezm/homebrew-cask,sosedoff/homebrew-cask,dcondrey/homebrew-cask,lumaxis/homebrew-cask,sjackman/homebrew-cask,gilesdring/homebrew-cask,kronicd/homebrew-cask,13k/homebrew-cask,antogg/homebrew-cask,jaredsampson/homebrew-cask,blainesch/homebrew-cask,joschi/homebrew-cask,kkdd/homebrew-cask,winkelsdorf/homebrew-cask,deanmorin/homebrew-cask,victorpopkov/homebrew-cask,leipert/homebrew-cask,andrewdisley/homebrew-cask,andrewdisley/homebrew-cask,hellosky806/homebrew-cask,perfide/homebrew-cask,aguynamedryan/homebrew-cask,mchlrmrz/homebrew-cask,slack4u/homebrew-cask,mahori/homebrew-cask,mikem/homebrew-cask,puffdad/homebrew-cask,ericbn/homebrew-cask,miccal/homebrew-cask,robertgzr/homebrew-cask,opsdev-ws/homebrew-cask,lantrix/homebrew-cask,mathbunnyru/homebrew-cask,riyad/homebrew-cask,usami-k/homebrew-cask,m3nu/homebrew-cask,alexg0/homebrew-cask,doits/homebrew-cask,daften/homebrew-cask,MoOx/homebrew-cask,jacobbednarz/homebrew-cask,phpwutz/homebrew-cask,mwean/homebrew-cask,rogeriopradoj/homebrew-cask,malford/homebrew-cask,athrunsun/homebrew-cask,sanyer/homebrew-cask,squid314/homebrew-cask,yutarody/homebrew-cask,mikem/homebrew-cask,giannitm/homebrew-cask,cprecioso/homebrew-cask,tjnycum/homebrew-cask,rogeriopradoj/homebrew-cask,jpmat296/homebrew-cask,inz/homebrew-cask,sscotth/homebrew-cask,robertgzr/homebrew-cask,samdoran/homebrew-cask,jmeridth/homebrew-cask,Cottser/homebrew-cask,mahori/homebrew-cask,usami-k/homebrew-cask,m3nu/homebrew-cask,adrianchia/homebrew-cask,andyli/homebrew-cask,tangestani/homebrew-cask,shonjir/homebrew-cask,0xadada/homebrew-cask,hanxue/caskroom,KosherBacon/homebrew-cask,dictcp/homebrew-cask,moogar0880/homebrew-cask,FinalDes/homebrew-cask,chuanxd/homebrew-cask,colindean/homebrew-cask,jpmat296/homebrew-cask,Saklad5/homebrew-cask,MircoT/homebrew-cask,tedski/homebrew-cask,danielbayley/homebrew-cask,ksylvan/homebrew-cask,chuanxd/homebrew-cask,gyndav/homebrew-cask,coeligena/homebrew-customized,yurikoles/homebrew-cask,nrlquaker/homebrew-cask,stephenwade/homebrew-cask,sebcode/homebrew-cask,alebcay/homebrew-cask,FinalDes/homebrew-cask,mauricerkelly/homebrew-cask,mazehall/homebrew-cask,sscotth/homebrew-cask,skatsuta/homebrew-cask,sohtsuka/homebrew-cask,mrmachine/homebrew-cask,rogeriopradoj/homebrew-cask,BenjaminHCCarr/homebrew-cask,victorpopkov/homebrew-cask,a1russell/homebrew-cask,joshka/homebrew-cask,boecko/homebrew-cask,inta/homebrew-cask,jalaziz/homebrew-cask,caskroom/homebrew-cask,devmynd/homebrew-cask,rajiv/homebrew-cask,timsutton/homebrew-cask,xight/homebrew-cask,wickles/homebrew-cask,JikkuJose/homebrew-cask,kongslund/homebrew-cask,hristozov/homebrew-cask,claui/homebrew-cask,uetchy/homebrew-cask,patresi/homebrew-cask,antogg/homebrew-cask,yumitsu/homebrew-cask,vin047/homebrew-cask,paour/homebrew-cask,mathbunnyru/homebrew-cask,xcezx/homebrew-cask,morganestes/homebrew-cask,shonjir/homebrew-cask,yumitsu/homebrew-cask,JacopKane/homebrew-cask,hanxue/caskroom,RJHsiao/homebrew-cask,andyli/homebrew-cask,lucasmezencio/homebrew-cask,mchlrmrz/homebrew-cask,imgarylai/homebrew-cask,jeroenj/homebrew-cask,vigosan/homebrew-cask,klane/homebrew-cask,onlynone/homebrew-cask,danielbayley/homebrew-cask,jmeridth/homebrew-cask,ebraminio/homebrew-cask,perfide/homebrew-cask,Keloran/homebrew-cask,m3nu/homebrew-cask,kesara/homebrew-cask,mattrobenolt/homebrew-cask,toonetown/homebrew-cask,jellyfishcoder/homebrew-cask,wmorin/homebrew-cask,phpwutz/homebrew-cask,uetchy/homebrew-cask,ptb/homebrew-cask,gabrielizaias/homebrew-cask,KosherBacon/homebrew-cask,onlynone/homebrew-cask,Labutin/homebrew-cask,bdhess/homebrew-cask,franklouwers/homebrew-cask,gyndav/homebrew-cask,colindunn/homebrew-cask,neverfox/homebrew-cask,AnastasiaSulyagina/homebrew-cask,samdoran/homebrew-cask,wKovacs64/homebrew-cask,koenrh/homebrew-cask,lantrix/homebrew-cask,hovancik/homebrew-cask,muan/homebrew-cask,singingwolfboy/homebrew-cask,nrlquaker/homebrew-cask,flaviocamilo/homebrew-cask,kingthorin/homebrew-cask,jangalinski/homebrew-cask,lucasmezencio/homebrew-cask,samnung/homebrew-cask,lumaxis/homebrew-cask,tjnycum/homebrew-cask,mwean/homebrew-cask,mlocher/homebrew-cask,y00rb/homebrew-cask,slack4u/homebrew-cask,wickles/homebrew-cask,wastrachan/homebrew-cask,malford/homebrew-cask,josa42/homebrew-cask,joschi/homebrew-cask,squid314/homebrew-cask,samnung/homebrew-cask,wickedsp1d3r/homebrew-cask,mjgardner/homebrew-cask,tyage/homebrew-cask,winkelsdorf/homebrew-cask,sgnh/homebrew-cask,xtian/homebrew-cask,n0ts/homebrew-cask,alexg0/homebrew-cask,blogabe/homebrew-cask,exherb/homebrew-cask,pkq/homebrew-cask,josa42/homebrew-cask,goxberry/homebrew-cask,thehunmonkgroup/homebrew-cask,thii/homebrew-cask,mishari/homebrew-cask,esebastian/homebrew-cask,moimikey/homebrew-cask,yuhki50/homebrew-cask,scribblemaniac/homebrew-cask,mahori/homebrew-cask,xyb/homebrew-cask,kingthorin/homebrew-cask,larseggert/homebrew-cask,0rax/homebrew-cask,wmorin/homebrew-cask,reitermarkus/homebrew-cask,ianyh/homebrew-cask,hanxue/caskroom,hovancik/homebrew-cask,troyxmccall/homebrew-cask,shoichiaizawa/homebrew-cask,joshka/homebrew-cask,michelegera/homebrew-cask,markthetech/homebrew-cask,gmkey/homebrew-cask,cfillion/homebrew-cask,esebastian/homebrew-cask,esebastian/homebrew-cask,wmorin/homebrew-cask,0xadada/homebrew-cask,jconley/homebrew-cask,patresi/homebrew-cask,jangalinski/homebrew-cask,sebcode/homebrew-cask,goxberry/homebrew-cask,imgarylai/homebrew-cask,neverfox/homebrew-cask,andrewdisley/homebrew-cask,cobyism/homebrew-cask,gilesdring/homebrew-cask,yutarody/homebrew-cask,13k/homebrew-cask,jbeagley52/homebrew-cask,ebraminio/homebrew-cask,tangestani/homebrew-cask,blainesch/homebrew-cask,jiashuw/homebrew-cask,pkq/homebrew-cask,danielbayley/homebrew-cask,larseggert/homebrew-cask,elyscape/homebrew-cask,schneidmaster/homebrew-cask,gyndav/homebrew-cask,lukasbestle/homebrew-cask,chadcatlett/caskroom-homebrew-cask,sohtsuka/homebrew-cask,AnastasiaSulyagina/homebrew-cask,doits/homebrew-cask,daften/homebrew-cask,vin047/homebrew-cask,My2ndAngelic/homebrew-cask,maxnordlund/homebrew-cask,wickedsp1d3r/homebrew-cask,nathancahill/homebrew-cask,toonetown/homebrew-cask,JosephViolago/homebrew-cask,syscrusher/homebrew-cask,MoOx/homebrew-cask,boecko/homebrew-cask,muan/homebrew-cask,ksylvan/homebrew-cask,paour/homebrew-cask,jasmas/homebrew-cask,imgarylai/homebrew-cask,adrianchia/homebrew-cask,MichaelPei/homebrew-cask,adrianchia/homebrew-cask,malob/homebrew-cask,tangestani/homebrew-cask,xight/homebrew-cask,cfillion/homebrew-cask,haha1903/homebrew-cask,amatos/homebrew-cask,xight/homebrew-cask,okket/homebrew-cask,mathbunnyru/homebrew-cask,alebcay/homebrew-cask,julionc/homebrew-cask,markthetech/homebrew-cask,nathanielvarona/homebrew-cask,xyb/homebrew-cask,rajiv/homebrew-cask,ericbn/homebrew-cask,rajiv/homebrew-cask,nathanielvarona/homebrew-cask,diguage/homebrew-cask,Cottser/homebrew-cask,julionc/homebrew-cask,chrisfinazzo/homebrew-cask,shoichiaizawa/homebrew-cask,janlugt/homebrew-cask,mhubig/homebrew-cask,giannitm/homebrew-cask,johndbritton/homebrew-cask,deiga/homebrew-cask,vigosan/homebrew-cask,scottsuch/homebrew-cask,yutarody/homebrew-cask,colindean/homebrew-cask,paour/homebrew-cask,pkq/homebrew-cask,arronmabrey/homebrew-cask,kTitan/homebrew-cask,mjgardner/homebrew-cask,seanzxx/homebrew-cask,stephenwade/homebrew-cask,dictcp/homebrew-cask,RJHsiao/homebrew-cask,cblecker/homebrew-cask,johnjelinek/homebrew-cask,jalaziz/homebrew-cask,sanyer/homebrew-cask,malob/homebrew-cask,cliffcotino/homebrew-cask,forevergenin/homebrew-cask,stephenwade/homebrew-cask,athrunsun/homebrew-cask,Amorymeltzer/homebrew-cask,guerrero/homebrew-cask,jbeagley52/homebrew-cask,yurikoles/homebrew-cask,shoichiaizawa/homebrew-cask,JikkuJose/homebrew-cask,sanchezm/homebrew-cask,kamilboratynski/homebrew-cask,jedahan/homebrew-cask,thii/homebrew-cask,gerrypower/homebrew-cask,reelsense/homebrew-cask,artdevjs/homebrew-cask,jgarber623/homebrew-cask,jacobbednarz/homebrew-cask,JosephViolago/homebrew-cask,nathanielvarona/homebrew-cask,stonehippo/homebrew-cask,koenrh/homebrew-cask,yuhki50/homebrew-cask,schneidmaster/homebrew-cask,wastrachan/homebrew-cask,kpearson/homebrew-cask,amatos/homebrew-cask,scottsuch/homebrew-cask,SentinelWarren/homebrew-cask,inta/homebrew-cask,diogodamiani/homebrew-cask,moimikey/homebrew-cask,tjnycum/homebrew-cask,bosr/homebrew-cask,scottsuch/homebrew-cask,hyuna917/homebrew-cask,Keloran/homebrew-cask,mjgardner/homebrew-cask,blogabe/homebrew-cask,artdevjs/homebrew-cask,lifepillar/homebrew-cask,jawshooah/homebrew-cask,wKovacs64/homebrew-cask,tjt263/homebrew-cask,xyb/homebrew-cask,klane/homebrew-cask,kronicd/homebrew-cask,Ngrd/homebrew-cask,hellosky806/homebrew-cask,arronmabrey/homebrew-cask,Labutin/homebrew-cask,aguynamedryan/homebrew-cask,reitermarkus/homebrew-cask,lifepillar/homebrew-cask,elyscape/homebrew-cask,shorshe/homebrew-cask,winkelsdorf/homebrew-cask,My2ndAngelic/homebrew-cask,ptb/homebrew-cask,puffdad/homebrew-cask,alexg0/homebrew-cask,johnjelinek/homebrew-cask,mhubig/homebrew-cask,singingwolfboy/homebrew-cask,ericbn/homebrew-cask,opsdev-ws/homebrew-cask,jconley/homebrew-cask,kongslund/homebrew-cask,decrement/homebrew-cask,y00rb/homebrew-cask,tjt263/homebrew-cask,mattrobenolt/homebrew-cask,sscotth/homebrew-cask,troyxmccall/homebrew-cask,michelegera/homebrew-cask,optikfluffel/homebrew-cask,flaviocamilo/homebrew-cask,malob/homebrew-cask,forevergenin/homebrew-cask,ninjahoahong/homebrew-cask,Ketouem/homebrew-cask,bric3/homebrew-cask,guerrero/homebrew-cask,kassi/homebrew-cask,MircoT/homebrew-cask,julionc/homebrew-cask,haha1903/homebrew-cask,cprecioso/homebrew-cask,deiga/homebrew-cask,dictcp/homebrew-cask,chadcatlett/caskroom-homebrew-cask,mishari/homebrew-cask,gabrielizaias/homebrew-cask,Ephemera/homebrew-cask,Ketouem/homebrew-cask,inz/homebrew-cask,gmkey/homebrew-cask,scribblemaniac/homebrew-cask,seanzxx/homebrew-cask,mattrobenolt/homebrew-cask,jellyfishcoder/homebrew-cask,tyage/homebrew-cask,shorshe/homebrew-cask,neverfox/homebrew-cask,bric3/homebrew-cask,diguage/homebrew-cask,SentinelWarren/homebrew-cask,FredLackeyOfficial/homebrew-cask,JacopKane/homebrew-cask,a1russell/homebrew-cask,Ephemera/homebrew-cask,chrisfinazzo/homebrew-cask,ninjahoahong/homebrew-cask,mlocher/homebrew-cask,deiga/homebrew-cask,Amorymeltzer/homebrew-cask,MichaelPei/homebrew-cask,moimikey/homebrew-cask,caskroom/homebrew-cask,reelsense/homebrew-cask,syscrusher/homebrew-cask,BenjaminHCCarr/homebrew-cask,moogar0880/homebrew-cask,vitorgalvao/homebrew-cask,antogg/homebrew-cask,exherb/homebrew-cask,pacav69/homebrew-cask,asins/homebrew-cask,bric3/homebrew-cask,coeligena/homebrew-customized,yurikoles/homebrew-cask,devmynd/homebrew-cask,kkdd/homebrew-cask,kesara/homebrew-cask,dcondrey/homebrew-cask,psibre/homebrew-cask,nrlquaker/homebrew-cask,optikfluffel/homebrew-cask,hakamadare/homebrew-cask,jgarber623/homebrew-cask,jeroenj/homebrew-cask,diogodamiani/homebrew-cask,mazehall/homebrew-cask,claui/homebrew-cask,kassi/homebrew-cask,optikfluffel/homebrew-cask,scribblemaniac/homebrew-cask,JosephViolago/homebrew-cask,lukasbestle/homebrew-cask,tedski/homebrew-cask,jalaziz/homebrew-cask,hakamadare/homebrew-cask,reitermarkus/homebrew-cask,dvdoliveira/homebrew-cask,Saklad5/homebrew-cask,sgnh/homebrew-cask,miccal/homebrew-cask,thehunmonkgroup/homebrew-cask,kTitan/homebrew-cask,mrmachine/homebrew-cask,nshemonsky/homebrew-cask,asins/homebrew-cask,0rax/homebrew-cask,riyad/homebrew-cask,jgarber623/homebrew-cask,Ephemera/homebrew-cask,JacopKane/homebrew-cask,nathancahill/homebrew-cask,jiashuw/homebrew-cask,joshka/homebrew-cask,josa42/homebrew-cask,psibre/homebrew-cask
ruby
## Code Before: cask 'nulloy' do version '0.8.2' sha256 '67acc5ada9b5245cda7da04456bc18ad6e9b49dbdcb1e2752ce988d4d3607b35' url "https://github.com/nulloy/nulloy/releases/download/#{version}/Nulloy-#{version}-x86_64.dmg" appcast 'https://github.com/nulloy/nulloy/releases.atom', checkpoint: '6b12d536ceefb813d7e269dc5943e5fa1efca77de4f1e9b9b5eb700ee9d0a3ff' name 'Nulloy' homepage 'http://nulloy.com/' license :gpl app 'Nulloy.app' end ## Instruction: Fix `url` stanza comment for Nulloy. ## Code After: cask 'nulloy' do version '0.8.2' sha256 '67acc5ada9b5245cda7da04456bc18ad6e9b49dbdcb1e2752ce988d4d3607b35' # github.com/nulloy/nulloy was verified as official when first introduced to the cask url "https://github.com/nulloy/nulloy/releases/download/#{version}/Nulloy-#{version}-x86_64.dmg" appcast 'https://github.com/nulloy/nulloy/releases.atom', checkpoint: '6b12d536ceefb813d7e269dc5943e5fa1efca77de4f1e9b9b5eb700ee9d0a3ff' name 'Nulloy' homepage 'http://nulloy.com/' license :gpl app 'Nulloy.app' end
cask 'nulloy' do version '0.8.2' sha256 '67acc5ada9b5245cda7da04456bc18ad6e9b49dbdcb1e2752ce988d4d3607b35' + # github.com/nulloy/nulloy was verified as official when first introduced to the cask url "https://github.com/nulloy/nulloy/releases/download/#{version}/Nulloy-#{version}-x86_64.dmg" appcast 'https://github.com/nulloy/nulloy/releases.atom', checkpoint: '6b12d536ceefb813d7e269dc5943e5fa1efca77de4f1e9b9b5eb700ee9d0a3ff' name 'Nulloy' homepage 'http://nulloy.com/' license :gpl app 'Nulloy.app' end
1
0.076923
1
0
42cca2bd3411e45f38c0419faed5ccd9e5b01dcf
src/release/make-bower.json.js
src/release/make-bower.json.js
// Renders the bower.json template and prints it to stdout var template = { name: "graphlib", version: require("../../package.json").version, main: [ "dist/graphlib.core.js", "dist/graphlib.core.min.js" ], ignore: [ ".*", "README.md", "CHANGELOG.md", "Makefile", "browser.js", "dist/graphlib.js", "dist/graphlib.min.js", "index.js", "karma*", "lib/**", "package.json", "src/**", "test/**" ], dependencies: { "lodash": "^2.4.1" } }; console.log(JSON.stringify(template, null, 2));
// Renders the bower.json template and prints it to stdout var packageJson = require("../../package.json"); var template = { name: packageJson.name, version: packageJson.version, main: ["dist/" + packageJson.name + ".core.js", "dist/" + packageJson.name + ".core.min.js"], ignore: [ ".*", "README.md", "CHANGELOG.md", "Makefile", "browser.js", "dist/" + packageJson.name + ".js", "dist/" + packageJson.name + ".min.js", "index.js", "karma*", "lib/**", "package.json", "src/**", "test/**" ], dependencies: packageJson.dependencies }; console.log(JSON.stringify(template, null, 2));
Check in improved bower generation script
Check in improved bower generation script
JavaScript
mit
cpettitt/graphlib,dagrejs/graphlib,dagrejs/graphlib,kdawes/graphlib,cpettitt/graphlib,kdawes/graphlib,dagrejs/graphlib,gardner/graphlib,gardner/graphlib,leMaik/graphlib,leMaik/graphlib
javascript
## Code Before: // Renders the bower.json template and prints it to stdout var template = { name: "graphlib", version: require("../../package.json").version, main: [ "dist/graphlib.core.js", "dist/graphlib.core.min.js" ], ignore: [ ".*", "README.md", "CHANGELOG.md", "Makefile", "browser.js", "dist/graphlib.js", "dist/graphlib.min.js", "index.js", "karma*", "lib/**", "package.json", "src/**", "test/**" ], dependencies: { "lodash": "^2.4.1" } }; console.log(JSON.stringify(template, null, 2)); ## Instruction: Check in improved bower generation script ## Code After: // Renders the bower.json template and prints it to stdout var packageJson = require("../../package.json"); var template = { name: packageJson.name, version: packageJson.version, main: ["dist/" + packageJson.name + ".core.js", "dist/" + packageJson.name + ".core.min.js"], ignore: [ ".*", "README.md", "CHANGELOG.md", "Makefile", "browser.js", "dist/" + packageJson.name + ".js", "dist/" + packageJson.name + ".min.js", "index.js", "karma*", "lib/**", "package.json", "src/**", "test/**" ], dependencies: packageJson.dependencies }; console.log(JSON.stringify(template, null, 2));
// Renders the bower.json template and prints it to stdout + var packageJson = require("../../package.json"); + var template = { - name: "graphlib", + name: packageJson.name, - version: require("../../package.json").version, ? --------------- ^^ -- + version: packageJson.version, ? ^ - main: [ "dist/graphlib.core.js", "dist/graphlib.core.min.js" ], + main: ["dist/" + packageJson.name + ".core.js", "dist/" + packageJson.name + ".core.min.js"], ignore: [ ".*", "README.md", "CHANGELOG.md", "Makefile", "browser.js", - "dist/graphlib.js", - "dist/graphlib.min.js", + "dist/" + packageJson.name + ".js", + "dist/" + packageJson.name + ".min.js", "index.js", "karma*", "lib/**", "package.json", "src/**", "test/**" ], + dependencies: packageJson.dependencies - dependencies: { - "lodash": "^2.4.1" - } }; console.log(JSON.stringify(template, null, 2));
16
0.571429
8
8
c4fff9577c4827a956e4de1eb5db0df39c1cca21
.travis.yml
.travis.yml
language: php php: 5.4 before_script: phpize && ./configure && make && sudo make install env: REPORT_EXIT_STATUS=1 TEST_PHP_EXECUTABLE=/usr/local/bin/php script: php run-tests.php -dextension=scalar_objects.so
language: php php: 5.4 before_script: phpize && ./configure && make && sudo make install env: REPORT_EXIT_STATUS=1 TEST_PHP_EXECUTABLE=`which php` script: php run-tests.php -dextension=scalar_objects.so
Use `which php` to get executable path
Use `which php` to get executable path Maybe this will work...
YAML
mit
nikic/scalar_objects,nikic/scalar_objects,alissonzampietro/scalar_objects,nikic/scalar_objects,alissonzampietro/scalar_objects
yaml
## Code Before: language: php php: 5.4 before_script: phpize && ./configure && make && sudo make install env: REPORT_EXIT_STATUS=1 TEST_PHP_EXECUTABLE=/usr/local/bin/php script: php run-tests.php -dextension=scalar_objects.so ## Instruction: Use `which php` to get executable path Maybe this will work... ## Code After: language: php php: 5.4 before_script: phpize && ./configure && make && sudo make install env: REPORT_EXIT_STATUS=1 TEST_PHP_EXECUTABLE=`which php` script: php run-tests.php -dextension=scalar_objects.so
language: php php: 5.4 before_script: phpize && ./configure && make && sudo make install - env: REPORT_EXIT_STATUS=1 TEST_PHP_EXECUTABLE=/usr/local/bin/php ? ^^^^^^^ ^^^^^^^ + env: REPORT_EXIT_STATUS=1 TEST_PHP_EXECUTABLE=`which php` ? ^^^^ ^^ + script: php run-tests.php -dextension=scalar_objects.so
2
0.333333
1
1
06176d46c09f8004346caed5609c36aca1d7023c
recipes/solo-install.rb
recipes/solo-install.rb
remote_file "/tmp/#{File.basename(node['mysql-zrm']['package']['all'])}" do source node['mysql-zrm']['package']['all'] action :create_if_missing not_if 'which mysql-zrm' end # Install package dependencies for mysql-zrm package "libxml-parser-perl" do action :install end dpkg_package "/tmp/#{File.basename(node['mysql-zrm']['package']['all'])}" do action :install not_if 'which mysql-zrm' end
pkg_filepath = "#{Chef::Config['file_cache_path'] || '/tmp'}/#{File.basename(node['mysql-zrm']['package']['all'])}" # Download and build MySQL ZRM remote_file pkg_filepath do source node['mysql-zrm']['package']['all'] action :create_if_missing not_if 'which mysql-zrm' end # Install package dependencies for mysql-zrm package "libxml-parser-perl" do action :install end dpkg_package pkg_filepath do action :install not_if 'which mysql-zrm' end
Use chef file_cache for temp download.
Use chef file_cache for temp download.
Ruby
apache-2.0
dataferret/chef-mysql-zrm,dataferret/chef-mysql-zrm
ruby
## Code Before: remote_file "/tmp/#{File.basename(node['mysql-zrm']['package']['all'])}" do source node['mysql-zrm']['package']['all'] action :create_if_missing not_if 'which mysql-zrm' end # Install package dependencies for mysql-zrm package "libxml-parser-perl" do action :install end dpkg_package "/tmp/#{File.basename(node['mysql-zrm']['package']['all'])}" do action :install not_if 'which mysql-zrm' end ## Instruction: Use chef file_cache for temp download. ## Code After: pkg_filepath = "#{Chef::Config['file_cache_path'] || '/tmp'}/#{File.basename(node['mysql-zrm']['package']['all'])}" # Download and build MySQL ZRM remote_file pkg_filepath do source node['mysql-zrm']['package']['all'] action :create_if_missing not_if 'which mysql-zrm' end # Install package dependencies for mysql-zrm package "libxml-parser-perl" do action :install end dpkg_package pkg_filepath do action :install not_if 'which mysql-zrm' end
- remote_file "/tmp/#{File.basename(node['mysql-zrm']['package']['all'])}" do + + pkg_filepath = "#{Chef::Config['file_cache_path'] || '/tmp'}/#{File.basename(node['mysql-zrm']['package']['all'])}" + + + # Download and build MySQL ZRM + remote_file pkg_filepath do source node['mysql-zrm']['package']['all'] action :create_if_missing not_if 'which mysql-zrm' end # Install package dependencies for mysql-zrm package "libxml-parser-perl" do action :install end - dpkg_package "/tmp/#{File.basename(node['mysql-zrm']['package']['all'])}" do + dpkg_package pkg_filepath do action :install not_if 'which mysql-zrm' end
9
0.6
7
2
6092a9d2c5a722d02ba5d69a37b20bf376b58d47
src/tensorflow_clj/core.clj
src/tensorflow_clj/core.clj
(ns tensorflow-clj.core (:gen-class)) (def ^:dynamic graph nil) (defmacro with-graph [& body] `(binding [graph (org.tensorflow.Graph.)] (try ~@body (finally (.close graph))))) (defn- build-op [op-type op-name attr-map] (let [ob (.opBuilder graph op-type (name op-name))] (doseq [[attr-name attr-value] attr-map] (.setAttr ob attr-name attr-value)) (-> ob (.build) (.output 0)))) (defn tensor [value] (org.tensorflow.Tensor/create value)) (defn constant [name value] (let [t (tensor value)] (build-op "Const" name {"dtype" (.dataType t) "value" t}))) (defn variable [name] (build-op "Variable" name {"dtype" org.tensorflow.DataType/DOUBLE "shape" (org.tensorflow.Shape/scalar)})) (defn run-and-fetch [name] (with-open [sess (org.tensorflow.Session. graph)] (-> sess (.runner) (.fetch (name name)) (.run)))) (defn -main "I don't do a whole lot ... yet." [& args] (println "Hello, World!"))
(ns tensorflow-clj.core (:gen-class)) (def ^:dynamic graph nil) (defmacro with-graph [& body] `(binding [graph (org.tensorflow.Graph.)] (try ~@body (finally (.close graph))))) (defn- build-op [op-type op-name attr-map] (let [ob (.opBuilder graph op-type (name op-name))] (doseq [[attr-name attr-value] attr-map] (.setAttr ob attr-name attr-value)) (-> ob (.build) (.output 0)))) (defn tensor [value] (org.tensorflow.Tensor/create value)) (defn constant [name value] (let [t (tensor value)] (build-op "Const" name {"dtype" (.dataType t) "value" t}))) (defn variable [name] (build-op "Variable" name {"dtype" org.tensorflow.DataType/DOUBLE "shape" (org.tensorflow.Shape/scalar)})) (defn run-and-fetch [name] (with-open [sess (org.tensorflow.Session. graph)] (let [runner (.runner sess)] (print (-> runner (.feed (name name) (tensor 234.0)) (.fetch (name name)) (.run) (.get 0) (.toString)))))) (defn -main "I don't do a whole lot ... yet." [& args] (println "Hello, World!"))
Throw an exception instead of segfaulting
Throw an exception instead of segfaulting
Clojure
epl-1.0
enragedginger/tensorflow-clj
clojure
## Code Before: (ns tensorflow-clj.core (:gen-class)) (def ^:dynamic graph nil) (defmacro with-graph [& body] `(binding [graph (org.tensorflow.Graph.)] (try ~@body (finally (.close graph))))) (defn- build-op [op-type op-name attr-map] (let [ob (.opBuilder graph op-type (name op-name))] (doseq [[attr-name attr-value] attr-map] (.setAttr ob attr-name attr-value)) (-> ob (.build) (.output 0)))) (defn tensor [value] (org.tensorflow.Tensor/create value)) (defn constant [name value] (let [t (tensor value)] (build-op "Const" name {"dtype" (.dataType t) "value" t}))) (defn variable [name] (build-op "Variable" name {"dtype" org.tensorflow.DataType/DOUBLE "shape" (org.tensorflow.Shape/scalar)})) (defn run-and-fetch [name] (with-open [sess (org.tensorflow.Session. graph)] (-> sess (.runner) (.fetch (name name)) (.run)))) (defn -main "I don't do a whole lot ... yet." [& args] (println "Hello, World!")) ## Instruction: Throw an exception instead of segfaulting ## Code After: (ns tensorflow-clj.core (:gen-class)) (def ^:dynamic graph nil) (defmacro with-graph [& body] `(binding [graph (org.tensorflow.Graph.)] (try ~@body (finally (.close graph))))) (defn- build-op [op-type op-name attr-map] (let [ob (.opBuilder graph op-type (name op-name))] (doseq [[attr-name attr-value] attr-map] (.setAttr ob attr-name attr-value)) (-> ob (.build) (.output 0)))) (defn tensor [value] (org.tensorflow.Tensor/create value)) (defn constant [name value] (let [t (tensor value)] (build-op "Const" name {"dtype" (.dataType t) "value" t}))) (defn variable [name] (build-op "Variable" name {"dtype" org.tensorflow.DataType/DOUBLE "shape" (org.tensorflow.Shape/scalar)})) (defn run-and-fetch [name] (with-open [sess (org.tensorflow.Session. graph)] (let [runner (.runner sess)] (print (-> runner (.feed (name name) (tensor 234.0)) (.fetch (name name)) (.run) (.get 0) (.toString)))))) (defn -main "I don't do a whole lot ... yet." [& args] (println "Hello, World!"))
(ns tensorflow-clj.core (:gen-class)) (def ^:dynamic graph nil) (defmacro with-graph [& body] `(binding [graph (org.tensorflow.Graph.)] (try ~@body (finally (.close graph))))) (defn- build-op [op-type op-name attr-map] (let [ob (.opBuilder graph op-type (name op-name))] (doseq [[attr-name attr-value] attr-map] (.setAttr ob attr-name attr-value)) (-> ob (.build) (.output 0)))) (defn tensor [value] (org.tensorflow.Tensor/create value)) (defn constant [name value] (let [t (tensor value)] (build-op "Const" name {"dtype" (.dataType t) "value" t}))) (defn variable [name] (build-op "Variable" name {"dtype" org.tensorflow.DataType/DOUBLE "shape" (org.tensorflow.Shape/scalar)})) (defn run-and-fetch [name] (with-open [sess (org.tensorflow.Session. graph)] - (-> sess (.runner) + (let [runner (.runner sess)] + (print (-> runner + (.feed (name name) (tensor 234.0)) - (.fetch (name name)) + (.fetch (name name)) ? +++++++++ - (.run)))) + (.run) + (.get 0) + (.toString)))))) (defn -main "I don't do a whole lot ... yet." [& args] (println "Hello, World!"))
10
0.25
7
3
ed55201556da451a580728e971cd5805dd24462c
app/styles/less/modules/_buttons.less
app/styles/less/modules/_buttons.less
// Buttons .btn { display: inline-block; padding: @btn-padding-y @btn-padding-x; font-size: @btn-font-size; line-height: @line-height; text-align: center; white-space: nowrap; vertical-align: middle; cursor: pointer; user-select: none; border: 1px solid transparent; border-radius: @global-radius; transition: all .25s ease-in-out; &:focus, &:hover { text-decoration: none; outline: none; } // Disabled button &.disabled, &:disabled { pointer-events: none; cursor: not-allowed; opacity: .65; } } // Default button .btn-default { .btn-color(@btn-default-bg, @btn-default-color, @btn-default-border); } // Primary button .btn-primary { .btn-color(@btn-primary-bg, @btn-primary-color, @btn-primary-border); } // Secondary button .btn-secondary { .btn-color(@btn-secondary-bg, @btn-secondary-color, @btn-secondary-border); } // Transparent button .btn-transparent { background-color: transparent; &:focus, &:hover { color: lighten(@body-color, 30); background-color: transparent; } }
// Buttons .btn { display: inline-block; padding: @btn-padding-y @btn-padding-x; font-size: @btn-font-size; line-height: @line-height; text-align: center; white-space: nowrap; vertical-align: middle; cursor: pointer; user-select: none; background-color: transparent; border: 1px solid transparent; border-radius: @global-radius; transition: all .25s ease-in-out; &:focus, &:hover { text-decoration: none; outline: none; } // Disabled button &.disabled, &:disabled { pointer-events: none; cursor: not-allowed; opacity: .65; } } // Default button .btn-default { .btn-color(@btn-default-bg, @btn-default-color, @btn-default-border); } // Primary button .btn-primary { .btn-color(@btn-primary-bg, @btn-primary-color, @btn-primary-border); } // Secondary button .btn-secondary { .btn-color(@btn-secondary-bg, @btn-secondary-color, @btn-secondary-border); } // Transparent button .btn-transparent { background-color: transparent; &:focus, &:hover { color: lighten(@body-color, 30); background-color: transparent; } }
Add bg property for buttons
Add bg property for buttons
Less
mit
mrmlnc/rwk,mrmlnc/rwk
less
## Code Before: // Buttons .btn { display: inline-block; padding: @btn-padding-y @btn-padding-x; font-size: @btn-font-size; line-height: @line-height; text-align: center; white-space: nowrap; vertical-align: middle; cursor: pointer; user-select: none; border: 1px solid transparent; border-radius: @global-radius; transition: all .25s ease-in-out; &:focus, &:hover { text-decoration: none; outline: none; } // Disabled button &.disabled, &:disabled { pointer-events: none; cursor: not-allowed; opacity: .65; } } // Default button .btn-default { .btn-color(@btn-default-bg, @btn-default-color, @btn-default-border); } // Primary button .btn-primary { .btn-color(@btn-primary-bg, @btn-primary-color, @btn-primary-border); } // Secondary button .btn-secondary { .btn-color(@btn-secondary-bg, @btn-secondary-color, @btn-secondary-border); } // Transparent button .btn-transparent { background-color: transparent; &:focus, &:hover { color: lighten(@body-color, 30); background-color: transparent; } } ## Instruction: Add bg property for buttons ## Code After: // Buttons .btn { display: inline-block; padding: @btn-padding-y @btn-padding-x; font-size: @btn-font-size; line-height: @line-height; text-align: center; white-space: nowrap; vertical-align: middle; cursor: pointer; user-select: none; background-color: transparent; border: 1px solid transparent; border-radius: @global-radius; transition: all .25s ease-in-out; &:focus, &:hover { text-decoration: none; outline: none; } // Disabled button &.disabled, &:disabled { pointer-events: none; cursor: not-allowed; opacity: .65; } } // Default button .btn-default { .btn-color(@btn-default-bg, @btn-default-color, @btn-default-border); } // Primary button .btn-primary { .btn-color(@btn-primary-bg, @btn-primary-color, @btn-primary-border); } // Secondary button .btn-secondary { .btn-color(@btn-secondary-bg, @btn-secondary-color, @btn-secondary-border); } // Transparent button .btn-transparent { background-color: transparent; &:focus, &:hover { color: lighten(@body-color, 30); background-color: transparent; } }
// Buttons .btn { display: inline-block; padding: @btn-padding-y @btn-padding-x; font-size: @btn-font-size; line-height: @line-height; text-align: center; white-space: nowrap; vertical-align: middle; cursor: pointer; user-select: none; + background-color: transparent; border: 1px solid transparent; border-radius: @global-radius; transition: all .25s ease-in-out; &:focus, &:hover { text-decoration: none; outline: none; } // Disabled button &.disabled, &:disabled { pointer-events: none; cursor: not-allowed; opacity: .65; } } // Default button .btn-default { .btn-color(@btn-default-bg, @btn-default-color, @btn-default-border); } // Primary button .btn-primary { .btn-color(@btn-primary-bg, @btn-primary-color, @btn-primary-border); } // Secondary button .btn-secondary { .btn-color(@btn-secondary-bg, @btn-secondary-color, @btn-secondary-border); } // Transparent button .btn-transparent { background-color: transparent; &:focus, &:hover { color: lighten(@body-color, 30); background-color: transparent; } }
1
0.017857
1
0
d0b4725e0d8dba7cb57b95c08b240d529cb08de5
db/migrate/20170403162041_create_materials.rb
db/migrate/20170403162041_create_materials.rb
class CreateMaterials < ActiveRecord::Migration[5.0] def change create_table :materials do |t| t.references :rightholder, index: true, foreign_key: { to_table: :rightholders } t.references :owner, index: true, foreign_key: { to_table: :users } t.string :original_link, null: true t.string :caption_original, null: false t.string :caption_translated, null: true t.text :annotation_original, null: false t.text :annotation_translated, null: true t.references :state, index: true, foreign_key: { to_table: :states } t.references :license, index: true, foreign_key: { to_table: :licenses } t.string :original_language, null: false t.string :translation_language, null: false t.string :tags, array: true, null: false t.timestamps end end end
class CreateMaterials < ActiveRecord::Migration[5.0] def change create_table :materials do |t| t.references :rightholder, index: true, foreign_key: { to_table: :rightholders } t.references :owner, index: true, foreign_key: { to_table: :users } t.string :original_link, null: true t.string :caption_original, null: false t.string :caption_translated, null: true t.text :annotation_original, null: false t.text :annotation_translated, null: true t.references :state, index: true, foreign_key: { to_table: :states } t.references :license, index: true, foreign_key: { to_table: :licenses } t.string :original_language, null: false t.string :translation_language, null: false t.integer :tags, array: true, null: false t.timestamps end end end
Fix field type in materials migration
Fix field type in materials migration
Ruby
mit
catapod/Transfer,catapod/Transfer,catapod/Transfer
ruby
## Code Before: class CreateMaterials < ActiveRecord::Migration[5.0] def change create_table :materials do |t| t.references :rightholder, index: true, foreign_key: { to_table: :rightholders } t.references :owner, index: true, foreign_key: { to_table: :users } t.string :original_link, null: true t.string :caption_original, null: false t.string :caption_translated, null: true t.text :annotation_original, null: false t.text :annotation_translated, null: true t.references :state, index: true, foreign_key: { to_table: :states } t.references :license, index: true, foreign_key: { to_table: :licenses } t.string :original_language, null: false t.string :translation_language, null: false t.string :tags, array: true, null: false t.timestamps end end end ## Instruction: Fix field type in materials migration ## Code After: class CreateMaterials < ActiveRecord::Migration[5.0] def change create_table :materials do |t| t.references :rightholder, index: true, foreign_key: { to_table: :rightholders } t.references :owner, index: true, foreign_key: { to_table: :users } t.string :original_link, null: true t.string :caption_original, null: false t.string :caption_translated, null: true t.text :annotation_original, null: false t.text :annotation_translated, null: true t.references :state, index: true, foreign_key: { to_table: :states } t.references :license, index: true, foreign_key: { to_table: :licenses } t.string :original_language, null: false t.string :translation_language, null: false t.integer :tags, array: true, null: false t.timestamps end end end
class CreateMaterials < ActiveRecord::Migration[5.0] def change create_table :materials do |t| t.references :rightholder, index: true, foreign_key: { to_table: :rightholders } t.references :owner, index: true, foreign_key: { to_table: :users } t.string :original_link, null: true t.string :caption_original, null: false t.string :caption_translated, null: true - t.text :annotation_original, null: false ? -- + t.text :annotation_original, null: false - t.text :annotation_translated, null: true ? -- + t.text :annotation_translated, null: true t.references :state, index: true, foreign_key: { to_table: :states } t.references :license, index: true, foreign_key: { to_table: :licenses } t.string :original_language, null: false t.string :translation_language, null: false - t.string :tags, array: true, null: false ? --- + t.integer :tags, array: true, null: false ? ++ ++ t.timestamps end end end
6
0.315789
3
3
6c510b869308ed627adf9ab9beb51f8c79829078
dist/utilities/_icon-font.scss
dist/utilities/_icon-font.scss
// Icon Font // ========= // // Dependencies: // // * This assumes a font icon set has been added using the web-font() mixin @mixin icon-font($position: 'before', $size: inherit, $color: inherit, $margin: 0, $width: 1em) { &::#{$position} { display: inline-block; color: $color; font: { family: $icon-font; size: $size; style: normal; weight: normal; } text-decoration: inherit; vertical-align: middle; // Apply appropriate margins whether it's before or after; @if $position == 'before' { margin-right: $margin; } @else if $position == 'after' { margin-left: $margin; } } }
// Icon Font // ========= // // Dependencies: // // * This assumes a font icon set has been added using the web-font() mixin // * $icon-font must be defined @mixin icon-font($position: 'before', $size: inherit, $color: inherit, $margin: 0, $width: 1em) { &::#{$position} { display: inline-block; color: $color; font: { family: $icon-font; size: $size; style: normal; weight: normal; } text-decoration: inherit; vertical-align: middle; // Apply appropriate margins whether it's before or after; @if $position == 'before' { margin-right: $margin; } @else if $position == 'after' { margin-left: $margin; } } }
Add dependency comment for the $icon-font variable
Add dependency comment for the $icon-font variable
SCSS
mit
mobify/spline,mobify/spline
scss
## Code Before: // Icon Font // ========= // // Dependencies: // // * This assumes a font icon set has been added using the web-font() mixin @mixin icon-font($position: 'before', $size: inherit, $color: inherit, $margin: 0, $width: 1em) { &::#{$position} { display: inline-block; color: $color; font: { family: $icon-font; size: $size; style: normal; weight: normal; } text-decoration: inherit; vertical-align: middle; // Apply appropriate margins whether it's before or after; @if $position == 'before' { margin-right: $margin; } @else if $position == 'after' { margin-left: $margin; } } } ## Instruction: Add dependency comment for the $icon-font variable ## Code After: // Icon Font // ========= // // Dependencies: // // * This assumes a font icon set has been added using the web-font() mixin // * $icon-font must be defined @mixin icon-font($position: 'before', $size: inherit, $color: inherit, $margin: 0, $width: 1em) { &::#{$position} { display: inline-block; color: $color; font: { family: $icon-font; size: $size; style: normal; weight: normal; } text-decoration: inherit; vertical-align: middle; // Apply appropriate margins whether it's before or after; @if $position == 'before' { margin-right: $margin; } @else if $position == 'after' { margin-left: $margin; } } }
// Icon Font // ========= // // Dependencies: // // * This assumes a font icon set has been added using the web-font() mixin + // * $icon-font must be defined @mixin icon-font($position: 'before', $size: inherit, $color: inherit, $margin: 0, $width: 1em) { &::#{$position} { display: inline-block; color: $color; font: { family: $icon-font; size: $size; style: normal; weight: normal; } text-decoration: inherit; vertical-align: middle; // Apply appropriate margins whether it's before or after; @if $position == 'before' { margin-right: $margin; } @else if $position == 'after' { margin-left: $margin; } } }
1
0.032258
1
0
9185c0bcc679e1f28d20d64e1c8e2e39b64d51b5
.eslintrc.yml
.eslintrc.yml
env: browser: true es6: false extends: "eslint:recommended" globals: $: readonly App: readonly annotator: readonly c3: readonly CKEDITOR: readonly L: readonly Turbolinks: readonly parserOptions: ecmaVersion: 5 rules: array-bracket-spacing: error block-spacing: error brace-style: error comma-spacing: error computed-property-spacing: error curly: error eol-last: error func-call-spacing: error indent: - error - 2 key-spacing: error keyword-spacing: error linebreak-style: error lines-between-class-members: error no-console: error no-multi-spaces: error no-multiple-empty-lines: - error - max: 1 no-spaced-func: error no-tabs: error no-trailing-spaces: error no-void: error no-whitespace-before-property: error object-curly-spacing: - error - always - objectsInObjects: false padded-blocks: - error - never quotes: - error - double - avoidEscape: true semi-spacing: error space-before-blocks: error space-before-function-paren: - error - never space-in-parens: error space-infix-ops: error space-unary-ops: error spaced-comment: - error - always - markers: - "=" exceptions: - "-" strict: error switch-colon-spacing: error
env: browser: true es6: false extends: "eslint:recommended" globals: $: readonly App: readonly annotator: readonly c3: readonly CKEDITOR: readonly L: readonly Turbolinks: readonly parserOptions: ecmaVersion: 5 rules: array-bracket-spacing: error block-spacing: error brace-style: error comma-spacing: error computed-property-spacing: error curly: error eol-last: error func-call-spacing: error indent: - error - 2 key-spacing: error keyword-spacing: error linebreak-style: error lines-between-class-members: error no-console: error no-multi-spaces: error no-multiple-empty-lines: - error - max: 1 no-spaced-func: error no-tabs: error no-trailing-spaces: error no-void: error no-whitespace-before-property: error object-curly-spacing: - error - always - objectsInObjects: false padded-blocks: - error - never quotes: - error - double - avoidEscape: true semi: - error - always semi-spacing: error space-before-blocks: error space-before-function-paren: - error - never space-in-parens: error space-infix-ops: error space-unary-ops: error spaced-comment: - error - always - markers: - "=" exceptions: - "-" strict: error switch-colon-spacing: error
Add JavaScript rule for semi colons
Add JavaScript rule for semi colons While I personally prefer the "never" option for this rule, we haven't discussed which guideline to follow, so for now I'm applying the rule CoffeeScript used when generating these files.
YAML
agpl-3.0
consul/consul,usabi/consul_san_borondon,usabi/consul_san_borondon,usabi/consul_san_borondon,usabi/consul_san_borondon,consul/consul,consul/consul,consul/consul,consul/consul
yaml
## Code Before: env: browser: true es6: false extends: "eslint:recommended" globals: $: readonly App: readonly annotator: readonly c3: readonly CKEDITOR: readonly L: readonly Turbolinks: readonly parserOptions: ecmaVersion: 5 rules: array-bracket-spacing: error block-spacing: error brace-style: error comma-spacing: error computed-property-spacing: error curly: error eol-last: error func-call-spacing: error indent: - error - 2 key-spacing: error keyword-spacing: error linebreak-style: error lines-between-class-members: error no-console: error no-multi-spaces: error no-multiple-empty-lines: - error - max: 1 no-spaced-func: error no-tabs: error no-trailing-spaces: error no-void: error no-whitespace-before-property: error object-curly-spacing: - error - always - objectsInObjects: false padded-blocks: - error - never quotes: - error - double - avoidEscape: true semi-spacing: error space-before-blocks: error space-before-function-paren: - error - never space-in-parens: error space-infix-ops: error space-unary-ops: error spaced-comment: - error - always - markers: - "=" exceptions: - "-" strict: error switch-colon-spacing: error ## Instruction: Add JavaScript rule for semi colons While I personally prefer the "never" option for this rule, we haven't discussed which guideline to follow, so for now I'm applying the rule CoffeeScript used when generating these files. ## Code After: env: browser: true es6: false extends: "eslint:recommended" globals: $: readonly App: readonly annotator: readonly c3: readonly CKEDITOR: readonly L: readonly Turbolinks: readonly parserOptions: ecmaVersion: 5 rules: array-bracket-spacing: error block-spacing: error brace-style: error comma-spacing: error computed-property-spacing: error curly: error eol-last: error func-call-spacing: error indent: - error - 2 key-spacing: error keyword-spacing: error linebreak-style: error lines-between-class-members: error no-console: error no-multi-spaces: error no-multiple-empty-lines: - error - max: 1 no-spaced-func: error no-tabs: error no-trailing-spaces: error no-void: error no-whitespace-before-property: error object-curly-spacing: - error - always - objectsInObjects: false padded-blocks: - error - never quotes: - error - double - avoidEscape: true semi: - error - always semi-spacing: error space-before-blocks: error space-before-function-paren: - error - never space-in-parens: error space-infix-ops: error space-unary-ops: error spaced-comment: - error - always - markers: - "=" exceptions: - "-" strict: error switch-colon-spacing: error
env: browser: true es6: false extends: "eslint:recommended" globals: $: readonly App: readonly annotator: readonly c3: readonly CKEDITOR: readonly L: readonly Turbolinks: readonly parserOptions: ecmaVersion: 5 rules: array-bracket-spacing: error block-spacing: error brace-style: error comma-spacing: error computed-property-spacing: error curly: error eol-last: error func-call-spacing: error indent: - error - 2 key-spacing: error keyword-spacing: error linebreak-style: error lines-between-class-members: error no-console: error no-multi-spaces: error no-multiple-empty-lines: - error - max: 1 no-spaced-func: error no-tabs: error no-trailing-spaces: error no-void: error no-whitespace-before-property: error object-curly-spacing: - error - always - objectsInObjects: false padded-blocks: - error - never quotes: - error - double - avoidEscape: true + semi: + - error + - always semi-spacing: error space-before-blocks: error space-before-function-paren: - error - never space-in-parens: error space-infix-ops: error space-unary-ops: error spaced-comment: - error - always - markers: - "=" exceptions: - "-" strict: error switch-colon-spacing: error
3
0.044118
3
0
0102bf31a0de9c65bbbc923a68d9f2a5df741c97
test/controllers/account/integrations_controller_test.rb
test/controllers/account/integrations_controller_test.rb
require "test_helper" class Account::IntegrationsControllerTest < ActionController::TestCase end
require "test_helper" class Account::IntegrationsControllerTest < ActionController::TestCase setup do @user = users(:gaston) sign_in @user end test "#index" do get :index assert_response :success end test "#index is not authorized when signed out" do sign_out get :index assert_redirected_to_auth_new end test "#new" do get :new assert_response :success Authorization.available_providers.each do |provider| assert_select "a[href=?]", auth_authorize_path(provider) end end test "#new is not authorized when signed out" do sign_out get :new assert_redirected_to_auth_new end end
Add tests for the integration controller
Add tests for the integration controller
Ruby
mit
maximebedard/remets,maximebedard/remets,maximebedard/remets
ruby
## Code Before: require "test_helper" class Account::IntegrationsControllerTest < ActionController::TestCase end ## Instruction: Add tests for the integration controller ## Code After: require "test_helper" class Account::IntegrationsControllerTest < ActionController::TestCase setup do @user = users(:gaston) sign_in @user end test "#index" do get :index assert_response :success end test "#index is not authorized when signed out" do sign_out get :index assert_redirected_to_auth_new end test "#new" do get :new assert_response :success Authorization.available_providers.each do |provider| assert_select "a[href=?]", auth_authorize_path(provider) end end test "#new is not authorized when signed out" do sign_out get :new assert_redirected_to_auth_new end end
require "test_helper" class Account::IntegrationsControllerTest < ActionController::TestCase + setup do + @user = users(:gaston) + sign_in @user + end + + test "#index" do + get :index + assert_response :success + end + + test "#index is not authorized when signed out" do + sign_out + + get :index + assert_redirected_to_auth_new + end + + test "#new" do + get :new + assert_response :success + + Authorization.available_providers.each do |provider| + assert_select "a[href=?]", auth_authorize_path(provider) + end + end + + test "#new is not authorized when signed out" do + sign_out + + get :new + assert_redirected_to_auth_new + end end
32
8
32
0
bd5b9a4678471580328fbf0668277920cd113f65
README.md
README.md
The marketplace for on demmand changes
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fworknenjoy%2Fgitpay.svg?type=shield)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fworknenjoy%2Fgitpay?ref=badge_shield) The marketplace for on demmand changes ## License [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fworknenjoy%2Fgitpay.svg?type=large)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fworknenjoy%2Fgitpay?ref=badge_large)
Add license scan report and status
Add license scan report and status
Markdown
agpl-3.0
worknenjoy/gitpay,worknenjoy/gitpay,worknenjoy/gitpay
markdown
## Code Before: The marketplace for on demmand changes ## Instruction: Add license scan report and status ## Code After: [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fworknenjoy%2Fgitpay.svg?type=shield)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fworknenjoy%2Fgitpay?ref=badge_shield) The marketplace for on demmand changes ## License [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fworknenjoy%2Fgitpay.svg?type=large)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fworknenjoy%2Fgitpay?ref=badge_large)
+ [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fworknenjoy%2Fgitpay.svg?type=shield)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fworknenjoy%2Fgitpay?ref=badge_shield) + The marketplace for on demmand changes + + + ## License + [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fworknenjoy%2Fgitpay.svg?type=large)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fworknenjoy%2Fgitpay?ref=badge_large)
6
6
6
0
886b69be4ab61773844ec1311373c70aaffcf0b3
setup.cfg
setup.cfg
[easy_install] zip_ok = 0 always_copy = False [sdist] formats=gztar,zip [egg_info] tag_build = dev [develop] optimize=1 [install] optimize=1
[easy_install] zip_ok = 0 always_copy = False [sdist] formats=gztar,zip [egg_info] tag_build = dev tag_date = 1 [develop] optimize=1 [install] optimize=1
Add a date tag to dev builds.
Add a date tag to dev builds.
INI
mit
Schevo/schevodurus
ini
## Code Before: [easy_install] zip_ok = 0 always_copy = False [sdist] formats=gztar,zip [egg_info] tag_build = dev [develop] optimize=1 [install] optimize=1 ## Instruction: Add a date tag to dev builds. ## Code After: [easy_install] zip_ok = 0 always_copy = False [sdist] formats=gztar,zip [egg_info] tag_build = dev tag_date = 1 [develop] optimize=1 [install] optimize=1
[easy_install] zip_ok = 0 always_copy = False [sdist] formats=gztar,zip [egg_info] tag_build = dev + tag_date = 1 [develop] optimize=1 [install] optimize=1
1
0.066667
1
0
d3933d58b2ebcb0fb0c6301344335ae018973774
n_pair_mc_loss.py
n_pair_mc_loss.py
from chainer import cuda from chainer.functions import matmul from chainer.functions import transpose from chainer.functions import softmax_cross_entropy from chainer.functions import batch_l2_norm_squared def n_pair_mc_loss(f, f_p, l2_reg): """Multi-class N-pair loss (N-pair-mc loss) function. Args: f (~chainer.Variable): Feature vectors. All examples must be different classes each other. f_p (~chainer.Variable): Positive examples corresponding to f. Each example must be the same class for each example in f. l2_reg (~float): A weight of L2 regularization for feature vectors. Returns: ~chainer.Variable: Loss value. See: `Improved Deep Metric Learning with Multi-class N-pair Loss \ Objective <https://papers.nips.cc/paper/6200-improved-deep-metric-\ learning-with-multi-class-n-pair-loss-objective>`_ """ logit = matmul(f, transpose(f_p)) N = len(logit.data) xp = cuda.get_array_module(logit.data) loss_sce = softmax_cross_entropy(logit, xp.arange(N)) l2_loss = sum(batch_l2_norm_squared(f) + batch_l2_norm_squared(f_p)) loss = loss_sce + l2_reg * l2_loss return loss
from chainer import cuda from chainer.functions import matmul from chainer.functions import transpose from chainer.functions import softmax_cross_entropy from chainer.functions import batch_l2_norm_squared def n_pair_mc_loss(f, f_p, l2_reg): """Multi-class N-pair loss (N-pair-mc loss) function. Args: f (~chainer.Variable): Feature vectors. All examples must be different classes each other. f_p (~chainer.Variable): Positive examples corresponding to f. Each example must be the same class for each example in f. l2_reg (~float): A weight of L2 regularization for feature vectors. Returns: ~chainer.Variable: Loss value. See: `Improved Deep Metric Learning with Multi-class N-pair Loss \ Objective <https://papers.nips.cc/paper/6200-improved-deep-metric-\ learning-with-multi-class-n-pair-loss-objective>`_ """ logit = matmul(f, transpose(f_p)) N = len(logit.data) xp = cuda.get_array_module(logit.data) loss_sce = softmax_cross_entropy(logit, xp.arange(N)) l2_loss = sum(batch_l2_norm_squared(f) + batch_l2_norm_squared(f_p)) / (2.0 * N) loss = loss_sce + l2_reg * l2_loss return loss
Modify to average the L2 norm loss of output vectors
Modify to average the L2 norm loss of output vectors
Python
mit
ronekko/deep_metric_learning
python
## Code Before: from chainer import cuda from chainer.functions import matmul from chainer.functions import transpose from chainer.functions import softmax_cross_entropy from chainer.functions import batch_l2_norm_squared def n_pair_mc_loss(f, f_p, l2_reg): """Multi-class N-pair loss (N-pair-mc loss) function. Args: f (~chainer.Variable): Feature vectors. All examples must be different classes each other. f_p (~chainer.Variable): Positive examples corresponding to f. Each example must be the same class for each example in f. l2_reg (~float): A weight of L2 regularization for feature vectors. Returns: ~chainer.Variable: Loss value. See: `Improved Deep Metric Learning with Multi-class N-pair Loss \ Objective <https://papers.nips.cc/paper/6200-improved-deep-metric-\ learning-with-multi-class-n-pair-loss-objective>`_ """ logit = matmul(f, transpose(f_p)) N = len(logit.data) xp = cuda.get_array_module(logit.data) loss_sce = softmax_cross_entropy(logit, xp.arange(N)) l2_loss = sum(batch_l2_norm_squared(f) + batch_l2_norm_squared(f_p)) loss = loss_sce + l2_reg * l2_loss return loss ## Instruction: Modify to average the L2 norm loss of output vectors ## Code After: from chainer import cuda from chainer.functions import matmul from chainer.functions import transpose from chainer.functions import softmax_cross_entropy from chainer.functions import batch_l2_norm_squared def n_pair_mc_loss(f, f_p, l2_reg): """Multi-class N-pair loss (N-pair-mc loss) function. Args: f (~chainer.Variable): Feature vectors. All examples must be different classes each other. f_p (~chainer.Variable): Positive examples corresponding to f. Each example must be the same class for each example in f. l2_reg (~float): A weight of L2 regularization for feature vectors. Returns: ~chainer.Variable: Loss value. See: `Improved Deep Metric Learning with Multi-class N-pair Loss \ Objective <https://papers.nips.cc/paper/6200-improved-deep-metric-\ learning-with-multi-class-n-pair-loss-objective>`_ """ logit = matmul(f, transpose(f_p)) N = len(logit.data) xp = cuda.get_array_module(logit.data) loss_sce = softmax_cross_entropy(logit, xp.arange(N)) l2_loss = sum(batch_l2_norm_squared(f) + batch_l2_norm_squared(f_p)) / (2.0 * N) loss = loss_sce + l2_reg * l2_loss return loss
from chainer import cuda from chainer.functions import matmul from chainer.functions import transpose from chainer.functions import softmax_cross_entropy from chainer.functions import batch_l2_norm_squared def n_pair_mc_loss(f, f_p, l2_reg): """Multi-class N-pair loss (N-pair-mc loss) function. Args: f (~chainer.Variable): Feature vectors. All examples must be different classes each other. f_p (~chainer.Variable): Positive examples corresponding to f. Each example must be the same class for each example in f. l2_reg (~float): A weight of L2 regularization for feature vectors. Returns: ~chainer.Variable: Loss value. See: `Improved Deep Metric Learning with Multi-class N-pair Loss \ Objective <https://papers.nips.cc/paper/6200-improved-deep-metric-\ learning-with-multi-class-n-pair-loss-objective>`_ """ logit = matmul(f, transpose(f_p)) N = len(logit.data) xp = cuda.get_array_module(logit.data) loss_sce = softmax_cross_entropy(logit, xp.arange(N)) - l2_loss = sum(batch_l2_norm_squared(f) + batch_l2_norm_squared(f_p)) ? ---------------------------- + l2_loss = sum(batch_l2_norm_squared(f) + + batch_l2_norm_squared(f_p)) / (2.0 * N) loss = loss_sce + l2_reg * l2_loss return loss
3
0.09375
2
1
04ce6d407b453983740c1621fb37196abda0c38a
src/main/java/com/intel/alex/Utils/ExcelUtil.java
src/main/java/com/intel/alex/Utils/ExcelUtil.java
package com.intel.alex.Utils; /** * Created by root on 3/7/16. */ public class ExcelUtil { }
package com.intel.alex.Utils; import jxl.Workbook; import jxl.write.*; import java.io.*; import java.lang.*; /** * Created by root on 3/7/16. */ public class ExcelUtil { private final String logDir; public ExcelUtil(String logDir) { this.logDir = logDir; } public void csv2Excel() { File csvFile = new File(logDir + "/run-logs/BigBenchTimes.csv"); FileReader fileReader; try{ WritableWorkbook book;// File excFile = new File("/home/BigBenchTimes.xls");// book = Workbook.createWorkbook(excFile);// int num = book.getNumberOfSheets(); WritableSheet sheet0 = book.createSheet("BigBenchTimes",num); WritableSheet sheet1 = book.createSheet("PowerTestTime",num+1); //1 is needed to change WritableSheet sheet2 = book.createSheet("ThroughPutTestTime_allstreams",num+2); fileReader = new FileReader(csvFile); BufferedReader br = new BufferedReader(fileReader); int i=0; int p=0; int t=0; String line ; while ((line=br.readLine())!=null){ String s[]= line.split(";"); if(s.length > 3){ for(int j=0; j< s.length; j++){ Label label = new Label(j, i, s[j]); sheet0.addCell(label); } if(s[1].equals("POWER_TEST")){ for(int j =0; j< s.length; j++){ Label label =new Label(j,p,s[j]); sheet1.addCell(label); } p++; } if(s[1].equals("THROUGHPUT_TEST_1")){ for(int j =0; j< s.length; j++){ Label label =new Label(j,t,s[j]); sheet2.addCell(label); } t++; } } i++; } br.close(); fileReader.close(); book.write(); book.close(); } catch (Exception e) { e.printStackTrace(); } } }
Add the function of generating excel file.
Add the function of generating excel file.
Java
apache-2.0
LifengWang/ReportGen,LifengWang/ReportGen,LifengWang/ReportGen
java
## Code Before: package com.intel.alex.Utils; /** * Created by root on 3/7/16. */ public class ExcelUtil { } ## Instruction: Add the function of generating excel file. ## Code After: package com.intel.alex.Utils; import jxl.Workbook; import jxl.write.*; import java.io.*; import java.lang.*; /** * Created by root on 3/7/16. */ public class ExcelUtil { private final String logDir; public ExcelUtil(String logDir) { this.logDir = logDir; } public void csv2Excel() { File csvFile = new File(logDir + "/run-logs/BigBenchTimes.csv"); FileReader fileReader; try{ WritableWorkbook book;// File excFile = new File("/home/BigBenchTimes.xls");// book = Workbook.createWorkbook(excFile);// int num = book.getNumberOfSheets(); WritableSheet sheet0 = book.createSheet("BigBenchTimes",num); WritableSheet sheet1 = book.createSheet("PowerTestTime",num+1); //1 is needed to change WritableSheet sheet2 = book.createSheet("ThroughPutTestTime_allstreams",num+2); fileReader = new FileReader(csvFile); BufferedReader br = new BufferedReader(fileReader); int i=0; int p=0; int t=0; String line ; while ((line=br.readLine())!=null){ String s[]= line.split(";"); if(s.length > 3){ for(int j=0; j< s.length; j++){ Label label = new Label(j, i, s[j]); sheet0.addCell(label); } if(s[1].equals("POWER_TEST")){ for(int j =0; j< s.length; j++){ Label label =new Label(j,p,s[j]); sheet1.addCell(label); } p++; } if(s[1].equals("THROUGHPUT_TEST_1")){ for(int j =0; j< s.length; j++){ Label label =new Label(j,t,s[j]); sheet2.addCell(label); } t++; } } i++; } br.close(); fileReader.close(); book.write(); book.close(); } catch (Exception e) { e.printStackTrace(); } } }
package com.intel.alex.Utils; + + + import jxl.Workbook; + + import jxl.write.*; + + import java.io.*; + import java.lang.*; /** * Created by root on 3/7/16. */ public class ExcelUtil { + private final String logDir; + + public ExcelUtil(String logDir) { + this.logDir = logDir; + } + + public void csv2Excel() { + File csvFile = new File(logDir + "/run-logs/BigBenchTimes.csv"); + FileReader fileReader; + try{ + WritableWorkbook book;// + File excFile = new File("/home/BigBenchTimes.xls");// + book = Workbook.createWorkbook(excFile);// + int num = book.getNumberOfSheets(); + WritableSheet sheet0 = book.createSheet("BigBenchTimes",num); + WritableSheet sheet1 = book.createSheet("PowerTestTime",num+1); //1 is needed to change + WritableSheet sheet2 = book.createSheet("ThroughPutTestTime_allstreams",num+2); + + fileReader = new FileReader(csvFile); + BufferedReader br = new BufferedReader(fileReader); + int i=0; + int p=0; + int t=0; + String line ; + while ((line=br.readLine())!=null){ + String s[]= line.split(";"); + if(s.length > 3){ + for(int j=0; j< s.length; j++){ + Label label = new Label(j, i, s[j]); + sheet0.addCell(label); + } + if(s[1].equals("POWER_TEST")){ + for(int j =0; j< s.length; j++){ + Label label =new Label(j,p,s[j]); + sheet1.addCell(label); + } + p++; + } + if(s[1].equals("THROUGHPUT_TEST_1")){ + for(int j =0; j< s.length; j++){ + Label label =new Label(j,t,s[j]); + sheet2.addCell(label); + } + t++; + } + } + i++; + } + br.close(); + fileReader.close(); + book.write(); + book.close(); + } catch (Exception e) { + e.printStackTrace(); + } + + + } }
66
9.428571
66
0
36e00778befd9e6763236b771a77184d31c3c885
babbage_fiscal/tasks.py
babbage_fiscal/tasks.py
from celery import Celery import requests from .config import get_engine, _set_connection_string from .loader import FDPLoader app = Celery('fdp_loader') app.config_from_object('babbage_fiscal.celeryconfig') @app.task def load_fdp_task(package, callback, connection_string=None): if connection_string is not None: _set_connection_string(connection_string) FDPLoader.load_fdp_to_db(package, get_engine()) ret = requests.get(callback)
from celery import Celery import requests from .config import get_engine, _set_connection_string from .loader import FDPLoader app = Celery('fdp_loader') app.config_from_object('babbage_fiscal.celeryconfig') @app.task def load_fdp_task(package, callback, connection_string=None): if connection_string is not None: _set_connection_string(connection_string) try: FDPLoader.load_fdp_to_db(package, get_engine()) requests.get(callback, params={'package': package, 'status': 'done'}) except Exception as e: requests.get(callback, params={'package': package, 'status': 'fail', 'error': str(e)})
Add more info to the callback
Add more info to the callback
Python
mit
openspending/babbage.fiscal-data-package
python
## Code Before: from celery import Celery import requests from .config import get_engine, _set_connection_string from .loader import FDPLoader app = Celery('fdp_loader') app.config_from_object('babbage_fiscal.celeryconfig') @app.task def load_fdp_task(package, callback, connection_string=None): if connection_string is not None: _set_connection_string(connection_string) FDPLoader.load_fdp_to_db(package, get_engine()) ret = requests.get(callback) ## Instruction: Add more info to the callback ## Code After: from celery import Celery import requests from .config import get_engine, _set_connection_string from .loader import FDPLoader app = Celery('fdp_loader') app.config_from_object('babbage_fiscal.celeryconfig') @app.task def load_fdp_task(package, callback, connection_string=None): if connection_string is not None: _set_connection_string(connection_string) try: FDPLoader.load_fdp_to_db(package, get_engine()) requests.get(callback, params={'package': package, 'status': 'done'}) except Exception as e: requests.get(callback, params={'package': package, 'status': 'fail', 'error': str(e)})
from celery import Celery import requests from .config import get_engine, _set_connection_string from .loader import FDPLoader app = Celery('fdp_loader') app.config_from_object('babbage_fiscal.celeryconfig') @app.task def load_fdp_task(package, callback, connection_string=None): if connection_string is not None: _set_connection_string(connection_string) + try: - FDPLoader.load_fdp_to_db(package, get_engine()) + FDPLoader.load_fdp_to_db(package, get_engine()) ? ++++ - ret = requests.get(callback) + requests.get(callback, params={'package': package, 'status': 'done'}) + except Exception as e: + requests.get(callback, params={'package': package, 'status': 'fail', 'error': str(e)})
7
0.466667
5
2
1c15c97091298581798495387f8ff98f6379e0b9
assets/stylesheets/layout/_assemblies.scss
assets/stylesheets/layout/_assemblies.scss
@import "../settings"; @import "../tools/mixins/layout"; // View assemblies // Define how components stack in views * + { form, .c-form-group, .c-form-fieldset, .c-error-summary, .results-summary { margin-top: $default-spacing-unit * 2; } .c-form-group--compact { margin-top: $default-spacing-unit; } .c-multiple-choice { margin-top: $default-spacing-unit / 2; } .c-meta-container, .c-multiple-choice--smaller { margin-top: $baseline-grid-unit; } .metadata-list { margin-top: $default-spacing-unit / 4; } .c-form-fieldset--subfield, .c-form-group--subfield { margin-top: $default-spacing-unit; margin-bottom: $default-spacing-unit; } .c-pagination { margin-top: $default-spacing-unit * 2; margin-bottom: $default-spacing-unit * 2; } } [type="hidden"] + .c-form-group { margin-top: 0; } .c-results__sort + .c-entity-list { border-top: 1px solid $grey-2; }
@import "../settings"; @import "../tools/mixins/layout"; // View assemblies // Define how components stack in views * + { form, .c-form-group, .c-form-fieldset, .c-error-summary, .results-summary { margin-top: $default-spacing-unit * 2; } .c-form-group--compact { margin-top: $default-spacing-unit; } .c-multiple-choice, .c-meta-list { margin-top: $default-spacing-unit / 2; } .c-meta-container, .c-multiple-choice--smaller { margin-top: $baseline-grid-unit; } .metadata-list { margin-top: $default-spacing-unit / 4; } .c-form-fieldset--subfield, .c-form-group--subfield { margin-top: $default-spacing-unit; margin-bottom: $default-spacing-unit; } .c-pagination { margin-top: $default-spacing-unit * 2; margin-bottom: $default-spacing-unit * 2; } } [type="hidden"] + .c-form-group { margin-top: 0; } .c-results__sort + .c-entity-list { border-top: 1px solid $grey-2; }
Add meta-list to assemblies CSS
Add meta-list to assemblies CSS
SCSS
mit
uktrade/data-hub-frontend,uktrade/data-hub-fe-beta2,uktrade/data-hub-fe-beta2,uktrade/data-hub-frontend,uktrade/data-hub-frontend
scss
## Code Before: @import "../settings"; @import "../tools/mixins/layout"; // View assemblies // Define how components stack in views * + { form, .c-form-group, .c-form-fieldset, .c-error-summary, .results-summary { margin-top: $default-spacing-unit * 2; } .c-form-group--compact { margin-top: $default-spacing-unit; } .c-multiple-choice { margin-top: $default-spacing-unit / 2; } .c-meta-container, .c-multiple-choice--smaller { margin-top: $baseline-grid-unit; } .metadata-list { margin-top: $default-spacing-unit / 4; } .c-form-fieldset--subfield, .c-form-group--subfield { margin-top: $default-spacing-unit; margin-bottom: $default-spacing-unit; } .c-pagination { margin-top: $default-spacing-unit * 2; margin-bottom: $default-spacing-unit * 2; } } [type="hidden"] + .c-form-group { margin-top: 0; } .c-results__sort + .c-entity-list { border-top: 1px solid $grey-2; } ## Instruction: Add meta-list to assemblies CSS ## Code After: @import "../settings"; @import "../tools/mixins/layout"; // View assemblies // Define how components stack in views * + { form, .c-form-group, .c-form-fieldset, .c-error-summary, .results-summary { margin-top: $default-spacing-unit * 2; } .c-form-group--compact { margin-top: $default-spacing-unit; } .c-multiple-choice, .c-meta-list { margin-top: $default-spacing-unit / 2; } .c-meta-container, .c-multiple-choice--smaller { margin-top: $baseline-grid-unit; } .metadata-list { margin-top: $default-spacing-unit / 4; } .c-form-fieldset--subfield, .c-form-group--subfield { margin-top: $default-spacing-unit; margin-bottom: $default-spacing-unit; } .c-pagination { margin-top: $default-spacing-unit * 2; margin-bottom: $default-spacing-unit * 2; } } [type="hidden"] + .c-form-group { margin-top: 0; } .c-results__sort + .c-entity-list { border-top: 1px solid $grey-2; }
@import "../settings"; @import "../tools/mixins/layout"; // View assemblies // Define how components stack in views * + { form, .c-form-group, .c-form-fieldset, .c-error-summary, .results-summary { margin-top: $default-spacing-unit * 2; } .c-form-group--compact { margin-top: $default-spacing-unit; } - .c-multiple-choice { ? ^^ + .c-multiple-choice, ? ^ + .c-meta-list { margin-top: $default-spacing-unit / 2; } .c-meta-container, .c-multiple-choice--smaller { margin-top: $baseline-grid-unit; } .metadata-list { margin-top: $default-spacing-unit / 4; } .c-form-fieldset--subfield, .c-form-group--subfield { margin-top: $default-spacing-unit; margin-bottom: $default-spacing-unit; } .c-pagination { margin-top: $default-spacing-unit * 2; margin-bottom: $default-spacing-unit * 2; } } [type="hidden"] + .c-form-group { margin-top: 0; } .c-results__sort + .c-entity-list { border-top: 1px solid $grey-2; }
3
0.058824
2
1
ad2772172b1e589df88d4c065ceb685b7fe442af
.travis.yml
.travis.yml
language: python env: - DJANGO_VERSION=https://github.com/django/django/archive/stable/1.4.x.zip - DJANGO_VERSION=1.5.12 - DJANGO_VERSION=1.6.11 - DJANGO_VERSION=https://github.com/django/django/archive/stable/1.7.x.zip - DJANGO_VERSION=https://github.com/django/django/archive/stable/1.8.x.zip python: - "2.6" - "2.7" - "3.3" - "3.4" - "pypy" matrix: exclude: - python: "3.3" env: DJANGO_VERSION=https://github.com/django/django/archive/stable/1.4.x.zip - python: "3.4" env: DJANGO_VERSION=https://github.com/django/django/archive/stable/1.4.x.zip - python: "2.6" env: DJANGO_VERSION=https://github.com/django/django/archive/stable/1.7.x.zip - python: "2.6" env: DJANGO_VERSION=https://github.com/django/django/archive/stable/1.8.x.zip install: - pip install django==$DJANGO_VERSION nose --use-mirrors - pip install . --use-mirrors script: - nosetests tests/tests.py
language: python env: - DJANGO_VERSION=1.4 - DJANGO_VERSION=1.5 - DJANGO_VERSION=1.6 - DJANGO_VERSION=1.7 - DJANGO_VERSION=1.8 python: - "2.6" - "2.7" - "3.3" - "3.4" - "pypy" matrix: exclude: - python: "3.3" env: DJANGO_VERSION=1.4 - python: "3.4" env: DJANGO_VERSION=1.4 - python: "2.6" env: DJANGO_VERSION=1.7 - python: "2.6" env: DJANGO_VERSION=1.8 install: - pip install django==$DJANGO_VERSION nose --use-mirrors - pip install . --use-mirrors script: - nosetests tests/tests.py
Test against PyPI Django releases
Test against PyPI Django releases
YAML
bsd-3-clause
AlexHill/djpj,AlexHill/djpj
yaml
## Code Before: language: python env: - DJANGO_VERSION=https://github.com/django/django/archive/stable/1.4.x.zip - DJANGO_VERSION=1.5.12 - DJANGO_VERSION=1.6.11 - DJANGO_VERSION=https://github.com/django/django/archive/stable/1.7.x.zip - DJANGO_VERSION=https://github.com/django/django/archive/stable/1.8.x.zip python: - "2.6" - "2.7" - "3.3" - "3.4" - "pypy" matrix: exclude: - python: "3.3" env: DJANGO_VERSION=https://github.com/django/django/archive/stable/1.4.x.zip - python: "3.4" env: DJANGO_VERSION=https://github.com/django/django/archive/stable/1.4.x.zip - python: "2.6" env: DJANGO_VERSION=https://github.com/django/django/archive/stable/1.7.x.zip - python: "2.6" env: DJANGO_VERSION=https://github.com/django/django/archive/stable/1.8.x.zip install: - pip install django==$DJANGO_VERSION nose --use-mirrors - pip install . --use-mirrors script: - nosetests tests/tests.py ## Instruction: Test against PyPI Django releases ## Code After: language: python env: - DJANGO_VERSION=1.4 - DJANGO_VERSION=1.5 - DJANGO_VERSION=1.6 - DJANGO_VERSION=1.7 - DJANGO_VERSION=1.8 python: - "2.6" - "2.7" - "3.3" - "3.4" - "pypy" matrix: exclude: - python: "3.3" env: DJANGO_VERSION=1.4 - python: "3.4" env: DJANGO_VERSION=1.4 - python: "2.6" env: DJANGO_VERSION=1.7 - python: "2.6" env: DJANGO_VERSION=1.8 install: - pip install django==$DJANGO_VERSION nose --use-mirrors - pip install . --use-mirrors script: - nosetests tests/tests.py
language: python env: - - DJANGO_VERSION=https://github.com/django/django/archive/stable/1.4.x.zip + - DJANGO_VERSION=1.4 - - DJANGO_VERSION=1.5.12 ? --- + - DJANGO_VERSION=1.5 - - DJANGO_VERSION=1.6.11 ? --- + - DJANGO_VERSION=1.6 - - DJANGO_VERSION=https://github.com/django/django/archive/stable/1.7.x.zip - - DJANGO_VERSION=https://github.com/django/django/archive/stable/1.8.x.zip + - DJANGO_VERSION=1.7 + - DJANGO_VERSION=1.8 python: - "2.6" - "2.7" - "3.3" - "3.4" - "pypy" matrix: exclude: - python: "3.3" - env: DJANGO_VERSION=https://github.com/django/django/archive/stable/1.4.x.zip + env: DJANGO_VERSION=1.4 - python: "3.4" - env: DJANGO_VERSION=https://github.com/django/django/archive/stable/1.4.x.zip + env: DJANGO_VERSION=1.4 - python: "2.6" - env: DJANGO_VERSION=https://github.com/django/django/archive/stable/1.7.x.zip + env: DJANGO_VERSION=1.7 - python: "2.6" - env: DJANGO_VERSION=https://github.com/django/django/archive/stable/1.8.x.zip + env: DJANGO_VERSION=1.8 install: - pip install django==$DJANGO_VERSION nose --use-mirrors - pip install . --use-mirrors script: - nosetests tests/tests.py
18
0.642857
9
9
cec35ed7c888fb5764804d887abd0a29ea178451
src/theme-package.coffee
src/theme-package.coffee
Q = require 'q' AtomPackage = require './atom-package' module.exports = class ThemePackage extends AtomPackage getType: -> 'theme' getStylesheetType: -> 'theme' enable: -> atom.config.unshiftAtKeyPath('core.themes', @metadata.name) disable: -> atom.config.removeAtKeyPath('core.themes', @metadata.name) load: -> @measure 'loadTime', => try @metadata ?= Package.loadMetadata(@path) catch e console.warn "Failed to load theme named '#{@name}'", e.stack ? e this activate: -> return @activationDeferred.promise if @activationDeferred? @activationDeferred = Q.defer() @measure 'activateTime', => @loadStylesheets() @activateNow() @activationDeferred.promise
Q = require 'q' AtomPackage = require './atom-package' module.exports = class ThemePackage extends AtomPackage getType: -> 'theme' getStylesheetType: -> 'theme' enable: -> atom.config.unshiftAtKeyPath('core.themes', @name) disable: -> atom.config.removeAtKeyPath('core.themes', @name) load: -> @measure 'loadTime', => try @metadata ?= Package.loadMetadata(@path) catch error console.warn "Failed to load theme named '#{@name}'", error.stack ? error this activate: -> return @activationDeferred.promise if @activationDeferred? @activationDeferred = Q.defer() @measure 'activateTime', => @loadStylesheets() @activateNow() @activationDeferred.promise
Use name ivar instead of metadata.name
Use name ivar instead of metadata.name
CoffeeScript
mit
Austen-G/BlockBuilder,Rodjana/atom,Ingramz/atom,deoxilix/atom,Galactix/atom,SlimeQ/atom,KENJU/atom,KENJU/atom,acontreras89/atom,githubteacher/atom,bolinfest/atom,vinodpanicker/atom,h0dgep0dge/atom,rookie125/atom,AlbertoBarrago/atom,hakatashi/atom,abe33/atom,johnhaley81/atom,einarmagnus/atom,ironbox360/atom,davideg/atom,pombredanne/atom,h0dgep0dge/atom,stinsonga/atom,charleswhchan/atom,russlescai/atom,tony612/atom,gisenberg/atom,florianb/atom,charleswhchan/atom,bcoe/atom,Andrey-Pavlov/atom,rsvip/aTom,me6iaton/atom,jjz/atom,harshdattani/atom,CraZySacX/atom,MjAbuz/atom,KENJU/atom,dkfiresky/atom,fredericksilva/atom,nucked/atom,darwin/atom,qskycolor/atom,Andrey-Pavlov/atom,yomybaby/atom,toqz/atom,oggy/atom,basarat/atom,sekcheong/atom,mostafaeweda/atom,acontreras89/atom,sotayamashita/atom,pombredanne/atom,isghe/atom,fredericksilva/atom,bencolon/atom,mrodalgaard/atom,rmartin/atom,qiujuer/atom,chengky/atom,boomwaiza/atom,targeter21/atom,Austen-G/BlockBuilder,Jdesk/atom,davideg/atom,AdrianVovk/substance-ide,efatsi/atom,constanzaurzua/atom,execjosh/atom,Rodjana/atom,omarhuanca/atom,Abdillah/atom,G-Baby/atom,FIT-CSE2410-A-Bombs/atom,omarhuanca/atom,YunchengLiao/atom,medovob/atom,AdrianVovk/substance-ide,nrodriguez13/atom,NunoEdgarGub1/atom,ykeisuke/atom,ilovezy/atom,Neron-X5/atom,YunchengLiao/atom,lovesnow/atom,andrewleverette/atom,sebmck/atom,scippio/atom,mdumrauf/atom,charleswhchan/atom,nucked/atom,Jandersolutions/atom,Klozz/atom,mnquintana/atom,Rychard/atom,lisonma/atom,folpindo/atom,AlexxNica/atom,FIT-CSE2410-A-Bombs/atom,RobinTec/atom,nrodriguez13/atom,Rodjana/atom,matthewclendening/atom,sekcheong/atom,vjeux/atom,vjeux/atom,rsvip/aTom,sillvan/atom,crazyquark/atom,ObviouslyGreen/atom,Huaraz2/atom,cyzn/atom,Austen-G/BlockBuilder,fang-yufeng/atom,einarmagnus/atom,dsandstrom/atom,abcP9110/atom,oggy/atom,dsandstrom/atom,001szymon/atom,gisenberg/atom,mnquintana/atom,Shekharrajak/atom,sillvan/atom,dannyflax/atom,lovesnow/atom,tjkr/atom,Galactix/atom,palita01/atom,matthewclendening/atom,Sangaroonaom/atom,kevinrenaers/atom,Neron-X5/atom,mertkahyaoglu/atom,nvoron23/atom,Neron-X5/atom,xream/atom,SlimeQ/atom,jtrose2/atom,bradgearon/atom,Jandersolutions/atom,dijs/atom,bsmr-x-script/atom,FoldingText/atom,yalexx/atom,burodepeper/atom,batjko/atom,kittens/atom,rsvip/aTom,liuxiong332/atom,rmartin/atom,n-riesco/atom,mertkahyaoglu/atom,seedtigo/atom,sebmck/atom,Shekharrajak/atom,davideg/atom,yalexx/atom,ykeisuke/atom,darwin/atom,gontadu/atom,lisonma/atom,phord/atom,ppamorim/atom,Ju2ender/atom,sillvan/atom,brumm/atom,pengshp/atom,jacekkopecky/atom,tisu2tisu/atom,DiogoXRP/atom,mostafaeweda/atom,hakatashi/atom,chengky/atom,mnquintana/atom,jacekkopecky/atom,Hasimir/atom,alexandergmann/atom,Andrey-Pavlov/atom,liuderchi/atom,niklabh/atom,splodingsocks/atom,Abdillah/atom,mostafaeweda/atom,githubteacher/atom,scv119/atom,sotayamashita/atom,gabrielPeart/atom,elkingtonmcb/atom,avdg/atom,AlisaKiatkongkumthon/atom,me-benni/atom,rxkit/atom,rjattrill/atom,jacekkopecky/atom,hpham04/atom,devoncarew/atom,SlimeQ/atom,bj7/atom,brumm/atom,hharchani/atom,fredericksilva/atom,liuderchi/atom,Dennis1978/atom,isghe/atom,dannyflax/atom,fedorov/atom,oggy/atom,efatsi/atom,Hasimir/atom,omarhuanca/atom,brettle/atom,dannyflax/atom,helber/atom,vcarrera/atom,Klozz/atom,tony612/atom,dkfiresky/atom,RobinTec/atom,tanin47/atom,mertkahyaoglu/atom,sekcheong/atom,yomybaby/atom,Klozz/atom,CraZySacX/atom,bcoe/atom,john-kelly/atom,scv119/atom,Ingramz/atom,alexandergmann/atom,bencolon/atom,stinsonga/atom,bradgearon/atom,hagb4rd/atom,dsandstrom/atom,G-Baby/atom,oggy/atom,devoncarew/atom,Huaraz2/atom,bryonwinger/atom,jtrose2/atom,devmario/atom,nvoron23/atom,transcranial/atom,yamhon/atom,abcP9110/atom,johnrizzo1/atom,vinodpanicker/atom,liuxiong332/atom,NunoEdgarGub1/atom,Abdillah/atom,AlbertoBarrago/atom,GHackAnonymous/atom,ardeshirj/atom,bencolon/atom,stuartquin/atom,kc8wxm/atom,palita01/atom,panuchart/atom,Arcanemagus/atom,lisonma/atom,champagnez/atom,yalexx/atom,gzzhanghao/atom,G-Baby/atom,Mokolea/atom,isghe/atom,targeter21/atom,dkfiresky/atom,batjko/atom,Rychard/atom,kjav/atom,AlisaKiatkongkumthon/atom,ReddTea/atom,qskycolor/atom,Austen-G/BlockBuilder,fredericksilva/atom,FoldingText/atom,kjav/atom,hellendag/atom,ezeoleaf/atom,execjosh/atom,Arcanemagus/atom,batjko/atom,PKRoma/atom,tony612/atom,rookie125/atom,anuwat121/atom,rjattrill/atom,sekcheong/atom,rsvip/aTom,jacekkopecky/atom,YunchengLiao/atom,mdumrauf/atom,john-kelly/atom,BogusCurry/atom,hharchani/atom,g2p/atom,originye/atom,john-kelly/atom,bcoe/atom,rjattrill/atom,bsmr-x-script/atom,seedtigo/atom,woss/atom,t9md/atom,bcoe/atom,basarat/atom,ashneo76/atom,pkdevbox/atom,sxgao3001/atom,scv119/atom,Jdesk/atom,matthewclendening/atom,decaffeinate-examples/atom,Hasimir/atom,h0dgep0dge/atom,hpham04/atom,florianb/atom,beni55/atom,t9md/atom,hagb4rd/atom,sebmck/atom,mnquintana/atom,deoxilix/atom,panuchart/atom,ilovezy/atom,me-benni/atom,jordanbtucker/atom,ReddTea/atom,cyzn/atom,tony612/atom,AlexxNica/atom,synaptek/atom,abcP9110/atom,MjAbuz/atom,champagnez/atom,RuiDGoncalves/atom,qskycolor/atom,kdheepak89/atom,abcP9110/atom,hakatashi/atom,ali/atom,tjkr/atom,fang-yufeng/atom,FoldingText/atom,basarat/atom,lisonma/atom,stuartquin/atom,seedtigo/atom,ObviouslyGreen/atom,Jdesk/atom,helber/atom,kc8wxm/atom,wiggzz/atom,Jandersoft/atom,sotayamashita/atom,alfredxing/atom,kjav/atom,woss/atom,xream/atom,AlexxNica/atom,codex8/atom,nvoron23/atom,niklabh/atom,gisenberg/atom,tisu2tisu/atom,johnrizzo1/atom,bsmr-x-script/atom,mdumrauf/atom,wiggzz/atom,davideg/atom,tisu2tisu/atom,0x73/atom,pombredanne/atom,bcoe/atom,Dennis1978/atom,ezeoleaf/atom,vjeux/atom,h0dgep0dge/atom,sillvan/atom,batjko/atom,vcarrera/atom,yomybaby/atom,me6iaton/atom,liuxiong332/atom,originye/atom,chengky/atom,ppamorim/atom,yangchenghu/atom,woss/atom,nrodriguez13/atom,KENJU/atom,jlord/atom,tanin47/atom,Dennis1978/atom,john-kelly/atom,kittens/atom,codex8/atom,kevinrenaers/atom,woss/atom,hpham04/atom,jacekkopecky/atom,florianb/atom,AlisaKiatkongkumthon/atom,Jandersolutions/atom,cyzn/atom,florianb/atom,isghe/atom,ReddTea/atom,jlord/atom,kdheepak89/atom,tjkr/atom,AdrianVovk/substance-ide,ivoadf/atom,devoncarew/atom,jeremyramin/atom,rmartin/atom,RuiDGoncalves/atom,kandros/atom,Shekharrajak/atom,vcarrera/atom,vhutheesing/atom,ezeoleaf/atom,boomwaiza/atom,devmario/atom,johnhaley81/atom,synaptek/atom,kittens/atom,PKRoma/atom,mostafaeweda/atom,rmartin/atom,g2p/atom,nvoron23/atom,splodingsocks/atom,toqz/atom,basarat/atom,erikhakansson/atom,ezeoleaf/atom,kc8wxm/atom,sxgao3001/atom,FIT-CSE2410-A-Bombs/atom,MjAbuz/atom,me-benni/atom,hharchani/atom,john-kelly/atom,florianb/atom,amine7536/atom,jtrose2/atom,chengky/atom,ralphtheninja/atom,gontadu/atom,bolinfest/atom,devmario/atom,constanzaurzua/atom,kaicataldo/atom,alexandergmann/atom,kdheepak89/atom,jlord/atom,hpham04/atom,YunchengLiao/atom,jacekkopecky/atom,russlescai/atom,kaicataldo/atom,Jdesk/atom,mertkahyaoglu/atom,acontreras89/atom,dkfiresky/atom,qskycolor/atom,me6iaton/atom,fang-yufeng/atom,mrodalgaard/atom,paulcbetts/atom,rsvip/aTom,kdheepak89/atom,jordanbtucker/atom,andrewleverette/atom,vhutheesing/atom,rmartin/atom,svanharmelen/atom,bolinfest/atom,phord/atom,brettle/atom,dijs/atom,rlugojr/atom,ppamorim/atom,constanzaurzua/atom,ilovezy/atom,constanzaurzua/atom,sxgao3001/atom,beni55/atom,hpham04/atom,Locke23rus/atom,ReddTea/atom,hellendag/atom,Ingramz/atom,Andrey-Pavlov/atom,russlescai/atom,dannyflax/atom,fedorov/atom,dannyflax/atom,pengshp/atom,AlbertoBarrago/atom,harshdattani/atom,Sangaroonaom/atom,Ju2ender/atom,targeter21/atom,xream/atom,Locke23rus/atom,Jandersolutions/atom,qiujuer/atom,atom/atom,palita01/atom,me6iaton/atom,scippio/atom,niklabh/atom,lovesnow/atom,kandros/atom,Huaraz2/atom,RobinTec/atom,jlord/atom,g2p/atom,splodingsocks/atom,codex8/atom,yomybaby/atom,rxkit/atom,lpommers/atom,ardeshirj/atom,fang-yufeng/atom,tmunro/atom,elkingtonmcb/atom,Jandersoft/atom,andrewleverette/atom,chengky/atom,anuwat121/atom,deepfox/atom,jjz/atom,fedorov/atom,acontreras89/atom,beni55/atom,Hasimir/atom,Andrey-Pavlov/atom,scv119/atom,panuchart/atom,tanin47/atom,0x73/atom,gisenberg/atom,yangchenghu/atom,Galactix/atom,PKRoma/atom,MjAbuz/atom,ralphtheninja/atom,SlimeQ/atom,prembasumatary/atom,deoxilix/atom,prembasumatary/atom,ironbox360/atom,helber/atom,dannyflax/atom,nvoron23/atom,Austen-G/BlockBuilder,scippio/atom,qiujuer/atom,toqz/atom,folpindo/atom,daxlab/atom,dsandstrom/atom,matthewclendening/atom,ali/atom,Shekharrajak/atom,ppamorim/atom,pengshp/atom,lovesnow/atom,liuderchi/atom,GHackAnonymous/atom,deepfox/atom,sebmck/atom,hharchani/atom,kandros/atom,pombredanne/atom,rxkit/atom,ralphtheninja/atom,omarhuanca/atom,Abdillah/atom,jjz/atom,toqz/atom,ashneo76/atom,abcP9110/atom,fscherwi/atom,Austen-G/BlockBuilder,GHackAnonymous/atom,DiogoXRP/atom,ashneo76/atom,jjz/atom,Galactix/atom,Sangaroonaom/atom,hakatashi/atom,isghe/atom,decaffeinate-examples/atom,Locke23rus/atom,codex8/atom,brumm/atom,001szymon/atom,Shekharrajak/atom,vjeux/atom,erikhakansson/atom,alfredxing/atom,hharchani/atom,daxlab/atom,svanharmelen/atom,russlescai/atom,001szymon/atom,liuderchi/atom,dkfiresky/atom,amine7536/atom,githubteacher/atom,constanzaurzua/atom,pkdevbox/atom,rookie125/atom,omarhuanca/atom,devmario/atom,tmunro/atom,crazyquark/atom,Jandersolutions/atom,FoldingText/atom,erikhakansson/atom,abe33/atom,Neron-X5/atom,bradgearon/atom,charleswhchan/atom,kjav/atom,atom/atom,pkdevbox/atom,stuartquin/atom,vhutheesing/atom,SlimeQ/atom,splodingsocks/atom,paulcbetts/atom,yamhon/atom,johnhaley81/atom,batjko/atom,BogusCurry/atom,targeter21/atom,brettle/atom,sekcheong/atom,n-riesco/atom,darwin/atom,basarat/atom,Ju2ender/atom,matthewclendening/atom,amine7536/atom,daxlab/atom,ivoadf/atom,vinodpanicker/atom,ali/atom,kc8wxm/atom,jjz/atom,me6iaton/atom,ReddTea/atom,devoncarew/atom,wiggzz/atom,sxgao3001/atom,nucked/atom,davideg/atom,MjAbuz/atom,rlugojr/atom,qskycolor/atom,DiogoXRP/atom,basarat/atom,0x73/atom,woss/atom,mertkahyaoglu/atom,codex8/atom,BogusCurry/atom,gontadu/atom,crazyquark/atom,avdg/atom,Ju2ender/atom,bj7/atom,kc8wxm/atom,svanharmelen/atom,jtrose2/atom,ilovezy/atom,hagb4rd/atom,einarmagnus/atom,yalexx/atom,ardeshirj/atom,einarmagnus/atom,toqz/atom,yomybaby/atom,prembasumatary/atom,sxgao3001/atom,sillvan/atom,ObviouslyGreen/atom,burodepeper/atom,decaffeinate-examples/atom,Jandersoft/atom,stinsonga/atom,atom/atom,amine7536/atom,liuxiong332/atom,qiujuer/atom,lpommers/atom,jlord/atom,vinodpanicker/atom,fedorov/atom,RobinTec/atom,kaicataldo/atom,GHackAnonymous/atom,devmario/atom,fscherwi/atom,fedorov/atom,transcranial/atom,einarmagnus/atom,n-riesco/atom,oggy/atom,efatsi/atom,Mokolea/atom,deepfox/atom,champagnez/atom,Neron-X5/atom,deepfox/atom,Rychard/atom,yamhon/atom,dsandstrom/atom,fredericksilva/atom,rjattrill/atom,pombredanne/atom,avdg/atom,n-riesco/atom,FoldingText/atom,vcarrera/atom,bryonwinger/atom,amine7536/atom,ivoadf/atom,targeter21/atom,Galactix/atom,NunoEdgarGub1/atom,kittens/atom,mostafaeweda/atom,johnrizzo1/atom,sebmck/atom,kjav/atom,crazyquark/atom,jordanbtucker/atom,bryonwinger/atom,jtrose2/atom,transcranial/atom,deepfox/atom,Arcanemagus/atom,qiujuer/atom,CraZySacX/atom,ykeisuke/atom,gzzhanghao/atom,FoldingText/atom,anuwat121/atom,YunchengLiao/atom,folpindo/atom,charleswhchan/atom,Jonekee/atom,devoncarew/atom,Hasimir/atom,kdheepak89/atom,decaffeinate-examples/atom,medovob/atom,alfredxing/atom,prembasumatary/atom,yalexx/atom,GHackAnonymous/atom,mrodalgaard/atom,bj7/atom,tmunro/atom,boomwaiza/atom,Abdillah/atom,Jonekee/atom,Mokolea/atom,russlescai/atom,jeremyramin/atom,t9md/atom,abe33/atom,0x73/atom,mnquintana/atom,ilovezy/atom,gabrielPeart/atom,Jdesk/atom,synaptek/atom,lisonma/atom,n-riesco/atom,medovob/atom,lovesnow/atom,kevinrenaers/atom,fang-yufeng/atom,vjeux/atom,RuiDGoncalves/atom,execjosh/atom,synaptek/atom,ali/atom,elkingtonmcb/atom,stinsonga/atom,synaptek/atom,harshdattani/atom,RobinTec/atom,acontreras89/atom,lpommers/atom,gisenberg/atom,ironbox360/atom,ali/atom,Jandersoft/atom,crazyquark/atom,yangchenghu/atom,originye/atom,jeremyramin/atom,fscherwi/atom,paulcbetts/atom,vinodpanicker/atom,gzzhanghao/atom,hagb4rd/atom,liuxiong332/atom,hellendag/atom,NunoEdgarGub1/atom,dijs/atom,tony612/atom,rlugojr/atom,bryonwinger/atom,chfritz/atom,chfritz/atom,gabrielPeart/atom,ppamorim/atom,phord/atom,KENJU/atom,prembasumatary/atom,paulcbetts/atom,hagb4rd/atom,Ju2ender/atom,vcarrera/atom,burodepeper/atom,NunoEdgarGub1/atom,chfritz/atom,kittens/atom,Jonekee/atom,Jandersoft/atom
coffeescript
## Code Before: Q = require 'q' AtomPackage = require './atom-package' module.exports = class ThemePackage extends AtomPackage getType: -> 'theme' getStylesheetType: -> 'theme' enable: -> atom.config.unshiftAtKeyPath('core.themes', @metadata.name) disable: -> atom.config.removeAtKeyPath('core.themes', @metadata.name) load: -> @measure 'loadTime', => try @metadata ?= Package.loadMetadata(@path) catch e console.warn "Failed to load theme named '#{@name}'", e.stack ? e this activate: -> return @activationDeferred.promise if @activationDeferred? @activationDeferred = Q.defer() @measure 'activateTime', => @loadStylesheets() @activateNow() @activationDeferred.promise ## Instruction: Use name ivar instead of metadata.name ## Code After: Q = require 'q' AtomPackage = require './atom-package' module.exports = class ThemePackage extends AtomPackage getType: -> 'theme' getStylesheetType: -> 'theme' enable: -> atom.config.unshiftAtKeyPath('core.themes', @name) disable: -> atom.config.removeAtKeyPath('core.themes', @name) load: -> @measure 'loadTime', => try @metadata ?= Package.loadMetadata(@path) catch error console.warn "Failed to load theme named '#{@name}'", error.stack ? error this activate: -> return @activationDeferred.promise if @activationDeferred? @activationDeferred = Q.defer() @measure 'activateTime', => @loadStylesheets() @activateNow() @activationDeferred.promise
Q = require 'q' AtomPackage = require './atom-package' module.exports = class ThemePackage extends AtomPackage getType: -> 'theme' getStylesheetType: -> 'theme' enable: -> - atom.config.unshiftAtKeyPath('core.themes', @metadata.name) ? --------- + atom.config.unshiftAtKeyPath('core.themes', @name) disable: -> - atom.config.removeAtKeyPath('core.themes', @metadata.name) ? --------- + atom.config.removeAtKeyPath('core.themes', @name) load: -> @measure 'loadTime', => try @metadata ?= Package.loadMetadata(@path) - catch e + catch error ? ++++ - console.warn "Failed to load theme named '#{@name}'", e.stack ? e + console.warn "Failed to load theme named '#{@name}'", error.stack ? error ? ++++ ++++ this activate: -> return @activationDeferred.promise if @activationDeferred? @activationDeferred = Q.defer() @measure 'activateTime', => @loadStylesheets() @activateNow() @activationDeferred.promise
8
0.25
4
4
305b33b4d08909839aded1a6e2b6ae66bb5c53a5
spec/simple_set_spec.rb
spec/simple_set_spec.rb
require File.dirname(__FILE__) + '/spec_helper' describe Extlib::SimpleSet do before do @s = Extlib::SimpleSet.new("Initial") end describe "#initialize" do it 'adds passed value to the set' do @new_generation_vms = Extlib::SimpleSet.new(["Rubinius", "PyPy", "Parrot"]) @new_generation_vms.should have_key("Rubinius") @new_generation_vms.should have_key("PyPy") @new_generation_vms.should have_key("Parrot") end end describe "#<<" do it "adds value to the set" do @s << "Hello" @s.to_a.should include("Hello") end end describe "#merge(other)" do it "preserves old values when values do not overlap" do @s.should have_key("Initial") end it 'adds new values from merged set' do @t = @s.merge(["Merged value"]) @t.should have_key("Merged value") end it 'returns a SimpleSet instance' do @s.merge(["Merged value"]).should be_kind_of(Extlib::SimpleSet) end end describe "#inspect" do it "lists set values" do @s.inspect.should == "#<SimpleSet: {\"Initial\"}>" end end describe "#keys" do it 'is aliased as to_a' do @s.to_a.should === @s.keys end end end
require File.dirname(__FILE__) + '/spec_helper' describe Extlib::SimpleSet do before do @s = Extlib::SimpleSet.new("Initial") end describe "#initialize" do it 'adds passed value to the set' do @new_generation_vms = Extlib::SimpleSet.new(["Rubinius", "PyPy", "Parrot"]) @new_generation_vms.should have_key("Rubinius") @new_generation_vms.should have_key("PyPy") @new_generation_vms.should have_key("Parrot") end end describe "#<<" do it "adds value to the set" do @s << "Hello" @s.to_a.should include("Hello") end it 'sets true mark on the key' do @s << "Fun" @s["Fun"].should be(true) end end describe "#merge(other)" do it "preserves old values when values do not overlap" do @s.should have_key("Initial") end it 'adds new values from merged set' do @t = @s.merge(["Merged value"]) @t.should have_key("Merged value") end it 'returns a SimpleSet instance' do @s.merge(["Merged value"]).should be_kind_of(Extlib::SimpleSet) end end describe "#inspect" do it "lists set values" do @s.inspect.should == "#<SimpleSet: {\"Initial\"}>" end end describe "#keys" do it 'is aliased as to_a' do @s.to_a.should === @s.keys end end end
Add one more spec example for SimpleSet.
Add one more spec example for SimpleSet.
Ruby
mit
paul/extlib
ruby
## Code Before: require File.dirname(__FILE__) + '/spec_helper' describe Extlib::SimpleSet do before do @s = Extlib::SimpleSet.new("Initial") end describe "#initialize" do it 'adds passed value to the set' do @new_generation_vms = Extlib::SimpleSet.new(["Rubinius", "PyPy", "Parrot"]) @new_generation_vms.should have_key("Rubinius") @new_generation_vms.should have_key("PyPy") @new_generation_vms.should have_key("Parrot") end end describe "#<<" do it "adds value to the set" do @s << "Hello" @s.to_a.should include("Hello") end end describe "#merge(other)" do it "preserves old values when values do not overlap" do @s.should have_key("Initial") end it 'adds new values from merged set' do @t = @s.merge(["Merged value"]) @t.should have_key("Merged value") end it 'returns a SimpleSet instance' do @s.merge(["Merged value"]).should be_kind_of(Extlib::SimpleSet) end end describe "#inspect" do it "lists set values" do @s.inspect.should == "#<SimpleSet: {\"Initial\"}>" end end describe "#keys" do it 'is aliased as to_a' do @s.to_a.should === @s.keys end end end ## Instruction: Add one more spec example for SimpleSet. ## Code After: require File.dirname(__FILE__) + '/spec_helper' describe Extlib::SimpleSet do before do @s = Extlib::SimpleSet.new("Initial") end describe "#initialize" do it 'adds passed value to the set' do @new_generation_vms = Extlib::SimpleSet.new(["Rubinius", "PyPy", "Parrot"]) @new_generation_vms.should have_key("Rubinius") @new_generation_vms.should have_key("PyPy") @new_generation_vms.should have_key("Parrot") end end describe "#<<" do it "adds value to the set" do @s << "Hello" @s.to_a.should include("Hello") end it 'sets true mark on the key' do @s << "Fun" @s["Fun"].should be(true) end end describe "#merge(other)" do it "preserves old values when values do not overlap" do @s.should have_key("Initial") end it 'adds new values from merged set' do @t = @s.merge(["Merged value"]) @t.should have_key("Merged value") end it 'returns a SimpleSet instance' do @s.merge(["Merged value"]).should be_kind_of(Extlib::SimpleSet) end end describe "#inspect" do it "lists set values" do @s.inspect.should == "#<SimpleSet: {\"Initial\"}>" end end describe "#keys" do it 'is aliased as to_a' do @s.to_a.should === @s.keys end end end
require File.dirname(__FILE__) + '/spec_helper' describe Extlib::SimpleSet do before do @s = Extlib::SimpleSet.new("Initial") end describe "#initialize" do it 'adds passed value to the set' do @new_generation_vms = Extlib::SimpleSet.new(["Rubinius", "PyPy", "Parrot"]) @new_generation_vms.should have_key("Rubinius") @new_generation_vms.should have_key("PyPy") @new_generation_vms.should have_key("Parrot") end end describe "#<<" do it "adds value to the set" do @s << "Hello" @s.to_a.should include("Hello") end + + it 'sets true mark on the key' do + @s << "Fun" + @s["Fun"].should be(true) + end end describe "#merge(other)" do it "preserves old values when values do not overlap" do @s.should have_key("Initial") end it 'adds new values from merged set' do @t = @s.merge(["Merged value"]) @t.should have_key("Merged value") end it 'returns a SimpleSet instance' do @s.merge(["Merged value"]).should be_kind_of(Extlib::SimpleSet) end end describe "#inspect" do it "lists set values" do @s.inspect.should == "#<SimpleSet: {\"Initial\"}>" - end ? ---- + end end describe "#keys" do it 'is aliased as to_a' do @s.to_a.should === @s.keys end end end
7
0.134615
6
1
5c4c4989b6e98a983590c455b1f533d845ddbbc3
lib/utility/logger.rb
lib/utility/logger.rb
class Logger def initialize @file = File.new("logs/#{Time.now.strftime('%Y-%m-%d')}.log", 'a') end def log(data) @file.write("[#{Time.now.strftime('%H:%M:%S')}] #{data}\n") end end
require 'digest/md5' class Logger def initialize @file = File.new("../logs/#{Time.now.strftime('%Y-%m-%d')} - #{Digest::MD5.hexdigest rand.to_s}.log", 'a') end def log(data) @file.write("[#{Time.now.strftime('%H:%M:%S')}] #{data}\n") end end
Add unique IDs to log files
Add unique IDs to log files
Ruby
mit
Hyftar/TeChris
ruby
## Code Before: class Logger def initialize @file = File.new("logs/#{Time.now.strftime('%Y-%m-%d')}.log", 'a') end def log(data) @file.write("[#{Time.now.strftime('%H:%M:%S')}] #{data}\n") end end ## Instruction: Add unique IDs to log files ## Code After: require 'digest/md5' class Logger def initialize @file = File.new("../logs/#{Time.now.strftime('%Y-%m-%d')} - #{Digest::MD5.hexdigest rand.to_s}.log", 'a') end def log(data) @file.write("[#{Time.now.strftime('%H:%M:%S')}] #{data}\n") end end
+ require 'digest/md5' class Logger + def initialize - @file = File.new("logs/#{Time.now.strftime('%Y-%m-%d')}.log", 'a') + @file = File.new("../logs/#{Time.now.strftime('%Y-%m-%d')} - #{Digest::MD5.hexdigest rand.to_s}.log", 'a') ? +++ +++++++++++++++++++++++++++++++++++++ end def log(data) @file.write("[#{Time.now.strftime('%H:%M:%S')}] #{data}\n") end end
4
0.444444
3
1
f8dcceb9702c079e16bda30582e561ffeb2e857b
billjobs/urls.py
billjobs/urls.py
from django.conf.urls import url, include from . import views urlpatterns = [ url(r'^generate_pdf/(?P<bill_id>\d+)$', views.generate_pdf, name='generate-pdf'), url(r'^users/$', views.UserAdmin.as_view(), name='users'), url(r'^users/(?P<pk>[0-9]+)/$', views.UserAdminDetail.as_view(), name='user-detail'), url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')) ]
from django.conf.urls import url, include from rest_framework.authtoken.views import obtain_auth_token from . import views urlpatterns = [ url(r'^generate_pdf/(?P<bill_id>\d+)$', views.generate_pdf, name='generate-pdf'), url(r'^users/$', views.UserAdmin.as_view(), name='users'), url(r'^users/(?P<pk>[0-9]+)/$', views.UserAdminDetail.as_view(), name='user-detail'), url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')), url(r'^api-token-auth/', obtain_auth_token) ]
Add rest_framework view to obtain auth token
Add rest_framework view to obtain auth token
Python
mit
ioO/billjobs
python
## Code Before: from django.conf.urls import url, include from . import views urlpatterns = [ url(r'^generate_pdf/(?P<bill_id>\d+)$', views.generate_pdf, name='generate-pdf'), url(r'^users/$', views.UserAdmin.as_view(), name='users'), url(r'^users/(?P<pk>[0-9]+)/$', views.UserAdminDetail.as_view(), name='user-detail'), url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')) ] ## Instruction: Add rest_framework view to obtain auth token ## Code After: from django.conf.urls import url, include from rest_framework.authtoken.views import obtain_auth_token from . import views urlpatterns = [ url(r'^generate_pdf/(?P<bill_id>\d+)$', views.generate_pdf, name='generate-pdf'), url(r'^users/$', views.UserAdmin.as_view(), name='users'), url(r'^users/(?P<pk>[0-9]+)/$', views.UserAdminDetail.as_view(), name='user-detail'), url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')), url(r'^api-token-auth/', obtain_auth_token) ]
from django.conf.urls import url, include + from rest_framework.authtoken.views import obtain_auth_token from . import views urlpatterns = [ url(r'^generate_pdf/(?P<bill_id>\d+)$', views.generate_pdf, name='generate-pdf'), url(r'^users/$', views.UserAdmin.as_view(), name='users'), url(r'^users/(?P<pk>[0-9]+)/$', views.UserAdminDetail.as_view(), name='user-detail'), - url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')) + url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')), ? + + url(r'^api-token-auth/', obtain_auth_token) ]
4
0.4
3
1
4aec2509b12f10a7bc6dc558e4cd2710c7e5e203
src/foam/nanos/logger/LogMessageController.js
src/foam/nanos/logger/LogMessageController.js
foam.CLASS({ package: 'foam.nanos.logger', name: 'LogMessageController', extends: 'foam.comics.DAOController', documentation: 'A custom DAOController to work with log messages.', requires: ['foam.nanos.logger.LogMessage'], imports: ['logMessageDAO'], properties: [ { class: 'foam.dao.DAOProperty', name: 'data', factory: function() { return this.logMessageDAO.orderBy(this.LogMessage.CREATED); } }, { name: 'summaryView', factory: function() { return this.FixedWidthScrollTableView; } } ], classes: [ { name: 'FixedWidthScrollTableView', extends: 'foam.u2.view.ScrollTableView', css: ` ^ { width: 968px; } ` } ] });
foam.CLASS({ package: 'foam.nanos.logger', name: 'LogMessageController', extends: 'foam.comics.DAOController', documentation: 'A custom DAOController to work with log messages.', requires: ['foam.nanos.logger.LogMessage'], imports: ['logMessageDAO'], properties: [ { class: 'foam.dao.DAOProperty', name: 'data', factory: function() { return this.logMessageDAO.orderBy(this.LogMessage.CREATED); } } ] });
Remove unnecessary code to limit table width
Remove unnecessary code to limit table width With the recent changes to tables, this is no longer necessary.
JavaScript
apache-2.0
jacksonic/vjlofvhjfgm,foam-framework/foam2,jacksonic/vjlofvhjfgm,foam-framework/foam2,foam-framework/foam2,foam-framework/foam2,jacksonic/vjlofvhjfgm,foam-framework/foam2
javascript
## Code Before: foam.CLASS({ package: 'foam.nanos.logger', name: 'LogMessageController', extends: 'foam.comics.DAOController', documentation: 'A custom DAOController to work with log messages.', requires: ['foam.nanos.logger.LogMessage'], imports: ['logMessageDAO'], properties: [ { class: 'foam.dao.DAOProperty', name: 'data', factory: function() { return this.logMessageDAO.orderBy(this.LogMessage.CREATED); } }, { name: 'summaryView', factory: function() { return this.FixedWidthScrollTableView; } } ], classes: [ { name: 'FixedWidthScrollTableView', extends: 'foam.u2.view.ScrollTableView', css: ` ^ { width: 968px; } ` } ] }); ## Instruction: Remove unnecessary code to limit table width With the recent changes to tables, this is no longer necessary. ## Code After: foam.CLASS({ package: 'foam.nanos.logger', name: 'LogMessageController', extends: 'foam.comics.DAOController', documentation: 'A custom DAOController to work with log messages.', requires: ['foam.nanos.logger.LogMessage'], imports: ['logMessageDAO'], properties: [ { class: 'foam.dao.DAOProperty', name: 'data', factory: function() { return this.logMessageDAO.orderBy(this.LogMessage.CREATED); } } ] });
foam.CLASS({ package: 'foam.nanos.logger', name: 'LogMessageController', extends: 'foam.comics.DAOController', documentation: 'A custom DAOController to work with log messages.', requires: ['foam.nanos.logger.LogMessage'], imports: ['logMessageDAO'], properties: [ { class: 'foam.dao.DAOProperty', name: 'data', factory: function() { return this.logMessageDAO.orderBy(this.LogMessage.CREATED); } - }, - { - name: 'summaryView', - factory: function() { - return this.FixedWidthScrollTableView; - } - } - ], - - classes: [ - { - name: 'FixedWidthScrollTableView', - extends: 'foam.u2.view.ScrollTableView', - - css: ` - ^ { - width: 968px; - } - ` } ] });
19
0.475
0
19
d56c4fe8257dccffa7755145d991f2ffaaad0347
recipes/database_mysql.rb
recipes/database_mysql.rb
mysql = node['mysql'] gitlab = node['gitlab'] # 5.Database include_recipe "mysql::server" include_recipe "database::mysql" mysql_connection = { :host => 'localhost', :username => 'root', :password => mysql['server_root_password'] } ## Create a user for GitLab. mysql_database_user gitlab['user'] do connection mysql_connection password gitlab['database_password'] action :create end ## Create the GitLab database & grant all privileges on database gitlab['environments'].each do |environment| mysql_database "gitlabhq_#{environment}" do connection mysql_connection action :create end mysql_database_user gitlab['user'] do connection mysql_connection password gitlab['database_password'] database_name "gitlabhq_#{environment}" host 'localhost' privileges ["SELECT", "UPDATE", "INSERT", "DELETE", "CREATE", "DROP", "INDEX", "ALTER", "LOCK TABLES"] action :grant end end
mysql = node['mysql'] gitlab = node['gitlab'] # 5.Database include_recipe "mysql::server" include_recipe "database::mysql" mysql_connection = { :host => 'localhost', :username => 'root', :password => mysql['server_root_password'] } ## Create a user for GitLab. mysql_database_user gitlab['user'] do connection mysql_connection password gitlab['database_password'] action :create end ## Create the GitLab database & grant all privileges on database gitlab['environments'].each do |environment| mysql_database "gitlabhq_#{environment}" do encoding "utf8" collation "utf8_unicode_ci" connection mysql_connection action :create end mysql_database_user gitlab['user'] do connection mysql_connection password gitlab['database_password'] database_name "gitlabhq_#{environment}" host 'localhost' privileges ["SELECT", "UPDATE", "INSERT", "DELETE", "CREATE", "DROP", "INDEX", "ALTER", "LOCK TABLES"] action :grant end end
Add encoding and collation to the db creation.
Add encoding and collation to the db creation.
Ruby
mit
dfang/deploy_gitlab,maoueh/cookbook-gitlab,maoueh/cookbook-gitlab,maoueh/cookbook-gitlab
ruby
## Code Before: mysql = node['mysql'] gitlab = node['gitlab'] # 5.Database include_recipe "mysql::server" include_recipe "database::mysql" mysql_connection = { :host => 'localhost', :username => 'root', :password => mysql['server_root_password'] } ## Create a user for GitLab. mysql_database_user gitlab['user'] do connection mysql_connection password gitlab['database_password'] action :create end ## Create the GitLab database & grant all privileges on database gitlab['environments'].each do |environment| mysql_database "gitlabhq_#{environment}" do connection mysql_connection action :create end mysql_database_user gitlab['user'] do connection mysql_connection password gitlab['database_password'] database_name "gitlabhq_#{environment}" host 'localhost' privileges ["SELECT", "UPDATE", "INSERT", "DELETE", "CREATE", "DROP", "INDEX", "ALTER", "LOCK TABLES"] action :grant end end ## Instruction: Add encoding and collation to the db creation. ## Code After: mysql = node['mysql'] gitlab = node['gitlab'] # 5.Database include_recipe "mysql::server" include_recipe "database::mysql" mysql_connection = { :host => 'localhost', :username => 'root', :password => mysql['server_root_password'] } ## Create a user for GitLab. mysql_database_user gitlab['user'] do connection mysql_connection password gitlab['database_password'] action :create end ## Create the GitLab database & grant all privileges on database gitlab['environments'].each do |environment| mysql_database "gitlabhq_#{environment}" do encoding "utf8" collation "utf8_unicode_ci" connection mysql_connection action :create end mysql_database_user gitlab['user'] do connection mysql_connection password gitlab['database_password'] database_name "gitlabhq_#{environment}" host 'localhost' privileges ["SELECT", "UPDATE", "INSERT", "DELETE", "CREATE", "DROP", "INDEX", "ALTER", "LOCK TABLES"] action :grant end end
mysql = node['mysql'] gitlab = node['gitlab'] # 5.Database include_recipe "mysql::server" include_recipe "database::mysql" mysql_connection = { :host => 'localhost', :username => 'root', :password => mysql['server_root_password'] } ## Create a user for GitLab. mysql_database_user gitlab['user'] do connection mysql_connection password gitlab['database_password'] action :create end ## Create the GitLab database & grant all privileges on database gitlab['environments'].each do |environment| mysql_database "gitlabhq_#{environment}" do + encoding "utf8" + collation "utf8_unicode_ci" connection mysql_connection action :create end mysql_database_user gitlab['user'] do connection mysql_connection password gitlab['database_password'] database_name "gitlabhq_#{environment}" host 'localhost' privileges ["SELECT", "UPDATE", "INSERT", "DELETE", "CREATE", "DROP", "INDEX", "ALTER", "LOCK TABLES"] action :grant end end
2
0.054054
2
0
057cf63c7eaf7ceb737402b23f02cbdc01ddbec2
README.md
README.md
A scraping framework written in PHP
A scraping framework written in PHP [![Build Status](https://travis-ci.org/rajanrx/php-scrape.svg?branch=master)](https://travis-ci.org/rajanrx/php-scrape)
Add travis status on readme
Add travis status on readme
Markdown
mit
rajanrx/php-scrape,rajanrx/php-scrape,rajanrx/php-scrape
markdown
## Code Before: A scraping framework written in PHP ## Instruction: Add travis status on readme ## Code After: A scraping framework written in PHP [![Build Status](https://travis-ci.org/rajanrx/php-scrape.svg?branch=master)](https://travis-ci.org/rajanrx/php-scrape)
A scraping framework written in PHP + + [![Build Status](https://travis-ci.org/rajanrx/php-scrape.svg?branch=master)](https://travis-ci.org/rajanrx/php-scrape)
2
2
2
0
9ec4ee7245a917cb697633e513c8471a6da8b958
composer.json
composer.json
{ "name": "ray/di", "type": "library", "description": "Guice style annotation-driven dependency injection framework", "keywords": [ "dependency injection", "di", "container", "guice", "annotation", "ioc", "aop", "method interception", "jsr" ], "homepage": "https://github.com/koriym/Ray.Di", "version": "1.0.0-beta1", "license": "BSD-3-Clause", "authors": [ { "name": "Akihito Koriyama", "email": "akihito.koriyama@gmail.com" } ], "require": { "php": ">=5.4.0", "doctrine/common": "2.3.*-dev", "Ray/Aop": ">=1.0.*-dev", "Aura/Di": ">=1.0.*-dev" }, "replace": { }, "autoload": { "psr-0": { "Ray\\Di": "src/", "Aura\\Di": "vendor/Aura/Di/src/" } }, "minimum-stability": "dev" }
{ "name": "ray/di", "type": "library", "description": "Guice style annotation-driven dependency injection framework", "keywords": [ "dependency injection", "di", "container", "guice", "annotation", "ioc", "aop", "method interception", "jsr" ], "homepage": "https://github.com/koriym/Ray.Di", "version": "1.0.0-beta1", "license": "BSD-3-Clause", "authors": [ { "name": "Akihito Koriyama", "email": "akihito.koriyama@gmail.com" } ], "require": { "php": ">=5.4.0", "doctrine/common": "2.3.*-dev", "Ray/Aop": ">=1.0.*-dev", "Aura/Di": ">=1.0.*-dev" }, "replace": {"Ray/Di": "self.version"} }, "autoload": { "psr-0": { "Ray\\Di": "src/", "Aura\\Di": "vendor/Aura/Di/src/" } }, "minimum-stability": "dev" }
Rename package name in packagist.
Rename package name in packagist.
JSON
mit
ray-di/Ray.Di,koriym/Ray.Di,deizel/Ray.Di
json
## Code Before: { "name": "ray/di", "type": "library", "description": "Guice style annotation-driven dependency injection framework", "keywords": [ "dependency injection", "di", "container", "guice", "annotation", "ioc", "aop", "method interception", "jsr" ], "homepage": "https://github.com/koriym/Ray.Di", "version": "1.0.0-beta1", "license": "BSD-3-Clause", "authors": [ { "name": "Akihito Koriyama", "email": "akihito.koriyama@gmail.com" } ], "require": { "php": ">=5.4.0", "doctrine/common": "2.3.*-dev", "Ray/Aop": ">=1.0.*-dev", "Aura/Di": ">=1.0.*-dev" }, "replace": { }, "autoload": { "psr-0": { "Ray\\Di": "src/", "Aura\\Di": "vendor/Aura/Di/src/" } }, "minimum-stability": "dev" } ## Instruction: Rename package name in packagist. ## Code After: { "name": "ray/di", "type": "library", "description": "Guice style annotation-driven dependency injection framework", "keywords": [ "dependency injection", "di", "container", "guice", "annotation", "ioc", "aop", "method interception", "jsr" ], "homepage": "https://github.com/koriym/Ray.Di", "version": "1.0.0-beta1", "license": "BSD-3-Clause", "authors": [ { "name": "Akihito Koriyama", "email": "akihito.koriyama@gmail.com" } ], "require": { "php": ">=5.4.0", "doctrine/common": "2.3.*-dev", "Ray/Aop": ">=1.0.*-dev", "Aura/Di": ">=1.0.*-dev" }, "replace": {"Ray/Di": "self.version"} }, "autoload": { "psr-0": { "Ray\\Di": "src/", "Aura\\Di": "vendor/Aura/Di/src/" } }, "minimum-stability": "dev" }
{ "name": "ray/di", "type": "library", "description": "Guice style annotation-driven dependency injection framework", "keywords": [ "dependency injection", "di", "container", "guice", "annotation", "ioc", "aop", "method interception", "jsr" ], "homepage": "https://github.com/koriym/Ray.Di", "version": "1.0.0-beta1", "license": "BSD-3-Clause", "authors": [ { "name": "Akihito Koriyama", "email": "akihito.koriyama@gmail.com" } ], "require": { "php": ">=5.4.0", "doctrine/common": "2.3.*-dev", "Ray/Aop": ">=1.0.*-dev", "Aura/Di": ">=1.0.*-dev" }, - "replace": { + "replace": {"Ray/Di": "self.version"} }, "autoload": { "psr-0": { "Ray\\Di": "src/", "Aura\\Di": "vendor/Aura/Di/src/" } }, "minimum-stability": "dev" }
2
0.05
1
1
b9e410f41edc24355c3922303b72d08ef65cbd04
package.json
package.json
{ "name": "twitter-crawler", "version": "1.0.3", "description": "NodeJS Crawler for Twitter", "engines": { "node": ">=6.0.0" }, "keywords": [ "twitter", "crawl", "crawling", "crawler", "tweets" ], "license": "Apache-2.0", "author": "Ary Pablo Batista <batarypa@ar.ibm.com>", "main": "index.js", "repository": { "type": "git", "url": "git@github.com:ibm-silvergate/nodejs-twitter-crawler.git" }, "scripts": { "test": "npm run jshint && (npm run codecov || true)", "jshint": "jshint --exclude ./node_modules/", "codecov": "istanbul cover ./node_modules/mocha/bin/_mocha && codecov" }, "dependencies": { "bluebird": "^3.3.5", "extend": "^3.0.0", "twitter": "^1.2.5", "winston": "^2.2.0" }, "devDependencies": { "chai": "^3.5.0", "codecov": "^1.0.1", "istanbul": "^0.4.3", "jshint": "^2.9.2", "mocha": "^2.4.5", "underscore": "*" } }
{ "name": "twitter-crawler", "version": "1.0.3", "description": "NodeJS Crawler for Twitter", "engines": { "node": ">=6.0.0" }, "keywords": [ "twitter", "crawl", "crawling", "crawler", "tweets" ], "license": "Apache-2.0", "author": "Ary Pablo Batista <batarypa@ar.ibm.com>", "main": "index.js", "repository": { "type": "git", "url": "git@github.com:ibm-silvergate/nodejs-twitter-crawler.git" }, "scripts": { "test": "npm run jshint && (npm run codecov || true)", "jshint": "jshint --exclude ./node_modules/", "codecov": "istanbul cover ./node_modules/mocha/bin/_mocha && codecov" }, "dependencies": { "bluebird": "^3.3.5", "extend": "^3.0.0", "twitter": "^1.2.5", "underscore": "^1.8.3", "winston": "^2.2.0" }, "devDependencies": { "chai": "^3.5.0", "codecov": "^1.0.1", "istanbul": "^0.4.3", "jshint": "^2.9.2", "mocha": "^2.4.5" } }
Add underscore as dependency instead of devDependency
Add underscore as dependency instead of devDependency
JSON
apache-2.0
ibm-silvergate/nodejs-twitter-crawler
json
## Code Before: { "name": "twitter-crawler", "version": "1.0.3", "description": "NodeJS Crawler for Twitter", "engines": { "node": ">=6.0.0" }, "keywords": [ "twitter", "crawl", "crawling", "crawler", "tweets" ], "license": "Apache-2.0", "author": "Ary Pablo Batista <batarypa@ar.ibm.com>", "main": "index.js", "repository": { "type": "git", "url": "git@github.com:ibm-silvergate/nodejs-twitter-crawler.git" }, "scripts": { "test": "npm run jshint && (npm run codecov || true)", "jshint": "jshint --exclude ./node_modules/", "codecov": "istanbul cover ./node_modules/mocha/bin/_mocha && codecov" }, "dependencies": { "bluebird": "^3.3.5", "extend": "^3.0.0", "twitter": "^1.2.5", "winston": "^2.2.0" }, "devDependencies": { "chai": "^3.5.0", "codecov": "^1.0.1", "istanbul": "^0.4.3", "jshint": "^2.9.2", "mocha": "^2.4.5", "underscore": "*" } } ## Instruction: Add underscore as dependency instead of devDependency ## Code After: { "name": "twitter-crawler", "version": "1.0.3", "description": "NodeJS Crawler for Twitter", "engines": { "node": ">=6.0.0" }, "keywords": [ "twitter", "crawl", "crawling", "crawler", "tweets" ], "license": "Apache-2.0", "author": "Ary Pablo Batista <batarypa@ar.ibm.com>", "main": "index.js", "repository": { "type": "git", "url": "git@github.com:ibm-silvergate/nodejs-twitter-crawler.git" }, "scripts": { "test": "npm run jshint && (npm run codecov || true)", "jshint": "jshint --exclude ./node_modules/", "codecov": "istanbul cover ./node_modules/mocha/bin/_mocha && codecov" }, "dependencies": { "bluebird": "^3.3.5", "extend": "^3.0.0", "twitter": "^1.2.5", "underscore": "^1.8.3", "winston": "^2.2.0" }, "devDependencies": { "chai": "^3.5.0", "codecov": "^1.0.1", "istanbul": "^0.4.3", "jshint": "^2.9.2", "mocha": "^2.4.5" } }
{ "name": "twitter-crawler", "version": "1.0.3", "description": "NodeJS Crawler for Twitter", "engines": { "node": ">=6.0.0" }, "keywords": [ "twitter", "crawl", "crawling", "crawler", "tweets" ], "license": "Apache-2.0", "author": "Ary Pablo Batista <batarypa@ar.ibm.com>", "main": "index.js", "repository": { "type": "git", "url": "git@github.com:ibm-silvergate/nodejs-twitter-crawler.git" }, "scripts": { "test": "npm run jshint && (npm run codecov || true)", "jshint": "jshint --exclude ./node_modules/", "codecov": "istanbul cover ./node_modules/mocha/bin/_mocha && codecov" }, "dependencies": { "bluebird": "^3.3.5", "extend": "^3.0.0", "twitter": "^1.2.5", + "underscore": "^1.8.3", "winston": "^2.2.0" }, "devDependencies": { "chai": "^3.5.0", "codecov": "^1.0.1", "istanbul": "^0.4.3", "jshint": "^2.9.2", - "mocha": "^2.4.5", ? - + "mocha": "^2.4.5" - "underscore": "*" } }
4
0.097561
2
2
51e7cd3bc5a9a56fb53a5b0a8328d0b9d58848dd
modder/utils/desktop_notification.py
modder/utils/desktop_notification.py
import platform if platform.system() == 'Darwin': from Foundation import NSUserNotificationDefaultSoundName import objc NSUserNotification = objc.lookUpClass('NSUserNotification') NSUserNotificationCenter = objc.lookUpClass('NSUserNotificationCenter') def desktop_notify(text, title='Modder', sound=False): notification = NSUserNotification.alloc().init() notification.setTitle_(title.decode('utf-8')) notification.setInformativeText_(text.decode('utf-8')) if sound: notification.setSoundName_(NSUserNotificationDefaultSoundName) center = NSUserNotificationCenter.defaultUserNotificationCenter() center.deliverNotification_(notification) elif platform.system() == 'Windows': def desktop_notify(text, title='Modder', sound=False): pass elif platform.system() == 'Linux': def desktop_notify(text, title='Modder', sound=False): pass
import platform if platform.system() == 'Darwin': from Foundation import NSUserNotificationDefaultSoundName import objc NSUserNotification = objc.lookUpClass('NSUserNotification') NSUserNotificationCenter = objc.lookUpClass('NSUserNotificationCenter') def desktop_notify(text, title=None, sound=False): title = title or 'Modder' notification = NSUserNotification.alloc().init() notification.setTitle_(title.decode('utf-8')) notification.setInformativeText_(text.decode('utf-8')) if sound: notification.setSoundName_(NSUserNotificationDefaultSoundName) center = NSUserNotificationCenter.defaultUserNotificationCenter() center.deliverNotification_(notification) elif platform.system() == 'Windows': def desktop_notify(text, title=None, sound=False): title = title or 'Modder' pass elif platform.system() == 'Linux': def desktop_notify(text, title=None, sound=False): title = title or 'Modder' pass
Fix title for desktop notification
Fix title for desktop notification
Python
mit
JokerQyou/Modder2
python
## Code Before: import platform if platform.system() == 'Darwin': from Foundation import NSUserNotificationDefaultSoundName import objc NSUserNotification = objc.lookUpClass('NSUserNotification') NSUserNotificationCenter = objc.lookUpClass('NSUserNotificationCenter') def desktop_notify(text, title='Modder', sound=False): notification = NSUserNotification.alloc().init() notification.setTitle_(title.decode('utf-8')) notification.setInformativeText_(text.decode('utf-8')) if sound: notification.setSoundName_(NSUserNotificationDefaultSoundName) center = NSUserNotificationCenter.defaultUserNotificationCenter() center.deliverNotification_(notification) elif platform.system() == 'Windows': def desktop_notify(text, title='Modder', sound=False): pass elif platform.system() == 'Linux': def desktop_notify(text, title='Modder', sound=False): pass ## Instruction: Fix title for desktop notification ## Code After: import platform if platform.system() == 'Darwin': from Foundation import NSUserNotificationDefaultSoundName import objc NSUserNotification = objc.lookUpClass('NSUserNotification') NSUserNotificationCenter = objc.lookUpClass('NSUserNotificationCenter') def desktop_notify(text, title=None, sound=False): title = title or 'Modder' notification = NSUserNotification.alloc().init() notification.setTitle_(title.decode('utf-8')) notification.setInformativeText_(text.decode('utf-8')) if sound: notification.setSoundName_(NSUserNotificationDefaultSoundName) center = NSUserNotificationCenter.defaultUserNotificationCenter() center.deliverNotification_(notification) elif platform.system() == 'Windows': def desktop_notify(text, title=None, sound=False): title = title or 'Modder' pass elif platform.system() == 'Linux': def desktop_notify(text, title=None, sound=False): title = title or 'Modder' pass
import platform if platform.system() == 'Darwin': from Foundation import NSUserNotificationDefaultSoundName import objc NSUserNotification = objc.lookUpClass('NSUserNotification') NSUserNotificationCenter = objc.lookUpClass('NSUserNotificationCenter') - def desktop_notify(text, title='Modder', sound=False): ? ^^ ^^ -- + def desktop_notify(text, title=None, sound=False): ? ^ ^ + title = title or 'Modder' + notification = NSUserNotification.alloc().init() notification.setTitle_(title.decode('utf-8')) notification.setInformativeText_(text.decode('utf-8')) if sound: notification.setSoundName_(NSUserNotificationDefaultSoundName) center = NSUserNotificationCenter.defaultUserNotificationCenter() center.deliverNotification_(notification) elif platform.system() == 'Windows': - def desktop_notify(text, title='Modder', sound=False): ? ^^ ^^ -- + def desktop_notify(text, title=None, sound=False): ? ^ ^ + title = title or 'Modder' + pass elif platform.system() == 'Linux': - def desktop_notify(text, title='Modder', sound=False): ? ^^ ^^ -- + def desktop_notify(text, title=None, sound=False): ? ^ ^ + title = title or 'Modder' + pass
12
0.444444
9
3
bb22de261a902298edf2b930efc025b0655455b3
manifest.json
manifest.json
{ "manifest_version": 2, "name": "AGDSN Traffic", "version": "3.0.5", "author": "Hagen Eckert, Christian Jacobs, Tim Kluge", "default_locale": "en", "description": "__MSG_description__", "icons": { "16": "logo/logo_16.png", "48": "logo/logo_48.png", "128": "logo/logo_128.png" }, "browser_action": { "default_icon": "icon/inactive.png", "default_title": "AGDSN Traffic", "default_popup": "popup.html" }, "permissions": [ "alarms", "https://agdsn.de/sipa/usertraffic", "https://agdsn.de/sipa/usertraffic/json", "https://agdsn.de/" ], "background": { "scripts": ["jquery-2.1.1.min.js", "background.js"] }, "applications": { "gecko": { "id": "trafficplugin@agdsn.de" } } }
{ "manifest_version": 2, "name": "AGDSN Traffic", "version": "3.0.5", "author": "Hagen Eckert, Christian Jacobs, Tim Kluge", "default_locale": "en", "description": "__MSG_description__", "icons": { "16": "logo/logo_16.png", "48": "logo/logo_48.png", "128": "logo/logo_128.png" }, "browser_action": { "default_icon": "icon/inactive.png", "default_title": "AGDSN Traffic", "default_popup": "popup.html" }, "permissions": [ "alarms", "https://agdsn.de/sipa/usertraffic", "https://agdsn.de/sipa/usertraffic/json", "https://agdsn.de/" ], "background": { "scripts": ["jquery-2.1.1.min.js", "background.js"] } }
Remove application id (became optional setting in new firefox releases)
Remove application id (became optional setting in new firefox releases)
JSON
unlicense
agdsn/trafficplugin,agdsn/trafficplugin
json
## Code Before: { "manifest_version": 2, "name": "AGDSN Traffic", "version": "3.0.5", "author": "Hagen Eckert, Christian Jacobs, Tim Kluge", "default_locale": "en", "description": "__MSG_description__", "icons": { "16": "logo/logo_16.png", "48": "logo/logo_48.png", "128": "logo/logo_128.png" }, "browser_action": { "default_icon": "icon/inactive.png", "default_title": "AGDSN Traffic", "default_popup": "popup.html" }, "permissions": [ "alarms", "https://agdsn.de/sipa/usertraffic", "https://agdsn.de/sipa/usertraffic/json", "https://agdsn.de/" ], "background": { "scripts": ["jquery-2.1.1.min.js", "background.js"] }, "applications": { "gecko": { "id": "trafficplugin@agdsn.de" } } } ## Instruction: Remove application id (became optional setting in new firefox releases) ## Code After: { "manifest_version": 2, "name": "AGDSN Traffic", "version": "3.0.5", "author": "Hagen Eckert, Christian Jacobs, Tim Kluge", "default_locale": "en", "description": "__MSG_description__", "icons": { "16": "logo/logo_16.png", "48": "logo/logo_48.png", "128": "logo/logo_128.png" }, "browser_action": { "default_icon": "icon/inactive.png", "default_title": "AGDSN Traffic", "default_popup": "popup.html" }, "permissions": [ "alarms", "https://agdsn.de/sipa/usertraffic", "https://agdsn.de/sipa/usertraffic/json", "https://agdsn.de/" ], "background": { "scripts": ["jquery-2.1.1.min.js", "background.js"] } }
{ "manifest_version": 2, "name": "AGDSN Traffic", "version": "3.0.5", "author": "Hagen Eckert, Christian Jacobs, Tim Kluge", "default_locale": "en", "description": "__MSG_description__", "icons": { "16": "logo/logo_16.png", "48": "logo/logo_48.png", "128": "logo/logo_128.png" }, "browser_action": { "default_icon": "icon/inactive.png", "default_title": "AGDSN Traffic", "default_popup": "popup.html" }, "permissions": [ "alarms", "https://agdsn.de/sipa/usertraffic", "https://agdsn.de/sipa/usertraffic/json", "https://agdsn.de/" ], "background": { "scripts": ["jquery-2.1.1.min.js", "background.js"] - }, - "applications": { - "gecko": { - "id": "trafficplugin@agdsn.de" - } } }
5
0.151515
0
5
ab8aa95939797c275688e02ffc596c3e2e8e94ea
CHANGES.rst
CHANGES.rst
Changelog ========= 0.1.0 (not yet released) ------------------------ - Initial release.
Changelog ========= 0.1.0 (not yet released) ------------------------ - Added ``django_mc.link`` sub-application. - Added ``AddComponentTypeToRegions`` and ``RemoveComponentTypeFromRegions`` to make it super easy to add and remove component types to and from the list of allowed components in a region. - Initial release.
Add changelog for django_mc.link and migration operations
Add changelog for django_mc.link and migration operations
reStructuredText
bsd-3-clause
team23/django_mc
restructuredtext
## Code Before: Changelog ========= 0.1.0 (not yet released) ------------------------ - Initial release. ## Instruction: Add changelog for django_mc.link and migration operations ## Code After: Changelog ========= 0.1.0 (not yet released) ------------------------ - Added ``django_mc.link`` sub-application. - Added ``AddComponentTypeToRegions`` and ``RemoveComponentTypeFromRegions`` to make it super easy to add and remove component types to and from the list of allowed components in a region. - Initial release.
Changelog ========= 0.1.0 (not yet released) ------------------------ + - Added ``django_mc.link`` sub-application. + - Added ``AddComponentTypeToRegions`` and ``RemoveComponentTypeFromRegions`` + to make it super easy to add and remove component types to and from the list of + allowed components in a region. - Initial release.
4
0.571429
4
0
ac9550e6fadd4d80915b6b93e5ee2ad8236a6a5c
server.js
server.js
var express = require('express'); var path = require('path'); var FlightAware = require('flightaware.js'); // Get access to the FlightAware 2.0 client API ... // See http://flightaware.com/commercial/flightxml for username/apiKey ... var username = 'your-flightaware-username'; var apiKey = 'your-flightaware-apiKey'; var client = new FlightAware(username, apiKey); var app = express(); app.get('/', function(req, res) { res.sendFile(path.join(__dirname, 'index.html')); }); app.get('/api/Arrived/:airport', function(req, res) { client.Arrived({ airport: req.params.airport, }, function(err, result) { if (err) return res.send(err); res.json(result); }); }); var port = 8000; app.listen(port, function() { console.log("Node app is running at http://localhost:" + port); });
var express = require('express'); var path = require('path'); var FlightAware = require('flightaware.js'); var config = require('./config'); // Get access to the FlightAware 2.0 client API ... // See http://flightaware.com/commercial/flightxml for username/apiKey ... var client = new FlightAware(config.username, config.apiKey); var app = express(); app.get('/', function(req, res) { res.sendFile(path.join(__dirname, 'index.html')); }); app.get('/api/Arrived/:airport', function(req, res) { client.Arrived({ airport: req.params.airport, }, function(err, result) { if (err) return res.send(err); res.json(result); }); }); var port = 8000; app.listen(port, function() { console.log("Node app is running at http://localhost:" + port); });
Use a config file for the FlightAware keys.
Use a config file for the FlightAware keys.
JavaScript
apache-2.0
icedawn/angular-flightaware.js,icedawn/angular-flightaware.js
javascript
## Code Before: var express = require('express'); var path = require('path'); var FlightAware = require('flightaware.js'); // Get access to the FlightAware 2.0 client API ... // See http://flightaware.com/commercial/flightxml for username/apiKey ... var username = 'your-flightaware-username'; var apiKey = 'your-flightaware-apiKey'; var client = new FlightAware(username, apiKey); var app = express(); app.get('/', function(req, res) { res.sendFile(path.join(__dirname, 'index.html')); }); app.get('/api/Arrived/:airport', function(req, res) { client.Arrived({ airport: req.params.airport, }, function(err, result) { if (err) return res.send(err); res.json(result); }); }); var port = 8000; app.listen(port, function() { console.log("Node app is running at http://localhost:" + port); }); ## Instruction: Use a config file for the FlightAware keys. ## Code After: var express = require('express'); var path = require('path'); var FlightAware = require('flightaware.js'); var config = require('./config'); // Get access to the FlightAware 2.0 client API ... // See http://flightaware.com/commercial/flightxml for username/apiKey ... var client = new FlightAware(config.username, config.apiKey); var app = express(); app.get('/', function(req, res) { res.sendFile(path.join(__dirname, 'index.html')); }); app.get('/api/Arrived/:airport', function(req, res) { client.Arrived({ airport: req.params.airport, }, function(err, result) { if (err) return res.send(err); res.json(result); }); }); var port = 8000; app.listen(port, function() { console.log("Node app is running at http://localhost:" + port); });
var express = require('express'); var path = require('path'); var FlightAware = require('flightaware.js'); + var config = require('./config'); // Get access to the FlightAware 2.0 client API ... // See http://flightaware.com/commercial/flightxml for username/apiKey ... - var username = 'your-flightaware-username'; - var apiKey = 'your-flightaware-apiKey'; - var client = new FlightAware(username, apiKey); + var client = new FlightAware(config.username, config.apiKey); ? +++++++ +++++++ var app = express(); app.get('/', function(req, res) { res.sendFile(path.join(__dirname, 'index.html')); }); app.get('/api/Arrived/:airport', function(req, res) { client.Arrived({ airport: req.params.airport, }, function(err, result) { if (err) return res.send(err); res.json(result); }); }); var port = 8000; app.listen(port, function() { console.log("Node app is running at http://localhost:" + port); });
5
0.166667
2
3
15ef95e3aff9a22f910a187aa4e2fae951430d7a
CMakeLists.txt
CMakeLists.txt
file(GLOB EASTL_SOURCES "source/*.cpp") add_library(EASTL ${EASTL_SOURCES}) #------------------------------------------------------------------------------------------- # Include dirs #------------------------------------------------------------------------------------------- target_include_directories(EASTL PUBLIC include) target_link_libraries(EASTL EABase)
cmake_minimum_required(VERSION 3.3) #------------------------------------------------------------------------------------------- # Library definition #------------------------------------------------------------------------------------------- file(GLOB EASTL_SOURCES "source/*.cpp") add_library(EASTL ${EASTL_SOURCES}) #------------------------------------------------------------------------------------------- # Include dirs #------------------------------------------------------------------------------------------- target_include_directories(EASTL PUBLIC include) target_link_libraries(EASTL EABase)
Fix up cmake warning: No cmake_minimum_required command is present.
Fix up cmake warning: No cmake_minimum_required command is present.
Text
bsd-3-clause
sinkingsugar/EASTL,electronicarts/EASTL,DragoonX6/EASTL,electronicarts/EASTL,mwolting/EASTL,DragoonX6/EASTL,Nuclearfossil/EASTL,DragoonX6/EASTL,Nuclearfossil/EASTL,mwolting/EASTL,mwolting/EASTL,Nuclearfossil/EASTL,sinkingsugar/EASTL,electronicarts/EASTL,sinkingsugar/EASTL
text
## Code Before: file(GLOB EASTL_SOURCES "source/*.cpp") add_library(EASTL ${EASTL_SOURCES}) #------------------------------------------------------------------------------------------- # Include dirs #------------------------------------------------------------------------------------------- target_include_directories(EASTL PUBLIC include) target_link_libraries(EASTL EABase) ## Instruction: Fix up cmake warning: No cmake_minimum_required command is present. ## Code After: cmake_minimum_required(VERSION 3.3) #------------------------------------------------------------------------------------------- # Library definition #------------------------------------------------------------------------------------------- file(GLOB EASTL_SOURCES "source/*.cpp") add_library(EASTL ${EASTL_SOURCES}) #------------------------------------------------------------------------------------------- # Include dirs #------------------------------------------------------------------------------------------- target_include_directories(EASTL PUBLIC include) target_link_libraries(EASTL EABase)
+ cmake_minimum_required(VERSION 3.3) + #------------------------------------------------------------------------------------------- + # Library definition + #------------------------------------------------------------------------------------------- file(GLOB EASTL_SOURCES "source/*.cpp") add_library(EASTL ${EASTL_SOURCES}) #------------------------------------------------------------------------------------------- # Include dirs #------------------------------------------------------------------------------------------- target_include_directories(EASTL PUBLIC include) target_link_libraries(EASTL EABase)
4
0.444444
4
0
14d6537cd2000ae28320366934d769846f3610cf
src/index.js
src/index.js
import React, { Component, PropTypes } from 'react' import ReactDOM from 'react-dom' import ReactDOMServer from 'react-dom/server' import SVGInjector from 'svg-injector' export default class ReactSVG extends Component { static defaultProps = { callback: () => {}, className: '', evalScripts: 'once', style: {} } static propTypes = { callback: PropTypes.func, className: PropTypes.string, evalScripts: PropTypes.oneOf([ 'always', 'once', 'never' ]), path: PropTypes.string.isRequired, style: PropTypes.object } renderSVG(props = this.props) { const { callback: each, className, evalScripts, path, style } = props this.container = this.container || ReactDOM.findDOMNode(this) const div = document.createElement('div') div.innerHTML = ReactDOMServer.renderToStaticMarkup( <img className={className} data-src={path} style={style} /> ) const img = this.container.appendChild(div.firstChild) SVGInjector(img, { evalScripts, each }) } removeSVG() { this.container.removeChild(this.container.firstChild) } componentDidMount() { this.renderSVG() } componentWillReceiveProps(nextProps) { this.removeSVG() this.renderSVG(nextProps) } shouldComponentUpdate() { return false } componentWillUnmount() { this.removeSVG() } render() { return <div /> } }
import React, { Component, PropTypes } from 'react' import ReactDOMServer from 'react-dom/server' import SVGInjector from 'svg-injector' export default class ReactSVG extends Component { static defaultProps = { callback: () => {}, className: '', evalScripts: 'once', style: {} } static propTypes = { callback: PropTypes.func, className: PropTypes.string, evalScripts: PropTypes.oneOf([ 'always', 'once', 'never' ]), path: PropTypes.string.isRequired, style: PropTypes.object } refCallback = (container) => { if (!container) { this.removeSVG() return } this.container = container this.renderSVG() } renderSVG(props = this.props) { const { callback: each, className, evalScripts, path, style } = props const div = document.createElement('div') div.innerHTML = ReactDOMServer.renderToStaticMarkup( <img className={className} data-src={path} style={style} /> ) const img = this.container.appendChild(div.firstChild) SVGInjector(img, { evalScripts, each }) } removeSVG() { this.container.removeChild(this.container.firstChild) } componentWillReceiveProps(nextProps) { this.removeSVG() this.renderSVG(nextProps) } shouldComponentUpdate() { return false } render() { return <div ref={this.refCallback} /> } }
Handle mounting and unmounting via ref callback
Handle mounting and unmounting via ref callback
JavaScript
mit
atomic-app/react-svg
javascript
## Code Before: import React, { Component, PropTypes } from 'react' import ReactDOM from 'react-dom' import ReactDOMServer from 'react-dom/server' import SVGInjector from 'svg-injector' export default class ReactSVG extends Component { static defaultProps = { callback: () => {}, className: '', evalScripts: 'once', style: {} } static propTypes = { callback: PropTypes.func, className: PropTypes.string, evalScripts: PropTypes.oneOf([ 'always', 'once', 'never' ]), path: PropTypes.string.isRequired, style: PropTypes.object } renderSVG(props = this.props) { const { callback: each, className, evalScripts, path, style } = props this.container = this.container || ReactDOM.findDOMNode(this) const div = document.createElement('div') div.innerHTML = ReactDOMServer.renderToStaticMarkup( <img className={className} data-src={path} style={style} /> ) const img = this.container.appendChild(div.firstChild) SVGInjector(img, { evalScripts, each }) } removeSVG() { this.container.removeChild(this.container.firstChild) } componentDidMount() { this.renderSVG() } componentWillReceiveProps(nextProps) { this.removeSVG() this.renderSVG(nextProps) } shouldComponentUpdate() { return false } componentWillUnmount() { this.removeSVG() } render() { return <div /> } } ## Instruction: Handle mounting and unmounting via ref callback ## Code After: import React, { Component, PropTypes } from 'react' import ReactDOMServer from 'react-dom/server' import SVGInjector from 'svg-injector' export default class ReactSVG extends Component { static defaultProps = { callback: () => {}, className: '', evalScripts: 'once', style: {} } static propTypes = { callback: PropTypes.func, className: PropTypes.string, evalScripts: PropTypes.oneOf([ 'always', 'once', 'never' ]), path: PropTypes.string.isRequired, style: PropTypes.object } refCallback = (container) => { if (!container) { this.removeSVG() return } this.container = container this.renderSVG() } renderSVG(props = this.props) { const { callback: each, className, evalScripts, path, style } = props const div = document.createElement('div') div.innerHTML = ReactDOMServer.renderToStaticMarkup( <img className={className} data-src={path} style={style} /> ) const img = this.container.appendChild(div.firstChild) SVGInjector(img, { evalScripts, each }) } removeSVG() { this.container.removeChild(this.container.firstChild) } componentWillReceiveProps(nextProps) { this.removeSVG() this.renderSVG(nextProps) } shouldComponentUpdate() { return false } render() { return <div ref={this.refCallback} /> } }
import React, { Component, PropTypes } from 'react' - import ReactDOM from 'react-dom' import ReactDOMServer from 'react-dom/server' import SVGInjector from 'svg-injector' export default class ReactSVG extends Component { static defaultProps = { callback: () => {}, className: '', evalScripts: 'once', style: {} } static propTypes = { callback: PropTypes.func, className: PropTypes.string, evalScripts: PropTypes.oneOf([ 'always', 'once', 'never' ]), path: PropTypes.string.isRequired, style: PropTypes.object } + refCallback = (container) => { + if (!container) { + this.removeSVG() + return + } + + this.container = container + this.renderSVG() + } + renderSVG(props = this.props) { const { callback: each, className, evalScripts, path, style } = props - - this.container = this.container || ReactDOM.findDOMNode(this) const div = document.createElement('div') div.innerHTML = ReactDOMServer.renderToStaticMarkup( <img className={className} data-src={path} style={style} /> ) const img = this.container.appendChild(div.firstChild) SVGInjector(img, { evalScripts, each }) } removeSVG() { this.container.removeChild(this.container.firstChild) } - componentDidMount() { - this.renderSVG() - } - componentWillReceiveProps(nextProps) { this.removeSVG() this.renderSVG(nextProps) } shouldComponentUpdate() { return false } - componentWillUnmount() { - this.removeSVG() - } - render() { - return <div /> + return <div ref={this.refCallback} /> } }
23
0.302632
11
12
c579148a0e5da18d9e531acdfd00433863778df0
test.lua
test.lua
button = ""; old_button = ""; count = 0; fact = ""; while (true) do for key, value in pairs(joypad.get(1)) do if(value) then button = key; end; end; if(button == "select" and old_button ~= button) then count = count + 1; output = io.open("output.txt", "w"); io.output(output); io.write(count); io.close(output); end; input = io.open("input.txt", "r"); io.input(input); input_content = io.read(); io.close(input); if(input_content ~= nil) then fact = input_content end; old_button = button; gui.text(50, 100, fact); emu.frameadvance(); end;
button = ""; old_button = ""; count = 0; fact = ""; function kill_mario () -- Sets the timer to zero. memory.writebyte(0x07F8, 0); memory.writebyte(0x07F9, 0); memory.writebyte(0x07FA, 0); end; function read_coins () -- Returns the number of coins the user has return memory.readbyte(0x07ED) .. memory.readbyte(0x07EE) end; function edit_coins (left, right) memory.writebyte(0x07ED, left); memory.writebyte(0x07EE, right); end; while (true) do for key, value in pairs(joypad.get(1)) do if(value) then button = key; end; end; if(button == "select" and old_button ~= button) then count = count + 1; output = io.open("output.txt", "w"); io.output(output); io.write(count); io.close(output); kill_mario(); end; input = io.open("input.txt", "r"); io.input(input); input_content = io.read(); io.close(input); if(input_content ~= nil) then fact = input_content end; old_button = button; gui.text(0, 50, fact); emu.frameadvance(); end;
Implement basic memory editing functions for super mario bros
Implement basic memory editing functions for super mario bros
Lua
mit
sagnew/RomHacking,sagnew/RomHacking
lua
## Code Before: button = ""; old_button = ""; count = 0; fact = ""; while (true) do for key, value in pairs(joypad.get(1)) do if(value) then button = key; end; end; if(button == "select" and old_button ~= button) then count = count + 1; output = io.open("output.txt", "w"); io.output(output); io.write(count); io.close(output); end; input = io.open("input.txt", "r"); io.input(input); input_content = io.read(); io.close(input); if(input_content ~= nil) then fact = input_content end; old_button = button; gui.text(50, 100, fact); emu.frameadvance(); end; ## Instruction: Implement basic memory editing functions for super mario bros ## Code After: button = ""; old_button = ""; count = 0; fact = ""; function kill_mario () -- Sets the timer to zero. memory.writebyte(0x07F8, 0); memory.writebyte(0x07F9, 0); memory.writebyte(0x07FA, 0); end; function read_coins () -- Returns the number of coins the user has return memory.readbyte(0x07ED) .. memory.readbyte(0x07EE) end; function edit_coins (left, right) memory.writebyte(0x07ED, left); memory.writebyte(0x07EE, right); end; while (true) do for key, value in pairs(joypad.get(1)) do if(value) then button = key; end; end; if(button == "select" and old_button ~= button) then count = count + 1; output = io.open("output.txt", "w"); io.output(output); io.write(count); io.close(output); kill_mario(); end; input = io.open("input.txt", "r"); io.input(input); input_content = io.read(); io.close(input); if(input_content ~= nil) then fact = input_content end; old_button = button; gui.text(0, 50, fact); emu.frameadvance(); end;
button = ""; old_button = ""; count = 0; fact = ""; + function kill_mario () + -- Sets the timer to zero. + memory.writebyte(0x07F8, 0); + memory.writebyte(0x07F9, 0); + memory.writebyte(0x07FA, 0); + end; + + function read_coins () + -- Returns the number of coins the user has + return memory.readbyte(0x07ED) .. memory.readbyte(0x07EE) + end; + + function edit_coins (left, right) + memory.writebyte(0x07ED, left); + memory.writebyte(0x07EE, right); + end; + while (true) do for key, value in pairs(joypad.get(1)) do if(value) then - button = key; ? ^ + button = key; ? ^^ end; end; if(button == "select" and old_button ~= button) then count = count + 1; output = io.open("output.txt", "w"); io.output(output); io.write(count); io.close(output); + kill_mario(); end; input = io.open("input.txt", "r"); io.input(input); input_content = io.read(); io.close(input); if(input_content ~= nil) then - fact = input_content ? ^ + fact = input_content ? ^^ end; old_button = button; - gui.text(50, 100, fact); ? - ^^ + gui.text(0, 50, fact); ? ^ emu.frameadvance(); end;
24
0.705882
21
3
05e4ee6a55c217849800b4dfa828b7c2af28f228
src/DI/ThemesExtension.php
src/DI/ThemesExtension.php
<?php /** * Created by PhpStorm. * User: Michal * Date: 8.1.14 * Time: 19:02 */ namespace AnnotateCms\Themes\DI; use AnnotateCms\Framework\DI\CompilerExtension; use AnnotateCms\Themes\Loaders\ThemesLoader; use Kdyby\Events\DI\EventsExtension; class ThemesExtension extends CompilerExtension { function getServices() { $config = $this->getConfig(); return [ "themeLoader" => [ "class" => ThemesLoader::classname, "tags" => [EventsExtension::SUBSCRIBER_TAG], "setup" => [ "setFrontendTheme" => ["name" => $config["frontend"]], "setBackendTheme" => ["name" => $config["backend"]], ], ], ]; } function getFactories() { // TODO: Implement getFactories() method. } function getDefaults() { return [ "frontend" => "Sandbox", "backend" => "Flatty", ]; } }
<?php /** * Created by PhpStorm. * User: Michal * Date: 8.1.14 * Time: 19:02 */ namespace AnnotateCms\Themes\DI; use AnnotateCms\Themes\Loaders\ThemesLoader; use Kdyby\Events\DI\EventsExtension; use Nette\DI\CompilerExtension; class ThemesExtension extends CompilerExtension { public function loadConfiguration() { $configuration = $this->getConfig($this->getDefaults()); $this->getContainerBuilder()->addDefinition($this->prefix('themeLoader')) ->setClass(ThemesLoader::classname) ->addTag(EventsExtension::SUBSCRIBER_TAG) ->addSetup('setFrontendTheme', ['name' => $configuration['frontend']]) ->addSetup('setBackendTheme', ['name' => $configuration['backend']]); } function getDefaults() { return [ 'frontend' => '', 'backend' => '', ]; } }
Remove custom compiler extension class
Remove custom compiler extension class
PHP
mit
greeny/themes,greeny/themes
php
## Code Before: <?php /** * Created by PhpStorm. * User: Michal * Date: 8.1.14 * Time: 19:02 */ namespace AnnotateCms\Themes\DI; use AnnotateCms\Framework\DI\CompilerExtension; use AnnotateCms\Themes\Loaders\ThemesLoader; use Kdyby\Events\DI\EventsExtension; class ThemesExtension extends CompilerExtension { function getServices() { $config = $this->getConfig(); return [ "themeLoader" => [ "class" => ThemesLoader::classname, "tags" => [EventsExtension::SUBSCRIBER_TAG], "setup" => [ "setFrontendTheme" => ["name" => $config["frontend"]], "setBackendTheme" => ["name" => $config["backend"]], ], ], ]; } function getFactories() { // TODO: Implement getFactories() method. } function getDefaults() { return [ "frontend" => "Sandbox", "backend" => "Flatty", ]; } } ## Instruction: Remove custom compiler extension class ## Code After: <?php /** * Created by PhpStorm. * User: Michal * Date: 8.1.14 * Time: 19:02 */ namespace AnnotateCms\Themes\DI; use AnnotateCms\Themes\Loaders\ThemesLoader; use Kdyby\Events\DI\EventsExtension; use Nette\DI\CompilerExtension; class ThemesExtension extends CompilerExtension { public function loadConfiguration() { $configuration = $this->getConfig($this->getDefaults()); $this->getContainerBuilder()->addDefinition($this->prefix('themeLoader')) ->setClass(ThemesLoader::classname) ->addTag(EventsExtension::SUBSCRIBER_TAG) ->addSetup('setFrontendTheme', ['name' => $configuration['frontend']]) ->addSetup('setBackendTheme', ['name' => $configuration['backend']]); } function getDefaults() { return [ 'frontend' => '', 'backend' => '', ]; } }
<?php /** * Created by PhpStorm. * User: Michal * Date: 8.1.14 * Time: 19:02 */ namespace AnnotateCms\Themes\DI; - use AnnotateCms\Framework\DI\CompilerExtension; use AnnotateCms\Themes\Loaders\ThemesLoader; use Kdyby\Events\DI\EventsExtension; + use Nette\DI\CompilerExtension; class ThemesExtension extends CompilerExtension { + public function loadConfiguration() + { + $configuration = $this->getConfig($this->getDefaults()); + $this->getContainerBuilder()->addDefinition($this->prefix('themeLoader')) - - function getServices() - { - $config = $this->getConfig(); - return [ - "themeLoader" => [ - "class" => ThemesLoader::classname, ? ^^^^^^ ^^^^^ ^ + ->setClass(ThemesLoader::classname) ? ^^^^^^ ^ ^ - "tags" => [EventsExtension::SUBSCRIBER_TAG], ? ^^^^^^ ^^^^^^^ ^^ + ->addTag(EventsExtension::SUBSCRIBER_TAG) ? ^^^^^^ ^ ^ + ->addSetup('setFrontendTheme', ['name' => $configuration['frontend']]) + ->addSetup('setBackendTheme', ['name' => $configuration['backend']]); - "setup" => [ - "setFrontendTheme" => ["name" => $config["frontend"]], - "setBackendTheme" => ["name" => $config["backend"]], - ], - ], - ]; - } - - - function getFactories() - { - // TODO: Implement getFactories() method. } function getDefaults() { return [ - "frontend" => "Sandbox", ? ^ ^ ^^^^^^^^^ + 'frontend' => '', ? ^ ^ ^^ - "backend" => "Flatty", ? ^ ^ ^^^^^^^^ + 'backend' => '', ? ^ ^ ^^ ]; } }
34
0.693878
11
23
a30225ba02d7402cfeb5590dcb52bb018d18230c
Ruby/lib/mini_profiler/storage/redis_store.rb
Ruby/lib/mini_profiler/storage/redis_store.rb
module Rack class MiniProfiler class RedisStore < AbstractStore EXPIRE_SECONDS = 60 * 60 * 24 def initialize(args) @args = args || {} @prefix = @args.delete(:prefix) || 'MPRedisStore' end def save(page_struct) redis.setex "#{@prefix}#{page_struct['Id']}", EXPIRE_SECONDS, Marshal::dump(page_struct) end def load(id) raw = redis.get "#{@prefix}#{id}" if raw Marshal::load raw end end def set_unviewed(user, id) redis.sadd "#{@prefix}-#{user}-v", id end def set_viewed(user, id) redis.srem "#{@prefix}-#{user}-v", id end def get_unviewed_ids(user) redis.smembers "#{@prefix}-#{user}-v" end private def redis require 'redis' unless defined? Redis Redis.new @args end end end end
module Rack class MiniProfiler class RedisStore < AbstractStore EXPIRE_SECONDS = 60 * 60 * 24 def initialize(args) @args = args || {} @prefix = @args.delete(:prefix) || 'MPRedisStore' @redis_connection = @args.delete(:connection) end def save(page_struct) redis.setex "#{@prefix}#{page_struct['Id']}", EXPIRE_SECONDS, Marshal::dump(page_struct) end def load(id) raw = redis.get "#{@prefix}#{id}" if raw Marshal::load raw end end def set_unviewed(user, id) redis.sadd "#{@prefix}-#{user}-v", id end def set_viewed(user, id) redis.srem "#{@prefix}-#{user}-v", id end def get_unviewed_ids(user) redis.smembers "#{@prefix}-#{user}-v" end private def redis return @redis_connection if @redis_connection require 'redis' unless defined? Redis Redis.new @args end end end end
Implement external connection creation in RedisStore
Implement external connection creation in RedisStore
Ruby
mit
MiniProfiler/dotnet,MiniProfiler/dotnet
ruby
## Code Before: module Rack class MiniProfiler class RedisStore < AbstractStore EXPIRE_SECONDS = 60 * 60 * 24 def initialize(args) @args = args || {} @prefix = @args.delete(:prefix) || 'MPRedisStore' end def save(page_struct) redis.setex "#{@prefix}#{page_struct['Id']}", EXPIRE_SECONDS, Marshal::dump(page_struct) end def load(id) raw = redis.get "#{@prefix}#{id}" if raw Marshal::load raw end end def set_unviewed(user, id) redis.sadd "#{@prefix}-#{user}-v", id end def set_viewed(user, id) redis.srem "#{@prefix}-#{user}-v", id end def get_unviewed_ids(user) redis.smembers "#{@prefix}-#{user}-v" end private def redis require 'redis' unless defined? Redis Redis.new @args end end end end ## Instruction: Implement external connection creation in RedisStore ## Code After: module Rack class MiniProfiler class RedisStore < AbstractStore EXPIRE_SECONDS = 60 * 60 * 24 def initialize(args) @args = args || {} @prefix = @args.delete(:prefix) || 'MPRedisStore' @redis_connection = @args.delete(:connection) end def save(page_struct) redis.setex "#{@prefix}#{page_struct['Id']}", EXPIRE_SECONDS, Marshal::dump(page_struct) end def load(id) raw = redis.get "#{@prefix}#{id}" if raw Marshal::load raw end end def set_unviewed(user, id) redis.sadd "#{@prefix}-#{user}-v", id end def set_viewed(user, id) redis.srem "#{@prefix}-#{user}-v", id end def get_unviewed_ids(user) redis.smembers "#{@prefix}-#{user}-v" end private def redis return @redis_connection if @redis_connection require 'redis' unless defined? Redis Redis.new @args end end end end
module Rack class MiniProfiler class RedisStore < AbstractStore EXPIRE_SECONDS = 60 * 60 * 24 def initialize(args) @args = args || {} @prefix = @args.delete(:prefix) || 'MPRedisStore' + @redis_connection = @args.delete(:connection) end def save(page_struct) redis.setex "#{@prefix}#{page_struct['Id']}", EXPIRE_SECONDS, Marshal::dump(page_struct) end def load(id) raw = redis.get "#{@prefix}#{id}" if raw Marshal::load raw end end def set_unviewed(user, id) redis.sadd "#{@prefix}-#{user}-v", id end def set_viewed(user, id) redis.srem "#{@prefix}-#{user}-v", id end def get_unviewed_ids(user) redis.smembers "#{@prefix}-#{user}-v" end private def redis + return @redis_connection if @redis_connection require 'redis' unless defined? Redis Redis.new @args end end end end
2
0.045455
2
0
e9694179c96395b190a8b9b0f479fe12e502e735
README.md
README.md
xtext-maven-example =================== This is the accompanying material for my [blog post](http://mnmlst-dvlpr.blogspot.de/2014/08/building-xtext-languages-with-maven-and.html) on how to build Xtext languages with Maven and Gradle. [Lorenzo Bettini](https://github.com/LorenzoBettini) has provided an additional example on how to use your language in the build of your language itself ("bootstrapping"). It is available on the "bootstrapping" branch
xtext-maven-example =================== This project is outdated and only kept around for historic reasons. Since Xtext 2.9, the Xtext wizard generates a Maven build for you. This is the accompanying material for my [blog post](http://mnmlst-dvlpr.blogspot.de/2014/08/building-xtext-languages-with-maven-and.html) on how to build Xtext languages with Maven and Gradle. [Lorenzo Bettini](https://github.com/LorenzoBettini) has provided an additional example on how to use your language in the build of your language itself ("bootstrapping"). It is available on the "bootstrapping" branch
Mark as outdated because of Xtext 2.9
Mark as outdated because of Xtext 2.9
Markdown
epl-1.0
oehme/xtext-maven-example
markdown
## Code Before: xtext-maven-example =================== This is the accompanying material for my [blog post](http://mnmlst-dvlpr.blogspot.de/2014/08/building-xtext-languages-with-maven-and.html) on how to build Xtext languages with Maven and Gradle. [Lorenzo Bettini](https://github.com/LorenzoBettini) has provided an additional example on how to use your language in the build of your language itself ("bootstrapping"). It is available on the "bootstrapping" branch ## Instruction: Mark as outdated because of Xtext 2.9 ## Code After: xtext-maven-example =================== This project is outdated and only kept around for historic reasons. Since Xtext 2.9, the Xtext wizard generates a Maven build for you. This is the accompanying material for my [blog post](http://mnmlst-dvlpr.blogspot.de/2014/08/building-xtext-languages-with-maven-and.html) on how to build Xtext languages with Maven and Gradle. [Lorenzo Bettini](https://github.com/LorenzoBettini) has provided an additional example on how to use your language in the build of your language itself ("bootstrapping"). It is available on the "bootstrapping" branch
xtext-maven-example =================== + + This project is outdated and only kept around for historic reasons. Since Xtext 2.9, the Xtext wizard generates a Maven build for you. This is the accompanying material for my [blog post](http://mnmlst-dvlpr.blogspot.de/2014/08/building-xtext-languages-with-maven-and.html) on how to build Xtext languages with Maven and Gradle. [Lorenzo Bettini](https://github.com/LorenzoBettini) has provided an additional example on how to use your language in the build of your language itself ("bootstrapping"). It is available on the "bootstrapping" branch
2
0.333333
2
0
54c625f4664f3fb63004ea416977cec01ecd2de6
client/controller/about-controller.coffee
client/controller/about-controller.coffee
class @AboutController extends RouteController onBeforeRun: -> if not subscriptionHandles.moderators subscriptionHandles.moderators = Meteor.subscribe('moderators') subscriptionHandles.moderators.stop = -> tempalte: 'about' renderTemplates: 'nav': to: 'nav' data: -> page: 'about'
class @AboutController extends RouteController onBeforeRun: -> if not subscriptionHandles.moderators subscriptionHandles.moderators = Meteor.subscribe('moderators') subscriptionHandles.moderators.stop = -> waitOn: -> subscriptionHandles.moderators tempalte: 'about' renderTemplates: 'nav': to: 'nav' data: -> page: 'about'
Fix the about page, where moderators don't always show up
Fix the about page, where moderators don't always show up
CoffeeScript
apache-2.0
rantav/reversim-summit-2015,rantav/reversim-summit-2015,rantav/reversim-summit-2014,rantav/reversim-summit-2014,rantav/reversim-summit-2015
coffeescript
## Code Before: class @AboutController extends RouteController onBeforeRun: -> if not subscriptionHandles.moderators subscriptionHandles.moderators = Meteor.subscribe('moderators') subscriptionHandles.moderators.stop = -> tempalte: 'about' renderTemplates: 'nav': to: 'nav' data: -> page: 'about' ## Instruction: Fix the about page, where moderators don't always show up ## Code After: class @AboutController extends RouteController onBeforeRun: -> if not subscriptionHandles.moderators subscriptionHandles.moderators = Meteor.subscribe('moderators') subscriptionHandles.moderators.stop = -> waitOn: -> subscriptionHandles.moderators tempalte: 'about' renderTemplates: 'nav': to: 'nav' data: -> page: 'about'
class @AboutController extends RouteController onBeforeRun: -> if not subscriptionHandles.moderators subscriptionHandles.moderators = Meteor.subscribe('moderators') subscriptionHandles.moderators.stop = -> + waitOn: -> + subscriptionHandles.moderators + tempalte: 'about' renderTemplates: 'nav': to: 'nav' data: -> page: 'about'
3
0.230769
3
0
fb2c51c0393bb41b453869425014de38f4d18591
src/lib.rs
src/lib.rs
//! This is a very early work-in-progress binding to various Linux Kernel APIs. //! //! It is not yet ready for use in your projects. Once version 0.1 or higher //! is released, you are welcome to start using it :) #![cfg(target_os="linux")] pub use std::os::*; pub use std::os::raw::*;
//! This is a very early work-in-progress binding to various Linux Kernel APIs. //! //! It is not yet ready for use in your projects. Once version 0.1 or higher //! is released, you are welcome to start using it :) #![cfg(target_os="linux")] pub use std::os::*; pub use std::os::raw::*; #[cfg(test)] mod tests { #[allow(unused_variables)] #[test] fn ensure_types_exist() { let schar: ::c_schar = -3; let uchar: ::c_uchar = 2; let achar: ::c_char = 62; let ashort: ::c_short = -5162; let ushort: ::c_ushort = 65000; let aint: ::c_int = 26327; let uint: ::c_uint = 20000026; let long: ::c_long = 75473765327; let ulong: ::c_ulong = 26294762868676748; let float: ::c_float = 2462347.426f32; let double: ::c_double = 2694237684327.4326237637f64; assert!(true);//Well, we haven't crashed! I guess it worked } }
Add a unit test to ensure that ctypes are imported
Add a unit test to ensure that ctypes are imported Signed-off-by: Cruz Julian Bishop <2ec049a14d87a31aea1a3d03a4724ab112720c17@gmail.com>
Rust
mit
Techern/linux-api-rs
rust
## Code Before: //! This is a very early work-in-progress binding to various Linux Kernel APIs. //! //! It is not yet ready for use in your projects. Once version 0.1 or higher //! is released, you are welcome to start using it :) #![cfg(target_os="linux")] pub use std::os::*; pub use std::os::raw::*; ## Instruction: Add a unit test to ensure that ctypes are imported Signed-off-by: Cruz Julian Bishop <2ec049a14d87a31aea1a3d03a4724ab112720c17@gmail.com> ## Code After: //! This is a very early work-in-progress binding to various Linux Kernel APIs. //! //! It is not yet ready for use in your projects. Once version 0.1 or higher //! is released, you are welcome to start using it :) #![cfg(target_os="linux")] pub use std::os::*; pub use std::os::raw::*; #[cfg(test)] mod tests { #[allow(unused_variables)] #[test] fn ensure_types_exist() { let schar: ::c_schar = -3; let uchar: ::c_uchar = 2; let achar: ::c_char = 62; let ashort: ::c_short = -5162; let ushort: ::c_ushort = 65000; let aint: ::c_int = 26327; let uint: ::c_uint = 20000026; let long: ::c_long = 75473765327; let ulong: ::c_ulong = 26294762868676748; let float: ::c_float = 2462347.426f32; let double: ::c_double = 2694237684327.4326237637f64; assert!(true);//Well, we haven't crashed! I guess it worked } }
//! This is a very early work-in-progress binding to various Linux Kernel APIs. //! //! It is not yet ready for use in your projects. Once version 0.1 or higher //! is released, you are welcome to start using it :) #![cfg(target_os="linux")] pub use std::os::*; pub use std::os::raw::*; + + #[cfg(test)] + mod tests { + + #[allow(unused_variables)] + #[test] + fn ensure_types_exist() { + let schar: ::c_schar = -3; + let uchar: ::c_uchar = 2; + let achar: ::c_char = 62; + + let ashort: ::c_short = -5162; + let ushort: ::c_ushort = 65000; + + let aint: ::c_int = 26327; + let uint: ::c_uint = 20000026; + + let long: ::c_long = 75473765327; + let ulong: ::c_ulong = 26294762868676748; + + let float: ::c_float = 2462347.426f32; + let double: ::c_double = 2694237684327.4326237637f64; + + assert!(true);//Well, we haven't crashed! I guess it worked + } + + }
27
3
27
0
4ce4bcd77abc41dca870dcddfc12b4547e901b7d
src/app/states/devices/device-og-kit.ts
src/app/states/devices/device-og-kit.ts
import { AbstractDevice, DeviceParams, DeviceParamsModel, DeviceParamType, DeviceType, RawDevice } from './abstract-device'; import { _ } from '@biesbjerg/ngx-translate-extract/dist/utils/utils'; export class DeviceOGKit extends AbstractDevice { readonly deviceType = DeviceType.OGKit; apparatusVersion = DeviceType.OGKit; params: DeviceParams = { audioHits: true, visualHits: true }; paramsModel: DeviceParamsModel = { audioHits: { label: <string>_('SENSORS.PARAM.AUDIO_HITS'), type: DeviceParamType.Boolean }, visualHits: { label: <string>_('SENSORS.PARAM.VISUAL_HITS'), type: DeviceParamType.Boolean } }; constructor(rawDevice: RawDevice) { super(rawDevice); const manufacturerData = rawDevice.advertising instanceof ArrayBuffer ? new Uint8Array(rawDevice.advertising).slice(23, 29) : new Uint8Array(rawDevice.advertising.kCBAdvDataManufacturerData); this.apparatusId = new TextDecoder('utf8').decode(manufacturerData); } }
import { AbstractDevice, DeviceParams, DeviceParamsModel, DeviceParamType, DeviceType, RawDevice } from './abstract-device'; import { _ } from '@biesbjerg/ngx-translate-extract/dist/utils/utils'; export class DeviceOGKit extends AbstractDevice { readonly deviceType = DeviceType.OGKit; apparatusVersion = DeviceType.OGKit; params: DeviceParams = { audioHits: true, visualHits: true }; paramsModel: DeviceParamsModel = { audioHits: { label: <string>_('SENSORS.PARAM.AUDIO_HITS'), type: DeviceParamType.Boolean }, visualHits: { label: <string>_('SENSORS.PARAM.VISUAL_HITS'), type: DeviceParamType.Boolean } }; constructor(rawDevice: RawDevice) { super(rawDevice); const manufacturerData = rawDevice.advertising instanceof ArrayBuffer ? new Uint8Array(rawDevice.advertising).slice(23, 29) : new Uint8Array(rawDevice.advertising.kCBAdvDataManufacturerData); this.apparatusId = new TextDecoder('utf8').decode(manufacturerData).replace(/\0/g, ''); } }
Fix OGKit device id read on iOS
Fix OGKit device id read on iOS
TypeScript
apache-2.0
openradiation/openradiation-mobile,openradiation/openradiation-mobile,openradiation/openradiation-mobile,openradiation/openradiation-mobile
typescript
## Code Before: import { AbstractDevice, DeviceParams, DeviceParamsModel, DeviceParamType, DeviceType, RawDevice } from './abstract-device'; import { _ } from '@biesbjerg/ngx-translate-extract/dist/utils/utils'; export class DeviceOGKit extends AbstractDevice { readonly deviceType = DeviceType.OGKit; apparatusVersion = DeviceType.OGKit; params: DeviceParams = { audioHits: true, visualHits: true }; paramsModel: DeviceParamsModel = { audioHits: { label: <string>_('SENSORS.PARAM.AUDIO_HITS'), type: DeviceParamType.Boolean }, visualHits: { label: <string>_('SENSORS.PARAM.VISUAL_HITS'), type: DeviceParamType.Boolean } }; constructor(rawDevice: RawDevice) { super(rawDevice); const manufacturerData = rawDevice.advertising instanceof ArrayBuffer ? new Uint8Array(rawDevice.advertising).slice(23, 29) : new Uint8Array(rawDevice.advertising.kCBAdvDataManufacturerData); this.apparatusId = new TextDecoder('utf8').decode(manufacturerData); } } ## Instruction: Fix OGKit device id read on iOS ## Code After: import { AbstractDevice, DeviceParams, DeviceParamsModel, DeviceParamType, DeviceType, RawDevice } from './abstract-device'; import { _ } from '@biesbjerg/ngx-translate-extract/dist/utils/utils'; export class DeviceOGKit extends AbstractDevice { readonly deviceType = DeviceType.OGKit; apparatusVersion = DeviceType.OGKit; params: DeviceParams = { audioHits: true, visualHits: true }; paramsModel: DeviceParamsModel = { audioHits: { label: <string>_('SENSORS.PARAM.AUDIO_HITS'), type: DeviceParamType.Boolean }, visualHits: { label: <string>_('SENSORS.PARAM.VISUAL_HITS'), type: DeviceParamType.Boolean } }; constructor(rawDevice: RawDevice) { super(rawDevice); const manufacturerData = rawDevice.advertising instanceof ArrayBuffer ? new Uint8Array(rawDevice.advertising).slice(23, 29) : new Uint8Array(rawDevice.advertising.kCBAdvDataManufacturerData); this.apparatusId = new TextDecoder('utf8').decode(manufacturerData).replace(/\0/g, ''); } }
import { AbstractDevice, DeviceParams, DeviceParamsModel, DeviceParamType, DeviceType, RawDevice } from './abstract-device'; import { _ } from '@biesbjerg/ngx-translate-extract/dist/utils/utils'; export class DeviceOGKit extends AbstractDevice { readonly deviceType = DeviceType.OGKit; apparatusVersion = DeviceType.OGKit; params: DeviceParams = { audioHits: true, visualHits: true }; paramsModel: DeviceParamsModel = { audioHits: { label: <string>_('SENSORS.PARAM.AUDIO_HITS'), type: DeviceParamType.Boolean }, visualHits: { label: <string>_('SENSORS.PARAM.VISUAL_HITS'), type: DeviceParamType.Boolean } }; constructor(rawDevice: RawDevice) { super(rawDevice); const manufacturerData = rawDevice.advertising instanceof ArrayBuffer ? new Uint8Array(rawDevice.advertising).slice(23, 29) : new Uint8Array(rawDevice.advertising.kCBAdvDataManufacturerData); - this.apparatusId = new TextDecoder('utf8').decode(manufacturerData); + this.apparatusId = new TextDecoder('utf8').decode(manufacturerData).replace(/\0/g, ''); ? +++++++++++++++++++ } }
2
0.052632
1
1
f64447ca0e1442552b4a854fec5a8f847d2165cd
numpy/_array_api/_types.py
numpy/_array_api/_types.py
__all__ = ['Literal', 'Optional', 'Tuple', 'Union', 'array', 'device', 'dtype', 'SupportsDLPack', 'SupportsBufferProtocol', 'PyCapsule'] from typing import Literal, Optional, Tuple, Union, TypeVar import numpy as np array = np.ndarray device = TypeVar('device') dtype = Literal[np.int8, np.int16, np.int32, np.int64, np.uint8, np.uint16, np.uint32, np.uint64, np.float32, np.float64] SupportsDLPack = TypeVar('SupportsDLPack') SupportsBufferProtocol = TypeVar('SupportsBufferProtocol') PyCapsule = TypeVar('PyCapsule')
__all__ = ['Literal', 'Optional', 'Tuple', 'Union', 'array', 'device', 'dtype', 'SupportsDLPack', 'SupportsBufferProtocol', 'PyCapsule'] from typing import Literal, Optional, Tuple, Union, TypeVar from . import (ndarray, int8, int16, int32, int64, uint8, uint16, uint32, uint64, float32, float64) array = ndarray device = TypeVar('device') dtype = Literal[int8, int16, int32, int64, uint8, uint16, uint32, uint64, float32, float64] SupportsDLPack = TypeVar('SupportsDLPack') SupportsBufferProtocol = TypeVar('SupportsBufferProtocol') PyCapsule = TypeVar('PyCapsule')
Use the array API types for the array API type annotations
Use the array API types for the array API type annotations
Python
mit
cupy/cupy,cupy/cupy,cupy/cupy,cupy/cupy
python
## Code Before: __all__ = ['Literal', 'Optional', 'Tuple', 'Union', 'array', 'device', 'dtype', 'SupportsDLPack', 'SupportsBufferProtocol', 'PyCapsule'] from typing import Literal, Optional, Tuple, Union, TypeVar import numpy as np array = np.ndarray device = TypeVar('device') dtype = Literal[np.int8, np.int16, np.int32, np.int64, np.uint8, np.uint16, np.uint32, np.uint64, np.float32, np.float64] SupportsDLPack = TypeVar('SupportsDLPack') SupportsBufferProtocol = TypeVar('SupportsBufferProtocol') PyCapsule = TypeVar('PyCapsule') ## Instruction: Use the array API types for the array API type annotations ## Code After: __all__ = ['Literal', 'Optional', 'Tuple', 'Union', 'array', 'device', 'dtype', 'SupportsDLPack', 'SupportsBufferProtocol', 'PyCapsule'] from typing import Literal, Optional, Tuple, Union, TypeVar from . import (ndarray, int8, int16, int32, int64, uint8, uint16, uint32, uint64, float32, float64) array = ndarray device = TypeVar('device') dtype = Literal[int8, int16, int32, int64, uint8, uint16, uint32, uint64, float32, float64] SupportsDLPack = TypeVar('SupportsDLPack') SupportsBufferProtocol = TypeVar('SupportsBufferProtocol') PyCapsule = TypeVar('PyCapsule')
__all__ = ['Literal', 'Optional', 'Tuple', 'Union', 'array', 'device', 'dtype', 'SupportsDLPack', 'SupportsBufferProtocol', 'PyCapsule'] from typing import Literal, Optional, Tuple, Union, TypeVar - import numpy as np + from . import (ndarray, int8, int16, int32, int64, uint8, uint16, uint32, + uint64, float32, float64) - array = np.ndarray ? --- + array = ndarray device = TypeVar('device') - dtype = Literal[np.int8, np.int16, np.int32, np.int64, np.uint8, np.uint16, ? --- --- --- --- --- --- + dtype = Literal[int8, int16, int32, int64, uint8, uint16, - np.uint32, np.uint64, np.float32, np.float64] ? --- --- --- --- + uint32, uint64, float32, float64] SupportsDLPack = TypeVar('SupportsDLPack') SupportsBufferProtocol = TypeVar('SupportsBufferProtocol') PyCapsule = TypeVar('PyCapsule')
9
0.6
5
4
cb5f8ef6edd926a1cbf5174f6c7a1d6434c5fcb7
README.md
README.md
自室に設置した Raspberry Pi B+ を使って様々な工作をして、部屋を便利にしていくプロジェクトです。 ## バージョン Ver 1.0
自室に設置した Raspberry Pi B+ を使って様々な工作をして、部屋を便利にしていくプロジェクトです。 ## ソフトウェアバージョン Ver 1.0 ## ハードウェアスペック * Raspberry Pi B+ * OS: Raspbian (Jessie) * 赤外線LED(ILED) * 赤外線受光器 * NFCリーダー/ライター
Add a description about hardware
Add a description about hardware
Markdown
apache-2.0
hideo54/SmartRoom
markdown
## Code Before: 自室に設置した Raspberry Pi B+ を使って様々な工作をして、部屋を便利にしていくプロジェクトです。 ## バージョン Ver 1.0 ## Instruction: Add a description about hardware ## Code After: 自室に設置した Raspberry Pi B+ を使って様々な工作をして、部屋を便利にしていくプロジェクトです。 ## ソフトウェアバージョン Ver 1.0 ## ハードウェアスペック * Raspberry Pi B+ * OS: Raspbian (Jessie) * 赤外線LED(ILED) * 赤外線受光器 * NFCリーダー/ライター
自室に設置した Raspberry Pi B+ を使って様々な工作をして、部屋を便利にしていくプロジェクトです。 - ## バージョン + ## ソフトウェアバージョン Ver 1.0 + + ## ハードウェアスペック + + * Raspberry Pi B+ + * OS: Raspbian (Jessie) + * 赤外線LED(ILED) + * 赤外線受光器 + * NFCリーダー/ライター
10
1.666667
9
1
5b7e2c7c4ad28634db9641a2b8c96f4d047ae503
arim/fields.py
arim/fields.py
import re from django import forms mac_pattern = re.compile("^[0-9a-f]{12}$") class MacAddrFormField(forms.CharField): def __init__(self, *args, **kwargs): kwargs['max_length'] = 17 super(MacAddrFormField, self).__init__(*args, **kwargs) def clean(self, value): value = super(MacAddrFormField, self).clean(value) value = filter(lambda x: x in "0123456789abcdef", value) if mac_pattern.match(value) is None: raise forms.ValidationError('Invalid MAC address') value = reduce(lambda x,y: x + ':' + y, (value[i:i+2] for i in xrange(0, 12, 2))) return value
import re from django import forms mac_pattern = re.compile("^[0-9a-f]{12}$") class MacAddrFormField(forms.CharField): def __init__(self, *args, **kwargs): kwargs['max_length'] = 17 super(MacAddrFormField, self).__init__(*args, **kwargs) def clean(self, value): value = super(MacAddrFormField, self).clean(value) value = value.lower().replace(':', '').replace('-', '') if mac_pattern.match(value) is None: raise forms.ValidationError('Invalid MAC address') value = reduce(lambda x,y: x + ':' + y, (value[i:i+2] for i in xrange(0, 12, 2))) return value
Revert "Properly handle non-hex characters in MAC"
Revert "Properly handle non-hex characters in MAC" This reverts commit 2734a3f0212c722fb9fe3698dfea0dbd8a14faa7.
Python
bsd-3-clause
OSU-Net/arim,drkitty/arim,OSU-Net/arim,drkitty/arim,drkitty/arim,OSU-Net/arim
python
## Code Before: import re from django import forms mac_pattern = re.compile("^[0-9a-f]{12}$") class MacAddrFormField(forms.CharField): def __init__(self, *args, **kwargs): kwargs['max_length'] = 17 super(MacAddrFormField, self).__init__(*args, **kwargs) def clean(self, value): value = super(MacAddrFormField, self).clean(value) value = filter(lambda x: x in "0123456789abcdef", value) if mac_pattern.match(value) is None: raise forms.ValidationError('Invalid MAC address') value = reduce(lambda x,y: x + ':' + y, (value[i:i+2] for i in xrange(0, 12, 2))) return value ## Instruction: Revert "Properly handle non-hex characters in MAC" This reverts commit 2734a3f0212c722fb9fe3698dfea0dbd8a14faa7. ## Code After: import re from django import forms mac_pattern = re.compile("^[0-9a-f]{12}$") class MacAddrFormField(forms.CharField): def __init__(self, *args, **kwargs): kwargs['max_length'] = 17 super(MacAddrFormField, self).__init__(*args, **kwargs) def clean(self, value): value = super(MacAddrFormField, self).clean(value) value = value.lower().replace(':', '').replace('-', '') if mac_pattern.match(value) is None: raise forms.ValidationError('Invalid MAC address') value = reduce(lambda x,y: x + ':' + y, (value[i:i+2] for i in xrange(0, 12, 2))) return value
import re from django import forms mac_pattern = re.compile("^[0-9a-f]{12}$") class MacAddrFormField(forms.CharField): def __init__(self, *args, **kwargs): kwargs['max_length'] = 17 super(MacAddrFormField, self).__init__(*args, **kwargs) def clean(self, value): value = super(MacAddrFormField, self).clean(value) + value = value.lower().replace(':', '').replace('-', '') - value = filter(lambda x: x in "0123456789abcdef", value) - if mac_pattern.match(value) is None: raise forms.ValidationError('Invalid MAC address') value = reduce(lambda x,y: x + ':' + y, (value[i:i+2] for i in xrange(0, 12, 2))) return value
3
0.130435
1
2
1b4779bf9f48c394e5601ff81d6c35dd91385ede
css/Common.css
css/Common.css
hr { page-break-after: always; }
hr { page-break-after: always; } h2 { text-align: center; }
Put the text of the chapiter header in the center
Put the text of the chapiter header in the center
CSS
mit
fan-jiang/Dujing
css
## Code Before: hr { page-break-after: always; } ## Instruction: Put the text of the chapiter header in the center ## Code After: hr { page-break-after: always; } h2 { text-align: center; }
hr { page-break-after: always; } + + h2 + { + text-align: center; + }
5
1.25
5
0
a952cd075e2378eda1ecd82fb88073505901a662
config/initializers/assets.rb
config/initializers/assets.rb
Rails.application.config.assets.precompile += %w( publify.js publify_admin.js publify.css accounts.css bootstrap.css )
Rails.application.config.assets.precompile += %w( publify.js publify.css publify_admin.js publify_admin.css accounts.css bootstrap.css )
Include admin css in precompile list
Include admin css in precompile list
Ruby
mit
leminhtuan2015/test_temona,leminhtuan2015/nginx_capuchino_rails,framgia/publify,leminhtuan2015/temona_staging,babaa/foodblog,SF-WDI-LABS/publify_debugging_lab,telekomatrix/publify,shaomingtan/publify,K-and-R/publify,totzYuta/coding-diary-of-totz,sf-wdi-25/publify_debugging_lab,solanolabs/publify,blairanderson/that-music-blog,jcfausto/publify,nguyenduyta/deploy-test,leminhtuan2015/test_temona,leminhtuan2015/nginx_capuchino_rails,blairanderson/that-music-blog,drakontia/publify,seyedrazavi/publify,totzYuta/coding-diary-of-totz,mozzan/publify,Juuro/publify,sf-wdi-25/publify_debugging_lab,seyedrazavi/publify,hmallett/publify,leminhtuan2015/portal_staging,jcfausto/publify,leminhtuan2015/temona_staging,moneyadviceservice/publify,freibuis/publify,leminhtuan2015/nginx_capuchino_rails,K-and-R/publify,framgia/publify,nguyenduyta/deploy-test,leminhtuan2015/test_temona,SF-WDI-LABS/publify_debugging_lab,publify/publify,mozzan/publify,leminhtuan2015/temona_staging,freibuis/publify,seyedrazavi/publify,mozzan/publify,solanolabs/publify,moneyadviceservice/publify,publify/publify,shaomingtan/publify,hmallett/publify,freibuis/publify,moneyadviceservice/publify,leminhtuan2015/nginx_capuchino_rails,burakicel/Burakicel.com,nguyenduyta/deploy-test,leminhtuan2015/portal_staging,blairanderson/that-music-blog,burakicel/Burakicel.com,telekomatrix/publify,babaa/foodblog,Juuro/publify,drakontia/publify,Juuro/publify,K-and-R/publify,telekomatrix/publify,hmallett/publify,whithajess/publify,whithajess/publify,sf-wdi-25/publify_debugging_lab,leminhtuan2015/portal_staging,solanolabs/publify,moneyadviceservice/publify,jcfausto/publify,whithajess/publify,publify/publify,leminhtuan2015/portal_staging,SF-WDI-LABS/publify_debugging_lab
ruby
## Code Before: Rails.application.config.assets.precompile += %w( publify.js publify_admin.js publify.css accounts.css bootstrap.css ) ## Instruction: Include admin css in precompile list ## Code After: Rails.application.config.assets.precompile += %w( publify.js publify.css publify_admin.js publify_admin.css accounts.css bootstrap.css )
Rails.application.config.assets.precompile += %w( publify.js + publify.css publify_admin.js - publify.css + publify_admin.css ? ++++++ accounts.css bootstrap.css )
3
0.428571
2
1
533fdf249ee73deb58c0108dafe6e20ecaad7728
salt/mopidy/init.sls
salt/mopidy/init.sls
{% set mopidy = pillar.get('mopidy', {}) %} include: - .pillar_check mopidy: pkgrepo.managed: - name: deb http://apt.mopidy.com/ jessie main contrib non-free - key_url: salt://mopidy/release-key.asc pkg.installed: - pkgs: - mopidy - mopidy-spotify file.managed: - name: /etc/mopidy/mopidy.conf - source: salt://mopidy/mopidy.conf - template: jinja - user: root - group: mopidy - mode: 640 - show_diff: False - require: - pkg: mopidy firewall.append: - chain: INPUT - proto: tcp - port: 6600 - match: - comment - comment: "mopidy: Allow MPD" - jump: ACCEPT {% if 'local' in mopidy %} mopidy-local-media-dir: file.directory: - name: {{ mopidy.local.media_dir }} {% endif %}
{% set mopidy = pillar.get('mopidy', {}) %} include: - .pillar_check mopidy: pkgrepo.managed: - name: deb http://apt.mopidy.com/ jessie main contrib non-free - key_url: salt://mopidy/release-key.asc pkg.installed: - pkgs: - mopidy - mopidy-spotify file.managed: - name: /etc/mopidy/mopidy.conf - source: salt://mopidy/mopidy.conf - template: jinja - user: mopidy - group: root - mode: 440 - show_diff: False - require: - pkg: mopidy firewall.append: - chain: INPUT - proto: tcp - port: 6600 - match: - comment - comment: "mopidy: Allow MPD" - jump: ACCEPT {% if 'local' in mopidy %} mopidy-local-media-dir: file.directory: - name: {{ mopidy.local.media_dir }} {% endif %}
Make mopidy user owner of config file
Make mopidy user owner of config file Turns out there is no group 'mopidy'...
SaltStack
mit
thusoy/salt-states,thusoy/salt-states,thusoy/salt-states,thusoy/salt-states
saltstack
## Code Before: {% set mopidy = pillar.get('mopidy', {}) %} include: - .pillar_check mopidy: pkgrepo.managed: - name: deb http://apt.mopidy.com/ jessie main contrib non-free - key_url: salt://mopidy/release-key.asc pkg.installed: - pkgs: - mopidy - mopidy-spotify file.managed: - name: /etc/mopidy/mopidy.conf - source: salt://mopidy/mopidy.conf - template: jinja - user: root - group: mopidy - mode: 640 - show_diff: False - require: - pkg: mopidy firewall.append: - chain: INPUT - proto: tcp - port: 6600 - match: - comment - comment: "mopidy: Allow MPD" - jump: ACCEPT {% if 'local' in mopidy %} mopidy-local-media-dir: file.directory: - name: {{ mopidy.local.media_dir }} {% endif %} ## Instruction: Make mopidy user owner of config file Turns out there is no group 'mopidy'... ## Code After: {% set mopidy = pillar.get('mopidy', {}) %} include: - .pillar_check mopidy: pkgrepo.managed: - name: deb http://apt.mopidy.com/ jessie main contrib non-free - key_url: salt://mopidy/release-key.asc pkg.installed: - pkgs: - mopidy - mopidy-spotify file.managed: - name: /etc/mopidy/mopidy.conf - source: salt://mopidy/mopidy.conf - template: jinja - user: mopidy - group: root - mode: 440 - show_diff: False - require: - pkg: mopidy firewall.append: - chain: INPUT - proto: tcp - port: 6600 - match: - comment - comment: "mopidy: Allow MPD" - jump: ACCEPT {% if 'local' in mopidy %} mopidy-local-media-dir: file.directory: - name: {{ mopidy.local.media_dir }} {% endif %}
{% set mopidy = pillar.get('mopidy', {}) %} include: - .pillar_check mopidy: pkgrepo.managed: - name: deb http://apt.mopidy.com/ jessie main contrib non-free - key_url: salt://mopidy/release-key.asc pkg.installed: - pkgs: - mopidy - mopidy-spotify file.managed: - name: /etc/mopidy/mopidy.conf - source: salt://mopidy/mopidy.conf - template: jinja - - user: root - - group: mopidy ? ^ --- + - user: mopidy ? ^^^ + - group: root - - mode: 640 ? ^ + - mode: 440 ? ^ - show_diff: False - require: - pkg: mopidy firewall.append: - chain: INPUT - proto: tcp - port: 6600 - match: - comment - comment: "mopidy: Allow MPD" - jump: ACCEPT {% if 'local' in mopidy %} mopidy-local-media-dir: file.directory: - name: {{ mopidy.local.media_dir }} {% endif %}
6
0.142857
3
3
76c67c09b60c45c13f89d2198ad9369b68d53047
resque-retry.gemspec
resque-retry.gemspec
spec = Gem::Specification.new do |s| s.name = 'resque-retry' s.version = '0.0.2' s.date = Time.now.strftime('%Y-%m-%d') s.summary = 'A resque plugin; provides retry, delay and exponential backoff support for resque jobs.' s.homepage = 'http://github.com/lantins/resque-retry' s.authors = ['Luke Antins', 'Ryan Carver'] s.email = 'luke@lividpenguin.com' s.has_rdoc = false s.files = %w(LICENSE Rakefile README.md) s.files += Dir.glob('{test/*,lib/**/*}') s.require_paths = ['lib'] s.add_dependency('resque', '~> 1.8.0') s.add_dependency('resque-scheduler', '~> 1.8.0') s.add_development_dependency('turn') s.add_development_dependency('yard') s.description = <<-EOL resque-retry provides retry, delay and exponential backoff support for resque jobs. Features: * Redis backed retry count/limit. * Retry on all or specific exceptions. * Exponential backoff (varying the delay between retrys). * Small & Extendable - plenty of places to override retry logic/settings. EOL end
spec = Gem::Specification.new do |s| s.name = 'resque-retry' s.version = '0.0.2' s.date = Time.now.strftime('%Y-%m-%d') s.summary = 'A resque plugin; provides retry, delay and exponential backoff support for resque jobs.' s.homepage = 'http://github.com/lantins/resque-retry' s.authors = ['Luke Antins', 'Ryan Carver'] s.email = 'luke@lividpenguin.com' s.has_rdoc = false s.files = %w(LICENSE Rakefile README.md HISTORY.md) s.files += Dir.glob('{test/*,lib/**/*}') s.require_paths = ['lib'] s.add_dependency('resque', '~> 1.8.0') s.add_dependency('resque-scheduler', '~> 1.8.0') s.add_development_dependency('turn') s.add_development_dependency('yard') s.description = <<-EOL resque-retry provides retry, delay and exponential backoff support for resque jobs. Features: * Redis backed retry count/limit. * Retry on all or specific exceptions. * Exponential backoff (varying the delay between retrys). * Small & Extendable - plenty of places to override retry logic/settings. EOL end
Include HISTORY.md file in gem. This one should really be tagged v0.0.2 ;-)
Include HISTORY.md file in gem. This one should really be tagged v0.0.2 ;-)
Ruby
mit
thenovices/resque-retry,jzaleski/resque-retry,thenovices/resque-retry,seomoz/resque-retry,lantins/resque-retry,lantins/resque-retry,jzaleski/resque-retry,thenovices/resque-retry,jzaleski/resque-retry,seomoz/resque-retry,seomoz/resque-retry,lantins/resque-retry
ruby
## Code Before: spec = Gem::Specification.new do |s| s.name = 'resque-retry' s.version = '0.0.2' s.date = Time.now.strftime('%Y-%m-%d') s.summary = 'A resque plugin; provides retry, delay and exponential backoff support for resque jobs.' s.homepage = 'http://github.com/lantins/resque-retry' s.authors = ['Luke Antins', 'Ryan Carver'] s.email = 'luke@lividpenguin.com' s.has_rdoc = false s.files = %w(LICENSE Rakefile README.md) s.files += Dir.glob('{test/*,lib/**/*}') s.require_paths = ['lib'] s.add_dependency('resque', '~> 1.8.0') s.add_dependency('resque-scheduler', '~> 1.8.0') s.add_development_dependency('turn') s.add_development_dependency('yard') s.description = <<-EOL resque-retry provides retry, delay and exponential backoff support for resque jobs. Features: * Redis backed retry count/limit. * Retry on all or specific exceptions. * Exponential backoff (varying the delay between retrys). * Small & Extendable - plenty of places to override retry logic/settings. EOL end ## Instruction: Include HISTORY.md file in gem. This one should really be tagged v0.0.2 ;-) ## Code After: spec = Gem::Specification.new do |s| s.name = 'resque-retry' s.version = '0.0.2' s.date = Time.now.strftime('%Y-%m-%d') s.summary = 'A resque plugin; provides retry, delay and exponential backoff support for resque jobs.' s.homepage = 'http://github.com/lantins/resque-retry' s.authors = ['Luke Antins', 'Ryan Carver'] s.email = 'luke@lividpenguin.com' s.has_rdoc = false s.files = %w(LICENSE Rakefile README.md HISTORY.md) s.files += Dir.glob('{test/*,lib/**/*}') s.require_paths = ['lib'] s.add_dependency('resque', '~> 1.8.0') s.add_dependency('resque-scheduler', '~> 1.8.0') s.add_development_dependency('turn') s.add_development_dependency('yard') s.description = <<-EOL resque-retry provides retry, delay and exponential backoff support for resque jobs. Features: * Redis backed retry count/limit. * Retry on all or specific exceptions. * Exponential backoff (varying the delay between retrys). * Small & Extendable - plenty of places to override retry logic/settings. EOL end
spec = Gem::Specification.new do |s| s.name = 'resque-retry' s.version = '0.0.2' s.date = Time.now.strftime('%Y-%m-%d') s.summary = 'A resque plugin; provides retry, delay and exponential backoff support for resque jobs.' s.homepage = 'http://github.com/lantins/resque-retry' s.authors = ['Luke Antins', 'Ryan Carver'] s.email = 'luke@lividpenguin.com' s.has_rdoc = false - s.files = %w(LICENSE Rakefile README.md) + s.files = %w(LICENSE Rakefile README.md HISTORY.md) ? +++++++++++ s.files += Dir.glob('{test/*,lib/**/*}') s.require_paths = ['lib'] s.add_dependency('resque', '~> 1.8.0') s.add_dependency('resque-scheduler', '~> 1.8.0') s.add_development_dependency('turn') s.add_development_dependency('yard') s.description = <<-EOL resque-retry provides retry, delay and exponential backoff support for resque jobs. Features: * Redis backed retry count/limit. * Retry on all or specific exceptions. * Exponential backoff (varying the delay between retrys). * Small & Extendable - plenty of places to override retry logic/settings. EOL end
2
0.064516
1
1
031c27d3af351eb047f8d985921410945c7b1a94
services-api/src/main/java/io/scalecube/services/api/Address.java
services-api/src/main/java/io/scalecube/services/api/Address.java
package io.scalecube.services.api; import java.util.Objects; public class Address { private final String host; private final int port; public static Address create(String host, int port) { return new Address(host, port); } private Address(String host, int port) { this.host = host; this.port = port; } public String host() { return this.host; } public int port() { return this.port; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Address address = (Address) o; return port == address.port && Objects.equals(host, address.host); } @Override public int hashCode() { return Objects.hash(host, port); } @Override public String toString() { return this.host + ":" + this.port; } }
package io.scalecube.services.api; import java.util.Objects; public class Address { private final String host; private final int port; private Address(String host, int port) { this.host = host; this.port = port; } /** * Create address. * * @param host host * @param port port * @return address */ public static Address create(String host, int port) { return new Address(host, port); } /** * Create address. * * @param hostAndPort host:port * @return address */ public static Address from(String hostAndPort) { String[] split = hostAndPort.split(":"); if (split.length != 2) { throw new IllegalArgumentException(); } String host = split[0]; int port = Integer.parseInt(split[1]); return new Address(host, port); } public String host() { return this.host; } public int port() { return this.port; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Address address = (Address) o; return port == address.port && Objects.equals(host, address.host); } @Override public int hashCode() { return Objects.hash(host, port); } @Override public String toString() { return this.host + ":" + this.port; } }
Set convenient .from method in address
Set convenient .from method in address
Java
apache-2.0
scalecube/scalecube,scalecube/scalecube,servicefabric/servicefabric
java
## Code Before: package io.scalecube.services.api; import java.util.Objects; public class Address { private final String host; private final int port; public static Address create(String host, int port) { return new Address(host, port); } private Address(String host, int port) { this.host = host; this.port = port; } public String host() { return this.host; } public int port() { return this.port; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Address address = (Address) o; return port == address.port && Objects.equals(host, address.host); } @Override public int hashCode() { return Objects.hash(host, port); } @Override public String toString() { return this.host + ":" + this.port; } } ## Instruction: Set convenient .from method in address ## Code After: package io.scalecube.services.api; import java.util.Objects; public class Address { private final String host; private final int port; private Address(String host, int port) { this.host = host; this.port = port; } /** * Create address. * * @param host host * @param port port * @return address */ public static Address create(String host, int port) { return new Address(host, port); } /** * Create address. * * @param hostAndPort host:port * @return address */ public static Address from(String hostAndPort) { String[] split = hostAndPort.split(":"); if (split.length != 2) { throw new IllegalArgumentException(); } String host = split[0]; int port = Integer.parseInt(split[1]); return new Address(host, port); } public String host() { return this.host; } public int port() { return this.port; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Address address = (Address) o; return port == address.port && Objects.equals(host, address.host); } @Override public int hashCode() { return Objects.hash(host, port); } @Override public String toString() { return this.host + ":" + this.port; } }
package io.scalecube.services.api; import java.util.Objects; public class Address { + private final String host; private final int port; + private Address(String host, int port) { + this.host = host; + this.port = port; + } + + /** + * Create address. + * + * @param host host + * @param port port + * @return address + */ public static Address create(String host, int port) { return new Address(host, port); } - private Address(String host, int port) { - this.host = host; - this.port = port; + /** + * Create address. + * + * @param hostAndPort host:port + * @return address + */ + public static Address from(String hostAndPort) { + String[] split = hostAndPort.split(":"); + if (split.length != 2) { + throw new IllegalArgumentException(); + } + String host = split[0]; + int port = Integer.parseInt(split[1]); + return new Address(host, port); } public String host() { return this.host; } public int port() { return this.port; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Address address = (Address) o; return port == address.port && Objects.equals(host, address.host); } @Override public int hashCode() { return Objects.hash(host, port); } @Override public String toString() { return this.host + ":" + this.port; } }
30
0.638298
27
3
929a80bb98e44a2c0f0bd05716d3152d7828e72f
webdiagrams/uml.js
webdiagrams/uml.js
/** * Created by Leandro Luque on 24/07/17. */ /* JSHint configurations */ /* jshint esversion: 6 */ /* jshint -W097 */ 'use strict'; // A. const ATTRIBUTE = "A1"; // C. const CLASS = "C1"; // D. const DEFAULT = "~"; // I. const INITIAL_VALUE = "I1"; const INTERFACE = "I2"; const IS_ABSTRACT = "I3"; const IS_LEAF = "I4"; const IS_READ_ONLY = "I5"; const IS_STATIC = "I6"; // M. const MODEL = "M1"; // O. const OPERATION = "O1"; // P. const PRIVATE = "-"; const PROTECTED = "#"; const PUBLIC = "+"; // R. const RETURN_TYPE = "R1"; // S. const STEREOTYPE = "S1"; // T. const TYPE = "T1"; // V. const VISIBILITY = "V1";
/** * Created by Leandro Luque on 24/07/17. */ /* JSHint configurations */ /* jshint esversion: 6 */ /* jshint -W097 */ 'use strict'; // A. const ATTRIBUTE = "A1"; // C. const CLASS = "C1"; // D. const DEFAULT = "~"; // I. const INITIAL_VALUE = "I1"; const INTERFACE = "I2"; const IS_ABSTRACT = "I3"; const IS_LEAF = "I4"; const IS_READ_ONLY = "I5"; const IS_STATIC = "I6"; // M. const MODEL = "M1"; // O. const OPERATION = "O1"; // P. const PRIVATE = "-"; const PROTECTED = "#"; const PUBLIC = "+"; const PARAMETER = "P1" // R. const RETURN_TYPE = "R1"; // S. const STEREOTYPE = "S1"; // T. const TYPE = "T1"; // V. const VISIBILITY = "V1";
Add parameter to UML constants
Add parameter to UML constants
JavaScript
mit
leluque/webdiagrams,leluque/webdiagrams
javascript
## Code Before: /** * Created by Leandro Luque on 24/07/17. */ /* JSHint configurations */ /* jshint esversion: 6 */ /* jshint -W097 */ 'use strict'; // A. const ATTRIBUTE = "A1"; // C. const CLASS = "C1"; // D. const DEFAULT = "~"; // I. const INITIAL_VALUE = "I1"; const INTERFACE = "I2"; const IS_ABSTRACT = "I3"; const IS_LEAF = "I4"; const IS_READ_ONLY = "I5"; const IS_STATIC = "I6"; // M. const MODEL = "M1"; // O. const OPERATION = "O1"; // P. const PRIVATE = "-"; const PROTECTED = "#"; const PUBLIC = "+"; // R. const RETURN_TYPE = "R1"; // S. const STEREOTYPE = "S1"; // T. const TYPE = "T1"; // V. const VISIBILITY = "V1"; ## Instruction: Add parameter to UML constants ## Code After: /** * Created by Leandro Luque on 24/07/17. */ /* JSHint configurations */ /* jshint esversion: 6 */ /* jshint -W097 */ 'use strict'; // A. const ATTRIBUTE = "A1"; // C. const CLASS = "C1"; // D. const DEFAULT = "~"; // I. const INITIAL_VALUE = "I1"; const INTERFACE = "I2"; const IS_ABSTRACT = "I3"; const IS_LEAF = "I4"; const IS_READ_ONLY = "I5"; const IS_STATIC = "I6"; // M. const MODEL = "M1"; // O. const OPERATION = "O1"; // P. const PRIVATE = "-"; const PROTECTED = "#"; const PUBLIC = "+"; const PARAMETER = "P1" // R. const RETURN_TYPE = "R1"; // S. const STEREOTYPE = "S1"; // T. const TYPE = "T1"; // V. const VISIBILITY = "V1";
/** * Created by Leandro Luque on 24/07/17. */ /* JSHint configurations */ /* jshint esversion: 6 */ /* jshint -W097 */ 'use strict'; // A. const ATTRIBUTE = "A1"; // C. const CLASS = "C1"; // D. const DEFAULT = "~"; // I. const INITIAL_VALUE = "I1"; const INTERFACE = "I2"; const IS_ABSTRACT = "I3"; const IS_LEAF = "I4"; const IS_READ_ONLY = "I5"; const IS_STATIC = "I6"; // M. const MODEL = "M1"; // O. const OPERATION = "O1"; // P. const PRIVATE = "-"; const PROTECTED = "#"; const PUBLIC = "+"; + const PARAMETER = "P1" // R. const RETURN_TYPE = "R1"; // S. const STEREOTYPE = "S1"; // T. const TYPE = "T1"; // V. const VISIBILITY = "V1";
1
0.020408
1
0
11200e161b7fd93f06a85b98f9c6c8cc695847e7
test/Transforms/SCCP/logical-nuke.ll
test/Transforms/SCCP/logical-nuke.ll
; RUN: opt < %s -sccp -S | FileCheck %s ; Test that SCCP has basic knowledge of when and/or/mul nuke overdefined values. ; CHECK-LABEL: test ; CHECK: ret i32 0 define i32 @test(i32 %X) { %Y = and i32 %X, 0 ret i32 %Y } ; CHECK-LABEL: test2 ; CHECK: ret i32 -1 define i32 @test2(i32 %X) { %Y = or i32 -1, %X ret i32 %Y } ; CHECK-LABEL: test3 ; CHECK: ret i32 0 define i32 @test3(i32 %X) { %Y = and i32 undef, %X ret i32 %Y } ; CHECK-LABEL: test4 ; CHECK: ret i32 -1 define i32 @test4(i32 %X) { %Y = or i32 %X, undef ret i32 %Y } ; CHECK-LABEL: test5 ; CHECK: ret i32 0 define i32 @test5(i32 %foo) { %patatino = mul i32 %foo, undef ret i32 %patatino }
; RUN: opt < %s -sccp -S | FileCheck %s ; Test that SCCP has basic knowledge of when and/or/mul nuke overdefined values. ; CHECK-LABEL: test ; CHECK: ret i32 0 define i32 @test(i32 %X) { %Y = and i32 %X, 0 ret i32 %Y } ; CHECK-LABEL: test2 ; CHECK: ret i32 -1 define i32 @test2(i32 %X) { %Y = or i32 -1, %X ret i32 %Y } ; CHECK-LABEL: test3 ; CHECK: ret i32 0 define i32 @test3(i32 %X) { %Y = and i32 undef, %X ret i32 %Y } ; CHECK-LABEL: test4 ; CHECK: ret i32 -1 define i32 @test4(i32 %X) { %Y = or i32 %X, undef ret i32 %Y } ; X * 0 = 0 even if X is overdefined. ; CHECK-LABEL: test5 ; CHECK: ret i32 0 define i32 @test5(i32 %foo) { %patatino = mul i32 %foo, 0 ret i32 %patatino }
Make the test added in r289175 more meaningful.
[SCCP] Make the test added in r289175 more meaningful. Add a comment while here. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@289182 91177308-0d34-0410-b5e6-96231b3b80d8
LLVM
apache-2.0
llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm
llvm
## Code Before: ; RUN: opt < %s -sccp -S | FileCheck %s ; Test that SCCP has basic knowledge of when and/or/mul nuke overdefined values. ; CHECK-LABEL: test ; CHECK: ret i32 0 define i32 @test(i32 %X) { %Y = and i32 %X, 0 ret i32 %Y } ; CHECK-LABEL: test2 ; CHECK: ret i32 -1 define i32 @test2(i32 %X) { %Y = or i32 -1, %X ret i32 %Y } ; CHECK-LABEL: test3 ; CHECK: ret i32 0 define i32 @test3(i32 %X) { %Y = and i32 undef, %X ret i32 %Y } ; CHECK-LABEL: test4 ; CHECK: ret i32 -1 define i32 @test4(i32 %X) { %Y = or i32 %X, undef ret i32 %Y } ; CHECK-LABEL: test5 ; CHECK: ret i32 0 define i32 @test5(i32 %foo) { %patatino = mul i32 %foo, undef ret i32 %patatino } ## Instruction: [SCCP] Make the test added in r289175 more meaningful. Add a comment while here. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@289182 91177308-0d34-0410-b5e6-96231b3b80d8 ## Code After: ; RUN: opt < %s -sccp -S | FileCheck %s ; Test that SCCP has basic knowledge of when and/or/mul nuke overdefined values. ; CHECK-LABEL: test ; CHECK: ret i32 0 define i32 @test(i32 %X) { %Y = and i32 %X, 0 ret i32 %Y } ; CHECK-LABEL: test2 ; CHECK: ret i32 -1 define i32 @test2(i32 %X) { %Y = or i32 -1, %X ret i32 %Y } ; CHECK-LABEL: test3 ; CHECK: ret i32 0 define i32 @test3(i32 %X) { %Y = and i32 undef, %X ret i32 %Y } ; CHECK-LABEL: test4 ; CHECK: ret i32 -1 define i32 @test4(i32 %X) { %Y = or i32 %X, undef ret i32 %Y } ; X * 0 = 0 even if X is overdefined. ; CHECK-LABEL: test5 ; CHECK: ret i32 0 define i32 @test5(i32 %foo) { %patatino = mul i32 %foo, 0 ret i32 %patatino }
; RUN: opt < %s -sccp -S | FileCheck %s ; Test that SCCP has basic knowledge of when and/or/mul nuke overdefined values. ; CHECK-LABEL: test ; CHECK: ret i32 0 define i32 @test(i32 %X) { %Y = and i32 %X, 0 ret i32 %Y } ; CHECK-LABEL: test2 ; CHECK: ret i32 -1 define i32 @test2(i32 %X) { %Y = or i32 -1, %X ret i32 %Y } ; CHECK-LABEL: test3 ; CHECK: ret i32 0 define i32 @test3(i32 %X) { %Y = and i32 undef, %X ret i32 %Y } ; CHECK-LABEL: test4 ; CHECK: ret i32 -1 define i32 @test4(i32 %X) { %Y = or i32 %X, undef ret i32 %Y } + ; X * 0 = 0 even if X is overdefined. ; CHECK-LABEL: test5 ; CHECK: ret i32 0 define i32 @test5(i32 %foo) { - %patatino = mul i32 %foo, undef ? ^^^^^ + %patatino = mul i32 %foo, 0 ? ^ ret i32 %patatino }
3
0.078947
2
1
2cf94f18ec6939b51d60f583bacb3592f948a53f
examples/apps/embedded/embedded.cpp
examples/apps/embedded/embedded.cpp
MainWindow::MainWindow() : QMainWindow() { initUI(); } MainWindow::~MainWindow() {} void MainWindow::initUI() { setWindowTitle("Maliit embedded demo"); setCentralWidget(new QWidget); QVBoxLayout *vbox = new QVBoxLayout; QPushButton *closeApp = new QPushButton("Close application"); vbox->addWidget(closeApp); connect(closeApp, SIGNAL(clicked()), this, SLOT(close())); // Clicking the button will steal focus from the text edit, thus hiding // the virtual keyboard: QPushButton *hideVkb = new QPushButton("Hide virtual keyboard"); vbox->addWidget(hideVkb); QTextEdit *textEdit = new QTextEdit; vbox->addWidget(textEdit); QWidget *imWidget = Maliit::InputMethod::instance()->widget(); if (imWidget) { imWidget->setParent(centralWidget()); vbox->addWidget(imWidget); // FIXME: hack to work around the fact that plugins expect a desktop sized widget QSize desktopSize = QApplication::desktop()->size(); imWidget->setMinimumSize(desktopSize.width(), desktopSize.height() - 150); } else { qCritical() << "Unable to embedded Maliit input method widget"; } centralWidget()->setLayout(vbox); show(); imWidget->hide(); }
MainWindow::MainWindow() : QMainWindow() { initUI(); } MainWindow::~MainWindow() {} void MainWindow::initUI() { setWindowTitle("Maliit embedded demo"); setCentralWidget(new QWidget); QVBoxLayout *vbox = new QVBoxLayout; QPushButton *closeApp = new QPushButton("Close application"); vbox->addWidget(closeApp); connect(closeApp, SIGNAL(clicked()), this, SLOT(close())); // Clicking the button will steal focus from the text edit, thus hiding // the virtual keyboard: QPushButton *hideVkb = new QPushButton("Hide virtual keyboard"); vbox->addWidget(hideVkb); QTextEdit *textEdit = new QTextEdit; vbox->addWidget(textEdit); QWidget *imWidget = Maliit::InputMethod::instance()->widget(); if (imWidget) { imWidget->setParent(centralWidget()); vbox->addWidget(imWidget); } else { qCritical() << "Unable to embedded Maliit input method widget"; } centralWidget()->setLayout(vbox); show(); }
Remove now unneded hack from embedding example.
Remove now unneded hack from embedding example. RevBy: Jon Nordby, Michael Hasselmann, Jan Arne Petersen
C++
lgpl-2.1
binlaten/framework,RHawkeyed/framework,Elleo/framework,Elleo/framework,RHawkeyed/framework,jpetersen/framework,jpetersen/framework
c++
## Code Before: MainWindow::MainWindow() : QMainWindow() { initUI(); } MainWindow::~MainWindow() {} void MainWindow::initUI() { setWindowTitle("Maliit embedded demo"); setCentralWidget(new QWidget); QVBoxLayout *vbox = new QVBoxLayout; QPushButton *closeApp = new QPushButton("Close application"); vbox->addWidget(closeApp); connect(closeApp, SIGNAL(clicked()), this, SLOT(close())); // Clicking the button will steal focus from the text edit, thus hiding // the virtual keyboard: QPushButton *hideVkb = new QPushButton("Hide virtual keyboard"); vbox->addWidget(hideVkb); QTextEdit *textEdit = new QTextEdit; vbox->addWidget(textEdit); QWidget *imWidget = Maliit::InputMethod::instance()->widget(); if (imWidget) { imWidget->setParent(centralWidget()); vbox->addWidget(imWidget); // FIXME: hack to work around the fact that plugins expect a desktop sized widget QSize desktopSize = QApplication::desktop()->size(); imWidget->setMinimumSize(desktopSize.width(), desktopSize.height() - 150); } else { qCritical() << "Unable to embedded Maliit input method widget"; } centralWidget()->setLayout(vbox); show(); imWidget->hide(); } ## Instruction: Remove now unneded hack from embedding example. RevBy: Jon Nordby, Michael Hasselmann, Jan Arne Petersen ## Code After: MainWindow::MainWindow() : QMainWindow() { initUI(); } MainWindow::~MainWindow() {} void MainWindow::initUI() { setWindowTitle("Maliit embedded demo"); setCentralWidget(new QWidget); QVBoxLayout *vbox = new QVBoxLayout; QPushButton *closeApp = new QPushButton("Close application"); vbox->addWidget(closeApp); connect(closeApp, SIGNAL(clicked()), this, SLOT(close())); // Clicking the button will steal focus from the text edit, thus hiding // the virtual keyboard: QPushButton *hideVkb = new QPushButton("Hide virtual keyboard"); vbox->addWidget(hideVkb); QTextEdit *textEdit = new QTextEdit; vbox->addWidget(textEdit); QWidget *imWidget = Maliit::InputMethod::instance()->widget(); if (imWidget) { imWidget->setParent(centralWidget()); vbox->addWidget(imWidget); } else { qCritical() << "Unable to embedded Maliit input method widget"; } centralWidget()->setLayout(vbox); show(); }
MainWindow::MainWindow() : QMainWindow() { initUI(); } MainWindow::~MainWindow() {} void MainWindow::initUI() { setWindowTitle("Maliit embedded demo"); setCentralWidget(new QWidget); QVBoxLayout *vbox = new QVBoxLayout; QPushButton *closeApp = new QPushButton("Close application"); vbox->addWidget(closeApp); connect(closeApp, SIGNAL(clicked()), this, SLOT(close())); // Clicking the button will steal focus from the text edit, thus hiding // the virtual keyboard: QPushButton *hideVkb = new QPushButton("Hide virtual keyboard"); vbox->addWidget(hideVkb); QTextEdit *textEdit = new QTextEdit; vbox->addWidget(textEdit); QWidget *imWidget = Maliit::InputMethod::instance()->widget(); if (imWidget) { imWidget->setParent(centralWidget()); vbox->addWidget(imWidget); - - // FIXME: hack to work around the fact that plugins expect a desktop sized widget - QSize desktopSize = QApplication::desktop()->size(); - imWidget->setMinimumSize(desktopSize.width(), desktopSize.height() - 150); } else { qCritical() << "Unable to embedded Maliit input method widget"; } centralWidget()->setLayout(vbox); show(); - imWidget->hide(); }
5
0.106383
0
5
eaeca1ba9db320733f31fe07b588d82360a51fa4
.travis.yml
.travis.yml
language: c sudo: required services: - docker env: matrix: - python=3.4 CONDA_PY=34 CONDA_NPY=18 install: - docker pull bioconda/bioconda-builder script: - docker run -v `pwd`:/tmp/conda-recipes bioconda/bioconda-builder /bin/build-packages.sh
language: c sudo: required services: - docker env: global: - CONDA_NPY=18 matrix: - CONDA_PY=34 - CONDA_PY=27 install: - docker pull bioconda/bioconda-builder script: - docker run -v `pwd`:/tmp/conda-recipes bioconda/bioconda-builder /bin/build-packages.sh
Build for python 2.7 and 3.4
Build for python 2.7 and 3.4
YAML
mit
chapmanb/bioconda-recipes,jfallmann/bioconda-recipes,rob-p/bioconda-recipes,colinbrislawn/bioconda-recipes,instituteofpathologyheidelberg/bioconda-recipes,oena/bioconda-recipes,mdehollander/bioconda-recipes,JenCabral/bioconda-recipes,rob-p/bioconda-recipes,xguse/bioconda-recipes,ivirshup/bioconda-recipes,ThomasWollmann/bioconda-recipes,cokelaer/bioconda-recipes,gvlproject/bioconda-recipes,saketkc/bioconda-recipes,gvlproject/bioconda-recipes,shenwei356/bioconda-recipes,zwanli/bioconda-recipes,omicsnut/bioconda-recipes,BIMSBbioinfo/bioconda-recipes,gregvonkuster/bioconda-recipes,zwanli/bioconda-recipes,dkoppstein/recipes,peterjc/bioconda-recipes,lpantano/recipes,jasper1918/bioconda-recipes,instituteofpathologyheidelberg/bioconda-recipes,daler/bioconda-recipes,pinguinkiste/bioconda-recipes,ThomasWollmann/bioconda-recipes,joachimwolff/bioconda-recipes,mcornwell1957/bioconda-recipes,npavlovikj/bioconda-recipes,shenwei356/bioconda-recipes,zwanli/bioconda-recipes,keuv-grvl/bioconda-recipes,rob-p/bioconda-recipes,jfallmann/bioconda-recipes,keuv-grvl/bioconda-recipes,chapmanb/bioconda-recipes,rob-p/bioconda-recipes,yesimon/bioconda-recipes,rvalieris/bioconda-recipes,BIMSBbioinfo/bioconda-recipes,mcornwell1957/bioconda-recipes,omicsnut/bioconda-recipes,gregvonkuster/bioconda-recipes,joachimwolff/bioconda-recipes,yesimon/bioconda-recipes,pinguinkiste/bioconda-recipes,bebatut/bioconda-recipes,matthdsm/bioconda-recipes,acaprez/recipes,bioconda/bioconda-recipes,jasper1918/bioconda-recipes,npavlovikj/bioconda-recipes,hardingnj/bioconda-recipes,oena/bioconda-recipes,xguse/bioconda-recipes,bioconda/recipes,mdehollander/bioconda-recipes,matthdsm/bioconda-recipes,chapmanb/bioconda-recipes,daler/bioconda-recipes,saketkc/bioconda-recipes,dmaticzka/bioconda-recipes,matthdsm/bioconda-recipes,HassanAmr/bioconda-recipes,guowei-he/bioconda-recipes,colinbrislawn/bioconda-recipes,daler/bioconda-recipes,martin-mann/bioconda-recipes,colinbrislawn/bioconda-recipes,peterjc/bioconda-recipes,mcornwell1957/bioconda-recipes,HassanAmr/bioconda-recipes,zachcp/bioconda-recipes,omicsnut/bioconda-recipes,keuv-grvl/bioconda-recipes,ThomasWollmann/bioconda-recipes,HassanAmr/bioconda-recipes,dkoppstein/recipes,JingchaoZhang/bioconda-recipes,gvlproject/bioconda-recipes,bow/bioconda-recipes,hardingnj/bioconda-recipes,abims-sbr/bioconda-recipes,guowei-he/bioconda-recipes,cokelaer/bioconda-recipes,CGATOxford/bioconda-recipes,bioconda/bioconda-recipes,Luobiny/bioconda-recipes,keuv-grvl/bioconda-recipes,lpantano/recipes,gvlproject/bioconda-recipes,HassanAmr/bioconda-recipes,JenCabral/bioconda-recipes,yesimon/bioconda-recipes,hardingnj/bioconda-recipes,xguse/bioconda-recipes,gvlproject/bioconda-recipes,CGATOxford/bioconda-recipes,peterjc/bioconda-recipes,phac-nml/bioconda-recipes,JingchaoZhang/bioconda-recipes,JingchaoZhang/bioconda-recipes,saketkc/bioconda-recipes,roryk/recipes,HassanAmr/bioconda-recipes,rvalieris/bioconda-recipes,saketkc/bioconda-recipes,peterjc/bioconda-recipes,dmaticzka/bioconda-recipes,peterjc/bioconda-recipes,lpantano/recipes,martin-mann/bioconda-recipes,ThomasWollmann/bioconda-recipes,JenCabral/bioconda-recipes,ostrokach/bioconda-recipes,ostrokach/bioconda-recipes,ostrokach/bioconda-recipes,BIMSBbioinfo/bioconda-recipes,instituteofpathologyheidelberg/bioconda-recipes,abims-sbr/bioconda-recipes,colinbrislawn/bioconda-recipes,pinguinkiste/bioconda-recipes,joachimwolff/bioconda-recipes,rvalieris/bioconda-recipes,mdehollander/bioconda-recipes,Luobiny/bioconda-recipes,pinguinkiste/bioconda-recipes,acaprez/recipes,bow/bioconda-recipes,martin-mann/bioconda-recipes,bioconda/bioconda-recipes,daler/bioconda-recipes,roryk/recipes,ivirshup/bioconda-recipes,guowei-he/bioconda-recipes,ivirshup/bioconda-recipes,ostrokach/bioconda-recipes,ostrokach/bioconda-recipes,omicsnut/bioconda-recipes,keuv-grvl/bioconda-recipes,instituteofpathologyheidelberg/bioconda-recipes,oena/bioconda-recipes,saketkc/bioconda-recipes,martin-mann/bioconda-recipes,acaprez/recipes,ivirshup/bioconda-recipes,pinguinkiste/bioconda-recipes,martin-mann/bioconda-recipes,bioconda/recipes,Luobiny/bioconda-recipes,dmaticzka/bioconda-recipes,daler/bioconda-recipes,rvalieris/bioconda-recipes,abims-sbr/bioconda-recipes,mcornwell1957/bioconda-recipes,yesimon/bioconda-recipes,JenCabral/bioconda-recipes,cokelaer/bioconda-recipes,guowei-he/bioconda-recipes,joachimwolff/bioconda-recipes,zwanli/bioconda-recipes,matthdsm/bioconda-recipes,BIMSBbioinfo/bioconda-recipes,jfallmann/bioconda-recipes,HassanAmr/bioconda-recipes,cokelaer/bioconda-recipes,mdehollander/bioconda-recipes,CGATOxford/bioconda-recipes,daler/bioconda-recipes,hardingnj/bioconda-recipes,ivirshup/bioconda-recipes,JenCabral/bioconda-recipes,matthdsm/bioconda-recipes,jasper1918/bioconda-recipes,shenwei356/bioconda-recipes,lpantano/recipes,dkoppstein/recipes,phac-nml/bioconda-recipes,zachcp/bioconda-recipes,gregvonkuster/bioconda-recipes,CGATOxford/bioconda-recipes,chapmanb/bioconda-recipes,zwanli/bioconda-recipes,bebatut/bioconda-recipes,bioconda/bioconda-recipes,dmaticzka/bioconda-recipes,colinbrislawn/bioconda-recipes,oena/bioconda-recipes,bow/bioconda-recipes,npavlovikj/bioconda-recipes,pinguinkiste/bioconda-recipes,matthdsm/bioconda-recipes,phac-nml/bioconda-recipes,jfallmann/bioconda-recipes,ostrokach/bioconda-recipes,bow/bioconda-recipes,bioconda/recipes,mcornwell1957/bioconda-recipes,abims-sbr/bioconda-recipes,zachcp/bioconda-recipes,CGATOxford/bioconda-recipes,CGATOxford/bioconda-recipes,blankenberg/bioconda-recipes,colinbrislawn/bioconda-recipes,chapmanb/bioconda-recipes,JenCabral/bioconda-recipes,phac-nml/bioconda-recipes,gregvonkuster/bioconda-recipes,guowei-he/bioconda-recipes,mdehollander/bioconda-recipes,JingchaoZhang/bioconda-recipes,abims-sbr/bioconda-recipes,ThomasWollmann/bioconda-recipes,joachimwolff/bioconda-recipes,peterjc/bioconda-recipes,dmaticzka/bioconda-recipes,keuv-grvl/bioconda-recipes,abims-sbr/bioconda-recipes,jasper1918/bioconda-recipes,ivirshup/bioconda-recipes,xguse/bioconda-recipes,dmaticzka/bioconda-recipes,roryk/recipes,Luobiny/bioconda-recipes,jasper1918/bioconda-recipes,bebatut/bioconda-recipes,blankenberg/bioconda-recipes,rvalieris/bioconda-recipes,zachcp/bioconda-recipes,blankenberg/bioconda-recipes,BIMSBbioinfo/bioconda-recipes,phac-nml/bioconda-recipes,zwanli/bioconda-recipes,hardingnj/bioconda-recipes,mdehollander/bioconda-recipes,instituteofpathologyheidelberg/bioconda-recipes,xguse/bioconda-recipes,shenwei356/bioconda-recipes,gvlproject/bioconda-recipes,blankenberg/bioconda-recipes,BIMSBbioinfo/bioconda-recipes,bow/bioconda-recipes,ThomasWollmann/bioconda-recipes,rvalieris/bioconda-recipes,bebatut/bioconda-recipes,joachimwolff/bioconda-recipes,npavlovikj/bioconda-recipes,bow/bioconda-recipes,oena/bioconda-recipes,saketkc/bioconda-recipes,acaprez/recipes,omicsnut/bioconda-recipes
yaml
## Code Before: language: c sudo: required services: - docker env: matrix: - python=3.4 CONDA_PY=34 CONDA_NPY=18 install: - docker pull bioconda/bioconda-builder script: - docker run -v `pwd`:/tmp/conda-recipes bioconda/bioconda-builder /bin/build-packages.sh ## Instruction: Build for python 2.7 and 3.4 ## Code After: language: c sudo: required services: - docker env: global: - CONDA_NPY=18 matrix: - CONDA_PY=34 - CONDA_PY=27 install: - docker pull bioconda/bioconda-builder script: - docker run -v `pwd`:/tmp/conda-recipes bioconda/bioconda-builder /bin/build-packages.sh
language: c sudo: required services: - docker env: + global: + - CONDA_NPY=18 matrix: - - python=3.4 CONDA_PY=34 CONDA_NPY=18 + - CONDA_PY=34 + - CONDA_PY=27 install: - docker pull bioconda/bioconda-builder script: - docker run -v `pwd`:/tmp/conda-recipes bioconda/bioconda-builder /bin/build-packages.sh
5
0.454545
4
1
74163dc02b192de5b4286d5cc7bd0377a7d06a74
CKTextField/CKTextField.h
CKTextField/CKTextField.h
// // CKTextField.h // CKTextField // // Created by Christian Klaproth on 12.09.14. // Copyright (c) 2014 Christian Klaproth. All rights reserved. // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #import "CKExternalKeyboardSupportedTextField.h" @class CKTextField; enum CKTextFieldValidationResult { CKTextFieldValidationUnknown, CKTextFieldValidationPassed, CKTextFieldValidationFailed }; /** * Adds optional methods that are sent to the UITextFieldDelegate. */ @protocol CKTextFieldValidationDelegate <NSObject> @optional - (void)textField:(CKTextField*)aTextField validationResult:(enum CKTextFieldValidationResult)aResult forText:(NSString*)aText; @end @interface CKTextField : CKExternalKeyboardSupportedTextField // // User Defined Runtime Attributes (--> Storyboard!) // // ******************************************************* // * // * @property (nonatomic) NSString* validationType; @property (nonatomic) NSString* minLength; @property (nonatomic) NSString* maxLength; @property (nonatomic) NSString* minValue; @property (nonatomic) NSString* maxValue; @property (nonatomic) NSString* pattern; // * // * // ******************************************************* @property (nonatomic, weak) id<CKTextFieldValidationDelegate> validationDelegate; - (void)shake; - (void)showAcceptButton; - (void)hideAcceptButton; @end
// // CKTextField.h // CKTextField // // Created by Christian Klaproth on 12.09.14. // Copyright (c) 2014 Christian Klaproth. All rights reserved. // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #import "CKExternalKeyboardSupportedTextField.h" @class CKTextField; enum CKTextFieldValidationResult { CKTextFieldValidationUnknown, CKTextFieldValidationPassed, CKTextFieldValidationFailed }; /** * Adds optional methods that are sent to the UITextFieldDelegate. */ @protocol CKTextFieldValidationDelegate <NSObject> @optional - (void)textField:(CKTextField*)aTextField validationResult:(enum CKTextFieldValidationResult)aResult forText:(NSString*)aText; @end @interface CKTextField : CKExternalKeyboardSupportedTextField // // User Defined Runtime Attributes (--> Storyboard!) // // ******************************************************* // * // * @property (nonatomic) IBInspectable NSString* validationType; @property (nonatomic) IBInspectable NSString* minLength; @property (nonatomic) IBInspectable NSString* maxLength; @property (nonatomic) IBInspectable NSString* minValue; @property (nonatomic) IBInspectable NSString* maxValue; @property (nonatomic) IBInspectable NSString* pattern; // * // * // ******************************************************* @property (nonatomic, weak) id<CKTextFieldValidationDelegate> validationDelegate; - (void)shake; - (void)showAcceptButton; - (void)hideAcceptButton; @end
Use of IBInspectable for user defined attributes.
Use of IBInspectable for user defined attributes. Validation type and ranges can be specified using the attribute inspector. #5
C
mit
JaNd3r/CKTextField,JaNd3r/CKTextField
c
## Code Before: // // CKTextField.h // CKTextField // // Created by Christian Klaproth on 12.09.14. // Copyright (c) 2014 Christian Klaproth. All rights reserved. // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #import "CKExternalKeyboardSupportedTextField.h" @class CKTextField; enum CKTextFieldValidationResult { CKTextFieldValidationUnknown, CKTextFieldValidationPassed, CKTextFieldValidationFailed }; /** * Adds optional methods that are sent to the UITextFieldDelegate. */ @protocol CKTextFieldValidationDelegate <NSObject> @optional - (void)textField:(CKTextField*)aTextField validationResult:(enum CKTextFieldValidationResult)aResult forText:(NSString*)aText; @end @interface CKTextField : CKExternalKeyboardSupportedTextField // // User Defined Runtime Attributes (--> Storyboard!) // // ******************************************************* // * // * @property (nonatomic) NSString* validationType; @property (nonatomic) NSString* minLength; @property (nonatomic) NSString* maxLength; @property (nonatomic) NSString* minValue; @property (nonatomic) NSString* maxValue; @property (nonatomic) NSString* pattern; // * // * // ******************************************************* @property (nonatomic, weak) id<CKTextFieldValidationDelegate> validationDelegate; - (void)shake; - (void)showAcceptButton; - (void)hideAcceptButton; @end ## Instruction: Use of IBInspectable for user defined attributes. Validation type and ranges can be specified using the attribute inspector. #5 ## Code After: // // CKTextField.h // CKTextField // // Created by Christian Klaproth on 12.09.14. // Copyright (c) 2014 Christian Klaproth. All rights reserved. // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #import "CKExternalKeyboardSupportedTextField.h" @class CKTextField; enum CKTextFieldValidationResult { CKTextFieldValidationUnknown, CKTextFieldValidationPassed, CKTextFieldValidationFailed }; /** * Adds optional methods that are sent to the UITextFieldDelegate. */ @protocol CKTextFieldValidationDelegate <NSObject> @optional - (void)textField:(CKTextField*)aTextField validationResult:(enum CKTextFieldValidationResult)aResult forText:(NSString*)aText; @end @interface CKTextField : CKExternalKeyboardSupportedTextField // // User Defined Runtime Attributes (--> Storyboard!) // // ******************************************************* // * // * @property (nonatomic) IBInspectable NSString* validationType; @property (nonatomic) IBInspectable NSString* minLength; @property (nonatomic) IBInspectable NSString* maxLength; @property (nonatomic) IBInspectable NSString* minValue; @property (nonatomic) IBInspectable NSString* maxValue; @property (nonatomic) IBInspectable NSString* pattern; // * // * // ******************************************************* @property (nonatomic, weak) id<CKTextFieldValidationDelegate> validationDelegate; - (void)shake; - (void)showAcceptButton; - (void)hideAcceptButton; @end
// // CKTextField.h // CKTextField // // Created by Christian Klaproth on 12.09.14. // Copyright (c) 2014 Christian Klaproth. All rights reserved. // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #import "CKExternalKeyboardSupportedTextField.h" @class CKTextField; enum CKTextFieldValidationResult { CKTextFieldValidationUnknown, CKTextFieldValidationPassed, CKTextFieldValidationFailed }; /** * Adds optional methods that are sent to the UITextFieldDelegate. */ @protocol CKTextFieldValidationDelegate <NSObject> @optional - (void)textField:(CKTextField*)aTextField validationResult:(enum CKTextFieldValidationResult)aResult forText:(NSString*)aText; @end @interface CKTextField : CKExternalKeyboardSupportedTextField // // User Defined Runtime Attributes (--> Storyboard!) // // ******************************************************* // * // * - @property (nonatomic) NSString* validationType; + @property (nonatomic) IBInspectable NSString* validationType; ? ++++++++++++++ - @property (nonatomic) NSString* minLength; + @property (nonatomic) IBInspectable NSString* minLength; ? ++++++++++++++ - @property (nonatomic) NSString* maxLength; + @property (nonatomic) IBInspectable NSString* maxLength; ? ++++++++++++++ - @property (nonatomic) NSString* minValue; + @property (nonatomic) IBInspectable NSString* minValue; ? ++++++++++++++ - @property (nonatomic) NSString* maxValue; + @property (nonatomic) IBInspectable NSString* maxValue; ? ++++++++++++++ - @property (nonatomic) NSString* pattern; + @property (nonatomic) IBInspectable NSString* pattern; ? ++++++++++++++ // * // * // ******************************************************* @property (nonatomic, weak) id<CKTextFieldValidationDelegate> validationDelegate; - (void)shake; - (void)showAcceptButton; - (void)hideAcceptButton; @end
12
0.206897
6
6
225fd1163a50d4740afdeb21cb94e3f375016e9a
setup.py
setup.py
import os from setuptools import setup import redis_shard def read_file(*path): base_dir = os.path.dirname(__file__) file_path = (base_dir, ) + tuple(path) return open(os.path.join(*file_path)).read() setup( name="redis-shard", url="https://pypi.python.org/pypi/redis-shard", license="BSD", author="Zhihu Inc.", author_email="y@zhihu.com", description="Redis Sharding API", long_description=( read_file("README.rst") + "\n\n" + "Change History\n" + "==============\n\n" + read_file("CHANGES.rst")), version=redis_shard.__version__, packages=["redis_shard"], include_package_data=True, zip_safe=False, install_requires=['redis'], tests_require=['Nose'], classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Operating System :: OS Independent", "License :: OSI Approved :: BSD License", "Topic :: Software Development :: Libraries", "Topic :: Utilities", ], )
import os from setuptools import setup import redis_shard def read_file(*path): base_dir = os.path.dirname(__file__) file_path = (base_dir, ) + tuple(path) return open(os.path.join(*file_path)).read() setup( name="redis-shard", url="https://pypi.python.org/pypi/redis-shard", license="BSD License", author="Zhihu Inc.", author_email="opensource@zhihu.com", maintainer="Young King", maintainer_email="y@zhihu.com", description="Redis Sharding API", long_description=( read_file("README.rst") + "\n\n" + "Change History\n" + "==============\n\n" + read_file("CHANGES.rst")), version=redis_shard.__version__, packages=["redis_shard"], include_package_data=True, zip_safe=False, install_requires=['redis'], tests_require=['Nose'], classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Operating System :: OS Independent", "License :: OSI Approved :: BSD License", "Topic :: Software Development :: Libraries", "Topic :: Utilities", ], )
Update author and maintainer information
Update author and maintainer information
Python
bsd-2-clause
zhihu/redis-shard,keakon/redis-shard
python
## Code Before: import os from setuptools import setup import redis_shard def read_file(*path): base_dir = os.path.dirname(__file__) file_path = (base_dir, ) + tuple(path) return open(os.path.join(*file_path)).read() setup( name="redis-shard", url="https://pypi.python.org/pypi/redis-shard", license="BSD", author="Zhihu Inc.", author_email="y@zhihu.com", description="Redis Sharding API", long_description=( read_file("README.rst") + "\n\n" + "Change History\n" + "==============\n\n" + read_file("CHANGES.rst")), version=redis_shard.__version__, packages=["redis_shard"], include_package_data=True, zip_safe=False, install_requires=['redis'], tests_require=['Nose'], classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Operating System :: OS Independent", "License :: OSI Approved :: BSD License", "Topic :: Software Development :: Libraries", "Topic :: Utilities", ], ) ## Instruction: Update author and maintainer information ## Code After: import os from setuptools import setup import redis_shard def read_file(*path): base_dir = os.path.dirname(__file__) file_path = (base_dir, ) + tuple(path) return open(os.path.join(*file_path)).read() setup( name="redis-shard", url="https://pypi.python.org/pypi/redis-shard", license="BSD License", author="Zhihu Inc.", author_email="opensource@zhihu.com", maintainer="Young King", maintainer_email="y@zhihu.com", description="Redis Sharding API", long_description=( read_file("README.rst") + "\n\n" + "Change History\n" + "==============\n\n" + read_file("CHANGES.rst")), version=redis_shard.__version__, packages=["redis_shard"], include_package_data=True, zip_safe=False, install_requires=['redis'], tests_require=['Nose'], classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Operating System :: OS Independent", "License :: OSI Approved :: BSD License", "Topic :: Software Development :: Libraries", "Topic :: Utilities", ], )
import os from setuptools import setup import redis_shard def read_file(*path): base_dir = os.path.dirname(__file__) file_path = (base_dir, ) + tuple(path) return open(os.path.join(*file_path)).read() setup( name="redis-shard", url="https://pypi.python.org/pypi/redis-shard", - license="BSD", + license="BSD License", ? ++++++++ author="Zhihu Inc.", + author_email="opensource@zhihu.com", + maintainer="Young King", - author_email="y@zhihu.com", ? ^ ^^ + maintainer_email="y@zhihu.com", ? + ^^ ^^^^ description="Redis Sharding API", long_description=( read_file("README.rst") + "\n\n" + "Change History\n" + "==============\n\n" + read_file("CHANGES.rst")), version=redis_shard.__version__, packages=["redis_shard"], include_package_data=True, zip_safe=False, install_requires=['redis'], tests_require=['Nose'], classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Operating System :: OS Independent", "License :: OSI Approved :: BSD License", "Topic :: Software Development :: Libraries", "Topic :: Utilities", ], )
6
0.136364
4
2
406a51258d1b9ba3049b16d4249241b40100b776
src/Collection.js
src/Collection.js
(function () { if (typeof define == "function" && define.amd) define(["graphjs/Graph"], factory); else if (typeof exports == "object") module.exports = factory(require("graphjs/Graph")); else root.Collection = factory(root.Graph); }(this, function (Graph) { return function Collection(Generic) { return function(array) { return array.map(function (entry) { return Graph.parse(Generic, entry); }); } }; }));
(function (root, factory) { if (typeof define == "function" && define.amd) define(["graphjs/Graph"], factory); else if (typeof exports == "object") module.exports = factory(require("graphjs/Graph")); else root.Collection = factory(root.Graph); }(this, function (Graph) { return function Collection(Generic) { return function(array) { return array.map(function (entry) { return Graph.parse(Generic, entry); }); } }; }));
Fix bug with root parameter
Fix bug with root parameter
JavaScript
mit
cameronprattedwards/graphjs
javascript
## Code Before: (function () { if (typeof define == "function" && define.amd) define(["graphjs/Graph"], factory); else if (typeof exports == "object") module.exports = factory(require("graphjs/Graph")); else root.Collection = factory(root.Graph); }(this, function (Graph) { return function Collection(Generic) { return function(array) { return array.map(function (entry) { return Graph.parse(Generic, entry); }); } }; })); ## Instruction: Fix bug with root parameter ## Code After: (function (root, factory) { if (typeof define == "function" && define.amd) define(["graphjs/Graph"], factory); else if (typeof exports == "object") module.exports = factory(require("graphjs/Graph")); else root.Collection = factory(root.Graph); }(this, function (Graph) { return function Collection(Generic) { return function(array) { return array.map(function (entry) { return Graph.parse(Generic, entry); }); } }; }));
- (function () { + (function (root, factory) { if (typeof define == "function" && define.amd) define(["graphjs/Graph"], factory); else if (typeof exports == "object") module.exports = factory(require("graphjs/Graph")); else root.Collection = factory(root.Graph); }(this, function (Graph) { return function Collection(Generic) { return function(array) { return array.map(function (entry) { return Graph.parse(Generic, entry); }); } }; }));
2
0.125
1
1
bd92bbe14155ca9a2ac37124d969e02e000b4239
.rubocop.yml
.rubocop.yml
AllCops: Exclude: - vendor/**/* TargetRubyVersion: 2.2 Layout/AccessModifierIndentation: EnforcedStyle: outdent Layout/EmptyLinesAroundBlockBody: Enabled: false Layout/EmptyLinesAroundClassBody: Enabled: false Layout/EmptyLinesAroundModuleBody: Enabled: false Layout/SpaceAroundEqualsInParameterDefault: EnforcedStyle: no_space Layout/SpaceAroundOperators: Enabled: false Layout/SpaceInsideHashLiteralBraces: EnforcedStyle: no_space Metrics/BlockLength: Enabled: false Metrics/LineLength: Enabled: false Metrics/MethodLength: Max: 20 Metrics/ModuleLength: Enabled: false Style/Documentation: Enabled: false Style/HashSyntax: EnforcedStyle: hash_rockets Style/IfUnlessModifier: Enabled: false Style/Lambda: Enabled: false Style/SignalException: EnforcedStyle: only_raise Style/StringLiterals: EnforcedStyle: double_quotes Style/SymbolArray: Enabled: false
AllCops: Exclude: - gemfiles/* - vendor/**/* TargetRubyVersion: 2.2 Layout/AccessModifierIndentation: EnforcedStyle: outdent Layout/EmptyLinesAroundBlockBody: Enabled: false Layout/EmptyLinesAroundClassBody: Enabled: false Layout/EmptyLinesAroundModuleBody: Enabled: false Layout/SpaceAroundEqualsInParameterDefault: EnforcedStyle: no_space Layout/SpaceAroundOperators: Enabled: false Layout/SpaceInsideHashLiteralBraces: EnforcedStyle: no_space Metrics/BlockLength: Enabled: false Metrics/LineLength: Enabled: false Metrics/MethodLength: Max: 20 Metrics/ModuleLength: Enabled: false Style/Documentation: Enabled: false Style/HashSyntax: EnforcedStyle: hash_rockets Style/IfUnlessModifier: Enabled: false Style/Lambda: Enabled: false Style/SignalException: EnforcedStyle: only_raise Style/StringLiterals: EnforcedStyle: double_quotes Style/SymbolArray: Enabled: false
Exclude generated gemfiles from linting
Exclude generated gemfiles from linting
YAML
mit
Within3/liquid-autoescape
yaml
## Code Before: AllCops: Exclude: - vendor/**/* TargetRubyVersion: 2.2 Layout/AccessModifierIndentation: EnforcedStyle: outdent Layout/EmptyLinesAroundBlockBody: Enabled: false Layout/EmptyLinesAroundClassBody: Enabled: false Layout/EmptyLinesAroundModuleBody: Enabled: false Layout/SpaceAroundEqualsInParameterDefault: EnforcedStyle: no_space Layout/SpaceAroundOperators: Enabled: false Layout/SpaceInsideHashLiteralBraces: EnforcedStyle: no_space Metrics/BlockLength: Enabled: false Metrics/LineLength: Enabled: false Metrics/MethodLength: Max: 20 Metrics/ModuleLength: Enabled: false Style/Documentation: Enabled: false Style/HashSyntax: EnforcedStyle: hash_rockets Style/IfUnlessModifier: Enabled: false Style/Lambda: Enabled: false Style/SignalException: EnforcedStyle: only_raise Style/StringLiterals: EnforcedStyle: double_quotes Style/SymbolArray: Enabled: false ## Instruction: Exclude generated gemfiles from linting ## Code After: AllCops: Exclude: - gemfiles/* - vendor/**/* TargetRubyVersion: 2.2 Layout/AccessModifierIndentation: EnforcedStyle: outdent Layout/EmptyLinesAroundBlockBody: Enabled: false Layout/EmptyLinesAroundClassBody: Enabled: false Layout/EmptyLinesAroundModuleBody: Enabled: false Layout/SpaceAroundEqualsInParameterDefault: EnforcedStyle: no_space Layout/SpaceAroundOperators: Enabled: false Layout/SpaceInsideHashLiteralBraces: EnforcedStyle: no_space Metrics/BlockLength: Enabled: false Metrics/LineLength: Enabled: false Metrics/MethodLength: Max: 20 Metrics/ModuleLength: Enabled: false Style/Documentation: Enabled: false Style/HashSyntax: EnforcedStyle: hash_rockets Style/IfUnlessModifier: Enabled: false Style/Lambda: Enabled: false Style/SignalException: EnforcedStyle: only_raise Style/StringLiterals: EnforcedStyle: double_quotes Style/SymbolArray: Enabled: false
AllCops: Exclude: + - gemfiles/* - vendor/**/* TargetRubyVersion: 2.2 Layout/AccessModifierIndentation: EnforcedStyle: outdent Layout/EmptyLinesAroundBlockBody: Enabled: false Layout/EmptyLinesAroundClassBody: Enabled: false Layout/EmptyLinesAroundModuleBody: Enabled: false Layout/SpaceAroundEqualsInParameterDefault: EnforcedStyle: no_space Layout/SpaceAroundOperators: Enabled: false Layout/SpaceInsideHashLiteralBraces: EnforcedStyle: no_space Metrics/BlockLength: Enabled: false Metrics/LineLength: Enabled: false Metrics/MethodLength: Max: 20 Metrics/ModuleLength: Enabled: false Style/Documentation: Enabled: false Style/HashSyntax: EnforcedStyle: hash_rockets Style/IfUnlessModifier: Enabled: false Style/Lambda: Enabled: false Style/SignalException: EnforcedStyle: only_raise Style/StringLiterals: EnforcedStyle: double_quotes Style/SymbolArray: Enabled: false
1
0.017241
1
0
ffda05a1cbcb25d939a406f0b6a791ec3a8058dc
server.js
server.js
var express = require('express'); var http = require('http'); var mongoose = require('mongoose'); var kue = require('kue'); var ds = require('./lib/data-store'); // Connect to MongoDB mongoose.connect('mongodb://127.0.0.1/habweb'); mongoose.connection.on('open', function() { console.log('Connected to Mongoose'); }); // Create the job queue var jobs = kue.createQueue(); // Create the webserver app = express(); app.configure(function() { //app.use(express.logger('dev')); app.use(express.static(__dirname + '/public')); app.use('/backend', express.basicAuth(function(user, pass, callback) { var result = (user === 'admin' && pass === 'password'); callback(null, result); })); app.use('/backend/queue', kue.app); }); http.createServer(app).listen(8080); console.log('Listening on port 8080'); ds.init();
var cluster = require('cluster'); var mongoose = require('mongoose'); //var ds = require('./lib/data-store'); var numCPUs = require('os').cpus().length; // Connect to MongoDB //mongoose.connect('mongodb://127.0.0.1/habweb'); //mongoose.connection.on('open', function() { // console.log('Connected to Mongoose'); //}); // Create the cluster if(cluster.isMaster) { // Master process //ds.init(); for(var i=0; i < numCPUs; i++) { cluster.fork(); } } else { // Worker process // Include express var express = require('express'); // Create an express application app = express(); // Configure express app.configure(function() { app.use(express.static(__dirname + '/app')); }); // Bind to a port app.listen(8000); }
Add node cluster to app.
Add node cluster to app.
JavaScript
bsd-3-clause
AerodyneLabs/Stratocast,AerodyneLabs/Stratocast,AerodyneLabs/Stratocast,AerodyneLabs/Stratocast,AerodyneLabs/Stratocast
javascript
## Code Before: var express = require('express'); var http = require('http'); var mongoose = require('mongoose'); var kue = require('kue'); var ds = require('./lib/data-store'); // Connect to MongoDB mongoose.connect('mongodb://127.0.0.1/habweb'); mongoose.connection.on('open', function() { console.log('Connected to Mongoose'); }); // Create the job queue var jobs = kue.createQueue(); // Create the webserver app = express(); app.configure(function() { //app.use(express.logger('dev')); app.use(express.static(__dirname + '/public')); app.use('/backend', express.basicAuth(function(user, pass, callback) { var result = (user === 'admin' && pass === 'password'); callback(null, result); })); app.use('/backend/queue', kue.app); }); http.createServer(app).listen(8080); console.log('Listening on port 8080'); ds.init(); ## Instruction: Add node cluster to app. ## Code After: var cluster = require('cluster'); var mongoose = require('mongoose'); //var ds = require('./lib/data-store'); var numCPUs = require('os').cpus().length; // Connect to MongoDB //mongoose.connect('mongodb://127.0.0.1/habweb'); //mongoose.connection.on('open', function() { // console.log('Connected to Mongoose'); //}); // Create the cluster if(cluster.isMaster) { // Master process //ds.init(); for(var i=0; i < numCPUs; i++) { cluster.fork(); } } else { // Worker process // Include express var express = require('express'); // Create an express application app = express(); // Configure express app.configure(function() { app.use(express.static(__dirname + '/app')); }); // Bind to a port app.listen(8000); }
+ var cluster = require('cluster'); - var express = require('express'); - var http = require('http'); var mongoose = require('mongoose'); - var kue = require('kue'); - var ds = require('./lib/data-store'); + //var ds = require('./lib/data-store'); ? ++ + + var numCPUs = require('os').cpus().length; // Connect to MongoDB - mongoose.connect('mongodb://127.0.0.1/habweb'); + //mongoose.connect('mongodb://127.0.0.1/habweb'); ? ++ - mongoose.connection.on('open', function() { + //mongoose.connection.on('open', function() { ? ++ - console.log('Connected to Mongoose'); ? ^ + // console.log('Connected to Mongoose'); ? ^^^^ - }); + //}); ? ++ - // Create the job queue - var jobs = kue.createQueue(); + // Create the cluster + if(cluster.isMaster) { // Master process + //ds.init(); + for(var i=0; i < numCPUs; i++) { + cluster.fork(); + } + } else { // Worker process + // Include express + var express = require('express'); - // Create the webserver + // Create an express application - app = express(); + app = express(); ? ++ + // Configure express - app.configure(function() { + app.configure(function() { ? ++ - //app.use(express.logger('dev')); - app.use(express.static(__dirname + '/public')); ? ^ ^^^^^ + app.use(express.static(__dirname + '/app')); ? ^^^^ + ^ - app.use('/backend', express.basicAuth(function(user, pass, callback) { - var result = (user === 'admin' && pass === 'password'); - callback(null, result); - })); - app.use('/backend/queue', kue.app); - }); + }); ? ++ + // Bind to a port + app.listen(8000); + } - http.createServer(app).listen(8080); - console.log('Listening on port 8080'); - - ds.init();
51
1.545455
26
25
47c1881c4b384d11f4d721f6fcc9fa2dbe16f654
client/templates/authenticated/components/wish_item.js
client/templates/authenticated/components/wish_item.js
Template.wishItem.helpers({ dateOfWish() { var data = Template.instance().data; return moment().format('LLLL'); } });
Template.wishItem.helpers({ dateOfWish() { var data = Template.instance().data; return moment().format('DD.MM.YYYY'); } });
Modify date created display format to DD.MM.YYYY
Modify date created display format to DD.MM.YYYY
JavaScript
mit
lnwKodeDotCom/WeWish,lnwKodeDotCom/WeWish
javascript
## Code Before: Template.wishItem.helpers({ dateOfWish() { var data = Template.instance().data; return moment().format('LLLL'); } }); ## Instruction: Modify date created display format to DD.MM.YYYY ## Code After: Template.wishItem.helpers({ dateOfWish() { var data = Template.instance().data; return moment().format('DD.MM.YYYY'); } });
Template.wishItem.helpers({ dateOfWish() { var data = Template.instance().data; - return moment().format('LLLL'); ? ^^^^ + return moment().format('DD.MM.YYYY'); ? ^^^^^^^^^^ } });
2
0.333333
1
1
4f16b8cf647fa3b53f63368789b9a88d4df0db71
README.md
README.md
This is to make testing JSON output of whatever-you're-doing a tiny bit easier. Import [nosj](http://github.com/totherme/nosj), [ginkgo](http://github.com/onsi/ginkgo) and [gomega](http://github.com/onsi/gomega): ```golang import ( "github.com/totherme/nosj" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) ``` Get yourself some JSON: ```golang rawjson := `{"name": "fred", "othernames": [ "alice", "bob", "ezekiel" ], "life": 42, "things": { "more": "things" }, "beauty": true }` json, err = nosj.Json(rawjson) Expect(err).NotTo(HaveOccurred()) ``` Test that it looks the way you expect: ```golang It("has a 'life' field with a number in", func() { Expect(json.HasKey("life")).To(BeTrue()) Expect(json.GetField("life").IsNum()).To(BeTrue()) }) It("contains deep things", func() { Expect(json.GetField("things").GetField("more").StringValue()).To(Equal("things")) }) ```
This is to make testing JSON output of whatever-you're-doing a tiny bit easier. Import [nosj](http://github.com/totherme/nosj), [ginkgo](http://github.com/onsi/ginkgo) and [gomega](http://github.com/onsi/gomega): ```go import ( "github.com/totherme/nosj" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) ``` Get yourself some JSON: ```go rawjson := `{"name": "fred", "othernames": [ "alice", "bob", "ezekiel" ], "life": 42, "things": { "more": "things" }, "beauty": true }` json, err = nosj.Json(rawjson) Expect(err).NotTo(HaveOccurred()) ``` Test that it looks the way you expect: ```go It("has a 'life' field with a number in", func() { Expect(json.HasKey("life")).To(BeTrue()) Expect(json.GetField("life").IsNum()).To(BeTrue()) }) It("contains deep things", func() { Expect(json.GetField("things").GetField("more").StringValue()).To(Equal("things")) }) ```
Make github syntax highlighting work
Make github syntax highlighting work Signed-off-by: Gareth Smith <2f9181a725196cd0a5e07c6a6e161d83fcc71157@totherme.org>
Markdown
mit
totherme/unstructured,totherme/nosj
markdown
## Code Before: This is to make testing JSON output of whatever-you're-doing a tiny bit easier. Import [nosj](http://github.com/totherme/nosj), [ginkgo](http://github.com/onsi/ginkgo) and [gomega](http://github.com/onsi/gomega): ```golang import ( "github.com/totherme/nosj" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) ``` Get yourself some JSON: ```golang rawjson := `{"name": "fred", "othernames": [ "alice", "bob", "ezekiel" ], "life": 42, "things": { "more": "things" }, "beauty": true }` json, err = nosj.Json(rawjson) Expect(err).NotTo(HaveOccurred()) ``` Test that it looks the way you expect: ```golang It("has a 'life' field with a number in", func() { Expect(json.HasKey("life")).To(BeTrue()) Expect(json.GetField("life").IsNum()).To(BeTrue()) }) It("contains deep things", func() { Expect(json.GetField("things").GetField("more").StringValue()).To(Equal("things")) }) ``` ## Instruction: Make github syntax highlighting work Signed-off-by: Gareth Smith <2f9181a725196cd0a5e07c6a6e161d83fcc71157@totherme.org> ## Code After: This is to make testing JSON output of whatever-you're-doing a tiny bit easier. Import [nosj](http://github.com/totherme/nosj), [ginkgo](http://github.com/onsi/ginkgo) and [gomega](http://github.com/onsi/gomega): ```go import ( "github.com/totherme/nosj" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) ``` Get yourself some JSON: ```go rawjson := `{"name": "fred", "othernames": [ "alice", "bob", "ezekiel" ], "life": 42, "things": { "more": "things" }, "beauty": true }` json, err = nosj.Json(rawjson) Expect(err).NotTo(HaveOccurred()) ``` Test that it looks the way you expect: ```go It("has a 'life' field with a number in", func() { Expect(json.HasKey("life")).To(BeTrue()) Expect(json.GetField("life").IsNum()).To(BeTrue()) }) It("contains deep things", func() { Expect(json.GetField("things").GetField("more").StringValue()).To(Equal("things")) }) ```
This is to make testing JSON output of whatever-you're-doing a tiny bit easier. Import [nosj](http://github.com/totherme/nosj), [ginkgo](http://github.com/onsi/ginkgo) and [gomega](http://github.com/onsi/gomega): - ```golang + ```go import ( "github.com/totherme/nosj" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) ``` Get yourself some JSON: - ```golang + ```go rawjson := `{"name": "fred", "othernames": [ "alice", "bob", "ezekiel" ], "life": 42, "things": { "more": "things" }, "beauty": true }` json, err = nosj.Json(rawjson) Expect(err).NotTo(HaveOccurred()) ``` Test that it looks the way you expect: - ```golang + ```go It("has a 'life' field with a number in", func() { Expect(json.HasKey("life")).To(BeTrue()) Expect(json.GetField("life").IsNum()).To(BeTrue()) }) It("contains deep things", func() { Expect(json.GetField("things").GetField("more").StringValue()).To(Equal("things")) }) ```
6
0.122449
3
3
50cf656f198bc50c562dd7cbc8314c14dfb76957
src/tokens/eth/0xdfbc9050F5B01DF53512DCC39B4f2B2BBaCD517A.json
src/tokens/eth/0xdfbc9050F5B01DF53512DCC39B4f2B2BBaCD517A.json
{ "symbol": "JOB", "name": "Jobchain", "type": "ERC20", "address": "0xdfbc9050F5B01DF53512DCC39B4f2B2BBaCD517A", "ens_address": "", "decimals": 8, "website": "https://www.jobchain.com", "logo": { "src": "https://www.jobchain.com/MyEtherWalletLogo.png", "width": "128", "height": "128", "ipfs_hash": "" }, "support": { "email": "support@jobchain.com", "url": "" }, "social": { "blog": "https://blog.jobchain.com", "chat": "", "facebook": "https://www.facebook.com/JobchainOfficial/", "forum": "", "github": "https://github.com/JobchainOfficial", "gitter": "", "instagram": "https://www.instagram.com/jobchain/", "linkedin": "https://www.linkedin.com/company/JobchainOfficial", "reddit": "https://www.reddit.com/r/Jobchain", "slack": "", "telegram": "https://t.me/JobchainOfficial", "twitter": "https://twitter.com/Jobchain", "youtube": "" } }
{ "symbol": "JOB", "name": "Jobchain", "type": "ERC20", "address": "0xdfbc9050F5B01DF53512DCC39B4f2B2BBaCD517A", "ens_address": "jobchain.eth", "decimals": 8, "website": "https://www.jobchain.com", "logo": { "src": "https://www.jobchain.com/MyEtherWalletLogo.png", "width": "128", "height": "128", "ipfs_hash": "" }, "support": { "email": "support@jobchain.com", "url": "" }, "social": { "blog": "https://blog.jobchain.com", "chat": "", "facebook": "https://www.facebook.com/JobchainOfficial/", "forum": "", "github": "https://github.com/JobchainOfficial", "gitter": "", "instagram": "https://www.instagram.com/jobchain/", "linkedin": "https://www.linkedin.com/company/JobchainOfficial", "reddit": "https://www.reddit.com/r/Jobchain", "slack": "", "telegram": "https://t.me/JobchainOfficial", "twitter": "https://twitter.com/Jobchain", "youtube": "" } }
Update JOB of MEW List
Update JOB of MEW List
JSON
mit
MyEtherWallet/ethereum-lists
json
## Code Before: { "symbol": "JOB", "name": "Jobchain", "type": "ERC20", "address": "0xdfbc9050F5B01DF53512DCC39B4f2B2BBaCD517A", "ens_address": "", "decimals": 8, "website": "https://www.jobchain.com", "logo": { "src": "https://www.jobchain.com/MyEtherWalletLogo.png", "width": "128", "height": "128", "ipfs_hash": "" }, "support": { "email": "support@jobchain.com", "url": "" }, "social": { "blog": "https://blog.jobchain.com", "chat": "", "facebook": "https://www.facebook.com/JobchainOfficial/", "forum": "", "github": "https://github.com/JobchainOfficial", "gitter": "", "instagram": "https://www.instagram.com/jobchain/", "linkedin": "https://www.linkedin.com/company/JobchainOfficial", "reddit": "https://www.reddit.com/r/Jobchain", "slack": "", "telegram": "https://t.me/JobchainOfficial", "twitter": "https://twitter.com/Jobchain", "youtube": "" } } ## Instruction: Update JOB of MEW List ## Code After: { "symbol": "JOB", "name": "Jobchain", "type": "ERC20", "address": "0xdfbc9050F5B01DF53512DCC39B4f2B2BBaCD517A", "ens_address": "jobchain.eth", "decimals": 8, "website": "https://www.jobchain.com", "logo": { "src": "https://www.jobchain.com/MyEtherWalletLogo.png", "width": "128", "height": "128", "ipfs_hash": "" }, "support": { "email": "support@jobchain.com", "url": "" }, "social": { "blog": "https://blog.jobchain.com", "chat": "", "facebook": "https://www.facebook.com/JobchainOfficial/", "forum": "", "github": "https://github.com/JobchainOfficial", "gitter": "", "instagram": "https://www.instagram.com/jobchain/", "linkedin": "https://www.linkedin.com/company/JobchainOfficial", "reddit": "https://www.reddit.com/r/Jobchain", "slack": "", "telegram": "https://t.me/JobchainOfficial", "twitter": "https://twitter.com/Jobchain", "youtube": "" } }
{ "symbol": "JOB", "name": "Jobchain", "type": "ERC20", "address": "0xdfbc9050F5B01DF53512DCC39B4f2B2BBaCD517A", - "ens_address": "", + "ens_address": "jobchain.eth", ? ++++++++++++ "decimals": 8, "website": "https://www.jobchain.com", "logo": { "src": "https://www.jobchain.com/MyEtherWalletLogo.png", "width": "128", "height": "128", "ipfs_hash": "" }, "support": { "email": "support@jobchain.com", "url": "" }, "social": { "blog": "https://blog.jobchain.com", "chat": "", "facebook": "https://www.facebook.com/JobchainOfficial/", "forum": "", "github": "https://github.com/JobchainOfficial", "gitter": "", "instagram": "https://www.instagram.com/jobchain/", "linkedin": "https://www.linkedin.com/company/JobchainOfficial", "reddit": "https://www.reddit.com/r/Jobchain", "slack": "", "telegram": "https://t.me/JobchainOfficial", "twitter": "https://twitter.com/Jobchain", "youtube": "" } }
2
0.064516
1
1
c0a341bb285e9906747c1f872e3b022a3a491044
falmer/events/filters.py
falmer/events/filters.py
from django_filters import FilterSet, CharFilter, IsoDateTimeFilter, BooleanFilter, ModelChoiceFilter from falmer.events.models import Curator from . import models class EventFilterSet(FilterSet): class Meta: model = models.Event fields = ( 'title', 'venue', 'type', 'bundle', 'parent', 'brand', 'student_group', 'from_time', 'to_time', 'audience_just_for_pgs', 'audience_suitable_kids_families', 'audience_good_to_meet_people', 'is_over_18_only', 'cost', 'alcohol', 'type', 'ticket_level', 'curated_by' ) title = CharFilter(lookup_expr='icontains') brand = CharFilter(field_name='brand__slug') bundle = CharFilter(field_name='bundle__slug') student_group = CharFilter(field_name='student_group__slug') to_time = IsoDateTimeFilter(field_name='start_time', lookup_expr='lte') from_time = IsoDateTimeFilter(field_name='end_time', lookup_expr='gte') uncurated = BooleanFilter(field_name='curated_by', lookup_expr='isnull') curated_by = ModelChoiceFilter(queryset=Curator.objects.all(), field_name='curated_by') # # class BrandingPeriodFilerSet(FilterSet): # class Meta: # model = BrandingPeriod
from django_filters import FilterSet, CharFilter, IsoDateTimeFilter, BooleanFilter, ModelChoiceFilter from falmer.events.models import Curator from . import models class EventFilterSet(FilterSet): class Meta: model = models.Event fields = ( 'title', 'venue', 'type', 'bundle', 'parent', 'brand', 'student_group', 'from_time', 'to_time', 'audience_just_for_pgs', 'audience_suitable_kids_families', 'audience_good_to_meet_people', 'is_over_18_only', 'cost', 'alcohol', 'type', 'ticket_level', 'curated_by' ) title = CharFilter(lookup_expr='icontains') brand = CharFilter(field_name='brand__slug') bundle = CharFilter(field_name='bundle__slug') type = CharFilter(field_name='type__slug') student_group = CharFilter(field_name='student_group__slug') to_time = IsoDateTimeFilter(field_name='start_time', lookup_expr='lte') from_time = IsoDateTimeFilter(field_name='end_time', lookup_expr='gte') uncurated = BooleanFilter(field_name='curated_by', lookup_expr='isnull') curated_by = ModelChoiceFilter(queryset=Curator.objects.all(), field_name='curated_by') # # class BrandingPeriodFilerSet(FilterSet): # class Meta: # model = BrandingPeriod
Add type filter by slug
Add type filter by slug
Python
mit
sussexstudent/falmer,sussexstudent/falmer,sussexstudent/falmer,sussexstudent/falmer
python
## Code Before: from django_filters import FilterSet, CharFilter, IsoDateTimeFilter, BooleanFilter, ModelChoiceFilter from falmer.events.models import Curator from . import models class EventFilterSet(FilterSet): class Meta: model = models.Event fields = ( 'title', 'venue', 'type', 'bundle', 'parent', 'brand', 'student_group', 'from_time', 'to_time', 'audience_just_for_pgs', 'audience_suitable_kids_families', 'audience_good_to_meet_people', 'is_over_18_only', 'cost', 'alcohol', 'type', 'ticket_level', 'curated_by' ) title = CharFilter(lookup_expr='icontains') brand = CharFilter(field_name='brand__slug') bundle = CharFilter(field_name='bundle__slug') student_group = CharFilter(field_name='student_group__slug') to_time = IsoDateTimeFilter(field_name='start_time', lookup_expr='lte') from_time = IsoDateTimeFilter(field_name='end_time', lookup_expr='gte') uncurated = BooleanFilter(field_name='curated_by', lookup_expr='isnull') curated_by = ModelChoiceFilter(queryset=Curator.objects.all(), field_name='curated_by') # # class BrandingPeriodFilerSet(FilterSet): # class Meta: # model = BrandingPeriod ## Instruction: Add type filter by slug ## Code After: from django_filters import FilterSet, CharFilter, IsoDateTimeFilter, BooleanFilter, ModelChoiceFilter from falmer.events.models import Curator from . import models class EventFilterSet(FilterSet): class Meta: model = models.Event fields = ( 'title', 'venue', 'type', 'bundle', 'parent', 'brand', 'student_group', 'from_time', 'to_time', 'audience_just_for_pgs', 'audience_suitable_kids_families', 'audience_good_to_meet_people', 'is_over_18_only', 'cost', 'alcohol', 'type', 'ticket_level', 'curated_by' ) title = CharFilter(lookup_expr='icontains') brand = CharFilter(field_name='brand__slug') bundle = CharFilter(field_name='bundle__slug') type = CharFilter(field_name='type__slug') student_group = CharFilter(field_name='student_group__slug') to_time = IsoDateTimeFilter(field_name='start_time', lookup_expr='lte') from_time = IsoDateTimeFilter(field_name='end_time', lookup_expr='gte') uncurated = BooleanFilter(field_name='curated_by', lookup_expr='isnull') curated_by = ModelChoiceFilter(queryset=Curator.objects.all(), field_name='curated_by') # # class BrandingPeriodFilerSet(FilterSet): # class Meta: # model = BrandingPeriod
from django_filters import FilterSet, CharFilter, IsoDateTimeFilter, BooleanFilter, ModelChoiceFilter from falmer.events.models import Curator from . import models class EventFilterSet(FilterSet): class Meta: model = models.Event fields = ( 'title', 'venue', 'type', 'bundle', 'parent', 'brand', 'student_group', 'from_time', 'to_time', 'audience_just_for_pgs', 'audience_suitable_kids_families', 'audience_good_to_meet_people', 'is_over_18_only', 'cost', 'alcohol', 'type', 'ticket_level', 'curated_by' ) title = CharFilter(lookup_expr='icontains') brand = CharFilter(field_name='brand__slug') bundle = CharFilter(field_name='bundle__slug') + type = CharFilter(field_name='type__slug') student_group = CharFilter(field_name='student_group__slug') to_time = IsoDateTimeFilter(field_name='start_time', lookup_expr='lte') from_time = IsoDateTimeFilter(field_name='end_time', lookup_expr='gte') uncurated = BooleanFilter(field_name='curated_by', lookup_expr='isnull') curated_by = ModelChoiceFilter(queryset=Curator.objects.all(), field_name='curated_by') # # class BrandingPeriodFilerSet(FilterSet): # class Meta: # model = BrandingPeriod
1
0.021739
1
0
07276ba0ef5ce648bfff4d1146b0ef2cda9cafa2
testdata/files/unusual_types.go
testdata/files/unusual_types.go
package foo type Closer interface { Close() } type ReadCloser interface { Closer Read() } func Basic(s string) { _ = s } func BasicWrong(rc ReadCloser) { // WARN rc can be Closer rc.Close() } func Array(ints [3]int) {} func ArrayIface(rcs [3]ReadCloser) { rcs[1].Close() } func Slice(ints []int) {} func SliceIface(rcs []ReadCloser) { rcs[1].Close() } func TypeConversion(i int) int64 { return int64(i) }
package foo type Closer interface { Close() } type ReadCloser interface { Closer Read() } func Basic(s string) { _ = s } func BasicWrong(rc ReadCloser) { // WARN rc can be Closer rc.Close() } func Array(ints [3]int) {} func ArrayIface(rcs [3]ReadCloser) { rcs[1].Close() } func Slice(ints []int) {} func SliceIface(rcs []ReadCloser) { rcs[1].Close() } func TypeConversion(i int) int64 { return int64(i) } func LocalType() { type str string }
Improve test coverage for onDecl()
Improve test coverage for onDecl() Sometimes the *ast.ValueSpec type cast is not succesful. Prove it, also avoiding future panics if we ever remove the ok check.
Go
bsd-3-clause
mvdan/interfacer
go
## Code Before: package foo type Closer interface { Close() } type ReadCloser interface { Closer Read() } func Basic(s string) { _ = s } func BasicWrong(rc ReadCloser) { // WARN rc can be Closer rc.Close() } func Array(ints [3]int) {} func ArrayIface(rcs [3]ReadCloser) { rcs[1].Close() } func Slice(ints []int) {} func SliceIface(rcs []ReadCloser) { rcs[1].Close() } func TypeConversion(i int) int64 { return int64(i) } ## Instruction: Improve test coverage for onDecl() Sometimes the *ast.ValueSpec type cast is not succesful. Prove it, also avoiding future panics if we ever remove the ok check. ## Code After: package foo type Closer interface { Close() } type ReadCloser interface { Closer Read() } func Basic(s string) { _ = s } func BasicWrong(rc ReadCloser) { // WARN rc can be Closer rc.Close() } func Array(ints [3]int) {} func ArrayIface(rcs [3]ReadCloser) { rcs[1].Close() } func Slice(ints []int) {} func SliceIface(rcs []ReadCloser) { rcs[1].Close() } func TypeConversion(i int) int64 { return int64(i) } func LocalType() { type str string }
package foo type Closer interface { Close() } type ReadCloser interface { Closer Read() } func Basic(s string) { _ = s } func BasicWrong(rc ReadCloser) { // WARN rc can be Closer rc.Close() } func Array(ints [3]int) {} func ArrayIface(rcs [3]ReadCloser) { rcs[1].Close() } func Slice(ints []int) {} func SliceIface(rcs []ReadCloser) { rcs[1].Close() } func TypeConversion(i int) int64 { return int64(i) } + + func LocalType() { + type str string + }
4
0.117647
4
0