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
5830e2367854630eb8fccec7d79fd0e12d5aa54f
examples/jquery.textarea_auto_expand.js
examples/jquery.textarea_auto_expand.js
(function($){ $.fn.textareaAutoExpand = function(){ return this.each(function(){ var textarea = $(this); var height = textarea.height(); var diff = parseInt(textarea.css('borderBottomWidth')) + parseInt(textarea.css('borderTopWidth')) + parseInt(textarea.css('paddingBottom')) + parseInt(textarea.css('paddingTop')); var hasInitialValue = (this.value.replace(/\s/g, '').length > 0); if (textarea.css('box-sizing') === 'border-box' || textarea.css('-moz-box-sizing') === 'border-box' || textarea.css('-webkit-box-sizing') === 'border-box') { height = textarea.outerHeight(); if (this.scrollHeight + diff == height) // special case for Firefox where scrollHeight isn't full height on border-box diff = 0; } else { diff = 0; } if (hasInitialValue) { textarea.height(this.scrollHeight); } textarea.on('scroll input', function(event){ if (event.keyCode == 13 && !event.shiftKey) { // just allow default behavior to enter new line if (this.value.replace(/\s/g, '').length == 0) { event.stopImmediatePropagation(); event.stopPropagation(); } } textarea.height(0); //textarea.height(Math.max(height - diff, this.scrollHeight - diff)); textarea.height(this.scrollHeight - diff); }); }); } })(jQuery);
(function($){ $.fn.textareaAutoExpand = function(){ return this.each(function(){ var textarea = $(this); var height = textarea.height(); var diff = parseInt(textarea.css('borderBottomWidth')) + parseInt(textarea.css('borderTopWidth')) + parseInt(textarea.css('paddingBottom')) + parseInt(textarea.css('paddingTop')); var hasInitialValue = (this.value.replace(/\s/g, '').length > 0); if (textarea.css('box-sizing') === 'border-box' || textarea.css('-moz-box-sizing') === 'border-box' || textarea.css('-webkit-box-sizing') === 'border-box') { height = textarea.outerHeight(); if (this.scrollHeight + diff == height) // special case for Firefox where scrollHeight isn't full height on border-box diff = 0; } else { diff = 0; } if (hasInitialValue) { textarea.height(this.scrollHeight); } textarea.on('scroll input keyup', function(event){ // keyup isn't necessary but when deleting text IE needs it to reset height properly if (event.keyCode == 13 && !event.shiftKey) { // just allow default behavior to enter new line if (this.value.replace(/\s/g, '').length == 0) { event.stopImmediatePropagation(); event.stopPropagation(); } } textarea.height(0); //textarea.height(Math.max(height - diff, this.scrollHeight - diff)); textarea.height(this.scrollHeight - diff); }); }); } })(jQuery);
Add keyup to event list to fix IE so it updates height properly when deleting text.
Add keyup to event list to fix IE so it updates height properly when deleting text.
JavaScript
mit
limenet/textarea-autosize,javierjulio/textarea-autosize,javierjulio/textarea-autosize,limenet/textarea-autosize
javascript
## Code Before: (function($){ $.fn.textareaAutoExpand = function(){ return this.each(function(){ var textarea = $(this); var height = textarea.height(); var diff = parseInt(textarea.css('borderBottomWidth')) + parseInt(textarea.css('borderTopWidth')) + parseInt(textarea.css('paddingBottom')) + parseInt(textarea.css('paddingTop')); var hasInitialValue = (this.value.replace(/\s/g, '').length > 0); if (textarea.css('box-sizing') === 'border-box' || textarea.css('-moz-box-sizing') === 'border-box' || textarea.css('-webkit-box-sizing') === 'border-box') { height = textarea.outerHeight(); if (this.scrollHeight + diff == height) // special case for Firefox where scrollHeight isn't full height on border-box diff = 0; } else { diff = 0; } if (hasInitialValue) { textarea.height(this.scrollHeight); } textarea.on('scroll input', function(event){ if (event.keyCode == 13 && !event.shiftKey) { // just allow default behavior to enter new line if (this.value.replace(/\s/g, '').length == 0) { event.stopImmediatePropagation(); event.stopPropagation(); } } textarea.height(0); //textarea.height(Math.max(height - diff, this.scrollHeight - diff)); textarea.height(this.scrollHeight - diff); }); }); } })(jQuery); ## Instruction: Add keyup to event list to fix IE so it updates height properly when deleting text. ## Code After: (function($){ $.fn.textareaAutoExpand = function(){ return this.each(function(){ var textarea = $(this); var height = textarea.height(); var diff = parseInt(textarea.css('borderBottomWidth')) + parseInt(textarea.css('borderTopWidth')) + parseInt(textarea.css('paddingBottom')) + parseInt(textarea.css('paddingTop')); var hasInitialValue = (this.value.replace(/\s/g, '').length > 0); if (textarea.css('box-sizing') === 'border-box' || textarea.css('-moz-box-sizing') === 'border-box' || textarea.css('-webkit-box-sizing') === 'border-box') { height = textarea.outerHeight(); if (this.scrollHeight + diff == height) // special case for Firefox where scrollHeight isn't full height on border-box diff = 0; } else { diff = 0; } if (hasInitialValue) { textarea.height(this.scrollHeight); } textarea.on('scroll input keyup', function(event){ // keyup isn't necessary but when deleting text IE needs it to reset height properly if (event.keyCode == 13 && !event.shiftKey) { // just allow default behavior to enter new line if (this.value.replace(/\s/g, '').length == 0) { event.stopImmediatePropagation(); event.stopPropagation(); } } textarea.height(0); //textarea.height(Math.max(height - diff, this.scrollHeight - diff)); textarea.height(this.scrollHeight - diff); }); }); } })(jQuery);
(function($){ $.fn.textareaAutoExpand = function(){ return this.each(function(){ var textarea = $(this); var height = textarea.height(); var diff = parseInt(textarea.css('borderBottomWidth')) + parseInt(textarea.css('borderTopWidth')) + parseInt(textarea.css('paddingBottom')) + parseInt(textarea.css('paddingTop')); var hasInitialValue = (this.value.replace(/\s/g, '').length > 0); if (textarea.css('box-sizing') === 'border-box' || textarea.css('-moz-box-sizing') === 'border-box' || textarea.css('-webkit-box-sizing') === 'border-box') { height = textarea.outerHeight(); if (this.scrollHeight + diff == height) // special case for Firefox where scrollHeight isn't full height on border-box diff = 0; } else { diff = 0; } if (hasInitialValue) { textarea.height(this.scrollHeight); } - textarea.on('scroll input', function(event){ + textarea.on('scroll input keyup', function(event){ // keyup isn't necessary but when deleting text IE needs it to reset height properly if (event.keyCode == 13 && !event.shiftKey) { // just allow default behavior to enter new line if (this.value.replace(/\s/g, '').length == 0) { event.stopImmediatePropagation(); event.stopPropagation(); } } textarea.height(0); //textarea.height(Math.max(height - diff, this.scrollHeight - diff)); textarea.height(this.scrollHeight - diff); }); }); } })(jQuery);
2
0.05
1
1
7e9eac8059a832b986eec15ba720599a00b6b6c7
opentreemap/treemap/css/sass/partials/_calculator.scss
opentreemap/treemap/css/sass/partials/_calculator.scss
// Partial: Diameter Calculator #diameter-calculator { width: 100%; margin: 0; & + a { font-weight: 300; font-size: 1.2rem; margin-bottom: 10px; display: block; > i { margin-right: 5px; } } th { font-size: 1em; } tr { td { width: 50%; } } input { margin: 0; } } #sidebar-add-tree { #diameter-calculator { tr { td { input { max-width: 78px; } } } } } #diameter-calculator-total-row { margin-top: 5px; margin-bottom: 5px; font-style: italic; color: $subtext-color; } [data-field="tree.diameter"] { #diameter-video { font-size: 1.2rem; font-weight: 400; > i { margin-right: 6px; } } }
// Partial: Diameter Calculator #diameter-calculator { width: 100%; margin: 0; & + a { font-weight: 300; font-size: 1.2rem; margin-bottom: 10px; display: block; > i { margin-right: 5px; } } th { font-size: 1em; font-weight: 300; } tr { td { width: 50%; } } input { margin: 0; } } #sidebar-add-tree { #diameter-calculator { tr { td { input { max-width: 78px; } } } } } #diameter-calculator-total-row { margin-top: 5px; margin-bottom: 5px; font-style: italic; color: $subtext-color; } [data-field="tree.diameter"] { #diameter-video { font-size: 1.2rem; font-weight: 400; > i { margin-right: 6px; } } }
Change font weight on diameter calculator headers
Change font weight on diameter calculator headers
SCSS
agpl-3.0
maurizi/otm-core,recklessromeo/otm-core,maurizi/otm-core,maurizi/otm-core,RickMohr/otm-core,RickMohr/otm-core,RickMohr/otm-core,clever-crow-consulting/otm-core,maurizi/otm-core,clever-crow-consulting/otm-core,recklessromeo/otm-core,clever-crow-consulting/otm-core,clever-crow-consulting/otm-core,recklessromeo/otm-core,RickMohr/otm-core,recklessromeo/otm-core
scss
## Code Before: // Partial: Diameter Calculator #diameter-calculator { width: 100%; margin: 0; & + a { font-weight: 300; font-size: 1.2rem; margin-bottom: 10px; display: block; > i { margin-right: 5px; } } th { font-size: 1em; } tr { td { width: 50%; } } input { margin: 0; } } #sidebar-add-tree { #diameter-calculator { tr { td { input { max-width: 78px; } } } } } #diameter-calculator-total-row { margin-top: 5px; margin-bottom: 5px; font-style: italic; color: $subtext-color; } [data-field="tree.diameter"] { #diameter-video { font-size: 1.2rem; font-weight: 400; > i { margin-right: 6px; } } } ## Instruction: Change font weight on diameter calculator headers ## Code After: // Partial: Diameter Calculator #diameter-calculator { width: 100%; margin: 0; & + a { font-weight: 300; font-size: 1.2rem; margin-bottom: 10px; display: block; > i { margin-right: 5px; } } th { font-size: 1em; font-weight: 300; } tr { td { width: 50%; } } input { margin: 0; } } #sidebar-add-tree { #diameter-calculator { tr { td { input { max-width: 78px; } } } } } #diameter-calculator-total-row { margin-top: 5px; margin-bottom: 5px; font-style: italic; color: $subtext-color; } [data-field="tree.diameter"] { #diameter-video { font-size: 1.2rem; font-weight: 400; > i { margin-right: 6px; } } }
// Partial: Diameter Calculator #diameter-calculator { width: 100%; margin: 0; & + a { font-weight: 300; font-size: 1.2rem; margin-bottom: 10px; display: block; > i { margin-right: 5px; } } th { font-size: 1em; + font-weight: 300; } tr { td { width: 50%; } } input { margin: 0; } } #sidebar-add-tree { #diameter-calculator { tr { td { input { max-width: 78px; } } } } } #diameter-calculator-total-row { margin-top: 5px; margin-bottom: 5px; font-style: italic; color: $subtext-color; } [data-field="tree.diameter"] { #diameter-video { font-size: 1.2rem; font-weight: 400; > i { margin-right: 6px; } } }
1
0.016949
1
0
2501d85c6e18d7a12507bbcbdd73559f34dd2b83
nvim/ginit.vim
nvim/ginit.vim
set guifont=Iosevka\ Term:h16 if exists('g:fvim_loaded') FVimCursorSmoothBlink v:true FVimCursorSmoothMove v:true FVimCustomTitleBar v:false endif
set guifont=JetBrains\ Mono:h13 if exists('g:fvim_loaded') FVimCursorSmoothBlink v:true FVimCursorSmoothMove v:true FVimCustomTitleBar v:false endif
Set font to JetBrains Mono
Neovim: Set font to JetBrains Mono
VimL
unlicense
tssm/.config,tssm/.config,tssm/.config,tssm/.config
viml
## Code Before: set guifont=Iosevka\ Term:h16 if exists('g:fvim_loaded') FVimCursorSmoothBlink v:true FVimCursorSmoothMove v:true FVimCustomTitleBar v:false endif ## Instruction: Neovim: Set font to JetBrains Mono ## Code After: set guifont=JetBrains\ Mono:h13 if exists('g:fvim_loaded') FVimCursorSmoothBlink v:true FVimCursorSmoothMove v:true FVimCustomTitleBar v:false endif
- set guifont=Iosevka\ Term:h16 + set guifont=JetBrains\ Mono:h13 if exists('g:fvim_loaded') FVimCursorSmoothBlink v:true FVimCursorSmoothMove v:true FVimCustomTitleBar v:false endif
2
0.285714
1
1
aefb77b2a6af6116a5924733857ce843b5895a9f
usr.bin/rlogin/Makefile
usr.bin/rlogin/Makefile
PROG= rlogin BINOWN= root BINMODE=4555 PRECIOUSPROG= .include <bsd.prog.mk>
PROG= rlogin BINOWN= root BINMODE=4555 PRECIOUSPROG= WARNS?= 3 .include <bsd.prog.mk>
Revert r221053 by replacing WARNS?= 3 since it's breaking the build on several arches.
Revert r221053 by replacing WARNS?= 3 since it's breaking the build on several arches.
unknown
bsd-3-clause
jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase
unknown
## Code Before: PROG= rlogin BINOWN= root BINMODE=4555 PRECIOUSPROG= .include <bsd.prog.mk> ## Instruction: Revert r221053 by replacing WARNS?= 3 since it's breaking the build on several arches. ## Code After: PROG= rlogin BINOWN= root BINMODE=4555 PRECIOUSPROG= WARNS?= 3 .include <bsd.prog.mk>
PROG= rlogin BINOWN= root BINMODE=4555 PRECIOUSPROG= + WARNS?= 3 + .include <bsd.prog.mk>
2
0.25
2
0
5fa0ccdd2a289e14a82cf66a2ae8c20fb1d47921
site/_posts/2018-10-08-le-travail-du-furet.md
site/_posts/2018-10-08-le-travail-du-furet.md
--- layout: post title: "Le travail du Furet" author: "Jean-Pierre Andrevon" isbn: 9782366298888 editor: Actusf --- ![Couverture](/img/9782366298888.jpg)
--- layout: post title: "Le travail du Furet" author: "Jean-Pierre Andrevon" isbn: 9782366298888 editor: Actusf --- ![Couverture](/img/9782366298888.jpg)Centrum, futur proche. La maladie a été éradiquée par la science. Pour maintenir un certain niveau de vie et éviter la surpopulation, des tueurs mandatés par l'Etat doivent éliminer 400 000 personnes chaque année. Riche, pauvre, homme, femme, personne n'y échappe. Mais les victimes sont-elles vraiment désignées au hasard ? C'est lorsque le Furet commence à en douter que les ennuis lui tombent dessus... Aura-t-il la force de se rebeller ? Livre culte, naviguant entre polar et dystopie, Le Travail du Furet est un roman coup-de-poing, sans concession sur les dérives de nos sociétés.
Fix summary of last book
Fix summary of last book
Markdown
apache-2.0
laedit/ReadingList,laedit/ReadingList
markdown
## Code Before: --- layout: post title: "Le travail du Furet" author: "Jean-Pierre Andrevon" isbn: 9782366298888 editor: Actusf --- ![Couverture](/img/9782366298888.jpg) ## Instruction: Fix summary of last book ## Code After: --- layout: post title: "Le travail du Furet" author: "Jean-Pierre Andrevon" isbn: 9782366298888 editor: Actusf --- ![Couverture](/img/9782366298888.jpg)Centrum, futur proche. La maladie a été éradiquée par la science. Pour maintenir un certain niveau de vie et éviter la surpopulation, des tueurs mandatés par l'Etat doivent éliminer 400 000 personnes chaque année. Riche, pauvre, homme, femme, personne n'y échappe. Mais les victimes sont-elles vraiment désignées au hasard ? C'est lorsque le Furet commence à en douter que les ennuis lui tombent dessus... Aura-t-il la force de se rebeller ? Livre culte, naviguant entre polar et dystopie, Le Travail du Furet est un roman coup-de-poing, sans concession sur les dérives de nos sociétés.
--- layout: post title: "Le travail du Furet" author: "Jean-Pierre Andrevon" isbn: 9782366298888 editor: Actusf --- - ![Couverture](/img/9782366298888.jpg) + ![Couverture](/img/9782366298888.jpg)Centrum, futur proche. ? ++++++++++++++++++++++ + La maladie a été éradiquée par la science. Pour maintenir un certain niveau de vie et éviter la surpopulation, des tueurs mandatés par l'Etat doivent éliminer 400 000 personnes chaque année. Riche, pauvre, homme, femme, personne n'y échappe. + Mais les victimes sont-elles vraiment désignées au hasard ? C'est lorsque le Furet commence à en douter que les ennuis lui tombent dessus... + Aura-t-il la force de se rebeller ? + Livre culte, naviguant entre polar et dystopie, Le Travail du Furet est un roman coup-de-poing, sans concession sur les dérives de nos sociétés.
6
0.666667
5
1
f769b829cd420cbe9615757ac1014d8e95e918a8
app/views/layouts/application.html.erb
app/views/layouts/application.html.erb
<!DOCTYPE html> <html> <head> <title><%= full_title(yield(:title)) %></title> <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> <%= render 'layouts/favicon' %> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta content='IE=edge' http-equiv='X-UA-Compatible'> <%= display_meta_tags %> <%= csrf_meta_tags %> <%= render 'layouts/shim' %> </head> <body class="<%= controller_name %> <%= action_name %>"> <h1 class="sr-only">Dillon Downeys Website</h1> <%= link_to "Skip to main content", "#mainSection", class:"sr-only" %> <%= link_to "Skip to project section", "#projectSection", class:"sr-only" %> <%= link_to "Skip to footer", "#footerSection", class:"sr-only" %> <%= render 'layouts/navbar_top' %> <%= render "layouts/flash_message" %> <main id="mainSection"> <%= yield %> </main> <%= render 'layouts/footer.html' %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> </body> </html>
<!DOCTYPE html> <html> <head> <title><%= full_title(yield(:title)) %></title> /* Stylesheets need to be before meta tags. New Relic creates a script tag that gets inserted after meta content='IE=edge' */ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> <%= render 'layouts/favicon' %> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta content='IE=edge' http-equiv='X-UA-Compatible'> <%= display_meta_tags %> <%= csrf_meta_tags %> <%= render 'layouts/shim' %> </head> <body class="<%= controller_name %> <%= action_name %>"> <h1 class="sr-only">Dillon Downeys Website</h1> <%= link_to "Skip to main content", "#mainSection", class:"sr-only" %> <%= link_to "Skip to project section", "#projectSection", class:"sr-only" %> <%= link_to "Skip to footer", "#footerSection", class:"sr-only" %> <%= render 'layouts/navbar_top' %> <%= render "layouts/flash_message" %> <main id="mainSection"> <%= yield %> </main> <%= render 'layouts/footer.html' %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> </body> </html>
Move stylesheets before New Relic script tag is inserted.
Move stylesheets before New Relic script tag is inserted.
HTML+ERB
mit
downeyd27/personal_website,downeyd27/personal_website,downeyd27/personal_website
html+erb
## Code Before: <!DOCTYPE html> <html> <head> <title><%= full_title(yield(:title)) %></title> <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> <%= render 'layouts/favicon' %> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta content='IE=edge' http-equiv='X-UA-Compatible'> <%= display_meta_tags %> <%= csrf_meta_tags %> <%= render 'layouts/shim' %> </head> <body class="<%= controller_name %> <%= action_name %>"> <h1 class="sr-only">Dillon Downeys Website</h1> <%= link_to "Skip to main content", "#mainSection", class:"sr-only" %> <%= link_to "Skip to project section", "#projectSection", class:"sr-only" %> <%= link_to "Skip to footer", "#footerSection", class:"sr-only" %> <%= render 'layouts/navbar_top' %> <%= render "layouts/flash_message" %> <main id="mainSection"> <%= yield %> </main> <%= render 'layouts/footer.html' %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> </body> </html> ## Instruction: Move stylesheets before New Relic script tag is inserted. ## Code After: <!DOCTYPE html> <html> <head> <title><%= full_title(yield(:title)) %></title> /* Stylesheets need to be before meta tags. New Relic creates a script tag that gets inserted after meta content='IE=edge' */ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> <%= render 'layouts/favicon' %> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta content='IE=edge' http-equiv='X-UA-Compatible'> <%= display_meta_tags %> <%= csrf_meta_tags %> <%= render 'layouts/shim' %> </head> <body class="<%= controller_name %> <%= action_name %>"> <h1 class="sr-only">Dillon Downeys Website</h1> <%= link_to "Skip to main content", "#mainSection", class:"sr-only" %> <%= link_to "Skip to project section", "#projectSection", class:"sr-only" %> <%= link_to "Skip to footer", "#footerSection", class:"sr-only" %> <%= render 'layouts/navbar_top' %> <%= render "layouts/flash_message" %> <main id="mainSection"> <%= yield %> </main> <%= render 'layouts/footer.html' %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> </body> </html>
<!DOCTYPE html> <html> <head> <title><%= full_title(yield(:title)) %></title> + /* Stylesheets need to be before meta tags. New Relic + creates a script tag that gets inserted after meta content='IE=edge' */ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> <%= render 'layouts/favicon' %> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta content='IE=edge' http-equiv='X-UA-Compatible'> <%= display_meta_tags %> <%= csrf_meta_tags %> <%= render 'layouts/shim' %> </head> <body class="<%= controller_name %> <%= action_name %>"> <h1 class="sr-only">Dillon Downeys Website</h1> <%= link_to "Skip to main content", "#mainSection", class:"sr-only" %> <%= link_to "Skip to project section", "#projectSection", class:"sr-only" %> <%= link_to "Skip to footer", "#footerSection", class:"sr-only" %> <%= render 'layouts/navbar_top' %> <%= render "layouts/flash_message" %> <main id="mainSection"> <%= yield %> </main> <%= render 'layouts/footer.html' %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> </body> </html>
2
0.058824
2
0
a942d28c315f59428a80d2fd0b268cd99bbe3b66
common/src/configureStore.js
common/src/configureStore.js
import appReducer from './app/reducer'; import createLogger from 'redux-logger'; import fetch from 'isomorphic-fetch'; import injectDependencies from './lib/injectDependencies'; import promiseMiddleware from 'redux-promise-middleware'; import stateToJS from './lib/stateToJS'; import validate from './validate'; import {applyMiddleware, createStore} from 'redux'; export default function configureStore(initialState) { const dependenciesMiddleware = injectDependencies( {fetch}, {validate} ); const middlewares = [ dependenciesMiddleware, promiseMiddleware ]; if (process.env.NODE_ENV !== 'production') { // eslint-disable-line no-undef const logger = createLogger({ collapsed: () => true, transformer: stateToJS }); middlewares.push(logger); } const store = applyMiddleware(...middlewares)(createStore)( appReducer, initialState); if (module.hot) { // eslint-disable-line no-undef // Enable Webpack hot module replacement for reducers. module.hot.accept('./app/reducer', () => { // eslint-disable-line no-undef const nextAppReducer = require('./app/reducer'); // eslint-disable-line no-undef store.replaceReducer(nextAppReducer); }); } return store; }
import appReducer from './app/reducer'; import createLogger from 'redux-logger'; import fetch from 'isomorphic-fetch'; import injectDependencies from './lib/injectDependencies'; import promiseMiddleware from 'redux-promise-middleware'; import stateToJS from './lib/stateToJS'; import validate from './validate'; import {applyMiddleware, createStore} from 'redux'; export default function configureStore(initialState) { const dependenciesMiddleware = injectDependencies( {fetch}, {validate} ); const middlewares = [ dependenciesMiddleware, promiseMiddleware ]; const loggerEnabled = process.env.IS_BROWSER && // eslint-disable-line no-undef process.env.NODE_ENV !== 'production'; // eslint-disable-line no-undef if (loggerEnabled) { const logger = createLogger({ collapsed: () => true, transformer: stateToJS }); middlewares.push(logger); } const store = applyMiddleware(...middlewares)(createStore)( appReducer, initialState); if (module.hot) { // eslint-disable-line no-undef // Enable Webpack hot module replacement for reducers. module.hot.accept('./app/reducer', () => { // eslint-disable-line no-undef const nextAppReducer = require('./app/reducer'); // eslint-disable-line no-undef store.replaceReducer(nextAppReducer); }); } return store; }
Enable Flux logger only for dev
Enable Flux logger only for dev
JavaScript
mit
puzzfuzz/othello-redux,christophediprima/este,XeeD/este,abelaska/este,skyuplam/debt_mgmt,AugustinLF/este,TheoMer/Gyms-Of-The-World,skyuplam/debt_mgmt,langpavel/este,XeeD/test,robinpokorny/este,aindre/este-example,christophediprima/este,SidhNor/este-cordova-starter-kit,robinpokorny/este,glaserp/Maturita-Project,christophediprima/este,AlesJiranek/este,sikhote/davidsinclair,blueberryapps/este,TheoMer/Gyms-Of-The-World,XeeD/test,TheoMer/Gyms-Of-The-World,syroegkin/mikora.eu,zanj2006/este,este/este,TheoMer/este,puzzfuzz/othello-redux,vacuumlabs/este,estaub/my-este,cjk/smart-home-app,AlesJiranek/este,skallet/este,neozhangthe1/framedrop-web,GarrettSmith/schizophrenia,este/este,aindre/este-example,neozhangthe1/framedrop-web,nezaidu/este,GarrettSmith/schizophrenia,amrsekilly/updatedEste,skallet/este,neozhangthe1/framedrop-web,amrsekilly/updatedEste,amrsekilly/updatedEste,este/este,zanj2006/este,este/este,neozhangthe1/framedrop-web,nason/este,glaserp/Maturita-Project,XeeD/este,abelaska/este,TheoMer/este,syroegkin/mikora.eu,steida/este,ViliamKopecky/este,estaub/my-este,syroegkin/mikora.eu,neozhangthe1/framedrop-web,steida/este,robinpokorny/este,vacuumlabs/este,blueberryapps/este,estaub/my-este,Brainfock/este,abelaska/este,sikhote/davidsinclair,TheoMer/este,langpavel/este,sikhote/davidsinclair,GarrettSmith/schizophrenia,christophediprima/este,shawn-dsz/este,AugustinLF/este,skallet/este
javascript
## Code Before: import appReducer from './app/reducer'; import createLogger from 'redux-logger'; import fetch from 'isomorphic-fetch'; import injectDependencies from './lib/injectDependencies'; import promiseMiddleware from 'redux-promise-middleware'; import stateToJS from './lib/stateToJS'; import validate from './validate'; import {applyMiddleware, createStore} from 'redux'; export default function configureStore(initialState) { const dependenciesMiddleware = injectDependencies( {fetch}, {validate} ); const middlewares = [ dependenciesMiddleware, promiseMiddleware ]; if (process.env.NODE_ENV !== 'production') { // eslint-disable-line no-undef const logger = createLogger({ collapsed: () => true, transformer: stateToJS }); middlewares.push(logger); } const store = applyMiddleware(...middlewares)(createStore)( appReducer, initialState); if (module.hot) { // eslint-disable-line no-undef // Enable Webpack hot module replacement for reducers. module.hot.accept('./app/reducer', () => { // eslint-disable-line no-undef const nextAppReducer = require('./app/reducer'); // eslint-disable-line no-undef store.replaceReducer(nextAppReducer); }); } return store; } ## Instruction: Enable Flux logger only for dev ## Code After: import appReducer from './app/reducer'; import createLogger from 'redux-logger'; import fetch from 'isomorphic-fetch'; import injectDependencies from './lib/injectDependencies'; import promiseMiddleware from 'redux-promise-middleware'; import stateToJS from './lib/stateToJS'; import validate from './validate'; import {applyMiddleware, createStore} from 'redux'; export default function configureStore(initialState) { const dependenciesMiddleware = injectDependencies( {fetch}, {validate} ); const middlewares = [ dependenciesMiddleware, promiseMiddleware ]; const loggerEnabled = process.env.IS_BROWSER && // eslint-disable-line no-undef process.env.NODE_ENV !== 'production'; // eslint-disable-line no-undef if (loggerEnabled) { const logger = createLogger({ collapsed: () => true, transformer: stateToJS }); middlewares.push(logger); } const store = applyMiddleware(...middlewares)(createStore)( appReducer, initialState); if (module.hot) { // eslint-disable-line no-undef // Enable Webpack hot module replacement for reducers. module.hot.accept('./app/reducer', () => { // eslint-disable-line no-undef const nextAppReducer = require('./app/reducer'); // eslint-disable-line no-undef store.replaceReducer(nextAppReducer); }); } return store; }
import appReducer from './app/reducer'; import createLogger from 'redux-logger'; import fetch from 'isomorphic-fetch'; import injectDependencies from './lib/injectDependencies'; import promiseMiddleware from 'redux-promise-middleware'; import stateToJS from './lib/stateToJS'; import validate from './validate'; import {applyMiddleware, createStore} from 'redux'; export default function configureStore(initialState) { const dependenciesMiddleware = injectDependencies( {fetch}, {validate} ); const middlewares = [ dependenciesMiddleware, promiseMiddleware ]; + const loggerEnabled = + process.env.IS_BROWSER && // eslint-disable-line no-undef + process.env.NODE_ENV !== 'production'; // eslint-disable-line no-undef - if (process.env.NODE_ENV !== 'production') { // eslint-disable-line no-undef + if (loggerEnabled) { const logger = createLogger({ collapsed: () => true, transformer: stateToJS }); middlewares.push(logger); } const store = applyMiddleware(...middlewares)(createStore)( appReducer, initialState); if (module.hot) { // eslint-disable-line no-undef // Enable Webpack hot module replacement for reducers. module.hot.accept('./app/reducer', () => { // eslint-disable-line no-undef const nextAppReducer = require('./app/reducer'); // eslint-disable-line no-undef store.replaceReducer(nextAppReducer); }); } return store; }
5
0.125
4
1
88899e2f09ceff11eb4609be00302fdf6b2fbed2
lib/zend/cli.rb
lib/zend/cli.rb
module Zend class CLI < Thor desc 'login', 'Starts prompt to login to your Zendesk account' def login Zend::Auth.login end desc 'logout', 'Remove credentials from local machine' def logout Zend::Auth.logout end class Tickets < Thor desc 'tickets list [string]', 'Print list of tickets' option :new, aliases: '-n', type: :boolean, desc: 'include new tickets' option :open, aliases: '-o', type: :boolean, desc: 'include open tickets' option :pending, aliases: '-p', type: :boolean, desc: 'include pending tickets' option :solved, aliases: '-s', type: :boolean, desc: 'include solved tickets' option :closed, aliases: '-c', type: :boolean, desc: 'include closed tickets' option :tags, aliases: '-t', type: :array, desc: 'only list tickets containing these tags' def list(query='') Zend::Command::Ticket::List.new(query, options) end desc 'show ID', 'Get details of a Zendesk ticket' def show(id) Zend::Command::Ticket::Show.new(id) end desc 'description ID [DESCRIPTION]', 'Get single line ticket description' def description(id, description=nil) Zend::Command::Ticket::Description.new(id, description) end end desc 'tickets SUBCOMMAND ...ARGS', 'manage tickets' subcommand 'tickets', CLI::Tickets end end
module Zend class Tickets < Thor desc 'tickets list [string]', 'Print list of tickets' option :new, aliases: '-n', type: :boolean, desc: 'include new tickets' option :open, aliases: '-o', type: :boolean, desc: 'include open tickets' option :pending, aliases: '-p', type: :boolean, desc: 'include pending tickets' option :solved, aliases: '-s', type: :boolean, desc: 'include solved tickets' option :closed, aliases: '-c', type: :boolean, desc: 'include closed tickets' option :tags, aliases: '-t', type: :array, desc: 'only list tickets containing these tags' def list(query='') Zend::Command::Ticket::List.new(query, options) end desc 'show ID', 'Get details of a Zendesk ticket' def show(id) Zend::Command::Ticket::Show.new(id) end desc 'description ID [DESCRIPTION]', 'Get single line ticket description' def description(id, description=nil) Zend::Command::Ticket::Description.new(id, description) end end class CLI < Thor desc 'login', 'Starts prompt to login to your Zendesk account' def login Zend::Auth.login end desc 'logout', 'Remove credentials from local machine' def logout Zend::Auth.logout end desc 'tickets SUBCOMMAND ...ARGS', 'manage tickets' subcommand 'tickets', Tickets end end
Fix `zend help` output issues
Fix `zend help` output issues
Ruby
mit
JeanMertz/zend
ruby
## Code Before: module Zend class CLI < Thor desc 'login', 'Starts prompt to login to your Zendesk account' def login Zend::Auth.login end desc 'logout', 'Remove credentials from local machine' def logout Zend::Auth.logout end class Tickets < Thor desc 'tickets list [string]', 'Print list of tickets' option :new, aliases: '-n', type: :boolean, desc: 'include new tickets' option :open, aliases: '-o', type: :boolean, desc: 'include open tickets' option :pending, aliases: '-p', type: :boolean, desc: 'include pending tickets' option :solved, aliases: '-s', type: :boolean, desc: 'include solved tickets' option :closed, aliases: '-c', type: :boolean, desc: 'include closed tickets' option :tags, aliases: '-t', type: :array, desc: 'only list tickets containing these tags' def list(query='') Zend::Command::Ticket::List.new(query, options) end desc 'show ID', 'Get details of a Zendesk ticket' def show(id) Zend::Command::Ticket::Show.new(id) end desc 'description ID [DESCRIPTION]', 'Get single line ticket description' def description(id, description=nil) Zend::Command::Ticket::Description.new(id, description) end end desc 'tickets SUBCOMMAND ...ARGS', 'manage tickets' subcommand 'tickets', CLI::Tickets end end ## Instruction: Fix `zend help` output issues ## Code After: module Zend class Tickets < Thor desc 'tickets list [string]', 'Print list of tickets' option :new, aliases: '-n', type: :boolean, desc: 'include new tickets' option :open, aliases: '-o', type: :boolean, desc: 'include open tickets' option :pending, aliases: '-p', type: :boolean, desc: 'include pending tickets' option :solved, aliases: '-s', type: :boolean, desc: 'include solved tickets' option :closed, aliases: '-c', type: :boolean, desc: 'include closed tickets' option :tags, aliases: '-t', type: :array, desc: 'only list tickets containing these tags' def list(query='') Zend::Command::Ticket::List.new(query, options) end desc 'show ID', 'Get details of a Zendesk ticket' def show(id) Zend::Command::Ticket::Show.new(id) end desc 'description ID [DESCRIPTION]', 'Get single line ticket description' def description(id, description=nil) Zend::Command::Ticket::Description.new(id, description) end end class CLI < Thor desc 'login', 'Starts prompt to login to your Zendesk account' def login Zend::Auth.login end desc 'logout', 'Remove credentials from local machine' def logout Zend::Auth.logout end desc 'tickets SUBCOMMAND ...ARGS', 'manage tickets' subcommand 'tickets', Tickets end end
module Zend + class Tickets < Thor + desc 'tickets list [string]', 'Print list of tickets' + option :new, aliases: '-n', type: :boolean, desc: 'include new tickets' + option :open, aliases: '-o', type: :boolean, desc: 'include open tickets' + option :pending, aliases: '-p', type: :boolean, desc: 'include pending tickets' + option :solved, aliases: '-s', type: :boolean, desc: 'include solved tickets' + option :closed, aliases: '-c', type: :boolean, desc: 'include closed tickets' + option :tags, aliases: '-t', type: :array, desc: 'only list tickets containing these tags' + def list(query='') + Zend::Command::Ticket::List.new(query, options) + end + + desc 'show ID', 'Get details of a Zendesk ticket' + def show(id) + Zend::Command::Ticket::Show.new(id) + end + + desc 'description ID [DESCRIPTION]', 'Get single line ticket description' + def description(id, description=nil) + Zend::Command::Ticket::Description.new(id, description) + end + end + class CLI < Thor desc 'login', 'Starts prompt to login to your Zendesk account' def login Zend::Auth.login end desc 'logout', 'Remove credentials from local machine' def logout Zend::Auth.logout end - class Tickets < Thor - desc 'tickets list [string]', 'Print list of tickets' - option :new, aliases: '-n', type: :boolean, desc: 'include new tickets' - option :open, aliases: '-o', type: :boolean, desc: 'include open tickets' - option :pending, aliases: '-p', type: :boolean, desc: 'include pending tickets' - option :solved, aliases: '-s', type: :boolean, desc: 'include solved tickets' - option :closed, aliases: '-c', type: :boolean, desc: 'include closed tickets' - option :tags, aliases: '-t', type: :array, desc: 'only list tickets containing these tags' - def list(query='') - Zend::Command::Ticket::List.new(query, options) - end - - desc 'show ID', 'Get details of a Zendesk ticket' - def show(id) - Zend::Command::Ticket::Show.new(id) - end - - desc 'description ID [DESCRIPTION]', 'Get single line ticket description' - def description(id, description=nil) - Zend::Command::Ticket::Description.new(id, description) - end - end desc 'tickets SUBCOMMAND ...ARGS', 'manage tickets' - subcommand 'tickets', CLI::Tickets ? ----- + subcommand 'tickets', Tickets end end
47
1.205128
24
23
5a5becc31f801859022ec388a2c30f14c34d01a8
requirements/dev.txt
requirements/dev.txt
-r prod.txt # Unit Testing pytest==6.2.5 factory-boy==3.2.0 pytest-mock==3.6.1 webtest==3.0.0 pytest-cov==2.12.1 # Acceptance Testing robotframework==4.1.1 robotframework-seleniumlibrary==5.1.3 webdrivermanager==0.10.0 # Lint and code style flake8==3.9.2 flake8-docstrings==1.6.0 flake8-quotes==3.3.0 pep8-naming==0.12.1
-r prod.txt # Unit Testing pytest==6.2.5 factory-boy==3.2.0 pytest-mock==3.6.1 webtest==3.0.0 pytest-cov==2.12.1 # Acceptance Testing robotframework==4.1.1 robotframework-seleniumlibrary==5.1.3 webdrivermanager==0.10.0 # Lint and code style flake8==3.9.2 flake8-docstrings==1.6.0 flake8-quotes==3.3.0 isort==5.10.1 pep8-naming==0.12.1
Add isort as a dependency
Add isort as a dependency
Text
mit
suever/MATL-Online,suever/MATL-Online,suever/MATL-Online,suever/MATL-Online,suever/MATL-Online
text
## Code Before: -r prod.txt # Unit Testing pytest==6.2.5 factory-boy==3.2.0 pytest-mock==3.6.1 webtest==3.0.0 pytest-cov==2.12.1 # Acceptance Testing robotframework==4.1.1 robotframework-seleniumlibrary==5.1.3 webdrivermanager==0.10.0 # Lint and code style flake8==3.9.2 flake8-docstrings==1.6.0 flake8-quotes==3.3.0 pep8-naming==0.12.1 ## Instruction: Add isort as a dependency ## Code After: -r prod.txt # Unit Testing pytest==6.2.5 factory-boy==3.2.0 pytest-mock==3.6.1 webtest==3.0.0 pytest-cov==2.12.1 # Acceptance Testing robotframework==4.1.1 robotframework-seleniumlibrary==5.1.3 webdrivermanager==0.10.0 # Lint and code style flake8==3.9.2 flake8-docstrings==1.6.0 flake8-quotes==3.3.0 isort==5.10.1 pep8-naming==0.12.1
-r prod.txt # Unit Testing pytest==6.2.5 factory-boy==3.2.0 pytest-mock==3.6.1 webtest==3.0.0 pytest-cov==2.12.1 # Acceptance Testing robotframework==4.1.1 robotframework-seleniumlibrary==5.1.3 webdrivermanager==0.10.0 # Lint and code style flake8==3.9.2 flake8-docstrings==1.6.0 flake8-quotes==3.3.0 + isort==5.10.1 pep8-naming==0.12.1
1
0.052632
1
0
1344180b45caacf8c7a1dffdc89155a429b5554d
contrib/lang/go/packages.el
contrib/lang/go/packages.el
(defvar go-packages '( go-mode ) "List of all packages to install and/or initialize. Built-in packages which require an initialization must be listed explicitly in the list.") (defun go/init-go-mode() (use-package go-mode :defer t :init (progn (evil-leader/set-key "mdp" 'godoc-at-point "mig" 'go-goto-imports "mia" 'go-import-add "mir" 'go-remove-unused-imports "mpb" 'go-play-buffer "mpr" 'go-play-region "mpd" 'go-download-play ) ) :config (add-hook 'before-save-hook 'gofmt-before-save) ) )
(defvar go-packages '( go-mode ) "List of all packages to install and/or initialize. Built-in packages which require an initialization must be listed explicitly in the list.") (defun go/init-go-mode() (use-package go-mode :defer t :init (progn (evil-leader/set-key "mdp" 'godoc-at-point "mig" 'go-goto-imports "mia" 'go-import-add "mir" 'go-remove-unused-imports "mpb" 'go-play-buffer "mpr" 'go-play-region "mpd" 'go-download-play ) ) :config (add-hook 'before-save-hook 'gofmt-before-save) (add-hook 'go-mode-hook 'flycheck-mode) ) )
Add flycheck-mode to go layer
Add flycheck-mode to go layer
Emacs Lisp
mit
tsonntag/dotemacs,tsonntag/dotemacs,tsonntag/dotemacs,tsonntag/dotemacs
emacs-lisp
## Code Before: (defvar go-packages '( go-mode ) "List of all packages to install and/or initialize. Built-in packages which require an initialization must be listed explicitly in the list.") (defun go/init-go-mode() (use-package go-mode :defer t :init (progn (evil-leader/set-key "mdp" 'godoc-at-point "mig" 'go-goto-imports "mia" 'go-import-add "mir" 'go-remove-unused-imports "mpb" 'go-play-buffer "mpr" 'go-play-region "mpd" 'go-download-play ) ) :config (add-hook 'before-save-hook 'gofmt-before-save) ) ) ## Instruction: Add flycheck-mode to go layer ## Code After: (defvar go-packages '( go-mode ) "List of all packages to install and/or initialize. Built-in packages which require an initialization must be listed explicitly in the list.") (defun go/init-go-mode() (use-package go-mode :defer t :init (progn (evil-leader/set-key "mdp" 'godoc-at-point "mig" 'go-goto-imports "mia" 'go-import-add "mir" 'go-remove-unused-imports "mpb" 'go-play-buffer "mpr" 'go-play-region "mpd" 'go-download-play ) ) :config (add-hook 'before-save-hook 'gofmt-before-save) (add-hook 'go-mode-hook 'flycheck-mode) ) )
(defvar go-packages '( go-mode ) "List of all packages to install and/or initialize. Built-in packages which require an initialization must be listed explicitly in the list.") (defun go/init-go-mode() (use-package go-mode :defer t :init (progn (evil-leader/set-key "mdp" 'godoc-at-point "mig" 'go-goto-imports "mia" 'go-import-add "mir" 'go-remove-unused-imports "mpb" 'go-play-buffer "mpr" 'go-play-region "mpd" 'go-download-play ) ) :config (add-hook 'before-save-hook 'gofmt-before-save) + (add-hook 'go-mode-hook 'flycheck-mode) ) )
1
0.037037
1
0
b164f86404211f610f1afe1ec9b1b0910f3f0450
twish.js
twish.js
var util = require('util') , twitter = require('twitter') , colors = require('colors') , repl = require('repl') , keys = require('./keys') , local = repl.start() , first = true var twish = new twitter(keys) local.context.repl = local local.defineCommand('tweet', function(tweet){ twish .verifyCredentials(function(data) { console.log(util.inspect(data)) }) .updateStatus(tweet, function(data) { console.log(util.inspect(data)) }) }) local.commands['.tweet'].help = 'Tweet as currently signed in user' twish.stream('user', {track:'gkatsev', delimited:20}, function(stream){ stream.on('data', function(data){ if(first){ first = false return } setTimeout(function(){ var obj = {} obj.user = data.user.screen_name obj.text = data.text obj.data = data.created_at process.stdout.write(JSON.stringify(obj, null, ' ')) }, 500) }) }) module.exports = twish
var util = require('util') , twitter = require('twitter') , colors = require('colors') , repl = require('repl') , keys = require('./keys') , local = repl.start() , first = true var twish = new twitter(keys) local.context.repl = local local.context.colors = colors local.context.twish = twish local.defineCommand('tweet', function(tweet){ twish .verifyCredentials(function(data) { console.log(util.inspect(data)) }) .updateStatus(tweet, function(data) { console.log(util.inspect(data)) }) }) local.commands['.tweet'].help = 'Tweet as currently signed in user' twish.stream('user', {track:'gkatsev', delimited:20}, function(stream){ stream.on('data', function(data){ if(first){ first = false return } setTimeout(function(){ var obj = {} obj.user = data.user.screen_name obj.text = data.text obj.data = data.created_at process.stdout.write(JSON.stringify(obj, null, ' ')) }, 500) }) }) module.exports = twish
Add modules to repl for testing
Add modules to repl for testing
JavaScript
mit
gkatsev/twish
javascript
## Code Before: var util = require('util') , twitter = require('twitter') , colors = require('colors') , repl = require('repl') , keys = require('./keys') , local = repl.start() , first = true var twish = new twitter(keys) local.context.repl = local local.defineCommand('tweet', function(tweet){ twish .verifyCredentials(function(data) { console.log(util.inspect(data)) }) .updateStatus(tweet, function(data) { console.log(util.inspect(data)) }) }) local.commands['.tweet'].help = 'Tweet as currently signed in user' twish.stream('user', {track:'gkatsev', delimited:20}, function(stream){ stream.on('data', function(data){ if(first){ first = false return } setTimeout(function(){ var obj = {} obj.user = data.user.screen_name obj.text = data.text obj.data = data.created_at process.stdout.write(JSON.stringify(obj, null, ' ')) }, 500) }) }) module.exports = twish ## Instruction: Add modules to repl for testing ## Code After: var util = require('util') , twitter = require('twitter') , colors = require('colors') , repl = require('repl') , keys = require('./keys') , local = repl.start() , first = true var twish = new twitter(keys) local.context.repl = local local.context.colors = colors local.context.twish = twish local.defineCommand('tweet', function(tweet){ twish .verifyCredentials(function(data) { console.log(util.inspect(data)) }) .updateStatus(tweet, function(data) { console.log(util.inspect(data)) }) }) local.commands['.tweet'].help = 'Tweet as currently signed in user' twish.stream('user', {track:'gkatsev', delimited:20}, function(stream){ stream.on('data', function(data){ if(first){ first = false return } setTimeout(function(){ var obj = {} obj.user = data.user.screen_name obj.text = data.text obj.data = data.created_at process.stdout.write(JSON.stringify(obj, null, ' ')) }, 500) }) }) module.exports = twish
var util = require('util') , twitter = require('twitter') , colors = require('colors') , repl = require('repl') , keys = require('./keys') , local = repl.start() , first = true var twish = new twitter(keys) local.context.repl = local + local.context.colors = colors + local.context.twish = twish + local.defineCommand('tweet', function(tweet){ twish .verifyCredentials(function(data) { console.log(util.inspect(data)) }) .updateStatus(tweet, function(data) { console.log(util.inspect(data)) }) }) local.commands['.tweet'].help = 'Tweet as currently signed in user' twish.stream('user', {track:'gkatsev', delimited:20}, function(stream){ stream.on('data', function(data){ if(first){ first = false return } setTimeout(function(){ var obj = {} obj.user = data.user.screen_name obj.text = data.text obj.data = data.created_at process.stdout.write(JSON.stringify(obj, null, ' ')) }, 500) }) }) module.exports = twish
3
0.075
3
0
74e37795754e1d02a3de5193b684d77623143940
lib/will_paginate_search.rb
lib/will_paginate_search.rb
module Foo::Acts::Indexed module WillPaginate module Search # DEPRECATED. Use chained pagination instead. def paginate_search(query, options) warn "[DEPRECATION] `paginate_search` is deprecated and will be removed in a later release. Use `with_query(query).paginate()` instead." page, per_page, total_entries = wp_parse_options(options) total_entries ||= find_with_index(query,{},{:ids_only => true}).size returning ::WillPaginate::Collection.new(page, per_page, total_entries) do |pager| options.update :offset => pager.offset, :limit => pager.per_page options = options.delete_if {|key, value| [:page, :per_page].include?(key) } pager.replace find_with_index(query, options) end end end end end class ActiveRecord::Base extend Foo::Acts::Indexed::WillPaginate::Search end
module ActsAsIndexed module WillPaginate module Search # DEPRECATED. Use chained pagination instead. def paginate_search(query, options) warn "[DEPRECATION] `paginate_search` is deprecated and will be removed in a later release. Use `with_query(query).paginate()` instead." page, per_page, total_entries = wp_parse_options(options) total_entries ||= find_with_index(query,{},{:ids_only => true}).size returning ::WillPaginate::Collection.new(page, per_page, total_entries) do |pager| options.update :offset => pager.offset, :limit => pager.per_page options = options.delete_if {|key, value| [:page, :per_page].include?(key) } pager.replace find_with_index(query, options) end end end end end class ActiveRecord::Base extend ActsAsIndexed::WillPaginate::Search end
Fix to WillPaginate module structure due to poor merge.
Fix to WillPaginate module structure due to poor merge.
Ruby
mit
evanrolfe/acts_as_indexed,nilbus/acts_as_indexed,dougal/acts_as_indexed,nikolai-b/acts_as_indexed
ruby
## Code Before: module Foo::Acts::Indexed module WillPaginate module Search # DEPRECATED. Use chained pagination instead. def paginate_search(query, options) warn "[DEPRECATION] `paginate_search` is deprecated and will be removed in a later release. Use `with_query(query).paginate()` instead." page, per_page, total_entries = wp_parse_options(options) total_entries ||= find_with_index(query,{},{:ids_only => true}).size returning ::WillPaginate::Collection.new(page, per_page, total_entries) do |pager| options.update :offset => pager.offset, :limit => pager.per_page options = options.delete_if {|key, value| [:page, :per_page].include?(key) } pager.replace find_with_index(query, options) end end end end end class ActiveRecord::Base extend Foo::Acts::Indexed::WillPaginate::Search end ## Instruction: Fix to WillPaginate module structure due to poor merge. ## Code After: module ActsAsIndexed module WillPaginate module Search # DEPRECATED. Use chained pagination instead. def paginate_search(query, options) warn "[DEPRECATION] `paginate_search` is deprecated and will be removed in a later release. Use `with_query(query).paginate()` instead." page, per_page, total_entries = wp_parse_options(options) total_entries ||= find_with_index(query,{},{:ids_only => true}).size returning ::WillPaginate::Collection.new(page, per_page, total_entries) do |pager| options.update :offset => pager.offset, :limit => pager.per_page options = options.delete_if {|key, value| [:page, :per_page].include?(key) } pager.replace find_with_index(query, options) end end end end end class ActiveRecord::Base extend ActsAsIndexed::WillPaginate::Search end
- module Foo::Acts::Indexed ? ----- ^^ + module ActsAsIndexed ? ^^ module WillPaginate module Search # DEPRECATED. Use chained pagination instead. def paginate_search(query, options) warn "[DEPRECATION] `paginate_search` is deprecated and will be removed in a later release. Use `with_query(query).paginate()` instead." page, per_page, total_entries = wp_parse_options(options) total_entries ||= find_with_index(query,{},{:ids_only => true}).size returning ::WillPaginate::Collection.new(page, per_page, total_entries) do |pager| options.update :offset => pager.offset, :limit => pager.per_page options = options.delete_if {|key, value| [:page, :per_page].include?(key) } pager.replace find_with_index(query, options) end end end end end class ActiveRecord::Base - extend Foo::Acts::Indexed::WillPaginate::Search ? ----- ^^ + extend ActsAsIndexed::WillPaginate::Search ? ^^ end
4
0.133333
2
2
0880ba3821ff4472d1a5c2003f6b8bc45176ffed
app/controllers/scm_projects_controller.rb
app/controllers/scm_projects_controller.rb
class ScmProjectsController < ApplicationController before_filter :check_access def new @scm_project= ScmProject.new end def create @scm_project= ScmProject.new(params[:scm_project]) if @scm_project.save redirect_to scm_project_url(@scm_project) else render :action=>:new end end def show @scm_project=ScmProject.find(params[:id]) end private def check_access unless current_user.admin? flash['notice'] = _"You're not allowed to create new scm project. Have your admin give you access." redirect_from_last return false end end end
class ScmProjectsController < ApplicationController before_filter :check_access def new @scm_project= ScmProject.new end def create @scm_project= ScmProject.new(params[:scm_project]) @scm_project.company= current_user.company if @scm_project.save redirect_to scm_project_url(@scm_project) else render :action=>:new end end def show @scm_project=ScmProject.find(params[:id]) end private def check_access unless current_user.admin? flash['notice'] = _"You're not allowed to create new scm project. Have your admin give you access." redirect_from_last return false end end end
Set company for new scm_project.
Set company for new scm_project.
Ruby
agpl-3.0
digitalnatives/jobsworth,evinoca/clockingit,ari/jobsworth,digitalnatives/jobsworth,evinoca/clockingit,webstream-io/jobsworth,rafaspinola/jobsworth,digitalnatives/jobsworth,webstream-io/jobsworth,xuewenfei/jobsworth,rafaspinola/jobsworth,webstream-io/jobsworth,xuewenfei/jobsworth,arunagw/clockingit,arunagw/clockingit,arunagw/clockingit,xuewenfei/jobsworth,webstream-io/jobsworth,ari/jobsworth,digitalnatives/jobsworth,rafaspinola/jobsworth,digitalnatives/jobsworth,rafaspinola/jobsworth,ari/jobsworth,evinoca/clockingit,ari/jobsworth,evinoca/clockingit,xuewenfei/jobsworth
ruby
## Code Before: class ScmProjectsController < ApplicationController before_filter :check_access def new @scm_project= ScmProject.new end def create @scm_project= ScmProject.new(params[:scm_project]) if @scm_project.save redirect_to scm_project_url(@scm_project) else render :action=>:new end end def show @scm_project=ScmProject.find(params[:id]) end private def check_access unless current_user.admin? flash['notice'] = _"You're not allowed to create new scm project. Have your admin give you access." redirect_from_last return false end end end ## Instruction: Set company for new scm_project. ## Code After: class ScmProjectsController < ApplicationController before_filter :check_access def new @scm_project= ScmProject.new end def create @scm_project= ScmProject.new(params[:scm_project]) @scm_project.company= current_user.company if @scm_project.save redirect_to scm_project_url(@scm_project) else render :action=>:new end end def show @scm_project=ScmProject.find(params[:id]) end private def check_access unless current_user.admin? flash['notice'] = _"You're not allowed to create new scm project. Have your admin give you access." redirect_from_last return false end end end
+ class ScmProjectsController < ApplicationController before_filter :check_access def new @scm_project= ScmProject.new end def create @scm_project= ScmProject.new(params[:scm_project]) - + @scm_project.company= current_user.company if @scm_project.save redirect_to scm_project_url(@scm_project) else render :action=>:new end end def show @scm_project=ScmProject.find(params[:id]) end private def check_access unless current_user.admin? flash['notice'] = _"You're not allowed to create new scm project. Have your admin give you access." redirect_from_last return false end end end
3
0.1
2
1
f054dfed3df3eeb2e89163266fe78cafa4edc810
src/lib/Components/Inbox/Bids/index.tsx
src/lib/Components/Inbox/Bids/index.tsx
import * as React from "react" import * as Relay from "react-relay" import styled from "styled-components/native" import { View } from "react-native" import { LargeHeadline } from "../Typography" import ActiveBid from "./ActiveBid" const Container = styled.View`margin: 20px 0 40px;` class ActiveBids extends React.Component<RelayProps, null> { hasContent() { if (!this.props.me) { return false } return this.props.me.lot_standings.length > 0 } renderRows() { const me = this.props.me || { lot_standings: [] } const bids = me.lot_standings.map(bidData => { return <ActiveBid key={bidData.active_bid.__id} bid={bidData} /> }) return bids } render() { return this.hasContent() ? <Container> <LargeHeadline>Active Bids</LargeHeadline> {this.renderRows()} </Container> : null } } export default Relay.createContainer(ActiveBids, { fragments: { me: () => Relay.QL` fragment on Me { lot_standings(active_positions: true) { active_bid { __id } ${ActiveBid.getFragment("bid")} } } `, }, }) interface RelayProps { me: { lot_standings: Array<{ active_bid: { __id: string } | null } | null> | null } }
import * as React from "react" import * as Relay from "react-relay" import styled from "styled-components/native" import { View } from "react-native" import { LargeHeadline } from "../Typography" import ActiveBid from "./ActiveBid" const Container = styled.View`margin: 20px 0 40px;` class ActiveBids extends React.Component<RelayProps, null> { hasContent() { return this.props.me.lot_standings.length > 0 } renderRows() { const bids = this.props.me.lot_standings.map(bidData => { return <ActiveBid key={bidData.active_bid.__id} bid={bidData} /> }) return bids } render() { return this.hasContent() ? <Container> <LargeHeadline>Active Bids</LargeHeadline> {this.renderRows()} </Container> : null } } export default Relay.createContainer(ActiveBids, { fragments: { me: () => Relay.QL` fragment on Me { lot_standings(active_positions: true) { active_bid { __id } ${ActiveBid.getFragment("bid")} } } `, }, }) interface RelayProps { me: { lot_standings: Array<{ active_bid: { __id: string } | null } | null> | null } }
Remove code that deals with staging details.
[Bids] Remove code that deals with staging details. Guards around the user possibly having been removed after the weekly sync.
TypeScript
mit
artsy/eigen,artsy/emission,artsy/eigen,artsy/eigen,artsy/eigen,artsy/eigen,artsy/emission,artsy/emission,artsy/emission,artsy/eigen,artsy/emission,artsy/emission,artsy/emission,artsy/eigen
typescript
## Code Before: import * as React from "react" import * as Relay from "react-relay" import styled from "styled-components/native" import { View } from "react-native" import { LargeHeadline } from "../Typography" import ActiveBid from "./ActiveBid" const Container = styled.View`margin: 20px 0 40px;` class ActiveBids extends React.Component<RelayProps, null> { hasContent() { if (!this.props.me) { return false } return this.props.me.lot_standings.length > 0 } renderRows() { const me = this.props.me || { lot_standings: [] } const bids = me.lot_standings.map(bidData => { return <ActiveBid key={bidData.active_bid.__id} bid={bidData} /> }) return bids } render() { return this.hasContent() ? <Container> <LargeHeadline>Active Bids</LargeHeadline> {this.renderRows()} </Container> : null } } export default Relay.createContainer(ActiveBids, { fragments: { me: () => Relay.QL` fragment on Me { lot_standings(active_positions: true) { active_bid { __id } ${ActiveBid.getFragment("bid")} } } `, }, }) interface RelayProps { me: { lot_standings: Array<{ active_bid: { __id: string } | null } | null> | null } } ## Instruction: [Bids] Remove code that deals with staging details. Guards around the user possibly having been removed after the weekly sync. ## Code After: import * as React from "react" import * as Relay from "react-relay" import styled from "styled-components/native" import { View } from "react-native" import { LargeHeadline } from "../Typography" import ActiveBid from "./ActiveBid" const Container = styled.View`margin: 20px 0 40px;` class ActiveBids extends React.Component<RelayProps, null> { hasContent() { return this.props.me.lot_standings.length > 0 } renderRows() { const bids = this.props.me.lot_standings.map(bidData => { return <ActiveBid key={bidData.active_bid.__id} bid={bidData} /> }) return bids } render() { return this.hasContent() ? <Container> <LargeHeadline>Active Bids</LargeHeadline> {this.renderRows()} </Container> : null } } export default Relay.createContainer(ActiveBids, { fragments: { me: () => Relay.QL` fragment on Me { lot_standings(active_positions: true) { active_bid { __id } ${ActiveBid.getFragment("bid")} } } `, }, }) interface RelayProps { me: { lot_standings: Array<{ active_bid: { __id: string } | null } | null> | null } }
import * as React from "react" import * as Relay from "react-relay" import styled from "styled-components/native" import { View } from "react-native" import { LargeHeadline } from "../Typography" import ActiveBid from "./ActiveBid" const Container = styled.View`margin: 20px 0 40px;` class ActiveBids extends React.Component<RelayProps, null> { hasContent() { - if (!this.props.me) { - return false - } return this.props.me.lot_standings.length > 0 } renderRows() { - const me = this.props.me || { lot_standings: [] } - const bids = me.lot_standings.map(bidData => { + const bids = this.props.me.lot_standings.map(bidData => { ? +++++++++++ return <ActiveBid key={bidData.active_bid.__id} bid={bidData} /> }) return bids } render() { return this.hasContent() ? <Container> <LargeHeadline>Active Bids</LargeHeadline> {this.renderRows()} </Container> : null } } export default Relay.createContainer(ActiveBids, { fragments: { me: () => Relay.QL` fragment on Me { lot_standings(active_positions: true) { active_bid { __id } ${ActiveBid.getFragment("bid")} } } `, }, }) interface RelayProps { me: { lot_standings: Array<{ active_bid: { __id: string } | null } | null> | null } }
6
0.1
1
5
eac323a711796de5e21cfba11f4bfa576e4f00d3
core/src/com/galvarez/ttw/model/components/Diplomacy.java
core/src/com/galvarez/ttw/model/components/Diplomacy.java
package com.galvarez.ttw.model.components; import java.util.EnumSet; import java.util.HashMap; import java.util.Map; import com.artemis.Component; import com.artemis.Entity; import com.galvarez.ttw.model.DiplomaticSystem.Action; import com.galvarez.ttw.model.DiplomaticSystem.State; public final class Diplomacy extends Component { public final Map<Entity, State> relations = new HashMap<>(); public final Map<Entity, Integer> lastChange = new HashMap<>(); public final Map<Entity, Action> proposals = new HashMap<>(); public final EnumSet<State> knownStates = EnumSet.of(State.NONE); public Diplomacy() { } public State getRelationWith(Entity other) { State state = relations.get(other); return state != null ? state : State.NONE; } public Action getProposalTo(Entity other) { Action action = proposals.get(other); return action != null ? action : Action.NO_CHANGE; } }
package com.galvarez.ttw.model.components; import java.util.ArrayList; import java.util.EnumSet; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; import com.artemis.Component; import com.artemis.Entity; import com.galvarez.ttw.model.DiplomaticSystem.Action; import com.galvarez.ttw.model.DiplomaticSystem.State; public final class Diplomacy extends Component { public final Map<Entity, State> relations = new HashMap<>(); public final Map<Entity, Integer> lastChange = new HashMap<>(); public final Map<Entity, Action> proposals = new HashMap<>(); public final EnumSet<State> knownStates = EnumSet.of(State.NONE); public Diplomacy() { } public State getRelationWith(Entity other) { State state = relations.get(other); return state != null ? state : State.NONE; } public Action getProposalTo(Entity other) { Action action = proposals.get(other); return action != null ? action : Action.NO_CHANGE; } /** Get all empires whose state is the one passed as a parameter. */ public List<Entity> getEmpires(State state) { List<Entity> others = new ArrayList<Entity>(); for (Entry<Entity, State> e : relations.entrySet()) { if (e.getValue() == state) others.add(e.getKey()); } return others; } }
Add helper method to get all the empires we have some relation with.
Add helper method to get all the empires we have some relation with.
Java
lgpl-2.1
guillaume-alvarez/ShapeOfThingsThatWere
java
## Code Before: package com.galvarez.ttw.model.components; import java.util.EnumSet; import java.util.HashMap; import java.util.Map; import com.artemis.Component; import com.artemis.Entity; import com.galvarez.ttw.model.DiplomaticSystem.Action; import com.galvarez.ttw.model.DiplomaticSystem.State; public final class Diplomacy extends Component { public final Map<Entity, State> relations = new HashMap<>(); public final Map<Entity, Integer> lastChange = new HashMap<>(); public final Map<Entity, Action> proposals = new HashMap<>(); public final EnumSet<State> knownStates = EnumSet.of(State.NONE); public Diplomacy() { } public State getRelationWith(Entity other) { State state = relations.get(other); return state != null ? state : State.NONE; } public Action getProposalTo(Entity other) { Action action = proposals.get(other); return action != null ? action : Action.NO_CHANGE; } } ## Instruction: Add helper method to get all the empires we have some relation with. ## Code After: package com.galvarez.ttw.model.components; import java.util.ArrayList; import java.util.EnumSet; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; import com.artemis.Component; import com.artemis.Entity; import com.galvarez.ttw.model.DiplomaticSystem.Action; import com.galvarez.ttw.model.DiplomaticSystem.State; public final class Diplomacy extends Component { public final Map<Entity, State> relations = new HashMap<>(); public final Map<Entity, Integer> lastChange = new HashMap<>(); public final Map<Entity, Action> proposals = new HashMap<>(); public final EnumSet<State> knownStates = EnumSet.of(State.NONE); public Diplomacy() { } public State getRelationWith(Entity other) { State state = relations.get(other); return state != null ? state : State.NONE; } public Action getProposalTo(Entity other) { Action action = proposals.get(other); return action != null ? action : Action.NO_CHANGE; } /** Get all empires whose state is the one passed as a parameter. */ public List<Entity> getEmpires(State state) { List<Entity> others = new ArrayList<Entity>(); for (Entry<Entity, State> e : relations.entrySet()) { if (e.getValue() == state) others.add(e.getKey()); } return others; } }
package com.galvarez.ttw.model.components; + import java.util.ArrayList; import java.util.EnumSet; import java.util.HashMap; + import java.util.List; import java.util.Map; + import java.util.Map.Entry; import com.artemis.Component; import com.artemis.Entity; import com.galvarez.ttw.model.DiplomaticSystem.Action; import com.galvarez.ttw.model.DiplomaticSystem.State; public final class Diplomacy extends Component { public final Map<Entity, State> relations = new HashMap<>(); public final Map<Entity, Integer> lastChange = new HashMap<>(); public final Map<Entity, Action> proposals = new HashMap<>(); public final EnumSet<State> knownStates = EnumSet.of(State.NONE); public Diplomacy() { } public State getRelationWith(Entity other) { State state = relations.get(other); return state != null ? state : State.NONE; } public Action getProposalTo(Entity other) { Action action = proposals.get(other); return action != null ? action : Action.NO_CHANGE; } + /** Get all empires whose state is the one passed as a parameter. */ + public List<Entity> getEmpires(State state) { + List<Entity> others = new ArrayList<Entity>(); + for (Entry<Entity, State> e : relations.entrySet()) { + if (e.getValue() == state) + others.add(e.getKey()); + } + return others; + } + }
13
0.371429
13
0
00922099d6abb03a0dbcca19781eb586d367eab0
skimage/measure/__init__.py
skimage/measure/__init__.py
from .find_contours import find_contours from ._regionprops import regionprops from .find_contours import find_contours from ._structural_similarity import ssim
from .find_contours import find_contours from ._regionprops import regionprops from ._structural_similarity import ssim
Remove double import of find contours.
BUG: Remove double import of find contours.
Python
bsd-3-clause
robintw/scikit-image,WarrenWeckesser/scikits-image,ofgulban/scikit-image,ajaybhat/scikit-image,rjeli/scikit-image,SamHames/scikit-image,chintak/scikit-image,ofgulban/scikit-image,SamHames/scikit-image,dpshelio/scikit-image,chintak/scikit-image,rjeli/scikit-image,oew1v07/scikit-image,almarklein/scikit-image,pratapvardhan/scikit-image,bsipocz/scikit-image,ClinicalGraphics/scikit-image,vighneshbirodkar/scikit-image,michaelaye/scikit-image,michaelaye/scikit-image,jwiggins/scikit-image,pratapvardhan/scikit-image,keflavich/scikit-image,chriscrosscutler/scikit-image,Britefury/scikit-image,dpshelio/scikit-image,bennlich/scikit-image,bsipocz/scikit-image,blink1073/scikit-image,GaZ3ll3/scikit-image,paalge/scikit-image,almarklein/scikit-image,Hiyorimi/scikit-image,bennlich/scikit-image,Hiyorimi/scikit-image,emon10005/scikit-image,emmanuelle/scikits.image,vighneshbirodkar/scikit-image,ofgulban/scikit-image,almarklein/scikit-image,warmspringwinds/scikit-image,Midafi/scikit-image,youprofit/scikit-image,chintak/scikit-image,newville/scikit-image,Britefury/scikit-image,almarklein/scikit-image,juliusbierk/scikit-image,jwiggins/scikit-image,chriscrosscutler/scikit-image,michaelpacer/scikit-image,emmanuelle/scikits.image,juliusbierk/scikit-image,SamHames/scikit-image,robintw/scikit-image,chintak/scikit-image,WarrenWeckesser/scikits-image,Midafi/scikit-image,emmanuelle/scikits.image,vighneshbirodkar/scikit-image,newville/scikit-image,blink1073/scikit-image,michaelpacer/scikit-image,emmanuelle/scikits.image,oew1v07/scikit-image,emon10005/scikit-image,youprofit/scikit-image,ajaybhat/scikit-image,paalge/scikit-image,rjeli/scikit-image,warmspringwinds/scikit-image,paalge/scikit-image,keflavich/scikit-image,ClinicalGraphics/scikit-image,GaZ3ll3/scikit-image,SamHames/scikit-image
python
## Code Before: from .find_contours import find_contours from ._regionprops import regionprops from .find_contours import find_contours from ._structural_similarity import ssim ## Instruction: BUG: Remove double import of find contours. ## Code After: from .find_contours import find_contours from ._regionprops import regionprops from ._structural_similarity import ssim
from .find_contours import find_contours from ._regionprops import regionprops - from .find_contours import find_contours from ._structural_similarity import ssim
1
0.25
0
1
6e0269446943f575808742c65564ea496f16925f
build.xml
build.xml
<project name="CloudWorkflowSimulatorDriver" default="compile" basedir="."> <!-- Set properties and paths ============================================================--> <!-- set global properties for this build --> <property name="src" location="src"/> <property name="build" location="bin"/> <property name="test" location="test"/> <property name="testbuild" location="test_bin"/> <property name="script.dir" location="scripts"/> <property name="dist" location="dist"/> <property name="test.data.dir" location="test_results"/> <property name="test.reports.dir" location="${test.data.dir}/reports"/> <!-- Hack to include all jars via links (my java can't resolve links) --> <path id="build.classpath"> <fileset dir="lib" includes="*.jar"/> <fileset dir="lib2" includes="*.jar"/> </path> <!-- Build commands ============================================================--> <target name="init"> <!-- Create the time stamp --> <tstamp/> <!-- Create the build directory structure used by compile --> <mkdir dir="${build}"/> <mkdir dir="${testbuild}"/> <!-- Create directories for test output --> <mkdir dir="${test.data.dir}"/> <mkdir dir="${test.reports.dir}"/> </target> <target name="compile" depends="init" description="compile the source " > <!-- Compile the java code from ${src} into ${build} --> <javac srcdir="${src}" destdir="${build}" classpathref="build.classpath" includeantruntime="false"/> </target> <target name="clean" description="clean up" > <delete dir="${build}"/> </target> </project>
<project name="CloudWorkflowSimulatorDriver" default="compile" basedir="."> <!-- Set properties and paths ============================================================--> <!-- set global properties for this build --> <property name="src" location="src"/> <property name="build" location="bin"/> <property name="test" location="test"/> <property name="testbuild" location="test_bin"/> <property name="script.dir" location="scripts"/> <property name="dist" location="dist"/> <property name="test.data.dir" location="test_results"/> <property name="test.reports.dir" location="${test.data.dir}/reports"/> <!-- Include all jars via links (from cws) --> <path id="build.classpath"> <fileset dir="lib" includes="*.jar"/> </path> <!-- Build commands ============================================================--> <target name="init"> <!-- Create the time stamp --> <tstamp/> <!-- Create the build directory structure used by compile --> <mkdir dir="${build}"/> <mkdir dir="${testbuild}"/> <!-- Create directories for test output --> <mkdir dir="${test.data.dir}"/> <mkdir dir="${test.reports.dir}"/> </target> <target name="compile" depends="init" description="compile the source " > <!-- Compile the java code from ${src} into ${build} --> <javac srcdir="${src}" destdir="${build}" classpathref="build.classpath" includeantruntime="false"/> </target> <target name="clean" description="clean up" > <delete dir="${build}"/> </target> </project>
Remove old hack around links not working in classpath
Remove old hack around links not working in classpath (updated my java version)
XML
apache-2.0
davidshepherd7/cloudworkflowsim-power-cap-experiments,davidshepherd7/cloudworkflowsim-power-cap-experiments,davidshepherd7/cloudworkflowsim-power-cap-experiments
xml
## Code Before: <project name="CloudWorkflowSimulatorDriver" default="compile" basedir="."> <!-- Set properties and paths ============================================================--> <!-- set global properties for this build --> <property name="src" location="src"/> <property name="build" location="bin"/> <property name="test" location="test"/> <property name="testbuild" location="test_bin"/> <property name="script.dir" location="scripts"/> <property name="dist" location="dist"/> <property name="test.data.dir" location="test_results"/> <property name="test.reports.dir" location="${test.data.dir}/reports"/> <!-- Hack to include all jars via links (my java can't resolve links) --> <path id="build.classpath"> <fileset dir="lib" includes="*.jar"/> <fileset dir="lib2" includes="*.jar"/> </path> <!-- Build commands ============================================================--> <target name="init"> <!-- Create the time stamp --> <tstamp/> <!-- Create the build directory structure used by compile --> <mkdir dir="${build}"/> <mkdir dir="${testbuild}"/> <!-- Create directories for test output --> <mkdir dir="${test.data.dir}"/> <mkdir dir="${test.reports.dir}"/> </target> <target name="compile" depends="init" description="compile the source " > <!-- Compile the java code from ${src} into ${build} --> <javac srcdir="${src}" destdir="${build}" classpathref="build.classpath" includeantruntime="false"/> </target> <target name="clean" description="clean up" > <delete dir="${build}"/> </target> </project> ## Instruction: Remove old hack around links not working in classpath (updated my java version) ## Code After: <project name="CloudWorkflowSimulatorDriver" default="compile" basedir="."> <!-- Set properties and paths ============================================================--> <!-- set global properties for this build --> <property name="src" location="src"/> <property name="build" location="bin"/> <property name="test" location="test"/> <property name="testbuild" location="test_bin"/> <property name="script.dir" location="scripts"/> <property name="dist" location="dist"/> <property name="test.data.dir" location="test_results"/> <property name="test.reports.dir" location="${test.data.dir}/reports"/> <!-- Include all jars via links (from cws) --> <path id="build.classpath"> <fileset dir="lib" includes="*.jar"/> </path> <!-- Build commands ============================================================--> <target name="init"> <!-- Create the time stamp --> <tstamp/> <!-- Create the build directory structure used by compile --> <mkdir dir="${build}"/> <mkdir dir="${testbuild}"/> <!-- Create directories for test output --> <mkdir dir="${test.data.dir}"/> <mkdir dir="${test.reports.dir}"/> </target> <target name="compile" depends="init" description="compile the source " > <!-- Compile the java code from ${src} into ${build} --> <javac srcdir="${src}" destdir="${build}" classpathref="build.classpath" includeantruntime="false"/> </target> <target name="clean" description="clean up" > <delete dir="${build}"/> </target> </project>
<project name="CloudWorkflowSimulatorDriver" default="compile" basedir="."> <!-- Set properties and paths ============================================================--> <!-- set global properties for this build --> <property name="src" location="src"/> <property name="build" location="bin"/> <property name="test" location="test"/> <property name="testbuild" location="test_bin"/> <property name="script.dir" location="scripts"/> <property name="dist" location="dist"/> <property name="test.data.dir" location="test_results"/> <property name="test.reports.dir" location="${test.data.dir}/reports"/> - <!-- Hack to include all jars via links (my java can't resolve links) --> + <!-- Include all jars via links (from cws) --> <path id="build.classpath"> <fileset dir="lib" includes="*.jar"/> - <fileset dir="lib2" includes="*.jar"/> </path> <!-- Build commands ============================================================--> <target name="init"> <!-- Create the time stamp --> <tstamp/> <!-- Create the build directory structure used by compile --> <mkdir dir="${build}"/> <mkdir dir="${testbuild}"/> <!-- Create directories for test output --> <mkdir dir="${test.data.dir}"/> <mkdir dir="${test.reports.dir}"/> </target> <target name="compile" depends="init" description="compile the source " > <!-- Compile the java code from ${src} into ${build} --> <javac srcdir="${src}" destdir="${build}" classpathref="build.classpath" includeantruntime="false"/> </target> <target name="clean" description="clean up" > <delete dir="${build}"/> </target> </project>
3
0.057692
1
2
943b08b78f296ae5827fca9f30e7236edb076b09
app/workers/repository_download_worker.rb
app/workers/repository_download_worker.rb
class RepositoryDownloadWorker include Sidekiq::Worker sidekiq_options unique: true def perform(class_name, name) klass = "Repositories::#{class_name}".constantize klass.update(name) end end
class RepositoryDownloadWorker include Sidekiq::Worker sidekiq_options queue: :critical, unique: true def perform(class_name, name) klass = "Repositories::#{class_name}".constantize klass.update(name) end end
Make repo downloads more important
Make repo downloads more important
Ruby
agpl-3.0
abrophy/libraries.io,abrophy/libraries.io,librariesio/libraries.io,librariesio/libraries.io,tomnatt/libraries.io,samjacobclift/libraries.io,samjacobclift/libraries.io,samjacobclift/libraries.io,librariesio/libraries.io,tomnatt/libraries.io,abrophy/libraries.io,tomnatt/libraries.io,librariesio/libraries.io
ruby
## Code Before: class RepositoryDownloadWorker include Sidekiq::Worker sidekiq_options unique: true def perform(class_name, name) klass = "Repositories::#{class_name}".constantize klass.update(name) end end ## Instruction: Make repo downloads more important ## Code After: class RepositoryDownloadWorker include Sidekiq::Worker sidekiq_options queue: :critical, unique: true def perform(class_name, name) klass = "Repositories::#{class_name}".constantize klass.update(name) end end
class RepositoryDownloadWorker include Sidekiq::Worker - sidekiq_options unique: true + sidekiq_options queue: :critical, unique: true ? ++++++++++++++++++ def perform(class_name, name) klass = "Repositories::#{class_name}".constantize klass.update(name) end end
2
0.222222
1
1
b226995e898745a5aaf2085c1134a346d78de835
spec/functional/fc082_spec.rb
spec/functional/fc082_spec.rb
require "spec_helper" describe "FC082" do context "with a cookbook with a recipe that sets an attribute with node.set" do recipe_file "node.set['foo']['bar'] = baz" it { is_expected.to violate_rule } end context "with a cookbook with a recipe that sets an attribute with node.set_unless" do recipe_file "node.set_unless['foo']['bar'] = baz" it { is_expected.to violate_rule } end context "with a cookbook with a recipe that sets an attribute with node.normal" do recipe_file "node.normal['foo']['bar'] = baz" it { is_expected.to_not violate_rule } end end
require "spec_helper" describe "FC082" do context "with a cookbook with a recipe that sets an attribute with node.set" do recipe_file "node.set['foo']['bar'] = baz" it { is_expected.to violate_rule } end context "with a cookbook with a recipe that sets an attribute with node.set_unless" do recipe_file "node.set_unless['foo']['bar'] = baz" it { is_expected.to violate_rule } end context "with a cookbook with a recipe that sets an attribute with node.normal" do recipe_file "node.normal['foo']['bar'] = baz" it { is_expected.to_not violate_rule } end context "with a cookbook with a recipe that reads a value using node.set" do recipe_file "foo = node.set['foo']" it { is_expected.to violate_rule } end end
Expand the test for the read scenario
Expand the test for the read scenario Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
Ruby
mit
Foodcritic/foodcritic,acrmp/foodcritic
ruby
## Code Before: require "spec_helper" describe "FC082" do context "with a cookbook with a recipe that sets an attribute with node.set" do recipe_file "node.set['foo']['bar'] = baz" it { is_expected.to violate_rule } end context "with a cookbook with a recipe that sets an attribute with node.set_unless" do recipe_file "node.set_unless['foo']['bar'] = baz" it { is_expected.to violate_rule } end context "with a cookbook with a recipe that sets an attribute with node.normal" do recipe_file "node.normal['foo']['bar'] = baz" it { is_expected.to_not violate_rule } end end ## Instruction: Expand the test for the read scenario Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io> ## Code After: require "spec_helper" describe "FC082" do context "with a cookbook with a recipe that sets an attribute with node.set" do recipe_file "node.set['foo']['bar'] = baz" it { is_expected.to violate_rule } end context "with a cookbook with a recipe that sets an attribute with node.set_unless" do recipe_file "node.set_unless['foo']['bar'] = baz" it { is_expected.to violate_rule } end context "with a cookbook with a recipe that sets an attribute with node.normal" do recipe_file "node.normal['foo']['bar'] = baz" it { is_expected.to_not violate_rule } end context "with a cookbook with a recipe that reads a value using node.set" do recipe_file "foo = node.set['foo']" it { is_expected.to violate_rule } end end
require "spec_helper" describe "FC082" do context "with a cookbook with a recipe that sets an attribute with node.set" do recipe_file "node.set['foo']['bar'] = baz" it { is_expected.to violate_rule } end context "with a cookbook with a recipe that sets an attribute with node.set_unless" do recipe_file "node.set_unless['foo']['bar'] = baz" it { is_expected.to violate_rule } end context "with a cookbook with a recipe that sets an attribute with node.normal" do recipe_file "node.normal['foo']['bar'] = baz" it { is_expected.to_not violate_rule } end + + context "with a cookbook with a recipe that reads a value using node.set" do + recipe_file "foo = node.set['foo']" + it { is_expected.to violate_rule } + end end
5
0.277778
5
0
8b1910813d8b53e968b07a374b6c6b23d1f46d39
Server/db_config.php
Server/db_config.php
<?php define('DB_USER', "root"); // db user define('DB_PASSWORD', "Cyborg@champ45"); // db password (mention your db password here) define('DB_DATABASE', "medicate"); // database name define('DB_SERVER', "localhost"); // db server ?>
<?php define('DB_USER', "medicate"); // db user define('DB_PASSWORD', "workload@45"); // db password (mention your db password here) define('DB_DATABASE', "medicate"); // database name define('DB_SERVER', "localhost"); // db server ?>
Change User Account on PHPMyAdmin
Change User Account on PHPMyAdmin
PHP
apache-2.0
cyborgnoah/Medicate,cyborgnoah/Medicate,cyborgnoah/Medicate,Nitin135/Medicate,Nitin135/Medicate,Nitin135/Medicate,Nitin135/Medicate,cyborgnoah/Medicate
php
## Code Before: <?php define('DB_USER', "root"); // db user define('DB_PASSWORD', "Cyborg@champ45"); // db password (mention your db password here) define('DB_DATABASE', "medicate"); // database name define('DB_SERVER', "localhost"); // db server ?> ## Instruction: Change User Account on PHPMyAdmin ## Code After: <?php define('DB_USER', "medicate"); // db user define('DB_PASSWORD', "workload@45"); // db password (mention your db password here) define('DB_DATABASE', "medicate"); // database name define('DB_SERVER', "localhost"); // db server ?>
<?php - define('DB_USER', "root"); // db user ? ^^^ + define('DB_USER', "medicate"); // db user ? ^^^^^^ + - define('DB_PASSWORD', "Cyborg@champ45"); // db password (mention your db password here) ? ^^^ ^ ----- + define('DB_PASSWORD', "workload@45"); // db password (mention your db password here) ? ^ ^^^^^ define('DB_DATABASE', "medicate"); // database name define('DB_SERVER', "localhost"); // db server ?>
4
0.666667
2
2
444ff0cb43d915cf0c212a56812e51440cf42172
templates/rustdoc.hbs
templates/rustdoc.hbs
<!DOCTYPE html> <html lang="en"> <head> {{{content.rustdoc_head}}} <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/menus-core.css" type="text/css" media="all" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/menus-horizontal.css" type="text/css" media="all" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/menus-skin.css" type="text/css" media="all" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" type="text/css" media="all" /> <link rel="stylesheet" href="/style.css" type="text/css" media="all" /> </head> <body> {{> navigation}} <div class="rustdoc container"> {{{content.rustdoc_body}}} </div> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> {{{content.rustdoc_head}}} <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/menus-min.css" type="text/css" media="all" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" type="text/css" media="all" /> <link rel="stylesheet" href="/style.css" type="text/css" media="all" /> </head> <body> {{> navigation}} <div class="rustdoc container"> {{{content.rustdoc_body}}} </div> </body> </html>
Use menus-min.css to get all purecss menu bundle
Use menus-min.css to get all purecss menu bundle
Handlebars
mit
onur/cratesfyi
handlebars
## Code Before: <!DOCTYPE html> <html lang="en"> <head> {{{content.rustdoc_head}}} <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/menus-core.css" type="text/css" media="all" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/menus-horizontal.css" type="text/css" media="all" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/menus-skin.css" type="text/css" media="all" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" type="text/css" media="all" /> <link rel="stylesheet" href="/style.css" type="text/css" media="all" /> </head> <body> {{> navigation}} <div class="rustdoc container"> {{{content.rustdoc_body}}} </div> </body> </html> ## Instruction: Use menus-min.css to get all purecss menu bundle ## Code After: <!DOCTYPE html> <html lang="en"> <head> {{{content.rustdoc_head}}} <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/menus-min.css" type="text/css" media="all" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" type="text/css" media="all" /> <link rel="stylesheet" href="/style.css" type="text/css" media="all" /> </head> <body> {{> navigation}} <div class="rustdoc container"> {{{content.rustdoc_body}}} </div> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> {{{content.rustdoc_head}}} - <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/menus-core.css" type="text/css" media="all" /> - <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/menus-horizontal.css" type="text/css" media="all" /> - <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/menus-skin.css" type="text/css" media="all" /> ? ^^ + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/menus-min.css" type="text/css" media="all" /> ? ^ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" type="text/css" media="all" /> <link rel="stylesheet" href="/style.css" type="text/css" media="all" /> </head> <body> {{> navigation}} <div class="rustdoc container"> {{{content.rustdoc_body}}} </div> </body> </html>
4
0.235294
1
3
889f6e08423ac9e2eea19d4912ede6c3da9fbb8c
files/precompute/methods/using-release.sql
files/precompute/methods/using-release.sql
create table :tablename as select distinct xref.upi from xref left join rnc_rna_precomputed pre on pre.upi = xref.upi and pre.taxid = xref.taxid where pre.id is null or xref.last > pre.last_release ; alter table :tablename add constraint fk_to_precompute__upi FOREIGN KEY (upi) REFERENCES rna(upi), add column id bigserial primary key ;
drop table if exists :tablename; create table :tablename as select distinct xref.upi from xref left join rnc_rna_precomputed pre on pre.upi = xref.upi and pre.taxid = xref.taxid where pre.id is null or xref.last > pre.last_release ; alter table :tablename add constraint fk_to_precompute__upi FOREIGN KEY (upi) REFERENCES rna(upi), add column id bigserial primary key ;
Remove temp precompute table before creating
Remove temp precompute table before creating If it exists we should remove it so we don't have duplicate or extra data to compute.
SQL
apache-2.0
RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline,RNAcentral/rnacentral-import-pipeline
sql
## Code Before: create table :tablename as select distinct xref.upi from xref left join rnc_rna_precomputed pre on pre.upi = xref.upi and pre.taxid = xref.taxid where pre.id is null or xref.last > pre.last_release ; alter table :tablename add constraint fk_to_precompute__upi FOREIGN KEY (upi) REFERENCES rna(upi), add column id bigserial primary key ; ## Instruction: Remove temp precompute table before creating If it exists we should remove it so we don't have duplicate or extra data to compute. ## Code After: drop table if exists :tablename; create table :tablename as select distinct xref.upi from xref left join rnc_rna_precomputed pre on pre.upi = xref.upi and pre.taxid = xref.taxid where pre.id is null or xref.last > pre.last_release ; alter table :tablename add constraint fk_to_precompute__upi FOREIGN KEY (upi) REFERENCES rna(upi), add column id bigserial primary key ;
+ drop table if exists :tablename; + create table :tablename as select distinct xref.upi from xref left join rnc_rna_precomputed pre on pre.upi = xref.upi and pre.taxid = xref.taxid where pre.id is null or xref.last > pre.last_release ; alter table :tablename add constraint fk_to_precompute__upi FOREIGN KEY (upi) REFERENCES rna(upi), add column id bigserial primary key ;
2
0.117647
2
0
999c3899b0603c1ffffdc9d1a2347bb4f7f38882
tests/CMakeLists.txt
tests/CMakeLists.txt
set(TESTS TestDns ) foreach(_test ${TESTS}) add_executable(${_test} ${_test}.cpp) set_target_properties(${_test} PROPERTIES CXX_STANDARD 11 ) target_include_directories(${_test} PUBLIC "${CMAKE_CURRENT_BINARY_DIR}") target_link_libraries(${_test} qmdnsengine Qt5::Test) add_test(NAME ${_test} COMMAND ${_test} ) endforeach()
set(TESTS TestDns ) foreach(_test ${TESTS}) add_executable(${_test} ${_test}.cpp) set_target_properties(${_test} PROPERTIES CXX_STANDARD 11 ) target_include_directories(${_test} PUBLIC "${CMAKE_CURRENT_BINARY_DIR}") target_link_libraries(${_test} qmdnsengine Qt5::Test) add_test(NAME ${_test} COMMAND ${_test} ) endforeach() # On Windows, the tests will not run without the DLL located in the current # directory - a target must be used to copy it here once built if(WIN32) add_custom_target(qmdnsengine-copy ALL "${CMAKE_COMMAND}" -E copy_if_different "$<TARGET_FILE:qmdnsengine>" "${CMAKE_CURRENT_BINARY_DIR}" DEPENDS qmdnsengine ) endif()
Copy DLL to current directory for running the tests on Windows.
Copy DLL to current directory for running the tests on Windows.
Text
mit
nitroshare/qmdnsengine,nitroshare/qmdnsengine
text
## Code Before: set(TESTS TestDns ) foreach(_test ${TESTS}) add_executable(${_test} ${_test}.cpp) set_target_properties(${_test} PROPERTIES CXX_STANDARD 11 ) target_include_directories(${_test} PUBLIC "${CMAKE_CURRENT_BINARY_DIR}") target_link_libraries(${_test} qmdnsengine Qt5::Test) add_test(NAME ${_test} COMMAND ${_test} ) endforeach() ## Instruction: Copy DLL to current directory for running the tests on Windows. ## Code After: set(TESTS TestDns ) foreach(_test ${TESTS}) add_executable(${_test} ${_test}.cpp) set_target_properties(${_test} PROPERTIES CXX_STANDARD 11 ) target_include_directories(${_test} PUBLIC "${CMAKE_CURRENT_BINARY_DIR}") target_link_libraries(${_test} qmdnsengine Qt5::Test) add_test(NAME ${_test} COMMAND ${_test} ) endforeach() # On Windows, the tests will not run without the DLL located in the current # directory - a target must be used to copy it here once built if(WIN32) add_custom_target(qmdnsengine-copy ALL "${CMAKE_COMMAND}" -E copy_if_different "$<TARGET_FILE:qmdnsengine>" "${CMAKE_CURRENT_BINARY_DIR}" DEPENDS qmdnsengine ) endif()
set(TESTS TestDns ) foreach(_test ${TESTS}) add_executable(${_test} ${_test}.cpp) set_target_properties(${_test} PROPERTIES CXX_STANDARD 11 ) target_include_directories(${_test} PUBLIC "${CMAKE_CURRENT_BINARY_DIR}") target_link_libraries(${_test} qmdnsengine Qt5::Test) add_test(NAME ${_test} COMMAND ${_test} ) endforeach() + + # On Windows, the tests will not run without the DLL located in the current + # directory - a target must be used to copy it here once built + if(WIN32) + add_custom_target(qmdnsengine-copy ALL + "${CMAKE_COMMAND}" -E copy_if_different "$<TARGET_FILE:qmdnsengine>" "${CMAKE_CURRENT_BINARY_DIR}" + DEPENDS qmdnsengine + ) + endif()
9
0.6
9
0
347325dacf796bc28298fe5fcc73ee84749c023f
client/testutil/driver_compatible.go
client/testutil/driver_compatible.go
package testutil import ( "os/exec" "runtime" "syscall" "testing" ) func ExecCompatible(t *testing.T) { if runtime.GOOS != "windows" && syscall.Geteuid() != 0 { t.Skip("Must be root on non-windows environments to run test") } } func QemuCompatible(t *testing.T) { // Check if qemu exists _, err := exec.Command("qemu-system-x86_64", "-version").CombinedOutput() if err != nil { t.Skip("Must have Qemu installed for Qemu specific tests to run") } } func RktCompatible(t *testing.T) { if runtime.GOOS == "windows" || syscall.Geteuid() != 0 { t.Skip("Must be root on non-windows environments to run test") } // else see if rkt exists _, err := exec.Command("rkt", "version").CombinedOutput() if err != nil { t.Skip("Must have rkt installed for rkt specific tests to run") } } func MountCompatible(t *testing.T) { if runtime.GOOS == "windows" { t.Skip("Windows does not support mount") } if syscall.Geteuid() != 0 { t.Skip("Must be root to run test") } }
package testutil import ( "os/exec" "runtime" "syscall" "testing" ) func ExecCompatible(t *testing.T) { if runtime.GOOS != "windows" && syscall.Geteuid() != 0 { t.Skip("Must be root on non-windows environments to run test") } } func QemuCompatible(t *testing.T) { // Check if qemu exists bin := "qemu-system-x86_64" if runtime.GOOS == "windows" { bin = "qemu-img" } _, err := exec.Command(bin, "--version").CombinedOutput() if err != nil { t.Skip("Must have Qemu installed for Qemu specific tests to run") } } func RktCompatible(t *testing.T) { if runtime.GOOS == "windows" || syscall.Geteuid() != 0 { t.Skip("Must be root on non-windows environments to run test") } // else see if rkt exists _, err := exec.Command("rkt", "version").CombinedOutput() if err != nil { t.Skip("Must have rkt installed for rkt specific tests to run") } } func MountCompatible(t *testing.T) { if runtime.GOOS == "windows" { t.Skip("Windows does not support mount") } if syscall.Geteuid() != 0 { t.Skip("Must be root to run test") } }
Use same binary as Fingerprint in the QemuCompatible function
Use same binary as Fingerprint in the QemuCompatible function
Go
mpl-2.0
nak3/nomad,dvusboy/nomad,barnardb/nomad,barnardb/nomad,carlosdp/nomad,mattyr/nomad,dvusboy/nomad,kmalec/nomad,achanda/nomad,martin416/nomad,hashicorp/nomad,xytis/nomad,burdandrei/nomad,savaki/nomad,frundh/nomad,ranjib/nomad,kmalec/nomad,xytis/nomad,achanda/nomad,carlosdp/nomad,diptanu/nomad,achanda/nomad,xytis/nomad,nak3/nomad,martin416/nomad,ranjib/nomad,jorgemarey/nomad,iverberk/nomad,novilabs/nomad,ranjib/nomad,iverberk/nomad,dbresson/nomad,frundh/nomad,Ashald/nomad,iverberk/nomad,jorgemarey/nomad,dvusboy/nomad,carlosdp/nomad,martin416/nomad,nak3/nomad,diptanu/nomad,Ashald/nomad,jorgemarey/nomad,burdandrei/nomad,Ashald/nomad,frundh/nomad,dbresson/nomad,frundh/nomad,hooklift/nomad,Ashald/nomad,jorgemarey/nomad,kmalec/nomad,burdandrei/nomad,iverberk/nomad,savaki/nomad,dvusboy/nomad,carlosdp/nomad,savaki/nomad,nak3/nomad,kmalec/nomad,savaki/nomad,dbresson/nomad,nak3/nomad,hooklift/nomad,hooklift/nomad,hashicorp/nomad,mattyr/nomad,achanda/nomad,jorgemarey/nomad,mattyr/nomad,barnardb/nomad,carlosdp/nomad,novilabs/nomad,diptanu/nomad,xytis/nomad,nak3/nomad,barnardb/nomad,savaki/nomad,frundh/nomad,burdandrei/nomad,diptanu/nomad,dbresson/nomad,iverberk/nomad,dvusboy/nomad,diptanu/nomad,hooklift/nomad,barnardb/nomad,mattyr/nomad,dbresson/nomad,burdandrei/nomad,achanda/nomad,achanda/nomad,xytis/nomad,diptanu/nomad,xytis/nomad,martin416/nomad,jorgemarey/nomad,frundh/nomad,iverberk/nomad,savaki/nomad,burdandrei/nomad,hashicorp/nomad,jorgemarey/nomad,frundh/nomad,Ashald/nomad,novilabs/nomad,hooklift/nomad,dbresson/nomad,kmalec/nomad,martin416/nomad,achanda/nomad,novilabs/nomad,barnardb/nomad,xytis/nomad,ranjib/nomad,barnardb/nomad,Ashald/nomad,ranjib/nomad,burdandrei/nomad,mattyr/nomad,mattyr/nomad,hashicorp/nomad,martin416/nomad,savaki/nomad,carlosdp/nomad,diptanu/nomad,iverberk/nomad,martin416/nomad,Ashald/nomad,nak3/nomad,novilabs/nomad,hooklift/nomad,carlosdp/nomad,dvusboy/nomad,novilabs/nomad,ranjib/nomad,mattyr/nomad,novilabs/nomad,kmalec/nomad,kmalec/nomad,dbresson/nomad,hashicorp/nomad,ranjib/nomad,dvusboy/nomad,hooklift/nomad,hashicorp/nomad
go
## Code Before: package testutil import ( "os/exec" "runtime" "syscall" "testing" ) func ExecCompatible(t *testing.T) { if runtime.GOOS != "windows" && syscall.Geteuid() != 0 { t.Skip("Must be root on non-windows environments to run test") } } func QemuCompatible(t *testing.T) { // Check if qemu exists _, err := exec.Command("qemu-system-x86_64", "-version").CombinedOutput() if err != nil { t.Skip("Must have Qemu installed for Qemu specific tests to run") } } func RktCompatible(t *testing.T) { if runtime.GOOS == "windows" || syscall.Geteuid() != 0 { t.Skip("Must be root on non-windows environments to run test") } // else see if rkt exists _, err := exec.Command("rkt", "version").CombinedOutput() if err != nil { t.Skip("Must have rkt installed for rkt specific tests to run") } } func MountCompatible(t *testing.T) { if runtime.GOOS == "windows" { t.Skip("Windows does not support mount") } if syscall.Geteuid() != 0 { t.Skip("Must be root to run test") } } ## Instruction: Use same binary as Fingerprint in the QemuCompatible function ## Code After: package testutil import ( "os/exec" "runtime" "syscall" "testing" ) func ExecCompatible(t *testing.T) { if runtime.GOOS != "windows" && syscall.Geteuid() != 0 { t.Skip("Must be root on non-windows environments to run test") } } func QemuCompatible(t *testing.T) { // Check if qemu exists bin := "qemu-system-x86_64" if runtime.GOOS == "windows" { bin = "qemu-img" } _, err := exec.Command(bin, "--version").CombinedOutput() if err != nil { t.Skip("Must have Qemu installed for Qemu specific tests to run") } } func RktCompatible(t *testing.T) { if runtime.GOOS == "windows" || syscall.Geteuid() != 0 { t.Skip("Must be root on non-windows environments to run test") } // else see if rkt exists _, err := exec.Command("rkt", "version").CombinedOutput() if err != nil { t.Skip("Must have rkt installed for rkt specific tests to run") } } func MountCompatible(t *testing.T) { if runtime.GOOS == "windows" { t.Skip("Windows does not support mount") } if syscall.Geteuid() != 0 { t.Skip("Must be root to run test") } }
package testutil import ( "os/exec" "runtime" "syscall" "testing" ) func ExecCompatible(t *testing.T) { if runtime.GOOS != "windows" && syscall.Geteuid() != 0 { t.Skip("Must be root on non-windows environments to run test") } } func QemuCompatible(t *testing.T) { // Check if qemu exists + bin := "qemu-system-x86_64" + if runtime.GOOS == "windows" { + bin = "qemu-img" + } - _, err := exec.Command("qemu-system-x86_64", "-version").CombinedOutput() ? ^^^^^^^^^^^^^^^^^^^^ + _, err := exec.Command(bin, "--version").CombinedOutput() ? ^^^ + if err != nil { t.Skip("Must have Qemu installed for Qemu specific tests to run") } } func RktCompatible(t *testing.T) { if runtime.GOOS == "windows" || syscall.Geteuid() != 0 { t.Skip("Must be root on non-windows environments to run test") } // else see if rkt exists _, err := exec.Command("rkt", "version").CombinedOutput() if err != nil { t.Skip("Must have rkt installed for rkt specific tests to run") } } func MountCompatible(t *testing.T) { if runtime.GOOS == "windows" { t.Skip("Windows does not support mount") } if syscall.Geteuid() != 0 { t.Skip("Must be root to run test") } }
6
0.139535
5
1
c8c9d34c76811176d6c719527a69ec456005c0d2
app/index.js
app/index.js
const canvas = document.getElementById('pong'); console.log('canvas', canvas);
const canvas = document.getElementById('pong'); const context = canvas.getContext('2d'); const COLORS = { BACKGROUND: '#000', PROPS: '#FFF', }; context.fillStyle = COLORS.BACKGROUND; context.fillRect(0, 0, canvas.width, canvas.height); const Player = function() {}; Player.prototype.draw = function(positionX, positionY) { context.beginPath(); context.rect(positionX, positionY, 10, 20); context.fillStyle = COLORS.PROPS; context.fill(); } const playerOne = new Player(); const playerTwo = new Player(); playerOne.draw(5, 50); playerTwo.draw(285, 50);
Add basic drawing functionality to test canvas is functional and behaving correctly
Add basic drawing functionality to test canvas is functional and behaving correctly
JavaScript
mit
oliverbenns/pong,oliverbenns/pong
javascript
## Code Before: const canvas = document.getElementById('pong'); console.log('canvas', canvas); ## Instruction: Add basic drawing functionality to test canvas is functional and behaving correctly ## Code After: const canvas = document.getElementById('pong'); const context = canvas.getContext('2d'); const COLORS = { BACKGROUND: '#000', PROPS: '#FFF', }; context.fillStyle = COLORS.BACKGROUND; context.fillRect(0, 0, canvas.width, canvas.height); const Player = function() {}; Player.prototype.draw = function(positionX, positionY) { context.beginPath(); context.rect(positionX, positionY, 10, 20); context.fillStyle = COLORS.PROPS; context.fill(); } const playerOne = new Player(); const playerTwo = new Player(); playerOne.draw(5, 50); playerTwo.draw(285, 50);
const canvas = document.getElementById('pong'); + const context = canvas.getContext('2d'); - console.log('canvas', canvas); + const COLORS = { + BACKGROUND: '#000', + PROPS: '#FFF', + }; + context.fillStyle = COLORS.BACKGROUND; + context.fillRect(0, 0, canvas.width, canvas.height); + + const Player = function() {}; + + Player.prototype.draw = function(positionX, positionY) { + context.beginPath(); + context.rect(positionX, positionY, 10, 20); + context.fillStyle = COLORS.PROPS; + context.fill(); + } + + const playerOne = new Player(); + const playerTwo = new Player(); + + playerOne.draw(5, 50); + playerTwo.draw(285, 50);
23
5.75
22
1
8b34294c9731ef56e787e4485a52f958d6655243
ts/types/MIME.ts
ts/types/MIME.ts
export type MIMEType = string & { _mimeTypeBrand: any }; export const APPLICATION_OCTET_STREAM = 'application/octet-stream' as MIMEType; export const APPLICATION_JSON = 'application/json' as MIMEType; export const AUDIO_AAC = 'audio/aac' as MIMEType; export const AUDIO_MP3 = 'audio/mp3' as MIMEType; export const IMAGE_GIF = 'image/gif' as MIMEType; export const IMAGE_JPEG = 'image/jpeg' as MIMEType; export const IMAGE_PNG = 'image/png' as MIMEType; export const IMAGE_WEBP = 'image/webp' as MIMEType; export const IMAGE_PNG = 'image/png' as MIMEType; export const VIDEO_MP4 = 'video/mp4' as MIMEType; export const VIDEO_QUICKTIME = 'video/quicktime' as MIMEType; export const LONG_MESSAGE = 'text/x-signal-plain' as MIMEType; export const isJPEG = (value: MIMEType): boolean => value === 'image/jpeg'; export const isImage = (value: MIMEType): boolean => value && value.startsWith('image/'); export const isVideo = (value: MIMEType): boolean => value && value.startsWith('video/'); // As of 2020-04-16 aif files do not play in Electron nor Chrome. We should only // recognize them as file attachments. export const isAudio = (value: MIMEType): boolean => value && value.startsWith('audio/') && !value.endsWith('aiff');
export type MIMEType = string & { _mimeTypeBrand: any }; export const APPLICATION_OCTET_STREAM = 'application/octet-stream' as MIMEType; export const APPLICATION_JSON = 'application/json' as MIMEType; export const AUDIO_AAC = 'audio/aac' as MIMEType; export const AUDIO_MP3 = 'audio/mp3' as MIMEType; export const IMAGE_GIF = 'image/gif' as MIMEType; export const IMAGE_JPEG = 'image/jpeg' as MIMEType; export const IMAGE_PNG = 'image/png' as MIMEType; export const IMAGE_WEBP = 'image/webp' as MIMEType; export const VIDEO_MP4 = 'video/mp4' as MIMEType; export const VIDEO_QUICKTIME = 'video/quicktime' as MIMEType; export const LONG_MESSAGE = 'text/x-signal-plain' as MIMEType; export const isJPEG = (value: MIMEType): boolean => value === 'image/jpeg'; export const isImage = (value: MIMEType): boolean => value && value.startsWith('image/'); export const isVideo = (value: MIMEType): boolean => value && value.startsWith('video/'); // As of 2020-04-16 aif files do not play in Electron nor Chrome. We should only // recognize them as file attachments. export const isAudio = (value: MIMEType): boolean => value && value.startsWith('audio/') && !value.endsWith('aiff');
Fix merge conflict in Mime.ts
Fix merge conflict in Mime.ts
TypeScript
agpl-3.0
nrizzio/Signal-Desktop,nrizzio/Signal-Desktop,nrizzio/Signal-Desktop,nrizzio/Signal-Desktop
typescript
## Code Before: export type MIMEType = string & { _mimeTypeBrand: any }; export const APPLICATION_OCTET_STREAM = 'application/octet-stream' as MIMEType; export const APPLICATION_JSON = 'application/json' as MIMEType; export const AUDIO_AAC = 'audio/aac' as MIMEType; export const AUDIO_MP3 = 'audio/mp3' as MIMEType; export const IMAGE_GIF = 'image/gif' as MIMEType; export const IMAGE_JPEG = 'image/jpeg' as MIMEType; export const IMAGE_PNG = 'image/png' as MIMEType; export const IMAGE_WEBP = 'image/webp' as MIMEType; export const IMAGE_PNG = 'image/png' as MIMEType; export const VIDEO_MP4 = 'video/mp4' as MIMEType; export const VIDEO_QUICKTIME = 'video/quicktime' as MIMEType; export const LONG_MESSAGE = 'text/x-signal-plain' as MIMEType; export const isJPEG = (value: MIMEType): boolean => value === 'image/jpeg'; export const isImage = (value: MIMEType): boolean => value && value.startsWith('image/'); export const isVideo = (value: MIMEType): boolean => value && value.startsWith('video/'); // As of 2020-04-16 aif files do not play in Electron nor Chrome. We should only // recognize them as file attachments. export const isAudio = (value: MIMEType): boolean => value && value.startsWith('audio/') && !value.endsWith('aiff'); ## Instruction: Fix merge conflict in Mime.ts ## Code After: export type MIMEType = string & { _mimeTypeBrand: any }; export const APPLICATION_OCTET_STREAM = 'application/octet-stream' as MIMEType; export const APPLICATION_JSON = 'application/json' as MIMEType; export const AUDIO_AAC = 'audio/aac' as MIMEType; export const AUDIO_MP3 = 'audio/mp3' as MIMEType; export const IMAGE_GIF = 'image/gif' as MIMEType; export const IMAGE_JPEG = 'image/jpeg' as MIMEType; export const IMAGE_PNG = 'image/png' as MIMEType; export const IMAGE_WEBP = 'image/webp' as MIMEType; export const VIDEO_MP4 = 'video/mp4' as MIMEType; export const VIDEO_QUICKTIME = 'video/quicktime' as MIMEType; export const LONG_MESSAGE = 'text/x-signal-plain' as MIMEType; export const isJPEG = (value: MIMEType): boolean => value === 'image/jpeg'; export const isImage = (value: MIMEType): boolean => value && value.startsWith('image/'); export const isVideo = (value: MIMEType): boolean => value && value.startsWith('video/'); // As of 2020-04-16 aif files do not play in Electron nor Chrome. We should only // recognize them as file attachments. export const isAudio = (value: MIMEType): boolean => value && value.startsWith('audio/') && !value.endsWith('aiff');
export type MIMEType = string & { _mimeTypeBrand: any }; export const APPLICATION_OCTET_STREAM = 'application/octet-stream' as MIMEType; export const APPLICATION_JSON = 'application/json' as MIMEType; export const AUDIO_AAC = 'audio/aac' as MIMEType; export const AUDIO_MP3 = 'audio/mp3' as MIMEType; export const IMAGE_GIF = 'image/gif' as MIMEType; export const IMAGE_JPEG = 'image/jpeg' as MIMEType; export const IMAGE_PNG = 'image/png' as MIMEType; export const IMAGE_WEBP = 'image/webp' as MIMEType; - export const IMAGE_PNG = 'image/png' as MIMEType; export const VIDEO_MP4 = 'video/mp4' as MIMEType; export const VIDEO_QUICKTIME = 'video/quicktime' as MIMEType; export const LONG_MESSAGE = 'text/x-signal-plain' as MIMEType; export const isJPEG = (value: MIMEType): boolean => value === 'image/jpeg'; export const isImage = (value: MIMEType): boolean => value && value.startsWith('image/'); export const isVideo = (value: MIMEType): boolean => value && value.startsWith('video/'); // As of 2020-04-16 aif files do not play in Electron nor Chrome. We should only // recognize them as file attachments. export const isAudio = (value: MIMEType): boolean => value && value.startsWith('audio/') && !value.endsWith('aiff');
1
0.041667
0
1
e5207179fb6ff16a1577adcc0c49fd0e01666a87
stylesheets/git-plus.less
stylesheets/git-plus.less
// The ui-variables file is provided by base themes provided by Atom. // // See https://github.com/atom/atom-dark-ui/blob/master/stylesheets/ui-variables.less // for a full listing of what's available. @import "ui-variables"; .git-plus { .alert { color: @text-color-warning; } .success { color: @text-color-success; } .atom-panel.modal.from-bottom { width: 600px; } .info-view { overflow: auto; } } .meta.diff.range.unified { color: @text-color-info; } .meta.diff.header { color: @text-color-info; } .markup.deleted.diff { color: @text-color-error; } .markup.inserted.diff { color: @text-color-success; }
// The ui-variables file is provided by base themes provided by Atom. // // See https://github.com/atom/atom-dark-ui/blob/master/stylesheets/ui-variables.less // for a full listing of what's available. @import "ui-variables"; .git-plus { .alert { color: @text-color-warning; } .success { color: @text-color-success; } .atom-panel.modal.from-bottom { width: 600px; } .info-view { overflow: auto; } } atom-text-editor, atom-text-editor::shadow { .meta.diff.range.unified { color: @text-color-info; } .meta.diff.header { color: @text-color-info; } .markup.deleted.diff { color: @text-color-error; } .markup.inserted.diff { color: @text-color-success; } }
Update styles to work with shadow DOM
Update styles to work with shadow DOM
Less
mit
akonwi/git-plus,akonwi/git-plus
less
## Code Before: // The ui-variables file is provided by base themes provided by Atom. // // See https://github.com/atom/atom-dark-ui/blob/master/stylesheets/ui-variables.less // for a full listing of what's available. @import "ui-variables"; .git-plus { .alert { color: @text-color-warning; } .success { color: @text-color-success; } .atom-panel.modal.from-bottom { width: 600px; } .info-view { overflow: auto; } } .meta.diff.range.unified { color: @text-color-info; } .meta.diff.header { color: @text-color-info; } .markup.deleted.diff { color: @text-color-error; } .markup.inserted.diff { color: @text-color-success; } ## Instruction: Update styles to work with shadow DOM ## Code After: // The ui-variables file is provided by base themes provided by Atom. // // See https://github.com/atom/atom-dark-ui/blob/master/stylesheets/ui-variables.less // for a full listing of what's available. @import "ui-variables"; .git-plus { .alert { color: @text-color-warning; } .success { color: @text-color-success; } .atom-panel.modal.from-bottom { width: 600px; } .info-view { overflow: auto; } } atom-text-editor, atom-text-editor::shadow { .meta.diff.range.unified { color: @text-color-info; } .meta.diff.header { color: @text-color-info; } .markup.deleted.diff { color: @text-color-error; } .markup.inserted.diff { color: @text-color-success; } }
// The ui-variables file is provided by base themes provided by Atom. // // See https://github.com/atom/atom-dark-ui/blob/master/stylesheets/ui-variables.less // for a full listing of what's available. @import "ui-variables"; .git-plus { .alert { color: @text-color-warning; } .success { color: @text-color-success; } .atom-panel.modal.from-bottom { width: 600px; } .info-view { overflow: auto; } } + atom-text-editor, + atom-text-editor::shadow { - .meta.diff.range.unified { + .meta.diff.range.unified { ? ++ - color: @text-color-info; + color: @text-color-info; ? ++ + } + + .meta.diff.header { + color: @text-color-info; + } + + .markup.deleted.diff { + color: @text-color-error; + } + + .markup.inserted.diff { + color: @text-color-success; + } } - - .meta.diff.header { - color: @text-color-info; - } - - .markup.deleted.diff { - color: @text-color-error; - } - - .markup.inserted.diff { - color: @text-color-success; - }
31
0.794872
17
14
091f2331e1a09130ae468e9a00461dbd0a7190e2
_setup/uwsgi_app.ini
_setup/uwsgi_app.ini
[uwsgi] # channel http = :8000 socket = socket # app wsgi-file = /path/to/wsgi-app module = django-app.wsgi daemonize = /var/log/uwsgi/app.log master = true processes = 2 max-requests = 5000 # clear environment on exit vacuum = true
[uwsgi] # channel http = :8000 socket = socket # app wsgi-file = /path/to/wsgi-app module = django-app.wsgi daemonize = /var/log/uwsgi/app.log master = true processes = 2 max-requests = 5000 enable-threads = true # clear environment on exit vacuum = true
Add enable-threads option for uwsgi ini
Add enable-threads option for uwsgi ini
INI
apache-2.0
leven-cn/admin-linux,leven-cn/admin-linux
ini
## Code Before: [uwsgi] # channel http = :8000 socket = socket # app wsgi-file = /path/to/wsgi-app module = django-app.wsgi daemonize = /var/log/uwsgi/app.log master = true processes = 2 max-requests = 5000 # clear environment on exit vacuum = true ## Instruction: Add enable-threads option for uwsgi ini ## Code After: [uwsgi] # channel http = :8000 socket = socket # app wsgi-file = /path/to/wsgi-app module = django-app.wsgi daemonize = /var/log/uwsgi/app.log master = true processes = 2 max-requests = 5000 enable-threads = true # clear environment on exit vacuum = true
[uwsgi] # channel http = :8000 socket = socket # app wsgi-file = /path/to/wsgi-app module = django-app.wsgi daemonize = /var/log/uwsgi/app.log master = true processes = 2 max-requests = 5000 + enable-threads = true # clear environment on exit vacuum = true
1
0.0625
1
0
3d05590530f5ef5e40d25e4c81e2b60e3ccef132
app/models/course.rb
app/models/course.rb
class Course < ActiveRecord::Base attr_accessible :description, :logo, :title acts_as_list :scope => :club validates :title, :presence => { :message => "for course can't be blank" } validates :description, :presence => { :message => "for course can't be blank" } validates :club_id, :presence => true belongs_to :club has_many :lessons, :dependent => :destroy def user club.user end def assign_defaults self.title = Settings.courses[:default_title] self.description = Settings.courses[:default_description] self.logo = Settings.courses[:default_logo] end end
class Course < ActiveRecord::Base attr_accessible :description, :logo, :title acts_as_list :scope => :club validates :title, :presence => { :message => "for course can't be blank" } validates :description, :presence => { :message => "for course can't be blank" } validates :club_id, :presence => true belongs_to :club has_many :lessons, :dependent => :destroy validates :title, :presence => { :message => "for course can't be blank" } validates :description, :presence => { :message => "for course can't be blank" } validates :club_id, :presence => true def user club.user end def assign_defaults self.title = Settings.courses[:default_title] self.description = Settings.courses[:default_description] self.logo = Settings.courses[:default_logo] end end
Reorganize Code for Course Model
Reorganize Code for Course Model Update the Course model code to ensure consistency in ordering of associations/validations with other models' code.
Ruby
mit
jekhokie/IfSimply,jekhokie/IfSimply,jekhokie/IfSimply
ruby
## Code Before: class Course < ActiveRecord::Base attr_accessible :description, :logo, :title acts_as_list :scope => :club validates :title, :presence => { :message => "for course can't be blank" } validates :description, :presence => { :message => "for course can't be blank" } validates :club_id, :presence => true belongs_to :club has_many :lessons, :dependent => :destroy def user club.user end def assign_defaults self.title = Settings.courses[:default_title] self.description = Settings.courses[:default_description] self.logo = Settings.courses[:default_logo] end end ## Instruction: Reorganize Code for Course Model Update the Course model code to ensure consistency in ordering of associations/validations with other models' code. ## Code After: class Course < ActiveRecord::Base attr_accessible :description, :logo, :title acts_as_list :scope => :club validates :title, :presence => { :message => "for course can't be blank" } validates :description, :presence => { :message => "for course can't be blank" } validates :club_id, :presence => true belongs_to :club has_many :lessons, :dependent => :destroy validates :title, :presence => { :message => "for course can't be blank" } validates :description, :presence => { :message => "for course can't be blank" } validates :club_id, :presence => true def user club.user end def assign_defaults self.title = Settings.courses[:default_title] self.description = Settings.courses[:default_description] self.logo = Settings.courses[:default_logo] end end
class Course < ActiveRecord::Base attr_accessible :description, :logo, :title acts_as_list :scope => :club validates :title, :presence => { :message => "for course can't be blank" } validates :description, :presence => { :message => "for course can't be blank" } validates :club_id, :presence => true belongs_to :club has_many :lessons, :dependent => :destroy + validates :title, :presence => { :message => "for course can't be blank" } + validates :description, :presence => { :message => "for course can't be blank" } + validates :club_id, :presence => true + def user club.user end def assign_defaults self.title = Settings.courses[:default_title] self.description = Settings.courses[:default_description] self.logo = Settings.courses[:default_logo] end end
4
0.173913
4
0
80c5900d88a9d2dfdc112c860f6c4dd7e81261bd
src/client/contest.js
src/client/contest.js
var CJS = require("../backend/contest_judging_sys.js"); let fbAuth = CJS.fetchFirebaseAuth(); var createEntryHolder = function(entryData) { return $("<h5>").addClass("center").text(entryData.name); }; var setupPage = function() { if (fbAuth === null) { $("#authBtn").text("Hello, guest! Click me to login."); } else { $("#authBtn").text(`Welcome, ${CJS.fetchFirebaseAuth().google.displayName}! (Not you? Click here)`); } CJS.loadXContestEntries("4688911017312256", function(response) { for (let entryId in response) { let thisEntry = response[entryId]; $("#entries").append(createEntryHolder(thisEntry)).append($("<div>").addClass("divider")); } }, 30); }; setupPage(); $("#authBtn").on("click", function(evt) { evt.preventDefault(); if (fbAuth === null) { CJS.authenticate(); } else { CJS.authenticate(true); } });
var CJS = require("../backend/contest_judging_sys.js"); let fbAuth = CJS.fetchFirebaseAuth(); var createEntryHolder = function(entryData) { return $("<h5>").addClass("center").text(entryData.name); }; var setupPage = function() { CJS.loadXContestEntries("4688911017312256", function(response) { for (let entryId in response) { let thisEntry = response[entryId]; $("#entries").append(createEntryHolder(thisEntry)).append($("<div>").addClass("divider")); } }, 30); }; if (fbAuth === null) { CJS.authenticate(); } else { if (fbAuth === null) { $("#authBtn").text("Hello, guest! Click me to login."); } else { $("#authBtn").text(`Welcome, ${CJS.fetchFirebaseAuth().google.displayName}! (Not you? Click here)`); } setupPage(); } $("#authBtn").on("click", function(evt) { evt.preventDefault(); if (fbAuth === null) { CJS.authenticate(); } else { CJS.authenticate(true); } });
Revert auth change made by @JavascriptFTW
Revert auth change made by @JavascriptFTW
JavaScript
mit
Team-Delta-KA/KA-Contest-Judging-System,sparkstudios/KA-Contest-Judging-System,Team-Delta-KA/KA-Contest-Judging-System,sparkstudios/Contest-Judging-System-for-KA,JavascriptFTW/KA-Contest-Judging-System,Noble-Mushtak/KA-Contest-Judging-System,Noble-Mushtak/KA-Contest-Judging-System,sparkstudios/KA-Contest-Judging-System,JavascriptFTW/KA-Contest-Judging-System,sparkstudios/Contest-Judging-System-for-KA
javascript
## Code Before: var CJS = require("../backend/contest_judging_sys.js"); let fbAuth = CJS.fetchFirebaseAuth(); var createEntryHolder = function(entryData) { return $("<h5>").addClass("center").text(entryData.name); }; var setupPage = function() { if (fbAuth === null) { $("#authBtn").text("Hello, guest! Click me to login."); } else { $("#authBtn").text(`Welcome, ${CJS.fetchFirebaseAuth().google.displayName}! (Not you? Click here)`); } CJS.loadXContestEntries("4688911017312256", function(response) { for (let entryId in response) { let thisEntry = response[entryId]; $("#entries").append(createEntryHolder(thisEntry)).append($("<div>").addClass("divider")); } }, 30); }; setupPage(); $("#authBtn").on("click", function(evt) { evt.preventDefault(); if (fbAuth === null) { CJS.authenticate(); } else { CJS.authenticate(true); } }); ## Instruction: Revert auth change made by @JavascriptFTW ## Code After: var CJS = require("../backend/contest_judging_sys.js"); let fbAuth = CJS.fetchFirebaseAuth(); var createEntryHolder = function(entryData) { return $("<h5>").addClass("center").text(entryData.name); }; var setupPage = function() { CJS.loadXContestEntries("4688911017312256", function(response) { for (let entryId in response) { let thisEntry = response[entryId]; $("#entries").append(createEntryHolder(thisEntry)).append($("<div>").addClass("divider")); } }, 30); }; if (fbAuth === null) { CJS.authenticate(); } else { if (fbAuth === null) { $("#authBtn").text("Hello, guest! Click me to login."); } else { $("#authBtn").text(`Welcome, ${CJS.fetchFirebaseAuth().google.displayName}! (Not you? Click here)`); } setupPage(); } $("#authBtn").on("click", function(evt) { evt.preventDefault(); if (fbAuth === null) { CJS.authenticate(); } else { CJS.authenticate(true); } });
var CJS = require("../backend/contest_judging_sys.js"); let fbAuth = CJS.fetchFirebaseAuth(); var createEntryHolder = function(entryData) { return $("<h5>").addClass("center").text(entryData.name); }; var setupPage = function() { - if (fbAuth === null) { - $("#authBtn").text("Hello, guest! Click me to login."); - } else { - $("#authBtn").text(`Welcome, ${CJS.fetchFirebaseAuth().google.displayName}! (Not you? Click here)`); - } CJS.loadXContestEntries("4688911017312256", function(response) { for (let entryId in response) { let thisEntry = response[entryId]; $("#entries").append(createEntryHolder(thisEntry)).append($("<div>").addClass("divider")); } }, 30); }; + if (fbAuth === null) { + CJS.authenticate(); + } else { + if (fbAuth === null) { + $("#authBtn").text("Hello, guest! Click me to login."); + } else { + $("#authBtn").text(`Welcome, ${CJS.fetchFirebaseAuth().google.displayName}! (Not you? Click here)`); + } + - setupPage(); + setupPage(); ? ++++ + } $("#authBtn").on("click", function(evt) { evt.preventDefault(); if (fbAuth === null) { CJS.authenticate(); } else { CJS.authenticate(true); } });
17
0.5
11
6
00768787511b0e1c4d0da264fdaafc30d820563f
.travis.yml
.travis.yml
language: ruby rvm: - 2.2.2 - 2.3 - 2.4 - 2.5 - 2.6 before_install: gem install bundler -v 1.11.2 addons: code_climate: repo_token: 0b8e41ecbc26637a7db4e6e9d4581c445441674f689016ab45fb5c51242b59bf after_success: - bundle exec codeclimate-test-reporter
language: ruby rvm: - 2.4 - 2.5 - 2.6 before_install: gem install bundler -v 1.11.2 addons: code_climate: repo_token: 0b8e41ecbc26637a7db4e6e9d4581c445441674f689016ab45fb5c51242b59bf after_success: - bundle exec codeclimate-test-reporter
Support ruby 2.4 and up
Support ruby 2.4 and up
YAML
mit
maartenvanvliet/moneybird,maartenvanvliet/moneybird
yaml
## Code Before: language: ruby rvm: - 2.2.2 - 2.3 - 2.4 - 2.5 - 2.6 before_install: gem install bundler -v 1.11.2 addons: code_climate: repo_token: 0b8e41ecbc26637a7db4e6e9d4581c445441674f689016ab45fb5c51242b59bf after_success: - bundle exec codeclimate-test-reporter ## Instruction: Support ruby 2.4 and up ## Code After: language: ruby rvm: - 2.4 - 2.5 - 2.6 before_install: gem install bundler -v 1.11.2 addons: code_climate: repo_token: 0b8e41ecbc26637a7db4e6e9d4581c445441674f689016ab45fb5c51242b59bf after_success: - bundle exec codeclimate-test-reporter
language: ruby rvm: - - 2.2.2 - - 2.3 - 2.4 - 2.5 - 2.6 before_install: gem install bundler -v 1.11.2 addons: code_climate: repo_token: 0b8e41ecbc26637a7db4e6e9d4581c445441674f689016ab45fb5c51242b59bf after_success: - bundle exec codeclimate-test-reporter
2
0.133333
0
2
c552330254944a9fcf63e0e34f3ea6bffddbc4ee
app/assets/stylesheets/index_featured_three.scss
app/assets/stylesheets/index_featured_three.scss
.row.three .span1 { figure.featured { position: relative; @include rem-fallback(margin-bottom, 0); padding: 0px; line-height: 0px; width: 100%; max-width: 100%; img { width:100%; } figcaption { position: absolute; color: $black; @include rem-fallback(font-size, 1); @include rem-fallback(line-height, 1.5); @include respond-to(tablet) { @include rem-fallback(line-height, 1.2) }; @include rem-fallback(padding, 0.5, 0); @include translucent_white; margin: 0; bottom: 60px; @include rem-fallback(bottom, 0.5); left: 0px; right: 0px; @include rem-fallback(padding, 0.35); @include respond-to(tablet) { @include rem-fallback(min-height, 3) }; .fa { color: $red; } .content { @include rem-fallback(padding-right, 1.25); font-style: normal; } } } }
.row.three .span1 { figure.featured { position: relative; @include rem-fallback(margin-bottom, 0); padding: 0px; line-height: 0px; width: 100%; max-width: 100%; @include respond-to(handheld) { @include rem-fallback(margin-bottom, 1.5) }; img { width:100%; } figcaption { position: absolute; color: $black; @include rem-fallback(font-size, 1); @include rem-fallback(line-height, 1.5); @include respond-to(tablet) { @include rem-fallback(line-height, 1.2) }; @include rem-fallback(padding, 0.5, 0); @include translucent_white; margin: 0; bottom: 60px; @include rem-fallback(bottom, 0.5); left: 0px; right: 0px; @include rem-fallback(padding, 0.35); @include respond-to(tablet) { @include rem-fallback(min-height, 3) }; .fa { color: $red; } .content { @include rem-fallback(padding-right, 1.25); font-style: normal; } } } }
Add margin to bottom of 3 featured posts for mobile
Add margin to bottom of 3 featured posts for mobile
SCSS
mit
jnears/ukhlswebfrontend-rails,jnears/ukhlswebfrontend-rails
scss
## Code Before: .row.three .span1 { figure.featured { position: relative; @include rem-fallback(margin-bottom, 0); padding: 0px; line-height: 0px; width: 100%; max-width: 100%; img { width:100%; } figcaption { position: absolute; color: $black; @include rem-fallback(font-size, 1); @include rem-fallback(line-height, 1.5); @include respond-to(tablet) { @include rem-fallback(line-height, 1.2) }; @include rem-fallback(padding, 0.5, 0); @include translucent_white; margin: 0; bottom: 60px; @include rem-fallback(bottom, 0.5); left: 0px; right: 0px; @include rem-fallback(padding, 0.35); @include respond-to(tablet) { @include rem-fallback(min-height, 3) }; .fa { color: $red; } .content { @include rem-fallback(padding-right, 1.25); font-style: normal; } } } } ## Instruction: Add margin to bottom of 3 featured posts for mobile ## Code After: .row.three .span1 { figure.featured { position: relative; @include rem-fallback(margin-bottom, 0); padding: 0px; line-height: 0px; width: 100%; max-width: 100%; @include respond-to(handheld) { @include rem-fallback(margin-bottom, 1.5) }; img { width:100%; } figcaption { position: absolute; color: $black; @include rem-fallback(font-size, 1); @include rem-fallback(line-height, 1.5); @include respond-to(tablet) { @include rem-fallback(line-height, 1.2) }; @include rem-fallback(padding, 0.5, 0); @include translucent_white; margin: 0; bottom: 60px; @include rem-fallback(bottom, 0.5); left: 0px; right: 0px; @include rem-fallback(padding, 0.35); @include respond-to(tablet) { @include rem-fallback(min-height, 3) }; .fa { color: $red; } .content { @include rem-fallback(padding-right, 1.25); font-style: normal; } } } }
.row.three .span1 { figure.featured { position: relative; @include rem-fallback(margin-bottom, 0); padding: 0px; line-height: 0px; width: 100%; max-width: 100%; + @include respond-to(handheld) { @include rem-fallback(margin-bottom, 1.5) }; img { width:100%; } figcaption { position: absolute; color: $black; @include rem-fallback(font-size, 1); @include rem-fallback(line-height, 1.5); @include respond-to(tablet) { @include rem-fallback(line-height, 1.2) }; @include rem-fallback(padding, 0.5, 0); @include translucent_white; margin: 0; bottom: 60px; @include rem-fallback(bottom, 0.5); left: 0px; right: 0px; @include rem-fallback(padding, 0.35); @include respond-to(tablet) { @include rem-fallback(min-height, 3) }; .fa { color: $red; } .content { @include rem-fallback(padding-right, 1.25); font-style: normal; } } } }
1
0.02381
1
0
a106e1d50e9047cafa74c29871413af020e71264
public-events/build.cmd
public-events/build.cmd
@echo off IF NOT EXIST %APPDATA%\npm\tsc.cmd ( ECHO You must have the TypeScript compiler installed. If npm is installed, run ECHO npm install -g typescript GOTO end ) IF EXIST "%ProgramFiles(x86)%\Microsoft SDKs\TypeScript\1.4\tsc.exe" ( CALL "%ProgramFiles(x86)%\Microsoft SDKs\TypeScript\1.4\tsc.exe" -m amd --outDir out\scripts\PublicEvents scripts\PublicEvents\PublicEventsSource.ts ) ELSE ( IF EXIST "%APPDATA%\npm\tsc.cmd" ( CALL %APPDATA%\npm\tsc -m amd --outDir out\scripts\PublicEvents scripts\PublicEvents\PublicEventsSource.ts ) ELSE ( echo TypeScript compiler not installed. ) ) mkdir out COPY main.html out\main.html XCOPY sdk out\sdk\ /r /f /e /c /h /y ECHO. :end
@echo off IF EXIST "%ProgramFiles(x86)%\Microsoft SDKs\TypeScript\1.4\tsc.exe" ( CALL "%ProgramFiles(x86)%\Microsoft SDKs\TypeScript\1.4\tsc.exe" -m amd --outDir out\scripts\PublicEvents scripts\PublicEvents\PublicEventsSource.ts ) ELSE ( IF EXIST "%APPDATA%\npm\tsc.cmd" ( CALL %APPDATA%\npm\tsc -m amd --outDir out\scripts\PublicEvents scripts\PublicEvents\PublicEventsSource.ts ) ELSE ( echo TypeScript compiler not installed. ) ) mkdir out COPY main.html out\main.html XCOPY sdk out\sdk\ /r /f /e /c /h /y ECHO. :end
Remove unnecessary npm tsc check.
Remove unnecessary npm tsc check.
Batchfile
mit
Microsoft/vsts-extension-samples,Microsoft/vso-extension-samples,Microsoft/vso-extension-samples,srdjan-bozovic/vso-extension-samples,Microsoft/vsts-extension-samples,Microsoft/vso-extension-samples,Microsoft/vsts-extension-samples,srdjan-bozovic/vso-extension-samples,srdjan-bozovic/vso-extension-samples
batchfile
## Code Before: @echo off IF NOT EXIST %APPDATA%\npm\tsc.cmd ( ECHO You must have the TypeScript compiler installed. If npm is installed, run ECHO npm install -g typescript GOTO end ) IF EXIST "%ProgramFiles(x86)%\Microsoft SDKs\TypeScript\1.4\tsc.exe" ( CALL "%ProgramFiles(x86)%\Microsoft SDKs\TypeScript\1.4\tsc.exe" -m amd --outDir out\scripts\PublicEvents scripts\PublicEvents\PublicEventsSource.ts ) ELSE ( IF EXIST "%APPDATA%\npm\tsc.cmd" ( CALL %APPDATA%\npm\tsc -m amd --outDir out\scripts\PublicEvents scripts\PublicEvents\PublicEventsSource.ts ) ELSE ( echo TypeScript compiler not installed. ) ) mkdir out COPY main.html out\main.html XCOPY sdk out\sdk\ /r /f /e /c /h /y ECHO. :end ## Instruction: Remove unnecessary npm tsc check. ## Code After: @echo off IF EXIST "%ProgramFiles(x86)%\Microsoft SDKs\TypeScript\1.4\tsc.exe" ( CALL "%ProgramFiles(x86)%\Microsoft SDKs\TypeScript\1.4\tsc.exe" -m amd --outDir out\scripts\PublicEvents scripts\PublicEvents\PublicEventsSource.ts ) ELSE ( IF EXIST "%APPDATA%\npm\tsc.cmd" ( CALL %APPDATA%\npm\tsc -m amd --outDir out\scripts\PublicEvents scripts\PublicEvents\PublicEventsSource.ts ) ELSE ( echo TypeScript compiler not installed. ) ) mkdir out COPY main.html out\main.html XCOPY sdk out\sdk\ /r /f /e /c /h /y ECHO. :end
@echo off - IF NOT EXIST %APPDATA%\npm\tsc.cmd ( - ECHO You must have the TypeScript compiler installed. If npm is installed, run - ECHO npm install -g typescript - GOTO end - ) IF EXIST "%ProgramFiles(x86)%\Microsoft SDKs\TypeScript\1.4\tsc.exe" ( CALL "%ProgramFiles(x86)%\Microsoft SDKs\TypeScript\1.4\tsc.exe" -m amd --outDir out\scripts\PublicEvents scripts\PublicEvents\PublicEventsSource.ts ) ELSE ( IF EXIST "%APPDATA%\npm\tsc.cmd" ( CALL %APPDATA%\npm\tsc -m amd --outDir out\scripts\PublicEvents scripts\PublicEvents\PublicEventsSource.ts ) ELSE ( echo TypeScript compiler not installed. ) ) mkdir out COPY main.html out\main.html XCOPY sdk out\sdk\ /r /f /e /c /h /y ECHO. :end
5
0.238095
0
5
4ba390219d58d1726773e14928428f2c9495f6de
api/src/SearchApi.py
api/src/SearchApi.py
from apiclient.discovery import build import json # Set DEVELOPER_KEY to the API key value from the APIs & auth > Registered apps # tab of # https://cloud.google.com/console # Please ensure that you have enabled the YouTube Data API for your project. devKeyFile = open("search-api.key", "rb") DEVELOPER_KEY = devKeyFile.read() devKeyFile.close() YOUTUBE_API_SERVICE_NAME = "youtube" YOUTUBE_API_VERSION = "v3" def youtubeSearch(query, maxResults=50): youtube = build(YOUTUBE_API_SERVICE_NAME, YOUTUBE_API_VERSION, developerKey=DEVELOPER_KEY) # Call the search.list method to retrieve results matching the specified # query term. search_request = youtube.search().list( part="id,snippet", q=query, type="video", maxResults=maxResults, safeSearch="moderate", #could also be strict videoSyndicated="true", eventType="completed", videoDefinition="high", #could also be standard videoDuration="short", #max length of video 4mins, medium:4min-20min long order="relevance" ) search_response = json.dumps(search_request.execute(), separators=[',',':']) return search_response if __name__ == "__main__": print youtubeSearch("paramore", 5)
from apiclient.discovery import build import json # Set DEVELOPER_KEY to the API key value from the APIs & auth > Registered apps # tab of # https://cloud.google.com/console # Please ensure that you have enabled the YouTube Data API for your project. devKeyFile = open("search-api.key", "rb") DEVELOPER_KEY = devKeyFile.read() devKeyFile.close() YOUTUBE_API_SERVICE_NAME = "youtube" YOUTUBE_API_VERSION = "v3" def youtubeSearch(query, maxResults=50): youtube = build(YOUTUBE_API_SERVICE_NAME, YOUTUBE_API_VERSION, developerKey=DEVELOPER_KEY) # Call the search.list method to retrieve results matching the specified # query term. search_request = youtube.search().list( part="id,snippet", q=query, type="video", maxResults=maxResults, order="relevance" ) search_response = json.dumps(search_request.execute(), separators=[',',':']) return search_response if __name__ == "__main__": print youtubeSearch("paramore", 5)
Update search api to produce results more consistant with those found on youtube
Update search api to produce results more consistant with those found on youtube
Python
mit
jghibiki/mopey,jghibiki/mopey,jghibiki/mopey,jghibiki/mopey,jghibiki/mopey
python
## Code Before: from apiclient.discovery import build import json # Set DEVELOPER_KEY to the API key value from the APIs & auth > Registered apps # tab of # https://cloud.google.com/console # Please ensure that you have enabled the YouTube Data API for your project. devKeyFile = open("search-api.key", "rb") DEVELOPER_KEY = devKeyFile.read() devKeyFile.close() YOUTUBE_API_SERVICE_NAME = "youtube" YOUTUBE_API_VERSION = "v3" def youtubeSearch(query, maxResults=50): youtube = build(YOUTUBE_API_SERVICE_NAME, YOUTUBE_API_VERSION, developerKey=DEVELOPER_KEY) # Call the search.list method to retrieve results matching the specified # query term. search_request = youtube.search().list( part="id,snippet", q=query, type="video", maxResults=maxResults, safeSearch="moderate", #could also be strict videoSyndicated="true", eventType="completed", videoDefinition="high", #could also be standard videoDuration="short", #max length of video 4mins, medium:4min-20min long order="relevance" ) search_response = json.dumps(search_request.execute(), separators=[',',':']) return search_response if __name__ == "__main__": print youtubeSearch("paramore", 5) ## Instruction: Update search api to produce results more consistant with those found on youtube ## Code After: from apiclient.discovery import build import json # Set DEVELOPER_KEY to the API key value from the APIs & auth > Registered apps # tab of # https://cloud.google.com/console # Please ensure that you have enabled the YouTube Data API for your project. devKeyFile = open("search-api.key", "rb") DEVELOPER_KEY = devKeyFile.read() devKeyFile.close() YOUTUBE_API_SERVICE_NAME = "youtube" YOUTUBE_API_VERSION = "v3" def youtubeSearch(query, maxResults=50): youtube = build(YOUTUBE_API_SERVICE_NAME, YOUTUBE_API_VERSION, developerKey=DEVELOPER_KEY) # Call the search.list method to retrieve results matching the specified # query term. search_request = youtube.search().list( part="id,snippet", q=query, type="video", maxResults=maxResults, order="relevance" ) search_response = json.dumps(search_request.execute(), separators=[',',':']) return search_response if __name__ == "__main__": print youtubeSearch("paramore", 5)
from apiclient.discovery import build import json # Set DEVELOPER_KEY to the API key value from the APIs & auth > Registered apps # tab of # https://cloud.google.com/console # Please ensure that you have enabled the YouTube Data API for your project. devKeyFile = open("search-api.key", "rb") DEVELOPER_KEY = devKeyFile.read() devKeyFile.close() YOUTUBE_API_SERVICE_NAME = "youtube" YOUTUBE_API_VERSION = "v3" def youtubeSearch(query, maxResults=50): youtube = build(YOUTUBE_API_SERVICE_NAME, YOUTUBE_API_VERSION, developerKey=DEVELOPER_KEY) # Call the search.list method to retrieve results matching the specified # query term. search_request = youtube.search().list( part="id,snippet", q=query, type="video", maxResults=maxResults, - safeSearch="moderate", #could also be strict - videoSyndicated="true", - eventType="completed", - videoDefinition="high", #could also be standard - videoDuration="short", #max length of video 4mins, medium:4min-20min long order="relevance" ) search_response = json.dumps(search_request.execute(), separators=[',',':']) return search_response if __name__ == "__main__": print youtubeSearch("paramore", 5)
5
0.125
0
5
48c49a3b8076e6f3543aa1596f0f771bef8921e3
resources/port_options.rb
resources/port_options.rb
actions :create default_action :create attribute :name, kind_of: String, name_attribute: true attribute :source, kind_of: String attribute :options, kind_of: Hash attribute :dir_path, kind_of: String attribute :full_path, kind_of: String attribute :default_options, kind_of: Hash, default: {} attribute :current_options, kind_of: Hash, default: {} attribute :file_writer, kind_of: String def initialize(*args) super @dir_path = '/var/db/ports/' + name @full_path = @dir_path + '/options' end
actions :create default_action :create attribute :name, kind_of: String, name_attribute: true attribute :source, kind_of: String attribute :options, kind_of: Hash attribute :dir_path, kind_of: String, default: lazy { |r| '/var/db/ports/' + r.name } attribute :full_path, kind_of: String, default: lazy { |r| r.dir_path + '/options' } attribute :default_options, kind_of: Hash, default: {} attribute :current_options, kind_of: Hash, default: {} attribute :file_writer, kind_of: String
Use lazy for the default values instead of the initializer
Use lazy for the default values instead of the initializer Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
Ruby
apache-2.0
opscode-cookbooks/freebsd,chef-cookbooks/freebsd
ruby
## Code Before: actions :create default_action :create attribute :name, kind_of: String, name_attribute: true attribute :source, kind_of: String attribute :options, kind_of: Hash attribute :dir_path, kind_of: String attribute :full_path, kind_of: String attribute :default_options, kind_of: Hash, default: {} attribute :current_options, kind_of: Hash, default: {} attribute :file_writer, kind_of: String def initialize(*args) super @dir_path = '/var/db/ports/' + name @full_path = @dir_path + '/options' end ## Instruction: Use lazy for the default values instead of the initializer Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io> ## Code After: actions :create default_action :create attribute :name, kind_of: String, name_attribute: true attribute :source, kind_of: String attribute :options, kind_of: Hash attribute :dir_path, kind_of: String, default: lazy { |r| '/var/db/ports/' + r.name } attribute :full_path, kind_of: String, default: lazy { |r| r.dir_path + '/options' } attribute :default_options, kind_of: Hash, default: {} attribute :current_options, kind_of: Hash, default: {} attribute :file_writer, kind_of: String
actions :create default_action :create attribute :name, kind_of: String, name_attribute: true attribute :source, kind_of: String attribute :options, kind_of: Hash - attribute :dir_path, kind_of: String - attribute :full_path, kind_of: String + attribute :dir_path, kind_of: String, default: lazy { |r| '/var/db/ports/' + r.name } + attribute :full_path, kind_of: String, default: lazy { |r| r.dir_path + '/options' } attribute :default_options, kind_of: Hash, default: {} attribute :current_options, kind_of: Hash, default: {} attribute :file_writer, kind_of: String - - def initialize(*args) - super - @dir_path = '/var/db/ports/' + name - @full_path = @dir_path + '/options' - end
10
0.555556
2
8
49b4b719aef392a1731aad221de2c4548e6b8dbc
installer/linux/debian/brackets.desktop
installer/linux/debian/brackets.desktop
[Desktop Entry] Name=Brackets Type=Application Categories=Development Exec=/opt/brackets/brackets %U Icon=brackets MimeType=text/html;
[Desktop Entry] Name=Brackets Type=Application Categories=Development Exec=/opt/brackets/brackets %U Icon=brackets MimeType=text/html; Keywords=Text;Editor;Write;Web;Development;
Add keywords to improve search
Add keywords to improve search Allows searching for the keywords in Ubuntu dash.
desktop
mit
albertinad/brackets-shell,petetnt/brackets-shell,MarcelGerber/brackets-shell,alexkid64/brackets-shell,digideskio/brackets-shell,weebygames/brackets-shell,weebygames/brackets-shell,ficristo/brackets-shell,pomadgw/brackets-shell,jomolinare/brackets-shell,keir-rex/brackets-shell,MarcelGerber/brackets-shell,stevemao/brackets-shell,petetnt/brackets-shell,petetnt/brackets-shell,digideskio/brackets-shell,jomolinare/brackets-shell,keir-rex/brackets-shell,pomadgw/brackets-shell,stevemao/brackets-shell,ficristo/brackets-shell,keir-rex/brackets-shell,JuanVicke/brackets-shell,arduino-org/brackets-shell,arduino-org/brackets-shell,arduino-org/brackets-shell,jomolinare/brackets-shell,stevemao/brackets-shell,keir-rex/brackets-shell,ficristo/brackets-shell,stevemao/brackets-shell,caiowilson/brackets-shell,alexkid64/brackets-shell,pomadgw/brackets-shell,hackerhelmut/brackets-shell,adobe/brackets-shell,adobe/brackets-shell,ficristo/brackets-shell,JuanVicke/brackets-shell,caiowilson/brackets-shell,ficristo/brackets-shell,caiowilson/brackets-shell,hackerhelmut/brackets-shell,adobe/brackets-shell,JuanVicke/brackets-shell,adobe/brackets-shell,JuanVicke/brackets-shell,alexkid64/brackets-shell,MarcelGerber/brackets-shell,MarcelGerber/brackets-shell,stevemao/brackets-shell,petetnt/brackets-shell,alexkid64/brackets-shell,digideskio/brackets-shell,digideskio/brackets-shell,adobe/brackets-shell,digideskio/brackets-shell,caiowilson/brackets-shell,albertinad/brackets-shell,pomadgw/brackets-shell,hackerhelmut/brackets-shell,albertinad/brackets-shell,JuanVicke/brackets-shell,arduino-org/brackets-shell,weebygames/brackets-shell,weebygames/brackets-shell,albertinad/brackets-shell,caiowilson/brackets-shell,hackerhelmut/brackets-shell,petetnt/brackets-shell,jomolinare/brackets-shell,keir-rex/brackets-shell,jomolinare/brackets-shell,arduino-org/brackets-shell,pomadgw/brackets-shell,adobe/brackets-shell,albertinad/brackets-shell,weebygames/brackets-shell,hackerhelmut/brackets-shell,MarcelGerber/brackets-shell,alexkid64/brackets-shell
desktop
## Code Before: [Desktop Entry] Name=Brackets Type=Application Categories=Development Exec=/opt/brackets/brackets %U Icon=brackets MimeType=text/html; ## Instruction: Add keywords to improve search Allows searching for the keywords in Ubuntu dash. ## Code After: [Desktop Entry] Name=Brackets Type=Application Categories=Development Exec=/opt/brackets/brackets %U Icon=brackets MimeType=text/html; Keywords=Text;Editor;Write;Web;Development;
[Desktop Entry] Name=Brackets Type=Application Categories=Development Exec=/opt/brackets/brackets %U Icon=brackets MimeType=text/html; + Keywords=Text;Editor;Write;Web;Development;
1
0.142857
1
0
8b583070d30f3f549fa697e743c08d58f09e424d
app/Providers/RouteServiceProvider.php
app/Providers/RouteServiceProvider.php
<?php namespace Wdi\Providers; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Route; use Wdi\Entities\Language; use Wdi\Entities\Paste; /** * Class RouteServiceProvider * * @package Wdi\Providers */ final class RouteServiceProvider extends ServiceProvider { /** {@inheritdoc} */ public function boot() { parent::boot(); Route::model("paste", Paste::class); Route::model("language", Language::class); } /** * Define the routes for the application. * * @return void */ public function map() { $this->mapApiRoutes(); $this->mapHandlerRoutes(); } /** * Define the "api" routes for the application. * * These routes are typically stateless. * * @return void */ private function mapApiRoutes() { Route::prefix("api")->namespace("Wdi\Http\Api")->middleware("api")->group(base_path("routes/api.php")); } /** * Define the "api" routes for the application. * * These routes are typically stateless. * * @return void */ private function mapHandlerRoutes() { Route::middleware("web")->group(base_path("routes/handler.php")); } }
<?php namespace Wdi\Providers; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Route; use Wdi\Entities\Language; use Wdi\Entities\Paste; /** * Class RouteServiceProvider * * @package Wdi\Providers */ final class RouteServiceProvider extends ServiceProvider { /** {@inheritdoc} */ public function boot() { parent::boot(); Route::model("language", Language::class); Route::bind("paste", function ($slug) { return Paste::select(["id", "language_id", "paste_id", "user_id", "slug", "name", "extension", "code", "description", "created_at", "updated_at"]) ->where("slug", $slug)->firstOrFail(); }); } /** * Define the routes for the application. * * @return void */ public function map() { $this->mapApiRoutes(); $this->mapHandlerRoutes(); } /** * Define the "api" routes for the application. * * These routes are typically stateless. * * @return void */ private function mapApiRoutes() { Route::prefix("api")->namespace("Wdi\Http\Api")->middleware("api")->group(base_path("routes/api.php")); } /** * Define the "api" routes for the application. * * These routes are typically stateless. * * @return void */ private function mapHandlerRoutes() { Route::middleware("web")->group(base_path("routes/handler.php")); } }
Improve Route model binding query for Paste
Improve Route model binding query for Paste
PHP
mit
WebDeveloperItaliani/paste,WebDeveloperItaliani/paste
php
## Code Before: <?php namespace Wdi\Providers; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Route; use Wdi\Entities\Language; use Wdi\Entities\Paste; /** * Class RouteServiceProvider * * @package Wdi\Providers */ final class RouteServiceProvider extends ServiceProvider { /** {@inheritdoc} */ public function boot() { parent::boot(); Route::model("paste", Paste::class); Route::model("language", Language::class); } /** * Define the routes for the application. * * @return void */ public function map() { $this->mapApiRoutes(); $this->mapHandlerRoutes(); } /** * Define the "api" routes for the application. * * These routes are typically stateless. * * @return void */ private function mapApiRoutes() { Route::prefix("api")->namespace("Wdi\Http\Api")->middleware("api")->group(base_path("routes/api.php")); } /** * Define the "api" routes for the application. * * These routes are typically stateless. * * @return void */ private function mapHandlerRoutes() { Route::middleware("web")->group(base_path("routes/handler.php")); } } ## Instruction: Improve Route model binding query for Paste ## Code After: <?php namespace Wdi\Providers; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Route; use Wdi\Entities\Language; use Wdi\Entities\Paste; /** * Class RouteServiceProvider * * @package Wdi\Providers */ final class RouteServiceProvider extends ServiceProvider { /** {@inheritdoc} */ public function boot() { parent::boot(); Route::model("language", Language::class); Route::bind("paste", function ($slug) { return Paste::select(["id", "language_id", "paste_id", "user_id", "slug", "name", "extension", "code", "description", "created_at", "updated_at"]) ->where("slug", $slug)->firstOrFail(); }); } /** * Define the routes for the application. * * @return void */ public function map() { $this->mapApiRoutes(); $this->mapHandlerRoutes(); } /** * Define the "api" routes for the application. * * These routes are typically stateless. * * @return void */ private function mapApiRoutes() { Route::prefix("api")->namespace("Wdi\Http\Api")->middleware("api")->group(base_path("routes/api.php")); } /** * Define the "api" routes for the application. * * These routes are typically stateless. * * @return void */ private function mapHandlerRoutes() { Route::middleware("web")->group(base_path("routes/handler.php")); } }
<?php namespace Wdi\Providers; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Route; use Wdi\Entities\Language; use Wdi\Entities\Paste; /** * Class RouteServiceProvider * * @package Wdi\Providers */ final class RouteServiceProvider extends ServiceProvider { /** {@inheritdoc} */ public function boot() { parent::boot(); - Route::model("paste", Paste::class); Route::model("language", Language::class); + + Route::bind("paste", function ($slug) { + return Paste::select(["id", "language_id", "paste_id", "user_id", "slug", "name", "extension", "code", "description", "created_at", "updated_at"]) + ->where("slug", $slug)->firstOrFail(); + }); } /** * Define the routes for the application. * * @return void */ public function map() { $this->mapApiRoutes(); $this->mapHandlerRoutes(); } /** * Define the "api" routes for the application. * * These routes are typically stateless. * * @return void */ private function mapApiRoutes() { Route::prefix("api")->namespace("Wdi\Http\Api")->middleware("api")->group(base_path("routes/api.php")); } /** * Define the "api" routes for the application. * * These routes are typically stateless. * * @return void */ private function mapHandlerRoutes() { Route::middleware("web")->group(base_path("routes/handler.php")); } }
6
0.098361
5
1
a051e59fb95b17788ecbb2d819e2bd058a7c7c95
actioncable/blade.yml
actioncable/blade.yml
load_paths: - app/assets/javascripts - test/javascript/src - test/javascript/vendor logical_paths: - test.js build: logical_paths: - action_cable.js path: lib/assets/compiled clean: true plugins: sauce_labs: browsers: Google Chrome: os: Mac, Windows version: -2 Firefox: os: Mac, Windows version: -2 Safari: platform: Mac version: -3 Microsoft Edge: version: -2 Internet Explorer: version: 11 iPhone: version: [9.2, 8.4] Motorola Droid 4 Emulator: version: [5.1, 4.4]
load_paths: - app/assets/javascripts - test/javascript/src - test/javascript/vendor logical_paths: - test.js build: logical_paths: - action_cable.js path: lib/assets/compiled clean: true plugins: sauce_labs: browsers: Google Chrome: os: Mac, Windows version: -1 Firefox: os: Mac, Windows version: -1 Safari: platform: Mac version: -1 Microsoft Edge: version: -1 Internet Explorer: version: 11 iPhone: version: -1 Motorola Droid 4 Emulator: version: -1
Test single latest browser version
Test single latest browser version Cuts down the number of concurrent Sauce Labs VMs we need to spin up. Can add specific versions back in to target regressions if need be.
YAML
mit
untidy-hair/rails,stefanmb/rails,arunagw/rails,starknx/rails,tgxworld/rails,ledestin/rails,illacceptanything/illacceptanything,kamipo/rails,bolek/rails,vipulnsward/rails,yhirano55/rails,notapatch/rails,elfassy/rails,coreyward/rails,yahonda/rails,gcourtemanche/rails,MichaelSp/rails,yawboakye/rails,gavingmiller/rails,bogdanvlviv/rails,joonyou/rails,kmayer/rails,pschambacher/rails,koic/rails,bradleypriest/rails,EmmaB/rails-1,riseshia/railsguides.kr,arunagw/rails,yalab/rails,brchristian/rails,schuetzm/rails,kachick/rails,eileencodes/rails,schuetzm/rails,Stellenticket/rails,samphilipd/rails,travisofthenorth/rails,gavingmiller/rails,hanystudy/rails,kddeisz/rails,tijwelch/rails,illacceptanything/illacceptanything,mtsmfm/railstest,georgeclaghorn/rails,iainbeeston/rails,MichaelSp/rails,Stellenticket/rails,betesh/rails,tgxworld/rails,palkan/rails,esparta/rails,stefanmb/rails,ttanimichi/rails,rafaelfranca/omg-rails,deraru/rails,jeremy/rails,BlakeWilliams/rails,printercu/rails,arunagw/rails,rbhitchcock/rails,rafaelfranca/omg-rails,starknx/rails,repinel/rails,gauravtiwari/rails,mohitnatoo/rails,iainbeeston/rails,yasslab/railsguides.jp,Edouard-chin/rails,iainbeeston/rails,lcreid/rails,printercu/rails,kmcphillips/rails,mechanicles/rails,kachick/rails,felipecvo/rails,Erol/rails,pschambacher/rails,georgeclaghorn/rails,shioyama/rails,arjes/rails,yahonda/rails,illacceptanything/illacceptanything,kaspth/rails,mohitnatoo/rails,aditya-kapoor/rails,yalab/rails,ttanimichi/rails,kmcphillips/rails,Sen-Zhang/rails,baerjam/rails,pvalena/rails,utilum/rails,tgxworld/rails,elfassy/rails,voray/rails,rossta/rails,kmayer/rails,deraru/rails,lucasmazza/rails,shioyama/rails,kmayer/rails,kddeisz/rails,xlymian/rails,tjschuck/rails,mtsmfm/railstest,Vasfed/rails,Envek/rails,tjschuck/rails,arunagw/rails,sergey-alekseev/rails,mathieujobin/reduced-rails-for-travis,repinel/rails,marklocklear/rails,riseshia/railsguides.kr,fabianoleittes/rails,rails/rails,yasslab/railsguides.jp,hanystudy/rails,bogdanvlviv/rails,baerjam/rails,palkan/rails,vipulnsward/rails,yasslab/railsguides.jp,xlymian/rails,kddeisz/rails,Spin42/rails,felipecvo/rails,Envek/rails,sealocal/rails,ngpestelos/rails,notapatch/rails,ledestin/rails,yalab/rails,rossta/rails,untidy-hair/rails,deraru/rails,riseshia/railsguides.kr,pschambacher/rails,kmcphillips/rails,flanger001/rails,illacceptanything/illacceptanything,mtsmfm/rails,betesh/rails,yhirano55/rails,richseviora/rails,mtsmfm/railstest,Stellenticket/rails,assain/rails,baerjam/rails,mechanicles/rails,ledestin/rails,illacceptanything/illacceptanything,Envek/rails,Vasfed/rails,illacceptanything/illacceptanything,esparta/rails,lucasmazza/rails,arjes/rails,kirs/rails-1,betesh/rails,palkan/rails,yahonda/rails,odedniv/rails,notapatch/rails,illacceptanything/illacceptanything,lucasmazza/rails,utilum/rails,matrinox/rails,vipulnsward/rails,flanger001/rails,eileencodes/rails,ngpestelos/rails,kirs/rails-1,bolek/rails,repinel/rails,brchristian/rails,joonyou/rails,pvalena/rails,rossta/rails,MSP-Greg/rails,illacceptanything/illacceptanything,mohitnatoo/rails,yasslab/railsguides.jp,Vasfed/rails,vipulnsward/rails,esparta/rails,rafaelfranca/omg-rails,coreyward/rails,travisofthenorth/rails,sealocal/rails,rails/rails,Spin42/rails,Erol/rails,tijwelch/rails,prathamesh-sonpatki/rails,gfvcastro/rails,yahonda/rails,schuetzm/rails,fabianoleittes/rails,jeremy/rails,joonyou/rails,lcreid/rails,richseviora/rails,printercu/rails,stefanmb/rails,mtsmfm/rails,sergey-alekseev/rails,mathieujobin/reduced-rails-for-travis,kmcphillips/rails,Sen-Zhang/rails,mathieujobin/reduced-rails-for-travis,odedniv/rails,flanger001/rails,kamipo/rails,BlakeWilliams/rails,bogdanvlviv/rails,baerjam/rails,alecspopa/rails,Sen-Zhang/rails,georgeclaghorn/rails,Erol/rails,jeremy/rails,maicher/rails,betesh/rails,brchristian/rails,alecspopa/rails,assain/rails,assain/rails,bradleypriest/rails,jeremy/rails,tijwelch/rails,illacceptanything/illacceptanything,eileencodes/rails,bolek/rails,rbhitchcock/rails,Spin42/rails,samphilipd/rails,coreyward/rails,kaspth/rails,koic/rails,starknx/rails,schuetzm/rails,fabianoleittes/rails,yawboakye/rails,lcreid/rails,shioyama/rails,gfvcastro/rails,printercu/rails,Stellenticket/rails,georgeclaghorn/rails,shioyama/rails,mohitnatoo/rails,matrinox/rails,voray/rails,tjschuck/rails,prathamesh-sonpatki/rails,voray/rails,fabianoleittes/rails,palkan/rails,joonyou/rails,EmmaB/rails-1,yawboakye/rails,aditya-kapoor/rails,travisofthenorth/rails,Envek/rails,kenta-s/rails,odedniv/rails,felipecvo/rails,esparta/rails,sergey-alekseev/rails,rbhitchcock/rails,illacceptanything/illacceptanything,gavingmiller/rails,EmmaB/rails-1,assain/rails,prathamesh-sonpatki/rails,mijoharas/rails,gcourtemanche/rails,kenta-s/rails,tjschuck/rails,tgxworld/rails,mijoharas/rails,Edouard-chin/rails,utilum/rails,utilum/rails,pvalena/rails,MSP-Greg/rails,maicher/rails,ngpestelos/rails,hanystudy/rails,untidy-hair/rails,aditya-kapoor/rails,MSP-Greg/rails,mechanicles/rails,alecspopa/rails,untidy-hair/rails,prathamesh-sonpatki/rails,riseshia/railsguides.kr,marklocklear/rails,kamipo/rails,lcreid/rails,richseviora/rails,mechanicles/rails,Edouard-chin/rails,repinel/rails,Erol/rails,kaspth/rails,kenta-s/rails,illacceptanything/illacceptanything,xlymian/rails,elfassy/rails,deraru/rails,gauravtiwari/rails,gcourtemanche/rails,mtsmfm/rails,pvalena/rails,kddeisz/rails,yhirano55/rails,gauravtiwari/rails,travisofthenorth/rails,kachick/rails,yalab/rails,Vasfed/rails,rails/rails,koic/rails,MichaelSp/rails,sealocal/rails,bradleypriest/rails,ttanimichi/rails,eileencodes/rails,matrinox/rails,illacceptanything/illacceptanything,gfvcastro/rails,bogdanvlviv/rails,BlakeWilliams/rails,illacceptanything/illacceptanything,yhirano55/rails,notapatch/rails,maicher/rails,arjes/rails,illacceptanything/illacceptanything,yawboakye/rails,kirs/rails-1,iainbeeston/rails,gfvcastro/rails,BlakeWilliams/rails,illacceptanything/illacceptanything,mijoharas/rails,Edouard-chin/rails,marklocklear/rails,samphilipd/rails,rails/rails,flanger001/rails,aditya-kapoor/rails,MSP-Greg/rails
yaml
## Code Before: load_paths: - app/assets/javascripts - test/javascript/src - test/javascript/vendor logical_paths: - test.js build: logical_paths: - action_cable.js path: lib/assets/compiled clean: true plugins: sauce_labs: browsers: Google Chrome: os: Mac, Windows version: -2 Firefox: os: Mac, Windows version: -2 Safari: platform: Mac version: -3 Microsoft Edge: version: -2 Internet Explorer: version: 11 iPhone: version: [9.2, 8.4] Motorola Droid 4 Emulator: version: [5.1, 4.4] ## Instruction: Test single latest browser version Cuts down the number of concurrent Sauce Labs VMs we need to spin up. Can add specific versions back in to target regressions if need be. ## Code After: load_paths: - app/assets/javascripts - test/javascript/src - test/javascript/vendor logical_paths: - test.js build: logical_paths: - action_cable.js path: lib/assets/compiled clean: true plugins: sauce_labs: browsers: Google Chrome: os: Mac, Windows version: -1 Firefox: os: Mac, Windows version: -1 Safari: platform: Mac version: -1 Microsoft Edge: version: -1 Internet Explorer: version: 11 iPhone: version: -1 Motorola Droid 4 Emulator: version: -1
load_paths: - app/assets/javascripts - test/javascript/src - test/javascript/vendor logical_paths: - test.js build: logical_paths: - action_cable.js path: lib/assets/compiled clean: true plugins: sauce_labs: browsers: Google Chrome: os: Mac, Windows - version: -2 ? ^ + version: -1 ? ^ Firefox: os: Mac, Windows - version: -2 ? ^ + version: -1 ? ^ Safari: platform: Mac - version: -3 ? ^ + version: -1 ? ^ Microsoft Edge: - version: -2 ? ^ + version: -1 ? ^ Internet Explorer: version: 11 iPhone: - version: [9.2, 8.4] + version: -1 Motorola Droid 4 Emulator: - version: [5.1, 4.4] ? ^^^ ------ + version: -1 ? ^
12
0.352941
6
6
18d119f9a7ef5144ff99e6eeec66c5ae7744c585
app/controllers/transactions_controller.rb
app/controllers/transactions_controller.rb
class TransactionsController < ApplicationController def create @bill = Bill.find(params[:bill_id]) @customer = Customer.find_by(username: params[:username]) @transaction = Transaction.new(bill: @bill, customer: @customer) if @transaction.save @bill.transactions << @transaction render json: {location: @transaction} else status 422 end end def show @transaction = Transaction.find(params[:id]) render :json => {location: @transaction} end def update p params @bill = Bill.find(params[:bill_id]) @transaction = @bill.transactions.first @transaction.amount += 5.5 if @transaction.save render json: { location: bill_path(@bill) } else status 422 end end end
class TransactionsController < ApplicationController def create @bill = Bill.find(params[:bill_id]) @customer = Customer.find_by(email: params[:email]) @transaction = Transaction.new(bill: @bill, customer: @customer) if @transaction.save @bill.transactions << @transaction render json: {location: @transaction} else status 422 end end def show @transaction = Transaction.find(params[:id]) render :json => {location: @transaction} end def update p params @bill = Bill.find(params[:bill_id]) @transaction = @bill.transactions.first @transaction.amount += 5.5 if @transaction.save render json: { location: bill_path(@bill) } else status 422 end end end
Add backend support for email transactions
Add backend support for email transactions
Ruby
mit
Heintzdm/check-it-out-app,Heintzdm/check-it-out-app,Heintzdm/check-it-out-app
ruby
## Code Before: class TransactionsController < ApplicationController def create @bill = Bill.find(params[:bill_id]) @customer = Customer.find_by(username: params[:username]) @transaction = Transaction.new(bill: @bill, customer: @customer) if @transaction.save @bill.transactions << @transaction render json: {location: @transaction} else status 422 end end def show @transaction = Transaction.find(params[:id]) render :json => {location: @transaction} end def update p params @bill = Bill.find(params[:bill_id]) @transaction = @bill.transactions.first @transaction.amount += 5.5 if @transaction.save render json: { location: bill_path(@bill) } else status 422 end end end ## Instruction: Add backend support for email transactions ## Code After: class TransactionsController < ApplicationController def create @bill = Bill.find(params[:bill_id]) @customer = Customer.find_by(email: params[:email]) @transaction = Transaction.new(bill: @bill, customer: @customer) if @transaction.save @bill.transactions << @transaction render json: {location: @transaction} else status 422 end end def show @transaction = Transaction.find(params[:id]) render :json => {location: @transaction} end def update p params @bill = Bill.find(params[:bill_id]) @transaction = @bill.transactions.first @transaction.amount += 5.5 if @transaction.save render json: { location: bill_path(@bill) } else status 422 end end end
class TransactionsController < ApplicationController def create @bill = Bill.find(params[:bill_id]) - @customer = Customer.find_by(username: params[:username]) ? -- ^^ ^^ -- ^^ ^^ + @customer = Customer.find_by(email: params[:email]) ? ^ ^^ ^ ^^ @transaction = Transaction.new(bill: @bill, customer: @customer) if @transaction.save @bill.transactions << @transaction render json: {location: @transaction} else status 422 end end def show @transaction = Transaction.find(params[:id]) render :json => {location: @transaction} end def update p params @bill = Bill.find(params[:bill_id]) @transaction = @bill.transactions.first @transaction.amount += 5.5 if @transaction.save render json: { location: bill_path(@bill) } else status 422 end end end
2
0.0625
1
1
05ddf4a2cbe068c62cdd847dfae39467c42351d1
CHANGELOG.md
CHANGELOG.md
* Support for Rails 5 * Dropping support for < Rails 5 ## Upgrading To upgrade ``front_end_builds`` just set the appropriate version in your ``Gemfile`` and run ``bundle update front_end_builds``. Once you upgrade make sure you install the latest migrations. ``` rake front_end_builds:install:migrations rake db:migrate ``` And that's it, you now have the latest version of ``front_end_builds``. Check the log below to see all the new features. ### 0.1.0 (Feb 23 2015) * Asymmetrical keys used to verify builds. Front end builds no longer uses API keys, instead a public key is used to verify the build. To set this up login to your admin area and add a public key, for example your SSH pubkey. Make sure you update your ``ember-cli-front-end-builds`` to use version `0.1.0` as well.
* Support for Rails 5 * Dropping support for < Rails 5 * Support for OpenSSL Ver 2 * If a user uses a key that is not RSA/DSA an exception will now be raised ## Upgrading To upgrade ``front_end_builds`` just set the appropriate version in your ``Gemfile`` and run ``bundle update front_end_builds``. Once you upgrade make sure you install the latest migrations. ``` rake front_end_builds:install:migrations rake db:migrate ``` And that's it, you now have the latest version of ``front_end_builds``. Check the log below to see all the new features. ### 0.1.0 (Feb 23 2015) * Asymmetrical keys used to verify builds. Front end builds no longer uses API keys, instead a public key is used to verify the build. To set this up login to your admin area and add a public key, for example your SSH pubkey. Make sure you update your ``ember-cli-front-end-builds`` to use version `0.1.0` as well.
Add notes about SSL and exceptions
Add notes about SSL and exceptions
Markdown
mit
tedconf/front_end_builds,tedconf/front_end_builds,tedconf/front_end_builds
markdown
## Code Before: * Support for Rails 5 * Dropping support for < Rails 5 ## Upgrading To upgrade ``front_end_builds`` just set the appropriate version in your ``Gemfile`` and run ``bundle update front_end_builds``. Once you upgrade make sure you install the latest migrations. ``` rake front_end_builds:install:migrations rake db:migrate ``` And that's it, you now have the latest version of ``front_end_builds``. Check the log below to see all the new features. ### 0.1.0 (Feb 23 2015) * Asymmetrical keys used to verify builds. Front end builds no longer uses API keys, instead a public key is used to verify the build. To set this up login to your admin area and add a public key, for example your SSH pubkey. Make sure you update your ``ember-cli-front-end-builds`` to use version `0.1.0` as well. ## Instruction: Add notes about SSL and exceptions ## Code After: * Support for Rails 5 * Dropping support for < Rails 5 * Support for OpenSSL Ver 2 * If a user uses a key that is not RSA/DSA an exception will now be raised ## Upgrading To upgrade ``front_end_builds`` just set the appropriate version in your ``Gemfile`` and run ``bundle update front_end_builds``. Once you upgrade make sure you install the latest migrations. ``` rake front_end_builds:install:migrations rake db:migrate ``` And that's it, you now have the latest version of ``front_end_builds``. Check the log below to see all the new features. ### 0.1.0 (Feb 23 2015) * Asymmetrical keys used to verify builds. Front end builds no longer uses API keys, instead a public key is used to verify the build. To set this up login to your admin area and add a public key, for example your SSH pubkey. Make sure you update your ``ember-cli-front-end-builds`` to use version `0.1.0` as well.
* Support for Rails 5 * Dropping support for < Rails 5 + * Support for OpenSSL Ver 2 + * If a user uses a key that is not RSA/DSA an exception will now be raised ## Upgrading To upgrade ``front_end_builds`` just set the appropriate version in your ``Gemfile`` and run ``bundle update front_end_builds``. Once you upgrade make sure you install the latest migrations. ``` rake front_end_builds:install:migrations rake db:migrate ``` And that's it, you now have the latest version of ``front_end_builds``. Check the log below to see all the new features. ### 0.1.0 (Feb 23 2015) * Asymmetrical keys used to verify builds. Front end builds no longer uses API keys, instead a public key is used to verify the build. To set this up login to your admin area and add a public key, for example your SSH pubkey. Make sure you update your ``ember-cli-front-end-builds`` to use version `0.1.0` as well.
2
0.068966
2
0
894bb47f6661d573181d7620cd079b52bd9ffe7a
scripts/make-messages.sh
scripts/make-messages.sh
pybabel extract --project=mailpile \ -F babel.cfg \ -o locale/mailpile.pot \ . # --omit-header for L in $(find locale/* -type d \ | grep -v "LC_MESSAGES" \ | sed 's:locale/::'); do msgmerge -U locale/$L/LC_MESSAGES/mailpile.po locale/mailpile.pot done;
set -x set -e # --omit-header \ pybabel extract --project=mailpile \ -F babel.cfg \ -o locale/mailpile.pot \ . for L in $(find locale/* -type d \ | grep -v "LC_MESSAGES" \ | sed 's:locale/::'); do msgmerge -U locale/$L/LC_MESSAGES/mailpile.po locale/mailpile.pot done;
Make more verbose for debugging
Make more verbose for debugging
Shell
apache-2.0
laborautonomo/Mailpile,laborautonomo/Mailpile,jparyani/Mailpile,jparyani/Mailpile,jparyani/Mailpile,laborautonomo/Mailpile
shell
## Code Before: pybabel extract --project=mailpile \ -F babel.cfg \ -o locale/mailpile.pot \ . # --omit-header for L in $(find locale/* -type d \ | grep -v "LC_MESSAGES" \ | sed 's:locale/::'); do msgmerge -U locale/$L/LC_MESSAGES/mailpile.po locale/mailpile.pot done; ## Instruction: Make more verbose for debugging ## Code After: set -x set -e # --omit-header \ pybabel extract --project=mailpile \ -F babel.cfg \ -o locale/mailpile.pot \ . for L in $(find locale/* -type d \ | grep -v "LC_MESSAGES" \ | sed 's:locale/::'); do msgmerge -U locale/$L/LC_MESSAGES/mailpile.po locale/mailpile.pot done;
+ set -x + set -e + # --omit-header \ pybabel extract --project=mailpile \ -F babel.cfg \ -o locale/mailpile.pot \ . - # --omit-header for L in $(find locale/* -type d \ | grep -v "LC_MESSAGES" \ | sed 's:locale/::'); do msgmerge -U locale/$L/LC_MESSAGES/mailpile.po locale/mailpile.pot done;
4
0.333333
3
1
97571cdfdb696d4d8eeb7daeba1f15b5671fe52b
docs/ecs-task-notification.md
docs/ecs-task-notification.md
In ECS scheduler, `hako oneshot` supports multiple methods of detecting task finish. ## ecs:DescribeTasks (default) Use [DescribeTasks](http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeTasks.html) API to get the task status. This method can be used without any preparation or configuration, but the DescribeTasks API can return "Rate exceeded" error when there's several running `hako oneshot` processes. ## s3:GetObject Amazon ECS has integration with Amazon CloudWatch Events. The integration notifies ECS task state changes to AWS Lambda, Amazon SNS, Amazon SQS, and so on. http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_cwe_events.html#ecs_task_events Amazon S3 is a good storage for polling, so connecting CloudWatch Events to AWS Lambda and put the payload to S3 is more scalable than ecs:DescribeTasks. The example implementation of AWS Lambda can be found in [../examples/put-ecs-container-status-to-s3](../examples/put-ecs-container-status-to-s3) directory. To enable task notification with S3, you have to configure scheduler in YAML. ```yaml scheduler: type: ecs oneshot_notification_prefix: 's3://ecs-task-notifications/task_statuses?region=ap-northeast-1' ``` It uses ecs-task-notifications bucket in ap-northeast-1 region.
In ECS scheduler, `hako oneshot` supports multiple methods of detecting task finish. ## ecs:DescribeTasks (default) Use [DescribeTasks](http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeTasks.html) API to get the task status. This method can be used without any preparation or configuration, but the DescribeTasks API can return "Rate exceeded" error when there's several running `hako oneshot` processes. ## s3:GetObject Amazon ECS has integration with Amazon CloudWatch Events. The integration notifies ECS task state changes to AWS Lambda, Amazon SNS, Amazon SQS, and so on. http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_cwe_events.html#ecs_task_events Amazon S3 is a good storage for polling, so connecting CloudWatch Events to AWS Lambda and put the payload to S3 is more scalable than ecs:DescribeTasks. The example implementation of AWS Lambda can be found in [../examples/put-ecs-container-status-to-s3](../examples/put-ecs-container-status-to-s3) directory. To enable task notification with S3, you have to configure scheduler in definition file. ```js { scheduler: { type: 'ecs', oneshot_notification_prefix: 's3://ecs-task-notifications/task_statuses?region=ap-northeast-1', }, } ``` It uses ecs-task-notifications bucket in ap-northeast-1 region.
Use Jsonnet format in docs
Use Jsonnet format in docs
Markdown
mit
eagletmt/hako,eagletmt/hako,eagletmt/hako
markdown
## Code Before: In ECS scheduler, `hako oneshot` supports multiple methods of detecting task finish. ## ecs:DescribeTasks (default) Use [DescribeTasks](http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeTasks.html) API to get the task status. This method can be used without any preparation or configuration, but the DescribeTasks API can return "Rate exceeded" error when there's several running `hako oneshot` processes. ## s3:GetObject Amazon ECS has integration with Amazon CloudWatch Events. The integration notifies ECS task state changes to AWS Lambda, Amazon SNS, Amazon SQS, and so on. http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_cwe_events.html#ecs_task_events Amazon S3 is a good storage for polling, so connecting CloudWatch Events to AWS Lambda and put the payload to S3 is more scalable than ecs:DescribeTasks. The example implementation of AWS Lambda can be found in [../examples/put-ecs-container-status-to-s3](../examples/put-ecs-container-status-to-s3) directory. To enable task notification with S3, you have to configure scheduler in YAML. ```yaml scheduler: type: ecs oneshot_notification_prefix: 's3://ecs-task-notifications/task_statuses?region=ap-northeast-1' ``` It uses ecs-task-notifications bucket in ap-northeast-1 region. ## Instruction: Use Jsonnet format in docs ## Code After: In ECS scheduler, `hako oneshot` supports multiple methods of detecting task finish. ## ecs:DescribeTasks (default) Use [DescribeTasks](http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeTasks.html) API to get the task status. This method can be used without any preparation or configuration, but the DescribeTasks API can return "Rate exceeded" error when there's several running `hako oneshot` processes. ## s3:GetObject Amazon ECS has integration with Amazon CloudWatch Events. The integration notifies ECS task state changes to AWS Lambda, Amazon SNS, Amazon SQS, and so on. http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_cwe_events.html#ecs_task_events Amazon S3 is a good storage for polling, so connecting CloudWatch Events to AWS Lambda and put the payload to S3 is more scalable than ecs:DescribeTasks. The example implementation of AWS Lambda can be found in [../examples/put-ecs-container-status-to-s3](../examples/put-ecs-container-status-to-s3) directory. To enable task notification with S3, you have to configure scheduler in definition file. ```js { scheduler: { type: 'ecs', oneshot_notification_prefix: 's3://ecs-task-notifications/task_statuses?region=ap-northeast-1', }, } ``` It uses ecs-task-notifications bucket in ap-northeast-1 region.
In ECS scheduler, `hako oneshot` supports multiple methods of detecting task finish. ## ecs:DescribeTasks (default) Use [DescribeTasks](http://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeTasks.html) API to get the task status. This method can be used without any preparation or configuration, but the DescribeTasks API can return "Rate exceeded" error when there's several running `hako oneshot` processes. ## s3:GetObject Amazon ECS has integration with Amazon CloudWatch Events. The integration notifies ECS task state changes to AWS Lambda, Amazon SNS, Amazon SQS, and so on. http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_cwe_events.html#ecs_task_events Amazon S3 is a good storage for polling, so connecting CloudWatch Events to AWS Lambda and put the payload to S3 is more scalable than ecs:DescribeTasks. The example implementation of AWS Lambda can be found in [../examples/put-ecs-container-status-to-s3](../examples/put-ecs-container-status-to-s3) directory. - To enable task notification with S3, you have to configure scheduler in YAML. ? ^^^^ + To enable task notification with S3, you have to configure scheduler in definition file. ? ^^^^^^^^^^^^^^^ - ```yaml + ```js + { - scheduler: + scheduler: { ? ++ ++ - type: ecs + type: 'ecs', ? ++ + ++ - oneshot_notification_prefix: 's3://ecs-task-notifications/task_statuses?region=ap-northeast-1' + oneshot_notification_prefix: 's3://ecs-task-notifications/task_statuses?region=ap-northeast-1', ? ++ + + }, + } ``` It uses ecs-task-notifications bucket in ap-northeast-1 region.
13
0.565217
8
5
07c25fda408a39781e4b5435b1cf9552bd29853b
resources/views/main.php
resources/views/main.php
<!doctype html> <html> <head> <title>Kathy's Garden Planner</title> <link rel="stylesheet" href="style.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.33.0/es6-shim.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/fetch/0.9.0/fetch.min.js"></script> <script src="https://apis.google.com/js/platform.js" async defer></script> <meta charset="utf-8"> <meta name="google-signin-client_id" content="<?php echo $googleClientId; ?>"> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <div id="app"></div> <script src="main.js"></script> </body> </html>
<!doctype html> <html> <head> <title>Kathy's Garden Planner</title> <link rel="stylesheet" href="style.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.33.8/es6-shim.min.js"></script> <script src="https://apis.google.com/js/platform.js" async defer></script> <meta charset="utf-8"> <meta name="google-signin-client_id" content="<?php echo $googleClientId; ?>"> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <div id="app"></div> <script src="main.js"></script> </body> </html>
Remove CDN for fetch and bump version for es6-shim
Remove CDN for fetch and bump version for es6-shim The fetch API is now pulled in by isomorphic-fetch.
PHP
mit
colinjeanne/garden,colinjeanne/garden
php
## Code Before: <!doctype html> <html> <head> <title>Kathy's Garden Planner</title> <link rel="stylesheet" href="style.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.33.0/es6-shim.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/fetch/0.9.0/fetch.min.js"></script> <script src="https://apis.google.com/js/platform.js" async defer></script> <meta charset="utf-8"> <meta name="google-signin-client_id" content="<?php echo $googleClientId; ?>"> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <div id="app"></div> <script src="main.js"></script> </body> </html> ## Instruction: Remove CDN for fetch and bump version for es6-shim The fetch API is now pulled in by isomorphic-fetch. ## Code After: <!doctype html> <html> <head> <title>Kathy's Garden Planner</title> <link rel="stylesheet" href="style.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.33.8/es6-shim.min.js"></script> <script src="https://apis.google.com/js/platform.js" async defer></script> <meta charset="utf-8"> <meta name="google-signin-client_id" content="<?php echo $googleClientId; ?>"> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <div id="app"></div> <script src="main.js"></script> </body> </html>
<!doctype html> <html> <head> <title>Kathy's Garden Planner</title> <link rel="stylesheet" href="style.css"> - <script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.33.0/es6-shim.min.js"></script> ? ^ + <script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.33.8/es6-shim.min.js"></script> ? ^ - <script src="https://cdnjs.cloudflare.com/ajax/libs/fetch/0.9.0/fetch.min.js"></script> <script src="https://apis.google.com/js/platform.js" async defer></script> <meta charset="utf-8"> <meta name="google-signin-client_id" content="<?php echo $googleClientId; ?>"> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <div id="app"></div> <script src="main.js"></script> </body> </html>
3
0.176471
1
2
3507be67990c5d89060c593e6207443834f5b940
Kwc/User/BoxWithoutLogin/Component.tpl
Kwc/User/BoxWithoutLogin/Component.tpl
<div class="<?=$this->cssClass?>"> <ul> <li><?=$this->componentLink($this->login, $this->data->trlKwf('Login'))?><?=$this->linkPostfix?></li> <li class="register"><?=$this->componentLink($this->register, $this->data->trlKwf('Register'))?><?=$this->linkPostfix?></li> <? if ($this->lostPassword) { ?> <li><?=$this->componentLink($this->lostPassword, $this->data->trlKwf('Lost password'))?><?=$this->linkPostfix?></li> <? } ?> </ul> </div>
<div class="<?=$this->cssClass?>"> <ul> <? if ($this->login) { ?> <li><?=$this->componentLink($this->login, $this->data->trlKwf('Login'))?><?=$this->linkPostfix?></li> <? } ?> <? if ($this->register) { ?> <li class="register"><?=$this->componentLink($this->register, $this->data->trlKwf('Register'))?><?=$this->linkPostfix?></li> <? } ?> <? if ($this->lostPassword) { ?> <li><?=$this->componentLink($this->lostPassword, $this->data->trlKwf('Lost password'))?><?=$this->linkPostfix?></li> <? } ?> </ul> </div>
Add check to template if components are not set
Add check to template if components are not set Now every component (register, loginLink and lostPassword) are optional therefore they should be only conditional in template
Smarty
bsd-2-clause
yacon/koala-framework,nsams/koala-framework,kaufmo/koala-framework,Ben-Ho/koala-framework,yacon/koala-framework,yacon/koala-framework,kaufmo/koala-framework,fraxachun/koala-framework,darimpulso/koala-framework,nsams/koala-framework,nsams/koala-framework,Ben-Ho/koala-framework,koala-framework/koala-framework,fraxachun/koala-framework,koala-framework/koala-framework,darimpulso/koala-framework,Sogl/koala-framework,kaufmo/koala-framework,Sogl/koala-framework
smarty
## Code Before: <div class="<?=$this->cssClass?>"> <ul> <li><?=$this->componentLink($this->login, $this->data->trlKwf('Login'))?><?=$this->linkPostfix?></li> <li class="register"><?=$this->componentLink($this->register, $this->data->trlKwf('Register'))?><?=$this->linkPostfix?></li> <? if ($this->lostPassword) { ?> <li><?=$this->componentLink($this->lostPassword, $this->data->trlKwf('Lost password'))?><?=$this->linkPostfix?></li> <? } ?> </ul> </div> ## Instruction: Add check to template if components are not set Now every component (register, loginLink and lostPassword) are optional therefore they should be only conditional in template ## Code After: <div class="<?=$this->cssClass?>"> <ul> <? if ($this->login) { ?> <li><?=$this->componentLink($this->login, $this->data->trlKwf('Login'))?><?=$this->linkPostfix?></li> <? } ?> <? if ($this->register) { ?> <li class="register"><?=$this->componentLink($this->register, $this->data->trlKwf('Register'))?><?=$this->linkPostfix?></li> <? } ?> <? if ($this->lostPassword) { ?> <li><?=$this->componentLink($this->lostPassword, $this->data->trlKwf('Lost password'))?><?=$this->linkPostfix?></li> <? } ?> </ul> </div>
<div class="<?=$this->cssClass?>"> <ul> + <? if ($this->login) { ?> - <li><?=$this->componentLink($this->login, $this->data->trlKwf('Login'))?><?=$this->linkPostfix?></li> + <li><?=$this->componentLink($this->login, $this->data->trlKwf('Login'))?><?=$this->linkPostfix?></li> ? ++++ + <? } ?> + + <? if ($this->register) { ?> - <li class="register"><?=$this->componentLink($this->register, $this->data->trlKwf('Register'))?><?=$this->linkPostfix?></li> + <li class="register"><?=$this->componentLink($this->register, $this->data->trlKwf('Register'))?><?=$this->linkPostfix?></li> ? ++++ + <? } ?> + <? if ($this->lostPassword) { ?> - <li><?=$this->componentLink($this->lostPassword, $this->data->trlKwf('Lost password'))?><?=$this->linkPostfix?></li> + <li><?=$this->componentLink($this->lostPassword, $this->data->trlKwf('Lost password'))?><?=$this->linkPostfix?></li> ? ++++ <? } ?> </ul> </div>
12
1.333333
9
3
cde02b548326ff548e40e021e7913fa455674f8e
metadata/rasel.lunar.launcher.yml
metadata/rasel.lunar.launcher.yml
Categories: - System - Theming License: GPL-3.0-only AuthorName: Md Rasel Hossain AuthorEmail: iamrasel@proton.me AuthorWebSite: https://iamrasel.github.io SourceCode: https://github.com/iamrasel/lunar-launcher IssueTracker: https://github.com/iamrasel/lunar-launcher/issues Bitcoin: 38mRQy6oDJjZNR3xxiNRVS5obqLMnwonFD AutoName: Lunar Launcher RepoType: git Repo: https://github.com/iamrasel/lunar-launcher Builds: - versionName: '15.0' versionCode: 15 commit: 854ca6a7ae4de42aa3725fc82f6c5cf7f41344cf subdir: app sudo: - apt-get update || apt-get update - apt-get install -y openjdk-11-jdk-headless - update-alternatives --auto java gradle: - yes AutoUpdateMode: Version UpdateCheckMode: Tags CurrentVersion: '15.0' CurrentVersionCode: 15
Categories: - System - Theming License: GPL-3.0-only AuthorName: Md Rasel Hossain AuthorEmail: iamrasel@proton.me AuthorWebSite: https://iamrasel.github.io SourceCode: https://github.com/iamrasel/lunar-launcher IssueTracker: https://github.com/iamrasel/lunar-launcher/issues Bitcoin: 38mRQy6oDJjZNR3xxiNRVS5obqLMnwonFD AutoName: Lunar Launcher RepoType: git Repo: https://github.com/iamrasel/lunar-launcher Builds: - versionName: '15.0' versionCode: 15 commit: 854ca6a7ae4de42aa3725fc82f6c5cf7f41344cf subdir: app sudo: - apt-get update || apt-get update - apt-get install -y openjdk-11-jdk-headless - update-alternatives --auto java gradle: - yes - versionName: '15.5' versionCode: 16 commit: 30d4a5a1b45ac5485d06b06af02cdbe21fd8e5e5 subdir: app sudo: - apt-get update || apt-get update - apt-get install -y openjdk-11-jdk-headless - update-alternatives --auto java gradle: - yes AutoUpdateMode: Version UpdateCheckMode: Tags CurrentVersion: '15.5' CurrentVersionCode: 16
Update Lunar Launcher to 15.5 (16)
Update Lunar Launcher to 15.5 (16)
YAML
agpl-3.0
f-droid/fdroiddata,f-droid/fdroiddata
yaml
## Code Before: Categories: - System - Theming License: GPL-3.0-only AuthorName: Md Rasel Hossain AuthorEmail: iamrasel@proton.me AuthorWebSite: https://iamrasel.github.io SourceCode: https://github.com/iamrasel/lunar-launcher IssueTracker: https://github.com/iamrasel/lunar-launcher/issues Bitcoin: 38mRQy6oDJjZNR3xxiNRVS5obqLMnwonFD AutoName: Lunar Launcher RepoType: git Repo: https://github.com/iamrasel/lunar-launcher Builds: - versionName: '15.0' versionCode: 15 commit: 854ca6a7ae4de42aa3725fc82f6c5cf7f41344cf subdir: app sudo: - apt-get update || apt-get update - apt-get install -y openjdk-11-jdk-headless - update-alternatives --auto java gradle: - yes AutoUpdateMode: Version UpdateCheckMode: Tags CurrentVersion: '15.0' CurrentVersionCode: 15 ## Instruction: Update Lunar Launcher to 15.5 (16) ## Code After: Categories: - System - Theming License: GPL-3.0-only AuthorName: Md Rasel Hossain AuthorEmail: iamrasel@proton.me AuthorWebSite: https://iamrasel.github.io SourceCode: https://github.com/iamrasel/lunar-launcher IssueTracker: https://github.com/iamrasel/lunar-launcher/issues Bitcoin: 38mRQy6oDJjZNR3xxiNRVS5obqLMnwonFD AutoName: Lunar Launcher RepoType: git Repo: https://github.com/iamrasel/lunar-launcher Builds: - versionName: '15.0' versionCode: 15 commit: 854ca6a7ae4de42aa3725fc82f6c5cf7f41344cf subdir: app sudo: - apt-get update || apt-get update - apt-get install -y openjdk-11-jdk-headless - update-alternatives --auto java gradle: - yes - versionName: '15.5' versionCode: 16 commit: 30d4a5a1b45ac5485d06b06af02cdbe21fd8e5e5 subdir: app sudo: - apt-get update || apt-get update - apt-get install -y openjdk-11-jdk-headless - update-alternatives --auto java gradle: - yes AutoUpdateMode: Version UpdateCheckMode: Tags CurrentVersion: '15.5' CurrentVersionCode: 16
Categories: - System - Theming License: GPL-3.0-only AuthorName: Md Rasel Hossain AuthorEmail: iamrasel@proton.me AuthorWebSite: https://iamrasel.github.io SourceCode: https://github.com/iamrasel/lunar-launcher IssueTracker: https://github.com/iamrasel/lunar-launcher/issues Bitcoin: 38mRQy6oDJjZNR3xxiNRVS5obqLMnwonFD AutoName: Lunar Launcher RepoType: git Repo: https://github.com/iamrasel/lunar-launcher Builds: - versionName: '15.0' versionCode: 15 commit: 854ca6a7ae4de42aa3725fc82f6c5cf7f41344cf subdir: app sudo: - apt-get update || apt-get update - apt-get install -y openjdk-11-jdk-headless - update-alternatives --auto java gradle: - yes + - versionName: '15.5' + versionCode: 16 + commit: 30d4a5a1b45ac5485d06b06af02cdbe21fd8e5e5 + subdir: app + sudo: + - apt-get update || apt-get update + - apt-get install -y openjdk-11-jdk-headless + - update-alternatives --auto java + gradle: + - yes + AutoUpdateMode: Version UpdateCheckMode: Tags - CurrentVersion: '15.0' ? ^ + CurrentVersion: '15.5' ? ^ - CurrentVersionCode: 15 ? ^ + CurrentVersionCode: 16 ? ^
15
0.46875
13
2
08aa6feb2d00d03051355105072dd116ea200161
.circleci/init-and-test-on-linux.sh
.circleci/init-and-test-on-linux.sh
bash -x bootstrap.sh # initialize machine ansible-playbook -i localhost oh-my-laptop.yml --extra-vars="ansible_become_pass=" # run test ruby tests/test-linux.rb
bash -x bootstrap.sh # initialize machine ansible-playbook -i localhost oh-my-laptop.yml --extra-vars="ansible_become_pass=" # run test gem install minitest ruby tests/test-linux.rb
Install minitest for circleci manually.
Install minitest for circleci manually.
Shell
bsd-3-clause
xiaohanyu/oh-my-laptop,xiaohanyu/oh-my-laptop
shell
## Code Before: bash -x bootstrap.sh # initialize machine ansible-playbook -i localhost oh-my-laptop.yml --extra-vars="ansible_become_pass=" # run test ruby tests/test-linux.rb ## Instruction: Install minitest for circleci manually. ## Code After: bash -x bootstrap.sh # initialize machine ansible-playbook -i localhost oh-my-laptop.yml --extra-vars="ansible_become_pass=" # run test gem install minitest ruby tests/test-linux.rb
bash -x bootstrap.sh # initialize machine ansible-playbook -i localhost oh-my-laptop.yml --extra-vars="ansible_become_pass=" # run test + gem install minitest ruby tests/test-linux.rb
1
0.142857
1
0
17b94cf3d4dcfe5960d376eeb279102b34144dbe
src/GenPHP/Operation/CreateDirOperation.php
src/GenPHP/Operation/CreateDirOperation.php
<?php namespace GenPHP\Operation; use GenPHP\Operation\Helper; class CreateDirOperation extends Operation { function run($dir) { $this->getLogger()->info("create $dir",1); Helper::mktree($dir); } }
<?php namespace GenPHP\Operation; use GenPHP\Operation\Helper; class CreateDirOperation extends Operation { function run($dir) { $this->logAction('create', $dir); Helper::mktree($dir); } }
Update CreateDir operation with logAction method.
Update CreateDir operation with logAction method.
PHP
bsd-3-clause
c9s/GenPHP,c9s/GenPHP
php
## Code Before: <?php namespace GenPHP\Operation; use GenPHP\Operation\Helper; class CreateDirOperation extends Operation { function run($dir) { $this->getLogger()->info("create $dir",1); Helper::mktree($dir); } } ## Instruction: Update CreateDir operation with logAction method. ## Code After: <?php namespace GenPHP\Operation; use GenPHP\Operation\Helper; class CreateDirOperation extends Operation { function run($dir) { $this->logAction('create', $dir); Helper::mktree($dir); } }
<?php namespace GenPHP\Operation; use GenPHP\Operation\Helper; class CreateDirOperation extends Operation { function run($dir) { - $this->getLogger()->info("create $dir",1); + $this->logAction('create', $dir); Helper::mktree($dir); } }
2
0.142857
1
1
23bb14d7c13103c23dcbd2cbaf3494ab2b12a935
README.md
README.md
This addon provides an OAuth2 password grant Authenticator that allows passing of user profile information for user registration. ## Installation `ember install ember-simple-auth-registration` ## Use In your application create an authorizer that extends from `oauth2-password-registration`: ```js // app/authenticators/register.js import Registration from 'ember-simple-auth-registration/authenticators/oauth2-password-registration'; export default Registration.extend(); ``` Then in your registration action: ```js let { identification, password } = this.getProperties('identification', 'password'); let userData = /* get your user data some way */ {}; this.get('session').authenticate('authenticator:register', identification, password, userData).catch((reason) => { this.set('errorMessage', reason.error || reason); }); ``` This will JSON stringify the `userData` variable and pass it as a `user_data` parameter to your server. ## Customization You will likely want to customize
This addon provides an OAuth2 password grant Authenticator that allows passing of user profile information for user registration. ## Installation `ember install ember-simple-auth-registration` ## Use In your application create an authorizer that extends from `oauth2-password-registration`: ```js // app/authenticators/register.js import Registration from 'ember-simple-auth-registration/authenticators/oauth2-password-registration'; export default Registration.extend(); ``` Then in your registration action: ```js let { identification, password } = this.getProperties('identification', 'password'); let userData = /* get your user data some way */ {}; this.get('session').authenticate('authenticator:register', identification, password, userData).catch((reason) => { this.set('errorMessage', reason.error || reason); }); ``` This will JSON stringify the `userData` variable and pass it as a `user_data` parameter to your server. ## Customization You will likely want to customize the `registrationEndpoint` to match the API route for your registration: ```js // app/authenticators/register.js import Registration from 'ember-simple-auth-registration/authenticators/oauth2-password-registration'; export default Registration.extend({ registrationEndpoint: '/api/register', }); ```
Update readme for registration endpoint
Update readme for registration endpoint
Markdown
mit
rtablada/ember-simple-auth-registration,rtablada/ember-simple-auth-registration
markdown
## Code Before: This addon provides an OAuth2 password grant Authenticator that allows passing of user profile information for user registration. ## Installation `ember install ember-simple-auth-registration` ## Use In your application create an authorizer that extends from `oauth2-password-registration`: ```js // app/authenticators/register.js import Registration from 'ember-simple-auth-registration/authenticators/oauth2-password-registration'; export default Registration.extend(); ``` Then in your registration action: ```js let { identification, password } = this.getProperties('identification', 'password'); let userData = /* get your user data some way */ {}; this.get('session').authenticate('authenticator:register', identification, password, userData).catch((reason) => { this.set('errorMessage', reason.error || reason); }); ``` This will JSON stringify the `userData` variable and pass it as a `user_data` parameter to your server. ## Customization You will likely want to customize ## Instruction: Update readme for registration endpoint ## Code After: This addon provides an OAuth2 password grant Authenticator that allows passing of user profile information for user registration. ## Installation `ember install ember-simple-auth-registration` ## Use In your application create an authorizer that extends from `oauth2-password-registration`: ```js // app/authenticators/register.js import Registration from 'ember-simple-auth-registration/authenticators/oauth2-password-registration'; export default Registration.extend(); ``` Then in your registration action: ```js let { identification, password } = this.getProperties('identification', 'password'); let userData = /* get your user data some way */ {}; this.get('session').authenticate('authenticator:register', identification, password, userData).catch((reason) => { this.set('errorMessage', reason.error || reason); }); ``` This will JSON stringify the `userData` variable and pass it as a `user_data` parameter to your server. ## Customization You will likely want to customize the `registrationEndpoint` to match the API route for your registration: ```js // app/authenticators/register.js import Registration from 'ember-simple-auth-registration/authenticators/oauth2-password-registration'; export default Registration.extend({ registrationEndpoint: '/api/register', }); ```
This addon provides an OAuth2 password grant Authenticator that allows passing of user profile information for user registration. ## Installation `ember install ember-simple-auth-registration` ## Use In your application create an authorizer that extends from `oauth2-password-registration`: ```js // app/authenticators/register.js import Registration from 'ember-simple-auth-registration/authenticators/oauth2-password-registration'; export default Registration.extend(); ``` Then in your registration action: ```js let { identification, password } = this.getProperties('identification', 'password'); let userData = /* get your user data some way */ {}; this.get('session').authenticate('authenticator:register', identification, password, userData).catch((reason) => { this.set('errorMessage', reason.error || reason); }); ``` This will JSON stringify the `userData` variable and pass it as a `user_data` parameter to your server. ## Customization - You will likely want to customize + You will likely want to customize the `registrationEndpoint` to match the API route for your registration: + + ```js + // app/authenticators/register.js + import Registration from 'ember-simple-auth-registration/authenticators/oauth2-password-registration'; + + export default Registration.extend({ + registrationEndpoint: '/api/register', + }); + ```
11
0.333333
10
1
9fe97ce4e33898dc3b1370e7ddf072ba45ee0067
src/test/java/syntax/SyntaxTestBase.java
src/test/java/syntax/SyntaxTestBase.java
package syntax; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import org.extendj.JavaChecker; import org.extendj.parser.JavaParser; import static java.nio.charset.StandardCharsets.UTF_8; import static org.junit.Assert.*; public abstract class SyntaxTestBase { private static final String DIR = "src/test/resources/syntax/"; private static class Checker extends JavaChecker { private String runChecker(String file) throws IOException { run(new String[]{file}); return program.structuredPrettyPrint(); } } private static String slurp(String file) throws IOException { return new String(Files.readAllBytes(Paths.get(file)), UTF_8); } protected void checkSyntax(String name) { String actual, expected; try { actual = new Checker().runChecker(DIR + name + ".java"); expected = slurp(DIR + name + ".expected"); } catch (IOException e) { throw new RuntimeException(e); } assertEquals(expected.trim(), actual.trim()); } }
package syntax; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import org.extendj.JavaChecker; import org.extendj.parser.JavaParser; import static java.nio.charset.StandardCharsets.UTF_8; import static org.junit.Assert.*; public abstract class SyntaxTestBase { private static final String DIR = "src/test/resources/syntax/"; private static class Checker extends JavaChecker { private String runChecker(String file) throws IOException { run(new String[]{"-classpath", "build/classes/main", file}); return program.structuredPrettyPrint(); } } private static String slurp(String file) throws IOException { return new String(Files.readAllBytes(Paths.get(file)), UTF_8); } protected void checkSyntax(String name) { String actual, expected; try { actual = new Checker().runChecker(DIR + name + ".java"); expected = slurp(DIR + name + ".expected"); } catch (IOException e) { throw new RuntimeException(e); } assertEquals(expected.trim(), actual.trim()); } }
Add proper classpath to syntax tests
Add proper classpath to syntax tests To prevent unknown type errors being spewed on stderr.
Java
apache-2.0
hartenfels/Jastics,hartenfels/Semantics4J
java
## Code Before: package syntax; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import org.extendj.JavaChecker; import org.extendj.parser.JavaParser; import static java.nio.charset.StandardCharsets.UTF_8; import static org.junit.Assert.*; public abstract class SyntaxTestBase { private static final String DIR = "src/test/resources/syntax/"; private static class Checker extends JavaChecker { private String runChecker(String file) throws IOException { run(new String[]{file}); return program.structuredPrettyPrint(); } } private static String slurp(String file) throws IOException { return new String(Files.readAllBytes(Paths.get(file)), UTF_8); } protected void checkSyntax(String name) { String actual, expected; try { actual = new Checker().runChecker(DIR + name + ".java"); expected = slurp(DIR + name + ".expected"); } catch (IOException e) { throw new RuntimeException(e); } assertEquals(expected.trim(), actual.trim()); } } ## Instruction: Add proper classpath to syntax tests To prevent unknown type errors being spewed on stderr. ## Code After: package syntax; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import org.extendj.JavaChecker; import org.extendj.parser.JavaParser; import static java.nio.charset.StandardCharsets.UTF_8; import static org.junit.Assert.*; public abstract class SyntaxTestBase { private static final String DIR = "src/test/resources/syntax/"; private static class Checker extends JavaChecker { private String runChecker(String file) throws IOException { run(new String[]{"-classpath", "build/classes/main", file}); return program.structuredPrettyPrint(); } } private static String slurp(String file) throws IOException { return new String(Files.readAllBytes(Paths.get(file)), UTF_8); } protected void checkSyntax(String name) { String actual, expected; try { actual = new Checker().runChecker(DIR + name + ".java"); expected = slurp(DIR + name + ".expected"); } catch (IOException e) { throw new RuntimeException(e); } assertEquals(expected.trim(), actual.trim()); } }
package syntax; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import org.extendj.JavaChecker; import org.extendj.parser.JavaParser; import static java.nio.charset.StandardCharsets.UTF_8; import static org.junit.Assert.*; public abstract class SyntaxTestBase { private static final String DIR = "src/test/resources/syntax/"; private static class Checker extends JavaChecker { private String runChecker(String file) throws IOException { - run(new String[]{file}); + run(new String[]{"-classpath", "build/classes/main", file}); return program.structuredPrettyPrint(); } } private static String slurp(String file) throws IOException { return new String(Files.readAllBytes(Paths.get(file)), UTF_8); } protected void checkSyntax(String name) { String actual, expected; try { actual = new Checker().runChecker(DIR + name + ".java"); expected = slurp(DIR + name + ".expected"); } catch (IOException e) { throw new RuntimeException(e); } assertEquals(expected.trim(), actual.trim()); } }
2
0.054054
1
1
35862267e32d6750a84400564a20ccb8f1d30b09
recipes/liquidprompt/build.sh
recipes/liquidprompt/build.sh
set +x set windows= if [[ $OS == Windows* ]]; then windows=1 export PATH=${LIBRARY_BIN}:$PATH fi # there is no build step export prefix=$PREFIX if [ ! -z ${windows} ]; then exit 1 else sed -i'' -e "s|/etc/liquidpromptrc|$PREFIX/etc/liquidpromptrc|g" liquidprompt sed -i'' \ -e "s|~/.config/liquidprompt/nojhan.theme|$PREFIX/etc/liquidprompt/liquid.theme|" \ -e "s|~/.config/liquidprompt/nojhan.ps1|$PREFIX/etc/liquidprompt/liquid.ps1|" \ liquidpromptrc-dist mkdir -p $PREFIX/etc/conda/activate.d cp liquidprompt $PREFIX/etc/conda/activate.d/liquidprompt.sh cp liquidpromptrc-dist $PREFIX/etc/liquidpromptrc mkdir -p $PREFIX/etc/liquidprompt cp liquid.ps1 liquid.theme $PREFIX/etc/liquidprompt fi
set +x set windows= if [[ $OS == Windows* ]]; then windows=1 export PATH=${LIBRARY_BIN}:$PATH fi # there is no build step export prefix=$PREFIX if [ ! -z ${windows} ]; then exit 1 else sed -e "s|/etc/liquidpromptrc|$PREFIX/etc/liquidpromptrc|g" \ -i \ liquidprompt sed -e "s|~/.config/liquidprompt/nojhan.theme|$PREFIX/etc/liquidprompt/liquid.theme|" \ -e "s|~/.config/liquidprompt/nojhan.ps1|$PREFIX/etc/liquidprompt/liquid.ps1|" \ -i \ liquidpromptrc-dist mkdir -p $PREFIX/etc/conda/activate.d cp liquidprompt $PREFIX/etc/conda/activate.d/liquidprompt.sh cp liquidpromptrc-dist $PREFIX/etc/liquidpromptrc mkdir -p $PREFIX/etc/liquidprompt cp liquid.ps1 liquid.theme $PREFIX/etc/liquidprompt fi
Fix sed call for macos
Fix sed call for macos
Shell
bsd-3-clause
dschreij/staged-recipes,Juanlu001/staged-recipes,jakirkham/staged-recipes,chrisburr/staged-recipes,Juanlu001/staged-recipes,sodre/staged-recipes,shadowwalkersb/staged-recipes,goanpeca/staged-recipes,pmlandwehr/staged-recipes,barkls/staged-recipes,SylvainCorlay/staged-recipes,ceholden/staged-recipes,conda-forge/staged-recipes,igortg/staged-recipes,ReimarBauer/staged-recipes,rmcgibbo/staged-recipes,jjhelmus/staged-recipes,pmlandwehr/staged-recipes,basnijholt/staged-recipes,scopatz/staged-recipes,synapticarbors/staged-recipes,petrushy/staged-recipes,patricksnape/staged-recipes,dschreij/staged-recipes,sodre/staged-recipes,ocefpaf/staged-recipes,asmeurer/staged-recipes,rvalieris/staged-recipes,jjhelmus/staged-recipes,scopatz/staged-recipes,stuertz/staged-recipes,SylvainCorlay/staged-recipes,cpaulik/staged-recipes,mcs07/staged-recipes,rmcgibbo/staged-recipes,isuruf/staged-recipes,jochym/staged-recipes,jakirkham/staged-recipes,guillochon/staged-recipes,rvalieris/staged-recipes,mcs07/staged-recipes,cpaulik/staged-recipes,johanneskoester/staged-recipes,stuertz/staged-recipes,shadowwalkersb/staged-recipes,ReimarBauer/staged-recipes,igortg/staged-recipes,ocefpaf/staged-recipes,jochym/staged-recipes,ceholden/staged-recipes,synapticarbors/staged-recipes,asmeurer/staged-recipes,birdsarah/staged-recipes,kwilcox/staged-recipes,mariusvniekerk/staged-recipes,conda-forge/staged-recipes,mariusvniekerk/staged-recipes,petrushy/staged-recipes,guillochon/staged-recipes,sodre/staged-recipes,johanneskoester/staged-recipes,barkls/staged-recipes,chrisburr/staged-recipes,goanpeca/staged-recipes,hadim/staged-recipes,hadim/staged-recipes,birdsarah/staged-recipes,patricksnape/staged-recipes,basnijholt/staged-recipes,kwilcox/staged-recipes,isuruf/staged-recipes
shell
## Code Before: set +x set windows= if [[ $OS == Windows* ]]; then windows=1 export PATH=${LIBRARY_BIN}:$PATH fi # there is no build step export prefix=$PREFIX if [ ! -z ${windows} ]; then exit 1 else sed -i'' -e "s|/etc/liquidpromptrc|$PREFIX/etc/liquidpromptrc|g" liquidprompt sed -i'' \ -e "s|~/.config/liquidprompt/nojhan.theme|$PREFIX/etc/liquidprompt/liquid.theme|" \ -e "s|~/.config/liquidprompt/nojhan.ps1|$PREFIX/etc/liquidprompt/liquid.ps1|" \ liquidpromptrc-dist mkdir -p $PREFIX/etc/conda/activate.d cp liquidprompt $PREFIX/etc/conda/activate.d/liquidprompt.sh cp liquidpromptrc-dist $PREFIX/etc/liquidpromptrc mkdir -p $PREFIX/etc/liquidprompt cp liquid.ps1 liquid.theme $PREFIX/etc/liquidprompt fi ## Instruction: Fix sed call for macos ## Code After: set +x set windows= if [[ $OS == Windows* ]]; then windows=1 export PATH=${LIBRARY_BIN}:$PATH fi # there is no build step export prefix=$PREFIX if [ ! -z ${windows} ]; then exit 1 else sed -e "s|/etc/liquidpromptrc|$PREFIX/etc/liquidpromptrc|g" \ -i \ liquidprompt sed -e "s|~/.config/liquidprompt/nojhan.theme|$PREFIX/etc/liquidprompt/liquid.theme|" \ -e "s|~/.config/liquidprompt/nojhan.ps1|$PREFIX/etc/liquidprompt/liquid.ps1|" \ -i \ liquidpromptrc-dist mkdir -p $PREFIX/etc/conda/activate.d cp liquidprompt $PREFIX/etc/conda/activate.d/liquidprompt.sh cp liquidpromptrc-dist $PREFIX/etc/liquidpromptrc mkdir -p $PREFIX/etc/liquidprompt cp liquid.ps1 liquid.theme $PREFIX/etc/liquidprompt fi
set +x set windows= if [[ $OS == Windows* ]]; then windows=1 export PATH=${LIBRARY_BIN}:$PATH fi # there is no build step export prefix=$PREFIX if [ ! -z ${windows} ]; then exit 1 else - sed -i'' -e "s|/etc/liquidpromptrc|$PREFIX/etc/liquidpromptrc|g" liquidprompt ? ----- ^^^^^^^^^^^^ + sed -e "s|/etc/liquidpromptrc|$PREFIX/etc/liquidpromptrc|g" \ ? ^ - sed -i'' \ + -i \ + liquidprompt - -e "s|~/.config/liquidprompt/nojhan.theme|$PREFIX/etc/liquidprompt/liquid.theme|" \ ? ^ + sed -e "s|~/.config/liquidprompt/nojhan.theme|$PREFIX/etc/liquidprompt/liquid.theme|" \ ? ^^^ - -e "s|~/.config/liquidprompt/nojhan.ps1|$PREFIX/etc/liquidprompt/liquid.ps1|" \ + -e "s|~/.config/liquidprompt/nojhan.ps1|$PREFIX/etc/liquidprompt/liquid.ps1|" \ ? ++ + -i \ - liquidpromptrc-dist + liquidpromptrc-dist ? ++ mkdir -p $PREFIX/etc/conda/activate.d cp liquidprompt $PREFIX/etc/conda/activate.d/liquidprompt.sh cp liquidpromptrc-dist $PREFIX/etc/liquidpromptrc mkdir -p $PREFIX/etc/liquidprompt cp liquid.ps1 liquid.theme $PREFIX/etc/liquidprompt fi
12
0.444444
7
5
010c2cbe24ab9cd606856d1012ad7a11b41e9b5b
_config.yml
_config.yml
title: Tommy’s stuff url: http://www.tcx.be baseUrl: / permalink: /blog/:year/:title/ paginate: 5 paginate_path: /blog/:num.html sass: sass_dir: assets/_sass style: :compressed kramdown: input: GFM
title: Tommy’s stuff url: http://www.tcx.be baseUrl: / permalink: /blog/:year/:title/ paginate: 5 paginate_path: /blog/:num.html pygments: true sass: sass_dir: assets/_sass style: :compressed kramdown: input: GFM
Enable pygments (for syntax coloring)
Enable pygments (for syntax coloring)
YAML
mit
tommy-carlier/www.tcx.be,tommy-carlier/www.tcx.be,tommy-carlier/www.tcx.be
yaml
## Code Before: title: Tommy’s stuff url: http://www.tcx.be baseUrl: / permalink: /blog/:year/:title/ paginate: 5 paginate_path: /blog/:num.html sass: sass_dir: assets/_sass style: :compressed kramdown: input: GFM ## Instruction: Enable pygments (for syntax coloring) ## Code After: title: Tommy’s stuff url: http://www.tcx.be baseUrl: / permalink: /blog/:year/:title/ paginate: 5 paginate_path: /blog/:num.html pygments: true sass: sass_dir: assets/_sass style: :compressed kramdown: input: GFM
title: Tommy’s stuff url: http://www.tcx.be baseUrl: / permalink: /blog/:year/:title/ paginate: 5 paginate_path: /blog/:num.html + pygments: true sass: sass_dir: assets/_sass style: :compressed kramdown: input: GFM
1
0.076923
1
0
df4f5a2da33c008815763a14a2927d8206e776af
README.md
README.md
Configuration and setup files for setting up an Ubuntu development machine
Configuration and setup files for setting up an Ubuntu development machine ## Bootstrap a New Machine * Updates and upgrades Ubuntu * Installs VirtualBox Guest Additions * Installs Git and Show ### Prerequisites * Ubuntu installed in a VirtualBox VM. ### Instructions Login and run the following shell command. ``` sh -c "$(wget https://raw.githubusercontent.com/lloydk/dotfiles/bootstrap.sh -O -)" ```
Add instructions for bootstrapping a new machine
Add instructions for bootstrapping a new machine
Markdown
mit
lloydk/dotfiles
markdown
## Code Before: Configuration and setup files for setting up an Ubuntu development machine ## Instruction: Add instructions for bootstrapping a new machine ## Code After: Configuration and setup files for setting up an Ubuntu development machine ## Bootstrap a New Machine * Updates and upgrades Ubuntu * Installs VirtualBox Guest Additions * Installs Git and Show ### Prerequisites * Ubuntu installed in a VirtualBox VM. ### Instructions Login and run the following shell command. ``` sh -c "$(wget https://raw.githubusercontent.com/lloydk/dotfiles/bootstrap.sh -O -)" ```
Configuration and setup files for setting up an Ubuntu development machine + + ## Bootstrap a New Machine + * Updates and upgrades Ubuntu + * Installs VirtualBox Guest Additions + * Installs Git and Show + ### Prerequisites + * Ubuntu installed in a VirtualBox VM. + + ### Instructions + Login and run the following shell command. + ``` + sh -c "$(wget https://raw.githubusercontent.com/lloydk/dotfiles/bootstrap.sh -O -)" + ```
13
13
13
0
0942997609b90a6b1bd031d628503f7387840a61
http.go
http.go
package main import ( "encoding/base64" "net/http" "strings" ) func BasicAuth(handler http.HandlerFunc, username, password string) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { authError := func() { w.Header().Set("WWW-Authenticate", "Basic realm=\"Zork\"") http.Error(w, "authorization failed", http.StatusUnauthorized) } auth := strings.SplitN(r.Header.Get("Authorization"), " ", 2) if len(auth) != 2 || auth[0] != "Basic" { authError() return } payload, err := base64.StdEncoding.DecodeString(auth[1]) if err != nil { authError() return } pair := strings.SplitN(string(payload), ":", 2) if len(pair) != 2 || !(pair[0] == username && pair[1] == password) { authError() return } handler(w, r) } }
package main import ( "net/http" ) func BasicAuth(handler http.Handler, username, password string) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { if u, p, ok := r.BasicAuth(); !ok || !(u == username && p == password) { w.Header().Set("WWW-Authenticate", "Basic realm=\"Zork\"") http.Error(w, "authorization failed", http.StatusUnauthorized) return } handler.ServeHTTP(w, r) } }
Simplify basic auth code signifigantly
Simplify basic auth code signifigantly
Go
mit
donatj/explainer
go
## Code Before: package main import ( "encoding/base64" "net/http" "strings" ) func BasicAuth(handler http.HandlerFunc, username, password string) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { authError := func() { w.Header().Set("WWW-Authenticate", "Basic realm=\"Zork\"") http.Error(w, "authorization failed", http.StatusUnauthorized) } auth := strings.SplitN(r.Header.Get("Authorization"), " ", 2) if len(auth) != 2 || auth[0] != "Basic" { authError() return } payload, err := base64.StdEncoding.DecodeString(auth[1]) if err != nil { authError() return } pair := strings.SplitN(string(payload), ":", 2) if len(pair) != 2 || !(pair[0] == username && pair[1] == password) { authError() return } handler(w, r) } } ## Instruction: Simplify basic auth code signifigantly ## Code After: package main import ( "net/http" ) func BasicAuth(handler http.Handler, username, password string) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { if u, p, ok := r.BasicAuth(); !ok || !(u == username && p == password) { w.Header().Set("WWW-Authenticate", "Basic realm=\"Zork\"") http.Error(w, "authorization failed", http.StatusUnauthorized) return } handler.ServeHTTP(w, r) } }
package main import ( - "encoding/base64" "net/http" - "strings" ) - func BasicAuth(handler http.HandlerFunc, username, password string) http.HandlerFunc { ? ---- + func BasicAuth(handler http.Handler, username, password string) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { - authError := func() { + if u, p, ok := r.BasicAuth(); !ok || !(u == username && p == password) { w.Header().Set("WWW-Authenticate", "Basic realm=\"Zork\"") http.Error(w, "authorization failed", http.StatusUnauthorized) - } - - auth := strings.SplitN(r.Header.Get("Authorization"), " ", 2) - if len(auth) != 2 || auth[0] != "Basic" { - authError() return } - payload, err := base64.StdEncoding.DecodeString(auth[1]) - if err != nil { - authError() - return - } - - pair := strings.SplitN(string(payload), ":", 2) - if len(pair) != 2 || !(pair[0] == username && pair[1] == password) { - authError() - return - } - - handler(w, r) + handler.ServeHTTP(w, r) ? ++++++++++ } }
25
0.694444
3
22
771abb08edcd169266a86cc84385a7c914876ce9
composer.json
composer.json
{ "name": "zendframework/zend-memory", "description": " ", "license": "BSD-3-Clause", "keywords": [ "zf2", "memory" ], "homepage": "https://github.com/zendframework/zend-memory", "autoload": { "psr-4": { "Zend\\Memory\\": "src/" } }, "require": { "php": "^5.5 || ^7.0" }, "require-dev": { "zendframework/zend-cache": "^2.7", "squizlabs/php_codesniffer": "^2.3.1", "phpunit/PHPUnit": "^4.8" }, "suggest": { "zendframework/zend-cache": "To support swapping memory objects into and out of non-memory cache storage" }, "minimum-stability": "dev", "prefer-stable": true, "extra": { "branch-alias": { "dev-master": "2.5-dev", "dev-develop": "2.6-dev" } }, "autoload-dev": { "psr-4": { "ZendTest\\Memory\\": "test/" } }, "scripts": { "check": [ "@cs-check", "@test" ], "upload-coverage": "coveralls -v", "cs-check": "phpcs", "cs-fix": "phpcbf", "test": "phpunit", "test-coverage": "phpunit --coverage-clover clover.xml" } }
{ "name": "zendframework/zend-memory", "description": " ", "license": "BSD-3-Clause", "keywords": [ "zf2", "memory" ], "homepage": "https://github.com/zendframework/zend-memory", "autoload": { "psr-4": { "Zend\\Memory\\": "src/" } }, "require": { "php": "^5.5 || ^7.0" }, "require-dev": { "zendframework/zend-cache": "^2.7", "phpunit/PHPUnit": "^4.8", "zendframework/zend-coding-standard": "~1.0.0" }, "suggest": { "zendframework/zend-cache": "To support swapping memory objects into and out of non-memory cache storage" }, "minimum-stability": "dev", "prefer-stable": true, "extra": { "branch-alias": { "dev-master": "2.5-dev", "dev-develop": "2.6-dev" } }, "autoload-dev": { "psr-4": { "ZendTest\\Memory\\": "test/" } }, "scripts": { "check": [ "@cs-check", "@test" ], "upload-coverage": "coveralls -v", "cs-check": "phpcs", "cs-fix": "phpcbf", "test": "phpunit", "test-coverage": "phpunit --coverage-clover clover.xml" } }
Remove CS dependencies and add zend-coding-standard to require-dev
Remove CS dependencies and add zend-coding-standard to require-dev
JSON
bsd-3-clause
zendframework/zend-memory
json
## Code Before: { "name": "zendframework/zend-memory", "description": " ", "license": "BSD-3-Clause", "keywords": [ "zf2", "memory" ], "homepage": "https://github.com/zendframework/zend-memory", "autoload": { "psr-4": { "Zend\\Memory\\": "src/" } }, "require": { "php": "^5.5 || ^7.0" }, "require-dev": { "zendframework/zend-cache": "^2.7", "squizlabs/php_codesniffer": "^2.3.1", "phpunit/PHPUnit": "^4.8" }, "suggest": { "zendframework/zend-cache": "To support swapping memory objects into and out of non-memory cache storage" }, "minimum-stability": "dev", "prefer-stable": true, "extra": { "branch-alias": { "dev-master": "2.5-dev", "dev-develop": "2.6-dev" } }, "autoload-dev": { "psr-4": { "ZendTest\\Memory\\": "test/" } }, "scripts": { "check": [ "@cs-check", "@test" ], "upload-coverage": "coveralls -v", "cs-check": "phpcs", "cs-fix": "phpcbf", "test": "phpunit", "test-coverage": "phpunit --coverage-clover clover.xml" } } ## Instruction: Remove CS dependencies and add zend-coding-standard to require-dev ## Code After: { "name": "zendframework/zend-memory", "description": " ", "license": "BSD-3-Clause", "keywords": [ "zf2", "memory" ], "homepage": "https://github.com/zendframework/zend-memory", "autoload": { "psr-4": { "Zend\\Memory\\": "src/" } }, "require": { "php": "^5.5 || ^7.0" }, "require-dev": { "zendframework/zend-cache": "^2.7", "phpunit/PHPUnit": "^4.8", "zendframework/zend-coding-standard": "~1.0.0" }, "suggest": { "zendframework/zend-cache": "To support swapping memory objects into and out of non-memory cache storage" }, "minimum-stability": "dev", "prefer-stable": true, "extra": { "branch-alias": { "dev-master": "2.5-dev", "dev-develop": "2.6-dev" } }, "autoload-dev": { "psr-4": { "ZendTest\\Memory\\": "test/" } }, "scripts": { "check": [ "@cs-check", "@test" ], "upload-coverage": "coveralls -v", "cs-check": "phpcs", "cs-fix": "phpcbf", "test": "phpunit", "test-coverage": "phpunit --coverage-clover clover.xml" } }
{ "name": "zendframework/zend-memory", "description": " ", "license": "BSD-3-Clause", "keywords": [ "zf2", "memory" ], "homepage": "https://github.com/zendframework/zend-memory", "autoload": { "psr-4": { "Zend\\Memory\\": "src/" } }, "require": { "php": "^5.5 || ^7.0" }, "require-dev": { "zendframework/zend-cache": "^2.7", - "squizlabs/php_codesniffer": "^2.3.1", - "phpunit/PHPUnit": "^4.8" + "phpunit/PHPUnit": "^4.8", ? + + "zendframework/zend-coding-standard": "~1.0.0" }, "suggest": { "zendframework/zend-cache": "To support swapping memory objects into and out of non-memory cache storage" }, "minimum-stability": "dev", "prefer-stable": true, "extra": { "branch-alias": { "dev-master": "2.5-dev", "dev-develop": "2.6-dev" } }, "autoload-dev": { "psr-4": { "ZendTest\\Memory\\": "test/" } }, "scripts": { "check": [ "@cs-check", "@test" ], "upload-coverage": "coveralls -v", "cs-check": "phpcs", "cs-fix": "phpcbf", "test": "phpunit", "test-coverage": "phpunit --coverage-clover clover.xml" } }
4
0.08
2
2
6cf6dd4be86282f4495db0cab76882930ed046d1
nvm/path.zsh
nvm/path.zsh
export NVM_DIR=~/.nvm mkdir -p ~/.nvm source $(brew --prefix nvm)/nvm.sh
export NVM_DIR=~/.nvm mkdir -p ~/.nvm if [[ -a $(brew --prefix nvm)/nvm.sh ]]; then source $(brew --prefix nvm)/nvm.sh fi
Test if file exists before loading nvm
Test if file exists before loading nvm
Shell
mit
frozzare/dotfiles,frozzare/dotfiles
shell
## Code Before: export NVM_DIR=~/.nvm mkdir -p ~/.nvm source $(brew --prefix nvm)/nvm.sh ## Instruction: Test if file exists before loading nvm ## Code After: export NVM_DIR=~/.nvm mkdir -p ~/.nvm if [[ -a $(brew --prefix nvm)/nvm.sh ]]; then source $(brew --prefix nvm)/nvm.sh fi
export NVM_DIR=~/.nvm mkdir -p ~/.nvm + if [[ -a $(brew --prefix nvm)/nvm.sh ]]; then - source $(brew --prefix nvm)/nvm.sh + source $(brew --prefix nvm)/nvm.sh ? ++++ + fi
4
1.333333
3
1
66d690980e430d081faba8608e08d8a68cb9db71
app/scripts/directives/lyraexport.js
app/scripts/directives/lyraexport.js
'use strict'; angular.module('vleApp') .directive('lyraExport', function () { return { template: '<a href="#" ng-click="export()">export to lyra...</a>', restrict: 'E', controller: function ($scope, $timeout, Vegalite, Alerts) { $scope.export = function() { var vegaSpec = Vegalite.vegaSpec; if (!vegaSpec) { Alerts.add('No vega spec present.'); } var lyraURL = 'http://idl.cs.washington.edu/projects/lyra/app/'; var lyraWindow = window.open(lyraURL, '_blank'); // HACK // lyraWindow.onload doesn't work across domains $timeout(function() { Alerts.add('Please check whether lyra loaded the vega spec correctly. This feature is experimental and may not work.', 5000); lyraWindow.postMessage({spec: vegaSpec}, lyraURL); }, 5000); } } }; });
'use strict'; angular.module('vleApp') .directive('lyraExport', function () { return { template: '<a href="#" ng-click="export()">export to lyra...</a>', restrict: 'E', controller: function ($scope, $timeout, Vegalite, Alerts) { $scope.export = function() { var vegaSpec = Vegalite.vegaSpec; if (!vegaSpec) { Alerts.add('No vega spec present.'); } // Hack needed. See https://github.com/uwdata/lyra/issues/214 vegaSpec.marks[0]['lyra.groupType'] = 'layer'; console.log(vegaSpec) var lyraURL = 'http://idl.cs.washington.edu/projects/lyra/app/'; var lyraWindow = window.open(lyraURL, '_blank'); // HACK // lyraWindow.onload doesn't work across domains $timeout(function() { Alerts.add('Please check whether lyra loaded the vega spec correctly. This feature is experimental and may not work.', 5000); lyraWindow.postMessage({spec: vegaSpec}, lyraURL); }, 5000); } } }; });
Make lyra export work thanks to @RussellSprouts and @arvind.
Make lyra export work thanks to @RussellSprouts and @arvind.
JavaScript
bsd-3-clause
vega/polestar,dennari/hack-n-hackers-polestar,uwdata/polestar,sandbox/polestar,hortonworks/polestar,sandbox/polestar,zegang/polestar,zegang/polestar,hortonworks/polestar,pallavkul/polestar,smartpcr/polestar,vivekratnavel/polestar,dennari/hack-n-hackers-polestar,jsanch/polestar,jsanch/polestar,uwdata/polestar,jsanch/polestar,smartpcr/polestar,dennari/hack-n-hackers-polestar,vivekratnavel/polestar,vega/polestar,pallavkul/polestar,vivekratnavel/polestar,smartpcr/polestar,sandbox/polestar,uwdata/polestar,hortonworks/polestar,vega/polestar,pallavkul/polestar,zegang/polestar
javascript
## Code Before: 'use strict'; angular.module('vleApp') .directive('lyraExport', function () { return { template: '<a href="#" ng-click="export()">export to lyra...</a>', restrict: 'E', controller: function ($scope, $timeout, Vegalite, Alerts) { $scope.export = function() { var vegaSpec = Vegalite.vegaSpec; if (!vegaSpec) { Alerts.add('No vega spec present.'); } var lyraURL = 'http://idl.cs.washington.edu/projects/lyra/app/'; var lyraWindow = window.open(lyraURL, '_blank'); // HACK // lyraWindow.onload doesn't work across domains $timeout(function() { Alerts.add('Please check whether lyra loaded the vega spec correctly. This feature is experimental and may not work.', 5000); lyraWindow.postMessage({spec: vegaSpec}, lyraURL); }, 5000); } } }; }); ## Instruction: Make lyra export work thanks to @RussellSprouts and @arvind. ## Code After: 'use strict'; angular.module('vleApp') .directive('lyraExport', function () { return { template: '<a href="#" ng-click="export()">export to lyra...</a>', restrict: 'E', controller: function ($scope, $timeout, Vegalite, Alerts) { $scope.export = function() { var vegaSpec = Vegalite.vegaSpec; if (!vegaSpec) { Alerts.add('No vega spec present.'); } // Hack needed. See https://github.com/uwdata/lyra/issues/214 vegaSpec.marks[0]['lyra.groupType'] = 'layer'; console.log(vegaSpec) var lyraURL = 'http://idl.cs.washington.edu/projects/lyra/app/'; var lyraWindow = window.open(lyraURL, '_blank'); // HACK // lyraWindow.onload doesn't work across domains $timeout(function() { Alerts.add('Please check whether lyra loaded the vega spec correctly. This feature is experimental and may not work.', 5000); lyraWindow.postMessage({spec: vegaSpec}, lyraURL); }, 5000); } } }; });
'use strict'; angular.module('vleApp') .directive('lyraExport', function () { return { template: '<a href="#" ng-click="export()">export to lyra...</a>', restrict: 'E', controller: function ($scope, $timeout, Vegalite, Alerts) { $scope.export = function() { var vegaSpec = Vegalite.vegaSpec; if (!vegaSpec) { Alerts.add('No vega spec present.'); } + // Hack needed. See https://github.com/uwdata/lyra/issues/214 + vegaSpec.marks[0]['lyra.groupType'] = 'layer'; + console.log(vegaSpec) + var lyraURL = 'http://idl.cs.washington.edu/projects/lyra/app/'; var lyraWindow = window.open(lyraURL, '_blank'); // HACK // lyraWindow.onload doesn't work across domains $timeout(function() { Alerts.add('Please check whether lyra loaded the vega spec correctly. This feature is experimental and may not work.', 5000); lyraWindow.postMessage({spec: vegaSpec}, lyraURL); }, 5000); } } }; });
4
0.148148
4
0
69b8b2ad667c3553e9dae12e2999c51032b0bbda
.travis.yml
.travis.yml
language: ruby rvm: - "1.9.3" script: bundle exec rspec before_script: - mysql -e 'create database foosball_test;'
language: ruby rvm: - "1.9.3" script: bundle exec rake db:create db:migrate spec RAILS_ENV=test before_script: - mysql -e 'create database foosball_test;'
Make sure test db tables are created.
Make sure test db tables are created.
YAML
apache-2.0
winterchord/foosball-bagels,winterchord/foosball-bagels,winterchord/foosball-bagels,winterchord/foosball-bagels
yaml
## Code Before: language: ruby rvm: - "1.9.3" script: bundle exec rspec before_script: - mysql -e 'create database foosball_test;' ## Instruction: Make sure test db tables are created. ## Code After: language: ruby rvm: - "1.9.3" script: bundle exec rake db:create db:migrate spec RAILS_ENV=test before_script: - mysql -e 'create database foosball_test;'
language: ruby rvm: - "1.9.3" - script: bundle exec rspec + script: bundle exec rake db:create db:migrate spec RAILS_ENV=test before_script: - mysql -e 'create database foosball_test;'
2
0.333333
1
1
936f50c552627e9122ee8b6388274b3211615351
client/templates/posts/posts_list.html
client/templates/posts/posts_list.html
<template name="postsList"> <div class="container"> <ul class="collection"> {{#each posts}} {{> postItem}} {{/each}} </ul> </div> </template>
<template name="postsList"> <div class="container"> <ul class="collection"> {{#if posts.count}} {{#each posts}} {{> postItem}} {{/each}} {{else}} <li class="collection-item center"> <i class="small material-icons">error_outline</i><br/>There is no item. </li> {{/if}} </ul> </div> </template>
Update Template where empty lists
Update Template where empty lists
HTML
mit
joonas-yoon/Mosaic,joonas-yoon/Mosaic
html
## Code Before: <template name="postsList"> <div class="container"> <ul class="collection"> {{#each posts}} {{> postItem}} {{/each}} </ul> </div> </template> ## Instruction: Update Template where empty lists ## Code After: <template name="postsList"> <div class="container"> <ul class="collection"> {{#if posts.count}} {{#each posts}} {{> postItem}} {{/each}} {{else}} <li class="collection-item center"> <i class="small material-icons">error_outline</i><br/>There is no item. </li> {{/if}} </ul> </div> </template>
<template name="postsList"> <div class="container"> <ul class="collection"> + {{#if posts.count}} {{#each posts}} {{> postItem}} {{/each}} + {{else}} + <li class="collection-item center"> + <i class="small material-icons">error_outline</i><br/>There is no item. + </li> + {{/if}} </ul> </div> </template>
6
0.666667
6
0
84412023437fab532129a4d6ef5bc4f32b98991a
public/javascripts/index.js
public/javascripts/index.js
$(function() { var s = io.connect('http://localhost:3000'); s.on("connect", function () { console.log("connected"); }); s.on("disconnect", function (client) { console.log("disconnected"); }); s.on("receive_stdout", function (data) { $("pre#stdout").append(data.value); // var msg = value.replace( /[!@$%<>'"&|]/g, '' ); //タグ記号とかいくつか削除 }); s.on("receive_stderr", function (data) { $("pre#stderr").append(data.value); }); s.on("receive_exit", function (data) { $("#running-now").hide(); $("div.alert-success").fadeIn("slow"); }); $("#start").click(function() { var name = $("input#name").val(); if (name == "") { $("div.input-warning").fadeIn(); return; } $("div.input-warning").hide(); $("div.alert-success").hide(); $("pre#stdout").text(""); $("pre#stderr").text(""); $("#running-now").fadeIn("slow"); s.emit("run", { value: name }); }); });
$(function() { var s = io.connect('/'); s.on("connect", function () { console.log("connected"); }); s.on("disconnect", function (client) { console.log("disconnected"); }); s.on("receive_stdout", function (data) { $("pre#stdout").append(data.value); // var msg = value.replace( /[!@$%<>'"&|]/g, '' ); //タグ記号とかいくつか削除 }); s.on("receive_stderr", function (data) { $("pre#stderr").append(data.value); }); s.on("receive_exit", function (data) { $("#running-now").hide(); $("div.alert-success").fadeIn("slow"); }); $("#start").click(function() { var name = $("input#name").val(); if (name == "") { $("div.input-warning").fadeIn(); return; } $("div.input-warning").hide(); $("div.alert-success").hide(); $("pre#stdout").text(""); $("pre#stderr").text(""); $("#running-now").fadeIn("slow"); s.emit("run", { value: name }); }); });
Remove server name and port
Remove server name and port
JavaScript
mit
shrkw/run-your-command-via-web-ui,shrkw/run-your-command-via-web-ui
javascript
## Code Before: $(function() { var s = io.connect('http://localhost:3000'); s.on("connect", function () { console.log("connected"); }); s.on("disconnect", function (client) { console.log("disconnected"); }); s.on("receive_stdout", function (data) { $("pre#stdout").append(data.value); // var msg = value.replace( /[!@$%<>'"&|]/g, '' ); //タグ記号とかいくつか削除 }); s.on("receive_stderr", function (data) { $("pre#stderr").append(data.value); }); s.on("receive_exit", function (data) { $("#running-now").hide(); $("div.alert-success").fadeIn("slow"); }); $("#start").click(function() { var name = $("input#name").val(); if (name == "") { $("div.input-warning").fadeIn(); return; } $("div.input-warning").hide(); $("div.alert-success").hide(); $("pre#stdout").text(""); $("pre#stderr").text(""); $("#running-now").fadeIn("slow"); s.emit("run", { value: name }); }); }); ## Instruction: Remove server name and port ## Code After: $(function() { var s = io.connect('/'); s.on("connect", function () { console.log("connected"); }); s.on("disconnect", function (client) { console.log("disconnected"); }); s.on("receive_stdout", function (data) { $("pre#stdout").append(data.value); // var msg = value.replace( /[!@$%<>'"&|]/g, '' ); //タグ記号とかいくつか削除 }); s.on("receive_stderr", function (data) { $("pre#stderr").append(data.value); }); s.on("receive_exit", function (data) { $("#running-now").hide(); $("div.alert-success").fadeIn("slow"); }); $("#start").click(function() { var name = $("input#name").val(); if (name == "") { $("div.input-warning").fadeIn(); return; } $("div.input-warning").hide(); $("div.alert-success").hide(); $("pre#stdout").text(""); $("pre#stderr").text(""); $("#running-now").fadeIn("slow"); s.emit("run", { value: name }); }); });
$(function() { - var s = io.connect('http://localhost:3000'); + var s = io.connect('/'); s.on("connect", function () { console.log("connected"); }); s.on("disconnect", function (client) { console.log("disconnected"); }); s.on("receive_stdout", function (data) { $("pre#stdout").append(data.value); // var msg = value.replace( /[!@$%<>'"&|]/g, '' ); //タグ記号とかいくつか削除 }); s.on("receive_stderr", function (data) { $("pre#stderr").append(data.value); }); s.on("receive_exit", function (data) { $("#running-now").hide(); $("div.alert-success").fadeIn("slow"); }); $("#start").click(function() { var name = $("input#name").val(); if (name == "") { $("div.input-warning").fadeIn(); return; } $("div.input-warning").hide(); $("div.alert-success").hide(); $("pre#stdout").text(""); $("pre#stderr").text(""); $("#running-now").fadeIn("slow"); s.emit("run", { value: name }); }); });
2
0.057143
1
1
b4bd9ba344866e84da3219543b21c9058d3b91d7
app/views/partials/_navbar.erb
app/views/partials/_navbar.erb
<div class="container-fullwidth" id="main"> <nav class="navbar navbar-inverse" style="border-radius:0px;" > <div class="container"> <ul class="nav navbar-nav pull-right"> <li> <a href='#'>home</a> </li> </ul> </div> </nav> </div>
<div class="container-fullwidth" id="main"> <nav class="navbar navbar-inverse" style="border-radius:0px;" > <div class="container"> <ul class="nav navbar-nav pull-right"> <li> <span class="glyphicon glyphicon-leaf"></span> </li> <li> <span class="glyphicon glyphicon-leaf"></span> </li> </ul> </div> </nav> </div>
Remove the home link on the navbar; glyphicon placeholder
Remove the home link on the navbar; glyphicon placeholder
HTML+ERB
mit
groovestation31785/inaturalist,groovestation31785/inaturalist
html+erb
## Code Before: <div class="container-fullwidth" id="main"> <nav class="navbar navbar-inverse" style="border-radius:0px;" > <div class="container"> <ul class="nav navbar-nav pull-right"> <li> <a href='#'>home</a> </li> </ul> </div> </nav> </div> ## Instruction: Remove the home link on the navbar; glyphicon placeholder ## Code After: <div class="container-fullwidth" id="main"> <nav class="navbar navbar-inverse" style="border-radius:0px;" > <div class="container"> <ul class="nav navbar-nav pull-right"> <li> <span class="glyphicon glyphicon-leaf"></span> </li> <li> <span class="glyphicon glyphicon-leaf"></span> </li> </ul> </div> </nav> </div>
<div class="container-fullwidth" id="main"> <nav class="navbar navbar-inverse" style="border-radius:0px;" > <div class="container"> <ul class="nav navbar-nav pull-right"> <li> - <a href='#'>home</a> + <span class="glyphicon glyphicon-leaf"></span> + </li> + <li> + <span class="glyphicon glyphicon-leaf"></span> </li> </ul> </div> </nav> </div>
5
0.454545
4
1
ada54d78ed978fd13383a61c5d1fc175ac6cf544
.travis.yml
.travis.yml
language: ruby sudo: false rvm: - 2.2.3 bundler_args: "--without development:production:intercode1_import" notifications: slack: secure: Fip6shy/5QPPqQc0qZvZnGGZeoc+ZObzQKeDKg46XsyBcAsiJO/f6GiALstWOY+Ne8Uo4V/FtzLEN3D/yV02FbJPAFh60JDcy15ltVBkQNZGeu9wQMIqdbuDkm+M7s9rp4f9/J3z39Yuas6EKzTk88Qt4EQyJTktqXDawKMKE+Q=
language: ruby sudo: false rvm: - 2.2.3 bundler_args: "--without development:production:intercode1_import" before_script: - cp config/database.yml.dev config/database.yml - bin/rake db:create db:migrate RAILS_ENV=test notifications: slack: secure: Fip6shy/5QPPqQc0qZvZnGGZeoc+ZObzQKeDKg46XsyBcAsiJO/f6GiALstWOY+Ne8Uo4V/FtzLEN3D/yV02FbJPAFh60JDcy15ltVBkQNZGeu9wQMIqdbuDkm+M7s9rp4f9/J3z39Yuas6EKzTk88Qt4EQyJTktqXDawKMKE+Q=
Set up database in Travis
Set up database in Travis
YAML
mit
neinteractiveliterature/intercode,neinteractiveliterature/intercode,neinteractiveliterature/intercode,neinteractiveliterature/intercode,neinteractiveliterature/intercode
yaml
## Code Before: language: ruby sudo: false rvm: - 2.2.3 bundler_args: "--without development:production:intercode1_import" notifications: slack: secure: Fip6shy/5QPPqQc0qZvZnGGZeoc+ZObzQKeDKg46XsyBcAsiJO/f6GiALstWOY+Ne8Uo4V/FtzLEN3D/yV02FbJPAFh60JDcy15ltVBkQNZGeu9wQMIqdbuDkm+M7s9rp4f9/J3z39Yuas6EKzTk88Qt4EQyJTktqXDawKMKE+Q= ## Instruction: Set up database in Travis ## Code After: language: ruby sudo: false rvm: - 2.2.3 bundler_args: "--without development:production:intercode1_import" before_script: - cp config/database.yml.dev config/database.yml - bin/rake db:create db:migrate RAILS_ENV=test notifications: slack: secure: Fip6shy/5QPPqQc0qZvZnGGZeoc+ZObzQKeDKg46XsyBcAsiJO/f6GiALstWOY+Ne8Uo4V/FtzLEN3D/yV02FbJPAFh60JDcy15ltVBkQNZGeu9wQMIqdbuDkm+M7s9rp4f9/J3z39Yuas6EKzTk88Qt4EQyJTktqXDawKMKE+Q=
language: ruby sudo: false rvm: - 2.2.3 bundler_args: "--without development:production:intercode1_import" + before_script: + - cp config/database.yml.dev config/database.yml + - bin/rake db:create db:migrate RAILS_ENV=test notifications: slack: secure: Fip6shy/5QPPqQc0qZvZnGGZeoc+ZObzQKeDKg46XsyBcAsiJO/f6GiALstWOY+Ne8Uo4V/FtzLEN3D/yV02FbJPAFh60JDcy15ltVBkQNZGeu9wQMIqdbuDkm+M7s9rp4f9/J3z39Yuas6EKzTk88Qt4EQyJTktqXDawKMKE+Q=
3
0.375
3
0
a6f1ac40a44ed7ccf432d1e2f4d019508b2efc8e
test/Feature/testvarargs.ll
test/Feature/testvarargs.ll
implementation declare int "printf"(sbyte*, ...) ;; Prototype for: int __builtin_printf(const char*, ...) int "testvarar"() begin cast int 0 to sbyte* call int(sbyte*, ...) *%printf(sbyte * %0, int 12, sbyte 42); ret int %0 end
implementation declare int "printf"(sbyte*, ...) ;; Prototype for: int __builtin_printf(const char*, ...) int "testvarar"() begin call int(sbyte*, ...) *%printf(sbyte * null, int 12, sbyte 42); ret int %0 end
Use null keyword instead of kludge
Use null keyword instead of kludge git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@778 91177308-0d34-0410-b5e6-96231b3b80d8
LLVM
apache-2.0
apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,chubbymaggie/asap,chubbymaggie/asap,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,dslab-epfl/asap,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,llvm-mirror/llvm,chubbymaggie/asap,dslab-epfl/asap
llvm
## Code Before: implementation declare int "printf"(sbyte*, ...) ;; Prototype for: int __builtin_printf(const char*, ...) int "testvarar"() begin cast int 0 to sbyte* call int(sbyte*, ...) *%printf(sbyte * %0, int 12, sbyte 42); ret int %0 end ## Instruction: Use null keyword instead of kludge git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@778 91177308-0d34-0410-b5e6-96231b3b80d8 ## Code After: implementation declare int "printf"(sbyte*, ...) ;; Prototype for: int __builtin_printf(const char*, ...) int "testvarar"() begin call int(sbyte*, ...) *%printf(sbyte * null, int 12, sbyte 42); ret int %0 end
implementation declare int "printf"(sbyte*, ...) ;; Prototype for: int __builtin_printf(const char*, ...) int "testvarar"() begin - cast int 0 to sbyte* - call int(sbyte*, ...) *%printf(sbyte * %0, int 12, sbyte 42); ? ^^ + call int(sbyte*, ...) *%printf(sbyte * null, int 12, sbyte 42); ? ^^^^ ret int %0 end
3
0.25
1
2
5e928710c2eb420ee12866d8823abef99258a2bf
app/assets/icons/app-icon.svg
app/assets/icons/app-icon.svg
<svg viewBox="0 0 32 32" width="192" height="192" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <circle id="c4-chip" cx="0" cy="0" r="6" stroke-width="1" /> <use id="c4-blue-chip" xlink:href="#c4-chip" fill="#36c" stroke="#149" /> <use id="c4-red-chip" xlink:href="#c4-chip" fill="#c33" stroke="#900" /> </defs> <use xlink:href="#c4-red-chip" x="8" y="8" /> <use xlink:href="#c4-blue-chip" x="8" y="24" /> <use xlink:href="#c4-red-chip" x="24" y="24" /> </svg>
<svg viewBox="0 0 32 32" width="192" height="192" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <circle id="c4-chip" cx="0" cy="0" r="6" stroke-width="1" /> <use id="c4-blue-chip" xlink:href="#c4-chip" fill="#36c" stroke="#149" /> <use id="c4-red-chip" xlink:href="#c4-chip" fill="#c33" stroke="#900" /> </defs> <rect x="0" y="0" width="100%" height="100%" fill="#fff" rx="3" ry="3" /> <use xlink:href="#c4-red-chip" x="8" y="8" /> <use xlink:href="#c4-blue-chip" x="8" y="24" /> <use xlink:href="#c4-red-chip" x="24" y="24" /> </svg>
Add rounded rectangle background to app icon
Add rounded rectangle background to app icon
SVG
mit
caleb531/connect-four
svg
## Code Before: <svg viewBox="0 0 32 32" width="192" height="192" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <circle id="c4-chip" cx="0" cy="0" r="6" stroke-width="1" /> <use id="c4-blue-chip" xlink:href="#c4-chip" fill="#36c" stroke="#149" /> <use id="c4-red-chip" xlink:href="#c4-chip" fill="#c33" stroke="#900" /> </defs> <use xlink:href="#c4-red-chip" x="8" y="8" /> <use xlink:href="#c4-blue-chip" x="8" y="24" /> <use xlink:href="#c4-red-chip" x="24" y="24" /> </svg> ## Instruction: Add rounded rectangle background to app icon ## Code After: <svg viewBox="0 0 32 32" width="192" height="192" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <circle id="c4-chip" cx="0" cy="0" r="6" stroke-width="1" /> <use id="c4-blue-chip" xlink:href="#c4-chip" fill="#36c" stroke="#149" /> <use id="c4-red-chip" xlink:href="#c4-chip" fill="#c33" stroke="#900" /> </defs> <rect x="0" y="0" width="100%" height="100%" fill="#fff" rx="3" ry="3" /> <use xlink:href="#c4-red-chip" x="8" y="8" /> <use xlink:href="#c4-blue-chip" x="8" y="24" /> <use xlink:href="#c4-red-chip" x="24" y="24" /> </svg>
<svg viewBox="0 0 32 32" width="192" height="192" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <circle id="c4-chip" cx="0" cy="0" r="6" stroke-width="1" /> <use id="c4-blue-chip" xlink:href="#c4-chip" fill="#36c" stroke="#149" /> <use id="c4-red-chip" xlink:href="#c4-chip" fill="#c33" stroke="#900" /> </defs> + <rect x="0" y="0" width="100%" height="100%" fill="#fff" rx="3" ry="3" /> <use xlink:href="#c4-red-chip" x="8" y="8" /> <use xlink:href="#c4-blue-chip" x="8" y="24" /> <use xlink:href="#c4-red-chip" x="24" y="24" /> </svg>
1
0.1
1
0
5ce2057098814e34613aec53de631608ff3f2ab7
Sources/Delegates/OutputDelegate.swift
Sources/Delegates/OutputDelegate.swift
import UIKit import SwiftUI class OutputDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { guard let windowScene = scene as? UIWindowScene, session.role == .windowExternalDisplay else { return } let window = UIWindow(windowScene: windowScene) let aspectRatio = window.bounds.width / window.bounds.height let hostingController = UIHostingController<CountdownView>(rootView: CountdownView(aspectRatio: aspectRatio)) window.rootViewController = hostingController window.isHidden = false OutputDisplay.shared.isConnected = true self.window = window } func sceneDidDisconnect(_ scene: UIScene) { OutputDisplay.shared.isConnected = false window = nil } } class OutputDisplay: ObservableObject { static let shared = OutputDisplay() @Published var isConnected = false }
import UIKit import SwiftUI class OutputDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { guard let windowScene = scene as? UIWindowScene, session.role == .windowExternalDisplay else { return } let window = UIWindow(windowScene: windowScene) let aspectRatio = window.bounds.width / window.bounds.height let hostingController = UIHostingController<CountdownView>(rootView: CountdownView(aspectRatio: aspectRatio)) hostingController.view.backgroundColor = .black window.rootViewController = hostingController window.isHidden = false OutputDisplay.shared.isConnected = true self.window = window } func sceneDidDisconnect(_ scene: UIScene) { OutputDisplay.shared.isConnected = false window = nil } } class OutputDisplay: ObservableObject { static let shared = OutputDisplay() @Published var isConnected = false }
Set the background colour of the output hosting controller to black in case of (unexpected) view resizes.
Set the background colour of the output hosting controller to black in case of (unexpected) view resizes.
Swift
mpl-2.0
pixlwave/Countout
swift
## Code Before: import UIKit import SwiftUI class OutputDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { guard let windowScene = scene as? UIWindowScene, session.role == .windowExternalDisplay else { return } let window = UIWindow(windowScene: windowScene) let aspectRatio = window.bounds.width / window.bounds.height let hostingController = UIHostingController<CountdownView>(rootView: CountdownView(aspectRatio: aspectRatio)) window.rootViewController = hostingController window.isHidden = false OutputDisplay.shared.isConnected = true self.window = window } func sceneDidDisconnect(_ scene: UIScene) { OutputDisplay.shared.isConnected = false window = nil } } class OutputDisplay: ObservableObject { static let shared = OutputDisplay() @Published var isConnected = false } ## Instruction: Set the background colour of the output hosting controller to black in case of (unexpected) view resizes. ## Code After: import UIKit import SwiftUI class OutputDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { guard let windowScene = scene as? UIWindowScene, session.role == .windowExternalDisplay else { return } let window = UIWindow(windowScene: windowScene) let aspectRatio = window.bounds.width / window.bounds.height let hostingController = UIHostingController<CountdownView>(rootView: CountdownView(aspectRatio: aspectRatio)) hostingController.view.backgroundColor = .black window.rootViewController = hostingController window.isHidden = false OutputDisplay.shared.isConnected = true self.window = window } func sceneDidDisconnect(_ scene: UIScene) { OutputDisplay.shared.isConnected = false window = nil } } class OutputDisplay: ObservableObject { static let shared = OutputDisplay() @Published var isConnected = false }
import UIKit import SwiftUI class OutputDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { guard let windowScene = scene as? UIWindowScene, session.role == .windowExternalDisplay else { return } let window = UIWindow(windowScene: windowScene) let aspectRatio = window.bounds.width / window.bounds.height let hostingController = UIHostingController<CountdownView>(rootView: CountdownView(aspectRatio: aspectRatio)) + hostingController.view.backgroundColor = .black window.rootViewController = hostingController window.isHidden = false OutputDisplay.shared.isConnected = true self.window = window } func sceneDidDisconnect(_ scene: UIScene) { OutputDisplay.shared.isConnected = false window = nil } } class OutputDisplay: ObservableObject { static let shared = OutputDisplay() @Published var isConnected = false }
1
0.033333
1
0
cc48ae2080bf5a31493467ca203a04c230eb13f2
.travis.yml
.travis.yml
language: ruby rvm: - 2.1 - 2.2 - 2.3.4 - 2.4.1 gemfile: - gemfiles/gemfile - gemfiles/fluentd.0.10.42.gemfile script: "bundle exec rake spec" branches: only: - master
language: ruby rvm: - 2.1 - 2.2 - 2.3.4 - 2.4.1 gemfile: - gemfiles/gemfile - gemfiles/fluentd.0.10.42.gemfile script: "bundle exec rake spec" branches: only: - master matrix: exclude: - rvm: 2.2 gemfile: gemfiles/fluentd.0.10.42.gemfile - rvm: 2.3.4 gemfile: gemfiles/fluentd.0.10.42.gemfile - rvm: 2.4.1 gemfile: gemfiles/fluentd.0.10.42.gemfile
Exclude newer Ruby with Fluentd v0.10 matrix elements
Exclude newer Ruby with Fluentd v0.10 matrix elements
YAML
mit
dtaniwaki/fluent-plugin-fork
yaml
## Code Before: language: ruby rvm: - 2.1 - 2.2 - 2.3.4 - 2.4.1 gemfile: - gemfiles/gemfile - gemfiles/fluentd.0.10.42.gemfile script: "bundle exec rake spec" branches: only: - master ## Instruction: Exclude newer Ruby with Fluentd v0.10 matrix elements ## Code After: language: ruby rvm: - 2.1 - 2.2 - 2.3.4 - 2.4.1 gemfile: - gemfiles/gemfile - gemfiles/fluentd.0.10.42.gemfile script: "bundle exec rake spec" branches: only: - master matrix: exclude: - rvm: 2.2 gemfile: gemfiles/fluentd.0.10.42.gemfile - rvm: 2.3.4 gemfile: gemfiles/fluentd.0.10.42.gemfile - rvm: 2.4.1 gemfile: gemfiles/fluentd.0.10.42.gemfile
language: ruby rvm: - 2.1 - 2.2 - 2.3.4 - 2.4.1 gemfile: - gemfiles/gemfile - gemfiles/fluentd.0.10.42.gemfile script: "bundle exec rake spec" branches: only: - master + matrix: + exclude: + - rvm: 2.2 + gemfile: gemfiles/fluentd.0.10.42.gemfile + - rvm: 2.3.4 + gemfile: gemfiles/fluentd.0.10.42.gemfile + - rvm: 2.4.1 + gemfile: gemfiles/fluentd.0.10.42.gemfile
8
0.5
8
0
07cdf1b20f718f66dbdbfe79811fcc4d0c6b16b1
spec/lib/cuttlefish_smtp_server_spec.rb
spec/lib/cuttlefish_smtp_server_spec.rb
require 'spec_helper' require File.expand_path File.join(File.dirname(__FILE__), '..', '..', 'lib', 'cuttlefish_smtp_server') describe CuttlefishSmtpConnection do describe '#receive_message' do it 'can queue large messages' do connection = CuttlefishSmtpConnection.new('') # This data is still about double what should fit in a TEXT # Something six times bigger than this causes mysql to lose connection on OS X for Matthew connection.current.data = 'a' * 1000000 connection.receive_message end end end
require 'spec_helper' require File.expand_path File.join(File.dirname(__FILE__), '..', '..', 'lib', 'cuttlefish_smtp_server') describe CuttlefishSmtpConnection do describe '#receive_message' do it 'can queue large messages' do connection = CuttlefishSmtpConnection.new('') # This data is still about double what should fit in a TEXT # Something six times bigger than this causes mysql to lose connection on OS X for Matthew connection.current.data = 'a' * 1000000 connection.receive_message end end describe "#receive_plain_auth" do let(:app) { App.create!(name: "test") } let(:connection) { CuttlefishSmtpConnection.new('') } it { expect(connection.receive_plain_auth("foo", "bar")).to eq false } it { expect(connection.receive_plain_auth(app.smtp_username, "bar")).to eq false } it { expect(connection.receive_plain_auth(app.smtp_username, app.smtp_password)).to eq true } end end
Add simple test for smtp authentication
Add simple test for smtp authentication
Ruby
agpl-3.0
idlweb/cuttlefish,pratyushmittal/cuttlefish,idlweb/cuttlefish,pratyushmittal/cuttlefish,pratyushmittal/cuttlefish,idlweb/cuttlefish,pratyushmittal/cuttlefish,idlweb/cuttlefish
ruby
## Code Before: require 'spec_helper' require File.expand_path File.join(File.dirname(__FILE__), '..', '..', 'lib', 'cuttlefish_smtp_server') describe CuttlefishSmtpConnection do describe '#receive_message' do it 'can queue large messages' do connection = CuttlefishSmtpConnection.new('') # This data is still about double what should fit in a TEXT # Something six times bigger than this causes mysql to lose connection on OS X for Matthew connection.current.data = 'a' * 1000000 connection.receive_message end end end ## Instruction: Add simple test for smtp authentication ## Code After: require 'spec_helper' require File.expand_path File.join(File.dirname(__FILE__), '..', '..', 'lib', 'cuttlefish_smtp_server') describe CuttlefishSmtpConnection do describe '#receive_message' do it 'can queue large messages' do connection = CuttlefishSmtpConnection.new('') # This data is still about double what should fit in a TEXT # Something six times bigger than this causes mysql to lose connection on OS X for Matthew connection.current.data = 'a' * 1000000 connection.receive_message end end describe "#receive_plain_auth" do let(:app) { App.create!(name: "test") } let(:connection) { CuttlefishSmtpConnection.new('') } it { expect(connection.receive_plain_auth("foo", "bar")).to eq false } it { expect(connection.receive_plain_auth(app.smtp_username, "bar")).to eq false } it { expect(connection.receive_plain_auth(app.smtp_username, app.smtp_password)).to eq true } end end
require 'spec_helper' require File.expand_path File.join(File.dirname(__FILE__), '..', '..', 'lib', 'cuttlefish_smtp_server') describe CuttlefishSmtpConnection do describe '#receive_message' do it 'can queue large messages' do connection = CuttlefishSmtpConnection.new('') # This data is still about double what should fit in a TEXT # Something six times bigger than this causes mysql to lose connection on OS X for Matthew connection.current.data = 'a' * 1000000 connection.receive_message end end + + describe "#receive_plain_auth" do + let(:app) { App.create!(name: "test") } + let(:connection) { CuttlefishSmtpConnection.new('') } + it { expect(connection.receive_plain_auth("foo", "bar")).to eq false } + it { expect(connection.receive_plain_auth(app.smtp_username, "bar")).to eq false } + it { expect(connection.receive_plain_auth(app.smtp_username, app.smtp_password)).to eq true } + end end
8
0.571429
8
0
0cea61901b178536059ca7e88b0447d60a86203c
src/Helpers/Global.php
src/Helpers/Global.php
<?php use Netcore\Translator\Models\Language; /** * @param $row * @param Language $language * @param String $attribute * @return String */ function trans_model($row, Language $language, $attribute = null): String { if (object_get($row, 'id')) { if (is_null($attribute)) { $model = $row->translateOrNew($language->iso_code); if (is_object($model)) { return $model; } } if ($row) { return (string)$row->translateOrNew($language->iso_code)->$attribute; } } return ''; }
<?php use Netcore\Translator\Models\Language; // In order to stay backwards compatible, we should define this // helper function only if it is not defined in project itself if (!function_exists('trans_model')) { /** * @param $row * @param Language $language * @param String $attribute * @return String */ function trans_model($row, Language $language, $attribute = null): String { if (object_get($row, 'id')) { if (is_null($attribute)) { $model = $row->translateOrNew($language->iso_code); if (is_object($model)) { return $model; } } if ($row) { return (string)$row->translateOrNew($language->iso_code)->$attribute; } } return ''; } }
Define trans_model only if it is not defined in project itself
Define trans_model only if it is not defined in project itself
PHP
mit
netcore/translations,netcore/translations
php
## Code Before: <?php use Netcore\Translator\Models\Language; /** * @param $row * @param Language $language * @param String $attribute * @return String */ function trans_model($row, Language $language, $attribute = null): String { if (object_get($row, 'id')) { if (is_null($attribute)) { $model = $row->translateOrNew($language->iso_code); if (is_object($model)) { return $model; } } if ($row) { return (string)$row->translateOrNew($language->iso_code)->$attribute; } } return ''; } ## Instruction: Define trans_model only if it is not defined in project itself ## Code After: <?php use Netcore\Translator\Models\Language; // In order to stay backwards compatible, we should define this // helper function only if it is not defined in project itself if (!function_exists('trans_model')) { /** * @param $row * @param Language $language * @param String $attribute * @return String */ function trans_model($row, Language $language, $attribute = null): String { if (object_get($row, 'id')) { if (is_null($attribute)) { $model = $row->translateOrNew($language->iso_code); if (is_object($model)) { return $model; } } if ($row) { return (string)$row->translateOrNew($language->iso_code)->$attribute; } } return ''; } }
<?php + use Netcore\Translator\Models\Language; - /** + // In order to stay backwards compatible, we should define this + // helper function only if it is not defined in project itself + if (!function_exists('trans_model')) { + /** - * @param $row + * @param $row ? ++++ - * @param Language $language + * @param Language $language ? ++++ - * @param String $attribute + * @param String $attribute ? ++++ - * @return String + * @return String ? ++++ - */ + */ - function trans_model($row, Language $language, $attribute = null): String + function trans_model($row, Language $language, $attribute = null): String ? ++++ - { + { - if (object_get($row, 'id')) { + if (object_get($row, 'id')) { ? ++++ - if (is_null($attribute)) { + if (is_null($attribute)) { ? ++++ - $model = $row->translateOrNew($language->iso_code); + $model = $row->translateOrNew($language->iso_code); ? ++++ - if (is_object($model)) { + if (is_object($model)) { ? ++++ - return $model; + return $model; ? ++++ + } + } + + if ($row) { + return (string)$row->translateOrNew($language->iso_code)->$attribute; } } + return ''; - if ($row) { - return (string)$row->translateOrNew($language->iso_code)->$attribute; - } } - - return ''; }
41
1.518519
23
18
c0fb4cc7a561770cdea7d9508b2f21cc88e0fe4b
src/Http/Requests/FormRequest.php
src/Http/Requests/FormRequest.php
<?php /* * NOTICE OF LICENSE * * Part of the Rinvex Support Package. * * This source file is subject to The MIT License (MIT) * that is bundled with this package in the LICENSE file. * * Package: Rinvex Support Package * License: The MIT License (MIT) * Link: https://rinvex.com */ declare(strict_types=1); namespace Rinvex\Support\Http\Requests; use Illuminate\Foundation\Http\FormRequest as BaseFormRequest; class FormRequest extends BaseFormRequest { /** * {@inheritdoc} */ protected function getValidatorInstance() { if (method_exists($this, 'process')) { $this->replace($this->container->call([$this, 'process'], [$this->all()])); } else { $this->replace(array_filter_recursive(array_trim_recursive($this->all()))); } return parent::getValidatorInstance(); } }
<?php /* * NOTICE OF LICENSE * * Part of the Rinvex Support Package. * * This source file is subject to The MIT License (MIT) * that is bundled with this package in the LICENSE file. * * Package: Rinvex Support Package * License: The MIT License (MIT) * Link: https://rinvex.com */ declare(strict_types=1); namespace Rinvex\Support\Http\Requests; use Illuminate\Foundation\Http\FormRequest as BaseFormRequest; class FormRequest extends BaseFormRequest { /** * {@inheritdoc} */ protected function getValidatorInstance() { if (method_exists($this, 'process')) { $this->replace($this->container->call([$this, 'process'], [$this->all()])); } return parent::getValidatorInstance(); } }
Remove redundant functionality, replaced by default Laravel 5.4 middleware
Remove redundant functionality, replaced by default Laravel 5.4 middleware
PHP
mit
rinvex/support
php
## Code Before: <?php /* * NOTICE OF LICENSE * * Part of the Rinvex Support Package. * * This source file is subject to The MIT License (MIT) * that is bundled with this package in the LICENSE file. * * Package: Rinvex Support Package * License: The MIT License (MIT) * Link: https://rinvex.com */ declare(strict_types=1); namespace Rinvex\Support\Http\Requests; use Illuminate\Foundation\Http\FormRequest as BaseFormRequest; class FormRequest extends BaseFormRequest { /** * {@inheritdoc} */ protected function getValidatorInstance() { if (method_exists($this, 'process')) { $this->replace($this->container->call([$this, 'process'], [$this->all()])); } else { $this->replace(array_filter_recursive(array_trim_recursive($this->all()))); } return parent::getValidatorInstance(); } } ## Instruction: Remove redundant functionality, replaced by default Laravel 5.4 middleware ## Code After: <?php /* * NOTICE OF LICENSE * * Part of the Rinvex Support Package. * * This source file is subject to The MIT License (MIT) * that is bundled with this package in the LICENSE file. * * Package: Rinvex Support Package * License: The MIT License (MIT) * Link: https://rinvex.com */ declare(strict_types=1); namespace Rinvex\Support\Http\Requests; use Illuminate\Foundation\Http\FormRequest as BaseFormRequest; class FormRequest extends BaseFormRequest { /** * {@inheritdoc} */ protected function getValidatorInstance() { if (method_exists($this, 'process')) { $this->replace($this->container->call([$this, 'process'], [$this->all()])); } return parent::getValidatorInstance(); } }
<?php /* * NOTICE OF LICENSE * * Part of the Rinvex Support Package. * * This source file is subject to The MIT License (MIT) * that is bundled with this package in the LICENSE file. * * Package: Rinvex Support Package * License: The MIT License (MIT) * Link: https://rinvex.com */ declare(strict_types=1); namespace Rinvex\Support\Http\Requests; use Illuminate\Foundation\Http\FormRequest as BaseFormRequest; class FormRequest extends BaseFormRequest { /** * {@inheritdoc} */ protected function getValidatorInstance() { if (method_exists($this, 'process')) { $this->replace($this->container->call([$this, 'process'], [$this->all()])); - } else { - $this->replace(array_filter_recursive(array_trim_recursive($this->all()))); } return parent::getValidatorInstance(); } }
2
0.054054
0
2
238e914b9389913e2525d5fd140505cf2c723418
metadata/com.numguesser.tonio_rpchp.numberguesser.txt
metadata/com.numguesser.tonio_rpchp.numberguesser.txt
Categories:Games License:GPLv3+ Web Site:https://github.com/Reepeecheep/NumberGuesser/blob/HEAD/README.md Source Code:https://github.com/Reepeecheep/NumberGuesser Issue Tracker:https://github.com/Reepeecheep/NumberGuesser/issues Auto Name:Number Guesser Summary:Guess the right number Description: Simple number guessing game. . Repo Type:git Repo:https://github.com/Reepeecheep/NumberGuesser Build:1.0,1 commit=56ede1bbe07d7f284dc5faf9ddd0f8e1996d6dc7 subdir=app gradle=yes Auto Update Mode:None Update Check Mode:RepoManifest Current Version:1.0 Current Version Code:1
Categories:Games License:GPLv3+ Web Site:https://github.com/Reepeecheep/NumberGuesser/blob/HEAD/README.md Source Code:https://github.com/Reepeecheep/NumberGuesser Issue Tracker:https://github.com/Reepeecheep/NumberGuesser/issues Auto Name:Number Guesser Summary:Guess the right number Description: Simple number guessing game. . Repo Type:git Repo:https://github.com/Reepeecheep/NumberGuesser Build:1.0,1 commit=56ede1bbe07d7f284dc5faf9ddd0f8e1996d6dc7 subdir=app gradle=yes Build:2.0,2 commit=2.0 subdir=app gradle=yes Auto Update Mode:Version %v Update Check Mode:Tags Current Version:2.0 Current Version Code:2
Update Number Guesser to 2.0 (2)
Update Number Guesser to 2.0 (2)
Text
agpl-3.0
f-droid/fdroiddata,f-droid/fdroid-data,f-droid/fdroiddata
text
## Code Before: Categories:Games License:GPLv3+ Web Site:https://github.com/Reepeecheep/NumberGuesser/blob/HEAD/README.md Source Code:https://github.com/Reepeecheep/NumberGuesser Issue Tracker:https://github.com/Reepeecheep/NumberGuesser/issues Auto Name:Number Guesser Summary:Guess the right number Description: Simple number guessing game. . Repo Type:git Repo:https://github.com/Reepeecheep/NumberGuesser Build:1.0,1 commit=56ede1bbe07d7f284dc5faf9ddd0f8e1996d6dc7 subdir=app gradle=yes Auto Update Mode:None Update Check Mode:RepoManifest Current Version:1.0 Current Version Code:1 ## Instruction: Update Number Guesser to 2.0 (2) ## Code After: Categories:Games License:GPLv3+ Web Site:https://github.com/Reepeecheep/NumberGuesser/blob/HEAD/README.md Source Code:https://github.com/Reepeecheep/NumberGuesser Issue Tracker:https://github.com/Reepeecheep/NumberGuesser/issues Auto Name:Number Guesser Summary:Guess the right number Description: Simple number guessing game. . Repo Type:git Repo:https://github.com/Reepeecheep/NumberGuesser Build:1.0,1 commit=56ede1bbe07d7f284dc5faf9ddd0f8e1996d6dc7 subdir=app gradle=yes Build:2.0,2 commit=2.0 subdir=app gradle=yes Auto Update Mode:Version %v Update Check Mode:Tags Current Version:2.0 Current Version Code:2
Categories:Games License:GPLv3+ Web Site:https://github.com/Reepeecheep/NumberGuesser/blob/HEAD/README.md Source Code:https://github.com/Reepeecheep/NumberGuesser Issue Tracker:https://github.com/Reepeecheep/NumberGuesser/issues Auto Name:Number Guesser Summary:Guess the right number Description: Simple number guessing game. . Repo Type:git Repo:https://github.com/Reepeecheep/NumberGuesser Build:1.0,1 commit=56ede1bbe07d7f284dc5faf9ddd0f8e1996d6dc7 subdir=app gradle=yes - Auto Update Mode:None - Update Check Mode:RepoManifest - Current Version:1.0 - Current Version Code:1 + Build:2.0,2 + commit=2.0 + subdir=app + gradle=yes + Auto Update Mode:Version %v + Update Check Mode:Tags + Current Version:2.0 + Current Version Code:2 +
13
0.52
9
4
224b2fdda0599d678659496e093bb22d2087d2a7
resources/pdf.xsl
resources/pdf.xsl
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> <!-- The local path to DocBook FO stylesheets --> <xsl:import href="docbook-xsl/fo/profile-docbook.xsl"/> <xsl:import href="docbook-xsl/fo/titlepage.templates.xsl"/> <!-- The local path to your common customization stylesheet --> <xsl:import href="lib/defines.xsl"/> <xsl:import href="lib/defines-a4.xsl"/> <xsl:import href="lib/defines-pdf.xsl"/> <xsl:import href="lib/placement.xsl"/> <xsl:import href="lib/style.xsl"/> <xsl:import href="lib/headers-footers.xsl"/> <xsl:import href="lib/titlepage-a4.xsl"/> </xsl:stylesheet> <!-- Keep this comment at the end of the file Local variables: mode: xml sgml-indent-step:2 sgml-indent-data:t End: -->
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> <!-- The local path to DocBook FO stylesheets --> <xsl:import href="docbook-xsl/fo/profile-docbook.xsl"/> <xsl:import href="docbook-xsl/fo/titlepage.templates.xsl"/> <!-- The local path to your common customization stylesheet --> <xsl:import href="lib/defines.xsl"/> <xsl:import href="lib/defines-a4.xsl"/> <xsl:import href="lib/defines-pdf.xsl"/> <xsl:import href="lib/placement.xsl"/> <xsl:import href="lib/style.xsl"/> <xsl:import href="lib/headers-footers.xsl"/> <xsl:import href="lib/titlepage-a4.xsl"/> <xsl:import href="lib/tables.xsl"/> </xsl:stylesheet> <!-- Keep this comment at the end of the file Local variables: mode: xml sgml-indent-step:2 sgml-indent-data:t End: -->
Add table to A4 stylesheet
Add table to A4 stylesheet
XSLT
agpl-3.0
mbrossard/doc-render
xslt
## Code Before: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> <!-- The local path to DocBook FO stylesheets --> <xsl:import href="docbook-xsl/fo/profile-docbook.xsl"/> <xsl:import href="docbook-xsl/fo/titlepage.templates.xsl"/> <!-- The local path to your common customization stylesheet --> <xsl:import href="lib/defines.xsl"/> <xsl:import href="lib/defines-a4.xsl"/> <xsl:import href="lib/defines-pdf.xsl"/> <xsl:import href="lib/placement.xsl"/> <xsl:import href="lib/style.xsl"/> <xsl:import href="lib/headers-footers.xsl"/> <xsl:import href="lib/titlepage-a4.xsl"/> </xsl:stylesheet> <!-- Keep this comment at the end of the file Local variables: mode: xml sgml-indent-step:2 sgml-indent-data:t End: --> ## Instruction: Add table to A4 stylesheet ## Code After: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> <!-- The local path to DocBook FO stylesheets --> <xsl:import href="docbook-xsl/fo/profile-docbook.xsl"/> <xsl:import href="docbook-xsl/fo/titlepage.templates.xsl"/> <!-- The local path to your common customization stylesheet --> <xsl:import href="lib/defines.xsl"/> <xsl:import href="lib/defines-a4.xsl"/> <xsl:import href="lib/defines-pdf.xsl"/> <xsl:import href="lib/placement.xsl"/> <xsl:import href="lib/style.xsl"/> <xsl:import href="lib/headers-footers.xsl"/> <xsl:import href="lib/titlepage-a4.xsl"/> <xsl:import href="lib/tables.xsl"/> </xsl:stylesheet> <!-- Keep this comment at the end of the file Local variables: mode: xml sgml-indent-step:2 sgml-indent-data:t End: -->
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> <!-- The local path to DocBook FO stylesheets --> <xsl:import href="docbook-xsl/fo/profile-docbook.xsl"/> <xsl:import href="docbook-xsl/fo/titlepage.templates.xsl"/> <!-- The local path to your common customization stylesheet --> <xsl:import href="lib/defines.xsl"/> <xsl:import href="lib/defines-a4.xsl"/> <xsl:import href="lib/defines-pdf.xsl"/> <xsl:import href="lib/placement.xsl"/> <xsl:import href="lib/style.xsl"/> <xsl:import href="lib/headers-footers.xsl"/> <xsl:import href="lib/titlepage-a4.xsl"/> + <xsl:import href="lib/tables.xsl"/> </xsl:stylesheet> <!-- Keep this comment at the end of the file Local variables: mode: xml sgml-indent-step:2 sgml-indent-data:t End: -->
1
0.04
1
0
3d8b5f36baa23f6ac3f4c0e641f62786cad2eece
link/emacs/plugin-notebook/my-smerge.org
link/emacs/plugin-notebook/my-smerge.org
=smerge-mode= is a minor mode for resolving merge conflicts in a file. Simply activate =smerge-mode= and use Smerge's awesome keybindings to simplify your merge conflict resolutions! #+begin_src emacs-lisp (use-package smerge-mode :general (my/evil-leader-def smerge-mode-map "mC" 'smerge-combine-with-next "mR" 'smerge-refine "ma" 'smerge-keep-all "mb" 'smerge-keep-base "mc" 'smerge-keep-current "md<" 'smerge-diff-base-upper "md=" 'smerge-diff-upper-lower "md>" 'smerge-diff-base-lower "me" 'smerge-ediff "ml" 'smerge-keep-lower "mm" 'smerge-keep-upper "mn" 'smerge-next "mo" 'smerge-keep-lower "mp" 'smerge-prev "mr" 'smerge-resolve "mu" 'smerge-keep-upper)) #+end_src
=smerge-mode= is a built-in minor mode for resolving merge conflicts in a file. Simply activate =smerge-mode= and use Smerge's awesome keybindings to simplify your merge conflict resolutions! #+begin_src emacs-lisp (use-package smerge-mode :general (my/evil-leader-def smerge-mode-map "mC" 'smerge-combine-with-next "mR" 'smerge-refine "ma" 'smerge-keep-all "mb" 'smerge-keep-base "mc" 'smerge-keep-current "md<" 'smerge-diff-base-upper "md=" 'smerge-diff-upper-lower "md>" 'smerge-diff-base-lower "me" 'smerge-ediff "ml" 'smerge-keep-lower "mm" 'smerge-keep-upper "mn" 'smerge-next "mo" 'smerge-keep-lower "mp" 'smerge-prev "mr" 'smerge-resolve "mu" 'smerge-keep-upper)) #+end_src
Clarify that smerge-mode is built-in
emacs: Clarify that smerge-mode is built-in
Org
mit
tjtrabue/dotfiles,tjtrabue/dotfiles,tjtrabue/dotfiles,tjtrabue/dotfiles,tjtrabue/dotfiles
org
## Code Before: =smerge-mode= is a minor mode for resolving merge conflicts in a file. Simply activate =smerge-mode= and use Smerge's awesome keybindings to simplify your merge conflict resolutions! #+begin_src emacs-lisp (use-package smerge-mode :general (my/evil-leader-def smerge-mode-map "mC" 'smerge-combine-with-next "mR" 'smerge-refine "ma" 'smerge-keep-all "mb" 'smerge-keep-base "mc" 'smerge-keep-current "md<" 'smerge-diff-base-upper "md=" 'smerge-diff-upper-lower "md>" 'smerge-diff-base-lower "me" 'smerge-ediff "ml" 'smerge-keep-lower "mm" 'smerge-keep-upper "mn" 'smerge-next "mo" 'smerge-keep-lower "mp" 'smerge-prev "mr" 'smerge-resolve "mu" 'smerge-keep-upper)) #+end_src ## Instruction: emacs: Clarify that smerge-mode is built-in ## Code After: =smerge-mode= is a built-in minor mode for resolving merge conflicts in a file. Simply activate =smerge-mode= and use Smerge's awesome keybindings to simplify your merge conflict resolutions! #+begin_src emacs-lisp (use-package smerge-mode :general (my/evil-leader-def smerge-mode-map "mC" 'smerge-combine-with-next "mR" 'smerge-refine "ma" 'smerge-keep-all "mb" 'smerge-keep-base "mc" 'smerge-keep-current "md<" 'smerge-diff-base-upper "md=" 'smerge-diff-upper-lower "md>" 'smerge-diff-base-lower "me" 'smerge-ediff "ml" 'smerge-keep-lower "mm" 'smerge-keep-upper "mn" 'smerge-next "mo" 'smerge-keep-lower "mp" 'smerge-prev "mr" 'smerge-resolve "mu" 'smerge-keep-upper)) #+end_src
- =smerge-mode= is a minor mode for resolving merge conflicts in a file. Simply ? ------------- + =smerge-mode= is a built-in minor mode for resolving merge conflicts in a ? +++++++++ - activate =smerge-mode= and use Smerge's awesome keybindings to simplify your ? -------------- + file. Simply activate =smerge-mode= and use Smerge's awesome keybindings to ? +++++++++++++ - merge conflict resolutions! + simplify your merge conflict resolutions! ? ++++++++++++++ #+begin_src emacs-lisp (use-package smerge-mode :general (my/evil-leader-def smerge-mode-map "mC" 'smerge-combine-with-next "mR" 'smerge-refine "ma" 'smerge-keep-all "mb" 'smerge-keep-base "mc" 'smerge-keep-current "md<" 'smerge-diff-base-upper "md=" 'smerge-diff-upper-lower "md>" 'smerge-diff-base-lower "me" 'smerge-ediff "ml" 'smerge-keep-lower "mm" 'smerge-keep-upper "mn" 'smerge-next "mo" 'smerge-keep-lower "mp" 'smerge-prev "mr" 'smerge-resolve "mu" 'smerge-keep-upper)) #+end_src
6
0.230769
3
3
c95c8f3e15d9ec6a3f955a131937b9cc1880b945
app/controllers/events_controller.rb
app/controllers/events_controller.rb
class EventsController < ApplicationController def index end def search @city = params[:city] @art_events = art_event_results @art_events_with_venues = remove_empty_venues(@art_events) @results = refine_results(@art_events_with_venues, @city) end private def art_event_results params = { category: '1', status: 'upcoming', format: 'json'} meetup_api = MeetupApi.new events = meetup_api.open_events(params) return events["results"] end def remove_empty_venues(events) results = [] events.each do |event| if event["venue"] results << event end end return results end def refine_results(events, city) results = [] events.each do |event| if event["venue"]["city"].downcase == city.downcase results << event end sleep 0.1 end return results end end
class EventsController < ApplicationController def index end def search @city = params[:city] @art_events = art_event_results @art_events_with_venues = remove_empty_venues(@art_events) @results = refine_results(@art_events_with_venues, @city) end private def art_event_results params = { category: '1', status: 'upcoming', format: 'json'} meetup_api = MeetupApi.new events = meetup_api.open_events(params) return events["results"] end def remove_empty_venues(events) results = [] events.each do |event| if event["venue"] results << event end end return results end def refine_results(events, city) results = [] events.each do |event| if event["venue"]["city"].downcase == city.downcase results << event end end return results end end
Remove sleep from refine_results method to make page load faster
Remove sleep from refine_results method to make page load faster
Ruby
mit
chi-cicadas-2015/galleriamia,chi-cicadas-2015/galleriamia,chi-cicadas-2015/galleriamia
ruby
## Code Before: class EventsController < ApplicationController def index end def search @city = params[:city] @art_events = art_event_results @art_events_with_venues = remove_empty_venues(@art_events) @results = refine_results(@art_events_with_venues, @city) end private def art_event_results params = { category: '1', status: 'upcoming', format: 'json'} meetup_api = MeetupApi.new events = meetup_api.open_events(params) return events["results"] end def remove_empty_venues(events) results = [] events.each do |event| if event["venue"] results << event end end return results end def refine_results(events, city) results = [] events.each do |event| if event["venue"]["city"].downcase == city.downcase results << event end sleep 0.1 end return results end end ## Instruction: Remove sleep from refine_results method to make page load faster ## Code After: class EventsController < ApplicationController def index end def search @city = params[:city] @art_events = art_event_results @art_events_with_venues = remove_empty_venues(@art_events) @results = refine_results(@art_events_with_venues, @city) end private def art_event_results params = { category: '1', status: 'upcoming', format: 'json'} meetup_api = MeetupApi.new events = meetup_api.open_events(params) return events["results"] end def remove_empty_venues(events) results = [] events.each do |event| if event["venue"] results << event end end return results end def refine_results(events, city) results = [] events.each do |event| if event["venue"]["city"].downcase == city.downcase results << event end end return results end end
class EventsController < ApplicationController def index end def search @city = params[:city] @art_events = art_event_results @art_events_with_venues = remove_empty_venues(@art_events) @results = refine_results(@art_events_with_venues, @city) end private def art_event_results params = { category: '1', status: 'upcoming', format: 'json'} meetup_api = MeetupApi.new events = meetup_api.open_events(params) return events["results"] end def remove_empty_venues(events) results = [] events.each do |event| if event["venue"] results << event end end return results end def refine_results(events, city) results = [] events.each do |event| if event["venue"]["city"].downcase == city.downcase results << event end - sleep 0.1 end return results end end
1
0.02381
0
1
618b7acedc24ad48911e0e8ead715e22c2017f23
.emacs.d/init.el
.emacs.d/init.el
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Set Package repositories ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (require 'package) (add-to-list 'package-archives '("melpa-stable" . "http://stable.melpa.org/packages/") t) (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t) (when (< emacs-major-version 24) ;; For important compatibility libraries like cl-lib (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))) (package-initialize) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Install use-package if it's not already installed. ;; ;; package-refresh-contents ensure packages loaded in new emacs. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (unless (package-installed-p 'use-package) (package-refresh-contents) (package-install 'use-package)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; From use-package README ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (eval-when-compile (require 'use-package)) (require 'diminish) (require 'bind-key) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Load the org config file ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (org-babel-load-file (concat user-emacs-directory "config.org"))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Set windowed interface before immediately to prevent choppy ui changes ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (when window-system (menu-bar-mode 1) (tool-bar-mode -1) (scroll-bar-mode -1) (tooltip-mode 1)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Set Package repositories ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (require 'package) (add-to-list 'package-archives '("melpa-stable" . "http://stable.melpa.org/packages/") t) (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t) (when (< emacs-major-version 24) ;; For important compatibility libraries like cl-lib (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))) (package-initialize) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Install use-package if it's not already installed. ;; ;; package-refresh-contents ensure packages loaded in new emacs. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (unless (package-installed-p 'use-package) (package-refresh-contents) (package-install 'use-package)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; From use-package README ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (eval-when-compile (require 'use-package)) (require 'diminish) (require 'bind-key) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Load the org config file ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (org-babel-load-file (concat user-emacs-directory "config.org"))
Set up windowed gui at startup.
Set up windowed gui at startup.
Emacs Lisp
mit
PurityControl/config-files,PurityControl/config-files
emacs-lisp
## Code Before: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Set Package repositories ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (require 'package) (add-to-list 'package-archives '("melpa-stable" . "http://stable.melpa.org/packages/") t) (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t) (when (< emacs-major-version 24) ;; For important compatibility libraries like cl-lib (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))) (package-initialize) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Install use-package if it's not already installed. ;; ;; package-refresh-contents ensure packages loaded in new emacs. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (unless (package-installed-p 'use-package) (package-refresh-contents) (package-install 'use-package)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; From use-package README ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (eval-when-compile (require 'use-package)) (require 'diminish) (require 'bind-key) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Load the org config file ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (org-babel-load-file (concat user-emacs-directory "config.org")) ## Instruction: Set up windowed gui at startup. ## Code After: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Set windowed interface before immediately to prevent choppy ui changes ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (when window-system (menu-bar-mode 1) (tool-bar-mode -1) (scroll-bar-mode -1) (tooltip-mode 1)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Set Package repositories ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (require 'package) (add-to-list 'package-archives '("melpa-stable" . "http://stable.melpa.org/packages/") t) (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t) (when (< emacs-major-version 24) ;; For important compatibility libraries like cl-lib (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))) (package-initialize) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Install use-package if it's not already installed. ;; ;; package-refresh-contents ensure packages loaded in new emacs. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (unless (package-installed-p 'use-package) (package-refresh-contents) (package-install 'use-package)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; From use-package README ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (eval-when-compile (require 'use-package)) (require 'diminish) (require 'bind-key) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Load the org config file ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (org-babel-load-file (concat user-emacs-directory "config.org"))
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Set windowed interface before immediately to prevent choppy ui changes ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + (when window-system + (menu-bar-mode 1) + (tool-bar-mode -1) + (scroll-bar-mode -1) + (tooltip-mode 1)) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Set Package repositories ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (require 'package) (add-to-list 'package-archives '("melpa-stable" . "http://stable.melpa.org/packages/") t) (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t) (when (< emacs-major-version 24) ;; For important compatibility libraries like cl-lib (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))) (package-initialize) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Install use-package if it's not already installed. ;; ;; package-refresh-contents ensure packages loaded in new emacs. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (unless (package-installed-p 'use-package) (package-refresh-contents) (package-install 'use-package)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; From use-package README ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (eval-when-compile (require 'use-package)) (require 'diminish) (require 'bind-key) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Load the org config file ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (org-babel-load-file (concat user-emacs-directory "config.org"))
10
0.294118
10
0
ab9f30de4f1b91953f5bf93270dba24a01535d1e
webpack.config.js
webpack.config.js
var path = require("path"); var config = { entry: ["./app.tsx"], /* * The combination of path and filename tells Webpack what name to give to * the final bundled JavaScript file and where to store this file. */ output: { path: path.resolve(__dirname, "build"), filename: "bundle.js" }, resolve: { extensions: [".ts", ".tsx", ".js"] }, module: { loaders: [ { test: /\.tsx?$/, loader: "awesome-typescript-loader" } ] } }; module.exports = config;
var path = require("path"); var config = { entry: ["./app.tsx"], devtool: "source-map", /* * The combination of path and filename tells Webpack what name to give to * the final bundled JavaScript file and where to store this file. */ output: { path: path.resolve(__dirname, "build"), filename: "bundle.js" }, resolve: { extensions: [".ts", ".tsx", ".js"] }, module: { loaders: [ { test: /\.tsx?$/, loader: "awesome-typescript-loader" } ] } }; module.exports = config;
Add source maps for easier in-browser debugging.
Add source maps for easier in-browser debugging.
JavaScript
mit
software-training-for-students/manual-editor,software-training-for-students/manual-editor,software-training-for-students/manual-editor
javascript
## Code Before: var path = require("path"); var config = { entry: ["./app.tsx"], /* * The combination of path and filename tells Webpack what name to give to * the final bundled JavaScript file and where to store this file. */ output: { path: path.resolve(__dirname, "build"), filename: "bundle.js" }, resolve: { extensions: [".ts", ".tsx", ".js"] }, module: { loaders: [ { test: /\.tsx?$/, loader: "awesome-typescript-loader" } ] } }; module.exports = config; ## Instruction: Add source maps for easier in-browser debugging. ## Code After: var path = require("path"); var config = { entry: ["./app.tsx"], devtool: "source-map", /* * The combination of path and filename tells Webpack what name to give to * the final bundled JavaScript file and where to store this file. */ output: { path: path.resolve(__dirname, "build"), filename: "bundle.js" }, resolve: { extensions: [".ts", ".tsx", ".js"] }, module: { loaders: [ { test: /\.tsx?$/, loader: "awesome-typescript-loader" } ] } }; module.exports = config;
var path = require("path"); var config = { entry: ["./app.tsx"], - + devtool: "source-map", /* * The combination of path and filename tells Webpack what name to give to * the final bundled JavaScript file and where to store this file. */ output: { path: path.resolve(__dirname, "build"), filename: "bundle.js" }, resolve: { extensions: [".ts", ".tsx", ".js"] }, module: { loaders: [ { test: /\.tsx?$/, loader: "awesome-typescript-loader" } ] } }; module.exports = config;
2
0.068966
1
1
c21c13cbae1aa4916b1474bab6c577f21ad28d56
.travis.yml
.travis.yml
language: php sudo: false php: - 5.6 - 7.0 - 7.1 - hhvm cache: directories: - $HOME/.composer/cache before_install: - composer selfupdate install: - composer install before_script: - mkdir -p build/logs script: - vendor/bin/phpunit --coverage-clover=clover.xml after_success: - bash <(curl -s https://codecov.io/bash)
language: php sudo: false dist: trusty php: - 5.6 - 7.0 - 7.1 - hhvm cache: directories: - $HOME/.composer/cache before_install: - composer selfupdate install: - composer install before_script: - mkdir -p build/logs script: - vendor/bin/phpunit --coverage-clover=clover.xml after_success: - bash <(curl -s https://codecov.io/bash)
Use trusty distributive to fix hhvm builds
Use trusty distributive to fix hhvm builds
YAML
mit
v-matsuk/time-overlap-calculator
yaml
## Code Before: language: php sudo: false php: - 5.6 - 7.0 - 7.1 - hhvm cache: directories: - $HOME/.composer/cache before_install: - composer selfupdate install: - composer install before_script: - mkdir -p build/logs script: - vendor/bin/phpunit --coverage-clover=clover.xml after_success: - bash <(curl -s https://codecov.io/bash) ## Instruction: Use trusty distributive to fix hhvm builds ## Code After: language: php sudo: false dist: trusty php: - 5.6 - 7.0 - 7.1 - hhvm cache: directories: - $HOME/.composer/cache before_install: - composer selfupdate install: - composer install before_script: - mkdir -p build/logs script: - vendor/bin/phpunit --coverage-clover=clover.xml after_success: - bash <(curl -s https://codecov.io/bash)
language: php - sudo: false + dist: trusty php: - 5.6 - 7.0 - 7.1 - hhvm cache: directories: - $HOME/.composer/cache before_install: - composer selfupdate install: - composer install before_script: - mkdir -p build/logs script: - vendor/bin/phpunit --coverage-clover=clover.xml after_success: - bash <(curl -s https://codecov.io/bash)
2
0.071429
1
1
d960da5b41abd2cece07828db66877a9bf87da3d
templates/hddepends.php
templates/hddepends.php
<meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <link rel="icon" href="/img/favicon.ico"> <title data-bind="text: title"></title> <!-- CSS style includes --> <link href="/css/bootstrap.min.css" rel="stylesheet"> <link href="/css/grader.css" rel="stylesheet"> <link href="/css/cssrapport/jquery-ui.min.css" rel="stylesheet"> <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="/js/html5shiv.min.js"></script> <script src="/js/respond.min.js"></script> <![endif]-->
<meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <link rel="icon" href="/img/favicon.ico"> <title data-bind="text: title"></title> <!-- CSS style includes --> <link href="/bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"> <link href="/css/grader.css" rel="stylesheet"> <link href="/css/cssrapport/jquery-ui.min.css" rel="stylesheet"> <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="/js/html5shiv.min.js"></script> <script src="/js/respond.min.js"></script> <![endif]-->
Use bower bootstrap CSS file
Use bower bootstrap CSS file
PHP
mit
daanpape/grader,daanpape/grader
php
## Code Before: <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <link rel="icon" href="/img/favicon.ico"> <title data-bind="text: title"></title> <!-- CSS style includes --> <link href="/css/bootstrap.min.css" rel="stylesheet"> <link href="/css/grader.css" rel="stylesheet"> <link href="/css/cssrapport/jquery-ui.min.css" rel="stylesheet"> <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="/js/html5shiv.min.js"></script> <script src="/js/respond.min.js"></script> <![endif]--> ## Instruction: Use bower bootstrap CSS file ## Code After: <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <link rel="icon" href="/img/favicon.ico"> <title data-bind="text: title"></title> <!-- CSS style includes --> <link href="/bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"> <link href="/css/grader.css" rel="stylesheet"> <link href="/css/cssrapport/jquery-ui.min.css" rel="stylesheet"> <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="/js/html5shiv.min.js"></script> <script src="/js/respond.min.js"></script> <![endif]-->
<meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <link rel="icon" href="/img/favicon.ico"> <title data-bind="text: title"></title> <!-- CSS style includes --> - <link href="/css/bootstrap.min.css" rel="stylesheet"> + <link href="/bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"> ? ++++++++++++++++++++++++++++++++ <link href="/css/grader.css" rel="stylesheet"> <link href="/css/cssrapport/jquery-ui.min.css" rel="stylesheet"> <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="/js/html5shiv.min.js"></script> <script src="/js/respond.min.js"></script> <![endif]-->
2
0.111111
1
1
62851c74af3af2d804d0ea6ee78e1cdb781301dc
requirements.txt
requirements.txt
pbr!=2.1.0,>=2.0.0 # Apache-2.0 python-ironicclient>=2.3.0 # Apache-2.0
pbr!=2.1.0,>=2.0.0 # Apache-2.0 python-ironicclient!=2.5.2,!=2.7.1,>=2.3.0 # Apache-2.0
Exclude broken ironicclient versions 2.5.2 and 2.7.1
Exclude broken ironicclient versions 2.5.2 and 2.7.1 depend on https://review.opendev.org/#/c/659612/ Change-Id: I1f802d9a114b93b47afc8b6ebb6bd92148945a50
Text
apache-2.0
openstack/ironic-ui,openstack/ironic-ui,openstack/ironic-ui,openstack/ironic-ui
text
## Code Before: pbr!=2.1.0,>=2.0.0 # Apache-2.0 python-ironicclient>=2.3.0 # Apache-2.0 ## Instruction: Exclude broken ironicclient versions 2.5.2 and 2.7.1 depend on https://review.opendev.org/#/c/659612/ Change-Id: I1f802d9a114b93b47afc8b6ebb6bd92148945a50 ## Code After: pbr!=2.1.0,>=2.0.0 # Apache-2.0 python-ironicclient!=2.5.2,!=2.7.1,>=2.3.0 # Apache-2.0
pbr!=2.1.0,>=2.0.0 # Apache-2.0 - python-ironicclient>=2.3.0 # Apache-2.0 + python-ironicclient!=2.5.2,!=2.7.1,>=2.3.0 # Apache-2.0 ? ++++++++++++++++
2
0.666667
1
1
ded41dfcc7a0b60016dd3c50fed5d3a63905bda3
AddKernels/CMakeLists.txt
AddKernels/CMakeLists.txt
project(AddKernels) set(ADD_KERNELS_SOURCE addkernels.cpp) add_executable(addkernels EXCLUDE_FROM_ALL ${ADD_KERNELS_SOURCE})
set(ADD_KERNELS_SOURCE addkernels.cpp) add_executable(addkernels EXCLUDE_FROM_ALL ${ADD_KERNELS_SOURCE})
Remove warning about project version
Remove warning about project version
Text
mit
ROCmSoftwarePlatform/MIOpen,ROCmSoftwarePlatform/MIOpen,ROCmSoftwarePlatform/MIOpen,ROCmSoftwarePlatform/MIOpen,ROCmSoftwarePlatform/MIOpen
text
## Code Before: project(AddKernels) set(ADD_KERNELS_SOURCE addkernels.cpp) add_executable(addkernels EXCLUDE_FROM_ALL ${ADD_KERNELS_SOURCE}) ## Instruction: Remove warning about project version ## Code After: set(ADD_KERNELS_SOURCE addkernels.cpp) add_executable(addkernels EXCLUDE_FROM_ALL ${ADD_KERNELS_SOURCE})
- project(AddKernels) set(ADD_KERNELS_SOURCE addkernels.cpp) add_executable(addkernels EXCLUDE_FROM_ALL ${ADD_KERNELS_SOURCE})
1
0.2
0
1
d46155b298a81703a8d09b16dfeaf0ed2e1a0aff
webapp/jsp/admin/site/AdminSite.jsp
webapp/jsp/admin/site/AdminSite.jsp
<%@ page errorPage="../ErrorPage.jsp" %> <%@ page import="java.util.Enumeration" %> <jsp:include page="../AdminHeader.jsp" /> <jsp:useBean id="admin" scope="session" class="fr.paris.lutece.portal.web.admin.AdminPageJspBean" /> <% admin.init( request , admin.RIGHT_MANAGE_ADMIN_SITE ); %> <jsp:include page="AdminPage.jsp" /> <% String strParams = ""; String strSeparator = "?"; Enumeration paramNames = request.getParameterNames(); int i = 0; while( paramNames.hasMoreElements() ) { i = i + 1; if( i > 1 ) { strSeparator = "&#38;"; } String strParamName = (String) paramNames.nextElement(); String strParamValue = request.getParameter( strParamName ); strParams += strSeparator + strParamName + "=" + strParamValue; } String strClassPreview = ""; String strParamBlock = request.getParameter("param_block"); int nParamBlock = strParamBlock != null ? Integer.parseInt( strParamBlock ) : 0; %> <iframe name="preview" src="jsp/admin/site/AdminPagePreview.jsp<%= strParams %>" width="100%" height="750" scrolling="auto">Pr&eacute;visualisation du site</iframe> <%@ include file="../AdminFooter.jsp"%>
<%@ page errorPage="../ErrorPage.jsp" %> <%@ page import="java.util.Enumeration" %> <jsp:include page="../AdminHeader.jsp" /> <jsp:useBean id="admin" scope="session" class="fr.paris.lutece.portal.web.admin.AdminPageJspBean" /> <% admin.init( request , admin.RIGHT_MANAGE_ADMIN_SITE ); %> <jsp:include page="AdminPage.jsp" /> <% String strParams = ""; String strSeparator = "?"; Enumeration paramNames = request.getParameterNames(); int i = 0; while( paramNames.hasMoreElements() ) { i = i + 1; if( i > 1 ) { strSeparator = "&#38;"; } String strParamName = (String) paramNames.nextElement(); String strParamValue = request.getParameter( strParamName ); strParams += strSeparator + strParamName + "=" + strParamValue; } String strClassPreview = ""; String strParamBlock = request.getParameter("param_block"); int nParamBlock = strParamBlock != null ? Integer.parseInt( strParamBlock ) : 0; %> <iframe id="preview" name="preview" src="jsp/admin/site/AdminPagePreview.jsp<%= strParams %>" width="100%" height="750" scrolling="auto">Pr&eacute;visualisation du site</iframe> <%@ include file="../AdminFooter.jsp"%>
Add id preview to iframe preview
LUTECE-1772: Add id preview to iframe preview git-svn-id: 890dd67775b5971c21efd90062c158582082fe1b@69596 bab10101-e421-0410-a517-8ce0973de3ef
Java Server Pages
bsd-3-clause
rzara/lutece-core,rzara/lutece-core,rzara/lutece-core,lutece-platform/lutece-core,lutece-platform/lutece-core,lutece-platform/lutece-core
java-server-pages
## Code Before: <%@ page errorPage="../ErrorPage.jsp" %> <%@ page import="java.util.Enumeration" %> <jsp:include page="../AdminHeader.jsp" /> <jsp:useBean id="admin" scope="session" class="fr.paris.lutece.portal.web.admin.AdminPageJspBean" /> <% admin.init( request , admin.RIGHT_MANAGE_ADMIN_SITE ); %> <jsp:include page="AdminPage.jsp" /> <% String strParams = ""; String strSeparator = "?"; Enumeration paramNames = request.getParameterNames(); int i = 0; while( paramNames.hasMoreElements() ) { i = i + 1; if( i > 1 ) { strSeparator = "&#38;"; } String strParamName = (String) paramNames.nextElement(); String strParamValue = request.getParameter( strParamName ); strParams += strSeparator + strParamName + "=" + strParamValue; } String strClassPreview = ""; String strParamBlock = request.getParameter("param_block"); int nParamBlock = strParamBlock != null ? Integer.parseInt( strParamBlock ) : 0; %> <iframe name="preview" src="jsp/admin/site/AdminPagePreview.jsp<%= strParams %>" width="100%" height="750" scrolling="auto">Pr&eacute;visualisation du site</iframe> <%@ include file="../AdminFooter.jsp"%> ## Instruction: LUTECE-1772: Add id preview to iframe preview git-svn-id: 890dd67775b5971c21efd90062c158582082fe1b@69596 bab10101-e421-0410-a517-8ce0973de3ef ## Code After: <%@ page errorPage="../ErrorPage.jsp" %> <%@ page import="java.util.Enumeration" %> <jsp:include page="../AdminHeader.jsp" /> <jsp:useBean id="admin" scope="session" class="fr.paris.lutece.portal.web.admin.AdminPageJspBean" /> <% admin.init( request , admin.RIGHT_MANAGE_ADMIN_SITE ); %> <jsp:include page="AdminPage.jsp" /> <% String strParams = ""; String strSeparator = "?"; Enumeration paramNames = request.getParameterNames(); int i = 0; while( paramNames.hasMoreElements() ) { i = i + 1; if( i > 1 ) { strSeparator = "&#38;"; } String strParamName = (String) paramNames.nextElement(); String strParamValue = request.getParameter( strParamName ); strParams += strSeparator + strParamName + "=" + strParamValue; } String strClassPreview = ""; String strParamBlock = request.getParameter("param_block"); int nParamBlock = strParamBlock != null ? Integer.parseInt( strParamBlock ) : 0; %> <iframe id="preview" name="preview" src="jsp/admin/site/AdminPagePreview.jsp<%= strParams %>" width="100%" height="750" scrolling="auto">Pr&eacute;visualisation du site</iframe> <%@ include file="../AdminFooter.jsp"%>
<%@ page errorPage="../ErrorPage.jsp" %> <%@ page import="java.util.Enumeration" %> <jsp:include page="../AdminHeader.jsp" /> <jsp:useBean id="admin" scope="session" class="fr.paris.lutece.portal.web.admin.AdminPageJspBean" /> <% admin.init( request , admin.RIGHT_MANAGE_ADMIN_SITE ); %> <jsp:include page="AdminPage.jsp" /> <% String strParams = ""; String strSeparator = "?"; Enumeration paramNames = request.getParameterNames(); int i = 0; while( paramNames.hasMoreElements() ) { i = i + 1; if( i > 1 ) { strSeparator = "&#38;"; } String strParamName = (String) paramNames.nextElement(); String strParamValue = request.getParameter( strParamName ); strParams += strSeparator + strParamName + "=" + strParamValue; } String strClassPreview = ""; String strParamBlock = request.getParameter("param_block"); int nParamBlock = strParamBlock != null ? Integer.parseInt( strParamBlock ) : 0; %> - <iframe name="preview" src="jsp/admin/site/AdminPagePreview.jsp<%= strParams %>" width="100%" height="750" scrolling="auto">Pr&eacute;visualisation du site</iframe> + <iframe id="preview" name="preview" src="jsp/admin/site/AdminPagePreview.jsp<%= strParams %>" width="100%" height="750" scrolling="auto">Pr&eacute;visualisation du site</iframe> ? +++++++++++++ <%@ include file="../AdminFooter.jsp"%>
2
0.054054
1
1
e2cb35af623660aa3b1f37dcded42949038a2691
.circleci/config.yml
.circleci/config.yml
version: 2 jobs: build: docker: - image: circleci/openjdk:8-jdk working_directory: ~/app steps: - checkout - run: chmod +x gradlew # Download and cache dependencies - restore_cache: keys: - v2-dependencies-{{ checksum "build.gradle.kts" }} # fallback to using the latest cache if no exact match is found - v2-dependencies- - run: ./gradlew dependencies - save_cache: paths: - ~/.gradle key: v2-dependencies-{{ checksum "build.gradle.kts" }} - run: ./gradlew test - store_test_results: path: build/test-results
version: 2 jobs: build: docker: - image: circleci/openjdk:8-jdk working_directory: ~/app steps: - checkout - run: chmod +x gradlew # Download and cache dependencies - restore_cache: keys: - v2-dependencies-{{ checksum "build.gradle.kts" }}-{{ checksum "buildSrc/src/main/kotlin/Version.kt" }} - v2-dependencies-{{ checksum "build.gradle.kts" }} # fallback to using the latest cache if no exact match is found - v2-dependencies- - run: ./gradlew dependencies - save_cache: paths: - ~/.gradle key: v2-dependencies-{{ checksum "build.gradle.kts" }}-{{ checksum "buildSrc/src/main/kotlin/Version.kt" }} - run: ./gradlew test - store_test_results: path: build/test-results
Include Version.kt in circleci cache key
Include Version.kt in circleci cache key
YAML
mit
BjoernPetersen/JMusicBot
yaml
## Code Before: version: 2 jobs: build: docker: - image: circleci/openjdk:8-jdk working_directory: ~/app steps: - checkout - run: chmod +x gradlew # Download and cache dependencies - restore_cache: keys: - v2-dependencies-{{ checksum "build.gradle.kts" }} # fallback to using the latest cache if no exact match is found - v2-dependencies- - run: ./gradlew dependencies - save_cache: paths: - ~/.gradle key: v2-dependencies-{{ checksum "build.gradle.kts" }} - run: ./gradlew test - store_test_results: path: build/test-results ## Instruction: Include Version.kt in circleci cache key ## Code After: version: 2 jobs: build: docker: - image: circleci/openjdk:8-jdk working_directory: ~/app steps: - checkout - run: chmod +x gradlew # Download and cache dependencies - restore_cache: keys: - v2-dependencies-{{ checksum "build.gradle.kts" }}-{{ checksum "buildSrc/src/main/kotlin/Version.kt" }} - v2-dependencies-{{ checksum "build.gradle.kts" }} # fallback to using the latest cache if no exact match is found - v2-dependencies- - run: ./gradlew dependencies - save_cache: paths: - ~/.gradle key: v2-dependencies-{{ checksum "build.gradle.kts" }}-{{ checksum "buildSrc/src/main/kotlin/Version.kt" }} - run: ./gradlew test - store_test_results: path: build/test-results
version: 2 jobs: build: docker: - image: circleci/openjdk:8-jdk working_directory: ~/app steps: - checkout - run: chmod +x gradlew # Download and cache dependencies - restore_cache: keys: + - v2-dependencies-{{ checksum "build.gradle.kts" }}-{{ checksum "buildSrc/src/main/kotlin/Version.kt" }} - v2-dependencies-{{ checksum "build.gradle.kts" }} # fallback to using the latest cache if no exact match is found - v2-dependencies- - run: ./gradlew dependencies - save_cache: paths: - ~/.gradle - key: v2-dependencies-{{ checksum "build.gradle.kts" }} + key: v2-dependencies-{{ checksum "build.gradle.kts" }}-{{ checksum "buildSrc/src/main/kotlin/Version.kt" }} - run: ./gradlew test - store_test_results: path: build/test-results
3
0.111111
2
1
6d8fc9e36b68be1d9cd5a6ce3387a716101d9b99
README.md
README.md
WeMote is a remote app for the Pebble Smartwatch to *flip* your WeMo switches from your wrist. It requires the [Ouimeaux](http://ouimeaux.readthedocs.org/en/latest/index.html) REST API running on a computer on the network to be able to work. An update in the future **_may_** remove this requirement. ## Running Ouimeaux REST API * Following instructions [here](http://ouimeaux.readthedocs.org/en/latest/installation.html) to install Ouimeaux. * Run `wemo server` in terminal to start the webserver. (pro-tip: run it in a `tmux` or a `screen` session) * Note down this computers' local IP address as that's what you'll enter in the configuration page. ## License WeMote is available under the MIT license. See the LICENSE file for more info.
WeMote is a remote app for the Pebble Smartwatch to *flip* your WeMo switches from your wrist. It requires the [Ouimeaux](http://ouimeaux.readthedocs.org/en/latest/index.html) REST API running on a computer on the network to be able to work. An update in the future **_may_** remove this requirement. _Much thanks to Ian McCracken for Ouimeaux._ ## Running Ouimeaux REST API * Following instructions [here](http://ouimeaux.readthedocs.org/en/latest/installation.html) to install Ouimeaux. * Run `wemo server` in terminal to start the webserver. (pro-tip: run it in a `tmux` or a `screen` session) * Note down this computers' local IP address as that's what you'll enter in the configuration page. ## License WeMote is available under the MIT license. See the LICENSE file for more info.
Update readme with thanks to @iancmcc.
Update readme with thanks to @iancmcc.
Markdown
mit
Neal/WeMote,Neal/WeMote,Neal/WeMote
markdown
## Code Before: WeMote is a remote app for the Pebble Smartwatch to *flip* your WeMo switches from your wrist. It requires the [Ouimeaux](http://ouimeaux.readthedocs.org/en/latest/index.html) REST API running on a computer on the network to be able to work. An update in the future **_may_** remove this requirement. ## Running Ouimeaux REST API * Following instructions [here](http://ouimeaux.readthedocs.org/en/latest/installation.html) to install Ouimeaux. * Run `wemo server` in terminal to start the webserver. (pro-tip: run it in a `tmux` or a `screen` session) * Note down this computers' local IP address as that's what you'll enter in the configuration page. ## License WeMote is available under the MIT license. See the LICENSE file for more info. ## Instruction: Update readme with thanks to @iancmcc. ## Code After: WeMote is a remote app for the Pebble Smartwatch to *flip* your WeMo switches from your wrist. It requires the [Ouimeaux](http://ouimeaux.readthedocs.org/en/latest/index.html) REST API running on a computer on the network to be able to work. An update in the future **_may_** remove this requirement. _Much thanks to Ian McCracken for Ouimeaux._ ## Running Ouimeaux REST API * Following instructions [here](http://ouimeaux.readthedocs.org/en/latest/installation.html) to install Ouimeaux. * Run `wemo server` in terminal to start the webserver. (pro-tip: run it in a `tmux` or a `screen` session) * Note down this computers' local IP address as that's what you'll enter in the configuration page. ## License WeMote is available under the MIT license. See the LICENSE file for more info.
WeMote is a remote app for the Pebble Smartwatch to *flip* your WeMo switches from your wrist. It requires the [Ouimeaux](http://ouimeaux.readthedocs.org/en/latest/index.html) REST API running on a computer on the network to be able to work. An update in the future **_may_** remove this requirement. + + _Much thanks to Ian McCracken for Ouimeaux._ ## Running Ouimeaux REST API * Following instructions [here](http://ouimeaux.readthedocs.org/en/latest/installation.html) to install Ouimeaux. * Run `wemo server` in terminal to start the webserver. (pro-tip: run it in a `tmux` or a `screen` session) * Note down this computers' local IP address as that's what you'll enter in the configuration page. ## License WeMote is available under the MIT license. See the LICENSE file for more info.
2
0.142857
2
0
a6090136b76df5fbc0da6b327ad06c9674e78549
assets/scss/variables/_grid.scss
assets/scss/variables/_grid.scss
$grid-columns: 12 !default; $grid-gutter-width-base: 16px !default; $grid-gutter-width-desktop: 24px !default; $grid-gutter-widths: ( xs: $grid-gutter-width-base, sm: $grid-gutter-width-base, md: $grid-gutter-width-desktop, lg: $grid-gutter-width-desktop, xl: $grid-gutter-width-desktop ) !default; // Breakpoint // Based on https://material.google.com/layout/responsive-ui.html#responsive-ui-breakpoints $grid-breakpoints: ( xs: 0, sm: 600px, md: 960px, lg: 1280px, xl: 1920px ) !default; @include _assert-ascending($grid-breakpoints, '$grid-breakpoints'); @include _assert-starts-at-zero($grid-breakpoints); // Container width // Based on https://material.google.com/layout/responsive-ui.html#responsive-ui-breakpoints $container-max-widths: ( sm: 600px, md: 840px, lg: 1024px, xl: 1600px ) !default; @include _assert-ascending($container-max-widths, '$container-max-widths');
$grid-columns: 12 !default; $grid-gutter-width-base: 16px !default; $grid-gutter-width-desktop: 24px !default; $grid-gutter-widths: ( xs: $grid-gutter-width-base, sm: $grid-gutter-width-base, md: $grid-gutter-width-desktop, lg: $grid-gutter-width-desktop, xl: $grid-gutter-width-desktop ) !default; // Breakpoint // Based on https://material.google.com/layout/responsive-ui.html#responsive-ui-breakpoints $grid-breakpoints: ( xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px ) !default; @include _assert-ascending($grid-breakpoints, '$grid-breakpoints'); @include _assert-starts-at-zero($grid-breakpoints); // Container width // Based on https://material.google.com/layout/responsive-ui.html#responsive-ui-breakpoints $container-max-widths: ( sm: 540px, md: 720px, lg: 960px, xl: 1140px ) !default; @include _assert-ascending($container-max-widths, '$container-max-widths');
Update breakpoints to in favour of BS4 values
Update breakpoints to in favour of BS4 values
SCSS
mit
Daemonite/material,Daemonite/material,Daemonite/material
scss
## Code Before: $grid-columns: 12 !default; $grid-gutter-width-base: 16px !default; $grid-gutter-width-desktop: 24px !default; $grid-gutter-widths: ( xs: $grid-gutter-width-base, sm: $grid-gutter-width-base, md: $grid-gutter-width-desktop, lg: $grid-gutter-width-desktop, xl: $grid-gutter-width-desktop ) !default; // Breakpoint // Based on https://material.google.com/layout/responsive-ui.html#responsive-ui-breakpoints $grid-breakpoints: ( xs: 0, sm: 600px, md: 960px, lg: 1280px, xl: 1920px ) !default; @include _assert-ascending($grid-breakpoints, '$grid-breakpoints'); @include _assert-starts-at-zero($grid-breakpoints); // Container width // Based on https://material.google.com/layout/responsive-ui.html#responsive-ui-breakpoints $container-max-widths: ( sm: 600px, md: 840px, lg: 1024px, xl: 1600px ) !default; @include _assert-ascending($container-max-widths, '$container-max-widths'); ## Instruction: Update breakpoints to in favour of BS4 values ## Code After: $grid-columns: 12 !default; $grid-gutter-width-base: 16px !default; $grid-gutter-width-desktop: 24px !default; $grid-gutter-widths: ( xs: $grid-gutter-width-base, sm: $grid-gutter-width-base, md: $grid-gutter-width-desktop, lg: $grid-gutter-width-desktop, xl: $grid-gutter-width-desktop ) !default; // Breakpoint // Based on https://material.google.com/layout/responsive-ui.html#responsive-ui-breakpoints $grid-breakpoints: ( xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px ) !default; @include _assert-ascending($grid-breakpoints, '$grid-breakpoints'); @include _assert-starts-at-zero($grid-breakpoints); // Container width // Based on https://material.google.com/layout/responsive-ui.html#responsive-ui-breakpoints $container-max-widths: ( sm: 540px, md: 720px, lg: 960px, xl: 1140px ) !default; @include _assert-ascending($container-max-widths, '$container-max-widths');
$grid-columns: 12 !default; $grid-gutter-width-base: 16px !default; $grid-gutter-width-desktop: 24px !default; $grid-gutter-widths: ( xs: $grid-gutter-width-base, sm: $grid-gutter-width-base, md: $grid-gutter-width-desktop, lg: $grid-gutter-width-desktop, xl: $grid-gutter-width-desktop ) !default; // Breakpoint // Based on https://material.google.com/layout/responsive-ui.html#responsive-ui-breakpoints $grid-breakpoints: ( xs: 0, - sm: 600px, ? -- + sm: 576px, ? ++ - md: 960px, ? ^ ^ + md: 768px, ? ^ ^ - lg: 1280px, ? ^ -- + lg: 992px, ? ^^ - xl: 1920px ? - + xl: 1200px ? + ) !default; @include _assert-ascending($grid-breakpoints, '$grid-breakpoints'); @include _assert-starts-at-zero($grid-breakpoints); // Container width // Based on https://material.google.com/layout/responsive-ui.html#responsive-ui-breakpoints $container-max-widths: ( - sm: 600px, ? ^^ + sm: 540px, ? ^^ - md: 840px, ? ^^ + md: 720px, ? ^^ - lg: 1024px, ? ^ -- + lg: 960px, ? ^^ - xl: 1600px ? ^^ + xl: 1140px ? ^^ ) !default; @include _assert-ascending($container-max-widths, '$container-max-widths');
16
0.432432
8
8
a37494f27f2ad18b7e4c4e7ba6e400cf93cc950c
build.sbt
build.sbt
name := "VexRiscv" version := "1.0" scalaVersion := "2.11.8" EclipseKeys.withSource := true libraryDependencies ++= Seq( "com.github.spinalhdl" % "spinalhdl-core_2.11" % "0.10.15", "com.github.spinalhdl" % "spinalhdl-lib_2.11" % "0.10.15", "org.yaml" % "snakeyaml" % "1.8" )
name := "VexRiscv" organization := "com.github.spinalhdl" version := "1.0" scalaVersion := "2.11.8" EclipseKeys.withSource := true libraryDependencies ++= Seq( "com.github.spinalhdl" % "spinalhdl-core_2.11" % "0.10.15", "com.github.spinalhdl" % "spinalhdl-lib_2.11" % "0.10.15", "org.yaml" % "snakeyaml" % "1.8" )
Set sbt organization to com.github.spinalhdl
Set sbt organization to com.github.spinalhdl
Scala
mit
SpinalHDL/VexRiscv,SpinalHDL/VexRiscv,SpinalHDL/VexRiscv,SpinalHDL/VexRiscv,SpinalHDL/VexRiscv
scala
## Code Before: name := "VexRiscv" version := "1.0" scalaVersion := "2.11.8" EclipseKeys.withSource := true libraryDependencies ++= Seq( "com.github.spinalhdl" % "spinalhdl-core_2.11" % "0.10.15", "com.github.spinalhdl" % "spinalhdl-lib_2.11" % "0.10.15", "org.yaml" % "snakeyaml" % "1.8" ) ## Instruction: Set sbt organization to com.github.spinalhdl ## Code After: name := "VexRiscv" organization := "com.github.spinalhdl" version := "1.0" scalaVersion := "2.11.8" EclipseKeys.withSource := true libraryDependencies ++= Seq( "com.github.spinalhdl" % "spinalhdl-core_2.11" % "0.10.15", "com.github.spinalhdl" % "spinalhdl-lib_2.11" % "0.10.15", "org.yaml" % "snakeyaml" % "1.8" )
name := "VexRiscv" + + organization := "com.github.spinalhdl" version := "1.0" scalaVersion := "2.11.8" EclipseKeys.withSource := true libraryDependencies ++= Seq( "com.github.spinalhdl" % "spinalhdl-core_2.11" % "0.10.15", "com.github.spinalhdl" % "spinalhdl-lib_2.11" % "0.10.15", "org.yaml" % "snakeyaml" % "1.8" )
2
0.153846
2
0
7ee4ea3700577df47171e4618bac8febb7068e59
src/CMakeLists.txt
src/CMakeLists.txt
SET(CMAKE_INCLUDE_CURRENT_DIR ON) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/../include ${NEON_INCLUDE_DIR}) FILE(GLOB _sources ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/xmlParser/*.cpp) ADD_LIBRARY(musicbrainz3 SHARED ${_sources}) IF(WIN32) TARGET_LINK_LIBRARIES(musicbrainz3 wsock32) ENDIF(WIN32) TARGET_LINK_LIBRARIES(musicbrainz3 ${NEON_LIBRARIES}) SET_TARGET_PROPERTIES(musicbrainz3 PROPERTIES VERSION ${musicbrainz3_VERSION} SOVERSION ${musicbrainz3_SOVERSION} DEFINE_SYMBOL MB_API_EXPORTS ) IF(DISCID_FOUND) INCLUDE_DIRECTORIES(${DISCID_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(musicbrainz3 ${DISCID_LIBRARIES}) ENDIF(DISCID_FOUND) INSTALL(TARGETS musicbrainz3 DESTINATION ${LIB_INSTALL_DIR})
SET(CMAKE_INCLUDE_CURRENT_DIR ON) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/../include ${NEON_INCLUDE_DIR}) FILE(GLOB _sources ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/xmlParser/*.cpp) ADD_LIBRARY(musicbrainz3 SHARED ${_sources}) SET_TARGET_PROPERTIES(musicbrainz3 PROPERTIES VERSION ${musicbrainz3_VERSION} SOVERSION ${musicbrainz3_SOVERSION} DEFINE_SYMBOL MB_API_EXPORTS ) TARGET_LINK_LIBRARIES(musicbrainz3 ${NEON_LIBRARIES}) IF(DISCID_FOUND) INCLUDE_DIRECTORIES(${DISCID_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(musicbrainz3 ${DISCID_LIBRARIES}) ENDIF(DISCID_FOUND) IF(WIN32) TARGET_LINK_LIBRARIES(musicbrainz3 wsock32 winmm) ENDIF(WIN32) INSTALL(TARGETS musicbrainz3 DESTINATION ${LIB_INSTALL_DIR})
Fix compilation with static libraries on Windows.
Fix compilation with static libraries on Windows.
Text
lgpl-2.1
sebastinas/libmusicbrainz,ianmcorvidae/libmusicbrainz,ianmcorvidae/libmusicbrainz,metabrainz/libmusicbrainz,sebastinas/libmusicbrainz,metabrainz/libmusicbrainz,sebastinas/libmusicbrainz,matthewruhland/libmusicbrainz,matthewruhland/libmusicbrainz,metabrainz/libmusicbrainz,matthewruhland/libmusicbrainz
text
## Code Before: SET(CMAKE_INCLUDE_CURRENT_DIR ON) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/../include ${NEON_INCLUDE_DIR}) FILE(GLOB _sources ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/xmlParser/*.cpp) ADD_LIBRARY(musicbrainz3 SHARED ${_sources}) IF(WIN32) TARGET_LINK_LIBRARIES(musicbrainz3 wsock32) ENDIF(WIN32) TARGET_LINK_LIBRARIES(musicbrainz3 ${NEON_LIBRARIES}) SET_TARGET_PROPERTIES(musicbrainz3 PROPERTIES VERSION ${musicbrainz3_VERSION} SOVERSION ${musicbrainz3_SOVERSION} DEFINE_SYMBOL MB_API_EXPORTS ) IF(DISCID_FOUND) INCLUDE_DIRECTORIES(${DISCID_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(musicbrainz3 ${DISCID_LIBRARIES}) ENDIF(DISCID_FOUND) INSTALL(TARGETS musicbrainz3 DESTINATION ${LIB_INSTALL_DIR}) ## Instruction: Fix compilation with static libraries on Windows. ## Code After: SET(CMAKE_INCLUDE_CURRENT_DIR ON) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/../include ${NEON_INCLUDE_DIR}) FILE(GLOB _sources ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/xmlParser/*.cpp) ADD_LIBRARY(musicbrainz3 SHARED ${_sources}) SET_TARGET_PROPERTIES(musicbrainz3 PROPERTIES VERSION ${musicbrainz3_VERSION} SOVERSION ${musicbrainz3_SOVERSION} DEFINE_SYMBOL MB_API_EXPORTS ) TARGET_LINK_LIBRARIES(musicbrainz3 ${NEON_LIBRARIES}) IF(DISCID_FOUND) INCLUDE_DIRECTORIES(${DISCID_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(musicbrainz3 ${DISCID_LIBRARIES}) ENDIF(DISCID_FOUND) IF(WIN32) TARGET_LINK_LIBRARIES(musicbrainz3 wsock32 winmm) ENDIF(WIN32) INSTALL(TARGETS musicbrainz3 DESTINATION ${LIB_INSTALL_DIR})
SET(CMAKE_INCLUDE_CURRENT_DIR ON) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/../include ${NEON_INCLUDE_DIR}) FILE(GLOB _sources ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/xmlParser/*.cpp) ADD_LIBRARY(musicbrainz3 SHARED ${_sources}) - IF(WIN32) - TARGET_LINK_LIBRARIES(musicbrainz3 wsock32) - ENDIF(WIN32) - TARGET_LINK_LIBRARIES(musicbrainz3 ${NEON_LIBRARIES}) SET_TARGET_PROPERTIES(musicbrainz3 PROPERTIES VERSION ${musicbrainz3_VERSION} SOVERSION ${musicbrainz3_SOVERSION} DEFINE_SYMBOL MB_API_EXPORTS ) + TARGET_LINK_LIBRARIES(musicbrainz3 ${NEON_LIBRARIES}) + IF(DISCID_FOUND) INCLUDE_DIRECTORIES(${DISCID_INCLUDE_DIR}) TARGET_LINK_LIBRARIES(musicbrainz3 ${DISCID_LIBRARIES}) ENDIF(DISCID_FOUND) + IF(WIN32) + TARGET_LINK_LIBRARIES(musicbrainz3 wsock32 winmm) + ENDIF(WIN32) + INSTALL(TARGETS musicbrainz3 DESTINATION ${LIB_INSTALL_DIR})
10
0.454545
6
4
f726dfba6269c68ce17a81a7f973e6b5e23964cb
app/views/admin/deploy_keys/index.html.haml
app/views/admin/deploy_keys/index.html.haml
- page_title "Deploy Keys" .panel.panel-default.prepend-top-default .panel-heading Public deploy keys (#{@deploy_keys.count}) .controls = link_to 'New Deploy Key', new_admin_deploy_key_path, class: "btn btn-new btn-sm" - if @deploy_keys.any? .table-holder %table.table %thead.panel-heading %tr %th Title %th Fingerprint %th Write access allowed %th Added at %th %tbody - @deploy_keys.each do |deploy_key| %tr %td %strong= deploy_key.title %td %code.key-fingerprint= deploy_key.fingerprint %td - if deploy_key.can_push? Yes - else No %td %span.cgray added #{time_ago_with_tooltip(deploy_key.created_at)} %td = link_to 'Remove', admin_deploy_key_path(deploy_key), data: { confirm: 'Are you sure?'}, method: :delete, class: "btn btn-sm btn-remove delete-key pull-right"
- page_title "Deploy Keys" .panel.panel-default.prepend-top-default .panel-heading Public deploy keys (#{@deploy_keys.count}) .controls = link_to 'New Deploy Key', new_admin_deploy_key_path, class: "btn btn-new btn-sm btn-inverted" - if @deploy_keys.any? .table-holder %table.table %thead.panel-heading %tr %th Title %th Fingerprint %th Write access allowed %th Added at %th %tbody - @deploy_keys.each do |deploy_key| %tr %td %strong= deploy_key.title %td %code.key-fingerprint= deploy_key.fingerprint %td - if deploy_key.can_push? Yes - else No %td %span.cgray added #{time_ago_with_tooltip(deploy_key.created_at)} %td = link_to 'Remove', admin_deploy_key_path(deploy_key), data: { confirm: 'Are you sure?'}, method: :delete, class: "btn btn-sm btn-remove delete-key pull-right"
Use btn-inverted for New Deploy Key
Use btn-inverted for New Deploy Key
Haml
mit
mmkassem/gitlabhq,iiet/iiet-git,jirutka/gitlabhq,t-zuehlsdorff/gitlabhq,LUMC/gitlabhq,LUMC/gitlabhq,t-zuehlsdorff/gitlabhq,dplarson/gitlabhq,iiet/iiet-git,dreampet/gitlab,iiet/iiet-git,LUMC/gitlabhq,stoplightio/gitlabhq,jirutka/gitlabhq,htve/GitlabForChinese,axilleas/gitlabhq,darkrasid/gitlabhq,openwide-java/gitlabhq,mmkassem/gitlabhq,dplarson/gitlabhq,dplarson/gitlabhq,mmkassem/gitlabhq,t-zuehlsdorff/gitlabhq,jirutka/gitlabhq,stoplightio/gitlabhq,htve/GitlabForChinese,LUMC/gitlabhq,dreampet/gitlab,axilleas/gitlabhq,openwide-java/gitlabhq,htve/GitlabForChinese,axilleas/gitlabhq,axilleas/gitlabhq,darkrasid/gitlabhq,iiet/iiet-git,darkrasid/gitlabhq,darkrasid/gitlabhq,htve/GitlabForChinese,t-zuehlsdorff/gitlabhq,stoplightio/gitlabhq,mmkassem/gitlabhq,stoplightio/gitlabhq,dreampet/gitlab,dplarson/gitlabhq,jirutka/gitlabhq,openwide-java/gitlabhq,openwide-java/gitlabhq,dreampet/gitlab
haml
## Code Before: - page_title "Deploy Keys" .panel.panel-default.prepend-top-default .panel-heading Public deploy keys (#{@deploy_keys.count}) .controls = link_to 'New Deploy Key', new_admin_deploy_key_path, class: "btn btn-new btn-sm" - if @deploy_keys.any? .table-holder %table.table %thead.panel-heading %tr %th Title %th Fingerprint %th Write access allowed %th Added at %th %tbody - @deploy_keys.each do |deploy_key| %tr %td %strong= deploy_key.title %td %code.key-fingerprint= deploy_key.fingerprint %td - if deploy_key.can_push? Yes - else No %td %span.cgray added #{time_ago_with_tooltip(deploy_key.created_at)} %td = link_to 'Remove', admin_deploy_key_path(deploy_key), data: { confirm: 'Are you sure?'}, method: :delete, class: "btn btn-sm btn-remove delete-key pull-right" ## Instruction: Use btn-inverted for New Deploy Key ## Code After: - page_title "Deploy Keys" .panel.panel-default.prepend-top-default .panel-heading Public deploy keys (#{@deploy_keys.count}) .controls = link_to 'New Deploy Key', new_admin_deploy_key_path, class: "btn btn-new btn-sm btn-inverted" - if @deploy_keys.any? .table-holder %table.table %thead.panel-heading %tr %th Title %th Fingerprint %th Write access allowed %th Added at %th %tbody - @deploy_keys.each do |deploy_key| %tr %td %strong= deploy_key.title %td %code.key-fingerprint= deploy_key.fingerprint %td - if deploy_key.can_push? Yes - else No %td %span.cgray added #{time_ago_with_tooltip(deploy_key.created_at)} %td = link_to 'Remove', admin_deploy_key_path(deploy_key), data: { confirm: 'Are you sure?'}, method: :delete, class: "btn btn-sm btn-remove delete-key pull-right"
- page_title "Deploy Keys" .panel.panel-default.prepend-top-default .panel-heading Public deploy keys (#{@deploy_keys.count}) .controls - = link_to 'New Deploy Key', new_admin_deploy_key_path, class: "btn btn-new btn-sm" + = link_to 'New Deploy Key', new_admin_deploy_key_path, class: "btn btn-new btn-sm btn-inverted" ? +++++++++++++ - if @deploy_keys.any? .table-holder %table.table %thead.panel-heading %tr %th Title %th Fingerprint %th Write access allowed %th Added at %th %tbody - @deploy_keys.each do |deploy_key| %tr %td %strong= deploy_key.title %td %code.key-fingerprint= deploy_key.fingerprint %td - if deploy_key.can_push? Yes - else No %td %span.cgray added #{time_ago_with_tooltip(deploy_key.created_at)} %td = link_to 'Remove', admin_deploy_key_path(deploy_key), data: { confirm: 'Are you sure?'}, method: :delete, class: "btn btn-sm btn-remove delete-key pull-right"
2
0.060606
1
1
20e336fc9c05e2abba96b244f05003092555b2c1
src/checkstyle/checkstyle.xml
src/checkstyle/checkstyle.xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> <module name="Checker"> <property name="severity" value="error" /> <module name="TreeWalker"> <module name="SuppressWarningsHolder" /> <module name="JavadocMethod"> <property name="allowMissingJavadoc" value="true" /> <property name="allowMissingParamTags" value="true" /> <property name="allowMissingReturnTag" value="true" /> <property name="allowMissingThrowsTags" value="true" /> <property name="validateThrows" value="true" /> </module> <module name="JavadocParagraph" /> <module name="AtclauseOrder"> <property name="tagOrder" value="@param, @return, @throws, @exception, @author, @since, @see" /> </module> <module name="NonEmptyAtclauseDescription" /> </module> <module name="SuppressWarningsFilter" /> </module>
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> <module name="Checker"> <property name="severity" value="error" /> <module name="TreeWalker"> <module name="SuppressWarningsHolder" /> <module name="JavadocMethod"> <property name="allowMissingJavadoc" value="true" /> <property name="allowMissingParamTags" value="true" /> <property name="allowMissingReturnTag" value="true" /> <property name="allowMissingThrowsTags" value="true" /> <property name="allowUndeclaredRTE" value="true" /> <property name="validateThrows" value="true" /> </module> <module name="JavadocParagraph" /> <module name="AtclauseOrder"> <property name="tagOrder" value="@param, @return, @throws, @exception, @author, @since, @see" /> </module> <module name="NonEmptyAtclauseDescription" /> </module> <module name="SuppressWarningsFilter" /> </module>
Allow Javadoc for undeclared RuntimeExceptions
Allow Javadoc for undeclared RuntimeExceptions ------------------------------------------------------------------------ On behalf of the community, the JUnit Lambda Team thanks Gradleware (https://gradle.org) for supporting the JUnit crowdfunding campaign! ------------------------------------------------------------------------
XML
epl-1.0
sbrannen/junit-lambda,marcphilipp/junit-lambda,junit-team/junit-lambda,marcphilipp/junit5
xml
## Code Before: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> <module name="Checker"> <property name="severity" value="error" /> <module name="TreeWalker"> <module name="SuppressWarningsHolder" /> <module name="JavadocMethod"> <property name="allowMissingJavadoc" value="true" /> <property name="allowMissingParamTags" value="true" /> <property name="allowMissingReturnTag" value="true" /> <property name="allowMissingThrowsTags" value="true" /> <property name="validateThrows" value="true" /> </module> <module name="JavadocParagraph" /> <module name="AtclauseOrder"> <property name="tagOrder" value="@param, @return, @throws, @exception, @author, @since, @see" /> </module> <module name="NonEmptyAtclauseDescription" /> </module> <module name="SuppressWarningsFilter" /> </module> ## Instruction: Allow Javadoc for undeclared RuntimeExceptions ------------------------------------------------------------------------ On behalf of the community, the JUnit Lambda Team thanks Gradleware (https://gradle.org) for supporting the JUnit crowdfunding campaign! ------------------------------------------------------------------------ ## Code After: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> <module name="Checker"> <property name="severity" value="error" /> <module name="TreeWalker"> <module name="SuppressWarningsHolder" /> <module name="JavadocMethod"> <property name="allowMissingJavadoc" value="true" /> <property name="allowMissingParamTags" value="true" /> <property name="allowMissingReturnTag" value="true" /> <property name="allowMissingThrowsTags" value="true" /> <property name="allowUndeclaredRTE" value="true" /> <property name="validateThrows" value="true" /> </module> <module name="JavadocParagraph" /> <module name="AtclauseOrder"> <property name="tagOrder" value="@param, @return, @throws, @exception, @author, @since, @see" /> </module> <module name="NonEmptyAtclauseDescription" /> </module> <module name="SuppressWarningsFilter" /> </module>
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> <module name="Checker"> <property name="severity" value="error" /> <module name="TreeWalker"> <module name="SuppressWarningsHolder" /> <module name="JavadocMethod"> <property name="allowMissingJavadoc" value="true" /> <property name="allowMissingParamTags" value="true" /> <property name="allowMissingReturnTag" value="true" /> <property name="allowMissingThrowsTags" value="true" /> + <property name="allowUndeclaredRTE" value="true" /> <property name="validateThrows" value="true" /> </module> <module name="JavadocParagraph" /> <module name="AtclauseOrder"> <property name="tagOrder" value="@param, @return, @throws, @exception, @author, @since, @see" /> </module> <module name="NonEmptyAtclauseDescription" /> </module> <module name="SuppressWarningsFilter" /> </module>
1
0.043478
1
0
4ea9e2dfa78520a75df70390afbe9dbbcfbfb194
download/modifyNuGetDownload/README.md
download/modifyNuGetDownload/README.md
==================================================== *This plugin was tested for Artifactory 4.x releases.* *This plugin was tested for Artifactory 5.x releases.* ## Features ==================================================== This plugins rewrite downlaod request for nupkg packages in nuget-gallery repo 2 levels down from it's original request path ## Installation ==================================================== To install pluging, put your groovy file under `${ARTIFACTORY_HOME}/etc/plugins` and restart your artifactory instance You can enable autoreload at `${ARTIFACTORY_HOME}/etc/artifactory.system.properties` by changing this property: artifactory.plugin.scripts.refreshIntervalSecs=0
This plugins rewrite downlaod request for nupkg packages in nuget-gallery repo 2 levels down from it's original request path For example, if you are requesting a package from `nuget-gallery/example.1.0.0.nupkg` the download request will be redirect to `nuget-galllery/example/example/example.1.0.0.nupkg`
Update readme to fix typo
Update readme to fix typo
Markdown
apache-2.0
JFrogDev/artifactory-user-plugins
markdown
## Code Before: ==================================================== *This plugin was tested for Artifactory 4.x releases.* *This plugin was tested for Artifactory 5.x releases.* ## Features ==================================================== This plugins rewrite downlaod request for nupkg packages in nuget-gallery repo 2 levels down from it's original request path ## Installation ==================================================== To install pluging, put your groovy file under `${ARTIFACTORY_HOME}/etc/plugins` and restart your artifactory instance You can enable autoreload at `${ARTIFACTORY_HOME}/etc/artifactory.system.properties` by changing this property: artifactory.plugin.scripts.refreshIntervalSecs=0 ## Instruction: Update readme to fix typo ## Code After: This plugins rewrite downlaod request for nupkg packages in nuget-gallery repo 2 levels down from it's original request path For example, if you are requesting a package from `nuget-gallery/example.1.0.0.nupkg` the download request will be redirect to `nuget-galllery/example/example/example.1.0.0.nupkg`
- ==================================================== - *This plugin was tested for Artifactory 4.x releases.* - *This plugin was tested for Artifactory 5.x releases.* - - ## Features - ==================================================== This plugins rewrite downlaod request for nupkg packages in nuget-gallery repo 2 levels down from it's original request path + For example, if you are requesting a package from - ## Installation - ==================================================== - To install pluging, put your groovy file under `${ARTIFACTORY_HOME}/etc/plugins` and restart your artifactory instance + `nuget-gallery/example.1.0.0.nupkg` - You can enable autoreload at `${ARTIFACTORY_HOME}/etc/artifactory.system.properties` by changing this property: + the download request will be redirect to + `nuget-galllery/example/example/example.1.0.0.nupkg` - - artifactory.plugin.scripts.refreshIntervalSecs=0
16
0.941176
4
12
f742f5ce52738da51a3adce35bad1e852691d7be
tests/__init__.py
tests/__init__.py
from tests import *
class fixture(object): """ Works like the built in @property decorator, except that it caches the return value for each instance. This allows you to lazy-load the fixture only if your test needs it, rather than having it setup before *every* test when put in the setUp() method or returning a fresh run of the decorated method, which 99% of the time isn't what you want. """ def __init__(self, func): self.func = func self.cache = {} def __call__(self, *args): try: return self.cache[args] except KeyError: self.cache[args] = self.func(*args) return self.cache[args] def __get__(self, instance, klass): return self.__call__(instance) from tests import *
Add fixture decorator to make tests better
Add fixture decorator to make tests better
Python
apache-2.0
disqus/gutter,kalail/gutter,kalail/gutter,disqus/gutter,kalail/gutter
python
## Code Before: from tests import * ## Instruction: Add fixture decorator to make tests better ## Code After: class fixture(object): """ Works like the built in @property decorator, except that it caches the return value for each instance. This allows you to lazy-load the fixture only if your test needs it, rather than having it setup before *every* test when put in the setUp() method or returning a fresh run of the decorated method, which 99% of the time isn't what you want. """ def __init__(self, func): self.func = func self.cache = {} def __call__(self, *args): try: return self.cache[args] except KeyError: self.cache[args] = self.func(*args) return self.cache[args] def __get__(self, instance, klass): return self.__call__(instance) from tests import *
+ + + class fixture(object): + """ + Works like the built in @property decorator, except that it caches the + return value for each instance. This allows you to lazy-load the fixture + only if your test needs it, rather than having it setup before *every* test + when put in the setUp() method or returning a fresh run of the decorated + method, which 99% of the time isn't what you want. + """ + + def __init__(self, func): + self.func = func + self.cache = {} + + def __call__(self, *args): + try: + return self.cache[args] + except KeyError: + self.cache[args] = self.func(*args) + return self.cache[args] + + def __get__(self, instance, klass): + return self.__call__(instance) from tests import *
24
12
24
0
5ebe5070d9fc59595d56319977a87d36389f89c3
app/models/init.go
app/models/init.go
package models import ( "github.com/coopernurse/gorp" ) func CreateTables(g *gorp.DbMap) { // Add User Table t := g.AddTableWithName(User{}, "dispatch_user").SetKeys(true, "UserId") t.ColMap("Password").Transient = true // Add UserApp Table g.AddTableWithName(UserApp{}, "dispatch_app").SetKeys(true, "UserAppId") // Add UserSubscription Table g.AddTableWithName(UserSubscription{}, "dispatch_subscription").SetKeys(true, "SubscriptionId") // Add User Identity Tables g.AddTableWithName(Identity{}, "dispatch_identity").SetKeys(true, "IdentityId") }
package models import ( "github.com/coopernurse/gorp" ) func CreateTables(g *gorp.DbMap) { // Add User Table t := g.AddTableWithName(User{}, "dispatch_user").SetKeys(true, "UserId") t.ColMap("Password").Transient = true // Add UserApp Table g.AddTableWithName(UserApp{}, "dispatch_app").SetKeys(true, "UserAppId") // Add UserSubscription Table g.AddTableWithName(UserSubscription{}, "dispatch_subscription").SetKeys(true, "SubscriptionId") // Add User Identity Tables g.AddTableWithName(Identity{}, "dispatch_identity").SetKeys(true, "IdentityId") // Add MailServer Tables g.AddTableWithName(Message{}, "dispatch_messages").SetKeys(true, "MessageId") g.AddTableWithName(Alert{}, "dispatch_alerts").SetKeys(true, "AlertId") g.AddTableWithName(Component{}, "dispatch_components").SetKeys(true, "ComponentId") }
Put the Tables for Live
Put the Tables for Live
Go
mit
melange-app/melange,melange-app/melange,melange-app/melange,melange-app/melange,melange-app/melange,melange-app/melange
go
## Code Before: package models import ( "github.com/coopernurse/gorp" ) func CreateTables(g *gorp.DbMap) { // Add User Table t := g.AddTableWithName(User{}, "dispatch_user").SetKeys(true, "UserId") t.ColMap("Password").Transient = true // Add UserApp Table g.AddTableWithName(UserApp{}, "dispatch_app").SetKeys(true, "UserAppId") // Add UserSubscription Table g.AddTableWithName(UserSubscription{}, "dispatch_subscription").SetKeys(true, "SubscriptionId") // Add User Identity Tables g.AddTableWithName(Identity{}, "dispatch_identity").SetKeys(true, "IdentityId") } ## Instruction: Put the Tables for Live ## Code After: package models import ( "github.com/coopernurse/gorp" ) func CreateTables(g *gorp.DbMap) { // Add User Table t := g.AddTableWithName(User{}, "dispatch_user").SetKeys(true, "UserId") t.ColMap("Password").Transient = true // Add UserApp Table g.AddTableWithName(UserApp{}, "dispatch_app").SetKeys(true, "UserAppId") // Add UserSubscription Table g.AddTableWithName(UserSubscription{}, "dispatch_subscription").SetKeys(true, "SubscriptionId") // Add User Identity Tables g.AddTableWithName(Identity{}, "dispatch_identity").SetKeys(true, "IdentityId") // Add MailServer Tables g.AddTableWithName(Message{}, "dispatch_messages").SetKeys(true, "MessageId") g.AddTableWithName(Alert{}, "dispatch_alerts").SetKeys(true, "AlertId") g.AddTableWithName(Component{}, "dispatch_components").SetKeys(true, "ComponentId") }
package models import ( "github.com/coopernurse/gorp" ) func CreateTables(g *gorp.DbMap) { // Add User Table t := g.AddTableWithName(User{}, "dispatch_user").SetKeys(true, "UserId") t.ColMap("Password").Transient = true // Add UserApp Table g.AddTableWithName(UserApp{}, "dispatch_app").SetKeys(true, "UserAppId") // Add UserSubscription Table g.AddTableWithName(UserSubscription{}, "dispatch_subscription").SetKeys(true, "SubscriptionId") // Add User Identity Tables g.AddTableWithName(Identity{}, "dispatch_identity").SetKeys(true, "IdentityId") + + // Add MailServer Tables + g.AddTableWithName(Message{}, "dispatch_messages").SetKeys(true, "MessageId") + g.AddTableWithName(Alert{}, "dispatch_alerts").SetKeys(true, "AlertId") + g.AddTableWithName(Component{}, "dispatch_components").SetKeys(true, "ComponentId") }
5
0.25
5
0
293af0e7172c87bec1ece10c2886ad03117fcdba
app/main/fonts.sass
app/main/fonts.sass
@import url('https://fonts.googleapis.com/css?family=Open+Sans:400,600,700|Montserrat:300,500,600|Material+Icons|Lobster') @import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css')
@import url('https://fonts.googleapis.com/css?family=Open+Sans:400,600,700|Montserrat:300,500,600|Material+Icons|Lobster') @import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css') @font-face font-family: Charis font-style: normal font-weight: bold src: local('Charis'), url('https://arkis.io/home/fonts/charissil-b-webfont.woff2') format('woff2'), url('https://arkis.io/home/fonts/charissil-b-webfont.woff') format('woff'), url('https://arkis.io/home/fonts/CharisSIL-B.ttf') format('ttf')
Load Charis font for Arkis logo
Load Charis font for Arkis logo
Sass
mit
controversial/controversial.io,controversial/controversial.io,controversial/controversial.io
sass
## Code Before: @import url('https://fonts.googleapis.com/css?family=Open+Sans:400,600,700|Montserrat:300,500,600|Material+Icons|Lobster') @import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css') ## Instruction: Load Charis font for Arkis logo ## Code After: @import url('https://fonts.googleapis.com/css?family=Open+Sans:400,600,700|Montserrat:300,500,600|Material+Icons|Lobster') @import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css') @font-face font-family: Charis font-style: normal font-weight: bold src: local('Charis'), url('https://arkis.io/home/fonts/charissil-b-webfont.woff2') format('woff2'), url('https://arkis.io/home/fonts/charissil-b-webfont.woff') format('woff'), url('https://arkis.io/home/fonts/CharisSIL-B.ttf') format('ttf')
@import url('https://fonts.googleapis.com/css?family=Open+Sans:400,600,700|Montserrat:300,500,600|Material+Icons|Lobster') @import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css') + + @font-face + font-family: Charis + font-style: normal + font-weight: bold + src: local('Charis'), url('https://arkis.io/home/fonts/charissil-b-webfont.woff2') format('woff2'), url('https://arkis.io/home/fonts/charissil-b-webfont.woff') format('woff'), url('https://arkis.io/home/fonts/CharisSIL-B.ttf') format('ttf')
6
3
6
0
3b8282703a468631d3e96242d80cdc3268ed26f1
src/test/java/seedu/doist/testutil/TaskBuilder.java
src/test/java/seedu/doist/testutil/TaskBuilder.java
package seedu.doist.testutil; import java.util.Date; import seedu.doist.commons.exceptions.IllegalValueException; import seedu.doist.model.tag.Tag; import seedu.doist.model.tag.UniqueTagList; import seedu.doist.model.task.Description; import seedu.doist.model.task.Priority; /** * */ public class TaskBuilder { private TestTask task; public TaskBuilder() { this.task = new TestTask(); } /** * Initializes the TaskBuilder with the data of {@code personToCopy}. */ public TaskBuilder(TestTask taskToCopy) { this.task = new TestTask(taskToCopy); } public TaskBuilder withName(String name) throws IllegalValueException { this.task.setName(new Description(name)); return this; } public TaskBuilder withPriority(String priority) throws IllegalValueException { this.task.setPriority(new Priority(priority)); return this; } public TaskBuilder withTags(String ... tags) throws IllegalValueException { task.setTags(new UniqueTagList()); for (String tag: tags) { task.getTags().add(new Tag(tag)); } return this; } public TaskBuilder withDates(Date startDate, Date endDate) throws IllegalValueException { this.task.setStartDate(startDate); this.task.setEndDate(endDate); return this; } public TestTask build() { return this.task; } }
package seedu.doist.testutil; import java.util.Date; import seedu.doist.commons.exceptions.IllegalValueException; import seedu.doist.model.tag.Tag; import seedu.doist.model.tag.UniqueTagList; import seedu.doist.model.task.Description; import seedu.doist.model.task.Priority; /** * */ public class TaskBuilder { private TestTask task; public TaskBuilder() { this.task = new TestTask(); } /** * Initializes the TaskBuilder with the data of {@code personToCopy}. */ public TaskBuilder(TestTask taskToCopy) { this.task = new TestTask(taskToCopy); } public TaskBuilder withName(String name) throws IllegalValueException { this.task.setName(new Description(name)); return this; } public TaskBuilder withPriority(String priority) throws IllegalValueException { this.task.setPriority(new Priority(priority)); return this; } public TaskBuilder withTags(String ... tags) throws IllegalValueException { task.setTags(new UniqueTagList()); for (String tag: tags) { task.getTags().add(new Tag(tag)); } return this; } public TaskBuilder withDates(Date startDate, Date endDate) throws IllegalValueException { this.task.getDates().setStartDate(startDate); this.task.getDates().setEndDate(endDate); return this; } public TestTask build() { return this.task; } }
Change class to use new TaskDate
Change class to use new TaskDate
Java
mit
CS2103JAN2017-W13-B4/main,CS2103JAN2017-W13-B4/main
java
## Code Before: package seedu.doist.testutil; import java.util.Date; import seedu.doist.commons.exceptions.IllegalValueException; import seedu.doist.model.tag.Tag; import seedu.doist.model.tag.UniqueTagList; import seedu.doist.model.task.Description; import seedu.doist.model.task.Priority; /** * */ public class TaskBuilder { private TestTask task; public TaskBuilder() { this.task = new TestTask(); } /** * Initializes the TaskBuilder with the data of {@code personToCopy}. */ public TaskBuilder(TestTask taskToCopy) { this.task = new TestTask(taskToCopy); } public TaskBuilder withName(String name) throws IllegalValueException { this.task.setName(new Description(name)); return this; } public TaskBuilder withPriority(String priority) throws IllegalValueException { this.task.setPriority(new Priority(priority)); return this; } public TaskBuilder withTags(String ... tags) throws IllegalValueException { task.setTags(new UniqueTagList()); for (String tag: tags) { task.getTags().add(new Tag(tag)); } return this; } public TaskBuilder withDates(Date startDate, Date endDate) throws IllegalValueException { this.task.setStartDate(startDate); this.task.setEndDate(endDate); return this; } public TestTask build() { return this.task; } } ## Instruction: Change class to use new TaskDate ## Code After: package seedu.doist.testutil; import java.util.Date; import seedu.doist.commons.exceptions.IllegalValueException; import seedu.doist.model.tag.Tag; import seedu.doist.model.tag.UniqueTagList; import seedu.doist.model.task.Description; import seedu.doist.model.task.Priority; /** * */ public class TaskBuilder { private TestTask task; public TaskBuilder() { this.task = new TestTask(); } /** * Initializes the TaskBuilder with the data of {@code personToCopy}. */ public TaskBuilder(TestTask taskToCopy) { this.task = new TestTask(taskToCopy); } public TaskBuilder withName(String name) throws IllegalValueException { this.task.setName(new Description(name)); return this; } public TaskBuilder withPriority(String priority) throws IllegalValueException { this.task.setPriority(new Priority(priority)); return this; } public TaskBuilder withTags(String ... tags) throws IllegalValueException { task.setTags(new UniqueTagList()); for (String tag: tags) { task.getTags().add(new Tag(tag)); } return this; } public TaskBuilder withDates(Date startDate, Date endDate) throws IllegalValueException { this.task.getDates().setStartDate(startDate); this.task.getDates().setEndDate(endDate); return this; } public TestTask build() { return this.task; } }
package seedu.doist.testutil; import java.util.Date; import seedu.doist.commons.exceptions.IllegalValueException; import seedu.doist.model.tag.Tag; import seedu.doist.model.tag.UniqueTagList; import seedu.doist.model.task.Description; import seedu.doist.model.task.Priority; /** * */ public class TaskBuilder { private TestTask task; public TaskBuilder() { this.task = new TestTask(); } /** * Initializes the TaskBuilder with the data of {@code personToCopy}. */ public TaskBuilder(TestTask taskToCopy) { this.task = new TestTask(taskToCopy); } public TaskBuilder withName(String name) throws IllegalValueException { this.task.setName(new Description(name)); return this; } public TaskBuilder withPriority(String priority) throws IllegalValueException { this.task.setPriority(new Priority(priority)); return this; } public TaskBuilder withTags(String ... tags) throws IllegalValueException { task.setTags(new UniqueTagList()); for (String tag: tags) { task.getTags().add(new Tag(tag)); } return this; } public TaskBuilder withDates(Date startDate, Date endDate) throws IllegalValueException { - this.task.setStartDate(startDate); + this.task.getDates().setStartDate(startDate); ? +++++++++++ - this.task.setEndDate(endDate); + this.task.getDates().setEndDate(endDate); ? +++++++++++ return this; } public TestTask build() { return this.task; } }
4
0.070175
2
2
fae74a7b75fc98d4723f082bda963f4dabb6edad
ajax/libs/oj.markdown/package.json
ajax/libs/oj.markdown/package.json
{ "name": "oj.markdown", "version": "0.2.9", "description": "Markdown plugin for oj", "homepage": "http://ojjs.org", "keywords": [ "oj", "markdown", "marked" ], "author": "Evan Moran <evan@evanmoran.com>", "repository": { "type": "git", "url": "git://github.com/ojjs/oj.markdown.git" }, "filename": "oj.markdown.min.js" }
{ "name": "oj.markdown", "version": "0.2.9", "description": "Markdown plugin for oj", "homepage": "http://ojjs.org", "keywords": [ "oj", "markdown", "marked" ], "author": "Evan Moran <evan@evanmoran.com>", "repository": { "type": "git", "url": "git://github.com/ojjs/oj.markdown.git" }, "filename": "oj.markdown.min.js", "autoupdate": { "source": "git", "target": "git://github.com/ojjs/oj.markdown.git", "basePath": "", "files": [ "oj.markdown.js" ] } }
Add git autoupdate config in oj.markdown
Add git autoupdate config in oj.markdown
JSON
mit
AlexisArce/cdnjs,ljharb/cdnjs,xymostech/cdnjs,GaryChamberlain/cdnjs,tmorin/cdnjs,iros/cdnjs,aashish24/cdnjs,dhowe/cdnjs,khasinski/cdnjs,zhangbg/cdnjs,ljharb/cdnjs,aashish24/cdnjs,gaearon/cdnjs,ematsusaka/cdnjs,iros/cdnjs,peteygao/cdnjs,viskin/cdnjs,khasinski/cdnjs,GaryChamberlain/cdnjs,xymostech/cdnjs,viskin/cdnjs,zhangbg/cdnjs,schoren/cdnjs,schoren/cdnjs,freak3dot/cdnjs,sujonvidia/cdnjs,AlexisArce/cdnjs,tresni/cdnjs,pcarrier/cdnjs,tmorin/cdnjs,dhowe/cdnjs,mgoldsborough/cdnjs,gokuale/cdnjs,sujonvidia/cdnjs,xymostech/cdnjs,nareshs435/cdnjs,dhenson02/cdnjs,xymostech/cdnjs,calvinf/cdnjs,ematsusaka/cdnjs,freak3dot/cdnjs,peteygao/cdnjs,viskin/cdnjs,paleozogt/cdnjs,dhenson02/cdnjs,xymostech/cdnjs,peteygao/cdnjs,gokuale/cdnjs,calvinf/cdnjs,jackdoyle/cdnjs,viskin/cdnjs,tresni/cdnjs,gaearon/cdnjs,dhenson02/cdnjs,viskin/cdnjs,pcarrier/cdnjs,paleozogt/cdnjs,dhenson02/cdnjs,nareshs435/cdnjs,jackdoyle/cdnjs,mgoldsborough/cdnjs
json
## Code Before: { "name": "oj.markdown", "version": "0.2.9", "description": "Markdown plugin for oj", "homepage": "http://ojjs.org", "keywords": [ "oj", "markdown", "marked" ], "author": "Evan Moran <evan@evanmoran.com>", "repository": { "type": "git", "url": "git://github.com/ojjs/oj.markdown.git" }, "filename": "oj.markdown.min.js" } ## Instruction: Add git autoupdate config in oj.markdown ## Code After: { "name": "oj.markdown", "version": "0.2.9", "description": "Markdown plugin for oj", "homepage": "http://ojjs.org", "keywords": [ "oj", "markdown", "marked" ], "author": "Evan Moran <evan@evanmoran.com>", "repository": { "type": "git", "url": "git://github.com/ojjs/oj.markdown.git" }, "filename": "oj.markdown.min.js", "autoupdate": { "source": "git", "target": "git://github.com/ojjs/oj.markdown.git", "basePath": "", "files": [ "oj.markdown.js" ] } }
{ "name": "oj.markdown", "version": "0.2.9", "description": "Markdown plugin for oj", "homepage": "http://ojjs.org", "keywords": [ "oj", "markdown", "marked" ], "author": "Evan Moran <evan@evanmoran.com>", "repository": { "type": "git", "url": "git://github.com/ojjs/oj.markdown.git" }, - "filename": "oj.markdown.min.js" + "filename": "oj.markdown.min.js", ? + + "autoupdate": { + "source": "git", + "target": "git://github.com/ojjs/oj.markdown.git", + "basePath": "", + "files": [ + "oj.markdown.js" + ] + } }
10
0.588235
9
1
df21abecc49fbc05540218748d47717a81f7872c
dev-tools/idea/.idea/libraries/Solr_example_library.xml
dev-tools/idea/.idea/libraries/Solr_example_library.xml
<component name="libraryTable"> <library name="Solr example library"> <CLASSES> <root url="file://$PROJECT_DIR$/solr/example/lib" /> </CLASSES> <JAVADOC /> <SOURCES /> <jarDirectory url="file://$PROJECT_DIR$/solr/example/lib" recursive="true" /> </library> </component>
<component name="libraryTable"> <library name="Solr example library"> <CLASSES> <root url="file://$PROJECT_DIR$/solr/server/lib" /> </CLASSES> <JAVADOC /> <SOURCES /> <jarDirectory url="file://$PROJECT_DIR$/solr/server/lib" recursive="true" /> </library> </component>
Fix IDEA project settings after move to server.
SOLR-3619: Fix IDEA project settings after move to server. git-svn-id: 308d55f399f3bd9aa0560a10e81a003040006c48@1635833 13f79535-47bb-0310-9956-ffa450edef68
XML
apache-2.0
apache/solr,apache/solr,apache/solr,apache/solr,apache/solr
xml
## Code Before: <component name="libraryTable"> <library name="Solr example library"> <CLASSES> <root url="file://$PROJECT_DIR$/solr/example/lib" /> </CLASSES> <JAVADOC /> <SOURCES /> <jarDirectory url="file://$PROJECT_DIR$/solr/example/lib" recursive="true" /> </library> </component> ## Instruction: SOLR-3619: Fix IDEA project settings after move to server. git-svn-id: 308d55f399f3bd9aa0560a10e81a003040006c48@1635833 13f79535-47bb-0310-9956-ffa450edef68 ## Code After: <component name="libraryTable"> <library name="Solr example library"> <CLASSES> <root url="file://$PROJECT_DIR$/solr/server/lib" /> </CLASSES> <JAVADOC /> <SOURCES /> <jarDirectory url="file://$PROJECT_DIR$/solr/server/lib" recursive="true" /> </library> </component>
<component name="libraryTable"> <library name="Solr example library"> <CLASSES> - <root url="file://$PROJECT_DIR$/solr/example/lib" /> ? ^^^^^ + <root url="file://$PROJECT_DIR$/solr/server/lib" /> ? + ^^ + </CLASSES> <JAVADOC /> <SOURCES /> - <jarDirectory url="file://$PROJECT_DIR$/solr/example/lib" recursive="true" /> ? ^^^^^ + <jarDirectory url="file://$PROJECT_DIR$/solr/server/lib" recursive="true" /> ? + ^^ + </library> </component>
4
0.4
2
2
c685a5a13e8dc8d1acdb1ddd9a18f0b1c0450173
app/account/login.jade
app/account/login.jade
article.login include ../../headline.jade section.login-form .inner-wrapper form( action="/login", method="POST") label(for="username") Username input(type="text" id="password" name="username" placeholder="johnfredrik" value = "johnfredrik" required) label(for="password") Password input(type="password" id="password" name="password" placeholder="password" value="SuperPass" required) label(for="remember") keep logged in input(type="checkbox" id="remember") button(class="submit" type="submit") Login
article.login include ../../headline.jade section.login-form .inner-wrapper form( action="/login", method="POST") label(for="username") Username input(type="text" id="password" name="username" placeholder="johnfredrik" value="" required) label(for="password") Password input(type="password" id="password" name="password" placeholder="password" value="" required) label(for="remember") keep logged in input(type="checkbox" id="remember") button(class="submit" type="submit") Login
Remove johnfredrik as defaulted input
Remove johnfredrik as defaulted input
Jade
mit
Microbrewit/microbrew-it-middleware,Microbrewit/microbrew-it-middleware
jade
## Code Before: article.login include ../../headline.jade section.login-form .inner-wrapper form( action="/login", method="POST") label(for="username") Username input(type="text" id="password" name="username" placeholder="johnfredrik" value = "johnfredrik" required) label(for="password") Password input(type="password" id="password" name="password" placeholder="password" value="SuperPass" required) label(for="remember") keep logged in input(type="checkbox" id="remember") button(class="submit" type="submit") Login ## Instruction: Remove johnfredrik as defaulted input ## Code After: article.login include ../../headline.jade section.login-form .inner-wrapper form( action="/login", method="POST") label(for="username") Username input(type="text" id="password" name="username" placeholder="johnfredrik" value="" required) label(for="password") Password input(type="password" id="password" name="password" placeholder="password" value="" required) label(for="remember") keep logged in input(type="checkbox" id="remember") button(class="submit" type="submit") Login
article.login include ../../headline.jade section.login-form .inner-wrapper form( action="/login", method="POST") label(for="username") Username - input(type="text" id="password" name="username" placeholder="johnfredrik" value = "johnfredrik" required) ? - - ----------- + input(type="text" id="password" name="username" placeholder="johnfredrik" value="" required) label(for="password") Password - input(type="password" id="password" name="password" placeholder="password" value="SuperPass" required) ? --------- + input(type="password" id="password" name="password" placeholder="password" value="" required) label(for="remember") keep logged in input(type="checkbox" id="remember") button(class="submit" type="submit") Login
4
0.266667
2
2
d3e8b08a2ba4036a878304fbcc6ad181f046606e
packages/ya/yam-app.yaml
packages/ya/yam-app.yaml
homepage: https://github.com/leptonyu/yam/tree/master/yam-app#readme changelog-type: '' hash: ff6a404b82429b388ccec66a6411c9455f311213d19195e8687be2037b3bba02 test-bench-deps: {} maintainer: Daniel YU <leptonyu@gmail.com> synopsis: Yam App changelog: '' basic-deps: exceptions: -any base: ! '>=4.7 && <5' time: -any persistent: -any unordered-containers: -any text: -any monad-control: -any resource-pool: -any conduit: -any data-default: -any ctrie: -any fast-logger: -any containers: -any mtl: -any monad-logger: -any transformers: -any random: -any string-conversions: -any wai-logger: -any resourcet: -any persistent-sqlite: -any aeson: -any yaml: -any directory: -any all-versions: - '0.1.7' author: Daniel YU latest: '0.1.7' description-type: markdown description: ! '# yam-app ' license-name: BSD3
homepage: https://github.com/leptonyu/yam/tree/master/yam-app#readme changelog-type: '' hash: 25bece857649c83de7f468ad4765d684799fe3b2ff929276929ab7b5f5ff3b2f test-bench-deps: {} maintainer: Daniel YU <leptonyu@gmail.com> synopsis: Yam App changelog: '' basic-deps: exceptions: -any base: ! '>=4.7 && <5' time: -any persistent: -any unordered-containers: -any text: -any monad-control: -any resource-pool: -any conduit: -any data-default: -any ctrie: -any fast-logger: -any containers: -any mtl: -any monad-logger: -any transformers: -any random: -any string-conversions: -any wai-logger: -any resourcet: -any persistent-sqlite: -any aeson: -any yaml: -any directory: -any all-versions: - '0.1.7' - '0.1.8' author: Daniel YU latest: '0.1.8' description-type: markdown description: ! '# yam-app ' license-name: BSD3
Update from Hackage at 2018-01-15T09:13:03Z
Update from Hackage at 2018-01-15T09:13:03Z
YAML
mit
commercialhaskell/all-cabal-metadata
yaml
## Code Before: homepage: https://github.com/leptonyu/yam/tree/master/yam-app#readme changelog-type: '' hash: ff6a404b82429b388ccec66a6411c9455f311213d19195e8687be2037b3bba02 test-bench-deps: {} maintainer: Daniel YU <leptonyu@gmail.com> synopsis: Yam App changelog: '' basic-deps: exceptions: -any base: ! '>=4.7 && <5' time: -any persistent: -any unordered-containers: -any text: -any monad-control: -any resource-pool: -any conduit: -any data-default: -any ctrie: -any fast-logger: -any containers: -any mtl: -any monad-logger: -any transformers: -any random: -any string-conversions: -any wai-logger: -any resourcet: -any persistent-sqlite: -any aeson: -any yaml: -any directory: -any all-versions: - '0.1.7' author: Daniel YU latest: '0.1.7' description-type: markdown description: ! '# yam-app ' license-name: BSD3 ## Instruction: Update from Hackage at 2018-01-15T09:13:03Z ## Code After: homepage: https://github.com/leptonyu/yam/tree/master/yam-app#readme changelog-type: '' hash: 25bece857649c83de7f468ad4765d684799fe3b2ff929276929ab7b5f5ff3b2f test-bench-deps: {} maintainer: Daniel YU <leptonyu@gmail.com> synopsis: Yam App changelog: '' basic-deps: exceptions: -any base: ! '>=4.7 && <5' time: -any persistent: -any unordered-containers: -any text: -any monad-control: -any resource-pool: -any conduit: -any data-default: -any ctrie: -any fast-logger: -any containers: -any mtl: -any monad-logger: -any transformers: -any random: -any string-conversions: -any wai-logger: -any resourcet: -any persistent-sqlite: -any aeson: -any yaml: -any directory: -any all-versions: - '0.1.7' - '0.1.8' author: Daniel YU latest: '0.1.8' description-type: markdown description: ! '# yam-app ' license-name: BSD3
homepage: https://github.com/leptonyu/yam/tree/master/yam-app#readme changelog-type: '' - hash: ff6a404b82429b388ccec66a6411c9455f311213d19195e8687be2037b3bba02 + hash: 25bece857649c83de7f468ad4765d684799fe3b2ff929276929ab7b5f5ff3b2f test-bench-deps: {} maintainer: Daniel YU <leptonyu@gmail.com> synopsis: Yam App changelog: '' basic-deps: exceptions: -any base: ! '>=4.7 && <5' time: -any persistent: -any unordered-containers: -any text: -any monad-control: -any resource-pool: -any conduit: -any data-default: -any ctrie: -any fast-logger: -any containers: -any mtl: -any monad-logger: -any transformers: -any random: -any string-conversions: -any wai-logger: -any resourcet: -any persistent-sqlite: -any aeson: -any yaml: -any directory: -any all-versions: - '0.1.7' + - '0.1.8' author: Daniel YU - latest: '0.1.7' ? ^ + latest: '0.1.8' ? ^ description-type: markdown description: ! '# yam-app ' license-name: BSD3
5
0.121951
3
2
ba16c9e2faf7b59628db5e5f7ed2ffe51638222b
cpp/docs/include/structure/unionfind.md
cpp/docs/include/structure/unionfind.md
``` UnionFind(int n); ``` - 0 から \\( n - 1 \\) までそれぞれに対して,その要素だけを格納した集合を作成する. - 計算量: O(n) ``` int root(int x); ``` - x を含む集合の代表元を返す. - 計算量: amortized O(α(n)) ``` bool same(int x, int y); ``` - x と y が同一の集合に属するかどうかを返す. - 計算量: amortized O(α(n)) ``` bool unite(int x, int y); ``` - x を含む集合と y を含む集合を併合する.既に x を含む集合と y を含む集合が同じ集合である場合は, `false` を返し,そうでない場合は `true` を返す. - 計算量: amortized O(α(n))
{% highlight cpp %} (1) UnionFind(int n); (2) int root(int x); (3) bool same(int x, int y); (4) bool unite(int x, int y); {% endhighlight %} - (1): \\( 0 \\) から \\( n - 1 \\) までそれぞれに対して,その要素だけを格納した集合を作る. - (2): \\( x \\) を含む集合の代表元を返す. - (3): \\( x \\) と \\( y \\) が同一の集合に属するかどうかを返す. - (4): \\( x \\) を含む集合と \\( y \\) を含む集合を併合する. - 既に \\( x \\) を含む集合と \\( y \\) を含む集合が同じ集合である場合は, false を返し,そうでない場合は true を返す. ### Time Complexity - (1): \\( O(n) \\) - (2): amortized \\( O(\alpha(n)) \\) - (3): amortized \\( O(\alpha(n)) \\) - (4): amortized \\( O(\alpha(n)) \\)
Fix the format of document
Fix the format of document
Markdown
mit
asi1024/ContestLibrary,asi1024/competitive-library,asi1024/competitive-library,asi1024/competitive-library
markdown
## Code Before: ``` UnionFind(int n); ``` - 0 から \\( n - 1 \\) までそれぞれに対して,その要素だけを格納した集合を作成する. - 計算量: O(n) ``` int root(int x); ``` - x を含む集合の代表元を返す. - 計算量: amortized O(α(n)) ``` bool same(int x, int y); ``` - x と y が同一の集合に属するかどうかを返す. - 計算量: amortized O(α(n)) ``` bool unite(int x, int y); ``` - x を含む集合と y を含む集合を併合する.既に x を含む集合と y を含む集合が同じ集合である場合は, `false` を返し,そうでない場合は `true` を返す. - 計算量: amortized O(α(n)) ## Instruction: Fix the format of document ## Code After: {% highlight cpp %} (1) UnionFind(int n); (2) int root(int x); (3) bool same(int x, int y); (4) bool unite(int x, int y); {% endhighlight %} - (1): \\( 0 \\) から \\( n - 1 \\) までそれぞれに対して,その要素だけを格納した集合を作る. - (2): \\( x \\) を含む集合の代表元を返す. - (3): \\( x \\) と \\( y \\) が同一の集合に属するかどうかを返す. - (4): \\( x \\) を含む集合と \\( y \\) を含む集合を併合する. - 既に \\( x \\) を含む集合と \\( y \\) を含む集合が同じ集合である場合は, false を返し,そうでない場合は true を返す. ### Time Complexity - (1): \\( O(n) \\) - (2): amortized \\( O(\alpha(n)) \\) - (3): amortized \\( O(\alpha(n)) \\) - (4): amortized \\( O(\alpha(n)) \\)
- ``` - UnionFind(int n); - ``` - - 0 から \\( n - 1 \\) までそれぞれに対して,その要素だけを格納した集合を作成する. - - 計算量: O(n) - ``` + {% highlight cpp %} + (1) UnionFind(int n); - int root(int x); + (2) int root(int x); ? ++++ - ``` - - x を含む集合の代表元を返す. - - 計算量: amortized O(α(n)) + (3) bool same(int x, int y); + (4) bool unite(int x, int y); + {% endhighlight %} - ``` - bool same(int x, int y); - ``` - - x と y が同一の集合に属するかどうかを返す. - - 計算量: amortized O(α(n)) + - (1): \\( 0 \\) から \\( n - 1 \\) までそれぞれに対して,その要素だけを格納した集合を作る. + - (2): \\( x \\) を含む集合の代表元を返す. + - (3): \\( x \\) と \\( y \\) が同一の集合に属するかどうかを返す. + - (4): \\( x \\) を含む集合と \\( y \\) を含む集合を併合する. + - 既に \\( x \\) を含む集合と \\( y \\) を含む集合が同じ集合である場合は, + false を返し,そうでない場合は true を返す. - ``` - bool unite(int x, int y); - ``` - - x を含む集合と y を含む集合を併合する.既に x を含む集合と y を含む集合が同じ集合である場合は, `false` を返し,そうでない場合は `true` を返す. - - 計算量: amortized O(α(n)) + ### Time Complexity + - (1): \\( O(n) \\) + - (2): amortized \\( O(\alpha(n)) \\) + - (3): amortized \\( O(\alpha(n)) \\) + - (4): amortized \\( O(\alpha(n)) \\)
37
1.608696
17
20
7e49e3797d2b3194975b55f01863732cd8a1eeb4
autoload.php
autoload.php
<?php $Gcm__ = array( 'GatewayApiController'=>'controllers/GatewayApiController.php', 'ManagementApiController'=>'controllers/ManagementApiController.php', 'SpringApiController'=>'controllers/SpringApiController.php', 'CoreHandler'=>'handlers/CoreHandler.php', 'GatewayHandler'=>'handlers/GatewayHandler.php', 'ModuleHandler'=>'handlers/ModuleHandler.php', 'ProtocolHandler'=>'handlers/ProtocolHandler.php', 'RequestHandler'=>'handlers/RequestHandler.php', 'SemanticVersion'=>'handlers/SemanticVersion.php', 'VersionHandler'=>'handlers/VersionHandler.php', 'ICoreHandler'=>'interfaces/ICoreHandler.php', 'IModuleHandler'=>'interfaces/IModuleHandler.php', 'ISystemUpdateDb'=>'interfaces/ISystemUpdateDb.php', 'IVersionHandler'=>'interfaces/IVersionHandler.php', 'NetspaceKvs'=>'models/NetspaceKvs.php', 'Resolution'=>'models/Resolution.php', 'SystemUpdateKvs'=>'models/SystemUpdateKvs.php', 'UpdateCheck'=>'updater/UpdateCheck.php', 'UpdateRunner'=>'updater/UpdateRunner.php', ); spl_autoload_register(function ($class) { global $Gcm__; if(!isset($Gcm__[$class])) return; include __DIR__.'/system/' . $Gcm__[$class]; });
<?php $Gcm__ = array( 'GatewayApiController'=>'controllers/GatewayApiController.php', 'ManagementApiController'=>'controllers/ManagementApiController.php', 'SpringApiController'=>'controllers/SpringApiController.php', 'CoreHandler'=>'handlers/CoreHandler.php', 'GatewayHandler'=>'handlers/GatewayHandler.php', 'ModuleHandler'=>'handlers/ModuleHandler.php', 'PackageHandler'=>'handlers/PackageHandler.php', 'ProtocolHandler'=>'handlers/ProtocolHandler.php', 'RequestHandler'=>'handlers/RequestHandler.php', 'SemanticVersion'=>'handlers/SemanticVersion.php', 'VersionHandler'=>'handlers/VersionHandler.php', 'ICoreHandler'=>'interfaces/ICoreHandler.php', 'IModuleHandler'=>'interfaces/IModuleHandler.php', 'IPackageHandler'=>'interfaces/IPackageHandler.php', 'ISystemUpdateDb'=>'interfaces/ISystemUpdateDb.php', 'IVersionHandler'=>'interfaces/IVersionHandler.php', 'NetspaceKvs'=>'models/NetspaceKvs.php', 'Resolution'=>'models/Resolution.php', 'SystemUpdateKvs'=>'models/SystemUpdateKvs.php', 'UpdateCheck'=>'updater/UpdateCheck.php', 'UpdateRunner'=>'updater/UpdateRunner.php', ); spl_autoload_register(function ($class) { global $Gcm__; if(!isset($Gcm__[$class])) return; include __DIR__.'/system/' . $Gcm__[$class]; });
Add package handler to class map
general: Add package handler to class map
PHP
apache-2.0
SpringDVS/php.web.node,SpringDVS/php.web.node,SpringDVS/nodeweb_php,SpringDVS/nodeweb_php
php
## Code Before: <?php $Gcm__ = array( 'GatewayApiController'=>'controllers/GatewayApiController.php', 'ManagementApiController'=>'controllers/ManagementApiController.php', 'SpringApiController'=>'controllers/SpringApiController.php', 'CoreHandler'=>'handlers/CoreHandler.php', 'GatewayHandler'=>'handlers/GatewayHandler.php', 'ModuleHandler'=>'handlers/ModuleHandler.php', 'ProtocolHandler'=>'handlers/ProtocolHandler.php', 'RequestHandler'=>'handlers/RequestHandler.php', 'SemanticVersion'=>'handlers/SemanticVersion.php', 'VersionHandler'=>'handlers/VersionHandler.php', 'ICoreHandler'=>'interfaces/ICoreHandler.php', 'IModuleHandler'=>'interfaces/IModuleHandler.php', 'ISystemUpdateDb'=>'interfaces/ISystemUpdateDb.php', 'IVersionHandler'=>'interfaces/IVersionHandler.php', 'NetspaceKvs'=>'models/NetspaceKvs.php', 'Resolution'=>'models/Resolution.php', 'SystemUpdateKvs'=>'models/SystemUpdateKvs.php', 'UpdateCheck'=>'updater/UpdateCheck.php', 'UpdateRunner'=>'updater/UpdateRunner.php', ); spl_autoload_register(function ($class) { global $Gcm__; if(!isset($Gcm__[$class])) return; include __DIR__.'/system/' . $Gcm__[$class]; }); ## Instruction: general: Add package handler to class map ## Code After: <?php $Gcm__ = array( 'GatewayApiController'=>'controllers/GatewayApiController.php', 'ManagementApiController'=>'controllers/ManagementApiController.php', 'SpringApiController'=>'controllers/SpringApiController.php', 'CoreHandler'=>'handlers/CoreHandler.php', 'GatewayHandler'=>'handlers/GatewayHandler.php', 'ModuleHandler'=>'handlers/ModuleHandler.php', 'PackageHandler'=>'handlers/PackageHandler.php', 'ProtocolHandler'=>'handlers/ProtocolHandler.php', 'RequestHandler'=>'handlers/RequestHandler.php', 'SemanticVersion'=>'handlers/SemanticVersion.php', 'VersionHandler'=>'handlers/VersionHandler.php', 'ICoreHandler'=>'interfaces/ICoreHandler.php', 'IModuleHandler'=>'interfaces/IModuleHandler.php', 'IPackageHandler'=>'interfaces/IPackageHandler.php', 'ISystemUpdateDb'=>'interfaces/ISystemUpdateDb.php', 'IVersionHandler'=>'interfaces/IVersionHandler.php', 'NetspaceKvs'=>'models/NetspaceKvs.php', 'Resolution'=>'models/Resolution.php', 'SystemUpdateKvs'=>'models/SystemUpdateKvs.php', 'UpdateCheck'=>'updater/UpdateCheck.php', 'UpdateRunner'=>'updater/UpdateRunner.php', ); spl_autoload_register(function ($class) { global $Gcm__; if(!isset($Gcm__[$class])) return; include __DIR__.'/system/' . $Gcm__[$class]; });
<?php $Gcm__ = array( 'GatewayApiController'=>'controllers/GatewayApiController.php', 'ManagementApiController'=>'controllers/ManagementApiController.php', 'SpringApiController'=>'controllers/SpringApiController.php', 'CoreHandler'=>'handlers/CoreHandler.php', 'GatewayHandler'=>'handlers/GatewayHandler.php', 'ModuleHandler'=>'handlers/ModuleHandler.php', + 'PackageHandler'=>'handlers/PackageHandler.php', 'ProtocolHandler'=>'handlers/ProtocolHandler.php', 'RequestHandler'=>'handlers/RequestHandler.php', 'SemanticVersion'=>'handlers/SemanticVersion.php', 'VersionHandler'=>'handlers/VersionHandler.php', 'ICoreHandler'=>'interfaces/ICoreHandler.php', 'IModuleHandler'=>'interfaces/IModuleHandler.php', + 'IPackageHandler'=>'interfaces/IPackageHandler.php', 'ISystemUpdateDb'=>'interfaces/ISystemUpdateDb.php', 'IVersionHandler'=>'interfaces/IVersionHandler.php', 'NetspaceKvs'=>'models/NetspaceKvs.php', 'Resolution'=>'models/Resolution.php', 'SystemUpdateKvs'=>'models/SystemUpdateKvs.php', 'UpdateCheck'=>'updater/UpdateCheck.php', 'UpdateRunner'=>'updater/UpdateRunner.php', ); spl_autoload_register(function ($class) { global $Gcm__; if(!isset($Gcm__[$class])) return; include __DIR__.'/system/' . $Gcm__[$class]; });
2
0.074074
2
0
d153c91d072d691d2e499b633f69f10751f8e9bd
lib/flaky/run/one_test.rb
lib/flaky/run/one_test.rb
module Flaky def self.run_one_test opts={} raise 'Must pass :count and :name' unless opts && opts[:count] && opts[:os] && opts[:name] count = opts[:count].to_i os = opts[:os] name = opts[:name] raise ':count must be an int' unless count.kind_of?(Integer) raise ':os must be a string' unless os.kind_of?(String) raise ':name must be a string' unless name.kind_of?(String) # ensure file name does not contain an extension name = File.basename name, '.*' flaky = Flaky::Run.new appium = Appium.new current_dir = Dir.pwd raise "Rakefile doesn't exist in #{current_dir}" unless File.exists?(File.join(current_dir, 'Rakefile')) file = '' Dir.glob(File.join current_dir, 'appium', os, 'specs', "**/#{name}.rb") do |test_file| file = test_file end raise "#{test_file} does not exist." if file.empty? test_name = file.sub(current_dir + '/appium/', '').gsub('/', '_') puts "Running #{name} #{count}x" count.times do appium.go # start appium run_cmd = "cd #{current_dir}; rake ios['#{name}']" flaky.execute run_cmd: run_cmd, test_name: test_name, appium: appium end flaky.report end end # module Flaky
module Flaky def self.run_one_test opts={} raise 'Must pass :count and :name' unless opts && opts[:count] && opts[:os] && opts[:name] count = opts[:count].to_i os = opts[:os] name = opts[:name] raise ':count must be an int' unless count.kind_of?(Integer) raise ':os must be a string' unless os.kind_of?(String) raise ':name must be a string' unless name.kind_of?(String) # ensure file name does not contain an extension name = File.basename name, '.*' flaky = Flaky::Run.new appium = Appium.new current_dir = Dir.pwd raise "Rakefile doesn't exist in #{current_dir}" unless File.exists?(File.join(current_dir, 'Rakefile')) file = '' Dir.glob(File.join current_dir, 'appium', os, 'specs', "**/#{name}.rb") do |test_file| file = test_file end raise "#{test_file} does not exist." if file.empty? test_name = file.sub(current_dir + '/appium/', '').gsub('/', '_') puts "Running #{name} #{count}x" count.times do appium.go # start appium run_cmd = "cd #{current_dir}; rake ios['#{name}']" flaky.execute run_cmd: run_cmd, test_name: test_name, appium: appium end appium.stop flaky.report end end # module Flaky
Stop appium once we're done
Stop appium once we're done
Ruby
apache-2.0
appium/flaky,bootstraponline/rspec_flake
ruby
## Code Before: module Flaky def self.run_one_test opts={} raise 'Must pass :count and :name' unless opts && opts[:count] && opts[:os] && opts[:name] count = opts[:count].to_i os = opts[:os] name = opts[:name] raise ':count must be an int' unless count.kind_of?(Integer) raise ':os must be a string' unless os.kind_of?(String) raise ':name must be a string' unless name.kind_of?(String) # ensure file name does not contain an extension name = File.basename name, '.*' flaky = Flaky::Run.new appium = Appium.new current_dir = Dir.pwd raise "Rakefile doesn't exist in #{current_dir}" unless File.exists?(File.join(current_dir, 'Rakefile')) file = '' Dir.glob(File.join current_dir, 'appium', os, 'specs', "**/#{name}.rb") do |test_file| file = test_file end raise "#{test_file} does not exist." if file.empty? test_name = file.sub(current_dir + '/appium/', '').gsub('/', '_') puts "Running #{name} #{count}x" count.times do appium.go # start appium run_cmd = "cd #{current_dir}; rake ios['#{name}']" flaky.execute run_cmd: run_cmd, test_name: test_name, appium: appium end flaky.report end end # module Flaky ## Instruction: Stop appium once we're done ## Code After: module Flaky def self.run_one_test opts={} raise 'Must pass :count and :name' unless opts && opts[:count] && opts[:os] && opts[:name] count = opts[:count].to_i os = opts[:os] name = opts[:name] raise ':count must be an int' unless count.kind_of?(Integer) raise ':os must be a string' unless os.kind_of?(String) raise ':name must be a string' unless name.kind_of?(String) # ensure file name does not contain an extension name = File.basename name, '.*' flaky = Flaky::Run.new appium = Appium.new current_dir = Dir.pwd raise "Rakefile doesn't exist in #{current_dir}" unless File.exists?(File.join(current_dir, 'Rakefile')) file = '' Dir.glob(File.join current_dir, 'appium', os, 'specs', "**/#{name}.rb") do |test_file| file = test_file end raise "#{test_file} does not exist." if file.empty? test_name = file.sub(current_dir + '/appium/', '').gsub('/', '_') puts "Running #{name} #{count}x" count.times do appium.go # start appium run_cmd = "cd #{current_dir}; rake ios['#{name}']" flaky.execute run_cmd: run_cmd, test_name: test_name, appium: appium end appium.stop flaky.report end end # module Flaky
module Flaky def self.run_one_test opts={} raise 'Must pass :count and :name' unless opts && opts[:count] && opts[:os] && opts[:name] count = opts[:count].to_i os = opts[:os] name = opts[:name] raise ':count must be an int' unless count.kind_of?(Integer) raise ':os must be a string' unless os.kind_of?(String) raise ':name must be a string' unless name.kind_of?(String) # ensure file name does not contain an extension name = File.basename name, '.*' flaky = Flaky::Run.new appium = Appium.new current_dir = Dir.pwd raise "Rakefile doesn't exist in #{current_dir}" unless File.exists?(File.join(current_dir, 'Rakefile')) file = '' Dir.glob(File.join current_dir, 'appium', os, 'specs', "**/#{name}.rb") do |test_file| file = test_file end raise "#{test_file} does not exist." if file.empty? test_name = file.sub(current_dir + '/appium/', '').gsub('/', '_') puts "Running #{name} #{count}x" count.times do appium.go # start appium run_cmd = "cd #{current_dir}; rake ios['#{name}']" flaky.execute run_cmd: run_cmd, test_name: test_name, appium: appium end + appium.stop flaky.report end end # module Flaky
1
0.025
1
0
16d9447b912d347fbef843d27781273e51df5498
orderedmodel/static/orderedmodel/jquery.inlineordering.js
orderedmodel/static/orderedmodel/jquery.inlineordering.js
/* Code taken from django snippets http://djangosnippets.org/snippets/1053/ */ (function($){ $(function() { $('div.inline-group').sortable({ items: 'div.inline-related', handle: 'h3:first', update: function() { $(this).find('div.inline-related').each(function(i) { if ($(this).find('input[id$="-id"]').val()) { $(this).find('input[id$=order]').val(i+1); } }); } }); $('div.inline-related h3').css('cursor', 'move'); $('div.inline-related').find('input[id$=order]').parent('div').hide(); }); })(jQuery);
/* Code taken from django snippets http://djangosnippets.org/snippets/1053/ */ (function($){ $(function() { $('div.inline-group').sortable({ items: 'div.inline-related', handle: 'h3:first', update: function() { $(this).find('div.inline-related').each(function(i) { if ($(this).find('input[id$="-id"]').val()) { $(this).find('input[id$=order]').val(i+1); } }); }, // Dirty hack for not loosing value of selects while mooving start: function(evt, ui) { ui.item.find('select').each(function(){ $(this).data('value', $(this).val()); }); }, stop: function(evt, ui) { ui.item.find('select').each(function(){ $(this).val($(this).data('value')); }); } }); $('div.inline-related h3').css('cursor', 'move'); $('div.inline-related').find('input[id$=order]').parent('div').hide(); }); })(jQuery);
Add a dirty hack for not loosing value of selects while mooving
Add a dirty hack for not loosing value of selects while mooving
JavaScript
bsd-3-clause
MagicSolutions/django-orderedmodel,MagicSolutions/django-orderedmodel
javascript
## Code Before: /* Code taken from django snippets http://djangosnippets.org/snippets/1053/ */ (function($){ $(function() { $('div.inline-group').sortable({ items: 'div.inline-related', handle: 'h3:first', update: function() { $(this).find('div.inline-related').each(function(i) { if ($(this).find('input[id$="-id"]').val()) { $(this).find('input[id$=order]').val(i+1); } }); } }); $('div.inline-related h3').css('cursor', 'move'); $('div.inline-related').find('input[id$=order]').parent('div').hide(); }); })(jQuery); ## Instruction: Add a dirty hack for not loosing value of selects while mooving ## Code After: /* Code taken from django snippets http://djangosnippets.org/snippets/1053/ */ (function($){ $(function() { $('div.inline-group').sortable({ items: 'div.inline-related', handle: 'h3:first', update: function() { $(this).find('div.inline-related').each(function(i) { if ($(this).find('input[id$="-id"]').val()) { $(this).find('input[id$=order]').val(i+1); } }); }, // Dirty hack for not loosing value of selects while mooving start: function(evt, ui) { ui.item.find('select').each(function(){ $(this).data('value', $(this).val()); }); }, stop: function(evt, ui) { ui.item.find('select').each(function(){ $(this).val($(this).data('value')); }); } }); $('div.inline-related h3').css('cursor', 'move'); $('div.inline-related').find('input[id$=order]').parent('div').hide(); }); })(jQuery);
/* Code taken from django snippets http://djangosnippets.org/snippets/1053/ */ (function($){ $(function() { $('div.inline-group').sortable({ items: 'div.inline-related', handle: 'h3:first', update: function() { $(this).find('div.inline-related').each(function(i) { if ($(this).find('input[id$="-id"]').val()) { $(this).find('input[id$=order]').val(i+1); } }); + }, + + // Dirty hack for not loosing value of selects while mooving + start: function(evt, ui) { + ui.item.find('select').each(function(){ + $(this).data('value', $(this).val()); + }); + }, + stop: function(evt, ui) { + ui.item.find('select').each(function(){ + $(this).val($(this).data('value')); + }); } }); $('div.inline-related h3').css('cursor', 'move'); $('div.inline-related').find('input[id$=order]').parent('div').hide(); }); })(jQuery);
12
0.571429
12
0
0ca10de801a0104fa3d9d3f23b074591672f2318
server/lib/redirects.js
server/lib/redirects.js
const redirects = [ ['192.168.99.100/fjs', 'https://github.com/kriegslustig/presentation-functional-javascript'], ['lucaschmid.net/fjs', 'https://github.com/kriegslustig/presentation-functional-javascript'] ] module.exports = function * (next) { const redirect = redirects.find(el => el[0] === `${this.request.host}${this.request.url}` ) if (redirect) { this.set('Location', redirect[1]) this.status = 302 } else { yield next } }
const redirects = [ ['192.168.99.100/fjs', 'https://github.com/kriegslustig/presentation-functional-javascript'], ['ls7.ch/fjs', 'https://github.com/kriegslustig/presentation-functional-javascript'] ] module.exports = function * (next) { const redirect = redirects.find(el => el[0] === `${this.request.host}${this.request.url}` ) if (redirect) { this.set('Location', redirect[1]) this.status = 302 } else { yield next } }
Make the fjs redirect shorter
Make the fjs redirect shorter
JavaScript
mit
Kriegslustig/lucaschmid.net,Kriegslustig/lucaschmid.net,Kriegslustig/lucaschmid.net
javascript
## Code Before: const redirects = [ ['192.168.99.100/fjs', 'https://github.com/kriegslustig/presentation-functional-javascript'], ['lucaschmid.net/fjs', 'https://github.com/kriegslustig/presentation-functional-javascript'] ] module.exports = function * (next) { const redirect = redirects.find(el => el[0] === `${this.request.host}${this.request.url}` ) if (redirect) { this.set('Location', redirect[1]) this.status = 302 } else { yield next } } ## Instruction: Make the fjs redirect shorter ## Code After: const redirects = [ ['192.168.99.100/fjs', 'https://github.com/kriegslustig/presentation-functional-javascript'], ['ls7.ch/fjs', 'https://github.com/kriegslustig/presentation-functional-javascript'] ] module.exports = function * (next) { const redirect = redirects.find(el => el[0] === `${this.request.host}${this.request.url}` ) if (redirect) { this.set('Location', redirect[1]) this.status = 302 } else { yield next } }
const redirects = [ ['192.168.99.100/fjs', 'https://github.com/kriegslustig/presentation-functional-javascript'], - ['lucaschmid.net/fjs', 'https://github.com/kriegslustig/presentation-functional-javascript'] ? --- ------- + ['ls7.ch/fjs', 'https://github.com/kriegslustig/presentation-functional-javascript'] ? ++ ] module.exports = function * (next) { const redirect = redirects.find(el => el[0] === `${this.request.host}${this.request.url}` ) if (redirect) { this.set('Location', redirect[1]) this.status = 302 } else { yield next } }
2
0.117647
1
1