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
828fec30b5b1deddcca79eae8fd1029bd5bd7b54
py/desispec/io/__init__.py
py/desispec/io/__init__.py
# help with 2to3 support from __future__ import absolute_import, division from .meta import findfile, get_exposures, get_files, rawdata_root, specprod_root from .frame import read_frame, write_frame from .sky import read_sky, write_sky from .fiberflat import read_fiberflat, write_fiberflat from .fibermap import read_fibermap, write_fibermap, empty_fibermap from .brick import Brick from .qa import read_qa_frame, write_qa_frame from .zfind import read_zbest, write_zbest from .image import read_image, write_image from .util import (header2wave, fitsheader, native_endian, makepath, write_bintable, iterfiles) from .fluxcalibration import ( read_stdstar_templates, write_stdstar_model, read_flux_calibration, write_flux_calibration) from .filters import read_filter_response from .download import download, filepath2url from .crc import memcrc, cksum from .database import (load_brick, is_night, load_night, is_flavor, load_flavor, get_bricks_by_name, get_brickid_by_name, load_data)
# help with 2to3 support from __future__ import absolute_import, division from .meta import (findfile, get_exposures, get_files, rawdata_root, specprod_root, validate_night) from .frame import read_frame, write_frame from .sky import read_sky, write_sky from .fiberflat import read_fiberflat, write_fiberflat from .fibermap import read_fibermap, write_fibermap, empty_fibermap from .brick import Brick from .qa import read_qa_frame, write_qa_frame from .zfind import read_zbest, write_zbest from .image import read_image, write_image from .util import (header2wave, fitsheader, native_endian, makepath, write_bintable, iterfiles) from .fluxcalibration import ( read_stdstar_templates, write_stdstar_model, read_flux_calibration, write_flux_calibration) from .filters import read_filter_response from .download import download, filepath2url from .crc import memcrc, cksum from .database import (load_brick, is_night, load_night, is_flavor, load_flavor, get_bricks_by_name, get_brickid_by_name, load_data)
Add validate_night to public API
Add validate_night to public API
Python
bsd-3-clause
desihub/desispec,gdhungana/desispec,timahutchinson/desispec,gdhungana/desispec,desihub/desispec,timahutchinson/desispec
python
## Code Before: # help with 2to3 support from __future__ import absolute_import, division from .meta import findfile, get_exposures, get_files, rawdata_root, specprod_root from .frame import read_frame, write_frame from .sky import read_sky, write_sky from .fiberflat import read_fiberflat, write_fiberflat from .fibermap import read_fibermap, write_fibermap, empty_fibermap from .brick import Brick from .qa import read_qa_frame, write_qa_frame from .zfind import read_zbest, write_zbest from .image import read_image, write_image from .util import (header2wave, fitsheader, native_endian, makepath, write_bintable, iterfiles) from .fluxcalibration import ( read_stdstar_templates, write_stdstar_model, read_flux_calibration, write_flux_calibration) from .filters import read_filter_response from .download import download, filepath2url from .crc import memcrc, cksum from .database import (load_brick, is_night, load_night, is_flavor, load_flavor, get_bricks_by_name, get_brickid_by_name, load_data) ## Instruction: Add validate_night to public API ## Code After: # help with 2to3 support from __future__ import absolute_import, division from .meta import (findfile, get_exposures, get_files, rawdata_root, specprod_root, validate_night) from .frame import read_frame, write_frame from .sky import read_sky, write_sky from .fiberflat import read_fiberflat, write_fiberflat from .fibermap import read_fibermap, write_fibermap, empty_fibermap from .brick import Brick from .qa import read_qa_frame, write_qa_frame from .zfind import read_zbest, write_zbest from .image import read_image, write_image from .util import (header2wave, fitsheader, native_endian, makepath, write_bintable, iterfiles) from .fluxcalibration import ( read_stdstar_templates, write_stdstar_model, read_flux_calibration, write_flux_calibration) from .filters import read_filter_response from .download import download, filepath2url from .crc import memcrc, cksum from .database import (load_brick, is_night, load_night, is_flavor, load_flavor, get_bricks_by_name, get_brickid_by_name, load_data)
# help with 2to3 support from __future__ import absolute_import, division - from .meta import findfile, get_exposures, get_files, rawdata_root, specprod_root ? ------------- + from .meta import (findfile, get_exposures, get_files, rawdata_root, ? + + specprod_root, validate_night) from .frame import read_frame, write_frame from .sky import read_sky, write_sky from .fiberflat import read_fiberflat, write_fiberflat from .fibermap import read_fibermap, write_fibermap, empty_fibermap from .brick import Brick from .qa import read_qa_frame, write_qa_frame from .zfind import read_zbest, write_zbest from .image import read_image, write_image from .util import (header2wave, fitsheader, native_endian, makepath, write_bintable, iterfiles) from .fluxcalibration import ( read_stdstar_templates, write_stdstar_model, read_flux_calibration, write_flux_calibration) from .filters import read_filter_response from .download import download, filepath2url from .crc import memcrc, cksum from .database import (load_brick, is_night, load_night, is_flavor, load_flavor, get_bricks_by_name, get_brickid_by_name, load_data)
3
0.130435
2
1
7a3a1ffc6c153e4ea867988d12725f92d133ffc4
js2py/internals/seval.py
js2py/internals/seval.py
import pyjsparser from space import Space import fill_space from byte_trans import ByteCodeGenerator from code import Code from simplex import MakeError import sys sys.setrecursionlimit(100000) pyjsparser.parser.ENABLE_JS2PY_ERRORS = lambda msg: MakeError(u'SyntaxError', unicode(msg)) def eval_js_vm(js): a = ByteCodeGenerator(Code()) s = Space() a.exe.space = s s.exe = a.exe d = pyjsparser.parse(js) a.emit(d) fill_space.fill_space(s, a) # print a.exe.tape a.exe.compile() return a.exe.run(a.exe.space.GlobalObj)
import pyjsparser from space import Space import fill_space from byte_trans import ByteCodeGenerator from code import Code from simplex import MakeError import sys sys.setrecursionlimit(100000) pyjsparser.parser.ENABLE_JS2PY_ERRORS = lambda msg: MakeError(u'SyntaxError', unicode(msg)) def get_js_bytecode(js): a = ByteCodeGenerator(Code()) d = pyjsparser.parse(js) a.emit(d) return a.exe.tape def eval_js_vm(js): a = ByteCodeGenerator(Code()) s = Space() a.exe.space = s s.exe = a.exe d = pyjsparser.parse(js) a.emit(d) fill_space.fill_space(s, a) # print a.exe.tape a.exe.compile() return a.exe.run(a.exe.space.GlobalObj)
Add a function returning js bytecode.
Add a function returning js bytecode.
Python
mit
PiotrDabkowski/Js2Py,PiotrDabkowski/Js2Py,PiotrDabkowski/Js2Py
python
## Code Before: import pyjsparser from space import Space import fill_space from byte_trans import ByteCodeGenerator from code import Code from simplex import MakeError import sys sys.setrecursionlimit(100000) pyjsparser.parser.ENABLE_JS2PY_ERRORS = lambda msg: MakeError(u'SyntaxError', unicode(msg)) def eval_js_vm(js): a = ByteCodeGenerator(Code()) s = Space() a.exe.space = s s.exe = a.exe d = pyjsparser.parse(js) a.emit(d) fill_space.fill_space(s, a) # print a.exe.tape a.exe.compile() return a.exe.run(a.exe.space.GlobalObj) ## Instruction: Add a function returning js bytecode. ## Code After: import pyjsparser from space import Space import fill_space from byte_trans import ByteCodeGenerator from code import Code from simplex import MakeError import sys sys.setrecursionlimit(100000) pyjsparser.parser.ENABLE_JS2PY_ERRORS = lambda msg: MakeError(u'SyntaxError', unicode(msg)) def get_js_bytecode(js): a = ByteCodeGenerator(Code()) d = pyjsparser.parse(js) a.emit(d) return a.exe.tape def eval_js_vm(js): a = ByteCodeGenerator(Code()) s = Space() a.exe.space = s s.exe = a.exe d = pyjsparser.parse(js) a.emit(d) fill_space.fill_space(s, a) # print a.exe.tape a.exe.compile() return a.exe.run(a.exe.space.GlobalObj)
import pyjsparser from space import Space import fill_space from byte_trans import ByteCodeGenerator from code import Code from simplex import MakeError import sys sys.setrecursionlimit(100000) pyjsparser.parser.ENABLE_JS2PY_ERRORS = lambda msg: MakeError(u'SyntaxError', unicode(msg)) - + def get_js_bytecode(js): + a = ByteCodeGenerator(Code()) + d = pyjsparser.parse(js) + a.emit(d) + return a.exe.tape + def eval_js_vm(js): a = ByteCodeGenerator(Code()) s = Space() a.exe.space = s s.exe = a.exe d = pyjsparser.parse(js) a.emit(d) fill_space.fill_space(s, a) # print a.exe.tape a.exe.compile() return a.exe.run(a.exe.space.GlobalObj)
7
0.259259
6
1
2253bbba48c48318532d63ea6c2a71749e89c4ea
perf/scenario-1.html
perf/scenario-1.html
<!DOCTYPE html> <html> <head> <script src="lib.js"></script> <script src="../src/skate.js"></script> <script src="x-append-button.js"></script> <script src="x-remove-button.js"></script> <script src="x-ignore-checkbox.js"></script> </head> <body> <h1>Scenario 1</h1> <p>Skating several items already in the DOM.</p> <x-append-button to="container">Add items</x-append-button> <x-remove-button from="container">Remove items</x-remove-button> <x-ignore-checkbox in="container">Ignore items</x-ignore-checkbox> <div id="container"></div> <script> addSkateListeners(1000); </script> </body> </html>
<!DOCTYPE html> <html> <head> <script src="lib.js"></script> <script src="../src/skate.js"></script> <script src="x-append-button.js"></script> <script src="x-remove-button.js"></script> <script src="x-ignore-checkbox.js"></script> </head> <body> <h1>Scenario 1</h1> <p>Skating several items already in the DOM.</p> <x-append-button to="container">Add items</x-append-button> <x-remove-button from="container">Remove items</x-remove-button> <x-ignore-checkbox in="container">Ignore items</x-ignore-checkbox> <div id="container"></div> <script> addTestElements(document.getElementById('container'), 10000); addSkateListeners(1000); </script> </body> </html>
Revert test back to having 100k elements on the page.
Revert test back to having 100k elements on the page.
HTML
mit
skatejs/skatejs,chrisdarroch/skatejs,antitoxic/skatejs,chrisdarroch/skatejs,skatejs/skatejs,skatejs/skatejs
html
## Code Before: <!DOCTYPE html> <html> <head> <script src="lib.js"></script> <script src="../src/skate.js"></script> <script src="x-append-button.js"></script> <script src="x-remove-button.js"></script> <script src="x-ignore-checkbox.js"></script> </head> <body> <h1>Scenario 1</h1> <p>Skating several items already in the DOM.</p> <x-append-button to="container">Add items</x-append-button> <x-remove-button from="container">Remove items</x-remove-button> <x-ignore-checkbox in="container">Ignore items</x-ignore-checkbox> <div id="container"></div> <script> addSkateListeners(1000); </script> </body> </html> ## Instruction: Revert test back to having 100k elements on the page. ## Code After: <!DOCTYPE html> <html> <head> <script src="lib.js"></script> <script src="../src/skate.js"></script> <script src="x-append-button.js"></script> <script src="x-remove-button.js"></script> <script src="x-ignore-checkbox.js"></script> </head> <body> <h1>Scenario 1</h1> <p>Skating several items already in the DOM.</p> <x-append-button to="container">Add items</x-append-button> <x-remove-button from="container">Remove items</x-remove-button> <x-ignore-checkbox in="container">Ignore items</x-ignore-checkbox> <div id="container"></div> <script> addTestElements(document.getElementById('container'), 10000); addSkateListeners(1000); </script> </body> </html>
<!DOCTYPE html> <html> <head> <script src="lib.js"></script> <script src="../src/skate.js"></script> <script src="x-append-button.js"></script> <script src="x-remove-button.js"></script> <script src="x-ignore-checkbox.js"></script> </head> <body> <h1>Scenario 1</h1> <p>Skating several items already in the DOM.</p> <x-append-button to="container">Add items</x-append-button> <x-remove-button from="container">Remove items</x-remove-button> <x-ignore-checkbox in="container">Ignore items</x-ignore-checkbox> <div id="container"></div> <script> + addTestElements(document.getElementById('container'), 10000); addSkateListeners(1000); </script> </body> </html>
1
0.047619
1
0
3bde8d6f57dd4d8e1ad2d75abd11b2d68b68c012
app/views/shared/_messages.html.haml
app/views/shared/_messages.html.haml
%section#messages .timeline %h4 Communication tool - if @messages.none? %span No messages found - else %ul.days %li %ul = render partial: 'shared/message', collection: @messages = simple_form_for @message do |f| = f.input :claim_id, value: @claim.id, as: :hidden = f.input :subject, placeholder: 'Subject', label: false = f.input :body, placeholder: 'Message', label: false = f.submit 'Post', class: 'button'
%section#messages .timeline %h4 Communication tool %ul.days %li %ul - if @messages.none? %span No messages found - else = render partial: 'shared/message', collection: @messages = simple_form_for @message do |f| = f.input :claim_id, value: @claim.id, as: :hidden = f.input :subject, placeholder: 'Subject', label: false = f.input :body, placeholder: 'Message', label: false = f.submit 'Post', class: 'button'
Fix claim messages bug where form is not visible if no messages present
Fix claim messages bug where form is not visible if no messages present
Haml
mit
ministryofjustice/advocate-defence-payments,ministryofjustice/advocate-defence-payments,ministryofjustice/advocate-defence-payments,ministryofjustice/advocate-defence-payments
haml
## Code Before: %section#messages .timeline %h4 Communication tool - if @messages.none? %span No messages found - else %ul.days %li %ul = render partial: 'shared/message', collection: @messages = simple_form_for @message do |f| = f.input :claim_id, value: @claim.id, as: :hidden = f.input :subject, placeholder: 'Subject', label: false = f.input :body, placeholder: 'Message', label: false = f.submit 'Post', class: 'button' ## Instruction: Fix claim messages bug where form is not visible if no messages present ## Code After: %section#messages .timeline %h4 Communication tool %ul.days %li %ul - if @messages.none? %span No messages found - else = render partial: 'shared/message', collection: @messages = simple_form_for @message do |f| = f.input :claim_id, value: @claim.id, as: :hidden = f.input :subject, placeholder: 'Subject', label: false = f.input :body, placeholder: 'Message', label: false = f.submit 'Post', class: 'button'
%section#messages .timeline %h4 Communication tool - - if @messages.none? - %span - No messages found - - else %ul.days %li %ul + - if @messages.none? + %span + No messages found + - else - = render partial: 'shared/message', collection: @messages + = render partial: 'shared/message', collection: @messages ? ++ - = simple_form_for @message do |f| ? -- + = simple_form_for @message do |f| - = f.input :claim_id, value: @claim.id, as: :hidden ? -- + = f.input :claim_id, value: @claim.id, as: :hidden - = f.input :subject, placeholder: 'Subject', label: false ? -- + = f.input :subject, placeholder: 'Subject', label: false - = f.input :body, placeholder: 'Message', label: false ? -- + = f.input :body, placeholder: 'Message', label: false - = f.submit 'Post', class: 'button' ? -- + = f.submit 'Post', class: 'button'
20
1.111111
10
10
e3752346e974b90c3c5977b1678b3f0a15e86dd8
composer.json
composer.json
{ "name": "padosoft/static-review", "description": "Custom Static Review classes", "keywords" : ["static-review", "code quality", "pre-commit", "commit", "git" ], "homepage":"https://github.org/padosoft/static-review/", "license" : "MIT", "authors" : [ { "name" : "padosoft", "email" : "helpdesk@padosoft.com", "homepage" : "https://www.padosoft.com", "role" : "Developer" } ], "require": { }, "require-dev": { "phpunit/phpunit" : "4.*", "scrutinizer/ocular": "~1.1", "phpmd/phpmd": "2.*", "squizlabs/php_codesniffer": "2.*" }, "autoload": { "psr-4": { "Padosoft\\StaticReview\\": "src" } }, "autoload-dev": { "psr-4": { "Padosoft\\StaticReview\\Test\\": "tests" } }, "extra": { "branch-alias": { "dev-master": "1.0-dev" } } }
{ "name": "padosoft/static-review", "description": "Custom Static Review classes", "keywords" : ["static-review", "code quality", "pre-commit", "commit", "git" ], "homepage":"https://github.org/padosoft/static-review/", "license" : "MIT", "authors" : [ { "name" : "padosoft", "email" : "helpdesk@padosoft.com", "homepage" : "https://www.padosoft.com", "role" : "Developer" } ], "require": { "sjparkinson/static-review": "5.*" }, "require-dev": { "phpunit/phpunit" : "4.*", "scrutinizer/ocular": "~1.1", "phpmd/phpmd": "2.*", "squizlabs/php_codesniffer": "2.*" }, "autoload": { "psr-4": { "Padosoft\\StaticReview\\": "src" } }, "autoload-dev": { "psr-4": { "Padosoft\\StaticReview\\Test\\": "tests" } }, "extra": { "branch-alias": { "dev-master": "1.0-dev" } } }
ADD require package CHANGE readme.md
ADD require package CHANGE readme.md
JSON
mit
padosoft/static-review
json
## Code Before: { "name": "padosoft/static-review", "description": "Custom Static Review classes", "keywords" : ["static-review", "code quality", "pre-commit", "commit", "git" ], "homepage":"https://github.org/padosoft/static-review/", "license" : "MIT", "authors" : [ { "name" : "padosoft", "email" : "helpdesk@padosoft.com", "homepage" : "https://www.padosoft.com", "role" : "Developer" } ], "require": { }, "require-dev": { "phpunit/phpunit" : "4.*", "scrutinizer/ocular": "~1.1", "phpmd/phpmd": "2.*", "squizlabs/php_codesniffer": "2.*" }, "autoload": { "psr-4": { "Padosoft\\StaticReview\\": "src" } }, "autoload-dev": { "psr-4": { "Padosoft\\StaticReview\\Test\\": "tests" } }, "extra": { "branch-alias": { "dev-master": "1.0-dev" } } } ## Instruction: ADD require package CHANGE readme.md ## Code After: { "name": "padosoft/static-review", "description": "Custom Static Review classes", "keywords" : ["static-review", "code quality", "pre-commit", "commit", "git" ], "homepage":"https://github.org/padosoft/static-review/", "license" : "MIT", "authors" : [ { "name" : "padosoft", "email" : "helpdesk@padosoft.com", "homepage" : "https://www.padosoft.com", "role" : "Developer" } ], "require": { "sjparkinson/static-review": "5.*" }, "require-dev": { "phpunit/phpunit" : "4.*", "scrutinizer/ocular": "~1.1", "phpmd/phpmd": "2.*", "squizlabs/php_codesniffer": "2.*" }, "autoload": { "psr-4": { "Padosoft\\StaticReview\\": "src" } }, "autoload-dev": { "psr-4": { "Padosoft\\StaticReview\\Test\\": "tests" } }, "extra": { "branch-alias": { "dev-master": "1.0-dev" } } }
{ "name": "padosoft/static-review", "description": "Custom Static Review classes", "keywords" : ["static-review", "code quality", "pre-commit", "commit", "git" ], "homepage":"https://github.org/padosoft/static-review/", "license" : "MIT", "authors" : [ { "name" : "padosoft", "email" : "helpdesk@padosoft.com", "homepage" : "https://www.padosoft.com", "role" : "Developer" } ], "require": { - + "sjparkinson/static-review": "5.*" }, "require-dev": { "phpunit/phpunit" : "4.*", "scrutinizer/ocular": "~1.1", "phpmd/phpmd": "2.*", "squizlabs/php_codesniffer": "2.*" }, "autoload": { "psr-4": { "Padosoft\\StaticReview\\": "src" } }, "autoload-dev": { "psr-4": { "Padosoft\\StaticReview\\Test\\": "tests" } }, "extra": { "branch-alias": { "dev-master": "1.0-dev" } } }
2
0.05
1
1
da59d4334eb1a6f77bd0a9599614a6289ef843e4
pytest-server-fixtures/tests/integration/test_mongo_server.py
pytest-server-fixtures/tests/integration/test_mongo_server.py
import pytest def test_mongo_server(mongo_server): assert mongo_server.check_server_up() assert mongo_server.delete mongo_server.api.db.test.insert_one({'a': 'b', 'c': 'd'}) assert mongo_server.api.db.test.find_one({'a': 'b'}, {'_id': False}) == {'a': 'b', 'c': 'd'} @pytest.mark.parametrize('count', range(3)) def test_mongo_server_multi(count, mongo_server): coll = mongo_server.api.some_database.some_collection assert coll.count_documents({}) == 0 coll.insert_one({'a': 'b'}) assert coll.count_documents({}) == 1
import pytest def test_mongo_server(mongo_server): assert mongo_server.check_server_up() assert mongo_server.delete mongo_server.api.db.test.insert({'a': 'b', 'c': 'd'}) assert mongo_server.api.db.test.find_one({'a': 'b'}, {'_id': False}) == {'a': 'b', 'c': 'd'} @pytest.mark.parametrize('count', range(3)) def test_mongo_server_multi(count, mongo_server): coll = mongo_server.api.some_database.some_collection assert coll.count() == 0 coll.insert({'a': 'b'}) assert coll.count() == 1
Revert "fix deprecation warnings in mongo"
Revert "fix deprecation warnings in mongo" This reverts commit 5d449ff9376e7c0a3c78f2b2d631ab0ecd08fe81.
Python
mit
manahl/pytest-plugins,manahl/pytest-plugins
python
## Code Before: import pytest def test_mongo_server(mongo_server): assert mongo_server.check_server_up() assert mongo_server.delete mongo_server.api.db.test.insert_one({'a': 'b', 'c': 'd'}) assert mongo_server.api.db.test.find_one({'a': 'b'}, {'_id': False}) == {'a': 'b', 'c': 'd'} @pytest.mark.parametrize('count', range(3)) def test_mongo_server_multi(count, mongo_server): coll = mongo_server.api.some_database.some_collection assert coll.count_documents({}) == 0 coll.insert_one({'a': 'b'}) assert coll.count_documents({}) == 1 ## Instruction: Revert "fix deprecation warnings in mongo" This reverts commit 5d449ff9376e7c0a3c78f2b2d631ab0ecd08fe81. ## Code After: import pytest def test_mongo_server(mongo_server): assert mongo_server.check_server_up() assert mongo_server.delete mongo_server.api.db.test.insert({'a': 'b', 'c': 'd'}) assert mongo_server.api.db.test.find_one({'a': 'b'}, {'_id': False}) == {'a': 'b', 'c': 'd'} @pytest.mark.parametrize('count', range(3)) def test_mongo_server_multi(count, mongo_server): coll = mongo_server.api.some_database.some_collection assert coll.count() == 0 coll.insert({'a': 'b'}) assert coll.count() == 1
import pytest def test_mongo_server(mongo_server): assert mongo_server.check_server_up() assert mongo_server.delete - mongo_server.api.db.test.insert_one({'a': 'b', 'c': 'd'}) ? ---- + mongo_server.api.db.test.insert({'a': 'b', 'c': 'd'}) assert mongo_server.api.db.test.find_one({'a': 'b'}, {'_id': False}) == {'a': 'b', 'c': 'd'} @pytest.mark.parametrize('count', range(3)) def test_mongo_server_multi(count, mongo_server): coll = mongo_server.api.some_database.some_collection - assert coll.count_documents({}) == 0 ? ---------- -- + assert coll.count() == 0 - coll.insert_one({'a': 'b'}) ? ---- + coll.insert({'a': 'b'}) - assert coll.count_documents({}) == 1 ? ---------- -- + assert coll.count() == 1
8
0.5
4
4
e238c93ceff2694aec391194e23ab821c6f2cd8c
docs/release-notes/version-4.4.23.rst
docs/release-notes/version-4.4.23.rst
============== Version 4.4.23 ============== Version 4.4.23 of mod_wsgi can be obtained from: https://codeload.github.com/GrahamDumpleton/mod_wsgi/tar.gz/4.4.23 For details on the availability of Windows binaries see: https://github.com/GrahamDumpleton/mod_wsgi/tree/master/win32
============== Version 4.4.23 ============== Version 4.4.23 of mod_wsgi can be obtained from: https://codeload.github.com/GrahamDumpleton/mod_wsgi/tar.gz/4.4.23 For details on the availability of Windows binaries see: https://github.com/GrahamDumpleton/mod_wsgi/tree/master/win32 New Features ------------ 1. Added the ``--ssl-certificate-chain-file`` option to ``mod_wsgi-express``, for specifying the path to a file containing the certificates of Certification Authorities (CA) which form the certificate chain of the server certificate. This is equivalent to having used the Apache ``SSLCertificateChainFile`` directive.
Document addition of --ssl-certificate-chain-file option for mod_wsgi-express.
Document addition of --ssl-certificate-chain-file option for mod_wsgi-express.
reStructuredText
apache-2.0
GrahamDumpleton/mod_wsgi,GrahamDumpleton/mod_wsgi,GrahamDumpleton/mod_wsgi
restructuredtext
## Code Before: ============== Version 4.4.23 ============== Version 4.4.23 of mod_wsgi can be obtained from: https://codeload.github.com/GrahamDumpleton/mod_wsgi/tar.gz/4.4.23 For details on the availability of Windows binaries see: https://github.com/GrahamDumpleton/mod_wsgi/tree/master/win32 ## Instruction: Document addition of --ssl-certificate-chain-file option for mod_wsgi-express. ## Code After: ============== Version 4.4.23 ============== Version 4.4.23 of mod_wsgi can be obtained from: https://codeload.github.com/GrahamDumpleton/mod_wsgi/tar.gz/4.4.23 For details on the availability of Windows binaries see: https://github.com/GrahamDumpleton/mod_wsgi/tree/master/win32 New Features ------------ 1. Added the ``--ssl-certificate-chain-file`` option to ``mod_wsgi-express``, for specifying the path to a file containing the certificates of Certification Authorities (CA) which form the certificate chain of the server certificate. This is equivalent to having used the Apache ``SSLCertificateChainFile`` directive.
============== Version 4.4.23 ============== Version 4.4.23 of mod_wsgi can be obtained from: https://codeload.github.com/GrahamDumpleton/mod_wsgi/tar.gz/4.4.23 For details on the availability of Windows binaries see: https://github.com/GrahamDumpleton/mod_wsgi/tree/master/win32 + + New Features + ------------ + + 1. Added the ``--ssl-certificate-chain-file`` option to + ``mod_wsgi-express``, for specifying the path to a file containing the + certificates of Certification Authorities (CA) which form the certificate + chain of the server certificate. This is equivalent to having used the + Apache ``SSLCertificateChainFile`` directive.
9
0.818182
9
0
233281e081f6a698b08814f9ea0c2808c0cbdd97
lib/premailer/rails/css_loaders/asset_pipeline_loader.rb
lib/premailer/rails/css_loaders/asset_pipeline_loader.rb
class Premailer module Rails module CSSLoaders module AssetPipelineLoader extend self def load(url) if asset_pipeline_present? file = file_name(url) asset = ::Rails.application.assets.find_asset(file) asset.to_s if asset end end def asset_pipeline_present? defined?(::Rails) and ::Rails.application.respond_to?(:assets) end def file_name(url) URI(url).path .sub("#{::Rails.configuration.assets.prefix}/", '') .sub(/-(\h{32}|\h{64})\.css$/, '.css') end end end end end
class Premailer module Rails module CSSLoaders module AssetPipelineLoader extend self def load(url) if asset_pipeline_present? file = file_name(url) asset = ::Rails.application.assets.find_asset(file) asset.to_s if asset end end def asset_pipeline_present? defined?(::Rails) && ::Rails.application.respond_to?(:assets) && ::Rails.application.assets end def file_name(url) URI(url).path .sub("#{::Rails.configuration.assets.prefix}/", '') .sub(/-(\h{32}|\h{64})\.css$/, '.css') end end end end end
Check for asset pipeline presence
Check for asset pipeline presence Closes #145
Ruby
mit
controlshift/premailer-rails,fphilipe/premailer-rails,fphilipe/premailer-rails,controlshift/premailer-rails,fphilipe/premailer-rails,controlshift/premailer-rails
ruby
## Code Before: class Premailer module Rails module CSSLoaders module AssetPipelineLoader extend self def load(url) if asset_pipeline_present? file = file_name(url) asset = ::Rails.application.assets.find_asset(file) asset.to_s if asset end end def asset_pipeline_present? defined?(::Rails) and ::Rails.application.respond_to?(:assets) end def file_name(url) URI(url).path .sub("#{::Rails.configuration.assets.prefix}/", '') .sub(/-(\h{32}|\h{64})\.css$/, '.css') end end end end end ## Instruction: Check for asset pipeline presence Closes #145 ## Code After: class Premailer module Rails module CSSLoaders module AssetPipelineLoader extend self def load(url) if asset_pipeline_present? file = file_name(url) asset = ::Rails.application.assets.find_asset(file) asset.to_s if asset end end def asset_pipeline_present? defined?(::Rails) && ::Rails.application.respond_to?(:assets) && ::Rails.application.assets end def file_name(url) URI(url).path .sub("#{::Rails.configuration.assets.prefix}/", '') .sub(/-(\h{32}|\h{64})\.css$/, '.css') end end end end end
class Premailer module Rails module CSSLoaders module AssetPipelineLoader extend self def load(url) if asset_pipeline_present? file = file_name(url) asset = ::Rails.application.assets.find_asset(file) asset.to_s if asset end end def asset_pipeline_present? + defined?(::Rails) && - defined?(::Rails) and ::Rails.application.respond_to?(:assets) ? ----------------- --- + ::Rails.application.respond_to?(:assets) && ? +++ + ::Rails.application.assets end def file_name(url) URI(url).path .sub("#{::Rails.configuration.assets.prefix}/", '') .sub(/-(\h{32}|\h{64})\.css$/, '.css') end end end end end
4
0.148148
3
1
b736739280d998a90d2ba161eeac41476907df81
docker-compose.yml
docker-compose.yml
version: '3' services: redis: image: "redis:alpine" ports: - "6379:6379"
version: '3' services: redis: image: "redis:alpine" ports: - "6379:6379" storage: image: "minio/minio" ports: - "9000:9000" command: server /data
Add minio as development storage
Add minio as development storage
YAML
mit
Scribblerockerz/cryptletter,Scribblerockerz/cryptletter,Scribblerockerz/cryptletter,Scribblerockerz/cryptletter
yaml
## Code Before: version: '3' services: redis: image: "redis:alpine" ports: - "6379:6379" ## Instruction: Add minio as development storage ## Code After: version: '3' services: redis: image: "redis:alpine" ports: - "6379:6379" storage: image: "minio/minio" ports: - "9000:9000" command: server /data
version: '3' services: redis: image: "redis:alpine" ports: - "6379:6379" + storage: + image: "minio/minio" + ports: + - "9000:9000" + command: server /data
5
0.714286
5
0
1655c03a11459f126ba9edf1f939b0cdcd91ef85
_protected/app/system/modules/hotornot/views/base/tpl/main/rating.tpl
_protected/app/system/modules/hotornot/views/base/tpl/main/rating.tpl
<div class="center"> <h2 class="pink1">{desc_for_woman}</h2> <h2 class="pink2">{desc_for_man}</h2> <div class="s_bMarg"></div> {if empty($error)} {{ $avatarDesign->get($data->username, $data->firstName, $data->sex, 400) }} <div class="hon_click"> {{ RatingDesignCore::voting($data->profileId,DbTableName::MEMBER,'center') }} </div> <p class="italic s_tMarg"> {lang}If the photo does not match your sexual preference please be respectful and press the SKIP button below{/lang} </p> <p> <a class="bold btn btn-primary" rel="nofollow" href="{{ $design->url('hotornot', 'main', 'rating') }}">{lang 'SKIP'}</a> </p> <br /><hr /><br /> <p class="center"> {{ $design->like($data->username, $data->firstName, $data->sex, (new UserCore)->getProfileLink($data->username)) }} | {{ $design->report($data->profileId, $data->username, $data->firstName, $data->sex) }} </p> {{ $design->likeApi() }} {else} <p class="bold">{error}</p> {/if} </div>
<div class="center"> <h2 class="pink1">{desc_for_woman}</h2> <h2 class="pink2">{desc_for_man}</h2> <div class="s_bMarg"></div> {if empty($error)} {{ $avatarDesign->get($data->username, $data->firstName, $data->sex, 400) }} <div class="hon_click"> {{ RatingDesignCore::voting($data->profileId,DbTableName::MEMBER,'center') }} </div> <p class="s_tMarg"> <a class="bold btn btn-primary" rel="nofollow" href="{{ $design->url('hotornot', 'main', 'rating') }}">{lang 'SKIP'}</a><br /> <span class="italic small"> {lang}If the photo does not match your sexual preference please be respectful and press the SKIP button below.{/lang} </span> </p> <br /><hr /><br /> <p class="center"> {{ $design->like($data->username, $data->firstName, $data->sex, (new UserCore)->getProfileLink($data->username)) }} | {{ $design->report($data->profileId, $data->username, $data->firstName, $data->sex) }} </p> {{ $design->likeApi() }} {else} <p class="bold">{error}</p> {/if} </div>
Change SKIP HotOrNot's order with sentence + set string to smaller
Change SKIP HotOrNot's order with sentence + set string to smaller
Smarty
mit
pH7Software/pH7-Social-Dating-CMS,pH7Software/pH7-Social-Dating-CMS,pH7Software/pH7-Social-Dating-CMS,pH7Software/pH7-Social-Dating-CMS
smarty
## Code Before: <div class="center"> <h2 class="pink1">{desc_for_woman}</h2> <h2 class="pink2">{desc_for_man}</h2> <div class="s_bMarg"></div> {if empty($error)} {{ $avatarDesign->get($data->username, $data->firstName, $data->sex, 400) }} <div class="hon_click"> {{ RatingDesignCore::voting($data->profileId,DbTableName::MEMBER,'center') }} </div> <p class="italic s_tMarg"> {lang}If the photo does not match your sexual preference please be respectful and press the SKIP button below{/lang} </p> <p> <a class="bold btn btn-primary" rel="nofollow" href="{{ $design->url('hotornot', 'main', 'rating') }}">{lang 'SKIP'}</a> </p> <br /><hr /><br /> <p class="center"> {{ $design->like($data->username, $data->firstName, $data->sex, (new UserCore)->getProfileLink($data->username)) }} | {{ $design->report($data->profileId, $data->username, $data->firstName, $data->sex) }} </p> {{ $design->likeApi() }} {else} <p class="bold">{error}</p> {/if} </div> ## Instruction: Change SKIP HotOrNot's order with sentence + set string to smaller ## Code After: <div class="center"> <h2 class="pink1">{desc_for_woman}</h2> <h2 class="pink2">{desc_for_man}</h2> <div class="s_bMarg"></div> {if empty($error)} {{ $avatarDesign->get($data->username, $data->firstName, $data->sex, 400) }} <div class="hon_click"> {{ RatingDesignCore::voting($data->profileId,DbTableName::MEMBER,'center') }} </div> <p class="s_tMarg"> <a class="bold btn btn-primary" rel="nofollow" href="{{ $design->url('hotornot', 'main', 'rating') }}">{lang 'SKIP'}</a><br /> <span class="italic small"> {lang}If the photo does not match your sexual preference please be respectful and press the SKIP button below.{/lang} </span> </p> <br /><hr /><br /> <p class="center"> {{ $design->like($data->username, $data->firstName, $data->sex, (new UserCore)->getProfileLink($data->username)) }} | {{ $design->report($data->profileId, $data->username, $data->firstName, $data->sex) }} </p> {{ $design->likeApi() }} {else} <p class="bold">{error}</p> {/if} </div>
<div class="center"> <h2 class="pink1">{desc_for_woman}</h2> <h2 class="pink2">{desc_for_man}</h2> <div class="s_bMarg"></div> {if empty($error)} {{ $avatarDesign->get($data->username, $data->firstName, $data->sex, 400) }} <div class="hon_click"> {{ RatingDesignCore::voting($data->profileId,DbTableName::MEMBER,'center') }} </div> - <p class="italic s_tMarg"> ? ------- + <p class="s_tMarg"> + <a class="bold btn btn-primary" rel="nofollow" href="{{ $design->url('hotornot', 'main', 'rating') }}">{lang 'SKIP'}</a><br /> + <span class="italic small"> - {lang}If the photo does not match your sexual preference please be respectful and press the SKIP button below{/lang} + {lang}If the photo does not match your sexual preference please be respectful and press the SKIP button below.{/lang} ? ++++ + + </span> </p> + - <p> - <a class="bold btn btn-primary" rel="nofollow" href="{{ $design->url('hotornot', 'main', 'rating') }}">{lang 'SKIP'}</a> - </p> <br /><hr /><br /> <p class="center"> {{ $design->like($data->username, $data->firstName, $data->sex, (new UserCore)->getProfileLink($data->username)) }} | {{ $design->report($data->profileId, $data->username, $data->firstName, $data->sex) }} </p> {{ $design->likeApi() }} {else} <p class="bold">{error}</p> {/if} </div>
11
0.407407
6
5
e24791c4f8d120dca48ea069ecb8aa368cdc348a
database/migrations/20190514162951_add_seen_to_messages_table.php
database/migrations/20190514162951_add_seen_to_messages_table.php
<?php use Movim\Migration; use Illuminate\Database\Schema\Blueprint; use App\Message; class AddSeenToMessagesTable extends Migration { public function up() { $this->schema->table('messages', function (Blueprint $table) { $table->boolean('seen')->default(false); }); Message::query()->update(['seen' => true]); } public function down() { $this->schema->table('messages', function (Blueprint $table) { $table->dropColumn('seen'); }); } }
<?php use Movim\Migration; use Illuminate\Database\Schema\Blueprint; use App\Message; class AddSeenToMessagesTable extends Migration { public function up() { $this->schema->table('messages', function (Blueprint $table) { $table->boolean('seen')->default(true); }); $this->schema->table('messages', function (Blueprint $table) { $table->boolean('seen')->default(false)->change(); }); } public function down() { $this->schema->table('messages', function (Blueprint $table) { $table->dropColumn('seen'); }); } }
Fix the latest seen migration, use the default parameter to init the whole seen column to true
Fix the latest seen migration, use the default parameter to init the whole seen column to true
PHP
agpl-3.0
movim/movim,movim/movim,movim/movim,edhelas/movim,edhelas/movim,edhelas/movim,edhelas/movim
php
## Code Before: <?php use Movim\Migration; use Illuminate\Database\Schema\Blueprint; use App\Message; class AddSeenToMessagesTable extends Migration { public function up() { $this->schema->table('messages', function (Blueprint $table) { $table->boolean('seen')->default(false); }); Message::query()->update(['seen' => true]); } public function down() { $this->schema->table('messages', function (Blueprint $table) { $table->dropColumn('seen'); }); } } ## Instruction: Fix the latest seen migration, use the default parameter to init the whole seen column to true ## Code After: <?php use Movim\Migration; use Illuminate\Database\Schema\Blueprint; use App\Message; class AddSeenToMessagesTable extends Migration { public function up() { $this->schema->table('messages', function (Blueprint $table) { $table->boolean('seen')->default(true); }); $this->schema->table('messages', function (Blueprint $table) { $table->boolean('seen')->default(false)->change(); }); } public function down() { $this->schema->table('messages', function (Blueprint $table) { $table->dropColumn('seen'); }); } }
<?php use Movim\Migration; use Illuminate\Database\Schema\Blueprint; use App\Message; class AddSeenToMessagesTable extends Migration { public function up() { - $this->schema->table('messages', function (Blueprint $table) { ? - + $this->schema->table('messages', function (Blueprint $table) { - $table->boolean('seen')->default(false); ? ^^^^ + $table->boolean('seen')->default(true); ? ^^^ }); - Message::query()->update(['seen' => true]); + $this->schema->table('messages', function (Blueprint $table) { + $table->boolean('seen')->default(false)->change(); + }); } public function down() { $this->schema->table('messages', function (Blueprint $table) { $table->dropColumn('seen'); }); } }
8
0.32
5
3
42978336583ac1a82a1bb209e637b5a898c93128
package.json
package.json
{ "name": "ai-bot-workspace", "productName": "AI Bot Workspace", "version": "2.4.2", "description": "An Electron application which includes testing workspaces for most Riddles.io competitions.", "main": "src/app.js", "repository": "https://github.com/jmerle/ai-bot-workspace", "author": "Jasper van Merle <jaspervmerle@gmail.com>", "license": "MIT", "private": true, "scripts": { "start": "electron .", "pack": "electron-builder --dir", "dist": "electron-builder", "release": "electron-builder", "postinstall": "electron-builder install-app-deps" }, "build": { "appId": "com.jaspervanmerle.aibotworkspace", "asarUnpack": "**/*.jar", "mac": { "category": "public.app-category.developer-tools" }, "linux": { "target": "AppImage", "category": "Development" }, "appImage": { "systemIntegration": "doNotAsk" } }, "dependencies": { "electron-store": "^1.3.0", "electron-updater": "^2.20.1", "execa": "^0.9.0", "marked": "^0.3.17", "semver": "^5.5.0" }, "devDependencies": { "electron": "1.8.2", "electron-builder": "^20.2.0" } }
{ "name": "ai-bot-workspace", "productName": "AI Bot Workspace", "version": "2.4.2", "description": "An Electron application which includes testing workspaces for most Riddles.io competitions.", "main": "src/app.js", "repository": "https://github.com/jmerle/ai-bot-workspace", "author": "Jasper van Merle <jaspervmerle@gmail.com>", "license": "MIT", "private": true, "scripts": { "start": "electron .", "pack": "electron-builder --dir", "dist": "electron-builder", "release": "electron-builder", "postinstall": "electron-builder install-app-deps" }, "build": { "appId": "com.jaspervanmerle.aibotworkspace", "asarUnpack": "**/*.jar", "mac": { "category": "public.app-category.developer-tools" }, "linux": { "target": "AppImage", "category": "Development" } }, "dependencies": { "electron-store": "^1.3.0", "electron-updater": "^2.20.1", "execa": "^0.9.0", "marked": "^0.3.17", "semver": "^5.5.0" }, "devDependencies": { "electron": "1.8.4", "electron-builder": "^20.2.0" } }
Update Electron dependency and remove accidentally commited AppImage setting
Update Electron dependency and remove accidentally commited AppImage setting
JSON
mit
jmerle/ai-bot-workspace,jmerle/ai-bot-workspace
json
## Code Before: { "name": "ai-bot-workspace", "productName": "AI Bot Workspace", "version": "2.4.2", "description": "An Electron application which includes testing workspaces for most Riddles.io competitions.", "main": "src/app.js", "repository": "https://github.com/jmerle/ai-bot-workspace", "author": "Jasper van Merle <jaspervmerle@gmail.com>", "license": "MIT", "private": true, "scripts": { "start": "electron .", "pack": "electron-builder --dir", "dist": "electron-builder", "release": "electron-builder", "postinstall": "electron-builder install-app-deps" }, "build": { "appId": "com.jaspervanmerle.aibotworkspace", "asarUnpack": "**/*.jar", "mac": { "category": "public.app-category.developer-tools" }, "linux": { "target": "AppImage", "category": "Development" }, "appImage": { "systemIntegration": "doNotAsk" } }, "dependencies": { "electron-store": "^1.3.0", "electron-updater": "^2.20.1", "execa": "^0.9.0", "marked": "^0.3.17", "semver": "^5.5.0" }, "devDependencies": { "electron": "1.8.2", "electron-builder": "^20.2.0" } } ## Instruction: Update Electron dependency and remove accidentally commited AppImage setting ## Code After: { "name": "ai-bot-workspace", "productName": "AI Bot Workspace", "version": "2.4.2", "description": "An Electron application which includes testing workspaces for most Riddles.io competitions.", "main": "src/app.js", "repository": "https://github.com/jmerle/ai-bot-workspace", "author": "Jasper van Merle <jaspervmerle@gmail.com>", "license": "MIT", "private": true, "scripts": { "start": "electron .", "pack": "electron-builder --dir", "dist": "electron-builder", "release": "electron-builder", "postinstall": "electron-builder install-app-deps" }, "build": { "appId": "com.jaspervanmerle.aibotworkspace", "asarUnpack": "**/*.jar", "mac": { "category": "public.app-category.developer-tools" }, "linux": { "target": "AppImage", "category": "Development" } }, "dependencies": { "electron-store": "^1.3.0", "electron-updater": "^2.20.1", "execa": "^0.9.0", "marked": "^0.3.17", "semver": "^5.5.0" }, "devDependencies": { "electron": "1.8.4", "electron-builder": "^20.2.0" } }
{ "name": "ai-bot-workspace", "productName": "AI Bot Workspace", "version": "2.4.2", "description": "An Electron application which includes testing workspaces for most Riddles.io competitions.", "main": "src/app.js", "repository": "https://github.com/jmerle/ai-bot-workspace", "author": "Jasper van Merle <jaspervmerle@gmail.com>", "license": "MIT", "private": true, "scripts": { "start": "electron .", "pack": "electron-builder --dir", "dist": "electron-builder", "release": "electron-builder", "postinstall": "electron-builder install-app-deps" }, "build": { "appId": "com.jaspervanmerle.aibotworkspace", "asarUnpack": "**/*.jar", "mac": { "category": "public.app-category.developer-tools" }, "linux": { "target": "AppImage", "category": "Development" - }, - "appImage": { - "systemIntegration": "doNotAsk" } }, "dependencies": { "electron-store": "^1.3.0", "electron-updater": "^2.20.1", "execa": "^0.9.0", "marked": "^0.3.17", "semver": "^5.5.0" }, "devDependencies": { - "electron": "1.8.2", ? ^ + "electron": "1.8.4", ? ^ "electron-builder": "^20.2.0" } }
5
0.116279
1
4
737e057677f59bb08b55b3f9464252b3aa683c3e
docker-compose.yaml
docker-compose.yaml
version: '2.1' services: nominatim: image: bringnow/nominatim volumes: - ./volumes/importdata:/importdata environment: - PGHOST=postgis - PLANET_DATA_URL=${PLANET_DATA_URL:-http://download.geofabrik.de/europe/monaco-latest.osm.pbf} - OSM2PGSQL_CACHE=${OSM2PGSQL_CACHE:-14000} ports: - ${EXTERNAL_PORT:-127.0.0.1:8080}:80 postgis: image: mdillon/postgis:9.4 environment: - POSTGRES_DB=nominatim - POSTGRES_USER=nominatim - POSTGRES_PASSWORD=nominatim volumes: - nominatim-database:/var/lib/postgresql/data - ./postgis/set-auth.sh:/docker-entrypoint-initdb.d/set-auth.sh - ./postgis/skip-initdb-postgis.sh:/docker-entrypoint-initdb.d/postgis.sh - ./postgis/tune-postgres.sh:/docker-entrypoint-initdb.d/tune-postgres.sh volumes_from: - nominatim:ro volumes: nominatim-database:
version: '2.1' services: nominatim: image: bringnow/nominatim volumes: - ./volumes/importdata:/importdata - /app/module environment: - PGHOST=postgis - PLANET_DATA_URL=${PLANET_DATA_URL:-http://download.geofabrik.de/europe/monaco-latest.osm.pbf} - OSM2PGSQL_CACHE=${OSM2PGSQL_CACHE:-14000} ports: - ${EXTERNAL_PORT:-127.0.0.1:8080}:80 postgis: image: mdillon/postgis:9.4 environment: - POSTGRES_DB=nominatim - POSTGRES_USER=nominatim - POSTGRES_PASSWORD=nominatim volumes: - nominatim-database:/var/lib/postgresql/data - ./postgis/set-auth.sh:/docker-entrypoint-initdb.d/set-auth.sh - ./postgis/skip-initdb-postgis.sh:/docker-entrypoint-initdb.d/postgis.sh - ./postgis/tune-postgres.sh:/docker-entrypoint-initdb.d/tune-postgres.sh volumes_from: - nominatim:ro volumes: nominatim-database:
Add volume for /app/module explicetely
Add volume for /app/module explicetely
YAML
agpl-3.0
bringnow/docker-nominatim,bringnow/docker-nominatim
yaml
## Code Before: version: '2.1' services: nominatim: image: bringnow/nominatim volumes: - ./volumes/importdata:/importdata environment: - PGHOST=postgis - PLANET_DATA_URL=${PLANET_DATA_URL:-http://download.geofabrik.de/europe/monaco-latest.osm.pbf} - OSM2PGSQL_CACHE=${OSM2PGSQL_CACHE:-14000} ports: - ${EXTERNAL_PORT:-127.0.0.1:8080}:80 postgis: image: mdillon/postgis:9.4 environment: - POSTGRES_DB=nominatim - POSTGRES_USER=nominatim - POSTGRES_PASSWORD=nominatim volumes: - nominatim-database:/var/lib/postgresql/data - ./postgis/set-auth.sh:/docker-entrypoint-initdb.d/set-auth.sh - ./postgis/skip-initdb-postgis.sh:/docker-entrypoint-initdb.d/postgis.sh - ./postgis/tune-postgres.sh:/docker-entrypoint-initdb.d/tune-postgres.sh volumes_from: - nominatim:ro volumes: nominatim-database: ## Instruction: Add volume for /app/module explicetely ## Code After: version: '2.1' services: nominatim: image: bringnow/nominatim volumes: - ./volumes/importdata:/importdata - /app/module environment: - PGHOST=postgis - PLANET_DATA_URL=${PLANET_DATA_URL:-http://download.geofabrik.de/europe/monaco-latest.osm.pbf} - OSM2PGSQL_CACHE=${OSM2PGSQL_CACHE:-14000} ports: - ${EXTERNAL_PORT:-127.0.0.1:8080}:80 postgis: image: mdillon/postgis:9.4 environment: - POSTGRES_DB=nominatim - POSTGRES_USER=nominatim - POSTGRES_PASSWORD=nominatim volumes: - nominatim-database:/var/lib/postgresql/data - ./postgis/set-auth.sh:/docker-entrypoint-initdb.d/set-auth.sh - ./postgis/skip-initdb-postgis.sh:/docker-entrypoint-initdb.d/postgis.sh - ./postgis/tune-postgres.sh:/docker-entrypoint-initdb.d/tune-postgres.sh volumes_from: - nominatim:ro volumes: nominatim-database:
version: '2.1' services: nominatim: image: bringnow/nominatim volumes: - ./volumes/importdata:/importdata + - /app/module environment: - PGHOST=postgis - PLANET_DATA_URL=${PLANET_DATA_URL:-http://download.geofabrik.de/europe/monaco-latest.osm.pbf} - OSM2PGSQL_CACHE=${OSM2PGSQL_CACHE:-14000} ports: - ${EXTERNAL_PORT:-127.0.0.1:8080}:80 postgis: image: mdillon/postgis:9.4 environment: - POSTGRES_DB=nominatim - POSTGRES_USER=nominatim - POSTGRES_PASSWORD=nominatim volumes: - nominatim-database:/var/lib/postgresql/data - ./postgis/set-auth.sh:/docker-entrypoint-initdb.d/set-auth.sh - ./postgis/skip-initdb-postgis.sh:/docker-entrypoint-initdb.d/postgis.sh - ./postgis/tune-postgres.sh:/docker-entrypoint-initdb.d/tune-postgres.sh volumes_from: - nominatim:ro volumes: nominatim-database:
1
0.037037
1
0
3c9115aa017acc1d22a24a76990d8bd2ed361bd7
src/MakingSense.AspNet.HypermediaApi.Seed/project.json
src/MakingSense.AspNet.HypermediaApi.Seed/project.json
{ "webroot": "wwwroot", "version": "1.0.0-*", "dependencies": { "Microsoft.AspNet.Server.IIS": "1.0.0-beta7", "Microsoft.AspNet.Server.WebListener": "1.0.0-beta7", "MakingSense.AspNet.Authentication.SimpleToken": "0.1.0-beta7-4", "MakingSense.AspNet.Documentation": "0.1.0-beta7-5", "MakingSense.AspNet.HypermediaApi": "0.1.0-beta7-6" }, "commands": { "web": "Microsoft.AspNet.Hosting --config hosting.ini" }, "frameworks": { "dnx451": { }, "dnxcore50": { } }, "publishExclude": [ "node_modules", "bower_components", "**.xproj", "**.user", "**.vspscc" ], "exclude": [ "wwwroot", "node_modules", "bower_components" ] }
{ "webroot": "wwwroot", "version": "1.0.0-*", "dependencies": { "Microsoft.AspNet.Server.IIS": "1.0.0-beta7", "Microsoft.AspNet.Server.Kestrel": "1.0.0-beta7", "Microsoft.AspNet.Server.WebListener": "1.0.0-beta7", "MakingSense.AspNet.Authentication.SimpleToken": "0.1.0-beta7-4", "MakingSense.AspNet.Documentation": "0.1.0-beta7-5", "MakingSense.AspNet.HypermediaApi": "0.1.0-beta7-6" }, "commands": { "web": "Microsoft.AspNet.Hosting --config hosting.ini", "kestrel": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --config hosting.ini" }, "frameworks": { "dnx451": { }, "dnxcore50": { } }, "publishExclude": [ "node_modules", "bower_components", "**.xproj", "**.user", "**.vspscc" ], "exclude": [ "wwwroot", "node_modules", "bower_components" ] }
Add Kestrel dependecies and command to allow to run it on Linux and Mac
Add Kestrel dependecies and command to allow to run it on Linux and Mac
JSON
mit
MakingSense/aspnet-hypermedia-api-seed,MakingSense/aspnet-hypermedia-api-seed
json
## Code Before: { "webroot": "wwwroot", "version": "1.0.0-*", "dependencies": { "Microsoft.AspNet.Server.IIS": "1.0.0-beta7", "Microsoft.AspNet.Server.WebListener": "1.0.0-beta7", "MakingSense.AspNet.Authentication.SimpleToken": "0.1.0-beta7-4", "MakingSense.AspNet.Documentation": "0.1.0-beta7-5", "MakingSense.AspNet.HypermediaApi": "0.1.0-beta7-6" }, "commands": { "web": "Microsoft.AspNet.Hosting --config hosting.ini" }, "frameworks": { "dnx451": { }, "dnxcore50": { } }, "publishExclude": [ "node_modules", "bower_components", "**.xproj", "**.user", "**.vspscc" ], "exclude": [ "wwwroot", "node_modules", "bower_components" ] } ## Instruction: Add Kestrel dependecies and command to allow to run it on Linux and Mac ## Code After: { "webroot": "wwwroot", "version": "1.0.0-*", "dependencies": { "Microsoft.AspNet.Server.IIS": "1.0.0-beta7", "Microsoft.AspNet.Server.Kestrel": "1.0.0-beta7", "Microsoft.AspNet.Server.WebListener": "1.0.0-beta7", "MakingSense.AspNet.Authentication.SimpleToken": "0.1.0-beta7-4", "MakingSense.AspNet.Documentation": "0.1.0-beta7-5", "MakingSense.AspNet.HypermediaApi": "0.1.0-beta7-6" }, "commands": { "web": "Microsoft.AspNet.Hosting --config hosting.ini", "kestrel": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --config hosting.ini" }, "frameworks": { "dnx451": { }, "dnxcore50": { } }, "publishExclude": [ "node_modules", "bower_components", "**.xproj", "**.user", "**.vspscc" ], "exclude": [ "wwwroot", "node_modules", "bower_components" ] }
{ "webroot": "wwwroot", "version": "1.0.0-*", "dependencies": { "Microsoft.AspNet.Server.IIS": "1.0.0-beta7", + "Microsoft.AspNet.Server.Kestrel": "1.0.0-beta7", "Microsoft.AspNet.Server.WebListener": "1.0.0-beta7", "MakingSense.AspNet.Authentication.SimpleToken": "0.1.0-beta7-4", "MakingSense.AspNet.Documentation": "0.1.0-beta7-5", "MakingSense.AspNet.HypermediaApi": "0.1.0-beta7-6" }, "commands": { - "web": "Microsoft.AspNet.Hosting --config hosting.ini" + "web": "Microsoft.AspNet.Hosting --config hosting.ini", ? + + "kestrel": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --config hosting.ini" }, "frameworks": { "dnx451": { }, "dnxcore50": { } }, "publishExclude": [ "node_modules", "bower_components", "**.xproj", "**.user", "**.vspscc" ], "exclude": [ "wwwroot", "node_modules", "bower_components" ] }
4
0.117647
3
1
7ba75cf5d2fa1425489e99783b4d0dfb5cbe1765
vim/buildvim.sh
vim/buildvim.sh
set -e if [ $(uname) == "Linux" ]; then sudo apt-get install xorg-dev # for x, for clipboard fi mkdir -p ~/build cd ~/build if [ ! -d vim ]; then git clone https://github.com/vim/vim.git fi cd vim make distclean #find the feature list in vim with :h feature-list ./configure \ --with-features=huge \ --enable-multibyte \ --with-x \ --enable-python3interp \ --with-python3-config-dir=/usr/lib/python3.5/config \ --enable-luainterp make sudo make install
set -e if [ $(uname) == "Linux" ]; then sudo apt-get install xorg-dev # for x, for clipboard sudo apt-get install python3-dev fi mkdir -p ~/build cd ~/build if [ ! -d vim ]; then git clone https://github.com/vim/vim.git fi cd vim make distclean #find the feature list in vim with :h feature-list ./configure \ --with-features=huge \ --enable-multibyte \ --with-x \ --enable-python3interp \ --with-python3-config-dir=/usr/lib/python3.5/config \ --enable-luainterp make sudo make install
Install python3 during vim build script
Install python3 during vim build script
Shell
mit
jargv/dotfiles,jargv/dotfiles,jargv/dotfiles
shell
## Code Before: set -e if [ $(uname) == "Linux" ]; then sudo apt-get install xorg-dev # for x, for clipboard fi mkdir -p ~/build cd ~/build if [ ! -d vim ]; then git clone https://github.com/vim/vim.git fi cd vim make distclean #find the feature list in vim with :h feature-list ./configure \ --with-features=huge \ --enable-multibyte \ --with-x \ --enable-python3interp \ --with-python3-config-dir=/usr/lib/python3.5/config \ --enable-luainterp make sudo make install ## Instruction: Install python3 during vim build script ## Code After: set -e if [ $(uname) == "Linux" ]; then sudo apt-get install xorg-dev # for x, for clipboard sudo apt-get install python3-dev fi mkdir -p ~/build cd ~/build if [ ! -d vim ]; then git clone https://github.com/vim/vim.git fi cd vim make distclean #find the feature list in vim with :h feature-list ./configure \ --with-features=huge \ --enable-multibyte \ --with-x \ --enable-python3interp \ --with-python3-config-dir=/usr/lib/python3.5/config \ --enable-luainterp make sudo make install
set -e if [ $(uname) == "Linux" ]; then sudo apt-get install xorg-dev # for x, for clipboard + sudo apt-get install python3-dev fi mkdir -p ~/build cd ~/build if [ ! -d vim ]; then git clone https://github.com/vim/vim.git fi cd vim make distclean #find the feature list in vim with :h feature-list ./configure \ --with-features=huge \ --enable-multibyte \ --with-x \ --enable-python3interp \ --with-python3-config-dir=/usr/lib/python3.5/config \ --enable-luainterp make sudo make install
1
0.038462
1
0
9cf06274df44b4291b222fd3555d67c2d39be928
Resources/views/data/view/text.txt.twig
Resources/views/data/view/text.txt.twig
{%- macro text(view, inline = true) -%} {%- if view.hasTitle -%} {{- view.title ~ ': ' -}} {%- endif -%} {%- if view.empty -%} - {%- else -%} {%- if view.hasChildren -%} {%- if inline -%} {%- for child in view.children %} {{- _self.text(child) -}} {%- if not loop.last -%} {{- ', ' -}} {%- endif -%} {%- endfor -%} {%- else -%} {%- for child in view.children %} {{ _self.text(child) -}} {%- endfor -%} {%- endif -%} {%- endif -%} {%- if view.hasValue -%} {{- view.value|striptags -}} {%- endif -%} {%- endif -%} {%- endmacro -%} {%- if view -%} {{- _self.text(view, false) -}} {%- endif -%}
{%- macro text(view, level = 0) -%} {%- if view.hasTitle -%} {{- view.title ~ ': ' -}} {%- endif -%} {%- if view.empty -%} - {%- else -%} {%- if view.hasChildren -%} {%- for child in view.children %} {% if level > 0 %}{% for i in 1..level %}{{ ' ' }}{% endfor %}{% endif %}{{ _self.text(child, level + 1) -}} {%- endfor -%} {%- endif -%} {%- if view.hasValue -%} {{- view.value|striptags -}} {%- endif -%} {%- endif -%} {%- endmacro -%} {%- if view -%} {{- _self.text(view) -}} {%- endif -%}
Add intentations to data text template.
Add intentations to data text template.
Twig
mit
DarvinStudio/darvin-utils
twig
## Code Before: {%- macro text(view, inline = true) -%} {%- if view.hasTitle -%} {{- view.title ~ ': ' -}} {%- endif -%} {%- if view.empty -%} - {%- else -%} {%- if view.hasChildren -%} {%- if inline -%} {%- for child in view.children %} {{- _self.text(child) -}} {%- if not loop.last -%} {{- ', ' -}} {%- endif -%} {%- endfor -%} {%- else -%} {%- for child in view.children %} {{ _self.text(child) -}} {%- endfor -%} {%- endif -%} {%- endif -%} {%- if view.hasValue -%} {{- view.value|striptags -}} {%- endif -%} {%- endif -%} {%- endmacro -%} {%- if view -%} {{- _self.text(view, false) -}} {%- endif -%} ## Instruction: Add intentations to data text template. ## Code After: {%- macro text(view, level = 0) -%} {%- if view.hasTitle -%} {{- view.title ~ ': ' -}} {%- endif -%} {%- if view.empty -%} - {%- else -%} {%- if view.hasChildren -%} {%- for child in view.children %} {% if level > 0 %}{% for i in 1..level %}{{ ' ' }}{% endfor %}{% endif %}{{ _self.text(child, level + 1) -}} {%- endfor -%} {%- endif -%} {%- if view.hasValue -%} {{- view.value|striptags -}} {%- endif -%} {%- endif -%} {%- endmacro -%} {%- if view -%} {{- _self.text(view) -}} {%- endif -%}
- {%- macro text(view, inline = true) -%} ? -- -- ^^^^ + {%- macro text(view, level = 0) -%} ? +++ ^ {%- if view.hasTitle -%} {{- view.title ~ ': ' -}} {%- endif -%} {%- if view.empty -%} - {%- else -%} {%- if view.hasChildren -%} - {%- if inline -%} + {%- for child in view.children %} - {%- for child in view.children %} + {% if level > 0 %}{% for i in 1..level %}{{ ' ' }}{% endfor %}{% endif %}{{ _self.text(child, level + 1) -}} - {{- _self.text(child) -}} - - {%- if not loop.last -%} - {{- ', ' -}} - {%- endif -%} - - {%- endfor -%} - - {%- else -%} - - {%- for child in view.children %} - - {{ _self.text(child) -}} - - {%- endfor -%} - - {%- endif -%} ? - + {%- endfor -%} ? ++ {%- endif -%} {%- if view.hasValue -%} {{- view.value|striptags -}} {%- endif -%} {%- endif -%} {%- endmacro -%} {%- if view -%} - {{- _self.text(view, false) -}} ? ------- + {{- _self.text(view) -}} {%- endif -%}
26
0.530612
5
21
410ef1b256e5088e77045ac5a3df1549ffbe7c01
features/support/remote_command_helpers.rb
features/support/remote_command_helpers.rb
module RemoteCommandHelpers def test_dir_exists(path) exists?("d", path) end def test_symlink_exists(path) exists?("L", path) end def test_file_exists(path) exists?("f", path) end def exists?(type, path) %Q{[ -#{type} "#{path}" ]} end def safely_remove_file(_path) run_vagrant_command("rm #{test_file}") rescue VagrantHelpers::VagrantSSHCommandError nil end end World(RemoteCommandHelpers)
module RemoteCommandHelpers def test_dir_exists(path) exists?("d", path) end def test_symlink_exists(path) exists?("L", path) end def test_file_exists(path) exists?("f", path) end def exists?(type, path) %Q{[ -#{type} "#{path}" ]} end def safely_remove_file(_path) run_vagrant_command("rm #{test_file}") rescue VagrantHelpers::VagrantSSHCommandError end end World(RemoteCommandHelpers)
Revert issue introduced by misunderstanding of rescue modifier
Revert issue introduced by misunderstanding of rescue modifier
Ruby
mit
jdelStrother/capistrano,kylerippey/capistrano,harrykiselev/capistrano,maliqq/capistrano,maliqq/capistrano,capistrano/capistrano,ngpestelos/capistrano,jdelStrother/capistrano,capistrano/capistrano,ngpestelos/capistrano,harrykiselev/capistrano,kylerippey/capistrano
ruby
## Code Before: module RemoteCommandHelpers def test_dir_exists(path) exists?("d", path) end def test_symlink_exists(path) exists?("L", path) end def test_file_exists(path) exists?("f", path) end def exists?(type, path) %Q{[ -#{type} "#{path}" ]} end def safely_remove_file(_path) run_vagrant_command("rm #{test_file}") rescue VagrantHelpers::VagrantSSHCommandError nil end end World(RemoteCommandHelpers) ## Instruction: Revert issue introduced by misunderstanding of rescue modifier ## Code After: module RemoteCommandHelpers def test_dir_exists(path) exists?("d", path) end def test_symlink_exists(path) exists?("L", path) end def test_file_exists(path) exists?("f", path) end def exists?(type, path) %Q{[ -#{type} "#{path}" ]} end def safely_remove_file(_path) run_vagrant_command("rm #{test_file}") rescue VagrantHelpers::VagrantSSHCommandError end end World(RemoteCommandHelpers)
module RemoteCommandHelpers def test_dir_exists(path) exists?("d", path) end def test_symlink_exists(path) exists?("L", path) end def test_file_exists(path) exists?("f", path) end def exists?(type, path) %Q{[ -#{type} "#{path}" ]} end def safely_remove_file(_path) run_vagrant_command("rm #{test_file}") + rescue - rescue VagrantHelpers::VagrantSSHCommandError ? ^^^^^^ + VagrantHelpers::VagrantSSHCommandError ? ^ - nil end end World(RemoteCommandHelpers)
4
0.16
2
2
5e7cbe717bc79cce1cec0fb9e9a9dfbcdcd1179a
src/main/webapp/resources/js/app.js
src/main/webapp/resources/js/app.js
/* jslint node: true, browser: true */ /* global angular: true */ 'use strict'; // Declare app level module which depends on views, and components var olyMod = angular.module('mcWebRTC', [ 'ngRoute', 'ngResource', 'ngAnimate', //'ui.bootstrap.dropdown', 'mgcrea.ngStrap.tooltip', 'mgcrea.ngStrap.popover', 'mgcrea.ngStrap.dropdown', 'mgcrea.ngStrap.alert', 'webcam', 'angularMoment', 'ngEmoticons', 'FBAngular', 'mcWebRTC.filters', 'mcWebRTC.services', 'mcWebRTC.directives', 'mcWebRTC.controllers' ]); olyMod.config(['$routeProvider', /*'$locationProvider',*/ function($routeProvider, $locationProvider) { $routeProvider. when('/', {templateUrl: 'modules/sign-in.html', controller: 'SignInCtrl'}). when('/room', {templateUrl: 'modules/room.html', controller: 'RoomCtrl'}). when('/home', {templateUrl: 'modules/home.html', controller: 'HomeCtrl'}). otherwise({redirectTo: '/'}); // $locationProvider.html5Mode(true); }]);
/* jslint node: true, browser: true */ /* global angular: true */ 'use strict'; // Declare app level module which depends on views, and components var olyMod = angular.module('mcWebRTC', [ 'ngRoute', 'ngResource', 'ngAnimate', //'ui.bootstrap.dropdown', 'mgcrea.ngStrap.tooltip', 'mgcrea.ngStrap.popover', 'mgcrea.ngStrap.dropdown', 'mgcrea.ngStrap.alert', 'webcam', 'angularMoment', 'ngEmoticons', 'FBAngular', 'mcWebRTC.filters', 'mcWebRTC.services', 'mcWebRTC.directives', 'mcWebRTC.controllers' ]); olyMod.config(['$routeProvider', /*'$locationProvider',*/ function($routeProvider, $locationProvider) { $routeProvider. when('/', {templateUrl: 'modules/sign-in.html', controller: 'SignInCtrl'}). when('/home', {templateUrl: 'modules/home.html', controller: 'HomeCtrl'}). // when('/room', {templateUrl: 'modules/room.html', controller: 'RoomCtrl'}). otherwise({redirectTo: '/'}); // $locationProvider.html5Mode(true); }]);
Disable old URL for /room
Disable old URL for /room
JavaScript
agpl-3.0
Mobicents/olympus,RestComm/olympus,RestComm/olympus,RestComm/olympus,RestComm/olympus,Mobicents/olympus,Mobicents/olympus
javascript
## Code Before: /* jslint node: true, browser: true */ /* global angular: true */ 'use strict'; // Declare app level module which depends on views, and components var olyMod = angular.module('mcWebRTC', [ 'ngRoute', 'ngResource', 'ngAnimate', //'ui.bootstrap.dropdown', 'mgcrea.ngStrap.tooltip', 'mgcrea.ngStrap.popover', 'mgcrea.ngStrap.dropdown', 'mgcrea.ngStrap.alert', 'webcam', 'angularMoment', 'ngEmoticons', 'FBAngular', 'mcWebRTC.filters', 'mcWebRTC.services', 'mcWebRTC.directives', 'mcWebRTC.controllers' ]); olyMod.config(['$routeProvider', /*'$locationProvider',*/ function($routeProvider, $locationProvider) { $routeProvider. when('/', {templateUrl: 'modules/sign-in.html', controller: 'SignInCtrl'}). when('/room', {templateUrl: 'modules/room.html', controller: 'RoomCtrl'}). when('/home', {templateUrl: 'modules/home.html', controller: 'HomeCtrl'}). otherwise({redirectTo: '/'}); // $locationProvider.html5Mode(true); }]); ## Instruction: Disable old URL for /room ## Code After: /* jslint node: true, browser: true */ /* global angular: true */ 'use strict'; // Declare app level module which depends on views, and components var olyMod = angular.module('mcWebRTC', [ 'ngRoute', 'ngResource', 'ngAnimate', //'ui.bootstrap.dropdown', 'mgcrea.ngStrap.tooltip', 'mgcrea.ngStrap.popover', 'mgcrea.ngStrap.dropdown', 'mgcrea.ngStrap.alert', 'webcam', 'angularMoment', 'ngEmoticons', 'FBAngular', 'mcWebRTC.filters', 'mcWebRTC.services', 'mcWebRTC.directives', 'mcWebRTC.controllers' ]); olyMod.config(['$routeProvider', /*'$locationProvider',*/ function($routeProvider, $locationProvider) { $routeProvider. when('/', {templateUrl: 'modules/sign-in.html', controller: 'SignInCtrl'}). when('/home', {templateUrl: 'modules/home.html', controller: 'HomeCtrl'}). // when('/room', {templateUrl: 'modules/room.html', controller: 'RoomCtrl'}). otherwise({redirectTo: '/'}); // $locationProvider.html5Mode(true); }]);
/* jslint node: true, browser: true */ /* global angular: true */ 'use strict'; // Declare app level module which depends on views, and components var olyMod = angular.module('mcWebRTC', [ 'ngRoute', 'ngResource', 'ngAnimate', //'ui.bootstrap.dropdown', 'mgcrea.ngStrap.tooltip', 'mgcrea.ngStrap.popover', 'mgcrea.ngStrap.dropdown', 'mgcrea.ngStrap.alert', 'webcam', 'angularMoment', 'ngEmoticons', 'FBAngular', 'mcWebRTC.filters', 'mcWebRTC.services', 'mcWebRTC.directives', 'mcWebRTC.controllers' ]); olyMod.config(['$routeProvider', /*'$locationProvider',*/ function($routeProvider, $locationProvider) { $routeProvider. when('/', {templateUrl: 'modules/sign-in.html', controller: 'SignInCtrl'}). - when('/room', {templateUrl: 'modules/room.html', controller: 'RoomCtrl'}). when('/home', {templateUrl: 'modules/home.html', controller: 'HomeCtrl'}). + // when('/room', {templateUrl: 'modules/room.html', controller: 'RoomCtrl'}). otherwise({redirectTo: '/'}); // $locationProvider.html5Mode(true); }]);
2
0.060606
1
1
8ba1c2e336cce5b0e37d0b46e413301f55dcbbf3
src/System.php
src/System.php
<?php declare(strict_types=1); namespace RoundingWell\Schematic; /** * @codeCoverageIgnore */ class System { public function writeFile(string $file, string $contents): int { return (int) file_put_contents($file, $contents); } }
<?php declare(strict_types=1); namespace RoundingWell\Schematic; /** * @codeCoverageIgnore */ class System { public function writeFile(string $file, string $contents): int { $directory = pathinfo($file, PATHINFO_DIRNAME); if (!file_exists($directory)) { mkdir($directory, 0755, true); } return (int) file_put_contents($file, $contents); } }
Create missing directories when writing files
Create missing directories when writing files Ensure that the directory exists before writing to it.
PHP
apache-2.0
RoundingWellOS/schematic
php
## Code Before: <?php declare(strict_types=1); namespace RoundingWell\Schematic; /** * @codeCoverageIgnore */ class System { public function writeFile(string $file, string $contents): int { return (int) file_put_contents($file, $contents); } } ## Instruction: Create missing directories when writing files Ensure that the directory exists before writing to it. ## Code After: <?php declare(strict_types=1); namespace RoundingWell\Schematic; /** * @codeCoverageIgnore */ class System { public function writeFile(string $file, string $contents): int { $directory = pathinfo($file, PATHINFO_DIRNAME); if (!file_exists($directory)) { mkdir($directory, 0755, true); } return (int) file_put_contents($file, $contents); } }
<?php declare(strict_types=1); namespace RoundingWell\Schematic; /** * @codeCoverageIgnore */ class System { public function writeFile(string $file, string $contents): int { + $directory = pathinfo($file, PATHINFO_DIRNAME); + + if (!file_exists($directory)) { + mkdir($directory, 0755, true); + } + return (int) file_put_contents($file, $contents); } }
6
0.4
6
0
4e9bd5cb6b9e2df88eda42ba8289cf091e58e1cd
app/views/layouts/application.html.haml
app/views/layouts/application.html.haml
!!! 5 %html %head %title= "Hydra Attribute v#{HydraAttribute::VERSION}" = stylesheet_link_tag 'application', media: 'all' = javascript_include_tag 'application' = csrf_meta_tags %body .container .row= render 'navbar' .row= render 'flash_messages' .row= yield
!!! 5 %html %head %title= "Hydra Attribute v#{HydraAttribute::VERSION}" = stylesheet_link_tag 'application', media: 'all' = javascript_include_tag 'application' = csrf_meta_tags %body %a{href: 'https://github.com/kostyantyn/hydra_attribute-demo'} %img{style: 'position: absolute; top: 0; right: 0; border: 0; z-index:1;', src: 'https://github-camo.global.ssl.fastly.net/e7bbb0521b397edbd5fe43e7f760759336b5e05f/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677265656e5f3030373230302e706e67', alt: 'Fork me on GitHub', 'data-canonical-src' => 'https://s3.amazonaws.com/github/ribbons/forkme_right_green_007200.png'} .container .row= render 'navbar' .row= render 'flash_messages' .row= yield
Add Fork Me on Github badge
Add Fork Me on Github badge
Haml
mit
kostyantyn/hydra_attribute-demo,kostyantyn/hydra_attribute-demo
haml
## Code Before: !!! 5 %html %head %title= "Hydra Attribute v#{HydraAttribute::VERSION}" = stylesheet_link_tag 'application', media: 'all' = javascript_include_tag 'application' = csrf_meta_tags %body .container .row= render 'navbar' .row= render 'flash_messages' .row= yield ## Instruction: Add Fork Me on Github badge ## Code After: !!! 5 %html %head %title= "Hydra Attribute v#{HydraAttribute::VERSION}" = stylesheet_link_tag 'application', media: 'all' = javascript_include_tag 'application' = csrf_meta_tags %body %a{href: 'https://github.com/kostyantyn/hydra_attribute-demo'} %img{style: 'position: absolute; top: 0; right: 0; border: 0; z-index:1;', src: 'https://github-camo.global.ssl.fastly.net/e7bbb0521b397edbd5fe43e7f760759336b5e05f/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677265656e5f3030373230302e706e67', alt: 'Fork me on GitHub', 'data-canonical-src' => 'https://s3.amazonaws.com/github/ribbons/forkme_right_green_007200.png'} .container .row= render 'navbar' .row= render 'flash_messages' .row= yield
!!! 5 %html %head %title= "Hydra Attribute v#{HydraAttribute::VERSION}" = stylesheet_link_tag 'application', media: 'all' = javascript_include_tag 'application' = csrf_meta_tags %body + %a{href: 'https://github.com/kostyantyn/hydra_attribute-demo'} + %img{style: 'position: absolute; top: 0; right: 0; border: 0; z-index:1;', src: 'https://github-camo.global.ssl.fastly.net/e7bbb0521b397edbd5fe43e7f760759336b5e05f/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677265656e5f3030373230302e706e67', alt: 'Fork me on GitHub', 'data-canonical-src' => 'https://s3.amazonaws.com/github/ribbons/forkme_right_green_007200.png'} + .container .row= render 'navbar' .row= render 'flash_messages' .row= yield
3
0.230769
3
0
42674c2c40b3105c805da620ebf426594bd304b3
docs/upgrade/3.1.rst
docs/upgrade/3.1.rst
.. _upgrade-to-3.1: ################# 3.1 release notes ################# ***************** What's new in 3.1 ***************** Switch from MPTT to MP ====================== Since django CMS 2.0 we relied on MPTT (Modified Preorder Tree Traversal) for efficiently handling tree structures in the DB. Over the years it proved that MPTT was not fast enough for big tree operations (>1000 pages) and regularly the tree got corrupted because of transactional errors. In 3.1 we replaced MPTT for MP (Materialized Path). MP is more efficient and has more error resistance then MPTT. It should make the whole django CMS experience way better, faster and reliable. Bofore upgrading ---------------- Be sure to run ``manage.py cms fix-mptt`` before you upgrade. ******************** Incompatible changes ********************
.. _upgrade-to-3.1: ################# 3.1 release notes ################# ***************** What's new in 3.1 ***************** Switch from MPTT to MP ====================== Since django CMS 2.0 we relied on MPTT (Modified Preorder Tree Traversal) for efficiently handling tree structures in the DB. Over the years it proved that MPTT was not fast enough for big tree operations (>1000 pages) and regularly the tree got corrupted because of transactional errors. In 3.1 we replaced MPTT for MP (Materialized Path). MP is more efficient and has more error resistance then MPTT. It should make the whole django CMS experience way better, faster and reliable. Bofore upgrading ---------------- Be sure to run ``manage.py cms fix-mptt`` before you upgrade. Dropped support for Django 1.4 and 1.5 ====================================== Starting from version 3.1 the supported Django versions are 1.6 and 1.7 ******************** Incompatible changes ********************
Add dropped support to release notes
Add dropped support to release notes
reStructuredText
bsd-3-clause
datakortet/django-cms,sephii/django-cms,webu/django-cms,AlexProfi/django-cms,Livefyre/django-cms,SachaMPS/django-cms,takeshineshiro/django-cms,mkoistinen/django-cms,czpython/django-cms,irudayarajisawa/django-cms,philippze/django-cms,andyzsf/django-cms,iddqd1/django-cms,netzkolchose/django-cms,intip/django-cms,leture/django-cms,liuyisiyisi/django-cms,mkoistinen/django-cms,vxsx/django-cms,sephii/django-cms,DylannCordel/django-cms,robmagee/django-cms,jproffitt/django-cms,timgraham/django-cms,keimlink/django-cms,FinalAngel/django-cms,SofiaReis/django-cms,memnonila/django-cms,benzkji/django-cms,chmberl/django-cms,jsma/django-cms,AlexProfi/django-cms,takeshineshiro/django-cms,jproffitt/django-cms,czpython/django-cms,wyg3958/django-cms,Jaccorot/django-cms,andyzsf/django-cms,chkir/django-cms,liuyisiyisi/django-cms,nimbis/django-cms,vxsx/django-cms,qnub/django-cms,bittner/django-cms,rsalmaso/django-cms,divio/django-cms,yakky/django-cms,jeffreylu9/django-cms,owers19856/django-cms,qnub/django-cms,saintbird/django-cms,Vegasvikk/django-cms,mkoistinen/django-cms,FinalAngel/django-cms,astagi/django-cms,dhorelik/django-cms,intip/django-cms,andyzsf/django-cms,saintbird/django-cms,irudayarajisawa/django-cms,iddqd1/django-cms,SmithsonianEnterprises/django-cms,wyg3958/django-cms,dhorelik/django-cms,rryan/django-cms,evildmp/django-cms,frnhr/django-cms,astagi/django-cms,DylannCordel/django-cms,vad/django-cms,bittner/django-cms,czpython/django-cms,stefanfoulis/django-cms,nimbis/django-cms,bittner/django-cms,kk9599/django-cms,memnonila/django-cms,vad/django-cms,evildmp/django-cms,rsalmaso/django-cms,datakortet/django-cms,rsalmaso/django-cms,benzkji/django-cms,evildmp/django-cms,FinalAngel/django-cms,donce/django-cms,intip/django-cms,donce/django-cms,benzkji/django-cms,kk9599/django-cms,stefanfoulis/django-cms,josjevv/django-cms,jrclaramunt/django-cms,robmagee/django-cms,rryan/django-cms,jproffitt/django-cms,stefanfoulis/django-cms,divio/django-cms,farhaadila/django-cms,wuzhihui1123/django-cms,yakky/django-cms,SachaMPS/django-cms,Jaccorot/django-cms,Vegasvikk/django-cms,divio/django-cms,webu/django-cms,intip/django-cms,jrclaramunt/django-cms,wuzhihui1123/django-cms,jproffitt/django-cms,owers19856/django-cms,SofiaReis/django-cms,FinalAngel/django-cms,keimlink/django-cms,andyzsf/django-cms,youprofit/django-cms,wuzhihui1123/django-cms,sznekol/django-cms,jsma/django-cms,rryan/django-cms,frnhr/django-cms,cyberintruder/django-cms,chmberl/django-cms,rscnt/django-cms,netzkolchose/django-cms,jrclaramunt/django-cms,dhorelik/django-cms,stefanw/django-cms,kk9599/django-cms,irudayarajisawa/django-cms,SmithsonianEnterprises/django-cms,rryan/django-cms,netzkolchose/django-cms,Livefyre/django-cms,SofiaReis/django-cms,vad/django-cms,saintbird/django-cms,benzkji/django-cms,chkir/django-cms,farhaadila/django-cms,vad/django-cms,Livefyre/django-cms,vxsx/django-cms,Livefyre/django-cms,sephii/django-cms,divio/django-cms,astagi/django-cms,DylannCordel/django-cms,chkir/django-cms,Jaccorot/django-cms,Vegasvikk/django-cms,mkoistinen/django-cms,owers19856/django-cms,memnonila/django-cms,datakortet/django-cms,evildmp/django-cms,leture/django-cms,petecummings/django-cms,keimlink/django-cms,jsma/django-cms,stefanw/django-cms,jeffreylu9/django-cms,petecummings/django-cms,SachaMPS/django-cms,philippze/django-cms,robmagee/django-cms,jsma/django-cms,donce/django-cms,yakky/django-cms,leture/django-cms,nimbis/django-cms,frnhr/django-cms,rsalmaso/django-cms,czpython/django-cms,vxsx/django-cms,netzkolchose/django-cms,timgraham/django-cms,wuzhihui1123/django-cms,bittner/django-cms,petecummings/django-cms,takeshineshiro/django-cms,qnub/django-cms,stefanw/django-cms,wyg3958/django-cms,yakky/django-cms,cyberintruder/django-cms,SmithsonianEnterprises/django-cms,philippze/django-cms,josjevv/django-cms,farhaadila/django-cms,webu/django-cms,youprofit/django-cms,sznekol/django-cms,jeffreylu9/django-cms,jeffreylu9/django-cms,iddqd1/django-cms,AlexProfi/django-cms,datakortet/django-cms,rscnt/django-cms,timgraham/django-cms,josjevv/django-cms,stefanw/django-cms,stefanfoulis/django-cms,chmberl/django-cms,sephii/django-cms,youprofit/django-cms,frnhr/django-cms,liuyisiyisi/django-cms,nimbis/django-cms,rscnt/django-cms,cyberintruder/django-cms,sznekol/django-cms
restructuredtext
## Code Before: .. _upgrade-to-3.1: ################# 3.1 release notes ################# ***************** What's new in 3.1 ***************** Switch from MPTT to MP ====================== Since django CMS 2.0 we relied on MPTT (Modified Preorder Tree Traversal) for efficiently handling tree structures in the DB. Over the years it proved that MPTT was not fast enough for big tree operations (>1000 pages) and regularly the tree got corrupted because of transactional errors. In 3.1 we replaced MPTT for MP (Materialized Path). MP is more efficient and has more error resistance then MPTT. It should make the whole django CMS experience way better, faster and reliable. Bofore upgrading ---------------- Be sure to run ``manage.py cms fix-mptt`` before you upgrade. ******************** Incompatible changes ******************** ## Instruction: Add dropped support to release notes ## Code After: .. _upgrade-to-3.1: ################# 3.1 release notes ################# ***************** What's new in 3.1 ***************** Switch from MPTT to MP ====================== Since django CMS 2.0 we relied on MPTT (Modified Preorder Tree Traversal) for efficiently handling tree structures in the DB. Over the years it proved that MPTT was not fast enough for big tree operations (>1000 pages) and regularly the tree got corrupted because of transactional errors. In 3.1 we replaced MPTT for MP (Materialized Path). MP is more efficient and has more error resistance then MPTT. It should make the whole django CMS experience way better, faster and reliable. Bofore upgrading ---------------- Be sure to run ``manage.py cms fix-mptt`` before you upgrade. Dropped support for Django 1.4 and 1.5 ====================================== Starting from version 3.1 the supported Django versions are 1.6 and 1.7 ******************** Incompatible changes ********************
.. _upgrade-to-3.1: ################# 3.1 release notes ################# ***************** What's new in 3.1 ***************** Switch from MPTT to MP ====================== Since django CMS 2.0 we relied on MPTT (Modified Preorder Tree Traversal) for efficiently handling tree structures in the DB. Over the years it proved that MPTT was not fast enough for big tree operations (>1000 pages) and regularly the tree got corrupted because of transactional errors. In 3.1 we replaced MPTT for MP (Materialized Path). MP is more efficient and has more error resistance then MPTT. It should make the whole django CMS experience way better, faster and reliable. Bofore upgrading ---------------- Be sure to run ``manage.py cms fix-mptt`` before you upgrade. + Dropped support for Django 1.4 and 1.5 + ====================================== + + Starting from version 3.1 the supported Django versions are 1.6 and 1.7 + + ******************** Incompatible changes ********************
6
0.206897
6
0
920e969da8e8529faecf766d7168d9fc5c8fdc93
lib/build/webpack/vue-loader.config.js
lib/build/webpack/vue-loader.config.js
'use strict' module.exports = function () { let config = { postcss: this.options.build.postcss, loaders: { 'js': 'babel-loader?presets[]=es2015&presets[]=stage-2', 'postcss': 'vue-style-loader!css-loader', 'less': 'vue-style-loader!css-loader!less-loader', 'sass': 'vue-style-loader!css-loader!sass-loader?indentedSyntax', 'scss': 'vue-style-loader!css-loader!sass-loader', 'stylus': 'vue-style-loader!css-loader!stylus-loader', 'styl': 'vue-style-loader!css-loader!stylus-loader' } } if (!this.dev) { // Use ExtractTextPlugin to extract CSS into a single file const ExtractTextPlugin = require('extract-text-webpack-plugin') config.loaders.css = ExtractTextPlugin.extract({ loader: 'css-loader' }) config.loaders.scss = ExtractTextPlugin.extract({ loader: 'css-loader!sass-loader', fallbackLoader: 'vue-style-loader' }) config.loaders.sass = ExtractTextPlugin.extract({ loader: 'css-loader!sass-loader?indentedSyntax', fallbackLoader: 'vue-style-loader' }) config.loaders.stylus = ExtractTextPlugin.extract({ loader: 'css-loader!stylus-loader', fallbackLoader: 'vue-style-loader' }) config.loaders.less = ExtractTextPlugin.extract({ loader: 'css-loader!less-loader', fallbackLoader: 'vue-style-loader' }) } // Return the config return config }
'use strict' module.exports = function () { let config = { postcss: this.options.build.postcss, loaders: { 'less': 'vue-style-loader!css-loader!less-loader', 'sass': 'vue-style-loader!css-loader!sass-loader?indentedSyntax', 'scss': 'vue-style-loader!css-loader!sass-loader', 'stylus': 'vue-style-loader!css-loader!stylus-loader', 'styl': 'vue-style-loader!css-loader!stylus-loader' } } if (!this.dev) { // Use ExtractTextPlugin to extract CSS into a single file const ExtractTextPlugin = require('extract-text-webpack-plugin') config.loaders.css = ExtractTextPlugin.extract({ loader: 'css-loader' }) config.loaders.scss = ExtractTextPlugin.extract({ loader: 'css-loader!sass-loader', fallbackLoader: 'vue-style-loader' }) config.loaders.sass = ExtractTextPlugin.extract({ loader: 'css-loader!sass-loader?indentedSyntax', fallbackLoader: 'vue-style-loader' }) config.loaders.stylus = ExtractTextPlugin.extract({ loader: 'css-loader!stylus-loader', fallbackLoader: 'vue-style-loader' }) config.loaders.less = ExtractTextPlugin.extract({ loader: 'css-loader!less-loader', fallbackLoader: 'vue-style-loader' }) } // Return the config return config }
Disable babel query in vue-loaders
Disable babel query in vue-loaders
JavaScript
mit
jfroffice/nuxt.js,cj/nuxt.js,mgesmundo/nuxt.js,mgesmundo/nuxt.js,jfroffice/nuxt.js,cj/nuxt.js
javascript
## Code Before: 'use strict' module.exports = function () { let config = { postcss: this.options.build.postcss, loaders: { 'js': 'babel-loader?presets[]=es2015&presets[]=stage-2', 'postcss': 'vue-style-loader!css-loader', 'less': 'vue-style-loader!css-loader!less-loader', 'sass': 'vue-style-loader!css-loader!sass-loader?indentedSyntax', 'scss': 'vue-style-loader!css-loader!sass-loader', 'stylus': 'vue-style-loader!css-loader!stylus-loader', 'styl': 'vue-style-loader!css-loader!stylus-loader' } } if (!this.dev) { // Use ExtractTextPlugin to extract CSS into a single file const ExtractTextPlugin = require('extract-text-webpack-plugin') config.loaders.css = ExtractTextPlugin.extract({ loader: 'css-loader' }) config.loaders.scss = ExtractTextPlugin.extract({ loader: 'css-loader!sass-loader', fallbackLoader: 'vue-style-loader' }) config.loaders.sass = ExtractTextPlugin.extract({ loader: 'css-loader!sass-loader?indentedSyntax', fallbackLoader: 'vue-style-loader' }) config.loaders.stylus = ExtractTextPlugin.extract({ loader: 'css-loader!stylus-loader', fallbackLoader: 'vue-style-loader' }) config.loaders.less = ExtractTextPlugin.extract({ loader: 'css-loader!less-loader', fallbackLoader: 'vue-style-loader' }) } // Return the config return config } ## Instruction: Disable babel query in vue-loaders ## Code After: 'use strict' module.exports = function () { let config = { postcss: this.options.build.postcss, loaders: { 'less': 'vue-style-loader!css-loader!less-loader', 'sass': 'vue-style-loader!css-loader!sass-loader?indentedSyntax', 'scss': 'vue-style-loader!css-loader!sass-loader', 'stylus': 'vue-style-loader!css-loader!stylus-loader', 'styl': 'vue-style-loader!css-loader!stylus-loader' } } if (!this.dev) { // Use ExtractTextPlugin to extract CSS into a single file const ExtractTextPlugin = require('extract-text-webpack-plugin') config.loaders.css = ExtractTextPlugin.extract({ loader: 'css-loader' }) config.loaders.scss = ExtractTextPlugin.extract({ loader: 'css-loader!sass-loader', fallbackLoader: 'vue-style-loader' }) config.loaders.sass = ExtractTextPlugin.extract({ loader: 'css-loader!sass-loader?indentedSyntax', fallbackLoader: 'vue-style-loader' }) config.loaders.stylus = ExtractTextPlugin.extract({ loader: 'css-loader!stylus-loader', fallbackLoader: 'vue-style-loader' }) config.loaders.less = ExtractTextPlugin.extract({ loader: 'css-loader!less-loader', fallbackLoader: 'vue-style-loader' }) } // Return the config return config }
'use strict' module.exports = function () { let config = { postcss: this.options.build.postcss, loaders: { - 'js': 'babel-loader?presets[]=es2015&presets[]=stage-2', - 'postcss': 'vue-style-loader!css-loader', 'less': 'vue-style-loader!css-loader!less-loader', 'sass': 'vue-style-loader!css-loader!sass-loader?indentedSyntax', 'scss': 'vue-style-loader!css-loader!sass-loader', 'stylus': 'vue-style-loader!css-loader!stylus-loader', 'styl': 'vue-style-loader!css-loader!stylus-loader' } } if (!this.dev) { // Use ExtractTextPlugin to extract CSS into a single file const ExtractTextPlugin = require('extract-text-webpack-plugin') config.loaders.css = ExtractTextPlugin.extract({ loader: 'css-loader' }) config.loaders.scss = ExtractTextPlugin.extract({ loader: 'css-loader!sass-loader', fallbackLoader: 'vue-style-loader' }) config.loaders.sass = ExtractTextPlugin.extract({ loader: 'css-loader!sass-loader?indentedSyntax', fallbackLoader: 'vue-style-loader' }) config.loaders.stylus = ExtractTextPlugin.extract({ loader: 'css-loader!stylus-loader', fallbackLoader: 'vue-style-loader' }) config.loaders.less = ExtractTextPlugin.extract({ loader: 'css-loader!less-loader', fallbackLoader: 'vue-style-loader' }) } // Return the config return config }
2
0.068966
0
2
e356ce2c6fc6a3383a4ab8f7eea1ecb3ef7aa978
linter.py
linter.py
from SublimeLinter.lint import ComposerLinter class Phpcs(ComposerLinter): cmd = ('phpcs', '--report=emacs', '${args}', '-') regex = r'^.*:(?P<line>[0-9]+):(?P<col>[0-9]+): (?:(?P<error>error)|(?P<warning>warning)) - (?P<message>(.(?!\(\S+\)$))+)( \((?P<code>\S+)\)$)?' # noqa: E501 defaults = { 'selector': 'source.php - text.blade, text.html.basic', # we want auto-substitution of the filename, # but `cmd` does not support that yet '--stdin-path=': '${file}' }
from SublimeLinter.lint import ComposerLinter class Phpcs(ComposerLinter): cmd = ('phpcs', '--report=emacs', '${args}', '-') regex = r'^.*:(?P<line>[0-9]+):(?P<col>[0-9]+): (?:(?P<error>error)|(?P<warning>warning)) - (?P<message>(.(?!\(\S+\)$))+)( \((?P<code>\S+)\)$)?' # noqa: E501 defaults = { 'selector': 'embedding.php, source.php - text.blade', # we want auto-substitution of the filename, # but `cmd` does not support that yet '--stdin-path=': '${file}' }
Update selector for Sublime Text >= 4134
Update selector for Sublime Text >= 4134
Python
mit
SublimeLinter/SublimeLinter-phpcs
python
## Code Before: from SublimeLinter.lint import ComposerLinter class Phpcs(ComposerLinter): cmd = ('phpcs', '--report=emacs', '${args}', '-') regex = r'^.*:(?P<line>[0-9]+):(?P<col>[0-9]+): (?:(?P<error>error)|(?P<warning>warning)) - (?P<message>(.(?!\(\S+\)$))+)( \((?P<code>\S+)\)$)?' # noqa: E501 defaults = { 'selector': 'source.php - text.blade, text.html.basic', # we want auto-substitution of the filename, # but `cmd` does not support that yet '--stdin-path=': '${file}' } ## Instruction: Update selector for Sublime Text >= 4134 ## Code After: from SublimeLinter.lint import ComposerLinter class Phpcs(ComposerLinter): cmd = ('phpcs', '--report=emacs', '${args}', '-') regex = r'^.*:(?P<line>[0-9]+):(?P<col>[0-9]+): (?:(?P<error>error)|(?P<warning>warning)) - (?P<message>(.(?!\(\S+\)$))+)( \((?P<code>\S+)\)$)?' # noqa: E501 defaults = { 'selector': 'embedding.php, source.php - text.blade', # we want auto-substitution of the filename, # but `cmd` does not support that yet '--stdin-path=': '${file}' }
from SublimeLinter.lint import ComposerLinter class Phpcs(ComposerLinter): cmd = ('phpcs', '--report=emacs', '${args}', '-') regex = r'^.*:(?P<line>[0-9]+):(?P<col>[0-9]+): (?:(?P<error>error)|(?P<warning>warning)) - (?P<message>(.(?!\(\S+\)$))+)( \((?P<code>\S+)\)$)?' # noqa: E501 defaults = { - 'selector': 'source.php - text.blade, text.html.basic', + 'selector': 'embedding.php, source.php - text.blade', # we want auto-substitution of the filename, # but `cmd` does not support that yet '--stdin-path=': '${file}' }
2
0.166667
1
1
8b5152cf4458561a53c707760053cb63a28fe298
.travis.yml
.travis.yml
language: php php: - 5.3 - 5.4 before_script: - pear channel-discover pear.phpspec.net - pear install phpspec/PHPSpec script: phpspec src/spec --bootstrap src/spec/bootstrap.php
language: php php: - 5.3 - 5.4 before_script: - pear config-set audo_discover 1 - pear channel-discover pear.phpspec.net - pear install phpspec/PHPSpec script: phpspec src/spec --bootstrap src/spec/bootstrap.php
Fix the Travis CI build.
Fix the Travis CI build. Configure PEAR to automatically discover channels for dependencies.
YAML
mit
phuedx/pinkerton
yaml
## Code Before: language: php php: - 5.3 - 5.4 before_script: - pear channel-discover pear.phpspec.net - pear install phpspec/PHPSpec script: phpspec src/spec --bootstrap src/spec/bootstrap.php ## Instruction: Fix the Travis CI build. Configure PEAR to automatically discover channels for dependencies. ## Code After: language: php php: - 5.3 - 5.4 before_script: - pear config-set audo_discover 1 - pear channel-discover pear.phpspec.net - pear install phpspec/PHPSpec script: phpspec src/spec --bootstrap src/spec/bootstrap.php
language: php php: - 5.3 - 5.4 before_script: + - pear config-set audo_discover 1 - - pear channel-discover pear.phpspec.net ? -- + - pear channel-discover pear.phpspec.net - - pear install phpspec/PHPSpec ? -- + - pear install phpspec/PHPSpec script: phpspec src/spec --bootstrap src/spec/bootstrap.php
5
0.454545
3
2
a04b672db617d2185b6a311f7567c281febf8fd5
README.md
README.md
New version of [docs.barricade.io](https://docs.barricade.io), built as a static site with [Hugo](http://gohugo.io/). ![https://cloud.githubusercontent.com/assets/686194/12189426/550f84e4-b572-11e5-821a-3b4d517b1642.png](https://cloud.githubusercontent.com/assets/686194/12189426/550f84e4-b572-11e5-821a-3b4d517b1642.png) -- New content is added by adding Markdown files to the `/content` subdirectories. New images and other media should be located in `themes/barricade/static/src`. -- # Deploying Changes The deploy script will take care of running Hugo, Gulp and the required Git magic - just run `bash deploy.sh` and the site will be pushed to the gh-pages branch. # Local Development * Run `hugo server --watch` to generate the site * In a different window, run `gulp watch` to compile assets * The site will be available at [localhost:1313](http://localhost:1313/)
New version of [docs.barricade.io](https://docs.barricade.io), built as a static site with [Hugo](http://gohugo.io/). ![https://cloud.githubusercontent.com/assets/686194/12189426/550f84e4-b572-11e5-821a-3b4d517b1642.png](https://cloud.githubusercontent.com/assets/686194/12189426/550f84e4-b572-11e5-821a-3b4d517b1642.png) -- New content is added by adding Markdown files to the `/content` subdirectories. New images and other media should be located in `themes/barricade/static/src`. -- # Local Development * Run `hugo server --watch` to generate the site * In a different window, run `gulp watch` to compile assets * The site will be available at [localhost:1313](http://localhost:1313/) # Deploying Run `hugo` (not hugo server) to update the BaseUrl with the live url. Then run `bash deploy.sh` to run the deploy script, which will take care of running Gulp and the required Git magic. The site will be pushed to the gh-pages branch.
Update readme with note about running hugo before deployment
Update readme with note about running hugo before deployment
Markdown
mit
barricadeio/docs,barricadeio/docs,barricadeio/docs,barricadeio/docs
markdown
## Code Before: New version of [docs.barricade.io](https://docs.barricade.io), built as a static site with [Hugo](http://gohugo.io/). ![https://cloud.githubusercontent.com/assets/686194/12189426/550f84e4-b572-11e5-821a-3b4d517b1642.png](https://cloud.githubusercontent.com/assets/686194/12189426/550f84e4-b572-11e5-821a-3b4d517b1642.png) -- New content is added by adding Markdown files to the `/content` subdirectories. New images and other media should be located in `themes/barricade/static/src`. -- # Deploying Changes The deploy script will take care of running Hugo, Gulp and the required Git magic - just run `bash deploy.sh` and the site will be pushed to the gh-pages branch. # Local Development * Run `hugo server --watch` to generate the site * In a different window, run `gulp watch` to compile assets * The site will be available at [localhost:1313](http://localhost:1313/) ## Instruction: Update readme with note about running hugo before deployment ## Code After: New version of [docs.barricade.io](https://docs.barricade.io), built as a static site with [Hugo](http://gohugo.io/). ![https://cloud.githubusercontent.com/assets/686194/12189426/550f84e4-b572-11e5-821a-3b4d517b1642.png](https://cloud.githubusercontent.com/assets/686194/12189426/550f84e4-b572-11e5-821a-3b4d517b1642.png) -- New content is added by adding Markdown files to the `/content` subdirectories. New images and other media should be located in `themes/barricade/static/src`. -- # Local Development * Run `hugo server --watch` to generate the site * In a different window, run `gulp watch` to compile assets * The site will be available at [localhost:1313](http://localhost:1313/) # Deploying Run `hugo` (not hugo server) to update the BaseUrl with the live url. Then run `bash deploy.sh` to run the deploy script, which will take care of running Gulp and the required Git magic. The site will be pushed to the gh-pages branch.
New version of [docs.barricade.io](https://docs.barricade.io), built as a static site with [Hugo](http://gohugo.io/). ![https://cloud.githubusercontent.com/assets/686194/12189426/550f84e4-b572-11e5-821a-3b4d517b1642.png](https://cloud.githubusercontent.com/assets/686194/12189426/550f84e4-b572-11e5-821a-3b4d517b1642.png) -- New content is added by adding Markdown files to the `/content` subdirectories. New images and other media should be located in `themes/barricade/static/src`. -- - # Deploying Changes - - The deploy script will take care of running Hugo, Gulp and the required Git magic - just run `bash deploy.sh` and the site will be pushed to the gh-pages branch. - - # Local Development * Run `hugo server --watch` to generate the site * In a different window, run `gulp watch` to compile assets * The site will be available at [localhost:1313](http://localhost:1313/) + # Deploying + + Run `hugo` (not hugo server) to update the BaseUrl with the live url. + + Then run `bash deploy.sh` to run the deploy script, which will take care of running Gulp and the required Git magic. The site will be pushed to the gh-pages branch.
10
0.434783
5
5
fceac2b2b82cc8e9a1cfabb13d1d7ff3d12d8d04
Sources/PBXBuildStyle.swift
Sources/PBXBuildStyle.swift
// // PBXBuildStyle.swift // XcodeProjKit // // Created by phimage on 30/07/2017. // Copyright © 2017 phimage (Eric Marchand). All rights reserved. // import Foundation public class PBXBuildStyle: PBXProjectItem { public enum PBXKeys: PBXKey { case buildSettings } #if LAZY public lazy var buildSettings: [String: Any]? = dictionary(PBXKeys.buildSettings) #else public var buildSettings: [String: Any]? { dictionary(PBXKeys.buildSettings) } #endif }
// // PBXBuildStyle.swift // XcodeProjKit // // Created by phimage on 30/07/2017. // Copyright © 2017 phimage (Eric Marchand). All rights reserved. // import Foundation public class PBXBuildStyle: PBXProjectItem { public enum PBXKeys: PBXKey { case buildSettings } #if LAZY public lazy var buildSettings: [String: Any]? = dictionary(PBXKeys.buildSettings) #else public var buildSettings: [String: Any]? { get { dictionary(PBXKeys.buildSettings) } set { self.fields[PBXKeys.buildSettings.rawValue] = newValue } } #endif }
Allow to modify build settings
Allow to modify build settings
Swift
mit
phimage/XcodeProjKit,phimage/XcodeProjKit
swift
## Code Before: // // PBXBuildStyle.swift // XcodeProjKit // // Created by phimage on 30/07/2017. // Copyright © 2017 phimage (Eric Marchand). All rights reserved. // import Foundation public class PBXBuildStyle: PBXProjectItem { public enum PBXKeys: PBXKey { case buildSettings } #if LAZY public lazy var buildSettings: [String: Any]? = dictionary(PBXKeys.buildSettings) #else public var buildSettings: [String: Any]? { dictionary(PBXKeys.buildSettings) } #endif } ## Instruction: Allow to modify build settings ## Code After: // // PBXBuildStyle.swift // XcodeProjKit // // Created by phimage on 30/07/2017. // Copyright © 2017 phimage (Eric Marchand). All rights reserved. // import Foundation public class PBXBuildStyle: PBXProjectItem { public enum PBXKeys: PBXKey { case buildSettings } #if LAZY public lazy var buildSettings: [String: Any]? = dictionary(PBXKeys.buildSettings) #else public var buildSettings: [String: Any]? { get { dictionary(PBXKeys.buildSettings) } set { self.fields[PBXKeys.buildSettings.rawValue] = newValue } } #endif }
// // PBXBuildStyle.swift // XcodeProjKit // // Created by phimage on 30/07/2017. // Copyright © 2017 phimage (Eric Marchand). All rights reserved. // import Foundation public class PBXBuildStyle: PBXProjectItem { public enum PBXKeys: PBXKey { case buildSettings } #if LAZY public lazy var buildSettings: [String: Any]? = dictionary(PBXKeys.buildSettings) #else - public var buildSettings: [String: Any]? { dictionary(PBXKeys.buildSettings) } + public var buildSettings: [String: Any]? { + get { + dictionary(PBXKeys.buildSettings) + } + set { + self.fields[PBXKeys.buildSettings.rawValue] = newValue + } + } #endif }
9
0.391304
8
1
2596904080e1367a1d82fce2083a2d5b7f6e04a9
lab4/src/SecureElection/SecureElectionClient.java
lab4/src/SecureElection/SecureElectionClient.java
package SecureElection; /** * Created by Klas Eskilson on 15-11-16. */ public class SecureElectionClient { public static void main(String[] args) { } }
package SecureElection; import java.io.BufferedReader; import java.io.FileInputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.InetAddress; import java.net.UnknownHostException; import java.security.KeyStore; import javax.net.ssl.*; import SecureElection.Common.Settings; /** * Created by Klas Eskilson on 15-11-16. */ public class SecureElectionClient { // constants private static final String CLIENTTRUSTSTORE = Settings.KEYLOCATION + "ClientTruststore.ks"; private static final String CLIENTKEYSTORE = Settings.KEYLOCATION + "ClientKeystore.ks"; private static final String CLIENTPASSWORD = "somephrase"; // class variables BufferedReader socketIn; PrintWriter socketOut; /** * setup ssl client * @param addr the address to connect to */ private void setupSSLClient(InetAddress hostAddr) { try { // load keystores KeyStore ks = KeyStore.getInstance("JCEKS"); ks.load(new FileInputStream(CLIENTKEYSTORE), CLIENTPASSWORD.toCharArray()); KeyStore ts = KeyStore.getInstance("JCEKS"); ts.load(new FileInputStream(CLIENTTRUSTSTORE), CLIENTPASSWORD.toCharArray()); // setup key managers KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); kmf.init(ks, CLIENTPASSWORD.toCharArray()); TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); tmf.init(ts); // setup ssl SSLContext sslContext = SSLContext.getInstance("TLS"); sslContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); SSLSocketFactory sslFact = sslContext.getSocketFactory(); SSLSocket client = (SSLSocket) sslFact.createSocket(hostAddr, this.hostPort); client.setEnabledCipherSuites(client.getSupportedCipherSuites()); // setup transmissions socketIn = new BufferedReader(new InputStreamReader(client.getInputStream())); socketOut = new PrintWriter(client.getOutputStream(), true); } catch (Exception e) { System.out.println(e); e.printStackTrace(); } } public static void main(String[] args) { try { // setup connection InetAddress localhost = InetAddress.getLocalHost(); setupSSLClient(localhost); } catch (UnknownHostException uhe) { System.out.println(uhe); uhe.printStackTrace(); } } }
Add SSL setup to client
Add SSL setup to client
Java
mit
klaseskilson/TNM031-labs
java
## Code Before: package SecureElection; /** * Created by Klas Eskilson on 15-11-16. */ public class SecureElectionClient { public static void main(String[] args) { } } ## Instruction: Add SSL setup to client ## Code After: package SecureElection; import java.io.BufferedReader; import java.io.FileInputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.InetAddress; import java.net.UnknownHostException; import java.security.KeyStore; import javax.net.ssl.*; import SecureElection.Common.Settings; /** * Created by Klas Eskilson on 15-11-16. */ public class SecureElectionClient { // constants private static final String CLIENTTRUSTSTORE = Settings.KEYLOCATION + "ClientTruststore.ks"; private static final String CLIENTKEYSTORE = Settings.KEYLOCATION + "ClientKeystore.ks"; private static final String CLIENTPASSWORD = "somephrase"; // class variables BufferedReader socketIn; PrintWriter socketOut; /** * setup ssl client * @param addr the address to connect to */ private void setupSSLClient(InetAddress hostAddr) { try { // load keystores KeyStore ks = KeyStore.getInstance("JCEKS"); ks.load(new FileInputStream(CLIENTKEYSTORE), CLIENTPASSWORD.toCharArray()); KeyStore ts = KeyStore.getInstance("JCEKS"); ts.load(new FileInputStream(CLIENTTRUSTSTORE), CLIENTPASSWORD.toCharArray()); // setup key managers KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); kmf.init(ks, CLIENTPASSWORD.toCharArray()); TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); tmf.init(ts); // setup ssl SSLContext sslContext = SSLContext.getInstance("TLS"); sslContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); SSLSocketFactory sslFact = sslContext.getSocketFactory(); SSLSocket client = (SSLSocket) sslFact.createSocket(hostAddr, this.hostPort); client.setEnabledCipherSuites(client.getSupportedCipherSuites()); // setup transmissions socketIn = new BufferedReader(new InputStreamReader(client.getInputStream())); socketOut = new PrintWriter(client.getOutputStream(), true); } catch (Exception e) { System.out.println(e); e.printStackTrace(); } } public static void main(String[] args) { try { // setup connection InetAddress localhost = InetAddress.getLocalHost(); setupSSLClient(localhost); } catch (UnknownHostException uhe) { System.out.println(uhe); uhe.printStackTrace(); } } }
package SecureElection; + + import java.io.BufferedReader; + import java.io.FileInputStream; + import java.io.InputStreamReader; + import java.io.PrintWriter; + import java.net.InetAddress; + import java.net.UnknownHostException; + import java.security.KeyStore; + import javax.net.ssl.*; + import SecureElection.Common.Settings; + /** * Created by Klas Eskilson on 15-11-16. */ public class SecureElectionClient { + // constants + private static final String CLIENTTRUSTSTORE = Settings.KEYLOCATION + "ClientTruststore.ks"; + private static final String CLIENTKEYSTORE = Settings.KEYLOCATION + "ClientKeystore.ks"; + private static final String CLIENTPASSWORD = "somephrase"; + + // class variables + BufferedReader socketIn; + PrintWriter socketOut; + + /** + * setup ssl client + * @param addr the address to connect to + */ + private void setupSSLClient(InetAddress hostAddr) { + try { + // load keystores + KeyStore ks = KeyStore.getInstance("JCEKS"); + ks.load(new FileInputStream(CLIENTKEYSTORE), + CLIENTPASSWORD.toCharArray()); + KeyStore ts = KeyStore.getInstance("JCEKS"); + ts.load(new FileInputStream(CLIENTTRUSTSTORE), + CLIENTPASSWORD.toCharArray()); + + // setup key managers + KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); + kmf.init(ks, CLIENTPASSWORD.toCharArray()); + TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); + tmf.init(ts); + + // setup ssl + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); + SSLSocketFactory sslFact = sslContext.getSocketFactory(); + SSLSocket client = (SSLSocket) sslFact.createSocket(hostAddr, this.hostPort); + client.setEnabledCipherSuites(client.getSupportedCipherSuites()); + + // setup transmissions + socketIn = new BufferedReader(new InputStreamReader(client.getInputStream())); + socketOut = new PrintWriter(client.getOutputStream(), true); + } catch (Exception e) { + System.out.println(e); + e.printStackTrace(); + } + } public static void main(String[] args) { + try { + // setup connection + InetAddress localhost = InetAddress.getLocalHost(); + setupSSLClient(localhost); + } catch (UnknownHostException uhe) { + System.out.println(uhe); + uhe.printStackTrace(); + } } }
63
5.727273
63
0
98d87d447ae0f84bdbd1bee3ecd4a842acfeacbc
ibmcnx/test/loadFunction.py
ibmcnx/test/loadFunction.py
import sys from java.lang import String from java.util import HashSet from java.util import HashMap import java globdict = globals() def loadFilesService(): global globdict exec open("filesAdmin.py").read()
import sys from java.lang import String from java.util import HashSet from java.util import HashMap import java import lotusConnectionsCommonAdmin globdict = globals() def loadFilesService(): global globdict exec open("filesAdmin.py").read()
Customize scripts to work with menu
Customize scripts to work with menu
Python
apache-2.0
stoeps13/ibmcnx2,stoeps13/ibmcnx2
python
## Code Before: import sys from java.lang import String from java.util import HashSet from java.util import HashMap import java globdict = globals() def loadFilesService(): global globdict exec open("filesAdmin.py").read() ## Instruction: Customize scripts to work with menu ## Code After: import sys from java.lang import String from java.util import HashSet from java.util import HashMap import java import lotusConnectionsCommonAdmin globdict = globals() def loadFilesService(): global globdict exec open("filesAdmin.py").read()
import sys from java.lang import String from java.util import HashSet from java.util import HashMap import java + import lotusConnectionsCommonAdmin globdict = globals() def loadFilesService(): global globdict exec open("filesAdmin.py").read()
1
0.083333
1
0
b7fad2e12b8b453d55a64e8150f1e20ff28489ce
Test/Factory/TestUserFactoryInterface.php
Test/Factory/TestUserFactoryInterface.php
<?php /* * This file is part of the Sylius package. * * (c) Paweł Jędrzejewski * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Sylius\Component\Core\Test\Factory; use Sylius\Component\Core\Model\UserInterface; /** * @author Mateusz Zalewski <mateusz.zalewski@lakion.com> * @author Magdalena Banasiak <magdalena.banasiak@lakion.com> */ interface TestUserFactoryInterface { /** * @param string $email * @param string $password * @param string $firstName * @param string $lastName * @param string $role * * @return UserInterface */ public function create($email, $password, $firstName, $lastName, $role); /** * @return UserInterface */ public function createDefault(); /** * @return UserInterface */ public function createDefaultAdmin(); }
<?php /* * This file is part of the Sylius package. * * (c) Paweł Jędrzejewski * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Sylius\Component\Core\Test\Factory; use Sylius\Component\Core\Model\UserInterface; /** * @author Mateusz Zalewski <mateusz.zalewski@lakion.com> * @author Magdalena Banasiak <magdalena.banasiak@lakion.com> */ interface TestUserFactoryInterface { /** * @param string $email * @param string $password * @param string $firstName * @param string $lastName * @param string $role * * @return UserInterface */ public function create($email, $password, $firstName, $lastName, $role); /** * @return UserInterface */ public function createDefault(); }
Change user bundle configuration to be able to support multiple entity
[User] Change user bundle configuration to be able to support multiple entity [Behat] Separate security context & clean up [Core][User] replace unused services
PHP
mit
Sylius/Core
php
## Code Before: <?php /* * This file is part of the Sylius package. * * (c) Paweł Jędrzejewski * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Sylius\Component\Core\Test\Factory; use Sylius\Component\Core\Model\UserInterface; /** * @author Mateusz Zalewski <mateusz.zalewski@lakion.com> * @author Magdalena Banasiak <magdalena.banasiak@lakion.com> */ interface TestUserFactoryInterface { /** * @param string $email * @param string $password * @param string $firstName * @param string $lastName * @param string $role * * @return UserInterface */ public function create($email, $password, $firstName, $lastName, $role); /** * @return UserInterface */ public function createDefault(); /** * @return UserInterface */ public function createDefaultAdmin(); } ## Instruction: [User] Change user bundle configuration to be able to support multiple entity [Behat] Separate security context & clean up [Core][User] replace unused services ## Code After: <?php /* * This file is part of the Sylius package. * * (c) Paweł Jędrzejewski * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Sylius\Component\Core\Test\Factory; use Sylius\Component\Core\Model\UserInterface; /** * @author Mateusz Zalewski <mateusz.zalewski@lakion.com> * @author Magdalena Banasiak <magdalena.banasiak@lakion.com> */ interface TestUserFactoryInterface { /** * @param string $email * @param string $password * @param string $firstName * @param string $lastName * @param string $role * * @return UserInterface */ public function create($email, $password, $firstName, $lastName, $role); /** * @return UserInterface */ public function createDefault(); }
<?php /* * This file is part of the Sylius package. * * (c) Paweł Jędrzejewski * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Sylius\Component\Core\Test\Factory; use Sylius\Component\Core\Model\UserInterface; /** * @author Mateusz Zalewski <mateusz.zalewski@lakion.com> * @author Magdalena Banasiak <magdalena.banasiak@lakion.com> */ interface TestUserFactoryInterface { /** * @param string $email * @param string $password * @param string $firstName * @param string $lastName * @param string $role * * @return UserInterface */ public function create($email, $password, $firstName, $lastName, $role); /** * @return UserInterface */ public function createDefault(); - - /** - * @return UserInterface - */ - public function createDefaultAdmin(); }
5
0.119048
0
5
821cb5f233085f067e448d4fef61c83f6b73916f
web/wp-content/themes/twentyseventeen-child/source/js/twentyseventeen-child.js
web/wp-content/themes/twentyseventeen-child/source/js/twentyseventeen-child.js
console.log('TwentySeventeen Child Theme Initializing!');
/** * Test ES6 support with const and arrow functions */ const initializeTwentySeventeenChildTheme = () => { console.log('TwentySeventeen Child Theme Initializing!'); }; initializeTwentySeventeenChildTheme();
Test ES6 support with const and arrow functions
Test ES6 support with const and arrow functions
JavaScript
mit
ataylorme/Advanced-WordPress-on-Pantheon,ataylorme/Advanced-WordPress-on-Pantheon,ataylorme/Advanced-WordPress-on-Pantheon
javascript
## Code Before: console.log('TwentySeventeen Child Theme Initializing!'); ## Instruction: Test ES6 support with const and arrow functions ## Code After: /** * Test ES6 support with const and arrow functions */ const initializeTwentySeventeenChildTheme = () => { console.log('TwentySeventeen Child Theme Initializing!'); }; initializeTwentySeventeenChildTheme();
+ /** + * Test ES6 support with const and arrow functions + */ + const initializeTwentySeventeenChildTheme = () => { - console.log('TwentySeventeen Child Theme Initializing!'); + console.log('TwentySeventeen Child Theme Initializing!'); ? ++++ + }; + + initializeTwentySeventeenChildTheme();
9
9
8
1
0443f10ecc21ad16d2a9fda34434e8203f5c58f5
ui/src/index.tsx
ui/src/index.tsx
import 'bootstrap/dist/css/bootstrap.min.css'; import React from 'react'; import ReactDOM from 'react-dom'; import { I18nextProvider } from 'react-i18next'; import Modal from 'react-modal'; import App from './App'; import './buttons.css'; import i18n from './i18n/i18n'; import Field from './idai_field/Field'; import Shapes from './idai_shapes/Shapes'; import './index.css'; Modal.setAppElement('#root'); const getSubdomain = (): string => { const levels = window.location.host.split('.'); if (levels.length >= 3) return levels[0]; else return null; }; // Run only shapes or field if subdomain is set, otherwise App wraps both const subdomain = getSubdomain(); const app = (subdomain === 'shapes') ? <Shapes /> : (subdomain === 'field') ? <Field /> : <App />; ReactDOM.render( <I18nextProvider i18n={ i18n }> { app } </I18nextProvider>, document.getElementById('root') );
import 'bootstrap/dist/css/bootstrap.min.css'; import React from 'react'; import ReactDOM from 'react-dom'; import { I18nextProvider } from 'react-i18next'; import Modal from 'react-modal'; import './buttons.css'; import i18n from './i18n/i18n'; import Field from './idai_field/Field'; import Shapes from './idai_shapes/Shapes'; import './index.css'; Modal.setAppElement('#root'); const getSubdomain = (): string => { const levels = window.location.host.split('.'); if (levels.length >= 3) return levels[0]; else return null; }; // Run only shapes or field if subdomain is set, otherwise App wraps both const subdomain = getSubdomain(); const app = (subdomain === 'shapes' || process.env.REACT_APP_MAIN === 'shapes') ? <Shapes /> : <Field />; ReactDOM.render( <I18nextProvider i18n={ i18n }> { app } </I18nextProvider>, document.getElementById('root') );
Read main component from env for dev environment
Read main component from env for dev environment
TypeScript
apache-2.0
dainst/idai-field-web,dainst/idai-field-web,dainst/idai-field-web
typescript
## Code Before: import 'bootstrap/dist/css/bootstrap.min.css'; import React from 'react'; import ReactDOM from 'react-dom'; import { I18nextProvider } from 'react-i18next'; import Modal from 'react-modal'; import App from './App'; import './buttons.css'; import i18n from './i18n/i18n'; import Field from './idai_field/Field'; import Shapes from './idai_shapes/Shapes'; import './index.css'; Modal.setAppElement('#root'); const getSubdomain = (): string => { const levels = window.location.host.split('.'); if (levels.length >= 3) return levels[0]; else return null; }; // Run only shapes or field if subdomain is set, otherwise App wraps both const subdomain = getSubdomain(); const app = (subdomain === 'shapes') ? <Shapes /> : (subdomain === 'field') ? <Field /> : <App />; ReactDOM.render( <I18nextProvider i18n={ i18n }> { app } </I18nextProvider>, document.getElementById('root') ); ## Instruction: Read main component from env for dev environment ## Code After: import 'bootstrap/dist/css/bootstrap.min.css'; import React from 'react'; import ReactDOM from 'react-dom'; import { I18nextProvider } from 'react-i18next'; import Modal from 'react-modal'; import './buttons.css'; import i18n from './i18n/i18n'; import Field from './idai_field/Field'; import Shapes from './idai_shapes/Shapes'; import './index.css'; Modal.setAppElement('#root'); const getSubdomain = (): string => { const levels = window.location.host.split('.'); if (levels.length >= 3) return levels[0]; else return null; }; // Run only shapes or field if subdomain is set, otherwise App wraps both const subdomain = getSubdomain(); const app = (subdomain === 'shapes' || process.env.REACT_APP_MAIN === 'shapes') ? <Shapes /> : <Field />; ReactDOM.render( <I18nextProvider i18n={ i18n }> { app } </I18nextProvider>, document.getElementById('root') );
import 'bootstrap/dist/css/bootstrap.min.css'; import React from 'react'; import ReactDOM from 'react-dom'; import { I18nextProvider } from 'react-i18next'; import Modal from 'react-modal'; - import App from './App'; import './buttons.css'; import i18n from './i18n/i18n'; import Field from './idai_field/Field'; import Shapes from './idai_shapes/Shapes'; import './index.css'; Modal.setAppElement('#root'); const getSubdomain = (): string => { const levels = window.location.host.split('.'); if (levels.length >= 3) return levels[0]; else return null; }; // Run only shapes or field if subdomain is set, otherwise App wraps both const subdomain = getSubdomain(); - const app = (subdomain === 'shapes') + const app = (subdomain === 'shapes' || process.env.REACT_APP_MAIN === 'shapes') ? <Shapes /> - : (subdomain === 'field') - ? <Field /> ? ^^^ + : <Field />; ? ^ + - : <App />; ReactDOM.render( <I18nextProvider i18n={ i18n }> { app } </I18nextProvider>, document.getElementById('root') );
7
0.184211
2
5
167446b1a7d8f2fdba88c0f257f2b75b4d16fb10
tasks/watch.js
tasks/watch.js
'use strict'; var gulp = require('gulp'), config = require('../config'), bs = require('browser-sync').get('SIM01'); module.exports = function() { gulp.watch(config.watch.styles, ['build:css']); gulp.watch(config.watch.scripts, ['build:js']); gulp.watch(config.watch.images, ['build:images']); gulp.watch(config.watch.code, ['build:i18n']); gulp.watch(config.watch.root).on('change', bs.reload); };
'use strict'; var gulp = require('gulp'), config = require('../config'), bs = require('browser-sync').get('SIM01'); module.exports = function() { gulp.watch(config.watch.styles, ['build:css']); gulp.watch(config.watch.scripts, ['build:js']); gulp.watch(config.watch.images, ['build:images']); gulp.watch(config.watch.code, ['build:i18n']); gulp.watch([ config.watch.styles, config.watch.scripts, config.watch.images, config.watch.code ]).on('change', bs.reload); };
Refresh BrowserSync if something changes.
Refresh BrowserSync if something changes.
JavaScript
mit
craigsimps/gulp-wp-toolkit
javascript
## Code Before: 'use strict'; var gulp = require('gulp'), config = require('../config'), bs = require('browser-sync').get('SIM01'); module.exports = function() { gulp.watch(config.watch.styles, ['build:css']); gulp.watch(config.watch.scripts, ['build:js']); gulp.watch(config.watch.images, ['build:images']); gulp.watch(config.watch.code, ['build:i18n']); gulp.watch(config.watch.root).on('change', bs.reload); }; ## Instruction: Refresh BrowserSync if something changes. ## Code After: 'use strict'; var gulp = require('gulp'), config = require('../config'), bs = require('browser-sync').get('SIM01'); module.exports = function() { gulp.watch(config.watch.styles, ['build:css']); gulp.watch(config.watch.scripts, ['build:js']); gulp.watch(config.watch.images, ['build:images']); gulp.watch(config.watch.code, ['build:i18n']); gulp.watch([ config.watch.styles, config.watch.scripts, config.watch.images, config.watch.code ]).on('change', bs.reload); };
'use strict'; var gulp = require('gulp'), config = require('../config'), bs = require('browser-sync').get('SIM01'); module.exports = function() { gulp.watch(config.watch.styles, ['build:css']); gulp.watch(config.watch.scripts, ['build:js']); gulp.watch(config.watch.images, ['build:images']); gulp.watch(config.watch.code, ['build:i18n']); - gulp.watch(config.watch.root).on('change', bs.reload); + gulp.watch([ + config.watch.styles, + config.watch.scripts, + config.watch.images, + config.watch.code + ]).on('change', bs.reload); };
7
0.538462
6
1
9e65e5e8130051aa9e6d9563fe2722185ecd13d5
services/web/public/coffee/ide/test-controls/controllers/TestControlsController.coffee
services/web/public/coffee/ide/test-controls/controllers/TestControlsController.coffee
define [ "base" "ace/ace" ], (App) -> App.controller "TestControlsController", ($scope) -> $scope.openProjectLinkedFileModal = () -> window.openProjectLinkedFileModal() $scope.openLinkedFileModal = () -> window.openLinkedFileModal() $scope.richText = () -> window.location.href = window.location.toString() + '&rt=true'
define [ "base" "ace/ace" ], (App) -> App.controller "TestControlsController", ($scope) -> $scope.openProjectLinkedFileModal = () -> window.openProjectLinkedFileModal() $scope.openLinkedFileModal = () -> window.openLinkedFileModal() $scope.richText = () -> current = window.location.toString() target = "#{current}#{if window.location.search then '&' else '?'}rt=true" window.location.href = target
Fix loading of Rich Text page in Test Controls
Fix loading of Rich Text page in Test Controls
CoffeeScript
agpl-3.0
sharelatex/sharelatex
coffeescript
## Code Before: define [ "base" "ace/ace" ], (App) -> App.controller "TestControlsController", ($scope) -> $scope.openProjectLinkedFileModal = () -> window.openProjectLinkedFileModal() $scope.openLinkedFileModal = () -> window.openLinkedFileModal() $scope.richText = () -> window.location.href = window.location.toString() + '&rt=true' ## Instruction: Fix loading of Rich Text page in Test Controls ## Code After: define [ "base" "ace/ace" ], (App) -> App.controller "TestControlsController", ($scope) -> $scope.openProjectLinkedFileModal = () -> window.openProjectLinkedFileModal() $scope.openLinkedFileModal = () -> window.openLinkedFileModal() $scope.richText = () -> current = window.location.toString() target = "#{current}#{if window.location.search then '&' else '?'}rt=true" window.location.href = target
define [ "base" "ace/ace" ], (App) -> App.controller "TestControlsController", ($scope) -> $scope.openProjectLinkedFileModal = () -> window.openProjectLinkedFileModal() $scope.openLinkedFileModal = () -> window.openLinkedFileModal() $scope.richText = () -> - window.location.href = window.location.toString() + '&rt=true' + current = window.location.toString() + target = "#{current}#{if window.location.search then '&' else '?'}rt=true" + window.location.href = target
4
0.285714
3
1
6fb38742d4b62594a72d185632a54a23ad0d7150
src/main/java/at/ac/tuwien/inso/service/GradeService.java
src/main/java/at/ac/tuwien/inso/service/GradeService.java
package at.ac.tuwien.inso.service; import at.ac.tuwien.inso.entity.*; import org.springframework.security.access.prepost.*; import org.springframework.stereotype.*; import java.util.*; @Service public interface GradeService { @PreAuthorize("hasRole('LECTURER')") Grade getDefaultGradeForStudentAndCourse(Long studentId, Long courseId); @PreAuthorize("hasRole('LECTURER')") Grade saveNewGradeForStudentAndCourse(Grade grade); @PreAuthorize("hasRole('LECTURER')") List<Grade> getGradesForCourseOfLoggedInLecturer(Long courseId); @PreAuthorize("hasRole('STUDENT')") List<Grade> getGradesForLoggedInStudent(); Grade getForValidation(String identifier); @PreAuthorize("isAuthenticated()") List<Grade> findAllOfStudent(Student student); }
package at.ac.tuwien.inso.service; import at.ac.tuwien.inso.controller.lecturer.GradeAuthorizationDTO; import at.ac.tuwien.inso.entity.*; import org.springframework.security.access.prepost.*; import org.springframework.stereotype.*; import java.util.*; @Service public interface GradeService { @PreAuthorize("hasRole('LECTURER')") GradeAuthorizationDTO getDefaultGradeAuthorizationDTOForStudentAndCourse(Long studentId, Long courseId); @PreAuthorize("hasRole('LECTURER')") Grade saveNewGradeForStudentAndCourse(GradeAuthorizationDTO grade); @PreAuthorize("hasRole('LECTURER')") List<Grade> getGradesForCourseOfLoggedInLecturer(Long courseId); @PreAuthorize("hasRole('STUDENT')") List<Grade> getGradesForLoggedInStudent(); Grade getForValidation(String identifier); @PreAuthorize("isAuthenticated()") List<Grade> findAllOfStudent(Student student); @PreAuthorize("isAuthenticated()") List<Mark> getMarkOptions(); }
Refactor for two factor authentification
Refactor for two factor authentification
Java
mit
university-information-system/uis,university-information-system/uis,university-information-system/uis,university-information-system/uis
java
## Code Before: package at.ac.tuwien.inso.service; import at.ac.tuwien.inso.entity.*; import org.springframework.security.access.prepost.*; import org.springframework.stereotype.*; import java.util.*; @Service public interface GradeService { @PreAuthorize("hasRole('LECTURER')") Grade getDefaultGradeForStudentAndCourse(Long studentId, Long courseId); @PreAuthorize("hasRole('LECTURER')") Grade saveNewGradeForStudentAndCourse(Grade grade); @PreAuthorize("hasRole('LECTURER')") List<Grade> getGradesForCourseOfLoggedInLecturer(Long courseId); @PreAuthorize("hasRole('STUDENT')") List<Grade> getGradesForLoggedInStudent(); Grade getForValidation(String identifier); @PreAuthorize("isAuthenticated()") List<Grade> findAllOfStudent(Student student); } ## Instruction: Refactor for two factor authentification ## Code After: package at.ac.tuwien.inso.service; import at.ac.tuwien.inso.controller.lecturer.GradeAuthorizationDTO; import at.ac.tuwien.inso.entity.*; import org.springframework.security.access.prepost.*; import org.springframework.stereotype.*; import java.util.*; @Service public interface GradeService { @PreAuthorize("hasRole('LECTURER')") GradeAuthorizationDTO getDefaultGradeAuthorizationDTOForStudentAndCourse(Long studentId, Long courseId); @PreAuthorize("hasRole('LECTURER')") Grade saveNewGradeForStudentAndCourse(GradeAuthorizationDTO grade); @PreAuthorize("hasRole('LECTURER')") List<Grade> getGradesForCourseOfLoggedInLecturer(Long courseId); @PreAuthorize("hasRole('STUDENT')") List<Grade> getGradesForLoggedInStudent(); Grade getForValidation(String identifier); @PreAuthorize("isAuthenticated()") List<Grade> findAllOfStudent(Student student); @PreAuthorize("isAuthenticated()") List<Mark> getMarkOptions(); }
package at.ac.tuwien.inso.service; + import at.ac.tuwien.inso.controller.lecturer.GradeAuthorizationDTO; import at.ac.tuwien.inso.entity.*; import org.springframework.security.access.prepost.*; import org.springframework.stereotype.*; import java.util.*; @Service public interface GradeService { @PreAuthorize("hasRole('LECTURER')") - Grade getDefaultGradeForStudentAndCourse(Long studentId, Long courseId); + GradeAuthorizationDTO getDefaultGradeAuthorizationDTOForStudentAndCourse(Long studentId, Long courseId); ? ++++++++++++++++ ++++++++++++++++ @PreAuthorize("hasRole('LECTURER')") - Grade saveNewGradeForStudentAndCourse(Grade grade); + Grade saveNewGradeForStudentAndCourse(GradeAuthorizationDTO grade); ? ++++++++++++++++ @PreAuthorize("hasRole('LECTURER')") List<Grade> getGradesForCourseOfLoggedInLecturer(Long courseId); @PreAuthorize("hasRole('STUDENT')") List<Grade> getGradesForLoggedInStudent(); Grade getForValidation(String identifier); @PreAuthorize("isAuthenticated()") List<Grade> findAllOfStudent(Student student); + + @PreAuthorize("isAuthenticated()") + List<Mark> getMarkOptions(); }
8
0.285714
6
2
4c294c8edc1eaabd9473af9fe19d7ebc6fda9b3a
docs/RELEASE-NOTES.rst
docs/RELEASE-NOTES.rst
Release Notes for BIG-IP Controller for Cloud Foundry ===================================================== |release| --------- Added Functionality ^^^^^^^^^^^^^^^^^^^ * Support for TCP and HTTP routing. * Attach custom policy, profile, or health monitor to L7 objects created on the BIG-IP device. * Manages the following Local Traffic Manager (LTM) resources for the BIG-IP partition: * Virtual Servers * Pools * Pool members * Nodes * Policies * Rules * Actions * Conditions Limitations ^^^^^^^^^^^ * The BIG-IP Controller controls one (1) partition on the BIG-IP device. * Controller configurations are global: they apply to all L7 (HTTP) LTM objects in the designated BIG-IP partition. * This release supports custom policies and profiles for **L7 virtual servers** only. * Configured health monitor objects apply to all pools (both L4 and L7 routes). * SSL profile(s) defined in the application manifest do not attach to the HTTP virtual server. * Modification of a Controller-owned policy resulting in a state change may cause traffic flow interruptions. If the modification changes the state to ‘published’, the Controller will delete the policy and recreate it with a ‘legacy’ status. * The default route domain for a partition managed by an F5 controller cannot be changed once a controller has been deployed. To specify a new default route domain, a new partition should be used.
Release Notes for BIG-IP Controller for Cloud Foundry ===================================================== |release| --------- Added Functionality ^^^^^^^^^^^^^^^^^^^ * Support for TCP and HTTP routing. * Attach custom policy, profile, or health monitor to L7 objects created on the BIG-IP device. * Manages the following Local Traffic Manager (LTM) resources for the BIG-IP partition: * Virtual Servers * Pools * Pool members * Nodes * Policies * Rules * Actions * Conditions Limitations ^^^^^^^^^^^ * The BIG-IP Controller controls one (1) partition on the BIG-IP device. * Controller configurations are global: they apply to all L7 (HTTP) LTM objects in the designated BIG-IP partition. * This release supports custom policies and profiles for **L7 virtual servers** only. * Configured health monitor objects apply to all pools (both L4 and L7 routes). * SSL profile(s) defined in the application manifest do not attach to the HTTP virtual server. * Modification of a Controller-owned policy resulting in a state change may cause traffic flow interruptions. If the modification changes the state to ‘published’, the Controller will delete the policy and recreate it with a ‘legacy’ status. * You cannot change the default route domain for a partition managed by an F5 controller after the controller has deployed. To specify a new default route domain, use a different partition.
Fix grammar and style check errors
Fix grammar and style check errors Problem: The grammar and style check listed errors in the release notes. Solution: Fixed these error by changing to active voice.
reStructuredText
apache-2.0
dramich/cf-bigip-ctlr,dramich/cf-bigip-ctlr,ryan-talley/cf-bigip-ctlr,dramich/cf-bigip-ctlr,ryan-talley/cf-bigip-ctlr,ryan-talley/cf-bigip-ctlr,dramich/cf-bigip-ctlr,ryan-talley/cf-bigip-ctlr
restructuredtext
## Code Before: Release Notes for BIG-IP Controller for Cloud Foundry ===================================================== |release| --------- Added Functionality ^^^^^^^^^^^^^^^^^^^ * Support for TCP and HTTP routing. * Attach custom policy, profile, or health monitor to L7 objects created on the BIG-IP device. * Manages the following Local Traffic Manager (LTM) resources for the BIG-IP partition: * Virtual Servers * Pools * Pool members * Nodes * Policies * Rules * Actions * Conditions Limitations ^^^^^^^^^^^ * The BIG-IP Controller controls one (1) partition on the BIG-IP device. * Controller configurations are global: they apply to all L7 (HTTP) LTM objects in the designated BIG-IP partition. * This release supports custom policies and profiles for **L7 virtual servers** only. * Configured health monitor objects apply to all pools (both L4 and L7 routes). * SSL profile(s) defined in the application manifest do not attach to the HTTP virtual server. * Modification of a Controller-owned policy resulting in a state change may cause traffic flow interruptions. If the modification changes the state to ‘published’, the Controller will delete the policy and recreate it with a ‘legacy’ status. * The default route domain for a partition managed by an F5 controller cannot be changed once a controller has been deployed. To specify a new default route domain, a new partition should be used. ## Instruction: Fix grammar and style check errors Problem: The grammar and style check listed errors in the release notes. Solution: Fixed these error by changing to active voice. ## Code After: Release Notes for BIG-IP Controller for Cloud Foundry ===================================================== |release| --------- Added Functionality ^^^^^^^^^^^^^^^^^^^ * Support for TCP and HTTP routing. * Attach custom policy, profile, or health monitor to L7 objects created on the BIG-IP device. * Manages the following Local Traffic Manager (LTM) resources for the BIG-IP partition: * Virtual Servers * Pools * Pool members * Nodes * Policies * Rules * Actions * Conditions Limitations ^^^^^^^^^^^ * The BIG-IP Controller controls one (1) partition on the BIG-IP device. * Controller configurations are global: they apply to all L7 (HTTP) LTM objects in the designated BIG-IP partition. * This release supports custom policies and profiles for **L7 virtual servers** only. * Configured health monitor objects apply to all pools (both L4 and L7 routes). * SSL profile(s) defined in the application manifest do not attach to the HTTP virtual server. * Modification of a Controller-owned policy resulting in a state change may cause traffic flow interruptions. If the modification changes the state to ‘published’, the Controller will delete the policy and recreate it with a ‘legacy’ status. * You cannot change the default route domain for a partition managed by an F5 controller after the controller has deployed. To specify a new default route domain, use a different partition.
Release Notes for BIG-IP Controller for Cloud Foundry ===================================================== |release| --------- Added Functionality ^^^^^^^^^^^^^^^^^^^ * Support for TCP and HTTP routing. * Attach custom policy, profile, or health monitor to L7 objects created on the BIG-IP device. * Manages the following Local Traffic Manager (LTM) resources for the BIG-IP partition: * Virtual Servers * Pools * Pool members * Nodes * Policies * Rules * Actions * Conditions Limitations ^^^^^^^^^^^ * The BIG-IP Controller controls one (1) partition on the BIG-IP device. * Controller configurations are global: they apply to all L7 (HTTP) LTM objects in the designated BIG-IP partition. * This release supports custom policies and profiles for **L7 virtual servers** only. * Configured health monitor objects apply to all pools (both L4 and L7 routes). * SSL profile(s) defined in the application manifest do not attach to the HTTP virtual server. * Modification of a Controller-owned policy resulting in a state change may cause traffic flow interruptions. If the modification changes the state to ‘published’, the Controller will delete the policy and recreate it with a ‘legacy’ status. - * The default route domain for a partition managed by an F5 controller cannot be changed once a controller has been deployed. To specify a new default route domain, a new partition should be used. ? ^ - ^^^ ^ --------------- ----- ^^ --------------- + * You cannot change the default route domain for a partition managed by an F5 controller after the controller has deployed. To specify a new default route domain, use a different partition. ? ^^^^^^^^^^^^^^^^^^^ ^ ++ ^^ ++++ +++++++ ^
2
0.060606
1
1
2fdc5943bc6f23c6d56d6bb86e6a5bf33338237e
digikey/admin.py
digikey/admin.py
from django.contrib import admin from digikey.models import Components, Orders, Order_Details, Groups class ComponentInline(admin.TabularInline): model = Order_Details extra = 1 class OrderInline(admin.TabularInline): model = Orders extra = 1 fieldsets = [ ('Payment information', {'fields': ['paid', 'paid_account', 'paid_date']}), ('Additional Shipping information', {'fields': ['receiver', 'shipping_address', 'phone_number']}), ] @admin.register(Orders) class OrderAdmin(admin.ModelAdmin): list_display = ('pk', 'group_id','paid', 'sent') fieldsets = [ (None, {'fields': ['Orderer', 'group_id']}), ('Payment information', {'fields': ['paid', 'paid_account', 'paid_date']}), ('Uplink information', {'fields': ['sent', 'sent_date']}), ('Additional Shipping information', {'fields': ['receiver', 'shipping_address', 'phone_number']}), ] inlines = [ComponentInline] @admin.register(Groups) class GroupAdmin(admin.ModelAdmin): fieldsets = [ (None, {'fields': ['ordered', 'orderdate']}), ] inlines = [OrderInline] @admin.register(Components) class ComponentAdmin(admin.ModelAdmin): list_display = ('part_number','unit_price')
from django.contrib import admin from digikey.models import Components, Orders, Order_Details, Groups class ComponentInline(admin.TabularInline): model = Order_Details extra = 1 class OrderInline(admin.TabularInline): model = Orders extra = 1 fieldsets = [ ('Payment information', {'fields': ['paid', 'paid_account', 'paid_date']}), ('Additional Shipping information', {'fields': ['receiver', 'shipping_address', 'phone_number']}), ] @admin.register(Orders) class OrderAdmin(admin.ModelAdmin): list_filter = ['sent', 'paid', 'sent_date'] list_display = ('pk', 'group_id','paid', 'sent') fieldsets = [ (None, {'fields': ['Orderer', 'group_id']}), ('Payment information', {'fields': ['paid', 'paid_account', 'paid_date']}), ('Uplink information', {'fields': ['sent', 'sent_date']}), ('Additional Shipping information', {'fields': ['receiver', 'shipping_address', 'phone_number']}), ] inlines = [ComponentInline] @admin.register(Groups) class GroupAdmin(admin.ModelAdmin): list_filter = ['ordered', 'orderdate'] fieldsets = [ (None, {'fields': ['ordered', 'orderdate']}), ] inlines = [OrderInline] @admin.register(Components) class ComponentAdmin(admin.ModelAdmin): list_display = ('part_number','unit_price')
Add Filter option for order amd order group
Add Filter option for order amd order group
Python
mit
sonicyang/chiphub,sonicyang/chiphub,sonicyang/chiphub
python
## Code Before: from django.contrib import admin from digikey.models import Components, Orders, Order_Details, Groups class ComponentInline(admin.TabularInline): model = Order_Details extra = 1 class OrderInline(admin.TabularInline): model = Orders extra = 1 fieldsets = [ ('Payment information', {'fields': ['paid', 'paid_account', 'paid_date']}), ('Additional Shipping information', {'fields': ['receiver', 'shipping_address', 'phone_number']}), ] @admin.register(Orders) class OrderAdmin(admin.ModelAdmin): list_display = ('pk', 'group_id','paid', 'sent') fieldsets = [ (None, {'fields': ['Orderer', 'group_id']}), ('Payment information', {'fields': ['paid', 'paid_account', 'paid_date']}), ('Uplink information', {'fields': ['sent', 'sent_date']}), ('Additional Shipping information', {'fields': ['receiver', 'shipping_address', 'phone_number']}), ] inlines = [ComponentInline] @admin.register(Groups) class GroupAdmin(admin.ModelAdmin): fieldsets = [ (None, {'fields': ['ordered', 'orderdate']}), ] inlines = [OrderInline] @admin.register(Components) class ComponentAdmin(admin.ModelAdmin): list_display = ('part_number','unit_price') ## Instruction: Add Filter option for order amd order group ## Code After: from django.contrib import admin from digikey.models import Components, Orders, Order_Details, Groups class ComponentInline(admin.TabularInline): model = Order_Details extra = 1 class OrderInline(admin.TabularInline): model = Orders extra = 1 fieldsets = [ ('Payment information', {'fields': ['paid', 'paid_account', 'paid_date']}), ('Additional Shipping information', {'fields': ['receiver', 'shipping_address', 'phone_number']}), ] @admin.register(Orders) class OrderAdmin(admin.ModelAdmin): list_filter = ['sent', 'paid', 'sent_date'] list_display = ('pk', 'group_id','paid', 'sent') fieldsets = [ (None, {'fields': ['Orderer', 'group_id']}), ('Payment information', {'fields': ['paid', 'paid_account', 'paid_date']}), ('Uplink information', {'fields': ['sent', 'sent_date']}), ('Additional Shipping information', {'fields': ['receiver', 'shipping_address', 'phone_number']}), ] inlines = [ComponentInline] @admin.register(Groups) class GroupAdmin(admin.ModelAdmin): list_filter = ['ordered', 'orderdate'] fieldsets = [ (None, {'fields': ['ordered', 'orderdate']}), ] inlines = [OrderInline] @admin.register(Components) class ComponentAdmin(admin.ModelAdmin): list_display = ('part_number','unit_price')
from django.contrib import admin from digikey.models import Components, Orders, Order_Details, Groups class ComponentInline(admin.TabularInline): model = Order_Details extra = 1 class OrderInline(admin.TabularInline): model = Orders extra = 1 fieldsets = [ ('Payment information', {'fields': ['paid', 'paid_account', 'paid_date']}), ('Additional Shipping information', {'fields': ['receiver', 'shipping_address', 'phone_number']}), ] @admin.register(Orders) class OrderAdmin(admin.ModelAdmin): + list_filter = ['sent', 'paid', 'sent_date'] list_display = ('pk', 'group_id','paid', 'sent') fieldsets = [ (None, {'fields': ['Orderer', 'group_id']}), ('Payment information', {'fields': ['paid', 'paid_account', 'paid_date']}), ('Uplink information', {'fields': ['sent', 'sent_date']}), ('Additional Shipping information', {'fields': ['receiver', 'shipping_address', 'phone_number']}), ] inlines = [ComponentInline] @admin.register(Groups) class GroupAdmin(admin.ModelAdmin): + list_filter = ['ordered', 'orderdate'] fieldsets = [ (None, {'fields': ['ordered', 'orderdate']}), ] inlines = [OrderInline] @admin.register(Components) class ComponentAdmin(admin.ModelAdmin): list_display = ('part_number','unit_price')
2
0.051282
2
0
289563d09764475bcf432c7dbbed9e92c6b7688a
src/widgets/Wizard.js
src/widgets/Wizard.js
/* eslint-disable import/no-named-as-default */ /* eslint-disable react/forbid-prop-types */ import React from 'react'; import PropTypes from 'prop-types'; import { StepsTracker } from './StepsTracker'; import { TabNavigator } from './TabNavigator'; import DataTablePageView from './DataTablePageView'; /** * Layout component for a Tracker and TabNavigator, displaying steps * to completion for completion. See TabNavigator and StepsTracker * for individual component implementation. */ export const Wizard = ({ tabs, titles, onPress, currentTabIndex }) => ( <DataTablePageView> <StepsTracker numberOfSteps={tabs.length} currentStep={currentTabIndex} onPress={onPress} titles={titles} /> <TabNavigator tabs={tabs} currentTabIndex={currentTabIndex} /> </DataTablePageView> ); Wizard.propTypes = { tabs: PropTypes.array.isRequired, titles: PropTypes.array.isRequired, onPress: PropTypes.func.isRequired, currentTabIndex: PropTypes.number.isRequired, };
/* eslint-disable import/no-named-as-default */ /* eslint-disable react/forbid-prop-types */ import React from 'react'; import PropTypes from 'prop-types'; import { Stepper } from './Stepper'; import { TabNavigator } from './TabNavigator'; import DataTablePageView from './DataTablePageView'; /** * Layout component for a Tracker and TabNavigator, displaying steps * to completion for completion. See TabNavigator and StepsTracker * for individual component implementation. */ export const Wizard = ({ tabs, titles, onPress, currentTabIndex }) => ( <DataTablePageView> <Stepper numberOfSteps={tabs.length} currentStep={currentTabIndex} onPress={onPress} titles={titles} /> <TabNavigator tabs={tabs} currentTabIndex={currentTabIndex} /> </DataTablePageView> ); Wizard.propTypes = { tabs: PropTypes.array.isRequired, titles: PropTypes.array.isRequired, onPress: PropTypes.func.isRequired, currentTabIndex: PropTypes.number.isRequired, };
Add rename use of Stepper
Add rename use of Stepper
JavaScript
mit
sussol/mobile,sussol/mobile,sussol/mobile,sussol/mobile
javascript
## Code Before: /* eslint-disable import/no-named-as-default */ /* eslint-disable react/forbid-prop-types */ import React from 'react'; import PropTypes from 'prop-types'; import { StepsTracker } from './StepsTracker'; import { TabNavigator } from './TabNavigator'; import DataTablePageView from './DataTablePageView'; /** * Layout component for a Tracker and TabNavigator, displaying steps * to completion for completion. See TabNavigator and StepsTracker * for individual component implementation. */ export const Wizard = ({ tabs, titles, onPress, currentTabIndex }) => ( <DataTablePageView> <StepsTracker numberOfSteps={tabs.length} currentStep={currentTabIndex} onPress={onPress} titles={titles} /> <TabNavigator tabs={tabs} currentTabIndex={currentTabIndex} /> </DataTablePageView> ); Wizard.propTypes = { tabs: PropTypes.array.isRequired, titles: PropTypes.array.isRequired, onPress: PropTypes.func.isRequired, currentTabIndex: PropTypes.number.isRequired, }; ## Instruction: Add rename use of Stepper ## Code After: /* eslint-disable import/no-named-as-default */ /* eslint-disable react/forbid-prop-types */ import React from 'react'; import PropTypes from 'prop-types'; import { Stepper } from './Stepper'; import { TabNavigator } from './TabNavigator'; import DataTablePageView from './DataTablePageView'; /** * Layout component for a Tracker and TabNavigator, displaying steps * to completion for completion. See TabNavigator and StepsTracker * for individual component implementation. */ export const Wizard = ({ tabs, titles, onPress, currentTabIndex }) => ( <DataTablePageView> <Stepper numberOfSteps={tabs.length} currentStep={currentTabIndex} onPress={onPress} titles={titles} /> <TabNavigator tabs={tabs} currentTabIndex={currentTabIndex} /> </DataTablePageView> ); Wizard.propTypes = { tabs: PropTypes.array.isRequired, titles: PropTypes.array.isRequired, onPress: PropTypes.func.isRequired, currentTabIndex: PropTypes.number.isRequired, };
/* eslint-disable import/no-named-as-default */ /* eslint-disable react/forbid-prop-types */ import React from 'react'; import PropTypes from 'prop-types'; - import { StepsTracker } from './StepsTracker'; ? ^^^^^^ ^^^^^^ + import { Stepper } from './Stepper'; ? ^ ^ import { TabNavigator } from './TabNavigator'; import DataTablePageView from './DataTablePageView'; /** * Layout component for a Tracker and TabNavigator, displaying steps * to completion for completion. See TabNavigator and StepsTracker * for individual component implementation. */ export const Wizard = ({ tabs, titles, onPress, currentTabIndex }) => ( <DataTablePageView> - <StepsTracker ? ^^^^^^ + <Stepper ? ^ numberOfSteps={tabs.length} currentStep={currentTabIndex} onPress={onPress} titles={titles} /> <TabNavigator tabs={tabs} currentTabIndex={currentTabIndex} /> </DataTablePageView> ); Wizard.propTypes = { tabs: PropTypes.array.isRequired, titles: PropTypes.array.isRequired, onPress: PropTypes.func.isRequired, currentTabIndex: PropTypes.number.isRequired, };
4
0.125
2
2
5ebed26734ffe2987b289cf9f1ac414fa0525a45
README.md
README.md
elegant-git =========== Allows easy handle git tasks. [![Build Status](https://travis-ci.org/bees-hive/elegant-git.svg?branch=master)](https://travis-ci.org/bees-hive/elegant-git) [![PDD status](http://www.0pdd.com/svg?name=bees-hive/elegant-git)](http://www.0pdd.com/p?name=bees-hive/elegant-git) [![Rultor.com](http://www.rultor.com/b/bees-hive/elegant-git)](http://www.rultor.com/p/bees-hive/elegant-git) Installation ============ Manual ------ `curl https://raw.githubusercontent.com/extsoft/elegant-git/master/install.bash | $(which bash)` Homebrew -------- `brew install extsoft/insight/elegant-git` To find out more [click here](https://github.com/extsoft/homebrew-insight). Usage ===== ```bash $ git elegant feature pull push push-after-rebase rebase init clone add clear-local ``` Development =========== Please follow [CONTRIBUTING.md](CONTRIBUTING.md) when working with the code.
elegant-git =========== Allows easy handle git tasks. [![Build Status](https://travis-ci.org/bees-hive/elegant-git.svg?branch=master)](https://travis-ci.org/bees-hive/elegant-git) [![PDD status](http://www.0pdd.com/svg?name=bees-hive/elegant-git)](http://www.0pdd.com/p?name=bees-hive/elegant-git) [![Rultor.com](http://www.rultor.com/b/bees-hive/elegant-git)](http://www.rultor.com/p/bees-hive/elegant-git) Installation ============ Manual ------ `curl https://raw.githubusercontent.com/bees-hive/elegant-git/master/install.bash | $(which bash)` Homebrew -------- `brew install bees-hive/hive/elegant-git` To find out more [click here](https://github.com/bees-hive/homebrew-hive). Usage ===== ```bash $ git elegant feature pull push push-after-rebase rebase init clone add clear-local ``` Development =========== Please follow [CONTRIBUTING.md](CONTRIBUTING.md) when working with the code.
Update installation for the Bees Hive organization
Update installation for the Bees Hive organization
Markdown
apache-2.0
extsoft/elegant-git
markdown
## Code Before: elegant-git =========== Allows easy handle git tasks. [![Build Status](https://travis-ci.org/bees-hive/elegant-git.svg?branch=master)](https://travis-ci.org/bees-hive/elegant-git) [![PDD status](http://www.0pdd.com/svg?name=bees-hive/elegant-git)](http://www.0pdd.com/p?name=bees-hive/elegant-git) [![Rultor.com](http://www.rultor.com/b/bees-hive/elegant-git)](http://www.rultor.com/p/bees-hive/elegant-git) Installation ============ Manual ------ `curl https://raw.githubusercontent.com/extsoft/elegant-git/master/install.bash | $(which bash)` Homebrew -------- `brew install extsoft/insight/elegant-git` To find out more [click here](https://github.com/extsoft/homebrew-insight). Usage ===== ```bash $ git elegant feature pull push push-after-rebase rebase init clone add clear-local ``` Development =========== Please follow [CONTRIBUTING.md](CONTRIBUTING.md) when working with the code. ## Instruction: Update installation for the Bees Hive organization ## Code After: elegant-git =========== Allows easy handle git tasks. [![Build Status](https://travis-ci.org/bees-hive/elegant-git.svg?branch=master)](https://travis-ci.org/bees-hive/elegant-git) [![PDD status](http://www.0pdd.com/svg?name=bees-hive/elegant-git)](http://www.0pdd.com/p?name=bees-hive/elegant-git) [![Rultor.com](http://www.rultor.com/b/bees-hive/elegant-git)](http://www.rultor.com/p/bees-hive/elegant-git) Installation ============ Manual ------ `curl https://raw.githubusercontent.com/bees-hive/elegant-git/master/install.bash | $(which bash)` Homebrew -------- `brew install bees-hive/hive/elegant-git` To find out more [click here](https://github.com/bees-hive/homebrew-hive). Usage ===== ```bash $ git elegant feature pull push push-after-rebase rebase init clone add clear-local ``` Development =========== Please follow [CONTRIBUTING.md](CONTRIBUTING.md) when working with the code.
elegant-git =========== Allows easy handle git tasks. [![Build Status](https://travis-ci.org/bees-hive/elegant-git.svg?branch=master)](https://travis-ci.org/bees-hive/elegant-git) [![PDD status](http://www.0pdd.com/svg?name=bees-hive/elegant-git)](http://www.0pdd.com/p?name=bees-hive/elegant-git) [![Rultor.com](http://www.rultor.com/b/bees-hive/elegant-git)](http://www.rultor.com/p/bees-hive/elegant-git) Installation ============ Manual ------ - `curl https://raw.githubusercontent.com/extsoft/elegant-git/master/install.bash | $(which bash)` ? ^^ ^^^ + `curl https://raw.githubusercontent.com/bees-hive/elegant-git/master/install.bash | $(which bash)` ? + ^ ^^^^^ Homebrew -------- - `brew install extsoft/insight/elegant-git` + `brew install bees-hive/hive/elegant-git` - To find out more [click here](https://github.com/extsoft/homebrew-insight). ? ^^ ^^^ ^^^^^^ + To find out more [click here](https://github.com/bees-hive/homebrew-hive). ? + ^ ^^^^^ + ^^ Usage ===== ```bash $ git elegant feature pull push push-after-rebase rebase init clone add clear-local ``` Development =========== Please follow [CONTRIBUTING.md](CONTRIBUTING.md) when working with the code.
6
0.153846
3
3
5e85ee5a6fb16324d7e8e52ea455dbfd19d0bf70
build/tfs/darwin/smoketest.sh
build/tfs/darwin/smoketest.sh
. ./build/tfs/common/node.sh . ./scripts/env.sh . ./build/tfs/common/common.sh export VSCODE_MIXIN_PASSWORD="$1" VSO_PAT="$2" echo "machine monacotools.visualstudio.com password $VSO_PAT" > ~/.netrc step "Install dependencies" \ npm install step "Mix in repository from vscode-distro" \ npm run gulp -- mixin step "Install distro dependencies" \ node build/tfs/common/installDistro.js step "Build minified & upload source maps" \ npm run gulp -- vscode-darwin-min step "Run smoke test" \ pushd test/smoke npm install npm run smoketest -- --build "$AGENT_BUILDDIRECTORY/VSCode-darwin/Visual Studio Code - Insiders.app/Contents/MacOS/Electron" --screenshot popd
. ./build/tfs/common/node.sh . ./scripts/env.sh . ./build/tfs/common/common.sh export VSCODE_MIXIN_PASSWORD="$1" VSO_PAT="$2" echo "machine monacotools.visualstudio.com password $VSO_PAT" > ~/.netrc step "Install dependencies" \ npm install step "Mix in repository from vscode-distro" \ npm run gulp -- mixin step "Install distro dependencies" \ node build/tfs/common/installDistro.js step "Build minified & upload source maps" \ npm run gulp -- vscode-darwin-min step "Run smoke test" \ pushd test/smoke npm install mocha --build "$AGENT_BUILDDIRECTORY/VSCode-darwin/Visual Studio Code - Insiders.app/Contents/MacOS/Electron" --screenshot popd
Test smoke test on build
Test smoke test on build
Shell
mit
stringham/vscode,joaomoreno/vscode,joaomoreno/vscode,cleidigh/vscode,gagangupt16/vscode,Microsoft/vscode,0xmohit/vscode,Krzysztof-Cieslak/vscode,Microsoft/vscode,microsoft/vscode,Zalastax/vscode,gagangupt16/vscode,Krzysztof-Cieslak/vscode,stringham/vscode,microsoft/vscode,hoovercj/vscode,landonepps/vscode,stringham/vscode,cleidigh/vscode,cleidigh/vscode,microlv/vscode,veeramarni/vscode,microlv/vscode,KattMingMing/vscode,eamodio/vscode,joaomoreno/vscode,rishii7/vscode,eamodio/vscode,microsoft/vscode,Microsoft/vscode,microsoft/vscode,joaomoreno/vscode,veeramarni/vscode,0xmohit/vscode,microlv/vscode,Krzysztof-Cieslak/vscode,KattMingMing/vscode,cleidigh/vscode,veeramarni/vscode,rishii7/vscode,gagangupt16/vscode,cleidigh/vscode,mjbvz/vscode,KattMingMing/vscode,veeramarni/vscode,the-ress/vscode,Zalastax/vscode,mjbvz/vscode,0xmohit/vscode,joaomoreno/vscode,gagangupt16/vscode,Krzysztof-Cieslak/vscode,DustinCampbell/vscode,rishii7/vscode,joaomoreno/vscode,gagangupt16/vscode,veeramarni/vscode,landonepps/vscode,Krzysztof-Cieslak/vscode,veeramarni/vscode,0xmohit/vscode,joaomoreno/vscode,veeramarni/vscode,hoovercj/vscode,microsoft/vscode,microsoft/vscode,DustinCampbell/vscode,0xmohit/vscode,cleidigh/vscode,eamodio/vscode,hoovercj/vscode,KattMingMing/vscode,the-ress/vscode,microsoft/vscode,microsoft/vscode,stringham/vscode,Zalastax/vscode,Microsoft/vscode,hoovercj/vscode,joaomoreno/vscode,Krzysztof-Cieslak/vscode,Zalastax/vscode,mjbvz/vscode,KattMingMing/vscode,the-ress/vscode,microlv/vscode,the-ress/vscode,eamodio/vscode,0xmohit/vscode,eamodio/vscode,eamodio/vscode,0xmohit/vscode,the-ress/vscode,Krzysztof-Cieslak/vscode,stringham/vscode,eamodio/vscode,Microsoft/vscode,hoovercj/vscode,rishii7/vscode,DustinCampbell/vscode,cra0zy/VSCode,gagangupt16/vscode,joaomoreno/vscode,mjbvz/vscode,microsoft/vscode,Microsoft/vscode,gagangupt16/vscode,mjbvz/vscode,eamodio/vscode,hoovercj/vscode,landonepps/vscode,KattMingMing/vscode,cleidigh/vscode,Zalastax/vscode,mjbvz/vscode,Microsoft/vscode,mjbvz/vscode,hoovercj/vscode,hoovercj/vscode,landonepps/vscode,the-ress/vscode,landonepps/vscode,landonepps/vscode,gagangupt16/vscode,Zalastax/vscode,rishii7/vscode,mjbvz/vscode,cleidigh/vscode,gagangupt16/vscode,veeramarni/vscode,joaomoreno/vscode,Krzysztof-Cieslak/vscode,joaomoreno/vscode,landonepps/vscode,microsoft/vscode,mjbvz/vscode,mjbvz/vscode,rishii7/vscode,Krzysztof-Cieslak/vscode,microlv/vscode,0xmohit/vscode,the-ress/vscode,DustinCampbell/vscode,Microsoft/vscode,Zalastax/vscode,gagangupt16/vscode,KattMingMing/vscode,mjbvz/vscode,DustinCampbell/vscode,DustinCampbell/vscode,cleidigh/vscode,hoovercj/vscode,Zalastax/vscode,veeramarni/vscode,rishii7/vscode,landonepps/vscode,stringham/vscode,microsoft/vscode,0xmohit/vscode,landonepps/vscode,eamodio/vscode,stringham/vscode,microlv/vscode,veeramarni/vscode,mjbvz/vscode,microsoft/vscode,hoovercj/vscode,rishii7/vscode,cleidigh/vscode,DustinCampbell/vscode,DustinCampbell/vscode,Krzysztof-Cieslak/vscode,Zalastax/vscode,KattMingMing/vscode,microlv/vscode,cleidigh/vscode,microsoft/vscode,Microsoft/vscode,joaomoreno/vscode,Zalastax/vscode,landonepps/vscode,KattMingMing/vscode,hoovercj/vscode,gagangupt16/vscode,DustinCampbell/vscode,the-ress/vscode,0xmohit/vscode,stringham/vscode,0xmohit/vscode,landonepps/vscode,0xmohit/vscode,Zalastax/vscode,microlv/vscode,joaomoreno/vscode,landonepps/vscode,microlv/vscode,Microsoft/vscode,KattMingMing/vscode,0xmohit/vscode,DustinCampbell/vscode,0xmohit/vscode,landonepps/vscode,Zalastax/vscode,microsoft/vscode,microlv/vscode,Krzysztof-Cieslak/vscode,Microsoft/vscode,stringham/vscode,KattMingMing/vscode,veeramarni/vscode,veeramarni/vscode,Microsoft/vscode,Krzysztof-Cieslak/vscode,gagangupt16/vscode,stringham/vscode,gagangupt16/vscode,veeramarni/vscode,Zalastax/vscode,cleidigh/vscode,the-ress/vscode,Zalastax/vscode,microlv/vscode,DustinCampbell/vscode,stringham/vscode,stringham/vscode,KattMingMing/vscode,joaomoreno/vscode,the-ress/vscode,stringham/vscode,rishii7/vscode,hoovercj/vscode,veeramarni/vscode,rishii7/vscode,hoovercj/vscode,joaomoreno/vscode,stringham/vscode,eamodio/vscode,stringham/vscode,cleidigh/vscode,microlv/vscode,landonepps/vscode,hoovercj/vscode,mjbvz/vscode,veeramarni/vscode,microlv/vscode,0xmohit/vscode,rishii7/vscode,Krzysztof-Cieslak/vscode,Microsoft/vscode,0xmohit/vscode,rishii7/vscode,Zalastax/vscode,DustinCampbell/vscode,mjbvz/vscode,hoovercj/vscode,KattMingMing/vscode,the-ress/vscode,eamodio/vscode,joaomoreno/vscode,hoovercj/vscode,landonepps/vscode,cleidigh/vscode,rishii7/vscode,rishii7/vscode,eamodio/vscode,microlv/vscode,mjbvz/vscode,DustinCampbell/vscode,DustinCampbell/vscode,microlv/vscode,cleidigh/vscode,the-ress/vscode,KattMingMing/vscode,gagangupt16/vscode,Microsoft/vscode,the-ress/vscode,Microsoft/vscode,microlv/vscode,microlv/vscode,DustinCampbell/vscode,KattMingMing/vscode,mjbvz/vscode,eamodio/vscode,stringham/vscode,the-ress/vscode,KattMingMing/vscode,stringham/vscode,eamodio/vscode,Krzysztof-Cieslak/vscode,cleidigh/vscode,Krzysztof-Cieslak/vscode,gagangupt16/vscode,Microsoft/vscode,eamodio/vscode,landonepps/vscode,rishii7/vscode,cleidigh/vscode,Zalastax/vscode,microsoft/vscode,landonepps/vscode,eamodio/vscode,rishii7/vscode,hoovercj/vscode,Krzysztof-Cieslak/vscode,veeramarni/vscode,veeramarni/vscode,DustinCampbell/vscode,mjbvz/vscode,Microsoft/vscode,0xmohit/vscode,rishii7/vscode,microsoft/vscode,DustinCampbell/vscode,KattMingMing/vscode,the-ress/vscode,joaomoreno/vscode,the-ress/vscode,Zalastax/vscode,gagangupt16/vscode,microsoft/vscode,Krzysztof-Cieslak/vscode,eamodio/vscode,gagangupt16/vscode
shell
## Code Before: . ./build/tfs/common/node.sh . ./scripts/env.sh . ./build/tfs/common/common.sh export VSCODE_MIXIN_PASSWORD="$1" VSO_PAT="$2" echo "machine monacotools.visualstudio.com password $VSO_PAT" > ~/.netrc step "Install dependencies" \ npm install step "Mix in repository from vscode-distro" \ npm run gulp -- mixin step "Install distro dependencies" \ node build/tfs/common/installDistro.js step "Build minified & upload source maps" \ npm run gulp -- vscode-darwin-min step "Run smoke test" \ pushd test/smoke npm install npm run smoketest -- --build "$AGENT_BUILDDIRECTORY/VSCode-darwin/Visual Studio Code - Insiders.app/Contents/MacOS/Electron" --screenshot popd ## Instruction: Test smoke test on build ## Code After: . ./build/tfs/common/node.sh . ./scripts/env.sh . ./build/tfs/common/common.sh export VSCODE_MIXIN_PASSWORD="$1" VSO_PAT="$2" echo "machine monacotools.visualstudio.com password $VSO_PAT" > ~/.netrc step "Install dependencies" \ npm install step "Mix in repository from vscode-distro" \ npm run gulp -- mixin step "Install distro dependencies" \ node build/tfs/common/installDistro.js step "Build minified & upload source maps" \ npm run gulp -- vscode-darwin-min step "Run smoke test" \ pushd test/smoke npm install mocha --build "$AGENT_BUILDDIRECTORY/VSCode-darwin/Visual Studio Code - Insiders.app/Contents/MacOS/Electron" --screenshot popd
. ./build/tfs/common/node.sh . ./scripts/env.sh . ./build/tfs/common/common.sh export VSCODE_MIXIN_PASSWORD="$1" VSO_PAT="$2" echo "machine monacotools.visualstudio.com password $VSO_PAT" > ~/.netrc step "Install dependencies" \ npm install step "Mix in repository from vscode-distro" \ npm run gulp -- mixin step "Install distro dependencies" \ node build/tfs/common/installDistro.js step "Build minified & upload source maps" \ npm run gulp -- vscode-darwin-min step "Run smoke test" \ pushd test/smoke npm install - npm run smoketest -- --build "$AGENT_BUILDDIRECTORY/VSCode-darwin/Visual Studio Code - Insiders.app/Contents/MacOS/Electron" --screenshot ? --------- ^^^^^^^^^ + mocha --build "$AGENT_BUILDDIRECTORY/VSCode-darwin/Visual Studio Code - Insiders.app/Contents/MacOS/Electron" --screenshot ? ^^^ popd
2
0.074074
1
1
14842ecc917c60d154b185b80fafe69b83799742
README.md
README.md
Hub === A Hub for all JH modules, which will include Flexi-Time, Over Time &amp; Holiday management
Hub === [![Build Status](https://travis-ci.org/WeareJH/Hub.svg?branch=master)](https://travis-ci.org/WeareJH/Hub) [![Coverage Status](https://coveralls.io/repos/WeareJH/Hub/badge.png?branch=master)](https://coveralls.io/r/WeareJH/Hub?branch=master) [![Dependency Status](https://www.versioneye.com/user/projects/533c71b67bae4be7ee0001c7/badge.png)](https://www.versioneye.com/user/projects/533c71b67bae4be7ee0001c7) A Hub for all JH modules, which will include Flexi-Time, Over Time &amp; Holiday management
Add travis, coveralls & versioneye badges
Add travis, coveralls & versioneye badges
Markdown
mit
WeareJH/Hub,WeareJH/Hub,WeareJH/Hub
markdown
## Code Before: Hub === A Hub for all JH modules, which will include Flexi-Time, Over Time &amp; Holiday management ## Instruction: Add travis, coveralls & versioneye badges ## Code After: Hub === [![Build Status](https://travis-ci.org/WeareJH/Hub.svg?branch=master)](https://travis-ci.org/WeareJH/Hub) [![Coverage Status](https://coveralls.io/repos/WeareJH/Hub/badge.png?branch=master)](https://coveralls.io/r/WeareJH/Hub?branch=master) [![Dependency Status](https://www.versioneye.com/user/projects/533c71b67bae4be7ee0001c7/badge.png)](https://www.versioneye.com/user/projects/533c71b67bae4be7ee0001c7) A Hub for all JH modules, which will include Flexi-Time, Over Time &amp; Holiday management
Hub === + [![Build Status](https://travis-ci.org/WeareJH/Hub.svg?branch=master)](https://travis-ci.org/WeareJH/Hub) + [![Coverage Status](https://coveralls.io/repos/WeareJH/Hub/badge.png?branch=master)](https://coveralls.io/r/WeareJH/Hub?branch=master) + [![Dependency Status](https://www.versioneye.com/user/projects/533c71b67bae4be7ee0001c7/badge.png)](https://www.versioneye.com/user/projects/533c71b67bae4be7ee0001c7) A Hub for all JH modules, which will include Flexi-Time, Over Time &amp; Holiday management
3
0.75
3
0
cd0c50a29840d29e20ea7fa6e772f064f4c5adf3
bemuse/src/game/game-scene.js
bemuse/src/game/game-scene.js
import $ from 'jquery' export default function GameScene(display) { return function (container) { let handler = () => false $(window).on('touchstart', handler) showCanvas(display, container) return { teardown() { $(window).off('touchstart', handler) }, } } } function showCanvas(display, container) { var { view, wrapper } = display var { width, height } = view container.appendChild(wrapper) resize() $(window).on('resize', resize) function resize() { var scale = Math.min(window.innerWidth / width, window.innerHeight / height) view.style.width = Math.round(width * scale) + 'px' view.style.height = Math.round(height * scale) + 'px' wrapper.style.width = Math.round(width * scale) + 'px' wrapper.style.height = Math.round(height * scale) + 'px' var yOffset = (window.innerHeight - height * scale) / 2 wrapper.style.marginTop = Math.round(yOffset) + 'px' } return wrapper }
import $ from 'jquery' export default function GameScene(display) { return function (container) { let handler = () => false $(window).on('touchstart', handler) showCanvas(display, container) return { teardown() { $(window).off('touchstart', handler) }, } } } function showCanvas(display, container) { var { view, wrapper } = display var { width, height } = view container.appendChild(wrapper) container.addEventListener('touchstart', disableContextMenu) function disableContextMenu() { container.removeEventListener('touchstart', disableContextMenu) container.addEventListener('contextmenu', e => { e.preventDefault() }) } resize() $(window).on('resize', resize) function resize() { var scale = Math.min(window.innerWidth / width, window.innerHeight / height) view.style.width = Math.round(width * scale) + 'px' view.style.height = Math.round(height * scale) + 'px' wrapper.style.width = Math.round(width * scale) + 'px' wrapper.style.height = Math.round(height * scale) + 'px' var yOffset = (window.innerHeight - height * scale) / 2 wrapper.style.marginTop = Math.round(yOffset) + 'px' } return wrapper }
Fix accidental context menu opening in Windows
Fix accidental context menu opening in Windows
JavaScript
agpl-3.0
bemusic/bemuse,bemusic/bemuse,bemusic/bemuse,bemusic/bemuse,bemusic/bemuse
javascript
## Code Before: import $ from 'jquery' export default function GameScene(display) { return function (container) { let handler = () => false $(window).on('touchstart', handler) showCanvas(display, container) return { teardown() { $(window).off('touchstart', handler) }, } } } function showCanvas(display, container) { var { view, wrapper } = display var { width, height } = view container.appendChild(wrapper) resize() $(window).on('resize', resize) function resize() { var scale = Math.min(window.innerWidth / width, window.innerHeight / height) view.style.width = Math.round(width * scale) + 'px' view.style.height = Math.round(height * scale) + 'px' wrapper.style.width = Math.round(width * scale) + 'px' wrapper.style.height = Math.round(height * scale) + 'px' var yOffset = (window.innerHeight - height * scale) / 2 wrapper.style.marginTop = Math.round(yOffset) + 'px' } return wrapper } ## Instruction: Fix accidental context menu opening in Windows ## Code After: import $ from 'jquery' export default function GameScene(display) { return function (container) { let handler = () => false $(window).on('touchstart', handler) showCanvas(display, container) return { teardown() { $(window).off('touchstart', handler) }, } } } function showCanvas(display, container) { var { view, wrapper } = display var { width, height } = view container.appendChild(wrapper) container.addEventListener('touchstart', disableContextMenu) function disableContextMenu() { container.removeEventListener('touchstart', disableContextMenu) container.addEventListener('contextmenu', e => { e.preventDefault() }) } resize() $(window).on('resize', resize) function resize() { var scale = Math.min(window.innerWidth / width, window.innerHeight / height) view.style.width = Math.round(width * scale) + 'px' view.style.height = Math.round(height * scale) + 'px' wrapper.style.width = Math.round(width * scale) + 'px' wrapper.style.height = Math.round(height * scale) + 'px' var yOffset = (window.innerHeight - height * scale) / 2 wrapper.style.marginTop = Math.round(yOffset) + 'px' } return wrapper }
import $ from 'jquery' export default function GameScene(display) { return function (container) { let handler = () => false $(window).on('touchstart', handler) showCanvas(display, container) return { teardown() { $(window).off('touchstart', handler) }, } } } function showCanvas(display, container) { var { view, wrapper } = display var { width, height } = view container.appendChild(wrapper) + container.addEventListener('touchstart', disableContextMenu) + function disableContextMenu() { + container.removeEventListener('touchstart', disableContextMenu) + container.addEventListener('contextmenu', e => { + e.preventDefault() + }) + } resize() $(window).on('resize', resize) function resize() { var scale = Math.min(window.innerWidth / width, window.innerHeight / height) view.style.width = Math.round(width * scale) + 'px' view.style.height = Math.round(height * scale) + 'px' wrapper.style.width = Math.round(width * scale) + 'px' wrapper.style.height = Math.round(height * scale) + 'px' var yOffset = (window.innerHeight - height * scale) / 2 wrapper.style.marginTop = Math.round(yOffset) + 'px' } return wrapper }
7
0.2
7
0
bece36886c36c99e6704b58dac39ee8cabbc2d8d
packages/skatejs/src/define.ts
packages/skatejs/src/define.ts
import { CustomElementConstructor } from './types'; import { name } from './name.js'; export function define(Ctor: CustomElementConstructor): CustomElementConstructor { customElements.define(Ctor.is || name(), Ctor); return Ctor; }
import { CustomElementConstructor } from './types'; import { name } from './name.js'; export function define( ctor: CustomElementConstructor ): CustomElementConstructor { if (!ctor.is) { ctor.is = name(); } customElements.define(ctor.is, ctor); return ctor; }
Define is class property on constructor if it's not present.
Define is class property on constructor if it's not present.
TypeScript
mit
skatejs/skatejs,skatejs/skatejs,skatejs/skatejs
typescript
## Code Before: import { CustomElementConstructor } from './types'; import { name } from './name.js'; export function define(Ctor: CustomElementConstructor): CustomElementConstructor { customElements.define(Ctor.is || name(), Ctor); return Ctor; } ## Instruction: Define is class property on constructor if it's not present. ## Code After: import { CustomElementConstructor } from './types'; import { name } from './name.js'; export function define( ctor: CustomElementConstructor ): CustomElementConstructor { if (!ctor.is) { ctor.is = name(); } customElements.define(ctor.is, ctor); return ctor; }
import { CustomElementConstructor } from './types'; import { name } from './name.js'; - export function define(Ctor: CustomElementConstructor): CustomElementConstructor { + export function define( + ctor: CustomElementConstructor + ): CustomElementConstructor { + if (!ctor.is) { + ctor.is = name(); + } - customElements.define(Ctor.is || name(), Ctor); ? ^ ---------- ^ + customElements.define(ctor.is, ctor); ? ^ ^ - return Ctor; ? ^ + return ctor; ? ^ }
11
1.571429
8
3
c95ccb0f14ca9511960901ee9e315c483f5f2ebf
tests/test-remove.t
tests/test-remove.t
-*- coding: utf-8 -*- $ if [ -n "$COVERAGE" ]; then > export COVERAGE_FILE=$TESTDIR/../.coverage > alias clean="coverage run --branch -a $TESTDIR/../clean" > fi $ touch empty.py $ echo "# one line" > one-line.py $ echo "# coding: utf-8" > only-coding-line.py $ cat > ascii.py <<EOM > # coding: utf-8 > # ASCII text > EOM $ echo "# coding: utf-8; ☃" > utf-8.py $ clean -r *.py cleaned ascii.py cleaned only-coding-line.py $ cat ascii.py # ASCII text $ cat only-coding-line.py
-*- coding: utf-8 -*- $ if [ -n "$COVERAGE" ]; then > export COVERAGE_FILE=$TESTDIR/../.coverage > alias clean="coverage run --branch -a $TESTDIR/../clean" > fi $ touch empty.py $ echo "# one line" > one-line.py $ echo "# coding: utf-8" > only-coding-line.py $ cat > ascii.py <<EOM > # coding: utf-8 > # ASCII text > EOM $ cat > blank-line.py <<EOM > # coding: utf-8 > # > # more comments > EOM $ echo "# coding: utf-8; ☃" > utf-8.py $ clean -r *.py cleaned ascii.py cleaned blank-line.py cleaned only-coding-line.py $ cat ascii.py # ASCII text $ cat only-coding-line.py $ cat blank-line.py # more comments
Test removal of blank line after coding line
Test removal of blank line after coding line
Perl
mit
mgeisler/clean-headers,mgeisler/clean-headers
perl
## Code Before: -*- coding: utf-8 -*- $ if [ -n "$COVERAGE" ]; then > export COVERAGE_FILE=$TESTDIR/../.coverage > alias clean="coverage run --branch -a $TESTDIR/../clean" > fi $ touch empty.py $ echo "# one line" > one-line.py $ echo "# coding: utf-8" > only-coding-line.py $ cat > ascii.py <<EOM > # coding: utf-8 > # ASCII text > EOM $ echo "# coding: utf-8; ☃" > utf-8.py $ clean -r *.py cleaned ascii.py cleaned only-coding-line.py $ cat ascii.py # ASCII text $ cat only-coding-line.py ## Instruction: Test removal of blank line after coding line ## Code After: -*- coding: utf-8 -*- $ if [ -n "$COVERAGE" ]; then > export COVERAGE_FILE=$TESTDIR/../.coverage > alias clean="coverage run --branch -a $TESTDIR/../clean" > fi $ touch empty.py $ echo "# one line" > one-line.py $ echo "# coding: utf-8" > only-coding-line.py $ cat > ascii.py <<EOM > # coding: utf-8 > # ASCII text > EOM $ cat > blank-line.py <<EOM > # coding: utf-8 > # > # more comments > EOM $ echo "# coding: utf-8; ☃" > utf-8.py $ clean -r *.py cleaned ascii.py cleaned blank-line.py cleaned only-coding-line.py $ cat ascii.py # ASCII text $ cat only-coding-line.py $ cat blank-line.py # more comments
-*- coding: utf-8 -*- $ if [ -n "$COVERAGE" ]; then > export COVERAGE_FILE=$TESTDIR/../.coverage > alias clean="coverage run --branch -a $TESTDIR/../clean" > fi $ touch empty.py $ echo "# one line" > one-line.py $ echo "# coding: utf-8" > only-coding-line.py $ cat > ascii.py <<EOM > # coding: utf-8 > # ASCII text > EOM + $ cat > blank-line.py <<EOM + > # coding: utf-8 + > # + > # more comments + > EOM + $ echo "# coding: utf-8; ☃" > utf-8.py $ clean -r *.py cleaned ascii.py + cleaned blank-line.py cleaned only-coding-line.py $ cat ascii.py # ASCII text $ cat only-coding-line.py + + $ cat blank-line.py + # more comments
10
0.434783
10
0
81ba4e70645070b70c3f0290e9fdb186b0e48e1e
.travis.yml
.travis.yml
language: generic sudo: false cache: directories: - $HOME/bin env: global: - PATH="$HOME/bin:$PATH" - GOOGLE_ACCOUNT_FILE="$(cat $TRAVIS_BUILD_DIR/gce.json)" apt: packages: - unzip install: - mkdir -p ~/bin - ./bin/setup script: - terraform get --update - terraform plan
language: generic sudo: false cache: directories: - $HOME/bin env: global: - PATH="$HOME/bin:$PATH" apt: packages: - unzip install: - mkdir -p ~/bin - ./bin/setup script: - terraform get --update - terraform plan
Set GOOGLE_ACCOUNT_FILE via repo settings
Set GOOGLE_ACCOUNT_FILE via repo settings
YAML
mit
travis-infrastructure/terraform-stuff,travis-infrastructure/terraform-stuff
yaml
## Code Before: language: generic sudo: false cache: directories: - $HOME/bin env: global: - PATH="$HOME/bin:$PATH" - GOOGLE_ACCOUNT_FILE="$(cat $TRAVIS_BUILD_DIR/gce.json)" apt: packages: - unzip install: - mkdir -p ~/bin - ./bin/setup script: - terraform get --update - terraform plan ## Instruction: Set GOOGLE_ACCOUNT_FILE via repo settings ## Code After: language: generic sudo: false cache: directories: - $HOME/bin env: global: - PATH="$HOME/bin:$PATH" apt: packages: - unzip install: - mkdir -p ~/bin - ./bin/setup script: - terraform get --update - terraform plan
language: generic sudo: false cache: directories: - $HOME/bin env: global: - PATH="$HOME/bin:$PATH" - - GOOGLE_ACCOUNT_FILE="$(cat $TRAVIS_BUILD_DIR/gce.json)" apt: packages: - unzip install: - mkdir -p ~/bin - ./bin/setup script: - terraform get --update - terraform plan
1
0.041667
0
1
e96ff926a0c49d2dbfa8b6d0d0e41ca29f382dc4
app/controllers/public_uploads_controller.rb
app/controllers/public_uploads_controller.rb
class PublicUploadsController < ApplicationController include ActionView::Helpers::AssetTagHelper def show asset_host = URI.parse(Plek.new.public_asset_host).host redirect_to host: asset_host end private def fail if image? upload_path redirect_to view_context.path_to_image('thumbnail-placeholder.png') elsif incoming_upload_exists? upload_path redirect_to_placeholder else render plain: "Not found", status: :not_found end end def redirect_to_placeholder # Cache is explicitly 1 minute to prevent the virus redirect beng # cached by CDNs. expires_in(1.minute, public: true) redirect_to placeholder_url end def send_file_for_mime_type if (mime_type = mime_type_for(upload_path)) send_file real_path_for_x_accel_mapping(upload_path), type: mime_type, disposition: 'inline' else send_file real_path_for_x_accel_mapping(upload_path), disposition: 'inline' end end def image?(path) ['.jpg', '.jpeg', '.png', '.gif'].include?(File.extname(path)) end def mime_type_for(path) Mime::Type.lookup_by_extension(File.extname(path).from(1).downcase) end def expires_headers expires_in(Whitehall.uploads_cache_max_age, public: true) end def upload_path basename = [params[:path], params[:format]].compact.join('.') File.join(Whitehall.clean_uploads_root, basename) end def attachment_visible? upload_exists? upload_path end def upload_exists?(path) File.exist?(path) && file_is_clean?(path) end def incoming_upload_exists?(path) path = path.sub(Whitehall.clean_uploads_root, Whitehall.incoming_uploads_root) File.exist?(path) end def file_is_clean?(path) path.starts_with?(Whitehall.clean_uploads_root) end def real_path_for_x_accel_mapping(potentially_symlinked_path) File.realpath(potentially_symlinked_path) end end
class PublicUploadsController < ApplicationController def show asset_host = URI.parse(Plek.new.public_asset_host).host redirect_to host: asset_host end end
Remove unused methods from PublicUploadsController
Remove unused methods from PublicUploadsController These methods are never called and can be removed.
Ruby
mit
alphagov/whitehall,alphagov/whitehall,alphagov/whitehall,alphagov/whitehall
ruby
## Code Before: class PublicUploadsController < ApplicationController include ActionView::Helpers::AssetTagHelper def show asset_host = URI.parse(Plek.new.public_asset_host).host redirect_to host: asset_host end private def fail if image? upload_path redirect_to view_context.path_to_image('thumbnail-placeholder.png') elsif incoming_upload_exists? upload_path redirect_to_placeholder else render plain: "Not found", status: :not_found end end def redirect_to_placeholder # Cache is explicitly 1 minute to prevent the virus redirect beng # cached by CDNs. expires_in(1.minute, public: true) redirect_to placeholder_url end def send_file_for_mime_type if (mime_type = mime_type_for(upload_path)) send_file real_path_for_x_accel_mapping(upload_path), type: mime_type, disposition: 'inline' else send_file real_path_for_x_accel_mapping(upload_path), disposition: 'inline' end end def image?(path) ['.jpg', '.jpeg', '.png', '.gif'].include?(File.extname(path)) end def mime_type_for(path) Mime::Type.lookup_by_extension(File.extname(path).from(1).downcase) end def expires_headers expires_in(Whitehall.uploads_cache_max_age, public: true) end def upload_path basename = [params[:path], params[:format]].compact.join('.') File.join(Whitehall.clean_uploads_root, basename) end def attachment_visible? upload_exists? upload_path end def upload_exists?(path) File.exist?(path) && file_is_clean?(path) end def incoming_upload_exists?(path) path = path.sub(Whitehall.clean_uploads_root, Whitehall.incoming_uploads_root) File.exist?(path) end def file_is_clean?(path) path.starts_with?(Whitehall.clean_uploads_root) end def real_path_for_x_accel_mapping(potentially_symlinked_path) File.realpath(potentially_symlinked_path) end end ## Instruction: Remove unused methods from PublicUploadsController These methods are never called and can be removed. ## Code After: class PublicUploadsController < ApplicationController def show asset_host = URI.parse(Plek.new.public_asset_host).host redirect_to host: asset_host end end
class PublicUploadsController < ApplicationController - include ActionView::Helpers::AssetTagHelper - def show asset_host = URI.parse(Plek.new.public_asset_host).host redirect_to host: asset_host end - - private - - def fail - if image? upload_path - redirect_to view_context.path_to_image('thumbnail-placeholder.png') - elsif incoming_upload_exists? upload_path - redirect_to_placeholder - else - render plain: "Not found", status: :not_found - end - end - - def redirect_to_placeholder - # Cache is explicitly 1 minute to prevent the virus redirect beng - # cached by CDNs. - expires_in(1.minute, public: true) - redirect_to placeholder_url - end - - def send_file_for_mime_type - if (mime_type = mime_type_for(upload_path)) - send_file real_path_for_x_accel_mapping(upload_path), type: mime_type, disposition: 'inline' - else - send_file real_path_for_x_accel_mapping(upload_path), disposition: 'inline' - end - end - - def image?(path) - ['.jpg', '.jpeg', '.png', '.gif'].include?(File.extname(path)) - end - - def mime_type_for(path) - Mime::Type.lookup_by_extension(File.extname(path).from(1).downcase) - end - - def expires_headers - expires_in(Whitehall.uploads_cache_max_age, public: true) - end - - def upload_path - basename = [params[:path], params[:format]].compact.join('.') - File.join(Whitehall.clean_uploads_root, basename) - end - - def attachment_visible? - upload_exists? upload_path - end - - def upload_exists?(path) - File.exist?(path) && file_is_clean?(path) - end - - def incoming_upload_exists?(path) - path = path.sub(Whitehall.clean_uploads_root, Whitehall.incoming_uploads_root) - File.exist?(path) - end - - def file_is_clean?(path) - path.starts_with?(Whitehall.clean_uploads_root) - end - - def real_path_for_x_accel_mapping(potentially_symlinked_path) - File.realpath(potentially_symlinked_path) - end end
67
0.917808
0
67
500466e21038826fd9ebe166b082bcb6fac313ee
Library/Sources/Extensions/VKURLSessionTask.swift
Library/Sources/Extensions/VKURLSessionTask.swift
import Foundation protocol VKURLSessionTask: ObservableObject { func resume() func cancel() var countOfBytesReceived: Int64 { get } var countOfBytesSent: Int64 { get } var countOfBytesExpectedToSend: Int64 { get } var countOfBytesExpectedToReceive: Int64 { get } } extension URLSessionTask: VKURLSessionTask {}
import Foundation protocol VKURLSessionTask: ObservableObject { var countOfBytesReceived: Int64 { get } var countOfBytesSent: Int64 { get } var countOfBytesExpectedToSend: Int64 { get } var countOfBytesExpectedToReceive: Int64 { get } func resume() func cancel() } extension URLSessionTask: VKURLSessionTask {}
Fix vars and methods sequencing
Fix vars and methods sequencing
Swift
mit
WE-St0r/SwiftyVK,SwiftyVK/SwiftyVK,WE-St0r/SwiftyVK,SwiftyVK/SwiftyVK,WE-St0r/SwiftyVK
swift
## Code Before: import Foundation protocol VKURLSessionTask: ObservableObject { func resume() func cancel() var countOfBytesReceived: Int64 { get } var countOfBytesSent: Int64 { get } var countOfBytesExpectedToSend: Int64 { get } var countOfBytesExpectedToReceive: Int64 { get } } extension URLSessionTask: VKURLSessionTask {} ## Instruction: Fix vars and methods sequencing ## Code After: import Foundation protocol VKURLSessionTask: ObservableObject { var countOfBytesReceived: Int64 { get } var countOfBytesSent: Int64 { get } var countOfBytesExpectedToSend: Int64 { get } var countOfBytesExpectedToReceive: Int64 { get } func resume() func cancel() } extension URLSessionTask: VKURLSessionTask {}
import Foundation protocol VKURLSessionTask: ObservableObject { - func resume() - func cancel() - var countOfBytesReceived: Int64 { get } var countOfBytesSent: Int64 { get } var countOfBytesExpectedToSend: Int64 { get } var countOfBytesExpectedToReceive: Int64 { get } + + func resume() + func cancel() } extension URLSessionTask: VKURLSessionTask {}
6
0.461538
3
3
cf5041ea80267649e6c7d87cc305ad3838520657
src/main/java/me/modmuss50/rebornstorage/proxys/ClientProxy.java
src/main/java/me/modmuss50/rebornstorage/proxys/ClientProxy.java
package me.modmuss50.rebornstorage.proxys; import me.modmuss50.rebornstorage.init.ModelHelper; /** * Created by Gigabit101 on 03/01/2017. */ public class ClientProxy extends CommonProxy { @Override public void registerRenders() { ModelHelper.init(); } }
package me.modmuss50.rebornstorage.proxys; import com.raoulvdberge.refinedstorage.apiimpl.API; import me.modmuss50.rebornstorage.client.gui.ContainerMultiCrafter; import me.modmuss50.rebornstorage.init.ModelHelper; import net.minecraft.client.Minecraft; import net.minecraft.inventory.Container; /** * Created by Gigabit101 on 03/01/2017. */ public class ClientProxy extends CommonProxy { @Override public void registerRenders() { ModelHelper.init(); API.instance().addPatternRenderHandler(itemStack -> { Container container = Minecraft.getMinecraft().player.openContainer; if(container instanceof ContainerMultiCrafter){ for (int i = 0; i < 78; i++) { if(container.getSlot(i).getStack() == itemStack){ return true; } } } return false; }); } }
Make patters render output item when in multicrafter slot
Make patters render output item when in multicrafter slot
Java
mit
TechReborn/RebornStorage
java
## Code Before: package me.modmuss50.rebornstorage.proxys; import me.modmuss50.rebornstorage.init.ModelHelper; /** * Created by Gigabit101 on 03/01/2017. */ public class ClientProxy extends CommonProxy { @Override public void registerRenders() { ModelHelper.init(); } } ## Instruction: Make patters render output item when in multicrafter slot ## Code After: package me.modmuss50.rebornstorage.proxys; import com.raoulvdberge.refinedstorage.apiimpl.API; import me.modmuss50.rebornstorage.client.gui.ContainerMultiCrafter; import me.modmuss50.rebornstorage.init.ModelHelper; import net.minecraft.client.Minecraft; import net.minecraft.inventory.Container; /** * Created by Gigabit101 on 03/01/2017. */ public class ClientProxy extends CommonProxy { @Override public void registerRenders() { ModelHelper.init(); API.instance().addPatternRenderHandler(itemStack -> { Container container = Minecraft.getMinecraft().player.openContainer; if(container instanceof ContainerMultiCrafter){ for (int i = 0; i < 78; i++) { if(container.getSlot(i).getStack() == itemStack){ return true; } } } return false; }); } }
package me.modmuss50.rebornstorage.proxys; + import com.raoulvdberge.refinedstorage.apiimpl.API; + import me.modmuss50.rebornstorage.client.gui.ContainerMultiCrafter; import me.modmuss50.rebornstorage.init.ModelHelper; + import net.minecraft.client.Minecraft; + import net.minecraft.inventory.Container; /** * Created by Gigabit101 on 03/01/2017. */ public class ClientProxy extends CommonProxy { @Override public void registerRenders() { ModelHelper.init(); + + API.instance().addPatternRenderHandler(itemStack -> { + Container container = Minecraft.getMinecraft().player.openContainer; + if(container instanceof ContainerMultiCrafter){ + for (int i = 0; i < 78; i++) { + if(container.getSlot(i).getStack() == itemStack){ + return true; + } + } + + } + return false; + }); } }
17
1.307692
17
0
f24a3d44078fe19ed933f8fe992c64e2926b8048
lib/formats/carto/api_key/grants.json
lib/formats/carto/api_key/grants.json
{ "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "apis", "database" ] }, "apis": { "type": "array", "items": { "type": "string", "enum": [ "sql", "maps" ] } }, "tables": { "type": "array", "additionalProperties": false, "items": { "type": "object", "required": [ "schema", "name", "permissions" ], "properties": { "schema": { "type": "string" }, "name": { "type": "string" }, "permissions": { "type": "array", "items": { "type": "string", "enum": [ "insert", "select", "update", "delete" ] } } }, "additionalProperties": false } } }, "additionalProperties": false } }
{ "type": "array", "items": { "type": "object", "required": [ "type" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "apis", "database" ] }, "apis": { "type": "array", "items": { "type": "string", "enum": [ "sql", "maps" ] } }, "tables": { "type": "array", "additionalProperties": false, "items": { "type": "object", "required": [ "schema", "name", "permissions" ], "additionalProperties": false, "properties": { "schema": { "type": "string" }, "name": { "type": "string" }, "permissions": { "type": "array", "items": { "type": "string", "enum": [ "insert", "select", "update", "delete" ] } } } } } } } }
Reorder additional properties for readability
Reorder additional properties for readability
JSON
bsd-3-clause
CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb,CartoDB/cartodb
json
## Code Before: { "type": "array", "items": { "type": "object", "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "apis", "database" ] }, "apis": { "type": "array", "items": { "type": "string", "enum": [ "sql", "maps" ] } }, "tables": { "type": "array", "additionalProperties": false, "items": { "type": "object", "required": [ "schema", "name", "permissions" ], "properties": { "schema": { "type": "string" }, "name": { "type": "string" }, "permissions": { "type": "array", "items": { "type": "string", "enum": [ "insert", "select", "update", "delete" ] } } }, "additionalProperties": false } } }, "additionalProperties": false } } ## Instruction: Reorder additional properties for readability ## Code After: { "type": "array", "items": { "type": "object", "required": [ "type" ], "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "apis", "database" ] }, "apis": { "type": "array", "items": { "type": "string", "enum": [ "sql", "maps" ] } }, "tables": { "type": "array", "additionalProperties": false, "items": { "type": "object", "required": [ "schema", "name", "permissions" ], "additionalProperties": false, "properties": { "schema": { "type": "string" }, "name": { "type": "string" }, "permissions": { "type": "array", "items": { "type": "string", "enum": [ "insert", "select", "update", "delete" ] } } } } } } } }
{ "type": "array", "items": { "type": "object", "required": [ "type" ], + "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "apis", "database" ] }, "apis": { "type": "array", "items": { "type": "string", "enum": [ "sql", "maps" ] } }, "tables": { "type": "array", "additionalProperties": false, "items": { "type": "object", "required": [ "schema", "name", "permissions" ], + "additionalProperties": false, "properties": { "schema": { "type": "string" }, "name": { "type": "string" }, "permissions": { "type": "array", "items": { "type": "string", "enum": [ "insert", "select", "update", "delete" ] } } - }, ? - + } - "additionalProperties": false } } - }, ? - + } - "additionalProperties": false } }
8
0.129032
4
4
2292ff67109de793fd3461d1a753a51b5c734881
lib/tasks/frankiz.rake
lib/tasks/frankiz.rake
namespace :frankiz do task :refresh_promo, [:promo] => :environment do |_, args| fkz = FrankizLdap.new fkz.crawl_promo(args[:promo]) end task :associate_accounts, [:promo] => :environment do |_, args| doubtful = 0 Account.where(frankiz_id: nil, promo: args[:promo]).where(status: User::STATUSES.values.uniq).each do |acc| users = acc.possible_users next if users.nil? || users.try(:empty?) if users.is_a? User acc.update(frankiz_id: users.frankiz_id) else doubtful += 1 puts '' puts acc.as_json puts 'has several possible matches:' users.each_with_index do |u, i| puts "\t#{i + 1}:\t#{u.as_json(only: [:name, :email, :promo, :group, :casert])}" end idx = user_prompt('Which one should we use? (0 to skip):').to_i next if idx < 1 || idx > users.size acc.update(frankiz_id: users[idx - 1].frankiz_id) end end puts "#{doubtful} doubtful accounts" end end
namespace :frankiz do task :refresh_promo, [:promo] => :environment do |_, args| fkz = FrankizLdap.new fkz.crawl_promo(args[:promo]) end task :associate_accounts, [:promo] => :environment do |_, args| doubtful = 0 Account.where(frankiz_id: nil, promo: args[:promo]).where.not(status: Account.statuses[:binet]).each do |acc| users = acc.possible_users next if users.nil? || users.try(:empty?) if users.is_a? User acc.update(frankiz_id: users.frankiz_id) else doubtful += 1 puts '' puts acc.as_json puts 'has several possible matches:' users.each_with_index do |u, i| puts "\t#{i + 1}:\t#{u.as_json(only: [:name, :email, :promo, :group, :casert])}" end idx = user_prompt('Which one should we use? (0 to skip):').to_i next if idx < 1 || idx > users.size acc.update(frankiz_id: users[idx - 1].frankiz_id) end end puts "#{doubtful} doubtful accounts" end end
Fix trigramme association rake task
Fix trigramme association rake task
Ruby
mit
bobar/tdfb,bobar/tdfb,bobar/tdfb,bobar/tdfb
ruby
## Code Before: namespace :frankiz do task :refresh_promo, [:promo] => :environment do |_, args| fkz = FrankizLdap.new fkz.crawl_promo(args[:promo]) end task :associate_accounts, [:promo] => :environment do |_, args| doubtful = 0 Account.where(frankiz_id: nil, promo: args[:promo]).where(status: User::STATUSES.values.uniq).each do |acc| users = acc.possible_users next if users.nil? || users.try(:empty?) if users.is_a? User acc.update(frankiz_id: users.frankiz_id) else doubtful += 1 puts '' puts acc.as_json puts 'has several possible matches:' users.each_with_index do |u, i| puts "\t#{i + 1}:\t#{u.as_json(only: [:name, :email, :promo, :group, :casert])}" end idx = user_prompt('Which one should we use? (0 to skip):').to_i next if idx < 1 || idx > users.size acc.update(frankiz_id: users[idx - 1].frankiz_id) end end puts "#{doubtful} doubtful accounts" end end ## Instruction: Fix trigramme association rake task ## Code After: namespace :frankiz do task :refresh_promo, [:promo] => :environment do |_, args| fkz = FrankizLdap.new fkz.crawl_promo(args[:promo]) end task :associate_accounts, [:promo] => :environment do |_, args| doubtful = 0 Account.where(frankiz_id: nil, promo: args[:promo]).where.not(status: Account.statuses[:binet]).each do |acc| users = acc.possible_users next if users.nil? || users.try(:empty?) if users.is_a? User acc.update(frankiz_id: users.frankiz_id) else doubtful += 1 puts '' puts acc.as_json puts 'has several possible matches:' users.each_with_index do |u, i| puts "\t#{i + 1}:\t#{u.as_json(only: [:name, :email, :promo, :group, :casert])}" end idx = user_prompt('Which one should we use? (0 to skip):').to_i next if idx < 1 || idx > users.size acc.update(frankiz_id: users[idx - 1].frankiz_id) end end puts "#{doubtful} doubtful accounts" end end
namespace :frankiz do task :refresh_promo, [:promo] => :environment do |_, args| fkz = FrankizLdap.new fkz.crawl_promo(args[:promo]) end task :associate_accounts, [:promo] => :environment do |_, args| doubtful = 0 - Account.where(frankiz_id: nil, promo: args[:promo]).where(status: User::STATUSES.values.uniq).each do |acc| ? ^ ^ ^^^^^^^^^^^^^^ ^^^^^^ + Account.where(frankiz_id: nil, promo: args[:promo]).where.not(status: Account.statuses[:binet]).each do |acc| ? ++++ ^^^^^^^^^^^^^ ^^ ^^^ ^^ users = acc.possible_users next if users.nil? || users.try(:empty?) if users.is_a? User acc.update(frankiz_id: users.frankiz_id) else doubtful += 1 puts '' puts acc.as_json puts 'has several possible matches:' users.each_with_index do |u, i| puts "\t#{i + 1}:\t#{u.as_json(only: [:name, :email, :promo, :group, :casert])}" end idx = user_prompt('Which one should we use? (0 to skip):').to_i next if idx < 1 || idx > users.size acc.update(frankiz_id: users[idx - 1].frankiz_id) end end puts "#{doubtful} doubtful accounts" end end
2
0.068966
1
1
40a766d21b4dd151c9398a5f442fd968e463cb01
lib/logster/base_store.rb
lib/logster/base_store.rb
module Logster class BaseStore attr_accessor :level, :max_retention, :skip_empty, :ignore def initialize @dedup = false @max_retention = 60 * 60 * 24 * 7 @skip_empty = true end def save(message) not_implemented end def count not_implemented end def clear not_implemented end def clear_all not_implemented end def get(message_key) not_implemented end def protect(message_key) not_implemented end def unprotect(message_key) not_implemented end def report(severity, progname, message, opts = {}) return if (!message || (String === message && message.empty?)) && skip_empty return if level && severity < level return if ignore && ignore.any? { |pattern| message =~ pattern} message = Logster::Message.new(severity, progname, message, opts[:timestamp]) env = opts[:env] backtrace = opts[:backtrace] if env if env[:backtrace] # Special - passing backtrace through env backtrace = env.delete(:backtrace) end message.populate_from_env(env) end if backtrace if backtrace.respond_to? :join backtrace = backtrace.join("\n") end message.backtrace = backtrace else message.backtrace = caller.join("\n") end save message message end private def not_implemented raise "Not Implemented" end end end
module Logster class BaseStore attr_accessor :level, :max_retention, :skip_empty, :ignore def initialize @dedup = false @max_retention = 60 * 60 * 24 * 7 @skip_empty = true end def save(message) not_implemented end def count not_implemented end def clear not_implemented end def clear_all not_implemented end def get(message_key) not_implemented end def protect(message_key) not_implemented end def unprotect(message_key) not_implemented end def report(severity, progname, msg, opts = {}) return if (!msg || (String === msg && msg.empty?)) && skip_empty return if level && severity < level return if ignore && ignore.any? { |pattern| msg =~ pattern} message = Logster::Message.new(severity, progname, msg, opts[:timestamp]) env = opts[:env] backtrace = opts[:backtrace] if env if env[:backtrace] # Special - passing backtrace through env backtrace = env.delete(:backtrace) end message.populate_from_env(env) end if backtrace if backtrace.respond_to? :join backtrace = backtrace.join("\n") end message.backtrace = backtrace else message.backtrace = caller.join("\n") end save message message end private def not_implemented raise "Not Implemented" end end end
Rename local variable to avoid confusion
Rename local variable to avoid confusion
Ruby
mit
discourse/logster,zBMNForks/logster,discourse/logster,zBMNForks/logster,discourse/logster,zBMNForks/logster,discourse/logster
ruby
## Code Before: module Logster class BaseStore attr_accessor :level, :max_retention, :skip_empty, :ignore def initialize @dedup = false @max_retention = 60 * 60 * 24 * 7 @skip_empty = true end def save(message) not_implemented end def count not_implemented end def clear not_implemented end def clear_all not_implemented end def get(message_key) not_implemented end def protect(message_key) not_implemented end def unprotect(message_key) not_implemented end def report(severity, progname, message, opts = {}) return if (!message || (String === message && message.empty?)) && skip_empty return if level && severity < level return if ignore && ignore.any? { |pattern| message =~ pattern} message = Logster::Message.new(severity, progname, message, opts[:timestamp]) env = opts[:env] backtrace = opts[:backtrace] if env if env[:backtrace] # Special - passing backtrace through env backtrace = env.delete(:backtrace) end message.populate_from_env(env) end if backtrace if backtrace.respond_to? :join backtrace = backtrace.join("\n") end message.backtrace = backtrace else message.backtrace = caller.join("\n") end save message message end private def not_implemented raise "Not Implemented" end end end ## Instruction: Rename local variable to avoid confusion ## Code After: module Logster class BaseStore attr_accessor :level, :max_retention, :skip_empty, :ignore def initialize @dedup = false @max_retention = 60 * 60 * 24 * 7 @skip_empty = true end def save(message) not_implemented end def count not_implemented end def clear not_implemented end def clear_all not_implemented end def get(message_key) not_implemented end def protect(message_key) not_implemented end def unprotect(message_key) not_implemented end def report(severity, progname, msg, opts = {}) return if (!msg || (String === msg && msg.empty?)) && skip_empty return if level && severity < level return if ignore && ignore.any? { |pattern| msg =~ pattern} message = Logster::Message.new(severity, progname, msg, opts[:timestamp]) env = opts[:env] backtrace = opts[:backtrace] if env if env[:backtrace] # Special - passing backtrace through env backtrace = env.delete(:backtrace) end message.populate_from_env(env) end if backtrace if backtrace.respond_to? :join backtrace = backtrace.join("\n") end message.backtrace = backtrace else message.backtrace = caller.join("\n") end save message message end private def not_implemented raise "Not Implemented" end end end
module Logster class BaseStore attr_accessor :level, :max_retention, :skip_empty, :ignore def initialize @dedup = false @max_retention = 60 * 60 * 24 * 7 @skip_empty = true end def save(message) not_implemented end def count not_implemented end def clear not_implemented end def clear_all not_implemented end def get(message_key) not_implemented end def protect(message_key) not_implemented end def unprotect(message_key) not_implemented end - def report(severity, progname, message, opts = {}) ? - -- - + def report(severity, progname, msg, opts = {}) - return if (!message || (String === message && message.empty?)) && skip_empty ? - -- - - -- - - -- - + return if (!msg || (String === msg && msg.empty?)) && skip_empty return if level && severity < level - return if ignore && ignore.any? { |pattern| message =~ pattern} ? - -- - + return if ignore && ignore.any? { |pattern| msg =~ pattern} - message = Logster::Message.new(severity, progname, message, opts[:timestamp]) ? - -- - + message = Logster::Message.new(severity, progname, msg, opts[:timestamp]) env = opts[:env] backtrace = opts[:backtrace] if env if env[:backtrace] # Special - passing backtrace through env backtrace = env.delete(:backtrace) end message.populate_from_env(env) end if backtrace if backtrace.respond_to? :join backtrace = backtrace.join("\n") end message.backtrace = backtrace else message.backtrace = caller.join("\n") end save message message end private def not_implemented raise "Not Implemented" end end end
8
0.1
4
4
e7c6c6ab772a7c2700f6d636c2508aaa042f8045
app/views/shared/_account.html.slim
app/views/shared/_account.html.slim
ul.nav.navbar-nav.navbar-right - if user_signed_in? li.dropdown a.dropdown-toggle data-toggle="dropdown" href="#" | Account b.caret ul.dropdown-menu li = link_to 'Profile', user_profile_path(current_user) unless current_user.profile.blank? = link_to 'Profile', new_user_profile_path(current_user) if current_user.profile.blank? li a href="#" | View schedule li.divider li= link_to 'Sign out', destroy_user_session_path, method: :delete - else li= link_to "Sign in", "#sign_in", "data-toggle" => "modal" li= link_to "Register", "#sign_up", "data-toggle" => "modal" li= link_to "Help", "#"
ul.nav.navbar-nav.navbar-right - if user_signed_in? li.dropdown a.dropdown-toggle data-toggle="dropdown" href="#" | Account b.caret ul.dropdown-menu li = link_to 'Profile', user_profile_path(current_user) unless current_user.profile.blank? = link_to 'Profile', new_user_profile_path(current_user) if current_user.profile.blank? li a href="#" | View schedule li.divider li= link_to 'Sign out', destroy_user_session_path, method: :delete - else li= link_to "Sign in", "#sign_in", "data-toggle" => "modal" li= link_to "Register", "#sign_up", "data-toggle" => "modal" / Devise links go here li= link_to "Help", "#"
Add reminder about what help page will be for
Add reminder about what help page will be for
Slim
mit
jrhorn424/recruiter,jrhorn424/recruiter
slim
## Code Before: ul.nav.navbar-nav.navbar-right - if user_signed_in? li.dropdown a.dropdown-toggle data-toggle="dropdown" href="#" | Account b.caret ul.dropdown-menu li = link_to 'Profile', user_profile_path(current_user) unless current_user.profile.blank? = link_to 'Profile', new_user_profile_path(current_user) if current_user.profile.blank? li a href="#" | View schedule li.divider li= link_to 'Sign out', destroy_user_session_path, method: :delete - else li= link_to "Sign in", "#sign_in", "data-toggle" => "modal" li= link_to "Register", "#sign_up", "data-toggle" => "modal" li= link_to "Help", "#" ## Instruction: Add reminder about what help page will be for ## Code After: ul.nav.navbar-nav.navbar-right - if user_signed_in? li.dropdown a.dropdown-toggle data-toggle="dropdown" href="#" | Account b.caret ul.dropdown-menu li = link_to 'Profile', user_profile_path(current_user) unless current_user.profile.blank? = link_to 'Profile', new_user_profile_path(current_user) if current_user.profile.blank? li a href="#" | View schedule li.divider li= link_to 'Sign out', destroy_user_session_path, method: :delete - else li= link_to "Sign in", "#sign_in", "data-toggle" => "modal" li= link_to "Register", "#sign_up", "data-toggle" => "modal" / Devise links go here li= link_to "Help", "#"
ul.nav.navbar-nav.navbar-right - if user_signed_in? li.dropdown a.dropdown-toggle data-toggle="dropdown" href="#" | Account b.caret ul.dropdown-menu li = link_to 'Profile', user_profile_path(current_user) unless current_user.profile.blank? = link_to 'Profile', new_user_profile_path(current_user) if current_user.profile.blank? li a href="#" | View schedule li.divider li= link_to 'Sign out', destroy_user_session_path, method: :delete - else li= link_to "Sign in", "#sign_in", "data-toggle" => "modal" li= link_to "Register", "#sign_up", "data-toggle" => "modal" + / Devise links go here li= link_to "Help", "#"
1
0.052632
1
0
96a37d48484e2ba9df047bde6721fb8d76eb20d5
app/assets/stylesheets/core/alert-box.sass
app/assets/stylesheets/core/alert-box.sass
.alert-box padding: 15px background: $alert-success-color &.error, &.alert, &.failure background: $alert-color &.success, &.notice background: $alert-success-color .flash .alert-box margin-top: -30px +radius(0) #devise .flash .alert-box margin-top: 0
.alert-box padding: 15px background: $alert-success-color &.error, &.alert, &.failure background: $alert-color &.success, &.notice background: $alert-success-color .flash .alert-box +radius(0) #devise .flash .alert-box margin-top: 0
Remove negative margin top from alert box, since the topboar is fixed now
Remove negative margin top from alert box, since the topboar is fixed now
Sass
mit
MicroPasts/micropasts-crowdfunding,MicroPasts/micropasts-crowdfunding,rockkhuya/taydantay,MicroPasts/micropasts-crowdfunding,gustavoguichard/neighborly,jinutm/silverclass,jinutm/silvfinal,jinutm/silveralms.com,jinutm/silverclass,jinutm/silvfinal,rockkhuya/taydantay,rockkhuya/taydantay,jinutm/silvfinal,MicroPasts/micropasts-crowdfunding,jinutm/silverpro,jinutm/silverme,jinutm/silverpro,gustavoguichard/neighborly,raksonibs/raimcrowd,jinutm/silverprod,jinutm/silveralms.com,raksonibs/raimcrowd,jinutm/silverme,jinutm/silverpro,raksonibs/raimcrowd,jinutm/silverclass,gustavoguichard/neighborly,jinutm/silverme,raksonibs/raimcrowd,jinutm/silverprod,jinutm/silveralms.com,jinutm/silverprod
sass
## Code Before: .alert-box padding: 15px background: $alert-success-color &.error, &.alert, &.failure background: $alert-color &.success, &.notice background: $alert-success-color .flash .alert-box margin-top: -30px +radius(0) #devise .flash .alert-box margin-top: 0 ## Instruction: Remove negative margin top from alert box, since the topboar is fixed now ## Code After: .alert-box padding: 15px background: $alert-success-color &.error, &.alert, &.failure background: $alert-color &.success, &.notice background: $alert-success-color .flash .alert-box +radius(0) #devise .flash .alert-box margin-top: 0
.alert-box padding: 15px background: $alert-success-color &.error, &.alert, &.failure background: $alert-color &.success, &.notice background: $alert-success-color .flash .alert-box - margin-top: -30px +radius(0) #devise .flash .alert-box margin-top: 0
1
0.058824
0
1
e7aea7c181a5a7619d0756e4e02f7694446c9289
src/helpers/util.js
src/helpers/util.js
import _ from 'lodash'; /** * Returns copy of an object with mapped values. Works really similar to * lodash's mapValues, with difference that also EVERY nested object is * also mapped with passed function. * * @param {Object} obj - object to map values of * @param {Function} fn - function to map values with * * @returns {Object} * @private */ export const deepMapValues = (obj, fn) => _.mapValues(obj, (value) => { if (_.isPlainObject(value)) return deepMapValues(value, fn); return fn(value); }); export const isFunction = (obj) => typeof obj === 'function';
import _ from 'lodash'; /** * Returns copy of an object with mapped values. Works really similar to * lodash's mapValues, with difference that also EVERY nested object is * also mapped with passed function. * * @param {Object} obj - object to map values of * @param {Function} fn - function to map values with * * @returns {Object} * @private */ export const deepMapValues = (obj, fn) => _.mapValues(obj, (value) => { if (_.isPlainObject(value)) return deepMapValues(value, fn); return fn(value); }); export const extendWithBind = (...args) => _.extendWith(...args, (objectValue, sourceValue, key, object, source) => { if (!_.isUndefined(objectValue)) { return objectValue; } if (_.isFunction(sourceValue)) { return sourceValue.bind(source); } return sourceValue; });
Remove not needed functions and move from other files
Remove not needed functions and move from other files
JavaScript
mit
devlucky/Kakapo.js,devlucky/Kakapo.js
javascript
## Code Before: import _ from 'lodash'; /** * Returns copy of an object with mapped values. Works really similar to * lodash's mapValues, with difference that also EVERY nested object is * also mapped with passed function. * * @param {Object} obj - object to map values of * @param {Function} fn - function to map values with * * @returns {Object} * @private */ export const deepMapValues = (obj, fn) => _.mapValues(obj, (value) => { if (_.isPlainObject(value)) return deepMapValues(value, fn); return fn(value); }); export const isFunction = (obj) => typeof obj === 'function'; ## Instruction: Remove not needed functions and move from other files ## Code After: import _ from 'lodash'; /** * Returns copy of an object with mapped values. Works really similar to * lodash's mapValues, with difference that also EVERY nested object is * also mapped with passed function. * * @param {Object} obj - object to map values of * @param {Function} fn - function to map values with * * @returns {Object} * @private */ export const deepMapValues = (obj, fn) => _.mapValues(obj, (value) => { if (_.isPlainObject(value)) return deepMapValues(value, fn); return fn(value); }); export const extendWithBind = (...args) => _.extendWith(...args, (objectValue, sourceValue, key, object, source) => { if (!_.isUndefined(objectValue)) { return objectValue; } if (_.isFunction(sourceValue)) { return sourceValue.bind(source); } return sourceValue; });
import _ from 'lodash'; /** * Returns copy of an object with mapped values. Works really similar to * lodash's mapValues, with difference that also EVERY nested object is * also mapped with passed function. * * @param {Object} obj - object to map values of * @param {Function} fn - function to map values with * * @returns {Object} * @private */ export const deepMapValues = (obj, fn) => _.mapValues(obj, (value) => { if (_.isPlainObject(value)) return deepMapValues(value, fn); return fn(value); }); - export const isFunction = (obj) => typeof obj === 'function'; + export const extendWithBind = (...args) => + _.extendWith(...args, (objectValue, sourceValue, key, object, source) => { + if (!_.isUndefined(objectValue)) { return objectValue; } + if (_.isFunction(sourceValue)) { return sourceValue.bind(source); } + return sourceValue; + });
7
0.368421
6
1
00d8956263124949673511a301fd7cc48d2a81cc
lib/devise/async/backend/sucker_punch.rb
lib/devise/async/backend/sucker_punch.rb
require "sucker_punch" module Devise module Async module Backend class SuckerPunch < Base include ::SuckerPunch::Job def self.enqueue(*args) new.async.perform(*args) end # Loads the resource record and sends the email. # # It uses `orm_adapter` API to fetch the record in order to enforce # compatibility among diferent ORMs. def perform(method, resource_class, resource_id, *args) ActiveRecord::Base.connection_pool.with_connection do resource = resource_class.constantize.to_adapter.get!(resource_id) args[-1] = args.last.symbolize_keys if args.last.is_a?(Hash) mailer_class(resource).send(method, resource, *args).deliver end end private def mailer_class(resource = nil) @mailer_class ||= Devise.mailer end end end end end
require "sucker_punch" module Devise module Async module Backend class SuckerPunch < Base include ::SuckerPunch::Job def self.enqueue(*args) new.async.perform(*args) end # Return the connection to the pool after we're done with it # see: https://github.com/brandonhilkert/sucker_punch#usage def perform(method, resource_class, resource_id, *args) ActiveRecord::Base.connection_pool.with_connection do super end end private def mailer_class(resource = nil) @mailer_class ||= Devise.mailer end end end end end
Fix comments for connection pooling
Fix comments for connection pooling
Ruby
mit
mhfs/devise-async,hewrin/devise-async
ruby
## Code Before: require "sucker_punch" module Devise module Async module Backend class SuckerPunch < Base include ::SuckerPunch::Job def self.enqueue(*args) new.async.perform(*args) end # Loads the resource record and sends the email. # # It uses `orm_adapter` API to fetch the record in order to enforce # compatibility among diferent ORMs. def perform(method, resource_class, resource_id, *args) ActiveRecord::Base.connection_pool.with_connection do resource = resource_class.constantize.to_adapter.get!(resource_id) args[-1] = args.last.symbolize_keys if args.last.is_a?(Hash) mailer_class(resource).send(method, resource, *args).deliver end end private def mailer_class(resource = nil) @mailer_class ||= Devise.mailer end end end end end ## Instruction: Fix comments for connection pooling ## Code After: require "sucker_punch" module Devise module Async module Backend class SuckerPunch < Base include ::SuckerPunch::Job def self.enqueue(*args) new.async.perform(*args) end # Return the connection to the pool after we're done with it # see: https://github.com/brandonhilkert/sucker_punch#usage def perform(method, resource_class, resource_id, *args) ActiveRecord::Base.connection_pool.with_connection do super end end private def mailer_class(resource = nil) @mailer_class ||= Devise.mailer end end end end end
require "sucker_punch" module Devise module Async module Backend class SuckerPunch < Base include ::SuckerPunch::Job def self.enqueue(*args) new.async.perform(*args) end + # Return the connection to the pool after we're done with it + # see: https://github.com/brandonhilkert/sucker_punch#usage - # Loads the resource record and sends the email. - # - # It uses `orm_adapter` API to fetch the record in order to enforce - # compatibility among diferent ORMs. def perform(method, resource_class, resource_id, *args) ActiveRecord::Base.connection_pool.with_connection do + super - resource = resource_class.constantize.to_adapter.get!(resource_id) - args[-1] = args.last.symbolize_keys if args.last.is_a?(Hash) - mailer_class(resource).send(method, resource, *args).deliver end end private def mailer_class(resource = nil) @mailer_class ||= Devise.mailer end end end end end
10
0.30303
3
7
6704c4dc8a14d01c1f419b460eeb1c7e9e12bfe6
lib/sepa/xml_templates/soap/op/get_certificate.xml
lib/sepa/xml_templates/soap/op/get_certificate.xml
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"> <env:Header/> <env:Body> <opc:getCertificatein xmlns:opc="http://mlp.op.fi/OPCertificateService"> <opc:RequestHeader> <opc:SenderId></opc:SenderId> <opc:RequestId></opc:RequestId> <opc:Timestamp></opc:Timestamp> </opc:RequestHeader> <opc:ApplicationRequest></opc:ApplicationRequest> </opc:getCertificatein> </env:Body> </env:Envelope>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:opc="http://mlp.op.fi/OPCertificateService"> <env:Header/> <env:Body> <opc:getCertificatein> <opc:RequestHeader> <opc:SenderId/> <opc:RequestId/> <opc:Timestamp/> </opc:RequestHeader> <opc:ApplicationRequest/> </opc:getCertificatein> </env:Body> </env:Envelope>
Move namespace definitions to root element and collapse empty tags
Move namespace definitions to root element and collapse empty tags
XML
mit
devlab-oy/sepa
xml
## Code Before: <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"> <env:Header/> <env:Body> <opc:getCertificatein xmlns:opc="http://mlp.op.fi/OPCertificateService"> <opc:RequestHeader> <opc:SenderId></opc:SenderId> <opc:RequestId></opc:RequestId> <opc:Timestamp></opc:Timestamp> </opc:RequestHeader> <opc:ApplicationRequest></opc:ApplicationRequest> </opc:getCertificatein> </env:Body> </env:Envelope> ## Instruction: Move namespace definitions to root element and collapse empty tags ## Code After: <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:opc="http://mlp.op.fi/OPCertificateService"> <env:Header/> <env:Body> <opc:getCertificatein> <opc:RequestHeader> <opc:SenderId/> <opc:RequestId/> <opc:Timestamp/> </opc:RequestHeader> <opc:ApplicationRequest/> </opc:getCertificatein> </env:Body> </env:Envelope>
- <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"> ? - + <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" + xmlns:opc="http://mlp.op.fi/OPCertificateService"> <env:Header/> <env:Body> - <opc:getCertificatein xmlns:opc="http://mlp.op.fi/OPCertificateService"> + <opc:getCertificatein> <opc:RequestHeader> - <opc:SenderId></opc:SenderId> - <opc:RequestId></opc:RequestId> - <opc:Timestamp></opc:Timestamp> + <opc:SenderId/> + <opc:RequestId/> + <opc:Timestamp/> </opc:RequestHeader> - <opc:ApplicationRequest></opc:ApplicationRequest> + <opc:ApplicationRequest/> </opc:getCertificatein> </env:Body> </env:Envelope>
13
1
7
6
8b2da192dbc26d7354ec1db9d101ae4c927b1bc6
src/state/middleware.js
src/state/middleware.js
import dataComplete from './actions/dataComplete'; import preprocessData from './actions/preprocessData'; import readFile from '../functions/file/readFile'; import preprocessFile from '../functions/file/preprocessFile'; import { PREPROCESSDATA, READDATA } from './constants'; const middleware = store => next => action => { const state = store.getState(); switch (action.type) { case READDATA: if (!state.coordIn || !state.fileIn) { console.error('Input fields not filled properly!'); break; } next(action); readFile(state.fileInList) .then(data => { store.dispatch(preprocessData(data)); }).catch(error => { console.error(error.message); }); break; case PREPROCESSDATA: preprocessFile(action.payload) .then(data => { store.dispatch(dataComplete(data)); }).catch(error => { console.error(error.message); }); break; default: next(action); } }; export default middleware;
import dataComplete from './actions/dataComplete'; import preprocessData from './actions/preprocessData'; import readFile from '../functions/file/readFile'; import preprocessFile from '../functions/file/preprocessFile'; import parseCoordinates from '../functions/parseCoordinates'; import issetCoordinates from '../functions/issetCoordinates'; import { PREPROCESSDATA, READDATA } from './constants'; const checkCoordinates = coordinates => issetCoordinates(parseCoordinates(coordinates)); const middleware = store => next => action => { const state = store.getState(); switch (action.type) { case READDATA: if (!state.coordIn || !state.fileIn || !checkCoordinates(state.coordIn)) { console.error('Input fields not filled properly!'); break; } next(action); readFile(state.fileInList) .then(data => { store.dispatch(preprocessData(data)); }).catch(error => { console.error(error.message); }); break; case PREPROCESSDATA: preprocessFile(action.payload) .then(data => { store.dispatch(dataComplete(data)); }).catch(error => { console.error(error.message); }); break; default: next(action); } }; export default middleware;
Check passed coordinates to be correct
Check passed coordinates to be correct
JavaScript
mit
krajvy/nearest-coordinates,krajvy/nearest-coordinates,krajvy/nearest-coordinates
javascript
## Code Before: import dataComplete from './actions/dataComplete'; import preprocessData from './actions/preprocessData'; import readFile from '../functions/file/readFile'; import preprocessFile from '../functions/file/preprocessFile'; import { PREPROCESSDATA, READDATA } from './constants'; const middleware = store => next => action => { const state = store.getState(); switch (action.type) { case READDATA: if (!state.coordIn || !state.fileIn) { console.error('Input fields not filled properly!'); break; } next(action); readFile(state.fileInList) .then(data => { store.dispatch(preprocessData(data)); }).catch(error => { console.error(error.message); }); break; case PREPROCESSDATA: preprocessFile(action.payload) .then(data => { store.dispatch(dataComplete(data)); }).catch(error => { console.error(error.message); }); break; default: next(action); } }; export default middleware; ## Instruction: Check passed coordinates to be correct ## Code After: import dataComplete from './actions/dataComplete'; import preprocessData from './actions/preprocessData'; import readFile from '../functions/file/readFile'; import preprocessFile from '../functions/file/preprocessFile'; import parseCoordinates from '../functions/parseCoordinates'; import issetCoordinates from '../functions/issetCoordinates'; import { PREPROCESSDATA, READDATA } from './constants'; const checkCoordinates = coordinates => issetCoordinates(parseCoordinates(coordinates)); const middleware = store => next => action => { const state = store.getState(); switch (action.type) { case READDATA: if (!state.coordIn || !state.fileIn || !checkCoordinates(state.coordIn)) { console.error('Input fields not filled properly!'); break; } next(action); readFile(state.fileInList) .then(data => { store.dispatch(preprocessData(data)); }).catch(error => { console.error(error.message); }); break; case PREPROCESSDATA: preprocessFile(action.payload) .then(data => { store.dispatch(dataComplete(data)); }).catch(error => { console.error(error.message); }); break; default: next(action); } }; export default middleware;
import dataComplete from './actions/dataComplete'; import preprocessData from './actions/preprocessData'; import readFile from '../functions/file/readFile'; import preprocessFile from '../functions/file/preprocessFile'; + import parseCoordinates from '../functions/parseCoordinates'; + import issetCoordinates from '../functions/issetCoordinates'; import { PREPROCESSDATA, READDATA } from './constants'; + + const checkCoordinates = coordinates => issetCoordinates(parseCoordinates(coordinates)); const middleware = store => next => action => { const state = store.getState(); switch (action.type) { case READDATA: - if (!state.coordIn || !state.fileIn) { + if (!state.coordIn || !state.fileIn || !checkCoordinates(state.coordIn)) { console.error('Input fields not filled properly!'); break; } next(action); readFile(state.fileInList) .then(data => { store.dispatch(preprocessData(data)); }).catch(error => { console.error(error.message); }); break; case PREPROCESSDATA: preprocessFile(action.payload) .then(data => { store.dispatch(dataComplete(data)); }).catch(error => { console.error(error.message); }); break; default: next(action); } }; export default middleware;
6
0.157895
5
1
187c249a4b8c01a92ec6b86bdf32d643cf8c74cd
app/Http/Controllers/GenreController.php
app/Http/Controllers/GenreController.php
<?php namespace App\Http\Controllers; use App\Genre; class GenreController extends Controller { public function index() { // Only include certain information $include = ['id', 'parent_id', 'name']; $genres = Genre::root()->getDescendantsAndSelf($include)->toHierarchy(); $genres = $this->cleanup($genres->toArray()); return $genres[1]; } /** * Recursively renames `name` to `text` and `children` to `nodes` * * @param array $array * * @return array */ private function cleanup(array $array) { foreach($array as &$value) { $value['text'] = $value['name']; $value['nodes'] = $value['children']; unset($value['name']); unset($value['children']); if (empty($value['nodes'])) { unset($value['nodes']); } else { $value['nodes'] = $this->cleanup($value['nodes']); } } return $array; } }
<?php namespace App\Http\Controllers; use App\Genre; class GenreController extends Controller { public function index() { // Only include certain information $include = ['id', 'parent_id', 'name']; $genres = Genre::root()->getDescendantsAndSelf($include)->toHierarchy(); $genres = $this->cleanup($genres->toArray()); return $genres[1]; } /** * Recursively renames `name` to `text` and `children` to `nodes` * * @param array $array * * @return array */ private function cleanup(array $array) { foreach($array as &$value) { $value['text'] = $value['name']; $value['nodes'] = $value['children']; unset($value['name']); unset($value['children']); unset($value['id']); unset($value['parent_id']); if (empty($value['nodes'])) { unset($value['nodes']); } else { $value['nodes'] = $this->cleanup($value['nodes']); } } return $array; } }
Hide more fields in JSON genre response
Hide more fields in JSON genre response
PHP
mit
ntzm/OpenPlaylists,ntzm/OpenPlaylists,natzim/OpenPlaylists,natzim/OpenPlaylists
php
## Code Before: <?php namespace App\Http\Controllers; use App\Genre; class GenreController extends Controller { public function index() { // Only include certain information $include = ['id', 'parent_id', 'name']; $genres = Genre::root()->getDescendantsAndSelf($include)->toHierarchy(); $genres = $this->cleanup($genres->toArray()); return $genres[1]; } /** * Recursively renames `name` to `text` and `children` to `nodes` * * @param array $array * * @return array */ private function cleanup(array $array) { foreach($array as &$value) { $value['text'] = $value['name']; $value['nodes'] = $value['children']; unset($value['name']); unset($value['children']); if (empty($value['nodes'])) { unset($value['nodes']); } else { $value['nodes'] = $this->cleanup($value['nodes']); } } return $array; } } ## Instruction: Hide more fields in JSON genre response ## Code After: <?php namespace App\Http\Controllers; use App\Genre; class GenreController extends Controller { public function index() { // Only include certain information $include = ['id', 'parent_id', 'name']; $genres = Genre::root()->getDescendantsAndSelf($include)->toHierarchy(); $genres = $this->cleanup($genres->toArray()); return $genres[1]; } /** * Recursively renames `name` to `text` and `children` to `nodes` * * @param array $array * * @return array */ private function cleanup(array $array) { foreach($array as &$value) { $value['text'] = $value['name']; $value['nodes'] = $value['children']; unset($value['name']); unset($value['children']); unset($value['id']); unset($value['parent_id']); if (empty($value['nodes'])) { unset($value['nodes']); } else { $value['nodes'] = $this->cleanup($value['nodes']); } } return $array; } }
<?php namespace App\Http\Controllers; use App\Genre; class GenreController extends Controller { public function index() { // Only include certain information $include = ['id', 'parent_id', 'name']; $genres = Genre::root()->getDescendantsAndSelf($include)->toHierarchy(); $genres = $this->cleanup($genres->toArray()); return $genres[1]; } /** * Recursively renames `name` to `text` and `children` to `nodes` * * @param array $array * * @return array */ private function cleanup(array $array) { foreach($array as &$value) { $value['text'] = $value['name']; $value['nodes'] = $value['children']; + unset($value['name']); unset($value['children']); + unset($value['id']); + unset($value['parent_id']); if (empty($value['nodes'])) { unset($value['nodes']); } else { $value['nodes'] = $this->cleanup($value['nodes']); } } return $array; } }
3
0.0625
3
0
01107b38c987fc885678e4b6e1c5a9aa6f3d9541
busted/modules/helper_loader.lua
busted/modules/helper_loader.lua
local utils = require 'busted.utils' return function() local loadHelper = function(helper, hpath, options, busted) local success, err = pcall(function() if helper:match('%.lua$') or helper:match('%.moon$') then dofile(utils.normpath(hpath)) else require(helper) end end) if not success then busted.publish({ 'error', 'helper' }, { descriptor = 'helper', name = helper }, nil, err, {}) end end return loadHelper end
local utils = require 'busted.utils' local hasMoon, moonscript = pcall(require, 'moonscript') return function() local loadHelper = function(helper, hpath, options, busted) local success, err = pcall(function() if helper:match('%.lua$') then dofile(utils.normpath(hpath)) elseif hasMoon and helper:match('%.moon$') then moonscript.dofile(utils.normpath(hpath)) else require(helper) end end) if not success then busted.publish({ 'error', 'helper' }, { descriptor = 'helper', name = helper }, nil, err, {}) end end return loadHelper end
Support loading helper moonscript files
Support loading helper moonscript files
Lua
mit
o-lim/busted,xyliuke/busted,nehz/busted,istr/busted,sobrinho/busted,ryanplusplus/busted,DorianGray/busted,Olivine-Labs/busted,leafo/busted,mpeterv/busted
lua
## Code Before: local utils = require 'busted.utils' return function() local loadHelper = function(helper, hpath, options, busted) local success, err = pcall(function() if helper:match('%.lua$') or helper:match('%.moon$') then dofile(utils.normpath(hpath)) else require(helper) end end) if not success then busted.publish({ 'error', 'helper' }, { descriptor = 'helper', name = helper }, nil, err, {}) end end return loadHelper end ## Instruction: Support loading helper moonscript files ## Code After: local utils = require 'busted.utils' local hasMoon, moonscript = pcall(require, 'moonscript') return function() local loadHelper = function(helper, hpath, options, busted) local success, err = pcall(function() if helper:match('%.lua$') then dofile(utils.normpath(hpath)) elseif hasMoon and helper:match('%.moon$') then moonscript.dofile(utils.normpath(hpath)) else require(helper) end end) if not success then busted.publish({ 'error', 'helper' }, { descriptor = 'helper', name = helper }, nil, err, {}) end end return loadHelper end
local utils = require 'busted.utils' + local hasMoon, moonscript = pcall(require, 'moonscript') return function() local loadHelper = function(helper, hpath, options, busted) local success, err = pcall(function() - if helper:match('%.lua$') or helper:match('%.moon$') then + if helper:match('%.lua$') then dofile(utils.normpath(hpath)) + elseif hasMoon and helper:match('%.moon$') then + moonscript.dofile(utils.normpath(hpath)) else require(helper) end end) if not success then busted.publish({ 'error', 'helper' }, { descriptor = 'helper', name = helper }, nil, err, {}) end end return loadHelper end
5
0.263158
4
1
da1d64bdd74da0c2dea21d9564fec37393ad733a
setup.cfg
setup.cfg
; E128: We prefer hang-closing visual indents ; E251: We prefer `function(x = 1)` over `function(x=1)` ; E501: We do not enforce a maximum line length ; F405: We ignore * module imports ; W503/4: We break lines before binary operators (Knuth's style) [flake8] hang-closing = true ignore = E128,E251,F405,E501,W504 [pep8] hang-closing = true ignore = E128,E251,F405,E501,W504 in-place = true [nosetests] where = tests exe = true with-doctest = true
; E128/133: We prefer hang-closing visual indents ; E251: We prefer `function(x = 1)` over `function(x=1)` ; E501: We do not enforce a maximum line length ; F403/405: We ignore * imports ; W503/504: We break lines before binary operators (Knuth's style) [flake8] hang-closing = true ignore = E128,E251,F403,F405,E501,W503 [pep8] hang-closing = true ignore = E128,E251,F403,F405,E501,W503 in-place = true [nosetests] where = tests exe = true with-doctest = true
Correct style ignore: W503 rather than W504
Correct style ignore: W503 rather than W504
INI
agpl-3.0
openfisca/openfisca-core,openfisca/openfisca-core
ini
## Code Before: ; E128: We prefer hang-closing visual indents ; E251: We prefer `function(x = 1)` over `function(x=1)` ; E501: We do not enforce a maximum line length ; F405: We ignore * module imports ; W503/4: We break lines before binary operators (Knuth's style) [flake8] hang-closing = true ignore = E128,E251,F405,E501,W504 [pep8] hang-closing = true ignore = E128,E251,F405,E501,W504 in-place = true [nosetests] where = tests exe = true with-doctest = true ## Instruction: Correct style ignore: W503 rather than W504 ## Code After: ; E128/133: We prefer hang-closing visual indents ; E251: We prefer `function(x = 1)` over `function(x=1)` ; E501: We do not enforce a maximum line length ; F403/405: We ignore * imports ; W503/504: We break lines before binary operators (Knuth's style) [flake8] hang-closing = true ignore = E128,E251,F403,F405,E501,W503 [pep8] hang-closing = true ignore = E128,E251,F403,F405,E501,W503 in-place = true [nosetests] where = tests exe = true with-doctest = true
- ; E128: We prefer hang-closing visual indents ? -- + ; E128/133: We prefer hang-closing visual indents ? ++++ - ; E251: We prefer `function(x = 1)` over `function(x=1)` + ; E251: We prefer `function(x = 1)` over `function(x=1)` ? ++ - ; E501: We do not enforce a maximum line length + ; E501: We do not enforce a maximum line length ? ++ - ; F405: We ignore * module imports ? -- ------- + ; F403/405: We ignore * imports ? ++++ - ; W503/4: We break lines before binary operators (Knuth's style) + ; W503/504: We break lines before binary operators (Knuth's style) ? ++ [flake8] hang-closing = true - ignore = E128,E251,F405,E501,W504 ? ^ + ignore = E128,E251,F403,F405,E501,W503 ? +++++ ^ [pep8] hang-closing = true - ignore = E128,E251,F405,E501,W504 ? ^ + ignore = E128,E251,F403,F405,E501,W503 ? +++++ ^ in-place = true [nosetests] where = tests exe = true with-doctest = true
14
0.7
7
7
f5bf74361f81fab20c8a59e25f4e7038a05380f1
lib/mdb/mdbd/api.go
lib/mdb/mdbd/api.go
package mdbd import ( "github.com/Symantec/Dominator/lib/mdb" "log" ) func StartMdbDaemon(mdbFileName string, logger *log.Logger) <-chan *mdb.Mdb { return startMdbDaemon(mdbFileName, logger) }
/* Package mdbd implements a simple MDB watcher. Package mdbd may be used to read MDB data from a file and watch for updates. */ package mdbd import ( "github.com/Symantec/Dominator/lib/mdb" "log" ) // StartMdbDaemon starts an in-process "daemon" goroutine which watches the // file named by mdbFileName for MDB updates. The default format is JSON, but // if the filename extension is ".gob" then GOB format is read. // If the file is replaced by a different inode, MDB data are read from the new // inode and if the MDB data are different than previously read, they are sent // over the returned channel. // The logger will be used to log problems. func StartMdbDaemon(mdbFileName string, logger *log.Logger) <-chan *mdb.Mdb { return startMdbDaemon(mdbFileName, logger) }
Add documentation to lib/mdb/mdbd package.
Add documentation to lib/mdb/mdbd package.
Go
apache-2.0
rgooch/Dominator,Symantec/Dominator,keep94/Dominator,Symantec/Dominator,Symantec/Dominator,keep94/Dominator,keep94/Dominator,rgooch/Dominator,rgooch/Dominator
go
## Code Before: package mdbd import ( "github.com/Symantec/Dominator/lib/mdb" "log" ) func StartMdbDaemon(mdbFileName string, logger *log.Logger) <-chan *mdb.Mdb { return startMdbDaemon(mdbFileName, logger) } ## Instruction: Add documentation to lib/mdb/mdbd package. ## Code After: /* Package mdbd implements a simple MDB watcher. Package mdbd may be used to read MDB data from a file and watch for updates. */ package mdbd import ( "github.com/Symantec/Dominator/lib/mdb" "log" ) // StartMdbDaemon starts an in-process "daemon" goroutine which watches the // file named by mdbFileName for MDB updates. The default format is JSON, but // if the filename extension is ".gob" then GOB format is read. // If the file is replaced by a different inode, MDB data are read from the new // inode and if the MDB data are different than previously read, they are sent // over the returned channel. // The logger will be used to log problems. func StartMdbDaemon(mdbFileName string, logger *log.Logger) <-chan *mdb.Mdb { return startMdbDaemon(mdbFileName, logger) }
+ /* + Package mdbd implements a simple MDB watcher. + + Package mdbd may be used to read MDB data from a file and watch for updates. + */ package mdbd import ( "github.com/Symantec/Dominator/lib/mdb" "log" ) + // StartMdbDaemon starts an in-process "daemon" goroutine which watches the + // file named by mdbFileName for MDB updates. The default format is JSON, but + // if the filename extension is ".gob" then GOB format is read. + // If the file is replaced by a different inode, MDB data are read from the new + // inode and if the MDB data are different than previously read, they are sent + // over the returned channel. + // The logger will be used to log problems. func StartMdbDaemon(mdbFileName string, logger *log.Logger) <-chan *mdb.Mdb { return startMdbDaemon(mdbFileName, logger) }
12
1.2
12
0
4069813bc0cfd3c6ead0dca3c71c8aeb9e759831
_layouts/post.html
_layouts/post.html
--- layout: default --- {% if page.cover_image %} <header class="cover-image-top" style="background-image: url('{{ page.cover_image }}')" data-top-top="background-position: 50% 50%;" data-top-bottom="background-position: 50% 70%;"> <div class="curtain" data-top-top="opacity: 0; filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);" data-top-bottom="opacity: 0.8; filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0.8);"></div> </header> {% endif %} <div class="content" role="main"> <article class="post"> <header class="post-header"> <a class="btn home" href="{{ site.baseurl }}/"><span aria-hidden="true" data-icon="«"></span></a> <div class="post-meta"> <time datetime="{{ page.date | date_to_xmlschema }}">{{ page.date | date_to_long_string }}</time> {% include category_links categories = page.categories %} </div> <h1 class="post-title">{{ page.title }}</h1> </header> <section class="post-content"> {{ content }} </section> <footer class="post-footer"> {% include share.html %} {% include author.html %} {% include disqus.html %} </footer> </article> </div>
--- layout: default --- {% if page.cover_image %} <header class="cover-image-top" style="background-image: url('{{ page.cover_image }}')" data-top-top="background-position: 50% 50%;" data-top-bottom="background-position: 50% 70%;"> <div class="curtain" data-top-top="opacity: 0; filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);" data-top-bottom="opacity: 0.8; filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0.8);"></div> </header> {% else %} <header class="site-header"></header> {% endif %} <div class="content" role="main"> <article class="post"> <header class="post-header"> <a class="btn home" href="{{ site.baseurl }}/"><span aria-hidden="true" data-icon="«"></span></a> <div class="post-meta"> <time datetime="{{ page.date | date_to_xmlschema }}">{{ page.date | date_to_long_string }}</time> {% include category_links categories = page.categories %} </div> <h1 class="post-title">{{ page.title }}</h1> </header> <section class="post-content"> {{ content }} </section> <footer class="post-footer"> {% include share.html %} {% include author.html %} {% include disqus.html %} </footer> </article> </div>
Add dummy header if there's no cover image
Add dummy header if there's no cover image
HTML
mit
yimingtang/blog.xianqu.org,yimingtang/soda,yimingtang/blog.xianqu.org,yimingtang/soda,yimingtang/soda,yimingtang/blog.xianqu.org
html
## Code Before: --- layout: default --- {% if page.cover_image %} <header class="cover-image-top" style="background-image: url('{{ page.cover_image }}')" data-top-top="background-position: 50% 50%;" data-top-bottom="background-position: 50% 70%;"> <div class="curtain" data-top-top="opacity: 0; filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);" data-top-bottom="opacity: 0.8; filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0.8);"></div> </header> {% endif %} <div class="content" role="main"> <article class="post"> <header class="post-header"> <a class="btn home" href="{{ site.baseurl }}/"><span aria-hidden="true" data-icon="«"></span></a> <div class="post-meta"> <time datetime="{{ page.date | date_to_xmlschema }}">{{ page.date | date_to_long_string }}</time> {% include category_links categories = page.categories %} </div> <h1 class="post-title">{{ page.title }}</h1> </header> <section class="post-content"> {{ content }} </section> <footer class="post-footer"> {% include share.html %} {% include author.html %} {% include disqus.html %} </footer> </article> </div> ## Instruction: Add dummy header if there's no cover image ## Code After: --- layout: default --- {% if page.cover_image %} <header class="cover-image-top" style="background-image: url('{{ page.cover_image }}')" data-top-top="background-position: 50% 50%;" data-top-bottom="background-position: 50% 70%;"> <div class="curtain" data-top-top="opacity: 0; filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);" data-top-bottom="opacity: 0.8; filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0.8);"></div> </header> {% else %} <header class="site-header"></header> {% endif %} <div class="content" role="main"> <article class="post"> <header class="post-header"> <a class="btn home" href="{{ site.baseurl }}/"><span aria-hidden="true" data-icon="«"></span></a> <div class="post-meta"> <time datetime="{{ page.date | date_to_xmlschema }}">{{ page.date | date_to_long_string }}</time> {% include category_links categories = page.categories %} </div> <h1 class="post-title">{{ page.title }}</h1> </header> <section class="post-content"> {{ content }} </section> <footer class="post-footer"> {% include share.html %} {% include author.html %} {% include disqus.html %} </footer> </article> </div>
--- layout: default --- {% if page.cover_image %} <header class="cover-image-top" style="background-image: url('{{ page.cover_image }}')" data-top-top="background-position: 50% 50%;" data-top-bottom="background-position: 50% 70%;"> <div class="curtain" data-top-top="opacity: 0; filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);" data-top-bottom="opacity: 0.8; filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0.8);"></div> </header> + {% else %} + <header class="site-header"></header> {% endif %} <div class="content" role="main"> <article class="post"> <header class="post-header"> <a class="btn home" href="{{ site.baseurl }}/"><span aria-hidden="true" data-icon="«"></span></a> <div class="post-meta"> <time datetime="{{ page.date | date_to_xmlschema }}">{{ page.date | date_to_long_string }}</time> {% include category_links categories = page.categories %} </div> <h1 class="post-title">{{ page.title }}</h1> </header> <section class="post-content"> {{ content }} </section> <footer class="post-footer"> {% include share.html %} {% include author.html %} {% include disqus.html %} </footer> </article> </div>
2
0.0625
2
0
3ce1f29a5a297c5a188c11cc5af75225c8ef2ac5
src/Listabierta/Bundle/MunicipalesBundle/Controller/CandidateController.php
src/Listabierta/Bundle/MunicipalesBundle/Controller/CandidateController.php
<?php namespace Listabierta\Bundle\MunicipalesBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; use Listabierta\Bundle\MunicipalesBundle\Form\Type\TownStep1Type; class CandidateController extends Controller { public function indexAction(Request $request = NULL) { $this->step1Action($request); } public function step1Action($address = NULL, Request $request = NULL) { $form = $this->createForm(new TownStep1Type(), NULL, array( 'action' => $this->generateUrl('candidate_step1', array('address' => $address)), 'method' => 'POST', ) ); $form->handleRequest($request); if ($form->isValid()) { } return $this->render('MunicipalesBundle:Candidate:step1.html.twig', array( 'address' => $address, 'form' => $form->createView(), 'errors' => $form->getErrors() )); } }
<?php namespace Listabierta\Bundle\MunicipalesBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; use Listabierta\Bundle\MunicipalesBundle\Form\Type\TownStep1Type; class CandidateController extends Controller { public function indexAction(Request $request = NULL) { $this->step1Action($request); } public function step1Action($address = NULL, Request $request = NULL) { $entity_manager = $this->getDoctrine()->getManager(); $admin_candidacy_repository = $entity_manager->getRepository('Listabierta\Bundle\MunicipalesBundle\Entity\AdminCandidacy'); $address_slug = $this->get('slugify')->slugify($address); $admin_candidacy = $admin_candidacy_repository->findOneBy(array('address' => $address_slug)); if(empty($admin_candidacy)) { throw $this->createNotFoundException('No existe la candidatura de administrador para cargar la dirección ' . $address_slug); } $form = $this->createForm(new TownStep1Type(), NULL, array( 'action' => $this->generateUrl('candidate_step1', array('address' => $address)), 'method' => 'POST', ) ); $form->handleRequest($request); if ($form->isValid()) { } return $this->render('MunicipalesBundle:Candidate:step1.html.twig', array( 'address' => $address, 'town' => $admin_candidacy->getTown(), 'form' => $form->createView(), 'errors' => $form->getErrors() )); } }
Check address slug for candidate first step
Check address slug for candidate first step
PHP
agpl-3.0
listabierta/census-ahoraencomun,listabierta/census-ahoraencomun,listabierta/census-ahoraencomun,listabierta/census-ahoraencomun
php
## Code Before: <?php namespace Listabierta\Bundle\MunicipalesBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; use Listabierta\Bundle\MunicipalesBundle\Form\Type\TownStep1Type; class CandidateController extends Controller { public function indexAction(Request $request = NULL) { $this->step1Action($request); } public function step1Action($address = NULL, Request $request = NULL) { $form = $this->createForm(new TownStep1Type(), NULL, array( 'action' => $this->generateUrl('candidate_step1', array('address' => $address)), 'method' => 'POST', ) ); $form->handleRequest($request); if ($form->isValid()) { } return $this->render('MunicipalesBundle:Candidate:step1.html.twig', array( 'address' => $address, 'form' => $form->createView(), 'errors' => $form->getErrors() )); } } ## Instruction: Check address slug for candidate first step ## Code After: <?php namespace Listabierta\Bundle\MunicipalesBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; use Listabierta\Bundle\MunicipalesBundle\Form\Type\TownStep1Type; class CandidateController extends Controller { public function indexAction(Request $request = NULL) { $this->step1Action($request); } public function step1Action($address = NULL, Request $request = NULL) { $entity_manager = $this->getDoctrine()->getManager(); $admin_candidacy_repository = $entity_manager->getRepository('Listabierta\Bundle\MunicipalesBundle\Entity\AdminCandidacy'); $address_slug = $this->get('slugify')->slugify($address); $admin_candidacy = $admin_candidacy_repository->findOneBy(array('address' => $address_slug)); if(empty($admin_candidacy)) { throw $this->createNotFoundException('No existe la candidatura de administrador para cargar la dirección ' . $address_slug); } $form = $this->createForm(new TownStep1Type(), NULL, array( 'action' => $this->generateUrl('candidate_step1', array('address' => $address)), 'method' => 'POST', ) ); $form->handleRequest($request); if ($form->isValid()) { } return $this->render('MunicipalesBundle:Candidate:step1.html.twig', array( 'address' => $address, 'town' => $admin_candidacy->getTown(), 'form' => $form->createView(), 'errors' => $form->getErrors() )); } }
<?php namespace Listabierta\Bundle\MunicipalesBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; use Listabierta\Bundle\MunicipalesBundle\Form\Type\TownStep1Type; class CandidateController extends Controller { public function indexAction(Request $request = NULL) { $this->step1Action($request); } public function step1Action($address = NULL, Request $request = NULL) { + $entity_manager = $this->getDoctrine()->getManager(); + + $admin_candidacy_repository = $entity_manager->getRepository('Listabierta\Bundle\MunicipalesBundle\Entity\AdminCandidacy'); + + $address_slug = $this->get('slugify')->slugify($address); + + $admin_candidacy = $admin_candidacy_repository->findOneBy(array('address' => $address_slug)); + + if(empty($admin_candidacy)) + { + throw $this->createNotFoundException('No existe la candidatura de administrador para cargar la dirección ' . $address_slug); + } + $form = $this->createForm(new TownStep1Type(), NULL, array( 'action' => $this->generateUrl('candidate_step1', array('address' => $address)), 'method' => 'POST', ) ); $form->handleRequest($request); if ($form->isValid()) { } return $this->render('MunicipalesBundle:Candidate:step1.html.twig', array( 'address' => $address, + 'town' => $admin_candidacy->getTown(), 'form' => $form->createView(), 'errors' => $form->getErrors() )); } }
14
0.378378
14
0
f88f92ff1c506ba71bf1bd9ed0fdecfa582bb6a6
katalyze/run_katalyze.sh
katalyze/run_katalyze.sh
CP=`find lib/*.jar | tr '\n' ':'`src echo $CP # run! #cat data/kattislog_rehearsal_2011.txt | java -classpath $CP katalyzeapp.Katalyze $@ #netcat 192.168.1.141 4714 | java -classpath $CP katalyzeapp.Katalyze $@ curl --user analyst:dr0pjes --netrc --insecure --max-time 360000 https://192.168.1.207/events | java -classpath $CP katalyzeapp.Katalyze $@ # wait until input read x
CP=`find lib/*.jar | tr '\n' ':'`src echo $CP # Read CDS connection data from global config file, using # very hackish YAML parsing eval `grep -A4 '^CDS:' ../config.yaml | tail -n +2 | \ sed 's/^[[:space:]]*\([a-z]*\):[[:space:]]*\(.*\)/\1=\2/'` # run! #cat data/kattislog_rehearsal_2011.txt | java -classpath $CP katalyzeapp.Katalyze $@ #netcat 192.168.1.141 4714 | java -classpath $CP katalyzeapp.Katalyze $@ curl --user $user:$pass --no-buffer --netrc --insecure --max-time 360000 \ "${baseurl}/events" | java -classpath $CP katalyzeapp.Katalyze $@ # wait until input read x
Read CDS connection data from global config YAML. Hackish implementation via shell script code.
Read CDS connection data from global config YAML. Hackish implementation via shell script code.
Shell
mit
eldering/autoanalyst,eldering/autoanalyst,eldering/autoanalyst,eldering/autoanalyst,eldering/autoanalyst,eldering/autoanalyst,eldering/autoanalyst
shell
## Code Before: CP=`find lib/*.jar | tr '\n' ':'`src echo $CP # run! #cat data/kattislog_rehearsal_2011.txt | java -classpath $CP katalyzeapp.Katalyze $@ #netcat 192.168.1.141 4714 | java -classpath $CP katalyzeapp.Katalyze $@ curl --user analyst:dr0pjes --netrc --insecure --max-time 360000 https://192.168.1.207/events | java -classpath $CP katalyzeapp.Katalyze $@ # wait until input read x ## Instruction: Read CDS connection data from global config YAML. Hackish implementation via shell script code. ## Code After: CP=`find lib/*.jar | tr '\n' ':'`src echo $CP # Read CDS connection data from global config file, using # very hackish YAML parsing eval `grep -A4 '^CDS:' ../config.yaml | tail -n +2 | \ sed 's/^[[:space:]]*\([a-z]*\):[[:space:]]*\(.*\)/\1=\2/'` # run! #cat data/kattislog_rehearsal_2011.txt | java -classpath $CP katalyzeapp.Katalyze $@ #netcat 192.168.1.141 4714 | java -classpath $CP katalyzeapp.Katalyze $@ curl --user $user:$pass --no-buffer --netrc --insecure --max-time 360000 \ "${baseurl}/events" | java -classpath $CP katalyzeapp.Katalyze $@ # wait until input read x
CP=`find lib/*.jar | tr '\n' ':'`src echo $CP + # Read CDS connection data from global config file, using + # very hackish YAML parsing + eval `grep -A4 '^CDS:' ../config.yaml | tail -n +2 | \ + sed 's/^[[:space:]]*\([a-z]*\):[[:space:]]*\(.*\)/\1=\2/'` + # run! #cat data/kattislog_rehearsal_2011.txt | java -classpath $CP katalyzeapp.Katalyze $@ #netcat 192.168.1.141 4714 | java -classpath $CP katalyzeapp.Katalyze $@ - curl --user analyst:dr0pjes --netrc --insecure --max-time 360000 https://192.168.1.207/events | java -classpath $CP katalyzeapp.Katalyze $@ + curl --user $user:$pass --no-buffer --netrc --insecure --max-time 360000 \ + "${baseurl}/events" | java -classpath $CP katalyzeapp.Katalyze $@ # wait until input read x
8
0.727273
7
1
0500ac6733c5c4a070effc349402c103ac5010bd
src/scripts/ci/appveyor.yml
src/scripts/ci/appveyor.yml
os: Windows Server 2012 R2 platform: - x86 - x86_amd64 install: - call "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" %PLATFORM% - cl # check compiler version build_script: - python configure.py --disable-shared --via-amalgamation --cpu=%PLATFORM% --cc=msvc - nmake - botan-test - nmake install
os: Windows Server 2012 R2 platform: - x86 - x86_amd64 environment: matrix: - MODE: --enable-shared - MODE: --disable-shared install: - call "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" %PLATFORM% - cl # check compiler version # always build via amalgamation due to build time constraints on appveyor build_script: - python configure.py --cc=msvc --via-amalgamation --cpu=%PLATFORM% %MODE% - nmake - botan-test - nmake install
Add DLL target to MSVC CI build
Add DLL target to MSVC CI build
YAML
bsd-2-clause
randombit/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,randombit/botan,randombit/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,randombit/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan
yaml
## Code Before: os: Windows Server 2012 R2 platform: - x86 - x86_amd64 install: - call "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" %PLATFORM% - cl # check compiler version build_script: - python configure.py --disable-shared --via-amalgamation --cpu=%PLATFORM% --cc=msvc - nmake - botan-test - nmake install ## Instruction: Add DLL target to MSVC CI build ## Code After: os: Windows Server 2012 R2 platform: - x86 - x86_amd64 environment: matrix: - MODE: --enable-shared - MODE: --disable-shared install: - call "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" %PLATFORM% - cl # check compiler version # always build via amalgamation due to build time constraints on appveyor build_script: - python configure.py --cc=msvc --via-amalgamation --cpu=%PLATFORM% %MODE% - nmake - botan-test - nmake install
os: Windows Server 2012 R2 platform: - x86 - x86_amd64 + environment: + matrix: + - MODE: --enable-shared + - MODE: --disable-shared + install: - call "%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" %PLATFORM% - cl # check compiler version + # always build via amalgamation due to build time constraints on appveyor build_script: - - python configure.py --disable-shared --via-amalgamation --cpu=%PLATFORM% --cc=msvc ? ^^ ^^^^^^^^^^^ ^^^^^^^^^ + - python configure.py --cc=msvc --via-amalgamation --cpu=%PLATFORM% %MODE% ? ^^^^ ^^ ^^^^^^ - nmake - botan-test - nmake install
8
0.533333
7
1
84bdedccd287375690779105c00e2fddd4fed7d3
lib/voteable/voteable.rb
lib/voteable/voteable.rb
module Voteable def is_voteable(options = {}, &block) has n, :votes, 'Voteable::Vote', :as => :voteable, :child_key => [ :voteable_id ] #if !options[:every_x_days].nil? # Vote.instance_eval { @@x_days = 0; def x_days; @@x_days; end; def x_days=(value); @@x_days = (value); end } # Vote.x_days = options[:every_x_days] #end include Voteable::InstanceMethods end module InstanceMethods def vote(voter = nil) Voteable::Vote.create(voteable_id: self.id, voteable_type: self.class, voter: voter) end def votes_count Voteable::Vote.all(voteable_id: self.id, voteable_type: self.class).count end end end
module Voteable def is_voteable(options = {}) has n, :votes, 'Voteable::Vote', as: :voteable, child_key: [ :voteable_id ] if (!options[:time_between_votes].nil? && options[:time_between_votes].class == Proc) class << self attr_accessor :time_between_votes end self.time_between_votes = options[:time_between_votes] end include Voteable::InstanceMethods end module InstanceMethods def vote(voter = nil) Voteable::Vote.create(voteable_id: self.id, voteable_type: self.class, voter: voter) end def votes_count Voteable::Vote.all(voteable_id: self.id, voteable_type: self.class).count end end end
Change interface for setting the time between interface. Now accept a proc.
Change interface for setting the time between interface. Now accept a proc.
Ruby
mit
brianp/dm-is-voteable
ruby
## Code Before: module Voteable def is_voteable(options = {}, &block) has n, :votes, 'Voteable::Vote', :as => :voteable, :child_key => [ :voteable_id ] #if !options[:every_x_days].nil? # Vote.instance_eval { @@x_days = 0; def x_days; @@x_days; end; def x_days=(value); @@x_days = (value); end } # Vote.x_days = options[:every_x_days] #end include Voteable::InstanceMethods end module InstanceMethods def vote(voter = nil) Voteable::Vote.create(voteable_id: self.id, voteable_type: self.class, voter: voter) end def votes_count Voteable::Vote.all(voteable_id: self.id, voteable_type: self.class).count end end end ## Instruction: Change interface for setting the time between interface. Now accept a proc. ## Code After: module Voteable def is_voteable(options = {}) has n, :votes, 'Voteable::Vote', as: :voteable, child_key: [ :voteable_id ] if (!options[:time_between_votes].nil? && options[:time_between_votes].class == Proc) class << self attr_accessor :time_between_votes end self.time_between_votes = options[:time_between_votes] end include Voteable::InstanceMethods end module InstanceMethods def vote(voter = nil) Voteable::Vote.create(voteable_id: self.id, voteable_type: self.class, voter: voter) end def votes_count Voteable::Vote.all(voteable_id: self.id, voteable_type: self.class).count end end end
module Voteable - def is_voteable(options = {}, &block) ? -------- + def is_voteable(options = {}) - has n, :votes, 'Voteable::Vote', :as => :voteable, :child_key => [ :voteable_id ] ? - ^^^ - ^^^ + has n, :votes, 'Voteable::Vote', as: :voteable, child_key: [ :voteable_id ] ? ^ ^ - #if !options[:every_x_days].nil? - # Vote.instance_eval { @@x_days = 0; def x_days; @@x_days; end; def x_days=(value); @@x_days = (value); end } - # Vote.x_days = options[:every_x_days] + if (!options[:time_between_votes].nil? && options[:time_between_votes].class == Proc) + class << self + attr_accessor :time_between_votes + end + self.time_between_votes = options[:time_between_votes] - #end ? - + end include Voteable::InstanceMethods end module InstanceMethods def vote(voter = nil) Voteable::Vote.create(voteable_id: self.id, voteable_type: self.class, voter: voter) end def votes_count Voteable::Vote.all(voteable_id: self.id, voteable_type: self.class).count end end end
14
0.636364
8
6
5502a0be6f419990b95480c5d92d0bc594783c80
tests/test_redgem.py
tests/test_redgem.py
from pytfa.redgem.redgem import RedGEM from pytfa.io import import_matlab_model from pytfa.io.base import load_thermoDB from pytfa.thermo.tmodel import ThermoModel from pytfa.io import read_compartment_data, apply_compartment_data, read_lexicon, annotate_from_lexicon path_to_model = 'models/small_ecoli.mat' thermoDB = "data/thermo_data.thermodb" carbon_uptake = 60000 growth = 0.5 model = import_matlab_model(path_to_model) thermo_data = load_thermoDB(thermoDB) lexicon = read_lexicon('models/iJO1366/lexicon.csv') compartment_data = read_compartment_data('models/iJO1366/compartment_data.json') tfa_model = ThermoModel(thermo_data, model) annotate_from_lexicon(tfa_model, lexicon) apply_compartment_data(tfa_model, compartment_data) tfa_model.name = 'Lumped Model' path_to_params = 'tests/redgem_params.yml' redgem = RedGEM(tfa_model, path_to_params, False) redgem.run()
from pytfa.redgem.redgem import RedGEM from pytfa.io import import_matlab_model from pytfa.io.base import load_thermoDB from pytfa.thermo.tmodel import ThermoModel from pytfa.io import read_compartment_data, apply_compartment_data, read_lexicon, annotate_from_lexicon path_to_model = 'models/small_ecoli.mat' thermoDB = "data/thermo_data.thermodb" path_to_lexicon = 'models/iJO1366/lexicon.csv' path_to_compartment_data = 'models/iJO1366/compartment_data.json' model = import_matlab_model(path_to_model) thermo_data = load_thermoDB(thermoDB) lexicon = read_lexicon(path_to_lexicon) compartment_data = read_compartment_data(path_to_compartment_data) tfa_model = ThermoModel(thermo_data, model) annotate_from_lexicon(tfa_model, lexicon) apply_compartment_data(tfa_model, compartment_data) tfa_model.name = 'Lumped Model' path_to_params = 'tests/redgem_params.yml' redgem = RedGEM(tfa_model, path_to_params, False) redgem.run()
Remove unused parameters in test script
FIX: Remove unused parameters in test script
Python
apache-2.0
EPFL-LCSB/pytfa,EPFL-LCSB/pytfa
python
## Code Before: from pytfa.redgem.redgem import RedGEM from pytfa.io import import_matlab_model from pytfa.io.base import load_thermoDB from pytfa.thermo.tmodel import ThermoModel from pytfa.io import read_compartment_data, apply_compartment_data, read_lexicon, annotate_from_lexicon path_to_model = 'models/small_ecoli.mat' thermoDB = "data/thermo_data.thermodb" carbon_uptake = 60000 growth = 0.5 model = import_matlab_model(path_to_model) thermo_data = load_thermoDB(thermoDB) lexicon = read_lexicon('models/iJO1366/lexicon.csv') compartment_data = read_compartment_data('models/iJO1366/compartment_data.json') tfa_model = ThermoModel(thermo_data, model) annotate_from_lexicon(tfa_model, lexicon) apply_compartment_data(tfa_model, compartment_data) tfa_model.name = 'Lumped Model' path_to_params = 'tests/redgem_params.yml' redgem = RedGEM(tfa_model, path_to_params, False) redgem.run() ## Instruction: FIX: Remove unused parameters in test script ## Code After: from pytfa.redgem.redgem import RedGEM from pytfa.io import import_matlab_model from pytfa.io.base import load_thermoDB from pytfa.thermo.tmodel import ThermoModel from pytfa.io import read_compartment_data, apply_compartment_data, read_lexicon, annotate_from_lexicon path_to_model = 'models/small_ecoli.mat' thermoDB = "data/thermo_data.thermodb" path_to_lexicon = 'models/iJO1366/lexicon.csv' path_to_compartment_data = 'models/iJO1366/compartment_data.json' model = import_matlab_model(path_to_model) thermo_data = load_thermoDB(thermoDB) lexicon = read_lexicon(path_to_lexicon) compartment_data = read_compartment_data(path_to_compartment_data) tfa_model = ThermoModel(thermo_data, model) annotate_from_lexicon(tfa_model, lexicon) apply_compartment_data(tfa_model, compartment_data) tfa_model.name = 'Lumped Model' path_to_params = 'tests/redgem_params.yml' redgem = RedGEM(tfa_model, path_to_params, False) redgem.run()
from pytfa.redgem.redgem import RedGEM from pytfa.io import import_matlab_model from pytfa.io.base import load_thermoDB from pytfa.thermo.tmodel import ThermoModel from pytfa.io import read_compartment_data, apply_compartment_data, read_lexicon, annotate_from_lexicon - path_to_model = 'models/small_ecoli.mat' thermoDB = "data/thermo_data.thermodb" - carbon_uptake = 60000 - growth = 0.5 + path_to_lexicon = 'models/iJO1366/lexicon.csv' + path_to_compartment_data = 'models/iJO1366/compartment_data.json' model = import_matlab_model(path_to_model) thermo_data = load_thermoDB(thermoDB) - lexicon = read_lexicon('models/iJO1366/lexicon.csv') + lexicon = read_lexicon(path_to_lexicon) - compartment_data = read_compartment_data('models/iJO1366/compartment_data.json') ? ^^ ^^^^^^^^^^^^^ ------ + compartment_data = read_compartment_data(path_to_compartment_data) ? ^^^^^^ ^ tfa_model = ThermoModel(thermo_data, model) annotate_from_lexicon(tfa_model, lexicon) apply_compartment_data(tfa_model, compartment_data) tfa_model.name = 'Lumped Model' path_to_params = 'tests/redgem_params.yml' redgem = RedGEM(tfa_model, path_to_params, False) redgem.run()
9
0.310345
4
5
71d0862a28e5711a665e713e971849bc06d9335b
setup.py
setup.py
"""Setup script for humanize.""" from setuptools import setup, find_packages import sys, os import io version = '0.5.1' # some trove classifiers: setup( name='humanize', version=version, description="python humanize utilities", long_description=io.open('README.rst', 'r', encoding="UTF-8").read(), # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: POSIX', 'Programming Language :: Python :: 3', 'Programming Language :: Python', ], keywords='humanize time size', author='Jason Moiron', author_email='jmoiron@jmoiron.net', url='http://github.com/jmoiron/humanize', license='MIT', packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), include_package_data=True, zip_safe=False, test_suite="tests", tests_require=['mock'], install_requires=[ # -*- Extra requirements: -*- ], entry_points=""" # -*- Entry points: -*- """, )
"""Setup script for humanize.""" from setuptools import setup, find_packages import io version = '0.5.1' setup( name='humanize', version=version, description="python humanize utilities", long_description=io.open('README.rst', 'r', encoding="UTF-8").read(), # Get strings from https://pypi.org/pypi?%3Aaction=list_classifiers classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: POSIX', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', ], keywords='humanize time size', author='Jason Moiron', author_email='jmoiron@jmoiron.net', url='https://github.com/jmoiron/humanize', license='MIT', packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), include_package_data=True, zip_safe=False, test_suite="tests", tests_require=['mock'], install_requires=[ # -*- Extra requirements: -*- ], entry_points=""" # -*- Entry points: -*- """, )
Update Trove classifiers to match tested versions
Update Trove classifiers to match tested versions
Python
mit
jmoiron/humanize,jmoiron/humanize
python
## Code Before: """Setup script for humanize.""" from setuptools import setup, find_packages import sys, os import io version = '0.5.1' # some trove classifiers: setup( name='humanize', version=version, description="python humanize utilities", long_description=io.open('README.rst', 'r', encoding="UTF-8").read(), # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: POSIX', 'Programming Language :: Python :: 3', 'Programming Language :: Python', ], keywords='humanize time size', author='Jason Moiron', author_email='jmoiron@jmoiron.net', url='http://github.com/jmoiron/humanize', license='MIT', packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), include_package_data=True, zip_safe=False, test_suite="tests", tests_require=['mock'], install_requires=[ # -*- Extra requirements: -*- ], entry_points=""" # -*- Entry points: -*- """, ) ## Instruction: Update Trove classifiers to match tested versions ## Code After: """Setup script for humanize.""" from setuptools import setup, find_packages import io version = '0.5.1' setup( name='humanize', version=version, description="python humanize utilities", long_description=io.open('README.rst', 'r', encoding="UTF-8").read(), # Get strings from https://pypi.org/pypi?%3Aaction=list_classifiers classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: POSIX', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', ], keywords='humanize time size', author='Jason Moiron', author_email='jmoiron@jmoiron.net', url='https://github.com/jmoiron/humanize', license='MIT', packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), include_package_data=True, zip_safe=False, test_suite="tests", tests_require=['mock'], install_requires=[ # -*- Extra requirements: -*- ], entry_points=""" # -*- Entry points: -*- """, )
"""Setup script for humanize.""" from setuptools import setup, find_packages - import sys, os import io version = '0.5.1' - - # some trove classifiers: - setup( name='humanize', version=version, description="python humanize utilities", long_description=io.open('README.rst', 'r', encoding="UTF-8").read(), - # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers ? ------- + # Get strings from https://pypi.org/pypi?%3Aaction=list_classifiers ? + classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: POSIX', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python', + 'Programming Language :: Python :: 3.5', ? +++++++ + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: Implementation :: CPython', + 'Programming Language :: Python :: Implementation :: PyPy', ], keywords='humanize time size', author='Jason Moiron', author_email='jmoiron@jmoiron.net', - url='http://github.com/jmoiron/humanize', + url='https://github.com/jmoiron/humanize', ? + license='MIT', packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), include_package_data=True, zip_safe=False, test_suite="tests", tests_require=['mock'], install_requires=[ # -*- Extra requirements: -*- ], entry_points=""" # -*- Entry points: -*- """, )
18
0.409091
11
7
7f8455c9687e8c7750fe1cfcbfdf4fd720888012
iis/__init__.py
iis/__init__.py
import logging.config from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate from flask_mail import Mail from flask_user import UserManager, SQLAlchemyAdapter from flask_bootstrap import Bootstrap def create_app(config: object) -> Flask: """Create the flask app. Can be called from testing contexts""" app = Flask(__name__) app.config.from_envvar('IIS_FLASK_SETTINGS') app.config.from_object(config) # Call app.logger to prevent it from clobbering configuration app.logger logging.config.dictConfig(app.config['LOGGING']) app.logger.info("App configured.") return app app = create_app(None) # Set up SQLAlchemy and Migrate db = SQLAlchemy(app) # type: SQLAlchemy migrate = Migrate(app, db) # Load Flask-Mail mail = Mail(app) # Set up bootstrap Bootstrap(app) # Configure user model for Flask-User from iis.models import User # noqa: E402 db_adapter = SQLAlchemyAdapter(db, User) user_manager = UserManager(db_adapter, app) from iis import views, models # noqa: E402, F401
import logging.config from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate from flask_mail import Mail from flask_user import UserManager, SQLAlchemyAdapter from flask_bootstrap import Bootstrap import iis.jobs def create_app(config: object) -> Flask: """Create the flask app. Can be called from testing contexts""" app = Flask(__name__) app.config.from_envvar("IIS_FLASK_SETTINGS") app.config.from_object(config) # Register blueprints app.register_blueprint(iis.jobs.jobs, url_prefix="/jobs") # Call app.logger to prevent it from clobbering configuration app.logger logging.config.dictConfig(app.config["LOGGING"]) app.logger.info("App configured.") return app app = create_app(None) # Set up SQLAlchemy and Migrate db = SQLAlchemy(app) # type: SQLAlchemy migrate = Migrate(app, db) # Load Flask-Mail mail = Mail(app) # Set up bootstrap Bootstrap(app) # Configure user model for Flask-User from iis.models import User # noqa: E402 db_adapter = SQLAlchemyAdapter(db, User) user_manager = UserManager(db_adapter, app) from iis import views, models # noqa: E402, F401
Use '"' for string delimeter
Use '"' for string delimeter
Python
agpl-3.0
interactomix/iis,interactomix/iis
python
## Code Before: import logging.config from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate from flask_mail import Mail from flask_user import UserManager, SQLAlchemyAdapter from flask_bootstrap import Bootstrap def create_app(config: object) -> Flask: """Create the flask app. Can be called from testing contexts""" app = Flask(__name__) app.config.from_envvar('IIS_FLASK_SETTINGS') app.config.from_object(config) # Call app.logger to prevent it from clobbering configuration app.logger logging.config.dictConfig(app.config['LOGGING']) app.logger.info("App configured.") return app app = create_app(None) # Set up SQLAlchemy and Migrate db = SQLAlchemy(app) # type: SQLAlchemy migrate = Migrate(app, db) # Load Flask-Mail mail = Mail(app) # Set up bootstrap Bootstrap(app) # Configure user model for Flask-User from iis.models import User # noqa: E402 db_adapter = SQLAlchemyAdapter(db, User) user_manager = UserManager(db_adapter, app) from iis import views, models # noqa: E402, F401 ## Instruction: Use '"' for string delimeter ## Code After: import logging.config from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate from flask_mail import Mail from flask_user import UserManager, SQLAlchemyAdapter from flask_bootstrap import Bootstrap import iis.jobs def create_app(config: object) -> Flask: """Create the flask app. Can be called from testing contexts""" app = Flask(__name__) app.config.from_envvar("IIS_FLASK_SETTINGS") app.config.from_object(config) # Register blueprints app.register_blueprint(iis.jobs.jobs, url_prefix="/jobs") # Call app.logger to prevent it from clobbering configuration app.logger logging.config.dictConfig(app.config["LOGGING"]) app.logger.info("App configured.") return app app = create_app(None) # Set up SQLAlchemy and Migrate db = SQLAlchemy(app) # type: SQLAlchemy migrate = Migrate(app, db) # Load Flask-Mail mail = Mail(app) # Set up bootstrap Bootstrap(app) # Configure user model for Flask-User from iis.models import User # noqa: E402 db_adapter = SQLAlchemyAdapter(db, User) user_manager = UserManager(db_adapter, app) from iis import views, models # noqa: E402, F401
import logging.config from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate from flask_mail import Mail from flask_user import UserManager, SQLAlchemyAdapter from flask_bootstrap import Bootstrap + import iis.jobs + def create_app(config: object) -> Flask: """Create the flask app. Can be called from testing contexts""" app = Flask(__name__) - app.config.from_envvar('IIS_FLASK_SETTINGS') ? ^ ^ + app.config.from_envvar("IIS_FLASK_SETTINGS") ? ^ ^ app.config.from_object(config) + + # Register blueprints + app.register_blueprint(iis.jobs.jobs, url_prefix="/jobs") # Call app.logger to prevent it from clobbering configuration app.logger - logging.config.dictConfig(app.config['LOGGING']) ? ^ ^ + logging.config.dictConfig(app.config["LOGGING"]) ? ^ ^ app.logger.info("App configured.") return app app = create_app(None) # Set up SQLAlchemy and Migrate db = SQLAlchemy(app) # type: SQLAlchemy migrate = Migrate(app, db) # Load Flask-Mail mail = Mail(app) # Set up bootstrap Bootstrap(app) # Configure user model for Flask-User from iis.models import User # noqa: E402 db_adapter = SQLAlchemyAdapter(db, User) user_manager = UserManager(db_adapter, app) from iis import views, models # noqa: E402, F401
9
0.209302
7
2
fc2fd2ba734a0016bac829f643aa99d8c9a08cda
tests/unit/dashboard/route-test.js
tests/unit/dashboard/route-test.js
import { moduleFor, test } from 'ember-qunit'; moduleFor('route:dashboard', 'Unit | Route | dashboard', { // Specify the other units that are required for this test. // needs: ['controller:foo'] }); test('it exists', function(assert) { const route = this.subject(); assert.ok(route); });
import { moduleFor, test } from 'ember-qunit'; moduleFor('route:dashboard', 'Unit | Route | dashboard', { // Specify the other units that are required for this test. needs: ['service:metrics'], }); test('it exists', function(assert) { const route = this.subject(); assert.ok(route); });
Add 'service:metrics' to dashboard route test
Add 'service:metrics' to dashboard route test
JavaScript
apache-2.0
hmoco/ember-osf-web,hmoco/ember-osf-web,hmoco/ember-osf-web
javascript
## Code Before: import { moduleFor, test } from 'ember-qunit'; moduleFor('route:dashboard', 'Unit | Route | dashboard', { // Specify the other units that are required for this test. // needs: ['controller:foo'] }); test('it exists', function(assert) { const route = this.subject(); assert.ok(route); }); ## Instruction: Add 'service:metrics' to dashboard route test ## Code After: import { moduleFor, test } from 'ember-qunit'; moduleFor('route:dashboard', 'Unit | Route | dashboard', { // Specify the other units that are required for this test. needs: ['service:metrics'], }); test('it exists', function(assert) { const route = this.subject(); assert.ok(route); });
import { moduleFor, test } from 'ember-qunit'; moduleFor('route:dashboard', 'Unit | Route | dashboard', { // Specify the other units that are required for this test. - // needs: ['controller:foo'] + needs: ['service:metrics'], }); test('it exists', function(assert) { const route = this.subject(); assert.ok(route); });
2
0.181818
1
1
ce7e8850f2e124b9205855a2c586d3662afc4251
app/views/effective/orders/_order_header.html.haml
app/views/effective/orders/_order_header.html.haml
%h3 Acme Industries Inc. .row .col-sm-6 %p= mail_to EffectiveOrders.mailer[:admin_email] || 'info@acmeindustries.com' %p 1234 Fake Street %br Edmonton, AB, T5H 4A5 %br %small Customize me by overriding '/app/views/effective/orders/_order_header.html.haml' .col-sm-6 - if order.persisted? %p Order: ##{order.to_param} - if order.purchased? %p Purchased at: #{order.purchased_at.strftime("%Y-%m-%d %H:%M")} - else %p Date: #{Time.zone.now.strftime("%Y-%m-%d %H:%M")}
%h3 Acme Industries Inc. .row .col-sm-6 %p= mail_to EffectiveOrders.mailer[:admin_email] || 'info@acmeindustries.com' %p 1234 Fake Street %br Edmonton, AB, T5H 4A5 %br %small Customize me by overriding '/app/views/effective/orders/_order_header.html.haml' .col-sm-6 - if order.purchased? %p Receipt: ##{order.to_param} - elsif order.persisted? %p Order: ##{order.to_param} - if order.purchased? %p Purchased at: #{order.purchased_at.strftime("%Y-%m-%d %H:%M")} - else %p Date: #{Time.zone.now.strftime("%Y-%m-%d %H:%M")}
Use the title ‘Receipt’ on a purchased Order in default header
Use the title ‘Receipt’ on a purchased Order in default header
Haml
mit
code-and-effect/effective_orders,mrmayfield/effective_orders,mrmayfield/effective_orders,smpetrey/effective_orders,smpetrey/effective_orders,code-and-effect/effective_orders,mrmayfield/effective_orders,code-and-effect/effective_orders,smpetrey/effective_orders,smpetrey/effective_orders
haml
## Code Before: %h3 Acme Industries Inc. .row .col-sm-6 %p= mail_to EffectiveOrders.mailer[:admin_email] || 'info@acmeindustries.com' %p 1234 Fake Street %br Edmonton, AB, T5H 4A5 %br %small Customize me by overriding '/app/views/effective/orders/_order_header.html.haml' .col-sm-6 - if order.persisted? %p Order: ##{order.to_param} - if order.purchased? %p Purchased at: #{order.purchased_at.strftime("%Y-%m-%d %H:%M")} - else %p Date: #{Time.zone.now.strftime("%Y-%m-%d %H:%M")} ## Instruction: Use the title ‘Receipt’ on a purchased Order in default header ## Code After: %h3 Acme Industries Inc. .row .col-sm-6 %p= mail_to EffectiveOrders.mailer[:admin_email] || 'info@acmeindustries.com' %p 1234 Fake Street %br Edmonton, AB, T5H 4A5 %br %small Customize me by overriding '/app/views/effective/orders/_order_header.html.haml' .col-sm-6 - if order.purchased? %p Receipt: ##{order.to_param} - elsif order.persisted? %p Order: ##{order.to_param} - if order.purchased? %p Purchased at: #{order.purchased_at.strftime("%Y-%m-%d %H:%M")} - else %p Date: #{Time.zone.now.strftime("%Y-%m-%d %H:%M")}
%h3 Acme Industries Inc. .row .col-sm-6 %p= mail_to EffectiveOrders.mailer[:admin_email] || 'info@acmeindustries.com' %p 1234 Fake Street %br Edmonton, AB, T5H 4A5 %br %small Customize me by overriding '/app/views/effective/orders/_order_header.html.haml' .col-sm-6 + - if order.purchased? + %p Receipt: ##{order.to_param} - - if order.persisted? + - elsif order.persisted? ? +++ %p Order: ##{order.to_param} - if order.purchased? %p Purchased at: #{order.purchased_at.strftime("%Y-%m-%d %H:%M")} - else %p Date: #{Time.zone.now.strftime("%Y-%m-%d %H:%M")}
4
0.210526
3
1
1b3700c858c4605d81b5e4b89fafed4b70b1b303
protected/config/third_party.php
protected/config/third_party.php
<?php class ThirdParty { public static function init() { spl_autoload_register(array(self, '::autoload'), true, true); } public static function autoload($class) { $class_array = explode('\\', $class); if (count($class_array)>1) { if ($class_array[0] == 'ThirdParty') { $file_load = Config::get('path.third_party').'/'.$class_array[1].'/'.$class_array[2].'.php'; if (file_exists($file_load)) { $namespace = "<?php\nnamespace ThirdParty\\$class_array[1];\n?>\n"; $thirdpartyfile = fopen($file_load, "r"); $thirdpartyclass = fread($thirdpartyfile,filesize($file_load)); fclose($thirdpartyfile); eval("?>$namespace.$thirdpartyclass"); //include_once $file_load; } } } } }
<?php function ThirdPartyAutoload($class) { $class_array = explode('\\', $class); //if (count($class_array)>1) { //if ($class_array[0] == 'ThirdParty') { if (isset($class_array[1])) $file_load = \Kecik\Config::get('path.third_party').'/'.$class_array[0].'/'.$class_array[1].'.php'; else $file_load = \Kecik\Config::get('path.third_party').'/'.$class_array[0].'/'.$class_array[0].'.php'; if (file_exists($file_load)) { include_once $file_load; } else { $file_load = \Kecik\Config::get('path.third_party').'/'.$class_array[0].'.php'; if (file_exists($file_load)) include_once $file_load; } //} //} } spl_autoload_register('ThirdPartyAutoload');
Change Autoload Third Party to Global Class
Change Autoload Third Party to Global Class
PHP
mit
kecik-framework/skeleton,kecik-framework/skeleton,kecik-framework/skeleton
php
## Code Before: <?php class ThirdParty { public static function init() { spl_autoload_register(array(self, '::autoload'), true, true); } public static function autoload($class) { $class_array = explode('\\', $class); if (count($class_array)>1) { if ($class_array[0] == 'ThirdParty') { $file_load = Config::get('path.third_party').'/'.$class_array[1].'/'.$class_array[2].'.php'; if (file_exists($file_load)) { $namespace = "<?php\nnamespace ThirdParty\\$class_array[1];\n?>\n"; $thirdpartyfile = fopen($file_load, "r"); $thirdpartyclass = fread($thirdpartyfile,filesize($file_load)); fclose($thirdpartyfile); eval("?>$namespace.$thirdpartyclass"); //include_once $file_load; } } } } } ## Instruction: Change Autoload Third Party to Global Class ## Code After: <?php function ThirdPartyAutoload($class) { $class_array = explode('\\', $class); //if (count($class_array)>1) { //if ($class_array[0] == 'ThirdParty') { if (isset($class_array[1])) $file_load = \Kecik\Config::get('path.third_party').'/'.$class_array[0].'/'.$class_array[1].'.php'; else $file_load = \Kecik\Config::get('path.third_party').'/'.$class_array[0].'/'.$class_array[0].'.php'; if (file_exists($file_load)) { include_once $file_load; } else { $file_load = \Kecik\Config::get('path.third_party').'/'.$class_array[0].'.php'; if (file_exists($file_load)) include_once $file_load; } //} //} } spl_autoload_register('ThirdPartyAutoload');
<?php - class ThirdParty { + function ThirdPartyAutoload($class) { + $class_array = explode('\\', $class); + + //if (count($class_array)>1) { + //if ($class_array[0] == 'ThirdParty') { - public static function init() { - spl_autoload_register(array(self, '::autoload'), true, true); - } + if (isset($class_array[1])) + $file_load = \Kecik\Config::get('path.third_party').'/'.$class_array[0].'/'.$class_array[1].'.php'; + else + $file_load = \Kecik\Config::get('path.third_party').'/'.$class_array[0].'/'.$class_array[0].'.php'; - public static function autoload($class) { + if (file_exists($file_load)) { + include_once $file_load; + } else { + $file_load = \Kecik\Config::get('path.third_party').'/'.$class_array[0].'.php'; + if (file_exists($file_load)) + include_once $file_load; + } + //} + //} + } + spl_autoload_register('ThirdPartyAutoload'); - $class_array = explode('\\', $class); - if (count($class_array)>1) { - if ($class_array[0] == 'ThirdParty') { - $file_load = Config::get('path.third_party').'/'.$class_array[1].'/'.$class_array[2].'.php'; - if (file_exists($file_load)) { - $namespace = "<?php\nnamespace ThirdParty\\$class_array[1];\n?>\n"; - $thirdpartyfile = fopen($file_load, "r"); - $thirdpartyclass = fread($thirdpartyfile,filesize($file_load)); - fclose($thirdpartyfile); - eval("?>$namespace.$thirdpartyclass"); - - //include_once $file_load; - } - } - } - } - }
42
1.555556
20
22
e57bb4f74b2f89123bb994a54c57cdbce357aca6
t/db.t
t/db.t
use strict; use warnings; use Test::More tests => 7; use SReview::Db; use SReview::Config; use SReview::Config::Common; use DBI; SKIP: { skip("Can't test database work unless the SREVIEW_TESTDB environment variable points to a database which we may clobber and recreate", 7) unless defined($ENV{SREVIEW_TESTDB}); my $warn; local $SIG{__WARN__} = sub { $warn = shift }; my $config = SReview::Config::Common::setup; isa_ok($config, 'SReview::Config'); $config->set(dbistring => 'dbi:Pg:dbname=' . $ENV{SREVIEW_TESTDB}); ok(SReview::Db::init($config), "Initializing the database was successful"); ok(SReview::Db::selfdestruct(0), "Clobbering the database works"); ok(SReview::Db::init($config), "Re-initializing the database after clobbering it was successful"); my $db = DBI->connect($config->get('dbistring'), '', '', {AutoCommit => 1}); ok(defined($db), "connecting to the database was successful"); my $q = $db->prepare("SELECT * FROM raw_files"); ok(defined($q), "preparing a query succeeds"); ok(defined($q->execute), "running a query succeeds, and the tables exist"); }
use strict; use warnings; use Test::More tests => 7; use SReview::Db; use SReview::Config; use SReview::Config::Common; use DBI; SKIP: { skip("Can't test database work unless the SREVIEW_TESTDB environment variable points to a database which we may clobber and recreate", 7) unless defined($ENV{SREVIEW_TESTDB}); my $warn; local $SIG{__WARN__} = sub { $warn = shift }; my $config = SReview::Config::Common::setup; isa_ok($config, 'SReview::Config'); $config->set(dbistring => 'dbi:Pg:dbname=' . $ENV{SREVIEW_TESTDB}); ok(SReview::Db::init($config), "Initializing the database was successful"); ok(SReview::Db::selfdestruct(code => 0, init => 0), "Clobbering the database works"); ok(SReview::Db::init($config), "Re-initializing the database after clobbering it was successful"); my $db = DBI->connect($config->get('dbistring'), '', '', {AutoCommit => 1}); ok(defined($db), "connecting to the database was successful"); my $q = $db->prepare("SELECT * FROM raw_files"); ok(defined($q), "preparing a query succeeds"); ok(defined($q->execute), "running a query succeeds, and the tables exist"); }
Test the new style of clobbering the database.
Test the new style of clobbering the database.
Perl
agpl-3.0
yoe/sreview,yoe/sreview,yoe/sreview,yoe/sreview
perl
## Code Before: use strict; use warnings; use Test::More tests => 7; use SReview::Db; use SReview::Config; use SReview::Config::Common; use DBI; SKIP: { skip("Can't test database work unless the SREVIEW_TESTDB environment variable points to a database which we may clobber and recreate", 7) unless defined($ENV{SREVIEW_TESTDB}); my $warn; local $SIG{__WARN__} = sub { $warn = shift }; my $config = SReview::Config::Common::setup; isa_ok($config, 'SReview::Config'); $config->set(dbistring => 'dbi:Pg:dbname=' . $ENV{SREVIEW_TESTDB}); ok(SReview::Db::init($config), "Initializing the database was successful"); ok(SReview::Db::selfdestruct(0), "Clobbering the database works"); ok(SReview::Db::init($config), "Re-initializing the database after clobbering it was successful"); my $db = DBI->connect($config->get('dbistring'), '', '', {AutoCommit => 1}); ok(defined($db), "connecting to the database was successful"); my $q = $db->prepare("SELECT * FROM raw_files"); ok(defined($q), "preparing a query succeeds"); ok(defined($q->execute), "running a query succeeds, and the tables exist"); } ## Instruction: Test the new style of clobbering the database. ## Code After: use strict; use warnings; use Test::More tests => 7; use SReview::Db; use SReview::Config; use SReview::Config::Common; use DBI; SKIP: { skip("Can't test database work unless the SREVIEW_TESTDB environment variable points to a database which we may clobber and recreate", 7) unless defined($ENV{SREVIEW_TESTDB}); my $warn; local $SIG{__WARN__} = sub { $warn = shift }; my $config = SReview::Config::Common::setup; isa_ok($config, 'SReview::Config'); $config->set(dbistring => 'dbi:Pg:dbname=' . $ENV{SREVIEW_TESTDB}); ok(SReview::Db::init($config), "Initializing the database was successful"); ok(SReview::Db::selfdestruct(code => 0, init => 0), "Clobbering the database works"); ok(SReview::Db::init($config), "Re-initializing the database after clobbering it was successful"); my $db = DBI->connect($config->get('dbistring'), '', '', {AutoCommit => 1}); ok(defined($db), "connecting to the database was successful"); my $q = $db->prepare("SELECT * FROM raw_files"); ok(defined($q), "preparing a query succeeds"); ok(defined($q->execute), "running a query succeeds, and the tables exist"); }
use strict; use warnings; use Test::More tests => 7; use SReview::Db; use SReview::Config; use SReview::Config::Common; use DBI; SKIP: { skip("Can't test database work unless the SREVIEW_TESTDB environment variable points to a database which we may clobber and recreate", 7) unless defined($ENV{SREVIEW_TESTDB}); my $warn; local $SIG{__WARN__} = sub { $warn = shift }; my $config = SReview::Config::Common::setup; isa_ok($config, 'SReview::Config'); $config->set(dbistring => 'dbi:Pg:dbname=' . $ENV{SREVIEW_TESTDB}); ok(SReview::Db::init($config), "Initializing the database was successful"); - ok(SReview::Db::selfdestruct(0), "Clobbering the database works"); + ok(SReview::Db::selfdestruct(code => 0, init => 0), "Clobbering the database works"); ? +++++++++++++++++++ ok(SReview::Db::init($config), "Re-initializing the database after clobbering it was successful"); my $db = DBI->connect($config->get('dbistring'), '', '', {AutoCommit => 1}); ok(defined($db), "connecting to the database was successful"); my $q = $db->prepare("SELECT * FROM raw_files"); ok(defined($q), "preparing a query succeeds"); ok(defined($q->execute), "running a query succeeds, and the tables exist"); }
2
0.060606
1
1
2e8f8d2bcc6d2426c99589cd88d8c6851b578a16
requirements.txt
requirements.txt
django-calaccess-raw-data # Need to install from repo, which includes fixtures necessary for tests -e git+https://github.com/california-civic-data-coalition/django-calaccess-scraped-data.git@HEAD#egg=django-calaccess-scraped-data opencivicdata==2.0.1.dev1 Django>=1.10 hurry.filesize pytz # Databases psycopg2>=2.5.4 # Testing flake8 flake8_docstrings coverage python-coveralls requests_mock # Packaging wheel twine
django-calaccess-raw-data # Need to install from repo, which includes fixtures necessary for tests -e git+https://github.com/california-civic-data-coalition/django-calaccess-scraped-data.git@HEAD#egg=django-calaccess-scraped-data opencivicdata Django>=1.10 hurry.filesize pytz # Databases psycopg2>=2.5.4 # Testing flake8 flake8_docstrings coverage python-coveralls requests_mock # Packaging wheel twine
Switch install ocd back to no-binary
Switch install ocd back to no-binary
Text
mit
california-civic-data-coalition/django-calaccess-processed-data,california-civic-data-coalition/django-calaccess-processed-data
text
## Code Before: django-calaccess-raw-data # Need to install from repo, which includes fixtures necessary for tests -e git+https://github.com/california-civic-data-coalition/django-calaccess-scraped-data.git@HEAD#egg=django-calaccess-scraped-data opencivicdata==2.0.1.dev1 Django>=1.10 hurry.filesize pytz # Databases psycopg2>=2.5.4 # Testing flake8 flake8_docstrings coverage python-coveralls requests_mock # Packaging wheel twine ## Instruction: Switch install ocd back to no-binary ## Code After: django-calaccess-raw-data # Need to install from repo, which includes fixtures necessary for tests -e git+https://github.com/california-civic-data-coalition/django-calaccess-scraped-data.git@HEAD#egg=django-calaccess-scraped-data opencivicdata Django>=1.10 hurry.filesize pytz # Databases psycopg2>=2.5.4 # Testing flake8 flake8_docstrings coverage python-coveralls requests_mock # Packaging wheel twine
django-calaccess-raw-data # Need to install from repo, which includes fixtures necessary for tests -e git+https://github.com/california-civic-data-coalition/django-calaccess-scraped-data.git@HEAD#egg=django-calaccess-scraped-data - opencivicdata==2.0.1.dev1 + opencivicdata Django>=1.10 hurry.filesize pytz # Databases psycopg2>=2.5.4 # Testing flake8 flake8_docstrings coverage python-coveralls requests_mock # Packaging wheel twine
2
0.095238
1
1
8cf8e1b5aa824d691850e0cb431e56744f699a92
bin/task_usage_analyze.py
bin/task_usage_analyze.py
import os, sys sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'lib')) import glob, json import matplotlib.pyplot as pp import support def main(index_path, min_length=0, max_length=100, report_each=1000000): support.figure() print('Loading the index from "{}"...'.format(index_path)) with open(index_path, 'r') as file: index = json.load(file)['index'] total = len(index) print('Processing {} traces...'.format(total)) data = [] processed, selected = 0, 0 for record in index: processed += 1 length = record['length'] if length >= min_length and length <= max_length: selected += 1 data.append(length) if processed % report_each == 0 or processed == total: pp.clf() pp.title("Processed {} ({:.2f}%), selected {} ({:.2f}%)".format( processed, 100 * processed / total, selected, 100 * selected / processed)) pp.hist(data, bins=200) pp.pause(1e-3) pp.show() if __name__ == '__main__': assert(len(sys.argv) == 2) main(sys.argv[1])
import os, sys sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'lib')) import glob, json import matplotlib.pyplot as pp import support def main(index_path, min_length=0, max_length=100, report_each=1000000): support.figure() print('Loading the index from "{}"...'.format(index_path)) with open(index_path, 'r') as file: index = json.load(file)['index'] total = len(index) print('Processing {} traces...'.format(total)) data = [] processed, selected = 0, 0 for record in index: processed += 1 length = record['length'] if length >= min_length and length <= max_length: selected += 1 data.append(length) if processed % report_each == 0 or processed == total: pp.clf() pp.title("Processed {} ({:.2f}%), selected {} ({:.2f}%)".format( processed, 100 * processed / total, selected, 100 * selected / processed)) pp.hist(data, bins=(max_length - min_length)) pp.pause(1e-3) pp.show() if __name__ == '__main__': assert(len(sys.argv) == 2) main(sys.argv[1])
Adjust the number of bins
Adjust the number of bins
Python
mit
learning-on-chip/google-cluster-prediction
python
## Code Before: import os, sys sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'lib')) import glob, json import matplotlib.pyplot as pp import support def main(index_path, min_length=0, max_length=100, report_each=1000000): support.figure() print('Loading the index from "{}"...'.format(index_path)) with open(index_path, 'r') as file: index = json.load(file)['index'] total = len(index) print('Processing {} traces...'.format(total)) data = [] processed, selected = 0, 0 for record in index: processed += 1 length = record['length'] if length >= min_length and length <= max_length: selected += 1 data.append(length) if processed % report_each == 0 or processed == total: pp.clf() pp.title("Processed {} ({:.2f}%), selected {} ({:.2f}%)".format( processed, 100 * processed / total, selected, 100 * selected / processed)) pp.hist(data, bins=200) pp.pause(1e-3) pp.show() if __name__ == '__main__': assert(len(sys.argv) == 2) main(sys.argv[1]) ## Instruction: Adjust the number of bins ## Code After: import os, sys sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'lib')) import glob, json import matplotlib.pyplot as pp import support def main(index_path, min_length=0, max_length=100, report_each=1000000): support.figure() print('Loading the index from "{}"...'.format(index_path)) with open(index_path, 'r') as file: index = json.load(file)['index'] total = len(index) print('Processing {} traces...'.format(total)) data = [] processed, selected = 0, 0 for record in index: processed += 1 length = record['length'] if length >= min_length and length <= max_length: selected += 1 data.append(length) if processed % report_each == 0 or processed == total: pp.clf() pp.title("Processed {} ({:.2f}%), selected {} ({:.2f}%)".format( processed, 100 * processed / total, selected, 100 * selected / processed)) pp.hist(data, bins=(max_length - min_length)) pp.pause(1e-3) pp.show() if __name__ == '__main__': assert(len(sys.argv) == 2) main(sys.argv[1])
import os, sys sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'lib')) import glob, json import matplotlib.pyplot as pp import support def main(index_path, min_length=0, max_length=100, report_each=1000000): support.figure() print('Loading the index from "{}"...'.format(index_path)) with open(index_path, 'r') as file: index = json.load(file)['index'] total = len(index) print('Processing {} traces...'.format(total)) data = [] processed, selected = 0, 0 for record in index: processed += 1 length = record['length'] if length >= min_length and length <= max_length: selected += 1 data.append(length) if processed % report_each == 0 or processed == total: pp.clf() pp.title("Processed {} ({:.2f}%), selected {} ({:.2f}%)".format( processed, 100 * processed / total, selected, 100 * selected / processed)) - pp.hist(data, bins=200) + pp.hist(data, bins=(max_length - min_length)) pp.pause(1e-3) pp.show() if __name__ == '__main__': assert(len(sys.argv) == 2) main(sys.argv[1])
2
0.055556
1
1
cb1f88ae032e8f8010d1fe997ff2e0366b27f2af
lib/srpc/load.go
lib/srpc/load.go
package srpc import ( "crypto/tls" "fmt" "os" "path" "strings" ) func loadCertificates(directory string) ([]tls.Certificate, error) { dir, err := os.Open(directory) if err != nil { return nil, err } names, err := dir.Readdirnames(0) defer dir.Close() if err != nil { return nil, err } certs := make([]tls.Certificate, 0, len(names)/2) for _, name := range names { if !strings.HasSuffix(name, ".key") { continue } cert, err := tls.LoadX509KeyPair( path.Join(directory, name[:len(name)-3]+"cert"), path.Join(directory, name)) if err != nil { return nil, fmt.Errorf("unable to load keypair: %s", err) } certs = append(certs, cert) } return certs, nil }
package srpc import ( "crypto/tls" "fmt" "os" "path" "strings" ) func loadCertificates(directory string) ([]tls.Certificate, error) { dir, err := os.Open(directory) if err != nil { return nil, err } names, err := dir.Readdirnames(0) defer dir.Close() if err != nil { return nil, err } certs := make([]tls.Certificate, 0, len(names)/2) for _, name := range names { if !strings.HasSuffix(name, ".key") { continue } cert, err := tls.LoadX509KeyPair( path.Join(directory, name[:len(name)-3]+"cert"), path.Join(directory, name)) if err != nil { return nil, fmt.Errorf("unable to load keypair: %s", err) } certs = append(certs, cert) } if len(certs) < 1 { return nil, nil } return certs, nil }
Return nil for empty cert slice in lib/srpc.LoadCertificates().
Return nil for empty cert slice in lib/srpc.LoadCertificates().
Go
apache-2.0
rgooch/Dominator,Symantec/Dominator,rgooch/Dominator,Symantec/Dominator,Symantec/Dominator,keep94/Dominator,keep94/Dominator,rgooch/Dominator,keep94/Dominator
go
## Code Before: package srpc import ( "crypto/tls" "fmt" "os" "path" "strings" ) func loadCertificates(directory string) ([]tls.Certificate, error) { dir, err := os.Open(directory) if err != nil { return nil, err } names, err := dir.Readdirnames(0) defer dir.Close() if err != nil { return nil, err } certs := make([]tls.Certificate, 0, len(names)/2) for _, name := range names { if !strings.HasSuffix(name, ".key") { continue } cert, err := tls.LoadX509KeyPair( path.Join(directory, name[:len(name)-3]+"cert"), path.Join(directory, name)) if err != nil { return nil, fmt.Errorf("unable to load keypair: %s", err) } certs = append(certs, cert) } return certs, nil } ## Instruction: Return nil for empty cert slice in lib/srpc.LoadCertificates(). ## Code After: package srpc import ( "crypto/tls" "fmt" "os" "path" "strings" ) func loadCertificates(directory string) ([]tls.Certificate, error) { dir, err := os.Open(directory) if err != nil { return nil, err } names, err := dir.Readdirnames(0) defer dir.Close() if err != nil { return nil, err } certs := make([]tls.Certificate, 0, len(names)/2) for _, name := range names { if !strings.HasSuffix(name, ".key") { continue } cert, err := tls.LoadX509KeyPair( path.Join(directory, name[:len(name)-3]+"cert"), path.Join(directory, name)) if err != nil { return nil, fmt.Errorf("unable to load keypair: %s", err) } certs = append(certs, cert) } if len(certs) < 1 { return nil, nil } return certs, nil }
package srpc import ( "crypto/tls" "fmt" "os" "path" "strings" ) func loadCertificates(directory string) ([]tls.Certificate, error) { dir, err := os.Open(directory) if err != nil { return nil, err } names, err := dir.Readdirnames(0) defer dir.Close() if err != nil { return nil, err } certs := make([]tls.Certificate, 0, len(names)/2) for _, name := range names { if !strings.HasSuffix(name, ".key") { continue } cert, err := tls.LoadX509KeyPair( path.Join(directory, name[:len(name)-3]+"cert"), path.Join(directory, name)) if err != nil { return nil, fmt.Errorf("unable to load keypair: %s", err) } certs = append(certs, cert) } + if len(certs) < 1 { + return nil, nil + } return certs, nil }
3
0.085714
3
0
1c8cd7ac910492353de1f57852d6633f76fdafdd
sources/src/test/kotlin/net/devromik/bw/MaxWhiteTest.kt
sources/src/test/kotlin/net/devromik/bw/MaxWhiteTest.kt
package net.devromik.bw import org.junit.Assert.* import org.junit.Test /** * @author Shulnyaev Roman */ class MaxWhiteTest { val TREE_SIZE = 10 // ****************************** // @Test fun numberOfBlackNodes_ShouldBe_From_0_To_SizeOfTree() { val maxWhite = MaxWhite(treeSize = TREE_SIZE) assertEquals(TREE_SIZE, maxWhite.treeSize) assertEquals(INVALID_MAX_WHITE, maxWhite.forBlack(-1)) assertEquals(INVALID_MAX_WHITE, maxWhite.forBlack(Int.MIN_VALUE)) (0..TREE_SIZE).forEach { maxWhite.put(black = it, maxWhite = it) assertEquals(it, maxWhite.forBlack(it)) } assertEquals(INVALID_MAX_WHITE, maxWhite.forBlack(TREE_SIZE + 1)) assertEquals(INVALID_MAX_WHITE, maxWhite.forBlack(Int.MAX_VALUE)) } @Test(expected = IllegalStateException::class) fun queryShouldBePrecededByFilling() { val maxWhite = MaxWhite(treeSize = TREE_SIZE) maxWhite.forBlack(0) } @Test(expected = IllegalArgumentException::class) fun maxNumberOfWhiteNodes_ShouldBe_NonNegative() { val maxWhite = MaxWhite(treeSize = TREE_SIZE) maxWhite.put(0, -1) } @Test fun INVALID_MAX_WHITE_ShouldBe_Negative() { assertTrue(INVALID_MAX_WHITE < 0) } }
package net.devromik.bw import org.junit.Assert.* import org.junit.Test /** * @author Shulnyaev Roman */ class MaxWhiteTest { val TREE_SIZE = 10 // ****************************** // @Test fun numberOfBlackNodes_ShouldBe_From_0_To_SizeOfTree() { val maxWhite = MaxWhite(treeSize = TREE_SIZE) assertEquals(TREE_SIZE, maxWhite.treeSize) assertEquals(INVALID_MAX_WHITE, maxWhite.forBlack(-1)) assertEquals(INVALID_MAX_WHITE, maxWhite.forBlack(Int.MIN_VALUE)) (0..TREE_SIZE).forEach { maxWhite[it] = it assertEquals(it, maxWhite.forBlack(it)) } assertEquals(INVALID_MAX_WHITE, maxWhite.forBlack(TREE_SIZE + 1)) assertEquals(INVALID_MAX_WHITE, maxWhite.forBlack(Int.MAX_VALUE)) } @Test(expected = IllegalStateException::class) fun queryShouldBePrecededByFilling() { val maxWhite = MaxWhite(treeSize = TREE_SIZE) maxWhite.forBlack(0) } @Test(expected = IllegalArgumentException::class) fun maxNumberOfWhiteNodes_ShouldBe_NonNegative_Or_INVALID_MAX_WHITE() { val maxWhite = MaxWhite(treeSize = TREE_SIZE) maxWhite[0] = NOT_INIT_MAX_WHITE } @Test fun INVALID_MAX_WHITE_ShouldBe_Negative() { assertTrue(INVALID_MAX_WHITE < 0) } }
Fix the test for MaxWhite
Fix the test for MaxWhite
Kotlin
mit
devromik/black-and-white
kotlin
## Code Before: package net.devromik.bw import org.junit.Assert.* import org.junit.Test /** * @author Shulnyaev Roman */ class MaxWhiteTest { val TREE_SIZE = 10 // ****************************** // @Test fun numberOfBlackNodes_ShouldBe_From_0_To_SizeOfTree() { val maxWhite = MaxWhite(treeSize = TREE_SIZE) assertEquals(TREE_SIZE, maxWhite.treeSize) assertEquals(INVALID_MAX_WHITE, maxWhite.forBlack(-1)) assertEquals(INVALID_MAX_WHITE, maxWhite.forBlack(Int.MIN_VALUE)) (0..TREE_SIZE).forEach { maxWhite.put(black = it, maxWhite = it) assertEquals(it, maxWhite.forBlack(it)) } assertEquals(INVALID_MAX_WHITE, maxWhite.forBlack(TREE_SIZE + 1)) assertEquals(INVALID_MAX_WHITE, maxWhite.forBlack(Int.MAX_VALUE)) } @Test(expected = IllegalStateException::class) fun queryShouldBePrecededByFilling() { val maxWhite = MaxWhite(treeSize = TREE_SIZE) maxWhite.forBlack(0) } @Test(expected = IllegalArgumentException::class) fun maxNumberOfWhiteNodes_ShouldBe_NonNegative() { val maxWhite = MaxWhite(treeSize = TREE_SIZE) maxWhite.put(0, -1) } @Test fun INVALID_MAX_WHITE_ShouldBe_Negative() { assertTrue(INVALID_MAX_WHITE < 0) } } ## Instruction: Fix the test for MaxWhite ## Code After: package net.devromik.bw import org.junit.Assert.* import org.junit.Test /** * @author Shulnyaev Roman */ class MaxWhiteTest { val TREE_SIZE = 10 // ****************************** // @Test fun numberOfBlackNodes_ShouldBe_From_0_To_SizeOfTree() { val maxWhite = MaxWhite(treeSize = TREE_SIZE) assertEquals(TREE_SIZE, maxWhite.treeSize) assertEquals(INVALID_MAX_WHITE, maxWhite.forBlack(-1)) assertEquals(INVALID_MAX_WHITE, maxWhite.forBlack(Int.MIN_VALUE)) (0..TREE_SIZE).forEach { maxWhite[it] = it assertEquals(it, maxWhite.forBlack(it)) } assertEquals(INVALID_MAX_WHITE, maxWhite.forBlack(TREE_SIZE + 1)) assertEquals(INVALID_MAX_WHITE, maxWhite.forBlack(Int.MAX_VALUE)) } @Test(expected = IllegalStateException::class) fun queryShouldBePrecededByFilling() { val maxWhite = MaxWhite(treeSize = TREE_SIZE) maxWhite.forBlack(0) } @Test(expected = IllegalArgumentException::class) fun maxNumberOfWhiteNodes_ShouldBe_NonNegative_Or_INVALID_MAX_WHITE() { val maxWhite = MaxWhite(treeSize = TREE_SIZE) maxWhite[0] = NOT_INIT_MAX_WHITE } @Test fun INVALID_MAX_WHITE_ShouldBe_Negative() { assertTrue(INVALID_MAX_WHITE < 0) } }
package net.devromik.bw import org.junit.Assert.* import org.junit.Test /** * @author Shulnyaev Roman */ class MaxWhiteTest { val TREE_SIZE = 10 // ****************************** // @Test fun numberOfBlackNodes_ShouldBe_From_0_To_SizeOfTree() { val maxWhite = MaxWhite(treeSize = TREE_SIZE) assertEquals(TREE_SIZE, maxWhite.treeSize) assertEquals(INVALID_MAX_WHITE, maxWhite.forBlack(-1)) assertEquals(INVALID_MAX_WHITE, maxWhite.forBlack(Int.MIN_VALUE)) (0..TREE_SIZE).forEach { - maxWhite.put(black = it, maxWhite = it) + maxWhite[it] = it assertEquals(it, maxWhite.forBlack(it)) } assertEquals(INVALID_MAX_WHITE, maxWhite.forBlack(TREE_SIZE + 1)) assertEquals(INVALID_MAX_WHITE, maxWhite.forBlack(Int.MAX_VALUE)) } @Test(expected = IllegalStateException::class) fun queryShouldBePrecededByFilling() { val maxWhite = MaxWhite(treeSize = TREE_SIZE) maxWhite.forBlack(0) } @Test(expected = IllegalArgumentException::class) - fun maxNumberOfWhiteNodes_ShouldBe_NonNegative() { + fun maxNumberOfWhiteNodes_ShouldBe_NonNegative_Or_INVALID_MAX_WHITE() { ? +++++++++++++++++++++ val maxWhite = MaxWhite(treeSize = TREE_SIZE) - maxWhite.put(0, -1) + maxWhite[0] = NOT_INIT_MAX_WHITE } @Test fun INVALID_MAX_WHITE_ShouldBe_Negative() { assertTrue(INVALID_MAX_WHITE < 0) } }
6
0.130435
3
3
fe7059841567191c87c61e0e51f11d634db5d138
src/app/middleware/malformedPushEventError.js
src/app/middleware/malformedPushEventError.js
(function() { var csError = require('./csError'); var MalformedPushEventError = csError.createCustomError('MalformedPushEventError', function() { var message = 'There are no translators that understand the payload you are sending.'; var errors = [message]; MalformedPushEventError.prototype.constructor.call(this, errors, 400); }); module.exports = MalformedPushEventError; })()
(function() { var csError = require('./csError'); var MalformedPushEventError = csError.createCustomError('MalformedPushEventError', function() { var message = 'Push event could not be processed.'; var errors = [message]; MalformedPushEventError.prototype.constructor.call(this, errors, 400); }); module.exports = MalformedPushEventError; })()
Change the error message to not be so implementy in lingo
S-53159: Change the error message to not be so implementy in lingo
JavaScript
bsd-3-clause
openAgile/CommitStream.Web,JogoShugh/CommitStream.Web,openAgile/CommitStream.Web,JogoShugh/CommitStream.Web,JogoShugh/CommitStream.Web,openAgile/CommitStream.Web,openAgile/CommitStream.Web,JogoShugh/CommitStream.Web
javascript
## Code Before: (function() { var csError = require('./csError'); var MalformedPushEventError = csError.createCustomError('MalformedPushEventError', function() { var message = 'There are no translators that understand the payload you are sending.'; var errors = [message]; MalformedPushEventError.prototype.constructor.call(this, errors, 400); }); module.exports = MalformedPushEventError; })() ## Instruction: S-53159: Change the error message to not be so implementy in lingo ## Code After: (function() { var csError = require('./csError'); var MalformedPushEventError = csError.createCustomError('MalformedPushEventError', function() { var message = 'Push event could not be processed.'; var errors = [message]; MalformedPushEventError.prototype.constructor.call(this, errors, 400); }); module.exports = MalformedPushEventError; })()
(function() { var csError = require('./csError'); var MalformedPushEventError = csError.createCustomError('MalformedPushEventError', function() { - var message = 'There are no translators that understand the payload you are sending.'; + var message = 'Push event could not be processed.'; var errors = [message]; MalformedPushEventError.prototype.constructor.call(this, errors, 400); }); module.exports = MalformedPushEventError; })()
2
0.181818
1
1
cc6a50fa7307cb547816e0523b34ee62c89a1725
README.md
README.md
Allows you to leverage the update/delete operations of your [Haystack](http://haystacksearch.org/) search index to backgrounds tasks using [RQ](http://python-rq.org), a lightweight [Redis](http://redis.io) background queue. For use with [Haystack](http://haystacksearch.org) version 2.0+. ## Requirements * Django 1.3+ * [Haystack 2.0.X](http://github.com/toastdriven/django-haystack) * [RQ](http://python-rq.org) * [django-rq](http://github.com/ui/django-rq) You also need to install your choice of one of the supported search engines for Haystack and have properly configured Redis and `django-rq`. ## Setup 1. Just make shure the `haystack_rqueue` directory is available in your `PYTHON_PATH`. The prefered way is to run `pip install http://github.com/mandx/haystack-rqueue/tarball/master` 1. Include this line in your settings module `HAYSTACK_SIGNAL_PROCESSOR = 'haystack_rqueue.signals.RQueueSignalProcessor'`). 1. Configure `django-rq` (see the README) and ensure your Redis instance is running and it's accessible. 1. Start the RQ workers (via `$ ./manage.py rqworker`). 1. Profit!
Allows you to leverage the update/delete operations of your [Haystack](http://haystacksearch.org/) search index to backgrounds tasks using [RQ](http://python-rq.org), a lightweight [Redis](http://redis.io) background queue. For use with [Haystack](http://haystacksearch.org) version 2.0+. ## Requirements * Django 1.3+ * [Haystack 2.0.X](http://github.com/toastdriven/django-haystack) * [RQ](http://python-rq.org) * [django-rq](http://github.com/ui/django-rq) You also need to install your choice of one of the supported search engines for Haystack and have properly configured Redis and `django-rq`. ## Setup 1. Just make shure the `haystack_rqueue` directory is available in your `PYTHON_PATH`. The prefered way is to run `pip install http://github.com/mandx/haystack-rqueue/tarball/master` 1. Include this line in your settings module `HAYSTACK_SIGNAL_PROCESSOR = 'haystack_rqueue.signals.RQueueSignalProcessor'`). 1. If you are running Django 1.8+, add `'haystack_rqueue'` to your `INSTALLED_APPS` setting. 1. Configure `django-rq` (see the README) and ensure your Redis instance is running and it's accessible. 1. Start the RQ workers (via `$ ./manage.py rqworker`). 1. Profit!
Document additional steps for Django 1.8+
Document additional steps for Django 1.8+ Closes #3
Markdown
bsd-3-clause
mandx/haystack-rqueue
markdown
## Code Before: Allows you to leverage the update/delete operations of your [Haystack](http://haystacksearch.org/) search index to backgrounds tasks using [RQ](http://python-rq.org), a lightweight [Redis](http://redis.io) background queue. For use with [Haystack](http://haystacksearch.org) version 2.0+. ## Requirements * Django 1.3+ * [Haystack 2.0.X](http://github.com/toastdriven/django-haystack) * [RQ](http://python-rq.org) * [django-rq](http://github.com/ui/django-rq) You also need to install your choice of one of the supported search engines for Haystack and have properly configured Redis and `django-rq`. ## Setup 1. Just make shure the `haystack_rqueue` directory is available in your `PYTHON_PATH`. The prefered way is to run `pip install http://github.com/mandx/haystack-rqueue/tarball/master` 1. Include this line in your settings module `HAYSTACK_SIGNAL_PROCESSOR = 'haystack_rqueue.signals.RQueueSignalProcessor'`). 1. Configure `django-rq` (see the README) and ensure your Redis instance is running and it's accessible. 1. Start the RQ workers (via `$ ./manage.py rqworker`). 1. Profit! ## Instruction: Document additional steps for Django 1.8+ Closes #3 ## Code After: Allows you to leverage the update/delete operations of your [Haystack](http://haystacksearch.org/) search index to backgrounds tasks using [RQ](http://python-rq.org), a lightweight [Redis](http://redis.io) background queue. For use with [Haystack](http://haystacksearch.org) version 2.0+. ## Requirements * Django 1.3+ * [Haystack 2.0.X](http://github.com/toastdriven/django-haystack) * [RQ](http://python-rq.org) * [django-rq](http://github.com/ui/django-rq) You also need to install your choice of one of the supported search engines for Haystack and have properly configured Redis and `django-rq`. ## Setup 1. Just make shure the `haystack_rqueue` directory is available in your `PYTHON_PATH`. The prefered way is to run `pip install http://github.com/mandx/haystack-rqueue/tarball/master` 1. Include this line in your settings module `HAYSTACK_SIGNAL_PROCESSOR = 'haystack_rqueue.signals.RQueueSignalProcessor'`). 1. If you are running Django 1.8+, add `'haystack_rqueue'` to your `INSTALLED_APPS` setting. 1. Configure `django-rq` (see the README) and ensure your Redis instance is running and it's accessible. 1. Start the RQ workers (via `$ ./manage.py rqworker`). 1. Profit!
Allows you to leverage the update/delete operations of your [Haystack](http://haystacksearch.org/) search index to backgrounds tasks using [RQ](http://python-rq.org), a lightweight [Redis](http://redis.io) background queue. For use with [Haystack](http://haystacksearch.org) version 2.0+. ## Requirements * Django 1.3+ * [Haystack 2.0.X](http://github.com/toastdriven/django-haystack) * [RQ](http://python-rq.org) * [django-rq](http://github.com/ui/django-rq) You also need to install your choice of one of the supported search engines for Haystack and have properly configured Redis and `django-rq`. ## Setup 1. Just make shure the `haystack_rqueue` directory is available in your `PYTHON_PATH`. The prefered way is to run `pip install http://github.com/mandx/haystack-rqueue/tarball/master` 1. Include this line in your settings module `HAYSTACK_SIGNAL_PROCESSOR = 'haystack_rqueue.signals.RQueueSignalProcessor'`). + 1. If you are running Django 1.8+, add `'haystack_rqueue'` to your `INSTALLED_APPS` setting. 1. Configure `django-rq` (see the README) and ensure your Redis instance is running and it's accessible. 1. Start the RQ workers (via `$ ./manage.py rqworker`). 1. Profit!
1
0.041667
1
0
54b8e560e8dd776c29d5ddb249b8878534873ee7
website/site/templates/skin.html
website/site/templates/skin.html
<!DOCTYPE html> <html> <head> <title>Objenesis : \${title}</title> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="style.css"/> \${head} </head> <body> <div id="banner"> <a href="index.html"><img id="logo" src="objenesis.png" alt="Objenesis" width="300" height="75"/></a> </div> <div id="center" class="Content2Column"> <div id="content"> <h1 class="FirstChild">\${title}</h1> \${body} <br/><br/> </div> </div> <div class="SidePanel" id="left"> <#list sitemap.sections as section> <div class="MenuGroup"> <h1>\${section.name}</h1> <ul> <#list section.pages as otherPage> <#if otherPage = page> <li class="currentLink">\${otherPage.title}</li> <#else> <li><a href="${otherPage.href}">\${otherPage.title}</a></li> </#if> </#list> </ul> </div> </#list> </div> </body> </html>
<!DOCTYPE html> <html> <head> <title>Objenesis : \${title}</title> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="style.css"/> \${head} </head> <body> <div id="banner"> <a href="index.html"><img id="logo" src="objenesis.png" alt="Objenesis" width="300" height="75"/></a> <a href="https://github.com/easymock/objenesis"><img style="position: absolute; top: 0; right: 0; border: 0; z-index: 10" src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub"></a> </div> <div id="center" class="Content2Column"> <div id="content"> <h1 class="FirstChild">\${title}</h1> \${body} <br/><br/> </div> </div> <div class="SidePanel" id="left"> <#list sitemap.sections as section> <div class="MenuGroup"> <h1>\${section.name}</h1> <ul> <#list section.pages as otherPage> <#if otherPage = page> <li class="currentLink">\${otherPage.title}</li> <#else> <li><a href="${otherPage.href}">\${otherPage.title}</a></li> </#if> </#list> </ul> </div> </#list> </div> </body> </html>
Add "Fork me on GitHub"
Add "Fork me on GitHub"
HTML
apache-2.0
easymock/objenesis,irudyak/objenesis,easymock/objenesis,easymock/objenesis,irudyak/objenesis,irudyak/objenesis
html
## Code Before: <!DOCTYPE html> <html> <head> <title>Objenesis : \${title}</title> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="style.css"/> \${head} </head> <body> <div id="banner"> <a href="index.html"><img id="logo" src="objenesis.png" alt="Objenesis" width="300" height="75"/></a> </div> <div id="center" class="Content2Column"> <div id="content"> <h1 class="FirstChild">\${title}</h1> \${body} <br/><br/> </div> </div> <div class="SidePanel" id="left"> <#list sitemap.sections as section> <div class="MenuGroup"> <h1>\${section.name}</h1> <ul> <#list section.pages as otherPage> <#if otherPage = page> <li class="currentLink">\${otherPage.title}</li> <#else> <li><a href="${otherPage.href}">\${otherPage.title}</a></li> </#if> </#list> </ul> </div> </#list> </div> </body> </html> ## Instruction: Add "Fork me on GitHub" ## Code After: <!DOCTYPE html> <html> <head> <title>Objenesis : \${title}</title> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="style.css"/> \${head} </head> <body> <div id="banner"> <a href="index.html"><img id="logo" src="objenesis.png" alt="Objenesis" width="300" height="75"/></a> <a href="https://github.com/easymock/objenesis"><img style="position: absolute; top: 0; right: 0; border: 0; z-index: 10" src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub"></a> </div> <div id="center" class="Content2Column"> <div id="content"> <h1 class="FirstChild">\${title}</h1> \${body} <br/><br/> </div> </div> <div class="SidePanel" id="left"> <#list sitemap.sections as section> <div class="MenuGroup"> <h1>\${section.name}</h1> <ul> <#list section.pages as otherPage> <#if otherPage = page> <li class="currentLink">\${otherPage.title}</li> <#else> <li><a href="${otherPage.href}">\${otherPage.title}</a></li> </#if> </#list> </ul> </div> </#list> </div> </body> </html>
<!DOCTYPE html> <html> <head> <title>Objenesis : \${title}</title> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="style.css"/> \${head} </head> <body> - <div id="banner"> <a href="index.html"><img id="logo" src="objenesis.png" alt="Objenesis" width="300" height="75"/></a> + <a href="https://github.com/easymock/objenesis"><img style="position: absolute; top: 0; right: 0; border: 0; z-index: 10" src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub"></a> </div> <div id="center" class="Content2Column"> <div id="content"> <h1 class="FirstChild">\${title}</h1> \${body} <br/><br/> </div> </div> <div class="SidePanel" id="left"> <#list sitemap.sections as section> <div class="MenuGroup"> <h1>\${section.name}</h1> <ul> <#list section.pages as otherPage> <#if otherPage = page> <li class="currentLink">\${otherPage.title}</li> <#else> <li><a href="${otherPage.href}">\${otherPage.title}</a></li> </#if> </#list> </ul> </div> </#list> </div> </body> </html>
2
0.04878
1
1
ab90a56bebdd24e5c2f4fbb9864d29cce90218bf
spec/integration/auth_spec.rb
spec/integration/auth_spec.rb
require 'spec_helper' describe 'registration with invites', :type => :feature do before { @onceoff = Invite.create(:description => 'Test') } it 'should let me register an account with an invite' do pass = 'password' visit '/register' fill_in 'Email', :with => 'hello@world.com' fill_in 'Password', :with => pass fill_in 'Password confirmation', :with => pass click_button 'Register' expect(page).to have_content 'You have signed up successfully' end it 'should let me login' do mail = 'registered@user.com' pass = 'cosmoflips' visit '/login' User.create(:password => pass, :email => mail) fill_in 'Email', :with => mail fill_in 'Password', :with => pass click_button 'Sign in' expect(page).to have_content 'Signed in successfully.' end it 'should show registration page at /register' do visit '/register' end it 'should show login page at /login' do visit '/login' end it 'should refuse registration with a bad key' do end it 'should refuse registration with no key' do end it 'should not let me use a onceoff key more than once' do end it 'should let me make multiple accounts with a multi-use invite' do end end
require 'spec_helper' describe 'registration with invites', :type => :feature do before { @onceoff = Invite.create(:description => 'Test') } it 'should let me register an account with an invite' do pass = 'password' visit '/register' fill_in 'Email', :with => 'hello@world.com' fill_in 'Password', :with => pass fill_in 'Password confirmation', :with => pass click_button 'Register' expect(page).to have_content 'You have signed up successfully' end it 'should let me login' do mail = 'registered@user.com' pass = 'cosmoflips' visit '/login' User.create(:password => pass, :email => mail) fill_in 'Email', :with => mail fill_in 'Password', :with => pass click_button 'Sign in' expect(page).to have_content 'Signed in successfully.' end it 'should show registration page at /register' do visit '/register' expect(page).to have_content 'Register new account' end it 'should show login page at /login' do visit '/login' expect(page).to have_content 'Log in' end it 'should refuse registration with a bad key' do end it 'should refuse registration with no key' do end it 'should not let me use a onceoff key more than once' do end it 'should let me make multiple accounts with a multi-use invite' do end end
Make sure login and register pages have certain words
Make sure login and register pages have certain words
Ruby
mit
Margatroid/uploadstuffto.me,Margatroid/uploadstuffto.me
ruby
## Code Before: require 'spec_helper' describe 'registration with invites', :type => :feature do before { @onceoff = Invite.create(:description => 'Test') } it 'should let me register an account with an invite' do pass = 'password' visit '/register' fill_in 'Email', :with => 'hello@world.com' fill_in 'Password', :with => pass fill_in 'Password confirmation', :with => pass click_button 'Register' expect(page).to have_content 'You have signed up successfully' end it 'should let me login' do mail = 'registered@user.com' pass = 'cosmoflips' visit '/login' User.create(:password => pass, :email => mail) fill_in 'Email', :with => mail fill_in 'Password', :with => pass click_button 'Sign in' expect(page).to have_content 'Signed in successfully.' end it 'should show registration page at /register' do visit '/register' end it 'should show login page at /login' do visit '/login' end it 'should refuse registration with a bad key' do end it 'should refuse registration with no key' do end it 'should not let me use a onceoff key more than once' do end it 'should let me make multiple accounts with a multi-use invite' do end end ## Instruction: Make sure login and register pages have certain words ## Code After: require 'spec_helper' describe 'registration with invites', :type => :feature do before { @onceoff = Invite.create(:description => 'Test') } it 'should let me register an account with an invite' do pass = 'password' visit '/register' fill_in 'Email', :with => 'hello@world.com' fill_in 'Password', :with => pass fill_in 'Password confirmation', :with => pass click_button 'Register' expect(page).to have_content 'You have signed up successfully' end it 'should let me login' do mail = 'registered@user.com' pass = 'cosmoflips' visit '/login' User.create(:password => pass, :email => mail) fill_in 'Email', :with => mail fill_in 'Password', :with => pass click_button 'Sign in' expect(page).to have_content 'Signed in successfully.' end it 'should show registration page at /register' do visit '/register' expect(page).to have_content 'Register new account' end it 'should show login page at /login' do visit '/login' expect(page).to have_content 'Log in' end it 'should refuse registration with a bad key' do end it 'should refuse registration with no key' do end it 'should not let me use a onceoff key more than once' do end it 'should let me make multiple accounts with a multi-use invite' do end end
require 'spec_helper' describe 'registration with invites', :type => :feature do before { @onceoff = Invite.create(:description => 'Test') } it 'should let me register an account with an invite' do pass = 'password' visit '/register' fill_in 'Email', :with => 'hello@world.com' fill_in 'Password', :with => pass fill_in 'Password confirmation', :with => pass click_button 'Register' expect(page).to have_content 'You have signed up successfully' end it 'should let me login' do mail = 'registered@user.com' pass = 'cosmoflips' visit '/login' User.create(:password => pass, :email => mail) fill_in 'Email', :with => mail fill_in 'Password', :with => pass click_button 'Sign in' expect(page).to have_content 'Signed in successfully.' end it 'should show registration page at /register' do visit '/register' + expect(page).to have_content 'Register new account' end it 'should show login page at /login' do visit '/login' + expect(page).to have_content 'Log in' end it 'should refuse registration with a bad key' do end it 'should refuse registration with no key' do end it 'should not let me use a onceoff key more than once' do end it 'should let me make multiple accounts with a multi-use invite' do end end
2
0.039216
2
0
1f7039e933ba3a38de15db18a59a9dc4e05c55f6
ads/ads_wms.js
ads/ads_wms.js
// Extent of the map in units of the projection var extent = [-3276800, -3276800, 3276800, 3276800]; // Fixed resolutions to display the map at var resolutions = [1600, 800, 400, 200, 100, 50, 25, 10, 5, 2.5, 1, 0.5]; // Basic ol3 Projection definition, include the extent here and specify the // resolutions as a property of the View2D or TileWMS if you are using a tiled // WMS to ensure tiles are requested at the correct boundaries var projection = new ol.proj.Projection({ code: 'EPSG:27700', units: 'm', extent: extent }); var map = new ol.Map({ target: 'map', layers: [ new ol.layer.Tile({ source: new ol.source.TileWMS({ url: 'http://t0.ads.astuntechnology.com/astuntechnology/osopen/service?', attributions: [ new ol.Attribution({html: 'OS OpenData, &copy; Ordnance Survey'}) ], params: { 'LAYERS': 'osopen', 'FORMAT': 'image/png', 'TILED': true } }) }) ], view: new ol.View2D({ projection: projection, resolutions: resolutions, center: [315000, 468000], zoom: 0 }) });
// Extent of the map in units of the projection var extent = [-3276800, -3276800, 3276800, 3276800]; // Fixed resolutions to display the map at var resolutions = [1600, 800, 400, 200, 100, 50, 25]; // Basic ol3 Projection definition, include the extent here and specify the // resolutions as a property of the View2D or TileWMS if you are using a tiled // WMS to ensure tiles are requested at the correct boundaries var projection = new ol.proj.Projection({ code: 'EPSG:27700', units: 'm', extent: extent }); var map = new ol.Map({ target: 'map', layers: [ new ol.layer.Tile({ source: new ol.source.TileWMS({ url: 'http://t0.ads.astuntechnology.com/astuntechnology/osopen/service?', attributions: [ new ol.Attribution({html: 'OS OpenData, &copy; Ordnance Survey'}) ], params: { 'LAYERS': 'osopen', 'FORMAT': 'image/png', 'TILED': true } }) }) ], view: new ol.View2D({ projection: projection, resolutions: resolutions, center: [315000, 468000], zoom: 0 }) });
Trim resolutions so they are a factor of 2.
Trim resolutions so they are a factor of 2. Currently ol3 appears to be assuming that resolutions are always a factor of 2, need to look into it more.
JavaScript
mit
AstunTechnology/astun-ol3-examples,AstunTechnology/astun-ol3-examples
javascript
## Code Before: // Extent of the map in units of the projection var extent = [-3276800, -3276800, 3276800, 3276800]; // Fixed resolutions to display the map at var resolutions = [1600, 800, 400, 200, 100, 50, 25, 10, 5, 2.5, 1, 0.5]; // Basic ol3 Projection definition, include the extent here and specify the // resolutions as a property of the View2D or TileWMS if you are using a tiled // WMS to ensure tiles are requested at the correct boundaries var projection = new ol.proj.Projection({ code: 'EPSG:27700', units: 'm', extent: extent }); var map = new ol.Map({ target: 'map', layers: [ new ol.layer.Tile({ source: new ol.source.TileWMS({ url: 'http://t0.ads.astuntechnology.com/astuntechnology/osopen/service?', attributions: [ new ol.Attribution({html: 'OS OpenData, &copy; Ordnance Survey'}) ], params: { 'LAYERS': 'osopen', 'FORMAT': 'image/png', 'TILED': true } }) }) ], view: new ol.View2D({ projection: projection, resolutions: resolutions, center: [315000, 468000], zoom: 0 }) }); ## Instruction: Trim resolutions so they are a factor of 2. Currently ol3 appears to be assuming that resolutions are always a factor of 2, need to look into it more. ## Code After: // Extent of the map in units of the projection var extent = [-3276800, -3276800, 3276800, 3276800]; // Fixed resolutions to display the map at var resolutions = [1600, 800, 400, 200, 100, 50, 25]; // Basic ol3 Projection definition, include the extent here and specify the // resolutions as a property of the View2D or TileWMS if you are using a tiled // WMS to ensure tiles are requested at the correct boundaries var projection = new ol.proj.Projection({ code: 'EPSG:27700', units: 'm', extent: extent }); var map = new ol.Map({ target: 'map', layers: [ new ol.layer.Tile({ source: new ol.source.TileWMS({ url: 'http://t0.ads.astuntechnology.com/astuntechnology/osopen/service?', attributions: [ new ol.Attribution({html: 'OS OpenData, &copy; Ordnance Survey'}) ], params: { 'LAYERS': 'osopen', 'FORMAT': 'image/png', 'TILED': true } }) }) ], view: new ol.View2D({ projection: projection, resolutions: resolutions, center: [315000, 468000], zoom: 0 }) });
// Extent of the map in units of the projection var extent = [-3276800, -3276800, 3276800, 3276800]; // Fixed resolutions to display the map at - var resolutions = [1600, 800, 400, 200, 100, 50, 25, 10, 5, 2.5, 1, 0.5]; ? -------------------- + var resolutions = [1600, 800, 400, 200, 100, 50, 25]; // Basic ol3 Projection definition, include the extent here and specify the // resolutions as a property of the View2D or TileWMS if you are using a tiled // WMS to ensure tiles are requested at the correct boundaries var projection = new ol.proj.Projection({ code: 'EPSG:27700', units: 'm', extent: extent }); var map = new ol.Map({ target: 'map', layers: [ new ol.layer.Tile({ source: new ol.source.TileWMS({ url: 'http://t0.ads.astuntechnology.com/astuntechnology/osopen/service?', attributions: [ new ol.Attribution({html: 'OS OpenData, &copy; Ordnance Survey'}) ], params: { 'LAYERS': 'osopen', 'FORMAT': 'image/png', 'TILED': true } }) }) ], view: new ol.View2D({ projection: projection, resolutions: resolutions, center: [315000, 468000], zoom: 0 }) });
2
0.051282
1
1
f16e0e181816408e2e617429e5b47571c70528d2
README.asciidoc
README.asciidoc
== dda - Django Desktop Application === Introduction DDA is an example project to demonstrate how to use Django as a desktop application. It provides an alternative to using a GUI framework such as https://docs.python.org/3.4/library/tkinter.html[Tkinter] or http://sourceforge.net/projects/pyqt/[PyQt]. It is a work in progress.
== dda - Django Desktop Application === Introduction DDA is an example project to demonstrate how to use Django as a desktop application. It provides an alternative to using a GUI framework such as https://docs.python.org/3.4/library/tkinter.html[Tkinter] or http://sourceforge.net/projects/pyqt/[PyQt]. It is a work in progress. === Credits To allow the Django Desktop Application to access common javascript and css files used by the web pages (without having to hit the network), I have included copies in this distribution. Here is a list: - http://jquery.com/[jQuery (Version 2.1.1)] - http://getbootstrap.com/[Bootstrap (Version 3.3.1)] - http://glyphicons.com/[Glyphicons] (Graciously donated to Bootstrap) - http://silviomoreto.github.io/bootstrap-select/[Bootstrap Select (Version 1.6.3)] They are all awesome.
Add credits section for included content.
Add credits section for included content.
AsciiDoc
mit
hoadlck/dda,hoadlck/dda
asciidoc
## Code Before: == dda - Django Desktop Application === Introduction DDA is an example project to demonstrate how to use Django as a desktop application. It provides an alternative to using a GUI framework such as https://docs.python.org/3.4/library/tkinter.html[Tkinter] or http://sourceforge.net/projects/pyqt/[PyQt]. It is a work in progress. ## Instruction: Add credits section for included content. ## Code After: == dda - Django Desktop Application === Introduction DDA is an example project to demonstrate how to use Django as a desktop application. It provides an alternative to using a GUI framework such as https://docs.python.org/3.4/library/tkinter.html[Tkinter] or http://sourceforge.net/projects/pyqt/[PyQt]. It is a work in progress. === Credits To allow the Django Desktop Application to access common javascript and css files used by the web pages (without having to hit the network), I have included copies in this distribution. Here is a list: - http://jquery.com/[jQuery (Version 2.1.1)] - http://getbootstrap.com/[Bootstrap (Version 3.3.1)] - http://glyphicons.com/[Glyphicons] (Graciously donated to Bootstrap) - http://silviomoreto.github.io/bootstrap-select/[Bootstrap Select (Version 1.6.3)] They are all awesome.
== dda - Django Desktop Application === Introduction DDA is an example project to demonstrate how to use Django as a desktop application. It provides an alternative to using a GUI framework such as https://docs.python.org/3.4/library/tkinter.html[Tkinter] or http://sourceforge.net/projects/pyqt/[PyQt]. It is a work in progress. + + === Credits + + To allow the Django Desktop Application to access common javascript and css + files used by the web pages (without having to hit the network), I have + included copies in this distribution. Here is a list: + + - http://jquery.com/[jQuery (Version 2.1.1)] + - http://getbootstrap.com/[Bootstrap (Version 3.3.1)] + - http://glyphicons.com/[Glyphicons] (Graciously donated to Bootstrap) + - http://silviomoreto.github.io/bootstrap-select/[Bootstrap Select (Version 1.6.3)] + + They are all awesome.
13
1.3
13
0
be53e92168a306715a845104d0b18aa5999952be
lib/spreewald.rb
lib/spreewald.rb
require 'cucumber_priority' require "spreewald_support/field_errors" require "spreewald_support/version" require "spreewald_support/github" require "spreewald_support/unsupported_email_header"
require 'cucumber_priority' require "spreewald_support/version" require "spreewald_support/github" require "spreewald_support/unsupported_email_header"
Fix "undefined method `build_rb_world_factory` for nil:NilClass" error when running tests on a real project
Fix "undefined method `build_rb_world_factory` for nil:NilClass" error when running tests on a real project
Ruby
mit
makandra/spreewald,makandra/spreewald
ruby
## Code Before: require 'cucumber_priority' require "spreewald_support/field_errors" require "spreewald_support/version" require "spreewald_support/github" require "spreewald_support/unsupported_email_header" ## Instruction: Fix "undefined method `build_rb_world_factory` for nil:NilClass" error when running tests on a real project ## Code After: require 'cucumber_priority' require "spreewald_support/version" require "spreewald_support/github" require "spreewald_support/unsupported_email_header"
require 'cucumber_priority' - require "spreewald_support/field_errors" require "spreewald_support/version" require "spreewald_support/github" require "spreewald_support/unsupported_email_header"
1
0.166667
0
1
ccc89418228d13bb4b9bfba350ca54d912b80182
assets/scss/_styles_project.scss
assets/scss/_styles_project.scss
// The stroom logo on the landing page .landing-page-logo { padding-top: 0px; padding-bottom: 60px; } .landing-page-bullets li { padding-top: 1.2em; } .landing-page-head-text { line-height: 1.7em; } // The 't' in stroom makes it appear off center vertically so move it a bit .navbar-brand { padding-top: 2px; padding-bottom: 8px; // As we want a 'stroom' logo on the left of the bar, we need to hide the title text .text-uppercase { visibility: hidden; } } .stroom-icon { vertical-align: -0.08em; }
// The stroom logo on the landing page .landing-page-logo { padding-top: 0px; padding-bottom: 60px; } .landing-page-bullets li { padding-top: 1.2em; } .landing-page-head-text { line-height: 1.7em; } // The 't' in stroom makes it appear off center vertically so move it a bit .navbar-brand { padding-top: 0em; padding-bottom: 0.3em; // As we want a 'stroom' logo on the left of the bar, we need to hide the title text .text-uppercase { visibility: hidden; } } // Make the top nav bar a bit thinner .navbar { padding: 0rem 1rem; // Make the search input more visible in the top nav bar .form-control { border:1px solid #ffffff8c; } } // Make the top nav bar a bit thinner .td-navbar { min-height: 3em; } .stroom-icon { vertical-align: -0.08em; }
Make top nav bar thinner, tweak nav bar search border
Make top nav bar thinner, tweak nav bar search border
SCSS
apache-2.0
gchq/stroom-docs,gchq/stroom-docs,gchq/stroom-docs
scss
## Code Before: // The stroom logo on the landing page .landing-page-logo { padding-top: 0px; padding-bottom: 60px; } .landing-page-bullets li { padding-top: 1.2em; } .landing-page-head-text { line-height: 1.7em; } // The 't' in stroom makes it appear off center vertically so move it a bit .navbar-brand { padding-top: 2px; padding-bottom: 8px; // As we want a 'stroom' logo on the left of the bar, we need to hide the title text .text-uppercase { visibility: hidden; } } .stroom-icon { vertical-align: -0.08em; } ## Instruction: Make top nav bar thinner, tweak nav bar search border ## Code After: // The stroom logo on the landing page .landing-page-logo { padding-top: 0px; padding-bottom: 60px; } .landing-page-bullets li { padding-top: 1.2em; } .landing-page-head-text { line-height: 1.7em; } // The 't' in stroom makes it appear off center vertically so move it a bit .navbar-brand { padding-top: 0em; padding-bottom: 0.3em; // As we want a 'stroom' logo on the left of the bar, we need to hide the title text .text-uppercase { visibility: hidden; } } // Make the top nav bar a bit thinner .navbar { padding: 0rem 1rem; // Make the search input more visible in the top nav bar .form-control { border:1px solid #ffffff8c; } } // Make the top nav bar a bit thinner .td-navbar { min-height: 3em; } .stroom-icon { vertical-align: -0.08em; }
// The stroom logo on the landing page .landing-page-logo { padding-top: 0px; padding-bottom: 60px; } .landing-page-bullets li { padding-top: 1.2em; } .landing-page-head-text { line-height: 1.7em; } // The 't' in stroom makes it appear off center vertically so move it a bit .navbar-brand { - padding-top: 2px; ? ^^^ + padding-top: 0em; ? ^^^ - padding-bottom: 8px; ? ^^^ + padding-bottom: 0.3em; ? ^^^^^ // As we want a 'stroom' logo on the left of the bar, we need to hide the title text .text-uppercase { visibility: hidden; } } + // Make the top nav bar a bit thinner + .navbar { + padding: 0rem 1rem; + + // Make the search input more visible in the top nav bar + .form-control { + border:1px solid #ffffff8c; + } + } + + // Make the top nav bar a bit thinner + .td-navbar { + min-height: 3em; + } + .stroom-icon { vertical-align: -0.08em; }
19
0.655172
17
2
ab49bb2ed4c2744f7457520975d54455d5c06b47
react/javascript/src/EnvelopesQueryContext.ts
react/javascript/src/EnvelopesQueryContext.ts
import React from 'react' import { messages } from '@cucumber/messages' export class EnvelopesQuery { private envelopes: messages.IEnvelope[] = [] public update(envelope: messages.IEnvelope) { this.envelopes.push(envelope) } public find( callback: (envelope: messages.IEnvelope) => boolean ): messages.IEnvelope { return this.envelopes.find(callback) } public filter( callback: (envelope: messages.IEnvelope) => boolean ): messages.IEnvelope[] { return this.envelopes.filter(callback) } } export default React.createContext(new EnvelopesQuery())
import React from 'react' import { messages } from '@cucumber/messages' export class EnvelopesQuery { private envelopes: messages.IEnvelope[] = [] public update(envelope: messages.IEnvelope) { this.envelopes.push(envelope) } public find( predicate: (envelope: messages.IEnvelope) => boolean ): messages.IEnvelope { return this.envelopes.find(predicate) } public filter( predicate: (envelope: messages.IEnvelope) => boolean ): messages.IEnvelope[] { return this.envelopes.filter(predicate) } } export default React.createContext(new EnvelopesQuery())
Rename callback to predicate to better reveal intent
Rename callback to predicate to better reveal intent
TypeScript
mit
cucumber/cucumber,cucumber/cucumber,cucumber/cucumber,cucumber/cucumber,cucumber/cucumber,cucumber/cucumber,cucumber/cucumber,cucumber/cucumber,cucumber/cucumber,cucumber/cucumber,cucumber/cucumber,cucumber/cucumber
typescript
## Code Before: import React from 'react' import { messages } from '@cucumber/messages' export class EnvelopesQuery { private envelopes: messages.IEnvelope[] = [] public update(envelope: messages.IEnvelope) { this.envelopes.push(envelope) } public find( callback: (envelope: messages.IEnvelope) => boolean ): messages.IEnvelope { return this.envelopes.find(callback) } public filter( callback: (envelope: messages.IEnvelope) => boolean ): messages.IEnvelope[] { return this.envelopes.filter(callback) } } export default React.createContext(new EnvelopesQuery()) ## Instruction: Rename callback to predicate to better reveal intent ## Code After: import React from 'react' import { messages } from '@cucumber/messages' export class EnvelopesQuery { private envelopes: messages.IEnvelope[] = [] public update(envelope: messages.IEnvelope) { this.envelopes.push(envelope) } public find( predicate: (envelope: messages.IEnvelope) => boolean ): messages.IEnvelope { return this.envelopes.find(predicate) } public filter( predicate: (envelope: messages.IEnvelope) => boolean ): messages.IEnvelope[] { return this.envelopes.filter(predicate) } } export default React.createContext(new EnvelopesQuery())
import React from 'react' import { messages } from '@cucumber/messages' export class EnvelopesQuery { private envelopes: messages.IEnvelope[] = [] public update(envelope: messages.IEnvelope) { this.envelopes.push(envelope) } public find( - callback: (envelope: messages.IEnvelope) => boolean ? ^^^^^^ + predicate: (envelope: messages.IEnvelope) => boolean ? +++++ ^^ ): messages.IEnvelope { - return this.envelopes.find(callback) ? ^^^^^^ + return this.envelopes.find(predicate) ? +++++ ^^ } public filter( - callback: (envelope: messages.IEnvelope) => boolean ? ^^^^^^ + predicate: (envelope: messages.IEnvelope) => boolean ? +++++ ^^ ): messages.IEnvelope[] { - return this.envelopes.filter(callback) ? ^^^^^^ + return this.envelopes.filter(predicate) ? +++++ ^^ } } export default React.createContext(new EnvelopesQuery())
8
0.333333
4
4
3f5fac4ff704429811e2548f970a5cc7cef8d721
spec/support/make_strings.php
spec/support/make_strings.php
<?php function dump ($o) { $o = serialize($o); echo json_encode($o), "\n"; } class Foo { public $bar = 1; protected $baz = 2; private $xyzzy = array(1,2,3,4,5,6,7,8,9); protected $self; public function __construct () { $this->self = $this; } } $f = new Foo(); dump($f); class Bar { } $f = new Bar(); $f->self = $f; dump($f); $f = new stdClass; $f->obj1->obj2->obj3->arr = array(); $f->obj1->obj2->obj3->arr[] = 1; $f->obj1->obj2->obj3->arr[] = 2; $f->obj1->obj2->obj3->arr[] = 3; $f->obj1->obj2->obj3->arr['ref1'] = $f->obj1->obj2; $f->obj1->obj2->obj3->arr['ref2'] = &$f->obj1->obj2->obj3->arr; dump($f);
<?php function dump ($o) { $o = serialize($o); echo json_encode($o), "\n"; } class Foo { public $bar = 1; protected $baz = 2; private $xyzzy = array(1,2,3,4,5,6,7,8,9); protected $self; public function __construct () { $this->self = $this; } } $f = new Foo(); dump($f); class Bar { } $f = new Bar(); $f->self = $f; dump($f); class Child extends Foo { public $lorem = 42; protected $ipsum = 37; private $dolor = 13; } $f = new Child(); dump($f); $f = new stdClass; $f->obj1->obj2->obj3->arr = array(); $f->obj1->obj2->obj3->arr[] = 1; $f->obj1->obj2->obj3->arr[] = 2; $f->obj1->obj2->obj3->arr[] = 3; $f->obj1->obj2->obj3->arr['ref1'] = $f->obj1->obj2; $f->obj1->obj2->obj3->arr['ref2'] = &$f->obj1->obj2->obj3->arr; dump($f);
Add debug case for serialize sources
Add debug case for serialize sources
PHP
mit
bd808/php-unserialize-js,bd808/php-unserialize-js
php
## Code Before: <?php function dump ($o) { $o = serialize($o); echo json_encode($o), "\n"; } class Foo { public $bar = 1; protected $baz = 2; private $xyzzy = array(1,2,3,4,5,6,7,8,9); protected $self; public function __construct () { $this->self = $this; } } $f = new Foo(); dump($f); class Bar { } $f = new Bar(); $f->self = $f; dump($f); $f = new stdClass; $f->obj1->obj2->obj3->arr = array(); $f->obj1->obj2->obj3->arr[] = 1; $f->obj1->obj2->obj3->arr[] = 2; $f->obj1->obj2->obj3->arr[] = 3; $f->obj1->obj2->obj3->arr['ref1'] = $f->obj1->obj2; $f->obj1->obj2->obj3->arr['ref2'] = &$f->obj1->obj2->obj3->arr; dump($f); ## Instruction: Add debug case for serialize sources ## Code After: <?php function dump ($o) { $o = serialize($o); echo json_encode($o), "\n"; } class Foo { public $bar = 1; protected $baz = 2; private $xyzzy = array(1,2,3,4,5,6,7,8,9); protected $self; public function __construct () { $this->self = $this; } } $f = new Foo(); dump($f); class Bar { } $f = new Bar(); $f->self = $f; dump($f); class Child extends Foo { public $lorem = 42; protected $ipsum = 37; private $dolor = 13; } $f = new Child(); dump($f); $f = new stdClass; $f->obj1->obj2->obj3->arr = array(); $f->obj1->obj2->obj3->arr[] = 1; $f->obj1->obj2->obj3->arr[] = 2; $f->obj1->obj2->obj3->arr[] = 3; $f->obj1->obj2->obj3->arr['ref1'] = $f->obj1->obj2; $f->obj1->obj2->obj3->arr['ref2'] = &$f->obj1->obj2->obj3->arr; dump($f);
<?php function dump ($o) { $o = serialize($o); echo json_encode($o), "\n"; } class Foo { public $bar = 1; protected $baz = 2; private $xyzzy = array(1,2,3,4,5,6,7,8,9); protected $self; public function __construct () { $this->self = $this; } } $f = new Foo(); dump($f); class Bar { } $f = new Bar(); $f->self = $f; dump($f); + class Child extends Foo { + public $lorem = 42; + protected $ipsum = 37; + private $dolor = 13; + } + $f = new Child(); + dump($f); + $f = new stdClass; $f->obj1->obj2->obj3->arr = array(); $f->obj1->obj2->obj3->arr[] = 1; $f->obj1->obj2->obj3->arr[] = 2; $f->obj1->obj2->obj3->arr[] = 3; $f->obj1->obj2->obj3->arr['ref1'] = $f->obj1->obj2; $f->obj1->obj2->obj3->arr['ref2'] = &$f->obj1->obj2->obj3->arr; dump($f);
8
0.242424
8
0
dcea1a457d9fe2004d00a0a908d540f3200cca93
fipes/public/app/views/fipe_view.js
fipes/public/app/views/fipe_view.js
(function() { App.Views.Fipe = Backbone.View.extend({ events: { // Classic file selection 'click .upload a' : 'browseFiles', 'change input[type="file"]' : 'enterTheFipe', // Drag'n drop 'dragover .widget' : 'dragOver', 'drop .widget' : 'drop' }, browseFiles: function(event) { var fileInput = $(this.el).find('input[type="file"]')[0]; fileInput.click(); }, enterTheFipe: function(event) { this.addFiles(event.target.files); // Only redirect when we are on the home page. if (App.Fipe === undefined) { this.redirect(); } }, dragOver: function(event) { return false; }, drop: function(event) { this.addFiles(event.dataTransfer.files); }, addFiles: function(files) { files = _.map(files, function(file) { return new App.Models.File({ obj : file, name : file.name, type : file.type, size : file.size }); }); App.Files.add(files).save(); }, redirect: function() { var fipe = new App.Models.Fipe; fipe.save({}, { success: function() { App.Routes.navigate(fipe.url(), true); } }); } }); })();
(function() { App.Views.Fipe = Backbone.View.extend({ events: { // Classic file selection 'click .upload a' : 'browseFiles', 'change input[type="file"]' : 'selectFiles', // Drag'n drop 'dragover .widget' : 'dragOver', 'drop .widget' : 'dropFiles' }, browseFiles: function(event) { var fileInput = $(this.el).find('input[type="file"]')[0]; fileInput.click(); }, selectFiles: function(event) { this.enterTheFipe(event.target.files); }, dragOver: function(event) { return false; }, dropFiles: function(event) { this.enterTheFipe(event.dataTransfer.files); }, enterTheFipe: function(files) { this.addFiles(files); // Only redirect when we are on the home page. if (App.Fipe === undefined) { this.redirect(); } }, addFiles: function(files) { files = _.map(files, function(file) { return new App.Models.File({ obj : file, name : file.name, type : file.type, size : file.size }); }); App.Files.add(files).save(); }, redirect: function() { var fipe = new App.Models.Fipe; fipe.save({}, { success: function() { App.Routes.navigate(fipe.url(), true); } }); } }); })();
Fix the drag'n drop when entering a fipe.
Fix the drag'n drop when entering a fipe.
JavaScript
agpl-3.0
tOkeshu/fipes
javascript
## Code Before: (function() { App.Views.Fipe = Backbone.View.extend({ events: { // Classic file selection 'click .upload a' : 'browseFiles', 'change input[type="file"]' : 'enterTheFipe', // Drag'n drop 'dragover .widget' : 'dragOver', 'drop .widget' : 'drop' }, browseFiles: function(event) { var fileInput = $(this.el).find('input[type="file"]')[0]; fileInput.click(); }, enterTheFipe: function(event) { this.addFiles(event.target.files); // Only redirect when we are on the home page. if (App.Fipe === undefined) { this.redirect(); } }, dragOver: function(event) { return false; }, drop: function(event) { this.addFiles(event.dataTransfer.files); }, addFiles: function(files) { files = _.map(files, function(file) { return new App.Models.File({ obj : file, name : file.name, type : file.type, size : file.size }); }); App.Files.add(files).save(); }, redirect: function() { var fipe = new App.Models.Fipe; fipe.save({}, { success: function() { App.Routes.navigate(fipe.url(), true); } }); } }); })(); ## Instruction: Fix the drag'n drop when entering a fipe. ## Code After: (function() { App.Views.Fipe = Backbone.View.extend({ events: { // Classic file selection 'click .upload a' : 'browseFiles', 'change input[type="file"]' : 'selectFiles', // Drag'n drop 'dragover .widget' : 'dragOver', 'drop .widget' : 'dropFiles' }, browseFiles: function(event) { var fileInput = $(this.el).find('input[type="file"]')[0]; fileInput.click(); }, selectFiles: function(event) { this.enterTheFipe(event.target.files); }, dragOver: function(event) { return false; }, dropFiles: function(event) { this.enterTheFipe(event.dataTransfer.files); }, enterTheFipe: function(files) { this.addFiles(files); // Only redirect when we are on the home page. if (App.Fipe === undefined) { this.redirect(); } }, addFiles: function(files) { files = _.map(files, function(file) { return new App.Models.File({ obj : file, name : file.name, type : file.type, size : file.size }); }); App.Files.add(files).save(); }, redirect: function() { var fipe = new App.Models.Fipe; fipe.save({}, { success: function() { App.Routes.navigate(fipe.url(), true); } }); } }); })();
(function() { App.Views.Fipe = Backbone.View.extend({ events: { // Classic file selection 'click .upload a' : 'browseFiles', - 'change input[type="file"]' : 'enterTheFipe', ? ^ ----- ^ + 'change input[type="file"]' : 'selectFiles', ? + ^^^ ^ + // Drag'n drop 'dragover .widget' : 'dragOver', - 'drop .widget' : 'drop' + 'drop .widget' : 'dropFiles' ? +++++ }, browseFiles: function(event) { var fileInput = $(this.el).find('input[type="file"]')[0]; fileInput.click(); }, - enterTheFipe: function(event) { ? ^ ----- ^ + selectFiles: function(event) { ? + ^^^ ^ + - this.addFiles(event.target.files); ? ^^^ ^ - + this.enterTheFipe(event.target.files); ? ^^^^^^^^ ^ - - // Only redirect when we are on the home page. - if (App.Fipe === undefined) { - this.redirect(); - } }, dragOver: function(event) { return false; }, - drop: function(event) { + dropFiles: function(event) { ? +++++ - this.addFiles(event.dataTransfer.files); ? ^^^ ^ - + this.enterTheFipe(event.dataTransfer.files); ? ^^^^^^^^ ^ + }, + + enterTheFipe: function(files) { + this.addFiles(files); + + // Only redirect when we are on the home page. + if (App.Fipe === undefined) { + this.redirect(); + } }, addFiles: function(files) { files = _.map(files, function(file) { return new App.Models.File({ obj : file, name : file.name, type : file.type, size : file.size }); }); App.Files.add(files).save(); }, redirect: function() { var fipe = new App.Models.Fipe; fipe.save({}, { success: function() { App.Routes.navigate(fipe.url(), true); } }); } }); })();
26
0.45614
15
11
3e6fc31e6363f5b18aee4c003f64b370b8d5b038
.circleci/config.yml
.circleci/config.yml
version: 2 jobs: build: docker: - image: circleci/node:latest-browsers steps: - checkout - restore_cache: keys: - node-v1-{{ .Branch }}-{{ checksum "package-lock.json" }} - node-v1-{{ .Branch }}- - node-v1- - run: npm install - save_cache: paths: - node_modules key: node-v1-{{ .Branch }}-{{ checksum "package-lock.json" }} - run: npm run build && git diff --exit-code -- :^package-lock.json - run: npm test -- --browsers ChromeHeadless,Firefox - run: test -z "$CIRCLE_PULL_REQUEST" && ./node_modules/.bin/codecov
version: 2 jobs: build: docker: - image: circleci/node:latest-browsers steps: - checkout - restore_cache: keys: - node-v1-{{ .Branch }}-{{ checksum "package-lock.json" }} - node-v1-{{ .Branch }}- - node-v1- - run: npm install - save_cache: paths: - node_modules key: node-v1-{{ .Branch }}-{{ checksum "package-lock.json" }} - run: npm run build && git diff --exit-code -- :^package-lock.json - run: npm test -- --browsers ChromeHeadless,Firefox - run: test -z "$CIRCLE_PULL_REQUEST" && ./node_modules/.bin/codecov deploy: docker: - image: circleci/node:latest-browsers steps: - checkout - run: | npm install NODE_ENV=production npm run build NODE_ENV=production npm test -- --browsers ChromeHeadless,Firefox - run: | echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc npm publish workflows: version: 2 build-and-deploy: jobs: - build: filters: tags: only: /^v.*/ - deploy: requires: - build filters: tags: only: /^v.*/ branches: ignore: /.*/
Prepare for publish using CircleCI
Prepare for publish using CircleCI
YAML
bsd-2-clause
ntkme/github-buttons
yaml
## Code Before: version: 2 jobs: build: docker: - image: circleci/node:latest-browsers steps: - checkout - restore_cache: keys: - node-v1-{{ .Branch }}-{{ checksum "package-lock.json" }} - node-v1-{{ .Branch }}- - node-v1- - run: npm install - save_cache: paths: - node_modules key: node-v1-{{ .Branch }}-{{ checksum "package-lock.json" }} - run: npm run build && git diff --exit-code -- :^package-lock.json - run: npm test -- --browsers ChromeHeadless,Firefox - run: test -z "$CIRCLE_PULL_REQUEST" && ./node_modules/.bin/codecov ## Instruction: Prepare for publish using CircleCI ## Code After: version: 2 jobs: build: docker: - image: circleci/node:latest-browsers steps: - checkout - restore_cache: keys: - node-v1-{{ .Branch }}-{{ checksum "package-lock.json" }} - node-v1-{{ .Branch }}- - node-v1- - run: npm install - save_cache: paths: - node_modules key: node-v1-{{ .Branch }}-{{ checksum "package-lock.json" }} - run: npm run build && git diff --exit-code -- :^package-lock.json - run: npm test -- --browsers ChromeHeadless,Firefox - run: test -z "$CIRCLE_PULL_REQUEST" && ./node_modules/.bin/codecov deploy: docker: - image: circleci/node:latest-browsers steps: - checkout - run: | npm install NODE_ENV=production npm run build NODE_ENV=production npm test -- --browsers ChromeHeadless,Firefox - run: | echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc npm publish workflows: version: 2 build-and-deploy: jobs: - build: filters: tags: only: /^v.*/ - deploy: requires: - build filters: tags: only: /^v.*/ branches: ignore: /.*/
version: 2 jobs: build: docker: - image: circleci/node:latest-browsers steps: - checkout - restore_cache: keys: - node-v1-{{ .Branch }}-{{ checksum "package-lock.json" }} - node-v1-{{ .Branch }}- - node-v1- - run: npm install - save_cache: paths: - node_modules key: node-v1-{{ .Branch }}-{{ checksum "package-lock.json" }} - run: npm run build && git diff --exit-code -- :^package-lock.json - run: npm test -- --browsers ChromeHeadless,Firefox - run: test -z "$CIRCLE_PULL_REQUEST" && ./node_modules/.bin/codecov + deploy: + docker: + - image: circleci/node:latest-browsers + steps: + - checkout + - run: | + npm install + NODE_ENV=production npm run build + NODE_ENV=production npm test -- --browsers ChromeHeadless,Firefox + - run: | + echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc + npm publish + + workflows: + version: 2 + build-and-deploy: + jobs: + - build: + filters: + tags: + only: /^v.*/ + - deploy: + requires: + - build + filters: + tags: + only: /^v.*/ + branches: + ignore: /.*/
29
1.45
29
0
a757407ea2a4709594251e0c149883163e00af84
extensions/common/xwalk_extension_messages.h
extensions/common/xwalk_extension_messages.h
// Copyright (c) 2013 Intel Corporation. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include <string> #include "ipc/ipc_message_macros.h" #define IPC_MESSAGE_START ExtensionMsgStart IPC_MESSAGE_ROUTED2(XWalkViewHostMsg_PostMessage, // NOLINT(*) std::string /* target extension */, std::string /* contents */) IPC_MESSAGE_ROUTED2(XWalkViewMsg_PostMessage, // NOLINT(*) std::string /* source extension */, std::string /* contents */) IPC_MESSAGE_CONTROL2(XWalkViewMsg_RegisterExtension, // NOLINT(*) std::string /* extension */, std::string /* JS API code for extension */)
// Copyright (c) 2013 Intel Corporation. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include <string> #include "ipc/ipc_message_macros.h" // Note: it is safe to use numbers after LastIPCMsgStart since that limit // is not relevant for embedders. It is used only by a tool inside chrome/ // that we currently don't use. // See also https://code.google.com/p/chromium/issues/detail?id=110911. const int XWalkExtensionMsgStart = LastIPCMsgStart + 1; #define IPC_MESSAGE_START XWalkExtensionMsgStart IPC_MESSAGE_ROUTED2(XWalkViewHostMsg_PostMessage, // NOLINT(*) std::string /* target extension */, std::string /* contents */) IPC_MESSAGE_ROUTED2(XWalkViewMsg_PostMessage, // NOLINT(*) std::string /* source extension */, std::string /* contents */) IPC_MESSAGE_CONTROL2(XWalkViewMsg_RegisterExtension, // NOLINT(*) std::string /* extension */, std::string /* JS API code for extension */)
Use an unique ID for Crosswalk Extension IPC messages
Use an unique ID for Crosswalk Extension IPC messages We were reusing ExtensionMsgStart, but it is not needed, we can simply take a number after the existing ones. The LastIPCMsgStart is currently used only by certain Chrome tools, so we won't miss anything for being a number larger than the last.
C
bsd-3-clause
crosswalk-project/crosswalk-efl,alex-zhang/crosswalk,xzhan96/crosswalk,lincsoon/crosswalk,DonnaWuDongxia/crosswalk,weiyirong/crosswalk-1,stonegithubs/crosswalk,baleboy/crosswalk,XiaosongWei/crosswalk,amaniak/crosswalk,mrunalk/crosswalk,crosswalk-project/crosswalk,PeterWangIntel/crosswalk,axinging/crosswalk,xzhan96/crosswalk,Pluto-tv/crosswalk,shaochangbin/crosswalk,mrunalk/crosswalk,kurli/crosswalk,leonhsl/crosswalk,zliang7/crosswalk,darktears/crosswalk,bestwpw/crosswalk,qjia7/crosswalk,TheDirtyCalvinist/spacewalk,myroot/crosswalk,rakuco/crosswalk,bestwpw/crosswalk,axinging/crosswalk,wuhengzhi/crosswalk,weiyirong/crosswalk-1,Shouqun/crosswalk,dreamsxin/crosswalk,fujunwei/crosswalk,huningxin/crosswalk,chuan9/crosswalk,huningxin/crosswalk,weiyirong/crosswalk-1,Pluto-tv/crosswalk,siovene/crosswalk,chinakids/crosswalk,amaniak/crosswalk,Bysmyyr/crosswalk,fujunwei/crosswalk,Pluto-tv/crosswalk,chuan9/crosswalk,xzhan96/crosswalk,amaniak/crosswalk,heke123/crosswalk,fujunwei/crosswalk,heke123/crosswalk,myroot/crosswalk,minggangw/crosswalk,rakuco/crosswalk,zliang7/crosswalk,bestwpw/crosswalk,jondwillis/crosswalk,Pluto-tv/crosswalk,jpike88/crosswalk,myroot/crosswalk,kurli/crosswalk,wuhengzhi/crosswalk,kurli/crosswalk,PeterWangIntel/crosswalk,marcuspridham/crosswalk,kurli/crosswalk,amaniak/crosswalk,RafuCater/crosswalk,alex-zhang/crosswalk,DonnaWuDongxia/crosswalk,siovene/crosswalk,baleboy/crosswalk,heke123/crosswalk,ZhengXinCN/crosswalk,chuan9/crosswalk,ZhengXinCN/crosswalk,stonegithubs/crosswalk,jondong/crosswalk,crosswalk-project/crosswalk-efl,RafuCater/crosswalk,jpike88/crosswalk,tomatell/crosswalk,pk-sam/crosswalk,seanlong/crosswalk,zliang7/crosswalk,pozdnyakov/crosswalk,crosswalk-project/crosswalk-efl,pk-sam/crosswalk,PeterWangIntel/crosswalk,shaochangbin/crosswalk,zliang7/crosswalk,PeterWangIntel/crosswalk,dreamsxin/crosswalk,zliang7/crosswalk,jondwillis/crosswalk,kurli/crosswalk,Bysmyyr/crosswalk,hgl888/crosswalk,hgl888/crosswalk-efl,myroot/crosswalk,qjia7/crosswalk,leonhsl/crosswalk,xzhan96/crosswalk,darktears/crosswalk,jpike88/crosswalk,crosswalk-project/crosswalk-efl,Bysmyyr/crosswalk,darktears/crosswalk,shaochangbin/crosswalk,pozdnyakov/crosswalk,baleboy/crosswalk,baleboy/crosswalk,xzhan96/crosswalk,chinakids/crosswalk,amaniak/crosswalk,marcuspridham/crosswalk,Bysmyyr/crosswalk,jondong/crosswalk,rakuco/crosswalk,xzhan96/crosswalk,heke123/crosswalk,pk-sam/crosswalk,leonhsl/crosswalk,DonnaWuDongxia/crosswalk,fujunwei/crosswalk,lincsoon/crosswalk,hgl888/crosswalk,fujunwei/crosswalk,jondong/crosswalk,jondong/crosswalk,alex-zhang/crosswalk,chinakids/crosswalk,RafuCater/crosswalk,seanlong/crosswalk,minggangw/crosswalk,Bysmyyr/crosswalk,weiyirong/crosswalk-1,rakuco/crosswalk,zeropool/crosswalk,ZhengXinCN/crosswalk,hgl888/crosswalk-efl,amaniak/crosswalk,Shouqun/crosswalk,alex-zhang/crosswalk,seanlong/crosswalk,jpike88/crosswalk,tedshroyer/crosswalk,crosswalk-project/crosswalk-efl,hgl888/crosswalk-efl,zeropool/crosswalk,TheDirtyCalvinist/spacewalk,dreamsxin/crosswalk,wuhengzhi/crosswalk,DonnaWuDongxia/crosswalk,zeropool/crosswalk,jondong/crosswalk,jondwillis/crosswalk,pk-sam/crosswalk,crosswalk-project/crosswalk,baleboy/crosswalk,dreamsxin/crosswalk,pozdnyakov/crosswalk,alex-zhang/crosswalk,Pluto-tv/crosswalk,crosswalk-project/crosswalk,lincsoon/crosswalk,stonegithubs/crosswalk,rakuco/crosswalk,seanlong/crosswalk,zeropool/crosswalk,siovene/crosswalk,shaochangbin/crosswalk,bestwpw/crosswalk,crosswalk-project/crosswalk-efl,jondwillis/crosswalk,chuan9/crosswalk,crosswalk-project/crosswalk,qjia7/crosswalk,leonhsl/crosswalk,tomatell/crosswalk,jpike88/crosswalk,TheDirtyCalvinist/spacewalk,rakuco/crosswalk,tedshroyer/crosswalk,XiaosongWei/crosswalk,chinakids/crosswalk,huningxin/crosswalk,jondong/crosswalk,marcuspridham/crosswalk,amaniak/crosswalk,heke123/crosswalk,shaochangbin/crosswalk,tomatell/crosswalk,Bysmyyr/crosswalk,RafuCater/crosswalk,stonegithubs/crosswalk,Pluto-tv/crosswalk,tedshroyer/crosswalk,myroot/crosswalk,xzhan96/crosswalk,zliang7/crosswalk,darktears/crosswalk,PeterWangIntel/crosswalk,pozdnyakov/crosswalk,pk-sam/crosswalk,XiaosongWei/crosswalk,RafuCater/crosswalk,darktears/crosswalk,marcuspridham/crosswalk,crosswalk-project/crosswalk,zeropool/crosswalk,seanlong/crosswalk,alex-zhang/crosswalk,minggangw/crosswalk,tomatell/crosswalk,dreamsxin/crosswalk,myroot/crosswalk,chuan9/crosswalk,wuhengzhi/crosswalk,seanlong/crosswalk,mrunalk/crosswalk,zliang7/crosswalk,minggangw/crosswalk,shaochangbin/crosswalk,xzhan96/crosswalk,hgl888/crosswalk-efl,hgl888/crosswalk-efl,stonegithubs/crosswalk,zliang7/crosswalk,lincsoon/crosswalk,leonhsl/crosswalk,chuan9/crosswalk,PeterWangIntel/crosswalk,bestwpw/crosswalk,minggangw/crosswalk,marcuspridham/crosswalk,zeropool/crosswalk,darktears/crosswalk,hgl888/crosswalk,alex-zhang/crosswalk,huningxin/crosswalk,leonhsl/crosswalk,minggangw/crosswalk,chuan9/crosswalk,PeterWangIntel/crosswalk,marcuspridham/crosswalk,Shouqun/crosswalk,crosswalk-project/crosswalk,rakuco/crosswalk,axinging/crosswalk,crosswalk-project/crosswalk-efl,axinging/crosswalk,DonnaWuDongxia/crosswalk,jondong/crosswalk,stonegithubs/crosswalk,heke123/crosswalk,tedshroyer/crosswalk,pk-sam/crosswalk,TheDirtyCalvinist/spacewalk,TheDirtyCalvinist/spacewalk,baleboy/crosswalk,lincsoon/crosswalk,chinakids/crosswalk,dreamsxin/crosswalk,darktears/crosswalk,tedshroyer/crosswalk,axinging/crosswalk,heke123/crosswalk,DonnaWuDongxia/crosswalk,jondong/crosswalk,axinging/crosswalk,bestwpw/crosswalk,ZhengXinCN/crosswalk,marcuspridham/crosswalk,crosswalk-project/crosswalk,mrunalk/crosswalk,weiyirong/crosswalk-1,siovene/crosswalk,qjia7/crosswalk,tedshroyer/crosswalk,wuhengzhi/crosswalk,tedshroyer/crosswalk,lincsoon/crosswalk,qjia7/crosswalk,Shouqun/crosswalk,stonegithubs/crosswalk,hgl888/crosswalk-efl,ZhengXinCN/crosswalk,pk-sam/crosswalk,hgl888/crosswalk,jpike88/crosswalk,hgl888/crosswalk,siovene/crosswalk,axinging/crosswalk,XiaosongWei/crosswalk,Shouqun/crosswalk,qjia7/crosswalk,rakuco/crosswalk,chinakids/crosswalk,RafuCater/crosswalk,hgl888/crosswalk,Bysmyyr/crosswalk,jondwillis/crosswalk,tomatell/crosswalk,leonhsl/crosswalk,fujunwei/crosswalk,weiyirong/crosswalk-1,jondwillis/crosswalk,lincsoon/crosswalk,XiaosongWei/crosswalk,crosswalk-project/crosswalk,zeropool/crosswalk,jondwillis/crosswalk,XiaosongWei/crosswalk,pozdnyakov/crosswalk,Shouqun/crosswalk,XiaosongWei/crosswalk,hgl888/crosswalk-efl,marcuspridham/crosswalk,bestwpw/crosswalk,DonnaWuDongxia/crosswalk,ZhengXinCN/crosswalk,fujunwei/crosswalk,Pluto-tv/crosswalk,baleboy/crosswalk,huningxin/crosswalk,pozdnyakov/crosswalk,heke123/crosswalk,minggangw/crosswalk,TheDirtyCalvinist/spacewalk,RafuCater/crosswalk,mrunalk/crosswalk,mrunalk/crosswalk,Bysmyyr/crosswalk,kurli/crosswalk,huningxin/crosswalk,darktears/crosswalk,lincsoon/crosswalk,jpike88/crosswalk,baleboy/crosswalk,ZhengXinCN/crosswalk,siovene/crosswalk,hgl888/crosswalk,hgl888/crosswalk,wuhengzhi/crosswalk,tomatell/crosswalk,weiyirong/crosswalk-1,dreamsxin/crosswalk,minggangw/crosswalk,tomatell/crosswalk,siovene/crosswalk
c
## Code Before: // Copyright (c) 2013 Intel Corporation. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include <string> #include "ipc/ipc_message_macros.h" #define IPC_MESSAGE_START ExtensionMsgStart IPC_MESSAGE_ROUTED2(XWalkViewHostMsg_PostMessage, // NOLINT(*) std::string /* target extension */, std::string /* contents */) IPC_MESSAGE_ROUTED2(XWalkViewMsg_PostMessage, // NOLINT(*) std::string /* source extension */, std::string /* contents */) IPC_MESSAGE_CONTROL2(XWalkViewMsg_RegisterExtension, // NOLINT(*) std::string /* extension */, std::string /* JS API code for extension */) ## Instruction: Use an unique ID for Crosswalk Extension IPC messages We were reusing ExtensionMsgStart, but it is not needed, we can simply take a number after the existing ones. The LastIPCMsgStart is currently used only by certain Chrome tools, so we won't miss anything for being a number larger than the last. ## Code After: // Copyright (c) 2013 Intel Corporation. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include <string> #include "ipc/ipc_message_macros.h" // Note: it is safe to use numbers after LastIPCMsgStart since that limit // is not relevant for embedders. It is used only by a tool inside chrome/ // that we currently don't use. // See also https://code.google.com/p/chromium/issues/detail?id=110911. const int XWalkExtensionMsgStart = LastIPCMsgStart + 1; #define IPC_MESSAGE_START XWalkExtensionMsgStart IPC_MESSAGE_ROUTED2(XWalkViewHostMsg_PostMessage, // NOLINT(*) std::string /* target extension */, std::string /* contents */) IPC_MESSAGE_ROUTED2(XWalkViewMsg_PostMessage, // NOLINT(*) std::string /* source extension */, std::string /* contents */) IPC_MESSAGE_CONTROL2(XWalkViewMsg_RegisterExtension, // NOLINT(*) std::string /* extension */, std::string /* JS API code for extension */)
// Copyright (c) 2013 Intel Corporation. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include <string> #include "ipc/ipc_message_macros.h" + // Note: it is safe to use numbers after LastIPCMsgStart since that limit + // is not relevant for embedders. It is used only by a tool inside chrome/ + // that we currently don't use. + // See also https://code.google.com/p/chromium/issues/detail?id=110911. + const int XWalkExtensionMsgStart = LastIPCMsgStart + 1; + - #define IPC_MESSAGE_START ExtensionMsgStart + #define IPC_MESSAGE_START XWalkExtensionMsgStart ? +++++ IPC_MESSAGE_ROUTED2(XWalkViewHostMsg_PostMessage, // NOLINT(*) std::string /* target extension */, std::string /* contents */) IPC_MESSAGE_ROUTED2(XWalkViewMsg_PostMessage, // NOLINT(*) std::string /* source extension */, std::string /* contents */) IPC_MESSAGE_CONTROL2(XWalkViewMsg_RegisterExtension, // NOLINT(*) std::string /* extension */, std::string /* JS API code for extension */)
8
0.4
7
1
efdf95441f542150576ff2eb2417d1860b6bd0c9
src/json/fn_plus_numbers_to_function_keys.json.erb
src/json/fn_plus_numbers_to_function_keys.json.erb
<% numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9]; %> { "title": "Map fn + number keys to function keys", "rules": [ { "description": "Map fn + number keys to their corresponding function keys", "manipulators": [ <% numbers.each do |number| %> { "type": "basic", "from": <%= from(number.to_s, ["fn"], []) %>, "to": <%= to([["f#{number}"]]) %> }, <% end %> { "type": "basic", "from": <%= from("0", ["fn"], []) %>, "to": <%= to([["f10"]]) %> }, { "type": "basic", "from": <%= from("hyphen", ["fn"], []) %>, "to": <%= to([["f11"]]) %> }, { "type": "basic", "from": <%= from("equal_sign", ["fn"], []) %>, "to": <%= to([["f12"]]) %> } ] } ] }
<% remap_source_keys = [ '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'hyphen', 'equal_sign' ]; remap_dest_keys = [ 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10', 'f11', 'f12' ]; manipulators = each_key( source_keys_list: remap_source_keys, dest_keys_list: remap_dest_keys, from_mandatory_modifiers: ["fn"], as_json: true ); %> { "title": "Map fn + number keys to function keys", "rules": [ { "description": "Map fn + number keys to their corresponding function keys", "manipulators": <%= manipulators %> } ] }
Use each_key for fn+numbers to function keys
Use each_key for fn+numbers to function keys
HTML+ERB
unlicense
kosukemori/KE-complex_modifications,pqrs-org/KE-complex_modifications,kosukemori/KE-complex_modifications,s-show/KE-complex_modifications,pqrs-org/KE-complex_modifications,kamykaze/KE-complex_modifications,pqrs-org/KE-complex_modifications,kamykaze/KE-complex_modifications,pqrs-org/KE-complex_modifications,kamykaze/KE-complex_modifications,s-show/KE-complex_modifications,pqrs-org/KE-complex_modifications,kamykaze/KE-complex_modifications,s-show/KE-complex_modifications,kosukemori/KE-complex_modifications,pqrs-org/KE-complex_modifications
html+erb
## Code Before: <% numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9]; %> { "title": "Map fn + number keys to function keys", "rules": [ { "description": "Map fn + number keys to their corresponding function keys", "manipulators": [ <% numbers.each do |number| %> { "type": "basic", "from": <%= from(number.to_s, ["fn"], []) %>, "to": <%= to([["f#{number}"]]) %> }, <% end %> { "type": "basic", "from": <%= from("0", ["fn"], []) %>, "to": <%= to([["f10"]]) %> }, { "type": "basic", "from": <%= from("hyphen", ["fn"], []) %>, "to": <%= to([["f11"]]) %> }, { "type": "basic", "from": <%= from("equal_sign", ["fn"], []) %>, "to": <%= to([["f12"]]) %> } ] } ] } ## Instruction: Use each_key for fn+numbers to function keys ## Code After: <% remap_source_keys = [ '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'hyphen', 'equal_sign' ]; remap_dest_keys = [ 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10', 'f11', 'f12' ]; manipulators = each_key( source_keys_list: remap_source_keys, dest_keys_list: remap_dest_keys, from_mandatory_modifiers: ["fn"], as_json: true ); %> { "title": "Map fn + number keys to function keys", "rules": [ { "description": "Map fn + number keys to their corresponding function keys", "manipulators": <%= manipulators %> } ] }
- <% numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9]; %> + <% + remap_source_keys = [ + '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'hyphen', 'equal_sign' + ]; + remap_dest_keys = [ + 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10', 'f11', 'f12' + ]; + manipulators = each_key( + source_keys_list: remap_source_keys, + dest_keys_list: remap_dest_keys, + from_mandatory_modifiers: ["fn"], + as_json: true + ); + %> { "title": "Map fn + number keys to function keys", "rules": [ { "description": "Map fn + number keys to their corresponding function keys", + "manipulators": <%= manipulators %> - "manipulators": [ - <% numbers.each do |number| %> - { - "type": "basic", - "from": <%= from(number.to_s, ["fn"], []) %>, - "to": <%= to([["f#{number}"]]) %> - }, - <% end %> - { - "type": "basic", - "from": <%= from("0", ["fn"], []) %>, - "to": <%= to([["f10"]]) %> - }, - { - "type": "basic", - "from": <%= from("hyphen", ["fn"], []) %>, - "to": <%= to([["f11"]]) %> - }, - { - "type": "basic", - "from": <%= from("equal_sign", ["fn"], []) %>, - "to": <%= to([["f12"]]) %> - } - ] } ] }
40
1.212121
15
25
da40f251c5f884c642b86f13b6d7ed6333eceeb4
pkgs.nix
pkgs.nix
{ pkgs }: rec { # likely-music haskellPackage likely-music-lib = likely-music-backend; likely-music-backend = pkgs.haskellPackages.callPackage ./likely-music-backend.nix { }; likely-music-frontend = pkgs.callPackage ./web { }; }
{ pkgs }: rec { # likely-music haskellPackage likely-music-lib = likely-music-backend; likely-music-backend = pkgs.haskellPackages.callPackage ./likely-music-backend.nix { }; likely-music-frontend = pkgs.callPackage ./web { }; # executable wrapper around everything with correct paths likely-music = pkgs.runCommand "likely-music" { } '' mkdir -p $out/bin source "${pkgs.dieHook}/nix-support/setup-hook" source "${pkgs.makeWrapper}/nix-support/setup-hook" makeWrapper "${likely-music-backend}/bin/likely-music-backend" "$out/bin/likely-music" \ --argv0 likely-music \ --set LIKELY_MUSIC_FRONTEND "${likely-music-frontend}/share/likely-music-frontend" \ --set LIKELY_MUSIC_SYNTH "${fluidsynth-wrapper}/bin/fluidsynth-wrapper" ''; fluidsynth-wrapper = pkgs.writeTextFile { name = "fluidsynth-wrapper"; executable = true; destination = "/bin/fluidsynth-wrapper"; text = '' #!${pkgs.bash}/bin/bash # fluidsynth-wrapper IN.mid OUT.wav if [ -z "$1" -o -z "$2" ]; then echo "$0: missing file parameter(s)" >&2 exit 1 fi ${pkgs.fluidsynth}/bin/fluidsynth -a file -i ${pkgs.soundfont-fluid}/share/soundfonts/FluidR3_GM2-2.sf2 -F "$2" "$1" ''; }; }
Add likely-music pkg (wrapped backend with all deps resolved)
Add likely-music pkg (wrapped backend with all deps resolved) use makeWrapper to wrap likely-music-backend and add the necessesary env vars: * LIKELY_MUSIC_FRONTEND points to likely-music-frontend * LIKELY_MUSIC_SYNTH points to a wrapper script around fluidsynth which accepts just the two necessary options and has soundfont-fluid set up properly.
Nix
agpl-3.0
sternenseemann/likely-music,sternenseemann/likely-music
nix
## Code Before: { pkgs }: rec { # likely-music haskellPackage likely-music-lib = likely-music-backend; likely-music-backend = pkgs.haskellPackages.callPackage ./likely-music-backend.nix { }; likely-music-frontend = pkgs.callPackage ./web { }; } ## Instruction: Add likely-music pkg (wrapped backend with all deps resolved) use makeWrapper to wrap likely-music-backend and add the necessesary env vars: * LIKELY_MUSIC_FRONTEND points to likely-music-frontend * LIKELY_MUSIC_SYNTH points to a wrapper script around fluidsynth which accepts just the two necessary options and has soundfont-fluid set up properly. ## Code After: { pkgs }: rec { # likely-music haskellPackage likely-music-lib = likely-music-backend; likely-music-backend = pkgs.haskellPackages.callPackage ./likely-music-backend.nix { }; likely-music-frontend = pkgs.callPackage ./web { }; # executable wrapper around everything with correct paths likely-music = pkgs.runCommand "likely-music" { } '' mkdir -p $out/bin source "${pkgs.dieHook}/nix-support/setup-hook" source "${pkgs.makeWrapper}/nix-support/setup-hook" makeWrapper "${likely-music-backend}/bin/likely-music-backend" "$out/bin/likely-music" \ --argv0 likely-music \ --set LIKELY_MUSIC_FRONTEND "${likely-music-frontend}/share/likely-music-frontend" \ --set LIKELY_MUSIC_SYNTH "${fluidsynth-wrapper}/bin/fluidsynth-wrapper" ''; fluidsynth-wrapper = pkgs.writeTextFile { name = "fluidsynth-wrapper"; executable = true; destination = "/bin/fluidsynth-wrapper"; text = '' #!${pkgs.bash}/bin/bash # fluidsynth-wrapper IN.mid OUT.wav if [ -z "$1" -o -z "$2" ]; then echo "$0: missing file parameter(s)" >&2 exit 1 fi ${pkgs.fluidsynth}/bin/fluidsynth -a file -i ${pkgs.soundfont-fluid}/share/soundfonts/FluidR3_GM2-2.sf2 -F "$2" "$1" ''; }; }
{ pkgs }: rec { # likely-music haskellPackage likely-music-lib = likely-music-backend; likely-music-backend = pkgs.haskellPackages.callPackage ./likely-music-backend.nix { }; likely-music-frontend = pkgs.callPackage ./web { }; + + # executable wrapper around everything with correct paths + likely-music = pkgs.runCommand "likely-music" { } '' + mkdir -p $out/bin + source "${pkgs.dieHook}/nix-support/setup-hook" + source "${pkgs.makeWrapper}/nix-support/setup-hook" + makeWrapper "${likely-music-backend}/bin/likely-music-backend" "$out/bin/likely-music" \ + --argv0 likely-music \ + --set LIKELY_MUSIC_FRONTEND "${likely-music-frontend}/share/likely-music-frontend" \ + --set LIKELY_MUSIC_SYNTH "${fluidsynth-wrapper}/bin/fluidsynth-wrapper" + ''; + + fluidsynth-wrapper = pkgs.writeTextFile { + name = "fluidsynth-wrapper"; + executable = true; + destination = "/bin/fluidsynth-wrapper"; + text = '' + #!${pkgs.bash}/bin/bash + # fluidsynth-wrapper IN.mid OUT.wav + if [ -z "$1" -o -z "$2" ]; then + echo "$0: missing file parameter(s)" >&2 + exit 1 + fi + ${pkgs.fluidsynth}/bin/fluidsynth -a file -i ${pkgs.soundfont-fluid}/share/soundfonts/FluidR3_GM2-2.sf2 -F "$2" "$1" + ''; + }; }
26
2.888889
26
0
258c56a83c7b6c72d7f23400e568c2a3a2e5cc9f
RELEASE-NOTES.md
RELEASE-NOTES.md
* Make all RuleMethodProcessors public (were package private); document them, change package. * Document all parser/rule annotations. * Rewrite ParserStatistics; add custom matcher. * Depend on mockito, AssertJ for tests. * Add Unicode and UnicodeRange. * Add UnicodeChar and UnicodeRange. * Add dependency on Guava. * ASM 5.0.1: make package work with Java 8. * Implement an InputBuffer over a CharSequence. * Deprecate a lot of packages which are in Guava (in fact, most of them _were_ copied from Guava in the first place). * Make javadoc compatible with Java 8.
* Make all RuleMethodProcessors public (were package private); document them, change package. * Document all parser/rule annotations. * Rewrite ParserStatistics; add custom matcher. * Depend on mockito, AssertJ for tests. * Add UnicodeChar and UnicodeRange. * Add dependency on Guava. * ASM 5.0.1: make package work with Java 8. * Implement an InputBuffer over a CharSequence. * Deprecate a lot of packages which are in Guava (in fact, most of them _were_ copied from Guava in the first place). * Make javadoc compatible with Java 8.
Fix bug in release notes...
Fix bug in release notes...
Markdown
apache-2.0
fge/grappa,fge/grappa
markdown
## Code Before: * Make all RuleMethodProcessors public (were package private); document them, change package. * Document all parser/rule annotations. * Rewrite ParserStatistics; add custom matcher. * Depend on mockito, AssertJ for tests. * Add Unicode and UnicodeRange. * Add UnicodeChar and UnicodeRange. * Add dependency on Guava. * ASM 5.0.1: make package work with Java 8. * Implement an InputBuffer over a CharSequence. * Deprecate a lot of packages which are in Guava (in fact, most of them _were_ copied from Guava in the first place). * Make javadoc compatible with Java 8. ## Instruction: Fix bug in release notes... ## Code After: * Make all RuleMethodProcessors public (were package private); document them, change package. * Document all parser/rule annotations. * Rewrite ParserStatistics; add custom matcher. * Depend on mockito, AssertJ for tests. * Add UnicodeChar and UnicodeRange. * Add dependency on Guava. * ASM 5.0.1: make package work with Java 8. * Implement an InputBuffer over a CharSequence. * Deprecate a lot of packages which are in Guava (in fact, most of them _were_ copied from Guava in the first place). * Make javadoc compatible with Java 8.
* Make all RuleMethodProcessors public (were package private); document them, change package. * Document all parser/rule annotations. * Rewrite ParserStatistics; add custom matcher. * Depend on mockito, AssertJ for tests. - * Add Unicode and UnicodeRange. * Add UnicodeChar and UnicodeRange. * Add dependency on Guava. * ASM 5.0.1: make package work with Java 8. * Implement an InputBuffer over a CharSequence. * Deprecate a lot of packages which are in Guava (in fact, most of them _were_ copied from Guava in the first place). * Make javadoc compatible with Java 8.
1
0.066667
0
1
8e943b82fa162d77eb8acafdd8b22e50da7abd0f
.travis.yml
.travis.yml
language: python sudo: false python: - 2.7 # The apt packages below are needed for sphinx builds. A full list of packages # that can be included can be found here: # # https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise addons: apt: packages: - graphviz - texlive-latex-extra - dvipng env: global: - SETUP_CMD='test' - CONDA_ADDITIONAL='scipy matplotlib networkx scikit-image h5py' - NP_VER=1.10 - ASTRO_VER=1.0 matrix: - SETUP_CMD='egg_info' matrix: include: # Check for sphinx doc build warnings - we do this first because it # may run for a long time - python: 2.7 env: SETUP_CMD='build_sphinx -w' - python: 2.7 env: NP_VER=1.9 ASTRO_VER=1.0 - python: 2.7 env: NP_VER=1.10 ASTRO_VER=1.0 - python: 2.7 env: NP_VER=1.10 ASTRO_VER=1.1 install: - git clone git://github.com/astropy/ci-helpers.git - source ci-helpers/travis/setup_conda_$TRAVIS_OS_NAME.sh script: - python setup.py $SETUP_CMD
language: python sudo: false python: - 2.7 # The apt packages below are needed for sphinx builds. A full list of packages # that can be included can be found here: # # https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise addons: apt: packages: - graphviz - texlive-latex-extra - dvipng env: global: - SETUP_CMD='test' - CONDA_ADDITIONAL='numpy astropy scipy matplotlib networkx scikit-image h5py' - NP_VER=1.10 - ASTRO_VER=1.0 matrix: - SETUP_CMD='egg_info' matrix: include: # Check for sphinx doc build warnings - we do this first because it # may run for a long time - python: 2.7 env: SETUP_CMD='build_sphinx -w' CONDA_ADDITIONAL=$CONDA_ADDITIONAL' mock' - python: 2.7 env: NP_VER=1.9 ASTRO_VER=1.0 - python: 2.7 env: NP_VER=1.10 ASTRO_VER=1.0 - python: 2.7 env: NP_VER=1.10 ASTRO_VER=1.1 install: - git clone git://github.com/astropy/ci-helpers.git - source ci-helpers/travis/setup_conda_$TRAVIS_OS_NAME.sh script: - python setup.py $SETUP_CMD
Install mock for sphinx build
Install mock for sphinx build
YAML
mit
e-koch/FilFinder
yaml
## Code Before: language: python sudo: false python: - 2.7 # The apt packages below are needed for sphinx builds. A full list of packages # that can be included can be found here: # # https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise addons: apt: packages: - graphviz - texlive-latex-extra - dvipng env: global: - SETUP_CMD='test' - CONDA_ADDITIONAL='scipy matplotlib networkx scikit-image h5py' - NP_VER=1.10 - ASTRO_VER=1.0 matrix: - SETUP_CMD='egg_info' matrix: include: # Check for sphinx doc build warnings - we do this first because it # may run for a long time - python: 2.7 env: SETUP_CMD='build_sphinx -w' - python: 2.7 env: NP_VER=1.9 ASTRO_VER=1.0 - python: 2.7 env: NP_VER=1.10 ASTRO_VER=1.0 - python: 2.7 env: NP_VER=1.10 ASTRO_VER=1.1 install: - git clone git://github.com/astropy/ci-helpers.git - source ci-helpers/travis/setup_conda_$TRAVIS_OS_NAME.sh script: - python setup.py $SETUP_CMD ## Instruction: Install mock for sphinx build ## Code After: language: python sudo: false python: - 2.7 # The apt packages below are needed for sphinx builds. A full list of packages # that can be included can be found here: # # https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise addons: apt: packages: - graphviz - texlive-latex-extra - dvipng env: global: - SETUP_CMD='test' - CONDA_ADDITIONAL='numpy astropy scipy matplotlib networkx scikit-image h5py' - NP_VER=1.10 - ASTRO_VER=1.0 matrix: - SETUP_CMD='egg_info' matrix: include: # Check for sphinx doc build warnings - we do this first because it # may run for a long time - python: 2.7 env: SETUP_CMD='build_sphinx -w' CONDA_ADDITIONAL=$CONDA_ADDITIONAL' mock' - python: 2.7 env: NP_VER=1.9 ASTRO_VER=1.0 - python: 2.7 env: NP_VER=1.10 ASTRO_VER=1.0 - python: 2.7 env: NP_VER=1.10 ASTRO_VER=1.1 install: - git clone git://github.com/astropy/ci-helpers.git - source ci-helpers/travis/setup_conda_$TRAVIS_OS_NAME.sh script: - python setup.py $SETUP_CMD
language: python sudo: false python: - 2.7 # The apt packages below are needed for sphinx builds. A full list of packages # that can be included can be found here: # # https://github.com/travis-ci/apt-package-whitelist/blob/master/ubuntu-precise addons: apt: packages: - graphviz - texlive-latex-extra - dvipng env: global: - SETUP_CMD='test' - - CONDA_ADDITIONAL='scipy matplotlib networkx scikit-image h5py' + - CONDA_ADDITIONAL='numpy astropy scipy matplotlib networkx scikit-image h5py' ? ++++++++++++++ - NP_VER=1.10 - ASTRO_VER=1.0 matrix: - SETUP_CMD='egg_info' matrix: include: # Check for sphinx doc build warnings - we do this first because it # may run for a long time - python: 2.7 env: SETUP_CMD='build_sphinx -w' + CONDA_ADDITIONAL=$CONDA_ADDITIONAL' mock' - python: 2.7 env: NP_VER=1.9 ASTRO_VER=1.0 - python: 2.7 env: NP_VER=1.10 ASTRO_VER=1.0 - python: 2.7 env: NP_VER=1.10 ASTRO_VER=1.1 install: - git clone git://github.com/astropy/ci-helpers.git - source ci-helpers/travis/setup_conda_$TRAVIS_OS_NAME.sh script: - python setup.py $SETUP_CMD
3
0.058824
2
1
60f9ff3e6384005741b32d3da669bea49d775670
app/models/nightlight/page.rb
app/models/nightlight/page.rb
module Nightlight class Page < ActiveRecord::Base belongs_to :assignee, class_name: "User" has_many :activities, dependent: :destroy validates :path, presence: true, uniqueness: {scope: :name} scope :hidden, ->{ where hidden: true } scope :unhidden, ->{ where hidden: false } scope :unassigned, ->{ where assignee_id: nil } def to_param [id, name.gsub("'", "").parameterize].join("-") end def brightness if last_checked_at.nil? || last_checked_at < 1.month.ago 0 elsif last_checked_at < 2.weeks.ago 1 elsif last_checked_at < 1.week.ago 2 elsif last_checked_at < 1.day.ago 3 else 4 end end def current_status activities.status.first end def checked! user=nil user ||= assignee activities.checked.where(user: user).create! self.last_checked_at = Time.now self.assignee = nil if user==assignee save! end end end
module Nightlight class Page < ActiveRecord::Base belongs_to :assignee, class_name: "User" has_many :activities, dependent: :destroy validates :path, presence: true, uniqueness: {scope: :name} scope :hidden, ->{ where hidden: true } scope :unhidden, ->{ where hidden: false } scope :unassigned, ->{ where assignee_id: nil } def to_param if name.present? [id, name.gsub("'", "").parameterize].join("-") else id end end def brightness if last_checked_at.nil? || last_checked_at < 1.month.ago 0 elsif last_checked_at < 2.weeks.ago 1 elsif last_checked_at < 1.week.ago 2 elsif last_checked_at < 1.day.ago 3 else 4 end end def current_status activities.status.first end def checked! user=nil user ||= assignee activities.checked.where(user: user).create! self.last_checked_at = Time.now self.assignee = nil if user==assignee save! end end end
Handle to_param case where name is blank
Handle to_param case where name is blank
Ruby
mit
bonsaiben/nightlight,bonsaiben/nightlight,bonsaiben/nightlight
ruby
## Code Before: module Nightlight class Page < ActiveRecord::Base belongs_to :assignee, class_name: "User" has_many :activities, dependent: :destroy validates :path, presence: true, uniqueness: {scope: :name} scope :hidden, ->{ where hidden: true } scope :unhidden, ->{ where hidden: false } scope :unassigned, ->{ where assignee_id: nil } def to_param [id, name.gsub("'", "").parameterize].join("-") end def brightness if last_checked_at.nil? || last_checked_at < 1.month.ago 0 elsif last_checked_at < 2.weeks.ago 1 elsif last_checked_at < 1.week.ago 2 elsif last_checked_at < 1.day.ago 3 else 4 end end def current_status activities.status.first end def checked! user=nil user ||= assignee activities.checked.where(user: user).create! self.last_checked_at = Time.now self.assignee = nil if user==assignee save! end end end ## Instruction: Handle to_param case where name is blank ## Code After: module Nightlight class Page < ActiveRecord::Base belongs_to :assignee, class_name: "User" has_many :activities, dependent: :destroy validates :path, presence: true, uniqueness: {scope: :name} scope :hidden, ->{ where hidden: true } scope :unhidden, ->{ where hidden: false } scope :unassigned, ->{ where assignee_id: nil } def to_param if name.present? [id, name.gsub("'", "").parameterize].join("-") else id end end def brightness if last_checked_at.nil? || last_checked_at < 1.month.ago 0 elsif last_checked_at < 2.weeks.ago 1 elsif last_checked_at < 1.week.ago 2 elsif last_checked_at < 1.day.ago 3 else 4 end end def current_status activities.status.first end def checked! user=nil user ||= assignee activities.checked.where(user: user).create! self.last_checked_at = Time.now self.assignee = nil if user==assignee save! end end end
module Nightlight class Page < ActiveRecord::Base belongs_to :assignee, class_name: "User" has_many :activities, dependent: :destroy validates :path, presence: true, uniqueness: {scope: :name} scope :hidden, ->{ where hidden: true } scope :unhidden, ->{ where hidden: false } scope :unassigned, ->{ where assignee_id: nil } def to_param + if name.present? - [id, name.gsub("'", "").parameterize].join("-") + [id, name.gsub("'", "").parameterize].join("-") ? ++ + else + id + end end def brightness if last_checked_at.nil? || last_checked_at < 1.month.ago 0 elsif last_checked_at < 2.weeks.ago 1 elsif last_checked_at < 1.week.ago 2 elsif last_checked_at < 1.day.ago 3 else 4 end end def current_status activities.status.first end def checked! user=nil user ||= assignee activities.checked.where(user: user).create! self.last_checked_at = Time.now self.assignee = nil if user==assignee save! end end end
6
0.139535
5
1
0d81387322e82f815cf765364cdcffac4e11b885
.travis.yml
.travis.yml
--- sudo: false language: ruby bundler_args: --without system_tests script: "bundle exec rake validate lint spec SPEC_OPTS='--format documentation'" matrix: fast_finish: true include: - rvm: 1.9.3 env: PUPPET_VERSION="~> 2.7.0" - rvm: 1.9.3 env: PUPPET_VERSION="~> 3.1.0" - rvm: 2.0.0 env: PUPPET_VERSION="~> 3.8.0" - rvm: 2.1.4 env: PUPPET_VERSION="~> 4.2.0" notifications: email: false
--- sudo: false language: ruby bundler_args: --without system_tests script: "bundle exec rake validate lint spec SPEC_OPTS='--format documentation'" matrix: fast_finish: true include: - rvm: 1.9.3 env: PUPPET_VERSION="~> 3.1.0" - rvm: 2.0.0 env: PUPPET_VERSION="~> 3.8.0" - rvm: 2.1.4 env: PUPPET_VERSION="~> 4.2.0" notifications: email: false
Remove Puppet 2.7.0 from Travis-CI Build Matrix
Remove Puppet 2.7.0 from Travis-CI Build Matrix Let's not worry about things from five years ago.... Signed-off-by: Trevor Bramwell <9318f446584e3f6cf68dea37a1a9fde63cb30ce1@linuxfoundation.org>
YAML
apache-2.0
bramwelt/puppet-patchwork,bramwelt/puppet-patchwork,bramwelt/puppet-patchwork
yaml
## Code Before: --- sudo: false language: ruby bundler_args: --without system_tests script: "bundle exec rake validate lint spec SPEC_OPTS='--format documentation'" matrix: fast_finish: true include: - rvm: 1.9.3 env: PUPPET_VERSION="~> 2.7.0" - rvm: 1.9.3 env: PUPPET_VERSION="~> 3.1.0" - rvm: 2.0.0 env: PUPPET_VERSION="~> 3.8.0" - rvm: 2.1.4 env: PUPPET_VERSION="~> 4.2.0" notifications: email: false ## Instruction: Remove Puppet 2.7.0 from Travis-CI Build Matrix Let's not worry about things from five years ago.... Signed-off-by: Trevor Bramwell <9318f446584e3f6cf68dea37a1a9fde63cb30ce1@linuxfoundation.org> ## Code After: --- sudo: false language: ruby bundler_args: --without system_tests script: "bundle exec rake validate lint spec SPEC_OPTS='--format documentation'" matrix: fast_finish: true include: - rvm: 1.9.3 env: PUPPET_VERSION="~> 3.1.0" - rvm: 2.0.0 env: PUPPET_VERSION="~> 3.8.0" - rvm: 2.1.4 env: PUPPET_VERSION="~> 4.2.0" notifications: email: false
--- sudo: false language: ruby bundler_args: --without system_tests script: "bundle exec rake validate lint spec SPEC_OPTS='--format documentation'" matrix: fast_finish: true include: - rvm: 1.9.3 - env: PUPPET_VERSION="~> 2.7.0" - - rvm: 1.9.3 env: PUPPET_VERSION="~> 3.1.0" - rvm: 2.0.0 env: PUPPET_VERSION="~> 3.8.0" - rvm: 2.1.4 env: PUPPET_VERSION="~> 4.2.0" notifications: email: false
2
0.1
0
2
86bc92ff5755a7ab85aef402da7bb407a98c28f1
packages/tr/transformers-either.yaml
packages/tr/transformers-either.yaml
homepage: http://github.com/tmcgilchrist/transformers-either/ changelog-type: '' hash: c9ef494c6f3142ee8c0e1c5cc1edc510b8fa62d899b50e65a058e6380e9c13ae test-bench-deps: {} maintainer: Tim McGilchrist <timmcgil@gmail.com> synopsis: An Either monad transformer changelog: '' basic-deps: exceptions: ! '>=0.6 && <0.9' base: ! '>=4.8 && <5' text: ==1.2.* transformers: ! '>=0.4 && <0.6' all-versions: - '0.0.1' - '0.0.2' - '0.1.0' author: Tim McGilchrist <timmcgil@gmail.com> latest: '0.1.0' description-type: haddock description: ! 'Drop in alternative to ExceptT. Uses a pattern synonym to maintain compatibility with the old EitherT types but is actually ExceptT under the covers.' license-name: BSD3
homepage: http://github.com/tmcgilchrist/transformers-either/ changelog-type: '' hash: ec3d6fefd90e243b51aecebfc0ebc5db6381c261d473ea2df7ed7b501a8fb961 test-bench-deps: {} maintainer: Tim McGilchrist <timmcgil@gmail.com> synopsis: An Either monad transformer changelog: '' basic-deps: exceptions: ! '>=0.6 && <0.11' base: ! '>=4.8 && <5' text: ==1.2.* transformers: ! '>=0.4 && <0.6' all-versions: - '0.0.1' - '0.0.2' - '0.1.0' - '0.1.1' author: Tim McGilchrist <timmcgil@gmail.com> latest: '0.1.1' description-type: haddock description: ! 'Drop in alternative to ExceptT. Uses a pattern synonym to maintain compatibility with the old EitherT types but is actually ExceptT under the covers.' license-name: BSD3
Update from Hackage at 2018-05-17T00:49:21Z
Update from Hackage at 2018-05-17T00:49:21Z
YAML
mit
commercialhaskell/all-cabal-metadata
yaml
## Code Before: homepage: http://github.com/tmcgilchrist/transformers-either/ changelog-type: '' hash: c9ef494c6f3142ee8c0e1c5cc1edc510b8fa62d899b50e65a058e6380e9c13ae test-bench-deps: {} maintainer: Tim McGilchrist <timmcgil@gmail.com> synopsis: An Either monad transformer changelog: '' basic-deps: exceptions: ! '>=0.6 && <0.9' base: ! '>=4.8 && <5' text: ==1.2.* transformers: ! '>=0.4 && <0.6' all-versions: - '0.0.1' - '0.0.2' - '0.1.0' author: Tim McGilchrist <timmcgil@gmail.com> latest: '0.1.0' description-type: haddock description: ! 'Drop in alternative to ExceptT. Uses a pattern synonym to maintain compatibility with the old EitherT types but is actually ExceptT under the covers.' license-name: BSD3 ## Instruction: Update from Hackage at 2018-05-17T00:49:21Z ## Code After: homepage: http://github.com/tmcgilchrist/transformers-either/ changelog-type: '' hash: ec3d6fefd90e243b51aecebfc0ebc5db6381c261d473ea2df7ed7b501a8fb961 test-bench-deps: {} maintainer: Tim McGilchrist <timmcgil@gmail.com> synopsis: An Either monad transformer changelog: '' basic-deps: exceptions: ! '>=0.6 && <0.11' base: ! '>=4.8 && <5' text: ==1.2.* transformers: ! '>=0.4 && <0.6' all-versions: - '0.0.1' - '0.0.2' - '0.1.0' - '0.1.1' author: Tim McGilchrist <timmcgil@gmail.com> latest: '0.1.1' description-type: haddock description: ! 'Drop in alternative to ExceptT. Uses a pattern synonym to maintain compatibility with the old EitherT types but is actually ExceptT under the covers.' license-name: BSD3
homepage: http://github.com/tmcgilchrist/transformers-either/ changelog-type: '' - hash: c9ef494c6f3142ee8c0e1c5cc1edc510b8fa62d899b50e65a058e6380e9c13ae + hash: ec3d6fefd90e243b51aecebfc0ebc5db6381c261d473ea2df7ed7b501a8fb961 test-bench-deps: {} maintainer: Tim McGilchrist <timmcgil@gmail.com> synopsis: An Either monad transformer changelog: '' basic-deps: - exceptions: ! '>=0.6 && <0.9' ? ^ + exceptions: ! '>=0.6 && <0.11' ? ^^ base: ! '>=4.8 && <5' text: ==1.2.* transformers: ! '>=0.4 && <0.6' all-versions: - '0.0.1' - '0.0.2' - '0.1.0' + - '0.1.1' author: Tim McGilchrist <timmcgil@gmail.com> - latest: '0.1.0' ? ^ + latest: '0.1.1' ? ^ description-type: haddock description: ! 'Drop in alternative to ExceptT. Uses a pattern synonym to maintain compatibility with the old EitherT types but is actually ExceptT under the covers.' license-name: BSD3
7
0.28
4
3
f1714ea0657c1c29ec945ef69269e1baf3bb020f
app/javascript/packs/call_tool.js
app/javascript/packs/call_tool.js
// @flow import React from 'react'; import { render } from 'react-dom'; import { camelizeKeys } from '../util/util'; import ComponentWrapper from '../components/ComponentWrapper'; import CallToolView from '../call_tool/CallToolView'; window.mountCallTool = (root: string, props: any) => { props = camelizeKeys(props); render( <ComponentWrapper locale={props.locale}> <CallToolView {...props} /> </ComponentWrapper>, document.getElementById(root) ); };
// @flow import React from 'react'; import { render } from 'react-dom'; import { camelizeKeys } from '../util/util'; import ComponentWrapper from '../components/ComponentWrapper'; import CallToolView from '../call_tool/CallToolView'; window.mountCallTool = (root: string, props: any) => { props = camelizeKeys(props); render( <ComponentWrapper locale={props.locale} optimizelyHook={window.optimizelyHook} > <CallToolView {...props} /> </ComponentWrapper>, document.getElementById(root) ); };
Add optimizelyHook to call tool
Add optimizelyHook to call tool
JavaScript
mit
SumOfUs/Champaign,SumOfUs/Champaign,SumOfUs/Champaign,SumOfUs/Champaign,SumOfUs/Champaign
javascript
## Code Before: // @flow import React from 'react'; import { render } from 'react-dom'; import { camelizeKeys } from '../util/util'; import ComponentWrapper from '../components/ComponentWrapper'; import CallToolView from '../call_tool/CallToolView'; window.mountCallTool = (root: string, props: any) => { props = camelizeKeys(props); render( <ComponentWrapper locale={props.locale}> <CallToolView {...props} /> </ComponentWrapper>, document.getElementById(root) ); }; ## Instruction: Add optimizelyHook to call tool ## Code After: // @flow import React from 'react'; import { render } from 'react-dom'; import { camelizeKeys } from '../util/util'; import ComponentWrapper from '../components/ComponentWrapper'; import CallToolView from '../call_tool/CallToolView'; window.mountCallTool = (root: string, props: any) => { props = camelizeKeys(props); render( <ComponentWrapper locale={props.locale} optimizelyHook={window.optimizelyHook} > <CallToolView {...props} /> </ComponentWrapper>, document.getElementById(root) ); };
// @flow import React from 'react'; import { render } from 'react-dom'; import { camelizeKeys } from '../util/util'; import ComponentWrapper from '../components/ComponentWrapper'; import CallToolView from '../call_tool/CallToolView'; window.mountCallTool = (root: string, props: any) => { props = camelizeKeys(props); render( - <ComponentWrapper locale={props.locale}> + <ComponentWrapper + locale={props.locale} + optimizelyHook={window.optimizelyHook} + > <CallToolView {...props} /> </ComponentWrapper>, document.getElementById(root) ); };
5
0.294118
4
1
0753dd4d50d5acb21d8f108a5b369384202b2f26
etc/eb/docker-compose.yml
etc/eb/docker-compose.yml
version: '3.8' services: onboarding-service: image: "641866833894.dkr.ecr.eu-central-1.amazonaws.com/onboarding-service:${hash}" ports: - 5000:5000 volumes: - /home/webapp/keystore.p12:/keystore.p12 - /home/webapp/truststore.jks:/truststore.jks env_file: - .env nginx: image: nginx:latest volumes: - /etc/nginx/nginx.conf:/etc/nginx/nginx.conf - /tmp/fullchain.pem:/tmp/fullchain.pem - /tmp/privkey.pem:/tmp/privkey.pem - /tmp/id.crt:/tmp/id.crt - /tmp/dhparam.pem:/tmp/dhparam.pem - /etc/nginx/conf.d/01_ssl_proxy.conf:/etc/nginx/conf.d/01_ssl_proxy.conf ports: - 80:80 - 443:443
version: '3.8' services: onboarding-service: image: "641866833894.dkr.ecr.eu-central-1.amazonaws.com/onboarding-service:${hash}" ports: - 5000:5000 volumes: - /home/webapp/keystore.p12:/keystore.p12 - /home/webapp/truststore.jks:/truststore.jks env_file: - .env nginx: image: public.ecr.aws/nginx/nginx:latest volumes: - /etc/nginx/nginx.conf:/etc/nginx/nginx.conf - /tmp/fullchain.pem:/tmp/fullchain.pem - /tmp/privkey.pem:/tmp/privkey.pem - /tmp/id.crt:/tmp/id.crt - /tmp/dhparam.pem:/tmp/dhparam.pem - /etc/nginx/conf.d/01_ssl_proxy.conf:/etc/nginx/conf.d/01_ssl_proxy.conf ports: - 80:80 - 443:443
Move from from docker hub to amazon elastic container registry
Move from from docker hub to amazon elastic container registry
YAML
mit
TulevaEE/onboarding-service,TulevaEE/onboarding-service,TulevaEE/onboarding-service,TulevaEE/onboarding-service
yaml
## Code Before: version: '3.8' services: onboarding-service: image: "641866833894.dkr.ecr.eu-central-1.amazonaws.com/onboarding-service:${hash}" ports: - 5000:5000 volumes: - /home/webapp/keystore.p12:/keystore.p12 - /home/webapp/truststore.jks:/truststore.jks env_file: - .env nginx: image: nginx:latest volumes: - /etc/nginx/nginx.conf:/etc/nginx/nginx.conf - /tmp/fullchain.pem:/tmp/fullchain.pem - /tmp/privkey.pem:/tmp/privkey.pem - /tmp/id.crt:/tmp/id.crt - /tmp/dhparam.pem:/tmp/dhparam.pem - /etc/nginx/conf.d/01_ssl_proxy.conf:/etc/nginx/conf.d/01_ssl_proxy.conf ports: - 80:80 - 443:443 ## Instruction: Move from from docker hub to amazon elastic container registry ## Code After: version: '3.8' services: onboarding-service: image: "641866833894.dkr.ecr.eu-central-1.amazonaws.com/onboarding-service:${hash}" ports: - 5000:5000 volumes: - /home/webapp/keystore.p12:/keystore.p12 - /home/webapp/truststore.jks:/truststore.jks env_file: - .env nginx: image: public.ecr.aws/nginx/nginx:latest volumes: - /etc/nginx/nginx.conf:/etc/nginx/nginx.conf - /tmp/fullchain.pem:/tmp/fullchain.pem - /tmp/privkey.pem:/tmp/privkey.pem - /tmp/id.crt:/tmp/id.crt - /tmp/dhparam.pem:/tmp/dhparam.pem - /etc/nginx/conf.d/01_ssl_proxy.conf:/etc/nginx/conf.d/01_ssl_proxy.conf ports: - 80:80 - 443:443
version: '3.8' services: onboarding-service: image: "641866833894.dkr.ecr.eu-central-1.amazonaws.com/onboarding-service:${hash}" ports: - 5000:5000 volumes: - /home/webapp/keystore.p12:/keystore.p12 - /home/webapp/truststore.jks:/truststore.jks env_file: - .env nginx: - image: nginx:latest + image: public.ecr.aws/nginx/nginx:latest volumes: - /etc/nginx/nginx.conf:/etc/nginx/nginx.conf - /tmp/fullchain.pem:/tmp/fullchain.pem - /tmp/privkey.pem:/tmp/privkey.pem - /tmp/id.crt:/tmp/id.crt - /tmp/dhparam.pem:/tmp/dhparam.pem - /etc/nginx/conf.d/01_ssl_proxy.conf:/etc/nginx/conf.d/01_ssl_proxy.conf ports: - 80:80 - 443:443
2
0.083333
1
1
4d85c0348fba577782cabe910617d06558c772b6
twitter-clone/app/controllers/tweets_controller.rb
twitter-clone/app/controllers/tweets_controller.rb
class TweetsController < ApplicationController def index @tweets = Tweet.all @hashtags = Hashtag.all @users = User.all - current_user.followeds @following = Following.new end def new @tweet = Tweet.new end def create @tweet = Tweet.new(tweet_params) @tweet.creator_id = current_user.id @tweet.retweet_count = 0 @tweet.like_count = 0 if @tweet.save redirect_to tweets_path else render :new end end private def tweet_params params.require(:tweet).permit(:content, :image) end end
class TweetsController < ApplicationController def index @tweets = Tweet.all @hashtags = Hashtag.order('count').limit(5) @users = User.all - current_user.followeds @following = Following.new end def new @tweet = Tweet.new end def create @tweet = Tweet.new(tweet_params) @tweet.creator_id = current_user.id @tweet.retweet_count = 0 @tweet.like_count = 0 if @tweet.save redirect_to tweets_path else render :new end end private def tweet_params params.require(:tweet).permit(:content, :image) end end
Order and limit trending hashtags
Order and limit trending hashtags
Ruby
mit
sfinkenhdz/twitter-clone,sfinkenhdz/twitter-clone,sfinkenhdz/twitter-clone
ruby
## Code Before: class TweetsController < ApplicationController def index @tweets = Tweet.all @hashtags = Hashtag.all @users = User.all - current_user.followeds @following = Following.new end def new @tweet = Tweet.new end def create @tweet = Tweet.new(tweet_params) @tweet.creator_id = current_user.id @tweet.retweet_count = 0 @tweet.like_count = 0 if @tweet.save redirect_to tweets_path else render :new end end private def tweet_params params.require(:tweet).permit(:content, :image) end end ## Instruction: Order and limit trending hashtags ## Code After: class TweetsController < ApplicationController def index @tweets = Tweet.all @hashtags = Hashtag.order('count').limit(5) @users = User.all - current_user.followeds @following = Following.new end def new @tweet = Tweet.new end def create @tweet = Tweet.new(tweet_params) @tweet.creator_id = current_user.id @tweet.retweet_count = 0 @tweet.like_count = 0 if @tweet.save redirect_to tweets_path else render :new end end private def tweet_params params.require(:tweet).permit(:content, :image) end end
class TweetsController < ApplicationController def index @tweets = Tweet.all - @hashtags = Hashtag.all + @hashtags = Hashtag.order('count').limit(5) @users = User.all - current_user.followeds @following = Following.new end def new @tweet = Tweet.new end def create @tweet = Tweet.new(tweet_params) @tweet.creator_id = current_user.id @tweet.retweet_count = 0 @tweet.like_count = 0 if @tweet.save redirect_to tweets_path else render :new end end private def tweet_params params.require(:tweet).permit(:content, :image) end end
2
0.058824
1
1
0f7ba6290696e1ce75e42327fdfc4f9eae8614c3
pdfdocument/utils.py
pdfdocument/utils.py
from datetime import date import re from django.db.models import Max, Min from django.http import HttpResponse from pdfdocument.document import PDFDocument def worklog_period(obj): activity_period = obj.worklogentries.aggregate(Max('date'), Min('date')) article_period = obj.articleentries.aggregate(Max('date'), Min('date')) min_date = date(1900, 1, 1) max_date = date(3000, 1, 1) if not (activity_period['date__min'] or article_period['date__min']): return (min_date, max_date) start = min(activity_period['date__min'] or max_date, article_period['date__min'] or max_date) end = max(activity_period['date__max'] or min_date, article_period['date__max'] or min_date) return (start, end) def worklog_period_string(obj): start, end = obj.worklog_period() return u'%s - %s' % (start.strftime('%d.%m.%Y'), end.strftime('%d.%m.%Y')) FILENAME_RE = re.compile(r'[^A-Za-z0-9\-\.]+') def pdf_response(filename): response = HttpResponse(mimetype='application/pdf') response['Content-Disposition'] = 'attachment; filename=%s.pdf' %\ FILENAME_RE.sub('-', filename) return PDFDocument(response), response
from datetime import date import re from django.db.models import Max, Min from django.http import HttpResponse from pdfdocument.document import PDFDocument def worklog_period(obj): activity_period = obj.worklogentries.aggregate(Max('date'), Min('date')) article_period = obj.articleentries.aggregate(Max('date'), Min('date')) min_date = date(1900, 1, 1) max_date = date(3000, 1, 1) if not (activity_period['date__min'] or article_period['date__min']): return (min_date, max_date) start = min(activity_period['date__min'] or max_date, article_period['date__min'] or max_date) end = max(activity_period['date__max'] or min_date, article_period['date__max'] or min_date) return (start, end) def worklog_period_string(obj): start, end = obj.worklog_period() return u'%s - %s' % (start.strftime('%d.%m.%Y'), end.strftime('%d.%m.%Y')) FILENAME_RE = re.compile(r'[^A-Za-z0-9\-\.]+') def pdf_response(filename, **kwargs): response = HttpResponse(mimetype='application/pdf') response['Content-Disposition'] = 'attachment; filename=%s.pdf' %\ FILENAME_RE.sub('-', filename) return PDFDocument(response, **kwargs), response
Allow passing initialization kwargs to PDFDocument through pdf_response
Allow passing initialization kwargs to PDFDocument through pdf_response
Python
bsd-3-clause
matthiask/pdfdocument,dongguangming/pdfdocument
python
## Code Before: from datetime import date import re from django.db.models import Max, Min from django.http import HttpResponse from pdfdocument.document import PDFDocument def worklog_period(obj): activity_period = obj.worklogentries.aggregate(Max('date'), Min('date')) article_period = obj.articleentries.aggregate(Max('date'), Min('date')) min_date = date(1900, 1, 1) max_date = date(3000, 1, 1) if not (activity_period['date__min'] or article_period['date__min']): return (min_date, max_date) start = min(activity_period['date__min'] or max_date, article_period['date__min'] or max_date) end = max(activity_period['date__max'] or min_date, article_period['date__max'] or min_date) return (start, end) def worklog_period_string(obj): start, end = obj.worklog_period() return u'%s - %s' % (start.strftime('%d.%m.%Y'), end.strftime('%d.%m.%Y')) FILENAME_RE = re.compile(r'[^A-Za-z0-9\-\.]+') def pdf_response(filename): response = HttpResponse(mimetype='application/pdf') response['Content-Disposition'] = 'attachment; filename=%s.pdf' %\ FILENAME_RE.sub('-', filename) return PDFDocument(response), response ## Instruction: Allow passing initialization kwargs to PDFDocument through pdf_response ## Code After: from datetime import date import re from django.db.models import Max, Min from django.http import HttpResponse from pdfdocument.document import PDFDocument def worklog_period(obj): activity_period = obj.worklogentries.aggregate(Max('date'), Min('date')) article_period = obj.articleentries.aggregate(Max('date'), Min('date')) min_date = date(1900, 1, 1) max_date = date(3000, 1, 1) if not (activity_period['date__min'] or article_period['date__min']): return (min_date, max_date) start = min(activity_period['date__min'] or max_date, article_period['date__min'] or max_date) end = max(activity_period['date__max'] or min_date, article_period['date__max'] or min_date) return (start, end) def worklog_period_string(obj): start, end = obj.worklog_period() return u'%s - %s' % (start.strftime('%d.%m.%Y'), end.strftime('%d.%m.%Y')) FILENAME_RE = re.compile(r'[^A-Za-z0-9\-\.]+') def pdf_response(filename, **kwargs): response = HttpResponse(mimetype='application/pdf') response['Content-Disposition'] = 'attachment; filename=%s.pdf' %\ FILENAME_RE.sub('-', filename) return PDFDocument(response, **kwargs), response
from datetime import date import re from django.db.models import Max, Min from django.http import HttpResponse from pdfdocument.document import PDFDocument def worklog_period(obj): activity_period = obj.worklogentries.aggregate(Max('date'), Min('date')) article_period = obj.articleentries.aggregate(Max('date'), Min('date')) min_date = date(1900, 1, 1) max_date = date(3000, 1, 1) if not (activity_period['date__min'] or article_period['date__min']): return (min_date, max_date) start = min(activity_period['date__min'] or max_date, article_period['date__min'] or max_date) end = max(activity_period['date__max'] or min_date, article_period['date__max'] or min_date) return (start, end) def worklog_period_string(obj): start, end = obj.worklog_period() return u'%s - %s' % (start.strftime('%d.%m.%Y'), end.strftime('%d.%m.%Y')) FILENAME_RE = re.compile(r'[^A-Za-z0-9\-\.]+') - def pdf_response(filename): + def pdf_response(filename, **kwargs): ? ++++++++++ response = HttpResponse(mimetype='application/pdf') response['Content-Disposition'] = 'attachment; filename=%s.pdf' %\ FILENAME_RE.sub('-', filename) - return PDFDocument(response), response + return PDFDocument(response, **kwargs), response ? ++++++++++
4
0.102564
2
2