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
fae5db20daa1e7bcb1b915ce7f3ca84ae8bd4a1f
client/scripts/install-plugin.py
client/scripts/install-plugin.py
import argparse, shutil, os import ue4util def install_plugin(project_file, plugin_folder): project_folder = os.path.dirname(project_file) install_folder = os.path.join(project_folder, 'Plugins', 'unrealcv') if os.path.isdir(install_folder): shutil.rmtree(install_folder) # Complete remove old version, a little dangerous shutil.copytree(plugin_folder, install_folder) if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('plugin_version') parser.add_argument('project_file') args = parser.parse_args() plugin_version = args.plugin_version project_file = ue4util.get_real_abspath(args.project_file) plugin_folder = 'built_plugin/%s' % plugin_version install_plugin(project_file, plugin_folder)
import argparse, shutil, os import ue4util def install_plugin(project_file, plugin_folder): project_folder = os.path.dirname(project_file) install_folder = os.path.join(project_folder, 'Plugins', 'unrealcv') if os.path.isdir(install_folder): shutil.rmtree(install_folder) # Complete remove old version, a little dangerous shutil.copytree(plugin_folder, install_folder) if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('plugin_version') parser.add_argument('project_file') args = parser.parse_args() plugin_version = args.plugin_version project_file = ue4util.get_real_abspath(args.project_file) cur_dir = os.path.dirname(os.path.abspath(__file__)) plugin_folder = os.path.join(cur_dir, 'built_plugin/%s' % plugin_version) install_plugin(project_file, plugin_folder)
Update relative path with respect to __file__
Update relative path with respect to __file__
Python
mit
qiuwch/unrealcv,qiuwch/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv,qiuwch/unrealcv,unrealcv/unrealcv,qiuwch/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv,qiuwch/unrealcv,qiuwch/unrealcv
python
## Code Before: import argparse, shutil, os import ue4util def install_plugin(project_file, plugin_folder): project_folder = os.path.dirname(project_file) install_folder = os.path.join(project_folder, 'Plugins', 'unrealcv') if os.path.isdir(install_folder): shutil.rmtree(install_folder) # Complete remove old version, a little dangerous shutil.copytree(plugin_folder, install_folder) if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('plugin_version') parser.add_argument('project_file') args = parser.parse_args() plugin_version = args.plugin_version project_file = ue4util.get_real_abspath(args.project_file) plugin_folder = 'built_plugin/%s' % plugin_version install_plugin(project_file, plugin_folder) ## Instruction: Update relative path with respect to __file__ ## Code After: import argparse, shutil, os import ue4util def install_plugin(project_file, plugin_folder): project_folder = os.path.dirname(project_file) install_folder = os.path.join(project_folder, 'Plugins', 'unrealcv') if os.path.isdir(install_folder): shutil.rmtree(install_folder) # Complete remove old version, a little dangerous shutil.copytree(plugin_folder, install_folder) if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('plugin_version') parser.add_argument('project_file') args = parser.parse_args() plugin_version = args.plugin_version project_file = ue4util.get_real_abspath(args.project_file) cur_dir = os.path.dirname(os.path.abspath(__file__)) plugin_folder = os.path.join(cur_dir, 'built_plugin/%s' % plugin_version) install_plugin(project_file, plugin_folder)
import argparse, shutil, os import ue4util def install_plugin(project_file, plugin_folder): project_folder = os.path.dirname(project_file) install_folder = os.path.join(project_folder, 'Plugins', 'unrealcv') if os.path.isdir(install_folder): shutil.rmtree(install_folder) # Complete remove old version, a little dangerous shutil.copytree(plugin_folder, install_folder) if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('plugin_version') parser.add_argument('project_file') args = parser.parse_args() plugin_version = args.plugin_version project_file = ue4util.get_real_abspath(args.project_file) + cur_dir = os.path.dirname(os.path.abspath(__file__)) - plugin_folder = 'built_plugin/%s' % plugin_version + plugin_folder = os.path.join(cur_dir, 'built_plugin/%s' % plugin_version) ? ++++++++++++++++++++++ + install_plugin(project_file, plugin_folder)
3
0.136364
2
1
4c4664b9107e485baf90861f006a31538418993e
README.md
README.md
An open-source metronome that just works. Cool features: - Works offline using HTML5 Application Cache - Can "add to home screen" on iOS and Android to use as fullscreen apps ___ - Made by [Jon](https://lasercar.github.io) - [LICENSE.txt](https://github.com/simplemetronome/simplemetronome.github.io/blob/master/LICENSE.txt) (MIT License) - [CREDITS.md](https://github.com/simplemetronome/simplemetronome.github.io/blob/master/CREDITS.md) (Sounds, Libraries)
An open-source metronome that just works. - Made by [Jon](https://lasercar.github.io) Features: - Uses CSS animation - Works offline using HTML5 Application Cache - Can "add to home screen" on iOS and Android to use as fullscreen apps ___ - [LICENSE.txt](https://github.com/simplemetronome/simplemetronome.github.io/blob/master/LICENSE.txt) (MIT License) - [CREDITS.md](https://github.com/simplemetronome/simplemetronome.github.io/blob/master/CREDITS.md) (Sounds, Libraries)
Move "Made by" higher up in readme
Move "Made by" higher up in readme Makes it readable on mobile github without clicking "View all of README"
Markdown
mit
SimpleMetronome/simplemetronome.github.io
markdown
## Code Before: An open-source metronome that just works. Cool features: - Works offline using HTML5 Application Cache - Can "add to home screen" on iOS and Android to use as fullscreen apps ___ - Made by [Jon](https://lasercar.github.io) - [LICENSE.txt](https://github.com/simplemetronome/simplemetronome.github.io/blob/master/LICENSE.txt) (MIT License) - [CREDITS.md](https://github.com/simplemetronome/simplemetronome.github.io/blob/master/CREDITS.md) (Sounds, Libraries) ## Instruction: Move "Made by" higher up in readme Makes it readable on mobile github without clicking "View all of README" ## Code After: An open-source metronome that just works. - Made by [Jon](https://lasercar.github.io) Features: - Uses CSS animation - Works offline using HTML5 Application Cache - Can "add to home screen" on iOS and Android to use as fullscreen apps ___ - [LICENSE.txt](https://github.com/simplemetronome/simplemetronome.github.io/blob/master/LICENSE.txt) (MIT License) - [CREDITS.md](https://github.com/simplemetronome/simplemetronome.github.io/blob/master/CREDITS.md) (Sounds, Libraries)
An open-source metronome that just works. - Cool features: + - Made by [Jon](https://lasercar.github.io) + + Features: + - Uses CSS animation - Works offline using HTML5 Application Cache - Can "add to home screen" on iOS and Android to use as fullscreen apps ___ - - Made by [Jon](https://lasercar.github.io) - [LICENSE.txt](https://github.com/simplemetronome/simplemetronome.github.io/blob/master/LICENSE.txt) (MIT License) - [CREDITS.md](https://github.com/simplemetronome/simplemetronome.github.io/blob/master/CREDITS.md) (Sounds, Libraries)
6
0.545455
4
2
48ef0f93c6bc570aeddf2d5f72399be0c2b5fb4b
_up.sh
_up.sh
PORT=$1 bundle exec ruby app.rb -p $PORT
PORT=$1 bundle exec ruby app.rb -p $PORT # for production # bundle exec ruby app.rb -p $PORT -e production
Add command example for production
Add command example for production
Shell
mit
sonota88/sinatra-skelton,sonota88/sinatra-skelton,sonota88/sinatra-skelton,sonota88/sinatra-skelton
shell
## Code Before: PORT=$1 bundle exec ruby app.rb -p $PORT ## Instruction: Add command example for production ## Code After: PORT=$1 bundle exec ruby app.rb -p $PORT # for production # bundle exec ruby app.rb -p $PORT -e production
PORT=$1 bundle exec ruby app.rb -p $PORT + + # for production + # bundle exec ruby app.rb -p $PORT -e production
3
0.75
3
0
b96dab3bcd836277e9fc91d1ed4f0714e70becd4
articles/_posts/2006-03-30-developers-gone-wild-opera-web-apps-blog.md
articles/_posts/2006-03-30-developers-gone-wild-opera-web-apps-blog.md
--- title: 'Developers Gone Wild: Opera Web Applications Team Starts Blog' authors: - thomas-ford tags: - webapps - opera-9 - labs layout: article --- Opera has been hard at work creating a browser that acts as a platform for Web applications. Our first step in realizing this new world was taken with the launch of Opera Platform, the first mobile AJAX framework. Then we turned our attention to the desktop browser. In Opera 9 Technology Preview 2, we added support for Opera Widgets. Opera Widgets extend and expand the browser’s functionality in dramatic ways. The team behind many of these innovations tired of laboring away in obscurity and decided to start a [blog][1]. We invite you to see what new developments they’re working on add your voice to the discussion. [Visit Opera Web Applications Team Blog][1]. [1]: http://my.opera.com/webapplications/
--- title: 'Developers Gone Wild: Opera Web Applications Team Starts Blog' authors: - thomas-ford intro: 'Opera has been hard at work creating a browser that acts as a platform for Web applications. Our first step in realizing this new world was taken with the launch of Opera Platform, the first mobile Ajax framework. Then we turned our attention to the desktop browser. In Opera 9 Technology Preview 2, we added support for Opera Widgets. Opera Widgets extend and expand the browser’s functionality in dramatic ways.' tags: - webapps - opera-9 - labs layout: article --- Opera has been hard at work creating a browser that acts as a platform for Web applications. Our first step in realizing this new world was taken with the launch of Opera Platform, the first mobile AJAX framework. Then we turned our attention to the desktop browser. In Opera 9 Technology Preview 2, we added support for Opera Widgets. Opera Widgets extend and expand the browser’s functionality in dramatic ways. The team behind many of these innovations tired of laboring away in obscurity and decided to start a [blog][1]. We invite you to see what new developments they’re working on add your voice to the discussion. [Visit Opera Web Applications Team Blog][1]. [1]: http://my.opera.com/webapplications/
Add intro for article “Developers Gone Wild: Opera Web Applications Team Starts Blog”
Add intro for article “Developers Gone Wild: Opera Web Applications Team Starts Blog” Ref. #19.
Markdown
apache-2.0
payeldillip/devopera,Mtmotahar/devopera,kenarai/devopera,kenarai/devopera,shwetank/devopera,Jasenpan1987/devopera,cvan/devopera,SelenIT/devopera,kenarai/devopera,Mtmotahar/devopera,Jasenpan1987/devopera,operasoftware/devopera,michaelstewart/devopera,Jasenpan1987/devopera,michaelstewart/devopera,andreasbovens/devopera,shwetank/devopera,Mtmotahar/devopera,paulirish/devopera,cvan/devopera,operasoftware/devopera,SelenIT/devopera,paulirish/devopera,cvan/devopera,payeldillip/devopera,andreasbovens/devopera,simevidas/devopera,paulirish/devopera,erikmaarten/devopera,initaldk/devopera,operasoftware/devopera,michaelstewart/devopera,erikmaarten/devopera,simevidas/devopera,shwetank/devopera,kenarai/devopera,andreasbovens/devopera,cvan/devopera,payeldillip/devopera,michaelstewart/devopera,initaldk/devopera,payeldillip/devopera,erikmaarten/devopera,initaldk/devopera,simevidas/devopera,operasoftware/devopera,Jasenpan1987/devopera,SelenIT/devopera,SelenIT/devopera,paulirish/devopera,Mtmotahar/devopera,initaldk/devopera,simevidas/devopera,erikmaarten/devopera
markdown
## Code Before: --- title: 'Developers Gone Wild: Opera Web Applications Team Starts Blog' authors: - thomas-ford tags: - webapps - opera-9 - labs layout: article --- Opera has been hard at work creating a browser that acts as a platform for Web applications. Our first step in realizing this new world was taken with the launch of Opera Platform, the first mobile AJAX framework. Then we turned our attention to the desktop browser. In Opera 9 Technology Preview 2, we added support for Opera Widgets. Opera Widgets extend and expand the browser’s functionality in dramatic ways. The team behind many of these innovations tired of laboring away in obscurity and decided to start a [blog][1]. We invite you to see what new developments they’re working on add your voice to the discussion. [Visit Opera Web Applications Team Blog][1]. [1]: http://my.opera.com/webapplications/ ## Instruction: Add intro for article “Developers Gone Wild: Opera Web Applications Team Starts Blog” Ref. #19. ## Code After: --- title: 'Developers Gone Wild: Opera Web Applications Team Starts Blog' authors: - thomas-ford intro: 'Opera has been hard at work creating a browser that acts as a platform for Web applications. Our first step in realizing this new world was taken with the launch of Opera Platform, the first mobile Ajax framework. Then we turned our attention to the desktop browser. In Opera 9 Technology Preview 2, we added support for Opera Widgets. Opera Widgets extend and expand the browser’s functionality in dramatic ways.' tags: - webapps - opera-9 - labs layout: article --- Opera has been hard at work creating a browser that acts as a platform for Web applications. Our first step in realizing this new world was taken with the launch of Opera Platform, the first mobile AJAX framework. Then we turned our attention to the desktop browser. In Opera 9 Technology Preview 2, we added support for Opera Widgets. Opera Widgets extend and expand the browser’s functionality in dramatic ways. The team behind many of these innovations tired of laboring away in obscurity and decided to start a [blog][1]. We invite you to see what new developments they’re working on add your voice to the discussion. [Visit Opera Web Applications Team Blog][1]. [1]: http://my.opera.com/webapplications/
--- title: 'Developers Gone Wild: Opera Web Applications Team Starts Blog' authors: - thomas-ford + intro: 'Opera has been hard at work creating a browser that acts as a platform for Web applications. Our first step in realizing this new world was taken with the launch of Opera Platform, the first mobile Ajax framework. Then we turned our attention to the desktop browser. In Opera 9 Technology Preview 2, we added support for Opera Widgets. Opera Widgets extend and expand the browser’s functionality in dramatic ways.' tags: - webapps - opera-9 - labs layout: article --- Opera has been hard at work creating a browser that acts as a platform for Web applications. Our first step in realizing this new world was taken with the launch of Opera Platform, the first mobile AJAX framework. Then we turned our attention to the desktop browser. In Opera 9 Technology Preview 2, we added support for Opera Widgets. Opera Widgets extend and expand the browser’s functionality in dramatic ways. The team behind many of these innovations tired of laboring away in obscurity and decided to start a [blog][1]. We invite you to see what new developments they’re working on add your voice to the discussion. [Visit Opera Web Applications Team Blog][1]. [1]: http://my.opera.com/webapplications/
1
0.0625
1
0
0a078a7649a27614731b15a0f3867f7e025452e3
website/app/application/core/projects/project/project-controller.js
website/app/application/core/projects/project/project-controller.js
Application.Controllers.controller('projectsProject', ["$scope", "provStep", "ui", "project", "current", "pubsub", projectsProject]); function projectsProject ($scope, provStep, ui, project, current, pubsub) { $scope.isActive = function (tab) { return tab === $scope.activeTab; }; current.setProject(project); pubsub.send("sidebar.project"); provStep.addProject(project.id); $scope.project = project; $scope.showTabs = function() { return ui.showToolbarTabs(project.id); }; $scope.showFiles = function() { return ui.showFiles(project.id); }; }
Application.Controllers.controller('projectsProject', ["$scope", "provStep", "ui", "project", "current", "pubsub", "recent", projectsProject]); function projectsProject ($scope, provStep, ui, project, current, pubsub, recent) { recent.resetLast(project.id); current.setProject(project); pubsub.send("sidebar.project"); provStep.addProject(project.id); $scope.project = project; $scope.showTabs = function() { return ui.showToolbarTabs(project.id); }; $scope.showFiles = function() { return ui.showFiles(project.id); }; $scope.isActive = function (tab) { return tab === $scope.activeTab; }; }
Move code around to put functions at bottom.
Move code around to put functions at bottom.
JavaScript
mit
materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org
javascript
## Code Before: Application.Controllers.controller('projectsProject', ["$scope", "provStep", "ui", "project", "current", "pubsub", projectsProject]); function projectsProject ($scope, provStep, ui, project, current, pubsub) { $scope.isActive = function (tab) { return tab === $scope.activeTab; }; current.setProject(project); pubsub.send("sidebar.project"); provStep.addProject(project.id); $scope.project = project; $scope.showTabs = function() { return ui.showToolbarTabs(project.id); }; $scope.showFiles = function() { return ui.showFiles(project.id); }; } ## Instruction: Move code around to put functions at bottom. ## Code After: Application.Controllers.controller('projectsProject', ["$scope", "provStep", "ui", "project", "current", "pubsub", "recent", projectsProject]); function projectsProject ($scope, provStep, ui, project, current, pubsub, recent) { recent.resetLast(project.id); current.setProject(project); pubsub.send("sidebar.project"); provStep.addProject(project.id); $scope.project = project; $scope.showTabs = function() { return ui.showToolbarTabs(project.id); }; $scope.showFiles = function() { return ui.showFiles(project.id); }; $scope.isActive = function (tab) { return tab === $scope.activeTab; }; }
Application.Controllers.controller('projectsProject', ["$scope", "provStep", "ui", - "project", "current", "pubsub", projectsProject]); ? ^ -- ^^^^^^^^^^^ + "project", "current", "pubsub", "recent", ? ^ ++ ^^ + projectsProject]); - function projectsProject ($scope, provStep, ui, project, current, pubsub) { + function projectsProject ($scope, provStep, ui, project, current, pubsub, recent) { ? ++++++++ + recent.resetLast(project.id); - $scope.isActive = function (tab) { - return tab === $scope.activeTab; - }; current.setProject(project); pubsub.send("sidebar.project"); provStep.addProject(project.id); $scope.project = project; $scope.showTabs = function() { return ui.showToolbarTabs(project.id); }; $scope.showFiles = function() { return ui.showFiles(project.id); }; + + $scope.isActive = function (tab) { + return tab === $scope.activeTab; + }; }
13
0.565217
8
5
0e62a14420769195ed6dbc3fb5eb1cc39caad7ae
README.md
README.md
This repository provide frameworks in various language to do integration test that calls bazel and analyze its output.
This repository provide frameworks in various language to do integration test that calls bazel and analyze its output. __To do before it can be considered as usable__: - Document - Switch docker_rules to it - Switch eclipse plugin to it - Switch Bazel to it
Add a to do list before landing
Add a to do list before landing
Markdown
apache-2.0
bazelbuild/bazel-integration-testing,bazelbuild/bazel-integration-testing,bazelbuild/bazel-integration-testing
markdown
## Code Before: This repository provide frameworks in various language to do integration test that calls bazel and analyze its output. ## Instruction: Add a to do list before landing ## Code After: This repository provide frameworks in various language to do integration test that calls bazel and analyze its output. __To do before it can be considered as usable__: - Document - Switch docker_rules to it - Switch eclipse plugin to it - Switch Bazel to it
This repository provide frameworks in various language to do integration test that calls bazel and analyze its output. + __To do before it can be considered as usable__: + - Document + - Switch docker_rules to it + - Switch eclipse plugin to it + - Switch Bazel to it +
6
1.2
6
0
61849da47e71859eebee049a7bb5e997ddd4b449
settings.json
settings.json
{ "C_Cpp.intelliSenseEngine": "Default", "editor.autoClosingBrackets": false, "editor.fontFamily": "'Fira Code', Consolas", "editor.fontLigatures": true, "editor.formatOnPaste": true, "editor.formatOnSave": true, "editor.formatOnType": true, "files.associations": { "*.txx": "cpp", "*.sql": "pgsql" }, "files.trimTrailingWhitespace": true, "files.insertFinalNewline": true, "java.errors.incompleteClasspath.severity": "ignore", "python.formatting.autopep8Args": [ "--max-line-length", "260" ], "python.linting.flake8Enabled": true, "python.linting.pylintEnabled": false, "rust-client.setup_build_tasks_automatically": false, "rust-client.showStdErr": true, "rust-client.revealOutputChannelOn": "warn", "telemetry.enableCrashReporter": false, "telemetry.enableTelemetry": false, "workbench.colorTheme": "Default Light+", "workbench.editor.enablePreview": false, "window.zoomLevel": 0 }
{ "C_Cpp.intelliSenseEngine": "Default", "editor.autoClosingBrackets": false, "editor.fontFamily": "'Fira Code', Consolas", "editor.fontLigatures": true, "editor.formatOnPaste": true, "editor.formatOnSave": true, "editor.formatOnType": true, "files.associations": { "*.txx": "cpp", "*.sql": "pgsql" }, "files.trimTrailingWhitespace": true, "files.insertFinalNewline": true, "java.errors.incompleteClasspath.severity": "ignore", "python.formatting.autopep8Args": [ "--max-line-length", "260" ], "python.linting.flake8Enabled": true, "python.linting.pylintEnabled": false, "rust-client.showStdErr": true, "rust-client.revealOutputChannelOn": "warn", "telemetry.enableCrashReporter": false, "telemetry.enableTelemetry": false, "workbench.colorTheme": "Default Light+", "workbench.editor.enablePreview": false, "window.zoomLevel": 0 }
Remove rust-client setting that no longer exists
Remove rust-client setting that no longer exists
JSON
mit
GrayShade/dotfiles,lnicola/dotfiles,lnicola/dotfiles
json
## Code Before: { "C_Cpp.intelliSenseEngine": "Default", "editor.autoClosingBrackets": false, "editor.fontFamily": "'Fira Code', Consolas", "editor.fontLigatures": true, "editor.formatOnPaste": true, "editor.formatOnSave": true, "editor.formatOnType": true, "files.associations": { "*.txx": "cpp", "*.sql": "pgsql" }, "files.trimTrailingWhitespace": true, "files.insertFinalNewline": true, "java.errors.incompleteClasspath.severity": "ignore", "python.formatting.autopep8Args": [ "--max-line-length", "260" ], "python.linting.flake8Enabled": true, "python.linting.pylintEnabled": false, "rust-client.setup_build_tasks_automatically": false, "rust-client.showStdErr": true, "rust-client.revealOutputChannelOn": "warn", "telemetry.enableCrashReporter": false, "telemetry.enableTelemetry": false, "workbench.colorTheme": "Default Light+", "workbench.editor.enablePreview": false, "window.zoomLevel": 0 } ## Instruction: Remove rust-client setting that no longer exists ## Code After: { "C_Cpp.intelliSenseEngine": "Default", "editor.autoClosingBrackets": false, "editor.fontFamily": "'Fira Code', Consolas", "editor.fontLigatures": true, "editor.formatOnPaste": true, "editor.formatOnSave": true, "editor.formatOnType": true, "files.associations": { "*.txx": "cpp", "*.sql": "pgsql" }, "files.trimTrailingWhitespace": true, "files.insertFinalNewline": true, "java.errors.incompleteClasspath.severity": "ignore", "python.formatting.autopep8Args": [ "--max-line-length", "260" ], "python.linting.flake8Enabled": true, "python.linting.pylintEnabled": false, "rust-client.showStdErr": true, "rust-client.revealOutputChannelOn": "warn", "telemetry.enableCrashReporter": false, "telemetry.enableTelemetry": false, "workbench.colorTheme": "Default Light+", "workbench.editor.enablePreview": false, "window.zoomLevel": 0 }
{ "C_Cpp.intelliSenseEngine": "Default", "editor.autoClosingBrackets": false, "editor.fontFamily": "'Fira Code', Consolas", "editor.fontLigatures": true, "editor.formatOnPaste": true, "editor.formatOnSave": true, "editor.formatOnType": true, "files.associations": { "*.txx": "cpp", "*.sql": "pgsql" }, "files.trimTrailingWhitespace": true, "files.insertFinalNewline": true, "java.errors.incompleteClasspath.severity": "ignore", "python.formatting.autopep8Args": [ "--max-line-length", "260" ], "python.linting.flake8Enabled": true, "python.linting.pylintEnabled": false, - "rust-client.setup_build_tasks_automatically": false, "rust-client.showStdErr": true, "rust-client.revealOutputChannelOn": "warn", "telemetry.enableCrashReporter": false, "telemetry.enableTelemetry": false, "workbench.colorTheme": "Default Light+", "workbench.editor.enablePreview": false, "window.zoomLevel": 0 }
1
0.033333
0
1
139a3615b976cd3779ee7a8e6472a0c9db946b9a
app/views/shared/_footer.html.haml
app/views/shared/_footer.html.haml
.container %p.text-muted.credit - if current_user.andand.current_timesheet .time-left-to-submit-timesheet
.container %p.text-muted.credit - unless current_user.andand.current_timesheet.andand.submitted? .time-left-to-submit-timesheet
Remove counter if user has submitted his time sheet
Remove counter if user has submitted his time sheet
Haml
mit
danevron/hours-report-app,danevron/hours-report-app,danevron/hours-report-app
haml
## Code Before: .container %p.text-muted.credit - if current_user.andand.current_timesheet .time-left-to-submit-timesheet ## Instruction: Remove counter if user has submitted his time sheet ## Code After: .container %p.text-muted.credit - unless current_user.andand.current_timesheet.andand.submitted? .time-left-to-submit-timesheet
.container %p.text-muted.credit - - if current_user.andand.current_timesheet ? ^^ + - unless current_user.andand.current_timesheet.andand.submitted? ? ^^^^^^ ++++++++++++++++++ .time-left-to-submit-timesheet
2
0.5
1
1
5d8ca3498d794ab264377b1bc31f52fcd97210ba
setup.py
setup.py
import setuptools setuptools.setup( name="jack-select", version="0.1", url="https://github.com/SpotlightKid/jack-select", author="Christopher Arndt", author_email="chris@chrisarndt.de", description="A systray app to set the JACK configuration from QJackCtl " "presets via DBus", keywords="JACK,systray,GTK", packages=setuptools.find_packages(), include_package_data=True, install_requires=[ 'PyGObject', 'dbus-python', 'pyxdg' ], entry_points = { 'console_scripts': [ 'jack-select = jackselect.jackselect:main', ] }, classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: End users', 'License :: OSI Approved :: MIT License', 'Operating System :: POSIX', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Environment :: X11 Applications :: GTK', 'Topic :: Multimedia :: Sound/Audio' ], )
import setuptools setuptools.setup( name="jack-select", version="0.1b1", url="https://github.com/SpotlightKid/jack-select", author="Christopher Arndt", author_email="chris@chrisarndt.de", description="A systray app to set the JACK configuration from QJackCtl " "presets via DBus", keywords="JACK,systray,GTK,DBus,audio", packages=setuptools.find_packages(), include_package_data=True, install_requires=[ 'PyGObject', 'dbus-python', 'pyxdg' ], entry_points = { 'console_scripts': [ 'jack-select = jackselect.jackselect:main', ] }, classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: End users', 'License :: OSI Approved :: MIT License', 'Operating System :: POSIX', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Environment :: X11 Applications :: GTK', 'Topic :: Multimedia :: Sound/Audio' ], )
Add b1 to version number; add more keywords
Add b1 to version number; add more keywords
Python
mit
SpotlightKid/jack-select,SpotlightKid/jack-select
python
## Code Before: import setuptools setuptools.setup( name="jack-select", version="0.1", url="https://github.com/SpotlightKid/jack-select", author="Christopher Arndt", author_email="chris@chrisarndt.de", description="A systray app to set the JACK configuration from QJackCtl " "presets via DBus", keywords="JACK,systray,GTK", packages=setuptools.find_packages(), include_package_data=True, install_requires=[ 'PyGObject', 'dbus-python', 'pyxdg' ], entry_points = { 'console_scripts': [ 'jack-select = jackselect.jackselect:main', ] }, classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: End users', 'License :: OSI Approved :: MIT License', 'Operating System :: POSIX', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Environment :: X11 Applications :: GTK', 'Topic :: Multimedia :: Sound/Audio' ], ) ## Instruction: Add b1 to version number; add more keywords ## Code After: import setuptools setuptools.setup( name="jack-select", version="0.1b1", url="https://github.com/SpotlightKid/jack-select", author="Christopher Arndt", author_email="chris@chrisarndt.de", description="A systray app to set the JACK configuration from QJackCtl " "presets via DBus", keywords="JACK,systray,GTK,DBus,audio", packages=setuptools.find_packages(), include_package_data=True, install_requires=[ 'PyGObject', 'dbus-python', 'pyxdg' ], entry_points = { 'console_scripts': [ 'jack-select = jackselect.jackselect:main', ] }, classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: End users', 'License :: OSI Approved :: MIT License', 'Operating System :: POSIX', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Environment :: X11 Applications :: GTK', 'Topic :: Multimedia :: Sound/Audio' ], )
import setuptools setuptools.setup( name="jack-select", - version="0.1", + version="0.1b1", ? ++ url="https://github.com/SpotlightKid/jack-select", author="Christopher Arndt", author_email="chris@chrisarndt.de", description="A systray app to set the JACK configuration from QJackCtl " "presets via DBus", - keywords="JACK,systray,GTK", + keywords="JACK,systray,GTK,DBus,audio", ? +++++++++++ packages=setuptools.find_packages(), include_package_data=True, install_requires=[ 'PyGObject', 'dbus-python', 'pyxdg' ], entry_points = { 'console_scripts': [ 'jack-select = jackselect.jackselect:main', ] }, classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: End users', 'License :: OSI Approved :: MIT License', 'Operating System :: POSIX', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Environment :: X11 Applications :: GTK', 'Topic :: Multimedia :: Sound/Audio' ], )
4
0.105263
2
2
37a0cb41a88114ab9edb514e29447756b0c3e92a
tests/test_cli.py
tests/test_cli.py
from click.testing import CliRunner import pytest from cibopath.cli import main from cibopath import __version__ runner = CliRunner() @pytest.fixture(params=['-V', '--version']) def version_cli_flag(request): return request.param def test_cli_group_version_option(version_cli_flag): result = runner.invoke(main, [version_cli_flag]) assert result.exit_code == 0 assert result.output == 'cibopath, version {}\n'.format(__version__)
import pytest from cibopath import __version__ @pytest.fixture(params=['-V', '--version']) def version_cli_flag(request): return request.param def test_cli_group_version_option(cli_runner, version_cli_flag): result = cli_runner([version_cli_flag]) assert result.exit_code == 0 assert result.output == 'cibopath, version {}\n'.format(__version__)
Use cli_runner fixture in test
Use cli_runner fixture in test
Python
bsd-3-clause
hackebrot/cibopath
python
## Code Before: from click.testing import CliRunner import pytest from cibopath.cli import main from cibopath import __version__ runner = CliRunner() @pytest.fixture(params=['-V', '--version']) def version_cli_flag(request): return request.param def test_cli_group_version_option(version_cli_flag): result = runner.invoke(main, [version_cli_flag]) assert result.exit_code == 0 assert result.output == 'cibopath, version {}\n'.format(__version__) ## Instruction: Use cli_runner fixture in test ## Code After: import pytest from cibopath import __version__ @pytest.fixture(params=['-V', '--version']) def version_cli_flag(request): return request.param def test_cli_group_version_option(cli_runner, version_cli_flag): result = cli_runner([version_cli_flag]) assert result.exit_code == 0 assert result.output == 'cibopath, version {}\n'.format(__version__)
- from click.testing import CliRunner import pytest - from cibopath.cli import main from cibopath import __version__ - - runner = CliRunner() @pytest.fixture(params=['-V', '--version']) def version_cli_flag(request): return request.param - def test_cli_group_version_option(version_cli_flag): + def test_cli_group_version_option(cli_runner, version_cli_flag): ? ++++++++++++ - result = runner.invoke(main, [version_cli_flag]) ? ------- ------ + result = cli_runner([version_cli_flag]) ? ++++ assert result.exit_code == 0 assert result.output == 'cibopath, version {}\n'.format(__version__)
8
0.421053
2
6
49a7968e51ce850428936fb2fc66c905ce8b8998
head1stpython/Chapter3/sketch.py
head1stpython/Chapter3/sketch.py
import os os.chdir('/home/israel/Development/Python_Exercises/python-octo-wookie/head1stpython/Chapter3') #Change path for the current directory data = open('sketch.txt') #Start iteration over the text file for each_line in data: try: (role, line_spoken) = each_line.split(':', 1) print(role, end = '') print(' said: ', end = '') print(line_spoken, end = '') except: pass data.close()
import os #Change path for the current directory os.chdir('/home/israel/Development/Python_Exercises/python-octo-wookie/head1stpython/Chapter3') #Check if file exists if os.path.exists('sketch.txt'): #Load the text file into 'data' variable data = open('sketch.txt') #Start iteration over the text file for each_line in data: #We use try/except to handle errors that can occur with bad input try: (role, line_spoken) = each_line.split(':', 1) print(role, end = '') print(' said: ', end = '') print(line_spoken, end = '') except: pass #After all the iteration and printing, we close the file data.close() #If file does exists, we simply quit and display an error for the user/dev else: print('The data file is missing!')
Validate if the file exists (if/else)
Validate if the file exists (if/else)
Python
unlicense
israelzuniga/python-octo-wookie
python
## Code Before: import os os.chdir('/home/israel/Development/Python_Exercises/python-octo-wookie/head1stpython/Chapter3') #Change path for the current directory data = open('sketch.txt') #Start iteration over the text file for each_line in data: try: (role, line_spoken) = each_line.split(':', 1) print(role, end = '') print(' said: ', end = '') print(line_spoken, end = '') except: pass data.close() ## Instruction: Validate if the file exists (if/else) ## Code After: import os #Change path for the current directory os.chdir('/home/israel/Development/Python_Exercises/python-octo-wookie/head1stpython/Chapter3') #Check if file exists if os.path.exists('sketch.txt'): #Load the text file into 'data' variable data = open('sketch.txt') #Start iteration over the text file for each_line in data: #We use try/except to handle errors that can occur with bad input try: (role, line_spoken) = each_line.split(':', 1) print(role, end = '') print(' said: ', end = '') print(line_spoken, end = '') except: pass #After all the iteration and printing, we close the file data.close() #If file does exists, we simply quit and display an error for the user/dev else: print('The data file is missing!')
import os + #Change path for the current directory os.chdir('/home/israel/Development/Python_Exercises/python-octo-wookie/head1stpython/Chapter3') - #Change path for the current directory + #Check if file exists + if os.path.exists('sketch.txt'): + + #Load the text file into 'data' variable - data = open('sketch.txt') + data = open('sketch.txt') ? ++++ + #Start iteration over the text file + for each_line in data: + #We use try/except to handle errors that can occur with bad input + try: + (role, line_spoken) = each_line.split(':', 1) + print(role, end = '') + print(' said: ', end = '') + print(line_spoken, end = '') + except: + pass + #After all the iteration and printing, we close the file + data.close() - #Start iteration over the text file - for each_line in data: - try: - (role, line_spoken) = each_line.split(':', 1) - print(role, end = '') - print(' said: ', end = '') - print(line_spoken, end = '') - except: - pass - data.close() + #If file does exists, we simply quit and display an error for the user/dev + else: + print('The data file is missing!')
33
1.65
21
12
7074e05d85774a69375aee84effc8e367dc73d90
README.md
README.md
A boilerplate for running a Webpack workflow in Node express Please read the following article: [The ultimate Webpack setup](http://www.christianalfoni.com/articles/2015_04_19_The-ultimate-webpack-setup) to know more about this boilerplate. ## Major update to project Inspired by [this project](https://github.com/vesparny/react-kickstart) and the evolving of [react-transform](https://github.com/gaearon/react-transform-boilerplate) and [CSS Modules]((http://glenmaddern.com/articles/css-modules)), this project has gotten a major upgrade. **NOTE!** Use the latest version of Node, 4.x.x. ## Install and Running `git clone https://github.com/christianalfoni/webpack-express-boilerplate.git` or just export the files: `svn export https://github.com/christianalfoni/webpack-express-boilerplate/trunk ./dir` 1. cd webpack-express-boilerplate 2. npm install 3. npm start 4. navigate to http://localhost:3000 in your browser of choice. ## Overview ### React by default The project runs with React by default and hot replacement of changes to the modules. Currently it is on 0.14.3. ### CSS Modules CSS files loaded into components are locally scoped and you can point to class names with javascript. You can also compose classes together, also from other files. These are also hot loaded. Read more about them [here](http://glenmaddern.com/articles/css-modules). To turn off CSS Modules remove it from the `webpack.config.js` file. ### Babel and Linting Both Node server and frontend code runs with Babel. And all of it is linted. With atom you install the `linter` package, then `linter-eslint` and `linter-jscs`. You are covered. Also run `npm run eslint` or `npm run jscs` to verify all files. I would recommend installing `language-babel` package too for syntax highlighting ### Beautify With a beautify package installed in your editor it will also do that
React app that let's you manage discogs tracks for djing
Update readme with basic description
Update readme with basic description
Markdown
mit
jackokerman/discogs-dj,jackokerman/discogs-dj,jackokerman/react-discogs-dj,jackokerman/react-discogs-dj
markdown
## Code Before: A boilerplate for running a Webpack workflow in Node express Please read the following article: [The ultimate Webpack setup](http://www.christianalfoni.com/articles/2015_04_19_The-ultimate-webpack-setup) to know more about this boilerplate. ## Major update to project Inspired by [this project](https://github.com/vesparny/react-kickstart) and the evolving of [react-transform](https://github.com/gaearon/react-transform-boilerplate) and [CSS Modules]((http://glenmaddern.com/articles/css-modules)), this project has gotten a major upgrade. **NOTE!** Use the latest version of Node, 4.x.x. ## Install and Running `git clone https://github.com/christianalfoni/webpack-express-boilerplate.git` or just export the files: `svn export https://github.com/christianalfoni/webpack-express-boilerplate/trunk ./dir` 1. cd webpack-express-boilerplate 2. npm install 3. npm start 4. navigate to http://localhost:3000 in your browser of choice. ## Overview ### React by default The project runs with React by default and hot replacement of changes to the modules. Currently it is on 0.14.3. ### CSS Modules CSS files loaded into components are locally scoped and you can point to class names with javascript. You can also compose classes together, also from other files. These are also hot loaded. Read more about them [here](http://glenmaddern.com/articles/css-modules). To turn off CSS Modules remove it from the `webpack.config.js` file. ### Babel and Linting Both Node server and frontend code runs with Babel. And all of it is linted. With atom you install the `linter` package, then `linter-eslint` and `linter-jscs`. You are covered. Also run `npm run eslint` or `npm run jscs` to verify all files. I would recommend installing `language-babel` package too for syntax highlighting ### Beautify With a beautify package installed in your editor it will also do that ## Instruction: Update readme with basic description ## Code After: React app that let's you manage discogs tracks for djing
+ React app that let's you manage discogs tracks for djing - A boilerplate for running a Webpack workflow in Node express - - Please read the following article: [The ultimate Webpack setup](http://www.christianalfoni.com/articles/2015_04_19_The-ultimate-webpack-setup) to know more about this boilerplate. - - ## Major update to project - Inspired by [this project](https://github.com/vesparny/react-kickstart) and the evolving of [react-transform](https://github.com/gaearon/react-transform-boilerplate) and [CSS Modules]((http://glenmaddern.com/articles/css-modules)), this project has gotten a major upgrade. - - **NOTE!** Use the latest version of Node, 4.x.x. - - ## Install and Running - `git clone https://github.com/christianalfoni/webpack-express-boilerplate.git` - - or just export the files: - - `svn export https://github.com/christianalfoni/webpack-express-boilerplate/trunk ./dir` - - 1. cd webpack-express-boilerplate - 2. npm install - 3. npm start - 4. navigate to http://localhost:3000 in your browser of choice. - - - ## Overview - - ### React by default - The project runs with React by default and hot replacement of changes to the modules. Currently it is on 0.14.3. - - ### CSS Modules - CSS files loaded into components are locally scoped and you can point to class names with javascript. You can also compose classes together, also from other files. These are also hot loaded. Read more about them [here](http://glenmaddern.com/articles/css-modules). - - To turn off CSS Modules remove it from the `webpack.config.js` file. - - ### Babel and Linting - Both Node server and frontend code runs with Babel. And all of it is linted. With atom you install the `linter` package, then `linter-eslint` and `linter-jscs`. You are covered. Also run `npm run eslint` or `npm run jscs` to verify all files. I would recommend installing `language-babel` package too for syntax highlighting - - ### Beautify - With a beautify package installed in your editor it will also do that
38
1.027027
1
37
1922df3771ff349a998e3ba91f12a6785327d54e
Compiler/Platforms/LangPython/Resources/LibraryRegistry.txt
Compiler/Platforms/LangPython/Resources/LibraryRegistry.txt
class Library: def __init__(self, name, manifestFunction): self.name = name self.manifestFunction = manifestFunction class LibraryRegistry: def __init__(self, libraries): self.libraries = {} self.manifestFunctions = {} for name in libraries.keys(): canonicalName = name.lower() try: self.manifestFunctions[canonicalName] = libraries[name].v_lib_manifest_RegisterFunctions fnFinderFn = self.createFnFinderFn(libraries[name]) TranslationHelper_registerFunctionFinder(fnFinderFn) except: print("Invalid library: ", name) def loadLibrary(self, name, ver): canonicalName = name.lower() manifestFunction = self.manifestFunctions.get(canonicalName) if manifestFunction != None: self.libraries[canonicalName] = Library(canonicalName, manifestFunction) return 0 def getLibrary(self, name): return self.libraries.get(name.lower()) def createFnFinderFn(self, lib): def fnFinderFn(name): fnName = 'v_' + name.split(',')[-1] for fn in dir(lib): if fn == fnName: return eval('lib.' + fn) return None return fnFinderFn
class Library: def __init__(self, name, manifestFunction): self.name = name self.manifestFunction = manifestFunction class LibraryRegistry: def __init__(self, libraries): self.libraries = {} for name in libraries.keys(): canonicalName = name.lower() try: fnFinderFn = self.createFnFinderFn(libraries[name]) TranslationHelper_registerFunctionFinder(fnFinderFn) except: print("Invalid library: ", name) def loadLibrary(self, name, ver): canonicalName = name.lower() manifestFunction = self.manifestFunctions.get(canonicalName) if manifestFunction != None: self.libraries[canonicalName] = Library(canonicalName, manifestFunction) return 0 def getLibrary(self, name): return self.libraries.get(name.lower()) def createFnFinderFn(self, lib): def fnFinderFn(name): fnName = 'v_' + name.split(',')[-1] for fn in dir(lib): if fn == fnName: return eval('lib.' + fn) return None return fnFinderFn
Fix Python regression where library required a manifest function to be considered valid.
Fix Python regression where library required a manifest function to be considered valid.
Text
mit
blakeohare/crayon,blakeohare/crayon,blakeohare/crayon,blakeohare/crayon,blakeohare/crayon,blakeohare/crayon,blakeohare/crayon,blakeohare/crayon
text
## Code Before: class Library: def __init__(self, name, manifestFunction): self.name = name self.manifestFunction = manifestFunction class LibraryRegistry: def __init__(self, libraries): self.libraries = {} self.manifestFunctions = {} for name in libraries.keys(): canonicalName = name.lower() try: self.manifestFunctions[canonicalName] = libraries[name].v_lib_manifest_RegisterFunctions fnFinderFn = self.createFnFinderFn(libraries[name]) TranslationHelper_registerFunctionFinder(fnFinderFn) except: print("Invalid library: ", name) def loadLibrary(self, name, ver): canonicalName = name.lower() manifestFunction = self.manifestFunctions.get(canonicalName) if manifestFunction != None: self.libraries[canonicalName] = Library(canonicalName, manifestFunction) return 0 def getLibrary(self, name): return self.libraries.get(name.lower()) def createFnFinderFn(self, lib): def fnFinderFn(name): fnName = 'v_' + name.split(',')[-1] for fn in dir(lib): if fn == fnName: return eval('lib.' + fn) return None return fnFinderFn ## Instruction: Fix Python regression where library required a manifest function to be considered valid. ## Code After: class Library: def __init__(self, name, manifestFunction): self.name = name self.manifestFunction = manifestFunction class LibraryRegistry: def __init__(self, libraries): self.libraries = {} for name in libraries.keys(): canonicalName = name.lower() try: fnFinderFn = self.createFnFinderFn(libraries[name]) TranslationHelper_registerFunctionFinder(fnFinderFn) except: print("Invalid library: ", name) def loadLibrary(self, name, ver): canonicalName = name.lower() manifestFunction = self.manifestFunctions.get(canonicalName) if manifestFunction != None: self.libraries[canonicalName] = Library(canonicalName, manifestFunction) return 0 def getLibrary(self, name): return self.libraries.get(name.lower()) def createFnFinderFn(self, lib): def fnFinderFn(name): fnName = 'v_' + name.split(',')[-1] for fn in dir(lib): if fn == fnName: return eval('lib.' + fn) return None return fnFinderFn
class Library: def __init__(self, name, manifestFunction): self.name = name self.manifestFunction = manifestFunction class LibraryRegistry: def __init__(self, libraries): self.libraries = {} - self.manifestFunctions = {} for name in libraries.keys(): canonicalName = name.lower() try: - self.manifestFunctions[canonicalName] = libraries[name].v_lib_manifest_RegisterFunctions fnFinderFn = self.createFnFinderFn(libraries[name]) TranslationHelper_registerFunctionFinder(fnFinderFn) except: print("Invalid library: ", name) def loadLibrary(self, name, ver): canonicalName = name.lower() manifestFunction = self.manifestFunctions.get(canonicalName) if manifestFunction != None: self.libraries[canonicalName] = Library(canonicalName, manifestFunction) return 0 def getLibrary(self, name): return self.libraries.get(name.lower()) def createFnFinderFn(self, lib): def fnFinderFn(name): fnName = 'v_' + name.split(',')[-1] for fn in dir(lib): if fn == fnName: return eval('lib.' + fn) return None return fnFinderFn
2
0.055556
0
2
f4ef339852feab8d6141601d62c4740aedee7929
app/views/auth/sessions/new.html.haml
app/views/auth/sessions/new.html.haml
- content_for :page_title do = t('auth.login') = simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| .omniauth .block-button.omniauth-pixiv = t('simple_form.labels.omniauth_pixiv.signin') .separate= t('simple_form.labels.omniauth.or') = f.input :email, autofocus: true, placeholder: t('simple_form.labels.defaults.email'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.email') } = f.input :password, placeholder: t('simple_form.labels.defaults.password'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.password') } .actions = f.button :button, t('auth.login'), type: :submit .form-footer= render "auth/shared/links"
- content_for :page_title do = t('auth.login') = simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| .omniauth - if %w(iPhone Safari).all? { |keyword| request.user_agent.include? keyword } - query = { return_to: user_pixiv_omniauth_authorize_url }.to_query - link = "#{ENV['ACCOUNT_PIXIV_LOGIN_URL']}?#{query}" = link_to t('simple_form.labels.omniauth_pixiv.signin'), link, class: 'block-button' - else .block-button.omniauth-pixiv = t('simple_form.labels.omniauth_pixiv.signin') .separate= t('simple_form.labels.omniauth.or') = f.input :email, autofocus: true, placeholder: t('simple_form.labels.defaults.email'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.email') } = f.input :password, placeholder: t('simple_form.labels.defaults.password'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.password') } .actions = f.button :button, t('auth.login'), type: :submit .form-footer= render "auth/shared/links"
Split pixiv auth button for iOS App
Split pixiv auth button for iOS App
Haml
agpl-3.0
pixiv/mastodon,pixiv/mastodon,pixiv/mastodon,pixiv/mastodon
haml
## Code Before: - content_for :page_title do = t('auth.login') = simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| .omniauth .block-button.omniauth-pixiv = t('simple_form.labels.omniauth_pixiv.signin') .separate= t('simple_form.labels.omniauth.or') = f.input :email, autofocus: true, placeholder: t('simple_form.labels.defaults.email'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.email') } = f.input :password, placeholder: t('simple_form.labels.defaults.password'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.password') } .actions = f.button :button, t('auth.login'), type: :submit .form-footer= render "auth/shared/links" ## Instruction: Split pixiv auth button for iOS App ## Code After: - content_for :page_title do = t('auth.login') = simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| .omniauth - if %w(iPhone Safari).all? { |keyword| request.user_agent.include? keyword } - query = { return_to: user_pixiv_omniauth_authorize_url }.to_query - link = "#{ENV['ACCOUNT_PIXIV_LOGIN_URL']}?#{query}" = link_to t('simple_form.labels.omniauth_pixiv.signin'), link, class: 'block-button' - else .block-button.omniauth-pixiv = t('simple_form.labels.omniauth_pixiv.signin') .separate= t('simple_form.labels.omniauth.or') = f.input :email, autofocus: true, placeholder: t('simple_form.labels.defaults.email'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.email') } = f.input :password, placeholder: t('simple_form.labels.defaults.password'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.password') } .actions = f.button :button, t('auth.login'), type: :submit .form-footer= render "auth/shared/links"
- content_for :page_title do = t('auth.login') = simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| .omniauth + - if %w(iPhone Safari).all? { |keyword| request.user_agent.include? keyword } + - query = { return_to: user_pixiv_omniauth_authorize_url }.to_query + - link = "#{ENV['ACCOUNT_PIXIV_LOGIN_URL']}?#{query}" + = link_to t('simple_form.labels.omniauth_pixiv.signin'), link, class: 'block-button' + - else - .block-button.omniauth-pixiv + .block-button.omniauth-pixiv ? ++ - = t('simple_form.labels.omniauth_pixiv.signin') + = t('simple_form.labels.omniauth_pixiv.signin') ? ++ .separate= t('simple_form.labels.omniauth.or') = f.input :email, autofocus: true, placeholder: t('simple_form.labels.defaults.email'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.email') } = f.input :password, placeholder: t('simple_form.labels.defaults.password'), required: true, input_html: { 'aria-label' => t('simple_form.labels.defaults.password') } .actions = f.button :button, t('auth.login'), type: :submit .form-footer= render "auth/shared/links"
9
0.529412
7
2
92c856b1c9c39b856e2d0f7eff2d331608014c14
app/controllers/cdx/admin/users_controller.rb
app/controllers/cdx/admin/users_controller.rb
module Cdx module Admin class UsersController < ResourceController end end end
module Cdx module Admin class UsersController < ResourceController before_action :update_without_password, only: :update private def update_without_password if params[:user][:password].blank? params[:user].delete('password') params[:user].delete('password_confirmation') end end end end end
Allow update user without password
Allow update user without password
Ruby
mit
alexandre025/cdx,alexandre025/cdx,alexandre025/cdx
ruby
## Code Before: module Cdx module Admin class UsersController < ResourceController end end end ## Instruction: Allow update user without password ## Code After: module Cdx module Admin class UsersController < ResourceController before_action :update_without_password, only: :update private def update_without_password if params[:user][:password].blank? params[:user].delete('password') params[:user].delete('password_confirmation') end end end end end
module Cdx module Admin class UsersController < ResourceController + before_action :update_without_password, only: :update + + private + + def update_without_password + if params[:user][:password].blank? + params[:user].delete('password') + params[:user].delete('password_confirmation') + end + end + end end end
11
1.571429
11
0
5d516e0c5ab4ba1741d6a6d498008a9fd7c217b7
requirements/base.txt
requirements/base.txt
Django==1.9.1 psycopg2==2.5.4 django-leaflet gunicorn==19.3.0 requests[security] xlrd djangorestframework==3.3.2 djangorestframework-csv==1.4.1 django-rest-swagger==0.3.5 django-cors-headers==1.1.0 openpyxl==2.3.3 numpy==1.10.4 pandas==0.17.1 scipy==0.17.0 django-allauth==0.25.2 premailer django-anymail django-crispy-forms
Django==1.9.1 psycopg2==2.5.4 django-leaflet gunicorn==19.3.0 requests[security] xlrd djangorestframework==3.3.2 djangorestframework-csv==1.4.1 django-rest-swagger==0.3.5 django-cors-headers==1.1.0 openpyxl==2.3.3 numpy==1.10.4 pandas==0.17.1 scipy==0.17.0 django-allauth==0.25.2 premailer -e git@github.com:anymail/django-anymail.git#egg=django-anymail django-crispy-forms
Use python 2.7.3-compatible fork of anymail
Use python 2.7.3-compatible fork of anymail (awaiting PR to be merged)
Text
mit
annapowellsmith/openpresc,ebmdatalab/openprescribing,ebmdatalab/openprescribing,ebmdatalab/openprescribing,ebmdatalab/openprescribing,annapowellsmith/openpresc,annapowellsmith/openpresc,annapowellsmith/openpresc
text
## Code Before: Django==1.9.1 psycopg2==2.5.4 django-leaflet gunicorn==19.3.0 requests[security] xlrd djangorestframework==3.3.2 djangorestframework-csv==1.4.1 django-rest-swagger==0.3.5 django-cors-headers==1.1.0 openpyxl==2.3.3 numpy==1.10.4 pandas==0.17.1 scipy==0.17.0 django-allauth==0.25.2 premailer django-anymail django-crispy-forms ## Instruction: Use python 2.7.3-compatible fork of anymail (awaiting PR to be merged) ## Code After: Django==1.9.1 psycopg2==2.5.4 django-leaflet gunicorn==19.3.0 requests[security] xlrd djangorestframework==3.3.2 djangorestframework-csv==1.4.1 django-rest-swagger==0.3.5 django-cors-headers==1.1.0 openpyxl==2.3.3 numpy==1.10.4 pandas==0.17.1 scipy==0.17.0 django-allauth==0.25.2 premailer -e git@github.com:anymail/django-anymail.git#egg=django-anymail django-crispy-forms
Django==1.9.1 psycopg2==2.5.4 django-leaflet gunicorn==19.3.0 requests[security] xlrd djangorestframework==3.3.2 djangorestframework-csv==1.4.1 django-rest-swagger==0.3.5 django-cors-headers==1.1.0 openpyxl==2.3.3 numpy==1.10.4 pandas==0.17.1 scipy==0.17.0 django-allauth==0.25.2 premailer - django-anymail + -e git@github.com:anymail/django-anymail.git#egg=django-anymail django-crispy-forms
2
0.111111
1
1
4ecfbd118091e2bc7036fefda91eefaa226c7d1b
package.json
package.json
{ "name": "jsend", "version": "0.0.0", "description": "jSend middleware for express", "main": "index.js", "scripts": { "test": "jasmine", "lint": "jslint *.js **/*.js" }, "author": "Rohan Orton", "license": "MIT", "devDependencies": { "jasmine": "^2.3.1", "jslint": "^0.9.1", "node-mocks-http": "^1.4.2" } }
{ "name": "jsend", "version": "0.0.0", "description": "jSend middleware for express", "main": "index.js", "scripts": { "test": "jasmine", "lint": "jslint *.js **/*.js", "test:watch": "npm test -s; onchange '*.js' '**/*.js' -- npm test -s", "lint:watch": "npm run lint -s; onchange '*.js' '**/*.js' -- npm run lint -s" }, "author": "Rohan Orton", "license": "MIT", "devDependencies": { "jasmine": "^2.3.1", "jslint": "^0.9.1", "node-mocks-http": "^1.4.2", "onchange": "^1.1.0" } }
Add test:watch and lint:watch to npm file for continuous testing
Add test:watch and lint:watch to npm file for continuous testing
JSON
mit
rohanorton/proto-jSend,rohanorton/express-jSend
json
## Code Before: { "name": "jsend", "version": "0.0.0", "description": "jSend middleware for express", "main": "index.js", "scripts": { "test": "jasmine", "lint": "jslint *.js **/*.js" }, "author": "Rohan Orton", "license": "MIT", "devDependencies": { "jasmine": "^2.3.1", "jslint": "^0.9.1", "node-mocks-http": "^1.4.2" } } ## Instruction: Add test:watch and lint:watch to npm file for continuous testing ## Code After: { "name": "jsend", "version": "0.0.0", "description": "jSend middleware for express", "main": "index.js", "scripts": { "test": "jasmine", "lint": "jslint *.js **/*.js", "test:watch": "npm test -s; onchange '*.js' '**/*.js' -- npm test -s", "lint:watch": "npm run lint -s; onchange '*.js' '**/*.js' -- npm run lint -s" }, "author": "Rohan Orton", "license": "MIT", "devDependencies": { "jasmine": "^2.3.1", "jslint": "^0.9.1", "node-mocks-http": "^1.4.2", "onchange": "^1.1.0" } }
{ "name": "jsend", "version": "0.0.0", "description": "jSend middleware for express", "main": "index.js", "scripts": { "test": "jasmine", - "lint": "jslint *.js **/*.js" + "lint": "jslint *.js **/*.js", ? + + "test:watch": "npm test -s; onchange '*.js' '**/*.js' -- npm test -s", + "lint:watch": "npm run lint -s; onchange '*.js' '**/*.js' -- npm run lint -s" }, "author": "Rohan Orton", "license": "MIT", "devDependencies": { "jasmine": "^2.3.1", "jslint": "^0.9.1", - "node-mocks-http": "^1.4.2" + "node-mocks-http": "^1.4.2", ? + + "onchange": "^1.1.0" } }
7
0.411765
5
2
00eed045fb24e3f56465fd90b824658f06e65c1b
packages/vulcan-lib/lib/modules/dynamic_loader.js
packages/vulcan-lib/lib/modules/dynamic_loader.js
import React from 'react'; import loadable from 'react-loadable'; import { Components } from './components.js'; export const dynamicLoader = componentImport => loadable({ loader: () => componentImport, loading: Components.DynamicLoading, // serverSideRequirePath: adminPath }); export const getDynamicComponent = componentImport => React.createElement(dynamicLoader(componentImport));
import React from 'react'; import loadable from 'react-loadable'; import { Components } from './components.js'; export const dynamicLoader = componentImport => loadable({ loader: () => componentImport, loading: Components.DynamicLoading, // serverSideRequirePath: adminPath }); export const getDynamicComponent = (componentImport, props) => React.createElement(dynamicLoader(componentImport), props);
Add props to dynamic components (PR Worthy)
Add props to dynamic components (PR Worthy)
JavaScript
mit
Discordius/Telescope,Discordius/Lesswrong2,Discordius/Telescope,Discordius/Lesswrong2,Discordius/Lesswrong2,Discordius/Telescope,Discordius/Telescope,Discordius/Lesswrong2
javascript
## Code Before: import React from 'react'; import loadable from 'react-loadable'; import { Components } from './components.js'; export const dynamicLoader = componentImport => loadable({ loader: () => componentImport, loading: Components.DynamicLoading, // serverSideRequirePath: adminPath }); export const getDynamicComponent = componentImport => React.createElement(dynamicLoader(componentImport)); ## Instruction: Add props to dynamic components (PR Worthy) ## Code After: import React from 'react'; import loadable from 'react-loadable'; import { Components } from './components.js'; export const dynamicLoader = componentImport => loadable({ loader: () => componentImport, loading: Components.DynamicLoading, // serverSideRequirePath: adminPath }); export const getDynamicComponent = (componentImport, props) => React.createElement(dynamicLoader(componentImport), props);
import React from 'react'; import loadable from 'react-loadable'; import { Components } from './components.js'; export const dynamicLoader = componentImport => loadable({ loader: () => componentImport, loading: Components.DynamicLoading, // serverSideRequirePath: adminPath }); - export const getDynamicComponent = componentImport => React.createElement(dynamicLoader(componentImport)); + export const getDynamicComponent = (componentImport, props) => React.createElement(dynamicLoader(componentImport), props); ? + ++++++++ +++++++
2
0.181818
1
1
a0d929637290d6141392e4d780240766a60753ff
spec/lib/llt/diff/parser/postag_spec.rb
spec/lib/llt/diff/parser/postag_spec.rb
require 'spec_helper' describe LLT::Diff::Parser::Postag do let(:postag) { LLT::Diff::Parser::Postag.new('v3siia---') } describe "#analysis" do it "decodes the postag into a hash" do res = { part_of_speech: 'v', person: '3', number: 's', tense: 'i', mood: 'i', voice: 'a', gender: '-', case: '-', degree: '-', } postag.analysis.should == res end end describe "#clean_analysis" do it "returns only datapoints that are used" do res = { part_of_speech: 'v', person: '3', number: 's', tense: 'i', mood: 'i', voice: 'a', } postag.clean_analysis.should == res end end describe "#report" do xit "returns a report hash of the postag" do res = { datapoints: { total: 9, part_of_speech: { total: 1, 'v' => { total: 1 } }, person: { total: 1, '3' => { total: 1 }, }, number: { total: 1, 's' => { total: 1 }, }, tense: { total: 1, 'i' => { total: 1 }, }, mood: { total: 1, 'i' => { total: 1 }, }, voice: { total: 1, 'a' => { total: 1 }, }, } } postag.report.should == res end end end
require 'spec_helper' describe LLT::Diff::Parser::Postag do let(:postag) { LLT::Diff::Parser::Postag.new('v3siia---') } describe "#analysis" do it "decodes the postag into a hash" do res = { part_of_speech: 'v', person: '3', number: 's', tense: 'i', mood: 'i', voice: 'a', gender: '-', case: '-', degree: '-', } postag.analysis.should == res end end describe "#clean_analysis" do it "returns only datapoints that are used" do res = { part_of_speech: 'v', person: '3', number: 's', tense: 'i', mood: 'i', voice: 'a', } postag.clean_analysis.should == res end end end
Kill report spec for Postag
Kill report spec for Postag
Ruby
mit
latin-language-toolkit/llt-review,latin-language-toolkit/llt-review
ruby
## Code Before: require 'spec_helper' describe LLT::Diff::Parser::Postag do let(:postag) { LLT::Diff::Parser::Postag.new('v3siia---') } describe "#analysis" do it "decodes the postag into a hash" do res = { part_of_speech: 'v', person: '3', number: 's', tense: 'i', mood: 'i', voice: 'a', gender: '-', case: '-', degree: '-', } postag.analysis.should == res end end describe "#clean_analysis" do it "returns only datapoints that are used" do res = { part_of_speech: 'v', person: '3', number: 's', tense: 'i', mood: 'i', voice: 'a', } postag.clean_analysis.should == res end end describe "#report" do xit "returns a report hash of the postag" do res = { datapoints: { total: 9, part_of_speech: { total: 1, 'v' => { total: 1 } }, person: { total: 1, '3' => { total: 1 }, }, number: { total: 1, 's' => { total: 1 }, }, tense: { total: 1, 'i' => { total: 1 }, }, mood: { total: 1, 'i' => { total: 1 }, }, voice: { total: 1, 'a' => { total: 1 }, }, } } postag.report.should == res end end end ## Instruction: Kill report spec for Postag ## Code After: require 'spec_helper' describe LLT::Diff::Parser::Postag do let(:postag) { LLT::Diff::Parser::Postag.new('v3siia---') } describe "#analysis" do it "decodes the postag into a hash" do res = { part_of_speech: 'v', person: '3', number: 's', tense: 'i', mood: 'i', voice: 'a', gender: '-', case: '-', degree: '-', } postag.analysis.should == res end end describe "#clean_analysis" do it "returns only datapoints that are used" do res = { part_of_speech: 'v', person: '3', number: 's', tense: 'i', mood: 'i', voice: 'a', } postag.clean_analysis.should == res end end end
require 'spec_helper' describe LLT::Diff::Parser::Postag do let(:postag) { LLT::Diff::Parser::Postag.new('v3siia---') } describe "#analysis" do it "decodes the postag into a hash" do res = { part_of_speech: 'v', person: '3', number: 's', tense: 'i', mood: 'i', voice: 'a', gender: '-', case: '-', degree: '-', } postag.analysis.should == res end end describe "#clean_analysis" do it "returns only datapoints that are used" do res = { part_of_speech: 'v', person: '3', number: 's', tense: 'i', mood: 'i', voice: 'a', } postag.clean_analysis.should == res end end - - describe "#report" do - xit "returns a report hash of the postag" do - res = { - datapoints: { - total: 9, - part_of_speech: { total: 1, 'v' => { total: 1 } }, - person: { total: 1, '3' => { total: 1 }, }, - number: { total: 1, 's' => { total: 1 }, }, - tense: { total: 1, 'i' => { total: 1 }, }, - mood: { total: 1, 'i' => { total: 1 }, }, - voice: { total: 1, 'a' => { total: 1 }, }, - } - } - - postag.report.should == res - end - end end
18
0.333333
0
18
a5b314aa1c9a36f1311871b32ee6d94ec161cd29
config/views.js
config/views.js
module.exports= { views: [{ "name": "Raw Match Data", "view": "matches" }], matches: function (mongoCollection, callback) { mongoCollection.find().toArray(function (err, matches) { callback([ { name: "Matches", headers: [ { text: "Team", value: "team" }, { text: "Comments", value: "comments" }, { text: "Device", value: "sender" } ], data: matches } ]); db.close(); }); } };
module.exports= { views: [{ "name": "Raw Match Data", "view": "matches" }], matches: function (mongoCollection, callback) { mongoCollection .find() .sort({"_id": -1}) .toArray(function (err, matches) { callback([ { name: "Matches", headers: [ { text: "Team", value: "team" }, { text: "Comments", value: "comments" }, { text: "Device", value: "sender" } ], data: matches } ]); db.close(); }); } };
Return Raw Match Data in Inverse Order
Return Raw Match Data in Inverse Order
JavaScript
bsd-2-clause
FRCteam4909/FRC-Scouting,FRCteam4909/FRC-Scouting,FRCteam4909/FRC-Scouting
javascript
## Code Before: module.exports= { views: [{ "name": "Raw Match Data", "view": "matches" }], matches: function (mongoCollection, callback) { mongoCollection.find().toArray(function (err, matches) { callback([ { name: "Matches", headers: [ { text: "Team", value: "team" }, { text: "Comments", value: "comments" }, { text: "Device", value: "sender" } ], data: matches } ]); db.close(); }); } }; ## Instruction: Return Raw Match Data in Inverse Order ## Code After: module.exports= { views: [{ "name": "Raw Match Data", "view": "matches" }], matches: function (mongoCollection, callback) { mongoCollection .find() .sort({"_id": -1}) .toArray(function (err, matches) { callback([ { name: "Matches", headers: [ { text: "Team", value: "team" }, { text: "Comments", value: "comments" }, { text: "Device", value: "sender" } ], data: matches } ]); db.close(); }); } };
module.exports= { views: [{ "name": "Raw Match Data", "view": "matches" }], matches: function (mongoCollection, callback) { + mongoCollection + .find() + .sort({"_id": -1}) - mongoCollection.find().toArray(function (err, matches) { ? ^^^^^^^^^^^^^^^^^^^^^^ + .toArray(function (err, matches) { ? ^ - callback([ + callback([ ? + - { + { ? + - name: "Matches", + name: "Matches", ? + - headers: [ + headers: [ ? + - { + { ? + - text: "Team", + text: "Team", ? + - value: "team" + value: "team" ? + - }, + }, ? + - { + { ? + - text: "Comments", + text: "Comments", ? + - value: "comments" + value: "comments" ? + - }, + }, ? + - { + { ? + - text: "Device", + text: "Device", ? + - value: "sender" + value: "sender" ? + - } + } ? + - ], + ], ? + - data: matches + data: matches ? + - } + } ? + - ]); + ]); ? + - db.close(); + db.close(); ? + - }); + }); ? + } };
49
1.484848
26
23
64e5278d9c32b12c6f22552479f238dd169d9408
web/static/codesearch.js
web/static/codesearch.js
"use strict"; var Codesearch = function() { return { remote: null, onload: function() { Codesearch.input = $('#searchbox'); Codesearch.input.keydown(Codesearch.keypress); DNode({ error: Codesearch.regex_error, match: Codesearch.match, }).connect(function (remote) { Codesearch.remote = remote; }, { reconnect: 100 }); }, keypress: function() { setTimeout(Codesearch.newsearch, 0); }, newsearch: function() { if (Codesearch.remote !== null) Codesearch.remote.new_search(Codesearch.input.val()); }, error: function(str, error) { }, match: function(str, match) { console.log(match); var li = document.createElement('li'); var pre = document.createElement('pre'); pre.appendChild(document.createTextNode( match.file + ":" + match.lno + ":" + match.line)); li.appendChild(pre); $('#results').append(li); } }; }(); $(document).ready(Codesearch.onload);
"use strict"; var Codesearch = function() { return { remote: null, displaying: null, onload: function() { Codesearch.input = $('#searchbox'); Codesearch.input.keydown(Codesearch.keypress); DNode({ error: Codesearch.regex_error, match: Codesearch.match, }).connect(function (remote) { Codesearch.remote = remote; }, { reconnect: 100 }); }, keypress: function() { setTimeout(Codesearch.newsearch, 0); }, newsearch: function() { if (Codesearch.remote !== null) Codesearch.remote.new_search(Codesearch.input.val()); }, error: function(str, error) { }, match: function(str, match) { if (str != Codesearch.displaying) { $('#results').children().remove(); Codesearch.displaying = str; } var li = document.createElement('li'); var pre = document.createElement('pre'); pre.appendChild(document.createTextNode( match.file + ":" + match.lno + ":" + match.line)); li.appendChild(pre); $('#results').append(li); } }; }(); $(document).ready(Codesearch.onload);
Reset the results when we get back a new result set.
Reset the results when we get back a new result set.
JavaScript
bsd-2-clause
wfxiang08/livegrep,paulproteus/livegrep,wfxiang08/livegrep,lekkas/livegrep,lekkas/livegrep,lekkas/livegrep,paulproteus/livegrep,wfxiang08/livegrep,lekkas/livegrep,wfxiang08/livegrep,paulproteus/livegrep,lekkas/livegrep,paulproteus/livegrep,paulproteus/livegrep,wfxiang08/livegrep,wfxiang08/livegrep,lekkas/livegrep,paulproteus/livegrep
javascript
## Code Before: "use strict"; var Codesearch = function() { return { remote: null, onload: function() { Codesearch.input = $('#searchbox'); Codesearch.input.keydown(Codesearch.keypress); DNode({ error: Codesearch.regex_error, match: Codesearch.match, }).connect(function (remote) { Codesearch.remote = remote; }, { reconnect: 100 }); }, keypress: function() { setTimeout(Codesearch.newsearch, 0); }, newsearch: function() { if (Codesearch.remote !== null) Codesearch.remote.new_search(Codesearch.input.val()); }, error: function(str, error) { }, match: function(str, match) { console.log(match); var li = document.createElement('li'); var pre = document.createElement('pre'); pre.appendChild(document.createTextNode( match.file + ":" + match.lno + ":" + match.line)); li.appendChild(pre); $('#results').append(li); } }; }(); $(document).ready(Codesearch.onload); ## Instruction: Reset the results when we get back a new result set. ## Code After: "use strict"; var Codesearch = function() { return { remote: null, displaying: null, onload: function() { Codesearch.input = $('#searchbox'); Codesearch.input.keydown(Codesearch.keypress); DNode({ error: Codesearch.regex_error, match: Codesearch.match, }).connect(function (remote) { Codesearch.remote = remote; }, { reconnect: 100 }); }, keypress: function() { setTimeout(Codesearch.newsearch, 0); }, newsearch: function() { if (Codesearch.remote !== null) Codesearch.remote.new_search(Codesearch.input.val()); }, error: function(str, error) { }, match: function(str, match) { if (str != Codesearch.displaying) { $('#results').children().remove(); Codesearch.displaying = str; } var li = document.createElement('li'); var pre = document.createElement('pre'); pre.appendChild(document.createTextNode( match.file + ":" + match.lno + ":" + match.line)); li.appendChild(pre); $('#results').append(li); } }; }(); $(document).ready(Codesearch.onload);
"use strict"; var Codesearch = function() { return { remote: null, + displaying: null, onload: function() { Codesearch.input = $('#searchbox'); Codesearch.input.keydown(Codesearch.keypress); DNode({ error: Codesearch.regex_error, match: Codesearch.match, }).connect(function (remote) { Codesearch.remote = remote; }, { reconnect: 100 }); }, keypress: function() { setTimeout(Codesearch.newsearch, 0); }, newsearch: function() { if (Codesearch.remote !== null) Codesearch.remote.new_search(Codesearch.input.val()); }, error: function(str, error) { }, match: function(str, match) { - console.log(match); + if (str != Codesearch.displaying) { + $('#results').children().remove(); + Codesearch.displaying = str; + } var li = document.createElement('li'); var pre = document.createElement('pre'); pre.appendChild(document.createTextNode( match.file + ":" + match.lno + ":" + match.line)); li.appendChild(pre); $('#results').append(li); } }; }(); $(document).ready(Codesearch.onload);
6
0.166667
5
1
d55eacd8be39197b78db0b84da06045e729be939
recipes/openbabel/2.4.0/fix_library_path_search.diff
recipes/openbabel/2.4.0/fix_library_path_search.diff
Devised by Richard West <r.west@neu.edu> in an attempt to fix the way paths are manipulated when making anaconda packages. See https://github.com/conda/conda-recipes/pull/310#issuecomment-106533773 diff --git a/openbabel-2.3.2/src/dlhandler_unix.cpp b/openbabel-2.3.2/src/dlhandler_unix.cpp index 5bffac3..bc66235 100644 --- src/dlhandler_unix.cpp +++ src/dlhandler_unix.cpp @@ -79,7 +79,19 @@ int DLHandler::findFiles (std::vector <std::string>& file_list, char buffer[BUFF_SIZE]; if (!path.empty()) - paths.push_back(path); + { + strncpy(buffer, path.c_str(), BUFF_SIZE - 1); + // add a trailing NULL just in case + buffer[BUFF_SIZE - 1] = '\0'; + OpenBabel::tokenize(vs, buffer, "\r\n:"); + if (!vs.empty()) + { + for (unsigned int i = 0; i < vs.size(); ++i) { + paths.push_back(vs[i]); + } + } + } + if (getenv("BABEL_LIBDIR") != NULL) {
Devised by Richard West <r.west@neu.edu> in an attempt to fix the way paths are manipulated when making anaconda packages. See https://github.com/conda/conda-recipes/pull/310#issuecomment-106533773 diff --git a/src/dlhandler_unix.cpp b/src/dlhandler_unix.cpp index 5bffac3..bc66235 100644 --- src/dlhandler_unix.cpp +++ src/dlhandler_unix.cpp @@ -79,7 +79,19 @@ int DLHandler::findFiles (std::vector <std::string>& file_list, char buffer[BUFF_SIZE]; if (!path.empty()) - paths.push_back(path); + { + strncpy(buffer, path.c_str(), BUFF_SIZE - 1); + // add a trailing NULL just in case + buffer[BUFF_SIZE - 1] = '\0'; + OpenBabel::tokenize(vs, buffer, "\r\n:"); + if (!vs.empty()) + { + for (unsigned int i = 0; i < vs.size(); ++i) { + paths.push_back(vs[i]); + } + } + } + if (getenv("BABEL_LIBDIR") != NULL) {
Remove varsions from patch to avoid confusion
Remove varsions from patch to avoid confusion
Diff
mit
peterjc/bioconda-recipes,xguse/bioconda-recipes,hardingnj/bioconda-recipes,acaprez/recipes,phac-nml/bioconda-recipes,bioconda/bioconda-recipes,cokelaer/bioconda-recipes,ostrokach/bioconda-recipes,pinguinkiste/bioconda-recipes,saketkc/bioconda-recipes,bioconda/bioconda-recipes,bow/bioconda-recipes,instituteofpathologyheidelberg/bioconda-recipes,ostrokach/bioconda-recipes,jfallmann/bioconda-recipes,matthdsm/bioconda-recipes,matthdsm/bioconda-recipes,phac-nml/bioconda-recipes,pinguinkiste/bioconda-recipes,bow/bioconda-recipes,peterjc/bioconda-recipes,jasper1918/bioconda-recipes,HassanAmr/bioconda-recipes,acaprez/recipes,daler/bioconda-recipes,mcornwell1957/bioconda-recipes,xguse/bioconda-recipes,daler/bioconda-recipes,CGATOxford/bioconda-recipes,ThomasWollmann/bioconda-recipes,HassanAmr/bioconda-recipes,jfallmann/bioconda-recipes,martin-mann/bioconda-recipes,abims-sbr/bioconda-recipes,omicsnut/bioconda-recipes,gvlproject/bioconda-recipes,hardingnj/bioconda-recipes,joachimwolff/bioconda-recipes,acaprez/recipes,mdehollander/bioconda-recipes,acaprez/recipes,zwanli/bioconda-recipes,npavlovikj/bioconda-recipes,oena/bioconda-recipes,daler/bioconda-recipes,BIMSBbioinfo/bioconda-recipes,abims-sbr/bioconda-recipes,ivirshup/bioconda-recipes,bebatut/bioconda-recipes,guowei-he/bioconda-recipes,oena/bioconda-recipes,oena/bioconda-recipes,saketkc/bioconda-recipes,omicsnut/bioconda-recipes,chapmanb/bioconda-recipes,bow/bioconda-recipes,abims-sbr/bioconda-recipes,keuv-grvl/bioconda-recipes,ivirshup/bioconda-recipes,pinguinkiste/bioconda-recipes,BIMSBbioinfo/bioconda-recipes,omicsnut/bioconda-recipes,jasper1918/bioconda-recipes,mcornwell1957/bioconda-recipes,npavlovikj/bioconda-recipes,matthdsm/bioconda-recipes,ivirshup/bioconda-recipes,gregvonkuster/bioconda-recipes,blankenberg/bioconda-recipes,joachimwolff/bioconda-recipes,CGATOxford/bioconda-recipes,ThomasWollmann/bioconda-recipes,zwanli/bioconda-recipes,dkoppstein/recipes,rvalieris/bioconda-recipes,ivirshup/bioconda-recipes,bebatut/bioconda-recipes,instituteofpathologyheidelberg/bioconda-recipes,roryk/recipes,npavlovikj/bioconda-recipes,jfallmann/bioconda-recipes,abims-sbr/bioconda-recipes,chapmanb/bioconda-recipes,keuv-grvl/bioconda-recipes,guowei-he/bioconda-recipes,rvalieris/bioconda-recipes,pinguinkiste/bioconda-recipes,zachcp/bioconda-recipes,peterjc/bioconda-recipes,BIMSBbioinfo/bioconda-recipes,zwanli/bioconda-recipes,JenCabral/bioconda-recipes,blankenberg/bioconda-recipes,ThomasWollmann/bioconda-recipes,instituteofpathologyheidelberg/bioconda-recipes,cokelaer/bioconda-recipes,rvalieris/bioconda-recipes,mdehollander/bioconda-recipes,keuv-grvl/bioconda-recipes,mdehollander/bioconda-recipes,zwanli/bioconda-recipes,jasper1918/bioconda-recipes,abims-sbr/bioconda-recipes,daler/bioconda-recipes,shenwei356/bioconda-recipes,HassanAmr/bioconda-recipes,ostrokach/bioconda-recipes,phac-nml/bioconda-recipes,saketkc/bioconda-recipes,rvalieris/bioconda-recipes,BIMSBbioinfo/bioconda-recipes,rob-p/bioconda-recipes,mcornwell1957/bioconda-recipes,BIMSBbioinfo/bioconda-recipes,JenCabral/bioconda-recipes,blankenberg/bioconda-recipes,ostrokach/bioconda-recipes,mdehollander/bioconda-recipes,xguse/bioconda-recipes,guowei-he/bioconda-recipes,bioconda/bioconda-recipes,omicsnut/bioconda-recipes,matthdsm/bioconda-recipes,CGATOxford/bioconda-recipes,hardingnj/bioconda-recipes,dkoppstein/recipes,Luobiny/bioconda-recipes,Luobiny/bioconda-recipes,xguse/bioconda-recipes,daler/bioconda-recipes,chapmanb/bioconda-recipes,guowei-he/bioconda-recipes,instituteofpathologyheidelberg/bioconda-recipes,oena/bioconda-recipes,peterjc/bioconda-recipes,rob-p/bioconda-recipes,hardingnj/bioconda-recipes,matthdsm/bioconda-recipes,gvlproject/bioconda-recipes,xguse/bioconda-recipes,blankenberg/bioconda-recipes,lpantano/recipes,gvlproject/bioconda-recipes,dmaticzka/bioconda-recipes,joachimwolff/bioconda-recipes,bow/bioconda-recipes,npavlovikj/bioconda-recipes,JenCabral/bioconda-recipes,ThomasWollmann/bioconda-recipes,bebatut/bioconda-recipes,jfallmann/bioconda-recipes,omicsnut/bioconda-recipes,bioconda/bioconda-recipes,joachimwolff/bioconda-recipes,peterjc/bioconda-recipes,zachcp/bioconda-recipes,bebatut/bioconda-recipes,zwanli/bioconda-recipes,ostrokach/bioconda-recipes,rob-p/bioconda-recipes,gvlproject/bioconda-recipes,gregvonkuster/bioconda-recipes,bow/bioconda-recipes,martin-mann/bioconda-recipes,joachimwolff/bioconda-recipes,dmaticzka/bioconda-recipes,rob-p/bioconda-recipes,rvalieris/bioconda-recipes,peterjc/bioconda-recipes,dmaticzka/bioconda-recipes,mcornwell1957/bioconda-recipes,saketkc/bioconda-recipes,Luobiny/bioconda-recipes,bioconda/recipes,dmaticzka/bioconda-recipes,martin-mann/bioconda-recipes,CGATOxford/bioconda-recipes,roryk/recipes,gvlproject/bioconda-recipes,pinguinkiste/bioconda-recipes,mdehollander/bioconda-recipes,zachcp/bioconda-recipes,hardingnj/bioconda-recipes,rvalieris/bioconda-recipes,oena/bioconda-recipes,shenwei356/bioconda-recipes,gregvonkuster/bioconda-recipes,ThomasWollmann/bioconda-recipes,colinbrislawn/bioconda-recipes,HassanAmr/bioconda-recipes,ivirshup/bioconda-recipes,colinbrislawn/bioconda-recipes,pinguinkiste/bioconda-recipes,zachcp/bioconda-recipes,dmaticzka/bioconda-recipes,Luobiny/bioconda-recipes,colinbrislawn/bioconda-recipes,mcornwell1957/bioconda-recipes,zwanli/bioconda-recipes,guowei-he/bioconda-recipes,CGATOxford/bioconda-recipes,abims-sbr/bioconda-recipes,colinbrislawn/bioconda-recipes,phac-nml/bioconda-recipes,cokelaer/bioconda-recipes,saketkc/bioconda-recipes,gregvonkuster/bioconda-recipes,keuv-grvl/bioconda-recipes,jasper1918/bioconda-recipes,keuv-grvl/bioconda-recipes,chapmanb/bioconda-recipes,dkoppstein/recipes,cokelaer/bioconda-recipes,daler/bioconda-recipes,bioconda/recipes,ThomasWollmann/bioconda-recipes,bioconda/recipes,gvlproject/bioconda-recipes,HassanAmr/bioconda-recipes,bow/bioconda-recipes,joachimwolff/bioconda-recipes,JenCabral/bioconda-recipes,martin-mann/bioconda-recipes,ivirshup/bioconda-recipes,HassanAmr/bioconda-recipes,CGATOxford/bioconda-recipes,instituteofpathologyheidelberg/bioconda-recipes,BIMSBbioinfo/bioconda-recipes,lpantano/recipes,colinbrislawn/bioconda-recipes,JenCabral/bioconda-recipes,keuv-grvl/bioconda-recipes,saketkc/bioconda-recipes,colinbrislawn/bioconda-recipes,martin-mann/bioconda-recipes,dmaticzka/bioconda-recipes,roryk/recipes,shenwei356/bioconda-recipes,jasper1918/bioconda-recipes,matthdsm/bioconda-recipes,JenCabral/bioconda-recipes,lpantano/recipes,phac-nml/bioconda-recipes,chapmanb/bioconda-recipes,mdehollander/bioconda-recipes,ostrokach/bioconda-recipes,shenwei356/bioconda-recipes,lpantano/recipes
diff
## Code Before: Devised by Richard West <r.west@neu.edu> in an attempt to fix the way paths are manipulated when making anaconda packages. See https://github.com/conda/conda-recipes/pull/310#issuecomment-106533773 diff --git a/openbabel-2.3.2/src/dlhandler_unix.cpp b/openbabel-2.3.2/src/dlhandler_unix.cpp index 5bffac3..bc66235 100644 --- src/dlhandler_unix.cpp +++ src/dlhandler_unix.cpp @@ -79,7 +79,19 @@ int DLHandler::findFiles (std::vector <std::string>& file_list, char buffer[BUFF_SIZE]; if (!path.empty()) - paths.push_back(path); + { + strncpy(buffer, path.c_str(), BUFF_SIZE - 1); + // add a trailing NULL just in case + buffer[BUFF_SIZE - 1] = '\0'; + OpenBabel::tokenize(vs, buffer, "\r\n:"); + if (!vs.empty()) + { + for (unsigned int i = 0; i < vs.size(); ++i) { + paths.push_back(vs[i]); + } + } + } + if (getenv("BABEL_LIBDIR") != NULL) { ## Instruction: Remove varsions from patch to avoid confusion ## Code After: Devised by Richard West <r.west@neu.edu> in an attempt to fix the way paths are manipulated when making anaconda packages. See https://github.com/conda/conda-recipes/pull/310#issuecomment-106533773 diff --git a/src/dlhandler_unix.cpp b/src/dlhandler_unix.cpp index 5bffac3..bc66235 100644 --- src/dlhandler_unix.cpp +++ src/dlhandler_unix.cpp @@ -79,7 +79,19 @@ int DLHandler::findFiles (std::vector <std::string>& file_list, char buffer[BUFF_SIZE]; if (!path.empty()) - paths.push_back(path); + { + strncpy(buffer, path.c_str(), BUFF_SIZE - 1); + // add a trailing NULL just in case + buffer[BUFF_SIZE - 1] = '\0'; + OpenBabel::tokenize(vs, buffer, "\r\n:"); + if (!vs.empty()) + { + for (unsigned int i = 0; i < vs.size(); ++i) { + paths.push_back(vs[i]); + } + } + } + if (getenv("BABEL_LIBDIR") != NULL) {
Devised by Richard West <r.west@neu.edu> in an attempt to fix the way paths are manipulated when making anaconda packages. See https://github.com/conda/conda-recipes/pull/310#issuecomment-106533773 - diff --git a/openbabel-2.3.2/src/dlhandler_unix.cpp b/openbabel-2.3.2/src/dlhandler_unix.cpp ? ---------------- ---------------- + diff --git a/src/dlhandler_unix.cpp b/src/dlhandler_unix.cpp index 5bffac3..bc66235 100644 --- src/dlhandler_unix.cpp +++ src/dlhandler_unix.cpp @@ -79,7 +79,19 @@ int DLHandler::findFiles (std::vector <std::string>& file_list, char buffer[BUFF_SIZE]; - + if (!path.empty()) - paths.push_back(path); + { + strncpy(buffer, path.c_str(), BUFF_SIZE - 1); + // add a trailing NULL just in case - + buffer[BUFF_SIZE - 1] = '\0'; ? ---- + + buffer[BUFF_SIZE - 1] = '\0'; + OpenBabel::tokenize(vs, buffer, "\r\n:"); + if (!vs.empty()) + { + for (unsigned int i = 0; i < vs.size(); ++i) { + paths.push_back(vs[i]); + } + } + } - + - + + + if (getenv("BABEL_LIBDIR") != NULL) {
10
0.333333
5
5
ad0ced47e2718b158633300b909162be74c033da
compile_zlib.sh
compile_zlib.sh
base=/src/zlib url=http://zlib.net tarball=zlib-1.2.5.tar.gz directory=zlib-1.2.5 mkdir -p $base pushd $base if [ ! -f $tarball ] then echo downloading $tarball ... wget $url/$tarball fi if [ ! -d $directory ] then echo unpacking $tarball ... tar -xvf $tarball fi pushd $directory if [ ! -f configure.done ] then CFLAGS=-I/include\ -L/lib\ -Os ./configure --prefix= echo done > configure.done fi make popd popd
base=/src/zlib url=http://zlib.net tarball=zlib-1.2.5.tar.gz directory=zlib-1.2.5 mkdir -p $base pushd $base if [ ! -f $tarball ] then echo downloading $tarball ... wget $url/$tarball fi if [ ! -d $directory ] then echo unpacking $tarball ... tar -xvf $tarball fi pushd $directory #if [ ! -f configure.done ] #then # CFLAGS=-I/include\ -L/lib\ -Os ./configure --prefix= # # echo done > configure.done #fi make -f win32/Makefile.gcc INCLUDE_PATH=/include LIBRARY_PATH=/lib make -f win32/Makefile.gcc install popd popd
Use the correct Makefile to compile zlib
Use the correct Makefile to compile zlib
Shell
lgpl-2.1
photron/msys_setup,photron/msys_setup,photron/msys_setup
shell
## Code Before: base=/src/zlib url=http://zlib.net tarball=zlib-1.2.5.tar.gz directory=zlib-1.2.5 mkdir -p $base pushd $base if [ ! -f $tarball ] then echo downloading $tarball ... wget $url/$tarball fi if [ ! -d $directory ] then echo unpacking $tarball ... tar -xvf $tarball fi pushd $directory if [ ! -f configure.done ] then CFLAGS=-I/include\ -L/lib\ -Os ./configure --prefix= echo done > configure.done fi make popd popd ## Instruction: Use the correct Makefile to compile zlib ## Code After: base=/src/zlib url=http://zlib.net tarball=zlib-1.2.5.tar.gz directory=zlib-1.2.5 mkdir -p $base pushd $base if [ ! -f $tarball ] then echo downloading $tarball ... wget $url/$tarball fi if [ ! -d $directory ] then echo unpacking $tarball ... tar -xvf $tarball fi pushd $directory #if [ ! -f configure.done ] #then # CFLAGS=-I/include\ -L/lib\ -Os ./configure --prefix= # # echo done > configure.done #fi make -f win32/Makefile.gcc INCLUDE_PATH=/include LIBRARY_PATH=/lib make -f win32/Makefile.gcc install popd popd
base=/src/zlib url=http://zlib.net tarball=zlib-1.2.5.tar.gz directory=zlib-1.2.5 mkdir -p $base pushd $base if [ ! -f $tarball ] then echo downloading $tarball ... wget $url/$tarball fi if [ ! -d $directory ] then echo unpacking $tarball ... tar -xvf $tarball fi pushd $directory - if [ ! -f configure.done ] + #if [ ! -f configure.done ] ? + - then + #then ? + - CFLAGS=-I/include\ -L/lib\ -Os ./configure --prefix= + # CFLAGS=-I/include\ -L/lib\ -Os ./configure --prefix= ? + + # + # echo done > configure.done + #fi + make -f win32/Makefile.gcc + INCLUDE_PATH=/include LIBRARY_PATH=/lib make -f win32/Makefile.gcc install - echo done > configure.done - fi - - make popd popd
15
0.428571
8
7
6c3a76c48879b2a3fc1fff120a0f1e5c23b74049
app/soc/templates/v2/modules/gci/org_app/show.html
app/soc/templates/v2/modules/gci/org_app/show.html
{% extends base_layout %} {% comment %} Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. {% endcomment %} {% block page_content %} <!-- begin top message block --> {{ top_msg.render }} <!-- end top message block --> {% if not record %} <div id="user-message" class="error"> <strong>ALERT: </strong>No such organization application record exists. {% if update_link %} <a href="{{ update_link }}">To submit a new organization application click here.</a> {% else %} {{ submission_msg }} {% endif %} </div> {% else %} {% if update_link %} <div id="edit-page" class="org-page-link"> <a href="{{ update_link }}">Update</a> </div> {% endif %} <!-- begin profile block --> {{ record.render }} <!-- end profile block --> {% endif %} {% endblock page_content %} {% block dependencies %} [ css("/soc/content/{{ app_version }}/css/v2/gci/readonly.css") ] {% endblock dependencies %}
{% extends base_layout %} {% comment %} Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. {% endcomment %} {% block stylesheets %} {{ block.super }} <link rel="stylesheet" type="text/css" media="screen" href="/soc/content/{{ app_version }}/css/v2/gci/readonly.css" /> {% endblock stylesheets %} {% block page_content %} <!-- begin top message block --> {{ top_msg.render }} <!-- end top message block --> {% if not record %} <div id="user-message" class="error"> <strong>ALERT: </strong>No such organization application record exists. {% if update_link %} <a href="{{ update_link }}">To submit a new organization application click here.</a> {% else %} {{ submission_msg }} {% endif %} </div> {% else %} {% if update_link %} <div id="edit-page" class="org-page-link"> <a href="{{ update_link }}">Update</a> </div> {% endif %} <!-- begin profile block --> {{ record.render }} <!-- end profile block --> {% endif %} {% endblock page_content %}
Make readonly CSS properties not dependable on LABjs.
Make readonly CSS properties not dependable on LABjs.
HTML
apache-2.0
rhyolight/nupic.son,rhyolight/nupic.son,rhyolight/nupic.son
html
## Code Before: {% extends base_layout %} {% comment %} Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. {% endcomment %} {% block page_content %} <!-- begin top message block --> {{ top_msg.render }} <!-- end top message block --> {% if not record %} <div id="user-message" class="error"> <strong>ALERT: </strong>No such organization application record exists. {% if update_link %} <a href="{{ update_link }}">To submit a new organization application click here.</a> {% else %} {{ submission_msg }} {% endif %} </div> {% else %} {% if update_link %} <div id="edit-page" class="org-page-link"> <a href="{{ update_link }}">Update</a> </div> {% endif %} <!-- begin profile block --> {{ record.render }} <!-- end profile block --> {% endif %} {% endblock page_content %} {% block dependencies %} [ css("/soc/content/{{ app_version }}/css/v2/gci/readonly.css") ] {% endblock dependencies %} ## Instruction: Make readonly CSS properties not dependable on LABjs. ## Code After: {% extends base_layout %} {% comment %} Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. {% endcomment %} {% block stylesheets %} {{ block.super }} <link rel="stylesheet" type="text/css" media="screen" href="/soc/content/{{ app_version }}/css/v2/gci/readonly.css" /> {% endblock stylesheets %} {% block page_content %} <!-- begin top message block --> {{ top_msg.render }} <!-- end top message block --> {% if not record %} <div id="user-message" class="error"> <strong>ALERT: </strong>No such organization application record exists. {% if update_link %} <a href="{{ update_link }}">To submit a new organization application click here.</a> {% else %} {{ submission_msg }} {% endif %} </div> {% else %} {% if update_link %} <div id="edit-page" class="org-page-link"> <a href="{{ update_link }}">Update</a> </div> {% endif %} <!-- begin profile block --> {{ record.render }} <!-- end profile block --> {% endif %} {% endblock page_content %}
{% extends base_layout %} {% comment %} Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. {% endcomment %} + {% block stylesheets %} + {{ block.super }} + <link rel="stylesheet" type="text/css" media="screen" href="/soc/content/{{ app_version }}/css/v2/gci/readonly.css" /> + {% endblock stylesheets %} {% block page_content %} <!-- begin top message block --> {{ top_msg.render }} <!-- end top message block --> {% if not record %} <div id="user-message" class="error"> <strong>ALERT: </strong>No such organization application record exists. {% if update_link %} <a href="{{ update_link }}">To submit a new organization application click here.</a> {% else %} {{ submission_msg }} {% endif %} </div> {% else %} {% if update_link %} <div id="edit-page" class="org-page-link"> <a href="{{ update_link }}">Update</a> </div> {% endif %} <!-- begin profile block --> {{ record.render }} <!-- end profile block --> {% endif %} {% endblock page_content %} - - - {% block dependencies %} - [ - css("/soc/content/{{ app_version }}/css/v2/gci/readonly.css") - ] - {% endblock dependencies %}
11
0.22
4
7
a79cabf28bc39616862b84f94260f84db6b59ef2
libs-carto/cartocss/CMakeLists.txt
libs-carto/cartocss/CMakeLists.txt
cmake_minimum_required(VERSION 2.6) project(cartocss) if(WIN32) add_definitions("-D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -DBOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES") endif(WIN32) if(APPLE) add_definitions("-std=c++11 -Wno-unsequenced") endif(APPLE) if(CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") endif(CMAKE_COMPILER_IS_GNUCXX) set(cartocss_SRC_DIR "${PROJECT_SOURCE_DIR}/src/cartocss") set(cartocss_LIBS_DIR "${PROJECT_SOURCE_DIR}/../libs-external") file(GLOB cartocss_SRC_FILES "${cartocss_SRC_DIR}/*.cpp" "${cartocss_SRC_DIR}/*.h") if(WIN32) set_source_files_properties("${cartocss_SRC_DIR}/CartoCSSParser.cpp" PROPERTIES COMPILE_FLAGS "/Od /Ob2") endif(WIN32) if(SINGLE_LIBRARY) add_library(cartocss INTERFACE) set(cartocss_SRC_FILES ${cartocss_SRC_FILES} PARENT_SCOPE) else() add_library(cartocss OBJECT ${cartocss_SRC_FILES}) endif()
cmake_minimum_required(VERSION 2.6) project(cartocss) if(WIN32) add_definitions("-D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS") endif(WIN32) if(APPLE) add_definitions("-std=c++11 -Wno-unsequenced") endif(APPLE) if(CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") endif(CMAKE_COMPILER_IS_GNUCXX) set(cartocss_SRC_DIR "${PROJECT_SOURCE_DIR}/src/cartocss") set(cartocss_LIBS_DIR "${PROJECT_SOURCE_DIR}/../libs-external") file(GLOB cartocss_SRC_FILES "${cartocss_SRC_DIR}/*.cpp" "${cartocss_SRC_DIR}/*.h") if(WIN32) set_source_files_properties("${cartocss_SRC_DIR}/CartoCSSParser.cpp" PROPERTIES COMPILE_FLAGS "/Od /Ob2") endif(WIN32) if(SINGLE_LIBRARY) add_library(cartocss INTERFACE) set(cartocss_SRC_FILES ${cartocss_SRC_FILES} PARENT_SCOPE) else() add_library(cartocss OBJECT ${cartocss_SRC_FILES}) endif()
Remove variadic template disable flag from WinPhone build
Remove variadic template disable flag from WinPhone build
Text
bsd-3-clause
CartoDB/mobile-sdk,CartoDB/mobile-sdk,CartoDB/mobile-sdk,CartoDB/mobile-sdk,CartoDB/mobile-sdk,CartoDB/mobile-sdk
text
## Code Before: cmake_minimum_required(VERSION 2.6) project(cartocss) if(WIN32) add_definitions("-D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -DBOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES") endif(WIN32) if(APPLE) add_definitions("-std=c++11 -Wno-unsequenced") endif(APPLE) if(CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") endif(CMAKE_COMPILER_IS_GNUCXX) set(cartocss_SRC_DIR "${PROJECT_SOURCE_DIR}/src/cartocss") set(cartocss_LIBS_DIR "${PROJECT_SOURCE_DIR}/../libs-external") file(GLOB cartocss_SRC_FILES "${cartocss_SRC_DIR}/*.cpp" "${cartocss_SRC_DIR}/*.h") if(WIN32) set_source_files_properties("${cartocss_SRC_DIR}/CartoCSSParser.cpp" PROPERTIES COMPILE_FLAGS "/Od /Ob2") endif(WIN32) if(SINGLE_LIBRARY) add_library(cartocss INTERFACE) set(cartocss_SRC_FILES ${cartocss_SRC_FILES} PARENT_SCOPE) else() add_library(cartocss OBJECT ${cartocss_SRC_FILES}) endif() ## Instruction: Remove variadic template disable flag from WinPhone build ## Code After: cmake_minimum_required(VERSION 2.6) project(cartocss) if(WIN32) add_definitions("-D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS") endif(WIN32) if(APPLE) add_definitions("-std=c++11 -Wno-unsequenced") endif(APPLE) if(CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") endif(CMAKE_COMPILER_IS_GNUCXX) set(cartocss_SRC_DIR "${PROJECT_SOURCE_DIR}/src/cartocss") set(cartocss_LIBS_DIR "${PROJECT_SOURCE_DIR}/../libs-external") file(GLOB cartocss_SRC_FILES "${cartocss_SRC_DIR}/*.cpp" "${cartocss_SRC_DIR}/*.h") if(WIN32) set_source_files_properties("${cartocss_SRC_DIR}/CartoCSSParser.cpp" PROPERTIES COMPILE_FLAGS "/Od /Ob2") endif(WIN32) if(SINGLE_LIBRARY) add_library(cartocss INTERFACE) set(cartocss_SRC_FILES ${cartocss_SRC_FILES} PARENT_SCOPE) else() add_library(cartocss OBJECT ${cartocss_SRC_FILES}) endif()
cmake_minimum_required(VERSION 2.6) project(cartocss) if(WIN32) - add_definitions("-D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -DBOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES") ? ---------------------------------------------- + add_definitions("-D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS") endif(WIN32) if(APPLE) add_definitions("-std=c++11 -Wno-unsequenced") endif(APPLE) if(CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") endif(CMAKE_COMPILER_IS_GNUCXX) set(cartocss_SRC_DIR "${PROJECT_SOURCE_DIR}/src/cartocss") set(cartocss_LIBS_DIR "${PROJECT_SOURCE_DIR}/../libs-external") file(GLOB cartocss_SRC_FILES "${cartocss_SRC_DIR}/*.cpp" "${cartocss_SRC_DIR}/*.h") if(WIN32) set_source_files_properties("${cartocss_SRC_DIR}/CartoCSSParser.cpp" PROPERTIES COMPILE_FLAGS "/Od /Ob2") endif(WIN32) if(SINGLE_LIBRARY) add_library(cartocss INTERFACE) set(cartocss_SRC_FILES ${cartocss_SRC_FILES} PARENT_SCOPE) else() add_library(cartocss OBJECT ${cartocss_SRC_FILES}) endif()
2
0.066667
1
1
ac5b019c3c86d0ea00cb2e45d44d0b2927dd702f
.circleci/config.yml
.circleci/config.yml
version: 2 jobs: build: docker: - image: ubuntu:cosmic steps: - run: name: Installing command: 'apt-get update && apt-get install -y git gcc g++ cmake libboost-all-dev bison qt5-default libsdl2-dev ruby' - checkout - run: name: Submodules command: git submodule update --init --recursive - run: name: Configure command: | mkdir build cd build cmake .. - run: name: Build command: | cd build make - run: name: Test command: | cd build ctest . -L xfail || true ctest . -LE xfail
version: 2 jobs: build: docker: - image: cimg/base:2020.01 steps: - run: name: Installing command: 'sudo apt-get update && sudo apt-get install -y git gcc g++ cmake libboost-all-dev bison qt5-default libsdl1.2-dev libsdl2-dev ruby' - checkout - run: name: Submodules command: git submodule update --init --recursive - run: name: Configure command: | mkdir build cd build cmake .. - run: name: Build command: | cd build make - run: name: Test command: | cd build ctest . -L xfail || true ctest . -LE xfail
Fix circleci build: use current image, use sudo, add libsdl1.2
Fix circleci build: use current image, use sudo, add libsdl1.2
YAML
mit
autc04/executor,autc04/executor,autc04/executor,autc04/executor,autc04/executor,autc04/executor
yaml
## Code Before: version: 2 jobs: build: docker: - image: ubuntu:cosmic steps: - run: name: Installing command: 'apt-get update && apt-get install -y git gcc g++ cmake libboost-all-dev bison qt5-default libsdl2-dev ruby' - checkout - run: name: Submodules command: git submodule update --init --recursive - run: name: Configure command: | mkdir build cd build cmake .. - run: name: Build command: | cd build make - run: name: Test command: | cd build ctest . -L xfail || true ctest . -LE xfail ## Instruction: Fix circleci build: use current image, use sudo, add libsdl1.2 ## Code After: version: 2 jobs: build: docker: - image: cimg/base:2020.01 steps: - run: name: Installing command: 'sudo apt-get update && sudo apt-get install -y git gcc g++ cmake libboost-all-dev bison qt5-default libsdl1.2-dev libsdl2-dev ruby' - checkout - run: name: Submodules command: git submodule update --init --recursive - run: name: Configure command: | mkdir build cd build cmake .. - run: name: Build command: | cd build make - run: name: Test command: | cd build ctest . -L xfail || true ctest . -LE xfail
version: 2 jobs: build: docker: - - image: ubuntu:cosmic + - image: cimg/base:2020.01 steps: - run: name: Installing - command: 'apt-get update && apt-get install -y git gcc g++ cmake libboost-all-dev bison qt5-default libsdl2-dev ruby' + command: 'sudo apt-get update && sudo apt-get install -y git gcc g++ cmake libboost-all-dev bison qt5-default libsdl1.2-dev libsdl2-dev ruby' ? +++++ +++++ ++++++++++++++ - checkout - run: name: Submodules command: git submodule update --init --recursive - run: name: Configure command: | mkdir build cd build cmake .. - run: name: Build command: | cd build make - run: name: Test command: | cd build ctest . -L xfail || true ctest . -LE xfail
4
0.114286
2
2
fdf84fe4b9ffdd437df03260b59f30b2f18cdba6
starling-hsf.sh
starling-hsf.sh
QARMC=${QARMC:-"qarmc"} if [ $# != 1 ]; then echo "usage: $0 FILE" exit 1 fi tempfile=hsf.tmp if [ -e $tempfile ] then echo "Temp file already exists: " $tempfile exit 1 fi echo "--- STARLING ---" ./starling.sh -shsf $1 | tee $tempfile echo "--- HSF ---" $QARMC $tempfile rm $tempfile
QARMC=${QARMC:-"qarmc"} if [ $# -lt 1 ]; then echo "usage: $0 FILE starling-args..." exit 1 fi tempfile=hsf.tmp if [ -e $tempfile ] then echo "Temp file already exists: " $tempfile exit 1 fi echo "--- STARLING ---" ./starling.sh -shsf $* | tee $tempfile echo "--- HSF ---" $QARMC $tempfile rm $tempfile
Allow passing arguments to Starling via HSF script
Allow passing arguments to Starling via HSF script
Shell
mit
septract/starling-tool,septract/starling-tool
shell
## Code Before: QARMC=${QARMC:-"qarmc"} if [ $# != 1 ]; then echo "usage: $0 FILE" exit 1 fi tempfile=hsf.tmp if [ -e $tempfile ] then echo "Temp file already exists: " $tempfile exit 1 fi echo "--- STARLING ---" ./starling.sh -shsf $1 | tee $tempfile echo "--- HSF ---" $QARMC $tempfile rm $tempfile ## Instruction: Allow passing arguments to Starling via HSF script ## Code After: QARMC=${QARMC:-"qarmc"} if [ $# -lt 1 ]; then echo "usage: $0 FILE starling-args..." exit 1 fi tempfile=hsf.tmp if [ -e $tempfile ] then echo "Temp file already exists: " $tempfile exit 1 fi echo "--- STARLING ---" ./starling.sh -shsf $* | tee $tempfile echo "--- HSF ---" $QARMC $tempfile rm $tempfile
QARMC=${QARMC:-"qarmc"} - if [ $# != 1 ]; ? ^^ + if [ $# -lt 1 ]; ? ^^^ then - echo "usage: $0 FILE" + echo "usage: $0 FILE starling-args..." exit 1 fi tempfile=hsf.tmp if [ -e $tempfile ] then echo "Temp file already exists: " $tempfile exit 1 fi echo "--- STARLING ---" - ./starling.sh -shsf $1 | tee $tempfile ? ^ + ./starling.sh -shsf $* | tee $tempfile ? ^ echo "--- HSF ---" $QARMC $tempfile rm $tempfile
6
0.272727
3
3
af6c31d09aef686ba896b2a2c74fbb88cc7f1be0
tests/test_utils.py
tests/test_utils.py
__authors__ = [ '"Augie Fackler" <durin42@gmail.com>', ] class MockRequest(object): """Shared dummy request object to mock common aspects of a request. """ def __init__(self, path=None): self.REQUEST = self.GET = self.POST = {} self.path = path
__authors__ = [ '"Augie Fackler" <durin42@gmail.com>', '"Sverre Rabbelier" <sverre@rabbelier.nl>', ] from soc.modules import callback class MockRequest(object): """Shared dummy request object to mock common aspects of a request. Before using the object, start should be called, when done (and before calling start on a new request), end should be called. """ def __init__(self, path=None): """Creates a new empty request object. self.REQUEST, self.GET and self.POST are set to an empty dictionary, and path to the value specified. """ self.REQUEST = {} self.GET = {} self.POST = {} self.path = path def start(self): """Readies the core for a new request. """ core = callback.getCore() core.startNewRequest(self) def end(self): """Finishes up the current request. """ core = callback.getCore() core.endRequest(self, False)
Add a start and end method to MockRequest
Add a start and end method to MockRequest
Python
apache-2.0
SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange
python
## Code Before: __authors__ = [ '"Augie Fackler" <durin42@gmail.com>', ] class MockRequest(object): """Shared dummy request object to mock common aspects of a request. """ def __init__(self, path=None): self.REQUEST = self.GET = self.POST = {} self.path = path ## Instruction: Add a start and end method to MockRequest ## Code After: __authors__ = [ '"Augie Fackler" <durin42@gmail.com>', '"Sverre Rabbelier" <sverre@rabbelier.nl>', ] from soc.modules import callback class MockRequest(object): """Shared dummy request object to mock common aspects of a request. Before using the object, start should be called, when done (and before calling start on a new request), end should be called. """ def __init__(self, path=None): """Creates a new empty request object. self.REQUEST, self.GET and self.POST are set to an empty dictionary, and path to the value specified. """ self.REQUEST = {} self.GET = {} self.POST = {} self.path = path def start(self): """Readies the core for a new request. """ core = callback.getCore() core.startNewRequest(self) def end(self): """Finishes up the current request. """ core = callback.getCore() core.endRequest(self, False)
__authors__ = [ '"Augie Fackler" <durin42@gmail.com>', + '"Sverre Rabbelier" <sverre@rabbelier.nl>', ] + + + from soc.modules import callback class MockRequest(object): """Shared dummy request object to mock common aspects of a request. + + Before using the object, start should be called, when done (and + before calling start on a new request), end should be called. """ + def __init__(self, path=None): - self.REQUEST = self.GET = self.POST = {} + """Creates a new empty request object. + + self.REQUEST, self.GET and self.POST are set to an empty + dictionary, and path to the value specified. + """ + + self.REQUEST = {} + self.GET = {} + self.POST = {} self.path = path + + def start(self): + """Readies the core for a new request. + """ + + core = callback.getCore() + core.startNewRequest(self) + + def end(self): + """Finishes up the current request. + """ + + core = callback.getCore() + core.endRequest(self, False)
32
2.461538
31
1
63e43e4ce0ec838fd9c82b8ff345538e124d5128
app/controllers/comments_controller.rb
app/controllers/comments_controller.rb
class CommentsController < ApplicationController USER_KEY = :user TEXT_KEY = :text TIMESTAMP_KEY = :timestamp MAX_COMMENTS_TO_LOAD = 200 def create fail ArgumentError, 'Incorrect post submitted' unless params.key?(:request) comment = params[:request].symbolize_keys validate_comment_params(comment) comment[USER_KEY] = User.find(comment[USER_KEY]) comment[TIMESTAMP_KEY] = convert_time(comment[TIMESTAMP_KEY]) Comment.create!(comment) render json: { response: 'Success' } end def show comments = [] Comment.limit(MAX_COMMENTS_TO_LOAD).order('id asc').each do |c| tmp = c.as_json tmp[TIMESTAMP_KEY] = c[TIMESTAMP_KEY].to_f * 1000 tmp['user_name'] = User.find(c['user_id']).name comments.push(tmp) end render json: comments end def validate_comment_params(params) validate_all_parameters([USER_KEY, TEXT_KEY, TIMESTAMP_KEY], params) validate_user(params[USER_KEY]) end def validate_user(user) fail ArgumentError, 'User does not exist' unless User.find(user) end private def comment_params params.permit(:user, :timestamp, :text) end def convert_time(js_time) Time.zone.at(js_time.to_i / 1000.0) end end
class CommentsController < ApplicationController USER_KEY = :user TEXT_KEY = :text TIMESTAMP_KEY = :timestamp MAX_COMMENTS_TO_LOAD = 150 def create fail ArgumentError, 'Incorrect post submitted' unless params.key?(:request) comment = params[:request].symbolize_keys validate_comment_params(comment) comment[USER_KEY] = User.find(comment[USER_KEY]) comment[TIMESTAMP_KEY] = convert_time(comment[TIMESTAMP_KEY]) Comment.create!(comment) render json: { response: 'Success' } end def show comments = [] Comment.order('id desc').limit(MAX_COMMENTS_TO_LOAD).each do |c| tmp = c.as_json tmp[TIMESTAMP_KEY] = c[TIMESTAMP_KEY].to_f * 1000 tmp['user_name'] = User.find(c['user_id']).name comments.unshift(tmp) #Ensure earlier comments appear at top end render json: comments end def validate_comment_params(params) validate_all_parameters([USER_KEY, TEXT_KEY, TIMESTAMP_KEY], params) validate_user(params[USER_KEY]) end def validate_user(user) fail ArgumentError, 'User does not exist' unless User.find(user) end private def comment_params params.permit(:user, :timestamp, :text) end def convert_time(js_time) Time.zone.at(js_time.to_i / 1000.0) end end
Fix comments not appearing properly when you have more than the max comments amount
Fix comments not appearing properly when you have more than the max comments amount
Ruby
epl-1.0
ishakir/shakitz-fantasy-football,ishakir/shakitz-fantasy-football,ishakir/shakitz-fantasy-football,ishakir/shakitz-fantasy-football
ruby
## Code Before: class CommentsController < ApplicationController USER_KEY = :user TEXT_KEY = :text TIMESTAMP_KEY = :timestamp MAX_COMMENTS_TO_LOAD = 200 def create fail ArgumentError, 'Incorrect post submitted' unless params.key?(:request) comment = params[:request].symbolize_keys validate_comment_params(comment) comment[USER_KEY] = User.find(comment[USER_KEY]) comment[TIMESTAMP_KEY] = convert_time(comment[TIMESTAMP_KEY]) Comment.create!(comment) render json: { response: 'Success' } end def show comments = [] Comment.limit(MAX_COMMENTS_TO_LOAD).order('id asc').each do |c| tmp = c.as_json tmp[TIMESTAMP_KEY] = c[TIMESTAMP_KEY].to_f * 1000 tmp['user_name'] = User.find(c['user_id']).name comments.push(tmp) end render json: comments end def validate_comment_params(params) validate_all_parameters([USER_KEY, TEXT_KEY, TIMESTAMP_KEY], params) validate_user(params[USER_KEY]) end def validate_user(user) fail ArgumentError, 'User does not exist' unless User.find(user) end private def comment_params params.permit(:user, :timestamp, :text) end def convert_time(js_time) Time.zone.at(js_time.to_i / 1000.0) end end ## Instruction: Fix comments not appearing properly when you have more than the max comments amount ## Code After: class CommentsController < ApplicationController USER_KEY = :user TEXT_KEY = :text TIMESTAMP_KEY = :timestamp MAX_COMMENTS_TO_LOAD = 150 def create fail ArgumentError, 'Incorrect post submitted' unless params.key?(:request) comment = params[:request].symbolize_keys validate_comment_params(comment) comment[USER_KEY] = User.find(comment[USER_KEY]) comment[TIMESTAMP_KEY] = convert_time(comment[TIMESTAMP_KEY]) Comment.create!(comment) render json: { response: 'Success' } end def show comments = [] Comment.order('id desc').limit(MAX_COMMENTS_TO_LOAD).each do |c| tmp = c.as_json tmp[TIMESTAMP_KEY] = c[TIMESTAMP_KEY].to_f * 1000 tmp['user_name'] = User.find(c['user_id']).name comments.unshift(tmp) #Ensure earlier comments appear at top end render json: comments end def validate_comment_params(params) validate_all_parameters([USER_KEY, TEXT_KEY, TIMESTAMP_KEY], params) validate_user(params[USER_KEY]) end def validate_user(user) fail ArgumentError, 'User does not exist' unless User.find(user) end private def comment_params params.permit(:user, :timestamp, :text) end def convert_time(js_time) Time.zone.at(js_time.to_i / 1000.0) end end
class CommentsController < ApplicationController USER_KEY = :user TEXT_KEY = :text TIMESTAMP_KEY = :timestamp - MAX_COMMENTS_TO_LOAD = 200 ? ^ - + MAX_COMMENTS_TO_LOAD = 150 ? ^^ def create fail ArgumentError, 'Incorrect post submitted' unless params.key?(:request) comment = params[:request].symbolize_keys validate_comment_params(comment) comment[USER_KEY] = User.find(comment[USER_KEY]) comment[TIMESTAMP_KEY] = convert_time(comment[TIMESTAMP_KEY]) Comment.create!(comment) render json: { response: 'Success' } end def show comments = [] - Comment.limit(MAX_COMMENTS_TO_LOAD).order('id asc').each do |c| ? ---------------- + Comment.order('id desc').limit(MAX_COMMENTS_TO_LOAD).each do |c| ? +++++++++++++++++ tmp = c.as_json tmp[TIMESTAMP_KEY] = c[TIMESTAMP_KEY].to_f * 1000 tmp['user_name'] = User.find(c['user_id']).name - comments.push(tmp) + comments.unshift(tmp) #Ensure earlier comments appear at top end render json: comments end def validate_comment_params(params) validate_all_parameters([USER_KEY, TEXT_KEY, TIMESTAMP_KEY], params) validate_user(params[USER_KEY]) end def validate_user(user) fail ArgumentError, 'User does not exist' unless User.find(user) end private def comment_params params.permit(:user, :timestamp, :text) end def convert_time(js_time) Time.zone.at(js_time.to_i / 1000.0) end end
6
0.12766
3
3
03a4148e6fbf13f0d8446be08d92911b28306f2e
config/routes.rb
config/routes.rb
Rails.application.routes.draw do namespace :admin do resources :sites, param: :slug do resources :site_steps, only: [:show, :update, :edit] end resources :site_steps, only: [:show, :update, :new] resources :users resources :routes resources :site_templates resources :page_templates resources :site_users resources :datasets, only: :index do get 'dataset' end get '/', to: redirect('/admin/sites') resources :contexts end namespace :management do resources :sites, param: :slug, only: [:index], defaults: {format: :json} do resources :site_pages, shallow: true do member do put :toggle_enable end end get '/structure', to: 'sites#structure' put :update_structure end get '/', to: 'static_page#dashboard' end get '/no-permissions', to: 'static_page#no_permissions' # Auth get 'auth/login', to: 'auth#login' post 'auth/logout', to: 'auth#logout' DynamicRouter.load end
Rails.application.routes.draw do namespace :admin do resources :sites, param: :slug do resources :site_steps, only: [:show, :update, :edit] end resources :site_steps, only: [:show, :update, :new] resources :users resources :routes resources :site_templates resources :page_templates resources :site_users resources :datasets, only: :index do get 'dataset' end get '/', to: redirect('/admin/sites') resources :contexts end namespace :management do resources :sites, param: :slug, only: [:index] do resources :site_pages, shallow: true do member do put :toggle_enable end end get '/structure', to: 'sites#structure' put :update_structure end get '/', to: 'static_page#dashboard' end get '/no-permissions', to: 'static_page#no_permissions' # Auth get 'auth/login', to: 'auth#login' post 'auth/logout', to: 'auth#logout' DynamicRouter.load end
Fix for: Removed old action/view for the sites' listing in management
Fix for: Removed old action/view for the sites' listing in management
Ruby
mit
Vizzuality/forest-atlas-landscape-cms,Vizzuality/forest-atlas-landscape-cms,Vizzuality/forest-atlas-landscape-cms,Vizzuality/forest-atlas-landscape-cms
ruby
## Code Before: Rails.application.routes.draw do namespace :admin do resources :sites, param: :slug do resources :site_steps, only: [:show, :update, :edit] end resources :site_steps, only: [:show, :update, :new] resources :users resources :routes resources :site_templates resources :page_templates resources :site_users resources :datasets, only: :index do get 'dataset' end get '/', to: redirect('/admin/sites') resources :contexts end namespace :management do resources :sites, param: :slug, only: [:index], defaults: {format: :json} do resources :site_pages, shallow: true do member do put :toggle_enable end end get '/structure', to: 'sites#structure' put :update_structure end get '/', to: 'static_page#dashboard' end get '/no-permissions', to: 'static_page#no_permissions' # Auth get 'auth/login', to: 'auth#login' post 'auth/logout', to: 'auth#logout' DynamicRouter.load end ## Instruction: Fix for: Removed old action/view for the sites' listing in management ## Code After: Rails.application.routes.draw do namespace :admin do resources :sites, param: :slug do resources :site_steps, only: [:show, :update, :edit] end resources :site_steps, only: [:show, :update, :new] resources :users resources :routes resources :site_templates resources :page_templates resources :site_users resources :datasets, only: :index do get 'dataset' end get '/', to: redirect('/admin/sites') resources :contexts end namespace :management do resources :sites, param: :slug, only: [:index] do resources :site_pages, shallow: true do member do put :toggle_enable end end get '/structure', to: 'sites#structure' put :update_structure end get '/', to: 'static_page#dashboard' end get '/no-permissions', to: 'static_page#no_permissions' # Auth get 'auth/login', to: 'auth#login' post 'auth/logout', to: 'auth#logout' DynamicRouter.load end
Rails.application.routes.draw do namespace :admin do resources :sites, param: :slug do resources :site_steps, only: [:show, :update, :edit] end resources :site_steps, only: [:show, :update, :new] resources :users resources :routes resources :site_templates resources :page_templates resources :site_users resources :datasets, only: :index do get 'dataset' end get '/', to: redirect('/admin/sites') resources :contexts end namespace :management do - resources :sites, param: :slug, only: [:index], defaults: {format: :json} do ? --------------------------- + resources :sites, param: :slug, only: [:index] do resources :site_pages, shallow: true do member do put :toggle_enable end end get '/structure', to: 'sites#structure' put :update_structure end get '/', to: 'static_page#dashboard' end get '/no-permissions', to: 'static_page#no_permissions' # Auth get 'auth/login', to: 'auth#login' post 'auth/logout', to: 'auth#logout' DynamicRouter.load end
2
0.052632
1
1
bf085a18dbed4045e9d9e40ff7774de375a3cc88
ctl/Cargo.toml
ctl/Cargo.toml
[package] name = "sozuctl" description = "command line application to configure a sozu instance" repository = "https://github.com/sozu-proxy/sozu" readme = "README.md" documentation = "https://docs.rs/sozuctl" homepage = "http://sozu.io" version = "0.4.0" license = "AGPL-3.0" authors = ["Geoffroy Couprie <geo.couprie@gmail.com>"] categories = ["network-programming"] [[bin]] name = "sozuctl" [dependencies] clap = "^2.19.0" rand = "^0.3" prettytable-rs = "^0.6" sozu-command-lib = { version = "^0.4", path = "../command" } [features] unstable = [] [badges] travis-ci = { repository = "sozu-proxy/sozu" }
[package] name = "sozuctl" description = "command line application to configure a sozu instance" repository = "https://github.com/sozu-proxy/sozu" readme = "README.md" documentation = "https://docs.rs/sozuctl" homepage = "http://sozu.io" version = "0.4.0" license = "AGPL-3.0" authors = ["Geoffroy Couprie <geo.couprie@gmail.com>"] categories = ["network-programming"] [[bin]] name = "sozuctl" [dependencies] rand = "^0.3" prettytable-rs = "^0.6" sozu-command-lib = { version = "^0.4", path = "../command" } structopt = "0.1.0" structopt-derive = "0.1.0" [features] unstable = [] [badges] travis-ci = { repository = "sozu-proxy/sozu" }
Remove clap and add structopt deps
Remove clap and add structopt deps
TOML
agpl-3.0
sozu-proxy/sozu,sozu-proxy/sozu,sozu-proxy/sozu
toml
## Code Before: [package] name = "sozuctl" description = "command line application to configure a sozu instance" repository = "https://github.com/sozu-proxy/sozu" readme = "README.md" documentation = "https://docs.rs/sozuctl" homepage = "http://sozu.io" version = "0.4.0" license = "AGPL-3.0" authors = ["Geoffroy Couprie <geo.couprie@gmail.com>"] categories = ["network-programming"] [[bin]] name = "sozuctl" [dependencies] clap = "^2.19.0" rand = "^0.3" prettytable-rs = "^0.6" sozu-command-lib = { version = "^0.4", path = "../command" } [features] unstable = [] [badges] travis-ci = { repository = "sozu-proxy/sozu" } ## Instruction: Remove clap and add structopt deps ## Code After: [package] name = "sozuctl" description = "command line application to configure a sozu instance" repository = "https://github.com/sozu-proxy/sozu" readme = "README.md" documentation = "https://docs.rs/sozuctl" homepage = "http://sozu.io" version = "0.4.0" license = "AGPL-3.0" authors = ["Geoffroy Couprie <geo.couprie@gmail.com>"] categories = ["network-programming"] [[bin]] name = "sozuctl" [dependencies] rand = "^0.3" prettytable-rs = "^0.6" sozu-command-lib = { version = "^0.4", path = "../command" } structopt = "0.1.0" structopt-derive = "0.1.0" [features] unstable = [] [badges] travis-ci = { repository = "sozu-proxy/sozu" }
[package] name = "sozuctl" description = "command line application to configure a sozu instance" repository = "https://github.com/sozu-proxy/sozu" readme = "README.md" documentation = "https://docs.rs/sozuctl" homepage = "http://sozu.io" version = "0.4.0" license = "AGPL-3.0" authors = ["Geoffroy Couprie <geo.couprie@gmail.com>"] categories = ["network-programming"] [[bin]] name = "sozuctl" [dependencies] - clap = "^2.19.0" rand = "^0.3" prettytable-rs = "^0.6" sozu-command-lib = { version = "^0.4", path = "../command" } + structopt = "0.1.0" + structopt-derive = "0.1.0" [features] unstable = [] [badges] travis-ci = { repository = "sozu-proxy/sozu" }
3
0.115385
2
1
89b465b1d02a782f45f3ec6aa161ff27545d8fbe
kitten-scientists.js
kitten-scientists.js
prompt('Your bookmarklet is outdated. Please replace it with the value below.', "javascript:(function(){var d=document,s=d.createElement('script');s.src='https://rawgit.com/cameroncondry/cbc-kitten-scientists/master/kitten-scientists.user.js';d.body.appendChild(s);})();");
prompt('Your bookmarklet is outdated. Please replace it with the value below.', "javascript:(function(){var d=document,s=d.createElement('script');s.src='https://cdn.jsdelivr.net/gh/cameroncondry/cbc-kitten-scientists@master/kitten-scientists.user.js';d.body.appendChild(s);})();");
Update old url with url from README
Update old url with url from README
JavaScript
mit
oliversalzburg/cbc-kitten-scientists,oliversalzburg/cbc-kitten-scientists,cameroncondry/cbc-kitten-scientists,oliversalzburg/cbc-kitten-scientists
javascript
## Code Before: prompt('Your bookmarklet is outdated. Please replace it with the value below.', "javascript:(function(){var d=document,s=d.createElement('script');s.src='https://rawgit.com/cameroncondry/cbc-kitten-scientists/master/kitten-scientists.user.js';d.body.appendChild(s);})();"); ## Instruction: Update old url with url from README ## Code After: prompt('Your bookmarklet is outdated. Please replace it with the value below.', "javascript:(function(){var d=document,s=d.createElement('script');s.src='https://cdn.jsdelivr.net/gh/cameroncondry/cbc-kitten-scientists@master/kitten-scientists.user.js';d.body.appendChild(s);})();");
- prompt('Your bookmarklet is outdated. Please replace it with the value below.', "javascript:(function(){var d=document,s=d.createElement('script');s.src='https://rawgit.com/cameroncondry/cbc-kitten-scientists/master/kitten-scientists.user.js';d.body.appendChild(s);})();"); ? ^^^ ^^^^^^ ^ + prompt('Your bookmarklet is outdated. Please replace it with the value below.', "javascript:(function(){var d=document,s=d.createElement('script');s.src='https://cdn.jsdelivr.net/gh/cameroncondry/cbc-kitten-scientists@master/kitten-scientists.user.js';d.body.appendChild(s);})();"); ? ^^^^^^^^^^^^^^^^^ ^ ^
2
2
1
1
c0ebbd84a243afef2f88811e6a06c1f1d2b36297
catalog/Web_Apps_Services_Interaction/web_app_frameworks.yml
catalog/Web_Apps_Services_Interaction/web_app_frameworks.yml
name: Web App Frameworks description: projects: - bats - camping - cramp - cuba - e - gin - harbor - hobo - lattice - marley - merb-core - padrino - pakyow - rack - rails - ramaze - rango - raptor - renee - salad - scorched - sinatra - strelka - vanilla
name: Web App Frameworks description: projects: - bats - camping - cramp - cuba - e - gin - hanami - harbor - hobo - lattice - marley - merb-core - padrino - pakyow - rack - rails - ramaze - rango - raptor - renee - salad - scorched - sinatra - strelka - vanilla
Add Hanami to the "Web App Frameworks" category
Add Hanami to the "Web App Frameworks" category http://hanamirb.org/
YAML
mit
rubytoolbox/catalog
yaml
## Code Before: name: Web App Frameworks description: projects: - bats - camping - cramp - cuba - e - gin - harbor - hobo - lattice - marley - merb-core - padrino - pakyow - rack - rails - ramaze - rango - raptor - renee - salad - scorched - sinatra - strelka - vanilla ## Instruction: Add Hanami to the "Web App Frameworks" category http://hanamirb.org/ ## Code After: name: Web App Frameworks description: projects: - bats - camping - cramp - cuba - e - gin - hanami - harbor - hobo - lattice - marley - merb-core - padrino - pakyow - rack - rails - ramaze - rango - raptor - renee - salad - scorched - sinatra - strelka - vanilla
name: Web App Frameworks description: projects: - bats - camping - cramp - cuba - e - gin + - hanami - harbor - hobo - lattice - marley - merb-core - padrino - pakyow - rack - rails - ramaze - rango - raptor - renee - salad - scorched - sinatra - strelka - vanilla
1
0.037037
1
0
3d84a28b81023433175fab3bb560661678679f6f
README.md
README.md
[WordPress.com](https://wordpress.com/) has removed the preference to edit posts using the classic interface. This user script forces a redirect to the classic interface when the new edit interface is visited. ## Installation If you don't already have one, install [a browser extension](https://greasyfork.org/en/help/installing-user-scripts) that allows you to run user scripts. Then, visit the URL below: [https://github.com/tpenguinltg/wpcom-edit-post-redirect.user.js/raw/master/wpcom-edit-post-redirect.user.js](https://github.com/tpenguinltg/wpcom-edit-post-redirect.user.js/raw/master/wpcom-edit-post-redirect.user.js) Also on [Greasy Fork](https://greasyfork.org/en/scripts/8581-wordpress-com-edit-post-redirects). ## Known Issues * The new interface will start loading and appear before the redirect occurs ## Changelog * **v1.0.0:** Initial release * **v1.0.1:** Change updateURL to point to GitHub source * **v1.0.2:** Reduce to single regex call
[WordPress.com](https://wordpress.com/) has removed the preference to edit posts using the classic interface. This user script forces a redirect to the classic interface when the new edit interface is visited. ## Installation If you don't already have one, install [a browser extension](https://greasyfork.org/en/help/installing-user-scripts) that allows you to run user scripts. Then, visit the URL below: [https://github.com/tpenguinltg/wpcom-edit-post-redirect.user.js/raw/master/wpcom-edit-post-redirect.user.js](https://github.com/tpenguinltg/wpcom-edit-post-redirect.user.js/raw/master/wpcom-edit-post-redirect.user.js) Also on [Greasy Fork](https://greasyfork.org/en/scripts/8581-wordpress-com-edit-post-redirects). ## Known Issues * The new interface will sometimes start loading and appear before the redirect occurs * The redirection will likely fail if the site root is different from the installation root for Jetpack-enabled sites. e.g. the site is accessed from *http://example.com/*, but the installation root is *http://example.com/wordpress/*. ## Changelog * **v1.0.0:** Initial release * **v1.0.1:** Change updateURL to point to GitHub source * **v1.0.2:** Reduce to single regex call
Add redirection fail bug for Jetpack-enabled sites
Add redirection fail bug for Jetpack-enabled sites
Markdown
mpl-2.0
tpenguinltg/wpcom-edit-post-redirect.user.js
markdown
## Code Before: [WordPress.com](https://wordpress.com/) has removed the preference to edit posts using the classic interface. This user script forces a redirect to the classic interface when the new edit interface is visited. ## Installation If you don't already have one, install [a browser extension](https://greasyfork.org/en/help/installing-user-scripts) that allows you to run user scripts. Then, visit the URL below: [https://github.com/tpenguinltg/wpcom-edit-post-redirect.user.js/raw/master/wpcom-edit-post-redirect.user.js](https://github.com/tpenguinltg/wpcom-edit-post-redirect.user.js/raw/master/wpcom-edit-post-redirect.user.js) Also on [Greasy Fork](https://greasyfork.org/en/scripts/8581-wordpress-com-edit-post-redirects). ## Known Issues * The new interface will start loading and appear before the redirect occurs ## Changelog * **v1.0.0:** Initial release * **v1.0.1:** Change updateURL to point to GitHub source * **v1.0.2:** Reduce to single regex call ## Instruction: Add redirection fail bug for Jetpack-enabled sites ## Code After: [WordPress.com](https://wordpress.com/) has removed the preference to edit posts using the classic interface. This user script forces a redirect to the classic interface when the new edit interface is visited. ## Installation If you don't already have one, install [a browser extension](https://greasyfork.org/en/help/installing-user-scripts) that allows you to run user scripts. Then, visit the URL below: [https://github.com/tpenguinltg/wpcom-edit-post-redirect.user.js/raw/master/wpcom-edit-post-redirect.user.js](https://github.com/tpenguinltg/wpcom-edit-post-redirect.user.js/raw/master/wpcom-edit-post-redirect.user.js) Also on [Greasy Fork](https://greasyfork.org/en/scripts/8581-wordpress-com-edit-post-redirects). ## Known Issues * The new interface will sometimes start loading and appear before the redirect occurs * The redirection will likely fail if the site root is different from the installation root for Jetpack-enabled sites. e.g. the site is accessed from *http://example.com/*, but the installation root is *http://example.com/wordpress/*. ## Changelog * **v1.0.0:** Initial release * **v1.0.1:** Change updateURL to point to GitHub source * **v1.0.2:** Reduce to single regex call
[WordPress.com](https://wordpress.com/) has removed the preference to edit posts using the classic interface. This user script forces a redirect to the classic interface when the new edit interface is visited. ## Installation If you don't already have one, install [a browser extension](https://greasyfork.org/en/help/installing-user-scripts) that allows you to run user scripts. Then, visit the URL below: [https://github.com/tpenguinltg/wpcom-edit-post-redirect.user.js/raw/master/wpcom-edit-post-redirect.user.js](https://github.com/tpenguinltg/wpcom-edit-post-redirect.user.js/raw/master/wpcom-edit-post-redirect.user.js) Also on [Greasy Fork](https://greasyfork.org/en/scripts/8581-wordpress-com-edit-post-redirects). ## Known Issues - * The new interface will start loading and appear before the redirect occurs + * The new interface will sometimes start loading and appear before the redirect occurs ? ++++++++++ + * The redirection will likely fail if the site root is different from the installation root for Jetpack-enabled sites. + + e.g. the site is accessed from *http://example.com/*, but the installation root is *http://example.com/wordpress/*. ## Changelog * **v1.0.0:** Initial release * **v1.0.1:** Change updateURL to point to GitHub source * **v1.0.2:** Reduce to single regex call
5
0.3125
4
1
ed4d40571cd3f97259e943af0a5b9aa7419a0f78
talks_keeper/templates/talks_keeper/talk_form.html
talks_keeper/templates/talks_keeper/talk_form.html
{% extends 'talks_keeper/_base.html' %} {% block meta_title %}Додати розмову{% endblock meta_title %} {% block header %} <div class="row header"> <h4>Додати розмову</h4> </div> {% endblock header %} {% block content %} <form action="" method="post"> {% csrf_token %} {% include "talks_keeper/includes/render_fields.html" %} {% include "talks_keeper/includes/button.html" with button_value="Готово" %} </form> {% endblock content %}
{% extends 'talks_keeper/_base.html' %} {% load static from staticfiles %} {% block meta_title %}Додати розмову{% endblock meta_title %} {% block extra_css %} <link rel="stylesheet" href="{{ PORTAL_URL }}{% static 'css/pikaday.css' %}" /> {% endblock extra_css %} {% block header %} <div class="row header"> <h4>Додати розмову</h4> </div> {% endblock header %} {% block content %} <form action="" method="post"> {% csrf_token %} {% include "talks_keeper/includes/render_fields.html" %} {% include "talks_keeper/includes/button.html" with button_value="Готово" %} </form> {% endblock content %} {% block extra_js %} <script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.5.1/moment.min.js"></script> <script src="{{ PORTAL_URL }}{% static 'js/pikaday.js' %}"></script> <script> var rangeStart = new Pikaday({ field: document.getElementById('id_date'), firstDay: 1, fomat: 'YYYY-MM-DD', minDate: new Date(2016, 0, 1), maxDate: new Date(2018, 12, 31), }); </script> {% endblock extra_js %}
Add functionality for date field with pikaday.js
Add functionality for date field with pikaday.js
HTML
mit
samitnuk/talks_keeper,samitnuk/talks_keeper,samitnuk/talks_keeper
html
## Code Before: {% extends 'talks_keeper/_base.html' %} {% block meta_title %}Додати розмову{% endblock meta_title %} {% block header %} <div class="row header"> <h4>Додати розмову</h4> </div> {% endblock header %} {% block content %} <form action="" method="post"> {% csrf_token %} {% include "talks_keeper/includes/render_fields.html" %} {% include "talks_keeper/includes/button.html" with button_value="Готово" %} </form> {% endblock content %} ## Instruction: Add functionality for date field with pikaday.js ## Code After: {% extends 'talks_keeper/_base.html' %} {% load static from staticfiles %} {% block meta_title %}Додати розмову{% endblock meta_title %} {% block extra_css %} <link rel="stylesheet" href="{{ PORTAL_URL }}{% static 'css/pikaday.css' %}" /> {% endblock extra_css %} {% block header %} <div class="row header"> <h4>Додати розмову</h4> </div> {% endblock header %} {% block content %} <form action="" method="post"> {% csrf_token %} {% include "talks_keeper/includes/render_fields.html" %} {% include "talks_keeper/includes/button.html" with button_value="Готово" %} </form> {% endblock content %} {% block extra_js %} <script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.5.1/moment.min.js"></script> <script src="{{ PORTAL_URL }}{% static 'js/pikaday.js' %}"></script> <script> var rangeStart = new Pikaday({ field: document.getElementById('id_date'), firstDay: 1, fomat: 'YYYY-MM-DD', minDate: new Date(2016, 0, 1), maxDate: new Date(2018, 12, 31), }); </script> {% endblock extra_js %}
{% extends 'talks_keeper/_base.html' %} + {% load static from staticfiles %} + {% block meta_title %}Додати розмову{% endblock meta_title %} + + {% block extra_css %} + <link rel="stylesheet" href="{{ PORTAL_URL }}{% static 'css/pikaday.css' %}" /> + {% endblock extra_css %} {% block header %} <div class="row header"> <h4>Додати розмову</h4> </div> {% endblock header %} {% block content %} <form action="" method="post"> {% csrf_token %} {% include "talks_keeper/includes/render_fields.html" %} {% include "talks_keeper/includes/button.html" with button_value="Готово" %} </form> {% endblock content %} + + {% block extra_js %} + <script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.5.1/moment.min.js"></script> + <script src="{{ PORTAL_URL }}{% static 'js/pikaday.js' %}"></script> + <script> + var rangeStart = new Pikaday({ + field: document.getElementById('id_date'), + firstDay: 1, + fomat: 'YYYY-MM-DD', + minDate: new Date(2016, 0, 1), + maxDate: new Date(2018, 12, 31), + }); + </script> + {% endblock extra_js %}
20
1.176471
20
0
ae25bd624023adc27e1e9bc5dfceaf2c527766ac
vector-array/test.sh
vector-array/test.sh
echo "Standard compilation (64-bit?)" g++ -std=c++98 tmp.cpp -o tmp ./tmp echo "" echo "" echo "32-bit" g++ -m32 -std=c++98 tmp.cpp -o tmp ./tmp
echo "Standard compilation (64-bit?)" g++ -std=c++98 vector-array.cpp -o tmp ./tmp echo "" echo "" echo "32-bit" g++ -m32 -std=c++98 vector-array.cpp -o tmp ./tmp
Fix previous commit: wrong filename
Fix previous commit: wrong filename
Shell
mit
smanilov/playground,smanilov/playground,smanilov/playground,smanilov/playground,smanilov/playground,smanilov/playground
shell
## Code Before: echo "Standard compilation (64-bit?)" g++ -std=c++98 tmp.cpp -o tmp ./tmp echo "" echo "" echo "32-bit" g++ -m32 -std=c++98 tmp.cpp -o tmp ./tmp ## Instruction: Fix previous commit: wrong filename ## Code After: echo "Standard compilation (64-bit?)" g++ -std=c++98 vector-array.cpp -o tmp ./tmp echo "" echo "" echo "32-bit" g++ -m32 -std=c++98 vector-array.cpp -o tmp ./tmp
echo "Standard compilation (64-bit?)" - g++ -std=c++98 tmp.cpp -o tmp ? ^^ + g++ -std=c++98 vector-array.cpp -o tmp ? +++ ^^^^^^^^ ./tmp echo "" echo "" echo "32-bit" - g++ -m32 -std=c++98 tmp.cpp -o tmp ? ^^ + g++ -m32 -std=c++98 vector-array.cpp -o tmp ? +++ ^^^^^^^^ ./tmp
4
0.4
2
2
4cc831b4548b9af9a69c0469b5e39fdd2c58e2fe
.travis.yml
.travis.yml
dist: trusty sudo: required language: c compile: - gcc - clang before_install: - sudo add-apt-repository -y ppa:ben-collins/libjwt - sudo apt-get update -qq - sudo apt-get install -y -qq libjansson-dev libssl-dev libjwt-dev script: - autoreconf -i && ./configure && make && make install
dist: trusty sudo: required language: c compile: - gcc - clang before_install: - sudo add-apt-repository -y ppa:ben-collins/libjwt - sudo apt-get update -qq - sudo apt-get install -y -qq libjansson-dev libssl-dev libjwt-dev script: - autoreconf -i && ./configure && make
Remove install step from Travis CI
Remove install step from Travis CI Signed-off-by: Tatiana Jamison <46e5158282b180dbcdc0cb6cd988c23f7f8ba92e@jaguarlandrover.com>
YAML
mpl-2.0
GENIVI/rvi_lib,GENIVI/rvi_lib,tjamison/rvi_lib,tjamison/rvi_lib
yaml
## Code Before: dist: trusty sudo: required language: c compile: - gcc - clang before_install: - sudo add-apt-repository -y ppa:ben-collins/libjwt - sudo apt-get update -qq - sudo apt-get install -y -qq libjansson-dev libssl-dev libjwt-dev script: - autoreconf -i && ./configure && make && make install ## Instruction: Remove install step from Travis CI Signed-off-by: Tatiana Jamison <46e5158282b180dbcdc0cb6cd988c23f7f8ba92e@jaguarlandrover.com> ## Code After: dist: trusty sudo: required language: c compile: - gcc - clang before_install: - sudo add-apt-repository -y ppa:ben-collins/libjwt - sudo apt-get update -qq - sudo apt-get install -y -qq libjansson-dev libssl-dev libjwt-dev script: - autoreconf -i && ./configure && make
dist: trusty sudo: required language: c compile: - gcc - clang before_install: - sudo add-apt-repository -y ppa:ben-collins/libjwt - sudo apt-get update -qq - sudo apt-get install -y -qq libjansson-dev libssl-dev libjwt-dev script: - - autoreconf -i && ./configure && make && make install ? --------------- + - autoreconf -i && ./configure && make
2
0.166667
1
1
4d73eb2a7e06e1e2607a2abfae1063b9969e70a0
strichliste/strichliste/models.py
strichliste/strichliste/models.py
from django.db import models from django.db.models import Sum class User(models.Model): name = models.CharField(max_length=254, unique=True) create_date = models.DateTimeField(auto_now_add=True) active = models.BooleanField(default=True) mail_address = models.EmailField(null=True) @property def last_transaction(self): try: return self.transactions.last().create_date except AttributeError: return None @property def balance(self): return self.transactions.aggregate(sum=Sum('value'))['sum'] or 0 def to_full_dict(self): return {'id': self.id, 'name': self.name, 'mail_address': self.mail_address, 'balance': self.balance, 'last_transaction': self.last_transaction} def to_dict(self): return {'id': self.id, 'name': self.name, 'balance': self.balance, 'last_transaction': self.last_transaction} def __str__(self): return self.name class Transaction(models.Model): user = models.ForeignKey('User', related_name='transactions', on_delete=models.PROTECT, db_index=True) create_date = models.DateTimeField(auto_now_add=True) value = models.IntegerField() def to_dict(self): return {'id': self.id, 'create_date': self.create_date, 'value': self.value} class Meta: ordering = ('create_date',)
from django.db import models from django.db.models import Sum class User(models.Model): name = models.CharField(max_length=254, unique=True) create_date = models.DateTimeField(auto_now_add=True) active = models.BooleanField(default=True) mail_address = models.EmailField(null=True) @property def last_transaction(self): try: return self.transactions.last().create_date except AttributeError: return None @property def balance(self): return self.transactions.aggregate(sum=Sum('value'))['sum'] or 0 def to_full_dict(self): return {'id': self.id, 'name': self.name, 'mail_address': self.mail_address, 'balance': self.balance, 'last_transaction': self.last_transaction} def to_dict(self): return {'id': self.id, 'name': self.name, 'balance': self.balance, 'last_transaction': self.last_transaction} def __str__(self): return self.name class Transaction(models.Model): user = models.ForeignKey('User', related_name='transactions', on_delete=models.PROTECT, db_index=True) create_date = models.DateTimeField(auto_now_add=True) value = models.IntegerField() def to_dict(self): return {'id': self.id, 'create_date': self.create_date, 'value': self.value, 'user': self.user_id} class Meta: ordering = ('create_date',)
Add user_id to returned transactions
Add user_id to returned transactions
Python
mit
Don42/strichliste-django,hackerspace-bootstrap/strichliste-django
python
## Code Before: from django.db import models from django.db.models import Sum class User(models.Model): name = models.CharField(max_length=254, unique=True) create_date = models.DateTimeField(auto_now_add=True) active = models.BooleanField(default=True) mail_address = models.EmailField(null=True) @property def last_transaction(self): try: return self.transactions.last().create_date except AttributeError: return None @property def balance(self): return self.transactions.aggregate(sum=Sum('value'))['sum'] or 0 def to_full_dict(self): return {'id': self.id, 'name': self.name, 'mail_address': self.mail_address, 'balance': self.balance, 'last_transaction': self.last_transaction} def to_dict(self): return {'id': self.id, 'name': self.name, 'balance': self.balance, 'last_transaction': self.last_transaction} def __str__(self): return self.name class Transaction(models.Model): user = models.ForeignKey('User', related_name='transactions', on_delete=models.PROTECT, db_index=True) create_date = models.DateTimeField(auto_now_add=True) value = models.IntegerField() def to_dict(self): return {'id': self.id, 'create_date': self.create_date, 'value': self.value} class Meta: ordering = ('create_date',) ## Instruction: Add user_id to returned transactions ## Code After: from django.db import models from django.db.models import Sum class User(models.Model): name = models.CharField(max_length=254, unique=True) create_date = models.DateTimeField(auto_now_add=True) active = models.BooleanField(default=True) mail_address = models.EmailField(null=True) @property def last_transaction(self): try: return self.transactions.last().create_date except AttributeError: return None @property def balance(self): return self.transactions.aggregate(sum=Sum('value'))['sum'] or 0 def to_full_dict(self): return {'id': self.id, 'name': self.name, 'mail_address': self.mail_address, 'balance': self.balance, 'last_transaction': self.last_transaction} def to_dict(self): return {'id': self.id, 'name': self.name, 'balance': self.balance, 'last_transaction': self.last_transaction} def __str__(self): return self.name class Transaction(models.Model): user = models.ForeignKey('User', related_name='transactions', on_delete=models.PROTECT, db_index=True) create_date = models.DateTimeField(auto_now_add=True) value = models.IntegerField() def to_dict(self): return {'id': self.id, 'create_date': self.create_date, 'value': self.value, 'user': self.user_id} class Meta: ordering = ('create_date',)
from django.db import models from django.db.models import Sum class User(models.Model): name = models.CharField(max_length=254, unique=True) create_date = models.DateTimeField(auto_now_add=True) active = models.BooleanField(default=True) mail_address = models.EmailField(null=True) @property def last_transaction(self): try: return self.transactions.last().create_date except AttributeError: return None @property def balance(self): return self.transactions.aggregate(sum=Sum('value'))['sum'] or 0 def to_full_dict(self): return {'id': self.id, 'name': self.name, 'mail_address': self.mail_address, 'balance': self.balance, 'last_transaction': self.last_transaction} def to_dict(self): return {'id': self.id, 'name': self.name, 'balance': self.balance, 'last_transaction': self.last_transaction} def __str__(self): return self.name class Transaction(models.Model): user = models.ForeignKey('User', related_name='transactions', on_delete=models.PROTECT, db_index=True) create_date = models.DateTimeField(auto_now_add=True) value = models.IntegerField() def to_dict(self): return {'id': self.id, 'create_date': self.create_date, - 'value': self.value} ? ^ + 'value': self.value, ? ^ + 'user': self.user_id} class Meta: ordering = ('create_date',)
3
0.065217
2
1
866d34067f7c4fc7262e27b0304c2f7f204c3e7d
lib/mumuki/laboratory/controllers/embedded_mode.rb
lib/mumuki/laboratory/controllers/embedded_mode.rb
module Mumuki::Laboratory::Controllers::EmbeddedMode extend ActiveSupport::Concern included do helper_method :embedded_mode?, :standalone_mode? end def embedded_mode? @embedded_mode ||= params[:embed] == 'true' && Organization.current.embeddable? end def standalone_mode? !embedded_mode? end def enable_embedded_rendering return unless embedded_mode? allow_parent_iframe! render layout: 'embedded' end private def allow_parent_iframe! response.set_header 'X-Frame-Options', 'ALLOWALL' end end
module Mumuki::Laboratory::Controllers::EmbeddedMode extend ActiveSupport::Concern included do helper_method :embedded_mode?, :standalone_mode? end def embedded_mode? @embedded_mode ||= params[:embed] == 'true' && Organization.current.embeddable? end def standalone_mode? !embedded_mode? end def enable_embedded_rendering return unless embedded_mode? allow_parent_iframe! render layout: 'embedded' end private def allow_parent_iframe! response.delete_header 'X-Frame-Options' end end
Remove header instead of setting to invalid value
Remove header instead of setting to invalid value
Ruby
agpl-3.0
mumuki/mumuki-laboratory,mumuki/mumuki-laboratory,mumuki/mumuki-laboratory,mumuki/mumuki-laboratory
ruby
## Code Before: module Mumuki::Laboratory::Controllers::EmbeddedMode extend ActiveSupport::Concern included do helper_method :embedded_mode?, :standalone_mode? end def embedded_mode? @embedded_mode ||= params[:embed] == 'true' && Organization.current.embeddable? end def standalone_mode? !embedded_mode? end def enable_embedded_rendering return unless embedded_mode? allow_parent_iframe! render layout: 'embedded' end private def allow_parent_iframe! response.set_header 'X-Frame-Options', 'ALLOWALL' end end ## Instruction: Remove header instead of setting to invalid value ## Code After: module Mumuki::Laboratory::Controllers::EmbeddedMode extend ActiveSupport::Concern included do helper_method :embedded_mode?, :standalone_mode? end def embedded_mode? @embedded_mode ||= params[:embed] == 'true' && Organization.current.embeddable? end def standalone_mode? !embedded_mode? end def enable_embedded_rendering return unless embedded_mode? allow_parent_iframe! render layout: 'embedded' end private def allow_parent_iframe! response.delete_header 'X-Frame-Options' end end
module Mumuki::Laboratory::Controllers::EmbeddedMode extend ActiveSupport::Concern included do helper_method :embedded_mode?, :standalone_mode? end def embedded_mode? @embedded_mode ||= params[:embed] == 'true' && Organization.current.embeddable? end def standalone_mode? !embedded_mode? end def enable_embedded_rendering return unless embedded_mode? allow_parent_iframe! render layout: 'embedded' end private def allow_parent_iframe! - response.set_header 'X-Frame-Options', 'ALLOWALL' ? ^ ------------ + response.delete_header 'X-Frame-Options' ? ^^^ + end end
2
0.071429
1
1
f5564fca97922e7132169a857a08994a7f3eab43
content/issues/127.markdown
content/issues/127.markdown
<!-- 2018-10-04 unpublished --> Welcome to another issue of Haskell Weekly! [Haskell](https://haskell-lang.org) is a safe, purely functional programming language with a fast, concurrent runtime. This is a weekly summary of what's going on in its community. ## Featured - [Komposition: The video editor built for screencasters (in Haskell!)](https://owickstrom.github.io/komposition/) > Komposition is the video editor built for screencasters. It lets you focus on producing and publishing quality content, instead of spending all of your time in complicated video editors. Komposition automatically detects scenes in screen capture video, automatically detects sentences in voice-over audio recordings, and features a high-productivity editing workflow based on keyboard navigation. ## Jobs undefined ## In brief undefined ## Package of the week undefined ## Call for participation undefined ## Events undefined
<!-- 2018-10-04 unpublished --> Welcome to another issue of Haskell Weekly! [Haskell](https://haskell-lang.org) is a safe, purely functional programming language with a fast, concurrent runtime. This is a weekly summary of what's going on in its community. ## Featured - [Komposition: The video editor built for screencasters (in Haskell!)](https://owickstrom.github.io/komposition/) > Komposition is the video editor built for screencasters. It lets you focus on producing and publishing quality content, instead of spending all of your time in complicated video editors. Komposition automatically detects scenes in screen capture video, automatically detects sentences in voice-over audio recordings, and features a high-productivity editing workflow based on keyboard navigation. - [Testing Our Ruby and Haskell Implementations Side-By-Side](https://blog.mpowered.team/posts/2018-testing-ruby-haskell-implementations.html) > After almost ten years of continuous development, Mpowered's calculation engine has become a maintenance and innovation bottleneck. We decided to extract and replace the Empowerment component with a new solution built in Haskell. This posts describes how we are testing during the transition. ## Jobs undefined ## In brief undefined ## Package of the week undefined ## Call for participation undefined ## Events undefined
Add link to Mpowered post
Add link to Mpowered post
Markdown
mit
haskellweekly/haskellweekly.github.io,haskellweekly/haskellweekly.github.io
markdown
## Code Before: <!-- 2018-10-04 unpublished --> Welcome to another issue of Haskell Weekly! [Haskell](https://haskell-lang.org) is a safe, purely functional programming language with a fast, concurrent runtime. This is a weekly summary of what's going on in its community. ## Featured - [Komposition: The video editor built for screencasters (in Haskell!)](https://owickstrom.github.io/komposition/) > Komposition is the video editor built for screencasters. It lets you focus on producing and publishing quality content, instead of spending all of your time in complicated video editors. Komposition automatically detects scenes in screen capture video, automatically detects sentences in voice-over audio recordings, and features a high-productivity editing workflow based on keyboard navigation. ## Jobs undefined ## In brief undefined ## Package of the week undefined ## Call for participation undefined ## Events undefined ## Instruction: Add link to Mpowered post ## Code After: <!-- 2018-10-04 unpublished --> Welcome to another issue of Haskell Weekly! [Haskell](https://haskell-lang.org) is a safe, purely functional programming language with a fast, concurrent runtime. This is a weekly summary of what's going on in its community. ## Featured - [Komposition: The video editor built for screencasters (in Haskell!)](https://owickstrom.github.io/komposition/) > Komposition is the video editor built for screencasters. It lets you focus on producing and publishing quality content, instead of spending all of your time in complicated video editors. Komposition automatically detects scenes in screen capture video, automatically detects sentences in voice-over audio recordings, and features a high-productivity editing workflow based on keyboard navigation. - [Testing Our Ruby and Haskell Implementations Side-By-Side](https://blog.mpowered.team/posts/2018-testing-ruby-haskell-implementations.html) > After almost ten years of continuous development, Mpowered's calculation engine has become a maintenance and innovation bottleneck. We decided to extract and replace the Empowerment component with a new solution built in Haskell. This posts describes how we are testing during the transition. ## Jobs undefined ## In brief undefined ## Package of the week undefined ## Call for participation undefined ## Events undefined
<!-- 2018-10-04 unpublished --> Welcome to another issue of Haskell Weekly! [Haskell](https://haskell-lang.org) is a safe, purely functional programming language with a fast, concurrent runtime. This is a weekly summary of what's going on in its community. ## Featured - [Komposition: The video editor built for screencasters (in Haskell!)](https://owickstrom.github.io/komposition/) > Komposition is the video editor built for screencasters. It lets you focus on producing and publishing quality content, instead of spending all of your time in complicated video editors. Komposition automatically detects scenes in screen capture video, automatically detects sentences in voice-over audio recordings, and features a high-productivity editing workflow based on keyboard navigation. + + - [Testing Our Ruby and Haskell Implementations Side-By-Side](https://blog.mpowered.team/posts/2018-testing-ruby-haskell-implementations.html) + + > After almost ten years of continuous development, Mpowered's calculation engine has become a maintenance and innovation bottleneck. We decided to extract and replace the Empowerment component with a new solution built in Haskell. This posts describes how we are testing during the transition. ## Jobs undefined ## In brief undefined ## Package of the week undefined ## Call for participation undefined ## Events undefined
4
0.129032
4
0
ae43fd8cacc01b74ddaa5718a41d58387bd35418
.travis.yml
.travis.yml
language: node_js node_js: - "0.10" before_script: - "IOJS_VERSION=v1.0.1; wget https://iojs.org/dist/${IOJS_VERSION}/iojs-${IOJS_VERSION}-linux-x64.tar.xz && tar xvfJ iojs-${IOJS_VERSION}-linux-x64.tar.xz && sudo mv iojs-${IOJS_VERSION}-linux-x64/bin/iojs /usr/local/bin" script: - "npm run build && npm test" - "alias node=iojs; npm run build && npm test" after_script: - "istanbul cover --verbose --dir coverage node_modules/.bin/_mocha tests/tests.js -- -u exports -R spec && cat coverage/lcov.info | coveralls; rm -rf coverage/lcov*"
language: node_js node_js: - "0.10" - "0.12" - "iojs" script: - "npm run build && npm test" after_script: - "istanbul cover --verbose --dir coverage node_modules/.bin/_mocha tests/tests.js -- -u exports -R spec && cat coverage/lcov.info | coveralls; rm -rf coverage/lcov*"
Test in io.js and Node.js v0.12.x
Test in io.js and Node.js v0.12.x
YAML
mit
mathiasbynens/regexpu
yaml
## Code Before: language: node_js node_js: - "0.10" before_script: - "IOJS_VERSION=v1.0.1; wget https://iojs.org/dist/${IOJS_VERSION}/iojs-${IOJS_VERSION}-linux-x64.tar.xz && tar xvfJ iojs-${IOJS_VERSION}-linux-x64.tar.xz && sudo mv iojs-${IOJS_VERSION}-linux-x64/bin/iojs /usr/local/bin" script: - "npm run build && npm test" - "alias node=iojs; npm run build && npm test" after_script: - "istanbul cover --verbose --dir coverage node_modules/.bin/_mocha tests/tests.js -- -u exports -R spec && cat coverage/lcov.info | coveralls; rm -rf coverage/lcov*" ## Instruction: Test in io.js and Node.js v0.12.x ## Code After: language: node_js node_js: - "0.10" - "0.12" - "iojs" script: - "npm run build && npm test" after_script: - "istanbul cover --verbose --dir coverage node_modules/.bin/_mocha tests/tests.js -- -u exports -R spec && cat coverage/lcov.info | coveralls; rm -rf coverage/lcov*"
language: node_js node_js: - "0.10" - before_script: - - "IOJS_VERSION=v1.0.1; wget https://iojs.org/dist/${IOJS_VERSION}/iojs-${IOJS_VERSION}-linux-x64.tar.xz && tar xvfJ iojs-${IOJS_VERSION}-linux-x64.tar.xz && sudo mv iojs-${IOJS_VERSION}-linux-x64/bin/iojs /usr/local/bin" + - "0.12" + - "iojs" script: - "npm run build && npm test" - - "alias node=iojs; npm run build && npm test" after_script: - "istanbul cover --verbose --dir coverage node_modules/.bin/_mocha tests/tests.js -- -u exports -R spec && cat coverage/lcov.info | coveralls; rm -rf coverage/lcov*"
5
0.5
2
3
9ad4944b8c37902e80c684f8484105ff952f3dba
tests/test_program.py
tests/test_program.py
import io from hypothesis import given from hypothesis.strategies import lists, integers from sensibility import Program, vocabulary #semicolon = vocabulary.to_index(';') @given(lists(integers(min_value=vocabulary.start_token_index + 1, max_value=vocabulary.end_token_index - 1), min_size=1)) def test_program_random(tokens): p = Program('<none>', tokens) assert 0 <= p.random_token_index() < len(p) assert 0 <= p.random_insertion_point() <= len(p) @given(lists(integers(min_value=vocabulary.start_token_index + 1, max_value=vocabulary.end_token_index - 1), min_size=1)) def test_program_print(tokens): program = Program('<none>', tokens) with io.StringIO() as output: program.print(output) output_text = output.getvalue() assert len(program) >= 1 assert len(program) == len(output_text.split())
import io from hypothesis import given from hypothesis.strategies import builds, lists, integers, just from sensibility import Program, vocabulary tokens = integers(min_value=vocabulary.start_token_index + 1, max_value=vocabulary.end_token_index - 1) vectors = lists(tokens, min_size=1) programs = builds(Program, just('<test>'), vectors) @given(programs) def test_program_random(program): assert 0 <= program.random_token_index() < len(program) assert 0 <= program.random_insertion_point() <= len(program) @given(programs) def test_program_print(program): with io.StringIO() as output: program.print(output) output_text = output.getvalue() assert len(program) == len(output_text.split())
Clean up test a bit.
Clean up test a bit.
Python
apache-2.0
naturalness/sensibility,naturalness/sensibility,naturalness/sensibility,naturalness/sensibility
python
## Code Before: import io from hypothesis import given from hypothesis.strategies import lists, integers from sensibility import Program, vocabulary #semicolon = vocabulary.to_index(';') @given(lists(integers(min_value=vocabulary.start_token_index + 1, max_value=vocabulary.end_token_index - 1), min_size=1)) def test_program_random(tokens): p = Program('<none>', tokens) assert 0 <= p.random_token_index() < len(p) assert 0 <= p.random_insertion_point() <= len(p) @given(lists(integers(min_value=vocabulary.start_token_index + 1, max_value=vocabulary.end_token_index - 1), min_size=1)) def test_program_print(tokens): program = Program('<none>', tokens) with io.StringIO() as output: program.print(output) output_text = output.getvalue() assert len(program) >= 1 assert len(program) == len(output_text.split()) ## Instruction: Clean up test a bit. ## Code After: import io from hypothesis import given from hypothesis.strategies import builds, lists, integers, just from sensibility import Program, vocabulary tokens = integers(min_value=vocabulary.start_token_index + 1, max_value=vocabulary.end_token_index - 1) vectors = lists(tokens, min_size=1) programs = builds(Program, just('<test>'), vectors) @given(programs) def test_program_random(program): assert 0 <= program.random_token_index() < len(program) assert 0 <= program.random_insertion_point() <= len(program) @given(programs) def test_program_print(program): with io.StringIO() as output: program.print(output) output_text = output.getvalue() assert len(program) == len(output_text.split())
import io from hypothesis import given - from hypothesis.strategies import lists, integers + from hypothesis.strategies import builds, lists, integers, just ? ++++++++ ++++++ from sensibility import Program, vocabulary - #semicolon = vocabulary.to_index(';') - @given(lists(integers(min_value=vocabulary.start_token_index + 1, ? ^^^^ --- ^^^ + tokens = integers(min_value=vocabulary.start_token_index + 1, ? ^^^ ^^^ - max_value=vocabulary.end_token_index - 1), ? ---- - + max_value=vocabulary.end_token_index - 1) + vectors = lists(tokens, min_size=1) + programs = builds(Program, just('<test>'), vectors) - min_size=1)) - def test_program_random(tokens): - p = Program('<none>', tokens) - assert 0 <= p.random_token_index() < len(p) - assert 0 <= p.random_insertion_point() <= len(p) - @given(lists(integers(min_value=vocabulary.start_token_index + 1, - max_value=vocabulary.end_token_index - 1), - min_size=1)) + @given(programs) + def test_program_random(program): + assert 0 <= program.random_token_index() < len(program) + assert 0 <= program.random_insertion_point() <= len(program) + + + @given(programs) - def test_program_print(tokens): ? ^ ^^^^ + def test_program_print(program): ? ^^ ^^^^ - program = Program('<none>', tokens) with io.StringIO() as output: program.print(output) output_text = output.getvalue() - assert len(program) >= 1 assert len(program) == len(output_text.split())
28
0.965517
13
15
3bbe94d9ef4bc4299eb45162c6dbd57b3eeb0185
imouto/ansible/roles/setup_database/files/install_updates.sh
imouto/ansible/roles/setup_database/files/install_updates.sh
set -e -u #Date of the schema file that was used to build the initial db schema_date="2013-04-06" if [ "$#" -lt 5 ] ; then exit 1 fi function get_update_files { ls -1 "$1" } files=(`get_update_files "$4"`) status_file="$5""/.last_db_update" if [[ -f $status_file ]] ; then last_update=(`cat $status_file`) if [[ "$last_update" > "$schema_date" ]] ; then schema_date="$last_update" fi fi for file in "${files[@]}" do if [[ "$file" > "$schema_date" ]] ; then echo 'Imported '$file'' mysql -u "$1" -p"$2" "$3" < "$4"/"$file" else echo 'Skipped '$file'' fi done echo `ls -1 "$4" | tail -1` > $status_file #Update the .last_update file
set -e -u #Date of the schema file that was used to build the initial db schema_date="2013-04-06" if [ "$#" -lt 5 ] ; then exit 1 fi function get_update_files { ls -1 "$1" } mysql_user="$1" mysql_password="$2" mysql_db="$3" update_dir="$4" status_file="$5""/.last_db_update" files=(`get_update_files "$update_dir"`) if [[ -f $status_file ]] ; then last_update=`cat "$status_file" ` if [[ "$last_update" > "$schema_date" ]] ; then schema_date="$last_update" fi fi for file in "${files[@]}" do if [[ "$file" > "$schema_date" ]] ; then echo 'Imported '$file'' mysql -u "$mysql_user" -p"$mysql_password" "$mysql_db" < "$update_dir"/"$file" else echo 'Skipped '$file'' fi done echo `ls -1 "$4" | tail -1` > "$status_file" #Update the .last_update file
Fix typos and use meaningful variable names in install_udpates.sh
setup_database/files: Fix typos and use meaningful variable names in install_udpates.sh
Shell
agpl-3.0
Tatoeba/tatoeba2,Tatoeba/tatoeba2,Tatoeba/tatoeba2,Tatoeba/tatoeba2,Tatoeba/tatoeba2
shell
## Code Before: set -e -u #Date of the schema file that was used to build the initial db schema_date="2013-04-06" if [ "$#" -lt 5 ] ; then exit 1 fi function get_update_files { ls -1 "$1" } files=(`get_update_files "$4"`) status_file="$5""/.last_db_update" if [[ -f $status_file ]] ; then last_update=(`cat $status_file`) if [[ "$last_update" > "$schema_date" ]] ; then schema_date="$last_update" fi fi for file in "${files[@]}" do if [[ "$file" > "$schema_date" ]] ; then echo 'Imported '$file'' mysql -u "$1" -p"$2" "$3" < "$4"/"$file" else echo 'Skipped '$file'' fi done echo `ls -1 "$4" | tail -1` > $status_file #Update the .last_update file ## Instruction: setup_database/files: Fix typos and use meaningful variable names in install_udpates.sh ## Code After: set -e -u #Date of the schema file that was used to build the initial db schema_date="2013-04-06" if [ "$#" -lt 5 ] ; then exit 1 fi function get_update_files { ls -1 "$1" } mysql_user="$1" mysql_password="$2" mysql_db="$3" update_dir="$4" status_file="$5""/.last_db_update" files=(`get_update_files "$update_dir"`) if [[ -f $status_file ]] ; then last_update=`cat "$status_file" ` if [[ "$last_update" > "$schema_date" ]] ; then schema_date="$last_update" fi fi for file in "${files[@]}" do if [[ "$file" > "$schema_date" ]] ; then echo 'Imported '$file'' mysql -u "$mysql_user" -p"$mysql_password" "$mysql_db" < "$update_dir"/"$file" else echo 'Skipped '$file'' fi done echo `ls -1 "$4" | tail -1` > "$status_file" #Update the .last_update file
set -e -u #Date of the schema file that was used to build the initial db schema_date="2013-04-06" if [ "$#" -lt 5 ] ; then exit 1 fi function get_update_files { ls -1 "$1" } - files=(`get_update_files "$4"`) - + mysql_user="$1" + mysql_password="$2" + mysql_db="$3" + update_dir="$4" status_file="$5""/.last_db_update" + files=(`get_update_files "$update_dir"`) + if [[ -f $status_file ]] ; then - last_update=(`cat $status_file`) ? - - + last_update=`cat "$status_file" ` ? + ++ if [[ "$last_update" > "$schema_date" ]] ; then schema_date="$last_update" fi fi for file in "${files[@]}" do if [[ "$file" > "$schema_date" ]] ; then echo 'Imported '$file'' - mysql -u "$1" -p"$2" "$3" < "$4"/"$file" + mysql -u "$mysql_user" -p"$mysql_password" "$mysql_db" < "$update_dir"/"$file" else echo 'Skipped '$file'' fi done - echo `ls -1 "$4" | tail -1` > $status_file #Update the .last_update file + echo `ls -1 "$4" | tail -1` > "$status_file" #Update the .last_update file ? + +
14
0.388889
9
5
526091754aff9769d8070d62e315fe8b19de495f
app/models/spree/variant_decorator.rb
app/models/spree/variant_decorator.rb
Spree::Variant.class_eval do # Sorts by option value position and other criteria after variant position. scope :order_by_option_value, ->{ includes(:option_values).references(:option_values).unscope(:order).order( position: :asc ).order( 'spree_option_values.position ASC' ).order( is_master: :desc, id: :asc ).uniq } def first_option_value self.option_values.where(option_type_id: self.product.first_option_type.id).order(position: :asc).first end def stock_message if !self.in_stock? if self.is_backorderable? "#{Spree.t(:temporarily_out_of_stock)}. #{Spree.t(:deliver_when_available)}." else "#{Spree.t(:out_of_stock)}." end else nil end end end
Spree::Variant.class_eval do # Sorts by option value position and other criteria after variant position. scope :order_by_option_value, ->{ includes(:option_values).references(:option_values).unscope(:order).order( position: :asc ).order( 'spree_option_values.position ASC' ).order( is_master: :desc, id: :asc ).uniq } # Returns this variant's option value for its product's first option type. def first_option_value self.option_values.where(option_type_id: self.product.first_option_type.try(:id)).order(position: :asc).first end def stock_message if !self.in_stock? if self.is_backorderable? "#{Spree.t(:temporarily_out_of_stock)}. #{Spree.t(:deliver_when_available)}." else "#{Spree.t(:out_of_stock)}." end else nil end end end
Return nil from first_option_value if the product has no option types.
Return nil from first_option_value if the product has no option types.
Ruby
bsd-3-clause
deseretbook/solidus_variant_picker,deseretbook/solidus_variant_picker,deseretbook/spree_variant_picker,deseretbook/spree_variant_picker,deseretbook/spree_variant_picker,deseretbook/solidus_variant_picker
ruby
## Code Before: Spree::Variant.class_eval do # Sorts by option value position and other criteria after variant position. scope :order_by_option_value, ->{ includes(:option_values).references(:option_values).unscope(:order).order( position: :asc ).order( 'spree_option_values.position ASC' ).order( is_master: :desc, id: :asc ).uniq } def first_option_value self.option_values.where(option_type_id: self.product.first_option_type.id).order(position: :asc).first end def stock_message if !self.in_stock? if self.is_backorderable? "#{Spree.t(:temporarily_out_of_stock)}. #{Spree.t(:deliver_when_available)}." else "#{Spree.t(:out_of_stock)}." end else nil end end end ## Instruction: Return nil from first_option_value if the product has no option types. ## Code After: Spree::Variant.class_eval do # Sorts by option value position and other criteria after variant position. scope :order_by_option_value, ->{ includes(:option_values).references(:option_values).unscope(:order).order( position: :asc ).order( 'spree_option_values.position ASC' ).order( is_master: :desc, id: :asc ).uniq } # Returns this variant's option value for its product's first option type. def first_option_value self.option_values.where(option_type_id: self.product.first_option_type.try(:id)).order(position: :asc).first end def stock_message if !self.in_stock? if self.is_backorderable? "#{Spree.t(:temporarily_out_of_stock)}. #{Spree.t(:deliver_when_available)}." else "#{Spree.t(:out_of_stock)}." end else nil end end end
Spree::Variant.class_eval do # Sorts by option value position and other criteria after variant position. scope :order_by_option_value, ->{ includes(:option_values).references(:option_values).unscope(:order).order( position: :asc ).order( 'spree_option_values.position ASC' ).order( is_master: :desc, id: :asc ).uniq } - + # Returns this variant's option value for its product's first option type. def first_option_value - self.option_values.where(option_type_id: self.product.first_option_type.id).order(position: :asc).first + self.option_values.where(option_type_id: self.product.first_option_type.try(:id)).order(position: :asc).first ? +++++ + end def stock_message if !self.in_stock? if self.is_backorderable? "#{Spree.t(:temporarily_out_of_stock)}. #{Spree.t(:deliver_when_available)}." else "#{Spree.t(:out_of_stock)}." end else nil end end end
4
0.125
2
2
95d3401b29d2cba2d282256cdd2513c67e3df858
ipython_notebook_config.py
ipython_notebook_config.py
c = get_config() c.NotebookApp.ip = '*' c.NotebookApp.open_browser = False c.NotebookApp.port = 8888 # Whether to trust or not X-Scheme/X-Forwarded-Proto and X-Real-Ip/X-Forwarded- # For headerssent by the upstream reverse proxy. Necessary if the proxy handles # SSL c.NotebookApp.trust_xheaders = True # Supply overrides for the tornado.web.Application that the IPython notebook # uses. c.NotebookApp.webapp_settings = { 'X-Frame-Options': 'ALLOW FROM nature.com', 'template_path':['/srv/ga/', '/srv/ipython/IPython/html', '/srv/ipython/IPython/html/templates'] }
c = get_config() c.NotebookApp.ip = '*' c.NotebookApp.open_browser = False c.NotebookApp.port = 8888 # Whether to trust or not X-Scheme/X-Forwarded-Proto and X-Real-Ip/X-Forwarded- # For headerssent by the upstream reverse proxy. Necessary if the proxy handles # SSL c.NotebookApp.trust_xheaders = True # Supply overrides for the tornado.web.Application that the IPython notebook # uses. c.NotebookApp.webapp_settings = { 'X-Frame-Options': 'ALLOW FROM nature.com', 'Content-Security-Policy': "frame-ancestors 'self' *.nature.com", 'template_path':['/srv/ga/', '/srv/ipython/IPython/html', '/srv/ipython/IPython/html/templates'] }
Set the content security policy
Set the content security policy
Python
bsd-3-clause
jupyter/nature-demo,jupyter/nature-demo,jupyter/nature-demo
python
## Code Before: c = get_config() c.NotebookApp.ip = '*' c.NotebookApp.open_browser = False c.NotebookApp.port = 8888 # Whether to trust or not X-Scheme/X-Forwarded-Proto and X-Real-Ip/X-Forwarded- # For headerssent by the upstream reverse proxy. Necessary if the proxy handles # SSL c.NotebookApp.trust_xheaders = True # Supply overrides for the tornado.web.Application that the IPython notebook # uses. c.NotebookApp.webapp_settings = { 'X-Frame-Options': 'ALLOW FROM nature.com', 'template_path':['/srv/ga/', '/srv/ipython/IPython/html', '/srv/ipython/IPython/html/templates'] } ## Instruction: Set the content security policy ## Code After: c = get_config() c.NotebookApp.ip = '*' c.NotebookApp.open_browser = False c.NotebookApp.port = 8888 # Whether to trust or not X-Scheme/X-Forwarded-Proto and X-Real-Ip/X-Forwarded- # For headerssent by the upstream reverse proxy. Necessary if the proxy handles # SSL c.NotebookApp.trust_xheaders = True # Supply overrides for the tornado.web.Application that the IPython notebook # uses. c.NotebookApp.webapp_settings = { 'X-Frame-Options': 'ALLOW FROM nature.com', 'Content-Security-Policy': "frame-ancestors 'self' *.nature.com", 'template_path':['/srv/ga/', '/srv/ipython/IPython/html', '/srv/ipython/IPython/html/templates'] }
c = get_config() c.NotebookApp.ip = '*' c.NotebookApp.open_browser = False c.NotebookApp.port = 8888 # Whether to trust or not X-Scheme/X-Forwarded-Proto and X-Real-Ip/X-Forwarded- # For headerssent by the upstream reverse proxy. Necessary if the proxy handles # SSL c.NotebookApp.trust_xheaders = True # Supply overrides for the tornado.web.Application that the IPython notebook # uses. c.NotebookApp.webapp_settings = { 'X-Frame-Options': 'ALLOW FROM nature.com', + 'Content-Security-Policy': "frame-ancestors 'self' *.nature.com", 'template_path':['/srv/ga/', '/srv/ipython/IPython/html', '/srv/ipython/IPython/html/templates'] }
1
0.055556
1
0
8eafb73fa41c50cb6a57a082bcda4f13b5387bd8
docs/index.md
docs/index.md
--- title: Home layout: default --- # What is Livedoc ? Livedoc is a Java library that inspects the Java code of your API and builds its documentation based on what it found. It was [inspired by JSONDoc](about-jsondoc), and aims at allowing users to generate a documentation with the least possible effort. Ain't nobody's got time to write doc! It does not need you to use a particular framework, although it integrates very well with Spring, because it is able to read its annotation and generate doc from that without further configuration. Moreover, Livedoc is [able to read the Javadoc](javadoc-processing), thus removing the need to use extra annotation. Last but not least, Livedoc also provides a [UI](livedoc-ui) that you can use to visualize the documentation. # Get started with Livedoc Choose your Livedoc flavour: - [Spring Boot](quickstart/springboot) (recommended) - [Spring MVC](quickstart/springmvc) - [Other framework](quickstart/plain)
--- title: Home layout: default --- ## What is Livedoc ? Livedoc is a Java library that inspects the Java code of your API and builds its documentation based on what it found. It was [inspired by JSONDoc](about-jsondoc), and aims at allowing users to generate a documentation with the least possible effort. Ain't nobody's got time to write doc! It does not need you to use a particular framework, although it integrates very well with Spring, because it is able to read its annotation and generate doc from that without further configuration. Moreover, Livedoc is [able to read the Javadoc](javadoc-processing), thus removing the need to use extra annotation. Last but not least, Livedoc also provides a [UI](livedoc-ui) that you can use to visualize the documentation. ## Get started with Livedoc Choose your Livedoc flavour: - [Spring Boot](quickstart/springboot) (recommended) - [Spring MVC](quickstart/springmvc) - [Other framework](quickstart/plain) Then you may check out how to serve the documentation with [the provided UI](livedoc-ui). ## Credits Credits to [@fabiomaffioletti](https://github.com/fabiomaffioletti) for his great work on the original JSONDoc project, and to all contributors that helped him build JSONDoc up to version 1.2.17, which I started from. Special thanks to [@ST-DDT](https://github.com/ST-DDT) for his very constructive feedback, both on the original project and on Livedoc. Livedoc uses the [therapi-runtime-javadoc](https://github.com/dnault/therapi-runtime-javadoc) library by [@dnault](https://github.com/dnault) for its Javadoc-related processing.
Add credits to the docs welcome page
Add credits to the docs welcome page
Markdown
mit
joffrey-bion/livedoc,joffrey-bion/livedoc,joffrey-bion/livedoc,joffrey-bion/livedoc,joffrey-bion/livedoc
markdown
## Code Before: --- title: Home layout: default --- # What is Livedoc ? Livedoc is a Java library that inspects the Java code of your API and builds its documentation based on what it found. It was [inspired by JSONDoc](about-jsondoc), and aims at allowing users to generate a documentation with the least possible effort. Ain't nobody's got time to write doc! It does not need you to use a particular framework, although it integrates very well with Spring, because it is able to read its annotation and generate doc from that without further configuration. Moreover, Livedoc is [able to read the Javadoc](javadoc-processing), thus removing the need to use extra annotation. Last but not least, Livedoc also provides a [UI](livedoc-ui) that you can use to visualize the documentation. # Get started with Livedoc Choose your Livedoc flavour: - [Spring Boot](quickstart/springboot) (recommended) - [Spring MVC](quickstart/springmvc) - [Other framework](quickstart/plain) ## Instruction: Add credits to the docs welcome page ## Code After: --- title: Home layout: default --- ## What is Livedoc ? Livedoc is a Java library that inspects the Java code of your API and builds its documentation based on what it found. It was [inspired by JSONDoc](about-jsondoc), and aims at allowing users to generate a documentation with the least possible effort. Ain't nobody's got time to write doc! It does not need you to use a particular framework, although it integrates very well with Spring, because it is able to read its annotation and generate doc from that without further configuration. Moreover, Livedoc is [able to read the Javadoc](javadoc-processing), thus removing the need to use extra annotation. Last but not least, Livedoc also provides a [UI](livedoc-ui) that you can use to visualize the documentation. ## Get started with Livedoc Choose your Livedoc flavour: - [Spring Boot](quickstart/springboot) (recommended) - [Spring MVC](quickstart/springmvc) - [Other framework](quickstart/plain) Then you may check out how to serve the documentation with [the provided UI](livedoc-ui). ## Credits Credits to [@fabiomaffioletti](https://github.com/fabiomaffioletti) for his great work on the original JSONDoc project, and to all contributors that helped him build JSONDoc up to version 1.2.17, which I started from. Special thanks to [@ST-DDT](https://github.com/ST-DDT) for his very constructive feedback, both on the original project and on Livedoc. Livedoc uses the [therapi-runtime-javadoc](https://github.com/dnault/therapi-runtime-javadoc) library by [@dnault](https://github.com/dnault) for its Javadoc-related processing.
--- title: Home layout: default --- - # What is Livedoc ? + ## What is Livedoc ? ? + Livedoc is a Java library that inspects the Java code of your API and builds its documentation based on what it found. It was [inspired by JSONDoc](about-jsondoc), and aims at allowing users to generate a documentation with the least possible effort. Ain't nobody's got time to write doc! It does not need you to use a particular framework, although it integrates very well with Spring, because it is able to read its annotation and generate doc from that without further configuration. Moreover, Livedoc is [able to read the Javadoc](javadoc-processing), thus removing the need to use extra annotation. Last but not least, Livedoc also provides a [UI](livedoc-ui) that you can use to visualize the documentation. - # Get started with Livedoc + ## Get started with Livedoc ? + Choose your Livedoc flavour: - [Spring Boot](quickstart/springboot) (recommended) - [Spring MVC](quickstart/springmvc) - [Other framework](quickstart/plain) + + Then you may check out how to serve the documentation with [the provided UI](livedoc-ui). + + ## Credits + + Credits to [@fabiomaffioletti](https://github.com/fabiomaffioletti) for his great work on the original JSONDoc project, + and to all contributors that helped him build JSONDoc up to version 1.2.17, which I started from. + + Special thanks to [@ST-DDT](https://github.com/ST-DDT) for his very constructive feedback, both on the original project + and on Livedoc. + + Livedoc uses the [therapi-runtime-javadoc](https://github.com/dnault/therapi-runtime-javadoc) library by + [@dnault](https://github.com/dnault) for its Javadoc-related processing.
17
0.68
15
2
bc8a4d398e9035d08f46424359acc118e3a40be5
src/test/groovy/helios/HeliosSpec.groovy
src/test/groovy/helios/HeliosSpec.groovy
package helios import static helios.Helios.validate; import static helios.Validators.min; import static helios.Validators.required; import spock.lang.Specification import helios.HeliosSpecProperties as PROPERTY import helios.HeliosSpecValidators as VALIDATOR import helios.HeliosSpecGenerators as GENERATOR class HeliosSpec extends Specification { void 'check Helios final class'() { given: 'an Helios class' Class<Helios> heliosClass = Helios expect: 'constructor to be one' PROPERTY.classHasNoPublicConstructor heliosClass } void 'check Validators final class'() { given: 'an Validators class' Class<Validators> validatorsClass = Validators expect: 'constructor to be one' PROPERTY.classHasNoPublicConstructor validatorsClass } void 'check composed validator from varargs'() { when: 'validating with several validators at once' List<ValidatorError<PROPERTY.Loan>> result = Helios.validate("loan", loanSample, [ { PROPERTY.Loan loan -> validate("id", loan.id, required()) }, { PROPERTY.Loan loan -> validate("name", loan.name, validators) }, { PROPERTY.Loan loan -> validate("amount", loan.amount, required(), min(10)) }] as Validator[]) then: 'result should reflect properties' PROPERTY.checkLoanResult result where: 'possible loan samples and validators are' loanSample << GENERATOR.getLoanGenerator().take(100) validators << GENERATOR.validatorList().take(100) } }
package helios import static helios.Helios.validate; import static helios.Validators.min; import static helios.Validators.required; import spock.lang.Specification import helios.HeliosSpecProperties as PROPERTY import helios.HeliosSpecValidators as VALIDATOR import helios.HeliosSpecGenerators as GENERATOR class HeliosSpec extends Specification { void 'check Helios final class'() { given: 'an Helios class' Class<Helios> heliosClass = Helios expect: 'constructor to be one' PROPERTY.classHasNoPublicConstructor heliosClass } void 'check Validators final class'() { given: 'an Validators class' Class<Validators> validatorsClass = Validators expect: 'constructor to be one' PROPERTY.classHasNoPublicConstructor validatorsClass } void 'check composed validator from varargs'() { when: 'validating with several validators at once' List<ValidatorError<PROPERTY.Loan>> result = Helios.validate("loan", loanSample, [ { PROPERTY.Loan loan -> validate("id", loan.id, required()) }, { PROPERTY.Loan loan -> validate("name", loan.name, validators) }, { PROPERTY.Loan loan -> validate("amount", loan.amount, required(), min(10), min(null)) }] as Validator[]) then: 'result should reflect properties' PROPERTY.checkLoanResult result where: 'possible loan samples and validators are' loanSample << GENERATOR.getLoanGenerator().take(100) validators << GENERATOR.validatorList().take(100) } }
Add NPE case to fix it
Add NPE case to fix it
Groovy
apache-2.0
mariogarcia/helios
groovy
## Code Before: package helios import static helios.Helios.validate; import static helios.Validators.min; import static helios.Validators.required; import spock.lang.Specification import helios.HeliosSpecProperties as PROPERTY import helios.HeliosSpecValidators as VALIDATOR import helios.HeliosSpecGenerators as GENERATOR class HeliosSpec extends Specification { void 'check Helios final class'() { given: 'an Helios class' Class<Helios> heliosClass = Helios expect: 'constructor to be one' PROPERTY.classHasNoPublicConstructor heliosClass } void 'check Validators final class'() { given: 'an Validators class' Class<Validators> validatorsClass = Validators expect: 'constructor to be one' PROPERTY.classHasNoPublicConstructor validatorsClass } void 'check composed validator from varargs'() { when: 'validating with several validators at once' List<ValidatorError<PROPERTY.Loan>> result = Helios.validate("loan", loanSample, [ { PROPERTY.Loan loan -> validate("id", loan.id, required()) }, { PROPERTY.Loan loan -> validate("name", loan.name, validators) }, { PROPERTY.Loan loan -> validate("amount", loan.amount, required(), min(10)) }] as Validator[]) then: 'result should reflect properties' PROPERTY.checkLoanResult result where: 'possible loan samples and validators are' loanSample << GENERATOR.getLoanGenerator().take(100) validators << GENERATOR.validatorList().take(100) } } ## Instruction: Add NPE case to fix it ## Code After: package helios import static helios.Helios.validate; import static helios.Validators.min; import static helios.Validators.required; import spock.lang.Specification import helios.HeliosSpecProperties as PROPERTY import helios.HeliosSpecValidators as VALIDATOR import helios.HeliosSpecGenerators as GENERATOR class HeliosSpec extends Specification { void 'check Helios final class'() { given: 'an Helios class' Class<Helios> heliosClass = Helios expect: 'constructor to be one' PROPERTY.classHasNoPublicConstructor heliosClass } void 'check Validators final class'() { given: 'an Validators class' Class<Validators> validatorsClass = Validators expect: 'constructor to be one' PROPERTY.classHasNoPublicConstructor validatorsClass } void 'check composed validator from varargs'() { when: 'validating with several validators at once' List<ValidatorError<PROPERTY.Loan>> result = Helios.validate("loan", loanSample, [ { PROPERTY.Loan loan -> validate("id", loan.id, required()) }, { PROPERTY.Loan loan -> validate("name", loan.name, validators) }, { PROPERTY.Loan loan -> validate("amount", loan.amount, required(), min(10), min(null)) }] as Validator[]) then: 'result should reflect properties' PROPERTY.checkLoanResult result where: 'possible loan samples and validators are' loanSample << GENERATOR.getLoanGenerator().take(100) validators << GENERATOR.validatorList().take(100) } }
package helios import static helios.Helios.validate; import static helios.Validators.min; import static helios.Validators.required; import spock.lang.Specification import helios.HeliosSpecProperties as PROPERTY import helios.HeliosSpecValidators as VALIDATOR import helios.HeliosSpecGenerators as GENERATOR class HeliosSpec extends Specification { void 'check Helios final class'() { given: 'an Helios class' Class<Helios> heliosClass = Helios expect: 'constructor to be one' PROPERTY.classHasNoPublicConstructor heliosClass } void 'check Validators final class'() { given: 'an Validators class' Class<Validators> validatorsClass = Validators expect: 'constructor to be one' PROPERTY.classHasNoPublicConstructor validatorsClass } void 'check composed validator from varargs'() { when: 'validating with several validators at once' List<ValidatorError<PROPERTY.Loan>> result = Helios.validate("loan", loanSample, [ { PROPERTY.Loan loan -> validate("id", loan.id, required()) }, { PROPERTY.Loan loan -> validate("name", loan.name, validators) }, - { PROPERTY.Loan loan -> validate("amount", loan.amount, required(), min(10)) }] as Validator[]) + { PROPERTY.Loan loan -> validate("amount", loan.amount, required(), min(10), min(null)) }] as Validator[]) ? +++++++++++ then: 'result should reflect properties' PROPERTY.checkLoanResult result where: 'possible loan samples and validators are' loanSample << GENERATOR.getLoanGenerator().take(100) validators << GENERATOR.validatorList().take(100) } }
2
0.043478
1
1
24585d5766de31455f538743260ac9a3cca1ab28
lib/yard/server/commands/frames_command.rb
lib/yard/server/commands/frames_command.rb
module YARD module Server module Commands class FramesCommand < DisplayObjectCommand include DocServerHelper def run main_url = request.path.gsub(/^(.+)?\/frames\/(#{path})$/, '\1/\2') if path && !path.empty? page_title = "Object: #{object_path}" elsif options[:files] && options[:files].size > 0 page_title = "File: #{options[:files].first.sub(/^#{library.source_path}\/?/, '')}" main_url = url_for_file(options[:files].first) elsif !path || path.empty? page_title = "Documentation for #{library.name} #{library.version ? '(' + library.version + ')' : ''}" end options.update( :page_title => page_title, :main_url => main_url, :template => :doc_server, :type => :frames ) render end end end end end
module YARD module Server module Commands class FramesCommand < DisplayObjectCommand include DocServerHelper def run main_url = request.path.gsub(/^(.+)?\/frames\/(#{path})$/, '\1/\2') if path =~ %r{^file/} page_title = "File: #{$'}" elsif !path.empty? page_title = "Object: #{object_path}" elsif options[:files] && options[:files].size > 0 page_title = "File: #{options[:files].first.sub(/^#{library.source_path}\/?/, '')}" main_url = url_for_file(options[:files].first) elsif !path || path.empty? page_title = "Documentation for #{library.name} #{library.version ? '(' + library.version + ')' : ''}" end options.update( :page_title => page_title, :main_url => main_url, :template => :doc_server, :type => :frames ) render end end end end end
Fix titles for File urls in frames
Fix titles for File urls in frames
Ruby
mit
iankronquist/yard,herosky/yard,amclain/yard,iankronquist/yard,ohai/yard,jreinert/yard,amclain/yard,herosky/yard,thomthom/yard,alexdowad/yard,lsegal/yard,jreinert/yard,ohai/yard,ohai/yard,herosky/yard,iankronquist/yard,amclain/yard,lsegal/yard,thomthom/yard,jreinert/yard,alexdowad/yard,alexdowad/yard,lsegal/yard,thomthom/yard,travis-repos/yard,travis-repos/yard
ruby
## Code Before: module YARD module Server module Commands class FramesCommand < DisplayObjectCommand include DocServerHelper def run main_url = request.path.gsub(/^(.+)?\/frames\/(#{path})$/, '\1/\2') if path && !path.empty? page_title = "Object: #{object_path}" elsif options[:files] && options[:files].size > 0 page_title = "File: #{options[:files].first.sub(/^#{library.source_path}\/?/, '')}" main_url = url_for_file(options[:files].first) elsif !path || path.empty? page_title = "Documentation for #{library.name} #{library.version ? '(' + library.version + ')' : ''}" end options.update( :page_title => page_title, :main_url => main_url, :template => :doc_server, :type => :frames ) render end end end end end ## Instruction: Fix titles for File urls in frames ## Code After: module YARD module Server module Commands class FramesCommand < DisplayObjectCommand include DocServerHelper def run main_url = request.path.gsub(/^(.+)?\/frames\/(#{path})$/, '\1/\2') if path =~ %r{^file/} page_title = "File: #{$'}" elsif !path.empty? page_title = "Object: #{object_path}" elsif options[:files] && options[:files].size > 0 page_title = "File: #{options[:files].first.sub(/^#{library.source_path}\/?/, '')}" main_url = url_for_file(options[:files].first) elsif !path || path.empty? page_title = "Documentation for #{library.name} #{library.version ? '(' + library.version + ')' : ''}" end options.update( :page_title => page_title, :main_url => main_url, :template => :doc_server, :type => :frames ) render end end end end end
module YARD module Server module Commands class FramesCommand < DisplayObjectCommand include DocServerHelper def run main_url = request.path.gsub(/^(.+)?\/frames\/(#{path})$/, '\1/\2') + if path =~ %r{^file/} + page_title = "File: #{$'}" - if path && !path.empty? ? -------- + elsif !path.empty? ? +++ page_title = "Object: #{object_path}" elsif options[:files] && options[:files].size > 0 page_title = "File: #{options[:files].first.sub(/^#{library.source_path}\/?/, '')}" main_url = url_for_file(options[:files].first) elsif !path || path.empty? page_title = "Documentation for #{library.name} #{library.version ? '(' + library.version + ')' : ''}" end options.update( :page_title => page_title, :main_url => main_url, :template => :doc_server, :type => :frames ) render end end end end end
4
0.137931
3
1
c312ff0a7b0c3dc9c38ec070632edc21399af067
b_list/templates/contact_form/contact_form.html
b_list/templates/contact_form/contact_form.html
{% extends "base.html" %} {% block title %}Contact the author{% endblock %} {% block content %} {% load typogrify_tags %} <h1>Contact the author</h1> <p class="meta">See also: <a href="/about/">about the author</a>, <a href="{% url 'blog_entry_archive_index' %}">weblog index</a>.</p> <p>{% filter typogrify %}Enter your name, email address and message, and click "Send". Your email address won't ever be sold or shared; it's required only so that I can reply to your message.{% endfilter %}</p> <form method="post" action="" id="contact-form"> <dl> <dt><label for="id_name">Your name:</label>{% if form.name.errors %} <span class="error">{{ form.name.errors|join:", " }}</span>{% endif %}</dt> <dd>{{ form.name }}</dd> <dt><label for="id_email">Your email address:</label>{% if form.email.errors %} <span class="error">{{ form.email.errors|join:", " }}</span>{% endif %}</dt> <dd>{{ form.email }}</dd> <dt><label for="id_body">Your message:</label>{% if form.body.errors %} <span class="error">{{ form.body.errors|join:", " }}</span>{% endif %}</dt> <dd>{{ form.body }}</dd> <dd><input type="submit" value="Send" /></dd> </dl> </form> {% endblock %}
{% extends "base.html" %} {% block title %}Contact the author{% endblock %} {% block content %} {% load typogrify_tags %} <h1>Contact the author</h1> <p class="meta">See also: <a href="/about/">about the author</a>, <a href="{% url 'blog_entry_archive_index' %}">weblog index</a>.</p> <p>{% filter typogrify %}Enter your name, email address and message, and click "Send". Your email address won't ever be sold or shared; it's required only so that I can reply to your message.{% endfilter %}</p> <form method="post" action="" id="contact-form">{% csrf_token %} <dl> <dt><label for="id_name">Your name:</label>{% if form.name.errors %} <span class="error">{{ form.name.errors|join:", " }}</span>{% endif %}</dt> <dd>{{ form.name }}</dd> <dt><label for="id_email">Your email address:</label>{% if form.email.errors %} <span class="error">{{ form.email.errors|join:", " }}</span>{% endif %}</dt> <dd>{{ form.email }}</dd> <dt><label for="id_body">Your message:</label>{% if form.body.errors %} <span class="error">{{ form.body.errors|join:", " }}</span>{% endif %}</dt> <dd>{{ form.body }}</dd> <dd><input type="submit" value="Send" /></dd> </dl> </form> {% endblock %}
Add CSRF token to contact form.
Add CSRF token to contact form.
HTML
bsd-3-clause
ubernostrum/b_list,ubernostrum/b_list
html
## Code Before: {% extends "base.html" %} {% block title %}Contact the author{% endblock %} {% block content %} {% load typogrify_tags %} <h1>Contact the author</h1> <p class="meta">See also: <a href="/about/">about the author</a>, <a href="{% url 'blog_entry_archive_index' %}">weblog index</a>.</p> <p>{% filter typogrify %}Enter your name, email address and message, and click "Send". Your email address won't ever be sold or shared; it's required only so that I can reply to your message.{% endfilter %}</p> <form method="post" action="" id="contact-form"> <dl> <dt><label for="id_name">Your name:</label>{% if form.name.errors %} <span class="error">{{ form.name.errors|join:", " }}</span>{% endif %}</dt> <dd>{{ form.name }}</dd> <dt><label for="id_email">Your email address:</label>{% if form.email.errors %} <span class="error">{{ form.email.errors|join:", " }}</span>{% endif %}</dt> <dd>{{ form.email }}</dd> <dt><label for="id_body">Your message:</label>{% if form.body.errors %} <span class="error">{{ form.body.errors|join:", " }}</span>{% endif %}</dt> <dd>{{ form.body }}</dd> <dd><input type="submit" value="Send" /></dd> </dl> </form> {% endblock %} ## Instruction: Add CSRF token to contact form. ## Code After: {% extends "base.html" %} {% block title %}Contact the author{% endblock %} {% block content %} {% load typogrify_tags %} <h1>Contact the author</h1> <p class="meta">See also: <a href="/about/">about the author</a>, <a href="{% url 'blog_entry_archive_index' %}">weblog index</a>.</p> <p>{% filter typogrify %}Enter your name, email address and message, and click "Send". Your email address won't ever be sold or shared; it's required only so that I can reply to your message.{% endfilter %}</p> <form method="post" action="" id="contact-form">{% csrf_token %} <dl> <dt><label for="id_name">Your name:</label>{% if form.name.errors %} <span class="error">{{ form.name.errors|join:", " }}</span>{% endif %}</dt> <dd>{{ form.name }}</dd> <dt><label for="id_email">Your email address:</label>{% if form.email.errors %} <span class="error">{{ form.email.errors|join:", " }}</span>{% endif %}</dt> <dd>{{ form.email }}</dd> <dt><label for="id_body">Your message:</label>{% if form.body.errors %} <span class="error">{{ form.body.errors|join:", " }}</span>{% endif %}</dt> <dd>{{ form.body }}</dd> <dd><input type="submit" value="Send" /></dd> </dl> </form> {% endblock %}
{% extends "base.html" %} {% block title %}Contact the author{% endblock %} {% block content %} {% load typogrify_tags %} <h1>Contact the author</h1> <p class="meta">See also: <a href="/about/">about the author</a>, <a href="{% url 'blog_entry_archive_index' %}">weblog index</a>.</p> <p>{% filter typogrify %}Enter your name, email address and message, and click "Send". Your email address won't ever be sold or shared; it's required only so that I can reply to your message.{% endfilter %}</p> - <form method="post" action="" id="contact-form"> + <form method="post" action="" id="contact-form">{% csrf_token %} ? ++++++++++++++++ <dl> <dt><label for="id_name">Your name:</label>{% if form.name.errors %} <span class="error">{{ form.name.errors|join:", " }}</span>{% endif %}</dt> <dd>{{ form.name }}</dd> <dt><label for="id_email">Your email address:</label>{% if form.email.errors %} <span class="error">{{ form.email.errors|join:", " }}</span>{% endif %}</dt> <dd>{{ form.email }}</dd> <dt><label for="id_body">Your message:</label>{% if form.body.errors %} <span class="error">{{ form.body.errors|join:", " }}</span>{% endif %}</dt> <dd>{{ form.body }}</dd> <dd><input type="submit" value="Send" /></dd> </dl> </form> {% endblock %}
2
0.068966
1
1
1615f30998ab4dfe39fe0a64f63acbe9dbe7f43a
cereebro-server/src/test/java/io/cereebro/server/CereebroServerPropertiesTest.java
cereebro-server/src/test/java/io/cereebro/server/CereebroServerPropertiesTest.java
/* * Copyright © 2017 the original authors (http://cereebro.io) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.cereebro.server; import org.junit.Test; import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.Warning; /** * {@link CereebroServerProperties} unit tests. * * @author michaeltecourt */ public class CereebroServerPropertiesTest { @Test public void verifyEqualsAndHashcode() { EqualsVerifier.forClass(CereebroServerProperties.class).suppress(Warning.NONFINAL_FIELDS).verify(); } }
/* * Copyright © 2017 the original authors (http://cereebro.io) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.cereebro.server; import java.util.Arrays; import org.assertj.core.api.Assertions; import org.junit.Test; import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.Warning; /** * {@link CereebroServerProperties} unit tests. * * @author michaeltecourt */ public class CereebroServerPropertiesTest { @Test public void verifyEqualsAndHashcode() { EqualsVerifier.forClass(CereebroServerProperties.class).suppress(Warning.NONFINAL_FIELDS).verify(); } @Test public void testToString() { CereebroServerProperties server = new CereebroServerProperties(); SystemProperties system = new SystemProperties(); system.setName("alpha"); system.setPath("/nope"); SnitchProperties snitch = new SnitchProperties(); snitch.setResources(Arrays.asList()); system.setSnitch(snitch); server.setSystem(system); Assertions.assertThat(server.toString()).isNotEmpty(); } }
Improve test coverage one last time
Improve test coverage one last time
Java
apache-2.0
cereebro/cereebro,cereebro/cereebro,cereebro/cereebro
java
## Code Before: /* * Copyright © 2017 the original authors (http://cereebro.io) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.cereebro.server; import org.junit.Test; import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.Warning; /** * {@link CereebroServerProperties} unit tests. * * @author michaeltecourt */ public class CereebroServerPropertiesTest { @Test public void verifyEqualsAndHashcode() { EqualsVerifier.forClass(CereebroServerProperties.class).suppress(Warning.NONFINAL_FIELDS).verify(); } } ## Instruction: Improve test coverage one last time ## Code After: /* * Copyright © 2017 the original authors (http://cereebro.io) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.cereebro.server; import java.util.Arrays; import org.assertj.core.api.Assertions; import org.junit.Test; import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.Warning; /** * {@link CereebroServerProperties} unit tests. * * @author michaeltecourt */ public class CereebroServerPropertiesTest { @Test public void verifyEqualsAndHashcode() { EqualsVerifier.forClass(CereebroServerProperties.class).suppress(Warning.NONFINAL_FIELDS).verify(); } @Test public void testToString() { CereebroServerProperties server = new CereebroServerProperties(); SystemProperties system = new SystemProperties(); system.setName("alpha"); system.setPath("/nope"); SnitchProperties snitch = new SnitchProperties(); snitch.setResources(Arrays.asList()); system.setSnitch(snitch); server.setSystem(system); Assertions.assertThat(server.toString()).isNotEmpty(); } }
/* * Copyright © 2017 the original authors (http://cereebro.io) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.cereebro.server; + import java.util.Arrays; + + import org.assertj.core.api.Assertions; import org.junit.Test; import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.Warning; /** * {@link CereebroServerProperties} unit tests. * * @author michaeltecourt */ public class CereebroServerPropertiesTest { @Test public void verifyEqualsAndHashcode() { EqualsVerifier.forClass(CereebroServerProperties.class).suppress(Warning.NONFINAL_FIELDS).verify(); } + @Test + public void testToString() { + CereebroServerProperties server = new CereebroServerProperties(); + SystemProperties system = new SystemProperties(); + system.setName("alpha"); + system.setPath("/nope"); + SnitchProperties snitch = new SnitchProperties(); + snitch.setResources(Arrays.asList()); + system.setSnitch(snitch); + server.setSystem(system); + Assertions.assertThat(server.toString()).isNotEmpty(); + } + }
16
0.457143
16
0
2fae1e17295c6569a67c866a672a52608ccce113
.scrutinizer.yml
.scrutinizer.yml
application: environment: php: version: 5.5.14 project_setup: before: - cp app/config/parameters.yml.dist app/config/parameters.yml - composer install --prefer-dist --no-interaction build: dependencies: before: - composer install --prefer-dist filter: paths: [src/*] excluded_paths: [vendor/*] tools: external_code_coverage: timeout: 600 # Timeout in seconds. php_mess_detector: true php_code_sniffer: true sensiolabs_security_checker: true php_code_coverage: true php_pdepend: true php_loc: enabled: true excluded_dirs: [vendor, tests] php_cpd: enabled: true excluded_dirs: [vendor, tests] checks: php: code_rating: true duplication: true
application: environment: php: version: 5.5.14 project_setup: before: - cp app/config/parameters.yml.dist app/config/parameters.yml - composer install --prefer-dist --no-interaction filter: paths: [src/*] excluded_paths: [vendor/*] tools: external_code_coverage: timeout: 600 # Timeout in seconds. php_mess_detector: true php_code_sniffer: true sensiolabs_security_checker: true php_code_coverage: true php_pdepend: true php_loc: enabled: true excluded_dirs: [vendor, tests] php_cpd: enabled: true excluded_dirs: [vendor, tests] checks: php: code_rating: true duplication: true
Disable dublicated CI composer update
Disable dublicated CI composer update
YAML
mit
dardarlt/hangman
yaml
## Code Before: application: environment: php: version: 5.5.14 project_setup: before: - cp app/config/parameters.yml.dist app/config/parameters.yml - composer install --prefer-dist --no-interaction build: dependencies: before: - composer install --prefer-dist filter: paths: [src/*] excluded_paths: [vendor/*] tools: external_code_coverage: timeout: 600 # Timeout in seconds. php_mess_detector: true php_code_sniffer: true sensiolabs_security_checker: true php_code_coverage: true php_pdepend: true php_loc: enabled: true excluded_dirs: [vendor, tests] php_cpd: enabled: true excluded_dirs: [vendor, tests] checks: php: code_rating: true duplication: true ## Instruction: Disable dublicated CI composer update ## Code After: application: environment: php: version: 5.5.14 project_setup: before: - cp app/config/parameters.yml.dist app/config/parameters.yml - composer install --prefer-dist --no-interaction filter: paths: [src/*] excluded_paths: [vendor/*] tools: external_code_coverage: timeout: 600 # Timeout in seconds. php_mess_detector: true php_code_sniffer: true sensiolabs_security_checker: true php_code_coverage: true php_pdepend: true php_loc: enabled: true excluded_dirs: [vendor, tests] php_cpd: enabled: true excluded_dirs: [vendor, tests] checks: php: code_rating: true duplication: true
application: environment: php: version: 5.5.14 project_setup: before: - cp app/config/parameters.yml.dist app/config/parameters.yml - composer install --prefer-dist --no-interaction - build: - dependencies: - before: - - composer install --prefer-dist filter: paths: [src/*] excluded_paths: [vendor/*] tools: external_code_coverage: timeout: 600 # Timeout in seconds. php_mess_detector: true php_code_sniffer: true sensiolabs_security_checker: true php_code_coverage: true php_pdepend: true php_loc: enabled: true excluded_dirs: [vendor, tests] php_cpd: enabled: true excluded_dirs: [vendor, tests] checks: php: code_rating: true duplication: true
4
0.114286
0
4
fc6ca51d4a865368f82c26426a2d6c8d8366e25d
tcconfig/tcshow.py
tcconfig/tcshow.py
from __future__ import absolute_import from __future__ import with_statement import sys try: import json except ImportError: import simplejson as json import six import thutils import tcconfig import tcconfig.traffic_control from ._common import verify_network_interface def parse_option(): parser = thutils.option.ArgumentParserObject() parser.make(version=tcconfig.VERSION) group = parser.add_argument_group("Traffic Control") group.add_argument( "--device", action="append", required=True, help="network device name (e.g. eth0)") return parser.parse_args() @thutils.main.Main def main(): options = parse_option() thutils.initialize_library(__file__, options) thutils.common.verify_install_command(["tc"]) subproc_wrapper = thutils.subprocwrapper.SubprocessWrapper() tc_param = {} for device in options.device: verify_network_interface(device) tc = tcconfig.traffic_control.TrafficControl( subproc_wrapper, device) tc_param.update(tc.get_tc_parameter()) six.print_(json.dumps(tc_param, indent=4)) return 0 if __name__ == '__main__': sys.exit(main())
from __future__ import absolute_import from __future__ import with_statement import json import sys import six import thutils import tcconfig import tcconfig.traffic_control from ._common import verify_network_interface def parse_option(): parser = thutils.option.ArgumentParserObject() parser.make(version=tcconfig.VERSION) group = parser.add_argument_group("Traffic Control") group.add_argument( "--device", action="append", required=True, help="network device name (e.g. eth0)") return parser.parse_args() @thutils.main.Main def main(): options = parse_option() thutils.initialize_library(__file__, options) thutils.common.verify_install_command(["tc"]) subproc_wrapper = thutils.subprocwrapper.SubprocessWrapper() tc_param = {} for device in options.device: verify_network_interface(device) tc = tcconfig.traffic_control.TrafficControl( subproc_wrapper, device) tc_param.update(tc.get_tc_parameter()) six.print_(json.dumps(tc_param, indent=4)) return 0 if __name__ == '__main__': sys.exit(main())
Drop support for Python 2.6
Drop support for Python 2.6
Python
mit
thombashi/tcconfig,thombashi/tcconfig
python
## Code Before: from __future__ import absolute_import from __future__ import with_statement import sys try: import json except ImportError: import simplejson as json import six import thutils import tcconfig import tcconfig.traffic_control from ._common import verify_network_interface def parse_option(): parser = thutils.option.ArgumentParserObject() parser.make(version=tcconfig.VERSION) group = parser.add_argument_group("Traffic Control") group.add_argument( "--device", action="append", required=True, help="network device name (e.g. eth0)") return parser.parse_args() @thutils.main.Main def main(): options = parse_option() thutils.initialize_library(__file__, options) thutils.common.verify_install_command(["tc"]) subproc_wrapper = thutils.subprocwrapper.SubprocessWrapper() tc_param = {} for device in options.device: verify_network_interface(device) tc = tcconfig.traffic_control.TrafficControl( subproc_wrapper, device) tc_param.update(tc.get_tc_parameter()) six.print_(json.dumps(tc_param, indent=4)) return 0 if __name__ == '__main__': sys.exit(main()) ## Instruction: Drop support for Python 2.6 ## Code After: from __future__ import absolute_import from __future__ import with_statement import json import sys import six import thutils import tcconfig import tcconfig.traffic_control from ._common import verify_network_interface def parse_option(): parser = thutils.option.ArgumentParserObject() parser.make(version=tcconfig.VERSION) group = parser.add_argument_group("Traffic Control") group.add_argument( "--device", action="append", required=True, help="network device name (e.g. eth0)") return parser.parse_args() @thutils.main.Main def main(): options = parse_option() thutils.initialize_library(__file__, options) thutils.common.verify_install_command(["tc"]) subproc_wrapper = thutils.subprocwrapper.SubprocessWrapper() tc_param = {} for device in options.device: verify_network_interface(device) tc = tcconfig.traffic_control.TrafficControl( subproc_wrapper, device) tc_param.update(tc.get_tc_parameter()) six.print_(json.dumps(tc_param, indent=4)) return 0 if __name__ == '__main__': sys.exit(main())
from __future__ import absolute_import from __future__ import with_statement + import json import sys - - try: - import json - except ImportError: - import simplejson as json - import six import thutils import tcconfig import tcconfig.traffic_control from ._common import verify_network_interface def parse_option(): parser = thutils.option.ArgumentParserObject() parser.make(version=tcconfig.VERSION) group = parser.add_argument_group("Traffic Control") group.add_argument( "--device", action="append", required=True, help="network device name (e.g. eth0)") return parser.parse_args() @thutils.main.Main def main(): options = parse_option() thutils.initialize_library(__file__, options) thutils.common.verify_install_command(["tc"]) subproc_wrapper = thutils.subprocwrapper.SubprocessWrapper() tc_param = {} for device in options.device: verify_network_interface(device) tc = tcconfig.traffic_control.TrafficControl( subproc_wrapper, device) tc_param.update(tc.get_tc_parameter()) six.print_(json.dumps(tc_param, indent=4)) return 0 if __name__ == '__main__': sys.exit(main())
7
0.127273
1
6
0194736c13ddb3afd5a0f1947bb8faf4441fbcea
.travis.yml
.travis.yml
language: python dist: trusty sudo: false matrix: fast_finish: true include: - python: 2.7 env: - TOX_ENV=py27 - python: 3.5 env: - TOX_ENV=py35 - python: 3.6 env: - TOX_ENV=py36 - python: 3.7 env: - TOX_ENV=py37 install: - travis_retry pip install "virtualenv<14.0.0" "tox>=1.9" "coverage<4" # Emacs Version Manager - curl -fsSkL https://gist.github.com/rejeep/ebcd57c3af83b049833b/raw | sed 's/24\.3/24\.4/g' > x.sh && source ./x.sh script: - travis_wait tox -e $TOX_ENV - emacs --version - emacs -Q --batch -L emacs-live-py-mode --eval '(setq byte-compile-error-on-warn t)' -f batch-byte-compile emacs-live-py-mode/*.el - emacs -Q -nw -L emacs-live-py-mode -L plugin/PySrc -l live-py-mode.el -l live-py-test.el -f ert-run-tests-batch-and-exit after_success: - pip install codecov - codecov -e TOX_ENV
language: python dist: trusty sudo: false matrix: fast_finish: true include: - python: 2.7 env: - TOX_ENV=py27 - python: 3.5 env: - TOX_ENV=py35 - python: 3.6 env: - TOX_ENV=py36 - python: 3.7 dist: xenial env: - TOX_ENV=py37 install: - travis_retry pip install "virtualenv<14.0.0" "tox>=1.9" "coverage<4" # Emacs Version Manager - curl -fsSkL https://gist.github.com/rejeep/ebcd57c3af83b049833b/raw | sed 's/24\.3/24\.4/g' > x.sh && source ./x.sh script: - travis_wait tox -e $TOX_ENV - emacs --version - emacs -Q --batch -L emacs-live-py-mode --eval '(setq byte-compile-error-on-warn t)' -f batch-byte-compile emacs-live-py-mode/*.el - emacs -Q -nw -L emacs-live-py-mode -L plugin/PySrc -l live-py-mode.el -l live-py-test.el -f ert-run-tests-batch-and-exit after_success: - pip install codecov - codecov -e TOX_ENV
Switch Python 3.7 to run on Xenial distribution.
Switch Python 3.7 to run on Xenial distribution.
YAML
mit
brandm/live-py-plugin,donkirkby/live-py-plugin,donkirkby/live-py-plugin,donkirkby/live-py-plugin,brandm/live-py-plugin,brandm/live-py-plugin,donkirkby/live-py-plugin,brandm/live-py-plugin,donkirkby/live-py-plugin,brandm/live-py-plugin
yaml
## Code Before: language: python dist: trusty sudo: false matrix: fast_finish: true include: - python: 2.7 env: - TOX_ENV=py27 - python: 3.5 env: - TOX_ENV=py35 - python: 3.6 env: - TOX_ENV=py36 - python: 3.7 env: - TOX_ENV=py37 install: - travis_retry pip install "virtualenv<14.0.0" "tox>=1.9" "coverage<4" # Emacs Version Manager - curl -fsSkL https://gist.github.com/rejeep/ebcd57c3af83b049833b/raw | sed 's/24\.3/24\.4/g' > x.sh && source ./x.sh script: - travis_wait tox -e $TOX_ENV - emacs --version - emacs -Q --batch -L emacs-live-py-mode --eval '(setq byte-compile-error-on-warn t)' -f batch-byte-compile emacs-live-py-mode/*.el - emacs -Q -nw -L emacs-live-py-mode -L plugin/PySrc -l live-py-mode.el -l live-py-test.el -f ert-run-tests-batch-and-exit after_success: - pip install codecov - codecov -e TOX_ENV ## Instruction: Switch Python 3.7 to run on Xenial distribution. ## Code After: language: python dist: trusty sudo: false matrix: fast_finish: true include: - python: 2.7 env: - TOX_ENV=py27 - python: 3.5 env: - TOX_ENV=py35 - python: 3.6 env: - TOX_ENV=py36 - python: 3.7 dist: xenial env: - TOX_ENV=py37 install: - travis_retry pip install "virtualenv<14.0.0" "tox>=1.9" "coverage<4" # Emacs Version Manager - curl -fsSkL https://gist.github.com/rejeep/ebcd57c3af83b049833b/raw | sed 's/24\.3/24\.4/g' > x.sh && source ./x.sh script: - travis_wait tox -e $TOX_ENV - emacs --version - emacs -Q --batch -L emacs-live-py-mode --eval '(setq byte-compile-error-on-warn t)' -f batch-byte-compile emacs-live-py-mode/*.el - emacs -Q -nw -L emacs-live-py-mode -L plugin/PySrc -l live-py-mode.el -l live-py-test.el -f ert-run-tests-batch-and-exit after_success: - pip install codecov - codecov -e TOX_ENV
language: python dist: trusty sudo: false matrix: fast_finish: true include: - python: 2.7 env: - TOX_ENV=py27 - python: 3.5 env: - TOX_ENV=py35 - python: 3.6 env: - TOX_ENV=py36 - python: 3.7 + dist: xenial env: - TOX_ENV=py37 install: - travis_retry pip install "virtualenv<14.0.0" "tox>=1.9" "coverage<4" # Emacs Version Manager - curl -fsSkL https://gist.github.com/rejeep/ebcd57c3af83b049833b/raw | sed 's/24\.3/24\.4/g' > x.sh && source ./x.sh script: - travis_wait tox -e $TOX_ENV - emacs --version - emacs -Q --batch -L emacs-live-py-mode --eval '(setq byte-compile-error-on-warn t)' -f batch-byte-compile emacs-live-py-mode/*.el - emacs -Q -nw -L emacs-live-py-mode -L plugin/PySrc -l live-py-mode.el -l live-py-test.el -f ert-run-tests-batch-and-exit after_success: - pip install codecov - codecov -e TOX_ENV
1
0.028571
1
0
b087b9814de3e5b375c25362401ed5274149986a
lib/Predis/Options/ClientCluster.php
lib/Predis/Options/ClientCluster.php
<?php namespace Predis\Options; use Predis\Network\IConnectionCluster; use Predis\Network\PredisCluster; class ClientCluster extends Option { protected function checkInstance($cluster) { if (!$cluster instanceof IConnectionCluster) { throw new \InvalidArgumentException( 'Instance of Predis\Network\IConnectionCluster expected' ); } return $cluster; } public function validate($value) { if (is_callable($value)) { return $this->initializeFromCallable($value); } $initializer = $this->getInitializer($value); return $this->checkInstance($initializer()); } protected function initializeFromCallable($callable) { return $this->checkInstance(call_user_func($callable)); } protected function getInitializer($fqnOrType) { switch ($fqnOrType) { case 'predis': return function() { return new PredisCluster(); }; default: return function() use($fqnOrType) { return new $fqnOrType(); }; } } public function getDefault() { return new PredisCluster(); } }
<?php namespace Predis\Options; use Predis\Network\IConnectionCluster; use Predis\Network\PredisCluster; class ClientCluster extends Option { protected function checkInstance($cluster) { if (!$cluster instanceof IConnectionCluster) { throw new \InvalidArgumentException( 'Instance of Predis\Network\IConnectionCluster expected' ); } return $cluster; } public function validate($value) { if (is_callable($value)) { return $this->checkInstance(call_user_func($value)); } $initializer = $this->getInitializer($value); return $this->checkInstance($initializer()); } protected function getInitializer($fqnOrType) { switch ($fqnOrType) { case 'predis': return function() { return new PredisCluster(); }; default: return function() use($fqnOrType) { return new $fqnOrType(); }; } } public function getDefault() { return new PredisCluster(); } }
Remove a useless method from the cluster option class.
Remove a useless method from the cluster option class.
PHP
mit
lvbaosong/predis,zhangyancoder/predis,RudyJessop/predis,nguyenthaihan/predis,quangnguyen90/predis,johnhelmuth/predis,moria/predis,channelgrabber/predis,protomouse/predis,dzung2t/predis,nrk/predis,WalterShe/predis,stokes3452/predis,vend/predis,SwelenFrance/predis,gopalindians/predis,oswaldderiemaecker/predis,CloudSide/predis,gencer/predis,dominics/predis,RedisLabs/predis,mrkeng/predis,SecureCloud-biz/predis
php
## Code Before: <?php namespace Predis\Options; use Predis\Network\IConnectionCluster; use Predis\Network\PredisCluster; class ClientCluster extends Option { protected function checkInstance($cluster) { if (!$cluster instanceof IConnectionCluster) { throw new \InvalidArgumentException( 'Instance of Predis\Network\IConnectionCluster expected' ); } return $cluster; } public function validate($value) { if (is_callable($value)) { return $this->initializeFromCallable($value); } $initializer = $this->getInitializer($value); return $this->checkInstance($initializer()); } protected function initializeFromCallable($callable) { return $this->checkInstance(call_user_func($callable)); } protected function getInitializer($fqnOrType) { switch ($fqnOrType) { case 'predis': return function() { return new PredisCluster(); }; default: return function() use($fqnOrType) { return new $fqnOrType(); }; } } public function getDefault() { return new PredisCluster(); } } ## Instruction: Remove a useless method from the cluster option class. ## Code After: <?php namespace Predis\Options; use Predis\Network\IConnectionCluster; use Predis\Network\PredisCluster; class ClientCluster extends Option { protected function checkInstance($cluster) { if (!$cluster instanceof IConnectionCluster) { throw new \InvalidArgumentException( 'Instance of Predis\Network\IConnectionCluster expected' ); } return $cluster; } public function validate($value) { if (is_callable($value)) { return $this->checkInstance(call_user_func($value)); } $initializer = $this->getInitializer($value); return $this->checkInstance($initializer()); } protected function getInitializer($fqnOrType) { switch ($fqnOrType) { case 'predis': return function() { return new PredisCluster(); }; default: return function() use($fqnOrType) { return new $fqnOrType(); }; } } public function getDefault() { return new PredisCluster(); } }
<?php namespace Predis\Options; use Predis\Network\IConnectionCluster; use Predis\Network\PredisCluster; class ClientCluster extends Option { protected function checkInstance($cluster) { if (!$cluster instanceof IConnectionCluster) { throw new \InvalidArgumentException( 'Instance of Predis\Network\IConnectionCluster expected' ); } return $cluster; } public function validate($value) { if (is_callable($value)) { - return $this->initializeFromCallable($value); + return $this->checkInstance(call_user_func($value)); } $initializer = $this->getInitializer($value); return $this->checkInstance($initializer()); - } - - protected function initializeFromCallable($callable) { - return $this->checkInstance(call_user_func($callable)); } protected function getInitializer($fqnOrType) { switch ($fqnOrType) { case 'predis': return function() { return new PredisCluster(); }; default: return function() use($fqnOrType) { return new $fqnOrType(); }; } } public function getDefault() { return new PredisCluster(); } }
6
0.136364
1
5
844cc642466d74a0bf951d2fd57257adcdf0f9c6
ha-bridge/run.sh
ha-bridge/run.sh
java -jar -Dconfig.file=/data/habridge.config -Djava.net.preferIPv4Stack=true /habridge/app.jar
if [ ! -d /share/habridge ]; then echo "[INFO] Creating /share/habridge folder" mkdir -p /share/habridge fi # Migrate existing habridge.config file if [ ! -d /data/habridge.config ]; then echo "[INFO] Migrating existing habridge.config from /data to /share/habridge" mv -f /data/habridge.config /share/habridge fi # Migrate existing options.json file if [ ! -d /data/options.json ]; then echo "[INFO] Migrating existing options.json from /data to /share/habridge" mv -f /data/options.json /share/habridge fi # Migrate existing backup files find /data -name '*.cfgbk' -exec echo "[INFO] Moving existing {} to /share/habridge" \; -exec mv {} /share/habridge \; java -jar -Dconfig.file=/share/habridge/habridge.config -Djava.net.preferIPv4Stack=true /habridge/app.jar
Migrate config files to /share/habridge
Migrate config files to /share/habridge
Shell
apache-2.0
Ixsun/hassio-addons,notoriousbdg/hassio-addons,Ixsun/hassio-addons,notoriousbdg/hassio-addons
shell
## Code Before: java -jar -Dconfig.file=/data/habridge.config -Djava.net.preferIPv4Stack=true /habridge/app.jar ## Instruction: Migrate config files to /share/habridge ## Code After: if [ ! -d /share/habridge ]; then echo "[INFO] Creating /share/habridge folder" mkdir -p /share/habridge fi # Migrate existing habridge.config file if [ ! -d /data/habridge.config ]; then echo "[INFO] Migrating existing habridge.config from /data to /share/habridge" mv -f /data/habridge.config /share/habridge fi # Migrate existing options.json file if [ ! -d /data/options.json ]; then echo "[INFO] Migrating existing options.json from /data to /share/habridge" mv -f /data/options.json /share/habridge fi # Migrate existing backup files find /data -name '*.cfgbk' -exec echo "[INFO] Moving existing {} to /share/habridge" \; -exec mv {} /share/habridge \; java -jar -Dconfig.file=/share/habridge/habridge.config -Djava.net.preferIPv4Stack=true /habridge/app.jar
+ if [ ! -d /share/habridge ]; then + echo "[INFO] Creating /share/habridge folder" + mkdir -p /share/habridge + fi + + # Migrate existing habridge.config file + if [ ! -d /data/habridge.config ]; then + echo "[INFO] Migrating existing habridge.config from /data to /share/habridge" + mv -f /data/habridge.config /share/habridge + fi + + # Migrate existing options.json file + if [ ! -d /data/options.json ]; then + echo "[INFO] Migrating existing options.json from /data to /share/habridge" + mv -f /data/options.json /share/habridge + fi + + # Migrate existing backup files + find /data -name '*.cfgbk' -exec echo "[INFO] Moving existing {} to /share/habridge" \; -exec mv {} /share/habridge \; + - java -jar -Dconfig.file=/data/habridge.config -Djava.net.preferIPv4Stack=true /habridge/app.jar ? ^^^ + java -jar -Dconfig.file=/share/habridge/habridge.config -Djava.net.preferIPv4Stack=true /habridge/app.jar ? +++++++++++ ^^
22
22
21
1
3def618a5cf5607a9bbe95cb1d349de83224565c
javascript/editlock.js
javascript/editlock.js
jQuery.entwine("editlock", function($) { $('.cms-edit-form').entwine({ RecordID: null, RecordClass: null, LockURL: null, onmatch: function() { if(this.hasClass('edit-locked')){ this.showLockMessage(); }else{ this.setRecordID(this.data('recordid')); this.setRecordClass(this.data('recordclass')); this.setLockURL(this.data('lockurl')); this.lockRecord(); } }, lockRecord: function() { if(!this.getRecordID() || !this.getRecordClass() || !this.getLockURL()){ return false; } var data = { RecordID: this.getRecordID(), RecordClass: this.getRecordClass() }; $.post(this.getLockURL(), data).done(function(result){ setTimeout(function(){$('.cms-edit-form').lockRecord()},10000); }); }, showLockMessage: function(){ this.find('p.message').first().after('<p/>') .addClass('message warning') .css('overflow', 'hidden') .html(this.data('lockedmessage')) .show(); } }); });
jQuery.entwine("editlock", function($) { var lockTimer = 0; $('.cms-edit-form').entwine({ RecordID: null, RecordClass: null, LockURL: null, onmatch: function() { // clear any previously bound lock timer if (lockTimer) { clearTimeout(lockTimer); } if(this.hasClass('edit-locked')){ this.showLockMessage(); }else{ this.setRecordID(this.data('recordid')); this.setRecordClass(this.data('recordclass')); this.setLockURL(this.data('lockurl')); this.lockRecord(); } }, lockRecord: function() { if(!this.getRecordID() || !this.getRecordClass() || !this.getLockURL()){ return false; } var data = { RecordID: this.getRecordID(), RecordClass: this.getRecordClass() }; $.post(this.getLockURL(), data).done(function(result){ lockTimer = setTimeout(function(){$('.cms-edit-form').lockRecord()},10000); }); }, showLockMessage: function(){ this.find('p.message').first().after('<p/>') .addClass('message warning') .css('overflow', 'hidden') .html(this.data('lockedmessage')) .show(); } }); });
FIX Removal of existing lock timer on form load
FIX Removal of existing lock timer on form load
JavaScript
bsd-3-clause
sheadawson/silverstripe-editlock,sheadawson/silverstripe-editlock
javascript
## Code Before: jQuery.entwine("editlock", function($) { $('.cms-edit-form').entwine({ RecordID: null, RecordClass: null, LockURL: null, onmatch: function() { if(this.hasClass('edit-locked')){ this.showLockMessage(); }else{ this.setRecordID(this.data('recordid')); this.setRecordClass(this.data('recordclass')); this.setLockURL(this.data('lockurl')); this.lockRecord(); } }, lockRecord: function() { if(!this.getRecordID() || !this.getRecordClass() || !this.getLockURL()){ return false; } var data = { RecordID: this.getRecordID(), RecordClass: this.getRecordClass() }; $.post(this.getLockURL(), data).done(function(result){ setTimeout(function(){$('.cms-edit-form').lockRecord()},10000); }); }, showLockMessage: function(){ this.find('p.message').first().after('<p/>') .addClass('message warning') .css('overflow', 'hidden') .html(this.data('lockedmessage')) .show(); } }); }); ## Instruction: FIX Removal of existing lock timer on form load ## Code After: jQuery.entwine("editlock", function($) { var lockTimer = 0; $('.cms-edit-form').entwine({ RecordID: null, RecordClass: null, LockURL: null, onmatch: function() { // clear any previously bound lock timer if (lockTimer) { clearTimeout(lockTimer); } if(this.hasClass('edit-locked')){ this.showLockMessage(); }else{ this.setRecordID(this.data('recordid')); this.setRecordClass(this.data('recordclass')); this.setLockURL(this.data('lockurl')); this.lockRecord(); } }, lockRecord: function() { if(!this.getRecordID() || !this.getRecordClass() || !this.getLockURL()){ return false; } var data = { RecordID: this.getRecordID(), RecordClass: this.getRecordClass() }; $.post(this.getLockURL(), data).done(function(result){ lockTimer = setTimeout(function(){$('.cms-edit-form').lockRecord()},10000); }); }, showLockMessage: function(){ this.find('p.message').first().after('<p/>') .addClass('message warning') .css('overflow', 'hidden') .html(this.data('lockedmessage')) .show(); } }); });
jQuery.entwine("editlock", function($) { - + var lockTimer = 0; $('.cms-edit-form').entwine({ RecordID: null, RecordClass: null, LockURL: null, onmatch: function() { + // clear any previously bound lock timer + if (lockTimer) { + clearTimeout(lockTimer); + } + if(this.hasClass('edit-locked')){ this.showLockMessage(); }else{ this.setRecordID(this.data('recordid')); this.setRecordClass(this.data('recordclass')); this.setLockURL(this.data('lockurl')); this.lockRecord(); } }, - + lockRecord: function() { if(!this.getRecordID() || !this.getRecordClass() || !this.getLockURL()){ return false; } - + var data = { RecordID: this.getRecordID(), RecordClass: this.getRecordClass() }; $.post(this.getLockURL(), data).done(function(result){ - setTimeout(function(){$('.cms-edit-form').lockRecord()},10000); + lockTimer = setTimeout(function(){$('.cms-edit-form').lockRecord()},10000); ? ++++++++++++ }); }, showLockMessage: function(){ this.find('p.message').first().after('<p/>') .addClass('message warning') .css('overflow', 'hidden') .html(this.data('lockedmessage')) .show(); } }); });
13
0.302326
9
4
756109384dca9dc69aa88b6e415ff24cef9bb6d1
README.md
README.md
Here is an example repository for all Yak Shave Inc. operations that we know and can do. Copy/paste code yourself, or open an issue to help you. @abitrolly is occassionally available through many channels if you need to do something from the list prvately. #### Known Elements * [x] GitHub (https://github.com/yakshaveinc/linux) * [x] Travis CI (https://travis-ci.org/yakshaveinc/linux) * [x] DockerHub (https://hub.docker.com/r/yakshaveinc/linux) * [x] `cyberbuilder` account for automatic builds * [x] Snap Store (https://snapcraft.io/yakshaveinc) #### Mastered Operations * [x] Adding automatic builds to Linux projects through Travis - [![Travis](https://img.shields.io/travis/yakshaveinc/linux.svg)](https://travis-ci.org/yakshaveinc/linux) * [x] Automatic deploy of Docker containers from Travis CI to DockerHub ![github->travis->dockerhub](./docops/ops-travis-dockerhub.svg) * [x] Automatic build and publish from Travis CI to Snap Store
Yak Shave Inc. operations. Copy/paste code yourself, open an issue, or reach @abitrolly through https://t.me/abitrolly for support requests or project offers that require this expertise. #### Known Elements * [x] GitHub (https://github.com/yakshaveinc/linux) * [x] Travis CI (https://travis-ci.org/yakshaveinc/linux) * [x] DockerHub (https://hub.docker.com/r/yakshaveinc/linux) * [x] `cyberbuilder` account for automatic builds * [x] Snap Store (https://snapcraft.io/yakshaveinc) #### Mastered Operations * [x] Adding automatic builds to Linux projects through Travis - [![Travis](https://img.shields.io/travis/yakshaveinc/linux.svg)](https://travis-ci.org/yakshaveinc/linux) * [x] Automatic deploy of Docker containers from Travis CI to DockerHub ![github->travis->dockerhub](./docops/ops-travis-dockerhub.svg) * [x] Automatic build and publish from Travis CI to Snap Store * https://snapcraft.io/yakshaveinc (@abitrolly) * https://snapcraft.io/gitless (@techtonik, @abitrolly)
Add proof to snaps packaged and a way to reach me
Add proof to snaps packaged and a way to reach me
Markdown
unlicense
yakshaveinc/linux
markdown
## Code Before: Here is an example repository for all Yak Shave Inc. operations that we know and can do. Copy/paste code yourself, or open an issue to help you. @abitrolly is occassionally available through many channels if you need to do something from the list prvately. #### Known Elements * [x] GitHub (https://github.com/yakshaveinc/linux) * [x] Travis CI (https://travis-ci.org/yakshaveinc/linux) * [x] DockerHub (https://hub.docker.com/r/yakshaveinc/linux) * [x] `cyberbuilder` account for automatic builds * [x] Snap Store (https://snapcraft.io/yakshaveinc) #### Mastered Operations * [x] Adding automatic builds to Linux projects through Travis - [![Travis](https://img.shields.io/travis/yakshaveinc/linux.svg)](https://travis-ci.org/yakshaveinc/linux) * [x] Automatic deploy of Docker containers from Travis CI to DockerHub ![github->travis->dockerhub](./docops/ops-travis-dockerhub.svg) * [x] Automatic build and publish from Travis CI to Snap Store ## Instruction: Add proof to snaps packaged and a way to reach me ## Code After: Yak Shave Inc. operations. Copy/paste code yourself, open an issue, or reach @abitrolly through https://t.me/abitrolly for support requests or project offers that require this expertise. #### Known Elements * [x] GitHub (https://github.com/yakshaveinc/linux) * [x] Travis CI (https://travis-ci.org/yakshaveinc/linux) * [x] DockerHub (https://hub.docker.com/r/yakshaveinc/linux) * [x] `cyberbuilder` account for automatic builds * [x] Snap Store (https://snapcraft.io/yakshaveinc) #### Mastered Operations * [x] Adding automatic builds to Linux projects through Travis - [![Travis](https://img.shields.io/travis/yakshaveinc/linux.svg)](https://travis-ci.org/yakshaveinc/linux) * [x] Automatic deploy of Docker containers from Travis CI to DockerHub ![github->travis->dockerhub](./docops/ops-travis-dockerhub.svg) * [x] Automatic build and publish from Travis CI to Snap Store * https://snapcraft.io/yakshaveinc (@abitrolly) * https://snapcraft.io/gitless (@techtonik, @abitrolly)
+ Yak Shave Inc. operations. Copy/paste code yourself, open an issue, + or reach @abitrolly through https://t.me/abitrolly for support + requests or project offers that require this expertise. - Here is an example repository for all Yak Shave Inc. operations - that we know and can do. Copy/paste code yourself, or open an issue - to help you. @abitrolly is occassionally available through many - channels if you need to do something from the list prvately. #### Known Elements * [x] GitHub (https://github.com/yakshaveinc/linux) * [x] Travis CI (https://travis-ci.org/yakshaveinc/linux) * [x] DockerHub (https://hub.docker.com/r/yakshaveinc/linux) * [x] `cyberbuilder` account for automatic builds * [x] Snap Store (https://snapcraft.io/yakshaveinc) #### Mastered Operations * [x] Adding automatic builds to Linux projects through Travis - [![Travis](https://img.shields.io/travis/yakshaveinc/linux.svg)](https://travis-ci.org/yakshaveinc/linux) * [x] Automatic deploy of Docker containers from Travis CI to DockerHub ![github->travis->dockerhub](./docops/ops-travis-dockerhub.svg) * [x] Automatic build and publish from Travis CI to Snap Store + * https://snapcraft.io/yakshaveinc (@abitrolly) + * https://snapcraft.io/gitless (@techtonik, @abitrolly)
9
0.473684
5
4
a382ad6f6d1ca88fba920d2bf4a9a4940eda30df
compile-and-test.sh
compile-and-test.sh
set -e INFLUXDB_VERSIONS="1.3 1.2 1.1" JAVA_VERSIONS="3-jdk-8 3-jdk-9" for java_version in ${JAVA_VERSIONS} do echo "Run tests with maven:${java_version}" for version in ${INFLUXDB_VERSIONS} do echo "Tesing againts influxdb ${version}" docker kill influxdb || true docker rm influxdb || true docker pull influxdb:${version}-alpine || true docker run \ --detach \ --name influxdb \ --publish 8086:8086 \ --publish 8089:8089/udp \ --volume ${PWD}/influxdb.conf:/etc/influxdb/influxdb.conf \ influxdb:${version}-alpine docker run -it --rm \ --volume $PWD:/usr/src/mymaven \ --volume $PWD/.m2:/root/.m2 \ --workdir /usr/src/mymaven \ --link=influxdb \ --env INFLUXDB_IP=influxdb \ maven:${java_version} mvn clean install docker kill influxdb || true done done
set -e INFLUXDB_VERSIONS="1.4 1.3 1.2 1.1" JAVA_VERSIONS="3-jdk-8-alpine 3-jdk-9-slim" for java_version in ${JAVA_VERSIONS} do echo "Run tests with maven:${java_version}" for version in ${INFLUXDB_VERSIONS} do echo "Tesing againts influxdb ${version}" docker kill influxdb || true docker rm influxdb || true docker pull influxdb:${version}-alpine || true docker run \ --detach \ --name influxdb \ --publish 8086:8086 \ --publish 8089:8089/udp \ --volume ${PWD}/influxdb.conf:/etc/influxdb/influxdb.conf \ influxdb:${version}-alpine docker run -it --rm \ --volume $PWD:/usr/src/mymaven \ --volume $PWD/.m2:/root/.m2 \ --workdir /usr/src/mymaven \ --link=influxdb \ --env INFLUXDB_IP=influxdb \ maven:${java_version} mvn clean install docker kill influxdb || true done done
Add influxdb-1.4 to tests, use smaller maven images
Add influxdb-1.4 to tests, use smaller maven images
Shell
mit
influxdata/influxdb-java,influxdata/influxdb-java,influxdb/influxdb-java
shell
## Code Before: set -e INFLUXDB_VERSIONS="1.3 1.2 1.1" JAVA_VERSIONS="3-jdk-8 3-jdk-9" for java_version in ${JAVA_VERSIONS} do echo "Run tests with maven:${java_version}" for version in ${INFLUXDB_VERSIONS} do echo "Tesing againts influxdb ${version}" docker kill influxdb || true docker rm influxdb || true docker pull influxdb:${version}-alpine || true docker run \ --detach \ --name influxdb \ --publish 8086:8086 \ --publish 8089:8089/udp \ --volume ${PWD}/influxdb.conf:/etc/influxdb/influxdb.conf \ influxdb:${version}-alpine docker run -it --rm \ --volume $PWD:/usr/src/mymaven \ --volume $PWD/.m2:/root/.m2 \ --workdir /usr/src/mymaven \ --link=influxdb \ --env INFLUXDB_IP=influxdb \ maven:${java_version} mvn clean install docker kill influxdb || true done done ## Instruction: Add influxdb-1.4 to tests, use smaller maven images ## Code After: set -e INFLUXDB_VERSIONS="1.4 1.3 1.2 1.1" JAVA_VERSIONS="3-jdk-8-alpine 3-jdk-9-slim" for java_version in ${JAVA_VERSIONS} do echo "Run tests with maven:${java_version}" for version in ${INFLUXDB_VERSIONS} do echo "Tesing againts influxdb ${version}" docker kill influxdb || true docker rm influxdb || true docker pull influxdb:${version}-alpine || true docker run \ --detach \ --name influxdb \ --publish 8086:8086 \ --publish 8089:8089/udp \ --volume ${PWD}/influxdb.conf:/etc/influxdb/influxdb.conf \ influxdb:${version}-alpine docker run -it --rm \ --volume $PWD:/usr/src/mymaven \ --volume $PWD/.m2:/root/.m2 \ --workdir /usr/src/mymaven \ --link=influxdb \ --env INFLUXDB_IP=influxdb \ maven:${java_version} mvn clean install docker kill influxdb || true done done
set -e - INFLUXDB_VERSIONS="1.3 1.2 1.1" + INFLUXDB_VERSIONS="1.4 1.3 1.2 1.1" ? ++++ - JAVA_VERSIONS="3-jdk-8 3-jdk-9" + JAVA_VERSIONS="3-jdk-8-alpine 3-jdk-9-slim" ? +++++++ +++++ for java_version in ${JAVA_VERSIONS} do echo "Run tests with maven:${java_version}" for version in ${INFLUXDB_VERSIONS} do echo "Tesing againts influxdb ${version}" docker kill influxdb || true docker rm influxdb || true docker pull influxdb:${version}-alpine || true docker run \ --detach \ --name influxdb \ --publish 8086:8086 \ --publish 8089:8089/udp \ --volume ${PWD}/influxdb.conf:/etc/influxdb/influxdb.conf \ influxdb:${version}-alpine docker run -it --rm \ --volume $PWD:/usr/src/mymaven \ --volume $PWD/.m2:/root/.m2 \ --workdir /usr/src/mymaven \ --link=influxdb \ --env INFLUXDB_IP=influxdb \ maven:${java_version} mvn clean install docker kill influxdb || true done done
4
0.114286
2
2
17076899f03de6e343cbc78d4e300e630cfc404b
README.md
README.md
[![npm](https://nodei.co/npm/git-conflicts.png)](https://nodei.co/npm/git-conflicts/) # git-conflicts [![Dependency Status][david-badge]][david] Resolve merge conflicts in the editor. With `conflicts`, you do all the work yourself. [david]: https://david-dm.org/eush77/git-conflicts [david-badge]: https://david-dm.org/eush77/git-conflicts.png ## Usage ``` git conflicts ``` Opens each conflict in the editor. You resolve the conflict, save and exit, and go to the next one. ``` git conflicts [file]... ``` Run `conflicts` on specified files. ## Configuration - `$EDITOR` — set this variable to override the default editor. ## Install ``` npm install -g git-conflicts ``` ## License MIT
[![npm](https://nodei.co/npm/git-conflicts.png)](https://nodei.co/npm/git-conflicts/) # git-conflicts [![Dependency Status][david-badge]][david] Resolve merge conflicts in the editor. With `conflicts`, you do all the work yourself. [david]: https://david-dm.org/eush77/git-conflicts [david-badge]: https://david-dm.org/eush77/git-conflicts.png ## Usage ``` git conflicts ``` Opens each conflict in the editor. You resolve the conflict, save and exit, and go to the next one. You can abort conflict resolution process at any time by exiting with non-zero return code from the editor (editors not capable of that are not worth using). ``` git conflicts [file]... ``` Run `conflicts` on specified files. ## Configuration - `$EDITOR` — set this variable to override the default editor. ## Install ``` npm install -g git-conflicts ``` ## License MIT
Add note about aborting resolution
Add note about aborting resolution
Markdown
mit
eush77/git-conflicts
markdown
## Code Before: [![npm](https://nodei.co/npm/git-conflicts.png)](https://nodei.co/npm/git-conflicts/) # git-conflicts [![Dependency Status][david-badge]][david] Resolve merge conflicts in the editor. With `conflicts`, you do all the work yourself. [david]: https://david-dm.org/eush77/git-conflicts [david-badge]: https://david-dm.org/eush77/git-conflicts.png ## Usage ``` git conflicts ``` Opens each conflict in the editor. You resolve the conflict, save and exit, and go to the next one. ``` git conflicts [file]... ``` Run `conflicts` on specified files. ## Configuration - `$EDITOR` — set this variable to override the default editor. ## Install ``` npm install -g git-conflicts ``` ## License MIT ## Instruction: Add note about aborting resolution ## Code After: [![npm](https://nodei.co/npm/git-conflicts.png)](https://nodei.co/npm/git-conflicts/) # git-conflicts [![Dependency Status][david-badge]][david] Resolve merge conflicts in the editor. With `conflicts`, you do all the work yourself. [david]: https://david-dm.org/eush77/git-conflicts [david-badge]: https://david-dm.org/eush77/git-conflicts.png ## Usage ``` git conflicts ``` Opens each conflict in the editor. You resolve the conflict, save and exit, and go to the next one. You can abort conflict resolution process at any time by exiting with non-zero return code from the editor (editors not capable of that are not worth using). ``` git conflicts [file]... ``` Run `conflicts` on specified files. ## Configuration - `$EDITOR` — set this variable to override the default editor. ## Install ``` npm install -g git-conflicts ``` ## License MIT
[![npm](https://nodei.co/npm/git-conflicts.png)](https://nodei.co/npm/git-conflicts/) # git-conflicts [![Dependency Status][david-badge]][david] Resolve merge conflicts in the editor. With `conflicts`, you do all the work yourself. [david]: https://david-dm.org/eush77/git-conflicts [david-badge]: https://david-dm.org/eush77/git-conflicts.png ## Usage ``` git conflicts ``` Opens each conflict in the editor. You resolve the conflict, save and exit, and go to the next one. + + You can abort conflict resolution process at any time by exiting with non-zero return code from the editor (editors not capable of that are not worth using). ``` git conflicts [file]... ``` Run `conflicts` on specified files. ## Configuration - `$EDITOR` — set this variable to override the default editor. ## Install ``` npm install -g git-conflicts ``` ## License MIT
2
0.052632
2
0
851afcad6ced84d145c4b0a20c88d2cf0605bbdf
package.json
package.json
{ "name": "Mithril-Bootstrap_Modal", "version": "0.0.1", "description": "An implementation of Bootstrap 3 modal dialog using Mithril framework.", "author": "George Raptis (georapbox@gmail.com)", "homepage": "https://github.com/georapbox/Mithril-Bootstrap-Modal", "license": "Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.", "devDependencies": { "gulp": "^3.8.11", "gulp-minify-css": "^1.1.1", "gulp-rename": "^1.2.2", "gulp-uglify": "^1.2.0" } }
{ "name": "mithril-bootstrap-modal", "version": "0.0.1", "description": "An implementation of Bootstrap 3 modal dialog using Mithril framework.", "author": "George Raptis (georapbox@gmail.com)", "homepage": "https://github.com/georapbox/Mithril-Bootstrap-Modal", "license": "Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.", "main": "src/mithril_modal.js", "devDependencies": { "gulp": "^3.8.11", "gulp-minify-css": "^1.1.1", "gulp-rename": "^1.2.2", "gulp-uglify": "^1.2.0" } }
Add main script and make name all lowercase
Add main script and make name all lowercase
JSON
mit
lbn/Mithril-Bootstrap-Modal,lbn/Mithril-Bootstrap-Modal
json
## Code Before: { "name": "Mithril-Bootstrap_Modal", "version": "0.0.1", "description": "An implementation of Bootstrap 3 modal dialog using Mithril framework.", "author": "George Raptis (georapbox@gmail.com)", "homepage": "https://github.com/georapbox/Mithril-Bootstrap-Modal", "license": "Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.", "devDependencies": { "gulp": "^3.8.11", "gulp-minify-css": "^1.1.1", "gulp-rename": "^1.2.2", "gulp-uglify": "^1.2.0" } } ## Instruction: Add main script and make name all lowercase ## Code After: { "name": "mithril-bootstrap-modal", "version": "0.0.1", "description": "An implementation of Bootstrap 3 modal dialog using Mithril framework.", "author": "George Raptis (georapbox@gmail.com)", "homepage": "https://github.com/georapbox/Mithril-Bootstrap-Modal", "license": "Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.", "main": "src/mithril_modal.js", "devDependencies": { "gulp": "^3.8.11", "gulp-minify-css": "^1.1.1", "gulp-rename": "^1.2.2", "gulp-uglify": "^1.2.0" } }
{ - "name": "Mithril-Bootstrap_Modal", ? ^ ^ ^^ + "name": "mithril-bootstrap-modal", ? ^ ^ ^^ "version": "0.0.1", "description": "An implementation of Bootstrap 3 modal dialog using Mithril framework.", "author": "George Raptis (georapbox@gmail.com)", "homepage": "https://github.com/georapbox/Mithril-Bootstrap-Modal", "license": "Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.", + "main": "src/mithril_modal.js", "devDependencies": { "gulp": "^3.8.11", "gulp-minify-css": "^1.1.1", "gulp-rename": "^1.2.2", "gulp-uglify": "^1.2.0" } }
3
0.214286
2
1
ed186ce8dda5a8cee3ef45add251834bf459967f
Cargo.toml
Cargo.toml
[package] name = "single" version = "0.1.1" authors = ["CAD97 <cad97@cad97.com>"] description = "This crate exposes a `Single` trait for extracting the element from a single-element iterator (or `panic!`ing if that precondition is false)." repository = "https://github.com/CAD97/rust-single" readme = "README.md" keywords = ["iterator", "single", "once", "only"] license = "MIT/Apache-2.0" [badges] travis-ci = { repository = "https://github.com/CAD97/rust-single" } [dependencies]
[package] name = "single" version = "0.1.1" authors = ["CAD97 <cad97@cad97.com>"] description = "This crate exposes a `Single` trait for extracting the element from a single-element iterator (or `panic!`ing if that precondition is false)." repository = "https://github.com/CAD97/rust-single" readme = "README.md" keywords = ["iterator", "single", "once", "only"] license = "MIT/Apache-2.0" [badges] travis-ci = { repository = "CAD97/rust-single" } [dependencies]
Fix travis-ci badge on crates.io
Fix travis-ci badge on crates.io This'll have to wait until I push a new version to crates.io though... :(
TOML
mit
CAD97/rust-single
toml
## Code Before: [package] name = "single" version = "0.1.1" authors = ["CAD97 <cad97@cad97.com>"] description = "This crate exposes a `Single` trait for extracting the element from a single-element iterator (or `panic!`ing if that precondition is false)." repository = "https://github.com/CAD97/rust-single" readme = "README.md" keywords = ["iterator", "single", "once", "only"] license = "MIT/Apache-2.0" [badges] travis-ci = { repository = "https://github.com/CAD97/rust-single" } [dependencies] ## Instruction: Fix travis-ci badge on crates.io This'll have to wait until I push a new version to crates.io though... :( ## Code After: [package] name = "single" version = "0.1.1" authors = ["CAD97 <cad97@cad97.com>"] description = "This crate exposes a `Single` trait for extracting the element from a single-element iterator (or `panic!`ing if that precondition is false)." repository = "https://github.com/CAD97/rust-single" readme = "README.md" keywords = ["iterator", "single", "once", "only"] license = "MIT/Apache-2.0" [badges] travis-ci = { repository = "CAD97/rust-single" } [dependencies]
[package] name = "single" version = "0.1.1" authors = ["CAD97 <cad97@cad97.com>"] description = "This crate exposes a `Single` trait for extracting the element from a single-element iterator (or `panic!`ing if that precondition is false)." repository = "https://github.com/CAD97/rust-single" readme = "README.md" keywords = ["iterator", "single", "once", "only"] license = "MIT/Apache-2.0" [badges] - travis-ci = { repository = "https://github.com/CAD97/rust-single" } ? ------------------- + travis-ci = { repository = "CAD97/rust-single" } [dependencies]
2
0.105263
1
1
28ba5526201a3b2dbd83b263aa234297c08416fd
docs/system-reqs.md
docs/system-reqs.md
The v1.0.0 version of the plugin is supported on Ubuntu 14.04 and 16.04. Versions starting at v1.1.0 have been tested and are supported on the following Linux distributions: - Ubuntu 14.04 and beyond - RHEL 7.x and beyond - CoreOS 1122.3.0 and beyond - CentOS 7 and beyond Although the plugin software is supported on these linux distributions, you should consult the Hewlett Packard Enterprise Single Point of Connectivity Knowledge (SPOCK) for HPE Storage Products for specific details about which operating systems are supported by HPE 3PAR StoreServ and StoreVirtual Storage products (https://www.hpe.com/storage/spock). NOTE: Although other linux distributions have not been tested, the containerized version of the plugin should work as well. Docker 1.11 and newer is supported. Python 2.7 is supported. etcd 2.x is supported. Supported HPE 3PAR and StoreVirtual iSCSI storage arrays: - OS version support for 3PAR (3.2.1 MU2 and beyond) - OS version support for StoreVirtual (11.5 and beyond) NOTE: 3PAR FC support is currently not available. Supported HPE 3PAR and StoreVirtual clients: - python-3parclient version 4.0.0 or newer - python-lefthandclient version 2.0.0 or newer NOTE: Client support only applies when using the manual install instructions.
The v1.0.0 version of the plugin is supported on Ubuntu 14.04 and 16.04. Versions starting at v1.1.0 have been tested and are supported on the following Linux distributions: - Ubuntu 14.04 and 16.04 - RHEL 7.x and beyond - CoreOS 1122.3.0 and beyond - CentOS 7 and beyond Although the plugin software is supported on these linux distributions, you should consult the Hewlett Packard Enterprise Single Point of Connectivity Knowledge (SPOCK) for HPE Storage Products for specific details about which operating systems are supported by HPE 3PAR StoreServ and StoreVirtual Storage products (https://www.hpe.com/storage/spock). NOTE: Although other linux distributions have not been tested, the containerized version of the plugin should work as well. Docker 1.11 and 1.12 Python 2.7 is supported. etcd 2.x is supported. Supported HPE 3PAR and StoreVirtual iSCSI storage arrays: - OS version support for 3PAR (3.2.1 MU2, 3.2.2 upto MU3) - OS version support for StoreVirtual (11.5, 12.6) NOTE: 3PAR FC support is currently not available. Docker Swarm support is currently not avialable Supported HPE 3PAR and StoreVirtual clients: - python-3parclient version 4.0.0 or newer - python-lefthandclient version 2.0.0 or newer NOTE: Client support only applies when using the manual install instructions.
Update system requirements for HPE Docker Volume Plugin
Update system requirements for HPE Docker Volume Plugin Updated the system requirements document with the supported configurations for HPE Docker Volume Plugin
Markdown
apache-2.0
hpe-storage/python-hpedockerplugin,hpe-storage/python-hpedockerplugin
markdown
## Code Before: The v1.0.0 version of the plugin is supported on Ubuntu 14.04 and 16.04. Versions starting at v1.1.0 have been tested and are supported on the following Linux distributions: - Ubuntu 14.04 and beyond - RHEL 7.x and beyond - CoreOS 1122.3.0 and beyond - CentOS 7 and beyond Although the plugin software is supported on these linux distributions, you should consult the Hewlett Packard Enterprise Single Point of Connectivity Knowledge (SPOCK) for HPE Storage Products for specific details about which operating systems are supported by HPE 3PAR StoreServ and StoreVirtual Storage products (https://www.hpe.com/storage/spock). NOTE: Although other linux distributions have not been tested, the containerized version of the plugin should work as well. Docker 1.11 and newer is supported. Python 2.7 is supported. etcd 2.x is supported. Supported HPE 3PAR and StoreVirtual iSCSI storage arrays: - OS version support for 3PAR (3.2.1 MU2 and beyond) - OS version support for StoreVirtual (11.5 and beyond) NOTE: 3PAR FC support is currently not available. Supported HPE 3PAR and StoreVirtual clients: - python-3parclient version 4.0.0 or newer - python-lefthandclient version 2.0.0 or newer NOTE: Client support only applies when using the manual install instructions. ## Instruction: Update system requirements for HPE Docker Volume Plugin Updated the system requirements document with the supported configurations for HPE Docker Volume Plugin ## Code After: The v1.0.0 version of the plugin is supported on Ubuntu 14.04 and 16.04. Versions starting at v1.1.0 have been tested and are supported on the following Linux distributions: - Ubuntu 14.04 and 16.04 - RHEL 7.x and beyond - CoreOS 1122.3.0 and beyond - CentOS 7 and beyond Although the plugin software is supported on these linux distributions, you should consult the Hewlett Packard Enterprise Single Point of Connectivity Knowledge (SPOCK) for HPE Storage Products for specific details about which operating systems are supported by HPE 3PAR StoreServ and StoreVirtual Storage products (https://www.hpe.com/storage/spock). NOTE: Although other linux distributions have not been tested, the containerized version of the plugin should work as well. Docker 1.11 and 1.12 Python 2.7 is supported. etcd 2.x is supported. Supported HPE 3PAR and StoreVirtual iSCSI storage arrays: - OS version support for 3PAR (3.2.1 MU2, 3.2.2 upto MU3) - OS version support for StoreVirtual (11.5, 12.6) NOTE: 3PAR FC support is currently not available. Docker Swarm support is currently not avialable Supported HPE 3PAR and StoreVirtual clients: - python-3parclient version 4.0.0 or newer - python-lefthandclient version 2.0.0 or newer NOTE: Client support only applies when using the manual install instructions.
The v1.0.0 version of the plugin is supported on Ubuntu 14.04 and 16.04. Versions starting at v1.1.0 have been tested and are supported on the following Linux distributions: - - Ubuntu 14.04 and beyond ? ^^^^^^ + - Ubuntu 14.04 and 16.04 ? ^^^^^ - RHEL 7.x and beyond - CoreOS 1122.3.0 and beyond - CentOS 7 and beyond Although the plugin software is supported on these linux distributions, you should consult the Hewlett Packard Enterprise Single Point of Connectivity Knowledge (SPOCK) for HPE Storage Products for specific details about which operating systems are supported by HPE 3PAR StoreServ and StoreVirtual Storage products (https://www.hpe.com/storage/spock). NOTE: Although other linux distributions have not been tested, the containerized version of the plugin should work as well. - Docker 1.11 and newer is supported. + Docker 1.11 and 1.12 Python 2.7 is supported. etcd 2.x is supported. Supported HPE 3PAR and StoreVirtual iSCSI storage arrays: - - OS version support for 3PAR (3.2.1 MU2 and beyond) ? ^^^ ^^^ ^^ + - OS version support for 3PAR (3.2.1 MU2, 3.2.2 upto MU3) ? + ^^^^^ ^^^ ^^^^ - - OS version support for StoreVirtual (11.5 and beyond) ? ^^^^^^^^^^ + - OS version support for StoreVirtual (11.5, 12.6) ? + ^^^^ NOTE: 3PAR FC support is currently not available. + Docker Swarm support is currently not avialable Supported HPE 3PAR and StoreVirtual clients: - python-3parclient version 4.0.0 or newer - python-lefthandclient version 2.0.0 or newer NOTE: Client support only applies when using the manual install instructions.
9
0.28125
5
4
23e57facea49ebc093d1da7a9ae6857cd2c8dad7
warehouse/defaults.py
warehouse/defaults.py
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals # The base domain name for this installation. Used to control linking to # sub-domains. SERVER_NAME = "warehouse.local" # The URI for our PostgreSQL database. SQLALCHEMY_DATABASE_URI = "postgres:///warehouse" # The type of Storage to use. Can be either Filesystem or S3. STORAGE = "Filesystem" # The hash to use in computing filenames. # Allowed values: md5, sha1, sha224, sha256, sha384, sha512, None STORAGE_HASH = "md5" # Base directory for storage when using the Filesystem. STORAGE_DIRECTORY = "data" # The name of the bucket that files will be stored in when using S3. # STORAGE_BUCKET = "<storage bucket>" # The S3 Key used to access S3 when using S3 Storage # S3_KEY = "<S3 Key>" # The S3 Secret used to access S# when using S3 Storage # S3_SECRET = "<S3 Secret>"
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals # The base domain name for this installation. Used to control linking to # sub-domains. SERVER_NAME = "warehouse.local" # The URI for our PostgreSQL database. SQLALCHEMY_DATABASE_URI = "postgres:///warehouse" # The URI for our Redis database. REDIS_URI = "redis://localhost:6379/0" # The type of Storage to use. Can be either Filesystem or S3. STORAGE = "Filesystem" # The hash to use in computing filenames. # Allowed values: md5, sha1, sha224, sha256, sha384, sha512, None STORAGE_HASH = "md5" # Base directory for storage when using the Filesystem. STORAGE_DIRECTORY = "data" # The name of the bucket that files will be stored in when using S3. # STORAGE_BUCKET = "<storage bucket>" # The S3 Key used to access S3 when using S3 Storage # S3_KEY = "<S3 Key>" # The S3 Secret used to access S# when using S3 Storage # S3_SECRET = "<S3 Secret>"
Add an explicit default for REDIS_URI
Add an explicit default for REDIS_URI
Python
bsd-2-clause
davidfischer/warehouse
python
## Code Before: from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals # The base domain name for this installation. Used to control linking to # sub-domains. SERVER_NAME = "warehouse.local" # The URI for our PostgreSQL database. SQLALCHEMY_DATABASE_URI = "postgres:///warehouse" # The type of Storage to use. Can be either Filesystem or S3. STORAGE = "Filesystem" # The hash to use in computing filenames. # Allowed values: md5, sha1, sha224, sha256, sha384, sha512, None STORAGE_HASH = "md5" # Base directory for storage when using the Filesystem. STORAGE_DIRECTORY = "data" # The name of the bucket that files will be stored in when using S3. # STORAGE_BUCKET = "<storage bucket>" # The S3 Key used to access S3 when using S3 Storage # S3_KEY = "<S3 Key>" # The S3 Secret used to access S# when using S3 Storage # S3_SECRET = "<S3 Secret>" ## Instruction: Add an explicit default for REDIS_URI ## Code After: from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals # The base domain name for this installation. Used to control linking to # sub-domains. SERVER_NAME = "warehouse.local" # The URI for our PostgreSQL database. SQLALCHEMY_DATABASE_URI = "postgres:///warehouse" # The URI for our Redis database. REDIS_URI = "redis://localhost:6379/0" # The type of Storage to use. Can be either Filesystem or S3. STORAGE = "Filesystem" # The hash to use in computing filenames. # Allowed values: md5, sha1, sha224, sha256, sha384, sha512, None STORAGE_HASH = "md5" # Base directory for storage when using the Filesystem. STORAGE_DIRECTORY = "data" # The name of the bucket that files will be stored in when using S3. # STORAGE_BUCKET = "<storage bucket>" # The S3 Key used to access S3 when using S3 Storage # S3_KEY = "<S3 Key>" # The S3 Secret used to access S# when using S3 Storage # S3_SECRET = "<S3 Secret>"
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals # The base domain name for this installation. Used to control linking to # sub-domains. SERVER_NAME = "warehouse.local" # The URI for our PostgreSQL database. SQLALCHEMY_DATABASE_URI = "postgres:///warehouse" + + # The URI for our Redis database. + REDIS_URI = "redis://localhost:6379/0" # The type of Storage to use. Can be either Filesystem or S3. STORAGE = "Filesystem" # The hash to use in computing filenames. # Allowed values: md5, sha1, sha224, sha256, sha384, sha512, None STORAGE_HASH = "md5" # Base directory for storage when using the Filesystem. STORAGE_DIRECTORY = "data" # The name of the bucket that files will be stored in when using S3. # STORAGE_BUCKET = "<storage bucket>" # The S3 Key used to access S3 when using S3 Storage # S3_KEY = "<S3 Key>" # The S3 Secret used to access S# when using S3 Storage # S3_SECRET = "<S3 Secret>"
3
0.103448
3
0
7a6a6728b5bb30f804921d6acfd5c72400249fb7
doc/apps-dependencies.dot
doc/apps-dependencies.dot
digraph g { cluster -> "node"; ingest -> preprocessing; ingest -> cluster; "node" -> index; preprocessing -> stemming; preprocessing -> utf8; query -> cluster; query -> preprocessing; stemming -> utf8; }
digraph g { cluster -> "node"; doc -> preprocessing; ingest -> doc; ingest -> cluster; "node" -> index; preprocessing -> stemming; preprocessing -> utf8; query -> cluster; query -> preprocessing; stemming -> utf8; }
Add "doc" module to dependencies graph
Add "doc" module to dependencies graph
Graphviz (DOT)
bsd-3-clause
moretea/doko,moretea/doko
graphviz-dot
## Code Before: digraph g { cluster -> "node"; ingest -> preprocessing; ingest -> cluster; "node" -> index; preprocessing -> stemming; preprocessing -> utf8; query -> cluster; query -> preprocessing; stemming -> utf8; } ## Instruction: Add "doc" module to dependencies graph ## Code After: digraph g { cluster -> "node"; doc -> preprocessing; ingest -> doc; ingest -> cluster; "node" -> index; preprocessing -> stemming; preprocessing -> utf8; query -> cluster; query -> preprocessing; stemming -> utf8; }
digraph g { cluster -> "node"; - ingest -> preprocessing; ? ^^^^^^ + doc -> preprocessing; ? ^^^ + ingest -> doc; ingest -> cluster; "node" -> index; preprocessing -> stemming; preprocessing -> utf8; query -> cluster; query -> preprocessing; stemming -> utf8; }
3
0.272727
2
1
b1da47403f4871313e0759a21091ace04151cb84
src/renderer/actions/connections.js
src/renderer/actions/connections.js
import { sqlectron } from '../../browser/remote'; export const CONNECTION_REQUEST = 'CONNECTION_REQUEST'; export const CONNECTION_SUCCESS = 'CONNECTION_SUCCESS'; export const CONNECTION_FAILURE = 'CONNECTION_FAILURE'; export const dbSession = sqlectron.db.createSession(); export function connect (id, database) { return async (dispatch, getState) => { const { servers } = getState(); const [ server, config ] = await* [ servers.items.find(srv => srv.id === id), sqlectron.config.get(), ]; dispatch({ type: CONNECTION_REQUEST, server, database }); try { await dbSession.connect(server, database); dispatch({ type: CONNECTION_SUCCESS, server, database, config }); } catch (error) { dispatch({ type: CONNECTION_FAILURE, server, database, error }); } }; }
import { sqlectron } from '../../browser/remote'; export const CONNECTION_REQUEST = 'CONNECTION_REQUEST'; export const CONNECTION_SUCCESS = 'CONNECTION_SUCCESS'; export const CONNECTION_FAILURE = 'CONNECTION_FAILURE'; export const dbSession = sqlectron.db.createSession(); export function connect (id, database) { return async (dispatch, getState) => { const { servers } = getState(); const server = servers.items.find(srv => srv.id === id); dispatch({ type: CONNECTION_REQUEST, server, database }); try { const [, config ] = await Promise.all([ dbSession.connect(server, database), sqlectron.config.get(), ]); dispatch({ type: CONNECTION_SUCCESS, server, database, config }); } catch (error) { dispatch({ type: CONNECTION_FAILURE, server, database, error }); } }; }
Use promise all at the right place in the server connecting action
Use promise all at the right place in the server connecting action
JavaScript
mit
sqlectron/sqlectron-gui,sqlectron/sqlectron-gui,sqlectron/sqlectron-gui,sqlectron/sqlectron-gui
javascript
## Code Before: import { sqlectron } from '../../browser/remote'; export const CONNECTION_REQUEST = 'CONNECTION_REQUEST'; export const CONNECTION_SUCCESS = 'CONNECTION_SUCCESS'; export const CONNECTION_FAILURE = 'CONNECTION_FAILURE'; export const dbSession = sqlectron.db.createSession(); export function connect (id, database) { return async (dispatch, getState) => { const { servers } = getState(); const [ server, config ] = await* [ servers.items.find(srv => srv.id === id), sqlectron.config.get(), ]; dispatch({ type: CONNECTION_REQUEST, server, database }); try { await dbSession.connect(server, database); dispatch({ type: CONNECTION_SUCCESS, server, database, config }); } catch (error) { dispatch({ type: CONNECTION_FAILURE, server, database, error }); } }; } ## Instruction: Use promise all at the right place in the server connecting action ## Code After: import { sqlectron } from '../../browser/remote'; export const CONNECTION_REQUEST = 'CONNECTION_REQUEST'; export const CONNECTION_SUCCESS = 'CONNECTION_SUCCESS'; export const CONNECTION_FAILURE = 'CONNECTION_FAILURE'; export const dbSession = sqlectron.db.createSession(); export function connect (id, database) { return async (dispatch, getState) => { const { servers } = getState(); const server = servers.items.find(srv => srv.id === id); dispatch({ type: CONNECTION_REQUEST, server, database }); try { const [, config ] = await Promise.all([ dbSession.connect(server, database), sqlectron.config.get(), ]); dispatch({ type: CONNECTION_SUCCESS, server, database, config }); } catch (error) { dispatch({ type: CONNECTION_FAILURE, server, database, error }); } }; }
import { sqlectron } from '../../browser/remote'; export const CONNECTION_REQUEST = 'CONNECTION_REQUEST'; export const CONNECTION_SUCCESS = 'CONNECTION_SUCCESS'; export const CONNECTION_FAILURE = 'CONNECTION_FAILURE'; export const dbSession = sqlectron.db.createSession(); export function connect (id, database) { return async (dispatch, getState) => { const { servers } = getState(); - const [ server, config ] = await* [ - servers.items.find(srv => srv.id === id), ? ^ + const server = servers.items.find(srv => srv.id === id); ? +++++ ++++++++ ^ - sqlectron.config.get(), - ]; dispatch({ type: CONNECTION_REQUEST, server, database }); try { + const [, config ] = await Promise.all([ - await dbSession.connect(server, database); ? ^^^^^ ^ + dbSession.connect(server, database), ? ^ ^ + sqlectron.config.get(), + ]); dispatch({ type: CONNECTION_SUCCESS, server, database, config }); } catch (error) { dispatch({ type: CONNECTION_FAILURE, server, database, error }); } }; }
10
0.357143
5
5
488ff532521462a681030fd21fa65e39445235d9
app/views/main.html
app/views/main.html
<div ng-include="'views/search.html'" ng-controller="SearchCtrl"></div> <div ng-include="'views/document.html'" ng-controller="DocumentCtrl"></div>
<div ng-include="'views/document.html'" ng-controller="DocumentCtrl"></div>
Remove the search functionality from the view.
Remove the search functionality from the view.
HTML
apache-2.0
CenturyLinkLabs/lorry-ui,patocox/lorry-ui,CenturyLinkLabs/lorry-ui,rupakg/lorry-ui,patocox/lorry-ui,rupakg/lorry-ui,patocox/lorry-ui,CenturyLinkLabs/lorry-ui,rupakg/lorry-ui
html
## Code Before: <div ng-include="'views/search.html'" ng-controller="SearchCtrl"></div> <div ng-include="'views/document.html'" ng-controller="DocumentCtrl"></div> ## Instruction: Remove the search functionality from the view. ## Code After: <div ng-include="'views/document.html'" ng-controller="DocumentCtrl"></div>
- <div ng-include="'views/search.html'" ng-controller="SearchCtrl"></div> - <div ng-include="'views/document.html'" ng-controller="DocumentCtrl"></div>
2
0.666667
0
2
1903d3e11dab6cf98348d420c1f8701513958eb7
.travis.yml
.travis.yml
sudo: required services: - docker before_install: - gem install bundler install: - make test-deps script: - sed -i "s/172\.17\.0\.1/$(docker run debian:jessie ip route | sed -n 's/^default via \(.*\) dev .*/\1/p')/" spec/test_cluster.rb - make docker-compose - make test
sudo: required services: - docker before_install: - gem install bundler install: - make test-deps script: - sed -i "s/172\.17\.0\.1/$(docker run debian:jessie ip route | sed -n 's/^default via \(.*\) dev .*/\1/p')/" spec/test_cluster.rb - make docker-compose - make test 2>make-test.err after_failure: - "echo Tests failed, stderr was:" - cat make-test.err
Hide stderr on Travis unless build failed
Hide stderr on Travis unless build failed
YAML
apache-2.0
confluentinc/bottledwater-pg,confluentinc/bottledwater-pg,confluentinc/bottledwater-pg,confluentinc/bottledwater-pg
yaml
## Code Before: sudo: required services: - docker before_install: - gem install bundler install: - make test-deps script: - sed -i "s/172\.17\.0\.1/$(docker run debian:jessie ip route | sed -n 's/^default via \(.*\) dev .*/\1/p')/" spec/test_cluster.rb - make docker-compose - make test ## Instruction: Hide stderr on Travis unless build failed ## Code After: sudo: required services: - docker before_install: - gem install bundler install: - make test-deps script: - sed -i "s/172\.17\.0\.1/$(docker run debian:jessie ip route | sed -n 's/^default via \(.*\) dev .*/\1/p')/" spec/test_cluster.rb - make docker-compose - make test 2>make-test.err after_failure: - "echo Tests failed, stderr was:" - cat make-test.err
sudo: required services: - docker before_install: - gem install bundler install: - make test-deps script: - sed -i "s/172\.17\.0\.1/$(docker run debian:jessie ip route | sed -n 's/^default via \(.*\) dev .*/\1/p')/" spec/test_cluster.rb - make docker-compose - - make test + - make test 2>make-test.err + after_failure: + - "echo Tests failed, stderr was:" + - cat make-test.err
5
0.454545
4
1
11d2785c8bbc0bb71f4a4095834f1678cffb0545
README.md
README.md
nyan-cat ========
nyan-cat ======== [![Build Status](https://travis-ci.org/spyc3r/nyan-cat.png)](https://travis-ci.org/spyc3r/nyan-cat)
Add travis badge to readme
Add travis badge to readme
Markdown
mit
keathley/nyan-cat
markdown
## Code Before: nyan-cat ======== ## Instruction: Add travis badge to readme ## Code After: nyan-cat ======== [![Build Status](https://travis-ci.org/spyc3r/nyan-cat.png)](https://travis-ci.org/spyc3r/nyan-cat)
nyan-cat ======== + + [![Build Status](https://travis-ci.org/spyc3r/nyan-cat.png)](https://travis-ci.org/spyc3r/nyan-cat)
2
1
2
0
1736d7b7aed3ce3049186ce97e24941de0187caf
oidc_provider/lib/utils/common.py
oidc_provider/lib/utils/common.py
from django.conf import settings as django_settings from django.core.urlresolvers import reverse from oidc_provider import settings def get_issuer(): """ Construct the issuer full url. Basically is the site url with some path appended. """ site_url = settings.get('SITE_URL') path = reverse('oidc_provider:provider_info') \ .split('/.well-known/openid-configuration/')[0] issuer = site_url + path return issuer def get_rsa_key(): """ Load the rsa key previously created with `creatersakey` command. """ file_path = settings.get('OIDC_RSA_KEY_FOLDER') + '/OIDC_RSA_KEY.pem' with open(file_path, 'r') as f: key = f.read() return key
from django.conf import settings as django_settings from django.core.urlresolvers import reverse from oidc_provider import settings def get_issuer(): """ Construct the issuer full url. Basically is the site url with some path appended. """ site_url = settings.get('SITE_URL') path = reverse('oidc_provider:provider_info') \ .split('/.well-known/openid-configuration/')[0] issuer = site_url + path return issuer def get_rsa_key(): """ Load the rsa key previously created with `creatersakey` command. """ file_path = settings.get('OIDC_RSA_KEY_FOLDER') + '/OIDC_RSA_KEY.pem' try: with open(file_path, 'r') as f: key = f.read() except IOError: raise IOError('We could not find your key file on: ' + file_path) return key
Add IOError custom message when rsa key file is missing.
Add IOError custom message when rsa key file is missing.
Python
mit
ByteInternet/django-oidc-provider,torreco/django-oidc-provider,juanifioren/django-oidc-provider,bunnyinc/django-oidc-provider,wayward710/django-oidc-provider,bunnyinc/django-oidc-provider,wayward710/django-oidc-provider,wojtek-fliposports/django-oidc-provider,nmohoric/django-oidc-provider,nmohoric/django-oidc-provider,ByteInternet/django-oidc-provider,torreco/django-oidc-provider,wojtek-fliposports/django-oidc-provider,juanifioren/django-oidc-provider
python
## Code Before: from django.conf import settings as django_settings from django.core.urlresolvers import reverse from oidc_provider import settings def get_issuer(): """ Construct the issuer full url. Basically is the site url with some path appended. """ site_url = settings.get('SITE_URL') path = reverse('oidc_provider:provider_info') \ .split('/.well-known/openid-configuration/')[0] issuer = site_url + path return issuer def get_rsa_key(): """ Load the rsa key previously created with `creatersakey` command. """ file_path = settings.get('OIDC_RSA_KEY_FOLDER') + '/OIDC_RSA_KEY.pem' with open(file_path, 'r') as f: key = f.read() return key ## Instruction: Add IOError custom message when rsa key file is missing. ## Code After: from django.conf import settings as django_settings from django.core.urlresolvers import reverse from oidc_provider import settings def get_issuer(): """ Construct the issuer full url. Basically is the site url with some path appended. """ site_url = settings.get('SITE_URL') path = reverse('oidc_provider:provider_info') \ .split('/.well-known/openid-configuration/')[0] issuer = site_url + path return issuer def get_rsa_key(): """ Load the rsa key previously created with `creatersakey` command. """ file_path = settings.get('OIDC_RSA_KEY_FOLDER') + '/OIDC_RSA_KEY.pem' try: with open(file_path, 'r') as f: key = f.read() except IOError: raise IOError('We could not find your key file on: ' + file_path) return key
from django.conf import settings as django_settings from django.core.urlresolvers import reverse from oidc_provider import settings def get_issuer(): """ Construct the issuer full url. Basically is the site url with some path appended. """ site_url = settings.get('SITE_URL') path = reverse('oidc_provider:provider_info') \ .split('/.well-known/openid-configuration/')[0] issuer = site_url + path return issuer def get_rsa_key(): """ Load the rsa key previously created with `creatersakey` command. """ file_path = settings.get('OIDC_RSA_KEY_FOLDER') + '/OIDC_RSA_KEY.pem' + try: - with open(file_path, 'r') as f: + with open(file_path, 'r') as f: ? ++++ - key = f.read() + key = f.read() ? ++++ + except IOError: + raise IOError('We could not find your key file on: ' + file_path) return key
7
0.25
5
2
75d7b8e6a4487e73c1e34350c8bbcc467ebc9459
app/controllers/admin/features_controller.rb
app/controllers/admin/features_controller.rb
class Admin::FeaturesController < Admin::AdminController include FeatureGetterHelper before_filter :get_feature, :only => [:show, :destroy] def show @features_fields = Feature.non_common_fields end def create @features_fields = Feature.non_common_fields.map{|f| f[:name]} params_for_insert = Hash[params.select{|key| @features_fields.include?(key)}.map{|key, value| [key, value = value.blank?? nil : value]}] @new_feature = CartoDB::Connection.insert_row Cartoset::Config['features_table'], params_for_insert redirect_to admin_feature_path(@new_feature.cartodb_id) end def update @features_fields = Feature.non_common_fields.map{|f| f[:name]} params_for_update = params.select{|key| @features_fields.include?(key)} CartoDB::Connection.update_row Cartoset::Config['features_table'], params[:id], params_for_update redirect_to admin_feature_path(params[:id]) end def new @features_fields = Feature.non_common_fields end def destroy CartoDB::Connection.delete_row Cartoset::Config['features_table'], params[:id] redirect_to admin_path end end
class Admin::FeaturesController < Admin::AdminController include FeatureGetterHelper before_filter :get_feature, :only => [:show, :destroy] def show @features_fields = Feature.non_common_fields end def create @features_fields = Feature.non_common_fields.map{|f| f[:name]} params_for_insert = Hash[params.select{|key, value| @features_fields.include?(key)}.map{|key, value| [key, value = value.blank?? nil : value]}] @new_feature = CartoDB::Connection.insert_row Cartoset::Config['features_table'], params_for_insert redirect_to admin_feature_path(@new_feature.cartodb_id) end def update @features_fields = Feature.non_common_fields.map{|f| f[:name]} params_for_update = params.select{|key, value| @features_fields.include?(key)} CartoDB::Connection.update_row Cartoset::Config['features_table'], params[:id], params_for_update redirect_to admin_feature_path(params[:id]) end def new @features_fields = Feature.non_common_fields end def destroy CartoDB::Connection.delete_row Cartoset::Config['features_table'], params[:id] redirect_to admin_path end end
Fix a bug with ruby 1.8.7 when inserting/updating features
Fix a bug with ruby 1.8.7 when inserting/updating features
Ruby
bsd-3-clause
Vizzuality/cartoset,Vizzuality/cartoset
ruby
## Code Before: class Admin::FeaturesController < Admin::AdminController include FeatureGetterHelper before_filter :get_feature, :only => [:show, :destroy] def show @features_fields = Feature.non_common_fields end def create @features_fields = Feature.non_common_fields.map{|f| f[:name]} params_for_insert = Hash[params.select{|key| @features_fields.include?(key)}.map{|key, value| [key, value = value.blank?? nil : value]}] @new_feature = CartoDB::Connection.insert_row Cartoset::Config['features_table'], params_for_insert redirect_to admin_feature_path(@new_feature.cartodb_id) end def update @features_fields = Feature.non_common_fields.map{|f| f[:name]} params_for_update = params.select{|key| @features_fields.include?(key)} CartoDB::Connection.update_row Cartoset::Config['features_table'], params[:id], params_for_update redirect_to admin_feature_path(params[:id]) end def new @features_fields = Feature.non_common_fields end def destroy CartoDB::Connection.delete_row Cartoset::Config['features_table'], params[:id] redirect_to admin_path end end ## Instruction: Fix a bug with ruby 1.8.7 when inserting/updating features ## Code After: class Admin::FeaturesController < Admin::AdminController include FeatureGetterHelper before_filter :get_feature, :only => [:show, :destroy] def show @features_fields = Feature.non_common_fields end def create @features_fields = Feature.non_common_fields.map{|f| f[:name]} params_for_insert = Hash[params.select{|key, value| @features_fields.include?(key)}.map{|key, value| [key, value = value.blank?? nil : value]}] @new_feature = CartoDB::Connection.insert_row Cartoset::Config['features_table'], params_for_insert redirect_to admin_feature_path(@new_feature.cartodb_id) end def update @features_fields = Feature.non_common_fields.map{|f| f[:name]} params_for_update = params.select{|key, value| @features_fields.include?(key)} CartoDB::Connection.update_row Cartoset::Config['features_table'], params[:id], params_for_update redirect_to admin_feature_path(params[:id]) end def new @features_fields = Feature.non_common_fields end def destroy CartoDB::Connection.delete_row Cartoset::Config['features_table'], params[:id] redirect_to admin_path end end
class Admin::FeaturesController < Admin::AdminController include FeatureGetterHelper before_filter :get_feature, :only => [:show, :destroy] def show @features_fields = Feature.non_common_fields end def create @features_fields = Feature.non_common_fields.map{|f| f[:name]} - params_for_insert = Hash[params.select{|key| @features_fields.include?(key)}.map{|key, value| [key, value = value.blank?? nil : value]}] + params_for_insert = Hash[params.select{|key, value| @features_fields.include?(key)}.map{|key, value| [key, value = value.blank?? nil : value]}] ? +++++++ @new_feature = CartoDB::Connection.insert_row Cartoset::Config['features_table'], params_for_insert redirect_to admin_feature_path(@new_feature.cartodb_id) end def update @features_fields = Feature.non_common_fields.map{|f| f[:name]} - params_for_update = params.select{|key| @features_fields.include?(key)} + params_for_update = params.select{|key, value| @features_fields.include?(key)} ? +++++++ CartoDB::Connection.update_row Cartoset::Config['features_table'], params[:id], params_for_update redirect_to admin_feature_path(params[:id]) end def new @features_fields = Feature.non_common_fields end def destroy CartoDB::Connection.delete_row Cartoset::Config['features_table'], params[:id] redirect_to admin_path end end
4
0.102564
2
2
b511a3a8465b6ec4f3a7a9c626e7988d5feb885c
app.js
app.js
var express = require('express'), fs = require('fs'); var app = module.exports = express.createServer(); // Configuration app.configure(function(){ app.use(express.bodyParser()); app.use(express.methodOverride()); app.use(express.static(__dirname + '/public')); }); app.get('/', function (req, res) { res.sendfile(__dirname + '/public/index.html'); }); app.get('/:id/*?', function (req, res) { var path = __dirname + "/dump" + req.originalUrl.split("?")[0]; //HACK: we need to handle files that are not html var data = fs.readFileSync(path, 'utf8'); data += "<script src='/js/detect.js'></script>"; res.send(data); }); app.listen(3000, function(){ console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env); });
var express = require('express'), fs = require('fs'); var app = module.exports = express.createServer(); // Configuration app.configure(function(){ app.use(express.bodyParser()); app.use(express.methodOverride()); app.use(express.static(__dirname + '/public')); }); app.get('/', function (req, res) { res.sendfile(__dirname + '/public/index.html'); }); app.get('/:id/*?', function (req, res) { var path = __dirname + "/dump" + req.originalUrl.split("?")[0]; //HACK: we need to handle files that are not html var data = fs.readFileSync(path, 'utf8'); data += "<script src='/js/detect.js'></script>"; res.send(data); }); var port = process.env.PORT || 3000; app.listen(port, function(){ console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env); });
Add check for ENV port variable.
Add check for ENV port variable.
JavaScript
apache-2.0
phonegap/emulate.phonegap.com,phonegap/emulate.phonegap.com
javascript
## Code Before: var express = require('express'), fs = require('fs'); var app = module.exports = express.createServer(); // Configuration app.configure(function(){ app.use(express.bodyParser()); app.use(express.methodOverride()); app.use(express.static(__dirname + '/public')); }); app.get('/', function (req, res) { res.sendfile(__dirname + '/public/index.html'); }); app.get('/:id/*?', function (req, res) { var path = __dirname + "/dump" + req.originalUrl.split("?")[0]; //HACK: we need to handle files that are not html var data = fs.readFileSync(path, 'utf8'); data += "<script src='/js/detect.js'></script>"; res.send(data); }); app.listen(3000, function(){ console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env); }); ## Instruction: Add check for ENV port variable. ## Code After: var express = require('express'), fs = require('fs'); var app = module.exports = express.createServer(); // Configuration app.configure(function(){ app.use(express.bodyParser()); app.use(express.methodOverride()); app.use(express.static(__dirname + '/public')); }); app.get('/', function (req, res) { res.sendfile(__dirname + '/public/index.html'); }); app.get('/:id/*?', function (req, res) { var path = __dirname + "/dump" + req.originalUrl.split("?")[0]; //HACK: we need to handle files that are not html var data = fs.readFileSync(path, 'utf8'); data += "<script src='/js/detect.js'></script>"; res.send(data); }); var port = process.env.PORT || 3000; app.listen(port, function(){ console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env); });
var express = require('express'), fs = require('fs'); var app = module.exports = express.createServer(); // Configuration app.configure(function(){ app.use(express.bodyParser()); app.use(express.methodOverride()); app.use(express.static(__dirname + '/public')); }); app.get('/', function (req, res) { res.sendfile(__dirname + '/public/index.html'); }); app.get('/:id/*?', function (req, res) { var path = __dirname + "/dump" + req.originalUrl.split("?")[0]; //HACK: we need to handle files that are not html var data = fs.readFileSync(path, 'utf8'); data += "<script src='/js/detect.js'></script>"; res.send(data); }); + var port = process.env.PORT || 3000; - app.listen(3000, function(){ ? ^^^^ + app.listen(port, function(){ ? ^^^^ console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env); });
3
0.111111
2
1
8472078e29ca70843e19e24b6c3290dab20e80de
setup.py
setup.py
from setuptools import setup, find_packages # Parse the version from the mapbox module. with open('mapboxcli/__init__.py') as f: for line in f: if line.find("__version__") >= 0: version = line.split("=")[1].strip() version = version.strip('"') version = version.strip("'") continue setup(name='mapboxcli', version=version, description="Command line interface to Mapbox Web Services", classifiers=[], keywords='', author="Sean Gillies", author_email='sean@mapbox.com', url='https://github.com/mapbox/mapbox-cli-py', license='MIT', packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), include_package_data=True, zip_safe=False, install_requires=[ 'click', 'click-plugins', 'cligj>=0.4', 'mapbox>=0.11', 'six'], extras_require={ 'test': ['coveralls', 'pytest>=2.8', 'pytest-cov', 'responses'], }, entry_points=""" [console_scripts] mapbox=mapboxcli.scripts.cli:main_group """)
from setuptools import setup, find_packages # Parse the version from the mapbox module. with open('mapboxcli/__init__.py') as f: for line in f: if line.find("__version__") >= 0: version = line.split("=")[1].strip() version = version.strip('"') version = version.strip("'") continue setup(name='mapboxcli', version=version, description="Command line interface to Mapbox Web Services", classifiers=[], keywords='', author="Sean Gillies", author_email='sean@mapbox.com', url='https://github.com/mapbox/mapbox-cli-py', license='MIT', packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), include_package_data=True, zip_safe=False, install_requires=[ 'click', 'click-plugins', 'cligj>=0.4', 'mapbox>=0.11', 'six'], extras_require={ 'test': ['coveralls', 'pytest>=2.8', 'pytest-cov', 'responses', 'mock']}, entry_points=""" [console_scripts] mapbox=mapboxcli.scripts.cli:main_group """)
Add mock to test extras
Add mock to test extras
Python
mit
mapbox/mapbox-cli-py
python
## Code Before: from setuptools import setup, find_packages # Parse the version from the mapbox module. with open('mapboxcli/__init__.py') as f: for line in f: if line.find("__version__") >= 0: version = line.split("=")[1].strip() version = version.strip('"') version = version.strip("'") continue setup(name='mapboxcli', version=version, description="Command line interface to Mapbox Web Services", classifiers=[], keywords='', author="Sean Gillies", author_email='sean@mapbox.com', url='https://github.com/mapbox/mapbox-cli-py', license='MIT', packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), include_package_data=True, zip_safe=False, install_requires=[ 'click', 'click-plugins', 'cligj>=0.4', 'mapbox>=0.11', 'six'], extras_require={ 'test': ['coveralls', 'pytest>=2.8', 'pytest-cov', 'responses'], }, entry_points=""" [console_scripts] mapbox=mapboxcli.scripts.cli:main_group """) ## Instruction: Add mock to test extras ## Code After: from setuptools import setup, find_packages # Parse the version from the mapbox module. with open('mapboxcli/__init__.py') as f: for line in f: if line.find("__version__") >= 0: version = line.split("=")[1].strip() version = version.strip('"') version = version.strip("'") continue setup(name='mapboxcli', version=version, description="Command line interface to Mapbox Web Services", classifiers=[], keywords='', author="Sean Gillies", author_email='sean@mapbox.com', url='https://github.com/mapbox/mapbox-cli-py', license='MIT', packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), include_package_data=True, zip_safe=False, install_requires=[ 'click', 'click-plugins', 'cligj>=0.4', 'mapbox>=0.11', 'six'], extras_require={ 'test': ['coveralls', 'pytest>=2.8', 'pytest-cov', 'responses', 'mock']}, entry_points=""" [console_scripts] mapbox=mapboxcli.scripts.cli:main_group """)
from setuptools import setup, find_packages # Parse the version from the mapbox module. with open('mapboxcli/__init__.py') as f: for line in f: if line.find("__version__") >= 0: version = line.split("=")[1].strip() version = version.strip('"') version = version.strip("'") continue setup(name='mapboxcli', version=version, description="Command line interface to Mapbox Web Services", classifiers=[], keywords='', author="Sean Gillies", author_email='sean@mapbox.com', url='https://github.com/mapbox/mapbox-cli-py', license='MIT', packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), include_package_data=True, zip_safe=False, install_requires=[ 'click', 'click-plugins', 'cligj>=0.4', 'mapbox>=0.11', 'six'], extras_require={ - 'test': ['coveralls', 'pytest>=2.8', 'pytest-cov', 'responses'], ? - + 'test': ['coveralls', 'pytest>=2.8', 'pytest-cov', 'responses', - }, + 'mock']}, entry_points=""" [console_scripts] mapbox=mapboxcli.scripts.cli:main_group """)
4
0.108108
2
2
1b51a554e45810add193fbf65db0858b2e46f504
src/Zodiac/TSRP/HttpClient.hs
src/Zodiac/TSRP/HttpClient.hs
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} module Zodiac.TSRP.HttpClient( macHttpClientRequest , httpAuthHeader ) where import qualified Data.CaseInsensitive as CI import Network.HTTP.Client (Request) import Network.HTTP.Types (Header) import P import Tinfoil.Data (HashFunction(..), MAC, SymmetricKey) import Zodiac.Data import Zodiac.Request import Zodiac.Request.HttpClient import Zodiac.Symmetric httpAuthHeader :: SymmetricProtocol -> HashFunction -> KeyId -> RequestTimestamp -> RequestExpiry -> CRequest -> MAC -> Header httpAuthHeader sp hf kid rt re cr mac = let sh = signedHeaders cr sah = SymmetricAuthHeader sp hf kid rt re sh mac in (CI.mk "Authorization", renderSymmetricAuthHeader sah) macHttpClientRequest :: SymmetricProtocol -> HashFunction -> KeyId -> SymmetricKey -> RequestExpiry -> Request -> RequestTimestamp -> Either RequestError MAC macHttpClientRequest sp hf kid sk re r rts = do cr <- toCanonicalRequest r pure $ macRequest sp hf kid rts re cr sk
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} module Zodiac.TSRP.HttpClient( authedHttpClientRequest' , macHttpClientRequest , httpAuthHeader ) where import qualified Data.CaseInsensitive as CI import Network.HTTP.Client (Request(..), requestHeaders) import Network.HTTP.Types (Header) import P import Tinfoil.Data (HashFunction(..), MAC, SymmetricKey) import Zodiac.Data import Zodiac.Request import Zodiac.Request.HttpClient import Zodiac.Symmetric authedHttpClientRequest' :: SymmetricProtocol -> HashFunction -> KeyId -> SymmetricKey -> RequestExpiry -> Request -> RequestTimestamp -> Either RequestError Request authedHttpClientRequest' TSRPv1 hf kid sk re r rt = toCanonicalRequest r >>= \cr -> let mac = macRequest TSRPv1 hf kid rt re cr sk authH = httpAuthHeader TSRPv1 hf kid rt re cr mac newHeaders = authH : (requestHeaders r) in Right $ r { requestHeaders = newHeaders } httpAuthHeader :: SymmetricProtocol -> HashFunction -> KeyId -> RequestTimestamp -> RequestExpiry -> CRequest -> MAC -> Header httpAuthHeader TSRPv1 hf kid rt re cr mac = let sh = signedHeaders cr sah = SymmetricAuthHeader TSRPv1 hf kid rt re sh mac in (CI.mk "authorization", renderSymmetricAuthHeader sah) macHttpClientRequest :: SymmetricProtocol -> HashFunction -> KeyId -> SymmetricKey -> RequestExpiry -> Request -> RequestTimestamp -> Either RequestError MAC macHttpClientRequest TSRPv1 hf kid sk re r rts = do cr <- toCanonicalRequest r pure $ macRequest TSRPv1 hf kid rts re cr sk
Return an authenticated http-client Request
Return an authenticated http-client Request
Haskell
bsd-3-clause
ambiata/zodiac,ambiata/zodiac
haskell
## Code Before: {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} module Zodiac.TSRP.HttpClient( macHttpClientRequest , httpAuthHeader ) where import qualified Data.CaseInsensitive as CI import Network.HTTP.Client (Request) import Network.HTTP.Types (Header) import P import Tinfoil.Data (HashFunction(..), MAC, SymmetricKey) import Zodiac.Data import Zodiac.Request import Zodiac.Request.HttpClient import Zodiac.Symmetric httpAuthHeader :: SymmetricProtocol -> HashFunction -> KeyId -> RequestTimestamp -> RequestExpiry -> CRequest -> MAC -> Header httpAuthHeader sp hf kid rt re cr mac = let sh = signedHeaders cr sah = SymmetricAuthHeader sp hf kid rt re sh mac in (CI.mk "Authorization", renderSymmetricAuthHeader sah) macHttpClientRequest :: SymmetricProtocol -> HashFunction -> KeyId -> SymmetricKey -> RequestExpiry -> Request -> RequestTimestamp -> Either RequestError MAC macHttpClientRequest sp hf kid sk re r rts = do cr <- toCanonicalRequest r pure $ macRequest sp hf kid rts re cr sk ## Instruction: Return an authenticated http-client Request ## Code After: {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} module Zodiac.TSRP.HttpClient( authedHttpClientRequest' , macHttpClientRequest , httpAuthHeader ) where import qualified Data.CaseInsensitive as CI import Network.HTTP.Client (Request(..), requestHeaders) import Network.HTTP.Types (Header) import P import Tinfoil.Data (HashFunction(..), MAC, SymmetricKey) import Zodiac.Data import Zodiac.Request import Zodiac.Request.HttpClient import Zodiac.Symmetric authedHttpClientRequest' :: SymmetricProtocol -> HashFunction -> KeyId -> SymmetricKey -> RequestExpiry -> Request -> RequestTimestamp -> Either RequestError Request authedHttpClientRequest' TSRPv1 hf kid sk re r rt = toCanonicalRequest r >>= \cr -> let mac = macRequest TSRPv1 hf kid rt re cr sk authH = httpAuthHeader TSRPv1 hf kid rt re cr mac newHeaders = authH : (requestHeaders r) in Right $ r { requestHeaders = newHeaders } httpAuthHeader :: SymmetricProtocol -> HashFunction -> KeyId -> RequestTimestamp -> RequestExpiry -> CRequest -> MAC -> Header httpAuthHeader TSRPv1 hf kid rt re cr mac = let sh = signedHeaders cr sah = SymmetricAuthHeader TSRPv1 hf kid rt re sh mac in (CI.mk "authorization", renderSymmetricAuthHeader sah) macHttpClientRequest :: SymmetricProtocol -> HashFunction -> KeyId -> SymmetricKey -> RequestExpiry -> Request -> RequestTimestamp -> Either RequestError MAC macHttpClientRequest TSRPv1 hf kid sk re r rts = do cr <- toCanonicalRequest r pure $ macRequest TSRPv1 hf kid rts re cr sk
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} module Zodiac.TSRP.HttpClient( + authedHttpClientRequest' - macHttpClientRequest ? ^ + , macHttpClientRequest ? ^ , httpAuthHeader ) where import qualified Data.CaseInsensitive as CI - import Network.HTTP.Client (Request) + import Network.HTTP.Client (Request(..), requestHeaders) ? +++ +++++++++++++++++ import Network.HTTP.Types (Header) import P import Tinfoil.Data (HashFunction(..), MAC, SymmetricKey) import Zodiac.Data import Zodiac.Request import Zodiac.Request.HttpClient import Zodiac.Symmetric + authedHttpClientRequest' :: SymmetricProtocol + -> HashFunction + -> KeyId + -> SymmetricKey + -> RequestExpiry + -> Request + -> RequestTimestamp + -> Either RequestError Request + authedHttpClientRequest' TSRPv1 hf kid sk re r rt = + toCanonicalRequest r >>= \cr -> + let mac = macRequest TSRPv1 hf kid rt re cr sk + authH = httpAuthHeader TSRPv1 hf kid rt re cr mac + newHeaders = authH : (requestHeaders r) in + Right $ r { requestHeaders = newHeaders } + httpAuthHeader :: SymmetricProtocol -> HashFunction -> KeyId -> RequestTimestamp -> RequestExpiry -> CRequest -> MAC -> Header - httpAuthHeader sp hf kid rt re cr mac = ? ^^ + httpAuthHeader TSRPv1 hf kid rt re cr mac = ? ^^^^^^ let sh = signedHeaders cr - sah = SymmetricAuthHeader sp hf kid rt re sh mac in ? ^^ + sah = SymmetricAuthHeader TSRPv1 hf kid rt re sh mac in ? ^^^^^^ - (CI.mk "Authorization", renderSymmetricAuthHeader sah) ? ^ + (CI.mk "authorization", renderSymmetricAuthHeader sah) ? ^ macHttpClientRequest :: SymmetricProtocol -> HashFunction -> KeyId -> SymmetricKey -> RequestExpiry -> Request -> RequestTimestamp -> Either RequestError MAC - macHttpClientRequest sp hf kid sk re r rts = do ? ^^ + macHttpClientRequest TSRPv1 hf kid sk re r rts = do ? ^^^^^^ cr <- toCanonicalRequest r - pure $ macRequest sp hf kid rts re cr sk ? ^^ + pure $ macRequest TSRPv1 hf kid rts re cr sk ? ^^^^^^
30
0.625
23
7
a99085060c73346f15b54b916f56ece9a9501801
Examples/Segmentation/CMakeLists.txt
Examples/Segmentation/CMakeLists.txt
cmake_minimum_required(VERSION 2.8) project(SimpleITKSegmentationExamples) if(NOT SimpleITK_SOURCE_DIR) find_package(SimpleITK REQUIRED) include(${SimpleITK_USE_FILE}) endif() # Add executable example targets add_executable ( ConnectedThresholdImageFilter ConnectedThresholdImageFilter.cxx ) target_link_libraries ( ConnectedThresholdImageFilter ${SimpleITK_LIBRARIES} ) add_executable ( NeighborhoodConnectedImageFilter NeighborhoodConnectedImageFilter.cxx ) target_link_libraries ( NeighborhoodConnectedImageFilter ${SimpleITK_LIBRARIES} )
add_executable ( ConnectedThresholdImageFilter ConnectedThresholdImageFilter.cxx ) target_link_libraries ( ConnectedThresholdImageFilter ${SimpleITK_LIBRARIES} ) add_executable ( NeighborhoodConnectedImageFilter NeighborhoodConnectedImageFilter.cxx ) target_link_libraries ( NeighborhoodConnectedImageFilter ${SimpleITK_LIBRARIES} )
Remove Segmentation examples as separate project
Remove Segmentation examples as separate project Change-Id: Id9c6f07ef3346cc32f6a83ae881f75574dcdd2fd
Text
apache-2.0
richardbeare/SimpleITK,SimpleITK/SimpleITK,SimpleITK/SimpleITK,InsightSoftwareConsortium/SimpleITK,SimpleITK/SimpleITK,InsightSoftwareConsortium/SimpleITK,richardbeare/SimpleITK,kaspermarstal/SimpleElastix,InsightSoftwareConsortium/SimpleITK,blowekamp/SimpleITK,SimpleITK/SimpleITK,richardbeare/SimpleITK,kaspermarstal/SimpleElastix,SimpleITK/SimpleITK,richardbeare/SimpleITK,SimpleITK/SimpleITK,SimpleITK/SimpleITK,InsightSoftwareConsortium/SimpleITK,SimpleITK/SimpleITK,kaspermarstal/SimpleElastix,kaspermarstal/SimpleElastix,InsightSoftwareConsortium/SimpleITK,blowekamp/SimpleITK,blowekamp/SimpleITK,richardbeare/SimpleITK,blowekamp/SimpleITK,blowekamp/SimpleITK,InsightSoftwareConsortium/SimpleITK,blowekamp/SimpleITK,kaspermarstal/SimpleElastix,InsightSoftwareConsortium/SimpleITK,kaspermarstal/SimpleElastix,InsightSoftwareConsortium/SimpleITK,richardbeare/SimpleITK,richardbeare/SimpleITK,blowekamp/SimpleITK,blowekamp/SimpleITK,richardbeare/SimpleITK,kaspermarstal/SimpleElastix
text
## Code Before: cmake_minimum_required(VERSION 2.8) project(SimpleITKSegmentationExamples) if(NOT SimpleITK_SOURCE_DIR) find_package(SimpleITK REQUIRED) include(${SimpleITK_USE_FILE}) endif() # Add executable example targets add_executable ( ConnectedThresholdImageFilter ConnectedThresholdImageFilter.cxx ) target_link_libraries ( ConnectedThresholdImageFilter ${SimpleITK_LIBRARIES} ) add_executable ( NeighborhoodConnectedImageFilter NeighborhoodConnectedImageFilter.cxx ) target_link_libraries ( NeighborhoodConnectedImageFilter ${SimpleITK_LIBRARIES} ) ## Instruction: Remove Segmentation examples as separate project Change-Id: Id9c6f07ef3346cc32f6a83ae881f75574dcdd2fd ## Code After: add_executable ( ConnectedThresholdImageFilter ConnectedThresholdImageFilter.cxx ) target_link_libraries ( ConnectedThresholdImageFilter ${SimpleITK_LIBRARIES} ) add_executable ( NeighborhoodConnectedImageFilter NeighborhoodConnectedImageFilter.cxx ) target_link_libraries ( NeighborhoodConnectedImageFilter ${SimpleITK_LIBRARIES} )
- cmake_minimum_required(VERSION 2.8) - project(SimpleITKSegmentationExamples) - - if(NOT SimpleITK_SOURCE_DIR) - find_package(SimpleITK REQUIRED) - include(${SimpleITK_USE_FILE}) - endif() - - # Add executable example targets add_executable ( ConnectedThresholdImageFilter ConnectedThresholdImageFilter.cxx ) target_link_libraries ( ConnectedThresholdImageFilter ${SimpleITK_LIBRARIES} ) add_executable ( NeighborhoodConnectedImageFilter NeighborhoodConnectedImageFilter.cxx ) target_link_libraries ( NeighborhoodConnectedImageFilter ${SimpleITK_LIBRARIES} )
9
0.642857
0
9
9c24fdecf6b56eea88515afce962e65bc60255d5
setup.py
setup.py
from setuptools import setup setup( name='soccer-cli', version='0.0.3.1', description='Soccer for Hackers.', author='Archit Verma', license='MIT', classifiers=[ # How mature is this project? Common values are # 3 - Alpha # 4 - Beta # 5 - Production/Stable 'Development Status :: 3 - Alpha', # Indicate who your project is intended for 'Intended Audience :: Developers', 'Topic :: Software Development :: Build Tools', # Pick your license as you wish (should match "license" above) 'License :: OSI Approved :: MIT License', # Specify the Python versions you support here. In particular, ensure # that you indicate whether you support Python 2, Python 3 or both. 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', ], keywords = "soccer football espn scores live tool cli", author_email='architv07@gmail.com', url='https://github.com/architv/soccer-cli', scripts=['main.py', 'leagueids.py', 'authtoken.py', 'teamnames.py', 'liveapi.py'], install_requires=[ "click==5.0", "requests==2.7.0", ], entry_points = { 'console_scripts': [ 'soccer = main:main' ], } )
from setuptools import setup import sys setup( name='soccer-cli', version='0.0.3.1', description='Soccer for Hackers.', author='Archit Verma', license='MIT', classifiers=[ # How mature is this project? Common values are # 3 - Alpha # 4 - Beta # 5 - Production/Stable 'Development Status :: 3 - Alpha', # Indicate who your project is intended for 'Intended Audience :: Developers', 'Topic :: Software Development :: Build Tools', # Pick your license as you wish (should match "license" above) 'License :: OSI Approved :: MIT License', # Specify the Python versions you support here. In particular, ensure # that you indicate whether you support Python 2, Python 3 or both. 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', ], keywords = "soccer football espn scores live tool cli", author_email='architv07@gmail.com', url='https://github.com/architv/soccer-cli', scripts=['main.py', 'leagueids.py', 'authtoken.py', 'teamnames.py', 'liveapi.py'], install_requires=[ "click==5.0", "requests==2.7.0", ] + ["colorama==0.3.3"] if "win" in sys.platform else [], entry_points = { 'console_scripts': [ 'soccer = main:main' ], } )
Add color support for Windows
Add color support for Windows http://click.pocoo.org/5/utils/#ansi-colors
Python
mit
architv/soccer-cli,migueldvb/soccer-cli,Saturn/soccer-cli,saisai/soccer-cli,nare469/soccer-cli,littmus/soccer-cli,suhussai/soccer-cli,ueg1990/soccer-cli,thurask/soccer-cli,carlosvargas/soccer-cli
python
## Code Before: from setuptools import setup setup( name='soccer-cli', version='0.0.3.1', description='Soccer for Hackers.', author='Archit Verma', license='MIT', classifiers=[ # How mature is this project? Common values are # 3 - Alpha # 4 - Beta # 5 - Production/Stable 'Development Status :: 3 - Alpha', # Indicate who your project is intended for 'Intended Audience :: Developers', 'Topic :: Software Development :: Build Tools', # Pick your license as you wish (should match "license" above) 'License :: OSI Approved :: MIT License', # Specify the Python versions you support here. In particular, ensure # that you indicate whether you support Python 2, Python 3 or both. 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', ], keywords = "soccer football espn scores live tool cli", author_email='architv07@gmail.com', url='https://github.com/architv/soccer-cli', scripts=['main.py', 'leagueids.py', 'authtoken.py', 'teamnames.py', 'liveapi.py'], install_requires=[ "click==5.0", "requests==2.7.0", ], entry_points = { 'console_scripts': [ 'soccer = main:main' ], } ) ## Instruction: Add color support for Windows http://click.pocoo.org/5/utils/#ansi-colors ## Code After: from setuptools import setup import sys setup( name='soccer-cli', version='0.0.3.1', description='Soccer for Hackers.', author='Archit Verma', license='MIT', classifiers=[ # How mature is this project? Common values are # 3 - Alpha # 4 - Beta # 5 - Production/Stable 'Development Status :: 3 - Alpha', # Indicate who your project is intended for 'Intended Audience :: Developers', 'Topic :: Software Development :: Build Tools', # Pick your license as you wish (should match "license" above) 'License :: OSI Approved :: MIT License', # Specify the Python versions you support here. In particular, ensure # that you indicate whether you support Python 2, Python 3 or both. 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', ], keywords = "soccer football espn scores live tool cli", author_email='architv07@gmail.com', url='https://github.com/architv/soccer-cli', scripts=['main.py', 'leagueids.py', 'authtoken.py', 'teamnames.py', 'liveapi.py'], install_requires=[ "click==5.0", "requests==2.7.0", ] + ["colorama==0.3.3"] if "win" in sys.platform else [], entry_points = { 'console_scripts': [ 'soccer = main:main' ], } )
from setuptools import setup + import sys setup( name='soccer-cli', version='0.0.3.1', description='Soccer for Hackers.', author='Archit Verma', license='MIT', classifiers=[ # How mature is this project? Common values are # 3 - Alpha # 4 - Beta # 5 - Production/Stable 'Development Status :: 3 - Alpha', # Indicate who your project is intended for 'Intended Audience :: Developers', 'Topic :: Software Development :: Build Tools', # Pick your license as you wish (should match "license" above) 'License :: OSI Approved :: MIT License', # Specify the Python versions you support here. In particular, ensure # that you indicate whether you support Python 2, Python 3 or both. 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', ], keywords = "soccer football espn scores live tool cli", author_email='architv07@gmail.com', url='https://github.com/architv/soccer-cli', scripts=['main.py', 'leagueids.py', 'authtoken.py', 'teamnames.py', 'liveapi.py'], install_requires=[ "click==5.0", "requests==2.7.0", - ], + ] + ["colorama==0.3.3"] if "win" in sys.platform else [], entry_points = { 'console_scripts': [ 'soccer = main:main' ], } )
3
0.069767
2
1
7458e6cdd17cf5a7454e7b2212341722c94b988c
AUTHORS.txt
AUTHORS.txt
Adhocracy is licensed under the GNU Affero General Public License, Version 3, which can be found in LICENSE.txt Adhocracy is Copyright 2009, 2010, 2011, 2012, 2013, 2014 by Friedrich Lindenberg Martin Häcker Joscha Krutzki Bernhard Reiter Carsten Senger Nicolas Dietrich Philipp Hagemeister Tobias Bengfort
Adhocracy is licensed under the GNU Affero General Public License, Version 3, which can be found in LICENSE.txt Adhocracy is Copyright 2009, 2010, 2011, 2012, 2013, 2014 by Friedrich Lindenberg Joscha Krutzki Carsten Senger Nicolas Dietrich Philipp Hagemeister Tobias Bengfort and others. Check git history to get a list of all contributors.
Remove explicit authorship without significant contributions
Remove explicit authorship without significant contributions Note that there are more unnamed authors with more contributions.
Text
agpl-3.0
alkadis/vcv,DanielNeugebauer/adhocracy,liqd/adhocracy,alkadis/vcv,phihag/adhocracy,phihag/adhocracy,liqd/adhocracy,alkadis/vcv,alkadis/vcv,phihag/adhocracy,liqd/adhocracy,DanielNeugebauer/adhocracy,alkadis/vcv,phihag/adhocracy,liqd/adhocracy,DanielNeugebauer/adhocracy,DanielNeugebauer/adhocracy,DanielNeugebauer/adhocracy,phihag/adhocracy
text
## Code Before: Adhocracy is licensed under the GNU Affero General Public License, Version 3, which can be found in LICENSE.txt Adhocracy is Copyright 2009, 2010, 2011, 2012, 2013, 2014 by Friedrich Lindenberg Martin Häcker Joscha Krutzki Bernhard Reiter Carsten Senger Nicolas Dietrich Philipp Hagemeister Tobias Bengfort ## Instruction: Remove explicit authorship without significant contributions Note that there are more unnamed authors with more contributions. ## Code After: Adhocracy is licensed under the GNU Affero General Public License, Version 3, which can be found in LICENSE.txt Adhocracy is Copyright 2009, 2010, 2011, 2012, 2013, 2014 by Friedrich Lindenberg Joscha Krutzki Carsten Senger Nicolas Dietrich Philipp Hagemeister Tobias Bengfort and others. Check git history to get a list of all contributors.
Adhocracy is licensed under the GNU Affero General Public License, Version 3, which can be found in LICENSE.txt Adhocracy is Copyright 2009, 2010, 2011, 2012, 2013, 2014 by Friedrich Lindenberg - Martin Häcker Joscha Krutzki - Bernhard Reiter Carsten Senger Nicolas Dietrich Philipp Hagemeister Tobias Bengfort + + and others. Check git history to get a list of all contributors.
4
0.307692
2
2
505f8fcd0e0f9069c2a09fd0420bdab6606631a0
backend/app/views/comable/admin/shared/_notifier.slim
backend/app/views/comable/admin/shared/_notifier.slim
- if flash[:alert] || flash[:notice] #comable-notifier javascript: #{add_gritter(flash[:alert], image: :error) if flash[:alert]} #{add_gritter(flash[:notice], image: :success) if flash[:notice]}
- if flash[:alert] || flash[:notice] #comable-notifier javascript: #{add_gritter(flash[:alert], image: :error, nodom_wrap: true) if flash[:alert]} #{add_gritter(flash[:notice], image: :success, nodom_wrap: true) if flash[:notice]}
Add a gritter option to work
Add a gritter option to work
Slim
mit
hyoshida/comable,appirits/comable,hyoshida/comable,appirits/comable,appirits/comable,hyoshida/comable
slim
## Code Before: - if flash[:alert] || flash[:notice] #comable-notifier javascript: #{add_gritter(flash[:alert], image: :error) if flash[:alert]} #{add_gritter(flash[:notice], image: :success) if flash[:notice]} ## Instruction: Add a gritter option to work ## Code After: - if flash[:alert] || flash[:notice] #comable-notifier javascript: #{add_gritter(flash[:alert], image: :error, nodom_wrap: true) if flash[:alert]} #{add_gritter(flash[:notice], image: :success, nodom_wrap: true) if flash[:notice]}
- if flash[:alert] || flash[:notice] #comable-notifier javascript: - #{add_gritter(flash[:alert], image: :error) if flash[:alert]} + #{add_gritter(flash[:alert], image: :error, nodom_wrap: true) if flash[:alert]} ? ++++++++++++++++++ - #{add_gritter(flash[:notice], image: :success) if flash[:notice]} + #{add_gritter(flash[:notice], image: :success, nodom_wrap: true) if flash[:notice]} ? ++++++++++++++++++
4
0.8
2
2
ba46bf4e7fc4a5b3b161d6fe8d2ed9bd04e3a3fc
script/bootstrap.sh
script/bootstrap.sh
brew install tmux brew install ctags brew install rbenv brew install ruby-build brew install mysql brew install ag brew install sbt brew install leiningen brew install hub brew install node brew install vim brew install --HEAD https://raw.github.com/neovim/neovim/master/neovim.rb brew tap homebrew/dupes brew install apple-gcc42 brew install caskroom/cask/brew-cask brew cask install java brew cask install google-chrome brew cask install firefox brew cask install adium brew cask install hipchat brew cask install sequel-pro brew cask install iterm2 brew cask install alfred brew cask install spotify brew cask install vlc brew cask install utorrent brew cask install tvshows brew cask install evernote brew cask install skype brew cask install limechat brew cask install atom apm install vim-mode
brew install tmux brew install git bash-completion brew install ctags brew install rbenv brew install ruby-build brew install ag brew install sbt brew install leiningen brew install hub brew install node brew install vim brew install --HEAD https://raw.github.com/neovim/neovim/master/neovim.rb brew tap homebrew/dupes brew install apple-gcc42 brew install caskroom/cask/brew-cask brew cask install java brew cask install google-chrome brew cask install firefox brew cask install adium brew cask install hipchat brew cask install iterm2 brew cask install alfred brew cask install spotify brew cask install vlc brew cask install utorrent brew cask install tvshows brew cask install evernote brew cask install skype brew cask install limechat brew cask install atom apm install vim-mode
Add bash completion and remove optionals
Add bash completion and remove optionals
Shell
mit
lamuria/setup
shell
## Code Before: brew install tmux brew install ctags brew install rbenv brew install ruby-build brew install mysql brew install ag brew install sbt brew install leiningen brew install hub brew install node brew install vim brew install --HEAD https://raw.github.com/neovim/neovim/master/neovim.rb brew tap homebrew/dupes brew install apple-gcc42 brew install caskroom/cask/brew-cask brew cask install java brew cask install google-chrome brew cask install firefox brew cask install adium brew cask install hipchat brew cask install sequel-pro brew cask install iterm2 brew cask install alfred brew cask install spotify brew cask install vlc brew cask install utorrent brew cask install tvshows brew cask install evernote brew cask install skype brew cask install limechat brew cask install atom apm install vim-mode ## Instruction: Add bash completion and remove optionals ## Code After: brew install tmux brew install git bash-completion brew install ctags brew install rbenv brew install ruby-build brew install ag brew install sbt brew install leiningen brew install hub brew install node brew install vim brew install --HEAD https://raw.github.com/neovim/neovim/master/neovim.rb brew tap homebrew/dupes brew install apple-gcc42 brew install caskroom/cask/brew-cask brew cask install java brew cask install google-chrome brew cask install firefox brew cask install adium brew cask install hipchat brew cask install iterm2 brew cask install alfred brew cask install spotify brew cask install vlc brew cask install utorrent brew cask install tvshows brew cask install evernote brew cask install skype brew cask install limechat brew cask install atom apm install vim-mode
brew install tmux + brew install git bash-completion brew install ctags brew install rbenv brew install ruby-build - brew install mysql brew install ag brew install sbt brew install leiningen brew install hub brew install node brew install vim brew install --HEAD https://raw.github.com/neovim/neovim/master/neovim.rb brew tap homebrew/dupes brew install apple-gcc42 brew install caskroom/cask/brew-cask brew cask install java brew cask install google-chrome brew cask install firefox brew cask install adium brew cask install hipchat - brew cask install sequel-pro brew cask install iterm2 brew cask install alfred brew cask install spotify brew cask install vlc brew cask install utorrent brew cask install tvshows brew cask install evernote brew cask install skype brew cask install limechat brew cask install atom apm install vim-mode
3
0.085714
1
2
2ec99039bbea606d4f23b209eea5614608a62fcb
src/main/java/signature/CanonicalLabellingVisitor.java
src/main/java/signature/CanonicalLabellingVisitor.java
package signature; import java.util.Arrays; public class CanonicalLabellingVisitor implements DAGVisitor { private int[] labelling; private int currentLabel; public CanonicalLabellingVisitor(int vertexCount) { this.labelling = new int[vertexCount]; Arrays.fill(this.labelling, -1); this.currentLabel = 0; } public void visit(DAG.Node node) { // only label if this vertex has not yet been labeled if (this.labelling[node.vertexIndex] == -1) { this.labelling[node.vertexIndex] = this.currentLabel; this.currentLabel++; } for (DAG.Node child : node.children) { child.accept(this); } } public int[] getLabelling() { return this.labelling; } }
package signature; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; public class CanonicalLabellingVisitor implements DAGVisitor { private int[] labelling; private int currentLabel; private Comparator<DAG.Node> comparator; public CanonicalLabellingVisitor( int vertexCount, Comparator<DAG.Node> comparator) { labelling = new int[vertexCount]; Arrays.fill(labelling, -1); currentLabel = 0; } public void visit(DAG.Node node) { // only label if this vertex has not yet been labeled if (this.labelling[node.vertexIndex] == -1) { this.labelling[node.vertexIndex] = this.currentLabel; this.currentLabel++; } Collections.sort(node.children, comparator); for (DAG.Node child : node.children) { child.accept(this); } } public int[] getLabelling() { return this.labelling; } }
Sort the child nodes in the labelling visitor, to make sure that they are sorted
Sort the child nodes in the labelling visitor, to make sure that they are sorted
Java
mit
gilleain/signatures
java
## Code Before: package signature; import java.util.Arrays; public class CanonicalLabellingVisitor implements DAGVisitor { private int[] labelling; private int currentLabel; public CanonicalLabellingVisitor(int vertexCount) { this.labelling = new int[vertexCount]; Arrays.fill(this.labelling, -1); this.currentLabel = 0; } public void visit(DAG.Node node) { // only label if this vertex has not yet been labeled if (this.labelling[node.vertexIndex] == -1) { this.labelling[node.vertexIndex] = this.currentLabel; this.currentLabel++; } for (DAG.Node child : node.children) { child.accept(this); } } public int[] getLabelling() { return this.labelling; } } ## Instruction: Sort the child nodes in the labelling visitor, to make sure that they are sorted ## Code After: package signature; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; public class CanonicalLabellingVisitor implements DAGVisitor { private int[] labelling; private int currentLabel; private Comparator<DAG.Node> comparator; public CanonicalLabellingVisitor( int vertexCount, Comparator<DAG.Node> comparator) { labelling = new int[vertexCount]; Arrays.fill(labelling, -1); currentLabel = 0; } public void visit(DAG.Node node) { // only label if this vertex has not yet been labeled if (this.labelling[node.vertexIndex] == -1) { this.labelling[node.vertexIndex] = this.currentLabel; this.currentLabel++; } Collections.sort(node.children, comparator); for (DAG.Node child : node.children) { child.accept(this); } } public int[] getLabelling() { return this.labelling; } }
package signature; import java.util.Arrays; + import java.util.Collections; + import java.util.Comparator; public class CanonicalLabellingVisitor implements DAGVisitor { private int[] labelling; private int currentLabel; + private Comparator<DAG.Node> comparator; + + - public CanonicalLabellingVisitor(int vertexCount) { ? ------------------ + public CanonicalLabellingVisitor( + int vertexCount, Comparator<DAG.Node> comparator) { - this.labelling = new int[vertexCount]; ? ----- + labelling = new int[vertexCount]; - Arrays.fill(this.labelling, -1); ? ----- + Arrays.fill(labelling, -1); - this.currentLabel = 0; ? ----- + currentLabel = 0; } public void visit(DAG.Node node) { // only label if this vertex has not yet been labeled if (this.labelling[node.vertexIndex] == -1) { this.labelling[node.vertexIndex] = this.currentLabel; this.currentLabel++; } + Collections.sort(node.children, comparator); for (DAG.Node child : node.children) { child.accept(this); } } public int[] getLabelling() { return this.labelling; } }
15
0.46875
11
4
c5f644ac2162aa63def54e42365558222b546f93
app/controllers/letsencrypt_controller.rb
app/controllers/letsencrypt_controller.rb
class LetsencryptController < ApplicationController def letsencrypt # use your code here, not mine render text: "MQ5dUiAaSFm8z6_4o3igHp_P-5VcU-jSRU5O-gz6ufM.xQk3L_ZooytfqxYnB78MxA3nMkWHp7bd6j8jAExcZMs" end end
class LetsencryptController < ApplicationController def letsencrypt # use your code here, not mine render text: "GHsKETOLaQ3HUHjD4rJMzhjRnzM8K1Z_y6gXJcszipQ.xQk3L_ZooytfqxYnB78MxA3nMkWHp7bd6j8jAExcZMs" end end
Change url cert is for
Change url cert is for
Ruby
mit
icodeclean/StockAid,on-site/StockAid,on-site/StockAid,icodeclean/StockAid,icodeclean/StockAid,on-site/StockAid
ruby
## Code Before: class LetsencryptController < ApplicationController def letsencrypt # use your code here, not mine render text: "MQ5dUiAaSFm8z6_4o3igHp_P-5VcU-jSRU5O-gz6ufM.xQk3L_ZooytfqxYnB78MxA3nMkWHp7bd6j8jAExcZMs" end end ## Instruction: Change url cert is for ## Code After: class LetsencryptController < ApplicationController def letsencrypt # use your code here, not mine render text: "GHsKETOLaQ3HUHjD4rJMzhjRnzM8K1Z_y6gXJcszipQ.xQk3L_ZooytfqxYnB78MxA3nMkWHp7bd6j8jAExcZMs" end end
class LetsencryptController < ApplicationController def letsencrypt # use your code here, not mine - render text: "MQ5dUiAaSFm8z6_4o3igHp_P-5VcU-jSRU5O-gz6ufM.xQk3L_ZooytfqxYnB78MxA3nMkWHp7bd6j8jAExcZMs" + render text: "GHsKETOLaQ3HUHjD4rJMzhjRnzM8K1Z_y6gXJcszipQ.xQk3L_ZooytfqxYnB78MxA3nMkWHp7bd6j8jAExcZMs" end end
2
0.333333
1
1
9075cf1aa531252ffd4b97bddcbc4ca702da5436
utils.c
utils.c
char* file_to_buffer(const char *filename) { struct stat sb; stat(filename, &sb); char *buffer = (char*) malloc(sb.st_size * sizeof(char)); FILE *f = fopen(filename, "rb"); assert(fread((void*) buffer, sizeof(char), sb.st_size, f)); fclose(f); return buffer; }
char* file_to_buffer(const char *filename) { struct stat sb; stat(filename, &sb); char *buffer = (char*) malloc(sb.st_size * sizeof(char)); FILE *f = fopen(filename, "rb"); assert(fread((void*) buffer, sizeof(char), sb.st_size, f)); fclose(f); return buffer; } void* mmalloc(size_t sz, char *filename) { int fd = open(filename, O_RDWR | O_CREAT, 0666); assert(fd != -1); char v = 0; for (size_t i = 0; i < sz; i++) { assert(write(fd, &v, sizeof(char))); } void *map = mmap(NULL, sz, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); madvise(map, sz, MADV_RANDOM); return map; }
Implement dirty unallocatable memory mapped alloc.
Implement dirty unallocatable memory mapped alloc.
C
mit
frostburn/tinytsumego,frostburn/tinytsumego
c
## Code Before: char* file_to_buffer(const char *filename) { struct stat sb; stat(filename, &sb); char *buffer = (char*) malloc(sb.st_size * sizeof(char)); FILE *f = fopen(filename, "rb"); assert(fread((void*) buffer, sizeof(char), sb.st_size, f)); fclose(f); return buffer; } ## Instruction: Implement dirty unallocatable memory mapped alloc. ## Code After: char* file_to_buffer(const char *filename) { struct stat sb; stat(filename, &sb); char *buffer = (char*) malloc(sb.st_size * sizeof(char)); FILE *f = fopen(filename, "rb"); assert(fread((void*) buffer, sizeof(char), sb.st_size, f)); fclose(f); return buffer; } void* mmalloc(size_t sz, char *filename) { int fd = open(filename, O_RDWR | O_CREAT, 0666); assert(fd != -1); char v = 0; for (size_t i = 0; i < sz; i++) { assert(write(fd, &v, sizeof(char))); } void *map = mmap(NULL, sz, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); madvise(map, sz, MADV_RANDOM); return map; }
char* file_to_buffer(const char *filename) { struct stat sb; stat(filename, &sb); char *buffer = (char*) malloc(sb.st_size * sizeof(char)); FILE *f = fopen(filename, "rb"); assert(fread((void*) buffer, sizeof(char), sb.st_size, f)); fclose(f); return buffer; } + + void* mmalloc(size_t sz, char *filename) { + int fd = open(filename, O_RDWR | O_CREAT, 0666); + assert(fd != -1); + char v = 0; + for (size_t i = 0; i < sz; i++) { + assert(write(fd, &v, sizeof(char))); + } + void *map = mmap(NULL, sz, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + madvise(map, sz, MADV_RANDOM); + return map; + }
12
1.333333
12
0
9be7deeaf400858dc00118d274b4cf4d19c60858
stdnum/cr/__init__.py
stdnum/cr/__init__.py
"""Collection of Costa Rican numbers."""
"""Collection of Costa Rican numbers.""" from stdnum.cr import cpj as vat # noqa: F401
Add missing vat alias for Costa Rica
Add missing vat alias for Costa Rica
Python
lgpl-2.1
arthurdejong/python-stdnum,arthurdejong/python-stdnum,arthurdejong/python-stdnum
python
## Code Before: """Collection of Costa Rican numbers.""" ## Instruction: Add missing vat alias for Costa Rica ## Code After: """Collection of Costa Rican numbers.""" from stdnum.cr import cpj as vat # noqa: F401
"""Collection of Costa Rican numbers.""" + from stdnum.cr import cpj as vat # noqa: F401
1
0.5
1
0
f56daf1995445b84874515afbab18a9fafc0d1ea
tutorial-guide/INDEX.md
tutorial-guide/INDEX.md
Welcome to the Errai tutorial. This tutorial is designed to walk you through getting started with Errai. What exactly does that entail? Here is an index the files in this tutorial guide and what they cover: 1. **SETUP.md** : Get the tools you need (such as Git, Maven, and Jboss) 2. **RUN.md** : Run an Errai Application in production and development mode 3. **DEVELOP.md** : Start your very own Errai Application 4. **FAQ.md** : Answers to common questions and problems Would you like to contribute information you've learned to this tutorial? Send a pull request on [github](https://github.com/errai/errai-tutorial). Community contributions are cheerfully reviewed and accepted.
Welcome to the Errai tutorial. This tutorial is designed to walk you through getting started with Errai. What exactly does that entail? Here is an index the files in this tutorial guide and what they cover: 1. **SETUP.md** : Get the tools you need (such as Git, Maven, and Jboss) 2. **RUN.md** : Run an Errai Application in production and development mode 3. **DEVELOP.md** : Start your very own Errai Application Would you like to contribute information you've learned to this tutorial? Send a pull request on [github](https://github.com/errai/errai-tutorial). Community contributions are cheerfully reviewed and accepted.
Remove mention of FAQ from index.
Remove mention of FAQ from index. I might've been getting ahead of myself there.
Markdown
apache-2.0
WISDelft/ExpertiseFindingPrototype,errai/errai-tutorial,freelance-factory/errai-prototype,errai/errai-tutorial,freelance-factory/user-complaint-form,mbarkley/errai-tutorial,WISDelft/ExpertiseFindingPrototype,freelance-factory/ticketek,mbarkley/errai-tutorial,divd/errai-tutorial,freelance-factory/user-complaint-form,divd/errai-tutorial,freelance-factory/errai-prototype,freelance-factory/ticketek
markdown
## Code Before: Welcome to the Errai tutorial. This tutorial is designed to walk you through getting started with Errai. What exactly does that entail? Here is an index the files in this tutorial guide and what they cover: 1. **SETUP.md** : Get the tools you need (such as Git, Maven, and Jboss) 2. **RUN.md** : Run an Errai Application in production and development mode 3. **DEVELOP.md** : Start your very own Errai Application 4. **FAQ.md** : Answers to common questions and problems Would you like to contribute information you've learned to this tutorial? Send a pull request on [github](https://github.com/errai/errai-tutorial). Community contributions are cheerfully reviewed and accepted. ## Instruction: Remove mention of FAQ from index. I might've been getting ahead of myself there. ## Code After: Welcome to the Errai tutorial. This tutorial is designed to walk you through getting started with Errai. What exactly does that entail? Here is an index the files in this tutorial guide and what they cover: 1. **SETUP.md** : Get the tools you need (such as Git, Maven, and Jboss) 2. **RUN.md** : Run an Errai Application in production and development mode 3. **DEVELOP.md** : Start your very own Errai Application Would you like to contribute information you've learned to this tutorial? Send a pull request on [github](https://github.com/errai/errai-tutorial). Community contributions are cheerfully reviewed and accepted.
Welcome to the Errai tutorial. This tutorial is designed to walk you through getting started with Errai. What exactly does that entail? Here is an index the files in this tutorial guide and what they cover: 1. **SETUP.md** : Get the tools you need (such as Git, Maven, and Jboss) 2. **RUN.md** : Run an Errai Application in production and development mode 3. **DEVELOP.md** : Start your very own Errai Application - 4. **FAQ.md** : Answers to common questions and problems - Would you like to contribute information you've learned to this tutorial? Send a pull request on [github](https://github.com/errai/errai-tutorial). Community contributions are cheerfully reviewed and accepted.
2
0.166667
0
2
ba91fb3f357eae45022a76e613fcdbec8d58aee2
app/assets/stylesheets/dashboard.scss
app/assets/stylesheets/dashboard.scss
// Place all the styles related to the dashboard controller here. // They will automatically be included in application.css. // You can use Sass (SCSS) here: http://sass-lang.com/ header sup { font-variant: small-caps; } ul.dropdown-menu .popover { width:300px; } .motd { overflow-wrap: break-word; word-wrap: break-word; -ms-word-break: break-all; word-break: break-word; }
// Place all the styles related to the dashboard controller here. // They will automatically be included in application.css. // You can use Sass (SCSS) here: http://sass-lang.com/ header sup { font-variant: small-caps; } ul.dropdown-menu .popover { width:300px; } .motd { overflow-wrap: break-word; word-wrap: break-word; -ms-word-break: break-all; word-break: break-word; } footer { border-top: 1px solid #eee; margin: 0px 15px; padding-top: 30px; }
Add css hr to delineate footer
Add css hr to delineate footer
SCSS
mit
OSC/ood-dashboard,OSC/ood-dashboard,OSC/ood-dashboard
scss
## Code Before: // Place all the styles related to the dashboard controller here. // They will automatically be included in application.css. // You can use Sass (SCSS) here: http://sass-lang.com/ header sup { font-variant: small-caps; } ul.dropdown-menu .popover { width:300px; } .motd { overflow-wrap: break-word; word-wrap: break-word; -ms-word-break: break-all; word-break: break-word; } ## Instruction: Add css hr to delineate footer ## Code After: // Place all the styles related to the dashboard controller here. // They will automatically be included in application.css. // You can use Sass (SCSS) here: http://sass-lang.com/ header sup { font-variant: small-caps; } ul.dropdown-menu .popover { width:300px; } .motd { overflow-wrap: break-word; word-wrap: break-word; -ms-word-break: break-all; word-break: break-word; } footer { border-top: 1px solid #eee; margin: 0px 15px; padding-top: 30px; }
// Place all the styles related to the dashboard controller here. // They will automatically be included in application.css. // You can use Sass (SCSS) here: http://sass-lang.com/ header sup { font-variant: small-caps; } ul.dropdown-menu .popover { width:300px; } .motd { overflow-wrap: break-word; word-wrap: break-word; -ms-word-break: break-all; word-break: break-word; } + + footer { + border-top: 1px solid #eee; + margin: 0px 15px; + padding-top: 30px; + }
6
0.333333
6
0
74220e49b03bb5357eddec432719075643aaeb68
README.md
README.md
[![Travis](https://img.shields.io/travis/xmas-bunch/bookkeeper.svg)]() [![Codecov](https://img.shields.io/codecov/c/github/xmas-bunch/bookkeeper.svg)]() Track expenses, earning, and assets easily.
[!(https://img.shields.io/github/license/xmas-bunch/bookkeeper.svg)](http://www.opensource.org/licenses/MIT) [!(https://img.shields.io/travis/xmas-bunch/bookkeeper.svg)](https://travis-ci.org/xmas-bunch/bookkeeper) [!(https://img.shields.io/codecov/c/github/xmas-bunch/bookkeeper.svg)](https://codecov.io/gh/xmas-bunch/bookkeeper) Track expenses, earning, and assets easily.
Add license shield, fix links in others
Add license shield, fix links in others
Markdown
mit
xmas-bunch/bookkeeper
markdown
## Code Before: [![Travis](https://img.shields.io/travis/xmas-bunch/bookkeeper.svg)]() [![Codecov](https://img.shields.io/codecov/c/github/xmas-bunch/bookkeeper.svg)]() Track expenses, earning, and assets easily. ## Instruction: Add license shield, fix links in others ## Code After: [!(https://img.shields.io/github/license/xmas-bunch/bookkeeper.svg)](http://www.opensource.org/licenses/MIT) [!(https://img.shields.io/travis/xmas-bunch/bookkeeper.svg)](https://travis-ci.org/xmas-bunch/bookkeeper) [!(https://img.shields.io/codecov/c/github/xmas-bunch/bookkeeper.svg)](https://codecov.io/gh/xmas-bunch/bookkeeper) Track expenses, earning, and assets easily.
- [![Travis](https://img.shields.io/travis/xmas-bunch/bookkeeper.svg)]() [![Codecov](https://img.shields.io/codecov/c/github/xmas-bunch/bookkeeper.svg)]() + [!(https://img.shields.io/github/license/xmas-bunch/bookkeeper.svg)](http://www.opensource.org/licenses/MIT) + [!(https://img.shields.io/travis/xmas-bunch/bookkeeper.svg)](https://travis-ci.org/xmas-bunch/bookkeeper) + [!(https://img.shields.io/codecov/c/github/xmas-bunch/bookkeeper.svg)](https://codecov.io/gh/xmas-bunch/bookkeeper) Track expenses, earning, and assets easily.
4
1
3
1
5a2d9217230a74e2736523b261edf22da5ec7d49
README.rst
README.rst
================ FeinCMS in a Box ================ Prerequisites ------------- An up-to-date installation of compass and zurb-foundation 4.3.2:: (sudo) gem install compass (sudo) gem install zurb-foundation --version '=4.3.2' Under Debian-derivatives, you need the following libraries:: sudo apt-get install build-essential python-dev libjpeg8-dev \ libxslt1-dev libfreetype6-dev Under OS X, you need an installation of Xcode. It is also recommended to install `Homebrew <http://brew.sh/>`_, and install the following packages:: brew install gettext brew install libxslt brew install libxml2 brew install jpeg Installattion ------------- The following commands should get you up and running:: git clone git://github.com/matthiask/feincms-in-a-box.git box cd box git remote rm origin virtualenv venv source venv/bin/activate pip install -r requirements/dev.txt echo "SECRET_KEY = 'unsafe'" > box/local_settings.py ./manage.py syncdb --all ./manage.py migrate --all --fake fab dev open http://127.0.0.1:8038/admin/ # OR xdg-open http://127.0.0.1:8038/admin/
================ FeinCMS in a Box ================ Prerequisites ------------- An up-to-date installation of compass and zurb-foundation 4.3.2:: (sudo) gem install compass (sudo) gem install zurb-foundation --version '=4.3.2' Under Debian-derivatives, you need the following libraries:: sudo apt-get install build-essential python-dev libjpeg8-dev \ libxslt1-dev libfreetype6-dev Under OS X, you need an installation of Xcode. It is also recommended to install `Homebrew <http://brew.sh/>`_, and install the following packages:: brew install gettext brew install libxslt brew install libxml2 brew install jpeg Installattion ------------- First, clone this repository to a folder of your choice and change into the newly created directory:: git clone $REPOSITORY $FOLDER cd $FOLDER For example, if you want to play around with FeinCMS-in-a-Box:: git clone git://github.com/matthiask/feincms-in-a-box.git cd feincms-in-a-box The following commands should get you up and running:: virtualenv venv source venv/bin/activate pip install -r requirements/dev.txt echo "SECRET_KEY = 'unsafe'" > box/local_settings.py ./manage.py syncdb --all ./manage.py migrate --all --fake fab dev open http://127.0.0.1:8038/admin/ # OR xdg-open http://127.0.0.1:8038/admin/
Split the clone from the rest
Split the clone from the rest
reStructuredText
bsd-3-clause
lucacorsato/feincms-in-a-box,lucacorsato/feincms-in-a-box,lucacorsato/feincms-in-a-box,lucacorsato/feincms-in-a-box
restructuredtext
## Code Before: ================ FeinCMS in a Box ================ Prerequisites ------------- An up-to-date installation of compass and zurb-foundation 4.3.2:: (sudo) gem install compass (sudo) gem install zurb-foundation --version '=4.3.2' Under Debian-derivatives, you need the following libraries:: sudo apt-get install build-essential python-dev libjpeg8-dev \ libxslt1-dev libfreetype6-dev Under OS X, you need an installation of Xcode. It is also recommended to install `Homebrew <http://brew.sh/>`_, and install the following packages:: brew install gettext brew install libxslt brew install libxml2 brew install jpeg Installattion ------------- The following commands should get you up and running:: git clone git://github.com/matthiask/feincms-in-a-box.git box cd box git remote rm origin virtualenv venv source venv/bin/activate pip install -r requirements/dev.txt echo "SECRET_KEY = 'unsafe'" > box/local_settings.py ./manage.py syncdb --all ./manage.py migrate --all --fake fab dev open http://127.0.0.1:8038/admin/ # OR xdg-open http://127.0.0.1:8038/admin/ ## Instruction: Split the clone from the rest ## Code After: ================ FeinCMS in a Box ================ Prerequisites ------------- An up-to-date installation of compass and zurb-foundation 4.3.2:: (sudo) gem install compass (sudo) gem install zurb-foundation --version '=4.3.2' Under Debian-derivatives, you need the following libraries:: sudo apt-get install build-essential python-dev libjpeg8-dev \ libxslt1-dev libfreetype6-dev Under OS X, you need an installation of Xcode. It is also recommended to install `Homebrew <http://brew.sh/>`_, and install the following packages:: brew install gettext brew install libxslt brew install libxml2 brew install jpeg Installattion ------------- First, clone this repository to a folder of your choice and change into the newly created directory:: git clone $REPOSITORY $FOLDER cd $FOLDER For example, if you want to play around with FeinCMS-in-a-Box:: git clone git://github.com/matthiask/feincms-in-a-box.git cd feincms-in-a-box The following commands should get you up and running:: virtualenv venv source venv/bin/activate pip install -r requirements/dev.txt echo "SECRET_KEY = 'unsafe'" > box/local_settings.py ./manage.py syncdb --all ./manage.py migrate --all --fake fab dev open http://127.0.0.1:8038/admin/ # OR xdg-open http://127.0.0.1:8038/admin/
================ FeinCMS in a Box ================ Prerequisites ------------- An up-to-date installation of compass and zurb-foundation 4.3.2:: (sudo) gem install compass (sudo) gem install zurb-foundation --version '=4.3.2' Under Debian-derivatives, you need the following libraries:: sudo apt-get install build-essential python-dev libjpeg8-dev \ libxslt1-dev libfreetype6-dev Under OS X, you need an installation of Xcode. It is also recommended to install `Homebrew <http://brew.sh/>`_, and install the following packages:: brew install gettext brew install libxslt brew install libxml2 brew install jpeg Installattion ------------- + First, clone this repository to a folder of your choice and change + into the newly created directory:: + + git clone $REPOSITORY $FOLDER + cd $FOLDER + + For example, if you want to play around with FeinCMS-in-a-Box:: + + git clone git://github.com/matthiask/feincms-in-a-box.git + cd feincms-in-a-box + The following commands should get you up and running:: - git clone git://github.com/matthiask/feincms-in-a-box.git box - cd box - git remote rm origin virtualenv venv source venv/bin/activate pip install -r requirements/dev.txt echo "SECRET_KEY = 'unsafe'" > box/local_settings.py ./manage.py syncdb --all ./manage.py migrate --all --fake fab dev open http://127.0.0.1:8038/admin/ # OR xdg-open http://127.0.0.1:8038/admin/
14
0.304348
11
3
396975698365b81fbe8ae49bf1c637534fb2d0c4
source/api_v2_remote_resources.rst
source/api_v2_remote_resources.rst
Remote Resources ================ Get details on an account's remote instances. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: bash GET /remote_instances/ Request/Response: .. code-block:: bash $ http Get details on an account's remote instances. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: bash GET /remote_instances/<instance_name>/ Request/Response: .. code-block:: bash $ http Rename the specified remote instance. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: bash POST /remote_instances/<instance_name>/rename/ Request/Response: .. code-block:: bash $ http
Remote Resources ================ Get details on an account's remote instances. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: bash GET /remote_instances/ Request/Response: .. code-block:: bash $ http Get details on the specified remote instance. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: bash GET /remote_instances/<instance_name>/ Request/Response: .. code-block:: bash $ http Delete the specified remote instance. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: bash DELETE /remote_instances/<instance_name>/ Request/Response: .. code-block:: bash $ http Rename the specified remote instance. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: bash POST /remote_instances/<instance_name>/rename/ Request/Response: .. code-block:: bash $ http
Fix duplicates with new regex
Fix duplicates with new regex
reStructuredText
mit
zcorleissen/documentation
restructuredtext
## Code Before: Remote Resources ================ Get details on an account's remote instances. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: bash GET /remote_instances/ Request/Response: .. code-block:: bash $ http Get details on an account's remote instances. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: bash GET /remote_instances/<instance_name>/ Request/Response: .. code-block:: bash $ http Rename the specified remote instance. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: bash POST /remote_instances/<instance_name>/rename/ Request/Response: .. code-block:: bash $ http ## Instruction: Fix duplicates with new regex ## Code After: Remote Resources ================ Get details on an account's remote instances. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: bash GET /remote_instances/ Request/Response: .. code-block:: bash $ http Get details on the specified remote instance. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: bash GET /remote_instances/<instance_name>/ Request/Response: .. code-block:: bash $ http Delete the specified remote instance. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: bash DELETE /remote_instances/<instance_name>/ Request/Response: .. code-block:: bash $ http Rename the specified remote instance. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: bash POST /remote_instances/<instance_name>/rename/ Request/Response: .. code-block:: bash $ http
Remote Resources ================ Get details on an account's remote instances. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: bash GET /remote_instances/ Request/Response: .. code-block:: bash $ http - Get details on an account's remote instances. ? ^^ ^ ^^^^^^^ - + Get details on the specified remote instance. ? ^^^ ^^^ ^^^^^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: bash GET /remote_instances/<instance_name>/ + + Request/Response: + + .. code-block:: bash + + $ http + + Delete the specified remote instance. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + .. code-block:: bash + + DELETE /remote_instances/<instance_name>/ Request/Response: .. code-block:: bash $ http Rename the specified remote instance. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: bash POST /remote_instances/<instance_name>/rename/ Request/Response: .. code-block:: bash $ http
15
0.357143
14
1
8f76e6bda0c98d74c87eb8c422fab7b88a71e4cc
jdisc_http_service/src/main/java/com/yahoo/container/logging/FileConnectionLog.java
jdisc_http_service/src/main/java/com/yahoo/container/logging/FileConnectionLog.java
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.container.logging; import com.google.inject.Inject; import com.yahoo.component.AbstractComponent; import java.util.logging.Logger; /** * @author mortent */ public class FileConnectionLog extends AbstractComponent implements ConnectionLog { private static final Logger logger = Logger.getLogger(FileConnectionLog.class.getName()); private final ConnectionLogHandler logHandler; @Inject public FileConnectionLog(ConnectionLogConfig config) { logHandler = new ConnectionLogHandler(config.cluster(), config.logDirectoryName(), config.queueSize(), new JsonConnectionLogWriter()); } @Override public void log(ConnectionLogEntry connectionLogEntry) { logHandler.log(connectionLogEntry); } @Override public void deconstruct() { logHandler.shutdown(); } }
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.container.logging; import com.google.inject.Inject; import com.yahoo.component.AbstractComponent; /** * @author mortent */ public class FileConnectionLog extends AbstractComponent implements ConnectionLog { private final ConnectionLogHandler logHandler; @Inject public FileConnectionLog(ConnectionLogConfig config) { logHandler = new ConnectionLogHandler(config.logDirectoryName(), config.cluster(), config.queueSize(), new JsonConnectionLogWriter()); } @Override public void log(ConnectionLogEntry connectionLogEntry) { logHandler.log(connectionLogEntry); } @Override public void deconstruct() { logHandler.shutdown(); } }
Fix ordering of constructor arguments
Fix ordering of constructor arguments
Java
apache-2.0
vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa
java
## Code Before: // Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.container.logging; import com.google.inject.Inject; import com.yahoo.component.AbstractComponent; import java.util.logging.Logger; /** * @author mortent */ public class FileConnectionLog extends AbstractComponent implements ConnectionLog { private static final Logger logger = Logger.getLogger(FileConnectionLog.class.getName()); private final ConnectionLogHandler logHandler; @Inject public FileConnectionLog(ConnectionLogConfig config) { logHandler = new ConnectionLogHandler(config.cluster(), config.logDirectoryName(), config.queueSize(), new JsonConnectionLogWriter()); } @Override public void log(ConnectionLogEntry connectionLogEntry) { logHandler.log(connectionLogEntry); } @Override public void deconstruct() { logHandler.shutdown(); } } ## Instruction: Fix ordering of constructor arguments ## Code After: // Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.container.logging; import com.google.inject.Inject; import com.yahoo.component.AbstractComponent; /** * @author mortent */ public class FileConnectionLog extends AbstractComponent implements ConnectionLog { private final ConnectionLogHandler logHandler; @Inject public FileConnectionLog(ConnectionLogConfig config) { logHandler = new ConnectionLogHandler(config.logDirectoryName(), config.cluster(), config.queueSize(), new JsonConnectionLogWriter()); } @Override public void log(ConnectionLogEntry connectionLogEntry) { logHandler.log(connectionLogEntry); } @Override public void deconstruct() { logHandler.shutdown(); } }
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.container.logging; import com.google.inject.Inject; import com.yahoo.component.AbstractComponent; - import java.util.logging.Logger; - /** * @author mortent */ public class FileConnectionLog extends AbstractComponent implements ConnectionLog { - private static final Logger logger = Logger.getLogger(FileConnectionLog.class.getName()); private final ConnectionLogHandler logHandler; @Inject public FileConnectionLog(ConnectionLogConfig config) { - logHandler = new ConnectionLogHandler(config.cluster(), config.logDirectoryName(), config.queueSize(), new JsonConnectionLogWriter()); ? ------------------ + logHandler = new ConnectionLogHandler(config.logDirectoryName(), config.cluster(), config.queueSize(), new JsonConnectionLogWriter()); ? ++++++++++++++++++ } @Override public void log(ConnectionLogEntry connectionLogEntry) { logHandler.log(connectionLogEntry); } @Override public void deconstruct() { logHandler.shutdown(); } }
5
0.151515
1
4
a97f0b62319fff1d80d5e299e5a3ba566abe8c4e
.travis.yml
.travis.yml
language: php php: - 5.3 - 5.4 - 5.5 before_install: - composer install --prefer-source --dev - mkdir -p data/logs script: - ./vendor/bin/phpunit -c test/phpunit.xml --coverage-clover ./build/logs/clover.xml - ./vendor/bin/phpcs -n --standard=PSR2 ./src/ ./test/ after_script: - php ./vendor/bin/coveralls -v
language: php php: - 5.3 - 5.4 - 5.5 before_install: - composer install --prefer-source --dev - mkdir -p data/logs script: - ./vendor/bin/phpunit --bootstrap=test/Bootstrap.php --coverage-clover ./build/logs/clover.xml - ./vendor/bin/phpcs -n --standard=PSR2 ./src/ ./test/ after_script: - php ./vendor/bin/coveralls -v
Change the way phpunit bootstraps
Change the way phpunit bootstraps
YAML
mit
ughly/ugh-authorization
yaml
## Code Before: language: php php: - 5.3 - 5.4 - 5.5 before_install: - composer install --prefer-source --dev - mkdir -p data/logs script: - ./vendor/bin/phpunit -c test/phpunit.xml --coverage-clover ./build/logs/clover.xml - ./vendor/bin/phpcs -n --standard=PSR2 ./src/ ./test/ after_script: - php ./vendor/bin/coveralls -v ## Instruction: Change the way phpunit bootstraps ## Code After: language: php php: - 5.3 - 5.4 - 5.5 before_install: - composer install --prefer-source --dev - mkdir -p data/logs script: - ./vendor/bin/phpunit --bootstrap=test/Bootstrap.php --coverage-clover ./build/logs/clover.xml - ./vendor/bin/phpcs -n --standard=PSR2 ./src/ ./test/ after_script: - php ./vendor/bin/coveralls -v
language: php php: - 5.3 - 5.4 - 5.5 before_install: - composer install --prefer-source --dev - mkdir -p data/logs script: - - ./vendor/bin/phpunit -c test/phpunit.xml --coverage-clover ./build/logs/clover.xml ? ^^ -------- + - ./vendor/bin/phpunit --bootstrap=test/Bootstrap.php --coverage-clover ./build/logs/clover.xml ? ^^^^^^^^^^^ ++++++++++ - ./vendor/bin/phpcs -n --standard=PSR2 ./src/ ./test/ after_script: - php ./vendor/bin/coveralls -v
2
0.117647
1
1
4999d62bd685ee090edf49b1bf47c28a91ba5454
dev/golang/comparison/README.md
dev/golang/comparison/README.md
* [3 ways to compare slices (arrays)](https://yourbasic.org/golang/compare-slices/)
* [3 ways to compare slices (arrays)](https://yourbasic.org/golang/compare-slices/) * [Checking the equality of two slices](https://stackoverflow.com/questions/15311969/checking-the-equality-of-two-slices)
Add Checking the equality of two slices
Add Checking the equality of two slices
Markdown
mit
northbright/bookmarks,northbright/bookmarks,northbright/bookmarks
markdown
## Code Before: * [3 ways to compare slices (arrays)](https://yourbasic.org/golang/compare-slices/) ## Instruction: Add Checking the equality of two slices ## Code After: * [3 ways to compare slices (arrays)](https://yourbasic.org/golang/compare-slices/) * [Checking the equality of two slices](https://stackoverflow.com/questions/15311969/checking-the-equality-of-two-slices)
* [3 ways to compare slices (arrays)](https://yourbasic.org/golang/compare-slices/) + * [Checking the equality of two slices](https://stackoverflow.com/questions/15311969/checking-the-equality-of-two-slices)
1
1
1
0
07cc1527ac6daaf5326f509ec8971661d808d454
spec/nutrella/options_spec.rb
spec/nutrella/options_spec.rb
require "spec_helper" module Nutrella RSpec.describe Options do describe "reads board name from args" do it "-t" do subject = Options.new(["-t", "board_name"]) subject.parse expect(subject.board_name).to eq("board_name") end it "--trello-board" do subject = Options.new(["--trello-board", "board_name"]) subject.parse expect(subject.board_name).to eq("board_name") end end it "-h" do subject = Options.new(["-h"]) subject.parse expect(subject.show_usage?).to eq(true) end it "derives board name from git branch" do allow(Git).to receive_message_chain(:open, :current_branch).and_return("9476_git_branch") subject = Options.new([]) subject.parse expect(subject.board_name).to eq("9476 Git Branch") end end end
require "spec_helper" module Nutrella RSpec.describe Options do describe "reads board name from args" do it "-t" do subject = options_parse("-t", "board_name") expect(subject.board_name).to eq("board_name") end it "--trello-board" do subject = options_parse("--trello-board", "board_name") expect(subject.board_name).to eq("board_name") end end describe "display usage" do it "-h" do subject = options_parse("-h") expect(subject.show_usage?).to eq(true) end it "--help" do subject = options_parse("--help") expect(subject.show_usage?).to eq(true) end end it "derives board name from git branch" do allow(Git).to receive_message_chain(:open, :current_branch).and_return("9476_git_branch") subject = options_parse expect(subject.board_name).to eq("9476 Git Branch") end def options_parse(*opts) Options.new(opts).tap do |options| silence_stream(STDOUT) { options.parse } end end end end
Add the options_parse test helper method.
Add the options_parse test helper method.
Ruby
mit
amckinnell/nutrella,amckinnell/nutrella
ruby
## Code Before: require "spec_helper" module Nutrella RSpec.describe Options do describe "reads board name from args" do it "-t" do subject = Options.new(["-t", "board_name"]) subject.parse expect(subject.board_name).to eq("board_name") end it "--trello-board" do subject = Options.new(["--trello-board", "board_name"]) subject.parse expect(subject.board_name).to eq("board_name") end end it "-h" do subject = Options.new(["-h"]) subject.parse expect(subject.show_usage?).to eq(true) end it "derives board name from git branch" do allow(Git).to receive_message_chain(:open, :current_branch).and_return("9476_git_branch") subject = Options.new([]) subject.parse expect(subject.board_name).to eq("9476 Git Branch") end end end ## Instruction: Add the options_parse test helper method. ## Code After: require "spec_helper" module Nutrella RSpec.describe Options do describe "reads board name from args" do it "-t" do subject = options_parse("-t", "board_name") expect(subject.board_name).to eq("board_name") end it "--trello-board" do subject = options_parse("--trello-board", "board_name") expect(subject.board_name).to eq("board_name") end end describe "display usage" do it "-h" do subject = options_parse("-h") expect(subject.show_usage?).to eq(true) end it "--help" do subject = options_parse("--help") expect(subject.show_usage?).to eq(true) end end it "derives board name from git branch" do allow(Git).to receive_message_chain(:open, :current_branch).and_return("9476_git_branch") subject = options_parse expect(subject.board_name).to eq("9476 Git Branch") end def options_parse(*opts) Options.new(opts).tap do |options| silence_stream(STDOUT) { options.parse } end end end end
require "spec_helper" module Nutrella RSpec.describe Options do describe "reads board name from args" do it "-t" do - subject = Options.new(["-t", "board_name"]) ? ^ ^^ - - - + subject = options_parse("-t", "board_name") ? ^ ^^^^^ - subject.parse expect(subject.board_name).to eq("board_name") end it "--trello-board" do - subject = Options.new(["--trello-board", "board_name"]) ? ^ ^^ - - - + subject = options_parse("--trello-board", "board_name") ? ^ ^^^^^ - subject.parse expect(subject.board_name).to eq("board_name") end end + describe "display usage" do - it "-h" do + it "-h" do ? ++ - subject = Options.new(["-h"]) ? ^ ^^ - - - + subject = options_parse("-h") ? ++ ^ ^^^^^ - subject.parse - expect(subject.show_usage?).to eq(true) + expect(subject.show_usage?).to eq(true) ? ++ + end + + it "--help" do + subject = options_parse("--help") + + expect(subject.show_usage?).to eq(true) + end end it "derives board name from git branch" do allow(Git).to receive_message_chain(:open, :current_branch).and_return("9476_git_branch") - subject = Options.new([]) ? ^ ^^ ----- + subject = options_parse ? ^ ^^^^^ - subject.parse expect(subject.board_name).to eq("9476 Git Branch") end + + def options_parse(*opts) + Options.new(opts).tap do |options| + silence_stream(STDOUT) { options.parse } + end + end end end
30
0.810811
20
10
ddd89186bbce5aa21d87680769698b1728036154
.travis.yml
.travis.yml
language: python python: - 2.7 - 3.3 env: - NUMPY_VERSION=1.8 ASTROPY_VERSION=0.3.1 SETUP_CMD='test' before_install: - source .setup_conda.sh $TRAVIS_PYTHON_VERSION - export PATH=/home/travis/anaconda/bin:/home/travis/miniconda3/bin:$PATH install: - conda install --yes python=$TRAVIS_PYTHON_VERSION numpy=$NUMPY_VERSION astropy=$ASTROPY_VERSION pytest pytest-cov coveralls script: - if [[ $SETUP_CMD == test ]]; then cd spectral_cube/tests/data ; make ; cd ../../../ ; fi - if [[ $SETUP_CMD == test ]]; then py.test --cov spectral_cube ; fi after_success: - if [[ $SETUP_CMD == cov ]]; then coveralls; fi
language: python python: - 2.7 - 3.3 env: - NUMPY_VERSION=1.8 ASTROPY_VERSION=0.3.1 SETUP_CMD='test' before_install: - source .setup_conda.sh $TRAVIS_PYTHON_VERSION - export PATH=/home/travis/anaconda/bin:/home/travis/miniconda3/bin:$PATH install: - conda install --yes python=$TRAVIS_PYTHON_VERSION numpy=$NUMPY_VERSION astropy=$ASTROPY_VERSION pytest - pip install pytest-cov coveralls script: - if [[ $SETUP_CMD == test ]]; then cd spectral_cube/tests/data ; make ; cd ../../../ ; fi - if [[ $SETUP_CMD == test ]]; then py.test --cov spectral_cube ; fi after_success: - if [[ $SETUP_CMD == cov ]]; then coveralls; fi
Use pip for pytest-cov and coveralls
Use pip for pytest-cov and coveralls
YAML
bsd-3-clause
e-koch/spectral-cube,radio-astro-tools/spectral-cube,low-sky/spectral-cube,keflavich/spectral-cube,jzuhone/spectral-cube
yaml
## Code Before: language: python python: - 2.7 - 3.3 env: - NUMPY_VERSION=1.8 ASTROPY_VERSION=0.3.1 SETUP_CMD='test' before_install: - source .setup_conda.sh $TRAVIS_PYTHON_VERSION - export PATH=/home/travis/anaconda/bin:/home/travis/miniconda3/bin:$PATH install: - conda install --yes python=$TRAVIS_PYTHON_VERSION numpy=$NUMPY_VERSION astropy=$ASTROPY_VERSION pytest pytest-cov coveralls script: - if [[ $SETUP_CMD == test ]]; then cd spectral_cube/tests/data ; make ; cd ../../../ ; fi - if [[ $SETUP_CMD == test ]]; then py.test --cov spectral_cube ; fi after_success: - if [[ $SETUP_CMD == cov ]]; then coveralls; fi ## Instruction: Use pip for pytest-cov and coveralls ## Code After: language: python python: - 2.7 - 3.3 env: - NUMPY_VERSION=1.8 ASTROPY_VERSION=0.3.1 SETUP_CMD='test' before_install: - source .setup_conda.sh $TRAVIS_PYTHON_VERSION - export PATH=/home/travis/anaconda/bin:/home/travis/miniconda3/bin:$PATH install: - conda install --yes python=$TRAVIS_PYTHON_VERSION numpy=$NUMPY_VERSION astropy=$ASTROPY_VERSION pytest - pip install pytest-cov coveralls script: - if [[ $SETUP_CMD == test ]]; then cd spectral_cube/tests/data ; make ; cd ../../../ ; fi - if [[ $SETUP_CMD == test ]]; then py.test --cov spectral_cube ; fi after_success: - if [[ $SETUP_CMD == cov ]]; then coveralls; fi
language: python python: - 2.7 - 3.3 env: - NUMPY_VERSION=1.8 ASTROPY_VERSION=0.3.1 SETUP_CMD='test' before_install: - source .setup_conda.sh $TRAVIS_PYTHON_VERSION - export PATH=/home/travis/anaconda/bin:/home/travis/miniconda3/bin:$PATH install: - - conda install --yes python=$TRAVIS_PYTHON_VERSION numpy=$NUMPY_VERSION astropy=$ASTROPY_VERSION pytest pytest-cov coveralls ? --------------------- + - conda install --yes python=$TRAVIS_PYTHON_VERSION numpy=$NUMPY_VERSION astropy=$ASTROPY_VERSION pytest + - pip install pytest-cov coveralls script: - if [[ $SETUP_CMD == test ]]; then cd spectral_cube/tests/data ; make ; cd ../../../ ; fi - if [[ $SETUP_CMD == test ]]; then py.test --cov spectral_cube ; fi after_success: - if [[ $SETUP_CMD == cov ]]; then coveralls; fi
3
0.136364
2
1
9bba0683dc47ed09a907425378b7ac4bdcf53085
examples/basic/index.html
examples/basic/index.html
<!DOCTYPE HTML> <body style="background-color: #222;font-family: sans-serif;"> <div style="text-align:center;"> <h1 style="color:white;">Move with arrow keys</h1> <h4 style="color:white;">Hit Space to toggle AI control</h4> </div> <script src="../../Ecs.js"></script> <script src="test.js"></script> </body>
<!DOCTYPE HTML> <body style="background-color: #222;font-family: sans-serif;"> <canvas></canvas> <div style="text-align:center;"> <h1 style="color:white;">Move with arrow keys</h1> <h4 style="color:white;">Hit Space to toggle AI control</h4> </div> <script src="../../Ecs.js"></script> <script src="test.js"></script> </body>
Update basic example to be able to render on screen
Update basic example to be able to render on screen
HTML
mit
Luftare/Ecs
html
## Code Before: <!DOCTYPE HTML> <body style="background-color: #222;font-family: sans-serif;"> <div style="text-align:center;"> <h1 style="color:white;">Move with arrow keys</h1> <h4 style="color:white;">Hit Space to toggle AI control</h4> </div> <script src="../../Ecs.js"></script> <script src="test.js"></script> </body> ## Instruction: Update basic example to be able to render on screen ## Code After: <!DOCTYPE HTML> <body style="background-color: #222;font-family: sans-serif;"> <canvas></canvas> <div style="text-align:center;"> <h1 style="color:white;">Move with arrow keys</h1> <h4 style="color:white;">Hit Space to toggle AI control</h4> </div> <script src="../../Ecs.js"></script> <script src="test.js"></script> </body>
<!DOCTYPE HTML> <body style="background-color: #222;font-family: sans-serif;"> + <canvas></canvas> <div style="text-align:center;"> <h1 style="color:white;">Move with arrow keys</h1> <h4 style="color:white;">Hit Space to toggle AI control</h4> </div> <script src="../../Ecs.js"></script> <script src="test.js"></script> </body>
1
0.111111
1
0
a03154f3fb9875a47e22637b7b0a84d4464ee53c
stack.yaml
stack.yaml
compiler: ghcjs-0.2.1.9007001_ghc-8.0.1 compiler-check: match-exact extra-deps: - ghcjs-dom-0.2.4.0 - ref-tf-0.4.0.1 - zenc-0.1.1 packages: - '.' - extra-dep: true location: git: git@github.com:/jonathanknowles/reflex commit: a63aba90bdea5ae5b3e1506d468613bdfedcdfa3 - extra-dep: true location: git: git@github.com:/jonathanknowles/reflex-dom commit: fca15fd1b8a2dd34e53994553907f648091c7870 resolver: lts-7.1 setup-info: ghcjs: source: ghcjs-0.2.1.9007001_ghc-8.0.1: url: http://tolysz.org/ghcjs/ghc-8.0-2016-09-26-lts-7.1-9007001-mem.tar.gz sha1: e640724883238593e2d2f7f03991cb413ec0347b
compiler: ghcjs-0.2.1.9007015_ghc-8.0.1 compiler-check: match-exact extra-deps: - ghcjs-dom-0.2.4.0 - ref-tf-0.4.0.1 - zenc-0.1.1 packages: - '.' - extra-dep: true location: git: git@github.com:/jonathanknowles/reflex commit: a63aba90bdea5ae5b3e1506d468613bdfedcdfa3 - extra-dep: true location: git: git@github.com:/jonathanknowles/reflex-dom commit: fca15fd1b8a2dd34e53994553907f648091c7870 resolver: lts-7.15 setup-info: ghcjs: source: ghcjs-0.2.1.9007015_ghc-8.0.1: url: http://ghcjs.tolysz.org/ghc-8.0-2017-01-11-lts-7.15-9007015.tar.gz sha1: 30d34e9d704bdb799066387dfa1ba98b8884d932
Move to LTS Haskell 7.15.
Move to LTS Haskell 7.15.
YAML
bsd-3-clause
jonathanknowles/haskell-calculator
yaml
## Code Before: compiler: ghcjs-0.2.1.9007001_ghc-8.0.1 compiler-check: match-exact extra-deps: - ghcjs-dom-0.2.4.0 - ref-tf-0.4.0.1 - zenc-0.1.1 packages: - '.' - extra-dep: true location: git: git@github.com:/jonathanknowles/reflex commit: a63aba90bdea5ae5b3e1506d468613bdfedcdfa3 - extra-dep: true location: git: git@github.com:/jonathanknowles/reflex-dom commit: fca15fd1b8a2dd34e53994553907f648091c7870 resolver: lts-7.1 setup-info: ghcjs: source: ghcjs-0.2.1.9007001_ghc-8.0.1: url: http://tolysz.org/ghcjs/ghc-8.0-2016-09-26-lts-7.1-9007001-mem.tar.gz sha1: e640724883238593e2d2f7f03991cb413ec0347b ## Instruction: Move to LTS Haskell 7.15. ## Code After: compiler: ghcjs-0.2.1.9007015_ghc-8.0.1 compiler-check: match-exact extra-deps: - ghcjs-dom-0.2.4.0 - ref-tf-0.4.0.1 - zenc-0.1.1 packages: - '.' - extra-dep: true location: git: git@github.com:/jonathanknowles/reflex commit: a63aba90bdea5ae5b3e1506d468613bdfedcdfa3 - extra-dep: true location: git: git@github.com:/jonathanknowles/reflex-dom commit: fca15fd1b8a2dd34e53994553907f648091c7870 resolver: lts-7.15 setup-info: ghcjs: source: ghcjs-0.2.1.9007015_ghc-8.0.1: url: http://ghcjs.tolysz.org/ghc-8.0-2017-01-11-lts-7.15-9007015.tar.gz sha1: 30d34e9d704bdb799066387dfa1ba98b8884d932
- compiler: ghcjs-0.2.1.9007001_ghc-8.0.1 ? - + compiler: ghcjs-0.2.1.9007015_ghc-8.0.1 ? + compiler-check: match-exact extra-deps: - ghcjs-dom-0.2.4.0 - ref-tf-0.4.0.1 - zenc-0.1.1 packages: - '.' - extra-dep: true location: git: git@github.com:/jonathanknowles/reflex commit: a63aba90bdea5ae5b3e1506d468613bdfedcdfa3 - extra-dep: true location: git: git@github.com:/jonathanknowles/reflex-dom commit: fca15fd1b8a2dd34e53994553907f648091c7870 - resolver: lts-7.1 + resolver: lts-7.15 ? + setup-info: ghcjs: source: - ghcjs-0.2.1.9007001_ghc-8.0.1: ? - + ghcjs-0.2.1.9007015_ghc-8.0.1: ? + - url: http://tolysz.org/ghcjs/ghc-8.0-2016-09-26-lts-7.1-9007001-mem.tar.gz ? ------ ^ ^ ^^ - ^^^^ + url: http://ghcjs.tolysz.org/ghc-8.0-2017-01-11-lts-7.15-9007015.tar.gz ? ++++++ ^ ^ ^^ + ^ - sha1: e640724883238593e2d2f7f03991cb413ec0347b + sha1: 30d34e9d704bdb799066387dfa1ba98b8884d932
10
0.416667
5
5
1ed6da265ad447c48ace01bb4eb6f66f63b4dc14
source/css/_partial/sidebar.styl
source/css/_partial/sidebar.styl
if sidebar is bottom @import "sidebar-bottom" else @import "sidebar-aside" .widget @extend $base-style line-height: line-height word-wrap: break-word font-size: 0.9em ul, ol list-style: none margin: 0 ul, ol margin: 0 20px ul list-style: disc ol list-style: decimal .category-list-count .tag-list-count .archive-list-count padding-left: 5px color: color-grey font-size: 0.85em &:before content: "(" &:after content: ")" .tagcloud a margin-right: 5px
if sidebar is bottom @import "sidebar-bottom" else @import "sidebar-aside" .widget @extend $base-style line-height: line-height word-wrap: break-word font-size: 0.9em ul, ol list-style: none margin: 0 ul, ol margin: 0 20px ul list-style: disc ol list-style: decimal .category-list-count .tag-list-count .archive-list-count padding-left: 5px color: color-grey font-size: 0.85em &:before content: "(" &:after content: ")" .tagcloud a margin-right: 5px display: inline-block
Fix wrongly newlines after dashes.
Fix wrongly newlines after dashes. Fix wrongly newlines after dashes. For example, a tag "org-mode". https://github.com/hexojs/hexo/issues/1092
Stylus
mit
1PxUp/Naji,SykieChen/hexo-theme-hic17,critikapp/blog-theme,Nagland/hexo-theme-landscape-cn,cgmartin/hexo-theme-bootstrap-blog,QiJiaZhang/present,sandinmyjoints/hexo-theme-landscape,JLHwung/hexo-theme-landscape,hanliang512288/landscape-h,howiefh/hexo-theme-landscape-f,ideoplex/hexo-theme-landscape,tommy351/hexo-theme-landscape,1PxUp/Naji,JLHwung/hexo-theme-landscape,sandinmyjoints/hexo-theme-landscape,howiefh/hexo-theme-landscape-f,cgmartin/hexo-theme-bootstrap-blog,hexojs/hexo-theme-landscape,hanliang512288/landscape-h,Nagland/hexo-theme-landscape-cn,takeshik/hexo-theme-landscape,takeshik/hexo-theme-landscape,wangruofeng/present,SykieChen/hexo-theme-hic17
stylus
## Code Before: if sidebar is bottom @import "sidebar-bottom" else @import "sidebar-aside" .widget @extend $base-style line-height: line-height word-wrap: break-word font-size: 0.9em ul, ol list-style: none margin: 0 ul, ol margin: 0 20px ul list-style: disc ol list-style: decimal .category-list-count .tag-list-count .archive-list-count padding-left: 5px color: color-grey font-size: 0.85em &:before content: "(" &:after content: ")" .tagcloud a margin-right: 5px ## Instruction: Fix wrongly newlines after dashes. Fix wrongly newlines after dashes. For example, a tag "org-mode". https://github.com/hexojs/hexo/issues/1092 ## Code After: if sidebar is bottom @import "sidebar-bottom" else @import "sidebar-aside" .widget @extend $base-style line-height: line-height word-wrap: break-word font-size: 0.9em ul, ol list-style: none margin: 0 ul, ol margin: 0 20px ul list-style: disc ol list-style: decimal .category-list-count .tag-list-count .archive-list-count padding-left: 5px color: color-grey font-size: 0.85em &:before content: "(" &:after content: ")" .tagcloud a margin-right: 5px display: inline-block
if sidebar is bottom @import "sidebar-bottom" else @import "sidebar-aside" .widget @extend $base-style line-height: line-height word-wrap: break-word font-size: 0.9em ul, ol list-style: none margin: 0 ul, ol margin: 0 20px ul list-style: disc ol list-style: decimal .category-list-count .tag-list-count .archive-list-count padding-left: 5px color: color-grey font-size: 0.85em &:before content: "(" &:after content: ")" .tagcloud a margin-right: 5px + display: inline-block
1
0.029412
1
0
dc9782fadc5a886dbf4179896e458da5b6d20666
restart_sshd.sh
restart_sshd.sh
screen -D -m -S RestartSSHD bash -c 'killall sshd; sleep 5; /etc/init.d/sshd restart'
screen -D -m -S RestartSSHD bash -c 'killall sshd; sleep 5; /etc/init.d/sshd restart; systemctl restart sshd.service'
Make CentOS 7 also restart. Not the best way to do this, but should work...
Make CentOS 7 also restart. Not the best way to do this, but should work...
Shell
mit
gserafini/useful-server-scripts
shell
## Code Before: screen -D -m -S RestartSSHD bash -c 'killall sshd; sleep 5; /etc/init.d/sshd restart' ## Instruction: Make CentOS 7 also restart. Not the best way to do this, but should work... ## Code After: screen -D -m -S RestartSSHD bash -c 'killall sshd; sleep 5; /etc/init.d/sshd restart; systemctl restart sshd.service'
- screen -D -m -S RestartSSHD bash -c 'killall sshd; sleep 5; /etc/init.d/sshd restart' + screen -D -m -S RestartSSHD bash -c 'killall sshd; sleep 5; /etc/init.d/sshd restart; systemctl restart sshd.service' ? ++++++++++++++++++++++++++++++++
2
0.666667
1
1
1f745e65c50109fd1d414871f32533efcd57f2a1
app/views/application/_footer.html.erb
app/views/application/_footer.html.erb
<!-- =========== --> <!-- Footer Area --> <!-- =========== --> <div class="footer col-lg-12 col-md-12 col-sm-12 col-xs-12"> <div class="container"> <div class="row"> <div class="col-lg-3 col-lg-offset-3 col-md-3 col-sm-6 col-xs-12 sitemap"> <ul> <li> <%= link_to 'About', about_page_path %> </li> <li> <%= link_to 'Privacy', privacy_page_path %> </li> <li> <%= link_to 'Terms', terms_page_path %> </li> </ul> <!--sitemap--> </div> <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 sitemap2"> <ul> <li> Follow us </li> <li> <i class="fa fa-twitter"></i> <%= link_to 'MailpennyHQ', 'https://twitter.com/MailpennyHQ' %> </li> <li> <i class="fa fa-angellist"></i> <%= link_to 'Mailpenny', 'https://angel.co/mailpenny' %> </li> </ul> <!--sitemap--> </div> <!--row--> </div> <!--container--> </div> <!--footer--> </div>
<!-- =========== --> <!-- Footer Area --> <!-- =========== --> <div class="container-fluid"> <div class="footer col-lg-12 col-md-12 col-sm-12 col-xs-12"> <div class="row"> <div class="col-lg-1 col-lg-offset-4 col-md-3 col-sm-6 col-xs-12 sitemap"> <ul> <li> <%= link_to 'About', about_page_path %> </li> <li> <%= link_to 'Privacy', privacy_page_path %> </li> <li> <%= link_to 'Terms', terms_page_path %> </li> </ul> <!--sitemap--> </div> <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 social"> <ul> <li> Follow us </li> <li> <i class="fa fa-twitter"></i> <%= link_to 'MailpennyHQ', 'https://twitter.com/MailpennyHQ' %> </li> <li> <i class="fa fa-angellist"></i> <%= link_to 'Mailpenny', 'https://angel.co/mailpenny' %> </li> </ul> <!--social--> </div> <!--row--> </div> <!--container--> </div> <!--footer--> </div>
Remove redundent classes and divs, and rename footer links class to social
Remove redundent classes and divs, and rename footer links class to social
HTML+ERB
agpl-3.0
payloadtech/mailpenny,payloadtech/mailpenny,payloadtech/mailpenny
html+erb
## Code Before: <!-- =========== --> <!-- Footer Area --> <!-- =========== --> <div class="footer col-lg-12 col-md-12 col-sm-12 col-xs-12"> <div class="container"> <div class="row"> <div class="col-lg-3 col-lg-offset-3 col-md-3 col-sm-6 col-xs-12 sitemap"> <ul> <li> <%= link_to 'About', about_page_path %> </li> <li> <%= link_to 'Privacy', privacy_page_path %> </li> <li> <%= link_to 'Terms', terms_page_path %> </li> </ul> <!--sitemap--> </div> <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 sitemap2"> <ul> <li> Follow us </li> <li> <i class="fa fa-twitter"></i> <%= link_to 'MailpennyHQ', 'https://twitter.com/MailpennyHQ' %> </li> <li> <i class="fa fa-angellist"></i> <%= link_to 'Mailpenny', 'https://angel.co/mailpenny' %> </li> </ul> <!--sitemap--> </div> <!--row--> </div> <!--container--> </div> <!--footer--> </div> ## Instruction: Remove redundent classes and divs, and rename footer links class to social ## Code After: <!-- =========== --> <!-- Footer Area --> <!-- =========== --> <div class="container-fluid"> <div class="footer col-lg-12 col-md-12 col-sm-12 col-xs-12"> <div class="row"> <div class="col-lg-1 col-lg-offset-4 col-md-3 col-sm-6 col-xs-12 sitemap"> <ul> <li> <%= link_to 'About', about_page_path %> </li> <li> <%= link_to 'Privacy', privacy_page_path %> </li> <li> <%= link_to 'Terms', terms_page_path %> </li> </ul> <!--sitemap--> </div> <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 social"> <ul> <li> Follow us </li> <li> <i class="fa fa-twitter"></i> <%= link_to 'MailpennyHQ', 'https://twitter.com/MailpennyHQ' %> </li> <li> <i class="fa fa-angellist"></i> <%= link_to 'Mailpenny', 'https://angel.co/mailpenny' %> </li> </ul> <!--social--> </div> <!--row--> </div> <!--container--> </div> <!--footer--> </div>
<!-- =========== --> <!-- Footer Area --> <!-- =========== --> + <div class="container-fluid"> <div class="footer col-lg-12 col-md-12 col-sm-12 col-xs-12"> - <div class="container"> <div class="row"> - <div class="col-lg-3 col-lg-offset-3 col-md-3 col-sm-6 col-xs-12 sitemap"> ? ^ ^ + <div class="col-lg-1 col-lg-offset-4 col-md-3 col-sm-6 col-xs-12 sitemap"> ? ^ ^ <ul> <li> <%= link_to 'About', about_page_path %> </li> <li> <%= link_to 'Privacy', privacy_page_path %> </li> <li> <%= link_to 'Terms', terms_page_path %> </li> </ul> <!--sitemap--> </div> - <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 sitemap2"> ? --- ^^ + <div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 social"> ? ++ ^ <ul> <li> Follow us </li> <li> <i class="fa fa-twitter"></i> <%= link_to 'MailpennyHQ', 'https://twitter.com/MailpennyHQ' %> </li> <li> <i class="fa fa-angellist"></i> <%= link_to 'Mailpenny', 'https://angel.co/mailpenny' %> </li> </ul> - <!--sitemap--> ? --- ^ + <!--social--> ? ++ ^ </div> <!--row--> </div> <!--container--> </div> <!--footer--> </div>
8
0.186047
4
4
4c05966b3321c45b286edab4b2d4961e53dc9bdd
app/services/create_section_service.rb
app/services/create_section_service.rb
class CreateSectionService def initialize(manual_repository:, context:) @manual_repository = manual_repository @listeners = [ PublishingApiDraftManualExporter.new, PublishingApiDraftSectionExporter.new ] @context = context end def call @new_document = manual.build_document(document_params) if new_document.valid? manual.draft manual_repository.store(manual) notify_listeners end [manual, new_document] end private attr_reader :manual_repository, :listeners, :context attr_reader :new_document def manual @manual ||= manual_repository.fetch(context.params.fetch("manual_id")) end def notify_listeners listeners.each do |listener| listener.call(new_document, manual) end end def document_params context.params.fetch("section") end end
class CreateSectionService def initialize(manual_repository:, context:) @manual_repository = manual_repository @context = context end def call @new_document = manual.build_document(document_params) if new_document.valid? manual.draft manual_repository.store(manual) export_draft_manual_to_publishing_api export_draft_section_to_publishing_api end [manual, new_document] end private attr_reader :manual_repository, :context attr_reader :new_document def manual @manual ||= manual_repository.fetch(context.params.fetch("manual_id")) end def export_draft_manual_to_publishing_api PublishingApiDraftManualExporter.new.call(new_document, manual) end def export_draft_section_to_publishing_api PublishingApiDraftSectionExporter.new.call(new_document, manual) end def document_params context.params.fetch("section") end end
Use more meaningful method names for publishing
Use more meaningful method names for publishing Rather than "notifying listeners" use more meaningful names to refer to calling the Exporter methods.
Ruby
mit
alphagov/manuals-publisher,alphagov/manuals-publisher,alphagov/manuals-publisher
ruby
## Code Before: class CreateSectionService def initialize(manual_repository:, context:) @manual_repository = manual_repository @listeners = [ PublishingApiDraftManualExporter.new, PublishingApiDraftSectionExporter.new ] @context = context end def call @new_document = manual.build_document(document_params) if new_document.valid? manual.draft manual_repository.store(manual) notify_listeners end [manual, new_document] end private attr_reader :manual_repository, :listeners, :context attr_reader :new_document def manual @manual ||= manual_repository.fetch(context.params.fetch("manual_id")) end def notify_listeners listeners.each do |listener| listener.call(new_document, manual) end end def document_params context.params.fetch("section") end end ## Instruction: Use more meaningful method names for publishing Rather than "notifying listeners" use more meaningful names to refer to calling the Exporter methods. ## Code After: class CreateSectionService def initialize(manual_repository:, context:) @manual_repository = manual_repository @context = context end def call @new_document = manual.build_document(document_params) if new_document.valid? manual.draft manual_repository.store(manual) export_draft_manual_to_publishing_api export_draft_section_to_publishing_api end [manual, new_document] end private attr_reader :manual_repository, :context attr_reader :new_document def manual @manual ||= manual_repository.fetch(context.params.fetch("manual_id")) end def export_draft_manual_to_publishing_api PublishingApiDraftManualExporter.new.call(new_document, manual) end def export_draft_section_to_publishing_api PublishingApiDraftSectionExporter.new.call(new_document, manual) end def document_params context.params.fetch("section") end end
class CreateSectionService def initialize(manual_repository:, context:) @manual_repository = manual_repository - @listeners = [ - PublishingApiDraftManualExporter.new, - PublishingApiDraftSectionExporter.new - ] @context = context end def call @new_document = manual.build_document(document_params) if new_document.valid? manual.draft manual_repository.store(manual) - notify_listeners + export_draft_manual_to_publishing_api + export_draft_section_to_publishing_api end [manual, new_document] end private - attr_reader :manual_repository, :listeners, :context ? ------------ + attr_reader :manual_repository, :context attr_reader :new_document def manual @manual ||= manual_repository.fetch(context.params.fetch("manual_id")) end + def export_draft_manual_to_publishing_api + PublishingApiDraftManualExporter.new.call(new_document, manual) - def notify_listeners - listeners.each do |listener| - listener.call(new_document, manual) - end ? -- + end + + def export_draft_section_to_publishing_api + PublishingApiDraftSectionExporter.new.call(new_document, manual) end def document_params context.params.fetch("section") end end
19
0.452381
9
10
39fbce2a0e225591423f9b2d1edd111822063466
app/core/api.py
app/core/api.py
from flask import jsonify, request from ..main import app @app.route('/api/ip') def api_ip(): return jsonify({'Success': True, 'ipAddress': get_client_ip()}) def get_client_ip(): return request.headers.get('X-Forwarded-For') or request.remote_addr
from flask import jsonify, request from ..main import app @app.route('/api/ip') def api_ip(): """Return client IP""" return api_reply({'ipAddress': get_client_ip()}) def get_client_ip(): """Return the client x-forwarded-for header or IP address""" return request.headers.get('X-Forwarded-For') or request.remote_addr def api_reply(body={}, success=True): """Create a standard API reply interface""" return jsonify({**body, 'success': success})
Add a standard API reply interface
Add a standard API reply interface
Python
mit
jniedrauer/jniedrauer.com,jniedrauer/jniedrauer.com,jniedrauer/jniedrauer.com
python
## Code Before: from flask import jsonify, request from ..main import app @app.route('/api/ip') def api_ip(): return jsonify({'Success': True, 'ipAddress': get_client_ip()}) def get_client_ip(): return request.headers.get('X-Forwarded-For') or request.remote_addr ## Instruction: Add a standard API reply interface ## Code After: from flask import jsonify, request from ..main import app @app.route('/api/ip') def api_ip(): """Return client IP""" return api_reply({'ipAddress': get_client_ip()}) def get_client_ip(): """Return the client x-forwarded-for header or IP address""" return request.headers.get('X-Forwarded-For') or request.remote_addr def api_reply(body={}, success=True): """Create a standard API reply interface""" return jsonify({**body, 'success': success})
from flask import jsonify, request from ..main import app @app.route('/api/ip') def api_ip(): + """Return client IP""" - return jsonify({'Success': True, 'ipAddress': get_client_ip()}) ? ^^^^ ^ ----------------- + return api_reply({'ipAddress': get_client_ip()}) ? ^^ ^^^^^ def get_client_ip(): + """Return the client x-forwarded-for header or IP address""" return request.headers.get('X-Forwarded-For') or request.remote_addr + + + def api_reply(body={}, success=True): + """Create a standard API reply interface""" + return jsonify({**body, 'success': success})
9
0.818182
8
1
a9d4fab047249fbf5db26385779902d0f7483057
qsimcirq/__init__.py
qsimcirq/__init__.py
from .qsim_circuit import * from .qsim_simulator import * from .qsimh_simulator import *
from .qsim_circuit import add_op_to_opstring, add_op_to_circuit, QSimCircuit from .qsim_simulator import QSimSimulatorState, QSimSimulatorTrialResult, QSimSimulator from .qsimh_simulator import QSimhSimulator
Replace star imports to fix mypy issue.
Replace star imports to fix mypy issue.
Python
apache-2.0
quantumlib/qsim,quantumlib/qsim,quantumlib/qsim,quantumlib/qsim
python
## Code Before: from .qsim_circuit import * from .qsim_simulator import * from .qsimh_simulator import * ## Instruction: Replace star imports to fix mypy issue. ## Code After: from .qsim_circuit import add_op_to_opstring, add_op_to_circuit, QSimCircuit from .qsim_simulator import QSimSimulatorState, QSimSimulatorTrialResult, QSimSimulator from .qsimh_simulator import QSimhSimulator
- from .qsim_circuit import * - from .qsim_simulator import * + from .qsim_circuit import add_op_to_opstring, add_op_to_circuit, QSimCircuit + from .qsim_simulator import QSimSimulatorState, QSimSimulatorTrialResult, QSimSimulator - from .qsimh_simulator import * ? ^ + from .qsimh_simulator import QSimhSimulator ? ^^^^^^^^^^^^^^ - -
8
1.6
3
5