commit
stringlengths
40
40
old_file
stringlengths
4
237
new_file
stringlengths
4
237
old_contents
stringlengths
1
4.24k
new_contents
stringlengths
5
4.84k
subject
stringlengths
15
778
message
stringlengths
16
6.86k
lang
stringlengths
1
30
license
stringclasses
13 values
repos
stringlengths
5
116k
config
stringlengths
1
30
content
stringlengths
105
8.72k
d59317c34ac8bb10c8d8d760089d68c01ebdeca4
src/analyse-file.js
src/analyse-file.js
"use strict"; const vscode = require("vscode"); const analyser = require("./complexity-analyzer"); const reporter = require("./report-builder.js"); const config = require("./config"); const Output = require("./output-channel"); function getFileRelativePath(document) { const fileUri = document.fileName; const projectPath = vscode.workspace.rootPath; return projectPath ? fileUri.replace(projectPath, "") : fileUri; } function buildReport(document) { const channel = new Output(); const filePath = getFileRelativePath(document); channel.write(filePath); const metrics = config.getMetrics(); const legend = reporter.getLegend(metrics); channel.write(legend) const fileContents = document.getText(); const analysis = analyser.analyse(fileContents); const report = reporter.buildFileReport(analysis, metrics); channel.write(report); } function runAnalysis(editor) { try { buildReport(editor.document); } catch (e) { vscode.window.showErrorMessage("Failed to analyse file. " + e); console.log(e); } } module.exports = { execute: runAnalysis };
"use strict"; const vscode = require("vscode"); const analyser = require("./complexity-analyzer"); const reporter = require("./report-builder.js"); const config = require("./config"); const Output = require("./output-channel"); function buildReport(document) { const channel = new Output(); const filePath = vscode.workspace.asRelativePath(document.fileName); channel.write(filePath); const metrics = config.getMetrics(); const legend = reporter.getLegend(metrics); channel.write(legend) const fileContents = document.getText(); const analysis = analyser.analyse(fileContents); const report = reporter.buildFileReport(analysis, metrics); channel.write(report); } function runAnalysis(editor) { try { buildReport(editor.document); } catch (e) { vscode.window.showErrorMessage("Failed to analyse file. " + e); console.log(e); } } module.exports = { execute: runAnalysis };
Use build in relative path method
Use build in relative path method
JavaScript
mit
tomi/vscode-js-complexity-analysis
javascript
## Code Before: "use strict"; const vscode = require("vscode"); const analyser = require("./complexity-analyzer"); const reporter = require("./report-builder.js"); const config = require("./config"); const Output = require("./output-channel"); function getFileRelativePath(document) { const fileUri = document.fileName; const projectPath = vscode.workspace.rootPath; return projectPath ? fileUri.replace(projectPath, "") : fileUri; } function buildReport(document) { const channel = new Output(); const filePath = getFileRelativePath(document); channel.write(filePath); const metrics = config.getMetrics(); const legend = reporter.getLegend(metrics); channel.write(legend) const fileContents = document.getText(); const analysis = analyser.analyse(fileContents); const report = reporter.buildFileReport(analysis, metrics); channel.write(report); } function runAnalysis(editor) { try { buildReport(editor.document); } catch (e) { vscode.window.showErrorMessage("Failed to analyse file. " + e); console.log(e); } } module.exports = { execute: runAnalysis }; ## Instruction: Use build in relative path method ## Code After: "use strict"; const vscode = require("vscode"); const analyser = require("./complexity-analyzer"); const reporter = require("./report-builder.js"); const config = require("./config"); const Output = require("./output-channel"); function buildReport(document) { const channel = new Output(); const filePath = vscode.workspace.asRelativePath(document.fileName); channel.write(filePath); const metrics = config.getMetrics(); const legend = reporter.getLegend(metrics); channel.write(legend) const fileContents = document.getText(); const analysis = analyser.analyse(fileContents); const report = reporter.buildFileReport(analysis, metrics); channel.write(report); } function runAnalysis(editor) { try { buildReport(editor.document); } catch (e) { vscode.window.showErrorMessage("Failed to analyse file. " + e); console.log(e); } } module.exports = { execute: runAnalysis };
5f2eb49b325aed79be39bb465a70cb72539f2320
apps/backend/modules/cataloguewidget/templates/_extLinks.php
apps/backend/modules/cataloguewidget/templates/_extLinks.php
<table class="catalogue_table"> <thead> <tr> <th><?php echo __('Link');?></th> <th><?php echo __('Comment');?></th> <th></th> </tr> </thead> <tbody> <?php foreach($links as $link):?> <tr> <td> <?php echo link_to($link->getUrl(),'extlinks/extLinks?table='.$table.'&cid='.$link->getId().'&id='.$eid,array('class' => 'link_catalogue','title' => __('Edit Url') )) ; ?> <a href="<?php echo $link->getUrl();?>" target="_pop" class='complete_widget'> <?php echo image_tag('next.png',array('title'=>__('Go to this link'))) ; ?> </a> </td> <td> <?php echo $link->getComment();?> </td> <td class="widget_row_delete"> <a class="widget_row_delete" href="<?php echo url_for('catalogue/deleteRelated?table=ext_links&id='.$link->getId());?>" title="<?php echo __('Delete Link') ?>"><?php echo image_tag('remove.png'); ?> </a> </td> </tr> <?php endforeach;?> </tbody> </table> <br /> <?php echo image_tag('add_green.png');?><a title="<?php echo __('Add Link');?>" class="link_catalogue" href="<?php echo url_for('extlinks/extLinks?table='.$table.'&id='.$eid);?>"><?php echo __('Add');?></a>
<table class="catalogue_table"> <thead> <tr> <th></th> <th><?php echo __('Link');?></th> <th><?php echo __('Comment');?></th> <th></th> </tr> </thead> <tbody> <?php foreach($links as $link):?> <tr> <td> <?php echo link_to(image_tag('edit.png'),'extlinks/extLinks?table='.$table.'&cid='.$link->getId().'&id='.$eid,array('class' => 'link_catalogue','title' => __('Edit Url') )) ; ?> </td> <td> <a href="<?php echo $link->getUrl();?>" target="_pop" class='complete_widget'> <?php echo $link->getUrl();?> </a> </td> <td> <?php echo $link->getComment();?> </td> <td class="widget_row_delete"> <a class="widget_row_delete" href="<?php echo url_for('catalogue/deleteRelated?table=ext_links&id='.$link->getId());?>" title="<?php echo __('Delete Link') ?>"><?php echo image_tag('remove.png'); ?> </a> </td> </tr> <?php endforeach;?> </tbody> </table> <br /> <?php echo image_tag('add_green.png');?><a title="<?php echo __('Add Link');?>" class="link_catalogue" href="<?php echo url_for('extlinks/extLinks?table='.$table.'&id='.$eid);?>"><?php echo __('Add');?></a>
Rework external link style in catalogues
Rework external link style in catalogues
PHP
agpl-3.0
eMerzh/Darwin,eMerzh/Darwin,naturalsciences/Darwin,naturalsciences/Darwin,naturalsciences/Darwin,eMerzh/Darwin
php
## Code Before: <table class="catalogue_table"> <thead> <tr> <th><?php echo __('Link');?></th> <th><?php echo __('Comment');?></th> <th></th> </tr> </thead> <tbody> <?php foreach($links as $link):?> <tr> <td> <?php echo link_to($link->getUrl(),'extlinks/extLinks?table='.$table.'&cid='.$link->getId().'&id='.$eid,array('class' => 'link_catalogue','title' => __('Edit Url') )) ; ?> <a href="<?php echo $link->getUrl();?>" target="_pop" class='complete_widget'> <?php echo image_tag('next.png',array('title'=>__('Go to this link'))) ; ?> </a> </td> <td> <?php echo $link->getComment();?> </td> <td class="widget_row_delete"> <a class="widget_row_delete" href="<?php echo url_for('catalogue/deleteRelated?table=ext_links&id='.$link->getId());?>" title="<?php echo __('Delete Link') ?>"><?php echo image_tag('remove.png'); ?> </a> </td> </tr> <?php endforeach;?> </tbody> </table> <br /> <?php echo image_tag('add_green.png');?><a title="<?php echo __('Add Link');?>" class="link_catalogue" href="<?php echo url_for('extlinks/extLinks?table='.$table.'&id='.$eid);?>"><?php echo __('Add');?></a> ## Instruction: Rework external link style in catalogues ## Code After: <table class="catalogue_table"> <thead> <tr> <th></th> <th><?php echo __('Link');?></th> <th><?php echo __('Comment');?></th> <th></th> </tr> </thead> <tbody> <?php foreach($links as $link):?> <tr> <td> <?php echo link_to(image_tag('edit.png'),'extlinks/extLinks?table='.$table.'&cid='.$link->getId().'&id='.$eid,array('class' => 'link_catalogue','title' => __('Edit Url') )) ; ?> </td> <td> <a href="<?php echo $link->getUrl();?>" target="_pop" class='complete_widget'> <?php echo $link->getUrl();?> </a> </td> <td> <?php echo $link->getComment();?> </td> <td class="widget_row_delete"> <a class="widget_row_delete" href="<?php echo url_for('catalogue/deleteRelated?table=ext_links&id='.$link->getId());?>" title="<?php echo __('Delete Link') ?>"><?php echo image_tag('remove.png'); ?> </a> </td> </tr> <?php endforeach;?> </tbody> </table> <br /> <?php echo image_tag('add_green.png');?><a title="<?php echo __('Add Link');?>" class="link_catalogue" href="<?php echo url_for('extlinks/extLinks?table='.$table.'&id='.$eid);?>"><?php echo __('Add');?></a>
12558ca0d4180bc7433640c4a516bd3f5a85a8a2
exp/wsj/score.sh
exp/wsj/score.sh
set -e KU=$KALDI_ROOT/egs/wsj/s5/utils KL=$KALDI_ROOT/egs/wsj/s5/local . $KU/parse_options.sh if [ $# -ne 2 ]; then echo "usage: `basename $0` <dir> <part>" exit 1 fi dir=$1 part=$2 # Aggregate groundtruth cat $dir/$part-groundtruth-text.txt | sort | $KL/wer_ref_filter > $dir/tmp mv $dir/tmp $dir/$part-groundtruth-text.txt # Aggregate decoded $LVSR/bin/decoded_chars_to_words.py $lexicon $dir/$part-decoded.out - | $KL/wer_hyp_filter > $dir/$part-decoded-text.out # Score compute-wer --text --mode=all ark:$dir/$part-groundtruth-characters.txt ark:$dir/$part-decoded.out $dir/$part-characters.errs > $dir/$part-characters.wer compute-wer --text --mode=all ark:$dir/$part-groundtruth-text.txt ark:$dir/$part-decoded-text.out $dir/$part-text.errs > $dir/$part-text.wer
set -e KU=$KALDI_ROOT/egs/wsj/s5/utils KL=$KALDI_ROOT/egs/wsj/s5/local . $KU/parse_options.sh if [ $# -ne 2 ]; then echo "usage: `basename $0` <dir> <part>" echo "you should have following files:" echo " <dir>/<part>-decoded.out" echo " <dir>/<part>-decoded-text.out" echo " <dir>/<part>-groundtruth-characters.txt" echo " <dir>/<part>-groundtruth-text.txt" exit 1 fi dir=$1 part=$2 # Aggregate groundtruth cat $dir/$part-groundtruth-text.txt | sort | $KL/wer_ref_filter > $dir/tmp mv $dir/tmp $dir/$part-groundtruth-text.txt # Aggregate decoded $LVSR/bin/decoded_chars_to_words.py $lexicon $dir/$part-decoded.out - | $KL/wer_hyp_filter > $dir/$part-decoded-text.out # Score compute-wer --text --mode=all ark:$dir/$part-groundtruth-characters.txt ark:$dir/$part-decoded.out $dir/$part-characters.errs > $dir/$part-characters.wer compute-wer --text --mode=all ark:$dir/$part-groundtruth-text.txt ark:$dir/$part-decoded-text.out $dir/$part-text.errs > $dir/$part-text.wer
Make executable and some documentation
Make executable and some documentation
Shell
mit
rizar/attention-lvcsr,nke001/attention-lvcsr,rizar/attention-lvcsr,nke001/attention-lvcsr,rizar/attention-lvcsr,rizar/attention-lvcsr,nke001/attention-lvcsr,rizar/attention-lvcsr,nke001/attention-lvcsr,nke001/attention-lvcsr
shell
## Code Before: set -e KU=$KALDI_ROOT/egs/wsj/s5/utils KL=$KALDI_ROOT/egs/wsj/s5/local . $KU/parse_options.sh if [ $# -ne 2 ]; then echo "usage: `basename $0` <dir> <part>" exit 1 fi dir=$1 part=$2 # Aggregate groundtruth cat $dir/$part-groundtruth-text.txt | sort | $KL/wer_ref_filter > $dir/tmp mv $dir/tmp $dir/$part-groundtruth-text.txt # Aggregate decoded $LVSR/bin/decoded_chars_to_words.py $lexicon $dir/$part-decoded.out - | $KL/wer_hyp_filter > $dir/$part-decoded-text.out # Score compute-wer --text --mode=all ark:$dir/$part-groundtruth-characters.txt ark:$dir/$part-decoded.out $dir/$part-characters.errs > $dir/$part-characters.wer compute-wer --text --mode=all ark:$dir/$part-groundtruth-text.txt ark:$dir/$part-decoded-text.out $dir/$part-text.errs > $dir/$part-text.wer ## Instruction: Make executable and some documentation ## Code After: set -e KU=$KALDI_ROOT/egs/wsj/s5/utils KL=$KALDI_ROOT/egs/wsj/s5/local . $KU/parse_options.sh if [ $# -ne 2 ]; then echo "usage: `basename $0` <dir> <part>" echo "you should have following files:" echo " <dir>/<part>-decoded.out" echo " <dir>/<part>-decoded-text.out" echo " <dir>/<part>-groundtruth-characters.txt" echo " <dir>/<part>-groundtruth-text.txt" exit 1 fi dir=$1 part=$2 # Aggregate groundtruth cat $dir/$part-groundtruth-text.txt | sort | $KL/wer_ref_filter > $dir/tmp mv $dir/tmp $dir/$part-groundtruth-text.txt # Aggregate decoded $LVSR/bin/decoded_chars_to_words.py $lexicon $dir/$part-decoded.out - | $KL/wer_hyp_filter > $dir/$part-decoded-text.out # Score compute-wer --text --mode=all ark:$dir/$part-groundtruth-characters.txt ark:$dir/$part-decoded.out $dir/$part-characters.errs > $dir/$part-characters.wer compute-wer --text --mode=all ark:$dir/$part-groundtruth-text.txt ark:$dir/$part-decoded-text.out $dir/$part-text.errs > $dir/$part-text.wer
b237e4cc2dd5b0d09fff6bb08bda087f32c569bb
src/protocolsupport/api/chat/modifiers/ClickAction.java
src/protocolsupport/api/chat/modifiers/ClickAction.java
package protocolsupport.api.chat.modifiers; import java.net.MalformedURLException; import java.net.URL; import protocolsupport.utils.Utils; public class ClickAction { private final Type type; private final String value; public ClickAction(Type action, String value) { this.type = action; this.value = value; } public ClickAction(URL url) { this.type = Type.OPEN_URL; this.value = url.toString(); } public Type getType() { return type; } public String getValue() { return value; } public URL getUrl() throws MalformedURLException { if (type == Type.OPEN_URL) { return new URL(value); } throw new IllegalStateException(type + " is not an " + Type.OPEN_URL); } @Override public String toString() { return Utils.toStringAllFields(this); } public static enum Type { OPEN_URL, OPEN_FILE, RUN_COMMAND, TWITCH_USER_INFO, SUGGEST_COMMAND, CHANGE_PAGE; } }
package protocolsupport.api.chat.modifiers; import java.net.MalformedURLException; import java.net.URL; import protocolsupport.utils.Utils; public class ClickAction { private final Type type; private final String value; public ClickAction(Type action, String value) { this.type = action; this.value = value; } public ClickAction(URL url) { this.type = Type.OPEN_URL; this.value = url.toString(); } public Type getType() { return type; } public String getValue() { return value; } public URL getUrl() throws MalformedURLException { if (type == Type.OPEN_URL) { return new URL(value); } throw new IllegalStateException(type + " is not an " + Type.OPEN_URL); } @Override public String toString() { return Utils.toStringAllFields(this); } public static enum Type { OPEN_URL, OPEN_FILE, RUN_COMMAND, TWITCH_USER_INFO, SUGGEST_COMMAND, CHANGE_PAGE, COPY_TO_CLIPBOARD; } }
Add click action copy to clipboard
Add click action copy to clipboard
Java
agpl-3.0
ProtocolSupport/ProtocolSupport
java
## Code Before: package protocolsupport.api.chat.modifiers; import java.net.MalformedURLException; import java.net.URL; import protocolsupport.utils.Utils; public class ClickAction { private final Type type; private final String value; public ClickAction(Type action, String value) { this.type = action; this.value = value; } public ClickAction(URL url) { this.type = Type.OPEN_URL; this.value = url.toString(); } public Type getType() { return type; } public String getValue() { return value; } public URL getUrl() throws MalformedURLException { if (type == Type.OPEN_URL) { return new URL(value); } throw new IllegalStateException(type + " is not an " + Type.OPEN_URL); } @Override public String toString() { return Utils.toStringAllFields(this); } public static enum Type { OPEN_URL, OPEN_FILE, RUN_COMMAND, TWITCH_USER_INFO, SUGGEST_COMMAND, CHANGE_PAGE; } } ## Instruction: Add click action copy to clipboard ## Code After: package protocolsupport.api.chat.modifiers; import java.net.MalformedURLException; import java.net.URL; import protocolsupport.utils.Utils; public class ClickAction { private final Type type; private final String value; public ClickAction(Type action, String value) { this.type = action; this.value = value; } public ClickAction(URL url) { this.type = Type.OPEN_URL; this.value = url.toString(); } public Type getType() { return type; } public String getValue() { return value; } public URL getUrl() throws MalformedURLException { if (type == Type.OPEN_URL) { return new URL(value); } throw new IllegalStateException(type + " is not an " + Type.OPEN_URL); } @Override public String toString() { return Utils.toStringAllFields(this); } public static enum Type { OPEN_URL, OPEN_FILE, RUN_COMMAND, TWITCH_USER_INFO, SUGGEST_COMMAND, CHANGE_PAGE, COPY_TO_CLIPBOARD; } }
61244848dd40851ba67a522c37cdc5aa093d1872
defaults/main.yml
defaults/main.yml
--- # defaults file for ansible-role-fgci-bash/ bash_script_copy_these: - hist.sh bash_script_copy_all: True # This is added after MODULEPATH=$MODULEPATH bash_modules_path: "/cvmfs/fgi.csc.fi/modules/el7/all" lua_script_copy_all: True # disable by setting copy_all to false and copy_these to [] lua_script_copy_these: - SitePackage.lua
--- # defaults file for ansible-role-fgci-bash/ bash_script_copy_these: - hist.sh bash_script_copy_all: True # This is added after MODULEPATH=$MODULEPATH bash_modules_path: "/cvmfs/fgi.csc.fi/modules/el7/all:/cvmfs/fgi.csc.fi/apps/el7/aalto/spack/lmod/linux-centos7-x86_64/all:/cvmfs/fgi.csc.fi/apps/el7/aalto/spack/lmod/linux-centos7-westmere/all" lua_script_copy_all: True # disable by setting copy_all to false and copy_these to [] lua_script_copy_these: - SitePackage.lua
Update cvmfs module path to include software from aalto
Update cvmfs module path to include software from aalto
YAML
mit
CSC-IT-Center-for-Science/ansible-role-fgci-bash
yaml
## Code Before: --- # defaults file for ansible-role-fgci-bash/ bash_script_copy_these: - hist.sh bash_script_copy_all: True # This is added after MODULEPATH=$MODULEPATH bash_modules_path: "/cvmfs/fgi.csc.fi/modules/el7/all" lua_script_copy_all: True # disable by setting copy_all to false and copy_these to [] lua_script_copy_these: - SitePackage.lua ## Instruction: Update cvmfs module path to include software from aalto ## Code After: --- # defaults file for ansible-role-fgci-bash/ bash_script_copy_these: - hist.sh bash_script_copy_all: True # This is added after MODULEPATH=$MODULEPATH bash_modules_path: "/cvmfs/fgi.csc.fi/modules/el7/all:/cvmfs/fgi.csc.fi/apps/el7/aalto/spack/lmod/linux-centos7-x86_64/all:/cvmfs/fgi.csc.fi/apps/el7/aalto/spack/lmod/linux-centos7-westmere/all" lua_script_copy_all: True # disable by setting copy_all to false and copy_these to [] lua_script_copy_these: - SitePackage.lua
a373ed813ee805a3b29de0c945f1a4a358fd484d
tsbarapp/assets/style.css
tsbarapp/assets/style.css
.tsbar-popup { display:none; } .open .tsbar-popup { display:block; z-index: 1; } #tsbar { position:relative; height:50px; width:100%; border:solid black; } .tsbar-left { position:absolute; left:0px; top:0px; } .tsbar-middle { position:absolute; left:50%; margin-left:-100px; top:0px; } .tsbar-right { position:absolute; right:0px; top:0px; } .tsbar-user-icon, .tsbar-notification-icon { width:48px; height:48px; }
.tsbar-popup { display:none; } .open .tsbar-popup { display:block; z-index: 1; } #tsbar { position:relative; height:50px; width:100%; border:solid black; } .tsbar-left { position:absolute; left:0px; top:0px; } .tsbar-middle { position:absolute; left:50%; margin-left:-100px; top:0px; } .tsbar-right { position:absolute; right:0px; top:0px; } .tsbar-user-icon, .tsbar-notification-icon, .search img { width:48px; height:48px; }
Apply image sizing to search result site icons.
Apply image sizing to search result site icons.
CSS
bsd-3-clause
TiddlySpace/tsbar
css
## Code Before: .tsbar-popup { display:none; } .open .tsbar-popup { display:block; z-index: 1; } #tsbar { position:relative; height:50px; width:100%; border:solid black; } .tsbar-left { position:absolute; left:0px; top:0px; } .tsbar-middle { position:absolute; left:50%; margin-left:-100px; top:0px; } .tsbar-right { position:absolute; right:0px; top:0px; } .tsbar-user-icon, .tsbar-notification-icon { width:48px; height:48px; } ## Instruction: Apply image sizing to search result site icons. ## Code After: .tsbar-popup { display:none; } .open .tsbar-popup { display:block; z-index: 1; } #tsbar { position:relative; height:50px; width:100%; border:solid black; } .tsbar-left { position:absolute; left:0px; top:0px; } .tsbar-middle { position:absolute; left:50%; margin-left:-100px; top:0px; } .tsbar-right { position:absolute; right:0px; top:0px; } .tsbar-user-icon, .tsbar-notification-icon, .search img { width:48px; height:48px; }
6ec61fc80ea8c3626b507d20d6c95d64ae4216c0
tests/twisted/connect/timeout.py
tests/twisted/connect/timeout.py
from servicetest import assertEquals from gabbletest import exec_test, XmppAuthenticator import constants as cs import ns class NoStreamHeader(XmppAuthenticator): def __init__(self): XmppAuthenticator.__init__(self, 'test', 'pass') def streamStarted(self, root=None): return class NoAuthInfoResult(XmppAuthenticator): def __init__(self): XmppAuthenticator.__init__(self, 'test', 'pass') def auth(self, auth): return class NoAuthResult(XmppAuthenticator): def __init__(self): XmppAuthenticator.__init__(self, 'test', 'pass') def bindIq(self, iq): return def test(q, bus, conn, stream): conn.Connect() q.expect('dbus-signal', signal='StatusChanged', args=[cs.CONN_STATUS_CONNECTING, cs.CSR_REQUESTED]) e = q.expect('dbus-signal', signal='StatusChanged') status, reason = e.args assertEquals(cs.CONN_STATUS_DISCONNECTED, status) assertEquals(cs.CSR_NETWORK_ERROR, reason) if __name__ == '__main__': exec_test(test, authenticator=NoStreamHeader()) exec_test(test, authenticator=NoAuthInfoResult()) exec_test(test, authenticator=NoAuthResult())
from servicetest import assertEquals from gabbletest import exec_test, XmppAuthenticator import constants as cs import ns class NoStreamHeader(XmppAuthenticator): def __init__(self): XmppAuthenticator.__init__(self, 'test', 'pass') def streamStarted(self, root=None): pass class NoAuthInfoResult(XmppAuthenticator): def __init__(self): XmppAuthenticator.__init__(self, 'test', 'pass') def auth(self, auth): pass class NoAuthResult(XmppAuthenticator): def __init__(self): XmppAuthenticator.__init__(self, 'test', 'pass') def bindIq(self, iq): pass def test(q, bus, conn, stream): conn.Connect() q.expect('dbus-signal', signal='StatusChanged', args=[cs.CONN_STATUS_CONNECTING, cs.CSR_REQUESTED]) e = q.expect('dbus-signal', signal='StatusChanged') status, reason = e.args assertEquals(cs.CONN_STATUS_DISCONNECTED, status) assertEquals(cs.CSR_NETWORK_ERROR, reason) if __name__ == '__main__': exec_test(test, authenticator=NoStreamHeader()) exec_test(test, authenticator=NoAuthInfoResult()) exec_test(test, authenticator=NoAuthResult())
Use 'pass', not 'return', for empty Python methods
Use 'pass', not 'return', for empty Python methods
Python
lgpl-2.1
community-ssu/telepathy-gabble,community-ssu/telepathy-gabble,community-ssu/telepathy-gabble,community-ssu/telepathy-gabble
python
## Code Before: from servicetest import assertEquals from gabbletest import exec_test, XmppAuthenticator import constants as cs import ns class NoStreamHeader(XmppAuthenticator): def __init__(self): XmppAuthenticator.__init__(self, 'test', 'pass') def streamStarted(self, root=None): return class NoAuthInfoResult(XmppAuthenticator): def __init__(self): XmppAuthenticator.__init__(self, 'test', 'pass') def auth(self, auth): return class NoAuthResult(XmppAuthenticator): def __init__(self): XmppAuthenticator.__init__(self, 'test', 'pass') def bindIq(self, iq): return def test(q, bus, conn, stream): conn.Connect() q.expect('dbus-signal', signal='StatusChanged', args=[cs.CONN_STATUS_CONNECTING, cs.CSR_REQUESTED]) e = q.expect('dbus-signal', signal='StatusChanged') status, reason = e.args assertEquals(cs.CONN_STATUS_DISCONNECTED, status) assertEquals(cs.CSR_NETWORK_ERROR, reason) if __name__ == '__main__': exec_test(test, authenticator=NoStreamHeader()) exec_test(test, authenticator=NoAuthInfoResult()) exec_test(test, authenticator=NoAuthResult()) ## Instruction: Use 'pass', not 'return', for empty Python methods ## Code After: from servicetest import assertEquals from gabbletest import exec_test, XmppAuthenticator import constants as cs import ns class NoStreamHeader(XmppAuthenticator): def __init__(self): XmppAuthenticator.__init__(self, 'test', 'pass') def streamStarted(self, root=None): pass class NoAuthInfoResult(XmppAuthenticator): def __init__(self): XmppAuthenticator.__init__(self, 'test', 'pass') def auth(self, auth): pass class NoAuthResult(XmppAuthenticator): def __init__(self): XmppAuthenticator.__init__(self, 'test', 'pass') def bindIq(self, iq): pass def test(q, bus, conn, stream): conn.Connect() q.expect('dbus-signal', signal='StatusChanged', args=[cs.CONN_STATUS_CONNECTING, cs.CSR_REQUESTED]) e = q.expect('dbus-signal', signal='StatusChanged') status, reason = e.args assertEquals(cs.CONN_STATUS_DISCONNECTED, status) assertEquals(cs.CSR_NETWORK_ERROR, reason) if __name__ == '__main__': exec_test(test, authenticator=NoStreamHeader()) exec_test(test, authenticator=NoAuthInfoResult()) exec_test(test, authenticator=NoAuthResult())
fadd9ab31e0b0dbb3bdeb3d2e013ddab3c77f470
lib/ExportCsv/ExportCsv.js
lib/ExportCsv/ExportCsv.js
import React from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; import { deprecated } from 'prop-types-extra'; import exportToCsv from './exportToCsv'; import Button from '../Button'; class ExportCsv extends React.Component { static propTypes = { data: PropTypes.arrayOf(PropTypes.object), excludeKeys: deprecated(PropTypes.arrayOf(PropTypes.string), 'Use onlyFields to pass in the necessary fields'), onlyFields: PropTypes.oneOfType([ PropTypes.arrayOf(PropTypes.string), PropTypes.arrayOf(PropTypes.object), ]), } render() { const { data, excludeKeys, onlyFields } = this.props; const options = { excludeKeys, onlyFields }; return ( <Button onClick={() => { exportToCsv(data, options); }}> <FormattedMessage id="stripes-components.exportToCsv" /> </Button> ); } } export default ExportCsv;
import React from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; import exportToCsv from './exportToCsv'; import Button from '../Button'; class ExportCsv extends React.Component { static propTypes = { data: PropTypes.arrayOf(PropTypes.object), onlyFields: PropTypes.oneOfType([ PropTypes.arrayOf(PropTypes.string), PropTypes.arrayOf(PropTypes.object), ]), } render() { const { data, onlyFields } = this.props; const options = { onlyFields }; return ( <Button onClick={() => { exportToCsv(data, options); }}> <FormattedMessage id="stripes-components.exportToCsv" /> </Button> ); } } export default ExportCsv;
Remove deprecated excludeKeys prop for exportCsv
Remove deprecated excludeKeys prop for exportCsv
JavaScript
apache-2.0
folio-org/stripes-components,folio-org/stripes-components
javascript
## Code Before: import React from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; import { deprecated } from 'prop-types-extra'; import exportToCsv from './exportToCsv'; import Button from '../Button'; class ExportCsv extends React.Component { static propTypes = { data: PropTypes.arrayOf(PropTypes.object), excludeKeys: deprecated(PropTypes.arrayOf(PropTypes.string), 'Use onlyFields to pass in the necessary fields'), onlyFields: PropTypes.oneOfType([ PropTypes.arrayOf(PropTypes.string), PropTypes.arrayOf(PropTypes.object), ]), } render() { const { data, excludeKeys, onlyFields } = this.props; const options = { excludeKeys, onlyFields }; return ( <Button onClick={() => { exportToCsv(data, options); }}> <FormattedMessage id="stripes-components.exportToCsv" /> </Button> ); } } export default ExportCsv; ## Instruction: Remove deprecated excludeKeys prop for exportCsv ## Code After: import React from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; import exportToCsv from './exportToCsv'; import Button from '../Button'; class ExportCsv extends React.Component { static propTypes = { data: PropTypes.arrayOf(PropTypes.object), onlyFields: PropTypes.oneOfType([ PropTypes.arrayOf(PropTypes.string), PropTypes.arrayOf(PropTypes.object), ]), } render() { const { data, onlyFields } = this.props; const options = { onlyFields }; return ( <Button onClick={() => { exportToCsv(data, options); }}> <FormattedMessage id="stripes-components.exportToCsv" /> </Button> ); } } export default ExportCsv;
4ca56946ccc518ce57188ef64e9327f97f6f30be
tests/unit/utils/build-provider-asset-path-test.js
tests/unit/utils/build-provider-asset-path-test.js
import buildProviderAssetPath from 'preprint-service/utils/build-provider-asset-path'; import { module, test } from 'qunit'; module('Unit | Utility | build provider asset path'); // Replace this with your real tests. test('it works', function(assert) { let result = buildProviderAssetPath(); assert.ok(result); });
import config from 'ember-get-config'; import buildProviderAssetPath from 'preprint-service/utils/build-provider-asset-path'; import { module, test } from 'qunit'; module('Unit | Utility | build provider asset path'); test('build correct path for domain', function(assert) { let result = buildProviderAssetPath('foo', 'bar.baz', true); assert.equal(result, `${config.providerAssetsURL}foo/bar.baz`); }); test('build correct path for non-domain', function(assert) { let result = buildProviderAssetPath('foo', 'bar.baz', false); assert.equal(result, `${config.providerAssetsURL}foo/bar.baz`); });
Update buildProviderAssetPath unit test to do something useful
Update buildProviderAssetPath unit test to do something useful
JavaScript
apache-2.0
baylee-d/ember-preprints,CenterForOpenScience/ember-preprints,laurenrevere/ember-preprints,laurenrevere/ember-preprints,CenterForOpenScience/ember-preprints,baylee-d/ember-preprints
javascript
## Code Before: import buildProviderAssetPath from 'preprint-service/utils/build-provider-asset-path'; import { module, test } from 'qunit'; module('Unit | Utility | build provider asset path'); // Replace this with your real tests. test('it works', function(assert) { let result = buildProviderAssetPath(); assert.ok(result); }); ## Instruction: Update buildProviderAssetPath unit test to do something useful ## Code After: import config from 'ember-get-config'; import buildProviderAssetPath from 'preprint-service/utils/build-provider-asset-path'; import { module, test } from 'qunit'; module('Unit | Utility | build provider asset path'); test('build correct path for domain', function(assert) { let result = buildProviderAssetPath('foo', 'bar.baz', true); assert.equal(result, `${config.providerAssetsURL}foo/bar.baz`); }); test('build correct path for non-domain', function(assert) { let result = buildProviderAssetPath('foo', 'bar.baz', false); assert.equal(result, `${config.providerAssetsURL}foo/bar.baz`); });
eee45eca76ae643eb2dc8bbca54cecbd3f0144b3
plugin/dwall.vim
plugin/dwall.vim
if exists('g:loaded_dwall') || &compatible finish endif let g:loaded_dwall=1 function! Dwall(line1, line2, ...) range let buffer=join(getline(a:line1, a:line2), '\n') let args=join(a:000, ' ') let url=system('echo '.shellescape(buffer).' | dwall '.args) echo substitute(url, '\n$', '', '') endfunction command! -nargs=? -range=% Dwall :call Dwall(<line1>, <line2>, <f-args>)
if exists('g:loaded_dwall') || &compatible finish endif let g:loaded_dwall=1 let s:dwall=expand(expand('<sfile>:p:h:h')).'/dwall' function! Dwall(line1, line2, ...) range let buffer=join(getline(a:line1, a:line2), '\n') let args=join(a:000, ' ') let url=system('echo '.shellescape(buffer).' | '.shellescape(s:dwall).' '.args) echo substitute(url, '\n$', '', '') endfunction command! -nargs=? -range=% Dwall :call Dwall(<line1>, <line2>, <f-args>)
Use script packaged with Vim plugin
Use script packaged with Vim plugin
VimL
unlicense
valeriangalliat/dwall
viml
## Code Before: if exists('g:loaded_dwall') || &compatible finish endif let g:loaded_dwall=1 function! Dwall(line1, line2, ...) range let buffer=join(getline(a:line1, a:line2), '\n') let args=join(a:000, ' ') let url=system('echo '.shellescape(buffer).' | dwall '.args) echo substitute(url, '\n$', '', '') endfunction command! -nargs=? -range=% Dwall :call Dwall(<line1>, <line2>, <f-args>) ## Instruction: Use script packaged with Vim plugin ## Code After: if exists('g:loaded_dwall') || &compatible finish endif let g:loaded_dwall=1 let s:dwall=expand(expand('<sfile>:p:h:h')).'/dwall' function! Dwall(line1, line2, ...) range let buffer=join(getline(a:line1, a:line2), '\n') let args=join(a:000, ' ') let url=system('echo '.shellescape(buffer).' | '.shellescape(s:dwall).' '.args) echo substitute(url, '\n$', '', '') endfunction command! -nargs=? -range=% Dwall :call Dwall(<line1>, <line2>, <f-args>)
8a40d0df910cf9e17db99155ba148c69737809dc
ConnorBrozic-CymonScriptA2P2.py
ConnorBrozic-CymonScriptA2P2.py
import time from cymon import Cymon #Personal Key Removed. Replace 'xxx' with your own key. api = Cymon('xxx') #Parsing Text file retrieved from: #http://stackoverflow.com/questions/6277107/parsing-text-file-in-python #Open malware domain file. f = open('text.txt','r') #Open output file to write to cymondata = open('cymondata.txt','w') while True: try: #Read the next domain in file. text = f.readline() print(text) #Lookup the domain through Cymon and print results back to output file. cymondata.write(repr(api.domain_lookup(text))) cymondata.write("\n") cymondata.write("\n") #If 404 error encountered, skip domain and move to the next one. except Exception: pass time.sleep(1) #Once finished, close the connection. cymondata.close()
import time from cymon import Cymon #Personal Key Removed. Replace 'xxx' with your own key. api = Cymon('xxx') #Parsing Text file retrieved from: #http://stackoverflow.com/questions/6277107/parsing-text-file-in-python #Open malware domain file. f = open('TestedMalwareDomains.txt','r') #Open output file to write to cymondata = open('cymondata.txt','w') while True: try: #Read the next domain in file. text = f.readline() print(text) #Lookup the domain through Cymon and print results back to output file. cymondata.write(repr(api.domain_lookup(text))) cymondata.write("\n") cymondata.write("\n") #If 404 error encountered, skip domain and move to the next one. except Exception: pass time.sleep(1) #Once finished, close the connection. cymondata.close()
Update to Script, Fixed malware domain file name
Update to Script, Fixed malware domain file name Fixed malware domains file name to accurately represent the file opened. (Better than text.txt)
Python
mit
ConnorBrozic/SRT411-Assignment2
python
## Code Before: import time from cymon import Cymon #Personal Key Removed. Replace 'xxx' with your own key. api = Cymon('xxx') #Parsing Text file retrieved from: #http://stackoverflow.com/questions/6277107/parsing-text-file-in-python #Open malware domain file. f = open('text.txt','r') #Open output file to write to cymondata = open('cymondata.txt','w') while True: try: #Read the next domain in file. text = f.readline() print(text) #Lookup the domain through Cymon and print results back to output file. cymondata.write(repr(api.domain_lookup(text))) cymondata.write("\n") cymondata.write("\n") #If 404 error encountered, skip domain and move to the next one. except Exception: pass time.sleep(1) #Once finished, close the connection. cymondata.close() ## Instruction: Update to Script, Fixed malware domain file name Fixed malware domains file name to accurately represent the file opened. (Better than text.txt) ## Code After: import time from cymon import Cymon #Personal Key Removed. Replace 'xxx' with your own key. api = Cymon('xxx') #Parsing Text file retrieved from: #http://stackoverflow.com/questions/6277107/parsing-text-file-in-python #Open malware domain file. f = open('TestedMalwareDomains.txt','r') #Open output file to write to cymondata = open('cymondata.txt','w') while True: try: #Read the next domain in file. text = f.readline() print(text) #Lookup the domain through Cymon and print results back to output file. cymondata.write(repr(api.domain_lookup(text))) cymondata.write("\n") cymondata.write("\n") #If 404 error encountered, skip domain and move to the next one. except Exception: pass time.sleep(1) #Once finished, close the connection. cymondata.close()
b93d8a7a7394b406260d2e20810e3e42852d5a14
src/requirements-selenium.txt
src/requirements-selenium.txt
pytest-cache==1.0 pytest-flask==0.10.0 pytest-html==1.7 pytest-pep8==1.0.6 pytest-selenium==1.3.1 pytest-variables==1.2 pytest-xdist==1.13.1 pytest==2.8.2 requests==2.8.1 selenium==2.53.6 sniffer==0.3.5 timeout-decorator==0.3.2 pytest-timeout==1.0.0 pytest-pycharm==0.3.0 pytest-rerunfailures==2.0.0 pytest-cov==2.2.1 pytest-capturelog==0.7 pytest-xvfb==0.2.0 pytest-repeat==0.2
pytest-base-url==1.3.0 pytest-cache==1.0 pytest-flask==0.10.0 pytest-html==1.14.1 pytest-pep8==1.0.6 pytest-selenium==1.9.1 pytest-variables==1.5.1 pytest-xdist==1.15.0 pytest==3.0.6 requests==2.8.1 selenium==3.3.0 sniffer==0.3.5 timeout-decorator==0.3.3 pytest-timeout==1.2.0 pytest-pycharm==0.4.0 pytest-rerunfailures==2.1.0 pytest-cov==2.4.0 pytest-capturelog==0.7 pytest-xvfb==1.0.0 pytest-repeat==0.4.1
Update requirements file for selenium container
Update requirements file for selenium container
Text
apache-2.0
AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core,plamut/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core,plamut/ggrc-core
text
## Code Before: pytest-cache==1.0 pytest-flask==0.10.0 pytest-html==1.7 pytest-pep8==1.0.6 pytest-selenium==1.3.1 pytest-variables==1.2 pytest-xdist==1.13.1 pytest==2.8.2 requests==2.8.1 selenium==2.53.6 sniffer==0.3.5 timeout-decorator==0.3.2 pytest-timeout==1.0.0 pytest-pycharm==0.3.0 pytest-rerunfailures==2.0.0 pytest-cov==2.2.1 pytest-capturelog==0.7 pytest-xvfb==0.2.0 pytest-repeat==0.2 ## Instruction: Update requirements file for selenium container ## Code After: pytest-base-url==1.3.0 pytest-cache==1.0 pytest-flask==0.10.0 pytest-html==1.14.1 pytest-pep8==1.0.6 pytest-selenium==1.9.1 pytest-variables==1.5.1 pytest-xdist==1.15.0 pytest==3.0.6 requests==2.8.1 selenium==3.3.0 sniffer==0.3.5 timeout-decorator==0.3.3 pytest-timeout==1.2.0 pytest-pycharm==0.4.0 pytest-rerunfailures==2.1.0 pytest-cov==2.4.0 pytest-capturelog==0.7 pytest-xvfb==1.0.0 pytest-repeat==0.4.1
0265f1bf709cd80c91a38879a262e98d39ccf56b
app/overrides/spree/layouts/admin/gift_cards_tab.html.erb.deface
app/overrides/spree/layouts/admin/gift_cards_tab.html.erb.deface
<!-- insert_bottom "[data-hook='admin_tabs'], #main-sidebar" --> <% if can? :admin, Spree::GiftCard %> <ul class="nav nav-sidebar"> <%= tab Spree.t(:gift_cards), icon: 'credit-card', url: spree.admin_gift_cards_path %> </ul> <% end %>
<!-- insert_bottom "[data-hook='admin_tabs'], #main-sidebar" original "fe59e93696d1ff1c3d24664cdf404c4189f80a22" --> <% if can? :admin, Spree::GiftCard %> <ul class="nav nav-sidebar"> <%= tab Spree.t(:gift_cards), icon: 'credit-card', url: spree.admin_gift_cards_path %> </ul> <% end %>
Add 'original' to defaced view to remove warning
Add 'original' to defaced view to remove warning
unknown
bsd-3-clause
mr-ado/spree_gift_card,mr-ado/spree_gift_card,mr-ado/spree_gift_card
unknown
## Code Before: <!-- insert_bottom "[data-hook='admin_tabs'], #main-sidebar" --> <% if can? :admin, Spree::GiftCard %> <ul class="nav nav-sidebar"> <%= tab Spree.t(:gift_cards), icon: 'credit-card', url: spree.admin_gift_cards_path %> </ul> <% end %> ## Instruction: Add 'original' to defaced view to remove warning ## Code After: <!-- insert_bottom "[data-hook='admin_tabs'], #main-sidebar" original "fe59e93696d1ff1c3d24664cdf404c4189f80a22" --> <% if can? :admin, Spree::GiftCard %> <ul class="nav nav-sidebar"> <%= tab Spree.t(:gift_cards), icon: 'credit-card', url: spree.admin_gift_cards_path %> </ul> <% end %>
9996f5bd1da5f370e20b5e744f2f6528ef3f887a
python/README.md
python/README.md
Note that this is still under active development and the API might change until the official release. ## Getting Started In order to build Tink from source you can either use Bazel or build a Python package using pip. ### Build with Bazel `bash bazel build "..."` ### Build with pip from source A setup script is provided which allows to install Tink as a Python package `bash pip3 install .` Note that this still requires Bazel to compile the binding to C++ and the [protobuf compiler](https://github.com/protocolbuffers/protobuf). ### Running tests You can run all tests with Bazel using `bash bazel test "..."` ## Examples As a starting point, it is best to look at the examples provided in [../examples/python/](https://github.com/google/tink/examples/python/).
Note that this is still under active development and the API might change until the official release. ## Getting Started In order to build Tink from source you can either use Bazel or build a Python package using pip. ### Build with Bazel ```shell bazel build "..." ``` ### Build with pip from source A setup script is provided which allows to install Tink as a Python package ```shell pip3 install . ``` Note that this still requires Bazel to compile the binding to C++ and the [protobuf compiler](https://github.com/protocolbuffers/protobuf). ### Running tests You can run all tests with Bazel using ```shell bazel test "..." ``` ## Examples As a starting point, it is best to look at the examples provided in [../examples/python/](https://github.com/google/tink/examples/python/).
Fix formatting in Python Readme.
Fix formatting in Python Readme. PiperOrigin-RevId: 307773077
Markdown
apache-2.0
google/tink,google/tink,google/tink,google/tink,google/tink,google/tink,google/tink,google/tink
markdown
## Code Before: Note that this is still under active development and the API might change until the official release. ## Getting Started In order to build Tink from source you can either use Bazel or build a Python package using pip. ### Build with Bazel `bash bazel build "..."` ### Build with pip from source A setup script is provided which allows to install Tink as a Python package `bash pip3 install .` Note that this still requires Bazel to compile the binding to C++ and the [protobuf compiler](https://github.com/protocolbuffers/protobuf). ### Running tests You can run all tests with Bazel using `bash bazel test "..."` ## Examples As a starting point, it is best to look at the examples provided in [../examples/python/](https://github.com/google/tink/examples/python/). ## Instruction: Fix formatting in Python Readme. PiperOrigin-RevId: 307773077 ## Code After: Note that this is still under active development and the API might change until the official release. ## Getting Started In order to build Tink from source you can either use Bazel or build a Python package using pip. ### Build with Bazel ```shell bazel build "..." ``` ### Build with pip from source A setup script is provided which allows to install Tink as a Python package ```shell pip3 install . ``` Note that this still requires Bazel to compile the binding to C++ and the [protobuf compiler](https://github.com/protocolbuffers/protobuf). ### Running tests You can run all tests with Bazel using ```shell bazel test "..." ``` ## Examples As a starting point, it is best to look at the examples provided in [../examples/python/](https://github.com/google/tink/examples/python/).
e4721c239f46a787a97dbe0a26081a85ed93719c
app/assets/stylesheets/partials/_mixins.scss
app/assets/stylesheets/partials/_mixins.scss
// Control the reading expreience @mixin well-read { font-family: $reading-stack; font-size: 20px; line-height: 1.7; font-weight: 300; border: none; color: $font-black; } // Border Radius with vendor prefixes for older browsers @mixin border-radius($radius) { border-radius: $radius; } // Box Shadow with vendor prefixes @mixin box-shadow { box-shadow: 0 1px 4px rgba(0,0,0, 0.03); }
// Control the reading expreience @mixin well-read { font-family: $reading-stack; font-size: 20px; line-height: 1.7; font-weight: 300; border: none; color: $font-black; } // Border Radius with vendor prefixes for older browsers @mixin border-radius($radius) { border-radius: $radius; } // Box Shadow @mixin box-shadow { box-shadow: 0 1px 4px rgba(0,0,0, 0.07); }
Change box-shadow property on feed-panel
Change box-shadow property on feed-panel
SCSS
mit
aamin005/Firdowsspace,dev-warner/Revinyl-Product,aamin005/Firdowsspace,dev-warner/Revinyl-Product,dev-warner/Revinyl-Product,kenny-hibino/stories,aamin005/Firdowsspace,kenny-hibino/stories,kenny-hibino/stories
scss
## Code Before: // Control the reading expreience @mixin well-read { font-family: $reading-stack; font-size: 20px; line-height: 1.7; font-weight: 300; border: none; color: $font-black; } // Border Radius with vendor prefixes for older browsers @mixin border-radius($radius) { border-radius: $radius; } // Box Shadow with vendor prefixes @mixin box-shadow { box-shadow: 0 1px 4px rgba(0,0,0, 0.03); } ## Instruction: Change box-shadow property on feed-panel ## Code After: // Control the reading expreience @mixin well-read { font-family: $reading-stack; font-size: 20px; line-height: 1.7; font-weight: 300; border: none; color: $font-black; } // Border Radius with vendor prefixes for older browsers @mixin border-radius($radius) { border-radius: $radius; } // Box Shadow @mixin box-shadow { box-shadow: 0 1px 4px rgba(0,0,0, 0.07); }
7499df4c4a13435290767f0667fedcf7a646ebc6
src/models/hole.php
src/models/hole.php
<?php return function(MongoDB $db) { $collection = $db->holes; $findOne = function($id) use($collection) { $hole = null; try { $hole = $collection->findOne(['_id' => new MongoID($id)]); } catch (Exception $e) { } if ($hole === null) { throw new Exception("Hole '{$id}' does not exist."); } return $hole; }; return [ 'find' => function(array $conditions = array()) use($collection) { return iterator_to_array($collection->find($conditions)); }, 'findOne' => $findOne, 'addSubmission' => function($id, $username, $submission) use($collection, $findOne) { $hole = $findOne($id); $result = \Codegolf\judge(\Codegolf\loadHole($hole['fileName']), \Codegolf\createImage('php-5.5', $submission)); $result['_id'] = new MongoID(); $result['username'] = $username; $collection->update(['_id' => new MongoID($id)], ['$push' => ['submissions' => $result]]); }, ]; };
<?php return function(MongoDB $db) { $collection = $db->holes; $findOne = function($id) use($collection) { $hole = null; try { $hole = $collection->findOne(['_id' => new MongoID($id)]); } catch (Exception $e) { } if ($hole === null) { throw new Exception("Hole '{$id}' does not exist."); } return $hole; }; return [ 'find' => function(array $conditions = array()) use($collection) { return iterator_to_array($collection->find($conditions)); }, 'findOne' => $findOne, 'addSubmission' => function($id, $username, $submission) use($collection, $findOne) { $hole = $findOne($id); $result = \Codegolf\judge(\Codegolf\loadHole($hole['fileName']), \Codegolf\createImage('php-5.5', $submission)); $result['_id'] = new MongoID(); $result['username'] = $username; $code = file_get_contents($submission); $result['code'] = utf8_encode($code); $result['length'] = strlen($code); $collection->update(['_id' => new MongoID($id)], ['$push' => ['submissions' => $result]]); }, ]; };
Add source code and length to submissions.
Add source code and length to submissions. Have to utf8_encode the source because it can be non-ascii.
PHP
mit
nubs/bizgolf-ui,nubs/bizgolf-ui,nubs/bizgolf-ui
php
## Code Before: <?php return function(MongoDB $db) { $collection = $db->holes; $findOne = function($id) use($collection) { $hole = null; try { $hole = $collection->findOne(['_id' => new MongoID($id)]); } catch (Exception $e) { } if ($hole === null) { throw new Exception("Hole '{$id}' does not exist."); } return $hole; }; return [ 'find' => function(array $conditions = array()) use($collection) { return iterator_to_array($collection->find($conditions)); }, 'findOne' => $findOne, 'addSubmission' => function($id, $username, $submission) use($collection, $findOne) { $hole = $findOne($id); $result = \Codegolf\judge(\Codegolf\loadHole($hole['fileName']), \Codegolf\createImage('php-5.5', $submission)); $result['_id'] = new MongoID(); $result['username'] = $username; $collection->update(['_id' => new MongoID($id)], ['$push' => ['submissions' => $result]]); }, ]; }; ## Instruction: Add source code and length to submissions. Have to utf8_encode the source because it can be non-ascii. ## Code After: <?php return function(MongoDB $db) { $collection = $db->holes; $findOne = function($id) use($collection) { $hole = null; try { $hole = $collection->findOne(['_id' => new MongoID($id)]); } catch (Exception $e) { } if ($hole === null) { throw new Exception("Hole '{$id}' does not exist."); } return $hole; }; return [ 'find' => function(array $conditions = array()) use($collection) { return iterator_to_array($collection->find($conditions)); }, 'findOne' => $findOne, 'addSubmission' => function($id, $username, $submission) use($collection, $findOne) { $hole = $findOne($id); $result = \Codegolf\judge(\Codegolf\loadHole($hole['fileName']), \Codegolf\createImage('php-5.5', $submission)); $result['_id'] = new MongoID(); $result['username'] = $username; $code = file_get_contents($submission); $result['code'] = utf8_encode($code); $result['length'] = strlen($code); $collection->update(['_id' => new MongoID($id)], ['$push' => ['submissions' => $result]]); }, ]; };
4d584f419e92b4ee688dca4c01b74cfc1217f828
setup.sh
setup.sh
git config --global color.ui true ln -sf ~/dotfiles/d.zshrc ~/.zshrc ln -sf ~/dotfiles/d.zshenv ~/.zshenv ln -sf ~/dotfiles/d.vimrc ~/.vimrc ln -sf ~/dotfiles/d.gemrc ~/.gemrc # *env case ${OSTYPE} in darwin*) # install homebrew # ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" brew update brew install rbenv ruby-build brew install pyenv brew install ndenv node-build ;; linux*) git clone https://github.com/sstephenson/rbenv.git ~/.rbenv git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build git clone https://github.com/yyuu/pyenv.git ~/.pyenv git clone https://github.com/riywo/ndenv ~/.ndenv git clone https://github.com/riywo/node-build.git ~/.ndenv/plugins/node-build ;; esac # neobundle # curl https://raw.githubusercontent.com/Shougo/neobundle.vim/master/bin/install.sh | sh mkdir -p ~/.vim/bundle git clone https://github.com/Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim
git config --global color.ui true ln -sf ~/dotfiles/d.zshrc ~/.zshrc ln -sf ~/dotfiles/d.zshenv ~/.zshenv ln -sf ~/dotfiles/d.vimrc ~/.vimrc ln -sf ~/dotfiles/d.gemrc ~/.gemrc # *env case ${OSTYPE} in darwin*) # install homebrew # ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" brew update brew install rbenv ruby-build brew install pyenv ;; linux*) git clone https://github.com/sstephenson/rbenv.git ~/.rbenv git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build git clone https://github.com/yyuu/pyenv.git ~/.pyenv ;; esac git clone https://github.com/riywo/ndenv ~/.ndenv git clone https://github.com/riywo/node-build.git ~/.ndenv/plugins/node-build # neobundle # curl https://raw.githubusercontent.com/Shougo/neobundle.vim/master/bin/install.sh | sh mkdir -p ~/.vim/bundle git clone https://github.com/Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim
Modify ndenv installation in mac
Modify ndenv installation in mac
Shell
mit
dceoy/dotfiles,dceoy/dotfiles,dceoy/fabkit,dceoy/fabkit,dceoy/fabkit
shell
## Code Before: git config --global color.ui true ln -sf ~/dotfiles/d.zshrc ~/.zshrc ln -sf ~/dotfiles/d.zshenv ~/.zshenv ln -sf ~/dotfiles/d.vimrc ~/.vimrc ln -sf ~/dotfiles/d.gemrc ~/.gemrc # *env case ${OSTYPE} in darwin*) # install homebrew # ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" brew update brew install rbenv ruby-build brew install pyenv brew install ndenv node-build ;; linux*) git clone https://github.com/sstephenson/rbenv.git ~/.rbenv git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build git clone https://github.com/yyuu/pyenv.git ~/.pyenv git clone https://github.com/riywo/ndenv ~/.ndenv git clone https://github.com/riywo/node-build.git ~/.ndenv/plugins/node-build ;; esac # neobundle # curl https://raw.githubusercontent.com/Shougo/neobundle.vim/master/bin/install.sh | sh mkdir -p ~/.vim/bundle git clone https://github.com/Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim ## Instruction: Modify ndenv installation in mac ## Code After: git config --global color.ui true ln -sf ~/dotfiles/d.zshrc ~/.zshrc ln -sf ~/dotfiles/d.zshenv ~/.zshenv ln -sf ~/dotfiles/d.vimrc ~/.vimrc ln -sf ~/dotfiles/d.gemrc ~/.gemrc # *env case ${OSTYPE} in darwin*) # install homebrew # ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" brew update brew install rbenv ruby-build brew install pyenv ;; linux*) git clone https://github.com/sstephenson/rbenv.git ~/.rbenv git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build git clone https://github.com/yyuu/pyenv.git ~/.pyenv ;; esac git clone https://github.com/riywo/ndenv ~/.ndenv git clone https://github.com/riywo/node-build.git ~/.ndenv/plugins/node-build # neobundle # curl https://raw.githubusercontent.com/Shougo/neobundle.vim/master/bin/install.sh | sh mkdir -p ~/.vim/bundle git clone https://github.com/Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim
e056dc3581785fe34123189cccd9901e1e9afe71
pylatex/__init__.py
pylatex/__init__.py
from .document import Document from .math import Math, VectorName, Matrix from .package import Package from .section import Section, Subsection, Subsubsection from .table import Table, MultiColumn, MultiRow, Tabular from .pgfplots import TikZ, Axis, Plot from .graphics import Figure, SubFigure, MatplotlibFigure from .lists import Enumerate, Itemize, Description from .quantities import Quantity from .base_classes import Command
from .document import Document from .math import Math, VectorName, Matrix from .package import Package from .section import Section, Subsection, Subsubsection from .table import Table, MultiColumn, MultiRow, Tabular, Tabu, LongTable, \ LongTabu from .pgfplots import TikZ, Axis, Plot from .graphics import Figure, SubFigure, MatplotlibFigure from .lists import Enumerate, Itemize, Description from .quantities import Quantity from .base_classes import Command
Add Tabu, LongTable and LongTabu global import
Add Tabu, LongTable and LongTabu global import
Python
mit
sebastianhaas/PyLaTeX,sebastianhaas/PyLaTeX,votti/PyLaTeX,ovaskevich/PyLaTeX,JelteF/PyLaTeX,bjodah/PyLaTeX,votti/PyLaTeX,jendas1/PyLaTeX,bjodah/PyLaTeX,jendas1/PyLaTeX,JelteF/PyLaTeX,ovaskevich/PyLaTeX
python
## Code Before: from .document import Document from .math import Math, VectorName, Matrix from .package import Package from .section import Section, Subsection, Subsubsection from .table import Table, MultiColumn, MultiRow, Tabular from .pgfplots import TikZ, Axis, Plot from .graphics import Figure, SubFigure, MatplotlibFigure from .lists import Enumerate, Itemize, Description from .quantities import Quantity from .base_classes import Command ## Instruction: Add Tabu, LongTable and LongTabu global import ## Code After: from .document import Document from .math import Math, VectorName, Matrix from .package import Package from .section import Section, Subsection, Subsubsection from .table import Table, MultiColumn, MultiRow, Tabular, Tabu, LongTable, \ LongTabu from .pgfplots import TikZ, Axis, Plot from .graphics import Figure, SubFigure, MatplotlibFigure from .lists import Enumerate, Itemize, Description from .quantities import Quantity from .base_classes import Command
25b767137800b7723804576a924e44cb8c096ff4
functions/_pure_prompt_host.fish
functions/_pure_prompt_host.fish
function _pure_prompt_host set --local hostname (hostname -s) # current host name set --local hostname_color "$pure_host_color" echo "$hostname_color$hostname" end
function _pure_prompt_host set -qg hostname or set --local hostname (hostname -s) # current host name set --local hostname_color "$pure_host_color" echo "$hostname_color$hostname" end
Change hostname variable name to avoid scope error
Change hostname variable name to avoid scope error Add check for existing fish `hostname` variable
fish
mit
rafaelrinaldi/pure
fish
## Code Before: function _pure_prompt_host set --local hostname (hostname -s) # current host name set --local hostname_color "$pure_host_color" echo "$hostname_color$hostname" end ## Instruction: Change hostname variable name to avoid scope error Add check for existing fish `hostname` variable ## Code After: function _pure_prompt_host set -qg hostname or set --local hostname (hostname -s) # current host name set --local hostname_color "$pure_host_color" echo "$hostname_color$hostname" end
6ebc59148b513f358a3b76c7364eb6cf6f97b0d5
setup.py
setup.py
from setuptools import setup setup(name='borg-summon', version='0.1', description='A wrapper for the backup program borg', url='http://github.com/grensjo/borg-summon', author='Anton Grensjö', author_email='[email protected]', license='MIT', packages=['borg_summon'], install_requires=[ 'toml', 'click', 'sh', ], entry_points={ 'console_scripts': ['borg-summon=borg_summon.command_line:main'] }, zip_safe=True)
from setuptools import setup setup(name='borg-summon', version='0.1', description='A work-in-progress wrapper for automating BorgBackup use', url='https://github.com/grensjo/borg-summon', author='Anton Grensjö', author_email='[email protected]', license='MIT', packages=['borg_summon'], install_requires=[ 'toml', 'click', 'sh', ], entry_points={ 'console_scripts': ['borg-summon=borg_summon.command_line:main'] }, zip_safe=True)
Update project description and GitHub URL
Update project description and GitHub URL
Python
mit
grensjo/borg-summon
python
## Code Before: from setuptools import setup setup(name='borg-summon', version='0.1', description='A wrapper for the backup program borg', url='http://github.com/grensjo/borg-summon', author='Anton Grensjö', author_email='[email protected]', license='MIT', packages=['borg_summon'], install_requires=[ 'toml', 'click', 'sh', ], entry_points={ 'console_scripts': ['borg-summon=borg_summon.command_line:main'] }, zip_safe=True) ## Instruction: Update project description and GitHub URL ## Code After: from setuptools import setup setup(name='borg-summon', version='0.1', description='A work-in-progress wrapper for automating BorgBackup use', url='https://github.com/grensjo/borg-summon', author='Anton Grensjö', author_email='[email protected]', license='MIT', packages=['borg_summon'], install_requires=[ 'toml', 'click', 'sh', ], entry_points={ 'console_scripts': ['borg-summon=borg_summon.command_line:main'] }, zip_safe=True)
0da59ee8c95f2d065b6f0b600f4d6cffd654437e
packages/ddp-client/common/getClientStreamClass.js
packages/ddp-client/common/getClientStreamClass.js
import { Meteor } from 'meteor/meteor'; // In the client and server entry points, we make sure the // bundler loads the correct thing. Here, we just need to // make sure that we require the right one. export default function getClientStreamClass() { // The static analyzer of the bundler specifically looks // for direct calls to 'require', so it won't treat the // below calls as a request to include that module. const notRequire = require; if (Meteor.isClient) { return notRequire('../client/stream_client_sockjs').default; } else { /* Meteor.isServer */ return notRequire('../server/stream_client_nodejs').default; } }
import { Meteor } from 'meteor/meteor'; // In the client and server entry points, we make sure the // bundler loads the correct thing. Here, we just need to // make sure that we require the right one. export default function getClientStreamClass() { // The static analyzer of the bundler specifically looks // for static calls to 'require', so it won't treat the // below calls as a request to include that module. // // That means stream_client_nodejs won't be included on // the client, as desired. const modulePath = Meteor.isClient ? '../client/stream_client_sockjs' : '../server/stream_client_nodejs'; return require(modulePath).default; }
Switch to more concise require as suggested by Ben
Switch to more concise require as suggested by Ben
JavaScript
mit
Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor
javascript
## Code Before: import { Meteor } from 'meteor/meteor'; // In the client and server entry points, we make sure the // bundler loads the correct thing. Here, we just need to // make sure that we require the right one. export default function getClientStreamClass() { // The static analyzer of the bundler specifically looks // for direct calls to 'require', so it won't treat the // below calls as a request to include that module. const notRequire = require; if (Meteor.isClient) { return notRequire('../client/stream_client_sockjs').default; } else { /* Meteor.isServer */ return notRequire('../server/stream_client_nodejs').default; } } ## Instruction: Switch to more concise require as suggested by Ben ## Code After: import { Meteor } from 'meteor/meteor'; // In the client and server entry points, we make sure the // bundler loads the correct thing. Here, we just need to // make sure that we require the right one. export default function getClientStreamClass() { // The static analyzer of the bundler specifically looks // for static calls to 'require', so it won't treat the // below calls as a request to include that module. // // That means stream_client_nodejs won't be included on // the client, as desired. const modulePath = Meteor.isClient ? '../client/stream_client_sockjs' : '../server/stream_client_nodejs'; return require(modulePath).default; }
9ffc363cc05504bd8051d0bd689ae97d939aab00
doc/spicy/index.rst
doc/spicy/index.rst
================================================== Spicy: A Parser Generator For Network Protocols ================================================== .. note:: As you work with Spicy, you'll see a different name pop up sometimes: *Spicy*, which is Spicy's early name from when the project started. We have since renamed the system, as it is not really related to the original Spicy system at all. However, as the renaming remains a work in progress, Spicy's tools and source code still use the old terminology for the most part. Table of Contents: .. toctree:: :maxdepth: 3 :numbered: intro reference/index bro/index c-api internals Index * :ref:`genindex` * :ref:`modindex` * :ref:`search`
================================================== Spicy: A Parser Generator For Network Protocols ================================================== Table of Contents: .. toctree:: :maxdepth: 3 :numbered: intro reference/index bro/index c-api internals Index * :ref:`genindex` * :ref:`modindex` * :ref:`search`
Remove note regarding BinPAC++ from Spicy doc
Remove note regarding BinPAC++ from Spicy doc Since Spicy version 0.5 all tools have been renamed and there is no reference to BinPAC++ in the code. So we can delete the note. A hint is still left on the HILTI home page.
reStructuredText
bsd-3-clause
rsmmr/hilti,rsmmr/hilti,rsmmr/hilti,rsmmr/hilti,rsmmr/hilti
restructuredtext
## Code Before: ================================================== Spicy: A Parser Generator For Network Protocols ================================================== .. note:: As you work with Spicy, you'll see a different name pop up sometimes: *Spicy*, which is Spicy's early name from when the project started. We have since renamed the system, as it is not really related to the original Spicy system at all. However, as the renaming remains a work in progress, Spicy's tools and source code still use the old terminology for the most part. Table of Contents: .. toctree:: :maxdepth: 3 :numbered: intro reference/index bro/index c-api internals Index * :ref:`genindex` * :ref:`modindex` * :ref:`search` ## Instruction: Remove note regarding BinPAC++ from Spicy doc Since Spicy version 0.5 all tools have been renamed and there is no reference to BinPAC++ in the code. So we can delete the note. A hint is still left on the HILTI home page. ## Code After: ================================================== Spicy: A Parser Generator For Network Protocols ================================================== Table of Contents: .. toctree:: :maxdepth: 3 :numbered: intro reference/index bro/index c-api internals Index * :ref:`genindex` * :ref:`modindex` * :ref:`search`
c05d87dc62fedc871e075e2052a9b5f85d06e2b7
rome.rb
rome.rb
class Rome < Formula desc "A shared cache tool for Carthage on S3" homepage "https://github.com/blender/Rome" url "https://github.com/blender/Rome/releases/download/v0.13.1.35/rome.zip" sha256 "56216f143e0cdea294319a09868cc4523d7407a1fee733132f12ee5e6299e393" bottle :unneeded def install bin.install "rome" end test do system "#{bin}/rome", "--version" end end
class Rome < Formula desc "A shared cache tool for Carthage on S3" homepage "https://github.com/blender/Rome" url "https://github.com/blender/Rome/releases/download/v0.14.0.38/rome.zip" sha256 "2ca7df9a9ffeed2967a5056d052c6d8ce9d7f956fc3646e9e6e72c5a9d9aee93" bottle :unneeded def install bin.install "rome" end test do system "#{bin}/rome", "--version" end end
Update Rome formula to 0.14.0.38
Update Rome formula to 0.14.0.38
Ruby
mit
blender/homebrew-tap
ruby
## Code Before: class Rome < Formula desc "A shared cache tool for Carthage on S3" homepage "https://github.com/blender/Rome" url "https://github.com/blender/Rome/releases/download/v0.13.1.35/rome.zip" sha256 "56216f143e0cdea294319a09868cc4523d7407a1fee733132f12ee5e6299e393" bottle :unneeded def install bin.install "rome" end test do system "#{bin}/rome", "--version" end end ## Instruction: Update Rome formula to 0.14.0.38 ## Code After: class Rome < Formula desc "A shared cache tool for Carthage on S3" homepage "https://github.com/blender/Rome" url "https://github.com/blender/Rome/releases/download/v0.14.0.38/rome.zip" sha256 "2ca7df9a9ffeed2967a5056d052c6d8ce9d7f956fc3646e9e6e72c5a9d9aee93" bottle :unneeded def install bin.install "rome" end test do system "#{bin}/rome", "--version" end end
e5974cdc5650bd01c813fddb6640f04e53e5d339
AudioKit/Common/Internals/Helpers/ExceptionCatcher.swift
AudioKit/Common/Internals/Helpers/ExceptionCatcher.swift
// // ExceptionCatcher.swift // AudioKit // // Created by Stéphane Peter, revision history on Github. // Copyright © 2018 AudioKit. All rights reserved. // import Foundation extension NSException: Error { public var domain: String { return "io.audiokit.SwiftExceptionCatcher" } public var code: Int { return 0 } } public func AKTry(_ operation: @escaping (() throws -> Void)) throws { var error: NSException? let theTry = { do { try operation() } catch let ex { error = ex as? NSException } } let theCatch: (NSException?) -> Void = { except in error = except } AKTryOperation(theTry, theCatch, finally) if let except = error { // Caught an exception throw except as Error } }
// // ExceptionCatcher.swift // AudioKit // // Created by Stéphane Peter, revision history on Github. // Copyright © 2018 AudioKit. All rights reserved. // import Foundation public func AKTry(_ operation: @escaping (() throws -> Void)) throws { var error: Error? let theTry = { do { try operation() } catch let ex { error = ex } } let theCatch: (NSException) -> Void = { except in error = NSError(domain: "io.audiokit.AudioKit", code: 0, userInfo: ["Exception" : except.userInfo ?? except.name]) } AKTryOperation(theTry, theCatch) if let error = error { // Caught an exception throw error } }
Throw NSException inside of NSError
Throw NSException inside of NSError
Swift
mit
audiokit/AudioKit,adamnemecek/AudioKit,audiokit/AudioKit,eljeff/AudioKit,audiokit/AudioKit,eljeff/AudioKit,adamnemecek/AudioKit,adamnemecek/AudioKit,adamnemecek/AudioKit,eljeff/AudioKit,audiokit/AudioKit,eljeff/AudioKit
swift
## Code Before: // // ExceptionCatcher.swift // AudioKit // // Created by Stéphane Peter, revision history on Github. // Copyright © 2018 AudioKit. All rights reserved. // import Foundation extension NSException: Error { public var domain: String { return "io.audiokit.SwiftExceptionCatcher" } public var code: Int { return 0 } } public func AKTry(_ operation: @escaping (() throws -> Void)) throws { var error: NSException? let theTry = { do { try operation() } catch let ex { error = ex as? NSException } } let theCatch: (NSException?) -> Void = { except in error = except } AKTryOperation(theTry, theCatch, finally) if let except = error { // Caught an exception throw except as Error } } ## Instruction: Throw NSException inside of NSError ## Code After: // // ExceptionCatcher.swift // AudioKit // // Created by Stéphane Peter, revision history on Github. // Copyright © 2018 AudioKit. All rights reserved. // import Foundation public func AKTry(_ operation: @escaping (() throws -> Void)) throws { var error: Error? let theTry = { do { try operation() } catch let ex { error = ex } } let theCatch: (NSException) -> Void = { except in error = NSError(domain: "io.audiokit.AudioKit", code: 0, userInfo: ["Exception" : except.userInfo ?? except.name]) } AKTryOperation(theTry, theCatch) if let error = error { // Caught an exception throw error } }
4709f623b41dffe1ad227908e3f92782987bbfa9
server/models/card/card.js
server/models/card/card.js
'use strict'; var mongoose = require('mongoose'); const WAITING_FOR_PRINT = 'WAITING_FOR_PRINT'; const PRINTED_WAITING_FOR_SEND = 'PRINTED_WAITING_FOR_SEND'; const SENT = 'SENT'; var statusKeys = [ WAITING_FOR_PRINT, PRINTED_WAITING_FOR_SEND, SENT ]; var cardSchema = mongoose.Schema({ message: String, senderAddress: { type:String, required: true }, receiverAddress: { type:String, required: true }, createdOn: { type: Date, default: Date.now }, statusKey: { type: String, enum: statusKeys, default: WAITING_FOR_PRINT, required: true } }); var Card = mongoose.model('Card', cardSchema); module.exports = Card;
'use strict'; var mongoose = require('mongoose'); const WAITING_FOR_PRINT = 'WAITING_FOR_PRINT'; const PRINTED_WAITING_FOR_SEND = 'PRINTED_WAITING_FOR_SEND'; const SENT = 'SENT'; var statusKeys = [ WAITING_FOR_PRINT, PRINTED_WAITING_FOR_SEND, SENT ]; var cardSchema = mongoose.Schema({ message: { type: String, required: true }, senderAddress: { type: String, required: true }, receiverAddress: { type: String, required: true }, createdOn: { type: Date, default: Date.now }, statusKey: { type: String, enum: statusKeys, default: WAITING_FOR_PRINT, required: true } }); var Card = mongoose.model('Card', cardSchema); module.exports = Card;
Make message field as required
Make message field as required
JavaScript
mit
denisnarush/postcard,denisnarush/postcard
javascript
## Code Before: 'use strict'; var mongoose = require('mongoose'); const WAITING_FOR_PRINT = 'WAITING_FOR_PRINT'; const PRINTED_WAITING_FOR_SEND = 'PRINTED_WAITING_FOR_SEND'; const SENT = 'SENT'; var statusKeys = [ WAITING_FOR_PRINT, PRINTED_WAITING_FOR_SEND, SENT ]; var cardSchema = mongoose.Schema({ message: String, senderAddress: { type:String, required: true }, receiverAddress: { type:String, required: true }, createdOn: { type: Date, default: Date.now }, statusKey: { type: String, enum: statusKeys, default: WAITING_FOR_PRINT, required: true } }); var Card = mongoose.model('Card', cardSchema); module.exports = Card; ## Instruction: Make message field as required ## Code After: 'use strict'; var mongoose = require('mongoose'); const WAITING_FOR_PRINT = 'WAITING_FOR_PRINT'; const PRINTED_WAITING_FOR_SEND = 'PRINTED_WAITING_FOR_SEND'; const SENT = 'SENT'; var statusKeys = [ WAITING_FOR_PRINT, PRINTED_WAITING_FOR_SEND, SENT ]; var cardSchema = mongoose.Schema({ message: { type: String, required: true }, senderAddress: { type: String, required: true }, receiverAddress: { type: String, required: true }, createdOn: { type: Date, default: Date.now }, statusKey: { type: String, enum: statusKeys, default: WAITING_FOR_PRINT, required: true } }); var Card = mongoose.model('Card', cardSchema); module.exports = Card;
bf9ce5a438d1cf4bb9a54f067dc3e9900cf9a532
app/overview/overview-home.component.ts
app/overview/overview-home.component.ts
import {Component, OnInit, Inject, ViewChild, TemplateRef} from '@angular/core'; import {Router} from '@angular/router'; import {IdaiFieldDocument} from '../model/idai-field-document'; import {ObjectList} from "./object-list"; import {Messages} from "idai-components-2/idai-components-2"; import {M} from "../m"; import {DocumentEditChangeMonitor} from "idai-components-2/idai-components-2"; import {Validator} from "../model/validator"; import {NgbModal, NgbModalRef} from '@ng-bootstrap/ng-bootstrap'; import {PersistenceService} from "./persistence-service"; @Component({ moduleId: module.id, template: `<h1>Overview home</h1>` }) /** */ export class OverviewHomeComponent implements OnInit {}
import {Component} from "@angular/core"; @Component({ moduleId: module.id, template: `` }) /** */ export class OverviewHomeComponent {}
Make overview home showing just blank space.
Make overview home showing just blank space.
TypeScript
apache-2.0
codarchlab/idai-field-client,codarchlab/idai-field-client,codarchlab/idai-field-client,codarchlab/idai-field-client
typescript
## Code Before: import {Component, OnInit, Inject, ViewChild, TemplateRef} from '@angular/core'; import {Router} from '@angular/router'; import {IdaiFieldDocument} from '../model/idai-field-document'; import {ObjectList} from "./object-list"; import {Messages} from "idai-components-2/idai-components-2"; import {M} from "../m"; import {DocumentEditChangeMonitor} from "idai-components-2/idai-components-2"; import {Validator} from "../model/validator"; import {NgbModal, NgbModalRef} from '@ng-bootstrap/ng-bootstrap'; import {PersistenceService} from "./persistence-service"; @Component({ moduleId: module.id, template: `<h1>Overview home</h1>` }) /** */ export class OverviewHomeComponent implements OnInit {} ## Instruction: Make overview home showing just blank space. ## Code After: import {Component} from "@angular/core"; @Component({ moduleId: module.id, template: `` }) /** */ export class OverviewHomeComponent {}
c613b59861d24a7627844114933c318423d18866
alpha_helix_generator/geometry.py
alpha_helix_generator/geometry.py
import numpy as np
import numpy as np def normalize(v): '''Normalize a vector based on its 2 norm.''' if 0 == np.linalg.norm(v): return v return v / np.linalg.norm(v) def create_frame_from_three_points(p1, p2, p3): '''Create a left-handed coordinate frame from 3 points. The p2 is the origin; the y-axis is the vector from p2 to p3; the z-axis is the cross product of the vector from p2 to p1 and the y-axis. Return a matrix where the axis vectors are the rows. ''' y = normalize(p3 - p2) z = normalize(np.cross(p1 - p2, y)) x = np.cross(y, z) return np.array([x, y, z]) def rotation_matrix_to_axis_and_angle(M): '''Calculate the axis and angle of a rotation matrix.''' u = np.array([M[2][1] - M[1][2], M[0][2] - M[2][0], M[1][0] - M[0][1]]) sin_theta = np.linalg.norm(u) / 2 cos_theta = (np.trace(M) - 1) / 2 return normalize(u), np.arctan2(sin_theta, cos_theta) def rotation_matrix_from_axis_and_angle(u, theta): '''Calculate a rotation matrix from an axis and an angle.''' u = normalize(u) x = u[0] y = u[1] z = u[2] s = np.sin(theta) c = np.cos(theta) return np.array([[c + x**2 * (1 - c), x * y * (1 - c) - z * s, x * z * (1 - c) + y * s], [y * x * (1 - c) + z * s, c + y**2 * (1 - c), y * z * (1 - c) - x * s ], [z * x * (1 - c) + y * s, z * y * (1 - c) + x * s, c + z**2 * (1 - c) ]])
Add some basic geometric functions.
Add some basic geometric functions.
Python
bsd-3-clause
xingjiepan/ss_generator
python
## Code Before: import numpy as np ## Instruction: Add some basic geometric functions. ## Code After: import numpy as np def normalize(v): '''Normalize a vector based on its 2 norm.''' if 0 == np.linalg.norm(v): return v return v / np.linalg.norm(v) def create_frame_from_three_points(p1, p2, p3): '''Create a left-handed coordinate frame from 3 points. The p2 is the origin; the y-axis is the vector from p2 to p3; the z-axis is the cross product of the vector from p2 to p1 and the y-axis. Return a matrix where the axis vectors are the rows. ''' y = normalize(p3 - p2) z = normalize(np.cross(p1 - p2, y)) x = np.cross(y, z) return np.array([x, y, z]) def rotation_matrix_to_axis_and_angle(M): '''Calculate the axis and angle of a rotation matrix.''' u = np.array([M[2][1] - M[1][2], M[0][2] - M[2][0], M[1][0] - M[0][1]]) sin_theta = np.linalg.norm(u) / 2 cos_theta = (np.trace(M) - 1) / 2 return normalize(u), np.arctan2(sin_theta, cos_theta) def rotation_matrix_from_axis_and_angle(u, theta): '''Calculate a rotation matrix from an axis and an angle.''' u = normalize(u) x = u[0] y = u[1] z = u[2] s = np.sin(theta) c = np.cos(theta) return np.array([[c + x**2 * (1 - c), x * y * (1 - c) - z * s, x * z * (1 - c) + y * s], [y * x * (1 - c) + z * s, c + y**2 * (1 - c), y * z * (1 - c) - x * s ], [z * x * (1 - c) + y * s, z * y * (1 - c) + x * s, c + z**2 * (1 - c) ]])
8cac0c660eee774c32b87d2511e4d2eeddf0ffe8
scripts/slave/chromium/dart_buildbot_run.py
scripts/slave/chromium/dart_buildbot_run.py
import sys from common import chromium_utils def main(): return chromium_utils.RunCommand( [sys.executable, 'src/build/buildbot_annotated_steps.py', ]) if __name__ == '__main__': sys.exit(main())
import os import sys from common import chromium_utils def main(): builder_name = os.getenv('BUILDBOT_BUILDERNAME', default='') is_release_bot = builder_name.startswith('release') script = '' if is_release_bot: script = 'src/dartium_tools/buildbot_release_annotated_steps.py' else: script = 'src/dartium_tools/buildbot_annotated_steps.py' return chromium_utils.RunCommand([sys.executable, script]) if __name__ == '__main__': sys.exit(main())
Call dartium_tools/buildbot_annotated_steps.py directly, there is no need for moving this as part of the dartium patching process.
Call dartium_tools/buildbot_annotated_steps.py directly, there is no need for moving this as part of the dartium patching process. Additionally, start calling a new script for release builds (there are none yet, but this is what will be used to build the sdk and editor) TBR=foo Review URL: https://chromiumcodereview.appspot.com/11466003 git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@171512 0039d316-1c4b-4281-b951-d872f2087c98
Python
bsd-3-clause
eunchong/build,eunchong/build,eunchong/build,eunchong/build
python
## Code Before: import sys from common import chromium_utils def main(): return chromium_utils.RunCommand( [sys.executable, 'src/build/buildbot_annotated_steps.py', ]) if __name__ == '__main__': sys.exit(main()) ## Instruction: Call dartium_tools/buildbot_annotated_steps.py directly, there is no need for moving this as part of the dartium patching process. Additionally, start calling a new script for release builds (there are none yet, but this is what will be used to build the sdk and editor) TBR=foo Review URL: https://chromiumcodereview.appspot.com/11466003 git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@171512 0039d316-1c4b-4281-b951-d872f2087c98 ## Code After: import os import sys from common import chromium_utils def main(): builder_name = os.getenv('BUILDBOT_BUILDERNAME', default='') is_release_bot = builder_name.startswith('release') script = '' if is_release_bot: script = 'src/dartium_tools/buildbot_release_annotated_steps.py' else: script = 'src/dartium_tools/buildbot_annotated_steps.py' return chromium_utils.RunCommand([sys.executable, script]) if __name__ == '__main__': sys.exit(main())
7267bdd56fa8e5c446286eafb08fd85b26152297
.travis.yml
.travis.yml
language: python python: - 2.7 install: sudo setup_panda.sh script: python manage.py test panda
language: python python: - 2.7 before_script: sudo setup_panda.sh script: python manage.py test panda
Use before_script isntead of install.
Use before_script isntead of install.
YAML
mit
newsapps/panda,datadesk/panda,datadesk/panda,NUKnightLab/panda,NUKnightLab/panda,datadesk/panda,PalmBeachPost/panda,pandaproject/panda,ibrahimcesar/panda,NUKnightLab/panda,NUKnightLab/panda,PalmBeachPost/panda,newsapps/panda,datadesk/panda,PalmBeachPost/panda,PalmBeachPost/panda,ibrahimcesar/panda,newsapps/panda,pandaproject/panda,pandaproject/panda,pandaproject/panda,pandaproject/panda,newsapps/panda,PalmBeachPost/panda,datadesk/panda,ibrahimcesar/panda,ibrahimcesar/panda,ibrahimcesar/panda
yaml
## Code Before: language: python python: - 2.7 install: sudo setup_panda.sh script: python manage.py test panda ## Instruction: Use before_script isntead of install. ## Code After: language: python python: - 2.7 before_script: sudo setup_panda.sh script: python manage.py test panda
47bff0013cb7700bce366cea36319acfc9999cf1
CHANGES.txt
CHANGES.txt
NEXT RELEASE - New primitive and object types for boolean, string, and number. - Remove the option definition property. - Rename o.extend to o.augment. - Rename the default definition property to devoid. - Rename the extends writer property to augments. 0.0.3 : 2013-03-24 - New types extension (o-types.js). 0.0.2 : 2013-03-18 - Added o.construct. - o.extend now accepts a third argument to specify properties for the prototype. - Full test coverage of the Core API. - Fixed around to handle return values. - Fixed o.extend to properly inherit the parent's prototype instead of merging it with the child's. - Default isa to "object" if extends is set. 0.0.1 : 2013-03-10 - First release!
NEXT RELEASE - New primitive and object types for boolean, string, and number. - Remove the option definition property. - Rename o.extend to o.augment. - Rename the default definition property to devoid. - Rename the extends writer property to augments. - Rename the isa writer property to type. 0.0.3 : 2013-03-24 - New types extension (o-types.js). 0.0.2 : 2013-03-18 - Added o.construct. - o.extend now accepts a third argument to specify properties for the prototype. - Full test coverage of the Core API. - Fixed around to handle return values. - Fixed o.extend to properly inherit the parent's prototype instead of merging it with the child's. - Default isa to "object" if extends is set. 0.0.1 : 2013-03-10 - First release!
Document isa to type rename in the change log.
Document isa to type rename in the change log.
Text
mit
bluefeet/o-js,bluefeet/o-js
text
## Code Before: NEXT RELEASE - New primitive and object types for boolean, string, and number. - Remove the option definition property. - Rename o.extend to o.augment. - Rename the default definition property to devoid. - Rename the extends writer property to augments. 0.0.3 : 2013-03-24 - New types extension (o-types.js). 0.0.2 : 2013-03-18 - Added o.construct. - o.extend now accepts a third argument to specify properties for the prototype. - Full test coverage of the Core API. - Fixed around to handle return values. - Fixed o.extend to properly inherit the parent's prototype instead of merging it with the child's. - Default isa to "object" if extends is set. 0.0.1 : 2013-03-10 - First release! ## Instruction: Document isa to type rename in the change log. ## Code After: NEXT RELEASE - New primitive and object types for boolean, string, and number. - Remove the option definition property. - Rename o.extend to o.augment. - Rename the default definition property to devoid. - Rename the extends writer property to augments. - Rename the isa writer property to type. 0.0.3 : 2013-03-24 - New types extension (o-types.js). 0.0.2 : 2013-03-18 - Added o.construct. - o.extend now accepts a third argument to specify properties for the prototype. - Full test coverage of the Core API. - Fixed around to handle return values. - Fixed o.extend to properly inherit the parent's prototype instead of merging it with the child's. - Default isa to "object" if extends is set. 0.0.1 : 2013-03-10 - First release!
e87fdb0ecfb49bb458e14f734cc6155da91ee443
README.md
README.md
[![Build status](https://img.shields.io/appveyor/ci/mrahhal/mr-aspnet-identity-entityframework6/master.svg)](https://ci.appveyor.com/project/mrahhal/mr-aspnet-identity-entityframework6) [![Nuget version](https://img.shields.io/nuget/v/MR.AspNet.Identity.EntityFramework6.svg)](https://www.nuget.org/packages/MR.AspNet.Identity.EntityFramework6) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT) EntityFramework 6 provider for Identity 3.0 RC1. ## What is this This is basically a copy-paste from the EF7 Identity 3.0 RC1 provider but edited to work with EF6. All you have to do in your app: - Remove everything EF7 related, this means: `EntityFramework.Commands`, `EntityFramework.MicrosoftSqlServer`, `EntityFramework.InMemory` and `Microsoft.AspNet.Identity.EntityFramework`. And instead add the following: `EntityFramework` and `MR.AspNet.Identity.EntityFramework6`. - Replace all EF7 namespaces with their EF6 counterparts. ## Do you need ef6 migrations enabled for your Asp.Net Core app? Check out [Migrator.EF6](https://github.com/mrahhal/Migrator.EF6).
[![Build status](https://img.shields.io/appveyor/ci/mrahhal/mr-aspnet-identity-entityframework6/master.svg)](https://ci.appveyor.com/project/mrahhal/mr-aspnet-identity-entityframework6) [![NuGet version](https://badge.fury.io/nu/MR.AspNet.Identity.EntityFramework6.svg)](https://www.nuget.org/packages/MR.AspNet.Identity.EntityFramework6) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT) EntityFramework 6 provider for Identity 3.0 RC1. ## What is this This is basically a copy-paste from the EF7 Identity 3.0 RC1 provider but edited to work with EF6. All you have to do in your app: - Remove everything EF7 related, this means: `EntityFramework.Commands`, `EntityFramework.MicrosoftSqlServer`, `EntityFramework.InMemory` and `Microsoft.AspNet.Identity.EntityFramework`. And instead add the following: `EntityFramework` and `MR.AspNet.Identity.EntityFramework6`. - Replace all EF7 namespaces with their EF6 counterparts. ## Do you need ef6 migrations enabled for your Asp.Net Core app? Check out [Migrator.EF6](https://github.com/mrahhal/Migrator.EF6).
Use Version Badge for nuget badges
Use Version Badge for nuget badges
Markdown
mit
mrahhal/MR.AspNet.Identity.EntityFramework6
markdown
## Code Before: [![Build status](https://img.shields.io/appveyor/ci/mrahhal/mr-aspnet-identity-entityframework6/master.svg)](https://ci.appveyor.com/project/mrahhal/mr-aspnet-identity-entityframework6) [![Nuget version](https://img.shields.io/nuget/v/MR.AspNet.Identity.EntityFramework6.svg)](https://www.nuget.org/packages/MR.AspNet.Identity.EntityFramework6) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT) EntityFramework 6 provider for Identity 3.0 RC1. ## What is this This is basically a copy-paste from the EF7 Identity 3.0 RC1 provider but edited to work with EF6. All you have to do in your app: - Remove everything EF7 related, this means: `EntityFramework.Commands`, `EntityFramework.MicrosoftSqlServer`, `EntityFramework.InMemory` and `Microsoft.AspNet.Identity.EntityFramework`. And instead add the following: `EntityFramework` and `MR.AspNet.Identity.EntityFramework6`. - Replace all EF7 namespaces with their EF6 counterparts. ## Do you need ef6 migrations enabled for your Asp.Net Core app? Check out [Migrator.EF6](https://github.com/mrahhal/Migrator.EF6). ## Instruction: Use Version Badge for nuget badges ## Code After: [![Build status](https://img.shields.io/appveyor/ci/mrahhal/mr-aspnet-identity-entityframework6/master.svg)](https://ci.appveyor.com/project/mrahhal/mr-aspnet-identity-entityframework6) [![NuGet version](https://badge.fury.io/nu/MR.AspNet.Identity.EntityFramework6.svg)](https://www.nuget.org/packages/MR.AspNet.Identity.EntityFramework6) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT) EntityFramework 6 provider for Identity 3.0 RC1. ## What is this This is basically a copy-paste from the EF7 Identity 3.0 RC1 provider but edited to work with EF6. All you have to do in your app: - Remove everything EF7 related, this means: `EntityFramework.Commands`, `EntityFramework.MicrosoftSqlServer`, `EntityFramework.InMemory` and `Microsoft.AspNet.Identity.EntityFramework`. And instead add the following: `EntityFramework` and `MR.AspNet.Identity.EntityFramework6`. - Replace all EF7 namespaces with their EF6 counterparts. ## Do you need ef6 migrations enabled for your Asp.Net Core app? Check out [Migrator.EF6](https://github.com/mrahhal/Migrator.EF6).
3fb475ad2bae86a0632d8f6ac0561857c3a9f2e1
.travis.yml
.travis.yml
language: android android: components: # The BuildTools version - build-tools-21.0.1 # The SDK version - android-21 # Env matrix env: matrix: - ANDROID_SDKS=android-10 ANDROID_TARGET=android-10 ANDROID_ABI=armeabi - ANDROID_SDKS=android-19,sysimg-19 ANDROID_TARGET=android-19 ANDROID_ABI=armeabi-v7a # Emulator Management: Create, Start and Wait before_install: - echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI - emulator -avd test -no-skin -no-audio -no-window & before_script: - android-wait-for-emulator - adb shell input keyevent 82 &
language: android android: components: # The BuildTools version - build-tools-21.0.1 # The SDK version - android-21 jdk: - openjdk5 - openjdk7 # Env matrix env: matrix: - ANDROID_SDKS=android-10 ANDROID_TARGET=android-10 ANDROID_ABI=armeabi - ANDROID_SDKS=android-19,sysimg-19 ANDROID_TARGET=android-19 ANDROID_ABI=armeabi-v7a # Emulator Management: Create, Start and Wait before_install: - echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI - emulator -avd test -no-skin -no-audio -no-window & before_script: - android-wait-for-emulator - adb shell input keyevent 82 &
Build also against Java 5
Build also against Java 5
YAML
apache-2.0
davide-maestroni/jroutine,davide-maestroni/jroutine
yaml
## Code Before: language: android android: components: # The BuildTools version - build-tools-21.0.1 # The SDK version - android-21 # Env matrix env: matrix: - ANDROID_SDKS=android-10 ANDROID_TARGET=android-10 ANDROID_ABI=armeabi - ANDROID_SDKS=android-19,sysimg-19 ANDROID_TARGET=android-19 ANDROID_ABI=armeabi-v7a # Emulator Management: Create, Start and Wait before_install: - echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI - emulator -avd test -no-skin -no-audio -no-window & before_script: - android-wait-for-emulator - adb shell input keyevent 82 & ## Instruction: Build also against Java 5 ## Code After: language: android android: components: # The BuildTools version - build-tools-21.0.1 # The SDK version - android-21 jdk: - openjdk5 - openjdk7 # Env matrix env: matrix: - ANDROID_SDKS=android-10 ANDROID_TARGET=android-10 ANDROID_ABI=armeabi - ANDROID_SDKS=android-19,sysimg-19 ANDROID_TARGET=android-19 ANDROID_ABI=armeabi-v7a # Emulator Management: Create, Start and Wait before_install: - echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI - emulator -avd test -no-skin -no-audio -no-window & before_script: - android-wait-for-emulator - adb shell input keyevent 82 &
672d8f065cb69f07641e7fdc258b34a7bc1c6e3d
src/CMakeLists.txt
src/CMakeLists.txt
cmake_minimum_required(VERSION 3.2.2) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wextra") # Enable CCache if found include(${CMAKE_SOURCE_DIR}/cmake/CCache.cmake) include(${CMAKE_SOURCE_DIR}/cmake/iwyu.cmake) iwyu_check(OFF) project(StateMachineCreator CXX) add_subdirectory(gui) add_subdirectory(server)
cmake_minimum_required(VERSION 3.2.2) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wextra -Wpedantic") # Enable CCache if found include(${CMAKE_SOURCE_DIR}/cmake/CCache.cmake) include(${CMAKE_SOURCE_DIR}/cmake/iwyu.cmake) iwyu_check(OFF) project(StateMachineCreator CXX) add_subdirectory(gui) add_subdirectory(server)
Add pedantic flag to compiler
Add pedantic flag to compiler
Text
mit
dea82/StateMachineCreator,dea82/StateMachineCreator
text
## Code Before: cmake_minimum_required(VERSION 3.2.2) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wextra") # Enable CCache if found include(${CMAKE_SOURCE_DIR}/cmake/CCache.cmake) include(${CMAKE_SOURCE_DIR}/cmake/iwyu.cmake) iwyu_check(OFF) project(StateMachineCreator CXX) add_subdirectory(gui) add_subdirectory(server) ## Instruction: Add pedantic flag to compiler ## Code After: cmake_minimum_required(VERSION 3.2.2) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wextra -Wpedantic") # Enable CCache if found include(${CMAKE_SOURCE_DIR}/cmake/CCache.cmake) include(${CMAKE_SOURCE_DIR}/cmake/iwyu.cmake) iwyu_check(OFF) project(StateMachineCreator CXX) add_subdirectory(gui) add_subdirectory(server)
c7cff38c277ad55531a8f5f1ad97e3f2e2020adb
lib/bibliothecary/parsers/swift_pm.rb
lib/bibliothecary/parsers/swift_pm.rb
module Bibliothecary module Parsers class SwiftPM include Bibliothecary::Analyser def self.parse(filename, path) if filename.match(/^Package\.swift$/i) file_contents = File.open(path).read parse_package_swift(file_contents) else [] end end def self.parse_package_swift(manifest) response = Typhoeus.post("http://swiftpm.honza.tech/to-json", body: manifest) json = JSON.parse(response.body) json["dependencies"].map do |dependency| name = dependency['url'].gsub(/^https?:\/\//, '').gsub(/\.git$/,'') version = "#{dependency['version']['lowerBound']} - #{dependency['version']['upperBound']}" { name: name, version: version, type: 'runtime' } end end end end end
module Bibliothecary module Parsers class SwiftPM include Bibliothecary::Analyser def self.parse(filename, path) if filename.match(/^Package\.swift$/i) file_contents = File.open(path).read parse_package_swift(file_contents) else [] end end def self.parse_package_swift(manifest) response = Typhoeus.post("http://swift.libraries.io/to-json", body: manifest) json = JSON.parse(response.body) json["dependencies"].map do |dependency| name = dependency['url'].gsub(/^https?:\/\//, '').gsub(/\.git$/,'') version = "#{dependency['version']['lowerBound']} - #{dependency['version']['upperBound']}" { name: name, version: version, type: 'runtime' } end end end end end
Update link to swift parser
Update link to swift parser
Ruby
agpl-3.0
librariesio/bibliothecary,librariesio/bibliothecary
ruby
## Code Before: module Bibliothecary module Parsers class SwiftPM include Bibliothecary::Analyser def self.parse(filename, path) if filename.match(/^Package\.swift$/i) file_contents = File.open(path).read parse_package_swift(file_contents) else [] end end def self.parse_package_swift(manifest) response = Typhoeus.post("http://swiftpm.honza.tech/to-json", body: manifest) json = JSON.parse(response.body) json["dependencies"].map do |dependency| name = dependency['url'].gsub(/^https?:\/\//, '').gsub(/\.git$/,'') version = "#{dependency['version']['lowerBound']} - #{dependency['version']['upperBound']}" { name: name, version: version, type: 'runtime' } end end end end end ## Instruction: Update link to swift parser ## Code After: module Bibliothecary module Parsers class SwiftPM include Bibliothecary::Analyser def self.parse(filename, path) if filename.match(/^Package\.swift$/i) file_contents = File.open(path).read parse_package_swift(file_contents) else [] end end def self.parse_package_swift(manifest) response = Typhoeus.post("http://swift.libraries.io/to-json", body: manifest) json = JSON.parse(response.body) json["dependencies"].map do |dependency| name = dependency['url'].gsub(/^https?:\/\//, '').gsub(/\.git$/,'') version = "#{dependency['version']['lowerBound']} - #{dependency['version']['upperBound']}" { name: name, version: version, type: 'runtime' } end end end end end
2ab919b65cba55026df1baaa3dec6561e03f398f
deployment/post-install-tasks.yml
deployment/post-install-tasks.yml
--- - name: 'Ensure Git-repository-updating cron job exists' ansible.builtin.cron: cron_file: '{{ __release_crontab }}' job: 'nice -n 10 bash -c "{{ __release_base_directory }}/private/bin/update-git-repositories"' name: 'Update Git Repositories' user: 'root'
--- - name: 'Ensure Git-repository-updating cron job exists' ansible.builtin.cron: cron_file: '{{ __release_crontab }}' hour: '0' job: 'nice -n 10 bash -c "{{ __release_base_directory }}/private/bin/update-git-repositories"' name: 'Update Git Repositories' user: 'root'
Reduce frequency of Git-repository-updating job.
Reduce frequency of Git-repository-updating job.
YAML
mit
damiendart/robotinaponcho,damiendart/robotinaponcho,damiendart/robotinaponcho
yaml
## Code Before: --- - name: 'Ensure Git-repository-updating cron job exists' ansible.builtin.cron: cron_file: '{{ __release_crontab }}' job: 'nice -n 10 bash -c "{{ __release_base_directory }}/private/bin/update-git-repositories"' name: 'Update Git Repositories' user: 'root' ## Instruction: Reduce frequency of Git-repository-updating job. ## Code After: --- - name: 'Ensure Git-repository-updating cron job exists' ansible.builtin.cron: cron_file: '{{ __release_crontab }}' hour: '0' job: 'nice -n 10 bash -c "{{ __release_base_directory }}/private/bin/update-git-repositories"' name: 'Update Git Repositories' user: 'root'
e63bf1b294f4573da27b76a25b6490e6018d92a3
README.md
README.md
[![Greenkeeper badge](https://badges.greenkeeper.io/liqd/a4-meinberlin.svg)](https://greenkeeper.io/) mein.berlin is a participation platform for the city of berlin, germany. It is based on [adhocracy 4](https://github.com/liqd/adhocracy4). ## Requirements * nodejs (+ npm) * python 3.x (+ pip) * libmagic * libjpeg * libpq (only if postgres should be used) ## Installation git clone https://github.com/liqd/a4-meinberlin.git cd a4-meinberlin make install make build
mein.berlin is a participation platform for the city of berlin, germany. It is based on [adhocracy 4](https://github.com/liqd/adhocracy4). ## Requirements * nodejs (+ npm) * python 3.x (+ pip) * libmagic * libjpeg * libpq (only if postgres should be used) ## Installation git clone https://github.com/liqd/a4-meinberlin.git cd a4-meinberlin make install make build
Revert "docs(readme): add Greenkeeper badge"
Revert "docs(readme): add Greenkeeper badge" This reverts commit 1e136e2cf8153b347af660e0cc484897b778d7aa.
Markdown
agpl-3.0
liqd/a4-meinberlin,liqd/a4-meinberlin,liqd/a4-meinberlin,liqd/a4-meinberlin
markdown
## Code Before: [![Greenkeeper badge](https://badges.greenkeeper.io/liqd/a4-meinberlin.svg)](https://greenkeeper.io/) mein.berlin is a participation platform for the city of berlin, germany. It is based on [adhocracy 4](https://github.com/liqd/adhocracy4). ## Requirements * nodejs (+ npm) * python 3.x (+ pip) * libmagic * libjpeg * libpq (only if postgres should be used) ## Installation git clone https://github.com/liqd/a4-meinberlin.git cd a4-meinberlin make install make build ## Instruction: Revert "docs(readme): add Greenkeeper badge" This reverts commit 1e136e2cf8153b347af660e0cc484897b778d7aa. ## Code After: mein.berlin is a participation platform for the city of berlin, germany. It is based on [adhocracy 4](https://github.com/liqd/adhocracy4). ## Requirements * nodejs (+ npm) * python 3.x (+ pip) * libmagic * libjpeg * libpq (only if postgres should be used) ## Installation git clone https://github.com/liqd/a4-meinberlin.git cd a4-meinberlin make install make build
dbe717878a965c8cf89e4a226ea9e158687c68e5
test/CodeGen/X86/pr13577.ll
test/CodeGen/X86/pr13577.ll
; RUN: llc < %s -march=x86-64 define x86_fp80 @foo(x86_fp80 %a) { %1 = tail call x86_fp80 @copysignl(x86_fp80 0xK7FFF8000000000000000, x86_fp80 %a) nounwind readnone ret x86_fp80 %1 } declare x86_fp80 @copysignl(x86_fp80, x86_fp80) nounwind readnone
; RUN: llc < %s -march=x86-64 | FileCheck %s ; CHECK-LABEL: LCPI0_0: ; CHECK-NEXT: .long 4286578688 ; CHECK-LABEL: LCPI0_1: ; CHECK-NEXT: .long 2139095040 ; CHECK-LABEL: foo: ; CHECK: movq {{.*}}, %rax ; CHECK: shlq $48, %rax ; CHECK: sets %al ; CHECK: testb %al, %al ; CHECK: flds LCPI0_0(%rip) ; CHECK: flds LCPI0_1(%rip) ; CHECK: fcmovne %st(1), %st(0) ; CHECK: fstp %st(1) ; CHECK: retq define x86_fp80 @foo(x86_fp80 %a) { %1 = tail call x86_fp80 @copysignl(x86_fp80 0xK7FFF8000000000000000, x86_fp80 %a) nounwind readnone ret x86_fp80 %1 } declare x86_fp80 @copysignl(x86_fp80, x86_fp80) nounwind readnone
Check output of x86 copysignl testcase.
X86: Check output of x86 copysignl testcase. This makes the changes in an upcoming patch visible. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@242106 91177308-0d34-0410-b5e6-96231b3b80d8
LLVM
apache-2.0
llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm
llvm
## Code Before: ; RUN: llc < %s -march=x86-64 define x86_fp80 @foo(x86_fp80 %a) { %1 = tail call x86_fp80 @copysignl(x86_fp80 0xK7FFF8000000000000000, x86_fp80 %a) nounwind readnone ret x86_fp80 %1 } declare x86_fp80 @copysignl(x86_fp80, x86_fp80) nounwind readnone ## Instruction: X86: Check output of x86 copysignl testcase. This makes the changes in an upcoming patch visible. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@242106 91177308-0d34-0410-b5e6-96231b3b80d8 ## Code After: ; RUN: llc < %s -march=x86-64 | FileCheck %s ; CHECK-LABEL: LCPI0_0: ; CHECK-NEXT: .long 4286578688 ; CHECK-LABEL: LCPI0_1: ; CHECK-NEXT: .long 2139095040 ; CHECK-LABEL: foo: ; CHECK: movq {{.*}}, %rax ; CHECK: shlq $48, %rax ; CHECK: sets %al ; CHECK: testb %al, %al ; CHECK: flds LCPI0_0(%rip) ; CHECK: flds LCPI0_1(%rip) ; CHECK: fcmovne %st(1), %st(0) ; CHECK: fstp %st(1) ; CHECK: retq define x86_fp80 @foo(x86_fp80 %a) { %1 = tail call x86_fp80 @copysignl(x86_fp80 0xK7FFF8000000000000000, x86_fp80 %a) nounwind readnone ret x86_fp80 %1 } declare x86_fp80 @copysignl(x86_fp80, x86_fp80) nounwind readnone
928507957bc4a9b6382fc51d5a6367d217cf2ce6
environment/stage5/make-keyword.lisp
environment/stage5/make-keyword.lisp
(define-filter make-keywords (x) (make-keyword x)) (fn make-keyword (x) (& x (make-symbol (? (symbol? x) (symbol-name x) x) "KEYWORD")))
(define-filter make-keywords (x) (make-keyword x)) (fn make-keyword (x) (& x (make-symbol (? (symbol? x) (symbol-name x) x) *keyword-package*)))
Use *KEYWORD-PACKAGE* instead of "KEYWORD" with MAKE-SYMBOL.
Use *KEYWORD-PACKAGE* instead of "KEYWORD" with MAKE-SYMBOL.
Common Lisp
mit
SvenMichaelKlose/tre,SvenMichaelKlose/tre,SvenMichaelKlose/tre
common-lisp
## Code Before: (define-filter make-keywords (x) (make-keyword x)) (fn make-keyword (x) (& x (make-symbol (? (symbol? x) (symbol-name x) x) "KEYWORD"))) ## Instruction: Use *KEYWORD-PACKAGE* instead of "KEYWORD" with MAKE-SYMBOL. ## Code After: (define-filter make-keywords (x) (make-keyword x)) (fn make-keyword (x) (& x (make-symbol (? (symbol? x) (symbol-name x) x) *keyword-package*)))
6e6993c42bbc1ac0fa92eb154954b1d5acdc50df
lib/did_you_mean/strategies/similar_attribute_finder.rb
lib/did_you_mean/strategies/similar_attribute_finder.rb
module DidYouMean class SimilarAttributeFinder attr_reader :columns, :attribute_name def self.build(exception) columns = exception.frame_binding.eval("self.class").columns attribute_name = exception.original_message.gsub("unknown attribute: ", "") new(attribute_name, columns) end def initialize(attribute_name, columns) @attribute_name, @columns = attribute_name, columns end def did_you_mean? return if empty? output = "\n\n" output << " Did you mean? #{format(similar_columns.first)}\n" output << similar_columns[1..-1].map{|word| "#{' ' * 18}#{format(word)}\n" }.join output end def empty? similar_columns.empty? end def similar_columns @similar_columns ||= MethodMatcher.new(column_names, attribute_name).similar_methods end private def column_names columns.map(&:name) end def format(name) "%s: %s" % [name, columns.detect{|c| c.name == name }.type] end end strategies["ActiveRecord::UnknownAttributeError"] = SimilarAttributeFinder end
module DidYouMean class SimilarAttributeFinder attr_reader :columns, :attribute_name def self.build(exception) columns = exception.frame_binding.eval("self.class").columns attribute_name = exception.original_message.gsub("unknown attribute: ", "") new(attribute_name, columns) end def initialize(attribute_name, columns) @attribute_name, @columns = attribute_name, columns end def did_you_mean? return if empty? output = "\n\n" output << " Did you mean? #{format(similar_columns.first)}\n" output << similar_columns[1..-1].map{|word| "#{' ' * 18}#{format(word)}\n" }.join output end def empty? similar_columns.empty? end def similar_columns @similar_columns ||= MethodMatcher.new(columns.map(&:name), attribute_name).similar_methods end private def format(name) "%s: %s" % [name, columns.detect{|c| c.name == name }.type] end end strategies["ActiveRecord::UnknownAttributeError"] = SimilarAttributeFinder end
Remove method that doesn't have to be a method
Remove method that doesn't have to be a method
Ruby
mit
yui-knk/did_you_mean,yuki24/did_you_mean,Ye-Yong-Chi/did_you_mean
ruby
## Code Before: module DidYouMean class SimilarAttributeFinder attr_reader :columns, :attribute_name def self.build(exception) columns = exception.frame_binding.eval("self.class").columns attribute_name = exception.original_message.gsub("unknown attribute: ", "") new(attribute_name, columns) end def initialize(attribute_name, columns) @attribute_name, @columns = attribute_name, columns end def did_you_mean? return if empty? output = "\n\n" output << " Did you mean? #{format(similar_columns.first)}\n" output << similar_columns[1..-1].map{|word| "#{' ' * 18}#{format(word)}\n" }.join output end def empty? similar_columns.empty? end def similar_columns @similar_columns ||= MethodMatcher.new(column_names, attribute_name).similar_methods end private def column_names columns.map(&:name) end def format(name) "%s: %s" % [name, columns.detect{|c| c.name == name }.type] end end strategies["ActiveRecord::UnknownAttributeError"] = SimilarAttributeFinder end ## Instruction: Remove method that doesn't have to be a method ## Code After: module DidYouMean class SimilarAttributeFinder attr_reader :columns, :attribute_name def self.build(exception) columns = exception.frame_binding.eval("self.class").columns attribute_name = exception.original_message.gsub("unknown attribute: ", "") new(attribute_name, columns) end def initialize(attribute_name, columns) @attribute_name, @columns = attribute_name, columns end def did_you_mean? return if empty? output = "\n\n" output << " Did you mean? #{format(similar_columns.first)}\n" output << similar_columns[1..-1].map{|word| "#{' ' * 18}#{format(word)}\n" }.join output end def empty? similar_columns.empty? end def similar_columns @similar_columns ||= MethodMatcher.new(columns.map(&:name), attribute_name).similar_methods end private def format(name) "%s: %s" % [name, columns.detect{|c| c.name == name }.type] end end strategies["ActiveRecord::UnknownAttributeError"] = SimilarAttributeFinder end
18b878fccdc74cf9871f5e6bf64a337ce0c3007f
runtime/bin/utils_macos.cc
runtime/bin/utils_macos.cc
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. #include <errno.h> #include "bin/utils.h" OSError::OSError() { set_code(errno); SetMessage(strerror(errno)); }
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. #include <errno.h> #include "bin/utils.h" OSError::OSError() : code_(0), message_(NULL) { set_code(errno); SetMessage(strerror(errno)); }
Fix missing member initialization on Mac OS
Fix missing member initialization on Mac OS [email protected] Fix Mac OS build\n\[email protected] BUG= TEST= Review URL: https://chromiumcodereview.appspot.com//9694037 git-svn-id: c93d8a2297af3b929165606efe145742a534bc71@5400 260f80e4-7a28-3924-810f-c04153c831b5
C++
bsd-3-clause
dartino/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dart-lang/sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk
c++
## Code Before: // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. #include <errno.h> #include "bin/utils.h" OSError::OSError() { set_code(errno); SetMessage(strerror(errno)); } ## Instruction: Fix missing member initialization on Mac OS [email protected] Fix Mac OS build\n\[email protected] BUG= TEST= Review URL: https://chromiumcodereview.appspot.com//9694037 git-svn-id: c93d8a2297af3b929165606efe145742a534bc71@5400 260f80e4-7a28-3924-810f-c04153c831b5 ## Code After: // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. #include <errno.h> #include "bin/utils.h" OSError::OSError() : code_(0), message_(NULL) { set_code(errno); SetMessage(strerror(errno)); }
9d0a5d5dfb78664010fa7cf79b177e2a19d3561c
app/src/main/java/com/veyndan/redditclient/post/mutator/Mutators.java
app/src/main/java/com/veyndan/redditclient/post/mutator/Mutators.java
package com.veyndan.redditclient.post.mutator; import com.google.common.collect.ImmutableList; import com.veyndan.redditclient.post.model.Post; import java.util.List; import rx.functions.Action1; public final class Mutators { /** * All available mutator factories. * <p> * Note that the order of the mutator factories is the order in which the post will be mutated. */ private static final List<MutatorFactory> MUTATOR_FACTORIES = ImmutableList.of( TextMutatorFactory.create(), LinkImageMutatorFactory.create(), LinkMutatorFactory.create(), ImgurMutatorFactory.create(), TwitterMutatorFactory.create(), XkcdMutatorFactory.create() ); /** * Mutate a list of posts by all the available mutator factories. */ public Action1<Post> mutate() { return post -> { for (final MutatorFactory mutatorFactory : MUTATOR_FACTORIES) { if (mutatorFactory.applicable(post)) mutatorFactory.mutate(post); } }; } }
package com.veyndan.redditclient.post.mutator; import com.google.common.collect.ImmutableList; import com.veyndan.redditclient.post.model.Post; import java.util.List; import rx.functions.Action1; public final class Mutators { /** * All available mutator factories. * <p> * Note that the order of the mutator factories is the order in which the post will be * checked for applicability of mutation. * <p> * Example if the {@link TwitterMutatorFactory} was set * after {@link LinkMutatorFactory} then the post would see if the {@link LinkMutatorFactory} is * applicable to mutate the post first, and if {@code false}, then {@link TwitterMutatorFactory} * would check if it is applicable. In this case the {@link TwitterMutatorFactory} would never * be checked for applicability or be applicable, as if the post contains a link, then * {@link LinkMutatorFactory} would be applicable, then mutation would stop. If * {@link LinkMutatorFactory} isn't applicable, then the post doesn't have a link, so * {@link TwitterMutatorFactory} would never be applicable. Obviously this means that * {@link LinkMutatorFactory} should occur <b><em>after</em></b> {@link TwitterMutatorFactory}. */ private static final List<MutatorFactory> MUTATOR_FACTORIES = ImmutableList.of( TwitterMutatorFactory.create(), XkcdMutatorFactory.create(), ImgurMutatorFactory.create(), TextMutatorFactory.create(), LinkImageMutatorFactory.create(), LinkMutatorFactory.create() ); /** * Mutate a list of posts by the first mutator which is applicable to mutate the post. */ public Action1<Post> mutate() { return post -> { for (final MutatorFactory mutatorFactory : MUTATOR_FACTORIES) { if (mutatorFactory.applicable(post)) { mutatorFactory.mutate(post); return; } } }; } }
Stop mutating a post after the first applicable mutation
Stop mutating a post after the first applicable mutation
Java
mit
veyndan/paper-for-reddit,veyndan/paper-for-reddit,veyndan/reddit-client
java
## Code Before: package com.veyndan.redditclient.post.mutator; import com.google.common.collect.ImmutableList; import com.veyndan.redditclient.post.model.Post; import java.util.List; import rx.functions.Action1; public final class Mutators { /** * All available mutator factories. * <p> * Note that the order of the mutator factories is the order in which the post will be mutated. */ private static final List<MutatorFactory> MUTATOR_FACTORIES = ImmutableList.of( TextMutatorFactory.create(), LinkImageMutatorFactory.create(), LinkMutatorFactory.create(), ImgurMutatorFactory.create(), TwitterMutatorFactory.create(), XkcdMutatorFactory.create() ); /** * Mutate a list of posts by all the available mutator factories. */ public Action1<Post> mutate() { return post -> { for (final MutatorFactory mutatorFactory : MUTATOR_FACTORIES) { if (mutatorFactory.applicable(post)) mutatorFactory.mutate(post); } }; } } ## Instruction: Stop mutating a post after the first applicable mutation ## Code After: package com.veyndan.redditclient.post.mutator; import com.google.common.collect.ImmutableList; import com.veyndan.redditclient.post.model.Post; import java.util.List; import rx.functions.Action1; public final class Mutators { /** * All available mutator factories. * <p> * Note that the order of the mutator factories is the order in which the post will be * checked for applicability of mutation. * <p> * Example if the {@link TwitterMutatorFactory} was set * after {@link LinkMutatorFactory} then the post would see if the {@link LinkMutatorFactory} is * applicable to mutate the post first, and if {@code false}, then {@link TwitterMutatorFactory} * would check if it is applicable. In this case the {@link TwitterMutatorFactory} would never * be checked for applicability or be applicable, as if the post contains a link, then * {@link LinkMutatorFactory} would be applicable, then mutation would stop. If * {@link LinkMutatorFactory} isn't applicable, then the post doesn't have a link, so * {@link TwitterMutatorFactory} would never be applicable. Obviously this means that * {@link LinkMutatorFactory} should occur <b><em>after</em></b> {@link TwitterMutatorFactory}. */ private static final List<MutatorFactory> MUTATOR_FACTORIES = ImmutableList.of( TwitterMutatorFactory.create(), XkcdMutatorFactory.create(), ImgurMutatorFactory.create(), TextMutatorFactory.create(), LinkImageMutatorFactory.create(), LinkMutatorFactory.create() ); /** * Mutate a list of posts by the first mutator which is applicable to mutate the post. */ public Action1<Post> mutate() { return post -> { for (final MutatorFactory mutatorFactory : MUTATOR_FACTORIES) { if (mutatorFactory.applicable(post)) { mutatorFactory.mutate(post); return; } } }; } }
82a5b9ac62a34c18f5336208621338dd65674335
modules/coroutines/src/commonMain/kotlin/splitties/coroutines/SendChannel.kt
modules/coroutines/src/commonMain/kotlin/splitties/coroutines/SendChannel.kt
/* * Copyright 2019 Louis Cognault Ayeva Derman. Use of this source code is governed by the Apache 2.0 license. */ package splitties.coroutines import kotlinx.coroutines.CancellationException import kotlinx.coroutines.channels.SendChannel /** * [SendChannel.offer] that returns `false` when this [SendChannel.isClosedForSend], instead of * throwing. * * [SendChannel.offer] throws when the channel is closed. In race conditions, especially when using * multithreaded dispatchers, that can lead to uncaught exceptions as offer is often called from * non suspending functions that don't catch the default [CancellationException] or any other * exception that might be the cause of the closing of the channel. */ fun <E> SendChannel<E>.offerCatching(element: E): Boolean { return runCatching { offer(element) }.getOrDefault(false) }
/* * Copyright 2019 Louis Cognault Ayeva Derman. Use of this source code is governed by the Apache 2.0 license. */ package splitties.coroutines import kotlinx.coroutines.CancellationException import kotlinx.coroutines.channels.SendChannel /** * [SendChannel.offer] that returns `false` when this [SendChannel.isClosedForSend], instead of * throwing. * * [SendChannel.offer] throws when the channel is closed. In race conditions, especially when using * multithreaded dispatchers, that can lead to uncaught exceptions as offer is often called from * non suspending functions that don't catch the default [CancellationException] or any other * exception that might be the cause of the closing of the channel. * * See this issue: [https://github.com/Kotlin/kotlinx.coroutines/issues/974](https://github.com/Kotlin/kotlinx.coroutines/issues/974) */ fun <E> SendChannel<E>.offerCatching(element: E): Boolean { return runCatching { offer(element) }.getOrDefault(false) }
Add link to relevant issue
Add link to relevant issue
Kotlin
apache-2.0
LouisCAD/Splitties,LouisCAD/Splitties,LouisCAD/Splitties
kotlin
## Code Before: /* * Copyright 2019 Louis Cognault Ayeva Derman. Use of this source code is governed by the Apache 2.0 license. */ package splitties.coroutines import kotlinx.coroutines.CancellationException import kotlinx.coroutines.channels.SendChannel /** * [SendChannel.offer] that returns `false` when this [SendChannel.isClosedForSend], instead of * throwing. * * [SendChannel.offer] throws when the channel is closed. In race conditions, especially when using * multithreaded dispatchers, that can lead to uncaught exceptions as offer is often called from * non suspending functions that don't catch the default [CancellationException] or any other * exception that might be the cause of the closing of the channel. */ fun <E> SendChannel<E>.offerCatching(element: E): Boolean { return runCatching { offer(element) }.getOrDefault(false) } ## Instruction: Add link to relevant issue ## Code After: /* * Copyright 2019 Louis Cognault Ayeva Derman. Use of this source code is governed by the Apache 2.0 license. */ package splitties.coroutines import kotlinx.coroutines.CancellationException import kotlinx.coroutines.channels.SendChannel /** * [SendChannel.offer] that returns `false` when this [SendChannel.isClosedForSend], instead of * throwing. * * [SendChannel.offer] throws when the channel is closed. In race conditions, especially when using * multithreaded dispatchers, that can lead to uncaught exceptions as offer is often called from * non suspending functions that don't catch the default [CancellationException] or any other * exception that might be the cause of the closing of the channel. * * See this issue: [https://github.com/Kotlin/kotlinx.coroutines/issues/974](https://github.com/Kotlin/kotlinx.coroutines/issues/974) */ fun <E> SendChannel<E>.offerCatching(element: E): Boolean { return runCatching { offer(element) }.getOrDefault(false) }
6e74e3b50e927e847acb87fc59dc9b5ebc6de926
src/Microsoft.DotNet.Archive/LZMA/README.md
src/Microsoft.DotNet.Archive/LZMA/README.md
This source came from the C# implementation of LZMA from the LZMA SDK, version 16.02, from http://www.7-zip.org/sdk.html. ## License The LZMA SDK is public domain. Thanks goes to Igor Pavlov for making this available.
This source came from the C# implementation of LZMA from the LZMA SDK, version 16.02, from http://www.7-zip.org/sdk.html. ## License LZMA SDK is placed in the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute the original LZMA SDK code, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. ## Thanks! Thanks goes to Igor Pavlov for making this available.
Update LZMA license with correct text
Update LZMA license with correct text
Markdown
mit
harshjain2/cli,Faizan2304/cli,ravimeda/cli,dasMulli/cli,EdwardBlair/cli,johnbeisner/cli,Faizan2304/cli,harshjain2/cli,Faizan2304/cli,ravimeda/cli,johnbeisner/cli,blackdwarf/cli,svick/cli,livarcocc/cli-1,ravimeda/cli,jonsequitur/cli,jonsequitur/cli,dasMulli/cli,livarcocc/cli-1,EdwardBlair/cli,harshjain2/cli,jonsequitur/cli,svick/cli,blackdwarf/cli,EdwardBlair/cli,blackdwarf/cli,livarcocc/cli-1,dasMulli/cli,svick/cli,blackdwarf/cli,johnbeisner/cli,jonsequitur/cli
markdown
## Code Before: This source came from the C# implementation of LZMA from the LZMA SDK, version 16.02, from http://www.7-zip.org/sdk.html. ## License The LZMA SDK is public domain. Thanks goes to Igor Pavlov for making this available. ## Instruction: Update LZMA license with correct text ## Code After: This source came from the C# implementation of LZMA from the LZMA SDK, version 16.02, from http://www.7-zip.org/sdk.html. ## License LZMA SDK is placed in the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute the original LZMA SDK code, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. ## Thanks! Thanks goes to Igor Pavlov for making this available.
6e8b9fe6e24af56cbb6294c68e267ee6e48faf0e
spec/classes/ansible_spec.rb
spec/classes/ansible_spec.rb
require 'spec_helper' describe 'ansible' do it { is_expected.to compile.with_all_deps } it { should contain_class('ansible') } it { should contain_class('ansible::install') .that_comes_before('Class[ansible::config]') } it { should contain_class('ansible::config') } describe 'ansible::install' do it { should contain_package('ansible') } end describe 'ansible::config' do it { should contain_file('/etc/ansible').with_ensure('directory') } it { should contain_file('/etc/ansible').with_mode('0755') } it { should contain_file('/etc/ansible/ansible.cfg').with_ensure('file') } it { should contain_file('/etc/ansible/ansible.cfg').with_mode('0644') } it { should contain_concat('/etc/ansible/hosts').with_ensure('present') } it { should contain_concat('/etc/ansible/hosts').with_mode('0644') } it { should contain_concat('/etc/ansible/hosts').with_warn(true) } end end
require 'spec_helper' describe 'ansible' do let(:facts) do { 'operatingsystem' => 'CentOS', } end it { is_expected.to compile.with_all_deps } it { should contain_class('ansible') } it { should contain_class('ansible::install') .that_comes_before('Class[ansible::config]') } it { should contain_class('ansible::config') } describe 'ansible::install' do it { should contain_package('ansible') } end describe 'ansible::config' do it { should contain_file('/etc/ansible').with_ensure('directory') } it { should contain_file('/etc/ansible').with_mode('0755') } it { should contain_file('/etc/ansible/ansible.cfg').with_ensure('file') } it { should contain_file('/etc/ansible/ansible.cfg').with_mode('0644') } it { should contain_concat('/etc/ansible/hosts').with_ensure('present') } it { should contain_concat('/etc/ansible/hosts').with_mode('0644') } it { should contain_concat('/etc/ansible/hosts').with_warn(true) } end end
Include facts in rspec test
Include facts in rspec test
Ruby
apache-2.0
otherskins/puppet-ansible
ruby
## Code Before: require 'spec_helper' describe 'ansible' do it { is_expected.to compile.with_all_deps } it { should contain_class('ansible') } it { should contain_class('ansible::install') .that_comes_before('Class[ansible::config]') } it { should contain_class('ansible::config') } describe 'ansible::install' do it { should contain_package('ansible') } end describe 'ansible::config' do it { should contain_file('/etc/ansible').with_ensure('directory') } it { should contain_file('/etc/ansible').with_mode('0755') } it { should contain_file('/etc/ansible/ansible.cfg').with_ensure('file') } it { should contain_file('/etc/ansible/ansible.cfg').with_mode('0644') } it { should contain_concat('/etc/ansible/hosts').with_ensure('present') } it { should contain_concat('/etc/ansible/hosts').with_mode('0644') } it { should contain_concat('/etc/ansible/hosts').with_warn(true) } end end ## Instruction: Include facts in rspec test ## Code After: require 'spec_helper' describe 'ansible' do let(:facts) do { 'operatingsystem' => 'CentOS', } end it { is_expected.to compile.with_all_deps } it { should contain_class('ansible') } it { should contain_class('ansible::install') .that_comes_before('Class[ansible::config]') } it { should contain_class('ansible::config') } describe 'ansible::install' do it { should contain_package('ansible') } end describe 'ansible::config' do it { should contain_file('/etc/ansible').with_ensure('directory') } it { should contain_file('/etc/ansible').with_mode('0755') } it { should contain_file('/etc/ansible/ansible.cfg').with_ensure('file') } it { should contain_file('/etc/ansible/ansible.cfg').with_mode('0644') } it { should contain_concat('/etc/ansible/hosts').with_ensure('present') } it { should contain_concat('/etc/ansible/hosts').with_mode('0644') } it { should contain_concat('/etc/ansible/hosts').with_warn(true) } end end
8e8370a76c67d7905c73bcb808f89e3cd4b994a3
runtests.py
runtests.py
import django from django.conf import settings from django.core.management import call_command settings.configure( DATABASES={ 'default': { 'ENGINE': 'django.db.backends.sqlite3', } }, ALLOWED_HOSTS=[ 'testserver', ], INSTALLED_APPS=[ 'django.contrib.auth', 'django.contrib.contenttypes', 'permissions', 'permissions.tests', ], MIDDLEWARE_CLASSES=[], ROOT_URLCONF='permissions.tests.urls', TEMPLATES=[{ 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'APP_DIRS': True, }], TEST_RUNNER='django.test.runner.DiscoverRunner', ) if django.VERSION[:2] >= (1, 7): from django import setup else: setup = lambda: None setup() call_command("test")
import django from django.conf import settings from django.core.management import call_command settings.configure( DATABASES={ 'default': { 'ENGINE': 'django.db.backends.sqlite3', } }, ALLOWED_HOSTS=[ 'testserver', ], INSTALLED_APPS=[ 'django.contrib.auth', 'django.contrib.contenttypes', 'permissions', 'permissions.tests', ], MIDDLEWARE_CLASSES=[], PERMISSIONS={ 'allow_staff': False, }, ROOT_URLCONF='permissions.tests.urls', TEMPLATES=[{ 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'APP_DIRS': True, }], TEST_RUNNER='django.test.runner.DiscoverRunner', ) if django.VERSION[:2] >= (1, 7): from django import setup else: setup = lambda: None setup() call_command("test")
Add PERMISSIONS setting to test settings
Add PERMISSIONS setting to test settings
Python
mit
wylee/django-perms,PSU-OIT-ARC/django-perms
python
## Code Before: import django from django.conf import settings from django.core.management import call_command settings.configure( DATABASES={ 'default': { 'ENGINE': 'django.db.backends.sqlite3', } }, ALLOWED_HOSTS=[ 'testserver', ], INSTALLED_APPS=[ 'django.contrib.auth', 'django.contrib.contenttypes', 'permissions', 'permissions.tests', ], MIDDLEWARE_CLASSES=[], ROOT_URLCONF='permissions.tests.urls', TEMPLATES=[{ 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'APP_DIRS': True, }], TEST_RUNNER='django.test.runner.DiscoverRunner', ) if django.VERSION[:2] >= (1, 7): from django import setup else: setup = lambda: None setup() call_command("test") ## Instruction: Add PERMISSIONS setting to test settings ## Code After: import django from django.conf import settings from django.core.management import call_command settings.configure( DATABASES={ 'default': { 'ENGINE': 'django.db.backends.sqlite3', } }, ALLOWED_HOSTS=[ 'testserver', ], INSTALLED_APPS=[ 'django.contrib.auth', 'django.contrib.contenttypes', 'permissions', 'permissions.tests', ], MIDDLEWARE_CLASSES=[], PERMISSIONS={ 'allow_staff': False, }, ROOT_URLCONF='permissions.tests.urls', TEMPLATES=[{ 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'APP_DIRS': True, }], TEST_RUNNER='django.test.runner.DiscoverRunner', ) if django.VERSION[:2] >= (1, 7): from django import setup else: setup = lambda: None setup() call_command("test")
643e2b07e5a741e4e1e740b1ea3d32932d5e3631
.travis.yml
.travis.yml
language: php sudo: false cache: directories: - $HOME/.composer/cache matrix: include: - php: hhvm - php: 5.4 env: check_cs=true - php: 5.5 - php: 5.6 env: deps=low coverage=true - php: 5.6 env: deps=high coverage=true - php: 7.0 env: global: - deps=high - coverage=false - check_cs=false install: - if [ "$deps" = "low" ]; then composer --prefer-source --prefer-lowest update; fi; - if [ "$deps" != "low" ]; then composer --prefer-source update; fi; script: - if [ "$coverage" = "true" ]; then vendor/bin/phpunit --coverage-clover=coverage; fi; - if [ "$coverage" != "true" ]; then vendor/bin/phpunit; fi; - if [ "$check_cs" = "true" ]; then vendor/bin/php-cs-fixer fix --config-file=.php_cs --dry-run --diff; fi; after_script: - if [ "$coverage" = "true" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi; - if [ "$coverage" = "true" ]; then php ocular.phar code-coverage:upload --format=php-clover coverage; fi;
language: php sudo: false cache: directories: - $HOME/.composer/cache matrix: include: - php: hhvm - php: 5.4 env: check_cs=true - php: 5.5 - php: 5.6 env: deps=low coverage=true - php: 5.6 env: deps=high coverage=true - php: 7.0 - php: 7.1 - php: 7.2 - php: 7.3 env: global: - deps=high - coverage=false - check_cs=false install: - if [ "$deps" = "low" ]; then composer --prefer-source --prefer-lowest update; fi; - if [ "$deps" != "low" ]; then composer --prefer-source update; fi; script: - if [ "$coverage" = "true" ]; then vendor/bin/phpunit --coverage-clover=coverage; fi; - if [ "$coverage" != "true" ]; then vendor/bin/phpunit; fi; - if [ "$check_cs" = "true" ]; then vendor/bin/php-cs-fixer fix --config-file=.php_cs --dry-run --diff; fi; after_script: - if [ "$coverage" = "true" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi; - if [ "$coverage" = "true" ]; then php ocular.phar code-coverage:upload --format=php-clover coverage; fi;
Add PHP 7.1, 7.2, and 7.3 to Travis build matrix
Enhancement: Add PHP 7.1, 7.2, and 7.3 to Travis build matrix
YAML
mit
pyrech/composer-changelogs,pyrech/composer-changelogs
yaml
## Code Before: language: php sudo: false cache: directories: - $HOME/.composer/cache matrix: include: - php: hhvm - php: 5.4 env: check_cs=true - php: 5.5 - php: 5.6 env: deps=low coverage=true - php: 5.6 env: deps=high coverage=true - php: 7.0 env: global: - deps=high - coverage=false - check_cs=false install: - if [ "$deps" = "low" ]; then composer --prefer-source --prefer-lowest update; fi; - if [ "$deps" != "low" ]; then composer --prefer-source update; fi; script: - if [ "$coverage" = "true" ]; then vendor/bin/phpunit --coverage-clover=coverage; fi; - if [ "$coverage" != "true" ]; then vendor/bin/phpunit; fi; - if [ "$check_cs" = "true" ]; then vendor/bin/php-cs-fixer fix --config-file=.php_cs --dry-run --diff; fi; after_script: - if [ "$coverage" = "true" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi; - if [ "$coverage" = "true" ]; then php ocular.phar code-coverage:upload --format=php-clover coverage; fi; ## Instruction: Enhancement: Add PHP 7.1, 7.2, and 7.3 to Travis build matrix ## Code After: language: php sudo: false cache: directories: - $HOME/.composer/cache matrix: include: - php: hhvm - php: 5.4 env: check_cs=true - php: 5.5 - php: 5.6 env: deps=low coverage=true - php: 5.6 env: deps=high coverage=true - php: 7.0 - php: 7.1 - php: 7.2 - php: 7.3 env: global: - deps=high - coverage=false - check_cs=false install: - if [ "$deps" = "low" ]; then composer --prefer-source --prefer-lowest update; fi; - if [ "$deps" != "low" ]; then composer --prefer-source update; fi; script: - if [ "$coverage" = "true" ]; then vendor/bin/phpunit --coverage-clover=coverage; fi; - if [ "$coverage" != "true" ]; then vendor/bin/phpunit; fi; - if [ "$check_cs" = "true" ]; then vendor/bin/php-cs-fixer fix --config-file=.php_cs --dry-run --diff; fi; after_script: - if [ "$coverage" = "true" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi; - if [ "$coverage" = "true" ]; then php ocular.phar code-coverage:upload --format=php-clover coverage; fi;
714ad071ca683fc92f1f7627de89e5e60639b778
resources/views/account/api.blade.php
resources/views/account/api.blade.php
@extends('layouts/default') {{-- Page title --}} @section('title') Personal API Keys @parent @stop {{-- Page content --}} @section('content') @if (!config('app.lock_passwords')) <passport-personal-access-tokens token-url="{{ url('oauth/personal-access-tokens') }}" scopes-url="{{ url('oauth/scopes') }}"> </passport-personal-access-tokens> @else <p class="help-block">{{ trans('general.feature_disabled') }}</p> @endif @stop @section('moar_scripts') <script nonce="{{ csrf_token() }}"> new Vue({ el: "#app", }); </script> @endsection
@extends('layouts/default') {{-- Page title --}} @section('title') Personal API Keys @parent @stop {{-- Page content --}} @section('content') <div class="row"> <div class="col-md-8"> @if (!config('app.lock_passwords')) <passport-personal-access-tokens token-url="{{ url('oauth/personal-access-tokens') }}" scopes-url="{{ url('oauth/scopes') }}"> </passport-personal-access-tokens> @else <p class="help-block">{{ trans('general.feature_disabled') }}</p> @endif </div> <div class="col-md-4"> <p>Your API endpoint is located at:<br> <code>{{ url('/api/v1') }}</code></p> <p>When you generate an API token, be sure to copy it down immediately as they will not be visible to you again. </p> </div> </div> @stop @section('moar_scripts') <script nonce="{{ csrf_token() }}"> new Vue({ el: "#app", }); </script> @endsection
Add API endpoint to API keys page
Add API endpoint to API keys page // TODO - localize it
PHP
agpl-3.0
uberbrady/snipe-it,snipe/snipe-it,mtucker6784/snipe-it,snipe/snipe-it,uberbrady/snipe-it,uberbrady/snipe-it,mtucker6784/snipe-it,snipe/snipe-it,mtucker6784/snipe-it,uberbrady/snipe-it,mtucker6784/snipe-it,uberbrady/snipe-it,mtucker6784/snipe-it,snipe/snipe-it
php
## Code Before: @extends('layouts/default') {{-- Page title --}} @section('title') Personal API Keys @parent @stop {{-- Page content --}} @section('content') @if (!config('app.lock_passwords')) <passport-personal-access-tokens token-url="{{ url('oauth/personal-access-tokens') }}" scopes-url="{{ url('oauth/scopes') }}"> </passport-personal-access-tokens> @else <p class="help-block">{{ trans('general.feature_disabled') }}</p> @endif @stop @section('moar_scripts') <script nonce="{{ csrf_token() }}"> new Vue({ el: "#app", }); </script> @endsection ## Instruction: Add API endpoint to API keys page // TODO - localize it ## Code After: @extends('layouts/default') {{-- Page title --}} @section('title') Personal API Keys @parent @stop {{-- Page content --}} @section('content') <div class="row"> <div class="col-md-8"> @if (!config('app.lock_passwords')) <passport-personal-access-tokens token-url="{{ url('oauth/personal-access-tokens') }}" scopes-url="{{ url('oauth/scopes') }}"> </passport-personal-access-tokens> @else <p class="help-block">{{ trans('general.feature_disabled') }}</p> @endif </div> <div class="col-md-4"> <p>Your API endpoint is located at:<br> <code>{{ url('/api/v1') }}</code></p> <p>When you generate an API token, be sure to copy it down immediately as they will not be visible to you again. </p> </div> </div> @stop @section('moar_scripts') <script nonce="{{ csrf_token() }}"> new Vue({ el: "#app", }); </script> @endsection
a34b2269c3749a5c014e2fcdd663795f3c8f1731
lib/auth/token-container.js
lib/auth/token-container.js
var crypto = require('crypto'); var _ = require('underscore'); function TokenContainer() { this._tokens = {}; this._startGarbageCollecting(); } TokenContainer._hourMs = 60 * 60 * 1000; TokenContainer._collectorIntervalMs = 12 * TokenContainer._hourMs; TokenContainer._oudatedTimeMs = 48 * TokenContainer._hourMs; TokenContainer.prototype.saveToken = function(res, token) { var cookie = crypto.randomBytes(32).toString('hex'); this._tokens[cookie] = {token: token, lastUsage: Date.now()}; res.cookies.set('userid', cookie, {path: '/', secure: true, httpOnly: false}); }; TokenContainer.prototype.hasToken = function(tokenKey) { var info = this._tokens[tokenKey]; if (info) { info.lastUsage = Date.now(); } return !!info; }; TokenContainer.prototype.extractTokenKeyFromRequest = function(req) { return req.cookies.get('userid'); }; TokenContainer.prototype._startGarbageCollecting = function() { setInterval(function() { var now = Date.now(); _.each(this._tokens, function(info, cookie, cookies) { if (now - info.lastUsage > TokenContainer._oudatedTimeMs) { delete cookies[cookie]; } }); }.bind(this), TokenContainer._collectorIntervalMs); }; module.exports = TokenContainer;
var crypto = require('crypto'); var _ = require('underscore'); function TokenContainer() { this._tokens = {}; this._startGarbageCollecting(); } TokenContainer._hourMs = 60 * 60 * 1000; TokenContainer._collectorIntervalMs = 12 * TokenContainer._hourMs; TokenContainer._oudatedTimeMs = 48 * TokenContainer._hourMs; TokenContainer.prototype.saveToken = function(res, token) { var cookie = crypto.randomBytes(32).toString('hex'); this._tokens[cookie] = {token: token, lastUsage: Date.now()}; res.cookies.set('userid', cookie, {path: '/'}); }; TokenContainer.prototype.hasToken = function(tokenKey) { var info = this._tokens[tokenKey]; if (info) { info.lastUsage = Date.now(); } return !!info; }; TokenContainer.prototype.extractTokenKeyFromRequest = function(req) { return req.cookies.get('userid'); }; TokenContainer.prototype._startGarbageCollecting = function() { setInterval(function() { var now = Date.now(); _.each(this._tokens, function(info, cookie, cookies) { if (now - info.lastUsage > TokenContainer._oudatedTimeMs) { delete cookies[cookie]; } }); }.bind(this), TokenContainer._collectorIntervalMs); }; module.exports = TokenContainer;
Remove https restriction from cookie setter.
Remove https restriction from cookie setter.
JavaScript
mit
cargomedia/pulsar-rest-api,njam/pulsar-rest-api,cargomedia/pulsar-rest-api,njam/pulsar-rest-api,cargomedia/pulsar-rest-api,vogdb/pulsar-rest-api,cargomedia/pulsar-rest-api,njam/pulsar-rest-api,vogdb/pulsar-rest-api,njam/pulsar-rest-api,vogdb/pulsar-rest-api
javascript
## Code Before: var crypto = require('crypto'); var _ = require('underscore'); function TokenContainer() { this._tokens = {}; this._startGarbageCollecting(); } TokenContainer._hourMs = 60 * 60 * 1000; TokenContainer._collectorIntervalMs = 12 * TokenContainer._hourMs; TokenContainer._oudatedTimeMs = 48 * TokenContainer._hourMs; TokenContainer.prototype.saveToken = function(res, token) { var cookie = crypto.randomBytes(32).toString('hex'); this._tokens[cookie] = {token: token, lastUsage: Date.now()}; res.cookies.set('userid', cookie, {path: '/', secure: true, httpOnly: false}); }; TokenContainer.prototype.hasToken = function(tokenKey) { var info = this._tokens[tokenKey]; if (info) { info.lastUsage = Date.now(); } return !!info; }; TokenContainer.prototype.extractTokenKeyFromRequest = function(req) { return req.cookies.get('userid'); }; TokenContainer.prototype._startGarbageCollecting = function() { setInterval(function() { var now = Date.now(); _.each(this._tokens, function(info, cookie, cookies) { if (now - info.lastUsage > TokenContainer._oudatedTimeMs) { delete cookies[cookie]; } }); }.bind(this), TokenContainer._collectorIntervalMs); }; module.exports = TokenContainer; ## Instruction: Remove https restriction from cookie setter. ## Code After: var crypto = require('crypto'); var _ = require('underscore'); function TokenContainer() { this._tokens = {}; this._startGarbageCollecting(); } TokenContainer._hourMs = 60 * 60 * 1000; TokenContainer._collectorIntervalMs = 12 * TokenContainer._hourMs; TokenContainer._oudatedTimeMs = 48 * TokenContainer._hourMs; TokenContainer.prototype.saveToken = function(res, token) { var cookie = crypto.randomBytes(32).toString('hex'); this._tokens[cookie] = {token: token, lastUsage: Date.now()}; res.cookies.set('userid', cookie, {path: '/'}); }; TokenContainer.prototype.hasToken = function(tokenKey) { var info = this._tokens[tokenKey]; if (info) { info.lastUsage = Date.now(); } return !!info; }; TokenContainer.prototype.extractTokenKeyFromRequest = function(req) { return req.cookies.get('userid'); }; TokenContainer.prototype._startGarbageCollecting = function() { setInterval(function() { var now = Date.now(); _.each(this._tokens, function(info, cookie, cookies) { if (now - info.lastUsage > TokenContainer._oudatedTimeMs) { delete cookies[cookie]; } }); }.bind(this), TokenContainer._collectorIntervalMs); }; module.exports = TokenContainer;
6097c9395a8b61346c33c8ccac8884a2ac71e874
portal/app/Console/Commands/TestSmtpCredentials.php
portal/app/Console/Commands/TestSmtpCredentials.php
<?php namespace App\Console\Commands; use Exception; use Illuminate\Console\Command; use Illuminate\Support\Facades\Mail; class TestSmtpCredentials extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'sonar:test:smtp {email}'; /** * The console command description. * * @var string */ protected $description = 'Test the SMTP credentials from your .env file.'; /** * Create a new command instance. * */ public function __construct() { parent::__construct(); } /** * Execute the console command. * * @return mixed */ public function handle() { $email = $this->argument('email'); if (filter_var($email, FILTER_VALIDATE_EMAIL) === false) { $this->error($email . " is not a valid email address."); return; } try { Mail::send('emails.test', [], function($m) use ($email) { $m->from('[email protected]','Sonar Customer Portal'); $m->to($email, $email) ->subject('Sonar customer portal test email!'); }); $this->info("Test email to $email sent."); } catch (Exception $e) { $this->error("Test email failed with the following: " . $e->getMessage()); } } }
<?php namespace App\Console\Commands; use Exception; use Illuminate\Console\Command; use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Mail; class TestSmtpCredentials extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'sonar:test:smtp {email}'; /** * The console command description. * * @var string */ protected $description = 'Test the SMTP credentials from your .env file.'; /** * Create a new command instance. * */ public function __construct() { parent::__construct(); } /** * Execute the console command. * * @return mixed */ public function handle() { $email = $this->argument('email'); if (filter_var($email, FILTER_VALIDATE_EMAIL) === false) { $this->error($email . " is not a valid email address."); return; } try { Mail::send('emails.test', [], function($m) use ($email) { $m->from(Config::get("customer_portal.from_address"),Config::get("customer_portal.from_name")); $m->to($email, $email) ->subject('Sonar customer portal test email!'); }); $this->info("Test email to $email sent."); } catch (Exception $e) { $this->error("Test email failed with the following: " . $e->getMessage()); } } }
Send the test SMTP message from the configured from address/name
Send the test SMTP message from the configured from address/name
PHP
mit
sunithawisptools/customer_portal,sunithawisptools/customer_portal,sunithawisptools/customer_portal,SonarSoftware/customer_portal,SonarSoftware/customer_portal,sunithawisptools/customer_portal,SonarSoftware/customer_portal,SonarSoftware/customer_portal
php
## Code Before: <?php namespace App\Console\Commands; use Exception; use Illuminate\Console\Command; use Illuminate\Support\Facades\Mail; class TestSmtpCredentials extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'sonar:test:smtp {email}'; /** * The console command description. * * @var string */ protected $description = 'Test the SMTP credentials from your .env file.'; /** * Create a new command instance. * */ public function __construct() { parent::__construct(); } /** * Execute the console command. * * @return mixed */ public function handle() { $email = $this->argument('email'); if (filter_var($email, FILTER_VALIDATE_EMAIL) === false) { $this->error($email . " is not a valid email address."); return; } try { Mail::send('emails.test', [], function($m) use ($email) { $m->from('[email protected]','Sonar Customer Portal'); $m->to($email, $email) ->subject('Sonar customer portal test email!'); }); $this->info("Test email to $email sent."); } catch (Exception $e) { $this->error("Test email failed with the following: " . $e->getMessage()); } } } ## Instruction: Send the test SMTP message from the configured from address/name ## Code After: <?php namespace App\Console\Commands; use Exception; use Illuminate\Console\Command; use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Mail; class TestSmtpCredentials extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'sonar:test:smtp {email}'; /** * The console command description. * * @var string */ protected $description = 'Test the SMTP credentials from your .env file.'; /** * Create a new command instance. * */ public function __construct() { parent::__construct(); } /** * Execute the console command. * * @return mixed */ public function handle() { $email = $this->argument('email'); if (filter_var($email, FILTER_VALIDATE_EMAIL) === false) { $this->error($email . " is not a valid email address."); return; } try { Mail::send('emails.test', [], function($m) use ($email) { $m->from(Config::get("customer_portal.from_address"),Config::get("customer_portal.from_name")); $m->to($email, $email) ->subject('Sonar customer portal test email!'); }); $this->info("Test email to $email sent."); } catch (Exception $e) { $this->error("Test email failed with the following: " . $e->getMessage()); } } }
d94296e620cf993966138cef3bedc6f4f07a6ca9
doc/api/index.rst
doc/api/index.rst
======= Web API ======= .. toctree:: overview uploads jobs samples viruses history hmm genbank users groups account
======= Web API ======= .. toctree:: :maxdepth: 1 overview uploads jobs samples viruses history hmm genbank users groups account
Change API docs TOC depth
Change API docs TOC depth
reStructuredText
mit
igboyes/virtool,virtool/virtool,virtool/virtool,igboyes/virtool
restructuredtext
## Code Before: ======= Web API ======= .. toctree:: overview uploads jobs samples viruses history hmm genbank users groups account ## Instruction: Change API docs TOC depth ## Code After: ======= Web API ======= .. toctree:: :maxdepth: 1 overview uploads jobs samples viruses history hmm genbank users groups account
f397829939531a37238d920f8812d2304888417d
app/views/static/submit/thanks.md
app/views/static/submit/thanks.md
--- title: Thanks! --- Thank you for submitting an address. Why not [mail](mailto:yourfriendsemail@ddresshere?subject=Why not share your address&body=Share an address at openaddressesuk.org to help build an open address list for the UK) a friend to ask them to share an address?
--- title: Thanks! --- Thank you for submitting an address. Why not [mail](mailto:yourfriendsemail@ddresshere?subject=Why not share your address&body=Share an address at openaddressesuk.org to help build an open address list for the UK) a friend to ask them to share an address? ### Add another address? <%= include 'submission_form' %>
Add submission form to thank you page
Add submission form to thank you page
Markdown
mit
OpenAddressesUK/theodolite,OpenAddressesUK/theodolite,OpenAddressesUK/theodolite
markdown
## Code Before: --- title: Thanks! --- Thank you for submitting an address. Why not [mail](mailto:yourfriendsemail@ddresshere?subject=Why not share your address&body=Share an address at openaddressesuk.org to help build an open address list for the UK) a friend to ask them to share an address? ## Instruction: Add submission form to thank you page ## Code After: --- title: Thanks! --- Thank you for submitting an address. Why not [mail](mailto:yourfriendsemail@ddresshere?subject=Why not share your address&body=Share an address at openaddressesuk.org to help build an open address list for the UK) a friend to ask them to share an address? ### Add another address? <%= include 'submission_form' %>
099b220de0b1e00fc2c82125522bc881417e47ed
src/model/SketchItemEllipse.cpp
src/model/SketchItemEllipse.cpp
SketchItemEllipse::SketchItemEllipse(qreal x, qreal y) : SketchItemBezier(x, y) { addPath(QPointF(30, 0), QPointF(50, 20), QPointF(50, 50)); addPath(QPointF(50, 80), QPointF(30, 100), QPointF(0, 100)); addPath(QPointF(-30, 100), QPointF(-40, 80), QPointF(-40, 50)); addPath(QPointF(-40, 20), QPointF(-30, 0), QPointF(0, 0)); closePath(); } SketchItemEllipse::~SketchItemEllipse() { } void SketchItemEllipse::boundBoxPointMoved(BoundingBoxPoint::TranslationDirection direction, QPointF delta) { }
// Constants static const uint TOP_INDEX = 12; static const uint RIGHT_INDEX = 3; static const uint BOTTOM_INDEX = 6; static const uint LEFT_INDEX = 9; SketchItemEllipse::SketchItemEllipse(qreal x, qreal y) : SketchItemBezier(x, y) { addPath(QPointF(30, 0), QPointF(50, 20), QPointF(50, 50)); addPath(QPointF(50, 80), QPointF(30, 100), QPointF(0, 100)); addPath(QPointF(-40, 100), QPointF(-50, 80), QPointF(-50, 50)); addPath(QPointF(-40, 20), QPointF(-30, 0), QPointF(0, 0)); closePath(); mBoundingBox->updateRect(); } SketchItemEllipse::~SketchItemEllipse() { } void SketchItemEllipse::boundBoxPointMoved(BoundingBoxPoint::TranslationDirection direction, QPointF delta) { // because the path is closed, we don't have to // move the first item, the last is enough switch (direction) { default: qErrnoWarning("Unexpected TranslationDirection!"); break; } mBoundingBox->updateRect(direction); }
Prepare bounding box transform for Ellipse
Prepare bounding box transform for Ellipse
C++
apache-2.0
neuronalmotion/blueprint
c++
## Code Before: SketchItemEllipse::SketchItemEllipse(qreal x, qreal y) : SketchItemBezier(x, y) { addPath(QPointF(30, 0), QPointF(50, 20), QPointF(50, 50)); addPath(QPointF(50, 80), QPointF(30, 100), QPointF(0, 100)); addPath(QPointF(-30, 100), QPointF(-40, 80), QPointF(-40, 50)); addPath(QPointF(-40, 20), QPointF(-30, 0), QPointF(0, 0)); closePath(); } SketchItemEllipse::~SketchItemEllipse() { } void SketchItemEllipse::boundBoxPointMoved(BoundingBoxPoint::TranslationDirection direction, QPointF delta) { } ## Instruction: Prepare bounding box transform for Ellipse ## Code After: // Constants static const uint TOP_INDEX = 12; static const uint RIGHT_INDEX = 3; static const uint BOTTOM_INDEX = 6; static const uint LEFT_INDEX = 9; SketchItemEllipse::SketchItemEllipse(qreal x, qreal y) : SketchItemBezier(x, y) { addPath(QPointF(30, 0), QPointF(50, 20), QPointF(50, 50)); addPath(QPointF(50, 80), QPointF(30, 100), QPointF(0, 100)); addPath(QPointF(-40, 100), QPointF(-50, 80), QPointF(-50, 50)); addPath(QPointF(-40, 20), QPointF(-30, 0), QPointF(0, 0)); closePath(); mBoundingBox->updateRect(); } SketchItemEllipse::~SketchItemEllipse() { } void SketchItemEllipse::boundBoxPointMoved(BoundingBoxPoint::TranslationDirection direction, QPointF delta) { // because the path is closed, we don't have to // move the first item, the last is enough switch (direction) { default: qErrnoWarning("Unexpected TranslationDirection!"); break; } mBoundingBox->updateRect(direction); }
4b4b4e25c7c591ced4d1f6f6a767f814cffcb23f
README.md
README.md
hookly.js asset-pipeline provider/wrapper + connect to the Hookly API
1. Ruby wrapper for the Hookly API 2. hookly.js asset pipeline provider/wrapper Rails 3.1+ asset-pipeline gem to provide hookly.js #Setup Add to your Gemfile: ```ruby gem 'hookly-rails' ``` ###JS Setup Then add this to you application.js manifest: ```javascript //= require hookly ``` Then check out the [hookly.js docs](https://github.com/bnorton/hookly.js) for usage and working examples ###API Setup ```ruby # config/initializers/hookly.rb Hookly.token = '{{token}}' Hookly.secret = '{{secret}}' ``` ###Post a message to the #updates channel In the client javascript subscribe to '#updates' ```javascript hookly.setup('{{token}}') hookly.on('#updates', function(options) { // options == { model: 'Message', id: 5, text: 'Thanks for the info.' } }); ``` The push a new message the updates channel ```ruby Hookly::Channel.new('#updates').push(model: 'Message', id: 5, text: 'Thanks for the info.') #=> #<Hookly::Message id: '44fjwq-djas' slug: '#updates', data: { model: 'Message', id: 5, text: 'Thanks for the info.' }> ``` ###Post a **private** message Have information that only a certain user should see?? Include a unique user id on the client and server ```javascript hookly.setup('{{token}}', '{{uid}}') hookly.on('#updates', function(options) { // options == { model: 'Message', id: 6, text: 'Thanks for the PRIVATE info.' } }); ``` ```ruby Hookly::Channel.new('#updates', uid: '{{uid}}').push(model: 'Message', id: 6, text: 'Thanks for the PRIVATE info.') #=> #<Hookly::Message id: '44fjwq-djas' slug: '#updates', uid: '{{uid}}' data: { model: 'Message', id: 6, text: 'Thanks for the PRIVATE info.' }> ``` <!--- Not yet implemented ###Message buffering / caching A channel can be setup to buffer messages and deliver them when a user comes online. Simply create a buffered channel, messages will be cached for 60 minutes following their receipt ```ruby Hookly::Channel.create(buffer: 3600) ``` -->
Add information on how to make your first realtime push.
Add information on how to make your first realtime push.
Markdown
mit
bnorton/hookly-rails
markdown
## Code Before: hookly.js asset-pipeline provider/wrapper + connect to the Hookly API ## Instruction: Add information on how to make your first realtime push. ## Code After: 1. Ruby wrapper for the Hookly API 2. hookly.js asset pipeline provider/wrapper Rails 3.1+ asset-pipeline gem to provide hookly.js #Setup Add to your Gemfile: ```ruby gem 'hookly-rails' ``` ###JS Setup Then add this to you application.js manifest: ```javascript //= require hookly ``` Then check out the [hookly.js docs](https://github.com/bnorton/hookly.js) for usage and working examples ###API Setup ```ruby # config/initializers/hookly.rb Hookly.token = '{{token}}' Hookly.secret = '{{secret}}' ``` ###Post a message to the #updates channel In the client javascript subscribe to '#updates' ```javascript hookly.setup('{{token}}') hookly.on('#updates', function(options) { // options == { model: 'Message', id: 5, text: 'Thanks for the info.' } }); ``` The push a new message the updates channel ```ruby Hookly::Channel.new('#updates').push(model: 'Message', id: 5, text: 'Thanks for the info.') #=> #<Hookly::Message id: '44fjwq-djas' slug: '#updates', data: { model: 'Message', id: 5, text: 'Thanks for the info.' }> ``` ###Post a **private** message Have information that only a certain user should see?? Include a unique user id on the client and server ```javascript hookly.setup('{{token}}', '{{uid}}') hookly.on('#updates', function(options) { // options == { model: 'Message', id: 6, text: 'Thanks for the PRIVATE info.' } }); ``` ```ruby Hookly::Channel.new('#updates', uid: '{{uid}}').push(model: 'Message', id: 6, text: 'Thanks for the PRIVATE info.') #=> #<Hookly::Message id: '44fjwq-djas' slug: '#updates', uid: '{{uid}}' data: { model: 'Message', id: 6, text: 'Thanks for the PRIVATE info.' }> ``` <!--- Not yet implemented ###Message buffering / caching A channel can be setup to buffer messages and deliver them when a user comes online. Simply create a buffered channel, messages will be cached for 60 minutes following their receipt ```ruby Hookly::Channel.create(buffer: 3600) ``` -->
7cae2101a7c4f037ec3c51fd66410237203abccd
ansible/roles/devstack-packages-prerequisites/tasks/main.yaml
ansible/roles/devstack-packages-prerequisites/tasks/main.yaml
--- - name: upgrade dnf dnf: name=dnf state=latest - name: dnf update dnf: name='*' state=latest - name: install basic tools dnf: name={{item}} state=present with_items: - tmux - python-pip - vim-minimal - vim - xauth - tigervnc - git - python-ipython-console - the_silver_searcher - name: install kernel dev dnf: name=kernel-devel state=present - name: install python devel dnf: name={{item}} state=present with_items: - python-tox - python-subunit
--- - name: upgrade dnf dnf: name=dnf state=latest - name: dnf update dnf: name='*' state=latest - name: install basic tools dnf: name={{item}} state=present with_items: - tmux - python-pip - python2-tox - python3-tox - vim-minimal - vim - xauth - tigervnc - git - python-ipython-console - the_silver_searcher - name: install kernel dev dnf: name=kernel-devel state=present - name: install python devel dnf: name={{item}} state=present with_items: - python-tox - python-subunit
Add tox to ansible role
Add tox to ansible role
YAML
mit
jhamhader/sojourn
yaml
## Code Before: --- - name: upgrade dnf dnf: name=dnf state=latest - name: dnf update dnf: name='*' state=latest - name: install basic tools dnf: name={{item}} state=present with_items: - tmux - python-pip - vim-minimal - vim - xauth - tigervnc - git - python-ipython-console - the_silver_searcher - name: install kernel dev dnf: name=kernel-devel state=present - name: install python devel dnf: name={{item}} state=present with_items: - python-tox - python-subunit ## Instruction: Add tox to ansible role ## Code After: --- - name: upgrade dnf dnf: name=dnf state=latest - name: dnf update dnf: name='*' state=latest - name: install basic tools dnf: name={{item}} state=present with_items: - tmux - python-pip - python2-tox - python3-tox - vim-minimal - vim - xauth - tigervnc - git - python-ipython-console - the_silver_searcher - name: install kernel dev dnf: name=kernel-devel state=present - name: install python devel dnf: name={{item}} state=present with_items: - python-tox - python-subunit
fe21322b2bf174567e2fa491453b6ea15e6aec9a
README.md
README.md
[Squoosh] is an image compression web app that provides lossless image quality with a significant reduction to file size. # API & CLI Squoosh has [an API](https://github.com/GoogleChromeLabs/squoosh/tree/dev/libsquoosh) and [a CLI](https://github.com/GoogleChromeLabs/squoosh/tree/dev/cli) to compress many images at once. # Privacy Squoosh does not send your image to a server. All image compression processes locally. However, Squoosh utilizes Google Analytics to collect the following: - [Basic visitor data](https://support.google.com/analytics/answer/6004245?ref_topic=2919631). - The before and after image size value. - If Squoosh CLI, the type of Squoosh installation. - If Squoosh CLI, the installation time and date. # Developing To develop for Squoosh, use the following: 1. Clone the repository 1. Install node packages, by running: ```sh npm install ``` 1. Build the app, by running: ```sh npm run build ``` 1. Start the development server, by running: ```sh npm run dev ``` # Contributing Squoosh is an open-source project that appreciates all community involvement. To contribute to the project, follow the [contribute guide](/CONTRIBUTING.md). [squoosh]: https://squoosh.app
[Squoosh] is an image compression web app that provides lossless image quality with a significant reduction to file size. # API & CLI Squoosh has [an API](https://github.com/GoogleChromeLabs/squoosh/tree/dev/libsquoosh) and [a CLI](https://github.com/GoogleChromeLabs/squoosh/tree/dev/cli) to compress many images at once. # Privacy Squoosh does not send your image to a server. All image compression processes locally. However, Squoosh utilizes Google Analytics to collect the following: - [Basic visitor data](https://support.google.com/analytics/answer/6004245?ref_topic=2919631). - The before and after image size value. - If Squoosh CLI, the type of Squoosh installation. - If Squoosh CLI, the installation time and date. # Developing To develop for Squoosh: 1. Clone the repository 1. To install node packages, run: ```sh npm install ``` 1. Then build the app by running: ```sh npm run build ``` 1. After building, start the development server by running: ```sh npm run dev ``` # Contributing Squoosh is an open-source project that appreciates all community involvement. To contribute to the project, follow the [contribute guide](/CONTRIBUTING.md). [squoosh]: https://squoosh.app
Update list of develop steps
[DOCS] Update list of develop steps
Markdown
apache-2.0
GoogleChromeLabs/squoosh,GoogleChromeLabs/squoosh,GoogleChromeLabs/squoosh,GoogleChromeLabs/squoosh,GoogleChromeLabs/squoosh,GoogleChromeLabs/squoosh
markdown
## Code Before: [Squoosh] is an image compression web app that provides lossless image quality with a significant reduction to file size. # API & CLI Squoosh has [an API](https://github.com/GoogleChromeLabs/squoosh/tree/dev/libsquoosh) and [a CLI](https://github.com/GoogleChromeLabs/squoosh/tree/dev/cli) to compress many images at once. # Privacy Squoosh does not send your image to a server. All image compression processes locally. However, Squoosh utilizes Google Analytics to collect the following: - [Basic visitor data](https://support.google.com/analytics/answer/6004245?ref_topic=2919631). - The before and after image size value. - If Squoosh CLI, the type of Squoosh installation. - If Squoosh CLI, the installation time and date. # Developing To develop for Squoosh, use the following: 1. Clone the repository 1. Install node packages, by running: ```sh npm install ``` 1. Build the app, by running: ```sh npm run build ``` 1. Start the development server, by running: ```sh npm run dev ``` # Contributing Squoosh is an open-source project that appreciates all community involvement. To contribute to the project, follow the [contribute guide](/CONTRIBUTING.md). [squoosh]: https://squoosh.app ## Instruction: [DOCS] Update list of develop steps ## Code After: [Squoosh] is an image compression web app that provides lossless image quality with a significant reduction to file size. # API & CLI Squoosh has [an API](https://github.com/GoogleChromeLabs/squoosh/tree/dev/libsquoosh) and [a CLI](https://github.com/GoogleChromeLabs/squoosh/tree/dev/cli) to compress many images at once. # Privacy Squoosh does not send your image to a server. All image compression processes locally. However, Squoosh utilizes Google Analytics to collect the following: - [Basic visitor data](https://support.google.com/analytics/answer/6004245?ref_topic=2919631). - The before and after image size value. - If Squoosh CLI, the type of Squoosh installation. - If Squoosh CLI, the installation time and date. # Developing To develop for Squoosh: 1. Clone the repository 1. To install node packages, run: ```sh npm install ``` 1. Then build the app by running: ```sh npm run build ``` 1. After building, start the development server by running: ```sh npm run dev ``` # Contributing Squoosh is an open-source project that appreciates all community involvement. To contribute to the project, follow the [contribute guide](/CONTRIBUTING.md). [squoosh]: https://squoosh.app
af737fae14d84666b4400d5e9de8c07440ef41cc
.github/PULL_REQUEST_TEMPLATE.md
.github/PULL_REQUEST_TEMPLATE.md
Please: - [ ] Make your pull request atomic, fixing one issue at a time unless there are many relevant issues that cannot be decoupled. - [ ] Provide a test case & update the documentation under `site/docs/` - [ ] Make lint and test pass. (Run `npm run lint`, `npm run test`, `npm run build:examples`.) - [ ] Make sure you have merged `master` into your branch. - [ ] Provide a concise title so that we can just copy it to our release note. - Use imperative mood and present tense. - Mention relevant issues. (e.g., `#1`)
Please: - [ ] Make your pull request atomic, fixing one issue at a time unless there are many relevant issues that cannot be decoupled. - [ ] Provide a test case & update the documentation under `site/docs/` - [ ] Make lint and test pass. (Run `npm run lint`, `npm run test`, `npm run build:examples`, `npm run test:runtime:generate`.) - [ ] Make sure you have merged `master` into your branch. - [ ] Provide a concise title so that we can just copy it to our release note. - Use imperative mood and present tense. - Mention relevant issues. (e.g., `#1`)
Update PR template to include test:runtime:generate task.
Update PR template to include test:runtime:generate task.
Markdown
bsd-3-clause
uwdata/vega-lite,vega/vega-lite,uwdata/vega-lite,vega/vega-lite,vega/vega-lite,vega/vega-lite,vega/vega-lite,uwdata/vega-lite,uwdata/vega-lite,uwdata/vega-lite
markdown
## Code Before: Please: - [ ] Make your pull request atomic, fixing one issue at a time unless there are many relevant issues that cannot be decoupled. - [ ] Provide a test case & update the documentation under `site/docs/` - [ ] Make lint and test pass. (Run `npm run lint`, `npm run test`, `npm run build:examples`.) - [ ] Make sure you have merged `master` into your branch. - [ ] Provide a concise title so that we can just copy it to our release note. - Use imperative mood and present tense. - Mention relevant issues. (e.g., `#1`) ## Instruction: Update PR template to include test:runtime:generate task. ## Code After: Please: - [ ] Make your pull request atomic, fixing one issue at a time unless there are many relevant issues that cannot be decoupled. - [ ] Provide a test case & update the documentation under `site/docs/` - [ ] Make lint and test pass. (Run `npm run lint`, `npm run test`, `npm run build:examples`, `npm run test:runtime:generate`.) - [ ] Make sure you have merged `master` into your branch. - [ ] Provide a concise title so that we can just copy it to our release note. - Use imperative mood and present tense. - Mention relevant issues. (e.g., `#1`)
60a6fba319301962c64a92c70d1b4a548c2b27e9
twinkles.js
twinkles.js
var TwinklingStar = new Class({ Extends: Star, initialize: function(options) { this.parent(options); if (this.brightness < 4) this.brightness = 4; this.color = "#eeeeee"; this.stepSeed = Math.random() * Math.PI; }, draw: function() { var x = cx(this.pos.x); var y = cy(this.pos.y); var brightness = this.brightness; brightness += Math.sin(FRAME * 0.3 + this.stepSeed); context.save(); context.fillStyle = this.color; context.beginPath(); context.moveTo(x - brightness, y); context.quadraticCurveTo(x, y, x, y - brightness); context.quadraticCurveTo(x, y, x + brightness, y); context.quadraticCurveTo(x, y, x, y + brightness); context.quadraticCurveTo(x, y, x - brightness, y); context.fill(); context.closePath(); context.restore(); this.update(); }, }); function makeTwinkles(locations) { var stars = []; var i = 0; stars = locations.map(function (coords) { return new TwinklingStar({ x: coords[0], y: coords[1], brightness: Math.random() * 3 + 4, }); }); return { draw: function () { Array.each(stars, function(star) { star.draw(); }); }, locations: locations, }; }
var TwinklingStar = new Class({ Extends: Star, initialize: function(options) { this.parent(options); if (this.brightness < 4) this.brightness = 4; this.color = "#eeeeee"; this.stepSeed = Math.random() * Math.PI; this.stepScale = Math.random() / 3; }, draw: function() { var x = cx(this.pos.x); var y = cy(this.pos.y); var brightness = this.brightness; brightness += Math.sin(FRAME * this.stepScale + this.stepSeed); context.save(); context.fillStyle = this.color; context.beginPath(); context.moveTo(x - brightness, y); context.quadraticCurveTo(x, y, x, y - brightness); context.quadraticCurveTo(x, y, x + brightness, y); context.quadraticCurveTo(x, y, x, y + brightness); context.quadraticCurveTo(x, y, x - brightness, y); context.fill(); context.closePath(); context.restore(); this.update(); }, }); function makeTwinkles(locations) { var stars = []; var i = 0; stars = locations.map(function (coords) { return new TwinklingStar({ x: coords[0], y: coords[1], brightness: Math.random() * 3 + 4, }); }); return { draw: function () { Array.each(stars, function(star) { star.draw(); }); }, locations: locations, }; }
Put a bunch of stars together, and you can see that they twinkle at the same rate.
Put a bunch of stars together, and you can see that they twinkle at the same rate.
JavaScript
artistic-2.0
alloy-d/canvas51,alloy-d/canvas51
javascript
## Code Before: var TwinklingStar = new Class({ Extends: Star, initialize: function(options) { this.parent(options); if (this.brightness < 4) this.brightness = 4; this.color = "#eeeeee"; this.stepSeed = Math.random() * Math.PI; }, draw: function() { var x = cx(this.pos.x); var y = cy(this.pos.y); var brightness = this.brightness; brightness += Math.sin(FRAME * 0.3 + this.stepSeed); context.save(); context.fillStyle = this.color; context.beginPath(); context.moveTo(x - brightness, y); context.quadraticCurveTo(x, y, x, y - brightness); context.quadraticCurveTo(x, y, x + brightness, y); context.quadraticCurveTo(x, y, x, y + brightness); context.quadraticCurveTo(x, y, x - brightness, y); context.fill(); context.closePath(); context.restore(); this.update(); }, }); function makeTwinkles(locations) { var stars = []; var i = 0; stars = locations.map(function (coords) { return new TwinklingStar({ x: coords[0], y: coords[1], brightness: Math.random() * 3 + 4, }); }); return { draw: function () { Array.each(stars, function(star) { star.draw(); }); }, locations: locations, }; } ## Instruction: Put a bunch of stars together, and you can see that they twinkle at the same rate. ## Code After: var TwinklingStar = new Class({ Extends: Star, initialize: function(options) { this.parent(options); if (this.brightness < 4) this.brightness = 4; this.color = "#eeeeee"; this.stepSeed = Math.random() * Math.PI; this.stepScale = Math.random() / 3; }, draw: function() { var x = cx(this.pos.x); var y = cy(this.pos.y); var brightness = this.brightness; brightness += Math.sin(FRAME * this.stepScale + this.stepSeed); context.save(); context.fillStyle = this.color; context.beginPath(); context.moveTo(x - brightness, y); context.quadraticCurveTo(x, y, x, y - brightness); context.quadraticCurveTo(x, y, x + brightness, y); context.quadraticCurveTo(x, y, x, y + brightness); context.quadraticCurveTo(x, y, x - brightness, y); context.fill(); context.closePath(); context.restore(); this.update(); }, }); function makeTwinkles(locations) { var stars = []; var i = 0; stars = locations.map(function (coords) { return new TwinklingStar({ x: coords[0], y: coords[1], brightness: Math.random() * 3 + 4, }); }); return { draw: function () { Array.each(stars, function(star) { star.draw(); }); }, locations: locations, }; }
bd91b1f980fe0ceeae14b9368e7838c11449e2fb
tests/CMakeLists.txt
tests/CMakeLists.txt
FIND_PACKAGE(Boost 1.55 COMPONENTS unit_test_framework thread regex serialization REQUIRED) add_executable(utils_test utils_test.cpp) target_link_libraries(utils_test utils ${Boost_LIBRARIES} log4cplus) ADD_TEST(utils_test ${EXECUTABLE_OUTPUT_PATH}/utils_test --log_format=XML --log_sink=results_utils_test.xml --log_level=all --report_level=no) add_executable(csvreader_test csvreader_test.cpp) target_link_libraries(csvreader_test utils ${Boost_LIBRARIES} log4cplus) ADD_TEST(csvreader_test ${EXECUTABLE_OUTPUT_PATH}/csvreader_test --log_format=XML --log_sink=results_utils_test.xml --log_level=all --report_level=no) add_executable(lru_test lru_test.cpp) target_link_libraries(lru_test ${Boost_LIBRARIES} log4cplus) add_boost_test(lru_test) add_executable(idx_map_test idx_map_test.cpp) target_link_libraries(idx_map_test ${Boost_LIBRARIES} log4cplus) add_boost_test(idx_map_test) add_executable(multi_obj_pool_test multi_obj_pool_test.cpp) target_link_libraries(multi_obj_pool_test utils ${Boost_LIBRARIES} log4cplus) add_boost_test(multi_obj_pool_test) add_executable(obj_factory_test obj_factory_test.cpp) target_link_libraries(obj_factory_test utils ${Boost_LIBRARIES} log4cplus) add_boost_test(obj_factory_test)
FIND_PACKAGE(Boost 1.55 COMPONENTS unit_test_framework thread regex serialization REQUIRED) add_executable(utils_test utils_test.cpp) target_link_libraries(utils_test utils ${Boost_LIBRARIES} log4cplus) add_boost_test(utils_test) add_executable(csvreader_test csvreader_test.cpp) target_link_libraries(csvreader_test utils ${Boost_LIBRARIES} log4cplus) add_boost_test(csvreader_test) add_executable(lru_test lru_test.cpp) target_link_libraries(lru_test ${Boost_LIBRARIES} log4cplus) add_boost_test(lru_test) add_executable(idx_map_test idx_map_test.cpp) target_link_libraries(idx_map_test ${Boost_LIBRARIES} log4cplus) add_boost_test(idx_map_test) add_executable(multi_obj_pool_test multi_obj_pool_test.cpp) target_link_libraries(multi_obj_pool_test utils ${Boost_LIBRARIES} log4cplus) add_boost_test(multi_obj_pool_test) add_executable(obj_factory_test obj_factory_test.cpp) target_link_libraries(obj_factory_test utils ${Boost_LIBRARIES} log4cplus) add_boost_test(obj_factory_test)
Use boost macro test for all tests
Use boost macro test for all tests
Text
agpl-3.0
CanalTP/utils,CanalTP/utils
text
## Code Before: FIND_PACKAGE(Boost 1.55 COMPONENTS unit_test_framework thread regex serialization REQUIRED) add_executable(utils_test utils_test.cpp) target_link_libraries(utils_test utils ${Boost_LIBRARIES} log4cplus) ADD_TEST(utils_test ${EXECUTABLE_OUTPUT_PATH}/utils_test --log_format=XML --log_sink=results_utils_test.xml --log_level=all --report_level=no) add_executable(csvreader_test csvreader_test.cpp) target_link_libraries(csvreader_test utils ${Boost_LIBRARIES} log4cplus) ADD_TEST(csvreader_test ${EXECUTABLE_OUTPUT_PATH}/csvreader_test --log_format=XML --log_sink=results_utils_test.xml --log_level=all --report_level=no) add_executable(lru_test lru_test.cpp) target_link_libraries(lru_test ${Boost_LIBRARIES} log4cplus) add_boost_test(lru_test) add_executable(idx_map_test idx_map_test.cpp) target_link_libraries(idx_map_test ${Boost_LIBRARIES} log4cplus) add_boost_test(idx_map_test) add_executable(multi_obj_pool_test multi_obj_pool_test.cpp) target_link_libraries(multi_obj_pool_test utils ${Boost_LIBRARIES} log4cplus) add_boost_test(multi_obj_pool_test) add_executable(obj_factory_test obj_factory_test.cpp) target_link_libraries(obj_factory_test utils ${Boost_LIBRARIES} log4cplus) add_boost_test(obj_factory_test) ## Instruction: Use boost macro test for all tests ## Code After: FIND_PACKAGE(Boost 1.55 COMPONENTS unit_test_framework thread regex serialization REQUIRED) add_executable(utils_test utils_test.cpp) target_link_libraries(utils_test utils ${Boost_LIBRARIES} log4cplus) add_boost_test(utils_test) add_executable(csvreader_test csvreader_test.cpp) target_link_libraries(csvreader_test utils ${Boost_LIBRARIES} log4cplus) add_boost_test(csvreader_test) add_executable(lru_test lru_test.cpp) target_link_libraries(lru_test ${Boost_LIBRARIES} log4cplus) add_boost_test(lru_test) add_executable(idx_map_test idx_map_test.cpp) target_link_libraries(idx_map_test ${Boost_LIBRARIES} log4cplus) add_boost_test(idx_map_test) add_executable(multi_obj_pool_test multi_obj_pool_test.cpp) target_link_libraries(multi_obj_pool_test utils ${Boost_LIBRARIES} log4cplus) add_boost_test(multi_obj_pool_test) add_executable(obj_factory_test obj_factory_test.cpp) target_link_libraries(obj_factory_test utils ${Boost_LIBRARIES} log4cplus) add_boost_test(obj_factory_test)
a3d4cfe1c62c417f15bfc20c4d9a3fa11910baeb
README.md
README.md
Did you ever wish you could make scatter plots with cat shaped points? Now you can! Go ahead, treat yourself! There's over 10 cat models now! git clone the repo and install using: ``` R CMD INSTALL CatterPlot ``` In R: ``` library(CatterPlot) x <- 1:10 y <- 1:10 catplot(x,y,0.1) catplot(x,y^2,0.1) catplot(x^2,y,0.1) ``` NEW cat modes coming soon!
Did you ever wish you could make scatter plots with cat shaped points? Now you can! Go ahead, treat yourself! There's over 10 cat models now! To install, either: ``` library(devtools) install_github("Gibbsdavidl/CatterPlot") ``` Or git clone the repo and then install using: ``` R CMD INSTALL CatterPlot ``` In R: ``` library(CatterPlot) x <- 1:10 y <- 1:10 catplot(x,y,0.1) catplot(x,y^2,0.1) catplot(x^2,y,0.1) ``` NEW cat modes coming soon!
Add instructions for install via devtools.
Add instructions for install via devtools.
Markdown
apache-2.0
Binhnguen1512/CatterPlots,Gibbsdavidl/CatterPlots
markdown
## Code Before: Did you ever wish you could make scatter plots with cat shaped points? Now you can! Go ahead, treat yourself! There's over 10 cat models now! git clone the repo and install using: ``` R CMD INSTALL CatterPlot ``` In R: ``` library(CatterPlot) x <- 1:10 y <- 1:10 catplot(x,y,0.1) catplot(x,y^2,0.1) catplot(x^2,y,0.1) ``` NEW cat modes coming soon! ## Instruction: Add instructions for install via devtools. ## Code After: Did you ever wish you could make scatter plots with cat shaped points? Now you can! Go ahead, treat yourself! There's over 10 cat models now! To install, either: ``` library(devtools) install_github("Gibbsdavidl/CatterPlot") ``` Or git clone the repo and then install using: ``` R CMD INSTALL CatterPlot ``` In R: ``` library(CatterPlot) x <- 1:10 y <- 1:10 catplot(x,y,0.1) catplot(x,y^2,0.1) catplot(x^2,y,0.1) ``` NEW cat modes coming soon!
2735effc6ecb7ef47371cc5ac42871cb33464694
doc/src/terms.md
doc/src/terms.md
Term detectors ==================== Lift and translate epimorphisms - Address term (auipc) - Constant term (lui/shift/add/sub) - Nop (many nop encodings) - Useless branch term (branch to next, branch to branch) - Spin term detection (unconditional jump to self) - Implicit Function continuation term (branch target) - Function ABI lift - Epilog/Prolog detection - Stack spill term (translate into SSA form) - Rotate (sub/shift/shift/or) -,>>,<<,| -> >>>,<<< - Predication (lift branches; many forms of predication) - Coalescing of li,sb byte stores into large movabsq stores - Loop induction variable detection - Coalescing of load or store plus addi into move base + index * scale - Coalescing of load or store plus constant add into move base + index * scale - Coalescing of load or store plus constant mul into move base + index * scale
Term detectors ==================== Lift and translate epimorphisms - Address term (auipc) - Constant term (lui/shift/add/sub) - Nop (many nop encodings) - Useless branch term (branch to next, branch to branch) - Spin term detection (unconditional jump to self) - Implicit Function continuation term (branch target) - Call lift - AUIPC,JALR and JAL relaxation - Function ABI lift - Epilog/Prolog detection - Stack spill term (translate into SSA form) - Rotate (sub/shift/shift/or) -,>>,<<,| -> >>>,<<< - Predication (lift branches; many forms of predication) - Coalescing of li,sb byte stores into large movabsq stores - Loop induction variable detection - Coalescing of load or store plus addi into move base + index * scale - Coalescing of load or store plus constant add into move base + index * scale - Coalescing of load or store plus constant mul into move base + index * scale
Add call lift to term detectors
Add call lift to term detectors
Markdown
mit
rv8-io/rv8,rv8-io/rv8,rv8-io/rv8
markdown
## Code Before: Term detectors ==================== Lift and translate epimorphisms - Address term (auipc) - Constant term (lui/shift/add/sub) - Nop (many nop encodings) - Useless branch term (branch to next, branch to branch) - Spin term detection (unconditional jump to self) - Implicit Function continuation term (branch target) - Function ABI lift - Epilog/Prolog detection - Stack spill term (translate into SSA form) - Rotate (sub/shift/shift/or) -,>>,<<,| -> >>>,<<< - Predication (lift branches; many forms of predication) - Coalescing of li,sb byte stores into large movabsq stores - Loop induction variable detection - Coalescing of load or store plus addi into move base + index * scale - Coalescing of load or store plus constant add into move base + index * scale - Coalescing of load or store plus constant mul into move base + index * scale ## Instruction: Add call lift to term detectors ## Code After: Term detectors ==================== Lift and translate epimorphisms - Address term (auipc) - Constant term (lui/shift/add/sub) - Nop (many nop encodings) - Useless branch term (branch to next, branch to branch) - Spin term detection (unconditional jump to self) - Implicit Function continuation term (branch target) - Call lift - AUIPC,JALR and JAL relaxation - Function ABI lift - Epilog/Prolog detection - Stack spill term (translate into SSA form) - Rotate (sub/shift/shift/or) -,>>,<<,| -> >>>,<<< - Predication (lift branches; many forms of predication) - Coalescing of li,sb byte stores into large movabsq stores - Loop induction variable detection - Coalescing of load or store plus addi into move base + index * scale - Coalescing of load or store plus constant add into move base + index * scale - Coalescing of load or store plus constant mul into move base + index * scale
4785a5e8d639dea1a9cf767d2c77f6bd9dbe2433
leapp/cli/upgrade/__init__.py
leapp/cli/upgrade/__init__.py
from leapp.utils.clicmd import command, command_opt from leapp.repository.scan import find_and_scan_repositories from leapp.config import get_config from leapp.logger import configure_logger def load_repositories_from(name, repo_path, manager=None): if get_config().has_option('repositories', name): repo_path = get_config().get('repositories', name) return find_and_scan_repositories(repo_path, manager=manager) def load_repositories(): load_repositories_from('custom_repo_path', '/etc/leapp/repos.d/', manager=None) manager.load() return manager @command('upgrade', help='') @command_opt('resume', is_flag=True, help='Continue the last execution after it was stopped (e.g. after reboot)') def upgrade(args): configure_logger() repositories = load_repositories() workflow = repositories.lookup_workflow('IPUWorkflow') workflow.run()
from leapp.utils.clicmd import command, command_opt from leapp.repository.scan import find_and_scan_repositories from leapp.config import get_config from leapp.logger import configure_logger def load_repositories_from(name, repo_path, manager=None): if get_config().has_option('repositories', name): repo_path = get_config().get('repositories', name) return find_and_scan_repositories(repo_path, manager=manager) def load_repositories(): manager = load_repositories_from('custom_repo_path', '/etc/leapp/repos.d/', manager=None) manager.load() return manager @command('upgrade', help='') @command_opt('resume', is_flag=True, help='Continue the last execution after it was stopped (e.g. after reboot)') def upgrade(args): configure_logger() repositories = load_repositories() workflow = repositories.lookup_workflow('IPUWorkflow') workflow.run()
Add back missing manager creation
leapp: Add back missing manager creation
Python
lgpl-2.1
leapp-to/prototype,vinzenz/prototype,leapp-to/prototype,vinzenz/prototype,vinzenz/prototype,leapp-to/prototype,vinzenz/prototype,leapp-to/prototype
python
## Code Before: from leapp.utils.clicmd import command, command_opt from leapp.repository.scan import find_and_scan_repositories from leapp.config import get_config from leapp.logger import configure_logger def load_repositories_from(name, repo_path, manager=None): if get_config().has_option('repositories', name): repo_path = get_config().get('repositories', name) return find_and_scan_repositories(repo_path, manager=manager) def load_repositories(): load_repositories_from('custom_repo_path', '/etc/leapp/repos.d/', manager=None) manager.load() return manager @command('upgrade', help='') @command_opt('resume', is_flag=True, help='Continue the last execution after it was stopped (e.g. after reboot)') def upgrade(args): configure_logger() repositories = load_repositories() workflow = repositories.lookup_workflow('IPUWorkflow') workflow.run() ## Instruction: leapp: Add back missing manager creation ## Code After: from leapp.utils.clicmd import command, command_opt from leapp.repository.scan import find_and_scan_repositories from leapp.config import get_config from leapp.logger import configure_logger def load_repositories_from(name, repo_path, manager=None): if get_config().has_option('repositories', name): repo_path = get_config().get('repositories', name) return find_and_scan_repositories(repo_path, manager=manager) def load_repositories(): manager = load_repositories_from('custom_repo_path', '/etc/leapp/repos.d/', manager=None) manager.load() return manager @command('upgrade', help='') @command_opt('resume', is_flag=True, help='Continue the last execution after it was stopped (e.g. after reboot)') def upgrade(args): configure_logger() repositories = load_repositories() workflow = repositories.lookup_workflow('IPUWorkflow') workflow.run()
3f6b75281fc9d815bccf45a1f2f0cb309abe658b
test/ufront/log/MessageTest.hx
test/ufront/log/MessageTest.hx
package ufront.log; import utest.Assert; import ufront.log.Message; class MessageTest { var instance:Message; public function new() { } public function beforeClass():Void {} public function afterClass():Void {} public function setup():Void {} public function teardown():Void {} public function testExample():Void { } }
package ufront.log; import utest.Assert; import ufront.log.Message; class MessageTest { public function new() { } public function beforeClass():Void {} public function afterClass():Void {} public function setup():Void {} public function teardown():Void {} public function testMessageList():Void { var message1 = createMessage( "Hello Theo", Trace ); var message2 = createMessage( 400, Error ); var emptyMessageList = new MessageList(); emptyMessageList.push( message1 ); emptyMessageList.push( message2 ); var messageArray1 = []; var messageArray2 = []; function onMessageFn(m:Message) messageArray2.push(m); var messageList = new MessageList( messageArray1, onMessageFn ); Assert.equals( messageArray1, messageList.messages ); Assert.equals( onMessageFn, messageList.onMessage ); messageList.push( message1 ); Assert.equals( 1, messageArray1.length ); Assert.equals( 1, messageArray2.length ); messageList.push( message2 ); Assert.equals( 2, messageArray1.length ); Assert.equals( 2, messageArray2.length ); Assert.equals( "Hello Theo", messageArray1[0].msg ); Assert.equals( Error, messageArray2[1].type ); } function createMessage( msg:Dynamic, type:MessageType, ?pos:haxe.PosInfos ) { return { msg: msg, pos: pos, type: type }; } }
Add tests for Message / MessageList
Add tests for Message / MessageList
Haxe
mit
ufront/ufront-mvc,kevinresol/ufront-mvc,ufront/ufront-mvc,kevinresol/ufront-mvc
haxe
## Code Before: package ufront.log; import utest.Assert; import ufront.log.Message; class MessageTest { var instance:Message; public function new() { } public function beforeClass():Void {} public function afterClass():Void {} public function setup():Void {} public function teardown():Void {} public function testExample():Void { } } ## Instruction: Add tests for Message / MessageList ## Code After: package ufront.log; import utest.Assert; import ufront.log.Message; class MessageTest { public function new() { } public function beforeClass():Void {} public function afterClass():Void {} public function setup():Void {} public function teardown():Void {} public function testMessageList():Void { var message1 = createMessage( "Hello Theo", Trace ); var message2 = createMessage( 400, Error ); var emptyMessageList = new MessageList(); emptyMessageList.push( message1 ); emptyMessageList.push( message2 ); var messageArray1 = []; var messageArray2 = []; function onMessageFn(m:Message) messageArray2.push(m); var messageList = new MessageList( messageArray1, onMessageFn ); Assert.equals( messageArray1, messageList.messages ); Assert.equals( onMessageFn, messageList.onMessage ); messageList.push( message1 ); Assert.equals( 1, messageArray1.length ); Assert.equals( 1, messageArray2.length ); messageList.push( message2 ); Assert.equals( 2, messageArray1.length ); Assert.equals( 2, messageArray2.length ); Assert.equals( "Hello Theo", messageArray1[0].msg ); Assert.equals( Error, messageArray2[1].type ); } function createMessage( msg:Dynamic, type:MessageType, ?pos:haxe.PosInfos ) { return { msg: msg, pos: pos, type: type }; } }
bfe27e738051d697974e2846cfcf1e8430c9816c
README.md
README.md
HarmacenCloud ============= Gestión de un almacén
HarmacenCloud ============= Gestión de un almacén ## Componentes del equipo - David González Sola
Update Readme with teammembers section
Update Readme with teammembers section
Markdown
apache-2.0
HarmaDev/HarmacenCloud,HarmaDev/HarmacenCloud
markdown
## Code Before: HarmacenCloud ============= Gestión de un almacén ## Instruction: Update Readme with teammembers section ## Code After: HarmacenCloud ============= Gestión de un almacén ## Componentes del equipo - David González Sola
9120adf70f7df0f441ba3eed2ce09e2075cec07e
src/tools.cr
src/tools.cr
require "progress" struct Number def times_with_progress(&block) bar = ProgressBar.new bar.total = self bar.incomplete = "." bar.complete = "o" self.times do |i| yield i bar.inc end end {% for method in %w(upto downto) %} def {{ method.id }}_with_progress(hdl) bar = ProgressBar.new bar.total = self bar.incomplete = "." bar.complete = "o" self.times do |i| yield i bar.inc end end {% end %} end class Timers property? start : Time property? finish : Time def initialize @start = Time.now @finish = Time.now end def start @start = Time.now end def stop @finish = Time.now end def stats duration = @finish - @start return "Start: #{@start} Finish: #{@finish} Duration: #{duration.to_s}" end end
require "progress" struct Number def times_with_progress(&block) bar = ProgressBar.new bar.total = self bar.incomplete = "." bar.complete = "o" self.times do |i| yield i bar.inc end end {% for method in %w(upto downto) %} def {{ method.id }}_with_progress(num) bar = ProgressBar.new bar.total = self bar.incomplete = "." bar.complete = "o" self.{{ method.id }}(num) do |i| yield i bar.inc end end {% end %} end class Timers property? start : Time property? finish : Time def initialize @start = Time.now @finish = Time.now end def start @start = Time.now end def stop @finish = Time.now end def stats duration = @finish - @start return "Start: #{@start} Finish: #{@finish} Duration: #{duration.to_s}" end end
Fix for upto / downto
Fix for upto / downto
Crystal
mit
puppetpies/crystal-monetdb-libmapi
crystal
## Code Before: require "progress" struct Number def times_with_progress(&block) bar = ProgressBar.new bar.total = self bar.incomplete = "." bar.complete = "o" self.times do |i| yield i bar.inc end end {% for method in %w(upto downto) %} def {{ method.id }}_with_progress(hdl) bar = ProgressBar.new bar.total = self bar.incomplete = "." bar.complete = "o" self.times do |i| yield i bar.inc end end {% end %} end class Timers property? start : Time property? finish : Time def initialize @start = Time.now @finish = Time.now end def start @start = Time.now end def stop @finish = Time.now end def stats duration = @finish - @start return "Start: #{@start} Finish: #{@finish} Duration: #{duration.to_s}" end end ## Instruction: Fix for upto / downto ## Code After: require "progress" struct Number def times_with_progress(&block) bar = ProgressBar.new bar.total = self bar.incomplete = "." bar.complete = "o" self.times do |i| yield i bar.inc end end {% for method in %w(upto downto) %} def {{ method.id }}_with_progress(num) bar = ProgressBar.new bar.total = self bar.incomplete = "." bar.complete = "o" self.{{ method.id }}(num) do |i| yield i bar.inc end end {% end %} end class Timers property? start : Time property? finish : Time def initialize @start = Time.now @finish = Time.now end def start @start = Time.now end def stop @finish = Time.now end def stats duration = @finish - @start return "Start: #{@start} Finish: #{@finish} Duration: #{duration.to_s}" end end
fedf771275258cf333371406146dbbb8f7c8ae56
config/prisons/WYI-wetherby.yml
config/prisons/WYI-wetherby.yml
--- name: Wetherby nomis_id: WYI address: - York Road - 'LS22 5ED ' email: [email protected] enabled: true estate: Wetherby phone: 01937 544207 slots: wed: - 1830-2000 sat: - 0930-1130 - 1430-1630 sun: - 0930-1130 - 1430-1630 unbookable: - 2014-12-25
--- name: Wetherby nomis_id: WYI address: - York Road - 'LS22 5ED ' email: [email protected] enabled: true estate: Wetherby phone: 01937 544207 slot_anomalies: 2015-12-24: - 1430-1630 2015-12-28: - 1430-1630 2015-12-31: - 1430-1630 2016-01-01: - 1430-1630 slots: wed: - 1830-2000 sat: - 0930-1130 - 1430-1630 sun: - 0930-1130 - 1430-1630 unbookable: - 2014-12-25 - 2015-12-25
Update Wetherby Christmas visit slots
Update Wetherby Christmas visit slots Unbookable - Christmas Day Additional slots - 24th, 28th, 31st Dec and 1st Jan 1430-1630
YAML
mit
ministryofjustice/prison-visits,ministryofjustice/prison-visits,ministryofjustice/prison-visits
yaml
## Code Before: --- name: Wetherby nomis_id: WYI address: - York Road - 'LS22 5ED ' email: [email protected] enabled: true estate: Wetherby phone: 01937 544207 slots: wed: - 1830-2000 sat: - 0930-1130 - 1430-1630 sun: - 0930-1130 - 1430-1630 unbookable: - 2014-12-25 ## Instruction: Update Wetherby Christmas visit slots Unbookable - Christmas Day Additional slots - 24th, 28th, 31st Dec and 1st Jan 1430-1630 ## Code After: --- name: Wetherby nomis_id: WYI address: - York Road - 'LS22 5ED ' email: [email protected] enabled: true estate: Wetherby phone: 01937 544207 slot_anomalies: 2015-12-24: - 1430-1630 2015-12-28: - 1430-1630 2015-12-31: - 1430-1630 2016-01-01: - 1430-1630 slots: wed: - 1830-2000 sat: - 0930-1130 - 1430-1630 sun: - 0930-1130 - 1430-1630 unbookable: - 2014-12-25 - 2015-12-25
e7afc1ccf85baf54772493288074122bb1042f93
lcd_ticker.py
lcd_ticker.py
"""Display stock quotes on LCD""" from ystockquote import get_price, get_change from lcd import lcd_string, tn symbols = ['AAPL', 'MSFT', 'F', 'T', 'KO', 'GOOG', 'SYK', 'DIS', 'GM', 'GE', 'BAC', 'IBM', 'C', 'AMZN', 'AET', 'DOW', 'INTC', 'PFE', 'MRK', 'RTN'] while(True): for s in symbols: try: ticker_string = s + ' ' + get_price(s) + ' ' + get_change(s) + ' ' except KeyboardInterrupt: break lcd_string(ticker_string, tn)
"""Display stock quotes on LCD""" import ystockquote as y from lcd import lcd_string, tn symbols = ['AAPL', 'MSFT', 'F', 'T', 'KO', 'GOOG', 'SYK', 'DIS', 'GM', 'GE', 'BAC', 'IBM', 'C', 'AMZN', 'AET', 'DOW', 'INTC', 'PFE', 'MRK', 'RTN'] def compact_quote(symbol): symbol = 'SYK' a = y.get_all(symbol) L52 = int(round(float(a['fifty_two_week_low']), 0)) P = round(float(a['price']), 1) C = a['change'] H52 = int(round(float(a['fifty_two_week_high']), 0)) PE = round(float(a['price_earnings_ratio']), 1) Cp = int(round(float(C) / float(P) * 100)) return '{} {} {}% [{} {}] PE {}'.format(symbol, P, Cp, L52, H52, PE) while(True): try: for s in symbols: lcd_string(compact_quote(s), tn) except KeyboardInterrupt: break
Move compact_quote() to main LCD ticker file.
Move compact_quote() to main LCD ticker file.
Python
mit
zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie
python
## Code Before: """Display stock quotes on LCD""" from ystockquote import get_price, get_change from lcd import lcd_string, tn symbols = ['AAPL', 'MSFT', 'F', 'T', 'KO', 'GOOG', 'SYK', 'DIS', 'GM', 'GE', 'BAC', 'IBM', 'C', 'AMZN', 'AET', 'DOW', 'INTC', 'PFE', 'MRK', 'RTN'] while(True): for s in symbols: try: ticker_string = s + ' ' + get_price(s) + ' ' + get_change(s) + ' ' except KeyboardInterrupt: break lcd_string(ticker_string, tn) ## Instruction: Move compact_quote() to main LCD ticker file. ## Code After: """Display stock quotes on LCD""" import ystockquote as y from lcd import lcd_string, tn symbols = ['AAPL', 'MSFT', 'F', 'T', 'KO', 'GOOG', 'SYK', 'DIS', 'GM', 'GE', 'BAC', 'IBM', 'C', 'AMZN', 'AET', 'DOW', 'INTC', 'PFE', 'MRK', 'RTN'] def compact_quote(symbol): symbol = 'SYK' a = y.get_all(symbol) L52 = int(round(float(a['fifty_two_week_low']), 0)) P = round(float(a['price']), 1) C = a['change'] H52 = int(round(float(a['fifty_two_week_high']), 0)) PE = round(float(a['price_earnings_ratio']), 1) Cp = int(round(float(C) / float(P) * 100)) return '{} {} {}% [{} {}] PE {}'.format(symbol, P, Cp, L52, H52, PE) while(True): try: for s in symbols: lcd_string(compact_quote(s), tn) except KeyboardInterrupt: break
3ff24c90c9f50c849ea22e7d2d0a5fa11d1e777a
examples/hello-world.py
examples/hello-world.py
from glumpy import app, gl, gloo, glm, data, text window = app.Window(width=512, height=512) @window.event def on_draw(dt): window.clear() label.draw(x=256, y=256, color=(1,1,1,1)) font = text.TextureFont(data.get("OpenSans-Regular.ttf"), 64) label = text.Label("Hello World !", font, anchor_x = 'center', anchor_y = 'center') app.run()
from glumpy import app, gl, gloo, glm, data from glumpy.graphics.text import FontManager from glumpy.graphics.collections import GlyphCollection from glumpy.transforms import Position, OrthographicProjection window = app.Window(width=512, height=512) @window.event def on_draw(dt): window.clear() label.draw() x,y,z = 256,256,0 font = FontManager.get("OpenSans-Regular.ttf", 64, mode='agg') label = GlyphCollection('agg', transform=OrthographicProjection(Position())) label.append("Hello World !", font, anchor_x = 'center', anchor_y = 'center', origin=(x,y,z), color=(1,1,1,1)) window.attach(label["transform"]) app.run()
Fix hello world example broken imports
Fix hello world example broken imports
Python
bsd-3-clause
glumpy/glumpy,glumpy/glumpy
python
## Code Before: from glumpy import app, gl, gloo, glm, data, text window = app.Window(width=512, height=512) @window.event def on_draw(dt): window.clear() label.draw(x=256, y=256, color=(1,1,1,1)) font = text.TextureFont(data.get("OpenSans-Regular.ttf"), 64) label = text.Label("Hello World !", font, anchor_x = 'center', anchor_y = 'center') app.run() ## Instruction: Fix hello world example broken imports ## Code After: from glumpy import app, gl, gloo, glm, data from glumpy.graphics.text import FontManager from glumpy.graphics.collections import GlyphCollection from glumpy.transforms import Position, OrthographicProjection window = app.Window(width=512, height=512) @window.event def on_draw(dt): window.clear() label.draw() x,y,z = 256,256,0 font = FontManager.get("OpenSans-Regular.ttf", 64, mode='agg') label = GlyphCollection('agg', transform=OrthographicProjection(Position())) label.append("Hello World !", font, anchor_x = 'center', anchor_y = 'center', origin=(x,y,z), color=(1,1,1,1)) window.attach(label["transform"]) app.run()
cc29e6142a82d6c0d2366f26c52bc0dc0bd2503f
README.md
README.md
Automatically adds a banner only visible to visitors from the EU ## Demo See <a href="http://euvatbanner.appspot.com/">http://euvatbanner.appspot.com/</a> for an example ## Usage I recommend you lazy-load the javascript asynchronously by pasting this snippet before your closing body tag: ``` <script type="text/javascript"> (function() { function async_load(){ var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = 'http://euvatbanner.appspot.com/banner.js'; var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); } if (window.attachEvent) window.attachEvent('onload', async_load); else window.addEventListener('load', async_load, false); })(); </script> ``` Or if you prefer simplicity, you can simply include the javascript like this: ``` <script type="text/javascript">http://euvatbanner.appspot.com/banner.js</script> ```
Automatically adds a banner only visible to visitors from the EU (but not from GB) ## Demo See <a href="http://euvatbanner.appspot.com/">http://euvatbanner.appspot.com/</a> for an example ## Usage I recommend you lazy-load the javascript asynchronously by pasting this snippet before your closing body tag: ``` <script type="text/javascript"> (function() { function async_load(){ var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = 'http://euvatbanner.appspot.com/banner.js'; var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); } if (window.attachEvent) window.attachEvent('onload', async_load); else window.addEventListener('load', async_load, false); })(); </script> ``` Or if you prefer simplicity, you can simply include the javascript like this: ``` <script type="text/javascript">http://euvatbanner.appspot.com/banner.js</script> ```
Clarify message is not visible in GB
Clarify message is not visible in GB
Markdown
mit
mattburns/EuVatBanner
markdown
## Code Before: Automatically adds a banner only visible to visitors from the EU ## Demo See <a href="http://euvatbanner.appspot.com/">http://euvatbanner.appspot.com/</a> for an example ## Usage I recommend you lazy-load the javascript asynchronously by pasting this snippet before your closing body tag: ``` <script type="text/javascript"> (function() { function async_load(){ var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = 'http://euvatbanner.appspot.com/banner.js'; var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); } if (window.attachEvent) window.attachEvent('onload', async_load); else window.addEventListener('load', async_load, false); })(); </script> ``` Or if you prefer simplicity, you can simply include the javascript like this: ``` <script type="text/javascript">http://euvatbanner.appspot.com/banner.js</script> ``` ## Instruction: Clarify message is not visible in GB ## Code After: Automatically adds a banner only visible to visitors from the EU (but not from GB) ## Demo See <a href="http://euvatbanner.appspot.com/">http://euvatbanner.appspot.com/</a> for an example ## Usage I recommend you lazy-load the javascript asynchronously by pasting this snippet before your closing body tag: ``` <script type="text/javascript"> (function() { function async_load(){ var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = 'http://euvatbanner.appspot.com/banner.js'; var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); } if (window.attachEvent) window.attachEvent('onload', async_load); else window.addEventListener('load', async_load, false); })(); </script> ``` Or if you prefer simplicity, you can simply include the javascript like this: ``` <script type="text/javascript">http://euvatbanner.appspot.com/banner.js</script> ```
5f71912cdf71af8c8397e453520d7d7b6c412c1f
README.md
README.md
Count queries without a where clause cause PostgreSQL to do a full table scan to count the exact number of rows. Approximately uses metadata stored by PostgreSQL to return an approximate count of the rows without the full table scan. The number will be correct as of the last `VACUUM` or `ANALYZE` on the table. This makes it appropriate for any statistics that should be updated regularly but do not necessarily need to be live. For more on row estimation, see [the Postgres documentation][1]. [1]: http://www.postgresql.org/docs/9.2/static/row-estimation-examples.html ## Installation Add this line to your application's Gemfile: gem 'approximately' And then execute: $ bundle Or install it yourself as: $ gem install approximately ## Usage ```ruby ApproximateCount.of(Vote.table_name) # => 256233 ``` ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request
Count queries without a where clause cause PostgreSQL to do a full table scan to count the exact number of rows. Approximately uses metadata stored by PostgreSQL to return an approximate count of the rows without the full table scan. The number will be correct immediately following a `VACUUM` or `ANALYZE` on the table and will not be updated until the next `VACUUM` or `ANALYZE`. This makes it most appropriate for tables that are subject to [`autovacuum`] on a regular basis. See the Postgres documentation on [row estimation] and [autovacuum][2] for more. [1]: http://www.postgresql.org/docs/9.2/static/row-estimation-examples.html [2]: http://www.postgresql.org/docs/9.2/static/routine-vacuuming.html#AUTOVACUUM ## Installation Add this line to your application's Gemfile: gem 'approximately' And then execute: $ bundle Or install it yourself as: $ gem install approximately ## Usage ```ruby ApproximateCount.of(Vote.table_name) # => 256233 ``` ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request
Clarify accuracy of the approximation
Clarify accuracy of the approximation
Markdown
mit
derekprior/approximately
markdown
## Code Before: Count queries without a where clause cause PostgreSQL to do a full table scan to count the exact number of rows. Approximately uses metadata stored by PostgreSQL to return an approximate count of the rows without the full table scan. The number will be correct as of the last `VACUUM` or `ANALYZE` on the table. This makes it appropriate for any statistics that should be updated regularly but do not necessarily need to be live. For more on row estimation, see [the Postgres documentation][1]. [1]: http://www.postgresql.org/docs/9.2/static/row-estimation-examples.html ## Installation Add this line to your application's Gemfile: gem 'approximately' And then execute: $ bundle Or install it yourself as: $ gem install approximately ## Usage ```ruby ApproximateCount.of(Vote.table_name) # => 256233 ``` ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request ## Instruction: Clarify accuracy of the approximation ## Code After: Count queries without a where clause cause PostgreSQL to do a full table scan to count the exact number of rows. Approximately uses metadata stored by PostgreSQL to return an approximate count of the rows without the full table scan. The number will be correct immediately following a `VACUUM` or `ANALYZE` on the table and will not be updated until the next `VACUUM` or `ANALYZE`. This makes it most appropriate for tables that are subject to [`autovacuum`] on a regular basis. See the Postgres documentation on [row estimation] and [autovacuum][2] for more. [1]: http://www.postgresql.org/docs/9.2/static/row-estimation-examples.html [2]: http://www.postgresql.org/docs/9.2/static/routine-vacuuming.html#AUTOVACUUM ## Installation Add this line to your application's Gemfile: gem 'approximately' And then execute: $ bundle Or install it yourself as: $ gem install approximately ## Usage ```ruby ApproximateCount.of(Vote.table_name) # => 256233 ``` ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request
bb42fe14165806caf8a2386c49cb602dbf9ad391
connectionless_service.py
connectionless_service.py
from simple.server import SimpleServer __author__ = "Facundo Victor" __license__ = "MIT" __email__ = "[email protected]" def handle_message(sockets=None): """ Handle a simple UDP client. """ if sockets is not None: (readable, writable, errors) = sockets try: while True: (data, address) = readable.recvfrom(1024) print('Received data: %s from %s' % (data, address)) if data: print('Sending a custom ACK to the client %s \ '.format(address)) writable.sendto("Received ;)\n", address) else: print('Received empty data') break finally: SS.close_connection() SS = SimpleServer(connection_oriented=False) SS.register_handler(handle_message) SS.bind_and_listeen("localhost", 8888)
from simple.server import SimpleServer __author__ = "Facundo Victor" __license__ = "MIT" __email__ = "[email protected]" def handle_message(sockets=None): """ Handle a simple UDP client. """ if sockets is not None: (readable, writable, errors) = sockets try: while True: (data, address) = readable.recvfrom(1024) print('Received data: %s from %s' % (data, address)) if data: print('Sending a custom ACK to the client %s' % (address.__str__())) writable.sendto("Received ;)\n", address) else: print('Received empty data') break finally: SS.close_connection() SS = SimpleServer(connection_oriented=False) SS.register_handler(handle_message) SS.bind_and_listeen("localhost", 8888)
Fix python 2.4 connectionless service
Fix python 2.4 connectionless service
Python
mit
facundovictor/non-blocking-socket-samples
python
## Code Before: from simple.server import SimpleServer __author__ = "Facundo Victor" __license__ = "MIT" __email__ = "[email protected]" def handle_message(sockets=None): """ Handle a simple UDP client. """ if sockets is not None: (readable, writable, errors) = sockets try: while True: (data, address) = readable.recvfrom(1024) print('Received data: %s from %s' % (data, address)) if data: print('Sending a custom ACK to the client %s \ '.format(address)) writable.sendto("Received ;)\n", address) else: print('Received empty data') break finally: SS.close_connection() SS = SimpleServer(connection_oriented=False) SS.register_handler(handle_message) SS.bind_and_listeen("localhost", 8888) ## Instruction: Fix python 2.4 connectionless service ## Code After: from simple.server import SimpleServer __author__ = "Facundo Victor" __license__ = "MIT" __email__ = "[email protected]" def handle_message(sockets=None): """ Handle a simple UDP client. """ if sockets is not None: (readable, writable, errors) = sockets try: while True: (data, address) = readable.recvfrom(1024) print('Received data: %s from %s' % (data, address)) if data: print('Sending a custom ACK to the client %s' % (address.__str__())) writable.sendto("Received ;)\n", address) else: print('Received empty data') break finally: SS.close_connection() SS = SimpleServer(connection_oriented=False) SS.register_handler(handle_message) SS.bind_and_listeen("localhost", 8888)
960436b17211a225a729805a528653f2aff675d7
src/sentry/utils/social_auth.py
src/sentry/utils/social_auth.py
from __future__ import absolute_import from django.conf import settings from social_auth.backends.pipeline.user import create_user from social_auth.exceptions import SocialAuthBaseException class AuthNotAllowed(SocialAuthBaseException): pass def create_user_if_enabled(*args, **kwargs): """ A pipeline step for django-social-auth Create user. Depends on get_username pipeline. """ if not settings.SOCIAL_AUTH_CREATE_USERS and not kwargs.get('user'): raise AuthNotAllowed('You must create an account before associating an identity.') return create_user(*args, **kwargs)
from __future__ import absolute_import from django.conf import settings from social_auth.backends.pipeline.user import create_user from social_auth.exceptions import SocialAuthBaseException class AuthNotAllowed(SocialAuthBaseException): pass def create_user_if_enabled(*args, **kwargs): """ A pipeline step for django-social-auth Create user. Depends on get_username pipeline. """ if not settings.SOCIAL_AUTH_CREATE_USERS and not kwargs.get('user'): raise AuthNotAllowed('You must create an account before associating an identity.') backend = kwargs.pop('backend') details = kwargs.pop('details') response = kwargs.pop('response') uid = kwargs.pop('uid') username = kwargs.pop('username', None) user = kwargs.pop('user', None) return create_user(backend=backend, details=details, response=response, uid=uid, username=username, user=user, *args, **kwargs)
Call to create_user fails because django-social-auth module requires 5 parameters now for create_user now.
Call to create_user fails because django-social-auth module requires 5 parameters now for create_user now. The exception is quietly suppressed in social_auth/backends/__init__.py:143 in the pipeline stage for this module since TypeErrors in general are try/except in the authenticate() stage. It can be repro'd by putting a breakpoint on authenticate() in django.contrib.auth and the authenticate() function for the Google backend. Will there be a similar issue once this create_user() function gets even further ported to python-social-auth?
Python
bsd-3-clause
BuildingLink/sentry,gg7/sentry,kevinlondon/sentry,zenefits/sentry,ewdurbin/sentry,daevaorn/sentry,looker/sentry,zenefits/sentry,BuildingLink/sentry,1tush/sentry,wujuguang/sentry,ewdurbin/sentry,rdio/sentry,pauloschilling/sentry,songyi199111/sentry,argonemyth/sentry,wong2/sentry,jokey2k/sentry,zenefits/sentry,beeftornado/sentry,jean/sentry,alexm92/sentry,wong2/sentry,beeftornado/sentry,TedaLIEz/sentry,looker/sentry,BuildingLink/sentry,ifduyue/sentry,daevaorn/sentry,fotinakis/sentry,JamesMura/sentry,zenefits/sentry,daevaorn/sentry,drcapulet/sentry,fuziontech/sentry,llonchj/sentry,jokey2k/sentry,felixbuenemann/sentry,boneyao/sentry,wujuguang/sentry,vperron/sentry,boneyao/sentry,jean/sentry,vperron/sentry,ewdurbin/sentry,camilonova/sentry,fuziontech/sentry,drcapulet/sentry,camilonova/sentry,felixbuenemann/sentry,JackDanger/sentry,kevinastone/sentry,JackDanger/sentry,ifduyue/sentry,rdio/sentry,fotinakis/sentry,JamesMura/sentry,Natim/sentry,rdio/sentry,kevinastone/sentry,Natim/sentry,argonemyth/sentry,mvaled/sentry,rdio/sentry,alexm92/sentry,gencer/sentry,TedaLIEz/sentry,ifduyue/sentry,korealerts1/sentry,JackDanger/sentry,mitsuhiko/sentry,daevaorn/sentry,looker/sentry,alexm92/sentry,songyi199111/sentry,BayanGroup/sentry,imankulov/sentry,argonemyth/sentry,pauloschilling/sentry,mvaled/sentry,JTCunning/sentry,imankulov/sentry,jean/sentry,felixbuenemann/sentry,JTCunning/sentry,jean/sentry,kevinlondon/sentry,fotinakis/sentry,gencer/sentry,BayanGroup/sentry,Natim/sentry,boneyao/sentry,mitsuhiko/sentry,songyi199111/sentry,TedaLIEz/sentry,ngonzalvez/sentry,BayanGroup/sentry,ngonzalvez/sentry,mvaled/sentry,looker/sentry,hongliang5623/sentry,gencer/sentry,ifduyue/sentry,gg7/sentry,drcapulet/sentry,vperron/sentry,kevinlondon/sentry,nicholasserra/sentry,gg7/sentry,camilonova/sentry,fotinakis/sentry,nicholasserra/sentry,llonchj/sentry,fuziontech/sentry,looker/sentry,gencer/sentry,jean/sentry,1tush/sentry,JamesMura/sentry,JamesMura/sentry,BuildingLink/sentry,1tush/sentry,llonchj/sentry,mvaled/sentry,nicholasserra/sentry,JamesMura/sentry,mvaled/sentry,ngonzalvez/sentry,beeftornado/sentry,hongliang5623/sentry,zenefits/sentry,wong2/sentry,JTCunning/sentry,Kryz/sentry,jokey2k/sentry,wujuguang/sentry,gencer/sentry,korealerts1/sentry,Kryz/sentry,Kryz/sentry,mvaled/sentry,BuildingLink/sentry,korealerts1/sentry,hongliang5623/sentry,kevinastone/sentry,imankulov/sentry,pauloschilling/sentry,ifduyue/sentry
python
## Code Before: from __future__ import absolute_import from django.conf import settings from social_auth.backends.pipeline.user import create_user from social_auth.exceptions import SocialAuthBaseException class AuthNotAllowed(SocialAuthBaseException): pass def create_user_if_enabled(*args, **kwargs): """ A pipeline step for django-social-auth Create user. Depends on get_username pipeline. """ if not settings.SOCIAL_AUTH_CREATE_USERS and not kwargs.get('user'): raise AuthNotAllowed('You must create an account before associating an identity.') return create_user(*args, **kwargs) ## Instruction: Call to create_user fails because django-social-auth module requires 5 parameters now for create_user now. The exception is quietly suppressed in social_auth/backends/__init__.py:143 in the pipeline stage for this module since TypeErrors in general are try/except in the authenticate() stage. It can be repro'd by putting a breakpoint on authenticate() in django.contrib.auth and the authenticate() function for the Google backend. Will there be a similar issue once this create_user() function gets even further ported to python-social-auth? ## Code After: from __future__ import absolute_import from django.conf import settings from social_auth.backends.pipeline.user import create_user from social_auth.exceptions import SocialAuthBaseException class AuthNotAllowed(SocialAuthBaseException): pass def create_user_if_enabled(*args, **kwargs): """ A pipeline step for django-social-auth Create user. Depends on get_username pipeline. """ if not settings.SOCIAL_AUTH_CREATE_USERS and not kwargs.get('user'): raise AuthNotAllowed('You must create an account before associating an identity.') backend = kwargs.pop('backend') details = kwargs.pop('details') response = kwargs.pop('response') uid = kwargs.pop('uid') username = kwargs.pop('username', None) user = kwargs.pop('user', None) return create_user(backend=backend, details=details, response=response, uid=uid, username=username, user=user, *args, **kwargs)
ea6f0e4c52db7f557116fd75970941bc09cb57f1
README.md
README.md
= ResquePoll A resque-based web poller
resque-poll is a Rails engine that allows you to easily do long polling for Resque jobs. resque-poll depends on [resque-status](https://github.com/quirkey/resque-status). ## Usage Include resque-poll in your Gemfile: ```ruby gem 'resque-poll' ``` Mount the engine in your `routes.rb`: ```ruby mount ResquePoll::Engine => '/resque_poll' ``` Require the javascript files & the dependencies inyour application.js javascript file (requires Asset Pipeline): ```js //= require jquery //= require resque_poll ``` ## Usage In a form, the `data-resque-poll` attribute to your form tag: ```erb <%= form_for @movie, html: { data: { 'resque-poll' => true } } do |f| %> <%= f.input :title %> <%= f.submit %> ``` Your controller can then use ResquePoll to return the appropriate response to begin polling: ```ruby class MoviesController < ApplicationController def create poll = ResquePoll.create(LongRunningMoveJob, {title: params[:title]}) render json: poll.to_json end end
Add basic installation and usage notes
Add basic installation and usage notes
Markdown
mit
lumoslabs/resque-poll,lumoslabs/resque-poll,lumoslabs/resque-poll
markdown
## Code Before: = ResquePoll A resque-based web poller ## Instruction: Add basic installation and usage notes ## Code After: resque-poll is a Rails engine that allows you to easily do long polling for Resque jobs. resque-poll depends on [resque-status](https://github.com/quirkey/resque-status). ## Usage Include resque-poll in your Gemfile: ```ruby gem 'resque-poll' ``` Mount the engine in your `routes.rb`: ```ruby mount ResquePoll::Engine => '/resque_poll' ``` Require the javascript files & the dependencies inyour application.js javascript file (requires Asset Pipeline): ```js //= require jquery //= require resque_poll ``` ## Usage In a form, the `data-resque-poll` attribute to your form tag: ```erb <%= form_for @movie, html: { data: { 'resque-poll' => true } } do |f| %> <%= f.input :title %> <%= f.submit %> ``` Your controller can then use ResquePoll to return the appropriate response to begin polling: ```ruby class MoviesController < ApplicationController def create poll = ResquePoll.create(LongRunningMoveJob, {title: params[:title]}) render json: poll.to_json end end
6c19c79f596ae6872c7b5b2fe2b31ff4f5c8cb51
test/mjsunit/asm/math-clz32.js
test/mjsunit/asm/math-clz32.js
// Copyright 2015 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Flags: --allow-natives-syntax var stdlib = { Math: Math }; var f = (function Module(stdlib) { "use asm"; var clz32 = stdlib.Math.clz32; function f(a) { a = a >>> 0; return clz32(a)|0; } return f; })(stdlib); assertEquals(32, f(0)); assertEquals(32, f(NaN)); assertEquals(32, f(undefined)); for (var i = 0; i < 32; ++i) { assertEquals(i, f((-1) >>> i)); } for (var i = -2147483648; i < 2147483648; i += 3999773) { assertEquals(%MathClz32(i), f(i)); assertEquals(%_MathClz32(i), f(i)); }
// Copyright 2015 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Flags: --allow-natives-syntax var stdlib = { Math: Math }; var f = (function Module(stdlib) { "use asm"; var clz32 = stdlib.Math.clz32; function f(a) { a = a >>> 0; return clz32(a)|0; } return f; })(stdlib); assertEquals(32, f(0)); assertEquals(32, f(NaN)); assertEquals(32, f(undefined)); for (var i = 0; i < 32; ++i) { assertEquals(i, f((-1) >>> i)); } for (var i = -2147483648; i < 2147483648; i += 3999773) { assertEquals(%MathClz32(i), f(i)); assertEquals(%MathClz32(i), %_MathClz32(i >>> 0)); }
Fix test of %_MathClz32 intrinsic.
[turbofan] Fix test of %_MathClz32 intrinsic. This test will fail once we optimize top-level code, because the aforementioned intrinsic doesn't perform a NumberToUint32 conversion. [email protected] TEST=mjsunit/asm/math-clz32 Review URL: https://codereview.chromium.org/1041173002 Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#27524}
JavaScript
mit
UniversalFuture/moosh,UniversalFuture/moosh,UniversalFuture/moosh,UniversalFuture/moosh
javascript
## Code Before: // Copyright 2015 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Flags: --allow-natives-syntax var stdlib = { Math: Math }; var f = (function Module(stdlib) { "use asm"; var clz32 = stdlib.Math.clz32; function f(a) { a = a >>> 0; return clz32(a)|0; } return f; })(stdlib); assertEquals(32, f(0)); assertEquals(32, f(NaN)); assertEquals(32, f(undefined)); for (var i = 0; i < 32; ++i) { assertEquals(i, f((-1) >>> i)); } for (var i = -2147483648; i < 2147483648; i += 3999773) { assertEquals(%MathClz32(i), f(i)); assertEquals(%_MathClz32(i), f(i)); } ## Instruction: [turbofan] Fix test of %_MathClz32 intrinsic. This test will fail once we optimize top-level code, because the aforementioned intrinsic doesn't perform a NumberToUint32 conversion. [email protected] TEST=mjsunit/asm/math-clz32 Review URL: https://codereview.chromium.org/1041173002 Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#27524} ## Code After: // Copyright 2015 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Flags: --allow-natives-syntax var stdlib = { Math: Math }; var f = (function Module(stdlib) { "use asm"; var clz32 = stdlib.Math.clz32; function f(a) { a = a >>> 0; return clz32(a)|0; } return f; })(stdlib); assertEquals(32, f(0)); assertEquals(32, f(NaN)); assertEquals(32, f(undefined)); for (var i = 0; i < 32; ++i) { assertEquals(i, f((-1) >>> i)); } for (var i = -2147483648; i < 2147483648; i += 3999773) { assertEquals(%MathClz32(i), f(i)); assertEquals(%MathClz32(i), %_MathClz32(i >>> 0)); }
cb17c07247ab226f000033b882bb5171cf695edc
scripts/recalc_abilities_for_all_users.rb
scripts/recalc_abilities_for_all_users.rb
puts "Recalculating all the Abilities" puts User.unscoped.all.map do |u| puts "Scope: User.Id=#{u.id}" CommunityUser.unscoped.where(user: u).all.map do |cu| puts " Attempt CommunityUser.Id=#{cu.id}" RequestContext.community = cu.community cu.recalc_privileges rescue puts " !!! Error recalcing for CommunityUser.Id=#{cu.id}" end puts "End" puts end puts "---" puts "Recalculating completed"
puts "Recalculating all the Abilities" puts User.unscoped.all.map do |u| puts "Scope: User.Id=#{u.id}" CommunityUser.unscoped.where(user: u).all.map do |cu| puts " Attempt CommunityUser.Id=#{cu.id}" RequestContext.community = cu.community cu.recalc_privileges if (cu.is_moderator || cu.is_admin || u.is_global_moderator || u.is_global_admin) && !cu.privilege?('mod') cu.grant_privilege('mod') end rescue puts " !!! Error recalcing for CommunityUser.Id=#{cu.id}" end puts "End" puts end puts "---" puts "Recalculating completed"
Add enforcement for moderator ability to recalc script
Add enforcement for moderator ability to recalc script
Ruby
agpl-3.0
ArtOfCode-/qpixel,ArtOfCode-/qpixel,ArtOfCode-/qpixel,ArtOfCode-/qpixel
ruby
## Code Before: puts "Recalculating all the Abilities" puts User.unscoped.all.map do |u| puts "Scope: User.Id=#{u.id}" CommunityUser.unscoped.where(user: u).all.map do |cu| puts " Attempt CommunityUser.Id=#{cu.id}" RequestContext.community = cu.community cu.recalc_privileges rescue puts " !!! Error recalcing for CommunityUser.Id=#{cu.id}" end puts "End" puts end puts "---" puts "Recalculating completed" ## Instruction: Add enforcement for moderator ability to recalc script ## Code After: puts "Recalculating all the Abilities" puts User.unscoped.all.map do |u| puts "Scope: User.Id=#{u.id}" CommunityUser.unscoped.where(user: u).all.map do |cu| puts " Attempt CommunityUser.Id=#{cu.id}" RequestContext.community = cu.community cu.recalc_privileges if (cu.is_moderator || cu.is_admin || u.is_global_moderator || u.is_global_admin) && !cu.privilege?('mod') cu.grant_privilege('mod') end rescue puts " !!! Error recalcing for CommunityUser.Id=#{cu.id}" end puts "End" puts end puts "---" puts "Recalculating completed"
2f31b562a5a399c22ec14991db621ab47f99ee5a
tox.ini
tox.ini
[tox] envlist = py27 [testenv] deps = -rrequirements.txt commands= pep8 furtive nosetests --with-coverage --cover-package=furtive -v --with-xunit --xunit-file=test-results/nosetests.xml
[tox] envlist = py27 [testenv] install_command = pip install -rrequirements.txt --cache-dir={homedir}/.pipcache {opts} {packages} distribute=True sitepackages=False commands= pep8 furtive # pylint --rcfile=.pylintrc furtive nosetests --with-coverage --cover-package=furtive -v --with-xunit --xunit-file=test-results/nosetests.xml
Add pip should use cache-dir
Add pip should use cache-dir
INI
mit
dbryant4/furtive
ini
## Code Before: [tox] envlist = py27 [testenv] deps = -rrequirements.txt commands= pep8 furtive nosetests --with-coverage --cover-package=furtive -v --with-xunit --xunit-file=test-results/nosetests.xml ## Instruction: Add pip should use cache-dir ## Code After: [tox] envlist = py27 [testenv] install_command = pip install -rrequirements.txt --cache-dir={homedir}/.pipcache {opts} {packages} distribute=True sitepackages=False commands= pep8 furtive # pylint --rcfile=.pylintrc furtive nosetests --with-coverage --cover-package=furtive -v --with-xunit --xunit-file=test-results/nosetests.xml
a23f3806ea874bb93b46d001792397653680995b
lib/tasks/license_finder.rake
lib/tasks/license_finder.rake
namespace :license do desc 'write out example config file' task :init do FileUtils.cp(File.join(File.dirname(__FILE__), '..', '..', 'files', 'license_finder.yml'), './config/license_finder.yml') end desc 'generate a list of dependency licenses' task :generate_dependencies do LicenseFinder::Finder.new.write_files end desc 'action items' task :action_items => :generate_dependencies do puts "Dependencies that need approval:" puts LicenseFinder::Finder.new.action_items end end
namespace :license do desc 'write out example config file' task :init do FileUtils.cp(File.join(File.dirname(__FILE__), '..', '..', 'files', 'license_finder.yml'), './config/license_finder.yml') end desc 'generate a list of dependency licenses' task :generate_dependencies do LicenseFinder::Finder.new.write_files end desc 'action items' task :action_items => :generate_dependencies do puts "Dependencies that need approval:" puts LicenseFinder::Finder.new.action_items end desc 'All gems approved for use' task 'action_items:ok' => :generate_dependencies do exit 1 unless LicenseFinder::Finder.new.action_items.size == 0 end end
Add rake target for CI
Add rake target for CI
Ruby
mit
LukeWinikates/LicenseFinder,tinfoil/LicenseFinder,pivotal/LicenseFinder,bspeck/LicenseFinder,bdshroyer/LicenseFinder,bspeck/LicenseFinder,alexderz/LicenseFinder,alexderz/LicenseFinder,LukeWinikates/LicenseFinder,sschuberth/LicenseFinder,pivotal/LicenseFinder,pivotal/LicenseFinder,phusion/LicenseFinder,joemoore/LicenseFinder,JasonMSwrve/LicenseFinder,SimantovYousoufov/LicenseFinder,JasonMSwrve/LicenseFinder,chef/LicenseFinder,chef/LicenseFinder,JasonMSwrve/LicenseFinder,Swrve/LicenseFinder,phusion/LicenseFinder,tinfoil/LicenseFinder,bspeck/LicenseFinder,JasonMSwrve/LicenseFinder,joemoore/LicenseFinder,bdshroyer/LicenseFinder,joemoore/LicenseFinder,pivotal/LicenseFinder,LukeWinikates/LicenseFinder,phusion/LicenseFinder,chef/LicenseFinder,bspeck/LicenseFinder,SimantovYousoufov/LicenseFinder,pivotal/LicenseFinder,phusion/LicenseFinder,SimantovYousoufov/LicenseFinder,alexderz/LicenseFinder,sschuberth/LicenseFinder,alexderz/LicenseFinder,JasonMSwrve/LicenseFinder,sschuberth/LicenseFinder,bdshroyer/LicenseFinder,bdshroyer/LicenseFinder,bspeck/LicenseFinder,SimantovYousoufov/LicenseFinder,tinfoil/LicenseFinder,bdshroyer/LicenseFinder,tinfoil/LicenseFinder,joemoore/LicenseFinder,chef/LicenseFinder,LukeWinikates/LicenseFinder,Swrve/LicenseFinder,pivotal/LicenseFinder,phusion/LicenseFinder,pivotal/LicenseFinder,sschuberth/LicenseFinder,tinfoil/LicenseFinder,LukeWinikates/LicenseFinder,joemoore/LicenseFinder,alexderz/LicenseFinder,SimantovYousoufov/LicenseFinder,sschuberth/LicenseFinder
ruby
## Code Before: namespace :license do desc 'write out example config file' task :init do FileUtils.cp(File.join(File.dirname(__FILE__), '..', '..', 'files', 'license_finder.yml'), './config/license_finder.yml') end desc 'generate a list of dependency licenses' task :generate_dependencies do LicenseFinder::Finder.new.write_files end desc 'action items' task :action_items => :generate_dependencies do puts "Dependencies that need approval:" puts LicenseFinder::Finder.new.action_items end end ## Instruction: Add rake target for CI ## Code After: namespace :license do desc 'write out example config file' task :init do FileUtils.cp(File.join(File.dirname(__FILE__), '..', '..', 'files', 'license_finder.yml'), './config/license_finder.yml') end desc 'generate a list of dependency licenses' task :generate_dependencies do LicenseFinder::Finder.new.write_files end desc 'action items' task :action_items => :generate_dependencies do puts "Dependencies that need approval:" puts LicenseFinder::Finder.new.action_items end desc 'All gems approved for use' task 'action_items:ok' => :generate_dependencies do exit 1 unless LicenseFinder::Finder.new.action_items.size == 0 end end
0eb3fcd728fe774aeeb64a94c2c63c7effd767e3
package.json
package.json
{ "name": "node-vst-host", "version": "0.0.1", "description": "VST host for processing audio", "main": "node-vst-host.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "repository": "", "keywords": [ "VST", "audio", "process", "batch", "effect", "AU" ], "author": "Mike Vegeto <[email protected]> (http://mikevegeto.com)", "license": "MIT (with GPL dependencies)" }
{ "name": "node-vst-host", "version": "0.0.2", "description": "VST host for processing audio", "main": "node-vst-host.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { "type": "git", "url": "http://github.com/ZECTBynmo/node-vst-host.git" }, "repository": "", "keywords": [ "VST", "audio", "process", "batch", "effect", "AU" ], "author": "Mike Vegeto <[email protected]> (http://mikevegeto.com)", "license": "MIT (with GPL dependencies)", }
Make sure we have a link to the repo for npm
Make sure we have a link to the repo for npm
JSON
mit
ZECTBynmo/node-vst-host
json
## Code Before: { "name": "node-vst-host", "version": "0.0.1", "description": "VST host for processing audio", "main": "node-vst-host.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "repository": "", "keywords": [ "VST", "audio", "process", "batch", "effect", "AU" ], "author": "Mike Vegeto <[email protected]> (http://mikevegeto.com)", "license": "MIT (with GPL dependencies)" } ## Instruction: Make sure we have a link to the repo for npm ## Code After: { "name": "node-vst-host", "version": "0.0.2", "description": "VST host for processing audio", "main": "node-vst-host.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { "type": "git", "url": "http://github.com/ZECTBynmo/node-vst-host.git" }, "repository": "", "keywords": [ "VST", "audio", "process", "batch", "effect", "AU" ], "author": "Mike Vegeto <[email protected]> (http://mikevegeto.com)", "license": "MIT (with GPL dependencies)", }
5c535f3d91a5ac8bffe0c16afffb1eb2cb077e5c
README.md
README.md
Remindme =======
[![Codeship Status for PhDuc/remindme](https://codeship.com/projects/e49a1960-a9ea-0132-e9be-427bb4181a39/status?branch=master)](https://codeship.com/projects/67835) [![Code Climate](https://codeclimate.com/repos/54ffdfe66956807874003247/badges/d92f5d2d7cd39eaa3fd8/gpa.svg)](https://codeclimate.com/repos/54ffdfe66956807874003247/feed) [![PullReview stats](https://www.pullreview.com/github/PhDuc/remindme/badges/master.svg?)](https://www.pullreview.com/github/PhDuc/remindme/reviews/master) Remindme =======
Add codeship, codeclimate and pullreview badges
Add codeship, codeclimate and pullreview badges
Markdown
mit
PhDuc/remindme,PhDuc/remindme,PhDuc/remindme
markdown
## Code Before: Remindme ======= ## Instruction: Add codeship, codeclimate and pullreview badges ## Code After: [![Codeship Status for PhDuc/remindme](https://codeship.com/projects/e49a1960-a9ea-0132-e9be-427bb4181a39/status?branch=master)](https://codeship.com/projects/67835) [![Code Climate](https://codeclimate.com/repos/54ffdfe66956807874003247/badges/d92f5d2d7cd39eaa3fd8/gpa.svg)](https://codeclimate.com/repos/54ffdfe66956807874003247/feed) [![PullReview stats](https://www.pullreview.com/github/PhDuc/remindme/badges/master.svg?)](https://www.pullreview.com/github/PhDuc/remindme/reviews/master) Remindme =======
d1edad77613be736d846bd58c8778a8f37f39084
tests/yaml/zh-chn.yaml
tests/yaml/zh-chn.yaml
tables: [tables/unicode.dis, tables/zh-chn.ctb] tests: - [八,⠃⠔] - [8,⠼⠓] - [白,⠃⠪] - [门,⠍⠴] - [特,⠞⠢] - [丸,⠻] - [鱼,⠬] - [?,⠐⠄] - [贵,⠛⠺] - [兞,⠍⠖]
table: [tables/unicode.dis, tables/zh-chn.ctb] tests: - [八,⠃⠔] - [8,⠼⠓, {xfail: true}] - [白,⠃⠪] - [门,⠍⠴] - [特,⠞⠢] - [丸,⠻] - [鱼,⠬] - [?,⠐⠄] - [贵,⠛⠺] - [兞,⠍⠖]
Comment out a failing test case
Comment out a failing test case
YAML
lgpl-2.1
IndexBraille/liblouis,BueVest/liblouis,vsmontalvao/liblouis,BueVest/liblouis,hammera/liblouis,BueVest/liblouis,vsmontalvao/liblouis,liblouis/liblouis,hammera/liblouis,vsmontalvao/liblouis,vsmontalvao/liblouis,vsmontalvao/liblouis,liblouis/liblouis,hammera/liblouis,hammera/liblouis,liblouis/liblouis,IndexBraille/liblouis,liblouis/liblouis,hammera/liblouis,BueVest/liblouis,IndexBraille/liblouis,BueVest/liblouis,IndexBraille/liblouis,hammera/liblouis,liblouis/liblouis,liblouis/liblouis,IndexBraille/liblouis,BueVest/liblouis
yaml
## Code Before: tables: [tables/unicode.dis, tables/zh-chn.ctb] tests: - [八,⠃⠔] - [8,⠼⠓] - [白,⠃⠪] - [门,⠍⠴] - [特,⠞⠢] - [丸,⠻] - [鱼,⠬] - [?,⠐⠄] - [贵,⠛⠺] - [兞,⠍⠖] ## Instruction: Comment out a failing test case ## Code After: table: [tables/unicode.dis, tables/zh-chn.ctb] tests: - [八,⠃⠔] - [8,⠼⠓, {xfail: true}] - [白,⠃⠪] - [门,⠍⠴] - [特,⠞⠢] - [丸,⠻] - [鱼,⠬] - [?,⠐⠄] - [贵,⠛⠺] - [兞,⠍⠖]
2953b31243f2cb4bf6bdbddfcd032bcb2f0f7ff3
.travis.yml
.travis.yml
language: go go: - tip before_install: - go get -v golang.org/x/tools/cmd/cover - go get -v golang.org/x/tools/cmd/vet - go get -v golang.org/x/lint/golint - export PATH=$PATH:/home/travis/gopath/bin script: - go build -v ./... - go test -v -cover ./... - go vet ./... - golint .
language: go go: - master - tip - 1.9 - 1.8 - 1.7 - 1.6 - 1.5 - 1.4 - 1.3 - 1.2 before_install: - go get -v golang.org/x/tools/cmd/cover || echo 'could not get cover' - go get -v golang.org/x/tools/cmd/vet || echo 'could not get vet' - go get -v golang.org/x/lint/golint || echo 'could not get golint' - export PATH="$PATH:/home/travis/gopath/bin" script: - go build -v ./... - if go tool cover -V; then go test -v -cover ./...; else echo 'no cover'; go test -v ./...; fi - if go tool vet -V; then go vet -v ./...; else echo 'no vet'; fi - if which golint; then golint ./...; else echo 'no golint'; fi
Fix build errors; add language versions
Fix build errors; add language versions
YAML
bsd-3-clause
ajg/ez,ajg/ez
yaml
## Code Before: language: go go: - tip before_install: - go get -v golang.org/x/tools/cmd/cover - go get -v golang.org/x/tools/cmd/vet - go get -v golang.org/x/lint/golint - export PATH=$PATH:/home/travis/gopath/bin script: - go build -v ./... - go test -v -cover ./... - go vet ./... - golint . ## Instruction: Fix build errors; add language versions ## Code After: language: go go: - master - tip - 1.9 - 1.8 - 1.7 - 1.6 - 1.5 - 1.4 - 1.3 - 1.2 before_install: - go get -v golang.org/x/tools/cmd/cover || echo 'could not get cover' - go get -v golang.org/x/tools/cmd/vet || echo 'could not get vet' - go get -v golang.org/x/lint/golint || echo 'could not get golint' - export PATH="$PATH:/home/travis/gopath/bin" script: - go build -v ./... - if go tool cover -V; then go test -v -cover ./...; else echo 'no cover'; go test -v ./...; fi - if go tool vet -V; then go vet -v ./...; else echo 'no vet'; fi - if which golint; then golint ./...; else echo 'no golint'; fi
29a964a64230e26fca550e81a1ecba3dd782dfb1
python/vtd.py
python/vtd.py
import libvtd.trusted_system def UpdateTrustedSystem(file_name): """Make sure the TrustedSystem object is up to date.""" global my_system my_system = libvtd.trusted_system.TrustedSystem() my_system.AddFile(file_name)
import libvtd.trusted_system def UpdateTrustedSystem(file_name): """Make sure the TrustedSystem object is up to date.""" global my_system if 'my_system' not in globals(): my_system = libvtd.trusted_system.TrustedSystem() my_system.AddFile(file_name) my_system.Refresh()
Refresh system instead of clobbering it
Refresh system instead of clobbering it Otherwise, if we set the Contexts, they'll be gone before we can request the NextActions!
Python
apache-2.0
chiphogg/vim-vtd
python
## Code Before: import libvtd.trusted_system def UpdateTrustedSystem(file_name): """Make sure the TrustedSystem object is up to date.""" global my_system my_system = libvtd.trusted_system.TrustedSystem() my_system.AddFile(file_name) ## Instruction: Refresh system instead of clobbering it Otherwise, if we set the Contexts, they'll be gone before we can request the NextActions! ## Code After: import libvtd.trusted_system def UpdateTrustedSystem(file_name): """Make sure the TrustedSystem object is up to date.""" global my_system if 'my_system' not in globals(): my_system = libvtd.trusted_system.TrustedSystem() my_system.AddFile(file_name) my_system.Refresh()
322e9491411027bce0205f317f20050216ed98e8
parity-net/src/main/java/org/jvirtanen/parity/net/poe/ByteBuffers.java
parity-net/src/main/java/org/jvirtanen/parity/net/poe/ByteBuffers.java
package org.jvirtanen.parity.net.poe; import static java.nio.charset.StandardCharsets.*; import java.nio.ByteBuffer; class ByteBuffers { private static final byte SPACE = ' '; static String getString(ByteBuffer buffer, int length) { byte[] bytes = new byte[length]; buffer.get(bytes); return new String(bytes, US_ASCII); } static void putString(ByteBuffer buffer, String value, int length) { byte[] bytes = value.getBytes(US_ASCII); int i = 0; for (; i < Math.min(bytes.length, length); i++) buffer.put(bytes[i]); for (; i < length; i++) buffer.put(SPACE); } }
package org.jvirtanen.parity.net.poe; import static java.nio.charset.StandardCharsets.*; import java.nio.ByteBuffer; class ByteBuffers { private static final byte SPACE = ' '; static String getString(ByteBuffer buffer, int length) { byte[] bytes = new byte[length]; buffer.get(bytes); return new String(bytes, US_ASCII); } static void putString(ByteBuffer buffer, String value, int length) { int i = 0; for (; i < Math.min(value.length(), length); i++) buffer.put((byte)value.charAt(i)); for (; i < length; i++) buffer.put(SPACE); } }
Improve string encoding in network protocols
Improve string encoding in network protocols Eliminate unnecessary memory allocation.
Java
apache-2.0
paritytrading/parity,pmcs/parity,pmcs/parity,paritytrading/parity
java
## Code Before: package org.jvirtanen.parity.net.poe; import static java.nio.charset.StandardCharsets.*; import java.nio.ByteBuffer; class ByteBuffers { private static final byte SPACE = ' '; static String getString(ByteBuffer buffer, int length) { byte[] bytes = new byte[length]; buffer.get(bytes); return new String(bytes, US_ASCII); } static void putString(ByteBuffer buffer, String value, int length) { byte[] bytes = value.getBytes(US_ASCII); int i = 0; for (; i < Math.min(bytes.length, length); i++) buffer.put(bytes[i]); for (; i < length; i++) buffer.put(SPACE); } } ## Instruction: Improve string encoding in network protocols Eliminate unnecessary memory allocation. ## Code After: package org.jvirtanen.parity.net.poe; import static java.nio.charset.StandardCharsets.*; import java.nio.ByteBuffer; class ByteBuffers { private static final byte SPACE = ' '; static String getString(ByteBuffer buffer, int length) { byte[] bytes = new byte[length]; buffer.get(bytes); return new String(bytes, US_ASCII); } static void putString(ByteBuffer buffer, String value, int length) { int i = 0; for (; i < Math.min(value.length(), length); i++) buffer.put((byte)value.charAt(i)); for (; i < length; i++) buffer.put(SPACE); } }
1aa00db3d31f2532a8ebf3c0cb1e6ac25f2ab855
README.md
README.md
snakedb ======= A simple Object Relation Mapper (ORM) focusing on speed and simplicity.
snakedb ======= A simple Object Relation Mapper (ORM) focusing on speed and simplicity. Usage ----- SnakeDB looks at all classes annotated with the DatabaseEntity annotation and then compiles and generates a specific mapper class for each of the annotated classes. The bare minimum of an entity looks like this: ``` @DatabaseEntity public class ExampleEntity { @PrimaryKey public String Id; public String Name; } ``` The DatabaseEntityProcessor will look at all the public fields and use the name of the field as a column name in the database table. If you annotate a field with @FieldName("custom name") you can change the name for the column in the database. By default it will use getters and setters starting with set/get and then the field name. This can be changed by annotating your get method with @GetField("fieldName") and your set method with @SetField("fieldName"). You must always set what field is the primary key. Currently Only a single field is supported for primary key. When using the mapper you will not call the generated classes directly. The MappingFetcher is used for that. Register your entities and then initialize the MappingFetcher. After a call to initialize get the mapping for a specific entity by calling getMapping(mappingClass): ``` IMappingFetcher mappingFetcher = new MappingFetcher(); mappingFetcher.registerEntity(ExampleEntity.class); mappingFetcher.initialize(); IMapping mapping = mappingFetcher.getMapping(ExampleEntity.class); String sql = mapping.getCreateTableSql(); ``` If you are developing on Android, the simplest way to interact with your database is to use the SQLStorageFactory built specifically for Android and it's SQLiteDatabase class. ``` IStorage<ExampleEntity> storage = SQliteStorageFactory.initStorage(db, ExampleEntity.class); storage.initStorage(); ExampleEntity entity = new ExampleEntity(); entity.setName("David"); storage.insert(entity); ``` License ------- Copyright 2014 David Laurell Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Update Readme.md with instructions on usage
Update Readme.md with instructions on usage
Markdown
apache-2.0
daverix/slingerORM
markdown
## Code Before: snakedb ======= A simple Object Relation Mapper (ORM) focusing on speed and simplicity. ## Instruction: Update Readme.md with instructions on usage ## Code After: snakedb ======= A simple Object Relation Mapper (ORM) focusing on speed and simplicity. Usage ----- SnakeDB looks at all classes annotated with the DatabaseEntity annotation and then compiles and generates a specific mapper class for each of the annotated classes. The bare minimum of an entity looks like this: ``` @DatabaseEntity public class ExampleEntity { @PrimaryKey public String Id; public String Name; } ``` The DatabaseEntityProcessor will look at all the public fields and use the name of the field as a column name in the database table. If you annotate a field with @FieldName("custom name") you can change the name for the column in the database. By default it will use getters and setters starting with set/get and then the field name. This can be changed by annotating your get method with @GetField("fieldName") and your set method with @SetField("fieldName"). You must always set what field is the primary key. Currently Only a single field is supported for primary key. When using the mapper you will not call the generated classes directly. The MappingFetcher is used for that. Register your entities and then initialize the MappingFetcher. After a call to initialize get the mapping for a specific entity by calling getMapping(mappingClass): ``` IMappingFetcher mappingFetcher = new MappingFetcher(); mappingFetcher.registerEntity(ExampleEntity.class); mappingFetcher.initialize(); IMapping mapping = mappingFetcher.getMapping(ExampleEntity.class); String sql = mapping.getCreateTableSql(); ``` If you are developing on Android, the simplest way to interact with your database is to use the SQLStorageFactory built specifically for Android and it's SQLiteDatabase class. ``` IStorage<ExampleEntity> storage = SQliteStorageFactory.initStorage(db, ExampleEntity.class); storage.initStorage(); ExampleEntity entity = new ExampleEntity(); entity.setName("David"); storage.insert(entity); ``` License ------- Copyright 2014 David Laurell Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
2e1d3d2a499b8cdeec88d5f2b304bc114f1806b7
test/unit/document_test.rb
test/unit/document_test.rb
require 'test_helper' describe "a Riagent::Document" do it "should pass" do doc = User.new assert true end end
require 'test_helper' describe "a Riagent::Document" do # See test/examples/models/user.rb # User class includes the Riagent::Document mixin let(:user_document) { User.new } it "has a key" do user_document.key.must_be_nil # first initialized test_key = 'george' user_document.key = test_key user_document.key.must_equal test_key # Test for the .id alias user_document.id.must_equal test_key end it "has model attributes" do user_document.attributes.count.must_equal 3 # :username, :email, :language end end
Test for document key & attributes
Test for document key & attributes
Ruby
mit
dmitrizagidulin/riagent-document
ruby
## Code Before: require 'test_helper' describe "a Riagent::Document" do it "should pass" do doc = User.new assert true end end ## Instruction: Test for document key & attributes ## Code After: require 'test_helper' describe "a Riagent::Document" do # See test/examples/models/user.rb # User class includes the Riagent::Document mixin let(:user_document) { User.new } it "has a key" do user_document.key.must_be_nil # first initialized test_key = 'george' user_document.key = test_key user_document.key.must_equal test_key # Test for the .id alias user_document.id.must_equal test_key end it "has model attributes" do user_document.attributes.count.must_equal 3 # :username, :email, :language end end
c367d320977b76a82b8010b68ba7f5aef7d86900
lib/pixiv.rb
lib/pixiv.rb
require 'mechanize' require 'pixiv/error' require 'pixiv/client' require 'pixiv/page' require 'pixiv/illust' require 'pixiv/member' require 'pixiv/page_collection' require 'pixiv/bookmark_list' module Pixiv ROOT_URL = 'http://www.pixiv.net' # Delegates to {Pixiv::Client#initialize} def self.new(*args, &block) Pixiv::Client.new(*args, &block) end end
require 'mechanize' require 'pixiv/error' require 'pixiv/client' require 'pixiv/page' require 'pixiv/illust' require 'pixiv/member' require 'pixiv/page_collection' require 'pixiv/bookmark_list' module Pixiv ROOT_URL = 'http://www.pixiv.net' # @deprecated Use {.client} instead. Will be removed in 0.1.0. # Delegates to {Pixiv::Client#initialize} def self.new(*args, &block) Pixiv::Client.new(*args, &block) end # See {Pixiv::Client#initialize} # @return [Pixiv::Client] def self.client(*args, &block) Pixiv::Client.new(*args, &block) end end
Add Pixiv.client and deprecate Pixiv.new
Add Pixiv.client and deprecate Pixiv.new
Ruby
mit
ota42y/pixiv,Xwth/pixiv,sanadan/pixiv,uasi/pixiv
ruby
## Code Before: require 'mechanize' require 'pixiv/error' require 'pixiv/client' require 'pixiv/page' require 'pixiv/illust' require 'pixiv/member' require 'pixiv/page_collection' require 'pixiv/bookmark_list' module Pixiv ROOT_URL = 'http://www.pixiv.net' # Delegates to {Pixiv::Client#initialize} def self.new(*args, &block) Pixiv::Client.new(*args, &block) end end ## Instruction: Add Pixiv.client and deprecate Pixiv.new ## Code After: require 'mechanize' require 'pixiv/error' require 'pixiv/client' require 'pixiv/page' require 'pixiv/illust' require 'pixiv/member' require 'pixiv/page_collection' require 'pixiv/bookmark_list' module Pixiv ROOT_URL = 'http://www.pixiv.net' # @deprecated Use {.client} instead. Will be removed in 0.1.0. # Delegates to {Pixiv::Client#initialize} def self.new(*args, &block) Pixiv::Client.new(*args, &block) end # See {Pixiv::Client#initialize} # @return [Pixiv::Client] def self.client(*args, &block) Pixiv::Client.new(*args, &block) end end
b678a0368c8d9dcac461951d26e3695ee7307a00
src/PangolinConfigVersion.cmake.in
src/PangolinConfigVersion.cmake.in
set(PACKAGE_VERSION "@PANGOLIN_VERSION@") # Check build type is valid if( "System:${CMAKE_SYSTEM_NAME},Android:${ANDROID},iOS:${IOS}" STREQUAL "System:@CMAKE_SYSTEM_NAME@,Android:@ANDROID@,iOS:@IOS@" ) # Check whether the requested PACKAGE_FIND_VERSION is compatible if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") set(PACKAGE_VERSION_COMPATIBLE FALSE) else() set(PACKAGE_VERSION_COMPATIBLE TRUE) if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}") set(PACKAGE_VERSION_EXACT TRUE) endif() endif() else() set(PACKAGE_VERSION_COMPATIBLE FALSE) endif()
set(PACKAGE_VERSION "@PANGOLIN_VERSION@") # Check build type is valid if( "System:${CMAKE_SYSTEM_NAME},Win64:${CMAKE_CL_64},Android:${ANDROID},iOS:${IOS}" STREQUAL "System:@CMAKE_SYSTEM_NAME@,Win64:@CMAKE_CL_64@,Android:@ANDROID@,iOS:@IOS@" ) # Check whether the requested PACKAGE_FIND_VERSION is compatible if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") set(PACKAGE_VERSION_COMPATIBLE FALSE) else() set(PACKAGE_VERSION_COMPATIBLE TRUE) if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}") set(PACKAGE_VERSION_EXACT TRUE) endif() endif() else() set(PACKAGE_VERSION_COMPATIBLE FALSE) endif()
Allow win32 and win64 builds to exist in parallel.
Allow win32 and win64 builds to exist in parallel.
unknown
mit
stevenlovegrove/Pangolin,mp3guy/Pangolin,arpg/Pangolin,wxdzju/Pangolin,randi120/Pangolin,visigoth/Pangolin,tschmidt23/Pangolin,stevenlovegrove/Pangolin,pinglin/Pangolin,renzodenardi/Pangolin,stevenlovegrove/Pangolin,arpg/Pangolin,pinglin/Pangolin,renzodenardi/Pangolin,tschmidt23/Pangolin,mp3guy/Pangolin,mp3guy/Pangolin,wxdzju/Pangolin,visigoth/Pangolin,randi120/Pangolin,tschmidt23/Pangolin
unknown
## Code Before: set(PACKAGE_VERSION "@PANGOLIN_VERSION@") # Check build type is valid if( "System:${CMAKE_SYSTEM_NAME},Android:${ANDROID},iOS:${IOS}" STREQUAL "System:@CMAKE_SYSTEM_NAME@,Android:@ANDROID@,iOS:@IOS@" ) # Check whether the requested PACKAGE_FIND_VERSION is compatible if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") set(PACKAGE_VERSION_COMPATIBLE FALSE) else() set(PACKAGE_VERSION_COMPATIBLE TRUE) if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}") set(PACKAGE_VERSION_EXACT TRUE) endif() endif() else() set(PACKAGE_VERSION_COMPATIBLE FALSE) endif() ## Instruction: Allow win32 and win64 builds to exist in parallel. ## Code After: set(PACKAGE_VERSION "@PANGOLIN_VERSION@") # Check build type is valid if( "System:${CMAKE_SYSTEM_NAME},Win64:${CMAKE_CL_64},Android:${ANDROID},iOS:${IOS}" STREQUAL "System:@CMAKE_SYSTEM_NAME@,Win64:@CMAKE_CL_64@,Android:@ANDROID@,iOS:@IOS@" ) # Check whether the requested PACKAGE_FIND_VERSION is compatible if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") set(PACKAGE_VERSION_COMPATIBLE FALSE) else() set(PACKAGE_VERSION_COMPATIBLE TRUE) if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}") set(PACKAGE_VERSION_EXACT TRUE) endif() endif() else() set(PACKAGE_VERSION_COMPATIBLE FALSE) endif()
ac9eed9ecb2c00d494cdcdc6f2209ecfd8aac73e
sh/sh.d/clojure.sh
sh/sh.d/clojure.sh
clj () { if [[ $# -eq 0 ]]; then clojure -M:cljfmt:nrepl-dep:rebel:tools/repl -i ~/.clojure/src/my_repl.clj -m nrepl.cmdline -i -f my-repl/repl else command clj "$@" fi } -rlwrap! bb alias bbj='bb "(json/parse-stream *in* true)" | bb' export BABASHKA_PRELOADS='(defmacro $$ [& args] `(let [proc ^{:inherit true} (p/$ ~@args)] (p/check proc) nil))' # -rlwrap! shadow-cljs
clj () { if [[ $# -eq 0 ]]; then clojure -M:cljfmt:nrepl-dep:rebel:tools/repl -i ~/.clojure/src/my_repl.clj -m nrepl.cmdline -i -f my-repl/repl else command clj "$@" fi } alias cljs='clojure -M:rebel-cljs' -rlwrap! bb alias bbj='bb "(json/parse-stream *in* true)" | bb' export BABASHKA_PRELOADS='(defmacro $$ [& args] `(let [proc ^{:inherit true} (p/$ ~@args)] (p/check proc) nil))' # -rlwrap! shadow-cljs
Add alias for cljs with rebel readline
Add alias for cljs with rebel readline
Shell
mit
rwstauner/run_control,rwstauner/run_control,rwstauner/run_control,rwstauner/run_control,rwstauner/run_control
shell
## Code Before: clj () { if [[ $# -eq 0 ]]; then clojure -M:cljfmt:nrepl-dep:rebel:tools/repl -i ~/.clojure/src/my_repl.clj -m nrepl.cmdline -i -f my-repl/repl else command clj "$@" fi } -rlwrap! bb alias bbj='bb "(json/parse-stream *in* true)" | bb' export BABASHKA_PRELOADS='(defmacro $$ [& args] `(let [proc ^{:inherit true} (p/$ ~@args)] (p/check proc) nil))' # -rlwrap! shadow-cljs ## Instruction: Add alias for cljs with rebel readline ## Code After: clj () { if [[ $# -eq 0 ]]; then clojure -M:cljfmt:nrepl-dep:rebel:tools/repl -i ~/.clojure/src/my_repl.clj -m nrepl.cmdline -i -f my-repl/repl else command clj "$@" fi } alias cljs='clojure -M:rebel-cljs' -rlwrap! bb alias bbj='bb "(json/parse-stream *in* true)" | bb' export BABASHKA_PRELOADS='(defmacro $$ [& args] `(let [proc ^{:inherit true} (p/$ ~@args)] (p/check proc) nil))' # -rlwrap! shadow-cljs
5592e67be445dd54597c659113cb8f71e3d8e54a
Casks/virtualbox-beta.rb
Casks/virtualbox-beta.rb
cask :v1 => 'virtualbox-beta' do version '5.0.0_RC1-100731' sha256 '9cd0923966b83a0447b1bc4ea397971f3b1908ec974bb517637cf1e3a975573b' url "http://download.virtualbox.org/virtualbox/#{version.split('-')[0]}/VirtualBox-#{version}-OSX.dmg" homepage 'http://www.virtualbox.org' license :gpl pkg 'VirtualBox.pkg' uninstall :script => { :executable => 'VirtualBox_Uninstall.tool', :args => %w[--unattended] } end
cask :v1 => 'virtualbox-beta' do version '5.0.0_RC2-101271' sha256 '6ab15a281b30d60cf245aad3ef66deb72e87deacbcbfc660dfbbc5b8e7c8543d' url "http://download.virtualbox.org/virtualbox/#{version.split('-')[0]}/VirtualBox-#{version}-OSX.dmg" homepage 'http://www.virtualbox.org' license :gpl tags :vendor => 'Oracle' pkg 'VirtualBox.pkg' binary '/Applications/VirtualBox.app/Contents/MacOS/VBoxManage' binary '/Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless' uninstall :script => { :executable => 'VirtualBox_Uninstall.tool', :args => %w[--unattended] }, :pkgutil => 'org.virtualbox.pkg.*' end
Upgrade Virtualbox Beta to RC2-101271 and add tag,binary,pkgutil
Upgrade Virtualbox Beta to RC2-101271 and add tag,binary,pkgutil Signed-off-by: Koichi Shiraishi <[email protected]>
Ruby
bsd-2-clause
zsjohny/homebrew-versions,visualphoenix/homebrew-versions,noamross/homebrew-versions,pquentin/homebrew-versions,lukaselmer/homebrew-versions,coeligena/homebrew-verscustomized,lukasbestle/homebrew-versions,chadcatlett/caskroom-homebrew-versions,adjohnson916/homebrew-versions,bimmlerd/homebrew-versions,tomschlick/homebrew-versions,dictcp/homebrew-versions,elovelan/homebrew-versions,3van/homebrew-versions,nicday/homebrew-versions
ruby
## Code Before: cask :v1 => 'virtualbox-beta' do version '5.0.0_RC1-100731' sha256 '9cd0923966b83a0447b1bc4ea397971f3b1908ec974bb517637cf1e3a975573b' url "http://download.virtualbox.org/virtualbox/#{version.split('-')[0]}/VirtualBox-#{version}-OSX.dmg" homepage 'http://www.virtualbox.org' license :gpl pkg 'VirtualBox.pkg' uninstall :script => { :executable => 'VirtualBox_Uninstall.tool', :args => %w[--unattended] } end ## Instruction: Upgrade Virtualbox Beta to RC2-101271 and add tag,binary,pkgutil Signed-off-by: Koichi Shiraishi <[email protected]> ## Code After: cask :v1 => 'virtualbox-beta' do version '5.0.0_RC2-101271' sha256 '6ab15a281b30d60cf245aad3ef66deb72e87deacbcbfc660dfbbc5b8e7c8543d' url "http://download.virtualbox.org/virtualbox/#{version.split('-')[0]}/VirtualBox-#{version}-OSX.dmg" homepage 'http://www.virtualbox.org' license :gpl tags :vendor => 'Oracle' pkg 'VirtualBox.pkg' binary '/Applications/VirtualBox.app/Contents/MacOS/VBoxManage' binary '/Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless' uninstall :script => { :executable => 'VirtualBox_Uninstall.tool', :args => %w[--unattended] }, :pkgutil => 'org.virtualbox.pkg.*' end
7d8ca7ec282f8e13f4b8499aa7c70441cb845a32
README.md
README.md
Stinking Rich ============= Stinking rich is a board game created to test the [AshleyCPP](https://github.com/SgtCoDFish/AshleyCPP) engine. The game is inspired by a popular board game.
Stinking Rich ============= Stinking rich is a board game created to test the [AshleyCPP](https://github.com/SgtCoDFish/AshleyCPP) engine. The game is inspired by a popular board game. How to Play =========== The game has three players. You can buy properties you land on, and other players who land on the property are charged. The goal is to be the richest player; there is no "end point" to speak of so far. Controls ======== Space: Roll the dice and move. Mouse: Click on "Yes" or "No" options to buy property.
Update readme with controls and how to play
Update readme with controls and how to play
Markdown
apache-2.0
SgtCoDFish/StinkingRich
markdown
## Code Before: Stinking Rich ============= Stinking rich is a board game created to test the [AshleyCPP](https://github.com/SgtCoDFish/AshleyCPP) engine. The game is inspired by a popular board game. ## Instruction: Update readme with controls and how to play ## Code After: Stinking Rich ============= Stinking rich is a board game created to test the [AshleyCPP](https://github.com/SgtCoDFish/AshleyCPP) engine. The game is inspired by a popular board game. How to Play =========== The game has three players. You can buy properties you land on, and other players who land on the property are charged. The goal is to be the richest player; there is no "end point" to speak of so far. Controls ======== Space: Roll the dice and move. Mouse: Click on "Yes" or "No" options to buy property.
42276014d097db37fc733c31d89530c49eb77325
.github/ISSUE_TEMPLATE.md
.github/ISSUE_TEMPLATE.md
[Description of the issue] ### Demo [If possible, include a demo of your issue in a fork of this JSFiddle: https://jsfiddle.net/mattboldt/1xs3LLmL/] ### Steps to Reproduce 1. [First Step] 2. [Second Step] 3. [and so on...] **Expected behavior:** [What you expect to happen] **Actual behavior:** [What actually happens] **Reproduces how often:** [What percentage of the time does it reproduce?] ### Additional Information Any additional information, configuration or data that might be necessary to reproduce the issue.
<!-- IMPORTANT: Please use the following format to create a new issue. If your issue was not created using the format below, it will be closed immediately. --> ### Description [Description of the issue] ### Demo [If possible, include a demo of your issue in a fork of this JSFiddle: https://jsfiddle.net/mattboldt/1xs3LLmL/] ### Steps to Reproduce 1. [First Step] 2. [Second Step] 3. [and so on...] **Expected behavior:** [What you expect to happen] **Actual behavior:** [What actually happens] **Reproduces how often:** [What percentage of the time does it reproduce?] ### Additional Information Any additional information, configuration or data that might be necessary to reproduce the issue.
Add important notice to issue template
Add important notice to issue template
Markdown
mit
mattboldt/typed.js,mattboldt/typed.js,nsina/typed.js,nsina/typed.js
markdown
## Code Before: [Description of the issue] ### Demo [If possible, include a demo of your issue in a fork of this JSFiddle: https://jsfiddle.net/mattboldt/1xs3LLmL/] ### Steps to Reproduce 1. [First Step] 2. [Second Step] 3. [and so on...] **Expected behavior:** [What you expect to happen] **Actual behavior:** [What actually happens] **Reproduces how often:** [What percentage of the time does it reproduce?] ### Additional Information Any additional information, configuration or data that might be necessary to reproduce the issue. ## Instruction: Add important notice to issue template ## Code After: <!-- IMPORTANT: Please use the following format to create a new issue. If your issue was not created using the format below, it will be closed immediately. --> ### Description [Description of the issue] ### Demo [If possible, include a demo of your issue in a fork of this JSFiddle: https://jsfiddle.net/mattboldt/1xs3LLmL/] ### Steps to Reproduce 1. [First Step] 2. [Second Step] 3. [and so on...] **Expected behavior:** [What you expect to happen] **Actual behavior:** [What actually happens] **Reproduces how often:** [What percentage of the time does it reproduce?] ### Additional Information Any additional information, configuration or data that might be necessary to reproduce the issue.
4471d122b36a5317ed8f720b49c7dce079745706
README.md
README.md
Simple webapp for tracking usage of company-owned testing devices ### Technology - angular - express ### Getting Started - Setup node modules: ```npm install``` - Build project: ```npm run build``` - Run the express server on localhost: ```node app.js```
Simple webapp for tracking usage of company-owned testing devices ### Technology - angular - express ### Getting Started - Setup node modules: ```npm install``` - Build project: ```npm run build``` - Run the express server on localhost: ```node app.js``` ### Important To Note - Build process will not run successfully on Windows
Update docs to note build issue on Windows
Update docs to note build issue on Windows
Markdown
mit
diminutivesloop/device-checkout-app,diminutivesloop/device-checkout-app
markdown
## Code Before: Simple webapp for tracking usage of company-owned testing devices ### Technology - angular - express ### Getting Started - Setup node modules: ```npm install``` - Build project: ```npm run build``` - Run the express server on localhost: ```node app.js``` ## Instruction: Update docs to note build issue on Windows ## Code After: Simple webapp for tracking usage of company-owned testing devices ### Technology - angular - express ### Getting Started - Setup node modules: ```npm install``` - Build project: ```npm run build``` - Run the express server on localhost: ```node app.js``` ### Important To Note - Build process will not run successfully on Windows
867c4a545b9434d5f7e7ed1db2d3e9fd2e0a4a71
circle.yml
circle.yml
machine: python: version: 3.4.3 dependencies: pre: - sudo pip install -U awscli post: - pip install https://github.com/facelessuser/pymdown-extensions/archive/master.zip test: override: - echo 'no tests :·(' deployment: staging: branch: master commands: - ./deploy dev production: branch: production commands: - ./deploy prod
machine: python: version: 3.4.3 dependencies: pre: - sudo pip install -U awscli - rm -rf node_modules # Force npm install to fetch styleguide from remote server post: - pip install https://github.com/facelessuser/pymdown-extensions/archive/master.zip test: override: - echo 'no tests :·(' deployment: staging: branch: master commands: - ./deploy dev production: branch: production commands: - ./deploy prod
Clear npm cache on deploy
Clear npm cache on deploy
YAML
mit
mapzen/mapzen-docs-generator,mapzen/documentation,mapzen/mapzen-docs-generator,mapzen/documentation,mapzen/documentation,mapzen/mapzen-docs-generator,mapzen/mapzen-docs-generator,mapzen/documentation
yaml
## Code Before: machine: python: version: 3.4.3 dependencies: pre: - sudo pip install -U awscli post: - pip install https://github.com/facelessuser/pymdown-extensions/archive/master.zip test: override: - echo 'no tests :·(' deployment: staging: branch: master commands: - ./deploy dev production: branch: production commands: - ./deploy prod ## Instruction: Clear npm cache on deploy ## Code After: machine: python: version: 3.4.3 dependencies: pre: - sudo pip install -U awscli - rm -rf node_modules # Force npm install to fetch styleguide from remote server post: - pip install https://github.com/facelessuser/pymdown-extensions/archive/master.zip test: override: - echo 'no tests :·(' deployment: staging: branch: master commands: - ./deploy dev production: branch: production commands: - ./deploy prod
8daa9d0553fa28e835e1d4777cb8d93dda24d63f
generate-key-and-send.sh
generate-key-and-send.sh
KEYSIZE=2048 PASSPHRASE= FILENAME=~/.ssh/id_test KEYTYPE=rsa HOST=host USER=username # # NO MORE CONFIG SETTING BELOW THIS LINE # # check that we have all necessary parts wich ssh-keygen && which ssh-copy-id && which ssh RET=$? if [ $RET -ne 0 ];then echo Could not find the required tools, needed are 'ssh', 'ssh-keygen', 'ssh-copy-id': $RET exit 1 fi # perform the actual work ssh-keygen -t $KEYTYPE -b $KEYSIZE -f $FILENAME -N "$PASSPHRASE" RET=$? if [ $RET -ne 0 ];then echo ssh-keygen failed: $RET exit 1 fi ssh-copy-id -i $FILENAME $USER@$HOST RET=$? if [ $RET -ne 0 ];then echo ssh-copy-id failed: $RET exit 1 fi ssh $USER@$HOST "chmod go-w ~ && chmod 700 ~/.ssh && chmod 600 ~/.ssh/authorized_keys" RET=$? if [ $RET -ne 0 ];then echo ssh-chmod failed: $RET exit 1 fi
KEYSIZE=2048 PASSPHRASE= FILENAME=~/.ssh/id_test KEYTYPE=rsa HOST=host USER=username # # NO MORE CONFIG SETTING BELOW THIS LINE # # check that we have all necessary parts wich ssh-keygen && which ssh-copy-id && which ssh RET=$? if [ $RET -ne 0 ];then echo Could not find the required tools, needed are 'ssh', 'ssh-keygen', 'ssh-copy-id': $RET exit 1 fi # perform the actual work ssh-keygen -t $KEYTYPE -b $KEYSIZE -f $FILENAME -N "$PASSPHRASE" RET=$? if [ $RET -ne 0 ];then echo ssh-keygen failed: $RET exit 1 fi ssh-copy-id -i $FILENAME $USER@$HOST RET=$? if [ $RET -ne 0 ];then echo ssh-copy-id failed: $RET exit 1 fi ssh $USER@$HOST "chmod go-w ~ && chmod 700 ~/.ssh && chmod 600 ~/.ssh/authorized_keys" RET=$? if [ $RET -ne 0 ];then echo ssh-chmod failed: $RET exit 1 fi echo Setup finished, now try to run ssh -i $FILENAME $USER/$HOST
Add echo at the end
Add echo at the end
Shell
apache-2.0
centic9/generate-and-send-ssh-key
shell
## Code Before: KEYSIZE=2048 PASSPHRASE= FILENAME=~/.ssh/id_test KEYTYPE=rsa HOST=host USER=username # # NO MORE CONFIG SETTING BELOW THIS LINE # # check that we have all necessary parts wich ssh-keygen && which ssh-copy-id && which ssh RET=$? if [ $RET -ne 0 ];then echo Could not find the required tools, needed are 'ssh', 'ssh-keygen', 'ssh-copy-id': $RET exit 1 fi # perform the actual work ssh-keygen -t $KEYTYPE -b $KEYSIZE -f $FILENAME -N "$PASSPHRASE" RET=$? if [ $RET -ne 0 ];then echo ssh-keygen failed: $RET exit 1 fi ssh-copy-id -i $FILENAME $USER@$HOST RET=$? if [ $RET -ne 0 ];then echo ssh-copy-id failed: $RET exit 1 fi ssh $USER@$HOST "chmod go-w ~ && chmod 700 ~/.ssh && chmod 600 ~/.ssh/authorized_keys" RET=$? if [ $RET -ne 0 ];then echo ssh-chmod failed: $RET exit 1 fi ## Instruction: Add echo at the end ## Code After: KEYSIZE=2048 PASSPHRASE= FILENAME=~/.ssh/id_test KEYTYPE=rsa HOST=host USER=username # # NO MORE CONFIG SETTING BELOW THIS LINE # # check that we have all necessary parts wich ssh-keygen && which ssh-copy-id && which ssh RET=$? if [ $RET -ne 0 ];then echo Could not find the required tools, needed are 'ssh', 'ssh-keygen', 'ssh-copy-id': $RET exit 1 fi # perform the actual work ssh-keygen -t $KEYTYPE -b $KEYSIZE -f $FILENAME -N "$PASSPHRASE" RET=$? if [ $RET -ne 0 ];then echo ssh-keygen failed: $RET exit 1 fi ssh-copy-id -i $FILENAME $USER@$HOST RET=$? if [ $RET -ne 0 ];then echo ssh-copy-id failed: $RET exit 1 fi ssh $USER@$HOST "chmod go-w ~ && chmod 700 ~/.ssh && chmod 600 ~/.ssh/authorized_keys" RET=$? if [ $RET -ne 0 ];then echo ssh-chmod failed: $RET exit 1 fi echo Setup finished, now try to run ssh -i $FILENAME $USER/$HOST
7b378b1550be5a91500fbaf074c2847fa601cee2
.gitlab-ci.yml
.gitlab-ci.yml
image: ubuntu:latest before_script: - apt-get update - apt-get install -qq git build-essential cmake doxygen cppcheck my_project: script: - mkdir build && cd build - cmake .. - make
image: ubuntu:latest stages: - build before_script: - apt-get update - apt-get install -qq git build-essential cmake doxygen cppcheck build:linux: stage: build script: - mkdir build && cd build - cmake .. - make
Add stage info to gitlab
Add stage info to gitlab
YAML
apache-2.0
Mizux/snippets,Mizux/snippets
yaml
## Code Before: image: ubuntu:latest before_script: - apt-get update - apt-get install -qq git build-essential cmake doxygen cppcheck my_project: script: - mkdir build && cd build - cmake .. - make ## Instruction: Add stage info to gitlab ## Code After: image: ubuntu:latest stages: - build before_script: - apt-get update - apt-get install -qq git build-essential cmake doxygen cppcheck build:linux: stage: build script: - mkdir build && cd build - cmake .. - make
4e5f3bd442d7637403d8ff25624331338b04fa1f
app/controls/controls.ls
app/controls/controls.ls
app = angular.module 'recess.controls' app.controller 'ControlsController', [ '$scope' '$http' 'PageTitle' ($scope, $http, PageTitle) -> $scope.notNull = (group) -> group.group_id > 0 $scope.addFeed = (url) -> $http.post '/api/feed/add', { url } ..then ({data, status, headers}:res) -> alert status $scope.loadChan = (title) -> PageTitle.setTitle title $http.get '/api/channels' ..success (data, status, headers) -> $scope.channels = data ] app.directive 'LoadSpinner', { restrict: 'A' scope: {} controller: [ '$scope' '$http' !($scope, $http) -> ] link: !(scope, element, attrs) -> }
app = angular.module 'recess.controls' app.controller 'ControlsController', [ '$scope' '$http' 'PageTitle' ($scope, $http, PageTitle) -> $scope.notNull = (group) -> group.group_id > 0 $scope.addFeed = (url) -> $http.post '/api/feed/add', { url } ..then ({data, status, headers}:res) -> alert status $scope.loadChan = (title) -> PageTitle.setTitle title $http.get '/api/channels' ..success (data, status, headers) -> $scope.channels = data ]
Remove the load spinner directive for another day
Remove the load spinner directive for another day
LiveScript
bsd-3-clause
Zariel/lesandi
livescript
## Code Before: app = angular.module 'recess.controls' app.controller 'ControlsController', [ '$scope' '$http' 'PageTitle' ($scope, $http, PageTitle) -> $scope.notNull = (group) -> group.group_id > 0 $scope.addFeed = (url) -> $http.post '/api/feed/add', { url } ..then ({data, status, headers}:res) -> alert status $scope.loadChan = (title) -> PageTitle.setTitle title $http.get '/api/channels' ..success (data, status, headers) -> $scope.channels = data ] app.directive 'LoadSpinner', { restrict: 'A' scope: {} controller: [ '$scope' '$http' !($scope, $http) -> ] link: !(scope, element, attrs) -> } ## Instruction: Remove the load spinner directive for another day ## Code After: app = angular.module 'recess.controls' app.controller 'ControlsController', [ '$scope' '$http' 'PageTitle' ($scope, $http, PageTitle) -> $scope.notNull = (group) -> group.group_id > 0 $scope.addFeed = (url) -> $http.post '/api/feed/add', { url } ..then ({data, status, headers}:res) -> alert status $scope.loadChan = (title) -> PageTitle.setTitle title $http.get '/api/channels' ..success (data, status, headers) -> $scope.channels = data ]
6a870c1ea1e879eb0c7268bdc02fedceb586351b
app/views/delayed/web/jobs/show.html.erb
app/views/delayed/web/jobs/show.html.erb
<% title "#{t('delayed/web.views.job')} ##{job.id}" %> <div class="page-header"> <h1> <%= link_to t('delayed/web.views.jobs'), jobs_path %> / <%= title %> </h1> <div class="btn-group"> <% if job.can_queue? %> <%= button_to t('delayed/web.views.buttons.run_next'), queue_job_path(job), method: :put, class: 'btn', form_class: 'btn-rails pull-left' %> <% end %> <% if job.can_destroy? %> <%= button_to t('delayed/web.views.buttons.delete'), job_path(job), method: :delete, class: 'btn btn-danger', form_class: 'btn-rails pull-right' %> <% end %> </div> </div> <h2><%= t('delayed/web.views.last_error') %></h2> <% if job.last_error.present? %> <pre><%= job.last_error %></pre> <% else %> <span class="label label-success"><%= t('delayed/web.views.errors.empty') %></span> <% end %> <h2><%= t('delayed/web.views.handler') %></h2> <pre><%= job.handler %></pre>
<% title "#{t('delayed/web.views.job')} ##{job.id}" %> <div class="page-header"> <h1> <%= link_to t('delayed/web.views.jobs'), jobs_path %> / <%= title %> </h1> <div class="btn-group"> <% if job.can_queue? %> <%= button_to t('delayed/web.views.buttons.run_next'), queue_job_path(job), method: :put, class: 'btn', form_class: 'btn-rails pull-left' %> <% end %> <% if job.can_destroy? %> <%= button_to t('delayed/web.views.buttons.delete'), job_path(job), method: :delete, class: 'btn btn-danger', form_class: 'btn-rails pull-right' %> <% end %> </div> </div> <h2><%= t('delayed/web.views.status') %></h2> <p class="<%= status_dom_class(job.status) %>"> <%= t(job.status, scope: 'delayed/web.views.statuses').capitalize %> </p> <h2><%= t('delayed/web.views.last_error') %></h2> <% if job.last_error.present? %> <pre><%= job.last_error %></pre> <% else %> <p class="label label-success"><%= t('delayed/web.views.errors.empty') %></p> <% end %> <h2><%= t('delayed/web.views.handler') %></h2> <pre><%= job.handler %></pre>
Add job status information in show view
Add job status information in show view
HTML+ERB
mit
thebestday/delayed-web,thebestday/delayed-web,thebestday/delayed-web
html+erb
## Code Before: <% title "#{t('delayed/web.views.job')} ##{job.id}" %> <div class="page-header"> <h1> <%= link_to t('delayed/web.views.jobs'), jobs_path %> / <%= title %> </h1> <div class="btn-group"> <% if job.can_queue? %> <%= button_to t('delayed/web.views.buttons.run_next'), queue_job_path(job), method: :put, class: 'btn', form_class: 'btn-rails pull-left' %> <% end %> <% if job.can_destroy? %> <%= button_to t('delayed/web.views.buttons.delete'), job_path(job), method: :delete, class: 'btn btn-danger', form_class: 'btn-rails pull-right' %> <% end %> </div> </div> <h2><%= t('delayed/web.views.last_error') %></h2> <% if job.last_error.present? %> <pre><%= job.last_error %></pre> <% else %> <span class="label label-success"><%= t('delayed/web.views.errors.empty') %></span> <% end %> <h2><%= t('delayed/web.views.handler') %></h2> <pre><%= job.handler %></pre> ## Instruction: Add job status information in show view ## Code After: <% title "#{t('delayed/web.views.job')} ##{job.id}" %> <div class="page-header"> <h1> <%= link_to t('delayed/web.views.jobs'), jobs_path %> / <%= title %> </h1> <div class="btn-group"> <% if job.can_queue? %> <%= button_to t('delayed/web.views.buttons.run_next'), queue_job_path(job), method: :put, class: 'btn', form_class: 'btn-rails pull-left' %> <% end %> <% if job.can_destroy? %> <%= button_to t('delayed/web.views.buttons.delete'), job_path(job), method: :delete, class: 'btn btn-danger', form_class: 'btn-rails pull-right' %> <% end %> </div> </div> <h2><%= t('delayed/web.views.status') %></h2> <p class="<%= status_dom_class(job.status) %>"> <%= t(job.status, scope: 'delayed/web.views.statuses').capitalize %> </p> <h2><%= t('delayed/web.views.last_error') %></h2> <% if job.last_error.present? %> <pre><%= job.last_error %></pre> <% else %> <p class="label label-success"><%= t('delayed/web.views.errors.empty') %></p> <% end %> <h2><%= t('delayed/web.views.handler') %></h2> <pre><%= job.handler %></pre>
23cc8a3cc86e02156d92e284836076d068a5bade
lib/embersketch.rb
lib/embersketch.rb
require "embersketch/version" require 'thor' module EmberSketch class EmberSketch < Thor include Thor::Actions desc "new PROJECT_NAME", "Creates a new Ember Sketch project in a directory called PROJECT_NAME" def new(project_name) create_directory_structure(project_name) end def source_paths [File.join(File.expand_path(File.dirname(__FILE__)), ".")] end private def create_directory_structure(project_name) empty_directory project_name directory("./templates", "#{project_name}/.") say "Running bundler...", :green run("cd #{project_name} && bundle") say "Launch your ember sketch with: bundle exec middleman", :green end end end
require "embersketch/version" require 'thor' module EmberSketch class EmberSketch < Thor include Thor::Actions desc "new PROJECT_NAME", "Creates a new Ember Sketch project in a directory called PROJECT_NAME" def new(project_name) create_directory_structure(project_name) end no_commands do def source_paths [File.join(File.expand_path(File.dirname(__FILE__)), ".")] end end private def create_directory_structure(project_name) empty_directory project_name directory("./templates", "#{project_name}/.") say "Running bundler...", :green run("cd #{project_name} && bundle") say "Launch your ember sketch with: bundle exec middleman", :green end end end
Use no_commands block for sources
Use no_commands block for sources
Ruby
mit
emberzone/ember_sketch
ruby
## Code Before: require "embersketch/version" require 'thor' module EmberSketch class EmberSketch < Thor include Thor::Actions desc "new PROJECT_NAME", "Creates a new Ember Sketch project in a directory called PROJECT_NAME" def new(project_name) create_directory_structure(project_name) end def source_paths [File.join(File.expand_path(File.dirname(__FILE__)), ".")] end private def create_directory_structure(project_name) empty_directory project_name directory("./templates", "#{project_name}/.") say "Running bundler...", :green run("cd #{project_name} && bundle") say "Launch your ember sketch with: bundle exec middleman", :green end end end ## Instruction: Use no_commands block for sources ## Code After: require "embersketch/version" require 'thor' module EmberSketch class EmberSketch < Thor include Thor::Actions desc "new PROJECT_NAME", "Creates a new Ember Sketch project in a directory called PROJECT_NAME" def new(project_name) create_directory_structure(project_name) end no_commands do def source_paths [File.join(File.expand_path(File.dirname(__FILE__)), ".")] end end private def create_directory_structure(project_name) empty_directory project_name directory("./templates", "#{project_name}/.") say "Running bundler...", :green run("cd #{project_name} && bundle") say "Launch your ember sketch with: bundle exec middleman", :green end end end
c722958694b0098345995b5c59a7aeeac7ec6262
tests/integration/connect-test.js
tests/integration/connect-test.js
import Socket from 'src/socket' import {LongPoll} from 'src/transports' import {pause, resume} from 'tests/utils' QUnit.test('can connect', function(assert){ assert.expect(1) let socket = new Socket("ws://localhost:4000/socket", {transport: LongPoll}) socket.connect() let channel = socket.channel("rooms:lobby", {}) // pause QUnit so that we can wait for an asynchronous response pause(assert) channel .join() .receive("ok", resp => { assert.ok(true, "A join response was received") // a response was received, continue with tests resume(assert) }) });
import Socket from 'src/socket' import {WebSocket, LongPoll} from 'src/transports' import {pause, resume} from 'tests/utils' [{name: 'WebSocket', klass: WebSocket}, {name: 'LongPoll', klass: LongPoll}].forEach(item => { const {name, klass} = item QUnit.test(`${name} can connect`, function(assert){ assert.expect(2) let socket = new Socket("ws://localhost:4000/socket", {transport: klass}) socket.connect() let channel = socket.channel("rooms:lobby", {}) // pause QUnit so that we can wait for an asynchronous response pause(assert) channel .join() .receive("ok", resp => { assert.ok(true, "A join response was received") channel .push("ping", {lang: "Elixir"}) .receive("ok", resp => { assert.ok(true, "Message echoed") resume(assert) }) }) }); })
Test basic connection and message sending for both transports
Test basic connection and message sending for both transports
JavaScript
mit
jerel/phoenix_js
javascript
## Code Before: import Socket from 'src/socket' import {LongPoll} from 'src/transports' import {pause, resume} from 'tests/utils' QUnit.test('can connect', function(assert){ assert.expect(1) let socket = new Socket("ws://localhost:4000/socket", {transport: LongPoll}) socket.connect() let channel = socket.channel("rooms:lobby", {}) // pause QUnit so that we can wait for an asynchronous response pause(assert) channel .join() .receive("ok", resp => { assert.ok(true, "A join response was received") // a response was received, continue with tests resume(assert) }) }); ## Instruction: Test basic connection and message sending for both transports ## Code After: import Socket from 'src/socket' import {WebSocket, LongPoll} from 'src/transports' import {pause, resume} from 'tests/utils' [{name: 'WebSocket', klass: WebSocket}, {name: 'LongPoll', klass: LongPoll}].forEach(item => { const {name, klass} = item QUnit.test(`${name} can connect`, function(assert){ assert.expect(2) let socket = new Socket("ws://localhost:4000/socket", {transport: klass}) socket.connect() let channel = socket.channel("rooms:lobby", {}) // pause QUnit so that we can wait for an asynchronous response pause(assert) channel .join() .receive("ok", resp => { assert.ok(true, "A join response was received") channel .push("ping", {lang: "Elixir"}) .receive("ok", resp => { assert.ok(true, "Message echoed") resume(assert) }) }) }); })
925d2279ed593eb23f2618082a107077e2328aba
src/main/java/seedu/tache/logic/parser/SaveCommandParser.java
src/main/java/seedu/tache/logic/parser/SaveCommandParser.java
//@@author A0139961U package seedu.tache.logic.parser; import static seedu.tache.commons.core.Messages.MESSAGE_INVALID_DIRECTORY; import java.io.File; import seedu.tache.logic.commands.Command; import seedu.tache.logic.commands.IncorrectCommand; import seedu.tache.logic.commands.SaveCommand; /** * Parses input arguments and creates a new SaveCommand object */ public class SaveCommandParser { /** * Parses the given {@code String} of arguments in the context of the SaveCommand * and returns an SaveCommand object for execution. */ public Command parse(String args) { File directory = new File(args.trim()); if (!directory.exists()) { directory.mkdir(); } if (directory.isDirectory()) { return new SaveCommand(args.trim()); } else { return new IncorrectCommand( String.format(MESSAGE_INVALID_DIRECTORY, SaveCommand.MESSAGE_USAGE)); } } }
//@@author A0139961U package seedu.tache.logic.parser; import static seedu.tache.commons.core.Messages.MESSAGE_INVALID_DIRECTORY; import java.io.File; import seedu.tache.logic.commands.Command; import seedu.tache.logic.commands.IncorrectCommand; import seedu.tache.logic.commands.SaveCommand; /** * Parses input arguments and creates a new SaveCommand object */ public class SaveCommandParser { /** * Parses the given {@code String} of arguments in the context of the SaveCommand * and returns an SaveCommand object for execution. */ public Command parse(String args) { if (!(Character.toString(args.trim().charAt(0)).equals("/")) && !(Character.toString(args.trim().charAt(0)).equals("\\"))) { File directory = new File(args.trim()); if (!directory.exists()) { directory.mkdir(); } if (directory.isDirectory()) { return new SaveCommand(args.trim()); } else { return new IncorrectCommand( String.format(MESSAGE_INVALID_DIRECTORY, SaveCommand.MESSAGE_USAGE)); } } else { return new IncorrectCommand( String.format(MESSAGE_INVALID_DIRECTORY, SaveCommand.MESSAGE_USAGE)); } } }
Fix bug when user enter "/" or "\" as directory
Fix bug when user enter "/" or "\" as directory #221
Java
mit
CS2103JAN2017-T09-B4/main,CS2103JAN2017-T09-B4/main,CS2103JAN2017-T09-B4/main
java
## Code Before: //@@author A0139961U package seedu.tache.logic.parser; import static seedu.tache.commons.core.Messages.MESSAGE_INVALID_DIRECTORY; import java.io.File; import seedu.tache.logic.commands.Command; import seedu.tache.logic.commands.IncorrectCommand; import seedu.tache.logic.commands.SaveCommand; /** * Parses input arguments and creates a new SaveCommand object */ public class SaveCommandParser { /** * Parses the given {@code String} of arguments in the context of the SaveCommand * and returns an SaveCommand object for execution. */ public Command parse(String args) { File directory = new File(args.trim()); if (!directory.exists()) { directory.mkdir(); } if (directory.isDirectory()) { return new SaveCommand(args.trim()); } else { return new IncorrectCommand( String.format(MESSAGE_INVALID_DIRECTORY, SaveCommand.MESSAGE_USAGE)); } } } ## Instruction: Fix bug when user enter "/" or "\" as directory #221 ## Code After: //@@author A0139961U package seedu.tache.logic.parser; import static seedu.tache.commons.core.Messages.MESSAGE_INVALID_DIRECTORY; import java.io.File; import seedu.tache.logic.commands.Command; import seedu.tache.logic.commands.IncorrectCommand; import seedu.tache.logic.commands.SaveCommand; /** * Parses input arguments and creates a new SaveCommand object */ public class SaveCommandParser { /** * Parses the given {@code String} of arguments in the context of the SaveCommand * and returns an SaveCommand object for execution. */ public Command parse(String args) { if (!(Character.toString(args.trim().charAt(0)).equals("/")) && !(Character.toString(args.trim().charAt(0)).equals("\\"))) { File directory = new File(args.trim()); if (!directory.exists()) { directory.mkdir(); } if (directory.isDirectory()) { return new SaveCommand(args.trim()); } else { return new IncorrectCommand( String.format(MESSAGE_INVALID_DIRECTORY, SaveCommand.MESSAGE_USAGE)); } } else { return new IncorrectCommand( String.format(MESSAGE_INVALID_DIRECTORY, SaveCommand.MESSAGE_USAGE)); } } }
9cb9d25b447f4e88f54398149fa7f01e57d54145
index.html
index.html
<!DOCTYPE html> <html lang="en"> <head> <title> Micro Holding Cooperativism </title> <style> body { margin: 0; padding: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid red; } a { width: 50%; } </style> </head> <body> <a href="https://github.com/Micro-Holding-Cooperativism/roadmap" target="_blank"> <img src="assets/logo.svg"> </a> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <title> Micro Holding Cooperativism </title> <style> body { margin: 0; padding: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; } a { width: 50%; } </style> </head> <body> <a href="https://github.com/Micro-Holding-Cooperativism/roadmap" target="_blank"> <img src="assets/logo.svg"> </a> </body> </html>
UPDATE remove red border from website
UPDATE remove red border from website
HTML
mit
Micro-Holding-Co-Ownership/micro-holding-co-ownership.github.io
html
## Code Before: <!DOCTYPE html> <html lang="en"> <head> <title> Micro Holding Cooperativism </title> <style> body { margin: 0; padding: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid red; } a { width: 50%; } </style> </head> <body> <a href="https://github.com/Micro-Holding-Cooperativism/roadmap" target="_blank"> <img src="assets/logo.svg"> </a> </body> </html> ## Instruction: UPDATE remove red border from website ## Code After: <!DOCTYPE html> <html lang="en"> <head> <title> Micro Holding Cooperativism </title> <style> body { margin: 0; padding: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; } a { width: 50%; } </style> </head> <body> <a href="https://github.com/Micro-Holding-Cooperativism/roadmap" target="_blank"> <img src="assets/logo.svg"> </a> </body> </html>