commit stringlengths 40 40 | old_file stringlengths 4 184 | new_file stringlengths 4 184 | old_contents stringlengths 1 3.6k | new_contents stringlengths 5 3.38k | subject stringlengths 15 778 | message stringlengths 16 6.74k | lang stringclasses 201 values | license stringclasses 13 values | repos stringlengths 6 116k | config stringclasses 201 values | content stringlengths 137 7.24k | diff stringlengths 26 5.55k | diff_length int64 1 123 | relative_diff_length float64 0.01 89 | n_lines_added int64 0 108 | n_lines_deleted int64 0 106 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
48aeb44374abc3baae4bb098f9e94dea26c91494 | index.js | index.js |
var opts = require('optimist').argv
var through = require('through2');
function indexhtmlify(opts) {
var s = through(function onwrite(chunk, enc, cb) {
s.push(chunk)
cb()
}, function onend(cb) {
s.push('</script>\n')
s.push('</html>\n')
cb()
})
s.push('<!DOCTYPE html>\n')
s.push('<html>\n')
s.push('<head>\n')
s.push('<title>---</title>\n')
s.push('<meta content="width=device-width, initial-scale=1.0, ' +
'maximum-scale=1.0, user-scalable=0" name="viewport" />\n')
s.push('<meta charset=utf-8></head>\n')
if (opts.style) {
s.push('<style>\n')
s.push(require('fs').readFileSync(opts.style, 'utf8'))
s.push('</style>\n')
}
s.push('<body></body>\n')
s.push('<script language=javascript>\n')
return s
}
module.exports = indexhtmlify
if (require.main === module) {
if(process.stdin.isTTY) {
console.error('USAGE: browserify client.js | indexhtmlify ' +
'--style style.css > index.html')
process.exit(1)
}
process.stdin
.pipe(indexhtmlify(opts))
.pipe(process.stdout)
}
|
var opts = require('optimist').argv
var through = require('through2');
function indexhtmlify(opts) {
opts = opts || {}
var s = through(function onwrite(chunk, enc, cb) {
s.push(chunk)
cb()
}, function onend(cb) {
s.push('</script>\n')
s.push('</html>\n')
cb()
})
s.push('<!DOCTYPE html>\n')
s.push('<html>\n')
s.push('<head>\n')
s.push('<title>' + (opts.title || '---') + '</title>\n')
s.push('<meta content="width=device-width, initial-scale=1.0, ' +
'maximum-scale=1.0, user-scalable=0" name="viewport" />\n')
s.push('<meta charset=utf-8></head>\n')
if (opts.style) {
s.push('<style>\n')
s.push(require('fs').readFileSync(opts.style, 'utf8'))
s.push('</style>\n')
}
s.push('<body></body>\n')
s.push('<script language=javascript>\n')
return s
}
module.exports = indexhtmlify
if (require.main === module) {
if(process.stdin.isTTY) {
console.error('USAGE: browserify client.js | indexhtmlify ' +
'--style style.css > index.html')
process.exit(1)
}
process.stdin
.pipe(indexhtmlify(opts))
.pipe(process.stdout)
}
| Allow passing in a title | Allow passing in a title
| JavaScript | mit | dominictarr/indexhtmlify | javascript | ## Code Before:
var opts = require('optimist').argv
var through = require('through2');
function indexhtmlify(opts) {
var s = through(function onwrite(chunk, enc, cb) {
s.push(chunk)
cb()
}, function onend(cb) {
s.push('</script>\n')
s.push('</html>\n')
cb()
})
s.push('<!DOCTYPE html>\n')
s.push('<html>\n')
s.push('<head>\n')
s.push('<title>---</title>\n')
s.push('<meta content="width=device-width, initial-scale=1.0, ' +
'maximum-scale=1.0, user-scalable=0" name="viewport" />\n')
s.push('<meta charset=utf-8></head>\n')
if (opts.style) {
s.push('<style>\n')
s.push(require('fs').readFileSync(opts.style, 'utf8'))
s.push('</style>\n')
}
s.push('<body></body>\n')
s.push('<script language=javascript>\n')
return s
}
module.exports = indexhtmlify
if (require.main === module) {
if(process.stdin.isTTY) {
console.error('USAGE: browserify client.js | indexhtmlify ' +
'--style style.css > index.html')
process.exit(1)
}
process.stdin
.pipe(indexhtmlify(opts))
.pipe(process.stdout)
}
## Instruction:
Allow passing in a title
## Code After:
var opts = require('optimist').argv
var through = require('through2');
function indexhtmlify(opts) {
opts = opts || {}
var s = through(function onwrite(chunk, enc, cb) {
s.push(chunk)
cb()
}, function onend(cb) {
s.push('</script>\n')
s.push('</html>\n')
cb()
})
s.push('<!DOCTYPE html>\n')
s.push('<html>\n')
s.push('<head>\n')
s.push('<title>' + (opts.title || '---') + '</title>\n')
s.push('<meta content="width=device-width, initial-scale=1.0, ' +
'maximum-scale=1.0, user-scalable=0" name="viewport" />\n')
s.push('<meta charset=utf-8></head>\n')
if (opts.style) {
s.push('<style>\n')
s.push(require('fs').readFileSync(opts.style, 'utf8'))
s.push('</style>\n')
}
s.push('<body></body>\n')
s.push('<script language=javascript>\n')
return s
}
module.exports = indexhtmlify
if (require.main === module) {
if(process.stdin.isTTY) {
console.error('USAGE: browserify client.js | indexhtmlify ' +
'--style style.css > index.html')
process.exit(1)
}
process.stdin
.pipe(indexhtmlify(opts))
.pipe(process.stdout)
}
|
var opts = require('optimist').argv
var through = require('through2');
function indexhtmlify(opts) {
+ opts = opts || {}
+
var s = through(function onwrite(chunk, enc, cb) {
s.push(chunk)
cb()
}, function onend(cb) {
s.push('</script>\n')
s.push('</html>\n')
cb()
})
s.push('<!DOCTYPE html>\n')
s.push('<html>\n')
s.push('<head>\n')
- s.push('<title>---</title>\n')
+ s.push('<title>' + (opts.title || '---') + '</title>\n')
s.push('<meta content="width=device-width, initial-scale=1.0, ' +
'maximum-scale=1.0, user-scalable=0" name="viewport" />\n')
s.push('<meta charset=utf-8></head>\n')
if (opts.style) {
s.push('<style>\n')
s.push(require('fs').readFileSync(opts.style, 'utf8'))
s.push('</style>\n')
}
s.push('<body></body>\n')
s.push('<script language=javascript>\n')
return s
}
module.exports = indexhtmlify
if (require.main === module) {
if(process.stdin.isTTY) {
console.error('USAGE: browserify client.js | indexhtmlify ' +
'--style style.css > index.html')
process.exit(1)
}
process.stdin
.pipe(indexhtmlify(opts))
.pipe(process.stdout)
} | 4 | 0.085106 | 3 | 1 |
65c3bca812f50a3ec23342677ec9a1fb42f0aee3 | app/views/spree/templates/line_items/_show.html | app/views/spree/templates/line_items/_show.html | <script type='text/template' id='line-item-template'>
<td class="cart-item-image" data-hook="cart_item_image">
<a href='#'>
<img alt="<%%= variant.name %>" src="<%%= displayImage('small') %>" data-product-permalink='<%%= permalink() %>'>
</a>
</td>
<td class="cart-item-description" data-hook="cart_item_description">
<h4><a href='#' data-product-permalink='<%%= permalink() %>'><%%= variant.name %></a></h4>
<%%= variant.description %>
</td>
<td class="cart-item-price" data-hook="cart_item_price">
<%%= single_display_amount %>
</td>
<td class="cart-item-quantity" data-hook="cart_item_quantity">
<input class="line_item_quantity" data-line-item-id='<%%= id %>' size="5" type="number" value="<%%= quantity %>" min='0'>
</td>
<td class="cart-item-total" data-hook="cart_item_total">
<%%= display_amount %>
</td>
<td class="cart-item-delete" data-hook="cart_item_delete">
<a href="#" class="delete" id="delete_line_item_4"><img alt="Delete" src="/assets/icons/delete.png"></a>
</td>
</script> | <script type='text/template' id='line-item-template'>
<td class="cart-item-image" data-hook="cart_item_image">
<a href='#'>
<img alt="<%%= variant.name %>" src="<%%= displayImage('small') %>" data-product-permalink='<%%= permalink() %>'>
</a>
</td>
<td class="cart-item-description" data-hook="cart_item_description">
<h4><a href='#' data-product-permalink='<%%= permalink() %>'><%%= variant.name %></a></h4>
<%% if (variant.description.length > 50) { %>
<%%= variant.description.substring(0, 50) %>...
<%% } else { %>
<%%= variant.description %>
<%% } %>
</td>
<td class="cart-item-price" data-hook="cart_item_price">
<%%= single_display_amount %>
</td>
<td class="cart-item-quantity" data-hook="cart_item_quantity">
<input class="line_item_quantity" data-line-item-id='<%%= id %>' size="5" type="number" value="<%%= quantity %>" min='0'>
</td>
<td class="cart-item-total" data-hook="cart_item_total">
<%%= display_amount %>
</td>
<td class="cart-item-delete" data-hook="cart_item_delete">
<a href="#" class="delete" id="delete_line_item_4"><img alt="Delete" src="/assets/icons/delete.png"></a>
</td>
</script> | Truncate variant descriptions in cart | Truncate variant descriptions in cart
| HTML | bsd-3-clause | njaw/spree,njaw/spree,njaw/spree | html | ## Code Before:
<script type='text/template' id='line-item-template'>
<td class="cart-item-image" data-hook="cart_item_image">
<a href='#'>
<img alt="<%%= variant.name %>" src="<%%= displayImage('small') %>" data-product-permalink='<%%= permalink() %>'>
</a>
</td>
<td class="cart-item-description" data-hook="cart_item_description">
<h4><a href='#' data-product-permalink='<%%= permalink() %>'><%%= variant.name %></a></h4>
<%%= variant.description %>
</td>
<td class="cart-item-price" data-hook="cart_item_price">
<%%= single_display_amount %>
</td>
<td class="cart-item-quantity" data-hook="cart_item_quantity">
<input class="line_item_quantity" data-line-item-id='<%%= id %>' size="5" type="number" value="<%%= quantity %>" min='0'>
</td>
<td class="cart-item-total" data-hook="cart_item_total">
<%%= display_amount %>
</td>
<td class="cart-item-delete" data-hook="cart_item_delete">
<a href="#" class="delete" id="delete_line_item_4"><img alt="Delete" src="/assets/icons/delete.png"></a>
</td>
</script>
## Instruction:
Truncate variant descriptions in cart
## Code After:
<script type='text/template' id='line-item-template'>
<td class="cart-item-image" data-hook="cart_item_image">
<a href='#'>
<img alt="<%%= variant.name %>" src="<%%= displayImage('small') %>" data-product-permalink='<%%= permalink() %>'>
</a>
</td>
<td class="cart-item-description" data-hook="cart_item_description">
<h4><a href='#' data-product-permalink='<%%= permalink() %>'><%%= variant.name %></a></h4>
<%% if (variant.description.length > 50) { %>
<%%= variant.description.substring(0, 50) %>...
<%% } else { %>
<%%= variant.description %>
<%% } %>
</td>
<td class="cart-item-price" data-hook="cart_item_price">
<%%= single_display_amount %>
</td>
<td class="cart-item-quantity" data-hook="cart_item_quantity">
<input class="line_item_quantity" data-line-item-id='<%%= id %>' size="5" type="number" value="<%%= quantity %>" min='0'>
</td>
<td class="cart-item-total" data-hook="cart_item_total">
<%%= display_amount %>
</td>
<td class="cart-item-delete" data-hook="cart_item_delete">
<a href="#" class="delete" id="delete_line_item_4"><img alt="Delete" src="/assets/icons/delete.png"></a>
</td>
</script> | <script type='text/template' id='line-item-template'>
<td class="cart-item-image" data-hook="cart_item_image">
<a href='#'>
<img alt="<%%= variant.name %>" src="<%%= displayImage('small') %>" data-product-permalink='<%%= permalink() %>'>
</a>
</td>
<td class="cart-item-description" data-hook="cart_item_description">
<h4><a href='#' data-product-permalink='<%%= permalink() %>'><%%= variant.name %></a></h4>
+ <%% if (variant.description.length > 50) { %>
+ <%%= variant.description.substring(0, 50) %>...
+ <%% } else { %>
- <%%= variant.description %>
+ <%%= variant.description %>
? ++
+ <%% } %>
</td>
<td class="cart-item-price" data-hook="cart_item_price">
<%%= single_display_amount %>
</td>
<td class="cart-item-quantity" data-hook="cart_item_quantity">
<input class="line_item_quantity" data-line-item-id='<%%= id %>' size="5" type="number" value="<%%= quantity %>" min='0'>
</td>
<td class="cart-item-total" data-hook="cart_item_total">
<%%= display_amount %>
</td>
<td class="cart-item-delete" data-hook="cart_item_delete">
<a href="#" class="delete" id="delete_line_item_4"><img alt="Delete" src="/assets/icons/delete.png"></a>
</td>
</script> | 6 | 0.26087 | 5 | 1 |
6caca8b2d1757371bdb641cd67bde5e13a5b730e | README.md | README.md | Experimets with ELF infection
|
Experimets with ELF infection.
| Change Readme.md. Add logo :). | Change Readme.md. Add logo :).
| Markdown | bsd-3-clause | marmolak/cool-retro-virus,marmolak/cool-retro-virus | markdown | ## Code Before:
Experimets with ELF infection
## Instruction:
Change Readme.md. Add logo :).
## Code After:
Experimets with ELF infection.
| +
+
- Experimets with ELF infection
+ Experimets with ELF infection.
? +
| 4 | 4 | 3 | 1 |
05c3044a7b56ad1bd6b8e30e751c2a4d37f99591 | client/views/tasks/add_task.coffee | client/views/tasks/add_task.coffee | Template.newTaskForm.events
'submit #new-task, click #addTaskButton': (e) ->
e.preventDefault()
body = $('#new-task-text').val()
$('#new-task-text').val("")
now = new Date()
priority = 'low'
list = 'Home'
Tasks.insert
body: body
dateDue: moment(now).add('w', 1).toDate()
dateCreated: now
dateCompleted: false
modified: now
list: list
priority: priority
completed: false
repeating: false
list = Lists.findOne
name: list
Lists.update list._id,
$inc:
numTodos: 1
| Template.newTaskForm.events
'submit #new-task, click #addTaskButton': (e) ->
e.preventDefault()
body = $('#new-task-text').val()
$('#new-task-text').val("")
if body
addEvent body
$('#addTaskInput').removeClass('has-warning')
else
$('#addTaskInput').addClass('has-warning')
$('#new-task-text').focus()
addEvent = (taskTitle) ->
now = new Date()
priority = 'low'
list = 'Home'
Tasks.insert
body: taskTitle
dateDue: moment(now).add('w', 1).toDate()
dateCreated: now
dateCompleted: false
modified: now
list: list
priority: priority
completed: false
repeating: false
list = Lists.findOne
name: list
Lists.update list._id,
$inc:
numTodos: 1
| Check if body is empty before submitting | Check if body is empty before submitting
| CoffeeScript | agpl-3.0 | adelq/astroid-web | coffeescript | ## Code Before:
Template.newTaskForm.events
'submit #new-task, click #addTaskButton': (e) ->
e.preventDefault()
body = $('#new-task-text').val()
$('#new-task-text').val("")
now = new Date()
priority = 'low'
list = 'Home'
Tasks.insert
body: body
dateDue: moment(now).add('w', 1).toDate()
dateCreated: now
dateCompleted: false
modified: now
list: list
priority: priority
completed: false
repeating: false
list = Lists.findOne
name: list
Lists.update list._id,
$inc:
numTodos: 1
## Instruction:
Check if body is empty before submitting
## Code After:
Template.newTaskForm.events
'submit #new-task, click #addTaskButton': (e) ->
e.preventDefault()
body = $('#new-task-text').val()
$('#new-task-text').val("")
if body
addEvent body
$('#addTaskInput').removeClass('has-warning')
else
$('#addTaskInput').addClass('has-warning')
$('#new-task-text').focus()
addEvent = (taskTitle) ->
now = new Date()
priority = 'low'
list = 'Home'
Tasks.insert
body: taskTitle
dateDue: moment(now).add('w', 1).toDate()
dateCreated: now
dateCompleted: false
modified: now
list: list
priority: priority
completed: false
repeating: false
list = Lists.findOne
name: list
Lists.update list._id,
$inc:
numTodos: 1
| Template.newTaskForm.events
'submit #new-task, click #addTaskButton': (e) ->
e.preventDefault()
body = $('#new-task-text').val()
$('#new-task-text').val("")
+
+ if body
+ addEvent body
+ $('#addTaskInput').removeClass('has-warning')
+ else
+ $('#addTaskInput').addClass('has-warning')
+ $('#new-task-text').focus()
+
+ addEvent = (taskTitle) ->
- now = new Date()
? --
+ now = new Date()
- priority = 'low'
? --
+ priority = 'low'
- list = 'Home'
? --
+ list = 'Home'
- Tasks.insert
? --
+ Tasks.insert
- body: body
+ body: taskTitle
- dateDue: moment(now).add('w', 1).toDate()
? --
+ dateDue: moment(now).add('w', 1).toDate()
- dateCreated: now
? --
+ dateCreated: now
- dateCompleted: false
? --
+ dateCompleted: false
- modified: now
? --
+ modified: now
- list: list
? --
+ list: list
- priority: priority
? --
+ priority: priority
- completed: false
? --
+ completed: false
- repeating: false
? --
+ repeating: false
- list = Lists.findOne
? --
+ list = Lists.findOne
- name: list
? --
+ name: list
- Lists.update list._id,
? --
+ Lists.update list._id,
- $inc:
? --
+ $inc:
- numTodos: 1
? --
+ numTodos: 1 | 45 | 1.956522 | 27 | 18 |
05aa0c09909c1fafaf95f29f8905ba9002922ba2 | pkgs/development/libraries/mbedtls/default.nix | pkgs/development/libraries/mbedtls/default.nix | { stdenv, fetchurl, perl }:
stdenv.mkDerivation rec {
name = "mbedtls-1.3.11";
src = fetchurl {
url = "https://polarssl.org/download/${name}-gpl.tgz";
sha256 = "1js1lk6hvw9l3nhjhnhzfazfbnlcmk229hmnlm7jli3agc1979b7";
};
nativeBuildInputs = [ perl ];
postPatch = ''
patchShebangs .
'';
makeFlags = [
"SHARED=1"
];
installFlags = [
"DESTDIR=\${out}"
];
postInstall = ''
rm -f $out/lib/lib{mbedtls.so.8,polarssl.{a,so}}
ln -s libmbedtls.so $out/lib/libmbedtls.so.8
ln -s libmbedtls.so $out/lib/libpolarssl.so
ln -s libmbedtls.a $out/lib/libpolarssl.a
'';
doCheck = true;
meta = with stdenv.lib; {
homepage = https://polarssl.org/;
description = "Portable cryptographic and SSL/TLS library, aka polarssl";
license = licenses.gpl3;
platforms = platforms.all;
maintainers = with maintainers; [ wkennington ];
};
}
| { stdenv, fetchurl, perl }:
stdenv.mkDerivation rec {
name = "mbedtls-1.3.11";
src = fetchurl {
url = "https://polarssl.org/download/${name}-gpl.tgz";
sha256 = "1js1lk6hvw9l3nhjhnhzfazfbnlcmk229hmnlm7jli3agc1979b7";
};
nativeBuildInputs = [ perl ];
postPatch = ''
patchShebangs .
'';
makeFlags = [
"SHARED=1"
];
installFlags = [
"DESTDIR=\${out}"
];
doCheck = true;
meta = with stdenv.lib; {
homepage = https://polarssl.org/;
description = "Portable cryptographic and SSL/TLS library, aka polarssl";
license = licenses.gpl3;
platforms = platforms.all;
maintainers = with maintainers; [ wkennington ];
};
}
| Remove postInstall workarounds that were fixed upstream | mbedtls: Remove postInstall workarounds that were fixed upstream
Fixed by upstream commit f5203e0bb5a33b65aafdeb35fb6082ea69d700ff.
| Nix | mit | NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,triton/triton,NixOS/nixpkgs,SymbiFlow/nixpkgs,triton/triton,triton/triton,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,triton/triton,SymbiFlow/nixpkgs,triton/triton,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,triton/triton,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,triton/triton,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,triton/triton,NixOS/nixpkgs | nix | ## Code Before:
{ stdenv, fetchurl, perl }:
stdenv.mkDerivation rec {
name = "mbedtls-1.3.11";
src = fetchurl {
url = "https://polarssl.org/download/${name}-gpl.tgz";
sha256 = "1js1lk6hvw9l3nhjhnhzfazfbnlcmk229hmnlm7jli3agc1979b7";
};
nativeBuildInputs = [ perl ];
postPatch = ''
patchShebangs .
'';
makeFlags = [
"SHARED=1"
];
installFlags = [
"DESTDIR=\${out}"
];
postInstall = ''
rm -f $out/lib/lib{mbedtls.so.8,polarssl.{a,so}}
ln -s libmbedtls.so $out/lib/libmbedtls.so.8
ln -s libmbedtls.so $out/lib/libpolarssl.so
ln -s libmbedtls.a $out/lib/libpolarssl.a
'';
doCheck = true;
meta = with stdenv.lib; {
homepage = https://polarssl.org/;
description = "Portable cryptographic and SSL/TLS library, aka polarssl";
license = licenses.gpl3;
platforms = platforms.all;
maintainers = with maintainers; [ wkennington ];
};
}
## Instruction:
mbedtls: Remove postInstall workarounds that were fixed upstream
Fixed by upstream commit f5203e0bb5a33b65aafdeb35fb6082ea69d700ff.
## Code After:
{ stdenv, fetchurl, perl }:
stdenv.mkDerivation rec {
name = "mbedtls-1.3.11";
src = fetchurl {
url = "https://polarssl.org/download/${name}-gpl.tgz";
sha256 = "1js1lk6hvw9l3nhjhnhzfazfbnlcmk229hmnlm7jli3agc1979b7";
};
nativeBuildInputs = [ perl ];
postPatch = ''
patchShebangs .
'';
makeFlags = [
"SHARED=1"
];
installFlags = [
"DESTDIR=\${out}"
];
doCheck = true;
meta = with stdenv.lib; {
homepage = https://polarssl.org/;
description = "Portable cryptographic and SSL/TLS library, aka polarssl";
license = licenses.gpl3;
platforms = platforms.all;
maintainers = with maintainers; [ wkennington ];
};
}
| { stdenv, fetchurl, perl }:
stdenv.mkDerivation rec {
name = "mbedtls-1.3.11";
src = fetchurl {
url = "https://polarssl.org/download/${name}-gpl.tgz";
sha256 = "1js1lk6hvw9l3nhjhnhzfazfbnlcmk229hmnlm7jli3agc1979b7";
};
nativeBuildInputs = [ perl ];
postPatch = ''
patchShebangs .
'';
makeFlags = [
"SHARED=1"
];
installFlags = [
"DESTDIR=\${out}"
];
- postInstall = ''
- rm -f $out/lib/lib{mbedtls.so.8,polarssl.{a,so}}
- ln -s libmbedtls.so $out/lib/libmbedtls.so.8
- ln -s libmbedtls.so $out/lib/libpolarssl.so
- ln -s libmbedtls.a $out/lib/libpolarssl.a
- '';
-
doCheck = true;
meta = with stdenv.lib; {
homepage = https://polarssl.org/;
description = "Portable cryptographic and SSL/TLS library, aka polarssl";
license = licenses.gpl3;
platforms = platforms.all;
maintainers = with maintainers; [ wkennington ];
};
} | 7 | 0.170732 | 0 | 7 |
405e806514889bbcece5cf44266885c7e50615c2 | phjs-main.js | phjs-main.js | /* eslint-env phantomjs */
var system = require('system');
var webpage = require('webpage');
var page = webpage.create();
var ua = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) ' +
'AppleWebKit/537.36 (KHTML, like Gecko) ' +
'Chrome/56.0.2924.87 Safari/537.36';
var args = JSON.parse(system.args[1]);
var url = args.url;
var viewSize = args.viewSize;
function complete(msg) {
system.stdout.write(JSON.stringify(msg));
phantom.exit();
}
function uponWindowLoad() {
var render = page.renderBase64('PNG');
var msg = {
status: 'ok',
body: render,
};
complete(msg);
}
function uponPageOpen(status) {
if (status !== 'success') {
var msg = {
status: 'error',
body: status,
};
complete(msg);
return;
}
// Wait an extra second for anything else to load
window.setTimeout(uponWindowLoad, 1000);
}
page.settings.userAgent = ua;
page.viewportSize = viewSize;
page.open(url, uponPageOpen);
| /* eslint-env phantomjs */
var system = require('system');
var webpage = require('webpage');
var page = webpage.create();
var ua = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) ' +
'AppleWebKit/537.36 (KHTML, like Gecko) ' +
'Chrome/56.0.2924.87 Safari/537.36';
var args = JSON.parse(system.args[1]);
var url = args.url;
var viewSize = args.viewSize;
function complete(msg) {
system.stdout.write(JSON.stringify(msg));
phantom.exit();
}
function renderComplete() {
var render = page.renderBase64('PNG');
var msg = {
status: 'ok',
body: render,
};
complete(msg);
}
function uponPageOpen(status) {
if (status !== 'success') {
var msg = {
status: 'error',
body: status,
};
complete(msg);
return;
}
renderComplete();
}
page.settings.userAgent = ua;
page.viewportSize = viewSize;
page.open(url, uponPageOpen);
| Remove 1000ms wait for page load | Remove 1000ms wait for page load
| JavaScript | mit | tkmcc/stylish | javascript | ## Code Before:
/* eslint-env phantomjs */
var system = require('system');
var webpage = require('webpage');
var page = webpage.create();
var ua = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) ' +
'AppleWebKit/537.36 (KHTML, like Gecko) ' +
'Chrome/56.0.2924.87 Safari/537.36';
var args = JSON.parse(system.args[1]);
var url = args.url;
var viewSize = args.viewSize;
function complete(msg) {
system.stdout.write(JSON.stringify(msg));
phantom.exit();
}
function uponWindowLoad() {
var render = page.renderBase64('PNG');
var msg = {
status: 'ok',
body: render,
};
complete(msg);
}
function uponPageOpen(status) {
if (status !== 'success') {
var msg = {
status: 'error',
body: status,
};
complete(msg);
return;
}
// Wait an extra second for anything else to load
window.setTimeout(uponWindowLoad, 1000);
}
page.settings.userAgent = ua;
page.viewportSize = viewSize;
page.open(url, uponPageOpen);
## Instruction:
Remove 1000ms wait for page load
## Code After:
/* eslint-env phantomjs */
var system = require('system');
var webpage = require('webpage');
var page = webpage.create();
var ua = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) ' +
'AppleWebKit/537.36 (KHTML, like Gecko) ' +
'Chrome/56.0.2924.87 Safari/537.36';
var args = JSON.parse(system.args[1]);
var url = args.url;
var viewSize = args.viewSize;
function complete(msg) {
system.stdout.write(JSON.stringify(msg));
phantom.exit();
}
function renderComplete() {
var render = page.renderBase64('PNG');
var msg = {
status: 'ok',
body: render,
};
complete(msg);
}
function uponPageOpen(status) {
if (status !== 'success') {
var msg = {
status: 'error',
body: status,
};
complete(msg);
return;
}
renderComplete();
}
page.settings.userAgent = ua;
page.viewportSize = viewSize;
page.open(url, uponPageOpen);
| /* eslint-env phantomjs */
var system = require('system');
var webpage = require('webpage');
var page = webpage.create();
var ua = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) ' +
'AppleWebKit/537.36 (KHTML, like Gecko) ' +
'Chrome/56.0.2924.87 Safari/537.36';
var args = JSON.parse(system.args[1]);
var url = args.url;
var viewSize = args.viewSize;
function complete(msg) {
system.stdout.write(JSON.stringify(msg));
phantom.exit();
}
- function uponWindowLoad() {
+ function renderComplete() {
var render = page.renderBase64('PNG');
var msg = {
status: 'ok',
body: render,
};
complete(msg);
}
function uponPageOpen(status) {
if (status !== 'success') {
var msg = {
status: 'error',
body: status,
};
complete(msg);
return;
}
+ renderComplete();
- // Wait an extra second for anything else to load
- window.setTimeout(uponWindowLoad, 1000);
}
page.settings.userAgent = ua;
page.viewportSize = viewSize;
page.open(url, uponPageOpen); | 5 | 0.104167 | 2 | 3 |
bd479d94a8fab71197e9be02abf694336c665d10 | Casks/transporter-desktop.rb | Casks/transporter-desktop.rb | cask :v1 => 'transporter-desktop' do
version '3.1.15_18289'
sha256 'fecf3b1944832261900237537962a4783d709caa96c3e93ec2d828b88425ec8e'
# connecteddata.com is the official download host per the vendor homepage
url "https://secure.connecteddata.com/mac/2.5/software/Transporter_Desktop_#{version}.dmg"
homepage 'http://www.filetransporter.com/'
license :commercial
app 'Transporter Desktop.app'
end
| cask :v1 => 'transporter-desktop' do
version '3.1.17_18519'
sha256 'c62adff9e27ebdc424d7fb01b02d5d5ba06a53305c7f6d65ecde790bb487a95e'
# connecteddata.com is the official download host per the vendor homepage
url "https://secure.connecteddata.com/mac/2.5/software/Transporter_Desktop_#{version}.dmg"
homepage 'http://www.filetransporter.com/'
license :commercial
app 'Transporter Desktop.app'
end
| Update Transporter Desktop client to 3.1.17 | Update Transporter Desktop client to 3.1.17
This commit updates the version to 3.1.17 and the SHA for the
downloaded file.
| Ruby | bsd-2-clause | gurghet/homebrew-cask,crzrcn/homebrew-cask,rickychilcott/homebrew-cask,RogerThiede/homebrew-cask,kiliankoe/homebrew-cask,kkdd/homebrew-cask,helloIAmPau/homebrew-cask,jangalinski/homebrew-cask,albertico/homebrew-cask,MircoT/homebrew-cask,JoelLarson/homebrew-cask,rkJun/homebrew-cask,squid314/homebrew-cask,diguage/homebrew-cask,miccal/homebrew-cask,johnjelinek/homebrew-cask,esebastian/homebrew-cask,robertgzr/homebrew-cask,jaredsampson/homebrew-cask,yumitsu/homebrew-cask,kingthorin/homebrew-cask,pinut/homebrew-cask,riyad/homebrew-cask,nightscape/homebrew-cask,ayohrling/homebrew-cask,jellyfishcoder/homebrew-cask,cliffcotino/homebrew-cask,wastrachan/homebrew-cask,malob/homebrew-cask,a1russell/homebrew-cask,andrewdisley/homebrew-cask,kongslund/homebrew-cask,xight/homebrew-cask,claui/homebrew-cask,lumaxis/homebrew-cask,tjnycum/homebrew-cask,tsparber/homebrew-cask,timsutton/homebrew-cask,sscotth/homebrew-cask,ohammersmith/homebrew-cask,ericbn/homebrew-cask,MircoT/homebrew-cask,scribblemaniac/homebrew-cask,boecko/homebrew-cask,uetchy/homebrew-cask,tjnycum/homebrew-cask,kronicd/homebrew-cask,goxberry/homebrew-cask,hristozov/homebrew-cask,daften/homebrew-cask,joschi/homebrew-cask,MisumiRize/homebrew-cask,mjdescy/homebrew-cask,decrement/homebrew-cask,mikem/homebrew-cask,pacav69/homebrew-cask,Saklad5/homebrew-cask,otaran/homebrew-cask,jayshao/homebrew-cask,vin047/homebrew-cask,uetchy/homebrew-cask,tan9/homebrew-cask,zhuzihhhh/homebrew-cask,doits/homebrew-cask,winkelsdorf/homebrew-cask,astorije/homebrew-cask,ftiff/homebrew-cask,djakarta-trap/homebrew-myCask,optikfluffel/homebrew-cask,drostron/homebrew-cask,cobyism/homebrew-cask,mariusbutuc/homebrew-cask,johnste/homebrew-cask,Ketouem/homebrew-cask,mazehall/homebrew-cask,dspeckhard/homebrew-cask,tedski/homebrew-cask,m3nu/homebrew-cask,sanyer/homebrew-cask,dieterdemeyer/homebrew-cask,fkrone/homebrew-cask,sohtsuka/homebrew-cask,jasmas/homebrew-cask,tjt263/homebrew-cask,CameronGarrett/homebrew-cask,0rax/homebrew-cask,6uclz1/homebrew-cask,perfide/homebrew-cask,devmynd/homebrew-cask,jayshao/homebrew-cask,mfpierre/homebrew-cask,troyxmccall/homebrew-cask,bcomnes/homebrew-cask,dustinblackman/homebrew-cask,supriyantomaftuh/homebrew-cask,zorosteven/homebrew-cask,gguillotte/homebrew-cask,gurghet/homebrew-cask,iamso/homebrew-cask,blainesch/homebrew-cask,sanyer/homebrew-cask,jiashuw/homebrew-cask,tjt263/homebrew-cask,blogabe/homebrew-cask,iAmGhost/homebrew-cask,bdhess/homebrew-cask,malford/homebrew-cask,optikfluffel/homebrew-cask,paour/homebrew-cask,stigkj/homebrew-caskroom-cask,gwaldo/homebrew-cask,Labutin/homebrew-cask,jmeridth/homebrew-cask,jpmat296/homebrew-cask,jeroenj/homebrew-cask,shishi/homebrew-cask,nivanchikov/homebrew-cask,jonathanwiesel/homebrew-cask,bric3/homebrew-cask,vin047/homebrew-cask,d/homebrew-cask,shonjir/homebrew-cask,aktau/homebrew-cask,morganestes/homebrew-cask,neverfox/homebrew-cask,albertico/homebrew-cask,SamiHiltunen/homebrew-cask,gerrypower/homebrew-cask,xyb/homebrew-cask,aki77/homebrew-cask,miccal/homebrew-cask,farmerchris/homebrew-cask,kamilboratynski/homebrew-cask,nightscape/homebrew-cask,napaxton/homebrew-cask,stevehedrick/homebrew-cask,lcasey001/homebrew-cask,gerrypower/homebrew-cask,alloy/homebrew-cask,wolflee/homebrew-cask,sjackman/homebrew-cask,gerrymiller/homebrew-cask,blogabe/homebrew-cask,illusionfield/homebrew-cask,JosephViolago/homebrew-cask,helloIAmPau/homebrew-cask,inta/homebrew-cask,crmne/homebrew-cask,mhubig/homebrew-cask,chino/homebrew-cask,ptb/homebrew-cask,inz/homebrew-cask,AnastasiaSulyagina/homebrew-cask,bendoerr/homebrew-cask,nathancahill/homebrew-cask,dcondrey/homebrew-cask,alebcay/homebrew-cask,greg5green/homebrew-cask,athrunsun/homebrew-cask,kirikiriyamama/homebrew-cask,FredLackeyOfficial/homebrew-cask,My2ndAngelic/homebrew-cask,norio-nomura/homebrew-cask,renaudguerin/homebrew-cask,unasuke/homebrew-cask,wuman/homebrew-cask,drostron/homebrew-cask,unasuke/homebrew-cask,hanxue/caskroom,deiga/homebrew-cask,jbeagley52/homebrew-cask,rhendric/homebrew-cask,Ngrd/homebrew-cask,frapposelli/homebrew-cask,mjdescy/homebrew-cask,tolbkni/homebrew-cask,tedbundyjr/homebrew-cask,Cottser/homebrew-cask,larseggert/homebrew-cask,chuanxd/homebrew-cask,kamilboratynski/homebrew-cask,hyuna917/homebrew-cask,corbt/homebrew-cask,toonetown/homebrew-cask,mokagio/homebrew-cask,ddm/homebrew-cask,colindunn/homebrew-cask,remko/homebrew-cask,tangestani/homebrew-cask,feniix/homebrew-cask,tyage/homebrew-cask,epmatsw/homebrew-cask,scribblemaniac/homebrew-cask,SentinelWarren/homebrew-cask,williamboman/homebrew-cask,jedahan/homebrew-cask,ldong/homebrew-cask,leonmachadowilcox/homebrew-cask,patresi/homebrew-cask,FredLackeyOfficial/homebrew-cask,maxnordlund/homebrew-cask,cfillion/homebrew-cask,giannitm/homebrew-cask,jalaziz/homebrew-cask,xakraz/homebrew-cask,slnovak/homebrew-cask,MicTech/homebrew-cask,nysthee/homebrew-cask,dwkns/homebrew-cask,jpodlech/homebrew-cask,boydj/homebrew-cask,kteru/homebrew-cask,ddm/homebrew-cask,christer155/homebrew-cask,moonboots/homebrew-cask,mauricerkelly/homebrew-cask,wolflee/homebrew-cask,Cottser/homebrew-cask,yutarody/homebrew-cask,mjgardner/homebrew-cask,KosherBacon/homebrew-cask,stevehedrick/homebrew-cask,mjgardner/homebrew-cask,alexg0/homebrew-cask,jppelteret/homebrew-cask,miku/homebrew-cask,seanzxx/homebrew-cask,Saklad5/homebrew-cask,howie/homebrew-cask,gilesdring/homebrew-cask,sparrc/homebrew-cask,pacav69/homebrew-cask,flaviocamilo/homebrew-cask,jellyfishcoder/homebrew-cask,puffdad/homebrew-cask,leonmachadowilcox/homebrew-cask,thii/homebrew-cask,leipert/homebrew-cask,deanmorin/homebrew-cask,jconley/homebrew-cask,fly19890211/homebrew-cask,napaxton/homebrew-cask,hackhandslabs/homebrew-cask,mazehall/homebrew-cask,guerrero/homebrew-cask,markthetech/homebrew-cask,klane/homebrew-cask,haha1903/homebrew-cask,Ephemera/homebrew-cask,vuquoctuan/homebrew-cask,shoichiaizawa/homebrew-cask,6uclz1/homebrew-cask,Ibuprofen/homebrew-cask,cohei/homebrew-cask,Ketouem/homebrew-cask,sanchezm/homebrew-cask,aktau/homebrew-cask,robbiethegeek/homebrew-cask,nshemonsky/homebrew-cask,renard/homebrew-cask,jeanregisser/homebrew-cask,tan9/homebrew-cask,farmerchris/homebrew-cask,paour/homebrew-cask,pablote/homebrew-cask,Keloran/homebrew-cask,kkdd/homebrew-cask,mhubig/homebrew-cask,MatzFan/homebrew-cask,norio-nomura/homebrew-cask,danielbayley/homebrew-cask,3van/homebrew-cask,yuhki50/homebrew-cask,lucasmezencio/homebrew-cask,slack4u/homebrew-cask,genewoo/homebrew-cask,okket/homebrew-cask,vitorgalvao/homebrew-cask,retrography/homebrew-cask,rogeriopradoj/homebrew-cask,Bombenleger/homebrew-cask,Ephemera/homebrew-cask,genewoo/homebrew-cask,qbmiller/homebrew-cask,arronmabrey/homebrew-cask,MichaelPei/homebrew-cask,wickles/homebrew-cask,singingwolfboy/homebrew-cask,nysthee/homebrew-cask,vigosan/homebrew-cask,buo/homebrew-cask,djakarta-trap/homebrew-myCask,fwiesel/homebrew-cask,kiliankoe/homebrew-cask,andrewdisley/homebrew-cask,lalyos/homebrew-cask,shanonvl/homebrew-cask,gord1anknot/homebrew-cask,toonetown/homebrew-cask,scottsuch/homebrew-cask,johnste/homebrew-cask,shanonvl/homebrew-cask,markthetech/homebrew-cask,englishm/homebrew-cask,shonjir/homebrew-cask,samshadwell/homebrew-cask,claui/homebrew-cask,scw/homebrew-cask,wayou/homebrew-cask,sparrc/homebrew-cask,lauantai/homebrew-cask,michelegera/homebrew-cask,ahvigil/homebrew-cask,scottsuch/homebrew-cask,samdoran/homebrew-cask,jgarber623/homebrew-cask,taherio/homebrew-cask,fazo96/homebrew-cask,christophermanning/homebrew-cask,Whoaa512/homebrew-cask,tolbkni/homebrew-cask,danielgomezrico/homebrew-cask,Labutin/homebrew-cask,yumitsu/homebrew-cask,kostasdizas/homebrew-cask,mrmachine/homebrew-cask,wastrachan/homebrew-cask,riyad/homebrew-cask,skatsuta/homebrew-cask,crzrcn/homebrew-cask,a1russell/homebrew-cask,jedahan/homebrew-cask,barravi/homebrew-cask,RJHsiao/homebrew-cask,nathansgreen/homebrew-cask,thehunmonkgroup/homebrew-cask,paulbreslin/homebrew-cask,Ngrd/homebrew-cask,fanquake/homebrew-cask,sirodoht/homebrew-cask,nrlquaker/homebrew-cask,onlynone/homebrew-cask,ksato9700/homebrew-cask,alebcay/homebrew-cask,lucasmezencio/homebrew-cask,axodys/homebrew-cask,paulbreslin/homebrew-cask,Ibuprofen/homebrew-cask,hristozov/homebrew-cask,BahtiyarB/homebrew-cask,cliffcotino/homebrew-cask,andersonba/homebrew-cask,mahori/homebrew-cask,Fedalto/homebrew-cask,nicolas-brousse/homebrew-cask,mathbunnyru/homebrew-cask,gibsjose/homebrew-cask,casidiablo/homebrew-cask,mattrobenolt/homebrew-cask,stephenwade/homebrew-cask,reelsense/homebrew-cask,alloy/homebrew-cask,franklouwers/homebrew-cask,adrianchia/homebrew-cask,neverfox/homebrew-cask,mingzhi22/homebrew-cask,0rax/homebrew-cask,nivanchikov/homebrew-cask,retbrown/homebrew-cask,kTitan/homebrew-cask,exherb/homebrew-cask,tedski/homebrew-cask,antogg/homebrew-cask,lumaxis/homebrew-cask,mauricerkelly/homebrew-cask,sohtsuka/homebrew-cask,bdhess/homebrew-cask,jiashuw/homebrew-cask,kesara/homebrew-cask,yurikoles/homebrew-cask,lukasbestle/homebrew-cask,kassi/homebrew-cask,elnappo/homebrew-cask,stevenmaguire/homebrew-cask,jrwesolo/homebrew-cask,jrwesolo/homebrew-cask,nathancahill/homebrew-cask,arronmabrey/homebrew-cask,scw/homebrew-cask,Dremora/homebrew-cask,patresi/homebrew-cask,syscrusher/homebrew-cask,qnm/homebrew-cask,adriweb/homebrew-cask,renaudguerin/homebrew-cask,FranklinChen/homebrew-cask,pablote/homebrew-cask,Dremora/homebrew-cask,gyugyu/homebrew-cask,spruceb/homebrew-cask,mahori/homebrew-cask,renard/homebrew-cask,cprecioso/homebrew-cask,muan/homebrew-cask,gmkey/homebrew-cask,wmorin/homebrew-cask,mahori/homebrew-cask,deiga/homebrew-cask,bcaceiro/homebrew-cask,scottsuch/homebrew-cask,andersonba/homebrew-cask,mchlrmrz/homebrew-cask,hakamadare/homebrew-cask,lukasbestle/homebrew-cask,puffdad/homebrew-cask,shoichiaizawa/homebrew-cask,MoOx/homebrew-cask,JikkuJose/homebrew-cask,syscrusher/homebrew-cask,phpwutz/homebrew-cask,zerrot/homebrew-cask,Whoaa512/homebrew-cask,thomanq/homebrew-cask,kostasdizas/homebrew-cask,schneidmaster/homebrew-cask,epmatsw/homebrew-cask,dcondrey/homebrew-cask,johndbritton/homebrew-cask,nrlquaker/homebrew-cask,gabrielizaias/homebrew-cask,chrisRidgers/homebrew-cask,frapposelli/homebrew-cask,usami-k/homebrew-cask,slnovak/homebrew-cask,mgryszko/homebrew-cask,mishari/homebrew-cask,cedwardsmedia/homebrew-cask,nathansgreen/homebrew-cask,elyscape/homebrew-cask,santoshsahoo/homebrew-cask,mariusbutuc/homebrew-cask,ayohrling/homebrew-cask,RJHsiao/homebrew-cask,inz/homebrew-cask,gerrymiller/homebrew-cask,Ephemera/homebrew-cask,adelinofaria/homebrew-cask,lolgear/homebrew-cask,psibre/homebrew-cask,lukeadams/homebrew-cask,danielbayley/homebrew-cask,paulombcosta/homebrew-cask,perfide/homebrew-cask,tangestani/homebrew-cask,faun/homebrew-cask,exherb/homebrew-cask,y00rb/homebrew-cask,kassi/homebrew-cask,christer155/homebrew-cask,dunn/homebrew-cask,nathanielvarona/homebrew-cask,cedwardsmedia/homebrew-cask,mattrobenolt/homebrew-cask,cprecioso/homebrew-cask,mathbunnyru/homebrew-cask,samdoran/homebrew-cask,a-x-/homebrew-cask,paulombcosta/homebrew-cask,victorpopkov/homebrew-cask,bsiddiqui/homebrew-cask,huanzhang/homebrew-cask,gibsjose/homebrew-cask,mchlrmrz/homebrew-cask,joshka/homebrew-cask,wKovacs64/homebrew-cask,miguelfrde/homebrew-cask,diguage/homebrew-cask,morganestes/homebrew-cask,13k/homebrew-cask,devmynd/homebrew-cask,alexg0/homebrew-cask,My2ndAngelic/homebrew-cask,jawshooah/homebrew-cask,fharbe/homebrew-cask,JacopKane/homebrew-cask,mikem/homebrew-cask,markhuber/homebrew-cask,SamiHiltunen/homebrew-cask,sosedoff/homebrew-cask,franklouwers/homebrew-cask,thii/homebrew-cask,hakamadare/homebrew-cask,epardee/homebrew-cask,retrography/homebrew-cask,moogar0880/homebrew-cask,mchlrmrz/homebrew-cask,bsiddiqui/homebrew-cask,scribblemaniac/homebrew-cask,a1russell/homebrew-cask,rubenerd/homebrew-cask,caskroom/homebrew-cask,sscotth/homebrew-cask,lauantai/homebrew-cask,huanzhang/homebrew-cask,imgarylai/homebrew-cask,jbeagley52/homebrew-cask,deanmorin/homebrew-cask,chrisfinazzo/homebrew-cask,janlugt/homebrew-cask,reitermarkus/homebrew-cask,ahundt/homebrew-cask,xight/homebrew-cask,mwilmer/homebrew-cask,koenrh/homebrew-cask,casidiablo/homebrew-cask,daften/homebrew-cask,JosephViolago/homebrew-cask,afdnlw/homebrew-cask,antogg/homebrew-cask,kuno/homebrew-cask,hyuna917/homebrew-cask,jmeridth/homebrew-cask,jconley/homebrew-cask,jonathanwiesel/homebrew-cask,anbotero/homebrew-cask,gabrielizaias/homebrew-cask,mishari/homebrew-cask,andyli/homebrew-cask,jacobbednarz/homebrew-cask,nickpellant/homebrew-cask,n8henrie/homebrew-cask,m3nu/homebrew-cask,wayou/homebrew-cask,nathanielvarona/homebrew-cask,claui/homebrew-cask,theoriginalgri/homebrew-cask,xakraz/homebrew-cask,elyscape/homebrew-cask,hvisage/homebrew-cask,gyndav/homebrew-cask,kryhear/homebrew-cask,jppelteret/homebrew-cask,asbachb/homebrew-cask,kolomiichenko/homebrew-cask,kirikiriyamama/homebrew-cask,amatos/homebrew-cask,larseggert/homebrew-cask,jacobbednarz/homebrew-cask,psibre/homebrew-cask,sgnh/homebrew-cask,kpearson/homebrew-cask,slack4u/homebrew-cask,lieuwex/homebrew-cask,iAmGhost/homebrew-cask,tarwich/homebrew-cask,enriclluelles/homebrew-cask,opsdev-ws/homebrew-cask,sosedoff/homebrew-cask,lantrix/homebrew-cask,askl56/homebrew-cask,julionc/homebrew-cask,asins/homebrew-cask,thehunmonkgroup/homebrew-cask,josa42/homebrew-cask,jgarber623/homebrew-cask,pkq/homebrew-cask,dlovitch/homebrew-cask,nicolas-brousse/homebrew-cask,Keloran/homebrew-cask,mgryszko/homebrew-cask,reitermarkus/homebrew-cask,gmkey/homebrew-cask,okket/homebrew-cask,coeligena/homebrew-customized,ahundt/homebrew-cask,rickychilcott/homebrew-cask,BahtiyarB/homebrew-cask,jacobdam/homebrew-cask,underyx/homebrew-cask,JacopKane/homebrew-cask,spruceb/homebrew-cask,adriweb/homebrew-cask,rubenerd/homebrew-cask,samshadwell/homebrew-cask,ericbn/homebrew-cask,y00rb/homebrew-cask,chino/homebrew-cask,kongslund/homebrew-cask,pkq/homebrew-cask,githubutilities/homebrew-cask,ericbn/homebrew-cask,dspeckhard/homebrew-cask,moimikey/homebrew-cask,guerrero/homebrew-cask,jhowtan/homebrew-cask,barravi/homebrew-cask,FinalDes/homebrew-cask,aki77/homebrew-cask,stonehippo/homebrew-cask,dictcp/homebrew-cask,johnjelinek/homebrew-cask,yutarody/homebrew-cask,bcaceiro/homebrew-cask,MisumiRize/homebrew-cask,MatzFan/homebrew-cask,jalaziz/homebrew-cask,royalwang/homebrew-cask,lalyos/homebrew-cask,guylabs/homebrew-cask,nickpellant/homebrew-cask,sysbot/homebrew-cask,qbmiller/homebrew-cask,troyxmccall/homebrew-cask,alebcay/homebrew-cask,xcezx/homebrew-cask,bkono/homebrew-cask,lvicentesanchez/homebrew-cask,mkozjak/homebrew-cask,xyb/homebrew-cask,shonjir/homebrew-cask,mfpierre/homebrew-cask,rajiv/homebrew-cask,lifepillar/homebrew-cask,kei-yamazaki/homebrew-cask,boecko/homebrew-cask,christophermanning/homebrew-cask,buo/homebrew-cask,catap/homebrew-cask,kteru/homebrew-cask,yutarody/homebrew-cask,artdevjs/homebrew-cask,zeusdeux/homebrew-cask,afh/homebrew-cask,underyx/homebrew-cask,coneman/homebrew-cask,imgarylai/homebrew-cask,rogeriopradoj/homebrew-cask,retbrown/homebrew-cask,kevyau/homebrew-cask,xtian/homebrew-cask,coeligena/homebrew-customized,mwean/homebrew-cask,zeusdeux/homebrew-cask,wickedsp1d3r/homebrew-cask,zchee/homebrew-cask,BenjaminHCCarr/homebrew-cask,singingwolfboy/homebrew-cask,rajiv/homebrew-cask,wKovacs64/homebrew-cask,inta/homebrew-cask,xight/homebrew-cask,hackhandslabs/homebrew-cask,cblecker/homebrew-cask,afh/homebrew-cask,doits/homebrew-cask,moimikey/homebrew-cask,diogodamiani/homebrew-cask,KosherBacon/homebrew-cask,decrement/homebrew-cask,ajbw/homebrew-cask,dunn/homebrew-cask,chadcatlett/caskroom-homebrew-cask,chadcatlett/caskroom-homebrew-cask,kingthorin/homebrew-cask,JikkuJose/homebrew-cask,miku/homebrew-cask,stephenwade/homebrew-cask,jacobdam/homebrew-cask,skyyuan/homebrew-cask,jeanregisser/homebrew-cask,kievechua/homebrew-cask,mrmachine/homebrew-cask,coneman/homebrew-cask,malob/homebrew-cask,crmne/homebrew-cask,moimikey/homebrew-cask,julionc/homebrew-cask,chrisRidgers/homebrew-cask,jpmat296/homebrew-cask,zmwangx/homebrew-cask,0xadada/homebrew-cask,githubutilities/homebrew-cask,yurikoles/homebrew-cask,danielgomezrico/homebrew-cask,tmoreira2020/homebrew,mindriot101/homebrew-cask,stonehippo/homebrew-cask,Amorymeltzer/homebrew-cask,JacopKane/homebrew-cask,tangestani/homebrew-cask,lifepillar/homebrew-cask,mjgardner/homebrew-cask,miguelfrde/homebrew-cask,mingzhi22/homebrew-cask,n0ts/homebrew-cask,cblecker/homebrew-cask,kesara/homebrew-cask,lolgear/homebrew-cask,mwek/homebrew-cask,gyugyu/homebrew-cask,yuhki50/homebrew-cask,rkJun/homebrew-cask,codeurge/homebrew-cask,josa42/homebrew-cask,stonehippo/homebrew-cask,timsutton/homebrew-cask,fharbe/homebrew-cask,chuanxd/homebrew-cask,ctrevino/homebrew-cask,cblecker/homebrew-cask,zorosteven/homebrew-cask,bric3/homebrew-cask,mattfelsen/homebrew-cask,dieterdemeyer/homebrew-cask,lvicentesanchez/homebrew-cask,uetchy/homebrew-cask,seanzxx/homebrew-cask,jawshooah/homebrew-cask,askl56/homebrew-cask,malford/homebrew-cask,qnm/homebrew-cask,jeroenseegers/homebrew-cask,ftiff/homebrew-cask,danielbayley/homebrew-cask,andrewdisley/homebrew-cask,yurrriq/homebrew-cask,mathbunnyru/homebrew-cask,stigkj/homebrew-caskroom-cask,3van/homebrew-cask,seanorama/homebrew-cask,forevergenin/homebrew-cask,cobyism/homebrew-cask,joschi/homebrew-cask,sjackman/homebrew-cask,hanxue/caskroom,artdevjs/homebrew-cask,esebastian/homebrew-cask,shoichiaizawa/homebrew-cask,yurrriq/homebrew-cask,supriyantomaftuh/homebrew-cask,ywfwj2008/homebrew-cask,Hywan/homebrew-cask,giannitm/homebrew-cask,robertgzr/homebrew-cask,hovancik/homebrew-cask,ksylvan/homebrew-cask,hovancik/homebrew-cask,Nitecon/homebrew-cask,alexg0/homebrew-cask,imgarylai/homebrew-cask,zerrot/homebrew-cask,bchatard/homebrew-cask,royalwang/homebrew-cask,bosr/homebrew-cask,howie/homebrew-cask,shorshe/homebrew-cask,n8henrie/homebrew-cask,vitorgalvao/homebrew-cask,zchee/homebrew-cask,feniix/homebrew-cask,RogerThiede/homebrew-cask,goxberry/homebrew-cask,theoriginalgri/homebrew-cask,rcuza/homebrew-cask,sscotth/homebrew-cask,samnung/homebrew-cask,wizonesolutions/homebrew-cask,pkq/homebrew-cask,RickWong/homebrew-cask,mindriot101/homebrew-cask,ninjahoahong/homebrew-cask,0xadada/homebrew-cask,bosr/homebrew-cask,fanquake/homebrew-cask,epardee/homebrew-cask,wesen/homebrew-cask,samnung/homebrew-cask,JosephViolago/homebrew-cask,johndbritton/homebrew-cask,shishi/homebrew-cask,kesara/homebrew-cask,bkono/homebrew-cask,aguynamedryan/homebrew-cask,dvdoliveira/homebrew-cask,jeroenj/homebrew-cask,tarwich/homebrew-cask,deiga/homebrew-cask,rajiv/homebrew-cask,jaredsampson/homebrew-cask,timsutton/homebrew-cask,corbt/homebrew-cask,ohammersmith/homebrew-cask,klane/homebrew-cask,kei-yamazaki/homebrew-cask,sebcode/homebrew-cask,Amorymeltzer/homebrew-cask,dictcp/homebrew-cask,gwaldo/homebrew-cask,koenrh/homebrew-cask,johntrandall/homebrew-cask,kievechua/homebrew-cask,Gasol/homebrew-cask,ninjahoahong/homebrew-cask,FinalDes/homebrew-cask,kolomiichenko/homebrew-cask,fly19890211/homebrew-cask,fkrone/homebrew-cask,joshka/homebrew-cask,mlocher/homebrew-cask,flaviocamilo/homebrew-cask,dvdoliveira/homebrew-cask,mkozjak/homebrew-cask,afdnlw/homebrew-cask,colindean/homebrew-cask,SentinelWarren/homebrew-cask,sanyer/homebrew-cask,feigaochn/homebrew-cask,wesen/homebrew-cask,adelinofaria/homebrew-cask,moogar0880/homebrew-cask,akiomik/homebrew-cask,arranubels/homebrew-cask,reitermarkus/homebrew-cask,kpearson/homebrew-cask,iamso/homebrew-cask,blogabe/homebrew-cask,cfillion/homebrew-cask,RickWong/homebrew-cask,hellosky806/homebrew-cask,aguynamedryan/homebrew-cask,xyb/homebrew-cask,elnappo/homebrew-cask,nshemonsky/homebrew-cask,janlugt/homebrew-cask,mokagio/homebrew-cask,maxnordlund/homebrew-cask,reelsense/homebrew-cask,ianyh/homebrew-cask,adrianchia/homebrew-cask,jpodlech/homebrew-cask,stevenmaguire/homebrew-cask,wmorin/homebrew-cask,zmwangx/homebrew-cask,wizonesolutions/homebrew-cask,athrunsun/homebrew-cask,ianyh/homebrew-cask,bric3/homebrew-cask,asbachb/homebrew-cask,skatsuta/homebrew-cask,xtian/homebrew-cask,ywfwj2008/homebrew-cask,m3nu/homebrew-cask,arranubels/homebrew-cask,chrisfinazzo/homebrew-cask,MoOx/homebrew-cask,neil-ca-moore/homebrew-cask,axodys/homebrew-cask,lcasey001/homebrew-cask,gord1anknot/homebrew-cask,xcezx/homebrew-cask,thomanq/homebrew-cask,hanxue/caskroom,BenjaminHCCarr/homebrew-cask,brianshumate/homebrew-cask,atsuyim/homebrew-cask,mattfelsen/homebrew-cask,n0ts/homebrew-cask,illusionfield/homebrew-cask,gyndav/homebrew-cask,sysbot/homebrew-cask,ajbw/homebrew-cask,diogodamiani/homebrew-cask,neil-ca-moore/homebrew-cask,AnastasiaSulyagina/homebrew-cask,vmrob/homebrew-cask,vmrob/homebrew-cask,coeligena/homebrew-customized,optikfluffel/homebrew-cask,sanchezm/homebrew-cask,taherio/homebrew-cask,kTitan/homebrew-cask,jasmas/homebrew-cask,jen20/homebrew-cask,nrlquaker/homebrew-cask,BenjaminHCCarr/homebrew-cask,MerelyAPseudonym/homebrew-cask,bendoerr/homebrew-cask,gguillotte/homebrew-cask,linc01n/homebrew-cask,antogg/homebrew-cask,rcuza/homebrew-cask,shorshe/homebrew-cask,tsparber/homebrew-cask,mattrobenolt/homebrew-cask,greg5green/homebrew-cask,Bombenleger/homebrew-cask,mwean/homebrew-cask,dlovitch/homebrew-cask,vuquoctuan/homebrew-cask,kronicd/homebrew-cask,rogeriopradoj/homebrew-cask,MichaelPei/homebrew-cask,phpwutz/homebrew-cask,sirodoht/homebrew-cask,anbotero/homebrew-cask,remko/homebrew-cask,tranc99/homebrew-cask,singingwolfboy/homebrew-cask,amatos/homebrew-cask,adrianchia/homebrew-cask,brianshumate/homebrew-cask,gilesdring/homebrew-cask,miccal/homebrew-cask,gyndav/homebrew-cask,englishm/homebrew-cask,robbiethegeek/homebrew-cask,seanorama/homebrew-cask,asins/homebrew-cask,codeurge/homebrew-cask,sebcode/homebrew-cask,cohei/homebrew-cask,blainesch/homebrew-cask,ksylvan/homebrew-cask,santoshsahoo/homebrew-cask,LaurentFough/homebrew-cask,tranc99/homebrew-cask,forevergenin/homebrew-cask,dwkns/homebrew-cask,vigosan/homebrew-cask,kryhear/homebrew-cask,MicTech/homebrew-cask,ctrevino/homebrew-cask,hellosky806/homebrew-cask,chrisfinazzo/homebrew-cask,josa42/homebrew-cask,catap/homebrew-cask,wickles/homebrew-cask,muan/homebrew-cask,wmorin/homebrew-cask,MerelyAPseudonym/homebrew-cask,lukeadams/homebrew-cask,ebraminio/homebrew-cask,LaurentFough/homebrew-cask,jeroenseegers/homebrew-cask,zhuzihhhh/homebrew-cask,a-x-/homebrew-cask,Fedalto/homebrew-cask,dictcp/homebrew-cask,usami-k/homebrew-cask,linc01n/homebrew-cask,delphinus35/homebrew-cask,af/homebrew-cask,tmoreira2020/homebrew,paour/homebrew-cask,rhendric/homebrew-cask,cclauss/homebrew-cask,Nitecon/homebrew-cask,bgandon/homebrew-cask,atsuyim/homebrew-cask,d/homebrew-cask,mwek/homebrew-cask,stephenwade/homebrew-cask,julionc/homebrew-cask,fwiesel/homebrew-cask,pinut/homebrew-cask,victorpopkov/homebrew-cask,katoquro/homebrew-cask,nathanielvarona/homebrew-cask,andyli/homebrew-cask,mwilmer/homebrew-cask,tjnycum/homebrew-cask,jhowtan/homebrew-cask,kuno/homebrew-cask,johan/homebrew-cask,dwihn0r/homebrew-cask,moonboots/homebrew-cask,onlynone/homebrew-cask,af/homebrew-cask,ptb/homebrew-cask,haha1903/homebrew-cask,Hywan/homebrew-cask,otaran/homebrew-cask,enriclluelles/homebrew-cask,feigaochn/homebrew-cask,kingthorin/homebrew-cask,hvisage/homebrew-cask,ebraminio/homebrew-cask,sgnh/homebrew-cask,lantrix/homebrew-cask,bgandon/homebrew-cask,Gasol/homebrew-cask,malob/homebrew-cask,caskroom/homebrew-cask,wuman/homebrew-cask,13k/homebrew-cask,winkelsdorf/homebrew-cask,wickedsp1d3r/homebrew-cask,winkelsdorf/homebrew-cask,jamesmlees/homebrew-cask,jangalinski/homebrew-cask,dustinblackman/homebrew-cask,markhuber/homebrew-cask,jamesmlees/homebrew-cask,mlocher/homebrew-cask,akiomik/homebrew-cask,FranklinChen/homebrew-cask,astorije/homebrew-cask,johntrandall/homebrew-cask,katoquro/homebrew-cask,ksato9700/homebrew-cask,tyage/homebrew-cask,ahvigil/homebrew-cask,kevyau/homebrew-cask,jalaziz/homebrew-cask,colindunn/homebrew-cask,bchatard/homebrew-cask,tedbundyjr/homebrew-cask,guylabs/homebrew-cask,bcomnes/homebrew-cask,schneidmaster/homebrew-cask,jgarber623/homebrew-cask,fazo96/homebrew-cask,skyyuan/homebrew-cask,johan/homebrew-cask,esebastian/homebrew-cask,williamboman/homebrew-cask,cobyism/homebrew-cask,neverfox/homebrew-cask,lieuwex/homebrew-cask,cclauss/homebrew-cask,CameronGarrett/homebrew-cask,jen20/homebrew-cask,dwihn0r/homebrew-cask,boydj/homebrew-cask,Amorymeltzer/homebrew-cask,faun/homebrew-cask,squid314/homebrew-cask,ldong/homebrew-cask,JoelLarson/homebrew-cask,leipert/homebrew-cask,michelegera/homebrew-cask,opsdev-ws/homebrew-cask,joschi/homebrew-cask,colindean/homebrew-cask,delphinus35/homebrew-cask,yurikoles/homebrew-cask,joshka/homebrew-cask | ruby | ## Code Before:
cask :v1 => 'transporter-desktop' do
version '3.1.15_18289'
sha256 'fecf3b1944832261900237537962a4783d709caa96c3e93ec2d828b88425ec8e'
# connecteddata.com is the official download host per the vendor homepage
url "https://secure.connecteddata.com/mac/2.5/software/Transporter_Desktop_#{version}.dmg"
homepage 'http://www.filetransporter.com/'
license :commercial
app 'Transporter Desktop.app'
end
## Instruction:
Update Transporter Desktop client to 3.1.17
This commit updates the version to 3.1.17 and the SHA for the
downloaded file.
## Code After:
cask :v1 => 'transporter-desktop' do
version '3.1.17_18519'
sha256 'c62adff9e27ebdc424d7fb01b02d5d5ba06a53305c7f6d65ecde790bb487a95e'
# connecteddata.com is the official download host per the vendor homepage
url "https://secure.connecteddata.com/mac/2.5/software/Transporter_Desktop_#{version}.dmg"
homepage 'http://www.filetransporter.com/'
license :commercial
app 'Transporter Desktop.app'
end
| cask :v1 => 'transporter-desktop' do
- version '3.1.15_18289'
? ^ ^^
+ version '3.1.17_18519'
? ^ ^^
- sha256 'fecf3b1944832261900237537962a4783d709caa96c3e93ec2d828b88425ec8e'
+ sha256 'c62adff9e27ebdc424d7fb01b02d5d5ba06a53305c7f6d65ecde790bb487a95e'
# connecteddata.com is the official download host per the vendor homepage
url "https://secure.connecteddata.com/mac/2.5/software/Transporter_Desktop_#{version}.dmg"
homepage 'http://www.filetransporter.com/'
license :commercial
app 'Transporter Desktop.app'
end | 4 | 0.363636 | 2 | 2 |
ea5dc470d3b789ad8dc0be2c256b9c7ec6ac8500 | nailgun/static/templates/cluster/customization_message.html | nailgun/static/templates/cluster/customization_message.html | <% if (cluster.get('is_customized')) { %>
<div class="alert alert-block globalalert">
<p class="enable-selection">
This environment's deploy parameters were modified with CLI, any further modification through Web interface will not affect deployment, proceed with caution.
</p>
</div>
<% } %>
| <% if (cluster.get('is_customized')) { %>
<div class="alert alert-block globalalert">
<p class="enable-selection">
Some deployment parameters for this environment have been modified from Fuel CLI. Changes from Fuel CLI take precedence over any settings made from your browser. Proceed with caution.
</p>
</div>
<% } %>
| Improve CLI parameter warning in web | Improve CLI parameter warning in web
Change-Id: I6546433faae24815ee0006db2bcc50adf31a0268
| HTML | apache-2.0 | eayunstack/fuel-web,prmtl/fuel-web,SmartInfrastructures/fuel-web-dev,huntxu/fuel-web,zhaochao/fuel-web,koder-ua/nailgun-fcert,zhaochao/fuel-web,eayunstack/fuel-web,nebril/fuel-web,eayunstack/fuel-web,SmartInfrastructures/fuel-web-dev,nebril/fuel-web,nebril/fuel-web,huntxu/fuel-web,koder-ua/nailgun-fcert,koder-ua/nailgun-fcert,huntxu/fuel-web,stackforge/fuel-web,zhaochao/fuel-web,SmartInfrastructures/fuel-web-dev,eayunstack/fuel-web,stackforge/fuel-web,prmtl/fuel-web,SmartInfrastructures/fuel-web-dev,huntxu/fuel-web,prmtl/fuel-web,nebril/fuel-web,eayunstack/fuel-web,prmtl/fuel-web,huntxu/fuel-web,SmartInfrastructures/fuel-web-dev,prmtl/fuel-web,nebril/fuel-web,stackforge/fuel-web,koder-ua/nailgun-fcert,zhaochao/fuel-web,zhaochao/fuel-web | html | ## Code Before:
<% if (cluster.get('is_customized')) { %>
<div class="alert alert-block globalalert">
<p class="enable-selection">
This environment's deploy parameters were modified with CLI, any further modification through Web interface will not affect deployment, proceed with caution.
</p>
</div>
<% } %>
## Instruction:
Improve CLI parameter warning in web
Change-Id: I6546433faae24815ee0006db2bcc50adf31a0268
## Code After:
<% if (cluster.get('is_customized')) { %>
<div class="alert alert-block globalalert">
<p class="enable-selection">
Some deployment parameters for this environment have been modified from Fuel CLI. Changes from Fuel CLI take precedence over any settings made from your browser. Proceed with caution.
</p>
</div>
<% } %>
| <% if (cluster.get('is_customized')) { %>
<div class="alert alert-block globalalert">
<p class="enable-selection">
- This environment's deploy parameters were modified with CLI, any further modification through Web interface will not affect deployment, proceed with caution.
+ Some deployment parameters for this environment have been modified from Fuel CLI. Changes from Fuel CLI take precedence over any settings made from your browser. Proceed with caution.
</p>
</div>
<% } %> | 2 | 0.285714 | 1 | 1 |
c41eaf5dea612cc910d10753860514bd18a721ba | dist/utils/dimension/readme.md | dist/utils/dimension/readme.md |
Applies a fluid width that is equal to the chosen ratio, relative to its parent container. Can be applied to components and sub-components.
## Installation
Refer to the main [installation instructions for Stencil](https://github.com/mobify/stencil#installation).
Use the following to import the utility into your project with Sass:
```
@import '../bower_components/stencil/dist/utils/dimension';
```
## Using the Dimension Utility
### Example Markup
```html
<!-- Goes from u-width-1of6 up to u-width-5of6, then lastly u-width-full -->
<div class="u-width-1of6">
</div>
```
## Demo
Visual examples of the [Dimension Utility](https://mobify.github.io/stencil/visual/utils/dimension/index.html)
## Attribution
- https://github.com/suitcss/utils-size
|
Applies a fluid width that is equal to the chosen ratio, relative to its parent container. Can be applied to components and sub-components.
## Installation
Refer to the main [installation instructions for Stencil](https://github.com/mobify/stencil#installation).
Use the following to import the utility into your project with Sass:
```
@import '../bower_components/stencil/dist/utils/dimension';
```
## Using the Dimension Utility
### Example Markup
```html
<div class="u-width-1of6">
</div>
```
### Options
`.u-width-1of3` or `.u-width-2of6`
`.u-width-2of3` or `.u-width-4of6`
`.u-width-1of4`
`.u-width-1of2` or `.u-width-2of4` or `.u-width-3of6`
`.u-width-3of4`
`.u-width-1of6`
`.u-width-5of6`
`.u-width-full`
## Demo
Visual examples of the [Dimension Utility](https://mobify.github.io/stencil/visual/utils/dimension/index.html)
## Attribution
- https://github.com/suitcss/utils-size
| Add list of dimensions options | Add list of dimensions options
| Markdown | mit | mobify/stencil,mobify/stencil | markdown | ## Code Before:
Applies a fluid width that is equal to the chosen ratio, relative to its parent container. Can be applied to components and sub-components.
## Installation
Refer to the main [installation instructions for Stencil](https://github.com/mobify/stencil#installation).
Use the following to import the utility into your project with Sass:
```
@import '../bower_components/stencil/dist/utils/dimension';
```
## Using the Dimension Utility
### Example Markup
```html
<!-- Goes from u-width-1of6 up to u-width-5of6, then lastly u-width-full -->
<div class="u-width-1of6">
</div>
```
## Demo
Visual examples of the [Dimension Utility](https://mobify.github.io/stencil/visual/utils/dimension/index.html)
## Attribution
- https://github.com/suitcss/utils-size
## Instruction:
Add list of dimensions options
## Code After:
Applies a fluid width that is equal to the chosen ratio, relative to its parent container. Can be applied to components and sub-components.
## Installation
Refer to the main [installation instructions for Stencil](https://github.com/mobify/stencil#installation).
Use the following to import the utility into your project with Sass:
```
@import '../bower_components/stencil/dist/utils/dimension';
```
## Using the Dimension Utility
### Example Markup
```html
<div class="u-width-1of6">
</div>
```
### Options
`.u-width-1of3` or `.u-width-2of6`
`.u-width-2of3` or `.u-width-4of6`
`.u-width-1of4`
`.u-width-1of2` or `.u-width-2of4` or `.u-width-3of6`
`.u-width-3of4`
`.u-width-1of6`
`.u-width-5of6`
`.u-width-full`
## Demo
Visual examples of the [Dimension Utility](https://mobify.github.io/stencil/visual/utils/dimension/index.html)
## Attribution
- https://github.com/suitcss/utils-size
|
Applies a fluid width that is equal to the chosen ratio, relative to its parent container. Can be applied to components and sub-components.
## Installation
Refer to the main [installation instructions for Stencil](https://github.com/mobify/stencil#installation).
Use the following to import the utility into your project with Sass:
```
@import '../bower_components/stencil/dist/utils/dimension';
```
## Using the Dimension Utility
### Example Markup
```html
- <!-- Goes from u-width-1of6 up to u-width-5of6, then lastly u-width-full -->
<div class="u-width-1of6">
</div>
```
+
+
+ ### Options
+
+ `.u-width-1of3` or `.u-width-2of6`
+
+ `.u-width-2of3` or `.u-width-4of6`
+
+ `.u-width-1of4`
+
+ `.u-width-1of2` or `.u-width-2of4` or `.u-width-3of6`
+
+ `.u-width-3of4`
+
+ `.u-width-1of6`
+
+ `.u-width-5of6`
+
+ `.u-width-full`
## Demo
Visual examples of the [Dimension Utility](https://mobify.github.io/stencil/visual/utils/dimension/index.html)
## Attribution
- https://github.com/suitcss/utils-size | 20 | 0.571429 | 19 | 1 |
7a3f71b52175b210476a2a00689007d3b9f3e8ca | .github/workflows/push-to-docker-hub.yml | .github/workflows/push-to-docker-hub.yml | name: Run CI then push to Docker Hub
on:
push:
tags:
- '*'
branches:
- master
jobs:
push_to_docker_hub:
name: Push Docker image to Docker Hub
# This uses the default metadata-action configuration, see https://github.com/docker/metadata-action
# Pushes to master should build `ukwa/w3act:master`, tags should build `ukwa/w3act:TAG` and update `ukwa/w3act:latest` to refer to TAG.
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set up Docker metadata
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ github.repository }}
- name: Set up version variable to embed in container
run: echo "VERSION=`git describe --tags --always`" >> $GITHUB_ENV
- name: Log in to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Push to Docker Hub
uses: docker/build-push-action@v2
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
| name: Run CI then push to Docker Hub
on:
push:
tags:
- '*'
branches:
- master
jobs:
push_to_docker_hub:
name: Push Docker image to Docker Hub
# This uses the default metadata-action configuration, see https://github.com/docker/metadata-action
# Pushes to master should build `ukwa/w3act:master`, tags should build `ukwa/w3act:TAG` and update `ukwa/w3act:latest` to refer to TAG.
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set up Docker metadata
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ github.repository }}
- name: Set up version variable to embed in container
run: echo "VERSION=`git describe --tags --always`" >> $GITHUB_ENV
- name: Log in to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Push to Docker Hub
uses: docker/build-push-action@v2
with:
build-args: VERSION=$VERSION
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
| Set build arg from env var. | Set build arg from env var.
| YAML | apache-2.0 | ukwa/w3act,ukwa/w3act,ukwa/w3act,ukwa/w3act | yaml | ## Code Before:
name: Run CI then push to Docker Hub
on:
push:
tags:
- '*'
branches:
- master
jobs:
push_to_docker_hub:
name: Push Docker image to Docker Hub
# This uses the default metadata-action configuration, see https://github.com/docker/metadata-action
# Pushes to master should build `ukwa/w3act:master`, tags should build `ukwa/w3act:TAG` and update `ukwa/w3act:latest` to refer to TAG.
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set up Docker metadata
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ github.repository }}
- name: Set up version variable to embed in container
run: echo "VERSION=`git describe --tags --always`" >> $GITHUB_ENV
- name: Log in to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Push to Docker Hub
uses: docker/build-push-action@v2
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
## Instruction:
Set build arg from env var.
## Code After:
name: Run CI then push to Docker Hub
on:
push:
tags:
- '*'
branches:
- master
jobs:
push_to_docker_hub:
name: Push Docker image to Docker Hub
# This uses the default metadata-action configuration, see https://github.com/docker/metadata-action
# Pushes to master should build `ukwa/w3act:master`, tags should build `ukwa/w3act:TAG` and update `ukwa/w3act:latest` to refer to TAG.
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set up Docker metadata
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ github.repository }}
- name: Set up version variable to embed in container
run: echo "VERSION=`git describe --tags --always`" >> $GITHUB_ENV
- name: Log in to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Push to Docker Hub
uses: docker/build-push-action@v2
with:
build-args: VERSION=$VERSION
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
| name: Run CI then push to Docker Hub
on:
push:
tags:
- '*'
branches:
- master
jobs:
push_to_docker_hub:
name: Push Docker image to Docker Hub
# This uses the default metadata-action configuration, see https://github.com/docker/metadata-action
# Pushes to master should build `ukwa/w3act:master`, tags should build `ukwa/w3act:TAG` and update `ukwa/w3act:latest` to refer to TAG.
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set up Docker metadata
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ github.repository }}
- name: Set up version variable to embed in container
run: echo "VERSION=`git describe --tags --always`" >> $GITHUB_ENV
- name: Log in to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Push to Docker Hub
uses: docker/build-push-action@v2
with:
+ build-args: VERSION=$VERSION
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} | 1 | 0.027027 | 1 | 0 |
9830faa4502cbab1f21cbd0e1ce0895579dad8ca | 2015/11/index.html | 2015/11/index.html | ---
layout: default
title: "KirovohradJS · 2015"
description: "KirovohradJS - это конференция для JavaScript и NodeJS разработчиков в Кировограде"
keywords: "Кировоград, Kirovohrad, NodeJS, NodeSchool, JavaScript, KirovohradJS, KrJS"
---
{% include navigation.html date="2015_11" %}
{% include header.html date="2015_11" %}
{% include speakers.html date="2015_11" %}
{% include schedule.html date="2015_11" %}
{% include place.html date="2015_11" %}
{% include partners.html date="2015_11" %}
{% include organizers.html date="2015_11" %}
| ---
layout: default
title: "KirovohradJS · 2015"
description: "KirovohradJS - это конференция для JavaScript и NodeJS разработчиков в Кировограде"
keywords: "Кировоград, Kirovohrad, NodeJS, NodeSchool, JavaScript, KirovohradJS, KrJS"
---
{% include header.html date="2015_11" %}
{% include speakers.html date="2015_11" %}
{% include schedule.html date="2015_11" %}
{% include place.html date="2015_11" %}
{% include partners.html date="2015_11" %}
{% include organizers.html date="2015_11" %}
| Remove navigation from archive record | Remove navigation from archive record
| HTML | mit | ghaiklor/kirovohradjs.com,ghaiklor/kirovohradjs.com | html | ## Code Before:
---
layout: default
title: "KirovohradJS · 2015"
description: "KirovohradJS - это конференция для JavaScript и NodeJS разработчиков в Кировограде"
keywords: "Кировоград, Kirovohrad, NodeJS, NodeSchool, JavaScript, KirovohradJS, KrJS"
---
{% include navigation.html date="2015_11" %}
{% include header.html date="2015_11" %}
{% include speakers.html date="2015_11" %}
{% include schedule.html date="2015_11" %}
{% include place.html date="2015_11" %}
{% include partners.html date="2015_11" %}
{% include organizers.html date="2015_11" %}
## Instruction:
Remove navigation from archive record
## Code After:
---
layout: default
title: "KirovohradJS · 2015"
description: "KirovohradJS - это конференция для JavaScript и NodeJS разработчиков в Кировограде"
keywords: "Кировоград, Kirovohrad, NodeJS, NodeSchool, JavaScript, KirovohradJS, KrJS"
---
{% include header.html date="2015_11" %}
{% include speakers.html date="2015_11" %}
{% include schedule.html date="2015_11" %}
{% include place.html date="2015_11" %}
{% include partners.html date="2015_11" %}
{% include organizers.html date="2015_11" %}
| ---
layout: default
title: "KirovohradJS · 2015"
description: "KirovohradJS - это конференция для JavaScript и NodeJS разработчиков в Кировограде"
keywords: "Кировоград, Kirovohrad, NodeJS, NodeSchool, JavaScript, KirovohradJS, KrJS"
---
- {% include navigation.html date="2015_11" %}
{% include header.html date="2015_11" %}
{% include speakers.html date="2015_11" %}
{% include schedule.html date="2015_11" %}
{% include place.html date="2015_11" %}
{% include partners.html date="2015_11" %}
{% include organizers.html date="2015_11" %} | 1 | 0.071429 | 0 | 1 |
4c0199cd20b6f1e7b9f820af7023cf413d810a46 | docker-compose.yml | docker-compose.yml | version: '2.1'
services:
cozy:
container_name: cozy-desktop-stack
build: ./dev/cozy-stack
ports:
- "8080:8080"
- "8025:8025"
- "5984:5984"
volumes:
- .:/cozy-desktop
- ./tmp/couchdb:/usr/local/couchdb/data
- ./tmp/cozy-storage:/data/cozy-storage
| version: '2.1'
services:
cozy:
container_name: cozy-desktop-stack
build: ./dev/cozy-stack
ports:
- "8080:8080"
- "8025:8025"
- "5984:5984"
volumes:
- .:/cozy-desktop
# Mounting storage files on a Windows or macOS workstation is a bad idea
# since it may generate FS-specific cozy-stack issues.
# Better keep them in the GNU/Linux container to match the current
# production environment for now.
| Stop mounting storage (and couch) files | docker: Stop mounting storage (and couch) files
Mounting storage files on a macOS workstation may generate FS-specific
test failures (see next commit).
And mounting couch files by themselves doesn't really make sense.
| YAML | agpl-3.0 | nono/cozy-desktop,nono/cozy-desktop,cozy-labs/cozy-desktop,nono/cozy-desktop,cozy-labs/cozy-desktop,cozy-labs/cozy-desktop,nono/cozy-desktop,cozy-labs/cozy-desktop | yaml | ## Code Before:
version: '2.1'
services:
cozy:
container_name: cozy-desktop-stack
build: ./dev/cozy-stack
ports:
- "8080:8080"
- "8025:8025"
- "5984:5984"
volumes:
- .:/cozy-desktop
- ./tmp/couchdb:/usr/local/couchdb/data
- ./tmp/cozy-storage:/data/cozy-storage
## Instruction:
docker: Stop mounting storage (and couch) files
Mounting storage files on a macOS workstation may generate FS-specific
test failures (see next commit).
And mounting couch files by themselves doesn't really make sense.
## Code After:
version: '2.1'
services:
cozy:
container_name: cozy-desktop-stack
build: ./dev/cozy-stack
ports:
- "8080:8080"
- "8025:8025"
- "5984:5984"
volumes:
- .:/cozy-desktop
# Mounting storage files on a Windows or macOS workstation is a bad idea
# since it may generate FS-specific cozy-stack issues.
# Better keep them in the GNU/Linux container to match the current
# production environment for now.
| version: '2.1'
services:
cozy:
container_name: cozy-desktop-stack
build: ./dev/cozy-stack
ports:
- "8080:8080"
- "8025:8025"
- "5984:5984"
volumes:
- .:/cozy-desktop
- - ./tmp/couchdb:/usr/local/couchdb/data
- - ./tmp/cozy-storage:/data/cozy-storage
+ # Mounting storage files on a Windows or macOS workstation is a bad idea
+ # since it may generate FS-specific cozy-stack issues.
+ # Better keep them in the GNU/Linux container to match the current
+ # production environment for now. | 6 | 0.461538 | 4 | 2 |
e9c4881ee29ba104caf9fc8330583c254fe52c06 | scripts/examples/Arduino/Portenta-H7/19-Low-Power/deep_sleep.py | scripts/examples/Arduino/Portenta-H7/19-Low-Power/deep_sleep.py | import pyb, machine, sensor
# Create and init RTC object.
rtc = pyb.RTC()
# (year, month, day[, hour[, minute[, second[, microsecond[, tzinfo]]]]])
rtc.datetime((2014, 5, 1, 4, 13, 0, 0, 0))
# Print RTC info.
print(rtc.datetime())
sensor.reset()
# Enable sensor softsleep
sensor.sleep(True)
# Optionally bypass the regulator on OV7725
# for the lowest possible power consumption.
if (sensor.get_id() == sensor.OV7725):
# Bypass internal regulator
sensor.__write_reg(0x4F, 0x18)
# Shutdown the sensor (pulls PWDN high).
sensor.shutdown(True)
# Enable RTC interrupts every 30 seconds.
# Note the camera will RESET after wakeup from Deepsleep Mode.
rtc.wakeup(30000)
# Enter Deepsleep Mode.
machine.deepsleep()
| import pyb, machine, sensor
# Create and init RTC object.
rtc = pyb.RTC()
# (year, month, day[, hour[, minute[, second[, microsecond[, tzinfo]]]]])
rtc.datetime((2014, 5, 1, 4, 13, 0, 0, 0))
# Print RTC info.
print(rtc.datetime())
sensor.reset()
# Shutdown the sensor (pulls PWDN high).
sensor.shutdown(True)
# Enable RTC interrupts every 30 seconds.
# Note the camera will RESET after wakeup from Deepsleep Mode.
rtc.wakeup(30000)
# Enter Deepsleep Mode.
machine.deepsleep()
| Remove sensor setting from deep sleep example | Remove sensor setting from deep sleep example
| Python | mit | iabdalkader/openmv,openmv/openmv,kwagyeman/openmv,iabdalkader/openmv,openmv/openmv,kwagyeman/openmv,openmv/openmv,iabdalkader/openmv,kwagyeman/openmv,iabdalkader/openmv,kwagyeman/openmv,openmv/openmv | python | ## Code Before:
import pyb, machine, sensor
# Create and init RTC object.
rtc = pyb.RTC()
# (year, month, day[, hour[, minute[, second[, microsecond[, tzinfo]]]]])
rtc.datetime((2014, 5, 1, 4, 13, 0, 0, 0))
# Print RTC info.
print(rtc.datetime())
sensor.reset()
# Enable sensor softsleep
sensor.sleep(True)
# Optionally bypass the regulator on OV7725
# for the lowest possible power consumption.
if (sensor.get_id() == sensor.OV7725):
# Bypass internal regulator
sensor.__write_reg(0x4F, 0x18)
# Shutdown the sensor (pulls PWDN high).
sensor.shutdown(True)
# Enable RTC interrupts every 30 seconds.
# Note the camera will RESET after wakeup from Deepsleep Mode.
rtc.wakeup(30000)
# Enter Deepsleep Mode.
machine.deepsleep()
## Instruction:
Remove sensor setting from deep sleep example
## Code After:
import pyb, machine, sensor
# Create and init RTC object.
rtc = pyb.RTC()
# (year, month, day[, hour[, minute[, second[, microsecond[, tzinfo]]]]])
rtc.datetime((2014, 5, 1, 4, 13, 0, 0, 0))
# Print RTC info.
print(rtc.datetime())
sensor.reset()
# Shutdown the sensor (pulls PWDN high).
sensor.shutdown(True)
# Enable RTC interrupts every 30 seconds.
# Note the camera will RESET after wakeup from Deepsleep Mode.
rtc.wakeup(30000)
# Enter Deepsleep Mode.
machine.deepsleep()
| import pyb, machine, sensor
# Create and init RTC object.
rtc = pyb.RTC()
# (year, month, day[, hour[, minute[, second[, microsecond[, tzinfo]]]]])
rtc.datetime((2014, 5, 1, 4, 13, 0, 0, 0))
# Print RTC info.
print(rtc.datetime())
sensor.reset()
- # Enable sensor softsleep
- sensor.sleep(True)
-
- # Optionally bypass the regulator on OV7725
- # for the lowest possible power consumption.
- if (sensor.get_id() == sensor.OV7725):
- # Bypass internal regulator
- sensor.__write_reg(0x4F, 0x18)
-
# Shutdown the sensor (pulls PWDN high).
sensor.shutdown(True)
# Enable RTC interrupts every 30 seconds.
# Note the camera will RESET after wakeup from Deepsleep Mode.
rtc.wakeup(30000)
# Enter Deepsleep Mode.
machine.deepsleep() | 9 | 0.290323 | 0 | 9 |
84648be125624aac38963f921b35c563d35b245e | _includes/apply-now.html | _includes/apply-now.html | <!-- Begin Apply now Section -->
<section id="apply-now" class="apply-now container content-section">
<div class="row">
<!-- Begin MailChimp Signup Form -->
<div id="mc_embed_signup" class="col-md-8 col-md-offset-2 text-center">
<h3>Thank you for applying !</h3>
<p>
Thank you for applying in such a big number for the first edition of Cloudbase LABS. Unfortunately, the signup period ended, but we are waiting for you to the next editions of Cloudbase LABS, and also to our next events.
</p>
<p>
The results will be soon announced, just right after the last day of interviews.
</p>
<p>
Hope to see you soon,
Cloudbase Solutions Team
</p>
</section>
<!-- End Apply now Section -->
| <!-- Begin Apply now Section -->
<section id="apply-now" class="apply-now container content-section">
<div class="row">
<!-- Begin MailChimp Signup Form -->
<div id="mc_embed_signup" class="col-md-8 col-md-offset-2 text-center">
<h3>Thank you for applying !</h3>
<p>
Thank you for applying in such a great number for the first edition of our CloudbaseLABS workshops in Iași. Unfortunately the application windows has closed, but we’re welcoming you to join us at our next events.
</p>
<p>
Looking forward to hearing from you soon,
</p>
<p>
Cloudbase Solutions Team
</p>
</section>
<!-- End Apply now Section -->
| Update content from apply now section | Update content from apply now section
| HTML | mit | alexandrucoman/labs.cloudbase.it,alexandrucoman/labs.cloudbase.it | html | ## Code Before:
<!-- Begin Apply now Section -->
<section id="apply-now" class="apply-now container content-section">
<div class="row">
<!-- Begin MailChimp Signup Form -->
<div id="mc_embed_signup" class="col-md-8 col-md-offset-2 text-center">
<h3>Thank you for applying !</h3>
<p>
Thank you for applying in such a big number for the first edition of Cloudbase LABS. Unfortunately, the signup period ended, but we are waiting for you to the next editions of Cloudbase LABS, and also to our next events.
</p>
<p>
The results will be soon announced, just right after the last day of interviews.
</p>
<p>
Hope to see you soon,
Cloudbase Solutions Team
</p>
</section>
<!-- End Apply now Section -->
## Instruction:
Update content from apply now section
## Code After:
<!-- Begin Apply now Section -->
<section id="apply-now" class="apply-now container content-section">
<div class="row">
<!-- Begin MailChimp Signup Form -->
<div id="mc_embed_signup" class="col-md-8 col-md-offset-2 text-center">
<h3>Thank you for applying !</h3>
<p>
Thank you for applying in such a great number for the first edition of our CloudbaseLABS workshops in Iași. Unfortunately the application windows has closed, but we’re welcoming you to join us at our next events.
</p>
<p>
Looking forward to hearing from you soon,
</p>
<p>
Cloudbase Solutions Team
</p>
</section>
<!-- End Apply now Section -->
| <!-- Begin Apply now Section -->
<section id="apply-now" class="apply-now container content-section">
<div class="row">
<!-- Begin MailChimp Signup Form -->
<div id="mc_embed_signup" class="col-md-8 col-md-offset-2 text-center">
<h3>Thank you for applying !</h3>
<p>
- Thank you for applying in such a big number for the first edition of Cloudbase LABS. Unfortunately, the signup period ended, but we are waiting for you to the next editions of Cloudbase LABS, and also to our next events.
+ Thank you for applying in such a great number for the first edition of our CloudbaseLABS workshops in Iași. Unfortunately the application windows has closed, but we’re welcoming you to join us at our next events.
</p>
+
<p>
- The results will be soon announced, just right after the last day of interviews.
+ Looking forward to hearing from you soon,
</p>
+
<p>
- Hope to see you soon,
Cloudbase Solutions Team
</p>
</section>
<!-- End Apply now Section --> | 7 | 0.388889 | 4 | 3 |
5da99ceeeec050b2732475ffca89a64d2d10f34e | trainTweet.py | trainTweet.py |
import subprocess
import argparse
parser = argparse.ArgumentParser(description="Tweet some Train Statuses!")
parser.add_argument("-s", "--station", dest="station", type=str, help="Station Short Code. Ex: 'SLM'")
parser.add_argument("-t", "--train", dest="train", type=int, help="Train Number. Ex: '500'")
parser.add_argument("-d", "--date", dest="date", type=str, help="Date. MM/DD/YYYY")
parser.set_defaults(station=None, train=None, date=None)
args = parser.parse_args()
def main():
def run_command(cmd_array, shell=False):
p = subprocess.Popen(cmd_array, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=shell)
out, err = p.communicate()
return out
command = ['phantomjs', 'trainStatus.js']
if args.station:
command.append(str(args.station))
if args.train:
command.append(str(args.train))
if args.date:
command.append(str(args.date))
print "Executing {}".format(command)
text = run_command(command)
tweet = text.split("-" * 3)
result = run_command(['node', 'twitter.js', tweet[1]])
print result
if __name__ == "__main__":
main()
|
import subprocess
import argparse
import os
parser = argparse.ArgumentParser(description="Tweet some Train Statuses!")
parser.add_argument("-s", "--station", dest="station", type=str, help="Station Short Code. Ex: 'SLM'")
parser.add_argument("-t", "--train", dest="train", type=int, help="Train Number. Ex: '500'")
parser.add_argument("-d", "--date", dest="date", type=str, help="Date. MM/DD/YYYY")
parser.set_defaults(station=None, train=None, date=None)
args = parser.parse_args()
def main():
def run_command(cmd_array, shell=False):
print "Executing `{}`".format(cmd_array)
p = subprocess.Popen(cmd_array, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=shell)
out, err = p.communicate()
return out
command = ['phantomjs', "{}/trainStatus.js".format(os.getcwd())]
if args.station:
command.append(str(args.station))
if args.train:
command.append(str(args.train))
if args.date:
command.append(str(args.date))
text = run_command(command)
tweet = text.split("-" * 3)
result = run_command(['node', "{}/twitter.js".format(os.getcwd()), tweet[1]])
print result
if __name__ == "__main__":
main()
| Use full paths & print our current command fully | Use full paths & print our current command fully
| Python | mit | dmiedema/train-500-status | python | ## Code Before:
import subprocess
import argparse
parser = argparse.ArgumentParser(description="Tweet some Train Statuses!")
parser.add_argument("-s", "--station", dest="station", type=str, help="Station Short Code. Ex: 'SLM'")
parser.add_argument("-t", "--train", dest="train", type=int, help="Train Number. Ex: '500'")
parser.add_argument("-d", "--date", dest="date", type=str, help="Date. MM/DD/YYYY")
parser.set_defaults(station=None, train=None, date=None)
args = parser.parse_args()
def main():
def run_command(cmd_array, shell=False):
p = subprocess.Popen(cmd_array, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=shell)
out, err = p.communicate()
return out
command = ['phantomjs', 'trainStatus.js']
if args.station:
command.append(str(args.station))
if args.train:
command.append(str(args.train))
if args.date:
command.append(str(args.date))
print "Executing {}".format(command)
text = run_command(command)
tweet = text.split("-" * 3)
result = run_command(['node', 'twitter.js', tweet[1]])
print result
if __name__ == "__main__":
main()
## Instruction:
Use full paths & print our current command fully
## Code After:
import subprocess
import argparse
import os
parser = argparse.ArgumentParser(description="Tweet some Train Statuses!")
parser.add_argument("-s", "--station", dest="station", type=str, help="Station Short Code. Ex: 'SLM'")
parser.add_argument("-t", "--train", dest="train", type=int, help="Train Number. Ex: '500'")
parser.add_argument("-d", "--date", dest="date", type=str, help="Date. MM/DD/YYYY")
parser.set_defaults(station=None, train=None, date=None)
args = parser.parse_args()
def main():
def run_command(cmd_array, shell=False):
print "Executing `{}`".format(cmd_array)
p = subprocess.Popen(cmd_array, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=shell)
out, err = p.communicate()
return out
command = ['phantomjs', "{}/trainStatus.js".format(os.getcwd())]
if args.station:
command.append(str(args.station))
if args.train:
command.append(str(args.train))
if args.date:
command.append(str(args.date))
text = run_command(command)
tweet = text.split("-" * 3)
result = run_command(['node', "{}/twitter.js".format(os.getcwd()), tweet[1]])
print result
if __name__ == "__main__":
main()
|
import subprocess
import argparse
+ import os
parser = argparse.ArgumentParser(description="Tweet some Train Statuses!")
parser.add_argument("-s", "--station", dest="station", type=str, help="Station Short Code. Ex: 'SLM'")
parser.add_argument("-t", "--train", dest="train", type=int, help="Train Number. Ex: '500'")
parser.add_argument("-d", "--date", dest="date", type=str, help="Date. MM/DD/YYYY")
parser.set_defaults(station=None, train=None, date=None)
args = parser.parse_args()
def main():
def run_command(cmd_array, shell=False):
+ print "Executing `{}`".format(cmd_array)
p = subprocess.Popen(cmd_array, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=shell)
out, err = p.communicate()
return out
- command = ['phantomjs', 'trainStatus.js']
? ^ ^
+ command = ['phantomjs', "{}/trainStatus.js".format(os.getcwd())]
? ^^^^ ^^^^^^^^^^^^^^^^^^^^^
if args.station:
command.append(str(args.station))
if args.train:
command.append(str(args.train))
if args.date:
command.append(str(args.date))
- print "Executing {}".format(command)
text = run_command(command)
tweet = text.split("-" * 3)
- result = run_command(['node', 'twitter.js', tweet[1]])
? ^ ^
+ result = run_command(['node', "{}/twitter.js".format(os.getcwd()), tweet[1]])
? ^^^^ ^^^^^^^^^^^^^^^^^^^^^
print result
if __name__ == "__main__":
main()
| 7 | 0.194444 | 4 | 3 |
df08d7e711f8e7835bbb0befc337a3792de21beb | assets/source/css/frontend/components/_widget.scss | assets/source/css/frontend/components/_widget.scss | .widget {
@extend %widget;
}
.widget--boxed {
@extend %widget--boxed;
}
.widget__title {
@extend %widget__title;
}
.widget__content {
@extend %widget__content;
}
| .widget {
@extend %widget;
}
.widget--boxed {
@extend %widget--boxed;
}
.widget__title {
@extend %widget__title;
}
.widget__content {
@extend %widget__content;
}
.widget--call-to-action {
.button-group {
padding-right: $padding-base;
padding-left: $padding-base;
}
}
| Fix button group for call-to-action widget | BLRBT-2: Fix button group for call-to-action widget
| SCSS | mit | Decisionary/blr-base-theme,Decisionary/blr-base-theme,Decisionary/blr-base-theme | scss | ## Code Before:
.widget {
@extend %widget;
}
.widget--boxed {
@extend %widget--boxed;
}
.widget__title {
@extend %widget__title;
}
.widget__content {
@extend %widget__content;
}
## Instruction:
BLRBT-2: Fix button group for call-to-action widget
## Code After:
.widget {
@extend %widget;
}
.widget--boxed {
@extend %widget--boxed;
}
.widget__title {
@extend %widget__title;
}
.widget__content {
@extend %widget__content;
}
.widget--call-to-action {
.button-group {
padding-right: $padding-base;
padding-left: $padding-base;
}
}
| .widget {
@extend %widget;
}
.widget--boxed {
@extend %widget--boxed;
}
.widget__title {
@extend %widget__title;
}
.widget__content {
@extend %widget__content;
}
+
+ .widget--call-to-action {
+
+ .button-group {
+ padding-right: $padding-base;
+ padding-left: $padding-base;
+ }
+ } | 8 | 0.533333 | 8 | 0 |
6e20e60a8c67cb348bdbe9db116a1162468544e9 | src/batch.js | src/batch.js | 'use strict';
var Promise = require('bluebird');
var boom = require('boom');
var internals = {};
exports.handler = function (batch, reply) {
if (!Array.isArray(batch.payload.requests)) {
return reply(boom.badRequest('Missing requests array'));
}
Promise.map(batch.payload.requests, function (request) {
return batch.server.injectThen({
url: request.path,
method: request.method,
headers: batch.headers,
payload: request.payload,
session: batch.session
})
.get('result');
})
.done(reply);
};
| 'use strict';
var Promise = require('bluebird');
var boom = require('boom');
var internals = {};
exports.handler = function (batch, reply) {
if (!Array.isArray(batch.payload.requests)) {
return reply(boom.badRequest('Missing requests array'));
}
var responses;
if (internals.containsReferences(batch)) {
responses = Promise
.reduce(batch.payload.requests, function (requests, request) {
requests.push(request);
return requests;
}, [])
.reduce(function (responses, request) {
return internals.inject(request, batch)
.bind(responses)
.then(responses.push)
.return(responses);
}, []);
}
else {
responses = Promise.map(batch.payload.requests, function (request) {
return internals.inject(request, batch);
});
}
responses.done(reply);
};
internals.containsReferences = function (batch) {
return batch.payload.requests.some(function (request) {
return request.references && request.references.length;
});
};
internals.inject = function (request, batch) {
return batch.server.injectThen({
url: request.path,
method: request.method,
headers: batch.headers,
payload: request.payload,
session: batch.session
})
.get('result');
};
| Handle requests with a mapper or reducer depending on presence of references | Handle requests with a mapper or reducer depending on presence of references
| JavaScript | mit | bendrucker/batch-me-if-you-can | javascript | ## Code Before:
'use strict';
var Promise = require('bluebird');
var boom = require('boom');
var internals = {};
exports.handler = function (batch, reply) {
if (!Array.isArray(batch.payload.requests)) {
return reply(boom.badRequest('Missing requests array'));
}
Promise.map(batch.payload.requests, function (request) {
return batch.server.injectThen({
url: request.path,
method: request.method,
headers: batch.headers,
payload: request.payload,
session: batch.session
})
.get('result');
})
.done(reply);
};
## Instruction:
Handle requests with a mapper or reducer depending on presence of references
## Code After:
'use strict';
var Promise = require('bluebird');
var boom = require('boom');
var internals = {};
exports.handler = function (batch, reply) {
if (!Array.isArray(batch.payload.requests)) {
return reply(boom.badRequest('Missing requests array'));
}
var responses;
if (internals.containsReferences(batch)) {
responses = Promise
.reduce(batch.payload.requests, function (requests, request) {
requests.push(request);
return requests;
}, [])
.reduce(function (responses, request) {
return internals.inject(request, batch)
.bind(responses)
.then(responses.push)
.return(responses);
}, []);
}
else {
responses = Promise.map(batch.payload.requests, function (request) {
return internals.inject(request, batch);
});
}
responses.done(reply);
};
internals.containsReferences = function (batch) {
return batch.payload.requests.some(function (request) {
return request.references && request.references.length;
});
};
internals.inject = function (request, batch) {
return batch.server.injectThen({
url: request.path,
method: request.method,
headers: batch.headers,
payload: request.payload,
session: batch.session
})
.get('result');
};
| 'use strict';
var Promise = require('bluebird');
var boom = require('boom');
var internals = {};
exports.handler = function (batch, reply) {
if (!Array.isArray(batch.payload.requests)) {
return reply(boom.badRequest('Missing requests array'));
}
+ var responses;
+ if (internals.containsReferences(batch)) {
+ responses = Promise
+ .reduce(batch.payload.requests, function (requests, request) {
+ requests.push(request);
+ return requests;
+ }, [])
+ .reduce(function (responses, request) {
+ return internals.inject(request, batch)
+ .bind(responses)
+ .then(responses.push)
+ .return(responses);
+ }, []);
+ }
+ else {
- Promise.map(batch.payload.requests, function (request) {
+ responses = Promise.map(batch.payload.requests, function (request) {
? ++++++++++++++
+ return internals.inject(request, batch);
+ });
+ }
+
+ responses.done(reply);
+ };
+
+ internals.containsReferences = function (batch) {
+ return batch.payload.requests.some(function (request) {
+ return request.references && request.references.length;
+ });
+ };
+
+ internals.inject = function (request, batch) {
- return batch.server.injectThen({
? --
+ return batch.server.injectThen({
- url: request.path,
? --
+ url: request.path,
- method: request.method,
? --
+ method: request.method,
- headers: batch.headers,
? --
+ headers: batch.headers,
- payload: request.payload,
? --
+ payload: request.payload,
- session: batch.session
? --
+ session: batch.session
- })
- .get('result');
})
- .done(reply);
+ .get('result');
}; | 47 | 2.136364 | 37 | 10 |
6ad546c39c159087b948a74eb064a4741dd13a09 | _includes/comments.html | _includes/comments.html | <h4>Make a witty comment:</h4>
<form id="comment">
<div>
<label for="message">Message</label>
<textarea placeholder="Come at me!" id="message"></textarea>
</div>
<div>
<label for="name">Name</label>
<input placeholder="Who are you?" type="text" id="name">
</div>
<div>
<label for="email">Email</label>
<input placeholder="Pen pal opportunity!" type="text" id="email">
</div>
<small>Your email will not be shared.</small>
<div class="submit-comment">
<input type="submit" value="Submit">
</div>
</form>
| <h4>Make a witty comment:</h4>
<form id="comment">
<div>
<label for="message">Message</label>
<textarea placeholder="Come at me!" id="message"></textarea>
</div>
<div>
<label for="name">Name</label>
<input placeholder="Who this?" type="text" id="name">
</div>
<div>
<label for="email">Email</label>
<input placeholder="Gravatar" type="text" id="email">
</div>
<small>Your email will not be shared.</small>
<div class="submit-comment">
<input type="submit" value="Submit">
</div>
</form>
| Add comment validation on Firebase, cleanup form | Add comment validation on Firebase, cleanup form
| HTML | mit | nchristiny/nchristiny.github.io,nchristiny/nchristiny.github.io,nchristiny/nchristiny.github.io | html | ## Code Before:
<h4>Make a witty comment:</h4>
<form id="comment">
<div>
<label for="message">Message</label>
<textarea placeholder="Come at me!" id="message"></textarea>
</div>
<div>
<label for="name">Name</label>
<input placeholder="Who are you?" type="text" id="name">
</div>
<div>
<label for="email">Email</label>
<input placeholder="Pen pal opportunity!" type="text" id="email">
</div>
<small>Your email will not be shared.</small>
<div class="submit-comment">
<input type="submit" value="Submit">
</div>
</form>
## Instruction:
Add comment validation on Firebase, cleanup form
## Code After:
<h4>Make a witty comment:</h4>
<form id="comment">
<div>
<label for="message">Message</label>
<textarea placeholder="Come at me!" id="message"></textarea>
</div>
<div>
<label for="name">Name</label>
<input placeholder="Who this?" type="text" id="name">
</div>
<div>
<label for="email">Email</label>
<input placeholder="Gravatar" type="text" id="email">
</div>
<small>Your email will not be shared.</small>
<div class="submit-comment">
<input type="submit" value="Submit">
</div>
</form>
| <h4>Make a witty comment:</h4>
<form id="comment">
<div>
<label for="message">Message</label>
<textarea placeholder="Come at me!" id="message"></textarea>
</div>
<div>
<label for="name">Name</label>
- <input placeholder="Who are you?" type="text" id="name">
? ^^^^^^^
+ <input placeholder="Who this?" type="text" id="name">
? ^^^^
</div>
<div>
<label for="email">Email</label>
- <input placeholder="Pen pal opportunity!" type="text" id="email">
? ^^^^^ ^^^^^^ -------
+ <input placeholder="Gravatar" type="text" id="email">
? ^^ ^^^^
</div>
<small>Your email will not be shared.</small>
<div class="submit-comment">
<input type="submit" value="Submit">
</div>
</form> | 4 | 0.210526 | 2 | 2 |
1448a466109187dece94f64bc4343d3a7800eaed | src/js/api.js | src/js/api.js | function makeRequest(authToken, path, data) {
const d = $.extend({}, { format: 'json', auth_token: authToken }, data);
const u = `https://api.pinboard.in/v1/${path}`;
console.log('%cmakeRequest url: %s $data: %o', 'background: blue; color: white', u, d);
return new Promise((resolve, reject) => {
$.ajax({
url: u,
method: 'GET',
data: d,
timeout: 3000,
}).done((response) => {
console.log('response: %o', response);
try {
resolve(JSON.parse(response));
} catch (e) {
console.error(e);
reject();
}
}).fail((_, textStatus, error) => {
console.error('textStatus: %s error: %s', textStatus, error);
reject();
});
});
}
const Api = {};
Api.getLastUpdated = (authToken) => makeRequest(authToken, 'posts/update');
Api.addBookmark = (authToken, data) => makeRequest(authToken, 'posts/add', data);
Api.deleteBookmark = (authToken, url) => makeRequest(authToken, 'posts/delete', { url });
Api.getBookmark = (authToken, url) => makeRequest(authToken, 'posts/get', { url });
Api.getTags = (authToken) => makeRequest(authToken, 'tags/get');
export default Api;
| function makeRequest(authToken, path, data) {
const d = $.extend({}, { format: 'json', auth_token: authToken, id: 'pinboard-plusplus' }, data);
const u = `https://api.pinboard.in/v1/${path}`;
console.log('%cmakeRequest url: %s $data: %o', 'background: blue; color: white', u, d);
return new Promise((resolve, reject) => {
$.ajax({
url: u,
method: 'GET',
data: d,
timeout: 3000,
}).done((response) => {
console.log('response: %o', response);
try {
resolve(JSON.parse(response));
} catch (e) {
console.error(e);
reject();
}
}).fail((_, textStatus, error) => {
console.error('textStatus: %s error: %s', textStatus, error);
reject();
});
});
}
const Api = {};
Api.getLastUpdated = (authToken) => makeRequest(authToken, 'posts/update');
Api.addBookmark = (authToken, data) => makeRequest(authToken, 'posts/add', data);
Api.deleteBookmark = (authToken, url) => makeRequest(authToken, 'posts/delete', { url });
Api.getBookmark = (authToken, url) => makeRequest(authToken, 'posts/get', { url });
Api.getTags = (authToken) => makeRequest(authToken, 'tags/get');
export default Api;
| Send an id in all API request | Send an id in all API request
| JavaScript | mit | cppcho/pinboard-plusplus,cppcho/pinboard-plusplus | javascript | ## Code Before:
function makeRequest(authToken, path, data) {
const d = $.extend({}, { format: 'json', auth_token: authToken }, data);
const u = `https://api.pinboard.in/v1/${path}`;
console.log('%cmakeRequest url: %s $data: %o', 'background: blue; color: white', u, d);
return new Promise((resolve, reject) => {
$.ajax({
url: u,
method: 'GET',
data: d,
timeout: 3000,
}).done((response) => {
console.log('response: %o', response);
try {
resolve(JSON.parse(response));
} catch (e) {
console.error(e);
reject();
}
}).fail((_, textStatus, error) => {
console.error('textStatus: %s error: %s', textStatus, error);
reject();
});
});
}
const Api = {};
Api.getLastUpdated = (authToken) => makeRequest(authToken, 'posts/update');
Api.addBookmark = (authToken, data) => makeRequest(authToken, 'posts/add', data);
Api.deleteBookmark = (authToken, url) => makeRequest(authToken, 'posts/delete', { url });
Api.getBookmark = (authToken, url) => makeRequest(authToken, 'posts/get', { url });
Api.getTags = (authToken) => makeRequest(authToken, 'tags/get');
export default Api;
## Instruction:
Send an id in all API request
## Code After:
function makeRequest(authToken, path, data) {
const d = $.extend({}, { format: 'json', auth_token: authToken, id: 'pinboard-plusplus' }, data);
const u = `https://api.pinboard.in/v1/${path}`;
console.log('%cmakeRequest url: %s $data: %o', 'background: blue; color: white', u, d);
return new Promise((resolve, reject) => {
$.ajax({
url: u,
method: 'GET',
data: d,
timeout: 3000,
}).done((response) => {
console.log('response: %o', response);
try {
resolve(JSON.parse(response));
} catch (e) {
console.error(e);
reject();
}
}).fail((_, textStatus, error) => {
console.error('textStatus: %s error: %s', textStatus, error);
reject();
});
});
}
const Api = {};
Api.getLastUpdated = (authToken) => makeRequest(authToken, 'posts/update');
Api.addBookmark = (authToken, data) => makeRequest(authToken, 'posts/add', data);
Api.deleteBookmark = (authToken, url) => makeRequest(authToken, 'posts/delete', { url });
Api.getBookmark = (authToken, url) => makeRequest(authToken, 'posts/get', { url });
Api.getTags = (authToken) => makeRequest(authToken, 'tags/get');
export default Api;
| function makeRequest(authToken, path, data) {
- const d = $.extend({}, { format: 'json', auth_token: authToken }, data);
+ const d = $.extend({}, { format: 'json', auth_token: authToken, id: 'pinboard-plusplus' }, data);
? +++++++++++++++++++++++++
const u = `https://api.pinboard.in/v1/${path}`;
console.log('%cmakeRequest url: %s $data: %o', 'background: blue; color: white', u, d);
return new Promise((resolve, reject) => {
$.ajax({
url: u,
method: 'GET',
data: d,
timeout: 3000,
}).done((response) => {
console.log('response: %o', response);
try {
resolve(JSON.parse(response));
} catch (e) {
console.error(e);
reject();
}
}).fail((_, textStatus, error) => {
console.error('textStatus: %s error: %s', textStatus, error);
reject();
});
});
}
const Api = {};
Api.getLastUpdated = (authToken) => makeRequest(authToken, 'posts/update');
Api.addBookmark = (authToken, data) => makeRequest(authToken, 'posts/add', data);
Api.deleteBookmark = (authToken, url) => makeRequest(authToken, 'posts/delete', { url });
Api.getBookmark = (authToken, url) => makeRequest(authToken, 'posts/get', { url });
Api.getTags = (authToken) => makeRequest(authToken, 'tags/get');
export default Api; | 2 | 0.047619 | 1 | 1 |
44f92d7c96b074054b11876d208494da1acef7e7 | Lib/tempfile.py | Lib/tempfile.py |
import posix
import path
# Changeable parameters (by clients!)...
# XXX Should the environment variable $TMPDIR override tempdir?
tempdir = '/usr/tmp'
template = '@'
# Kludge to hold mutable state
class Struct: pass
G = Struct()
G.i = 0
# User-callable function
# XXX Should this have a parameter, like C's mktemp()?
# XXX Should we instead use the model of Standard C's tempnam()?
# XXX By all means, avoid a mess with four different functions like C...
def mktemp():
while 1:
G.i = G.i+1
file = tempdir +'/'+ template + `posix.getpid()` +'.'+ `G.i`
if not path.exists(file):
break
return file
|
import posix
import path
# Changeable parameters (by clients!)...
# XXX Should the environment variable $TMPDIR override tempdir?
tempdir = '/usr/tmp'
template = '@'
# Counter for generating unique names
counter = 0
# User-callable function
# XXX Should this have a parameter, like C's mktemp()?
# XXX Should we instead use the model of Standard C's tempnam()?
# XXX By all means, avoid a mess with four different functions like C...
def mktemp():
global counter
while 1:
counter = counter+1
file = tempdir+'/'+template+`posix.getpid()`+'.'+`counter`
if not path.exists(file):
break
return file
| Use 'global' instead of struct kludge. | Use 'global' instead of struct kludge.
| Python | mit | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | python | ## Code Before:
import posix
import path
# Changeable parameters (by clients!)...
# XXX Should the environment variable $TMPDIR override tempdir?
tempdir = '/usr/tmp'
template = '@'
# Kludge to hold mutable state
class Struct: pass
G = Struct()
G.i = 0
# User-callable function
# XXX Should this have a parameter, like C's mktemp()?
# XXX Should we instead use the model of Standard C's tempnam()?
# XXX By all means, avoid a mess with four different functions like C...
def mktemp():
while 1:
G.i = G.i+1
file = tempdir +'/'+ template + `posix.getpid()` +'.'+ `G.i`
if not path.exists(file):
break
return file
## Instruction:
Use 'global' instead of struct kludge.
## Code After:
import posix
import path
# Changeable parameters (by clients!)...
# XXX Should the environment variable $TMPDIR override tempdir?
tempdir = '/usr/tmp'
template = '@'
# Counter for generating unique names
counter = 0
# User-callable function
# XXX Should this have a parameter, like C's mktemp()?
# XXX Should we instead use the model of Standard C's tempnam()?
# XXX By all means, avoid a mess with four different functions like C...
def mktemp():
global counter
while 1:
counter = counter+1
file = tempdir+'/'+template+`posix.getpid()`+'.'+`counter`
if not path.exists(file):
break
return file
|
import posix
import path
# Changeable parameters (by clients!)...
# XXX Should the environment variable $TMPDIR override tempdir?
tempdir = '/usr/tmp'
template = '@'
- # Kludge to hold mutable state
+ # Counter for generating unique names
+ counter = 0
- class Struct: pass
- G = Struct()
- G.i = 0
# User-callable function
# XXX Should this have a parameter, like C's mktemp()?
# XXX Should we instead use the model of Standard C's tempnam()?
# XXX By all means, avoid a mess with four different functions like C...
def mktemp():
+ global counter
while 1:
- G.i = G.i+1
+ counter = counter+1
- file = tempdir +'/'+ template + `posix.getpid()` +'.'+ `G.i`
? - - - - - - ^^^
+ file = tempdir+'/'+template+`posix.getpid()`+'.'+`counter`
? ^^^^^^^
if not path.exists(file):
break
return file | 11 | 0.354839 | 5 | 6 |
6b6eef4207690e30c42ad511c69d7c0cb682dd4a | Resources/public/js/emails.js | Resources/public/js/emails.js | $(document).ready(function () {
$('#add-another-email').click(function () {
var emailList = $('#email-fields-list');
var newWidget = emailList.attr('data-prototype');
newWidget = newWidget.replace(/__name__/g, emailCount);
emailCount++;
var newDiv = $('<div></div>').html(newWidget);
newDiv.appendTo($('#email-fields-list'));
return false;
});
$(document).on('click', '.removeRow', function (event) {
var name = $(this).attr('data-related');
$('*[data-content="' + name + '"]').remove();
return false;
});
}); | $(function () {
var cList = $('#email-fields-list'),
cCount = cList.children().length;
$('#add-another-email').on('click', function () {
widget = cList.attr('data-prototype').replace(/__name__/g, cCount++);
$('<div></div>').html(widget).appendTo(cList);
return false;
});
$(document).on('click', '.removeRow', function (event) {
name = $(this).attr('data-related');
$('*[data-content="' + name + '"]').remove();
return false;
});
}); | Apply layout to user edit account form. JS collection minor refactoring. | BAP-258: Apply layout to user edit account form. JS collection minor refactoring.
| JavaScript | mit | geoffroycochard/platform,ramunasd/platform,northdakota/platform,orocrm/platform,hugeval/platform,geoffroycochard/platform,umpirsky/platform,hugeval/platform,northdakota/platform,orocrm/platform,geoffroycochard/platform,morontt/platform,trustify/oroplatform,Djamy/platform,2ndkauboy/platform,trustify/oroplatform,Djamy/platform,morontt/platform,orocrm/platform,mszajner/platform,akeneo/platform,akeneo/platform,akeneo/platform,2ndkauboy/platform,ramunasd/platform,mszajner/platform,trustify/oroplatform,2ndkauboy/platform,northdakota/platform,Djamy/platform,mszajner/platform,ramunasd/platform,morontt/platform,hugeval/platform,umpirsky/platform | javascript | ## Code Before:
$(document).ready(function () {
$('#add-another-email').click(function () {
var emailList = $('#email-fields-list');
var newWidget = emailList.attr('data-prototype');
newWidget = newWidget.replace(/__name__/g, emailCount);
emailCount++;
var newDiv = $('<div></div>').html(newWidget);
newDiv.appendTo($('#email-fields-list'));
return false;
});
$(document).on('click', '.removeRow', function (event) {
var name = $(this).attr('data-related');
$('*[data-content="' + name + '"]').remove();
return false;
});
});
## Instruction:
BAP-258: Apply layout to user edit account form. JS collection minor refactoring.
## Code After:
$(function () {
var cList = $('#email-fields-list'),
cCount = cList.children().length;
$('#add-another-email').on('click', function () {
widget = cList.attr('data-prototype').replace(/__name__/g, cCount++);
$('<div></div>').html(widget).appendTo(cList);
return false;
});
$(document).on('click', '.removeRow', function (event) {
name = $(this).attr('data-related');
$('*[data-content="' + name + '"]').remove();
return false;
});
}); | - $(document).ready(function () {
+ $(function () {
+ var cList = $('#email-fields-list'),
+ cCount = cList.children().length;
+
- $('#add-another-email').click(function () {
? ^
+ $('#add-another-email').on('click', function () {
? ++++ ^^^
+ widget = cList.attr('data-prototype').replace(/__name__/g, cCount++);
+
+ $('<div></div>').html(widget).appendTo(cList);
+
- var emailList = $('#email-fields-list');
- var newWidget = emailList.attr('data-prototype');
- newWidget = newWidget.replace(/__name__/g, emailCount);
- emailCount++;
- var newDiv = $('<div></div>').html(newWidget);
- newDiv.appendTo($('#email-fields-list'));
return false;
});
$(document).on('click', '.removeRow', function (event) {
- var name = $(this).attr('data-related');
? ----
+ name = $(this).attr('data-related');
+
$('*[data-content="' + name + '"]').remove();
+
return false;
});
}); | 21 | 1.235294 | 12 | 9 |
0d406d36d343b09bcacf2374d8cb7cd8382024fc | .travis.yml | .travis.yml | sudo: false
language: java
jdk: oraclejdk8
cache:
directories:
- $HOME/.gradle
before_cache:
- rm -f $HOME/.gradle/caches/*.lock
- rm -f $HOME/.gradle/caches/*.bin
- rm -f $HOME/.gradle/daemon
- rm -f $HOME/.gradle/native
script:
- ./gradlew test
notifications:
slack: elpassion:MMVt3NnH3yPusNWhFbyBvvPB | sudo: false
language: java
jdk: oraclejdk8
cache:
directories:
- $HOME/.gradle
before_cache:
- rm -f $HOME/.gradle/caches/*.lock
- rm -f $HOME/.gradle/caches/*.bin
- rm -f $HOME/.gradle/daemon
- rm -f $HOME/.gradle/native
script:
- ./gradlew test
notifications:
slack:
rooms:
secure: i75o0wwiOqJ8h7P9w0Pc5K5rosOgGZvgPA+50+mXBceZ1RSa/0Sn5gZgSey7NeM5DVrVvKFptqmIhIlkyI6fBlKIcQHdMfspPq+JicjsbHqM0SYkHI6oisoN7bsLqhgKH69g/B5e7lHZ38D9HpO5dulEce9s5+hCeggrrSAnT+JR37Nt12bUQuD6rGzeLK0ck18L/h9NWdtZN2vwsh5fSMOBGddNy6fwi6Ech0V6ZSAXGct0tvqJS6JyTiZoNbM0Z7mkMKMmmDKz13izi2jl0dZ3l5+kUtL1sgXdLgJ3aRIfEDIWZXPLQSExV9AkO5Z6VHiNFYLVpka0Ibhg1PIp91i0cdeAgDlro80ajDzoB7BZTGYQkYyPo5Z47SpdBK3hlit1A4uHXyGtmTYJO9Kcgp63c7ujppjBM6oMNHQFoEi4yh1Q4lSPNWMQpNr5nDjnZxvQssn1Qx0MfjWqN68m8EBON3UP5Ex271Gy7uBm6qQk4IWIz4j4DUJYaLhVyL2XMF+tmNyZ3TSVQELN280KelwtBDRDd8UxoLc7Mfh5p28y9QWiYSdBkz/y+BMLyjA1gP43Cz6HEhhW5LhlqBT/yHZD9j8vFqoeGuA+KlsVu43qR6waXa8S99V1gVWlf7j0PS0r4OUzhnE4ODXSBQKk2DTX4EvShrZ3YMABs3QbBWI=
on_success: change
on_failure: always | Encrypt regenerated token for slack | Encrypt regenerated token for slack
| YAML | apache-2.0 | elpassion/mainframer-intellij-plugin,elpassion/mainframer-intellij-plugin,elpassion/mainframer-intellij-plugin | yaml | ## Code Before:
sudo: false
language: java
jdk: oraclejdk8
cache:
directories:
- $HOME/.gradle
before_cache:
- rm -f $HOME/.gradle/caches/*.lock
- rm -f $HOME/.gradle/caches/*.bin
- rm -f $HOME/.gradle/daemon
- rm -f $HOME/.gradle/native
script:
- ./gradlew test
notifications:
slack: elpassion:MMVt3NnH3yPusNWhFbyBvvPB
## Instruction:
Encrypt regenerated token for slack
## Code After:
sudo: false
language: java
jdk: oraclejdk8
cache:
directories:
- $HOME/.gradle
before_cache:
- rm -f $HOME/.gradle/caches/*.lock
- rm -f $HOME/.gradle/caches/*.bin
- rm -f $HOME/.gradle/daemon
- rm -f $HOME/.gradle/native
script:
- ./gradlew test
notifications:
slack:
rooms:
secure: i75o0wwiOqJ8h7P9w0Pc5K5rosOgGZvgPA+50+mXBceZ1RSa/0Sn5gZgSey7NeM5DVrVvKFptqmIhIlkyI6fBlKIcQHdMfspPq+JicjsbHqM0SYkHI6oisoN7bsLqhgKH69g/B5e7lHZ38D9HpO5dulEce9s5+hCeggrrSAnT+JR37Nt12bUQuD6rGzeLK0ck18L/h9NWdtZN2vwsh5fSMOBGddNy6fwi6Ech0V6ZSAXGct0tvqJS6JyTiZoNbM0Z7mkMKMmmDKz13izi2jl0dZ3l5+kUtL1sgXdLgJ3aRIfEDIWZXPLQSExV9AkO5Z6VHiNFYLVpka0Ibhg1PIp91i0cdeAgDlro80ajDzoB7BZTGYQkYyPo5Z47SpdBK3hlit1A4uHXyGtmTYJO9Kcgp63c7ujppjBM6oMNHQFoEi4yh1Q4lSPNWMQpNr5nDjnZxvQssn1Qx0MfjWqN68m8EBON3UP5Ex271Gy7uBm6qQk4IWIz4j4DUJYaLhVyL2XMF+tmNyZ3TSVQELN280KelwtBDRDd8UxoLc7Mfh5p28y9QWiYSdBkz/y+BMLyjA1gP43Cz6HEhhW5LhlqBT/yHZD9j8vFqoeGuA+KlsVu43qR6waXa8S99V1gVWlf7j0PS0r4OUzhnE4ODXSBQKk2DTX4EvShrZ3YMABs3QbBWI=
on_success: change
on_failure: always | sudo: false
language: java
jdk: oraclejdk8
cache:
directories:
- $HOME/.gradle
before_cache:
- rm -f $HOME/.gradle/caches/*.lock
- rm -f $HOME/.gradle/caches/*.bin
- rm -f $HOME/.gradle/daemon
- rm -f $HOME/.gradle/native
script:
- - ./gradlew test
? --
+ - ./gradlew test
notifications:
- slack: elpassion:MMVt3NnH3yPusNWhFbyBvvPB
+ slack:
+ rooms:
+ secure: i75o0wwiOqJ8h7P9w0Pc5K5rosOgGZvgPA+50+mXBceZ1RSa/0Sn5gZgSey7NeM5DVrVvKFptqmIhIlkyI6fBlKIcQHdMfspPq+JicjsbHqM0SYkHI6oisoN7bsLqhgKH69g/B5e7lHZ38D9HpO5dulEce9s5+hCeggrrSAnT+JR37Nt12bUQuD6rGzeLK0ck18L/h9NWdtZN2vwsh5fSMOBGddNy6fwi6Ech0V6ZSAXGct0tvqJS6JyTiZoNbM0Z7mkMKMmmDKz13izi2jl0dZ3l5+kUtL1sgXdLgJ3aRIfEDIWZXPLQSExV9AkO5Z6VHiNFYLVpka0Ibhg1PIp91i0cdeAgDlro80ajDzoB7BZTGYQkYyPo5Z47SpdBK3hlit1A4uHXyGtmTYJO9Kcgp63c7ujppjBM6oMNHQFoEi4yh1Q4lSPNWMQpNr5nDjnZxvQssn1Qx0MfjWqN68m8EBON3UP5Ex271Gy7uBm6qQk4IWIz4j4DUJYaLhVyL2XMF+tmNyZ3TSVQELN280KelwtBDRDd8UxoLc7Mfh5p28y9QWiYSdBkz/y+BMLyjA1gP43Cz6HEhhW5LhlqBT/yHZD9j8vFqoeGuA+KlsVu43qR6waXa8S99V1gVWlf7j0PS0r4OUzhnE4ODXSBQKk2DTX4EvShrZ3YMABs3QbBWI=
+ on_success: change
+ on_failure: always | 8 | 0.444444 | 6 | 2 |
6a5ebf814c1b84b0548c7a43fba29565f076fabe | extend.php | extend.php | <?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
use Flarum\Akismet\Listener;
use Flarum\Approval\Event\PostWasApproved;
use Flarum\Extend;
use Flarum\Post\Event\Hidden;
use Flarum\Post\Event\Saving;
use Flarum\Settings\SettingsRepositoryInterface;
use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Events\Dispatcher;
use TijsVerkoyen\Akismet\Akismet;
return [
(new Extend\Frontend('forum'))
->js(__DIR__.'/js/dist/forum.js'),
(new Extend\Frontend('admin'))
->js(__DIR__.'/js/dist/admin.js'),
new Extend\Locales(__DIR__.'/locale'),
function (Dispatcher $events, Container $container) {
$container->bind(Akismet::class, function ($app) {
$settings = $app->make(SettingsRepositoryInterface::class);
return new Akismet(
$settings->get('flarum-akismet.api_key'),
$app->url()
);
});
$events->listen(Saving::class, Listener\ValidatePost::class);
$events->listen(PostWasApproved::class, Listener\SubmitHam::class);
$events->listen(Hidden::class, Listener\SubmitSpam::class);
},
];
| <?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
use Flarum\Akismet\Listener;
use Flarum\Approval\Event\PostWasApproved;
use Flarum\Extend;
use Flarum\Http\UrlGenerator;
use Flarum\Post\Event\Hidden;
use Flarum\Post\Event\Saving;
use Flarum\Settings\SettingsRepositoryInterface;
use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Events\Dispatcher;
use TijsVerkoyen\Akismet\Akismet;
return [
(new Extend\Frontend('forum'))
->js(__DIR__.'/js/dist/forum.js'),
(new Extend\Frontend('admin'))
->js(__DIR__.'/js/dist/admin.js'),
new Extend\Locales(__DIR__.'/locale'),
function (Dispatcher $events, Container $container) {
$container->bind(Akismet::class, function ($app) {
/** @var SettingsRepositoryInterface $settings */
$settings = $app->make(SettingsRepositoryInterface::class);
/** @var UrlGenerator $url */
$url = $app->make(UrlGenerator::class);
return new Akismet(
$settings->get('flarum-akismet.api_key'),
$url->to('forum')->base()
);
});
$events->listen(Saving::class, Listener\ValidatePost::class);
$events->listen(PostWasApproved::class, Listener\SubmitHam::class);
$events->listen(Hidden::class, Listener\SubmitSpam::class);
},
];
| Replace leftover app()->url() with UrlGenerator | Replace leftover app()->url() with UrlGenerator
| PHP | mit | flarum/flarum-ext-akismet,flarum/flarum-ext-akismet | php | ## Code Before:
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
use Flarum\Akismet\Listener;
use Flarum\Approval\Event\PostWasApproved;
use Flarum\Extend;
use Flarum\Post\Event\Hidden;
use Flarum\Post\Event\Saving;
use Flarum\Settings\SettingsRepositoryInterface;
use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Events\Dispatcher;
use TijsVerkoyen\Akismet\Akismet;
return [
(new Extend\Frontend('forum'))
->js(__DIR__.'/js/dist/forum.js'),
(new Extend\Frontend('admin'))
->js(__DIR__.'/js/dist/admin.js'),
new Extend\Locales(__DIR__.'/locale'),
function (Dispatcher $events, Container $container) {
$container->bind(Akismet::class, function ($app) {
$settings = $app->make(SettingsRepositoryInterface::class);
return new Akismet(
$settings->get('flarum-akismet.api_key'),
$app->url()
);
});
$events->listen(Saving::class, Listener\ValidatePost::class);
$events->listen(PostWasApproved::class, Listener\SubmitHam::class);
$events->listen(Hidden::class, Listener\SubmitSpam::class);
},
];
## Instruction:
Replace leftover app()->url() with UrlGenerator
## Code After:
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
use Flarum\Akismet\Listener;
use Flarum\Approval\Event\PostWasApproved;
use Flarum\Extend;
use Flarum\Http\UrlGenerator;
use Flarum\Post\Event\Hidden;
use Flarum\Post\Event\Saving;
use Flarum\Settings\SettingsRepositoryInterface;
use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Events\Dispatcher;
use TijsVerkoyen\Akismet\Akismet;
return [
(new Extend\Frontend('forum'))
->js(__DIR__.'/js/dist/forum.js'),
(new Extend\Frontend('admin'))
->js(__DIR__.'/js/dist/admin.js'),
new Extend\Locales(__DIR__.'/locale'),
function (Dispatcher $events, Container $container) {
$container->bind(Akismet::class, function ($app) {
/** @var SettingsRepositoryInterface $settings */
$settings = $app->make(SettingsRepositoryInterface::class);
/** @var UrlGenerator $url */
$url = $app->make(UrlGenerator::class);
return new Akismet(
$settings->get('flarum-akismet.api_key'),
$url->to('forum')->base()
);
});
$events->listen(Saving::class, Listener\ValidatePost::class);
$events->listen(PostWasApproved::class, Listener\SubmitHam::class);
$events->listen(Hidden::class, Listener\SubmitSpam::class);
},
];
| <?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
use Flarum\Akismet\Listener;
use Flarum\Approval\Event\PostWasApproved;
use Flarum\Extend;
+ use Flarum\Http\UrlGenerator;
use Flarum\Post\Event\Hidden;
use Flarum\Post\Event\Saving;
use Flarum\Settings\SettingsRepositoryInterface;
use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Events\Dispatcher;
use TijsVerkoyen\Akismet\Akismet;
return [
(new Extend\Frontend('forum'))
->js(__DIR__.'/js/dist/forum.js'),
(new Extend\Frontend('admin'))
->js(__DIR__.'/js/dist/admin.js'),
new Extend\Locales(__DIR__.'/locale'),
function (Dispatcher $events, Container $container) {
$container->bind(Akismet::class, function ($app) {
+ /** @var SettingsRepositoryInterface $settings */
$settings = $app->make(SettingsRepositoryInterface::class);
+ /** @var UrlGenerator $url */
+ $url = $app->make(UrlGenerator::class);
return new Akismet(
$settings->get('flarum-akismet.api_key'),
- $app->url()
+ $url->to('forum')->base()
);
});
$events->listen(Saving::class, Listener\ValidatePost::class);
$events->listen(PostWasApproved::class, Listener\SubmitHam::class);
$events->listen(Hidden::class, Listener\SubmitSpam::class);
},
]; | 6 | 0.139535 | 5 | 1 |
a1526d9a9224ebdecd5dd245d197a601c289afc1 | lib/generators/backbone_fixtures/install_generator.rb | lib/generators/backbone_fixtures/install_generator.rb | module BackboneRailsFixtures
module Generators
class InstallGenerator < Rails::Generators::Base
# Add stuff to jasmine.yml
source_root File.expand_path("../templates", __FILE__)
def create_fixture_definitions
template "backbone_fixture_definitions.js", "spec/javascripts/helpers/backbone_fixture_definitions.js"
end
def instruct_to_add_jasmine_config
puts "Copy the following line(s) into your jasmine_helper.rb:\n"
puts "Jasmine.configure do |config|"
puts " config.add_rack_path('/__fixtures', lambda { BackboneFixtures::FixtureMiddleware.new })"
puts "end"
end
end
end
end
| module BackboneFixturesRails
module Generators
class InstallGenerator < Rails::Generators::Base
# Add stuff to jasmine.yml
source_root File.expand_path("../templates", __FILE__)
def create_fixture_definitions
template "backbone_fixture_definitions.js", "spec/javascripts/helpers/backbone_fixture_definitions.js"
end
def instruct_to_add_jasmine_config
puts "Copy the following line(s) into your jasmine_helper.rb:\n"
puts "Jasmine.configure do |config|"
puts " config.add_rack_path('/__fixtures', lambda { BackboneFixtures::FixtureMiddleware.new })"
puts "end"
end
end
end
end
| Rename misnamed module with 'BackboneFixturesRails'. | Rename misnamed module with 'BackboneFixturesRails'.
| Ruby | mit | charleshansen/backbone_fixtures_rails,charleshansen/backbone_fixtures_rails | ruby | ## Code Before:
module BackboneRailsFixtures
module Generators
class InstallGenerator < Rails::Generators::Base
# Add stuff to jasmine.yml
source_root File.expand_path("../templates", __FILE__)
def create_fixture_definitions
template "backbone_fixture_definitions.js", "spec/javascripts/helpers/backbone_fixture_definitions.js"
end
def instruct_to_add_jasmine_config
puts "Copy the following line(s) into your jasmine_helper.rb:\n"
puts "Jasmine.configure do |config|"
puts " config.add_rack_path('/__fixtures', lambda { BackboneFixtures::FixtureMiddleware.new })"
puts "end"
end
end
end
end
## Instruction:
Rename misnamed module with 'BackboneFixturesRails'.
## Code After:
module BackboneFixturesRails
module Generators
class InstallGenerator < Rails::Generators::Base
# Add stuff to jasmine.yml
source_root File.expand_path("../templates", __FILE__)
def create_fixture_definitions
template "backbone_fixture_definitions.js", "spec/javascripts/helpers/backbone_fixture_definitions.js"
end
def instruct_to_add_jasmine_config
puts "Copy the following line(s) into your jasmine_helper.rb:\n"
puts "Jasmine.configure do |config|"
puts " config.add_rack_path('/__fixtures', lambda { BackboneFixtures::FixtureMiddleware.new })"
puts "end"
end
end
end
end
| - module BackboneRailsFixtures
? -----
+ module BackboneFixturesRails
? +++++
module Generators
class InstallGenerator < Rails::Generators::Base
# Add stuff to jasmine.yml
source_root File.expand_path("../templates", __FILE__)
def create_fixture_definitions
template "backbone_fixture_definitions.js", "spec/javascripts/helpers/backbone_fixture_definitions.js"
end
def instruct_to_add_jasmine_config
puts "Copy the following line(s) into your jasmine_helper.rb:\n"
puts "Jasmine.configure do |config|"
puts " config.add_rack_path('/__fixtures', lambda { BackboneFixtures::FixtureMiddleware.new })"
puts "end"
end
end
end
end
| 2 | 0.095238 | 1 | 1 |
2917c8d380bfee3c7589f806ea12f2e3f83e8b93 | npc/character/__init__.py | npc/character/__init__.py | from .character import *
|
from .character import Character
from .changeling import Changeling
from .werewolf import Werewolf
def build(attributes: dict = None, other_char: Character = None):
"""
Build a new character object with the appropriate class
This derives the correct character class based on the type tag of either the
other_char character object or the attributes dict, then creates a new
character object using that class. If neither is supplied, a blank Character
is returned.
The character type is fetched first from other_char and only if that is not
present is it fetched from attributes.
Both other_char and attribuets are passed to the character constructor. See
that for how their precedence is applied.
If you need more control over the instantiation process, use
character_klass_from_type and call the object manually.
Args:
attributes (dict): Dictionary of attributes to insert into the
Character.
other_char (Character): Existing character object to copy.
Returns:
Instantiated Character class or subclass matching the given type.
"""
if other_char:
klass = character_klass_from_type(other_char.type_key)
elif attributes:
klass = character_klass_from_type(attributes['type'][0])
else:
klass = Character
return klass(other_char = other_char, attributes = attributes)
def character_klass_from_type(ctype: str):
"""
Choose the correct character class based on type tag
Args:
ctype (str): Character type tag to use
Returns:
Character class or subclass depending on the type
"""
if ctype:
ctype = ctype.lower()
if ctype == 'changeling':
return Changeling
if ctype == 'werewolf':
return Werewolf
return Character
| Add helpers to find the right character class | Add helpers to find the right character class
| Python | mit | aurule/npc,aurule/npc | python | ## Code Before:
from .character import *
## Instruction:
Add helpers to find the right character class
## Code After:
from .character import Character
from .changeling import Changeling
from .werewolf import Werewolf
def build(attributes: dict = None, other_char: Character = None):
"""
Build a new character object with the appropriate class
This derives the correct character class based on the type tag of either the
other_char character object or the attributes dict, then creates a new
character object using that class. If neither is supplied, a blank Character
is returned.
The character type is fetched first from other_char and only if that is not
present is it fetched from attributes.
Both other_char and attribuets are passed to the character constructor. See
that for how their precedence is applied.
If you need more control over the instantiation process, use
character_klass_from_type and call the object manually.
Args:
attributes (dict): Dictionary of attributes to insert into the
Character.
other_char (Character): Existing character object to copy.
Returns:
Instantiated Character class or subclass matching the given type.
"""
if other_char:
klass = character_klass_from_type(other_char.type_key)
elif attributes:
klass = character_klass_from_type(attributes['type'][0])
else:
klass = Character
return klass(other_char = other_char, attributes = attributes)
def character_klass_from_type(ctype: str):
"""
Choose the correct character class based on type tag
Args:
ctype (str): Character type tag to use
Returns:
Character class or subclass depending on the type
"""
if ctype:
ctype = ctype.lower()
if ctype == 'changeling':
return Changeling
if ctype == 'werewolf':
return Werewolf
return Character
| +
- from .character import *
? ^
+ from .character import Character
? ^^^^^^^^^
+ from .changeling import Changeling
+ from .werewolf import Werewolf
+
+ def build(attributes: dict = None, other_char: Character = None):
+ """
+ Build a new character object with the appropriate class
+
+ This derives the correct character class based on the type tag of either the
+ other_char character object or the attributes dict, then creates a new
+ character object using that class. If neither is supplied, a blank Character
+ is returned.
+
+ The character type is fetched first from other_char and only if that is not
+ present is it fetched from attributes.
+
+ Both other_char and attribuets are passed to the character constructor. See
+ that for how their precedence is applied.
+
+ If you need more control over the instantiation process, use
+ character_klass_from_type and call the object manually.
+
+ Args:
+ attributes (dict): Dictionary of attributes to insert into the
+ Character.
+ other_char (Character): Existing character object to copy.
+
+ Returns:
+ Instantiated Character class or subclass matching the given type.
+ """
+ if other_char:
+ klass = character_klass_from_type(other_char.type_key)
+ elif attributes:
+ klass = character_klass_from_type(attributes['type'][0])
+ else:
+ klass = Character
+
+ return klass(other_char = other_char, attributes = attributes)
+
+ def character_klass_from_type(ctype: str):
+ """
+ Choose the correct character class based on type tag
+
+ Args:
+ ctype (str): Character type tag to use
+
+ Returns:
+ Character class or subclass depending on the type
+ """
+ if ctype:
+ ctype = ctype.lower()
+ if ctype == 'changeling':
+ return Changeling
+ if ctype == 'werewolf':
+ return Werewolf
+
+ return Character | 59 | 59 | 58 | 1 |
09cf8b450b68a322c384e8296d42deaddba49388 | README.md | README.md |
Gulp plugin for [Parker](https://github.com/katiefenn/parker), a stylesheet analysis tool.
## Install
```bash
npm install --save-dev gulp-parker
```
## Usage
```js
var gulp = require('gulp');
var parker = require('gulp-parker');
gulp.task('parker', function() {
return gulp.src('./css/*.css')
.pipe(parker());
});
```
Options are passed into `parker()` as an object and will be passed to parker aswell.
## Options
### `due: callback`
Does something very cool.
## Contributing
You can pitch in by submitting issues and pull requests. But before you do so, make sure it is specific to this wrapper, otherwise report issues at [Parker's issue tracker](https://github.com/katiefenn/parker/issues). | 
Gulp plugin for [Parker](https://github.com/katiefenn/parker), a stylesheet analysis tool.
## Install
```bash
npm install --save-dev gulp-parker
```
## Usage
```js
var gulp = require('gulp');
var parker = require('gulp-parker');
gulp.task('parker', function() {
return gulp.src('./css/*.css')
.pipe(parker());
});
```
Options are passed into `parker()` as an object and will be passed to parker aswell.
## Options
### `due: callback`
Does something very cool.
## Contributing
You can pitch in by submitting issues and pull requests. But before you do so, make sure it is specific to this wrapper, otherwise report issues at [Parker's issue tracker](https://github.com/katiefenn/parker/issues). | Add Travis Build Status badge | Add Travis Build Status badge
| Markdown | mit | fnky/gulp-parker | markdown | ## Code Before:
Gulp plugin for [Parker](https://github.com/katiefenn/parker), a stylesheet analysis tool.
## Install
```bash
npm install --save-dev gulp-parker
```
## Usage
```js
var gulp = require('gulp');
var parker = require('gulp-parker');
gulp.task('parker', function() {
return gulp.src('./css/*.css')
.pipe(parker());
});
```
Options are passed into `parker()` as an object and will be passed to parker aswell.
## Options
### `due: callback`
Does something very cool.
## Contributing
You can pitch in by submitting issues and pull requests. But before you do so, make sure it is specific to this wrapper, otherwise report issues at [Parker's issue tracker](https://github.com/katiefenn/parker/issues).
## Instruction:
Add Travis Build Status badge
## Code After:

Gulp plugin for [Parker](https://github.com/katiefenn/parker), a stylesheet analysis tool.
## Install
```bash
npm install --save-dev gulp-parker
```
## Usage
```js
var gulp = require('gulp');
var parker = require('gulp-parker');
gulp.task('parker', function() {
return gulp.src('./css/*.css')
.pipe(parker());
});
```
Options are passed into `parker()` as an object and will be passed to parker aswell.
## Options
### `due: callback`
Does something very cool.
## Contributing
You can pitch in by submitting issues and pull requests. But before you do so, make sure it is specific to this wrapper, otherwise report issues at [Parker's issue tracker](https://github.com/katiefenn/parker/issues). | + 
Gulp plugin for [Parker](https://github.com/katiefenn/parker), a stylesheet analysis tool.
## Install
```bash
npm install --save-dev gulp-parker
```
## Usage
```js
var gulp = require('gulp');
var parker = require('gulp-parker');
gulp.task('parker', function() {
return gulp.src('./css/*.css')
.pipe(parker());
});
```
Options are passed into `parker()` as an object and will be passed to parker aswell.
## Options
### `due: callback`
Does something very cool.
## Contributing
You can pitch in by submitting issues and pull requests. But before you do so, make sure it is specific to this wrapper, otherwise report issues at [Parker's issue tracker](https://github.com/katiefenn/parker/issues). | 1 | 0.03125 | 1 | 0 |
863dfc20ff4f2388ece05092115f0b9e2f0740ae | pkg/client/envconfig.go | pkg/client/envconfig.go | package client
import (
"context"
"github.com/sethvargo/go-envconfig"
)
type Env struct {
LoginAuthURL string `env:"TELEPRESENCE_LOGIN_AUTH_URL,default=https://auth.datawire.io/auth"`
LoginTokenURL string `env:"TELEPRESENCE_LOGIN_TOKEN_URL,default=https://auth.datawire.io/token"`
LoginCompletionURL string `env:"TELEPRESENCE_LOGIN_COMPLETION_URL,default=https://auth.datawire.io/completion"`
LoginClientID string `env:"TELEPRESENCE_LOGIN_CLIENT_ID,default=telepresence-cli"`
Registry string `env:"TELEPRESENCE_REGISTRY,default=docker.io/datawire"`
SystemAHost string `env:"SYSTEMA_HOST,default="`
SystemAPort string `env:"SYSTEMA_PORT,default="`
}
func LoadEnv(ctx context.Context) (Env, error) {
var env Env
err := envconfig.Process(ctx, &env)
return env, err
}
| package client
import (
"context"
"os"
"github.com/sethvargo/go-envconfig"
)
type Env struct {
LoginDomain string `env:"TELEPRESENCE_LOGIN_DOMAIN,required"`
LoginAuthURL string `env:"TELEPRESENCE_LOGIN_AUTH_URL,default=https://${TELEPRESENCE_LOGIN_DOMAIN}/auth"`
LoginTokenURL string `env:"TELEPRESENCE_LOGIN_TOKEN_URL,default=https://${TELEPRESENCE_LOGIN_DOMAIN}/token"`
LoginCompletionURL string `env:"TELEPRESENCE_LOGIN_COMPLETION_URL,default=https://${TELEPRESENCE_LOGIN_DOMAIN}/completion"`
LoginClientID string `env:"TELEPRESENCE_LOGIN_CLIENT_ID,default=telepresence-cli"`
Registry string `env:"TELEPRESENCE_REGISTRY,default=docker.io/datawire"`
SystemAHost string `env:"SYSTEMA_HOST,default="`
SystemAPort string `env:"SYSTEMA_PORT,default="`
}
func maybeSetEnv(key, val string) {
if os.Getenv(key) == "" {
os.Setenv(key, val)
}
}
func LoadEnv(ctx context.Context) (Env, error) {
switch os.Getenv("SYSTEMA_ENV") {
case "staging":
maybeSetEnv("TELEPRESENCE_LOGIN_DOMAIN", "beta-auth.datawire.io")
maybeSetEnv("SYSTEMA_HOST", "beta-app.datawire.io")
default:
maybeSetEnv("TELEPRESENCE_LOGIN_DOMAIN", "auth.datawire.io")
}
var env Env
err := envconfig.Process(ctx, &env)
return env, err
}
| Add a SYSTEMA_ENV variable to easily adjust staging/prod | CLI: Add a SYSTEMA_ENV variable to easily adjust staging/prod
| Go | apache-2.0 | datawire/telepresence,datawire/telepresence,datawire/telepresence | go | ## Code Before:
package client
import (
"context"
"github.com/sethvargo/go-envconfig"
)
type Env struct {
LoginAuthURL string `env:"TELEPRESENCE_LOGIN_AUTH_URL,default=https://auth.datawire.io/auth"`
LoginTokenURL string `env:"TELEPRESENCE_LOGIN_TOKEN_URL,default=https://auth.datawire.io/token"`
LoginCompletionURL string `env:"TELEPRESENCE_LOGIN_COMPLETION_URL,default=https://auth.datawire.io/completion"`
LoginClientID string `env:"TELEPRESENCE_LOGIN_CLIENT_ID,default=telepresence-cli"`
Registry string `env:"TELEPRESENCE_REGISTRY,default=docker.io/datawire"`
SystemAHost string `env:"SYSTEMA_HOST,default="`
SystemAPort string `env:"SYSTEMA_PORT,default="`
}
func LoadEnv(ctx context.Context) (Env, error) {
var env Env
err := envconfig.Process(ctx, &env)
return env, err
}
## Instruction:
CLI: Add a SYSTEMA_ENV variable to easily adjust staging/prod
## Code After:
package client
import (
"context"
"os"
"github.com/sethvargo/go-envconfig"
)
type Env struct {
LoginDomain string `env:"TELEPRESENCE_LOGIN_DOMAIN,required"`
LoginAuthURL string `env:"TELEPRESENCE_LOGIN_AUTH_URL,default=https://${TELEPRESENCE_LOGIN_DOMAIN}/auth"`
LoginTokenURL string `env:"TELEPRESENCE_LOGIN_TOKEN_URL,default=https://${TELEPRESENCE_LOGIN_DOMAIN}/token"`
LoginCompletionURL string `env:"TELEPRESENCE_LOGIN_COMPLETION_URL,default=https://${TELEPRESENCE_LOGIN_DOMAIN}/completion"`
LoginClientID string `env:"TELEPRESENCE_LOGIN_CLIENT_ID,default=telepresence-cli"`
Registry string `env:"TELEPRESENCE_REGISTRY,default=docker.io/datawire"`
SystemAHost string `env:"SYSTEMA_HOST,default="`
SystemAPort string `env:"SYSTEMA_PORT,default="`
}
func maybeSetEnv(key, val string) {
if os.Getenv(key) == "" {
os.Setenv(key, val)
}
}
func LoadEnv(ctx context.Context) (Env, error) {
switch os.Getenv("SYSTEMA_ENV") {
case "staging":
maybeSetEnv("TELEPRESENCE_LOGIN_DOMAIN", "beta-auth.datawire.io")
maybeSetEnv("SYSTEMA_HOST", "beta-app.datawire.io")
default:
maybeSetEnv("TELEPRESENCE_LOGIN_DOMAIN", "auth.datawire.io")
}
var env Env
err := envconfig.Process(ctx, &env)
return env, err
}
| package client
import (
"context"
+ "os"
"github.com/sethvargo/go-envconfig"
)
type Env struct {
+ LoginDomain string `env:"TELEPRESENCE_LOGIN_DOMAIN,required"`
- LoginAuthURL string `env:"TELEPRESENCE_LOGIN_AUTH_URL,default=https://auth.datawire.io/auth"`
? ^^^^^^^^^^^^^^^^
+ LoginAuthURL string `env:"TELEPRESENCE_LOGIN_AUTH_URL,default=https://${TELEPRESENCE_LOGIN_DOMAIN}/auth"`
? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- LoginTokenURL string `env:"TELEPRESENCE_LOGIN_TOKEN_URL,default=https://auth.datawire.io/token"`
? ^^^^^^^^^^^^^^^^
+ LoginTokenURL string `env:"TELEPRESENCE_LOGIN_TOKEN_URL,default=https://${TELEPRESENCE_LOGIN_DOMAIN}/token"`
? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- LoginCompletionURL string `env:"TELEPRESENCE_LOGIN_COMPLETION_URL,default=https://auth.datawire.io/completion"`
? ^^^^^^^^^^^^^^^^
+ LoginCompletionURL string `env:"TELEPRESENCE_LOGIN_COMPLETION_URL,default=https://${TELEPRESENCE_LOGIN_DOMAIN}/completion"`
? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LoginClientID string `env:"TELEPRESENCE_LOGIN_CLIENT_ID,default=telepresence-cli"`
Registry string `env:"TELEPRESENCE_REGISTRY,default=docker.io/datawire"`
SystemAHost string `env:"SYSTEMA_HOST,default="`
SystemAPort string `env:"SYSTEMA_PORT,default="`
}
+ func maybeSetEnv(key, val string) {
+ if os.Getenv(key) == "" {
+ os.Setenv(key, val)
+ }
+ }
+
func LoadEnv(ctx context.Context) (Env, error) {
+ switch os.Getenv("SYSTEMA_ENV") {
+ case "staging":
+ maybeSetEnv("TELEPRESENCE_LOGIN_DOMAIN", "beta-auth.datawire.io")
+ maybeSetEnv("SYSTEMA_HOST", "beta-app.datawire.io")
+ default:
+ maybeSetEnv("TELEPRESENCE_LOGIN_DOMAIN", "auth.datawire.io")
+ }
+
var env Env
err := envconfig.Process(ctx, &env)
return env, err
} | 22 | 0.88 | 19 | 3 |
b9af24eaac09a004f7d8f7906f4845c92462d771 | tests/functional/SvgCept.php | tests/functional/SvgCept.php | <?php
/** @var \Codeception\Scenario $scenario $I */
$I = new FunctionalTester($scenario);
$I->wantTo('perform analysis and see svg results');
$configFolder = codecept_data_dir('svg' . DIRECTORY_SEPARATOR . 'config');
$expectationFolder = codecept_data_dir('svg' . DIRECTORY_SEPARATOR . 'expectation');
$outputFolder = codecept_output_dir('svg');
array_map('unlink', glob($outputFolder . DIRECTORY_SEPARATOR . '*.svg'));
$dir = new \DirectoryIterator($configFolder);
foreach ($dir as $fileinfo) {
if (!$fileinfo->isDot()) {
exec('./bin/phpda analyze ' . $fileinfo->getRealPath(), $output);
$result = sha1_file($outputFolder . DIRECTORY_SEPARATOR . $fileinfo->getBasename('yml') . 'svg');
$expectation = sha1_file($expectationFolder . DIRECTORY_SEPARATOR . $fileinfo->getBasename('yml') . 'svg');
if ($expectation !== $result) {
//throw new \Exception($fileinfo->getBasename('yml') . ' not working');
}
}
}
| <?php
/** @var \Codeception\Scenario $scenario $I */
$I = new FunctionalTester($scenario);
$I->wantTo('perform analysis and see svg results');
@mkdir(codecept_output_dir() . 'svg');
$configFolder = codecept_data_dir('svg' . DIRECTORY_SEPARATOR . 'config');
$expectationFolder = codecept_data_dir('svg' . DIRECTORY_SEPARATOR . 'expectation');
$outputFolder = codecept_output_dir('svg');
array_map('unlink', glob($outputFolder . DIRECTORY_SEPARATOR . '*.svg'));
$dir = new \DirectoryIterator($configFolder);
foreach ($dir as $fileinfo) {
if (!$fileinfo->isDot()) {
exec('./bin/phpda analyze ' . $fileinfo->getRealPath(), $output);
$result = sha1_file($outputFolder . DIRECTORY_SEPARATOR . $fileinfo->getBasename('yml') . 'svg');
$expectation = sha1_file($expectationFolder . DIRECTORY_SEPARATOR . $fileinfo->getBasename('yml') . 'svg');
if ($expectation !== $result) {
//throw new \Exception($fileinfo->getBasename('yml') . ' not working');
}
}
}
| Add codeception framework for E2E tests | Add codeception framework for E2E tests [wip]
| PHP | mit | mamuz/PhpDependencyAnalysis,mamuz/PhpDependencyAnalysis | php | ## Code Before:
<?php
/** @var \Codeception\Scenario $scenario $I */
$I = new FunctionalTester($scenario);
$I->wantTo('perform analysis and see svg results');
$configFolder = codecept_data_dir('svg' . DIRECTORY_SEPARATOR . 'config');
$expectationFolder = codecept_data_dir('svg' . DIRECTORY_SEPARATOR . 'expectation');
$outputFolder = codecept_output_dir('svg');
array_map('unlink', glob($outputFolder . DIRECTORY_SEPARATOR . '*.svg'));
$dir = new \DirectoryIterator($configFolder);
foreach ($dir as $fileinfo) {
if (!$fileinfo->isDot()) {
exec('./bin/phpda analyze ' . $fileinfo->getRealPath(), $output);
$result = sha1_file($outputFolder . DIRECTORY_SEPARATOR . $fileinfo->getBasename('yml') . 'svg');
$expectation = sha1_file($expectationFolder . DIRECTORY_SEPARATOR . $fileinfo->getBasename('yml') . 'svg');
if ($expectation !== $result) {
//throw new \Exception($fileinfo->getBasename('yml') . ' not working');
}
}
}
## Instruction:
Add codeception framework for E2E tests [wip]
## Code After:
<?php
/** @var \Codeception\Scenario $scenario $I */
$I = new FunctionalTester($scenario);
$I->wantTo('perform analysis and see svg results');
@mkdir(codecept_output_dir() . 'svg');
$configFolder = codecept_data_dir('svg' . DIRECTORY_SEPARATOR . 'config');
$expectationFolder = codecept_data_dir('svg' . DIRECTORY_SEPARATOR . 'expectation');
$outputFolder = codecept_output_dir('svg');
array_map('unlink', glob($outputFolder . DIRECTORY_SEPARATOR . '*.svg'));
$dir = new \DirectoryIterator($configFolder);
foreach ($dir as $fileinfo) {
if (!$fileinfo->isDot()) {
exec('./bin/phpda analyze ' . $fileinfo->getRealPath(), $output);
$result = sha1_file($outputFolder . DIRECTORY_SEPARATOR . $fileinfo->getBasename('yml') . 'svg');
$expectation = sha1_file($expectationFolder . DIRECTORY_SEPARATOR . $fileinfo->getBasename('yml') . 'svg');
if ($expectation !== $result) {
//throw new \Exception($fileinfo->getBasename('yml') . ' not working');
}
}
}
| <?php
/** @var \Codeception\Scenario $scenario $I */
$I = new FunctionalTester($scenario);
$I->wantTo('perform analysis and see svg results');
+
+ @mkdir(codecept_output_dir() . 'svg');
$configFolder = codecept_data_dir('svg' . DIRECTORY_SEPARATOR . 'config');
$expectationFolder = codecept_data_dir('svg' . DIRECTORY_SEPARATOR . 'expectation');
$outputFolder = codecept_output_dir('svg');
array_map('unlink', glob($outputFolder . DIRECTORY_SEPARATOR . '*.svg'));
$dir = new \DirectoryIterator($configFolder);
foreach ($dir as $fileinfo) {
if (!$fileinfo->isDot()) {
exec('./bin/phpda analyze ' . $fileinfo->getRealPath(), $output);
$result = sha1_file($outputFolder . DIRECTORY_SEPARATOR . $fileinfo->getBasename('yml') . 'svg');
$expectation = sha1_file($expectationFolder . DIRECTORY_SEPARATOR . $fileinfo->getBasename('yml') . 'svg');
if ($expectation !== $result) {
//throw new \Exception($fileinfo->getBasename('yml') . ' not working');
}
}
} | 2 | 0.086957 | 2 | 0 |
3c2ecf1f653857c59754018853ca7e2e49a78b72 | fileSystemTest/index.js | fileSystemTest/index.js | var fs = require('fs');
var environmentVariables = [
"WEBSITE_SITE_NAME",
"WEBSITE_SKU",
"WEBSITE_COMPUTE_MODE",
"WEBSITE_HOSTNAME",
"WEBSITE_INSTANCE_ID",
"WEBSITE_NODE_DEFAULT_VERSION",
"WEBSOCKET_CONCURRENT_REQUEST_LIMIT",
"%APPDATA%",
"%TMP%"
]
module.exports = function (context, req, res) {
context.log('function triggered');
context.log(req);
context.log('Environment Variables');
environmentVariables
.map(getEnvironmentVarible)
.forEach(context.log);
context.log('process.cwd()', process.cwd());
context.log('__dirname', __dirname);
fs.writeFile('D:/local/Temp/message.txt', 'Hello Node.js', (err) => {
if (err) throw err;
context.log("It's saved!");
context.done();
});
}
function getEnvironmentVarible(name) {
return name + ": " + process.env[name];
} | var fs = require('fs');
var environmentVariables = [
"WEBSITE_SITE_NAME",
"WEBSITE_SKU",
"WEBSITE_COMPUTE_MODE",
"WEBSITE_HOSTNAME",
"WEBSITE_INSTANCE_ID",
"WEBSITE_NODE_DEFAULT_VERSION",
"WEBSOCKET_CONCURRENT_REQUEST_LIMIT",
"APPDATA",
"TMP",
"WEBJOBS_PATH",
"WEBJOBS_NAME",
"WEBJOBS_TYPE",
"WEBJOBS_DATA_PATH",
"WEBJOBS_RUN_ID",
"WEBJOBS_SHUTDOWN_FILE"
]
module.exports = function (context, req, res) {
context.log('function triggered');
context.log(req);
context.log('Environment Variables');
environmentVariables
.map(getEnvironmentVarible)
.forEach(function (x) {
context.log(x);
});
context.log('process.cwd()', process.cwd());
context.log('__dirname', __dirname);
fs.writeFile('D:/local/Temp/message.txt', 'Hello Node.js', (err) => {
if (err) throw err;
context.log("It's saved!");
context.done();
});
}
function getEnvironmentVarible(name) {
return name + ": " + process.env[name];
} | Remove % wrappers for node environment variables, fix forEach print to only print first argument. | Remove % wrappers for node environment variables, fix forEach print to only print first argument.
| JavaScript | mit | mattmazzola/sc2iq-azure-functions | javascript | ## Code Before:
var fs = require('fs');
var environmentVariables = [
"WEBSITE_SITE_NAME",
"WEBSITE_SKU",
"WEBSITE_COMPUTE_MODE",
"WEBSITE_HOSTNAME",
"WEBSITE_INSTANCE_ID",
"WEBSITE_NODE_DEFAULT_VERSION",
"WEBSOCKET_CONCURRENT_REQUEST_LIMIT",
"%APPDATA%",
"%TMP%"
]
module.exports = function (context, req, res) {
context.log('function triggered');
context.log(req);
context.log('Environment Variables');
environmentVariables
.map(getEnvironmentVarible)
.forEach(context.log);
context.log('process.cwd()', process.cwd());
context.log('__dirname', __dirname);
fs.writeFile('D:/local/Temp/message.txt', 'Hello Node.js', (err) => {
if (err) throw err;
context.log("It's saved!");
context.done();
});
}
function getEnvironmentVarible(name) {
return name + ": " + process.env[name];
}
## Instruction:
Remove % wrappers for node environment variables, fix forEach print to only print first argument.
## Code After:
var fs = require('fs');
var environmentVariables = [
"WEBSITE_SITE_NAME",
"WEBSITE_SKU",
"WEBSITE_COMPUTE_MODE",
"WEBSITE_HOSTNAME",
"WEBSITE_INSTANCE_ID",
"WEBSITE_NODE_DEFAULT_VERSION",
"WEBSOCKET_CONCURRENT_REQUEST_LIMIT",
"APPDATA",
"TMP",
"WEBJOBS_PATH",
"WEBJOBS_NAME",
"WEBJOBS_TYPE",
"WEBJOBS_DATA_PATH",
"WEBJOBS_RUN_ID",
"WEBJOBS_SHUTDOWN_FILE"
]
module.exports = function (context, req, res) {
context.log('function triggered');
context.log(req);
context.log('Environment Variables');
environmentVariables
.map(getEnvironmentVarible)
.forEach(function (x) {
context.log(x);
});
context.log('process.cwd()', process.cwd());
context.log('__dirname', __dirname);
fs.writeFile('D:/local/Temp/message.txt', 'Hello Node.js', (err) => {
if (err) throw err;
context.log("It's saved!");
context.done();
});
}
function getEnvironmentVarible(name) {
return name + ": " + process.env[name];
} | var fs = require('fs');
var environmentVariables = [
"WEBSITE_SITE_NAME",
"WEBSITE_SKU",
"WEBSITE_COMPUTE_MODE",
"WEBSITE_HOSTNAME",
"WEBSITE_INSTANCE_ID",
"WEBSITE_NODE_DEFAULT_VERSION",
"WEBSOCKET_CONCURRENT_REQUEST_LIMIT",
- "%APPDATA%",
? - -
+ "APPDATA",
- "%TMP%"
? - -
+ "TMP",
? +
+ "WEBJOBS_PATH",
+ "WEBJOBS_NAME",
+ "WEBJOBS_TYPE",
+ "WEBJOBS_DATA_PATH",
+ "WEBJOBS_RUN_ID",
+ "WEBJOBS_SHUTDOWN_FILE"
]
module.exports = function (context, req, res) {
context.log('function triggered');
context.log(req);
context.log('Environment Variables');
environmentVariables
.map(getEnvironmentVarible)
- .forEach(context.log);
+ .forEach(function (x) {
+ context.log(x);
+ });
context.log('process.cwd()', process.cwd());
context.log('__dirname', __dirname);
fs.writeFile('D:/local/Temp/message.txt', 'Hello Node.js', (err) => {
if (err) throw err;
context.log("It's saved!");
context.done();
});
}
function getEnvironmentVarible(name) {
return name + ": " + process.env[name];
} | 14 | 0.388889 | 11 | 3 |
f1898bc9e33fd0ff0fb72ea9efe437723764218a | modules/distribution/src/repository/resources/conf/default.json | modules/distribution/src/repository/resources/conf/default.json | {
"realm_manager": {
"properties": {
"isCascadeDeleteEnabled": true,
"initializeNewClaimManager": true
}
},
"user_store.type": "read_write_ldap",
"keystore.tls.type" : "JKS",
"truststore.type" : "JKS",
"transport.https.clientAuth": "want",
"authentication.consent.data_source": "jdbc/WSO2IdentityDB",
"message_builder.from_urlencoded": "org.apache.axis2.builder.XFormURLEncodedBuilder",
"message_builder.text_javascrip": "org.apache.axis2.json.gson.JsonBuilder",
"claim_management.hide_menu_items": [
"claim_mgt_menu",
"identity_mgt_emailtemplate_menu",
"identity_security_questions_menu"
]
}
| {
"realm_manager": {
"properties": {
"isCascadeDeleteEnabled": true,
"initializeNewClaimManager": true
}
},
"user_store.type": "read_write_ldap",
"keystore.tls.type" : "JKS",
"truststore.type" : "JKS",
"transport.https.clientAuth": "want",
"authentication.consent.data_source": "jdbc/WSO2IdentityDB",
"claim_management.hide_menu_items": [
"claim_mgt_menu",
"identity_mgt_emailtemplate_menu",
"identity_security_questions_menu"
]
}
| Remove configs related to axis2.xml | Remove configs related to axis2.xml
| JSON | apache-2.0 | mefarazath/product-is,madurangasiriwardena/product-is,wso2/product-is,wso2/product-is,mefarazath/product-is,madurangasiriwardena/product-is,mefarazath/product-is,wso2/product-is,mefarazath/product-is,wso2/product-is,madurangasiriwardena/product-is,madurangasiriwardena/product-is,wso2/product-is,mefarazath/product-is,madurangasiriwardena/product-is | json | ## Code Before:
{
"realm_manager": {
"properties": {
"isCascadeDeleteEnabled": true,
"initializeNewClaimManager": true
}
},
"user_store.type": "read_write_ldap",
"keystore.tls.type" : "JKS",
"truststore.type" : "JKS",
"transport.https.clientAuth": "want",
"authentication.consent.data_source": "jdbc/WSO2IdentityDB",
"message_builder.from_urlencoded": "org.apache.axis2.builder.XFormURLEncodedBuilder",
"message_builder.text_javascrip": "org.apache.axis2.json.gson.JsonBuilder",
"claim_management.hide_menu_items": [
"claim_mgt_menu",
"identity_mgt_emailtemplate_menu",
"identity_security_questions_menu"
]
}
## Instruction:
Remove configs related to axis2.xml
## Code After:
{
"realm_manager": {
"properties": {
"isCascadeDeleteEnabled": true,
"initializeNewClaimManager": true
}
},
"user_store.type": "read_write_ldap",
"keystore.tls.type" : "JKS",
"truststore.type" : "JKS",
"transport.https.clientAuth": "want",
"authentication.consent.data_source": "jdbc/WSO2IdentityDB",
"claim_management.hide_menu_items": [
"claim_mgt_menu",
"identity_mgt_emailtemplate_menu",
"identity_security_questions_menu"
]
}
| {
"realm_manager": {
"properties": {
"isCascadeDeleteEnabled": true,
"initializeNewClaimManager": true
}
},
"user_store.type": "read_write_ldap",
"keystore.tls.type" : "JKS",
"truststore.type" : "JKS",
"transport.https.clientAuth": "want",
"authentication.consent.data_source": "jdbc/WSO2IdentityDB",
- "message_builder.from_urlencoded": "org.apache.axis2.builder.XFormURLEncodedBuilder",
- "message_builder.text_javascrip": "org.apache.axis2.json.gson.JsonBuilder",
-
"claim_management.hide_menu_items": [
"claim_mgt_menu",
"identity_mgt_emailtemplate_menu",
"identity_security_questions_menu"
]
} | 3 | 0.125 | 0 | 3 |
dcdb6cc056182c668f8104e2a283b61727cfbc2d | tasks/main.yml | tasks/main.yml | ---
- name: 'Install apt-transport-https'
apt:
name: 'apt-transport-https'
- name: 'Add the docker apt signing key'
apt_key:
keyserver: 'pool.sks-keyservers.net'
id: '58118E89F3A912897C070ADBF76221572C52609D'
notify: 'docker-apt-get-update'
- name: 'Add the official docker repo'
apt_repository:
repo: 'deb https://apt.dockerproject.org/repo ubuntu-{{ ansible_distribution_release }} main'
state: 'present'
notify: 'docker-apt-get-update'
- meta: flush_handlers
- name: 'Install docker'
apt:
name: 'docker-engine'
state: 'latest'
- name: 'Start the docker service'
service:
name: 'docker'
state: 'started'
enabled: 'yes'
- name: 'Ensure that the docker service is functional'
docker_ping:
register: result
retries: 5
delay: 10
until: result|success
- name: 'Install python-pip'
apt:
name: 'python-pip'
state: 'present'
- name: 'Install virtualenv'
pip:
name: 'virtualenv'
state: 'present'
- name: 'Install docker-py'
pip:
name: 'docker-py'
state: 'present'
| ---
- name: 'Install apt-transport-https'
apt:
name: 'apt-transport-https'
- name: 'Add the docker apt signing key'
apt_key:
keyserver: 'pool.sks-keyservers.net'
id: '58118E89F3A912897C070ADBF76221572C52609D'
notify: 'docker-apt-get-update'
- name: 'Add the official docker repo'
apt_repository:
repo: 'deb https://apt.dockerproject.org/repo {{ansible_distribution|lower}}-{{ ansible_distribution_release }} main'
state: 'present'
notify: 'docker-apt-get-update'
- meta: flush_handlers
- name: 'Install docker'
apt:
name: 'docker-engine'
state: 'latest'
- name: 'Start the docker service'
service:
name: 'docker'
state: 'started'
enabled: 'yes'
- name: 'Ensure that the docker service is functional'
docker_ping:
register: result
retries: 5
delay: 10
until: result|success
- name: 'Install python-pip'
apt:
name: 'python-pip'
state: 'present'
- name: 'Install virtualenv'
pip:
name: 'virtualenv'
state: 'present'
- name: 'Install docker-py'
pip:
name: 'docker-py'
state: 'present'
| Support for debian without breaking ubuntu | Support for debian without breaking ubuntu
| YAML | mit | marvinpinto/ansible-role-docker | yaml | ## Code Before:
---
- name: 'Install apt-transport-https'
apt:
name: 'apt-transport-https'
- name: 'Add the docker apt signing key'
apt_key:
keyserver: 'pool.sks-keyservers.net'
id: '58118E89F3A912897C070ADBF76221572C52609D'
notify: 'docker-apt-get-update'
- name: 'Add the official docker repo'
apt_repository:
repo: 'deb https://apt.dockerproject.org/repo ubuntu-{{ ansible_distribution_release }} main'
state: 'present'
notify: 'docker-apt-get-update'
- meta: flush_handlers
- name: 'Install docker'
apt:
name: 'docker-engine'
state: 'latest'
- name: 'Start the docker service'
service:
name: 'docker'
state: 'started'
enabled: 'yes'
- name: 'Ensure that the docker service is functional'
docker_ping:
register: result
retries: 5
delay: 10
until: result|success
- name: 'Install python-pip'
apt:
name: 'python-pip'
state: 'present'
- name: 'Install virtualenv'
pip:
name: 'virtualenv'
state: 'present'
- name: 'Install docker-py'
pip:
name: 'docker-py'
state: 'present'
## Instruction:
Support for debian without breaking ubuntu
## Code After:
---
- name: 'Install apt-transport-https'
apt:
name: 'apt-transport-https'
- name: 'Add the docker apt signing key'
apt_key:
keyserver: 'pool.sks-keyservers.net'
id: '58118E89F3A912897C070ADBF76221572C52609D'
notify: 'docker-apt-get-update'
- name: 'Add the official docker repo'
apt_repository:
repo: 'deb https://apt.dockerproject.org/repo {{ansible_distribution|lower}}-{{ ansible_distribution_release }} main'
state: 'present'
notify: 'docker-apt-get-update'
- meta: flush_handlers
- name: 'Install docker'
apt:
name: 'docker-engine'
state: 'latest'
- name: 'Start the docker service'
service:
name: 'docker'
state: 'started'
enabled: 'yes'
- name: 'Ensure that the docker service is functional'
docker_ping:
register: result
retries: 5
delay: 10
until: result|success
- name: 'Install python-pip'
apt:
name: 'python-pip'
state: 'present'
- name: 'Install virtualenv'
pip:
name: 'virtualenv'
state: 'present'
- name: 'Install docker-py'
pip:
name: 'docker-py'
state: 'present'
| ---
- name: 'Install apt-transport-https'
apt:
name: 'apt-transport-https'
- name: 'Add the docker apt signing key'
apt_key:
keyserver: 'pool.sks-keyservers.net'
id: '58118E89F3A912897C070ADBF76221572C52609D'
notify: 'docker-apt-get-update'
- name: 'Add the official docker repo'
apt_repository:
- repo: 'deb https://apt.dockerproject.org/repo ubuntu-{{ ansible_distribution_release }} main'
? ^ ^^
+ repo: 'deb https://apt.dockerproject.org/repo {{ansible_distribution|lower}}-{{ ansible_distribution_release }} main'
? ^^^^^^^^^^^^^^^^ +++ ^^^^^^^^
state: 'present'
notify: 'docker-apt-get-update'
- meta: flush_handlers
- name: 'Install docker'
apt:
name: 'docker-engine'
state: 'latest'
- name: 'Start the docker service'
service:
name: 'docker'
state: 'started'
enabled: 'yes'
- name: 'Ensure that the docker service is functional'
docker_ping:
register: result
retries: 5
delay: 10
until: result|success
- name: 'Install python-pip'
apt:
name: 'python-pip'
state: 'present'
- name: 'Install virtualenv'
pip:
name: 'virtualenv'
state: 'present'
- name: 'Install docker-py'
pip:
name: 'docker-py'
state: 'present' | 2 | 0.039216 | 1 | 1 |
e8a0872e2d8a0b28ce8718bc754f205ab289d98f | lib/util/browserManager.js | lib/util/browserManager.js | /*jslint forin:true sub:true anon:true, sloppy:true, stupid:true nomen:true, node:true continue:true*/
/*
* Copyright (c) 2014, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*
*
*/
var
SelLib = require('../../arrow_selenium/selLib'),
BrowserManager = module.exports = {},
log4js = require("log4js"),
logger = log4js.getLogger("BrowserManager");
/**
* Open browsers as part of setup
* @param browser
* @param config
* @param capabilities
* @param cb
*/
BrowserManager.openBrowsers = function (browser, config, capabilities, cb) {
var selLib = new SelLib(config);
selLib.open(browser, capabilities, function(error) {
if (error) {
logger.error('Error while opening browser ' + browser + ' :' + error);
process.exit(1);
} else {
if (cb) {
cb();
}
}
});
};
/**
* Close browsers as part of teardown
* close browsers
* @param config
* @param cb
*/
BrowserManager.closeBrowsers = function (config, cb) {
var selLib = new SelLib(config);
selLib.close(function(cb) {
if (cb) {
cb();
}
});
};
module.exports = BrowserManager; | /*jslint forin:true sub:true anon:true, sloppy:true, stupid:true nomen:true, node:true continue:true*/
/*
* Copyright (c) 2014, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*
*
*/
var
SelLib = require('../../arrow_selenium/selLib'),
BrowserManager = module.exports = {},
log4js = require("log4js"),
logger = log4js.getLogger("BrowserManager");
/**
* Open browsers as part of setup
* @param browser
* @param config
* @param capabilities
* @param cb
*/
BrowserManager.openBrowsers = function (browser, config, capabilities, cb) {
var selLib = new SelLib(config);
// Use default browser if browser not passed
if (!browser || browser === null) {
browser = config.browser;
logger.info('No browser passed. Defaulting to ' + config.browser);
}
selLib.open(browser, capabilities, function(error) {
if (error) {
logger.error('Error while opening browser ' + browser + ' :' + error);
process.exit(1);
} else {
if (cb) {
cb();
}
}
});
};
/**
* Close browsers as part of teardown
* close browsers
* @param config
* @param cb
*/
BrowserManager.closeBrowsers = function (config, cb) {
var selLib = new SelLib(config);
selLib.close(function(cb) {
if (cb) {
cb();
}
});
};
module.exports = BrowserManager; | Use default browser if browser is not passed for reuseSession | Use default browser if browser is not passed for reuseSession
| JavaScript | bsd-3-clause | yahoo/arrow,yahoo/arrow,proverma/arrow,proverma/arrow,proverma/arrow,yahoo/arrow | javascript | ## Code Before:
/*jslint forin:true sub:true anon:true, sloppy:true, stupid:true nomen:true, node:true continue:true*/
/*
* Copyright (c) 2014, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*
*
*/
var
SelLib = require('../../arrow_selenium/selLib'),
BrowserManager = module.exports = {},
log4js = require("log4js"),
logger = log4js.getLogger("BrowserManager");
/**
* Open browsers as part of setup
* @param browser
* @param config
* @param capabilities
* @param cb
*/
BrowserManager.openBrowsers = function (browser, config, capabilities, cb) {
var selLib = new SelLib(config);
selLib.open(browser, capabilities, function(error) {
if (error) {
logger.error('Error while opening browser ' + browser + ' :' + error);
process.exit(1);
} else {
if (cb) {
cb();
}
}
});
};
/**
* Close browsers as part of teardown
* close browsers
* @param config
* @param cb
*/
BrowserManager.closeBrowsers = function (config, cb) {
var selLib = new SelLib(config);
selLib.close(function(cb) {
if (cb) {
cb();
}
});
};
module.exports = BrowserManager;
## Instruction:
Use default browser if browser is not passed for reuseSession
## Code After:
/*jslint forin:true sub:true anon:true, sloppy:true, stupid:true nomen:true, node:true continue:true*/
/*
* Copyright (c) 2014, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*
*
*/
var
SelLib = require('../../arrow_selenium/selLib'),
BrowserManager = module.exports = {},
log4js = require("log4js"),
logger = log4js.getLogger("BrowserManager");
/**
* Open browsers as part of setup
* @param browser
* @param config
* @param capabilities
* @param cb
*/
BrowserManager.openBrowsers = function (browser, config, capabilities, cb) {
var selLib = new SelLib(config);
// Use default browser if browser not passed
if (!browser || browser === null) {
browser = config.browser;
logger.info('No browser passed. Defaulting to ' + config.browser);
}
selLib.open(browser, capabilities, function(error) {
if (error) {
logger.error('Error while opening browser ' + browser + ' :' + error);
process.exit(1);
} else {
if (cb) {
cb();
}
}
});
};
/**
* Close browsers as part of teardown
* close browsers
* @param config
* @param cb
*/
BrowserManager.closeBrowsers = function (config, cb) {
var selLib = new SelLib(config);
selLib.close(function(cb) {
if (cb) {
cb();
}
});
};
module.exports = BrowserManager; | /*jslint forin:true sub:true anon:true, sloppy:true, stupid:true nomen:true, node:true continue:true*/
/*
* Copyright (c) 2014, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*
*
*/
var
SelLib = require('../../arrow_selenium/selLib'),
BrowserManager = module.exports = {},
log4js = require("log4js"),
logger = log4js.getLogger("BrowserManager");
/**
* Open browsers as part of setup
* @param browser
* @param config
* @param capabilities
* @param cb
*/
BrowserManager.openBrowsers = function (browser, config, capabilities, cb) {
var selLib = new SelLib(config);
+
+ // Use default browser if browser not passed
+ if (!browser || browser === null) {
+ browser = config.browser;
+ logger.info('No browser passed. Defaulting to ' + config.browser);
+ }
selLib.open(browser, capabilities, function(error) {
if (error) {
logger.error('Error while opening browser ' + browser + ' :' + error);
process.exit(1);
} else {
if (cb) {
cb();
}
}
});
};
/**
* Close browsers as part of teardown
* close browsers
* @param config
* @param cb
*/
BrowserManager.closeBrowsers = function (config, cb) {
var selLib = new SelLib(config);
selLib.close(function(cb) {
if (cb) {
cb();
}
});
};
module.exports = BrowserManager; | 6 | 0.101695 | 6 | 0 |
8eb60b9f35fe89350ff30dcaa7eec50a0bb1442b | addon/helpers/-base.js | addon/helpers/-base.js | import { run } from '@ember/runloop';
import Helper from '@ember/component/helper';
import { get, observer, computed } from '@ember/object';
import { inject as service } from '@ember/service';
export default Helper.extend({
moment: service(),
disableInterval: false,
globalAllowEmpty: computed.bool('moment.__config__.allowEmpty'),
supportsGlobalAllowEmpty: true,
localeOrTimeZoneChanged: observer('moment.locale', 'moment.timeZone', function() {
this.recompute();
}),
compute(value, { interval }) {
if (get(this, 'disableInterval')) { return; }
this.clearTimer();
if (interval) {
/*
* NOTE: intentionally a setTimeout so tests do not block on it
* as the run loop queue is never clear so tests will stay locked waiting
* for queue to clear.
*/
this.intervalTimer = setTimeout(() => {
run(() => this.recompute());
}, parseInt(interval, 10));
}
},
morphMoment(time, { locale, timeZone }) {
const momentService = get(this, 'moment');
locale = locale || get(momentService, 'locale');
timeZone = timeZone || get(momentService, 'timeZone');
if (locale && time.locale) {
time = time.locale(locale);
}
if (timeZone && time.tz) {
time = time.tz(timeZone);
}
return time;
},
clearTimer() {
clearTimeout(this.intervalTimer);
},
destroy() {
this.clearTimer();
this._super(...arguments);
}
});
| import { run } from '@ember/runloop';
import Helper from '@ember/component/helper';
import { get, observer, computed } from '@ember/object';
import { inject as service } from '@ember/service';
export default Helper.extend({
moment: service(),
disableInterval: false,
globalAllowEmpty: computed('moment.__config__.allowEmpty', function() {
return this.get('moment.__config__.allowEmpty');
}),
supportsGlobalAllowEmpty: true,
localeOrTimeZoneChanged: observer('moment.locale', 'moment.timeZone', function() {
this.recompute();
}),
compute(value, { interval }) {
if (get(this, 'disableInterval')) { return; }
this.clearTimer();
if (interval) {
/*
* NOTE: intentionally a setTimeout so tests do not block on it
* as the run loop queue is never clear so tests will stay locked waiting
* for queue to clear.
*/
this.intervalTimer = setTimeout(() => {
run(() => this.recompute());
}, parseInt(interval, 10));
}
},
morphMoment(time, { locale, timeZone }) {
const momentService = get(this, 'moment');
locale = locale || get(momentService, 'locale');
timeZone = timeZone || get(momentService, 'timeZone');
if (locale && time.locale) {
time = time.locale(locale);
}
if (timeZone && time.tz) {
time = time.tz(timeZone);
}
return time;
},
clearTimer() {
clearTimeout(this.intervalTimer);
},
destroy() {
this.clearTimer();
this._super(...arguments);
}
});
| Work around a problem in later (currently unsupported) embers where Ember.computed.bool is not a function | Work around a problem in later (currently unsupported) embers where Ember.computed.bool is not a function
| JavaScript | mit | stefanpenner/ember-moment,stefanpenner/ember-moment | javascript | ## Code Before:
import { run } from '@ember/runloop';
import Helper from '@ember/component/helper';
import { get, observer, computed } from '@ember/object';
import { inject as service } from '@ember/service';
export default Helper.extend({
moment: service(),
disableInterval: false,
globalAllowEmpty: computed.bool('moment.__config__.allowEmpty'),
supportsGlobalAllowEmpty: true,
localeOrTimeZoneChanged: observer('moment.locale', 'moment.timeZone', function() {
this.recompute();
}),
compute(value, { interval }) {
if (get(this, 'disableInterval')) { return; }
this.clearTimer();
if (interval) {
/*
* NOTE: intentionally a setTimeout so tests do not block on it
* as the run loop queue is never clear so tests will stay locked waiting
* for queue to clear.
*/
this.intervalTimer = setTimeout(() => {
run(() => this.recompute());
}, parseInt(interval, 10));
}
},
morphMoment(time, { locale, timeZone }) {
const momentService = get(this, 'moment');
locale = locale || get(momentService, 'locale');
timeZone = timeZone || get(momentService, 'timeZone');
if (locale && time.locale) {
time = time.locale(locale);
}
if (timeZone && time.tz) {
time = time.tz(timeZone);
}
return time;
},
clearTimer() {
clearTimeout(this.intervalTimer);
},
destroy() {
this.clearTimer();
this._super(...arguments);
}
});
## Instruction:
Work around a problem in later (currently unsupported) embers where Ember.computed.bool is not a function
## Code After:
import { run } from '@ember/runloop';
import Helper from '@ember/component/helper';
import { get, observer, computed } from '@ember/object';
import { inject as service } from '@ember/service';
export default Helper.extend({
moment: service(),
disableInterval: false,
globalAllowEmpty: computed('moment.__config__.allowEmpty', function() {
return this.get('moment.__config__.allowEmpty');
}),
supportsGlobalAllowEmpty: true,
localeOrTimeZoneChanged: observer('moment.locale', 'moment.timeZone', function() {
this.recompute();
}),
compute(value, { interval }) {
if (get(this, 'disableInterval')) { return; }
this.clearTimer();
if (interval) {
/*
* NOTE: intentionally a setTimeout so tests do not block on it
* as the run loop queue is never clear so tests will stay locked waiting
* for queue to clear.
*/
this.intervalTimer = setTimeout(() => {
run(() => this.recompute());
}, parseInt(interval, 10));
}
},
morphMoment(time, { locale, timeZone }) {
const momentService = get(this, 'moment');
locale = locale || get(momentService, 'locale');
timeZone = timeZone || get(momentService, 'timeZone');
if (locale && time.locale) {
time = time.locale(locale);
}
if (timeZone && time.tz) {
time = time.tz(timeZone);
}
return time;
},
clearTimer() {
clearTimeout(this.intervalTimer);
},
destroy() {
this.clearTimer();
this._super(...arguments);
}
});
| import { run } from '@ember/runloop';
import Helper from '@ember/component/helper';
import { get, observer, computed } from '@ember/object';
import { inject as service } from '@ember/service';
export default Helper.extend({
moment: service(),
disableInterval: false,
- globalAllowEmpty: computed.bool('moment.__config__.allowEmpty'),
? ----- ^
+ globalAllowEmpty: computed('moment.__config__.allowEmpty', function() {
? +++++++++++ ^^
+ return this.get('moment.__config__.allowEmpty');
+ }),
supportsGlobalAllowEmpty: true,
localeOrTimeZoneChanged: observer('moment.locale', 'moment.timeZone', function() {
this.recompute();
}),
compute(value, { interval }) {
if (get(this, 'disableInterval')) { return; }
this.clearTimer();
if (interval) {
/*
* NOTE: intentionally a setTimeout so tests do not block on it
* as the run loop queue is never clear so tests will stay locked waiting
* for queue to clear.
*/
this.intervalTimer = setTimeout(() => {
run(() => this.recompute());
}, parseInt(interval, 10));
}
},
morphMoment(time, { locale, timeZone }) {
const momentService = get(this, 'moment');
locale = locale || get(momentService, 'locale');
timeZone = timeZone || get(momentService, 'timeZone');
if (locale && time.locale) {
time = time.locale(locale);
}
if (timeZone && time.tz) {
time = time.tz(timeZone);
}
return time;
},
clearTimer() {
clearTimeout(this.intervalTimer);
},
destroy() {
this.clearTimer();
this._super(...arguments);
}
}); | 4 | 0.070175 | 3 | 1 |
51cf6e6bc5fab543b18c23a7698eccaf006a9ca9 | generators/app/templates/_gulpfile.js | generators/app/templates/_gulpfile.js | var gulp = require('gulp');
var tslint = require('gulp-tslint');
var exec = require('child_process').exec;
var jasmine = require('gulp-jasmine');
var gulp = require('gulp-help')(gulp);
gulp.task('tslint', 'Lints all TypeScript source files', function(){
return gulp.src('src/**/*.ts')
.pipe(tslint())
.pipe(tslint.report('verbose'));
});
gulp.task('build', 'Compiles all TypeScript source files', function (cb) {
exec('tsc', function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
cb(err);
});
});
gulp.task('test', 'Runs the Jasmine test specs', ['build'], function () {
return gulp.src('test/*.js')
.pipe(jasmine());
});
| var gulp = require('gulp');
var tslint = require('gulp-tslint');
var exec = require('child_process').exec;
var jasmine = require('gulp-jasmine');
var gulp = require('gulp-help')(gulp);
var tsFilesGlob = (function(c) {
return c.filesGlob || c.files || '**/*.ts';
})(require('./tsconfig.json'));
gulp.task('tslint', 'Lints all TypeScript source files', function(){
return gulp.src(tsFilesGlob)
.pipe(tslint())
.pipe(tslint.report('verbose'));
});
gulp.task('build', 'Compiles all TypeScript source files', function (cb) {
exec('tsc', function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
cb(err);
});
});
gulp.task('test', 'Runs the Jasmine test specs', ['build'], function () {
return gulp.src('test/*.js')
.pipe(jasmine());
});
| Use filesGlob from tsconfig in gulp file | Use filesGlob from tsconfig in gulp file
| JavaScript | mit | ospatil/generator-node-typescript,ospatil/generator-node-typescript | javascript | ## Code Before:
var gulp = require('gulp');
var tslint = require('gulp-tslint');
var exec = require('child_process').exec;
var jasmine = require('gulp-jasmine');
var gulp = require('gulp-help')(gulp);
gulp.task('tslint', 'Lints all TypeScript source files', function(){
return gulp.src('src/**/*.ts')
.pipe(tslint())
.pipe(tslint.report('verbose'));
});
gulp.task('build', 'Compiles all TypeScript source files', function (cb) {
exec('tsc', function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
cb(err);
});
});
gulp.task('test', 'Runs the Jasmine test specs', ['build'], function () {
return gulp.src('test/*.js')
.pipe(jasmine());
});
## Instruction:
Use filesGlob from tsconfig in gulp file
## Code After:
var gulp = require('gulp');
var tslint = require('gulp-tslint');
var exec = require('child_process').exec;
var jasmine = require('gulp-jasmine');
var gulp = require('gulp-help')(gulp);
var tsFilesGlob = (function(c) {
return c.filesGlob || c.files || '**/*.ts';
})(require('./tsconfig.json'));
gulp.task('tslint', 'Lints all TypeScript source files', function(){
return gulp.src(tsFilesGlob)
.pipe(tslint())
.pipe(tslint.report('verbose'));
});
gulp.task('build', 'Compiles all TypeScript source files', function (cb) {
exec('tsc', function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
cb(err);
});
});
gulp.task('test', 'Runs the Jasmine test specs', ['build'], function () {
return gulp.src('test/*.js')
.pipe(jasmine());
});
| var gulp = require('gulp');
var tslint = require('gulp-tslint');
var exec = require('child_process').exec;
var jasmine = require('gulp-jasmine');
var gulp = require('gulp-help')(gulp);
+ var tsFilesGlob = (function(c) {
+ return c.filesGlob || c.files || '**/*.ts';
+ })(require('./tsconfig.json'));
+
gulp.task('tslint', 'Lints all TypeScript source files', function(){
- return gulp.src('src/**/*.ts')
+ return gulp.src(tsFilesGlob)
.pipe(tslint())
.pipe(tslint.report('verbose'));
});
gulp.task('build', 'Compiles all TypeScript source files', function (cb) {
exec('tsc', function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
cb(err);
});
});
gulp.task('test', 'Runs the Jasmine test specs', ['build'], function () {
return gulp.src('test/*.js')
.pipe(jasmine());
}); | 6 | 0.25 | 5 | 1 |
d1db73d5f32e87fdbb20a03d240fb591cf9594d0 | src/components/Button.js | src/components/Button.js | import React, { Component } from 'react';
import _ from 'lodash';
import styles from './css/Button.module.css';
export default class Button extends Component {
static propTypes = {
onClick: React.PropTypes.func.isRequired,
disabled: React.PropTypes.bool
}
constructor (props) {
super(props);
this.onClick = _.debounce(this.props.onClick, 500, {
leading: true,
trailing: false
});
this.state = {
active: false
};
}
render () {
return (
<button
onTouchStart={() => { this.setState({ active: true }); }}
onTouchEnd={() => { this.setState({ active: false }, this.onClick); }}
onClick={this.onClick}
className={styles.wrapper}
disabled={this.props.disabled}
>
<span className={(this.state.active) ? styles.raisedActive : styles.raised}>
<span className={styles.button}>{this.props.children}</span>
</span>
</button>
);
}
};
| import React, { Component } from 'react';
import _ from 'lodash';
import styles from './css/Button.module.css';
export default class Button extends Component {
static propTypes = {
onClick: React.PropTypes.func.isRequired,
disabled: React.PropTypes.bool
}
constructor (props) {
super(props);
this.onClick = _.debounce(this.props.onClick, 500, {
leading: true,
trailing: false
});
this.state = {
active: false
};
}
render () {
return (
<button
onTouchStart={() => { this.setState({ active: true }); }}
onTouchEnd={() => {
this.onClick();
this.setState({ active: false });
}}
onClick={this.onClick}
className={styles.wrapper}
disabled={this.props.disabled}
>
<span className={(this.state.active) ? styles.raisedActive : styles.raised}>
<span className={styles.button}>{this.props.children}</span>
</span>
</button>
);
}
};
| Fix button misfires on mobile | Fix button misfires on mobile
| JavaScript | mit | neontribe/spool,neontribe/spool | javascript | ## Code Before:
import React, { Component } from 'react';
import _ from 'lodash';
import styles from './css/Button.module.css';
export default class Button extends Component {
static propTypes = {
onClick: React.PropTypes.func.isRequired,
disabled: React.PropTypes.bool
}
constructor (props) {
super(props);
this.onClick = _.debounce(this.props.onClick, 500, {
leading: true,
trailing: false
});
this.state = {
active: false
};
}
render () {
return (
<button
onTouchStart={() => { this.setState({ active: true }); }}
onTouchEnd={() => { this.setState({ active: false }, this.onClick); }}
onClick={this.onClick}
className={styles.wrapper}
disabled={this.props.disabled}
>
<span className={(this.state.active) ? styles.raisedActive : styles.raised}>
<span className={styles.button}>{this.props.children}</span>
</span>
</button>
);
}
};
## Instruction:
Fix button misfires on mobile
## Code After:
import React, { Component } from 'react';
import _ from 'lodash';
import styles from './css/Button.module.css';
export default class Button extends Component {
static propTypes = {
onClick: React.PropTypes.func.isRequired,
disabled: React.PropTypes.bool
}
constructor (props) {
super(props);
this.onClick = _.debounce(this.props.onClick, 500, {
leading: true,
trailing: false
});
this.state = {
active: false
};
}
render () {
return (
<button
onTouchStart={() => { this.setState({ active: true }); }}
onTouchEnd={() => {
this.onClick();
this.setState({ active: false });
}}
onClick={this.onClick}
className={styles.wrapper}
disabled={this.props.disabled}
>
<span className={(this.state.active) ? styles.raisedActive : styles.raised}>
<span className={styles.button}>{this.props.children}</span>
</span>
</button>
);
}
};
| import React, { Component } from 'react';
import _ from 'lodash';
import styles from './css/Button.module.css';
export default class Button extends Component {
static propTypes = {
onClick: React.PropTypes.func.isRequired,
disabled: React.PropTypes.bool
}
constructor (props) {
super(props);
this.onClick = _.debounce(this.props.onClick, 500, {
leading: true,
trailing: false
});
this.state = {
active: false
};
}
render () {
return (
<button
onTouchStart={() => { this.setState({ active: true }); }}
- onTouchEnd={() => { this.setState({ active: false }, this.onClick); }}
+ onTouchEnd={() => {
+ this.onClick();
+ this.setState({ active: false });
+ }}
onClick={this.onClick}
className={styles.wrapper}
disabled={this.props.disabled}
>
<span className={(this.state.active) ? styles.raisedActive : styles.raised}>
<span className={styles.button}>{this.props.children}</span>
</span>
</button>
);
}
}; | 5 | 0.125 | 4 | 1 |
b64b7463397c40f5621103689e6b0dfaef0cea8e | xpath_expressions/templates.xml | xpath_expressions/templates.xml | <openerp>
<data>
<record id="view_product_form_inherit" model="ir.ui.view">
<field name="name">product.template.common.form.inherit</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<!--Adds a new page (tab) to the view after the tab Information -->
<xpath expr="//page[@string='Information']" position="after">
<page name="Sample" string="Custom page">
<group>
<field name="FieldNewPage"/>
</group>
</page>
</xpath>
<!-- New group after other group (inside page) -->
<xpath expr="//page[@string='Information']/group" position="after">
<group>
<field name="FieldAfterGroup"/>
</group>
</xpath>
<!-- Field after other field -->
<xpath expr="//field[@name='standard_price']" position="before">
<field name="CostPrice" on_change="on_change_price(CostPrice,ShippingCost)"/>
<field name="ShippingCost" on_change="on_change_price(CostPrice,ShippingCost)"/>
</xpath>
</field>
</record>
</data>
</openerp>
| <openerp>
<data>
<record id="view_product_form_inherit" model="ir.ui.view">
<field name="name">product.template.common.form.inherit</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<!--Adds a new page (tab) to the view after the tab Information -->
<xpath expr="//page[@string='Information']" position="after">
<page name="Sample" string="Custom page">
<group>
<field name="FieldNewPage"/>
</group>
</page>
</xpath>
<!-- New group after other group (inside page) -->
<!-- Note that @string xpath expressions have been removed in V9.0! -->
<xpath expr="//page[@string='Information']/group" position="after">
<group>
<field name="FieldAfterGroup"/>
</group>
</xpath>
<!-- Field after other field -->
<xpath expr="//field[@name='standard_price']" position="before">
<field name="CostPrice" on_change="on_change_price(CostPrice,ShippingCost)"/>
<field name="ShippingCost" on_change="on_change_price(CostPrice,ShippingCost)"/>
</xpath>
</field>
</record>
</data>
</openerp>
| Add warning about 9.0 xpath expr | Add warning about 9.0 xpath expr
Add warning about 9.0 xpath expr | XML | agpl-3.0 | topecz/Odoo_Samples,Yenthe666/Odoo_Samples,Yenthe666/Odoo_Samples,topecz/Odoo_Samples,Yenthe666/Odoo_Samples,topecz/Odoo_Samples | xml | ## Code Before:
<openerp>
<data>
<record id="view_product_form_inherit" model="ir.ui.view">
<field name="name">product.template.common.form.inherit</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<!--Adds a new page (tab) to the view after the tab Information -->
<xpath expr="//page[@string='Information']" position="after">
<page name="Sample" string="Custom page">
<group>
<field name="FieldNewPage"/>
</group>
</page>
</xpath>
<!-- New group after other group (inside page) -->
<xpath expr="//page[@string='Information']/group" position="after">
<group>
<field name="FieldAfterGroup"/>
</group>
</xpath>
<!-- Field after other field -->
<xpath expr="//field[@name='standard_price']" position="before">
<field name="CostPrice" on_change="on_change_price(CostPrice,ShippingCost)"/>
<field name="ShippingCost" on_change="on_change_price(CostPrice,ShippingCost)"/>
</xpath>
</field>
</record>
</data>
</openerp>
## Instruction:
Add warning about 9.0 xpath expr
Add warning about 9.0 xpath expr
## Code After:
<openerp>
<data>
<record id="view_product_form_inherit" model="ir.ui.view">
<field name="name">product.template.common.form.inherit</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<!--Adds a new page (tab) to the view after the tab Information -->
<xpath expr="//page[@string='Information']" position="after">
<page name="Sample" string="Custom page">
<group>
<field name="FieldNewPage"/>
</group>
</page>
</xpath>
<!-- New group after other group (inside page) -->
<!-- Note that @string xpath expressions have been removed in V9.0! -->
<xpath expr="//page[@string='Information']/group" position="after">
<group>
<field name="FieldAfterGroup"/>
</group>
</xpath>
<!-- Field after other field -->
<xpath expr="//field[@name='standard_price']" position="before">
<field name="CostPrice" on_change="on_change_price(CostPrice,ShippingCost)"/>
<field name="ShippingCost" on_change="on_change_price(CostPrice,ShippingCost)"/>
</xpath>
</field>
</record>
</data>
</openerp>
| <openerp>
<data>
<record id="view_product_form_inherit" model="ir.ui.view">
<field name="name">product.template.common.form.inherit</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<!--Adds a new page (tab) to the view after the tab Information -->
<xpath expr="//page[@string='Information']" position="after">
<page name="Sample" string="Custom page">
<group>
<field name="FieldNewPage"/>
</group>
</page>
</xpath>
<!-- New group after other group (inside page) -->
+ <!-- Note that @string xpath expressions have been removed in V9.0! -->
<xpath expr="//page[@string='Information']/group" position="after">
<group>
<field name="FieldAfterGroup"/>
</group>
</xpath>
<!-- Field after other field -->
<xpath expr="//field[@name='standard_price']" position="before">
<field name="CostPrice" on_change="on_change_price(CostPrice,ShippingCost)"/>
<field name="ShippingCost" on_change="on_change_price(CostPrice,ShippingCost)"/>
</xpath>
</field>
</record>
</data>
</openerp> | 1 | 0.033333 | 1 | 0 |
77d72552432a6c487ef1506211c959609cf9e2a3 | app/views/spree/orders/show.html.haml | app/views/spree/orders/show.html.haml | = inject_enterprises
.darkswarm
- content_for :order_cycle_form do
%strong.avenir
Order ready on
- if @order.order_cycle
= @order.order_cycle.pickup_time_for(@order.distributor)
- else
= @order.distributor.next_collection_at
= render partial: "shopping_shared/details"
%fieldset#order_summary{"data-hook" => ""}
.row
.columns.large-12.text-center
%h2
Order confirmation
= " #" + @order.number
#order{"data-hook" => ""}
- if params.has_key? :checkout_complete
%h1= t(:thank_you_for_your_order)
= render :partial => 'spree/shared/order_details', :locals => { :order => @order }
.row
.columns.large-12
= link_to t(:back_to_store), main_app.shop_path, :class => "button"
- unless params.has_key? :checkout_complete
- if try_spree_current_user && respond_to?(:spree_account_path)
= link_to t(:my_account), spree_account_path, :class => "button"
| = inject_enterprises
.darkswarm
- content_for :order_cycle_form do
%strong.avenir
Order ready on
- if @order.order_cycle
= @order.order_cycle.pickup_time_for(@order.distributor)
- else
= @order.distributor.next_collection_at
= render "shopping_shared/details"
%fieldset#order_summary{"data-hook" => ""}
.row
.columns.large-12.text-center
%h2
Order confirmation
= " #" + @order.number
#order{"data-hook" => ""}
- if params.has_key? :checkout_complete
%h1= t(:thank_you_for_your_order)
= render 'spree/shared/order_details', order: @order
.row
.columns.large-12
= link_to t(:back_to_store), main_app.shop_path, :class => "button"
- unless params.has_key? :checkout_complete
- if try_spree_current_user && respond_to?(:spree_account_path)
= link_to t(:my_account), spree_account_path, :class => "button"
| Use short syntax for rendering partials | Use short syntax for rendering partials
| Haml | agpl-3.0 | KateDavis/openfoodnetwork,RohanM/openfoodnetwork,MikeiLL/openfoodnetwork,levent/openfoodnetwork,Em-AK/openfoodnetwork,stveep/openfoodnetwork,KateDavis/openfoodnetwork,Em-AK/openfoodnetwork,Matt-Yorkley/openfoodnetwork,levent/openfoodnetwork,mkllnk/openfoodnetwork,levent/openfoodnetwork,KosenkoDmitriy/openfoodnetwork,ltrls/openfoodnetwork,folklabs/openfoodnetwork,folklabs/openfoodnetwork,KateDavis/openfoodnetwork,RohanM/openfoodnetwork,ecocitycore/openfoodnetwork,levent/openfoodnetwork,Matt-Yorkley/openfoodnetwork,MikeiLL/openfoodnetwork,Em-AK/openfoodnetwork,Em-AK/openfoodnetwork,lin-d-hop/openfoodnetwork,folklabs/openfoodnetwork,mkllnk/openfoodnetwork,oeoeaio/openfoodnetwork,openfoodfoundation/openfoodnetwork,oeoeaio/openfoodnetwork,openfoodfoundation/openfoodnetwork,lin-d-hop/openfoodnetwork,KosenkoDmitriy/openfoodnetwork,Matt-Yorkley/openfoodnetwork,ltrls/openfoodnetwork,mkllnk/openfoodnetwork,stveep/openfoodnetwork,lin-d-hop/openfoodnetwork,KosenkoDmitriy/openfoodnetwork,openfoodfoundation/openfoodnetwork,mkllnk/openfoodnetwork,ecocitycore/openfoodnetwork,oeoeaio/openfoodnetwork,MikeiLL/openfoodnetwork,oeoeaio/openfoodnetwork,RohanM/openfoodnetwork,RohanM/openfoodnetwork,MikeiLL/openfoodnetwork,ecocitycore/openfoodnetwork,stveep/openfoodnetwork,openfoodfoundation/openfoodnetwork,ltrls/openfoodnetwork,ecocitycore/openfoodnetwork,lin-d-hop/openfoodnetwork,KateDavis/openfoodnetwork,Matt-Yorkley/openfoodnetwork,KosenkoDmitriy/openfoodnetwork,folklabs/openfoodnetwork,stveep/openfoodnetwork,ltrls/openfoodnetwork | haml | ## Code Before:
= inject_enterprises
.darkswarm
- content_for :order_cycle_form do
%strong.avenir
Order ready on
- if @order.order_cycle
= @order.order_cycle.pickup_time_for(@order.distributor)
- else
= @order.distributor.next_collection_at
= render partial: "shopping_shared/details"
%fieldset#order_summary{"data-hook" => ""}
.row
.columns.large-12.text-center
%h2
Order confirmation
= " #" + @order.number
#order{"data-hook" => ""}
- if params.has_key? :checkout_complete
%h1= t(:thank_you_for_your_order)
= render :partial => 'spree/shared/order_details', :locals => { :order => @order }
.row
.columns.large-12
= link_to t(:back_to_store), main_app.shop_path, :class => "button"
- unless params.has_key? :checkout_complete
- if try_spree_current_user && respond_to?(:spree_account_path)
= link_to t(:my_account), spree_account_path, :class => "button"
## Instruction:
Use short syntax for rendering partials
## Code After:
= inject_enterprises
.darkswarm
- content_for :order_cycle_form do
%strong.avenir
Order ready on
- if @order.order_cycle
= @order.order_cycle.pickup_time_for(@order.distributor)
- else
= @order.distributor.next_collection_at
= render "shopping_shared/details"
%fieldset#order_summary{"data-hook" => ""}
.row
.columns.large-12.text-center
%h2
Order confirmation
= " #" + @order.number
#order{"data-hook" => ""}
- if params.has_key? :checkout_complete
%h1= t(:thank_you_for_your_order)
= render 'spree/shared/order_details', order: @order
.row
.columns.large-12
= link_to t(:back_to_store), main_app.shop_path, :class => "button"
- unless params.has_key? :checkout_complete
- if try_spree_current_user && respond_to?(:spree_account_path)
= link_to t(:my_account), spree_account_path, :class => "button"
| = inject_enterprises
.darkswarm
- content_for :order_cycle_form do
%strong.avenir
Order ready on
- if @order.order_cycle
= @order.order_cycle.pickup_time_for(@order.distributor)
- else
= @order.distributor.next_collection_at
- = render partial: "shopping_shared/details"
? ---------
+ = render "shopping_shared/details"
%fieldset#order_summary{"data-hook" => ""}
.row
.columns.large-12.text-center
%h2
Order confirmation
= " #" + @order.number
#order{"data-hook" => ""}
- if params.has_key? :checkout_complete
%h1= t(:thank_you_for_your_order)
- = render :partial => 'spree/shared/order_details', :locals => { :order => @order }
? ------------ -------------- ^^^ --
+ = render 'spree/shared/order_details', order: @order
? ^
.row
.columns.large-12
= link_to t(:back_to_store), main_app.shop_path, :class => "button"
- unless params.has_key? :checkout_complete
- if try_spree_current_user && respond_to?(:spree_account_path)
= link_to t(:my_account), spree_account_path, :class => "button" | 4 | 0.125 | 2 | 2 |
2ff32c2d6ba9cd734118b014b4e341ac1fcdcf6d | lib/Internal/WhenQueue.php | lib/Internal/WhenQueue.php | <?php
namespace Amp\Internal;
use Interop\Async\Loop;
/**
* Stores a set of functions to be invoked when an awaitable is resolved.
*
* @internal
*/
class WhenQueue {
/**
* @var callable[]
*/
private $queue = [];
/**
* @param callable|null $callback Initial callback to add to queue.
*/
public function __construct(callable $callback = null) {
if (null !== $callback) {
$this->push($callback);
}
}
/**
* Calls each callback in the queue, passing the provided values to the function.
*
* @param \Throwable|null $exception
* @param mixed $value
*/
public function __invoke($exception = null, $value = null) {
foreach ($this->queue as $callback) {
try {
$callback($exception, $value);
} catch (\Throwable $exception) {
Loop::defer(static function () use ($exception) {
throw $exception;
});
}
}
}
/**
* Unrolls instances of self to avoid blowing up the call stack on resolution.
*
* @param callable $callback
*/
public function push(callable $callback) {
if ($callback instanceof self) {
$this->queue = \array_merge($this->queue, $callback->queue);
return;
}
$this->queue[] = $callback;
}
}
| <?php
namespace Amp\Internal;
use Interop\Async\Loop;
/**
* Stores a set of functions to be invoked when an awaitable is resolved.
*
* @internal
*/
class WhenQueue {
/**
* @var callable[]
*/
private $queue = [];
/**
* @param callable|null $callback Initial callback to add to queue.
*/
public function __construct(callable $callback = null) {
if (null !== $callback) {
$this->push($callback);
}
}
/**
* Calls each callback in the queue, passing the provided values to the function.
*
* @param \Throwable|null $exception
* @param mixed $value
*/
public function __invoke($exception, $value) {
foreach ($this->queue as $callback) {
try {
$callback($exception, $value);
} catch (\Throwable $exception) {
Loop::defer(static function () use ($exception) {
throw $exception;
});
}
}
}
/**
* Unrolls instances of self to avoid blowing up the call stack on resolution.
*
* @param callable $callback
*/
public function push(callable $callback) {
if ($callback instanceof self) {
$this->queue = \array_merge($this->queue, $callback->queue);
return;
}
$this->queue[] = $callback;
}
}
| Remove unnecessary default parameter values | Remove unnecessary default parameter values
| PHP | mit | amphp/amp,staabm/amp,staabm/amp | php | ## Code Before:
<?php
namespace Amp\Internal;
use Interop\Async\Loop;
/**
* Stores a set of functions to be invoked when an awaitable is resolved.
*
* @internal
*/
class WhenQueue {
/**
* @var callable[]
*/
private $queue = [];
/**
* @param callable|null $callback Initial callback to add to queue.
*/
public function __construct(callable $callback = null) {
if (null !== $callback) {
$this->push($callback);
}
}
/**
* Calls each callback in the queue, passing the provided values to the function.
*
* @param \Throwable|null $exception
* @param mixed $value
*/
public function __invoke($exception = null, $value = null) {
foreach ($this->queue as $callback) {
try {
$callback($exception, $value);
} catch (\Throwable $exception) {
Loop::defer(static function () use ($exception) {
throw $exception;
});
}
}
}
/**
* Unrolls instances of self to avoid blowing up the call stack on resolution.
*
* @param callable $callback
*/
public function push(callable $callback) {
if ($callback instanceof self) {
$this->queue = \array_merge($this->queue, $callback->queue);
return;
}
$this->queue[] = $callback;
}
}
## Instruction:
Remove unnecessary default parameter values
## Code After:
<?php
namespace Amp\Internal;
use Interop\Async\Loop;
/**
* Stores a set of functions to be invoked when an awaitable is resolved.
*
* @internal
*/
class WhenQueue {
/**
* @var callable[]
*/
private $queue = [];
/**
* @param callable|null $callback Initial callback to add to queue.
*/
public function __construct(callable $callback = null) {
if (null !== $callback) {
$this->push($callback);
}
}
/**
* Calls each callback in the queue, passing the provided values to the function.
*
* @param \Throwable|null $exception
* @param mixed $value
*/
public function __invoke($exception, $value) {
foreach ($this->queue as $callback) {
try {
$callback($exception, $value);
} catch (\Throwable $exception) {
Loop::defer(static function () use ($exception) {
throw $exception;
});
}
}
}
/**
* Unrolls instances of self to avoid blowing up the call stack on resolution.
*
* @param callable $callback
*/
public function push(callable $callback) {
if ($callback instanceof self) {
$this->queue = \array_merge($this->queue, $callback->queue);
return;
}
$this->queue[] = $callback;
}
}
| <?php
namespace Amp\Internal;
use Interop\Async\Loop;
/**
* Stores a set of functions to be invoked when an awaitable is resolved.
*
* @internal
*/
class WhenQueue {
/**
* @var callable[]
*/
private $queue = [];
/**
* @param callable|null $callback Initial callback to add to queue.
*/
public function __construct(callable $callback = null) {
if (null !== $callback) {
$this->push($callback);
}
}
/**
* Calls each callback in the queue, passing the provided values to the function.
*
* @param \Throwable|null $exception
* @param mixed $value
*/
- public function __invoke($exception = null, $value = null) {
? ------- -------
+ public function __invoke($exception, $value) {
foreach ($this->queue as $callback) {
try {
$callback($exception, $value);
} catch (\Throwable $exception) {
Loop::defer(static function () use ($exception) {
throw $exception;
});
}
}
}
/**
* Unrolls instances of self to avoid blowing up the call stack on resolution.
*
* @param callable $callback
*/
public function push(callable $callback) {
if ($callback instanceof self) {
$this->queue = \array_merge($this->queue, $callback->queue);
return;
}
$this->queue[] = $callback;
}
} | 2 | 0.034483 | 1 | 1 |
f904c9eae56c28df5341cd5b4fc0c9eccf3ec899 | spec/spec_helper.rb | spec/spec_helper.rb | require 'rspec'
RSpec.configure do |config|
config.expect_with :rspec do |c|
c.syntax = :expect
end
config.filter_run focus: true
config.run_all_when_everything_filtered = true
end
RSpec::Matchers.define :render_html do |html|
diffable
match do |markdown|
@expected = html.strip
parser = Redcarpet::Markdown.new(described_class)
@actual = parser.render(markdown).strip
@expected == @actual
end
end
| require 'rspec'
RSpec.configure do |config|
config.expect_with :rspec do |c|
c.syntax = :expect
end
config.filter_run focus: true
config.run_all_when_everything_filtered = true
end
RSpec::Matchers.define :render_html do |html|
diffable
match do |markdown|
@expected = html.strip
instance = Middleman::HashiCorp::RedcarpetHTML.new
instance.middleman_app = middleman_app
parser = Redcarpet::Markdown.new(instance)
@actual = parser.render(markdown).strip
@expected == @actual
end
end
# The default middleman application server.
#
# @return [Middleman::Application]
def middleman_app
@app ||= Middleman::Application.server.inst
end
| Use a default middleman application | Use a default middleman application | Ruby | mit | hashicorp/middleman-hashicorp,hashicorp/middleman-hashicorp,hashicorp/middleman-hashicorp,hashicorp/middleman-hashicorp | ruby | ## Code Before:
require 'rspec'
RSpec.configure do |config|
config.expect_with :rspec do |c|
c.syntax = :expect
end
config.filter_run focus: true
config.run_all_when_everything_filtered = true
end
RSpec::Matchers.define :render_html do |html|
diffable
match do |markdown|
@expected = html.strip
parser = Redcarpet::Markdown.new(described_class)
@actual = parser.render(markdown).strip
@expected == @actual
end
end
## Instruction:
Use a default middleman application
## Code After:
require 'rspec'
RSpec.configure do |config|
config.expect_with :rspec do |c|
c.syntax = :expect
end
config.filter_run focus: true
config.run_all_when_everything_filtered = true
end
RSpec::Matchers.define :render_html do |html|
diffable
match do |markdown|
@expected = html.strip
instance = Middleman::HashiCorp::RedcarpetHTML.new
instance.middleman_app = middleman_app
parser = Redcarpet::Markdown.new(instance)
@actual = parser.render(markdown).strip
@expected == @actual
end
end
# The default middleman application server.
#
# @return [Middleman::Application]
def middleman_app
@app ||= Middleman::Application.server.inst
end
| require 'rspec'
RSpec.configure do |config|
config.expect_with :rspec do |c|
c.syntax = :expect
end
config.filter_run focus: true
config.run_all_when_everything_filtered = true
end
RSpec::Matchers.define :render_html do |html|
diffable
match do |markdown|
@expected = html.strip
+ instance = Middleman::HashiCorp::RedcarpetHTML.new
+ instance.middleman_app = middleman_app
+
- parser = Redcarpet::Markdown.new(described_class)
? ^ -------------
+ parser = Redcarpet::Markdown.new(instance)
? ^^^^^^^
@actual = parser.render(markdown).strip
@expected == @actual
end
end
+
+ # The default middleman application server.
+ #
+ # @return [Middleman::Application]
+ def middleman_app
+ @app ||= Middleman::Application.server.inst
+ end | 12 | 0.521739 | 11 | 1 |
11a77043eb66f6b0e6548924a5472fffff4d0ca2 | app/controllers/api/product_images_controller.rb | app/controllers/api/product_images_controller.rb | module Api
class ProductImagesController < Spree::Api::BaseController
respond_to :json
def update_product_image
@product = Spree::Product.find(params[:product_id])
authorize! :update, @product
if @product.images.first.nil?
@image = Spree::Image.create(attachment: params[:file], viewable_id: @product.master.id, viewable_type: 'Spree::Variant')
render json: @image, serializer: ImageSerializer, status: :created
else
@image = @product.images.first
@image.update_attributes(attachment: params[:file])
render json: @image, serializer: ImageSerializer, status: :ok
end
end
end
end
| module Api
class ProductImagesController < BaseController
respond_to :json
def update_product_image
@product = Spree::Product.find(params[:product_id])
authorize! :update, @product
if @product.images.first.nil?
@image = Spree::Image.create(attachment: params[:file], viewable_id: @product.master.id, viewable_type: 'Spree::Variant')
render json: @image, serializer: ImageSerializer, status: :created
else
@image = @product.images.first
@image.update_attributes(attachment: params[:file])
render json: @image, serializer: ImageSerializer, status: :ok
end
end
end
end
| Switch from Spree::Api::BaseController to Api::BaseController so that AMS is activated | Switch from Spree::Api::BaseController to Api::BaseController so that AMS is activated
| Ruby | agpl-3.0 | mkllnk/openfoodnetwork,openfoodfoundation/openfoodnetwork,openfoodfoundation/openfoodnetwork,Matt-Yorkley/openfoodnetwork,mkllnk/openfoodnetwork,Matt-Yorkley/openfoodnetwork,lin-d-hop/openfoodnetwork,lin-d-hop/openfoodnetwork,Matt-Yorkley/openfoodnetwork,lin-d-hop/openfoodnetwork,Matt-Yorkley/openfoodnetwork,openfoodfoundation/openfoodnetwork,lin-d-hop/openfoodnetwork,mkllnk/openfoodnetwork,mkllnk/openfoodnetwork,openfoodfoundation/openfoodnetwork | ruby | ## Code Before:
module Api
class ProductImagesController < Spree::Api::BaseController
respond_to :json
def update_product_image
@product = Spree::Product.find(params[:product_id])
authorize! :update, @product
if @product.images.first.nil?
@image = Spree::Image.create(attachment: params[:file], viewable_id: @product.master.id, viewable_type: 'Spree::Variant')
render json: @image, serializer: ImageSerializer, status: :created
else
@image = @product.images.first
@image.update_attributes(attachment: params[:file])
render json: @image, serializer: ImageSerializer, status: :ok
end
end
end
end
## Instruction:
Switch from Spree::Api::BaseController to Api::BaseController so that AMS is activated
## Code After:
module Api
class ProductImagesController < BaseController
respond_to :json
def update_product_image
@product = Spree::Product.find(params[:product_id])
authorize! :update, @product
if @product.images.first.nil?
@image = Spree::Image.create(attachment: params[:file], viewable_id: @product.master.id, viewable_type: 'Spree::Variant')
render json: @image, serializer: ImageSerializer, status: :created
else
@image = @product.images.first
@image.update_attributes(attachment: params[:file])
render json: @image, serializer: ImageSerializer, status: :ok
end
end
end
end
| module Api
- class ProductImagesController < Spree::Api::BaseController
? ------------
+ class ProductImagesController < BaseController
respond_to :json
def update_product_image
@product = Spree::Product.find(params[:product_id])
authorize! :update, @product
if @product.images.first.nil?
@image = Spree::Image.create(attachment: params[:file], viewable_id: @product.master.id, viewable_type: 'Spree::Variant')
render json: @image, serializer: ImageSerializer, status: :created
else
@image = @product.images.first
@image.update_attributes(attachment: params[:file])
render json: @image, serializer: ImageSerializer, status: :ok
end
end
end
end | 2 | 0.105263 | 1 | 1 |
9b8cbfcf33ba644670a42490db7de4249e5ff080 | invocations/docs.py | invocations/docs.py | import os
from invoke.tasks import task
from invoke.runner import run
docs_dir = 'docs'
build = os.path.join(docs_dir, '_build')
@task
def clean_docs():
run("rm -rf %s" % build)
@task
def browse_docs():
run("open %s" % os.path.join(build, 'index.html'))
@task
def docs(clean=False, browse=False):
if clean:
clean_docs.body()
run("sphinx-build %s %s" % (docs_dir, build), pty=True)
if browse:
browse_docs.body()
| import os
from invoke.tasks import task
from invoke.runner import run
docs_dir = 'docs'
build = os.path.join(docs_dir, '_build')
@task
def clean_docs():
run("rm -rf %s" % build)
@task
def browse_docs():
run("open %s" % os.path.join(build, 'index.html'))
@task
def docs(clean=False, browse=False):
if clean:
clean_docs()
run("sphinx-build %s %s" % (docs_dir, build), pty=True)
if browse:
browse_docs()
| Leverage __call__ on task downstream | Leverage __call__ on task downstream
| Python | bsd-2-clause | mrjmad/invocations,alex/invocations,pyinvoke/invocations,singingwolfboy/invocations | python | ## Code Before:
import os
from invoke.tasks import task
from invoke.runner import run
docs_dir = 'docs'
build = os.path.join(docs_dir, '_build')
@task
def clean_docs():
run("rm -rf %s" % build)
@task
def browse_docs():
run("open %s" % os.path.join(build, 'index.html'))
@task
def docs(clean=False, browse=False):
if clean:
clean_docs.body()
run("sphinx-build %s %s" % (docs_dir, build), pty=True)
if browse:
browse_docs.body()
## Instruction:
Leverage __call__ on task downstream
## Code After:
import os
from invoke.tasks import task
from invoke.runner import run
docs_dir = 'docs'
build = os.path.join(docs_dir, '_build')
@task
def clean_docs():
run("rm -rf %s" % build)
@task
def browse_docs():
run("open %s" % os.path.join(build, 'index.html'))
@task
def docs(clean=False, browse=False):
if clean:
clean_docs()
run("sphinx-build %s %s" % (docs_dir, build), pty=True)
if browse:
browse_docs()
| import os
from invoke.tasks import task
from invoke.runner import run
docs_dir = 'docs'
build = os.path.join(docs_dir, '_build')
@task
def clean_docs():
run("rm -rf %s" % build)
@task
def browse_docs():
run("open %s" % os.path.join(build, 'index.html'))
@task
def docs(clean=False, browse=False):
if clean:
- clean_docs.body()
? -----
+ clean_docs()
run("sphinx-build %s %s" % (docs_dir, build), pty=True)
if browse:
- browse_docs.body()
? -----
+ browse_docs() | 4 | 0.148148 | 2 | 2 |
d67e56a96a99546bfbd5db718cdeb9a2062c0be3 | cmake/aiur_nightly_js_coverage.cmake | cmake/aiur_nightly_js_coverage.cmake |
set(CTEST_SOURCE_DIRECTORY "/home/cpatrick/Dashboards/girder")
set(CTEST_BINARY_DIRECTORY "/home/cpatrick/Dashboards/girder-nightly")
file(RENAME "${CTEST_BINARY_DIRECTORY}/js_coverage.xml" "${CTEST_BINARY_DIRECTORY}/../coverage.xml")
ctest_empty_binary_directory( ${CTEST_BINARY_DIRECTORY} )
include(${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake)
set(CTEST_SITE "Aiur.kitware")
set(CTEST_BUILD_NAME "Linux-master-nightly-js-cov")
set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
ctest_start("Nightly")
ctest_configure()
file(RENAME "${CTEST_BINARY_DIRECTORY}/../coverage.xml" "${CTEST_BINARY_DIRECTORY}/coverage.xml")
ctest_coverage()
file(REMOVE "${CTEST_BINARY_DIRECTORY}/coverage.xml")
ctest_submit()
|
set(CTEST_SOURCE_DIRECTORY "/home/cpatrick/Dashboards/girder")
set(CTEST_BINARY_DIRECTORY "/home/cpatrick/Dashboards/girder-nightly")
file(RENAME "${CTEST_BINARY_DIRECTORY}/js_coverage.xml" "${CTEST_BINARY_DIRECTORY}/../coverage.xml")
ctest_empty_binary_directory( ${CTEST_BINARY_DIRECTORY} )
include(${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake)
set(CTEST_SITE "Aiur.kitware")
set(CTEST_BUILD_NAME "Linux-master-nightly-js-cov")
set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
# Copy compile plugin template files
file(COPY "${CTEST_SOURCE_DIRECTORY}/clients/web/static/built/plugins/provenance/templates.js" DESTINATION "${CTEST_SOURCE_DIRECTORY}/plugins/provenance")
ctest_start("Nightly")
ctest_configure()
file(RENAME "${CTEST_BINARY_DIRECTORY}/../coverage.xml" "${CTEST_BINARY_DIRECTORY}/coverage.xml")
ctest_coverage()
file(REMOVE "${CTEST_BINARY_DIRECTORY}/coverage.xml")
ctest_submit()
| Fix cdash js coverage reporting. | Fix cdash js coverage reporting.
When I added templates.js from the provenance plugin, this file isn't included where ctest_coverage was expecting it. Copy it to the expected location. In my test environment, this fixed the submission to cdash.
| CMake | apache-2.0 | essamjoubori/girder,girder/girder,jbeezley/girder,Kitware/girder,Kitware/girder,jbeezley/girder,Kitware/girder,girder/girder,RafaelPalomar/girder,msmolens/girder,Xarthisius/girder,chrismattmann/girder,Kitware/girder,kotfic/girder,adsorensen/girder,girder/girder,data-exp-lab/girder,opadron/girder,data-exp-lab/girder,salamb/girder,essamjoubori/girder,Xarthisius/girder,opadron/girder,data-exp-lab/girder,essamjoubori/girder,jcfr/girder,manthey/girder,manthey/girder,salamb/girder,essamjoubori/girder,sutartmelson/girder,Xarthisius/girder,kotfic/girder,salamb/girder,chrismattmann/girder,girder/girder,opadron/girder,sutartmelson/girder,chrismattmann/girder,RafaelPalomar/girder,data-exp-lab/girder,data-exp-lab/girder,adsorensen/girder,opadron/girder,adsorensen/girder,jbeezley/girder,sutartmelson/girder,Xarthisius/girder,jcfr/girder,RafaelPalomar/girder,jcfr/girder,manthey/girder,essamjoubori/girder,msmolens/girder,adsorensen/girder,chrismattmann/girder,RafaelPalomar/girder,kotfic/girder,jcfr/girder,jcfr/girder,kotfic/girder,salamb/girder,sutartmelson/girder,Xarthisius/girder,opadron/girder,adsorensen/girder,msmolens/girder,kotfic/girder,msmolens/girder,manthey/girder,chrismattmann/girder,msmolens/girder,RafaelPalomar/girder,jbeezley/girder,salamb/girder,sutartmelson/girder | cmake | ## Code Before:
set(CTEST_SOURCE_DIRECTORY "/home/cpatrick/Dashboards/girder")
set(CTEST_BINARY_DIRECTORY "/home/cpatrick/Dashboards/girder-nightly")
file(RENAME "${CTEST_BINARY_DIRECTORY}/js_coverage.xml" "${CTEST_BINARY_DIRECTORY}/../coverage.xml")
ctest_empty_binary_directory( ${CTEST_BINARY_DIRECTORY} )
include(${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake)
set(CTEST_SITE "Aiur.kitware")
set(CTEST_BUILD_NAME "Linux-master-nightly-js-cov")
set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
ctest_start("Nightly")
ctest_configure()
file(RENAME "${CTEST_BINARY_DIRECTORY}/../coverage.xml" "${CTEST_BINARY_DIRECTORY}/coverage.xml")
ctest_coverage()
file(REMOVE "${CTEST_BINARY_DIRECTORY}/coverage.xml")
ctest_submit()
## Instruction:
Fix cdash js coverage reporting.
When I added templates.js from the provenance plugin, this file isn't included where ctest_coverage was expecting it. Copy it to the expected location. In my test environment, this fixed the submission to cdash.
## Code After:
set(CTEST_SOURCE_DIRECTORY "/home/cpatrick/Dashboards/girder")
set(CTEST_BINARY_DIRECTORY "/home/cpatrick/Dashboards/girder-nightly")
file(RENAME "${CTEST_BINARY_DIRECTORY}/js_coverage.xml" "${CTEST_BINARY_DIRECTORY}/../coverage.xml")
ctest_empty_binary_directory( ${CTEST_BINARY_DIRECTORY} )
include(${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake)
set(CTEST_SITE "Aiur.kitware")
set(CTEST_BUILD_NAME "Linux-master-nightly-js-cov")
set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
# Copy compile plugin template files
file(COPY "${CTEST_SOURCE_DIRECTORY}/clients/web/static/built/plugins/provenance/templates.js" DESTINATION "${CTEST_SOURCE_DIRECTORY}/plugins/provenance")
ctest_start("Nightly")
ctest_configure()
file(RENAME "${CTEST_BINARY_DIRECTORY}/../coverage.xml" "${CTEST_BINARY_DIRECTORY}/coverage.xml")
ctest_coverage()
file(REMOVE "${CTEST_BINARY_DIRECTORY}/coverage.xml")
ctest_submit()
|
set(CTEST_SOURCE_DIRECTORY "/home/cpatrick/Dashboards/girder")
set(CTEST_BINARY_DIRECTORY "/home/cpatrick/Dashboards/girder-nightly")
file(RENAME "${CTEST_BINARY_DIRECTORY}/js_coverage.xml" "${CTEST_BINARY_DIRECTORY}/../coverage.xml")
ctest_empty_binary_directory( ${CTEST_BINARY_DIRECTORY} )
include(${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake)
set(CTEST_SITE "Aiur.kitware")
set(CTEST_BUILD_NAME "Linux-master-nightly-js-cov")
set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
+ # Copy compile plugin template files
+ file(COPY "${CTEST_SOURCE_DIRECTORY}/clients/web/static/built/plugins/provenance/templates.js" DESTINATION "${CTEST_SOURCE_DIRECTORY}/plugins/provenance")
+
ctest_start("Nightly")
ctest_configure()
file(RENAME "${CTEST_BINARY_DIRECTORY}/../coverage.xml" "${CTEST_BINARY_DIRECTORY}/coverage.xml")
ctest_coverage()
file(REMOVE "${CTEST_BINARY_DIRECTORY}/coverage.xml")
ctest_submit() | 3 | 0.166667 | 3 | 0 |
aa72fe5d3fdfd6b32f7602eea4a5a6b212a020b5 | pre_commit/resources/empty_template/pre_commit_dummy_package.gemspec | pre_commit/resources/empty_template/pre_commit_dummy_package.gemspec | Gem::Specification.new do |s|
s.name = 'pre_commit_dummy_package'
s.version = '0.0.0'
s.authors = ['Anthony Sottile']
end
| Gem::Specification.new do |s|
s.name = 'pre_commit_dummy_package'
s.version = '0.0.0'
s.summary = 'dummy gem for pre-commit hooks'
s.authors = ['Anthony Sottile']
end
| Make the dummy gem valid by giving it a summary | Make the dummy gem valid by giving it a summary
| Ruby | mit | pre-commit/pre-commit,pre-commit/pre-commit,pre-commit/pre-commit,pre-commit/pre-commit,Lucas-C/pre-commit,philipgian/pre-commit,philipgian/pre-commit,pre-commit/pre-commit,Lucas-C/pre-commit,philipgian/pre-commit,pre-commit/pre-commit,Lucas-C/pre-commit,philipgian/pre-commit,pre-commit/pre-commit,pre-commit/pre-commit,Lucas-C/pre-commit,Lucas-C/pre-commit,pre-commit/pre-commit,philipgian/pre-commit,pre-commit/pre-commit,pre-commit/pre-commit,Lucas-C/pre-commit,philipgian/pre-commit | ruby | ## Code Before:
Gem::Specification.new do |s|
s.name = 'pre_commit_dummy_package'
s.version = '0.0.0'
s.authors = ['Anthony Sottile']
end
## Instruction:
Make the dummy gem valid by giving it a summary
## Code After:
Gem::Specification.new do |s|
s.name = 'pre_commit_dummy_package'
s.version = '0.0.0'
s.summary = 'dummy gem for pre-commit hooks'
s.authors = ['Anthony Sottile']
end
| Gem::Specification.new do |s|
s.name = 'pre_commit_dummy_package'
s.version = '0.0.0'
+ s.summary = 'dummy gem for pre-commit hooks'
s.authors = ['Anthony Sottile']
end | 1 | 0.2 | 1 | 0 |
d1b1e4982e231ad5666716244b9b7389c971efbd | docs/index.rst | docs/index.rst | .. include:: ../README.rst
Table of Contents
-----------------
.. toctree::
:maxdepth: 1
pages/reply_bot
pages/changelog
pages/code_overview
pages/contributor_guidelines
Other Relevant Pages
--------------------
* `PRAW's Source Code <https://github.com/praw-dev/praw>`_
* `reddit's Source Code <https://github.com/reddit/reddit>`_
* `reddit's API Wiki Page <https://github.com/reddit/reddit/wiki/API>`_
* `reddit's API Documentation <https://www.reddit.com/dev/api>`_
* `reddit Markdown Primer
<https://www.reddit.com/r/reddit.com/comments/6ewgt/reddit_markdown_primer_or
_how_do_you_do_all_that/c03nik6>`_
* `reddit.com's FAQ <https://www.reddit.com/wiki/faq>`_
* `reddit.com's Status Twitterbot <https://twitter.com/redditstatus/>`_.
Tweets when reddit goes up or down
* `r/changelog <https://www.reddit.com/r/changelog/>`_. Significant changes to
reddit's codebase will be announced here in non-developer speak
* `r/redditdev <https://www.reddit.com/r/redditdev>`_. Ask questions about
reddit's codebase, PRAW and other API clients here
| .. include:: ../README.rst
Table of Contents
-----------------
.. toctree::
:maxdepth: 1
pages/reply_bot
pages/changelog
pages/code_overview
pages/comments
pages/contributor_guidelines
Other Relevant Pages
--------------------
* `PRAW's Source Code <https://github.com/praw-dev/praw>`_
* `reddit's Source Code <https://github.com/reddit/reddit>`_
* `reddit's API Wiki Page <https://github.com/reddit/reddit/wiki/API>`_
* `reddit's API Documentation <https://www.reddit.com/dev/api>`_
* `reddit Markdown Primer
<https://www.reddit.com/r/reddit.com/comments/6ewgt/reddit_markdown_primer_or
_how_do_you_do_all_that/c03nik6>`_
* `reddit.com's FAQ <https://www.reddit.com/wiki/faq>`_
* `reddit.com's Status Twitterbot <https://twitter.com/redditstatus/>`_.
Tweets when reddit goes up or down
* `r/changelog <https://www.reddit.com/r/changelog/>`_. Significant changes to
reddit's codebase will be announced here in non-developer speak
* `r/redditdev <https://www.reddit.com/r/redditdev>`_. Ask questions about
reddit's codebase, PRAW and other API clients here
| Add comments document to sphinx build. | Add comments document to sphinx build.
| reStructuredText | bsd-2-clause | praw-dev/praw,13steinj/praw,13steinj/praw,nmtake/praw,leviroth/praw,nmtake/praw,RGood/praw,gschizas/praw,gschizas/praw,RGood/praw,darthkedrik/praw,darthkedrik/praw,praw-dev/praw,leviroth/praw | restructuredtext | ## Code Before:
.. include:: ../README.rst
Table of Contents
-----------------
.. toctree::
:maxdepth: 1
pages/reply_bot
pages/changelog
pages/code_overview
pages/contributor_guidelines
Other Relevant Pages
--------------------
* `PRAW's Source Code <https://github.com/praw-dev/praw>`_
* `reddit's Source Code <https://github.com/reddit/reddit>`_
* `reddit's API Wiki Page <https://github.com/reddit/reddit/wiki/API>`_
* `reddit's API Documentation <https://www.reddit.com/dev/api>`_
* `reddit Markdown Primer
<https://www.reddit.com/r/reddit.com/comments/6ewgt/reddit_markdown_primer_or
_how_do_you_do_all_that/c03nik6>`_
* `reddit.com's FAQ <https://www.reddit.com/wiki/faq>`_
* `reddit.com's Status Twitterbot <https://twitter.com/redditstatus/>`_.
Tweets when reddit goes up or down
* `r/changelog <https://www.reddit.com/r/changelog/>`_. Significant changes to
reddit's codebase will be announced here in non-developer speak
* `r/redditdev <https://www.reddit.com/r/redditdev>`_. Ask questions about
reddit's codebase, PRAW and other API clients here
## Instruction:
Add comments document to sphinx build.
## Code After:
.. include:: ../README.rst
Table of Contents
-----------------
.. toctree::
:maxdepth: 1
pages/reply_bot
pages/changelog
pages/code_overview
pages/comments
pages/contributor_guidelines
Other Relevant Pages
--------------------
* `PRAW's Source Code <https://github.com/praw-dev/praw>`_
* `reddit's Source Code <https://github.com/reddit/reddit>`_
* `reddit's API Wiki Page <https://github.com/reddit/reddit/wiki/API>`_
* `reddit's API Documentation <https://www.reddit.com/dev/api>`_
* `reddit Markdown Primer
<https://www.reddit.com/r/reddit.com/comments/6ewgt/reddit_markdown_primer_or
_how_do_you_do_all_that/c03nik6>`_
* `reddit.com's FAQ <https://www.reddit.com/wiki/faq>`_
* `reddit.com's Status Twitterbot <https://twitter.com/redditstatus/>`_.
Tweets when reddit goes up or down
* `r/changelog <https://www.reddit.com/r/changelog/>`_. Significant changes to
reddit's codebase will be announced here in non-developer speak
* `r/redditdev <https://www.reddit.com/r/redditdev>`_. Ask questions about
reddit's codebase, PRAW and other API clients here
| .. include:: ../README.rst
Table of Contents
-----------------
.. toctree::
:maxdepth: 1
pages/reply_bot
pages/changelog
pages/code_overview
+ pages/comments
pages/contributor_guidelines
Other Relevant Pages
--------------------
* `PRAW's Source Code <https://github.com/praw-dev/praw>`_
* `reddit's Source Code <https://github.com/reddit/reddit>`_
* `reddit's API Wiki Page <https://github.com/reddit/reddit/wiki/API>`_
* `reddit's API Documentation <https://www.reddit.com/dev/api>`_
* `reddit Markdown Primer
<https://www.reddit.com/r/reddit.com/comments/6ewgt/reddit_markdown_primer_or
_how_do_you_do_all_that/c03nik6>`_
* `reddit.com's FAQ <https://www.reddit.com/wiki/faq>`_
* `reddit.com's Status Twitterbot <https://twitter.com/redditstatus/>`_.
Tweets when reddit goes up or down
* `r/changelog <https://www.reddit.com/r/changelog/>`_. Significant changes to
reddit's codebase will be announced here in non-developer speak
* `r/redditdev <https://www.reddit.com/r/redditdev>`_. Ask questions about
reddit's codebase, PRAW and other API clients here
| 1 | 0.030303 | 1 | 0 |
81046062ee78cb9d59759f72791dab5d281f036e | .travis.yml | .travis.yml | language: python
python:
- 2.5
- 2.6
- 2.7
- 3.1
- 3.2
before_install: sudo apt-get install subversion bzr mercurial git-core
install: pip install nose virtualenv scripttest mock
script: nosetests
notifications:
branches:
only:
- develop
env:
- PIP_USE_MIRRORS=true
| language: python
python:
- 2.5
- 2.6
- 2.7
- 3.1
- 3.2
before_install: sudo apt-get install subversion bzr mercurial
install: pip install nose virtualenv scripttest mock
script: nosetests
notifications:
branches:
only:
- develop
env:
- PIP_USE_MIRRORS=true
| Remove git-core from list of dependencies. | Remove git-core from list of dependencies. | YAML | mit | mujiansu/pip,prasaianooz/pip,natefoo/pip,sbidoul/pip,mattrobenolt/pip,luzfcb/pip,zorosteven/pip,jasonkying/pip,Ivoz/pip,prasaianooz/pip,jythontools/pip,rbtcollins/pip,haridsv/pip,qbdsoft/pip,caosmo/pip,nthall/pip,msabramo/pip,mujiansu/pip,radiosilence/pip,cjerdonek/pip,Ivoz/pip,zvezdan/pip,pypa/pip,atdaemon/pip,pjdelport/pip,ncoghlan/pip,supriyantomaftuh/pip,zenlambda/pip,techtonik/pip,blarghmatey/pip,zorosteven/pip,sbidoul/pip,davidovich/pip,alex/pip,ChristopherHogan/pip,graingert/pip,ianw/pip,pradyunsg/pip,zenlambda/pip,erikrose/pip,wkeyword/pip,supriyantomaftuh/pip,zorosteven/pip,tdsmith/pip,techtonik/pip,harrisonfeng/pip,rbtcollins/pip,esc/pip,pypa/pip,natefoo/pip,ChristopherHogan/pip,Gabriel439/pip,supriyantomaftuh/pip,KarelJakubec/pip,haridsv/pip,mujiansu/pip,James-Firth/pip,patricklaw/pip,RonnyPfannschmidt/pip,James-Firth/pip,rouge8/pip,qbdsoft/pip,tdsmith/pip,tdsmith/pip,luzfcb/pip,habnabit/pip,techtonik/pip,luzfcb/pip,graingert/pip,sigmavirus24/pip,pjdelport/pip,squidsoup/pip,rouge8/pip,alex/pip,esc/pip,squidsoup/pip,habnabit/pip,sigmavirus24/pip,pradyunsg/pip,mindw/pip,Gabriel439/pip,davidovich/pip,jasonkying/pip,rouge8/pip,minrk/pip,fiber-space/pip,RonnyPfannschmidt/pip,ianw/pip,rbtcollins/pip,willingc/pip,nthall/pip,dstufft/pip,blarghmatey/pip,Carreau/pip,msabramo/pip,graingert/pip,fiber-space/pip,mindw/pip,willingc/pip,zvezdan/pip,Gabriel439/pip,h4ck3rm1k3/pip,mindw/pip,fiber-space/pip,jamezpolley/pip,caosmo/pip,Carreau/pip,wkeyword/pip,harrisonfeng/pip,jmagnusson/pip,mattrobenolt/pip,qbdsoft/pip,dstufft/pip,haridsv/pip,chaoallsome/pip,prasaianooz/pip,jamezpolley/pip,zenlambda/pip,pfmoore/pip,harrisonfeng/pip,domenkozar/pip,sigmavirus24/pip,jythontools/pip,zvezdan/pip,ChristopherHogan/pip,pjdelport/pip,caosmo/pip,esc/pip,dstufft/pip,minrk/pip,h4ck3rm1k3/pip,natefoo/pip,jythontools/pip,habnabit/pip,yati-sagade/pip,ncoghlan/pip,xavfernandez/pip,pfmoore/pip,atdaemon/pip,erikrose/pip,atdaemon/pip,cjerdonek/pip,erikrose/pip,James-Firth/pip,nthall/pip,benesch/pip,chaoallsome/pip,willingc/pip,jmagnusson/pip,wkeyword/pip,jmagnusson/pip,jasonkying/pip,yati-sagade/pip,davidovich/pip,xavfernandez/pip,benesch/pip,qwcode/pip,alquerci/pip,chaoallsome/pip,alex/pip,qwcode/pip,patricklaw/pip,KarelJakubec/pip,alquerci/pip,jamezpolley/pip,benesch/pip,ncoghlan/pip,xavfernandez/pip,blarghmatey/pip,squidsoup/pip,RonnyPfannschmidt/pip,KarelJakubec/pip,h4ck3rm1k3/pip,yati-sagade/pip | yaml | ## Code Before:
language: python
python:
- 2.5
- 2.6
- 2.7
- 3.1
- 3.2
before_install: sudo apt-get install subversion bzr mercurial git-core
install: pip install nose virtualenv scripttest mock
script: nosetests
notifications:
branches:
only:
- develop
env:
- PIP_USE_MIRRORS=true
## Instruction:
Remove git-core from list of dependencies.
## Code After:
language: python
python:
- 2.5
- 2.6
- 2.7
- 3.1
- 3.2
before_install: sudo apt-get install subversion bzr mercurial
install: pip install nose virtualenv scripttest mock
script: nosetests
notifications:
branches:
only:
- develop
env:
- PIP_USE_MIRRORS=true
| language: python
python:
- 2.5
- 2.6
- 2.7
- 3.1
- 3.2
- before_install: sudo apt-get install subversion bzr mercurial git-core
? ---------
+ before_install: sudo apt-get install subversion bzr mercurial
install: pip install nose virtualenv scripttest mock
script: nosetests
notifications:
branches:
only:
- develop
env:
- PIP_USE_MIRRORS=true
- | 3 | 0.176471 | 1 | 2 |
7eff20d706eb35513d8d1f420e59879e80400417 | pseudon/ast_translator.py | pseudon/ast_translator.py | from ast import AST
import yaml
class ASTTranslator:
def __init__(self, tree):
self.tree = tree
def translate(self):
return yaml.dump({'type': 'program', 'code': []})
| import ast
import yaml
class ASTTranslator:
def __init__(self, tree):
self.tree = tree
def translate(self):
return yaml.dump(self._translate_node(self.tree))
def _translate_node(self, node):
if isinstance(node, ast.AST):
return getattr('_translate_%s' % type(node).__name__)(**node.__dict__)
elif isinstance(node, list):
return [self._translate_node(n) for n in node]
elif isinstance(node, dict):
return {k: self._translate_node(v) for k, v in node.items()}
else:
return node
def _translate_module(self, body):
return {'type': 'program', 'code': self._translate_node(body)}
def _translate_int(self, n):
return {'type': 'int', 'value': n}
| Add a basic ast translator | Add a basic ast translator
| Python | mit | alehander42/pseudo-python | python | ## Code Before:
from ast import AST
import yaml
class ASTTranslator:
def __init__(self, tree):
self.tree = tree
def translate(self):
return yaml.dump({'type': 'program', 'code': []})
## Instruction:
Add a basic ast translator
## Code After:
import ast
import yaml
class ASTTranslator:
def __init__(self, tree):
self.tree = tree
def translate(self):
return yaml.dump(self._translate_node(self.tree))
def _translate_node(self, node):
if isinstance(node, ast.AST):
return getattr('_translate_%s' % type(node).__name__)(**node.__dict__)
elif isinstance(node, list):
return [self._translate_node(n) for n in node]
elif isinstance(node, dict):
return {k: self._translate_node(v) for k, v in node.items()}
else:
return node
def _translate_module(self, body):
return {'type': 'program', 'code': self._translate_node(body)}
def _translate_int(self, n):
return {'type': 'int', 'value': n}
| - from ast import AST
+ import ast
import yaml
class ASTTranslator:
def __init__(self, tree):
self.tree = tree
def translate(self):
- return yaml.dump({'type': 'program', 'code': []})
+ return yaml.dump(self._translate_node(self.tree))
+
+ def _translate_node(self, node):
+ if isinstance(node, ast.AST):
+ return getattr('_translate_%s' % type(node).__name__)(**node.__dict__)
+ elif isinstance(node, list):
+ return [self._translate_node(n) for n in node]
+ elif isinstance(node, dict):
+ return {k: self._translate_node(v) for k, v in node.items()}
+ else:
+ return node
+
+ def _translate_module(self, body):
+ return {'type': 'program', 'code': self._translate_node(body)}
+
+ def _translate_int(self, n):
+ return {'type': 'int', 'value': n} | 20 | 1.818182 | 18 | 2 |
74949efec57d12f0010ea8b6f0c2357b970ccec2 | README.md | README.md | Datatypes 
=========
Object-oriented implementation of the basic datatypes found in PHP - String, Collection, Number, and new base type Object
| Datatypes [](https://travis-ci.org/Alaneor/Datatypes)
=========
Object-oriented implementation of the basic datatypes found in PHP - String, Collection, Number, and new base type Object
| Make that Travis build status image clickable | Make that Travis build status image clickable
[ci skip]
| Markdown | mit | Alaneor/Datatypes,Alaneor/Datatypes | markdown | ## Code Before:
Datatypes 
=========
Object-oriented implementation of the basic datatypes found in PHP - String, Collection, Number, and new base type Object
## Instruction:
Make that Travis build status image clickable
[ci skip]
## Code After:
Datatypes [](https://travis-ci.org/Alaneor/Datatypes)
=========
Object-oriented implementation of the basic datatypes found in PHP - String, Collection, Number, and new base type Object
| - Datatypes 
+ Datatypes [](https://travis-ci.org/Alaneor/Datatypes)
? + ++++++++++++++++++++++++++++++++++++++++++
=========
Object-oriented implementation of the basic datatypes found in PHP - String, Collection, Number, and new base type Object | 2 | 0.5 | 1 | 1 |
e8d404aecf4253b5922b6e2a5ceb70f13244e6f8 | app/representers/answer_representer.rb | app/representers/answer_representer.rb | require 'roar/decorator'
require 'roar/json'
require 'roar/xml'
class AnswerRepresenter < Roar::Decorator
include Roar::JSON
include Roar::XML
self.representation_wrap = :answer
property :user_id
property :answer_text
property :details_text
end
| require 'roar/decorator'
require 'roar/json'
require 'roar/xml'
class AnswerRepresenter < Roar::Decorator
include Roar::JSON
include Roar::XML
self.representation_wrap = :answer
property :user_id
property :answer_text
property :details_text
property :matrix_answer
end
| Add matrix_answer property to answer object | Add matrix_answer property to answer object
| Ruby | mit | unepwcmc/ORS-API,unepwcmc/ORS-API,unepwcmc/ORS-API | ruby | ## Code Before:
require 'roar/decorator'
require 'roar/json'
require 'roar/xml'
class AnswerRepresenter < Roar::Decorator
include Roar::JSON
include Roar::XML
self.representation_wrap = :answer
property :user_id
property :answer_text
property :details_text
end
## Instruction:
Add matrix_answer property to answer object
## Code After:
require 'roar/decorator'
require 'roar/json'
require 'roar/xml'
class AnswerRepresenter < Roar::Decorator
include Roar::JSON
include Roar::XML
self.representation_wrap = :answer
property :user_id
property :answer_text
property :details_text
property :matrix_answer
end
| require 'roar/decorator'
require 'roar/json'
require 'roar/xml'
class AnswerRepresenter < Roar::Decorator
include Roar::JSON
include Roar::XML
self.representation_wrap = :answer
property :user_id
property :answer_text
property :details_text
+ property :matrix_answer
end | 1 | 0.071429 | 1 | 0 |
bcfa6a78e859c5bb8b9c516498fedfb33cd4dab2 | pkgs/os-specific/linux/pam/default.nix | pkgs/os-specific/linux/pam/default.nix | { stdenv, fetchurl, flex, cracklib, libxcrypt }:
stdenv.mkDerivation {
name = "linux-pam-1.1.1";
src = fetchurl {
url = mirror://kernel/linux/libs/pam/library/Linux-PAM-1.1.1.tar.bz2;
sha256 = "015r3xdkjpqwcv4lvxavq0nybdpxhfjycqpzbx8agqd5sywkx3b0";
};
buildNativeInputs = [ flex ];
buildInputs = [ cracklib ]
++ stdenv.lib.optional
(stdenv.system != "armv5tel-linux" && stdenv.system != "mips64-linux")
libxcrypt;
crossAttrs = {
# Skip libxcrypt cross-building, as it fails for mips and armv5tel
propagatedBuildInputs = [ flex.hostDrv cracklib.hostDrv ];
};
postInstall = ''
mv -v $out/sbin/unix_chkpwd{,.orig}
ln -sv /var/setuid-wrappers/unix_chkpwd $out/sbin/unix_chkpwd
'';
preConfigure = ''
configureFlags="$configureFlags --includedir=$out/include/security"
'';
meta = {
homepage = http://ftp.kernel.org/pub/linux/libs/pam/;
description = "Pluggable Authentication Modules, a flexible mechanism for authenticating user";
platforms = stdenv.lib.platforms.linux;
};
}
| { stdenv, fetchurl, flex, cracklib, libxcrypt }:
stdenv.mkDerivation {
name = "linux-pam-1.1.1";
src = fetchurl {
url = mirror://kernel/linux/libs/pam/library/Linux-PAM-1.1.1.tar.bz2;
sha256 = "015r3xdkjpqwcv4lvxavq0nybdpxhfjycqpzbx8agqd5sywkx3b0";
};
buildNativeInputs = [ flex ];
buildInputs = [ cracklib ]
++ stdenv.lib.optional
(stdenv.system != "armv5tel-linux" && stdenv.system != "mips64-linux")
libxcrypt;
crossAttrs = {
# Skip libxcrypt cross-building, as it fails for mips and armv5tel
propagatedBuildInputs = [ flex.hostDrv cracklib.hostDrv ];
preConfigure = ''
ar x ${flex.hostDrv}/lib/libfl.a
export LDFLAGS="$LDFLAGS $PWD/libyywrap.o"
'';
};
postInstall = ''
mv -v $out/sbin/unix_chkpwd{,.orig}
ln -sv /var/setuid-wrappers/unix_chkpwd $out/sbin/unix_chkpwd
'';
preConfigure = ''
configureFlags="$configureFlags --includedir=$out/include/security"
'';
meta = {
homepage = http://ftp.kernel.org/pub/linux/libs/pam/;
description = "Pluggable Authentication Modules, a flexible mechanism for authenticating user";
platforms = stdenv.lib.platforms.linux;
};
}
| Fix one part of cross-Linux-PAM failure... | Fix one part of cross-Linux-PAM failure...
svn path=/nixpkgs/trunk/; revision=30237
| Nix | mit | SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,triton/triton,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,triton/triton,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,triton/triton,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,triton/triton,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,triton/triton,SymbiFlow/nixpkgs,triton/triton,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,triton/triton,NixOS/nixpkgs,triton/triton | nix | ## Code Before:
{ stdenv, fetchurl, flex, cracklib, libxcrypt }:
stdenv.mkDerivation {
name = "linux-pam-1.1.1";
src = fetchurl {
url = mirror://kernel/linux/libs/pam/library/Linux-PAM-1.1.1.tar.bz2;
sha256 = "015r3xdkjpqwcv4lvxavq0nybdpxhfjycqpzbx8agqd5sywkx3b0";
};
buildNativeInputs = [ flex ];
buildInputs = [ cracklib ]
++ stdenv.lib.optional
(stdenv.system != "armv5tel-linux" && stdenv.system != "mips64-linux")
libxcrypt;
crossAttrs = {
# Skip libxcrypt cross-building, as it fails for mips and armv5tel
propagatedBuildInputs = [ flex.hostDrv cracklib.hostDrv ];
};
postInstall = ''
mv -v $out/sbin/unix_chkpwd{,.orig}
ln -sv /var/setuid-wrappers/unix_chkpwd $out/sbin/unix_chkpwd
'';
preConfigure = ''
configureFlags="$configureFlags --includedir=$out/include/security"
'';
meta = {
homepage = http://ftp.kernel.org/pub/linux/libs/pam/;
description = "Pluggable Authentication Modules, a flexible mechanism for authenticating user";
platforms = stdenv.lib.platforms.linux;
};
}
## Instruction:
Fix one part of cross-Linux-PAM failure...
svn path=/nixpkgs/trunk/; revision=30237
## Code After:
{ stdenv, fetchurl, flex, cracklib, libxcrypt }:
stdenv.mkDerivation {
name = "linux-pam-1.1.1";
src = fetchurl {
url = mirror://kernel/linux/libs/pam/library/Linux-PAM-1.1.1.tar.bz2;
sha256 = "015r3xdkjpqwcv4lvxavq0nybdpxhfjycqpzbx8agqd5sywkx3b0";
};
buildNativeInputs = [ flex ];
buildInputs = [ cracklib ]
++ stdenv.lib.optional
(stdenv.system != "armv5tel-linux" && stdenv.system != "mips64-linux")
libxcrypt;
crossAttrs = {
# Skip libxcrypt cross-building, as it fails for mips and armv5tel
propagatedBuildInputs = [ flex.hostDrv cracklib.hostDrv ];
preConfigure = ''
ar x ${flex.hostDrv}/lib/libfl.a
export LDFLAGS="$LDFLAGS $PWD/libyywrap.o"
'';
};
postInstall = ''
mv -v $out/sbin/unix_chkpwd{,.orig}
ln -sv /var/setuid-wrappers/unix_chkpwd $out/sbin/unix_chkpwd
'';
preConfigure = ''
configureFlags="$configureFlags --includedir=$out/include/security"
'';
meta = {
homepage = http://ftp.kernel.org/pub/linux/libs/pam/;
description = "Pluggable Authentication Modules, a flexible mechanism for authenticating user";
platforms = stdenv.lib.platforms.linux;
};
}
| { stdenv, fetchurl, flex, cracklib, libxcrypt }:
stdenv.mkDerivation {
name = "linux-pam-1.1.1";
src = fetchurl {
url = mirror://kernel/linux/libs/pam/library/Linux-PAM-1.1.1.tar.bz2;
sha256 = "015r3xdkjpqwcv4lvxavq0nybdpxhfjycqpzbx8agqd5sywkx3b0";
};
buildNativeInputs = [ flex ];
buildInputs = [ cracklib ]
++ stdenv.lib.optional
(stdenv.system != "armv5tel-linux" && stdenv.system != "mips64-linux")
libxcrypt;
crossAttrs = {
# Skip libxcrypt cross-building, as it fails for mips and armv5tel
propagatedBuildInputs = [ flex.hostDrv cracklib.hostDrv ];
+ preConfigure = ''
+ ar x ${flex.hostDrv}/lib/libfl.a
+ export LDFLAGS="$LDFLAGS $PWD/libyywrap.o"
+ '';
};
postInstall = ''
mv -v $out/sbin/unix_chkpwd{,.orig}
ln -sv /var/setuid-wrappers/unix_chkpwd $out/sbin/unix_chkpwd
'';
preConfigure = ''
configureFlags="$configureFlags --includedir=$out/include/security"
'';
meta = {
homepage = http://ftp.kernel.org/pub/linux/libs/pam/;
description = "Pluggable Authentication Modules, a flexible mechanism for authenticating user";
platforms = stdenv.lib.platforms.linux;
};
} | 4 | 0.111111 | 4 | 0 |
25b851c6c6ec04c504b8054ef8df6667432bae0c | snippets/form-errors-custom.liquid | snippets/form-errors-custom.liquid | {% comment %}
We want control over our error text, so we'll loop through them.
Alternatively, you can use the default layout to generate a
<ul> wrapped with <div class="errors">
- {{ form.errors | default_errors }}
{% endcomment %}
{% if form.errors %}
<div class="note form-error">
<p>{{ 'general.forms.post_error' | t }}</p>
<ul class="disc">
{% for field in form.errors %}
{% comment %}
Check if it's a generic 'form' error and don't show the {{ field }}
{% endcomment %}
{% if field == 'form' %}
<li>
{{ form.errors.messages[field] }}
</li>
{% else %}
<li>
{% assign field_name = field | replace: 'body', 'message' %}
{{ 'general.forms.post_field_error_html' | t: field: field_name, error: form.errors.messages[field] }}
</li>
{% endif %}
{% endfor %}
</ul>
</div>
{% endif %}
| {% comment %}
We want control over our error text, so we'll loop through them.
Alternatively, you can use the default layout to generate a
<ul> wrapped with <div class="errors">
- {{ form.errors | default_errors }}
{% endcomment %}
{% if form.errors %}
<div class="note form-error">
<p>{{ 'general.forms.post_error' | t }}</p>
{% assign message = 'contact.form.message' | t %}
<ul class="disc">
{% for field in form.errors %}
{% comment %}
Check if it's a generic 'form' error and don't show the {{ field }}
{% endcomment %}
{% if field == 'form' %}
<li>
{{ form.errors.messages[field] }}
</li>
{% else %}
<li>
{% assign field_name = field | replace: 'body', message %}
{{ 'general.forms.post_field_error_html' | t: field: field_name, error: form.errors.messages[field] }}
</li>
{% endif %}
{% endfor %}
</ul>
</div>
{% endif %}
| Allow for translation of 'message' text in contact form. | Allow for translation of 'message' text in contact form.
@cshold @jonasll
Reusing contact.form.message key here, already translatable.
| Liquid | mit | Klaudit/Timber,vovaane/timber,aboutjax/benny,swapkats/Materify,kipjib/Timber,zacwasielewski/Timber,aboutjax/benny,wad3inthewater/timber-theme,VirtoCommerce/Timber,mwcm/Kauai,gridmechanic/Timber,CodeKiwi/dirt,montalvomiguelo/Timber,mwcmitchell/Kauai,eugenelardy/shopifytheme,kipjib/Timber,montalvomiguelo/Timber,Klaudit/Timber,CodeKiwi/dirt,humancopy/Timber,eugenelardy/shopifytheme,CodeKiwi/dirt,Shine18/Timber,CodeKiwi/dirt,alexclarkofficial/newbury-theme,zacwasielewski/Timber,tikn/Timber,mwcm/Kauai,swapkats/Materify,alexclarkofficial/newbury-theme,humancopy/Timber,CodeKiwi/dirt,Shopify/Timber,wad3inthewater/timber-theme,triskybro/Timber,aboutjax/benny,mwcmitchell/Kauai,triskybro/Timber,mwcmitchell/Kauai,mwcm/Kauai,Shine18/Timber,gridmechanic/Timber,Shopify/Timber,tikn/Timber,vovaane/timber | liquid | ## Code Before:
{% comment %}
We want control over our error text, so we'll loop through them.
Alternatively, you can use the default layout to generate a
<ul> wrapped with <div class="errors">
- {{ form.errors | default_errors }}
{% endcomment %}
{% if form.errors %}
<div class="note form-error">
<p>{{ 'general.forms.post_error' | t }}</p>
<ul class="disc">
{% for field in form.errors %}
{% comment %}
Check if it's a generic 'form' error and don't show the {{ field }}
{% endcomment %}
{% if field == 'form' %}
<li>
{{ form.errors.messages[field] }}
</li>
{% else %}
<li>
{% assign field_name = field | replace: 'body', 'message' %}
{{ 'general.forms.post_field_error_html' | t: field: field_name, error: form.errors.messages[field] }}
</li>
{% endif %}
{% endfor %}
</ul>
</div>
{% endif %}
## Instruction:
Allow for translation of 'message' text in contact form.
@cshold @jonasll
Reusing contact.form.message key here, already translatable.
## Code After:
{% comment %}
We want control over our error text, so we'll loop through them.
Alternatively, you can use the default layout to generate a
<ul> wrapped with <div class="errors">
- {{ form.errors | default_errors }}
{% endcomment %}
{% if form.errors %}
<div class="note form-error">
<p>{{ 'general.forms.post_error' | t }}</p>
{% assign message = 'contact.form.message' | t %}
<ul class="disc">
{% for field in form.errors %}
{% comment %}
Check if it's a generic 'form' error and don't show the {{ field }}
{% endcomment %}
{% if field == 'form' %}
<li>
{{ form.errors.messages[field] }}
</li>
{% else %}
<li>
{% assign field_name = field | replace: 'body', message %}
{{ 'general.forms.post_field_error_html' | t: field: field_name, error: form.errors.messages[field] }}
</li>
{% endif %}
{% endfor %}
</ul>
</div>
{% endif %}
| {% comment %}
We want control over our error text, so we'll loop through them.
Alternatively, you can use the default layout to generate a
<ul> wrapped with <div class="errors">
- {{ form.errors | default_errors }}
{% endcomment %}
{% if form.errors %}
<div class="note form-error">
<p>{{ 'general.forms.post_error' | t }}</p>
-
+
+ {% assign message = 'contact.form.message' | t %}
+
<ul class="disc">
{% for field in form.errors %}
{% comment %}
Check if it's a generic 'form' error and don't show the {{ field }}
{% endcomment %}
{% if field == 'form' %}
<li>
{{ form.errors.messages[field] }}
</li>
{% else %}
+
<li>
- {% assign field_name = field | replace: 'body', 'message' %}
? - -
+ {% assign field_name = field | replace: 'body', message %}
{{ 'general.forms.post_field_error_html' | t: field: field_name, error: form.errors.messages[field] }}
</li>
{% endif %}
{% endfor %}
</ul>
</div>
{% endif %} | 7 | 0.21875 | 5 | 2 |
e5e82e6af9505c9f5a04a8acbe8170349faf80b7 | modules/openlmis-web/src/main/webapp/public/js/shared/directives/angular-flot.js | modules/openlmis-web/src/main/webapp/public/js/shared/directives/angular-flot.js | /**
* Created with IntelliJ IDEA.
* User: issa
* Date: 2/10/14
* Time: 1:18 AM
*/
app.directive('aFloat', function() {
function link(scope, element, attrs){
scope.$watch('afData', function(){
init(scope.afData,scope.afOption);
});
scope.$watch('afOption', function(){
init(scope.afData,scope.afOption);
});
function init(o,d){
var totalWidth = element.width(), totalHeight = element.height();
if (totalHeight === 0 || totalWidth === 0) {
throw new Error('Please set height and width for the aFloat element'+'width is '+ele);
}
if(element.is(":visible") && !isUndefined(d)){
$.plot(element, o , d);
}
}
}
return {
restrict: 'EA',
template: '<div></div>',
link: link,
replace:true,
scope: {
afOption: '=',
afData: '='
}
};
}); | /**
* Created with IntelliJ IDEA.
* User: issa
* Date: 2/10/14
* Time: 1:18 AM
*/
app.directive('aFloat', function() {
function link(scope, element, attrs){
scope.$watch('afData', function(){
init(scope.afData,scope.afOption);
});
scope.$watch('afOption', function(){
init(scope.afData,scope.afOption);
});
function init(o,d){
var totalWidth = element.width(), totalHeight = element.height();
if (totalHeight === 0 || totalWidth === 0) {
throw new Error('Please set height and width for the aFloat element'+'width is '+element);
}
if(element.is(":visible") && !isUndefined(d) && !isUndefined(o)){
$.plot(element, o , d);
}
}
}
return {
restrict: 'EA',
template: '<div></div>',
link: link,
replace:true,
scope: {
afOption: '=',
afData: '='
}
};
}); | Fix angular jqflot integration error | Fix angular jqflot integration error
| JavaScript | agpl-3.0 | OpenLMIS/open-lmis,jasolangi/jasolangi.github.io,jasolangi/jasolangi.github.io,USAID-DELIVER-PROJECT/elmis,OpenLMIS/open-lmis,vimsvarcode/elmis,vimsvarcode/elmis,vimsvarcode/elmis,kelvinmbwilo/vims,vimsvarcode/elmis,jasolangi/jasolangi.github.io,USAID-DELIVER-PROJECT/elmis,kelvinmbwilo/vims,vimsvarcode/elmis,kelvinmbwilo/vims,OpenLMIS/open-lmis,USAID-DELIVER-PROJECT/elmis,USAID-DELIVER-PROJECT/elmis,kelvinmbwilo/vims,OpenLMIS/open-lmis | javascript | ## Code Before:
/**
* Created with IntelliJ IDEA.
* User: issa
* Date: 2/10/14
* Time: 1:18 AM
*/
app.directive('aFloat', function() {
function link(scope, element, attrs){
scope.$watch('afData', function(){
init(scope.afData,scope.afOption);
});
scope.$watch('afOption', function(){
init(scope.afData,scope.afOption);
});
function init(o,d){
var totalWidth = element.width(), totalHeight = element.height();
if (totalHeight === 0 || totalWidth === 0) {
throw new Error('Please set height and width for the aFloat element'+'width is '+ele);
}
if(element.is(":visible") && !isUndefined(d)){
$.plot(element, o , d);
}
}
}
return {
restrict: 'EA',
template: '<div></div>',
link: link,
replace:true,
scope: {
afOption: '=',
afData: '='
}
};
});
## Instruction:
Fix angular jqflot integration error
## Code After:
/**
* Created with IntelliJ IDEA.
* User: issa
* Date: 2/10/14
* Time: 1:18 AM
*/
app.directive('aFloat', function() {
function link(scope, element, attrs){
scope.$watch('afData', function(){
init(scope.afData,scope.afOption);
});
scope.$watch('afOption', function(){
init(scope.afData,scope.afOption);
});
function init(o,d){
var totalWidth = element.width(), totalHeight = element.height();
if (totalHeight === 0 || totalWidth === 0) {
throw new Error('Please set height and width for the aFloat element'+'width is '+element);
}
if(element.is(":visible") && !isUndefined(d) && !isUndefined(o)){
$.plot(element, o , d);
}
}
}
return {
restrict: 'EA',
template: '<div></div>',
link: link,
replace:true,
scope: {
afOption: '=',
afData: '='
}
};
}); | /**
* Created with IntelliJ IDEA.
* User: issa
* Date: 2/10/14
* Time: 1:18 AM
*/
app.directive('aFloat', function() {
function link(scope, element, attrs){
scope.$watch('afData', function(){
init(scope.afData,scope.afOption);
});
scope.$watch('afOption', function(){
init(scope.afData,scope.afOption);
});
function init(o,d){
var totalWidth = element.width(), totalHeight = element.height();
if (totalHeight === 0 || totalWidth === 0) {
- throw new Error('Please set height and width for the aFloat element'+'width is '+ele);
+ throw new Error('Please set height and width for the aFloat element'+'width is '+element);
? ++++
}
- if(element.is(":visible") && !isUndefined(d)){
+ if(element.is(":visible") && !isUndefined(d) && !isUndefined(o)){
? +++++++++++++++++++
$.plot(element, o , d);
}
}
}
return {
restrict: 'EA',
template: '<div></div>',
link: link,
replace:true,
scope: {
afOption: '=',
afData: '='
}
};
}); | 4 | 0.097561 | 2 | 2 |
cbaac1f48a937fea5e5858003067b63c50abc7ee | _data/navigation.yml | _data/navigation.yml |
- title: Project Directory
url: /project-directory
excerpt: "A directory of neuroimaging projects in Python"
image:
- title: Get Help
url: /support
excerpt: "Where to go for more information"
image:
- title: Contribute
url: /contribute
excerpt: "It ain't a community if you don't take part"
image:
- title: Code of conduct
url: /code-of-conduct
excerpt:
image:
|
- title: Project Directory
url: /project-directory
excerpt: "A directory of neuroimaging projects in Python"
image:
- title: Get Help
url: /support
excerpt: "Where to go for more information"
image:
- title: Contribute
url: /contribute
excerpt: "It ain't a community if you don't take part"
image:
- title: Code of conduct
url: /code-of-conduct
excerpt:
image:
- title: Articles
url: /articles
excerpt: "Dispatches from the fronts of science"
image:
| Add the articles to the nav side bar thingee. | Add the articles to the nav side bar thingee.
| YAML | mit | lesteve/nipy.github.com,vsoch/nipy.github.com,vsoch/nipy.github.com,vsoch/nipy.github.com,lesteve/nipy.github.com,arokem/nipy.github.com,arokem/nipy.github.com,lesteve/nipy.github.com,vsoch/nipy.github.com,arokem/nipy.github.com | yaml | ## Code Before:
- title: Project Directory
url: /project-directory
excerpt: "A directory of neuroimaging projects in Python"
image:
- title: Get Help
url: /support
excerpt: "Where to go for more information"
image:
- title: Contribute
url: /contribute
excerpt: "It ain't a community if you don't take part"
image:
- title: Code of conduct
url: /code-of-conduct
excerpt:
image:
## Instruction:
Add the articles to the nav side bar thingee.
## Code After:
- title: Project Directory
url: /project-directory
excerpt: "A directory of neuroimaging projects in Python"
image:
- title: Get Help
url: /support
excerpt: "Where to go for more information"
image:
- title: Contribute
url: /contribute
excerpt: "It ain't a community if you don't take part"
image:
- title: Code of conduct
url: /code-of-conduct
excerpt:
image:
- title: Articles
url: /articles
excerpt: "Dispatches from the fronts of science"
image:
|
- title: Project Directory
url: /project-directory
excerpt: "A directory of neuroimaging projects in Python"
image:
- title: Get Help
url: /support
excerpt: "Where to go for more information"
image:
- title: Contribute
url: /contribute
excerpt: "It ain't a community if you don't take part"
image:
- title: Code of conduct
url: /code-of-conduct
- excerpt:
+ excerpt:
? +
image:
+ - title: Articles
+ url: /articles
+ excerpt: "Dispatches from the fronts of science"
+ image:
+ | 7 | 0.333333 | 6 | 1 |
aa451fec21eac8cd64d3efb46e82ba01097abcef | index.js | index.js | "use strict";
var CssSelectorParser = require('css-selector-parser').CssSelectorParser
var cssSelector = new CssSelectorParser()
cssSelector.registerSelectorPseudos('has');
cssSelector.registerNestingOperators('>', '+', '~');
cssSelector.registerAttrEqualityMods('^', '$', '*', '~');
cssSelector.enableSubstitutes();
module.exports = replaceClasses
function replaceClasses(selector, map) {
var ast = cssSelector.parse(selector)
visitRules(ast, function(node) {
if (node.classNames) {
node.classNames = node.classNames.map(function(cls) {
if (map.hasOwnProperty(cls)) {
return map[cls]
}
else {
return cls
}
})
}
})
return cssSelector.render(ast)
}
function visitRules(node, fn) {
if (node.rule) {
visitRules(node.rule, fn)
}
if (node.selectors) {
node.selectors.forEach(function(node) {
visitRules(node, fn)
})
}
if (node.pseudos) {
node.pseudos.forEach(function(pseudo) {
if (pseudo.valueType === 'selector') {
visitRules(pseudo.value, fn)
}
})
}
if (node.type === 'rule') {
fn(node)
}
}
| "use strict";
var CssSelectorParser = require('css-selector-parser').CssSelectorParser
var cssSelector = new CssSelectorParser()
cssSelector.registerNestingOperators('>', '+', '~');
cssSelector.registerAttrEqualityMods('^', '$', '*', '~');
module.exports = replaceClasses
function replaceClasses(selector, map) {
var ast = cssSelector.parse(selector)
visitRules(ast, function(node) {
if (node.classNames) {
node.classNames = node.classNames.map(function(cls) {
if (map.hasOwnProperty(cls)) {
return map[cls]
}
else {
return cls
}
})
}
})
return cssSelector.render(ast)
}
function visitRules(node, fn) {
if (node.rule) {
visitRules(node.rule, fn)
}
if (node.selectors) {
node.selectors.forEach(function(node) {
visitRules(node, fn)
})
}
if (node.pseudos) {
node.pseudos.forEach(function(pseudo) {
if (pseudo.valueType === 'selector') {
visitRules(pseudo.value, fn)
}
})
}
if (node.type === 'rule') {
fn(node)
}
}
| Remove unneeded css parser options | Remove unneeded css parser options
| JavaScript | mit | andrezsanchez/css-selector-replace-classes | javascript | ## Code Before:
"use strict";
var CssSelectorParser = require('css-selector-parser').CssSelectorParser
var cssSelector = new CssSelectorParser()
cssSelector.registerSelectorPseudos('has');
cssSelector.registerNestingOperators('>', '+', '~');
cssSelector.registerAttrEqualityMods('^', '$', '*', '~');
cssSelector.enableSubstitutes();
module.exports = replaceClasses
function replaceClasses(selector, map) {
var ast = cssSelector.parse(selector)
visitRules(ast, function(node) {
if (node.classNames) {
node.classNames = node.classNames.map(function(cls) {
if (map.hasOwnProperty(cls)) {
return map[cls]
}
else {
return cls
}
})
}
})
return cssSelector.render(ast)
}
function visitRules(node, fn) {
if (node.rule) {
visitRules(node.rule, fn)
}
if (node.selectors) {
node.selectors.forEach(function(node) {
visitRules(node, fn)
})
}
if (node.pseudos) {
node.pseudos.forEach(function(pseudo) {
if (pseudo.valueType === 'selector') {
visitRules(pseudo.value, fn)
}
})
}
if (node.type === 'rule') {
fn(node)
}
}
## Instruction:
Remove unneeded css parser options
## Code After:
"use strict";
var CssSelectorParser = require('css-selector-parser').CssSelectorParser
var cssSelector = new CssSelectorParser()
cssSelector.registerNestingOperators('>', '+', '~');
cssSelector.registerAttrEqualityMods('^', '$', '*', '~');
module.exports = replaceClasses
function replaceClasses(selector, map) {
var ast = cssSelector.parse(selector)
visitRules(ast, function(node) {
if (node.classNames) {
node.classNames = node.classNames.map(function(cls) {
if (map.hasOwnProperty(cls)) {
return map[cls]
}
else {
return cls
}
})
}
})
return cssSelector.render(ast)
}
function visitRules(node, fn) {
if (node.rule) {
visitRules(node.rule, fn)
}
if (node.selectors) {
node.selectors.forEach(function(node) {
visitRules(node, fn)
})
}
if (node.pseudos) {
node.pseudos.forEach(function(pseudo) {
if (pseudo.valueType === 'selector') {
visitRules(pseudo.value, fn)
}
})
}
if (node.type === 'rule') {
fn(node)
}
}
| "use strict";
var CssSelectorParser = require('css-selector-parser').CssSelectorParser
var cssSelector = new CssSelectorParser()
- cssSelector.registerSelectorPseudos('has');
cssSelector.registerNestingOperators('>', '+', '~');
cssSelector.registerAttrEqualityMods('^', '$', '*', '~');
- cssSelector.enableSubstitutes();
module.exports = replaceClasses
function replaceClasses(selector, map) {
var ast = cssSelector.parse(selector)
visitRules(ast, function(node) {
if (node.classNames) {
node.classNames = node.classNames.map(function(cls) {
if (map.hasOwnProperty(cls)) {
return map[cls]
}
else {
return cls
}
})
}
})
return cssSelector.render(ast)
}
function visitRules(node, fn) {
if (node.rule) {
visitRules(node.rule, fn)
}
if (node.selectors) {
node.selectors.forEach(function(node) {
visitRules(node, fn)
})
}
if (node.pseudos) {
node.pseudos.forEach(function(pseudo) {
if (pseudo.valueType === 'selector') {
visitRules(pseudo.value, fn)
}
})
}
if (node.type === 'rule') {
fn(node)
}
} | 2 | 0.040816 | 0 | 2 |
dec7761c438336e248b59d3843ce69cd961a33a8 | src/index.ts | src/index.ts | import { Application } from 'typedoc/dist/lib/application';
import { ParameterType } from 'typedoc/dist/lib/utils/options/declaration';
import { MarkdownPlugin } from './plugin';
module.exports = (PluginHost: Application) => {
const app = PluginHost.owner;
/**
* Expose additional options for consumption.
*/
app.options.addDeclaration({
component: 'markdown',
help: 'Markdown Plugin: Suppress file sources from output.',
name: 'mdHideSources',
type: ParameterType.Boolean,
});
app.options.addDeclaration({
component: 'markdown',
defaultValue: 'github',
help: 'Markdown Plugin: (github|bitbucket|gitbook) Specifies the markdown rendering engine.',
name: 'mdEngine',
type: ParameterType.String,
});
app.options.addDeclaration({
component: 'markdown',
defaultValue: 'github',
help: 'Markdown Plugin: Deprectated - use --mdEngine.',
name: 'mdFlavour',
type: ParameterType.String,
});
app.options.addDeclaration({
component: 'markdown',
help: 'The repository to use for source files (ignored unless markdownFlavour is set)',
name: 'mdSourceRepo',
type: ParameterType.String,
});
/**
* Add the plugin to the converter instance
*/
app.converter.addComponent('markdown', MarkdownPlugin);
};
| import { Application } from 'typedoc/dist/lib/application';
import { ParameterType } from 'typedoc/dist/lib/utils/options/declaration';
import { MarkdownPlugin } from './plugin';
module.exports = (PluginHost: Application) => {
const app = PluginHost.owner;
if (app.converter.hasComponent('markdown')) {
return;
}
/**
* Expose additional options for consumption.
*/
app.options.addDeclaration({
component: 'markdown',
help: 'Markdown Plugin: Suppress file sources from output.',
name: 'mdHideSources',
type: ParameterType.Boolean,
});
app.options.addDeclaration({
component: 'markdown',
defaultValue: 'github',
help: 'Markdown Plugin: (github|bitbucket|gitbook) Specifies the markdown rendering engine.',
name: 'mdEngine',
type: ParameterType.String,
});
app.options.addDeclaration({
component: 'markdown',
defaultValue: 'github',
help: 'Markdown Plugin: Deprectated - use --mdEngine.',
name: 'mdFlavour',
type: ParameterType.String,
});
app.options.addDeclaration({
component: 'markdown',
help: 'The repository to use for source files (ignored unless markdownFlavour is set)',
name: 'mdSourceRepo',
type: ParameterType.String,
});
/**
* Add the plugin to the converter instance
*/
app.converter.addComponent('markdown', MarkdownPlugin);
};
| Check if plugin is already loaded before adding components | Check if plugin is already loaded before adding components
| TypeScript | mit | tgreyuk/typedoc-plugin-markdown,tgreyuk/typedoc-plugin-markdown | typescript | ## Code Before:
import { Application } from 'typedoc/dist/lib/application';
import { ParameterType } from 'typedoc/dist/lib/utils/options/declaration';
import { MarkdownPlugin } from './plugin';
module.exports = (PluginHost: Application) => {
const app = PluginHost.owner;
/**
* Expose additional options for consumption.
*/
app.options.addDeclaration({
component: 'markdown',
help: 'Markdown Plugin: Suppress file sources from output.',
name: 'mdHideSources',
type: ParameterType.Boolean,
});
app.options.addDeclaration({
component: 'markdown',
defaultValue: 'github',
help: 'Markdown Plugin: (github|bitbucket|gitbook) Specifies the markdown rendering engine.',
name: 'mdEngine',
type: ParameterType.String,
});
app.options.addDeclaration({
component: 'markdown',
defaultValue: 'github',
help: 'Markdown Plugin: Deprectated - use --mdEngine.',
name: 'mdFlavour',
type: ParameterType.String,
});
app.options.addDeclaration({
component: 'markdown',
help: 'The repository to use for source files (ignored unless markdownFlavour is set)',
name: 'mdSourceRepo',
type: ParameterType.String,
});
/**
* Add the plugin to the converter instance
*/
app.converter.addComponent('markdown', MarkdownPlugin);
};
## Instruction:
Check if plugin is already loaded before adding components
## Code After:
import { Application } from 'typedoc/dist/lib/application';
import { ParameterType } from 'typedoc/dist/lib/utils/options/declaration';
import { MarkdownPlugin } from './plugin';
module.exports = (PluginHost: Application) => {
const app = PluginHost.owner;
if (app.converter.hasComponent('markdown')) {
return;
}
/**
* Expose additional options for consumption.
*/
app.options.addDeclaration({
component: 'markdown',
help: 'Markdown Plugin: Suppress file sources from output.',
name: 'mdHideSources',
type: ParameterType.Boolean,
});
app.options.addDeclaration({
component: 'markdown',
defaultValue: 'github',
help: 'Markdown Plugin: (github|bitbucket|gitbook) Specifies the markdown rendering engine.',
name: 'mdEngine',
type: ParameterType.String,
});
app.options.addDeclaration({
component: 'markdown',
defaultValue: 'github',
help: 'Markdown Plugin: Deprectated - use --mdEngine.',
name: 'mdFlavour',
type: ParameterType.String,
});
app.options.addDeclaration({
component: 'markdown',
help: 'The repository to use for source files (ignored unless markdownFlavour is set)',
name: 'mdSourceRepo',
type: ParameterType.String,
});
/**
* Add the plugin to the converter instance
*/
app.converter.addComponent('markdown', MarkdownPlugin);
};
| import { Application } from 'typedoc/dist/lib/application';
import { ParameterType } from 'typedoc/dist/lib/utils/options/declaration';
import { MarkdownPlugin } from './plugin';
module.exports = (PluginHost: Application) => {
const app = PluginHost.owner;
+
+ if (app.converter.hasComponent('markdown')) {
+ return;
+ }
/**
* Expose additional options for consumption.
*/
app.options.addDeclaration({
component: 'markdown',
help: 'Markdown Plugin: Suppress file sources from output.',
name: 'mdHideSources',
type: ParameterType.Boolean,
});
app.options.addDeclaration({
component: 'markdown',
defaultValue: 'github',
help: 'Markdown Plugin: (github|bitbucket|gitbook) Specifies the markdown rendering engine.',
name: 'mdEngine',
type: ParameterType.String,
});
app.options.addDeclaration({
component: 'markdown',
defaultValue: 'github',
help: 'Markdown Plugin: Deprectated - use --mdEngine.',
name: 'mdFlavour',
type: ParameterType.String,
});
app.options.addDeclaration({
component: 'markdown',
help: 'The repository to use for source files (ignored unless markdownFlavour is set)',
name: 'mdSourceRepo',
type: ParameterType.String,
});
/**
* Add the plugin to the converter instance
*/
app.converter.addComponent('markdown', MarkdownPlugin);
}; | 4 | 0.085106 | 4 | 0 |
8a2f9ebd60568d33eb4f7bb8741a07dea6bef918 | Kitbot/src/Commands/SavePreferences.cpp | Kitbot/src/Commands/SavePreferences.cpp |
SavePreferences::SavePreferences()
{
}
// Called just before this Command runs the first time
void SavePreferences::Initialize()
{
Preferences::GetInstance()->Save();
}
// Called repeatedly when this Command is scheduled to run
void SavePreferences::Execute()
{
}
// Make this return true when this Command no longer needs to run execute()
bool SavePreferences::IsFinished()
{
return true;
}
// Called once after isFinished returns true
void SavePreferences::End()
{
}
// Called when another command which requires one or more of the same
// subsystems is scheduled to run
void SavePreferences::Interrupted()
{
End();
}
|
SavePreferences::SavePreferences()
{
this->SetRunWhenDisabled(true);
}
// Called just before this Command runs the first time
void SavePreferences::Initialize()
{
Preferences::GetInstance()->Save();
}
// Called repeatedly when this Command is scheduled to run
void SavePreferences::Execute()
{
}
// Make this return true when this Command no longer needs to run execute()
bool SavePreferences::IsFinished()
{
return true;
}
// Called once after isFinished returns true
void SavePreferences::End()
{
}
// Called when another command which requires one or more of the same
// subsystems is scheduled to run
void SavePreferences::Interrupted()
{
End();
}
| Save Prefs can run when disabled | Save Prefs can run when disabled
| C++ | apache-2.0 | team3130/Kitbot-2015 | c++ | ## Code Before:
SavePreferences::SavePreferences()
{
}
// Called just before this Command runs the first time
void SavePreferences::Initialize()
{
Preferences::GetInstance()->Save();
}
// Called repeatedly when this Command is scheduled to run
void SavePreferences::Execute()
{
}
// Make this return true when this Command no longer needs to run execute()
bool SavePreferences::IsFinished()
{
return true;
}
// Called once after isFinished returns true
void SavePreferences::End()
{
}
// Called when another command which requires one or more of the same
// subsystems is scheduled to run
void SavePreferences::Interrupted()
{
End();
}
## Instruction:
Save Prefs can run when disabled
## Code After:
SavePreferences::SavePreferences()
{
this->SetRunWhenDisabled(true);
}
// Called just before this Command runs the first time
void SavePreferences::Initialize()
{
Preferences::GetInstance()->Save();
}
// Called repeatedly when this Command is scheduled to run
void SavePreferences::Execute()
{
}
// Make this return true when this Command no longer needs to run execute()
bool SavePreferences::IsFinished()
{
return true;
}
// Called once after isFinished returns true
void SavePreferences::End()
{
}
// Called when another command which requires one or more of the same
// subsystems is scheduled to run
void SavePreferences::Interrupted()
{
End();
}
|
SavePreferences::SavePreferences()
{
+ this->SetRunWhenDisabled(true);
}
// Called just before this Command runs the first time
void SavePreferences::Initialize()
{
Preferences::GetInstance()->Save();
}
// Called repeatedly when this Command is scheduled to run
void SavePreferences::Execute()
{
}
// Make this return true when this Command no longer needs to run execute()
bool SavePreferences::IsFinished()
{
return true;
}
// Called once after isFinished returns true
void SavePreferences::End()
{
}
// Called when another command which requires one or more of the same
// subsystems is scheduled to run
void SavePreferences::Interrupted()
{
End();
} | 1 | 0.030303 | 1 | 0 |
6e219bff7d768f929b3eda4d89f3936cc646b262 | README.md | README.md | [](http://choosealicense.com/licenses/agpl-3.0/)
[](https://travis-ci.org/jleclanche/fireplace)
A Hearthstone simulator and implementation, written in Python.
### Requirements
* Python 3.4+
### Installation
* `pip install -r requirements.txt`
* `./bootstrap`
* (optional) `./setup.py install` to install as a library
### Documentation
The [Fireplace Wiki](https://github.com/jleclanche/fireplace/wiki) is the best
source of documentation, along with the actual code.
### License
Fireplace is licensed under the terms of the
[Affero GPLv3](https://www.gnu.org/licenses/agpl-3.0.en.html) or any later version.
### Community
Fireplace is a [HearthSim](http://hearthsim.info) project. All development
happens on our IRC channel `#hearthsim` on [Freenode](https://freenode.net).
| [](https://travis-ci.org/jleclanche/fireplace)
A Hearthstone simulator and implementation, written in Python.
### Requirements
* Python 3.4+
### Installation
* `pip install -r requirements.txt`
* `./bootstrap`
* (optional) `./setup.py install` to install as a library
### Documentation
The [Fireplace Wiki](https://github.com/jleclanche/fireplace/wiki) is the best
source of documentation, along with the actual code.
### License
[](http://choosealicense.com/licenses/agpl-3.0/)
Fireplace is licensed under the terms of the
[Affero GPLv3](https://www.gnu.org/licenses/agpl-3.0.en.html) or any later version.
### Community
Fireplace is a [HearthSim](http://hearthsim.info) project. All development
happens on our IRC channel `#hearthsim` on [Freenode](https://freenode.net).
| Move AGPLv3 logo to the LICENSE section | Move AGPLv3 logo to the LICENSE section
| Markdown | agpl-3.0 | beheh/fireplace,smallnamespace/fireplace,amw2104/fireplace,NightKev/fireplace,smallnamespace/fireplace,jleclanche/fireplace,amw2104/fireplace,Ragowit/fireplace,Ragowit/fireplace | markdown | ## Code Before:
[](http://choosealicense.com/licenses/agpl-3.0/)
[](https://travis-ci.org/jleclanche/fireplace)
A Hearthstone simulator and implementation, written in Python.
### Requirements
* Python 3.4+
### Installation
* `pip install -r requirements.txt`
* `./bootstrap`
* (optional) `./setup.py install` to install as a library
### Documentation
The [Fireplace Wiki](https://github.com/jleclanche/fireplace/wiki) is the best
source of documentation, along with the actual code.
### License
Fireplace is licensed under the terms of the
[Affero GPLv3](https://www.gnu.org/licenses/agpl-3.0.en.html) or any later version.
### Community
Fireplace is a [HearthSim](http://hearthsim.info) project. All development
happens on our IRC channel `#hearthsim` on [Freenode](https://freenode.net).
## Instruction:
Move AGPLv3 logo to the LICENSE section
## Code After:
[](https://travis-ci.org/jleclanche/fireplace)
A Hearthstone simulator and implementation, written in Python.
### Requirements
* Python 3.4+
### Installation
* `pip install -r requirements.txt`
* `./bootstrap`
* (optional) `./setup.py install` to install as a library
### Documentation
The [Fireplace Wiki](https://github.com/jleclanche/fireplace/wiki) is the best
source of documentation, along with the actual code.
### License
[](http://choosealicense.com/licenses/agpl-3.0/)
Fireplace is licensed under the terms of the
[Affero GPLv3](https://www.gnu.org/licenses/agpl-3.0.en.html) or any later version.
### Community
Fireplace is a [HearthSim](http://hearthsim.info) project. All development
happens on our IRC channel `#hearthsim` on [Freenode](https://freenode.net).
| - [](http://choosealicense.com/licenses/agpl-3.0/)
[](https://travis-ci.org/jleclanche/fireplace)
A Hearthstone simulator and implementation, written in Python.
### Requirements
* Python 3.4+
### Installation
* `pip install -r requirements.txt`
* `./bootstrap`
* (optional) `./setup.py install` to install as a library
### Documentation
The [Fireplace Wiki](https://github.com/jleclanche/fireplace/wiki) is the best
source of documentation, along with the actual code.
### License
+ [](http://choosealicense.com/licenses/agpl-3.0/)
+
Fireplace is licensed under the terms of the
[Affero GPLv3](https://www.gnu.org/licenses/agpl-3.0.en.html) or any later version.
### Community
Fireplace is a [HearthSim](http://hearthsim.info) project. All development
happens on our IRC channel `#hearthsim` on [Freenode](https://freenode.net). | 3 | 0.103448 | 2 | 1 |
2f593f1581eaa4ec30c1a73a71bc8e0a52284441 | setup.py | setup.py | from setuptools import setup
setup(
name='armstrong.base',
version='0.1.2',
description='Base functionality that needs to be shared widely',
author='Texas Tribune',
author_email='tech@texastribune.org',
url='http://github.com/texastribune/armstrong.base/',
packages=[
'armstrong.base',
'armstrong.base.templatetags',
'armstrong.base.tests',
],
namespace_packages=[
"armstrong",
],
install_requires=[
'setuptools',
],
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
],
)
| from setuptools import setup
setup(
name='armstrong.base',
version='0.1.3',
description='Base functionality that needs to be shared widely',
author='Texas Tribune',
author_email='tech@texastribune.org',
url='http://github.com/texastribune/armstrong.base/',
packages=[
'armstrong.base',
'armstrong.base.templatetags',
'armstrong.base.tests',
'armstrong.base.tests.templatetags',
],
namespace_packages=[
"armstrong",
],
install_requires=[
'setuptools',
],
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
],
)
| Install missing templatetags test package | Install missing templatetags test package
| Python | bsd-3-clause | texastribune/armstrong.base | python | ## Code Before:
from setuptools import setup
setup(
name='armstrong.base',
version='0.1.2',
description='Base functionality that needs to be shared widely',
author='Texas Tribune',
author_email='tech@texastribune.org',
url='http://github.com/texastribune/armstrong.base/',
packages=[
'armstrong.base',
'armstrong.base.templatetags',
'armstrong.base.tests',
],
namespace_packages=[
"armstrong",
],
install_requires=[
'setuptools',
],
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
],
)
## Instruction:
Install missing templatetags test package
## Code After:
from setuptools import setup
setup(
name='armstrong.base',
version='0.1.3',
description='Base functionality that needs to be shared widely',
author='Texas Tribune',
author_email='tech@texastribune.org',
url='http://github.com/texastribune/armstrong.base/',
packages=[
'armstrong.base',
'armstrong.base.templatetags',
'armstrong.base.tests',
'armstrong.base.tests.templatetags',
],
namespace_packages=[
"armstrong",
],
install_requires=[
'setuptools',
],
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
],
)
| from setuptools import setup
setup(
name='armstrong.base',
- version='0.1.2',
? ^
+ version='0.1.3',
? ^
description='Base functionality that needs to be shared widely',
author='Texas Tribune',
author_email='tech@texastribune.org',
url='http://github.com/texastribune/armstrong.base/',
packages=[
'armstrong.base',
'armstrong.base.templatetags',
'armstrong.base.tests',
+ 'armstrong.base.tests.templatetags',
],
namespace_packages=[
"armstrong",
],
install_requires=[
'setuptools',
],
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
],
) | 3 | 0.096774 | 2 | 1 |
236f37f0c3c5f237c764d9209d6922530509a7e7 | contact/index.html | contact/index.html | ---
layout: root
title: Contact me
---
<div class="text-center contact-field">
<p>Yes, you can contact me.</p>
<table>
<tr>
<td><a target="_blank" href="https://twitter.com/_le717"><span class="ion ion-social-twitter contact-twitter"></span></a></td>
<td><a target="_blank" href="{{ site.wpurl }}/contact"><span class="ion ion-social-wordpress contact-wp"></span></a></td>
<td><a target="_blank" href="{{ site.github.owner_url }}/feedback#readme"><span class="ion ion-social-github contact-gh"></span></a></td>
<td><a target="_blank" href="http://www.youtube.com/user/Triangle717"><span class="ion ion-social-youtube contact-yt"></span></a></td>
<td>{% include contact.html %}<span class="ion ion-android-mail contact-email"></span></a></td>
</tr>
</table>
</div>
| ---
layout: root
title: Contact me
---
<div class="text-center contact-field">
<p>Yes, you can contact me.</p>
<table>
<tr>
<td><a target="_blank" href="https://twitter.com/_le717"><span class="ion ion-social-twitter contact-twitter"></span></a></td>
<td><a target="_blank" href="{{ site.wpurl }}/contact"><span class="ion ion-social-wordpress contact-wp"></span></a></td>
<td><a target="_blank" href="http://www.youtube.com/user/Triangle717"><span class="ion ion-social-youtube contact-yt"></span></a></td>
<td>{% include contact.html %}<span class="ion ion-android-mail contact-email"></span></a></td>
</tr>
</table>
</div>
| Remove GitHub from Contact page | Remove GitHub from Contact page | HTML | mit | le717/le717.github.io | html | ## Code Before:
---
layout: root
title: Contact me
---
<div class="text-center contact-field">
<p>Yes, you can contact me.</p>
<table>
<tr>
<td><a target="_blank" href="https://twitter.com/_le717"><span class="ion ion-social-twitter contact-twitter"></span></a></td>
<td><a target="_blank" href="{{ site.wpurl }}/contact"><span class="ion ion-social-wordpress contact-wp"></span></a></td>
<td><a target="_blank" href="{{ site.github.owner_url }}/feedback#readme"><span class="ion ion-social-github contact-gh"></span></a></td>
<td><a target="_blank" href="http://www.youtube.com/user/Triangle717"><span class="ion ion-social-youtube contact-yt"></span></a></td>
<td>{% include contact.html %}<span class="ion ion-android-mail contact-email"></span></a></td>
</tr>
</table>
</div>
## Instruction:
Remove GitHub from Contact page
## Code After:
---
layout: root
title: Contact me
---
<div class="text-center contact-field">
<p>Yes, you can contact me.</p>
<table>
<tr>
<td><a target="_blank" href="https://twitter.com/_le717"><span class="ion ion-social-twitter contact-twitter"></span></a></td>
<td><a target="_blank" href="{{ site.wpurl }}/contact"><span class="ion ion-social-wordpress contact-wp"></span></a></td>
<td><a target="_blank" href="http://www.youtube.com/user/Triangle717"><span class="ion ion-social-youtube contact-yt"></span></a></td>
<td>{% include contact.html %}<span class="ion ion-android-mail contact-email"></span></a></td>
</tr>
</table>
</div>
| ---
layout: root
title: Contact me
---
<div class="text-center contact-field">
<p>Yes, you can contact me.</p>
<table>
<tr>
<td><a target="_blank" href="https://twitter.com/_le717"><span class="ion ion-social-twitter contact-twitter"></span></a></td>
<td><a target="_blank" href="{{ site.wpurl }}/contact"><span class="ion ion-social-wordpress contact-wp"></span></a></td>
- <td><a target="_blank" href="{{ site.github.owner_url }}/feedback#readme"><span class="ion ion-social-github contact-gh"></span></a></td>
<td><a target="_blank" href="http://www.youtube.com/user/Triangle717"><span class="ion ion-social-youtube contact-yt"></span></a></td>
<td>{% include contact.html %}<span class="ion ion-android-mail contact-email"></span></a></td>
</tr>
</table>
</div> | 1 | 0.0625 | 0 | 1 |
d8c7be1d116a3d02aa2712c579df4f9ddfd5e3cc | st2common/in-requirements.txt | st2common/in-requirements.txt | apscheduler
python-dateutil
eventlet
jinja2
jsonschema
kombu
mongoengine
networkx
oslo.config
paramiko
pyyaml
pymongo
python-keyczar
requests
retrying
semver
six
tooz
# Required by tooz - on new versions of tooz, all the backend dependencies need
# to be installed manually
zake
ipaddr
# Note: our fork of entrypoints contains a fix for backports mess
git+https://github.com/Kami/entrypoints.git@dont_use_backports#egg=entrypoints
routes
flex
webob
prance
| apscheduler
python-dateutil
eventlet
jinja2
jsonschema
kombu
mongoengine
networkx
oslo.config
paramiko
pyyaml
pymongo
python-keyczar
requests
retrying
semver
six
tooz
# Required by tooz - on new versions of tooz, all the backend dependencies need
# to be installed manually
zake
ipaddr
# Note: our fork of entrypoints contains a fix for backports mess
git+https://github.com/Kami/entrypoints.git@dont_use_backports#egg=entrypoints
routes
flex
webob
prance
jsonpath-rw
| Add missing jsonpath-rw to st2common in requirements. | Add missing jsonpath-rw to st2common in requirements.
| Text | apache-2.0 | StackStorm/st2,StackStorm/st2,nzlosh/st2,Plexxi/st2,Plexxi/st2,Plexxi/st2,nzlosh/st2,nzlosh/st2,StackStorm/st2,StackStorm/st2,Plexxi/st2,nzlosh/st2 | text | ## Code Before:
apscheduler
python-dateutil
eventlet
jinja2
jsonschema
kombu
mongoengine
networkx
oslo.config
paramiko
pyyaml
pymongo
python-keyczar
requests
retrying
semver
six
tooz
# Required by tooz - on new versions of tooz, all the backend dependencies need
# to be installed manually
zake
ipaddr
# Note: our fork of entrypoints contains a fix for backports mess
git+https://github.com/Kami/entrypoints.git@dont_use_backports#egg=entrypoints
routes
flex
webob
prance
## Instruction:
Add missing jsonpath-rw to st2common in requirements.
## Code After:
apscheduler
python-dateutil
eventlet
jinja2
jsonschema
kombu
mongoengine
networkx
oslo.config
paramiko
pyyaml
pymongo
python-keyczar
requests
retrying
semver
six
tooz
# Required by tooz - on new versions of tooz, all the backend dependencies need
# to be installed manually
zake
ipaddr
# Note: our fork of entrypoints contains a fix for backports mess
git+https://github.com/Kami/entrypoints.git@dont_use_backports#egg=entrypoints
routes
flex
webob
prance
jsonpath-rw
| apscheduler
python-dateutil
eventlet
jinja2
jsonschema
kombu
mongoengine
networkx
oslo.config
paramiko
pyyaml
pymongo
python-keyczar
requests
retrying
semver
six
tooz
# Required by tooz - on new versions of tooz, all the backend dependencies need
# to be installed manually
zake
ipaddr
# Note: our fork of entrypoints contains a fix for backports mess
git+https://github.com/Kami/entrypoints.git@dont_use_backports#egg=entrypoints
routes
flex
webob
prance
+ jsonpath-rw | 1 | 0.035714 | 1 | 0 |
1ccd7a86064e14f4f19292961fadb04c0e1f0d24 | src/main/java/ch/tkuhn/nanopub/validator/DownloadTrustyResource.java | src/main/java/ch/tkuhn/nanopub/validator/DownloadTrustyResource.java | package ch.tkuhn.nanopub.validator;
import org.apache.wicket.request.http.WebResponse;
import org.apache.wicket.request.resource.IResource;
import org.nanopub.Nanopub;
import org.nanopub.NanopubUtils;
import org.openrdf.rio.RDFFormat;
import net.trustyuri.rdf.TransformNanopub;
public class DownloadTrustyResource implements IResource {
private static final long serialVersionUID = -4558302923207618223L;
private RDFFormat format;
private ValidatorPage mainPage;
public DownloadTrustyResource(RDFFormat format, ValidatorPage mainPage) {
this.format = format;
this.mainPage = mainPage;
}
@Override
public void respond(Attributes attributes) {
if (mainPage.getNanopub() == null) return;
WebResponse resp = (WebResponse) attributes.getResponse();
resp.setContentType(format.getMIMETypes().get(0));
resp.setAttachmentHeader("nanopub." + format.getDefaultFileExtension());
try {
Nanopub np = mainPage.getNanopub();
Nanopub trustyNp = TransformNanopub.transform(np, np.getUri().toString());
NanopubUtils.writeToStream(trustyNp, resp.getOutputStream(), format);
} catch (Exception ex) {
ex.printStackTrace();
}
resp.close();
}
}
| package ch.tkuhn.nanopub.validator;
import org.apache.wicket.request.http.WebResponse;
import org.apache.wicket.request.resource.IResource;
import org.nanopub.Nanopub;
import org.nanopub.NanopubUtils;
import org.openrdf.rio.RDFFormat;
import net.trustyuri.rdf.TransformNanopub;
public class DownloadTrustyResource implements IResource {
private static final long serialVersionUID = -4558302923207618223L;
private RDFFormat format;
private ValidatorPage mainPage;
public DownloadTrustyResource(RDFFormat format, ValidatorPage mainPage) {
this.format = format;
this.mainPage = mainPage;
}
@Override
public void respond(Attributes attributes) {
if (mainPage.getNanopub() == null) return;
WebResponse resp = (WebResponse) attributes.getResponse();
resp.setContentType(format.getMIMETypes().get(0));
resp.setAttachmentHeader("nanopub." + format.getDefaultFileExtension());
try {
Nanopub np = mainPage.getNanopub();
Nanopub trustyNp = TransformNanopub.transform(np);
NanopubUtils.writeToStream(trustyNp, resp.getOutputStream(), format);
} catch (Exception ex) {
ex.printStackTrace();
}
resp.close();
}
}
| Update to latest version of trusty-URI | Update to latest version of trusty-URI | Java | mit | tkuhn/nanopub-validator,tkuhn/nanopub-validator | java | ## Code Before:
package ch.tkuhn.nanopub.validator;
import org.apache.wicket.request.http.WebResponse;
import org.apache.wicket.request.resource.IResource;
import org.nanopub.Nanopub;
import org.nanopub.NanopubUtils;
import org.openrdf.rio.RDFFormat;
import net.trustyuri.rdf.TransformNanopub;
public class DownloadTrustyResource implements IResource {
private static final long serialVersionUID = -4558302923207618223L;
private RDFFormat format;
private ValidatorPage mainPage;
public DownloadTrustyResource(RDFFormat format, ValidatorPage mainPage) {
this.format = format;
this.mainPage = mainPage;
}
@Override
public void respond(Attributes attributes) {
if (mainPage.getNanopub() == null) return;
WebResponse resp = (WebResponse) attributes.getResponse();
resp.setContentType(format.getMIMETypes().get(0));
resp.setAttachmentHeader("nanopub." + format.getDefaultFileExtension());
try {
Nanopub np = mainPage.getNanopub();
Nanopub trustyNp = TransformNanopub.transform(np, np.getUri().toString());
NanopubUtils.writeToStream(trustyNp, resp.getOutputStream(), format);
} catch (Exception ex) {
ex.printStackTrace();
}
resp.close();
}
}
## Instruction:
Update to latest version of trusty-URI
## Code After:
package ch.tkuhn.nanopub.validator;
import org.apache.wicket.request.http.WebResponse;
import org.apache.wicket.request.resource.IResource;
import org.nanopub.Nanopub;
import org.nanopub.NanopubUtils;
import org.openrdf.rio.RDFFormat;
import net.trustyuri.rdf.TransformNanopub;
public class DownloadTrustyResource implements IResource {
private static final long serialVersionUID = -4558302923207618223L;
private RDFFormat format;
private ValidatorPage mainPage;
public DownloadTrustyResource(RDFFormat format, ValidatorPage mainPage) {
this.format = format;
this.mainPage = mainPage;
}
@Override
public void respond(Attributes attributes) {
if (mainPage.getNanopub() == null) return;
WebResponse resp = (WebResponse) attributes.getResponse();
resp.setContentType(format.getMIMETypes().get(0));
resp.setAttachmentHeader("nanopub." + format.getDefaultFileExtension());
try {
Nanopub np = mainPage.getNanopub();
Nanopub trustyNp = TransformNanopub.transform(np);
NanopubUtils.writeToStream(trustyNp, resp.getOutputStream(), format);
} catch (Exception ex) {
ex.printStackTrace();
}
resp.close();
}
}
| package ch.tkuhn.nanopub.validator;
import org.apache.wicket.request.http.WebResponse;
import org.apache.wicket.request.resource.IResource;
import org.nanopub.Nanopub;
import org.nanopub.NanopubUtils;
import org.openrdf.rio.RDFFormat;
import net.trustyuri.rdf.TransformNanopub;
public class DownloadTrustyResource implements IResource {
private static final long serialVersionUID = -4558302923207618223L;
private RDFFormat format;
private ValidatorPage mainPage;
public DownloadTrustyResource(RDFFormat format, ValidatorPage mainPage) {
this.format = format;
this.mainPage = mainPage;
}
@Override
public void respond(Attributes attributes) {
if (mainPage.getNanopub() == null) return;
WebResponse resp = (WebResponse) attributes.getResponse();
resp.setContentType(format.getMIMETypes().get(0));
resp.setAttachmentHeader("nanopub." + format.getDefaultFileExtension());
try {
Nanopub np = mainPage.getNanopub();
- Nanopub trustyNp = TransformNanopub.transform(np, np.getUri().toString());
? ------------------------
+ Nanopub trustyNp = TransformNanopub.transform(np);
NanopubUtils.writeToStream(trustyNp, resp.getOutputStream(), format);
} catch (Exception ex) {
ex.printStackTrace();
}
resp.close();
}
} | 2 | 0.051282 | 1 | 1 |
98d2a1f56370efad5e48f829e1b3e77b1b2baea1 | client/src/components/UpgradeNotification/index.js | client/src/components/UpgradeNotification/index.js | import { versionOutOfDate } from '../../utils/version';
const initUpgradeNotification = () => {
const container = document.querySelector('[data-upgrade]');
if (!container) {
return;
}
/*
* Expected JSON payload:
* {
* "version" : "1.2.3", // Version number. Can only contain numbers and decimal point.
* "url" : "https://wagtail.io" // Absolute URL to page/file containing release notes or actual package. It's up to you.
* }
*/
const releasesUrl = 'https://releases.wagtail.io/latest.txt';
const currentVersion = container.dataset.wagtailVersion;
fetch(releasesUrl).then(response => {
if (response.status !== 200) {
// eslint-disable-next-line no-console
console.log(`Unexpected response from ${releasesUrl}. Status: ${response.status}`);
return false;
}
return response.json();
}).then(data => {
if (data && data.version && versionOutOfDate(data.version, currentVersion)) {
container.querySelector('[data-upgrade-version]').innerText = data.version;
container.querySelector('[data-upgrade-link]').setAttribute('href', data.url);
container.style.display = '';
}
})
.catch(err => {
// eslint-disable-next-line no-console
console.log(`Error fetching ${releasesUrl}. Error: ${err}`);
});
};
export { initUpgradeNotification };
| import { versionOutOfDate } from '../../utils/version';
const initUpgradeNotification = () => {
const container = document.querySelector('[data-upgrade]');
if (!container) {
return;
}
/*
* Expected JSON payload:
* {
* "version" : "1.2.3", // Version number. Can only contain numbers and decimal point.
* "url" : "https://wagtail.io" // Absolute URL to page/file containing release notes or actual package. It's up to you.
* }
*/
const releasesUrl = 'https://releases.wagtail.io/latest.txt';
const currentVersion = container.dataset.wagtailVersion;
fetch(releasesUrl, {
referrerPolicy: 'strict-origin-when-cross-origin',
}).then(response => {
if (response.status !== 200) {
// eslint-disable-next-line no-console
console.log(`Unexpected response from ${releasesUrl}. Status: ${response.status}`);
return false;
}
return response.json();
}).then(data => {
if (data && data.version && versionOutOfDate(data.version, currentVersion)) {
container.querySelector('[data-upgrade-version]').innerText = data.version;
container.querySelector('[data-upgrade-link]').setAttribute('href', data.url);
container.style.display = '';
}
})
.catch(err => {
// eslint-disable-next-line no-console
console.log(`Error fetching ${releasesUrl}. Error: ${err}`);
});
};
export { initUpgradeNotification };
| Set referer policy of upgrade notifcation to "strict-origin-when-cross-origin" | Set referer policy of upgrade notifcation to "strict-origin-when-cross-origin"
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy
- Since Django 3.1, all Wagtail admin responses have been given a referer-policy: same-origin header. See: https://chipcullen.com/django-3-referrer-policy-change/
- #8560
| JavaScript | bsd-3-clause | torchbox/wagtail,torchbox/wagtail,torchbox/wagtail,torchbox/wagtail | javascript | ## Code Before:
import { versionOutOfDate } from '../../utils/version';
const initUpgradeNotification = () => {
const container = document.querySelector('[data-upgrade]');
if (!container) {
return;
}
/*
* Expected JSON payload:
* {
* "version" : "1.2.3", // Version number. Can only contain numbers and decimal point.
* "url" : "https://wagtail.io" // Absolute URL to page/file containing release notes or actual package. It's up to you.
* }
*/
const releasesUrl = 'https://releases.wagtail.io/latest.txt';
const currentVersion = container.dataset.wagtailVersion;
fetch(releasesUrl).then(response => {
if (response.status !== 200) {
// eslint-disable-next-line no-console
console.log(`Unexpected response from ${releasesUrl}. Status: ${response.status}`);
return false;
}
return response.json();
}).then(data => {
if (data && data.version && versionOutOfDate(data.version, currentVersion)) {
container.querySelector('[data-upgrade-version]').innerText = data.version;
container.querySelector('[data-upgrade-link]').setAttribute('href', data.url);
container.style.display = '';
}
})
.catch(err => {
// eslint-disable-next-line no-console
console.log(`Error fetching ${releasesUrl}. Error: ${err}`);
});
};
export { initUpgradeNotification };
## Instruction:
Set referer policy of upgrade notifcation to "strict-origin-when-cross-origin"
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy
- Since Django 3.1, all Wagtail admin responses have been given a referer-policy: same-origin header. See: https://chipcullen.com/django-3-referrer-policy-change/
- #8560
## Code After:
import { versionOutOfDate } from '../../utils/version';
const initUpgradeNotification = () => {
const container = document.querySelector('[data-upgrade]');
if (!container) {
return;
}
/*
* Expected JSON payload:
* {
* "version" : "1.2.3", // Version number. Can only contain numbers and decimal point.
* "url" : "https://wagtail.io" // Absolute URL to page/file containing release notes or actual package. It's up to you.
* }
*/
const releasesUrl = 'https://releases.wagtail.io/latest.txt';
const currentVersion = container.dataset.wagtailVersion;
fetch(releasesUrl, {
referrerPolicy: 'strict-origin-when-cross-origin',
}).then(response => {
if (response.status !== 200) {
// eslint-disable-next-line no-console
console.log(`Unexpected response from ${releasesUrl}. Status: ${response.status}`);
return false;
}
return response.json();
}).then(data => {
if (data && data.version && versionOutOfDate(data.version, currentVersion)) {
container.querySelector('[data-upgrade-version]').innerText = data.version;
container.querySelector('[data-upgrade-link]').setAttribute('href', data.url);
container.style.display = '';
}
})
.catch(err => {
// eslint-disable-next-line no-console
console.log(`Error fetching ${releasesUrl}. Error: ${err}`);
});
};
export { initUpgradeNotification };
| import { versionOutOfDate } from '../../utils/version';
const initUpgradeNotification = () => {
const container = document.querySelector('[data-upgrade]');
if (!container) {
return;
}
/*
* Expected JSON payload:
* {
* "version" : "1.2.3", // Version number. Can only contain numbers and decimal point.
* "url" : "https://wagtail.io" // Absolute URL to page/file containing release notes or actual package. It's up to you.
* }
*/
const releasesUrl = 'https://releases.wagtail.io/latest.txt';
const currentVersion = container.dataset.wagtailVersion;
- fetch(releasesUrl).then(response => {
+ fetch(releasesUrl, {
+ referrerPolicy: 'strict-origin-when-cross-origin',
+ }).then(response => {
if (response.status !== 200) {
// eslint-disable-next-line no-console
console.log(`Unexpected response from ${releasesUrl}. Status: ${response.status}`);
return false;
}
return response.json();
}).then(data => {
if (data && data.version && versionOutOfDate(data.version, currentVersion)) {
container.querySelector('[data-upgrade-version]').innerText = data.version;
container.querySelector('[data-upgrade-link]').setAttribute('href', data.url);
container.style.display = '';
}
})
.catch(err => {
// eslint-disable-next-line no-console
console.log(`Error fetching ${releasesUrl}. Error: ${err}`);
});
};
export { initUpgradeNotification }; | 4 | 0.1 | 3 | 1 |
f1068da3a8188e083724a246f1bd6c6d0a866aed | src/client/web/counter/index.js | src/client/web/counter/index.js | import React, { PropTypes as RPT, Component } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import * as counterActions from '../../common/counter/actions';
@connect(
(state) => {
const counter = state.counter.counter;
return { counter };
},
(dispatch) => {
const actions = bindActionCreators(counterActions, dispatch);
return { actions };
}
)
export default class Counter extends Component {
static propTypes = {
counter: RPT.number,
actions: RPT.object
}
render() {
const { actions } = this.props;
return (
<div>
<h2>Counter: {this.props.counter}</h2>
<button onClick={actions.increment}>inc</button>
<button onClick={actions.decrement}>dec</button>
<button onClick={actions.magicAction2}>asyncss</button>
</div>
);
}
}
| import * as counterActions from '../../common/counter/actions';
import React, { PropTypes as RPT } from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
function Counter(props) {
const { actions, counter } = props;
return (
<div>
<h2>Counter: {counter}</h2>
<button onClick={actions.increment}>inc</button>
<button onClick={actions.decrement}>dec</button>
<button onClick={actions.magicAction2}>asyncss</button>
</div>
);
}
Counter.propTypes = {
counter: RPT.number,
actions: RPT.object
};
export default connect(
(state) => {
const counter = state.counter.counter;
return { counter };
},
(dispatch) => {
const actions = bindActionCreators(counterActions, dispatch);
return { actions };
}
)(Counter);
| Use stateless function instead of class for counter implementation | Use stateless function instead of class for counter implementation
| JavaScript | mit | sljuka/bizflow-ui,sljuka/bizflow-ui | javascript | ## Code Before:
import React, { PropTypes as RPT, Component } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import * as counterActions from '../../common/counter/actions';
@connect(
(state) => {
const counter = state.counter.counter;
return { counter };
},
(dispatch) => {
const actions = bindActionCreators(counterActions, dispatch);
return { actions };
}
)
export default class Counter extends Component {
static propTypes = {
counter: RPT.number,
actions: RPT.object
}
render() {
const { actions } = this.props;
return (
<div>
<h2>Counter: {this.props.counter}</h2>
<button onClick={actions.increment}>inc</button>
<button onClick={actions.decrement}>dec</button>
<button onClick={actions.magicAction2}>asyncss</button>
</div>
);
}
}
## Instruction:
Use stateless function instead of class for counter implementation
## Code After:
import * as counterActions from '../../common/counter/actions';
import React, { PropTypes as RPT } from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
function Counter(props) {
const { actions, counter } = props;
return (
<div>
<h2>Counter: {counter}</h2>
<button onClick={actions.increment}>inc</button>
<button onClick={actions.decrement}>dec</button>
<button onClick={actions.magicAction2}>asyncss</button>
</div>
);
}
Counter.propTypes = {
counter: RPT.number,
actions: RPT.object
};
export default connect(
(state) => {
const counter = state.counter.counter;
return { counter };
},
(dispatch) => {
const actions = bindActionCreators(counterActions, dispatch);
return { actions };
}
)(Counter);
| + import * as counterActions from '../../common/counter/actions';
- import React, { PropTypes as RPT, Component } from 'react';
? -----------
+ import React, { PropTypes as RPT } from 'react';
+ import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
- import { bindActionCreators } from 'redux';
- import * as counterActions from '../../common/counter/actions';
- @connect(
+ function Counter(props) {
+ const { actions, counter } = props;
+
+ return (
+ <div>
+ <h2>Counter: {counter}</h2>
+ <button onClick={actions.increment}>inc</button>
+ <button onClick={actions.decrement}>dec</button>
+ <button onClick={actions.magicAction2}>asyncss</button>
+ </div>
+ );
+ }
+
+ Counter.propTypes = {
+ counter: RPT.number,
+ actions: RPT.object
+ };
+
+ export default connect(
(state) => {
const counter = state.counter.counter;
+
return { counter };
},
(dispatch) => {
const actions = bindActionCreators(counterActions, dispatch);
+
return { actions };
}
+ )(Counter);
- )
- export default class Counter extends Component {
-
- static propTypes = {
- counter: RPT.number,
- actions: RPT.object
- }
-
- render() {
- const { actions } = this.props;
-
- return (
- <div>
- <h2>Counter: {this.props.counter}</h2>
- <button onClick={actions.increment}>inc</button>
- <button onClick={actions.decrement}>dec</button>
- <button onClick={actions.magicAction2}>asyncss</button>
- </div>
- );
- }
- } | 50 | 1.428571 | 25 | 25 |
07fabcc0fa08d95ec5f17f5cbfcd0c14b645f31c | child_compassion/migrations/11.0.1.0.0/post-migration.py | child_compassion/migrations/11.0.1.0.0/post-migration.py | from openupgradelib import openupgrade
from odoo.addons.child_compassion import load_mappings
@openupgrade.migrate(use_env=True)
def migrate(env, version):
if not version:
return
load_mappings(env.cr, env)
| from openupgradelib import openupgrade
from odoo.addons.child_compassion import load_mappings
@openupgrade.migrate(use_env=True)
def migrate(env, version):
if not version:
return
load_mappings(env.cr, env)
# Add sponsorship group to everyone
sponsorship_group = env.ref('child_compassion.group_sponsorship')
env['res.users'].search([
('internal', '=', True),
('email', 'ilike', 'compassion.ch')
]).write({
'groups_id': [(4, sponsorship_group.id)]
})
# Add admin groups
sponsorship_manager_group = env.ref('child_compassion.group_manager')
gmc_manager_group = env.ref('message_center_compassion.group_gmc_manager')
env['res.users'].search([
('login', 'in', ['ecino', 'dwulliamoz', 'seicher', 'admin']),
]).write({
'groups_id': [(4, sponsorship_manager_group.id), (4, gmc_manager_group.id)]
})
| Add migration for assigning security groups | Add migration for assigning security groups
| Python | agpl-3.0 | CompassionCH/compassion-modules,CompassionCH/compassion-modules,CompassionCH/compassion-modules,CompassionCH/compassion-modules | python | ## Code Before:
from openupgradelib import openupgrade
from odoo.addons.child_compassion import load_mappings
@openupgrade.migrate(use_env=True)
def migrate(env, version):
if not version:
return
load_mappings(env.cr, env)
## Instruction:
Add migration for assigning security groups
## Code After:
from openupgradelib import openupgrade
from odoo.addons.child_compassion import load_mappings
@openupgrade.migrate(use_env=True)
def migrate(env, version):
if not version:
return
load_mappings(env.cr, env)
# Add sponsorship group to everyone
sponsorship_group = env.ref('child_compassion.group_sponsorship')
env['res.users'].search([
('internal', '=', True),
('email', 'ilike', 'compassion.ch')
]).write({
'groups_id': [(4, sponsorship_group.id)]
})
# Add admin groups
sponsorship_manager_group = env.ref('child_compassion.group_manager')
gmc_manager_group = env.ref('message_center_compassion.group_gmc_manager')
env['res.users'].search([
('login', 'in', ['ecino', 'dwulliamoz', 'seicher', 'admin']),
]).write({
'groups_id': [(4, sponsorship_manager_group.id), (4, gmc_manager_group.id)]
})
| from openupgradelib import openupgrade
from odoo.addons.child_compassion import load_mappings
@openupgrade.migrate(use_env=True)
def migrate(env, version):
if not version:
return
load_mappings(env.cr, env)
+
+ # Add sponsorship group to everyone
+ sponsorship_group = env.ref('child_compassion.group_sponsorship')
+ env['res.users'].search([
+ ('internal', '=', True),
+ ('email', 'ilike', 'compassion.ch')
+ ]).write({
+ 'groups_id': [(4, sponsorship_group.id)]
+ })
+ # Add admin groups
+ sponsorship_manager_group = env.ref('child_compassion.group_manager')
+ gmc_manager_group = env.ref('message_center_compassion.group_gmc_manager')
+ env['res.users'].search([
+ ('login', 'in', ['ecino', 'dwulliamoz', 'seicher', 'admin']),
+ ]).write({
+ 'groups_id': [(4, sponsorship_manager_group.id), (4, gmc_manager_group.id)]
+ }) | 17 | 1.545455 | 17 | 0 |
c9f9b126a924710487890a2a5fc4bb3cfbb60622 | tests/Dojo/ExampleTest.php | tests/Dojo/ExampleTest.php | <?php
use Dojo\Example;
use PHPUnit\Framework\TestCase;
class ExampleTest extends TestCase
{
public function testRandom()
{
$object = new Example();
$this->assertEquals(4, $object->random());
}
}
| <?php
use Dojo\Example;
use PHPUnit\Framework\TestCase;
class ExampleTest extends TestCase
{
// This method will be called *before* each test run.
public function setUp() {}
// This method will be called *after* each test run.
public function tearDown() {}
public function testRandom()
{
$object = new Example();
$this->assertEquals(4, $object->random());
}
}
| Add setUp and tearDown to test example | Add setUp and tearDown to test example | PHP | mit | pawel-lewtak/coding-dojo-template | php | ## Code Before:
<?php
use Dojo\Example;
use PHPUnit\Framework\TestCase;
class ExampleTest extends TestCase
{
public function testRandom()
{
$object = new Example();
$this->assertEquals(4, $object->random());
}
}
## Instruction:
Add setUp and tearDown to test example
## Code After:
<?php
use Dojo\Example;
use PHPUnit\Framework\TestCase;
class ExampleTest extends TestCase
{
// This method will be called *before* each test run.
public function setUp() {}
// This method will be called *after* each test run.
public function tearDown() {}
public function testRandom()
{
$object = new Example();
$this->assertEquals(4, $object->random());
}
}
| <?php
use Dojo\Example;
use PHPUnit\Framework\TestCase;
class ExampleTest extends TestCase
{
+ // This method will be called *before* each test run.
+ public function setUp() {}
+
+ // This method will be called *after* each test run.
+ public function tearDown() {}
+
public function testRandom()
{
$object = new Example();
$this->assertEquals(4, $object->random());
}
} | 6 | 0.461538 | 6 | 0 |
1f19be25ea40cf5a61224257dafea2d055d0d99b | README.md | README.md | A Secure Image Encryption Algorithm Based on Rubik's Cube Principle
##Examples
###Original Image

###Encrypted Image

###Decrypted Image

###Original Image

###Encrypted Image

###Decrypted Image

###Original Image

###Encrypted Image

###Decrypted Image

| A Secure Image Encryption Algorithm Based on Rubik's Cube Principle
Note: The output is written as PNG files to achieve losslessness
##Examples
###Original Image

###Encrypted Image

###Decrypted Image

###Original Image

###Encrypted Image

###Decrypted Image

###Original Image

###Encrypted Image

###Decrypted Image

| Write image as png to achieve losslessness | Write image as png to achieve losslessness
| Markdown | mit | pandu1990/Secure-Image-Encryption-Algorithm | markdown | ## Code Before:
A Secure Image Encryption Algorithm Based on Rubik's Cube Principle
##Examples
###Original Image

###Encrypted Image

###Decrypted Image

###Original Image

###Encrypted Image

###Decrypted Image

###Original Image

###Encrypted Image

###Decrypted Image

## Instruction:
Write image as png to achieve losslessness
## Code After:
A Secure Image Encryption Algorithm Based on Rubik's Cube Principle
Note: The output is written as PNG files to achieve losslessness
##Examples
###Original Image

###Encrypted Image

###Decrypted Image

###Original Image

###Encrypted Image

###Decrypted Image

###Original Image

###Encrypted Image

###Decrypted Image

| A Secure Image Encryption Algorithm Based on Rubik's Cube Principle
+
+ Note: The output is written as PNG files to achieve losslessness
##Examples
###Original Image

###Encrypted Image

###Decrypted Image

###Original Image

###Encrypted Image

###Decrypted Image

###Original Image

###Encrypted Image

###Decrypted Image
 | 2 | 0.066667 | 2 | 0 |
3f1de23eee55029056d26bd123f61adaf1ec3525 | main.c | main.c |
int main() {
FILE *file;
long length;
char *buffer;
file = fopen("example.minty", "r");
if (file == NULL) {
return 1;
}
fseek(file, 0, SEEK_END);
length = ftell(file);
fseek(file, 0, SEEK_SET);
buffer = (char *)malloc(length);
fread(buffer, length, 1, file);
fclose(file);
printf("%s", buffer);
return 0;
}
|
int main(int argc, char *argv[]) {
FILE *file;
long length;
char *buffer;
if (argc < 2) {
return 1;
}
file = fopen(argv[1], "r");
if (file == NULL) {
return 1;
}
fseek(file, 0, SEEK_END);
length = ftell(file);
fseek(file, 0, SEEK_SET);
buffer = (char *)malloc(length);
fread(buffer, length, 1, file);
fclose(file);
printf("%s", buffer);
return 0;
}
| Allow program to run to be specified on command line | Allow program to run to be specified on command line
| C | mit | shanepelletier/ChocoMinty | c | ## Code Before:
int main() {
FILE *file;
long length;
char *buffer;
file = fopen("example.minty", "r");
if (file == NULL) {
return 1;
}
fseek(file, 0, SEEK_END);
length = ftell(file);
fseek(file, 0, SEEK_SET);
buffer = (char *)malloc(length);
fread(buffer, length, 1, file);
fclose(file);
printf("%s", buffer);
return 0;
}
## Instruction:
Allow program to run to be specified on command line
## Code After:
int main(int argc, char *argv[]) {
FILE *file;
long length;
char *buffer;
if (argc < 2) {
return 1;
}
file = fopen(argv[1], "r");
if (file == NULL) {
return 1;
}
fseek(file, 0, SEEK_END);
length = ftell(file);
fseek(file, 0, SEEK_SET);
buffer = (char *)malloc(length);
fread(buffer, length, 1, file);
fclose(file);
printf("%s", buffer);
return 0;
}
|
- int main() {
+ int main(int argc, char *argv[]) {
FILE *file;
long length;
char *buffer;
- file = fopen("example.minty", "r");
+ if (argc < 2) {
+ return 1;
+ }
+ file = fopen(argv[1], "r");
if (file == NULL) {
return 1;
}
fseek(file, 0, SEEK_END);
length = ftell(file);
fseek(file, 0, SEEK_SET);
buffer = (char *)malloc(length);
fread(buffer, length, 1, file);
fclose(file);
printf("%s", buffer);
return 0;
} | 7 | 0.388889 | 5 | 2 |
14c55462b75ee8fb49ed333251f1158d9618df93 | server/s3manager/s3manager.coffee | server/s3manager/s3manager.coffee | AWS = Meteor.require 'aws-sdk'
AWS.config.update
'accessKeyId' : "AKIAJ4QROL3BSAMJTI7Q",
'secretAccessKey' : "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",
'region' : "us-west-2"
s3 = new AWS.S3()
bucket = "d2mpclient"
Meteor.startup ->
s3.listBuckets {}, (err, data)->
console.log "=== buckets ==="
if err?
console.log "Error loading buckets: "+err
else if data?
bucketFound = false
for bucket, i in data.Buckets
console.log " --> "+bucket.Name
bucketFound = true if bucket.Name is bucket
if not bucketFound
console.log "Client bucket not found!"
generateModDownloadURL = (mod)->
response = Async.runSync (done)->
done null, s3.getSignedUrl 'getObject', {Bucket: bucket, Key: mod.bundlepath}
response.result
| AWS = Meteor.require 'aws-sdk'
bucket = "d2mpclient"
AWS.config.update
'accessKeyId' : "AKIAJ4QROL3BSAMJTI7Q",
'secretAccessKey' : "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",
'region' : "us-west-2"
s3 = new AWS.S3()
Meteor.startup ->
s3.listBuckets {}, (err, data)->
console.log "client bucket: "+bucket
console.log "=== buckets ==="
if err?
console.log "Error loading buckets: "+err
else if data?
bucketFound = false
for bucket, i in data.Buckets
console.log " --> "+bucket.Name
generateModDownloadURL = (mod)->
response = Async.runSync (done)->
done null, s3.getSignedUrl 'getObject', {Bucket: bucket, Key: mod.bundlepath}
response.result
| Fix one thing with s3 | Fix one thing with s3
| CoffeeScript | apache-2.0 | paralin/D2ModdinMeteor,paralin/D2ModdinMeteor | coffeescript | ## Code Before:
AWS = Meteor.require 'aws-sdk'
AWS.config.update
'accessKeyId' : "AKIAJ4QROL3BSAMJTI7Q",
'secretAccessKey' : "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",
'region' : "us-west-2"
s3 = new AWS.S3()
bucket = "d2mpclient"
Meteor.startup ->
s3.listBuckets {}, (err, data)->
console.log "=== buckets ==="
if err?
console.log "Error loading buckets: "+err
else if data?
bucketFound = false
for bucket, i in data.Buckets
console.log " --> "+bucket.Name
bucketFound = true if bucket.Name is bucket
if not bucketFound
console.log "Client bucket not found!"
generateModDownloadURL = (mod)->
response = Async.runSync (done)->
done null, s3.getSignedUrl 'getObject', {Bucket: bucket, Key: mod.bundlepath}
response.result
## Instruction:
Fix one thing with s3
## Code After:
AWS = Meteor.require 'aws-sdk'
bucket = "d2mpclient"
AWS.config.update
'accessKeyId' : "AKIAJ4QROL3BSAMJTI7Q",
'secretAccessKey' : "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",
'region' : "us-west-2"
s3 = new AWS.S3()
Meteor.startup ->
s3.listBuckets {}, (err, data)->
console.log "client bucket: "+bucket
console.log "=== buckets ==="
if err?
console.log "Error loading buckets: "+err
else if data?
bucketFound = false
for bucket, i in data.Buckets
console.log " --> "+bucket.Name
generateModDownloadURL = (mod)->
response = Async.runSync (done)->
done null, s3.getSignedUrl 'getObject', {Bucket: bucket, Key: mod.bundlepath}
response.result
| AWS = Meteor.require 'aws-sdk'
+ bucket = "d2mpclient"
AWS.config.update
'accessKeyId' : "AKIAJ4QROL3BSAMJTI7Q",
'secretAccessKey' : "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",
'region' : "us-west-2"
s3 = new AWS.S3()
- bucket = "d2mpclient"
Meteor.startup ->
s3.listBuckets {}, (err, data)->
+ console.log "client bucket: "+bucket
console.log "=== buckets ==="
if err?
console.log "Error loading buckets: "+err
else if data?
bucketFound = false
for bucket, i in data.Buckets
console.log " --> "+bucket.Name
- bucketFound = true if bucket.Name is bucket
- if not bucketFound
- console.log "Client bucket not found!"
-
generateModDownloadURL = (mod)->
response = Async.runSync (done)->
done null, s3.getSignedUrl 'getObject', {Bucket: bucket, Key: mod.bundlepath}
response.result | 7 | 0.28 | 2 | 5 |
b93131549564db94698196191f367a2ad97731fa | index.md | index.md | ---
layout: page
title: Main μMerlin Github page
---
<!-- tagline: Supporting tagline -->
{% include JB/setup %}
Simple shell for now, to enable github pages for projects
### https://www.udacity.com/ Udacity
* Frontend Web Developer NanoDegree projects
* Project 1: http://mmerlin.github.io/mug-mockup/ mug-mockup
* Project 2: http://mmerlin.github.io/resume/ résumé
### Markdown
* Basics https://help.github.com/articles/markdown-basics
* GitHub Flavored Markdown https://help.github.com/articles/github-flavored-markdown/
## Posts
<ul class="posts">
{% for post in site.posts %}
<li><span>{{ post.date | date_to_string }}</span> » <a href="{{ BASE_PATH }}{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
| ---
layout: page
title: Main μMerlin Github page
---
<!-- tagline: Supporting tagline -->
{% include JB/setup %}
## References
* #### Markdown
* <a href="https://help.github.com/articles/markdown-basics">Basics</a>
* <a href="https://help.github.com/articles/github-flavored-markdown/">GitHub Flavored Markdown</a>
## Projects
* <a href="https://www.udacity.com/">Udacity</a> Frontend Web Developer NanoDegree
* <a href="http://mmerlin.github.io/mug-mockup/">Project 1:</a> mug-mockup
* <a href="http://mmerlin.github.io/resume/">Project 2:</a> résumé
## Posts
<ul class="posts">
{% for post in site.posts %}
<li><span>{{ post.date | date_to_string }}</span> » <a href="{{ BASE_PATH }}{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
## To Do
* add sidebar to hold the extras
* refactor theme(s) to:
* pull common header stuff out
* provide insertion points to adding extra tags
* site and page specific css and js
| Add main page blocks for references, projects, and TODO | Add main page blocks for references, projects, and TODO
| Markdown | mit | mMerlin/mMerlin.github.io,mMerlin/mMerlin.github.io,mMerlin/mMerlin.github.io | markdown | ## Code Before:
---
layout: page
title: Main μMerlin Github page
---
<!-- tagline: Supporting tagline -->
{% include JB/setup %}
Simple shell for now, to enable github pages for projects
### https://www.udacity.com/ Udacity
* Frontend Web Developer NanoDegree projects
* Project 1: http://mmerlin.github.io/mug-mockup/ mug-mockup
* Project 2: http://mmerlin.github.io/resume/ résumé
### Markdown
* Basics https://help.github.com/articles/markdown-basics
* GitHub Flavored Markdown https://help.github.com/articles/github-flavored-markdown/
## Posts
<ul class="posts">
{% for post in site.posts %}
<li><span>{{ post.date | date_to_string }}</span> » <a href="{{ BASE_PATH }}{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
## Instruction:
Add main page blocks for references, projects, and TODO
## Code After:
---
layout: page
title: Main μMerlin Github page
---
<!-- tagline: Supporting tagline -->
{% include JB/setup %}
## References
* #### Markdown
* <a href="https://help.github.com/articles/markdown-basics">Basics</a>
* <a href="https://help.github.com/articles/github-flavored-markdown/">GitHub Flavored Markdown</a>
## Projects
* <a href="https://www.udacity.com/">Udacity</a> Frontend Web Developer NanoDegree
* <a href="http://mmerlin.github.io/mug-mockup/">Project 1:</a> mug-mockup
* <a href="http://mmerlin.github.io/resume/">Project 2:</a> résumé
## Posts
<ul class="posts">
{% for post in site.posts %}
<li><span>{{ post.date | date_to_string }}</span> » <a href="{{ BASE_PATH }}{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
## To Do
* add sidebar to hold the extras
* refactor theme(s) to:
* pull common header stuff out
* provide insertion points to adding extra tags
* site and page specific css and js
| ---
layout: page
title: Main μMerlin Github page
---
<!-- tagline: Supporting tagline -->
{% include JB/setup %}
- Simple shell for now, to enable github pages for projects
+ ## References
+ * #### Markdown
+ * <a href="https://help.github.com/articles/markdown-basics">Basics</a>
+ * <a href="https://help.github.com/articles/github-flavored-markdown/">GitHub Flavored Markdown</a>
- ### https://www.udacity.com/ Udacity
- * Frontend Web Developer NanoDegree projects
+ ## Projects
+ * <a href="https://www.udacity.com/">Udacity</a> Frontend Web Developer NanoDegree
- * Project 1: http://mmerlin.github.io/mug-mockup/ mug-mockup
? ^ -- ^^^^^^
+ * <a href="http://mmerlin.github.io/mug-mockup/">Project 1:</a> mug-mockup
? ^^^^ ^^^ ++++++++++++++++
+ * <a href="http://mmerlin.github.io/resume/">Project 2:</a> résumé
- * Project 2: http://mmerlin.github.io/resume/ résumé
-
- ### Markdown
- * Basics https://help.github.com/articles/markdown-basics
- * GitHub Flavored Markdown https://help.github.com/articles/github-flavored-markdown/
## Posts
<ul class="posts">
{% for post in site.posts %}
<li><span>{{ post.date | date_to_string }}</span> » <a href="{{ BASE_PATH }}{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
+
+ ## To Do
+ * add sidebar to hold the extras
+ * refactor theme(s) to:
+ * pull common header stuff out
+ * provide insertion points to adding extra tags
+ * site and page specific css and js | 24 | 1 | 15 | 9 |
4ae5381f4151abe680e21cbac68fffdb373d2d66 | articles/_posts/2009-01-15-raphael-javascript-api-for-svg.md | articles/_posts/2009-01-15-raphael-javascript-api-for-svg.md | ---
title: 'Raphaël: a JavaScript API for SVG'
authors:
- dmitry-baranovskiy
layout: article
--- | ---
title: 'Raphaël: a JavaScript API for SVG'
authors:
- dmitry-baranovskiy
intro: 'In this article, we have the pleasure of introducing you to Raphaël, a JavaScript API for SVG that not only allows you to write SVG functionality using JavaScript code, but also provides support for SVG in IE, by emulating it in VML. This is a great tool for introducing more people to the power of SVG, and we'd like to wish it every success.'
layout: article
--- | Add intro for article “Raphaël: a JavaScript API for SVG” | Add intro for article “Raphaël: a JavaScript API for SVG”
Ref. #19.
| Markdown | apache-2.0 | paulirish/devopera,payeldillip/devopera,Mtmotahar/devopera,Mtmotahar/devopera,Jasenpan1987/devopera,simevidas/devopera,SelenIT/devopera,erikmaarten/devopera,payeldillip/devopera,simevidas/devopera,cvan/devopera,operasoftware/devopera,shwetank/devopera,simevidas/devopera,Jasenpan1987/devopera,kenarai/devopera,operasoftware/devopera,initaldk/devopera,operasoftware/devopera,cvan/devopera,initaldk/devopera,cvan/devopera,payeldillip/devopera,Jasenpan1987/devopera,erikmaarten/devopera,payeldillip/devopera,paulirish/devopera,michaelstewart/devopera,kenarai/devopera,erikmaarten/devopera,simevidas/devopera,paulirish/devopera,SelenIT/devopera,Jasenpan1987/devopera,SelenIT/devopera,shwetank/devopera,initaldk/devopera,michaelstewart/devopera,initaldk/devopera,michaelstewart/devopera,kenarai/devopera,andreasbovens/devopera,Mtmotahar/devopera,andreasbovens/devopera,SelenIT/devopera,andreasbovens/devopera,erikmaarten/devopera,cvan/devopera,paulirish/devopera,michaelstewart/devopera,shwetank/devopera,operasoftware/devopera,kenarai/devopera,Mtmotahar/devopera | markdown | ## Code Before:
---
title: 'Raphaël: a JavaScript API for SVG'
authors:
- dmitry-baranovskiy
layout: article
---
## Instruction:
Add intro for article “Raphaël: a JavaScript API for SVG”
Ref. #19.
## Code After:
---
title: 'Raphaël: a JavaScript API for SVG'
authors:
- dmitry-baranovskiy
intro: 'In this article, we have the pleasure of introducing you to Raphaël, a JavaScript API for SVG that not only allows you to write SVG functionality using JavaScript code, but also provides support for SVG in IE, by emulating it in VML. This is a great tool for introducing more people to the power of SVG, and we'd like to wish it every success.'
layout: article
--- | ---
title: 'Raphaël: a JavaScript API for SVG'
authors:
- dmitry-baranovskiy
+ intro: 'In this article, we have the pleasure of introducing you to Raphaël, a JavaScript API for SVG that not only allows you to write SVG functionality using JavaScript code, but also provides support for SVG in IE, by emulating it in VML. This is a great tool for introducing more people to the power of SVG, and we'd like to wish it every success.'
layout: article
--- | 1 | 0.166667 | 1 | 0 |
8d4880ffdcade5c7c6ef30a715bc6a66b80629ad | scss/_typography.scss | scss/_typography.scss | /* ---------- ==========================================
TYPOGRAPHY
*/
$thin: 200;
$light: 300;
$normal: 400;
$medium: 600;
$bold: 800;
$black: 900;
.brand-font {
font-family: 'Helvetica', 'sans-serif' !important;
}
body, input, textarea {
@extend .brand-font;
}
* {
@extend .prevent-text-breakouts;
}
h1,h2,h3,h4,h5 {
&, & * {
@extend .brand-font;
letter-spacing: -0.0075em;
}
} | /* ---------- ==========================================
TYPOGRAPHY
*/
$thin: 200;
$light: 300;
$normal: 400;
$medium: 600;
$bold: 800;
$black: 900;
.brand-font {
font-family: 'Helvetica', 'sans-serif' !important;
}
body, input, textarea {
@extend .brand-font;
}
* {
@extend .prevent-text-breakouts;
-webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4,h5 {
&, & * {
@extend .brand-font;
letter-spacing: -0.0075em;
line-height: 1.1em;
}
} | Tweak general font rendering; thinner default line height and use of -webkit-smoothing: antialias | Tweak general font rendering; thinner default line height and use of -webkit-smoothing: antialias
| SCSS | mit | janbaykara/generator-spontaneous-combustion,janbaykara/generator-spontaneous-combustion,janbaykara/generator-spontaneous-combustion | scss | ## Code Before:
/* ---------- ==========================================
TYPOGRAPHY
*/
$thin: 200;
$light: 300;
$normal: 400;
$medium: 600;
$bold: 800;
$black: 900;
.brand-font {
font-family: 'Helvetica', 'sans-serif' !important;
}
body, input, textarea {
@extend .brand-font;
}
* {
@extend .prevent-text-breakouts;
}
h1,h2,h3,h4,h5 {
&, & * {
@extend .brand-font;
letter-spacing: -0.0075em;
}
}
## Instruction:
Tweak general font rendering; thinner default line height and use of -webkit-smoothing: antialias
## Code After:
/* ---------- ==========================================
TYPOGRAPHY
*/
$thin: 200;
$light: 300;
$normal: 400;
$medium: 600;
$bold: 800;
$black: 900;
.brand-font {
font-family: 'Helvetica', 'sans-serif' !important;
}
body, input, textarea {
@extend .brand-font;
}
* {
@extend .prevent-text-breakouts;
-webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4,h5 {
&, & * {
@extend .brand-font;
letter-spacing: -0.0075em;
line-height: 1.1em;
}
} | /* ---------- ==========================================
TYPOGRAPHY
*/
$thin: 200;
$light: 300;
$normal: 400;
$medium: 600;
$bold: 800;
$black: 900;
.brand-font {
font-family: 'Helvetica', 'sans-serif' !important;
}
body, input, textarea {
@extend .brand-font;
}
* {
- @extend .prevent-text-breakouts;
? ^^
+ @extend .prevent-text-breakouts;
? ^
+ -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4,h5 {
&, & * {
@extend .brand-font;
letter-spacing: -0.0075em;
+ line-height: 1.1em;
}
} | 4 | 0.137931 | 3 | 1 |
25c3b84149febc647aba724523c0624d74d472ae | samples/openid/src/main/webapp/secure/extreme/index.jsp | samples/openid/src/main/webapp/secure/extreme/index.jsp | <%@ taglib prefix="authz" uri="http://www.springframework.org/security/tags" %>
<html>
<body>
<h1>VERY Secure Page</h1>
This is a protected page. You can only see me if you are a supervisor.
<authz:authorize ifAllGranted="ROLE_SUPERVISOR">
You have "ROLE_SUPERVISOR" (this text is surrounded by <authz:authorize> tags).
</authz:authorize>
<p><a href="../../">Home</a>
<p><a href="../../j_spring_security_logout">Logout</a>
</body>
</html> | <html>
<body>
<h1>VERY Secure Page</h1>
This is a protected page. You can only see me if you are a supervisor.
<p><a href="../../">Home</a>
<p><a href="../../j_spring_security_logout">Logout</a>
</body>
</html> | Remove security taglib dependency in OpenID sample. | Remove security taglib dependency in OpenID sample.
| Java Server Pages | apache-2.0 | ractive/spring-security,MatthiasWinzeler/spring-security,yinhe402/spring-security,wilkinsona/spring-security,kazuki43zoo/spring-security,dsyer/spring-security,jmnarloch/spring-security,xingguang2013/spring-security,rwinch/spring-security,Xcorpio/spring-security,izeye/spring-security,ractive/spring-security,pkdevbox/spring-security,hippostar/spring-security,caiwenshu/spring-security,Xcorpio/spring-security,hippostar/spring-security,MatthiasWinzeler/spring-security,cyratech/spring-security,olezhuravlev/spring-security,spring-projects/spring-security,panchenko/spring-security,kazuki43zoo/spring-security,mounb/spring-security,rwinch/spring-security,caiwenshu/spring-security,izeye/spring-security,dsyer/spring-security,vitorgv/spring-security,Krasnyanskiy/spring-security,jgrandja/spring-security,diegofernandes/spring-security,diegofernandes/spring-security,mparaz/spring-security,likaiwalkman/spring-security,jmnarloch/spring-security,kazuki43zoo/spring-security,zhaoqin102/spring-security,zhaoqin102/spring-security,liuguohua/spring-security,driftman/spring-security,liuguohua/spring-security,izeye/spring-security,djechelon/spring-security,zhaoqin102/spring-security,kazuki43zoo/spring-security,ollie314/spring-security,Peter32/spring-security,pwheel/spring-security,mounb/spring-security,liuguohua/spring-security,adairtaosy/spring-security,djechelon/spring-security,fhanik/spring-security,forestqqqq/spring-security,pwheel/spring-security,zgscwjm/spring-security,ajdinhedzic/spring-security,zshift/spring-security,tekul/spring-security,yinhe402/spring-security,olezhuravlev/spring-security,yinhe402/spring-security,thomasdarimont/spring-security,pkdevbox/spring-security,jgrandja/spring-security,follow99/spring-security,Peter32/spring-security,zshift/spring-security,djechelon/spring-security,zgscwjm/spring-security,thomasdarimont/spring-security,kazuki43zoo/spring-security,likaiwalkman/spring-security,ajdinhedzic/spring-security,olezhuravlev/spring-security,chinazhaoht/spring-security,panchenko/spring-security,follow99/spring-security,panchenko/spring-security,justinedelson/spring-security,vitorgv/spring-security,hippostar/spring-security,cyratech/spring-security,justinedelson/spring-security,ollie314/spring-security,Krasnyanskiy/spring-security,spring-projects/spring-security,pkdevbox/spring-security,dsyer/spring-security,ajdinhedzic/spring-security,dsyer/spring-security,pkdevbox/spring-security,adairtaosy/spring-security,chinazhaoht/spring-security,caiwenshu/spring-security,wkorando/spring-security,driftman/spring-security,ractive/spring-security,cyratech/spring-security,mrkingybc/spring-security,follow99/spring-security,panchenko/spring-security,mparaz/spring-security,vitorgv/spring-security,izeye/spring-security,zgscwjm/spring-security,eddumelendez/spring-security,adairtaosy/spring-security,wilkinsona/spring-security,cyratech/spring-security,eddumelendez/spring-security,wilkinsona/spring-security,SanjayUser/SpringSecurityPro,diegofernandes/spring-security,diegofernandes/spring-security,eddumelendez/spring-security,spring-projects/spring-security,mrkingybc/spring-security,rwinch/spring-security,tekul/spring-security,jgrandja/spring-security,Xcorpio/spring-security,SanjayUser/SpringSecurityPro,jgrandja/spring-security,djechelon/spring-security,jmnarloch/spring-security,mrkingybc/spring-security,ollie314/spring-security,spring-projects/spring-security,chinazhaoht/spring-security,follow99/spring-security,MatthiasWinzeler/spring-security,raindev/spring-security,mdeinum/spring-security,thomasdarimont/spring-security,tekul/spring-security,spring-projects/spring-security,pwheel/spring-security,justinedelson/spring-security,fhanik/spring-security,forestqqqq/spring-security,wilkinsona/spring-security,rwinch/spring-security,Krasnyanskiy/spring-security,mounb/spring-security,ractive/spring-security,xingguang2013/spring-security,wkorando/spring-security,xingguang2013/spring-security,wkorando/spring-security,zshift/spring-security,zhaoqin102/spring-security,liuguohua/spring-security,fhanik/spring-security,xingguang2013/spring-security,Krasnyanskiy/spring-security,Peter32/spring-security,chinazhaoht/spring-security,raindev/spring-security,mparaz/spring-security,wkorando/spring-security,justinedelson/spring-security,driftman/spring-security,rwinch/spring-security,yinhe402/spring-security,rwinch/spring-security,SanjayUser/SpringSecurityPro,ajdinhedzic/spring-security,jgrandja/spring-security,hippostar/spring-security,pwheel/spring-security,mounb/spring-security,vitorgv/spring-security,raindev/spring-security,zshift/spring-security,jgrandja/spring-security,olezhuravlev/spring-security,zgscwjm/spring-security,mrkingybc/spring-security,mparaz/spring-security,pwheel/spring-security,fhanik/spring-security,tekul/spring-security,likaiwalkman/spring-security,spring-projects/spring-security,forestqqqq/spring-security,likaiwalkman/spring-security,SanjayUser/SpringSecurityPro,fhanik/spring-security,MatthiasWinzeler/spring-security,jmnarloch/spring-security,forestqqqq/spring-security,caiwenshu/spring-security,fhanik/spring-security,mdeinum/spring-security,thomasdarimont/spring-security,ollie314/spring-security,raindev/spring-security,driftman/spring-security,spring-projects/spring-security,djechelon/spring-security,eddumelendez/spring-security,thomasdarimont/spring-security,mdeinum/spring-security,eddumelendez/spring-security,adairtaosy/spring-security,Xcorpio/spring-security,Peter32/spring-security,mdeinum/spring-security,SanjayUser/SpringSecurityPro,dsyer/spring-security,olezhuravlev/spring-security | java-server-pages | ## Code Before:
<%@ taglib prefix="authz" uri="http://www.springframework.org/security/tags" %>
<html>
<body>
<h1>VERY Secure Page</h1>
This is a protected page. You can only see me if you are a supervisor.
<authz:authorize ifAllGranted="ROLE_SUPERVISOR">
You have "ROLE_SUPERVISOR" (this text is surrounded by <authz:authorize> tags).
</authz:authorize>
<p><a href="../../">Home</a>
<p><a href="../../j_spring_security_logout">Logout</a>
</body>
</html>
## Instruction:
Remove security taglib dependency in OpenID sample.
## Code After:
<html>
<body>
<h1>VERY Secure Page</h1>
This is a protected page. You can only see me if you are a supervisor.
<p><a href="../../">Home</a>
<p><a href="../../j_spring_security_logout">Logout</a>
</body>
</html> | - <%@ taglib prefix="authz" uri="http://www.springframework.org/security/tags" %>
-
<html>
<body>
<h1>VERY Secure Page</h1>
This is a protected page. You can only see me if you are a supervisor.
- <authz:authorize ifAllGranted="ROLE_SUPERVISOR">
- You have "ROLE_SUPERVISOR" (this text is surrounded by <authz:authorize> tags).
- </authz:authorize>
-
<p><a href="../../">Home</a>
<p><a href="../../j_spring_security_logout">Logout</a>
</body>
</html> | 6 | 0.4 | 0 | 6 |
d68e87179c84655cfa65a52627c9ee939ece7d85 | CMakeLists.txt | CMakeLists.txt | cmake_minimum_required(VERSION 3.2)
if (CMAKE_COMPILER_IS_GNUCC)
option(ENABLE_COVERAGE "Enable coverage reporting for gcc/clang" FALSE)
if (ENABLE_COVERAGE)
add_compile_options(--coverage -O0)
endif()
endif()
if (MSVC)
add_compile_options(/W4)
else()
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
add_executable(intro main.cpp)
target_compile_features(intro PRIVATE cxx_lambda_init_captures)
target_link_libraries(intro --coverage)
enable_testing()
add_executable(tester tester.cpp)
target_link_libraries(tester --coverage)
add_test(Tester tester)
| cmake_minimum_required(VERSION 3.2)
option(BUILD_SHARED_LIBS "Enable compilation of shared libraries" FALSE)
if (CMAKE_COMPILER_IS_GNUCC)
option(ENABLE_COVERAGE "Enable coverage reporting for gcc/clang" FALSE)
if (ENABLE_COVERAGE)
add_compile_options(--coverage -O0)
endif()
endif()
if (MSVC)
add_compile_options(/W4)
else()
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
add_executable(intro main.cpp)
target_compile_features(intro PRIVATE cxx_lambda_init_captures)
target_link_libraries(intro --coverage)
enable_testing()
add_executable(tester tester.cpp)
target_link_libraries(tester --coverage)
add_test(Tester tester)
find_package(FLTK REQUIRED)
add_executable(test_fltk fltk/test_fltk.cpp)
target_link_libraries(test_fltk
PRIVATE ${FLTK_LIBRARIES})
target_include_directories(test_fltk
PRIVATE ${FLTK_INCLUDE_DIR})
find_package(PkgConfig REQUIRED)
pkg_check_modules(GTKMM REQUIRED gtkmm-3.0)
add_executable(test_gtkmm gtkmm/main.cpp gtkmm/hello_world.cpp)
target_link_libraries(test_gtkmm
PRIVATE ${GTKMM_LIBRARIES})
target_include_directories(test_gtkmm
PRIVATE ${GTKMM_INCLUDE_DIRS})
find_package(SFML
COMPONENTS graphics window system)
find_package(OpenGL )
add_library(imgui imgui/imgui.cpp imgui/imgui_draw.cpp imgui/imgui-SFML.cpp imgui/test.cpp)
target_link_libraries(imgui
INTERFACE ${SFML_LIBRARIES} ${OPENGL_gl_LIBRARY})
add_executable(test_imgui imgui/test.cpp)
target_link_libraries(test_imgui imgui)
target_include_directories(test_imgui
PRIVATE ${SFML_INCLUDE_DIR})
| Make imgui into a library | Make imgui into a library
| Text | unlicense | lefticus/cpp_starter_project | text | ## Code Before:
cmake_minimum_required(VERSION 3.2)
if (CMAKE_COMPILER_IS_GNUCC)
option(ENABLE_COVERAGE "Enable coverage reporting for gcc/clang" FALSE)
if (ENABLE_COVERAGE)
add_compile_options(--coverage -O0)
endif()
endif()
if (MSVC)
add_compile_options(/W4)
else()
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
add_executable(intro main.cpp)
target_compile_features(intro PRIVATE cxx_lambda_init_captures)
target_link_libraries(intro --coverage)
enable_testing()
add_executable(tester tester.cpp)
target_link_libraries(tester --coverage)
add_test(Tester tester)
## Instruction:
Make imgui into a library
## Code After:
cmake_minimum_required(VERSION 3.2)
option(BUILD_SHARED_LIBS "Enable compilation of shared libraries" FALSE)
if (CMAKE_COMPILER_IS_GNUCC)
option(ENABLE_COVERAGE "Enable coverage reporting for gcc/clang" FALSE)
if (ENABLE_COVERAGE)
add_compile_options(--coverage -O0)
endif()
endif()
if (MSVC)
add_compile_options(/W4)
else()
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
add_executable(intro main.cpp)
target_compile_features(intro PRIVATE cxx_lambda_init_captures)
target_link_libraries(intro --coverage)
enable_testing()
add_executable(tester tester.cpp)
target_link_libraries(tester --coverage)
add_test(Tester tester)
find_package(FLTK REQUIRED)
add_executable(test_fltk fltk/test_fltk.cpp)
target_link_libraries(test_fltk
PRIVATE ${FLTK_LIBRARIES})
target_include_directories(test_fltk
PRIVATE ${FLTK_INCLUDE_DIR})
find_package(PkgConfig REQUIRED)
pkg_check_modules(GTKMM REQUIRED gtkmm-3.0)
add_executable(test_gtkmm gtkmm/main.cpp gtkmm/hello_world.cpp)
target_link_libraries(test_gtkmm
PRIVATE ${GTKMM_LIBRARIES})
target_include_directories(test_gtkmm
PRIVATE ${GTKMM_INCLUDE_DIRS})
find_package(SFML
COMPONENTS graphics window system)
find_package(OpenGL )
add_library(imgui imgui/imgui.cpp imgui/imgui_draw.cpp imgui/imgui-SFML.cpp imgui/test.cpp)
target_link_libraries(imgui
INTERFACE ${SFML_LIBRARIES} ${OPENGL_gl_LIBRARY})
add_executable(test_imgui imgui/test.cpp)
target_link_libraries(test_imgui imgui)
target_include_directories(test_imgui
PRIVATE ${SFML_INCLUDE_DIR})
| cmake_minimum_required(VERSION 3.2)
+
+ option(BUILD_SHARED_LIBS "Enable compilation of shared libraries" FALSE)
if (CMAKE_COMPILER_IS_GNUCC)
option(ENABLE_COVERAGE "Enable coverage reporting for gcc/clang" FALSE)
if (ENABLE_COVERAGE)
add_compile_options(--coverage -O0)
endif()
endif()
if (MSVC)
add_compile_options(/W4)
else()
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
add_executable(intro main.cpp)
target_compile_features(intro PRIVATE cxx_lambda_init_captures)
target_link_libraries(intro --coverage)
enable_testing()
add_executable(tester tester.cpp)
target_link_libraries(tester --coverage)
add_test(Tester tester)
+ find_package(FLTK REQUIRED)
+ add_executable(test_fltk fltk/test_fltk.cpp)
+ target_link_libraries(test_fltk
+ PRIVATE ${FLTK_LIBRARIES})
+ target_include_directories(test_fltk
+ PRIVATE ${FLTK_INCLUDE_DIR})
+
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(GTKMM REQUIRED gtkmm-3.0)
+ add_executable(test_gtkmm gtkmm/main.cpp gtkmm/hello_world.cpp)
+ target_link_libraries(test_gtkmm
+ PRIVATE ${GTKMM_LIBRARIES})
+ target_include_directories(test_gtkmm
+ PRIVATE ${GTKMM_INCLUDE_DIRS})
+
+ find_package(SFML
+ COMPONENTS graphics window system)
+ find_package(OpenGL )
+ add_library(imgui imgui/imgui.cpp imgui/imgui_draw.cpp imgui/imgui-SFML.cpp imgui/test.cpp)
+ target_link_libraries(imgui
+ INTERFACE ${SFML_LIBRARIES} ${OPENGL_gl_LIBRARY})
+ add_executable(test_imgui imgui/test.cpp)
+ target_link_libraries(test_imgui imgui)
+ target_include_directories(test_imgui
+ PRIVATE ${SFML_INCLUDE_DIR})
+
+
+ | 30 | 1.111111 | 30 | 0 |
856b1f29230acc829d627aa8779f345c71a3ddaa | packages/babel-plugin-transform-react-jsx-self/src/index.js | packages/babel-plugin-transform-react-jsx-self/src/index.js |
/**
* This adds {fileName, lineNumber} annotations to React component definitions
* and to jsx tag literals.
*
*
* == JSX Literals ==
*
* <sometag />
*
* becomes:
*
* <sometag __self={this} />
*/
const TRACE_ID = "__self";
export default function ({ types: t }) {
let visitor = {
JSXOpeningElement(node) {
const id = t.jSXIdentifier(TRACE_ID);
const trace = t.identifier("this");
node.container.openingElement.attributes.push(t.jSXAttribute(id, t.jSXExpressionContainer(trace)));
}
};
return {
visitor
};
}
| /**
* This adds a __self={this} JSX attribute to all JSX elements, which React will use
* to generate some runtime warnings.
*
*
* == JSX Literals ==
*
* <sometag />
*
* becomes:
*
* <sometag __self={this} />
*/
const TRACE_ID = "__self";
export default function ({ types: t }) {
let visitor = {
JSXOpeningElement({ node }) {
const id = t.jSXIdentifier(TRACE_ID);
const trace = t.thisExpression();
node.attributes.push(t.jSXAttribute(id, t.jSXExpressionContainer(trace)));
}
};
return {
visitor
};
}
| Fix some mistakes in the jsx-self transform. | Fix some mistakes in the jsx-self transform.
| JavaScript | mit | babel/babel,claudiopro/babel,kaicataldo/babel,tikotzky/babel,hzoo/babel,samwgoldman/babel,kellyselden/babel,shuhei/babel,PolymerLabs/babel,kassens/babel,babel/babel,iamchenxin/babel,samwgoldman/babel,hulkish/babel,tikotzky/babel,garyjN7/babel,hzoo/babel,KunGha/babel,Skillupco/babel,shuhei/babel,jridgewell/babel,jridgewell/babel,kassens/babel,ccschneidr/babel,iamchenxin/babel,hulkish/babel,kedromelon/babel,existentialism/babel,zertosh/babel,zjmiller/babel,jridgewell/babel,rmacklin/babel,hulkish/babel,KunGha/babel,bcoe/babel,guybedford/babel,PolymerLabs/babel,kaicataldo/babel,rmacklin/babel,chicoxyzzy/babel,Skillupco/babel,bcoe/babel,ccschneidr/babel,STRML/babel,claudiopro/babel,jchip/babel,jridgewell/babel,kellyselden/babel,babel/babel,kellyselden/babel,kellyselden/babel,hzoo/babel,guybedford/babel,zertosh/babel,existentialism/babel,guybedford/babel,PolymerLabs/babel,chicoxyzzy/babel,maurobringolf/babel,jchip/babel,vadzim/babel,lxe/babel,kaicataldo/babel,maurobringolf/babel,Skillupco/babel,garyjN7/babel,maurobringolf/babel,zjmiller/babel,hzoo/babel,STRML/babel,kaicataldo/babel,lxe/babel,chicoxyzzy/babel,babel/babel,vadzim/babel,chicoxyzzy/babel,existentialism/babel,shuhei/babel,Skillupco/babel,claudiopro/babel,kedromelon/babel,iamchenxin/babel,kedromelon/babel,hulkish/babel,samwgoldman/babel | javascript | ## Code Before:
/**
* This adds {fileName, lineNumber} annotations to React component definitions
* and to jsx tag literals.
*
*
* == JSX Literals ==
*
* <sometag />
*
* becomes:
*
* <sometag __self={this} />
*/
const TRACE_ID = "__self";
export default function ({ types: t }) {
let visitor = {
JSXOpeningElement(node) {
const id = t.jSXIdentifier(TRACE_ID);
const trace = t.identifier("this");
node.container.openingElement.attributes.push(t.jSXAttribute(id, t.jSXExpressionContainer(trace)));
}
};
return {
visitor
};
}
## Instruction:
Fix some mistakes in the jsx-self transform.
## Code After:
/**
* This adds a __self={this} JSX attribute to all JSX elements, which React will use
* to generate some runtime warnings.
*
*
* == JSX Literals ==
*
* <sometag />
*
* becomes:
*
* <sometag __self={this} />
*/
const TRACE_ID = "__self";
export default function ({ types: t }) {
let visitor = {
JSXOpeningElement({ node }) {
const id = t.jSXIdentifier(TRACE_ID);
const trace = t.thisExpression();
node.attributes.push(t.jSXAttribute(id, t.jSXExpressionContainer(trace)));
}
};
return {
visitor
};
}
| -
- /**
? -
+ /**
- * This adds {fileName, lineNumber} annotations to React component definitions
- * and to jsx tag literals.
+ * This adds a __self={this} JSX attribute to all JSX elements, which React will use
+ * to generate some runtime warnings.
*
*
* == JSX Literals ==
*
* <sometag />
*
* becomes:
*
* <sometag __self={this} />
*/
const TRACE_ID = "__self";
export default function ({ types: t }) {
let visitor = {
- JSXOpeningElement(node) {
+ JSXOpeningElement({ node }) {
? ++ ++
const id = t.jSXIdentifier(TRACE_ID);
- const trace = t.identifier("this");
+ const trace = t.thisExpression();
+
- node.container.openingElement.attributes.push(t.jSXAttribute(id, t.jSXExpressionContainer(trace)));
? -------------------------
+ node.attributes.push(t.jSXAttribute(id, t.jSXExpressionContainer(trace)));
}
};
return {
visitor
};
} | 14 | 0.466667 | 7 | 7 |
dec8cbd09fbc97503d039a2546f9db441d93e4fb | src/polyChecksum.cpp | src/polyChecksum.cpp |
PolyChecksum::PolyChecksum()
{
// for all possible byte values
for (unsigned i = 0; i < 256; ++i)
{
unsigned long reg = i << 24;
// for all bits in a byte
for (int j = 0; j < 8; ++j)
{
bool topBit = (reg & 0x80000000) != 0;
reg <<= 1;
if (topBit)
reg ^= _key;
}
_table [i] = reg;
}
}
void PolyChecksum::putBytes(void* bytes, size_t dataSize)
{
unsigned char* ptr = (unsigned char*) bytes;
for (int i = 0; i < dataSize; i++)
{
unsigned byte = (unsigned) ptr[i];
unsigned top = _register >> 24;
top ^= byte;
_register = (_register << 8) ^ _table [top];
}
}
int PolyChecksum::getResult()
{
return (int) this->_register;
} |
PolyChecksum::PolyChecksum()
{
// for all possible byte values
for (unsigned i = 0; i < 256; ++i)
{
unsigned long reg = i << 24;
// for all bits in a byte
for (int j = 0; j < 8; ++j)
{
bool topBit = (reg & 0x80000000) != 0;
reg <<= 1;
if (topBit)
reg ^= _key;
}
_table [i] = reg;
}
}
void PolyChecksum::putBytes(void* bytes, size_t dataSize)
{
unsigned char* ptr = (unsigned char*) bytes;
for (size_t i = 0; i < dataSize; i++)
{
unsigned byte = *(ptr + i);
unsigned top = _register >> 24;
top ^= byte;
top &= 255;
_register = (_register << 8) ^ _table [top];
}
}
int PolyChecksum::getResult()
{
return (int) this->_register;
}
| Fix out of bounds error on Linux. | Fix out of bounds error on Linux.
| C++ | mit | yantor3d/polySymmetry,yantor3d/polySymmetry | c++ | ## Code Before:
PolyChecksum::PolyChecksum()
{
// for all possible byte values
for (unsigned i = 0; i < 256; ++i)
{
unsigned long reg = i << 24;
// for all bits in a byte
for (int j = 0; j < 8; ++j)
{
bool topBit = (reg & 0x80000000) != 0;
reg <<= 1;
if (topBit)
reg ^= _key;
}
_table [i] = reg;
}
}
void PolyChecksum::putBytes(void* bytes, size_t dataSize)
{
unsigned char* ptr = (unsigned char*) bytes;
for (int i = 0; i < dataSize; i++)
{
unsigned byte = (unsigned) ptr[i];
unsigned top = _register >> 24;
top ^= byte;
_register = (_register << 8) ^ _table [top];
}
}
int PolyChecksum::getResult()
{
return (int) this->_register;
}
## Instruction:
Fix out of bounds error on Linux.
## Code After:
PolyChecksum::PolyChecksum()
{
// for all possible byte values
for (unsigned i = 0; i < 256; ++i)
{
unsigned long reg = i << 24;
// for all bits in a byte
for (int j = 0; j < 8; ++j)
{
bool topBit = (reg & 0x80000000) != 0;
reg <<= 1;
if (topBit)
reg ^= _key;
}
_table [i] = reg;
}
}
void PolyChecksum::putBytes(void* bytes, size_t dataSize)
{
unsigned char* ptr = (unsigned char*) bytes;
for (size_t i = 0; i < dataSize; i++)
{
unsigned byte = *(ptr + i);
unsigned top = _register >> 24;
top ^= byte;
top &= 255;
_register = (_register << 8) ^ _table [top];
}
}
int PolyChecksum::getResult()
{
return (int) this->_register;
}
|
PolyChecksum::PolyChecksum()
{
// for all possible byte values
for (unsigned i = 0; i < 256; ++i)
{
unsigned long reg = i << 24;
// for all bits in a byte
for (int j = 0; j < 8; ++j)
{
bool topBit = (reg & 0x80000000) != 0;
reg <<= 1;
if (topBit)
reg ^= _key;
}
_table [i] = reg;
}
}
void PolyChecksum::putBytes(void* bytes, size_t dataSize)
{
unsigned char* ptr = (unsigned char*) bytes;
- for (int i = 0; i < dataSize; i++)
? ^
+ for (size_t i = 0; i < dataSize; i++)
? + ^^^
{
- unsigned byte = (unsigned) ptr[i];
? ---------- ^ ^
+ unsigned byte = *(ptr + i);
? + ^^^ ^
unsigned top = _register >> 24;
top ^= byte;
+ top &= 255;
_register = (_register << 8) ^ _table [top];
}
}
int PolyChecksum::getResult()
{
return (int) this->_register;
} | 5 | 0.131579 | 3 | 2 |
a1a52e887aadf88eb465777a5a019043896a9b79 | .travis.yml | .travis.yml | language: php
sudo: false
php:
- 7.1
- 7.2
- nightly
env:
- DEPENDENCIES="--prefer-lowest --prefer-stable"
- DEPENDENCIES=""
before_script:
- travis_retry composer update --prefer-dist $DEPENDENCIES
script:
- ./vendor/bin/phpunit --coverage-clover ./clover.xml
- php examples/persisting-new-objects-in-batch.php > /dev/null
- php examples/working-with-query-resultsets-in-batch.php > /dev/null
| language: php
sudo: false
php:
- 7.1
- 7.2
- 7.3
- 7.4snapshot
- nightly
matrix:
allow_failures:
- php: nightly
env:
- DEPENDENCIES="--prefer-lowest --prefer-stable"
- DEPENDENCIES=""
before_script:
- travis_retry composer update --prefer-dist $DEPENDENCIES
script:
- ./vendor/bin/phpunit --coverage-clover ./clover.xml
- php examples/persisting-new-objects-in-batch.php > /dev/null
- php examples/working-with-query-resultsets-in-batch.php > /dev/null
| Allow php nightly to fail | Allow php nightly to fail
| YAML | mit | Ocramius/DoctrineBatchUtils | yaml | ## Code Before:
language: php
sudo: false
php:
- 7.1
- 7.2
- nightly
env:
- DEPENDENCIES="--prefer-lowest --prefer-stable"
- DEPENDENCIES=""
before_script:
- travis_retry composer update --prefer-dist $DEPENDENCIES
script:
- ./vendor/bin/phpunit --coverage-clover ./clover.xml
- php examples/persisting-new-objects-in-batch.php > /dev/null
- php examples/working-with-query-resultsets-in-batch.php > /dev/null
## Instruction:
Allow php nightly to fail
## Code After:
language: php
sudo: false
php:
- 7.1
- 7.2
- 7.3
- 7.4snapshot
- nightly
matrix:
allow_failures:
- php: nightly
env:
- DEPENDENCIES="--prefer-lowest --prefer-stable"
- DEPENDENCIES=""
before_script:
- travis_retry composer update --prefer-dist $DEPENDENCIES
script:
- ./vendor/bin/phpunit --coverage-clover ./clover.xml
- php examples/persisting-new-objects-in-batch.php > /dev/null
- php examples/working-with-query-resultsets-in-batch.php > /dev/null
| language: php
sudo: false
php:
- 7.1
- 7.2
+ - 7.3
+ - 7.4snapshot
- nightly
+
+ matrix:
+ allow_failures:
+ - php: nightly
env:
- DEPENDENCIES="--prefer-lowest --prefer-stable"
- DEPENDENCIES=""
before_script:
- travis_retry composer update --prefer-dist $DEPENDENCIES
script:
- ./vendor/bin/phpunit --coverage-clover ./clover.xml
- php examples/persisting-new-objects-in-batch.php > /dev/null
- php examples/working-with-query-resultsets-in-batch.php > /dev/null | 6 | 0.3 | 6 | 0 |
d733e048c2158c836931a2540633d653b670ce8f | test/bird-test.js | test/bird-test.js | const assert = require('chai').assert;
const Bird = require('../lib/bird')
describe ("Bird", function(){
context('with default attributes', function(){
var bird = new Bird();
it('should assign an x value', function(){
assert.equal(bird.x, 10);
})
it('should assign a y value', function(){
assert.equal(bird.y, 150);
})
it('should assign a width', function(){
assert.equal(bird.width, 10);
})
it('should assign a height', function(){
assert.equal(bird.height, 10);
})
}
context('with game functionality', function(){
var initial_bird = new Bird();
it('will go up from default', function(){
assert.equal(initial_bird.up.y, 135);
})
})
}
| const assert = require('chai').assert;
const Bird = require('../lib/bird')
describe ("Bird", function(){
context('with default attributes', function(){
var bird = new Bird();
it('should assign an x value', function(){
assert.equal(bird.x, 10);
})
it('should assign a y value', function(){
assert.equal(bird.y, 150);
})
it('should assign a width', function(){
assert.equal(bird.width, 10);
})
it('should assign a height', function(){
assert.equal(bird.height, 10);
})
}
context('with game functionality', function(){
var initial_bird = new Bird();
it('will go up from default', function(){
assert.equal(initial_bird.up.y, 135);
})
it('will go down from default', function(){
assert.equal(initial_bird.down.y, 165)
})
})
}
| Add down testing though not functional | Add down testing though not functional
| JavaScript | mit | jeneve/typrr-burn,jeneve/typrr-burn | javascript | ## Code Before:
const assert = require('chai').assert;
const Bird = require('../lib/bird')
describe ("Bird", function(){
context('with default attributes', function(){
var bird = new Bird();
it('should assign an x value', function(){
assert.equal(bird.x, 10);
})
it('should assign a y value', function(){
assert.equal(bird.y, 150);
})
it('should assign a width', function(){
assert.equal(bird.width, 10);
})
it('should assign a height', function(){
assert.equal(bird.height, 10);
})
}
context('with game functionality', function(){
var initial_bird = new Bird();
it('will go up from default', function(){
assert.equal(initial_bird.up.y, 135);
})
})
}
## Instruction:
Add down testing though not functional
## Code After:
const assert = require('chai').assert;
const Bird = require('../lib/bird')
describe ("Bird", function(){
context('with default attributes', function(){
var bird = new Bird();
it('should assign an x value', function(){
assert.equal(bird.x, 10);
})
it('should assign a y value', function(){
assert.equal(bird.y, 150);
})
it('should assign a width', function(){
assert.equal(bird.width, 10);
})
it('should assign a height', function(){
assert.equal(bird.height, 10);
})
}
context('with game functionality', function(){
var initial_bird = new Bird();
it('will go up from default', function(){
assert.equal(initial_bird.up.y, 135);
})
it('will go down from default', function(){
assert.equal(initial_bird.down.y, 165)
})
})
}
| const assert = require('chai').assert;
const Bird = require('../lib/bird')
describe ("Bird", function(){
context('with default attributes', function(){
var bird = new Bird();
it('should assign an x value', function(){
assert.equal(bird.x, 10);
})
it('should assign a y value', function(){
assert.equal(bird.y, 150);
})
it('should assign a width', function(){
assert.equal(bird.width, 10);
})
it('should assign a height', function(){
assert.equal(bird.height, 10);
})
}
context('with game functionality', function(){
var initial_bird = new Bird();
it('will go up from default', function(){
assert.equal(initial_bird.up.y, 135);
})
+
+ it('will go down from default', function(){
+ assert.equal(initial_bird.down.y, 165)
+ })
})
} | 4 | 0.121212 | 4 | 0 |
4fb947d0c7f9b51eed25c4b93aa25ac801cf185f | code/IFramePageController.php | code/IFramePageController.php | <?php
namespace SilverStripe\IFrame;
use SilverStripe\CMS\Controllers\ContentController;
use SilverStripe\Control\Director;
use SilverStripe\View\Requirements;
class IFramePageController extends ContentController
{
protected function init()
{
parent::init();
if ($this->ForceProtocol) {
if ($this->ForceProtocol == 'http://' && Director::protocol() != 'http://') {
return $this->redirect(preg_replace('#https://#', 'http://', $this->AbsoluteLink()));
} elseif ($this->ForceProtocol == 'https://' && Director::protocol() != 'https://') {
return $this->redirect(preg_replace('#http://#', 'https://', $this->AbsoluteLink()));
}
}
if ($this->IFrameURL) {
Requirements::javascript('iframe/javascript/iframe_page.js');
}
}
}
| <?php
namespace SilverStripe\IFrame;
use SilverStripe\CMS\Controllers\ContentController;
use SilverStripe\Control\Director;
use SilverStripe\View\Requirements;
class IFramePageController extends ContentController
{
protected function init()
{
parent::init();
$currentProtocol = Director::protocol();
$desiredProtocol = $this->ForceProtocol;
if ($desiredProtocol && $currentProtocol !== $desiredProtocol) {
$enforcedLocation = preg_replace(
"#^${currentProtocol}#",
$desiredProtocol,
$this->AbsoluteLink()
);
return $this->redirect($enforcedLocation);
}
if ($this->IFrameURL) {
Requirements::javascript('silverstripe/iframe: javascript/iframe_page.js');
}
}
}
| Use new resource loading syntax for javascript | FIX: Use new resource loading syntax for javascript
SilverStripe 4 vendormodule types make use of an 'expose' composer
directive to allow assets they provide to be accessed by a web request.
Previously the javascript for the iFrame resizing business tried to load
from a static path that no longer exists (referenced inside PHP), which
caused a fatal error. This has been fixed along with making the
conditional code for enforcing a protocol on the page's request a bit more
readable & easily digestable to developers.
| PHP | bsd-3-clause | silverstripe-labs/silverstripe-iframe,silverstripe-labs/silverstripe-iframe | php | ## Code Before:
<?php
namespace SilverStripe\IFrame;
use SilverStripe\CMS\Controllers\ContentController;
use SilverStripe\Control\Director;
use SilverStripe\View\Requirements;
class IFramePageController extends ContentController
{
protected function init()
{
parent::init();
if ($this->ForceProtocol) {
if ($this->ForceProtocol == 'http://' && Director::protocol() != 'http://') {
return $this->redirect(preg_replace('#https://#', 'http://', $this->AbsoluteLink()));
} elseif ($this->ForceProtocol == 'https://' && Director::protocol() != 'https://') {
return $this->redirect(preg_replace('#http://#', 'https://', $this->AbsoluteLink()));
}
}
if ($this->IFrameURL) {
Requirements::javascript('iframe/javascript/iframe_page.js');
}
}
}
## Instruction:
FIX: Use new resource loading syntax for javascript
SilverStripe 4 vendormodule types make use of an 'expose' composer
directive to allow assets they provide to be accessed by a web request.
Previously the javascript for the iFrame resizing business tried to load
from a static path that no longer exists (referenced inside PHP), which
caused a fatal error. This has been fixed along with making the
conditional code for enforcing a protocol on the page's request a bit more
readable & easily digestable to developers.
## Code After:
<?php
namespace SilverStripe\IFrame;
use SilverStripe\CMS\Controllers\ContentController;
use SilverStripe\Control\Director;
use SilverStripe\View\Requirements;
class IFramePageController extends ContentController
{
protected function init()
{
parent::init();
$currentProtocol = Director::protocol();
$desiredProtocol = $this->ForceProtocol;
if ($desiredProtocol && $currentProtocol !== $desiredProtocol) {
$enforcedLocation = preg_replace(
"#^${currentProtocol}#",
$desiredProtocol,
$this->AbsoluteLink()
);
return $this->redirect($enforcedLocation);
}
if ($this->IFrameURL) {
Requirements::javascript('silverstripe/iframe: javascript/iframe_page.js');
}
}
}
| <?php
namespace SilverStripe\IFrame;
use SilverStripe\CMS\Controllers\ContentController;
use SilverStripe\Control\Director;
use SilverStripe\View\Requirements;
class IFramePageController extends ContentController
{
protected function init()
{
parent::init();
-
- if ($this->ForceProtocol) {
- if ($this->ForceProtocol == 'http://' && Director::protocol() != 'http://') {
- return $this->redirect(preg_replace('#https://#', 'http://', $this->AbsoluteLink()));
- } elseif ($this->ForceProtocol == 'https://' && Director::protocol() != 'https://') {
- return $this->redirect(preg_replace('#http://#', 'https://', $this->AbsoluteLink()));
+ $currentProtocol = Director::protocol();
+ $desiredProtocol = $this->ForceProtocol;
+ if ($desiredProtocol && $currentProtocol !== $desiredProtocol) {
+ $enforcedLocation = preg_replace(
+ "#^${currentProtocol}#",
+ $desiredProtocol,
+ $this->AbsoluteLink()
- }
? ^
+ );
? ^^
+ return $this->redirect($enforcedLocation);
}
if ($this->IFrameURL) {
- Requirements::javascript('iframe/javascript/iframe_page.js');
? ^
+ Requirements::javascript('silverstripe/iframe: javascript/iframe_page.js');
? +++++++++++++ ^^
}
}
} | 18 | 0.666667 | 10 | 8 |
92269a82acd02d53a0947e345c4c5edd60bbfddc | .travis.yml | .travis.yml | language: php
php:
- "5.5"
- "5.4"
- "5.3"
before_script:
- composer require --dev aura/sql:dev-master
- composer install --dev --no-interaction
script:
- mkdir -p build/logs
- phpunit
after_script:
- php vendor/bin/coveralls -v
| language: php
php:
- "5.5"
- "5.4"
- "5.3"
before_script:
- composer require --dev aura/sql:1.3
- composer install --dev --no-interaction
script:
- mkdir -p build/logs
- phpunit
after_script:
- php vendor/bin/coveralls -v
| Prepare for DB testing (3) | Prepare for DB testing (3)
| YAML | mit | tomkyle/Databases | yaml | ## Code Before:
language: php
php:
- "5.5"
- "5.4"
- "5.3"
before_script:
- composer require --dev aura/sql:dev-master
- composer install --dev --no-interaction
script:
- mkdir -p build/logs
- phpunit
after_script:
- php vendor/bin/coveralls -v
## Instruction:
Prepare for DB testing (3)
## Code After:
language: php
php:
- "5.5"
- "5.4"
- "5.3"
before_script:
- composer require --dev aura/sql:1.3
- composer install --dev --no-interaction
script:
- mkdir -p build/logs
- phpunit
after_script:
- php vendor/bin/coveralls -v
| language: php
php:
- "5.5"
- "5.4"
- "5.3"
before_script:
- - composer require --dev aura/sql:dev-master
? ^^^^^^^^^^
+ - composer require --dev aura/sql:1.3
? ^^^
- composer install --dev --no-interaction
script:
- mkdir -p build/logs
- phpunit
after_script:
- php vendor/bin/coveralls -v | 2 | 0.111111 | 1 | 1 |
eaf6e5a623157a48026b0d4b0f52505fa32e1acc | src/browser/home/AddressList.react.js | src/browser/home/AddressList.react.js | import './AddressList.less';
import AddrLine from './AddrLine.react';
import React, { PropTypes } from 'react';
import Component from 'react-pure-render/component';
import { connect } from 'react-redux';
class AddressList extends Component {
static propTypes = {
addresses: PropTypes.object.isRequired,
msg: PropTypes.object,
};
render() {
const { addresses, msg } = this.props;
return (
<section className="device-switch-list">
{addresses.map(address =>
<AddrLine {...{ msg, address }} key={address.id} />
)
}
</section>
);
}
}
export default connect(state => ({
msg: state.intl.msg.home, /* PENDING: don't use this, create your own subtree in en.js */
}))(AddressList);
| import './AddressList.less';
import AddrLine from './AddrLine.react';
import React, { PropTypes } from 'react';
import Component from 'react-pure-render/component';
import { connect } from 'react-redux';
class AddressList extends Component {
static propTypes = {
addresses: PropTypes.object.isRequired,
msg: PropTypes.object,
};
render() {
const { addresses, msg } = this.props;
return (
<section className="device-switch-list">
{addresses.sortBy(addr => addr.name)
.sortBy(addr => !addr.value)
.map(address =>
<AddrLine {...{ msg, address }} key={address.id} />
)
}
</section>
);
}
}
export default connect(state => ({
msg: state.intl.msg.home, /* PENDING: don't use this, create your own subtree in en.js */
}))(AddressList);
| Sort addresses on home-screen by name and value. | Sort addresses on home-screen by name and value.
| JavaScript | mit | cjk/smart-home-app | javascript | ## Code Before:
import './AddressList.less';
import AddrLine from './AddrLine.react';
import React, { PropTypes } from 'react';
import Component from 'react-pure-render/component';
import { connect } from 'react-redux';
class AddressList extends Component {
static propTypes = {
addresses: PropTypes.object.isRequired,
msg: PropTypes.object,
};
render() {
const { addresses, msg } = this.props;
return (
<section className="device-switch-list">
{addresses.map(address =>
<AddrLine {...{ msg, address }} key={address.id} />
)
}
</section>
);
}
}
export default connect(state => ({
msg: state.intl.msg.home, /* PENDING: don't use this, create your own subtree in en.js */
}))(AddressList);
## Instruction:
Sort addresses on home-screen by name and value.
## Code After:
import './AddressList.less';
import AddrLine from './AddrLine.react';
import React, { PropTypes } from 'react';
import Component from 'react-pure-render/component';
import { connect } from 'react-redux';
class AddressList extends Component {
static propTypes = {
addresses: PropTypes.object.isRequired,
msg: PropTypes.object,
};
render() {
const { addresses, msg } = this.props;
return (
<section className="device-switch-list">
{addresses.sortBy(addr => addr.name)
.sortBy(addr => !addr.value)
.map(address =>
<AddrLine {...{ msg, address }} key={address.id} />
)
}
</section>
);
}
}
export default connect(state => ({
msg: state.intl.msg.home, /* PENDING: don't use this, create your own subtree in en.js */
}))(AddressList);
| import './AddressList.less';
import AddrLine from './AddrLine.react';
import React, { PropTypes } from 'react';
import Component from 'react-pure-render/component';
import { connect } from 'react-redux';
class AddressList extends Component {
static propTypes = {
addresses: PropTypes.object.isRequired,
msg: PropTypes.object,
};
render() {
const { addresses, msg } = this.props;
return (
<section className="device-switch-list">
- {addresses.map(address =>
+ {addresses.sortBy(addr => addr.name)
+ .sortBy(addr => !addr.value)
+ .map(address =>
- <AddrLine {...{ msg, address }} key={address.id} />
+ <AddrLine {...{ msg, address }} key={address.id} />
? ++++++++++
- )
+ )
}
</section>
);
}
}
export default connect(state => ({
msg: state.intl.msg.home, /* PENDING: don't use this, create your own subtree in en.js */
}))(AddressList); | 8 | 0.266667 | 5 | 3 |
bebf614c13299374931d82f2ced5e461b013e97d | .github/workflows/prevent-prod-merges.yml | .github/workflows/prevent-prod-merges.yml | name: Prevent prod to staging merges
on:
pull_request:
branches: staging
jobs:
check-branch:
runs-on: ubuntu-latest
steps:
- name: Fail if we are merging prod to staging
run: |
env
echo $GITHUB_REF | grep -v prod
cat $GITHUB_EVENT_PATH | name: Prevent prod to staging merges
on:
pull_request:
branches: staging
jobs:
check-branch:
runs-on: ubuntu-latest
steps:
- name: Fail if we are merging prod to staging
run: |
echo $GITHUB_HEAD_REF | grep -v prod | Use $GITHUB_HEAD_REF instead of $GITHUB_REF | ci: Use $GITHUB_HEAD_REF instead of $GITHUB_REF
seems to properly refer to the name of branch that
is being merged.
| YAML | bsd-3-clause | ryanlovett/datahub,ryanlovett/datahub,berkeley-dsep-infra/datahub,berkeley-dsep-infra/datahub,berkeley-dsep-infra/datahub,ryanlovett/datahub | yaml | ## Code Before:
name: Prevent prod to staging merges
on:
pull_request:
branches: staging
jobs:
check-branch:
runs-on: ubuntu-latest
steps:
- name: Fail if we are merging prod to staging
run: |
env
echo $GITHUB_REF | grep -v prod
cat $GITHUB_EVENT_PATH
## Instruction:
ci: Use $GITHUB_HEAD_REF instead of $GITHUB_REF
seems to properly refer to the name of branch that
is being merged.
## Code After:
name: Prevent prod to staging merges
on:
pull_request:
branches: staging
jobs:
check-branch:
runs-on: ubuntu-latest
steps:
- name: Fail if we are merging prod to staging
run: |
echo $GITHUB_HEAD_REF | grep -v prod | name: Prevent prod to staging merges
on:
pull_request:
branches: staging
jobs:
check-branch:
runs-on: ubuntu-latest
steps:
- name: Fail if we are merging prod to staging
run: |
- env
- echo $GITHUB_REF | grep -v prod
+ echo $GITHUB_HEAD_REF | grep -v prod
? +++++
- cat $GITHUB_EVENT_PATH | 4 | 0.266667 | 1 | 3 |
d176026894f7d190fd58cec08c9d23688e52006f | lib/prettier.js | lib/prettier.js | module.exports = {
tabWidth: 4,
printWidth: 100,
singleQuote: true,
arrowParens: "always",
trailingComma: "all",
overrides: [
{
files: ["*.json"],
options: {
parser: "json",
tabWidth: 2,
singleQuote: false,
},
},
{
files: ["*.yml"],
options: {
parser: "yml",
tabWidth: 2,
singleQuote: false,
},
},
],
};
| module.exports = {
tabWidth: 4,
printWidth: 100,
singleQuote: true,
arrowParens: "always",
trailingComma: "all",
overrides: [
{
files: ["*.json"],
options: {
parser: "json",
tabWidth: 2,
singleQuote: false,
},
},
{
files: ["*.yml"],
options: {
parser: "yml",
tabWidth: 2,
singleQuote: false,
},
},
{
files: ["*.css"],
options: {
parser: "css",
singleQuote: false,
},
},
{
files: ["*.scss"],
options: {
parser: "scss",
singleQuote: false,
},
},
],
};
| Add stylesheets rules for Prettier | Add stylesheets rules for Prettier
| JavaScript | mit | prezly/code-style,prezly/code-style | javascript | ## Code Before:
module.exports = {
tabWidth: 4,
printWidth: 100,
singleQuote: true,
arrowParens: "always",
trailingComma: "all",
overrides: [
{
files: ["*.json"],
options: {
parser: "json",
tabWidth: 2,
singleQuote: false,
},
},
{
files: ["*.yml"],
options: {
parser: "yml",
tabWidth: 2,
singleQuote: false,
},
},
],
};
## Instruction:
Add stylesheets rules for Prettier
## Code After:
module.exports = {
tabWidth: 4,
printWidth: 100,
singleQuote: true,
arrowParens: "always",
trailingComma: "all",
overrides: [
{
files: ["*.json"],
options: {
parser: "json",
tabWidth: 2,
singleQuote: false,
},
},
{
files: ["*.yml"],
options: {
parser: "yml",
tabWidth: 2,
singleQuote: false,
},
},
{
files: ["*.css"],
options: {
parser: "css",
singleQuote: false,
},
},
{
files: ["*.scss"],
options: {
parser: "scss",
singleQuote: false,
},
},
],
};
| module.exports = {
tabWidth: 4,
printWidth: 100,
singleQuote: true,
arrowParens: "always",
trailingComma: "all",
overrides: [
{
files: ["*.json"],
options: {
parser: "json",
tabWidth: 2,
singleQuote: false,
},
},
{
files: ["*.yml"],
options: {
parser: "yml",
tabWidth: 2,
singleQuote: false,
},
},
+ {
+ files: ["*.css"],
+ options: {
+ parser: "css",
+ singleQuote: false,
+ },
+ },
+ {
+ files: ["*.scss"],
+ options: {
+ parser: "scss",
+ singleQuote: false,
+ },
+ },
],
}; | 14 | 0.538462 | 14 | 0 |
316ccd39b8e707b8a5f5cd07423560bcb8a6faec | README.md | README.md |
Probably only works with react-16+
`yarn add react-guitar-chords`
```javascript
import React from 'react';
import GuitarChord from 'react-guitar-chords';
const MyChord = () => {
return (
<GuitarChord
chordName='C major'
frets={['x', 3, 2, 0, 1, 0]}
/>
);
}
export default MyChord;
```
## Development Setup
Built with [create-react-library](https://github.com/udiliaInc/create-react-library.git)
````
git clone git@github.com:evan-007/react-guitar-chords.git
````
Install dependencies
`yarn install`
Start development server
`yarn start`
Runs the demo app in development mode.
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
## Library files
All library files are located inside `src/lib`
## Demo app
Is located inside `src/demo` directory, here you can test your library while developing
## Testing
`yarn run test`
## Build library
`yarn run build`
Produces production version of library under the `build` folder.
## Publish library
`yarn publish`
|
Needs react-16+
[Demo](http://ruddy-zebra.surge.sh/)
`yarn add react-guitar-chords`
```javascript
import React from 'react';
import GuitarChord from 'react-guitar-chords';
const MyChord = () => {
return (
<GuitarChord
chordName='C major'
frets={['x', 3, 2, 0, 1, 0]}
/>
);
}
export default MyChord;
```
## Development Setup
Built with [create-react-library](https://github.com/udiliaInc/create-react-library.git)
````
git clone git@github.com:evan-007/react-guitar-chords.git
````
Install dependencies
`yarn install`
Start development server
`yarn start`
Runs the demo app in development mode.
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
## Library files
All library files are located inside `src/lib`
## Demo app
Is located inside `src/demo` directory, here you can test your library while developing
## Testing
`yarn run test`
## Build library
`yarn run build`
Produces production version of library under the `build` folder.
## Publish library
`yarn publish`
| Add demo site to readme | Add demo site to readme
| Markdown | mit | evan-007/react-guitar-chords,evan-007/react-guitar-chords | markdown | ## Code Before:
Probably only works with react-16+
`yarn add react-guitar-chords`
```javascript
import React from 'react';
import GuitarChord from 'react-guitar-chords';
const MyChord = () => {
return (
<GuitarChord
chordName='C major'
frets={['x', 3, 2, 0, 1, 0]}
/>
);
}
export default MyChord;
```
## Development Setup
Built with [create-react-library](https://github.com/udiliaInc/create-react-library.git)
````
git clone git@github.com:evan-007/react-guitar-chords.git
````
Install dependencies
`yarn install`
Start development server
`yarn start`
Runs the demo app in development mode.
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
## Library files
All library files are located inside `src/lib`
## Demo app
Is located inside `src/demo` directory, here you can test your library while developing
## Testing
`yarn run test`
## Build library
`yarn run build`
Produces production version of library under the `build` folder.
## Publish library
`yarn publish`
## Instruction:
Add demo site to readme
## Code After:
Needs react-16+
[Demo](http://ruddy-zebra.surge.sh/)
`yarn add react-guitar-chords`
```javascript
import React from 'react';
import GuitarChord from 'react-guitar-chords';
const MyChord = () => {
return (
<GuitarChord
chordName='C major'
frets={['x', 3, 2, 0, 1, 0]}
/>
);
}
export default MyChord;
```
## Development Setup
Built with [create-react-library](https://github.com/udiliaInc/create-react-library.git)
````
git clone git@github.com:evan-007/react-guitar-chords.git
````
Install dependencies
`yarn install`
Start development server
`yarn start`
Runs the demo app in development mode.
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
## Library files
All library files are located inside `src/lib`
## Demo app
Is located inside `src/demo` directory, here you can test your library while developing
## Testing
`yarn run test`
## Build library
`yarn run build`
Produces production version of library under the `build` folder.
## Publish library
`yarn publish`
|
- Probably only works with react-16+
+ Needs react-16+
+
+ [Demo](http://ruddy-zebra.surge.sh/)
`yarn add react-guitar-chords`
```javascript
import React from 'react';
import GuitarChord from 'react-guitar-chords';
const MyChord = () => {
return (
<GuitarChord
chordName='C major'
frets={['x', 3, 2, 0, 1, 0]}
/>
);
}
export default MyChord;
```
## Development Setup
Built with [create-react-library](https://github.com/udiliaInc/create-react-library.git)
````
git clone git@github.com:evan-007/react-guitar-chords.git
````
Install dependencies
`yarn install`
Start development server
`yarn start`
Runs the demo app in development mode.
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
## Library files
All library files are located inside `src/lib`
## Demo app
Is located inside `src/demo` directory, here you can test your library while developing
## Testing
`yarn run test`
## Build library
`yarn run build`
Produces production version of library under the `build` folder.
## Publish library
`yarn publish` | 4 | 0.065574 | 3 | 1 |
f0e94176c2ce97278b7ac1c8a6bbdd1dad4c68a5 | virtualenvs/data-requirements.txt | virtualenvs/data-requirements.txt | numpy
scipy
# math and modeling
pandas
scikit-learn
statsmodels
# charting
matplotlib
seaborn
# other utilities
awscli
Cython
gapi
nltk
jupyter
ujson
| numpy
scipy
# math and modeling
pandas
scikit-learn
statsmodels
# charting
matplotlib
seaborn
# other utilities
awscli
Cython
gapi
pandashells[full]
nltk
jupyter
ujson
| Include pandashells in pip reqs | Include pandashells in pip reqs
| Text | mit | jrmontag/dotfiles | text | ## Code Before:
numpy
scipy
# math and modeling
pandas
scikit-learn
statsmodels
# charting
matplotlib
seaborn
# other utilities
awscli
Cython
gapi
nltk
jupyter
ujson
## Instruction:
Include pandashells in pip reqs
## Code After:
numpy
scipy
# math and modeling
pandas
scikit-learn
statsmodels
# charting
matplotlib
seaborn
# other utilities
awscli
Cython
gapi
pandashells[full]
nltk
jupyter
ujson
| numpy
scipy
# math and modeling
pandas
scikit-learn
statsmodels
# charting
matplotlib
seaborn
# other utilities
awscli
Cython
gapi
+ pandashells[full]
nltk
jupyter
ujson | 1 | 0.052632 | 1 | 0 |
bd92de5dc76170f28da25b0aa0698287b47fe53f | client/ember/app/routes/movies/view.js | client/ember/app/routes/movies/view.js | import Ember from 'ember';
export default Ember.Route.extend({
});
| import Ember from 'ember';
import config from 'polyflix/config/environment';
import TmdbMovie from 'polyflix/models/tmdb-movie';
export default Ember.Route.extend({
model: function(params) {
var id = params.id;
console.log('info', id);
return Ember.$.get(config.restURL + '/movies/info/' + id)
.done(response => {
var tmdbMovie = TmdbMovie.create(response);
console.log('info result:', tmdbMovie);
return tmdbMovie;
});
}
});
| Load movie info from server | Load movie info from server
| JavaScript | mit | ryanbradynd05/polyflix,ryanbradynd05/polyflix,ryanbradynd05/polyflix,ryanbradynd05/polyflix,ryanbradynd05/polyflix | javascript | ## Code Before:
import Ember from 'ember';
export default Ember.Route.extend({
});
## Instruction:
Load movie info from server
## Code After:
import Ember from 'ember';
import config from 'polyflix/config/environment';
import TmdbMovie from 'polyflix/models/tmdb-movie';
export default Ember.Route.extend({
model: function(params) {
var id = params.id;
console.log('info', id);
return Ember.$.get(config.restURL + '/movies/info/' + id)
.done(response => {
var tmdbMovie = TmdbMovie.create(response);
console.log('info result:', tmdbMovie);
return tmdbMovie;
});
}
});
| import Ember from 'ember';
+ import config from 'polyflix/config/environment';
+ import TmdbMovie from 'polyflix/models/tmdb-movie';
export default Ember.Route.extend({
+ model: function(params) {
+ var id = params.id;
+ console.log('info', id);
+ return Ember.$.get(config.restURL + '/movies/info/' + id)
+ .done(response => {
+ var tmdbMovie = TmdbMovie.create(response);
+ console.log('info result:', tmdbMovie);
+ return tmdbMovie;
+ });
+ }
}); | 12 | 3 | 12 | 0 |
e4fde66624f74c4b0bbfae7c7c11a50884a0a73c | pyfr/readers/base.py | pyfr/readers/base.py |
from abc import ABCMeta, abstractmethod
import uuid
class BaseReader(object, metaclass=ABCMeta):
@abstractmethod
def __init__(self):
pass
@abstractmethod
def _to_raw_pyfrm(self):
pass
def to_pyfrm(self):
mesh = self._to_raw_pyfrm()
# Add metadata
mesh['mesh_uuid'] = str(uuid.uuid4())
return mesh
|
from abc import ABCMeta, abstractmethod
import uuid
import numpy as np
class BaseReader(object, metaclass=ABCMeta):
@abstractmethod
def __init__(self):
pass
@abstractmethod
def _to_raw_pyfrm(self):
pass
def to_pyfrm(self):
mesh = self._to_raw_pyfrm()
# Add metadata
mesh['mesh_uuid'] = np.array(str(uuid.uuid4()), dtype='S')
return mesh
| Fix the HDF5 type of mesh_uuid for imported meshes. | Fix the HDF5 type of mesh_uuid for imported meshes.
| Python | bsd-3-clause | BrianVermeire/PyFR,Aerojspark/PyFR | python | ## Code Before:
from abc import ABCMeta, abstractmethod
import uuid
class BaseReader(object, metaclass=ABCMeta):
@abstractmethod
def __init__(self):
pass
@abstractmethod
def _to_raw_pyfrm(self):
pass
def to_pyfrm(self):
mesh = self._to_raw_pyfrm()
# Add metadata
mesh['mesh_uuid'] = str(uuid.uuid4())
return mesh
## Instruction:
Fix the HDF5 type of mesh_uuid for imported meshes.
## Code After:
from abc import ABCMeta, abstractmethod
import uuid
import numpy as np
class BaseReader(object, metaclass=ABCMeta):
@abstractmethod
def __init__(self):
pass
@abstractmethod
def _to_raw_pyfrm(self):
pass
def to_pyfrm(self):
mesh = self._to_raw_pyfrm()
# Add metadata
mesh['mesh_uuid'] = np.array(str(uuid.uuid4()), dtype='S')
return mesh
|
from abc import ABCMeta, abstractmethod
import uuid
+
+ import numpy as np
class BaseReader(object, metaclass=ABCMeta):
@abstractmethod
def __init__(self):
pass
@abstractmethod
def _to_raw_pyfrm(self):
pass
def to_pyfrm(self):
mesh = self._to_raw_pyfrm()
# Add metadata
- mesh['mesh_uuid'] = str(uuid.uuid4())
+ mesh['mesh_uuid'] = np.array(str(uuid.uuid4()), dtype='S')
? +++++++++ ++++++++++++
return mesh | 4 | 0.190476 | 3 | 1 |
9241b7947ddd7c18e858000503b19c40b1b954ab | manifest.json | manifest.json | {
"name": "Baikal",
"id": "baikal",
"description": {
"en": "Lightweight CalDAV+CardDAV server",
"fr": "Serveur CalDAV+CardDAV léger"
},
"developer": {
"name": "aquaxp",
"email": "n@a.ru",
"url": "https://github.com/aquaxp"
},
"multi_instance": "true",
"arguments": {
"install" : [
{
"name": "domain",
"ask": {
"en": "Choose a domain for baikal"
},
"example": "domain.org"
},
{
"name": "path",
"ask": {
"en": "Choose a path for baikal"
},
"example": "/baikal",
"default": "/baikal"
},
{
"name": "password",
"ask": {
"en": "Choose a password for baikal admin"
},
"example": "mysecret"
}
]
}
}
| {
"name": "Baikal",
"id": "baikal",
"description": {
"en": "Lightweight CalDAV+CardDAV server",
"fr": "Serveur CalDAV+CardDAV léger"
},
"licence": "GNU GPL-3",
"developer": {
"name": "julien",
"email": "julien.malik@paraiso.me",
"url": "https://github.com/aquaxp"
},
"multi_instance": "true",
"arguments": {
"install" : [
{
"name": "domain",
"ask": {
"en": "Choose a domain for baikal"
},
"example": "domain.org"
},
{
"name": "path",
"ask": {
"en": "Choose a path for baikal"
},
"example": "/baikal",
"default": "/baikal"
},
{
"name": "password",
"ask": {
"en": "Choose a password for baikal admin"
},
"example": "mysecret"
}
]
}
}
| Add licence and change mantainer informations | Add licence and change mantainer informations | JSON | agpl-3.0 | aquaxp/baikal_ynh,aquaxp/baikal_ynh | json | ## Code Before:
{
"name": "Baikal",
"id": "baikal",
"description": {
"en": "Lightweight CalDAV+CardDAV server",
"fr": "Serveur CalDAV+CardDAV léger"
},
"developer": {
"name": "aquaxp",
"email": "n@a.ru",
"url": "https://github.com/aquaxp"
},
"multi_instance": "true",
"arguments": {
"install" : [
{
"name": "domain",
"ask": {
"en": "Choose a domain for baikal"
},
"example": "domain.org"
},
{
"name": "path",
"ask": {
"en": "Choose a path for baikal"
},
"example": "/baikal",
"default": "/baikal"
},
{
"name": "password",
"ask": {
"en": "Choose a password for baikal admin"
},
"example": "mysecret"
}
]
}
}
## Instruction:
Add licence and change mantainer informations
## Code After:
{
"name": "Baikal",
"id": "baikal",
"description": {
"en": "Lightweight CalDAV+CardDAV server",
"fr": "Serveur CalDAV+CardDAV léger"
},
"licence": "GNU GPL-3",
"developer": {
"name": "julien",
"email": "julien.malik@paraiso.me",
"url": "https://github.com/aquaxp"
},
"multi_instance": "true",
"arguments": {
"install" : [
{
"name": "domain",
"ask": {
"en": "Choose a domain for baikal"
},
"example": "domain.org"
},
{
"name": "path",
"ask": {
"en": "Choose a path for baikal"
},
"example": "/baikal",
"default": "/baikal"
},
{
"name": "password",
"ask": {
"en": "Choose a password for baikal admin"
},
"example": "mysecret"
}
]
}
}
| {
"name": "Baikal",
"id": "baikal",
"description": {
"en": "Lightweight CalDAV+CardDAV server",
"fr": "Serveur CalDAV+CardDAV léger"
},
+ "licence": "GNU GPL-3",
"developer": {
- "name": "aquaxp",
? ^^ ^^^
+ "name": "julien",
? ^ ^^^^
- "email": "n@a.ru",
+ "email": "julien.malik@paraiso.me",
"url": "https://github.com/aquaxp"
},
"multi_instance": "true",
"arguments": {
"install" : [
{
"name": "domain",
"ask": {
"en": "Choose a domain for baikal"
},
"example": "domain.org"
},
{
"name": "path",
"ask": {
"en": "Choose a path for baikal"
},
"example": "/baikal",
"default": "/baikal"
},
{
"name": "password",
"ask": {
"en": "Choose a password for baikal admin"
},
"example": "mysecret"
}
]
}
} | 5 | 0.125 | 3 | 2 |
5f7d43f706a02ee07a66934245e72746483bacdf | PSScriptAnalyzerSettings.psd1 | PSScriptAnalyzerSettings.psd1 | @{
IncludeRules = @('*')
Rules = @{
# The statement assignment alignment check applies to the hashtable
# assignment itself and not just its properties.
PSAlignAssignmentStatement = @{
Enable = $false
CheckHashtable = $true
}
PSPlaceCloseBrace = @{
Enable = $true
IgnoreOneLineBlock = $true
NewLineAfter = $false
NoEmptyLineBefore = $false
}
PSPlaceOpenBrace = @{
Enable = $true
IgnoreOneLineBlock = $true
NewLineAfter = $true
OnSameLine = $true
}
PSProvideCommentHelp = @{
Enable = $true
BlockComment = $true
ExportedOnly = $true
Placement = 'begin'
VSCodeSnippetCorrection = $false
}
PSUseConsistentIndentation = @{
Enable = $true
IndentationSize = 4
Kind = 'space'
}
# CheckOperator doesn't work with aligned hashtable assignment
# statements (GitHub Issue #769).
PSUseConsistentWhitespace = @{
Enable = $true
CheckOpenBrace = $true
CheckOpenParen = $true
CheckOperator = $false
CheckSeparator = $true
}
}
}
| @{
IncludeRules = @('*')
Rules = @{
# The statement assignment alignment check applies to the hashtable
# assignment itself and not just its properties.
PSAlignAssignmentStatement = @{
Enable = $false
CheckHashtable = $true
}
PSPlaceCloseBrace = @{
Enable = $true
IgnoreOneLineBlock = $true
NewLineAfter = $false
NoEmptyLineBefore = $false
}
PSPlaceOpenBrace = @{
Enable = $true
IgnoreOneLineBlock = $true
NewLineAfter = $true
OnSameLine = $true
}
PSProvideCommentHelp = @{
Enable = $true
BlockComment = $true
ExportedOnly = $true
Placement = 'begin'
VSCodeSnippetCorrection = $false
}
PSUseConsistentIndentation = @{
Enable = $true
IndentationSize = 4
Kind = 'space'
PipelineIndentation = 'IncreaseIndentationForFirstPipeline'
}
# CheckOperator doesn't work with aligned hashtable assignment
# statements (GitHub Issue #769).
PSUseConsistentWhitespace = @{
Enable = $true
CheckInnerBrace = $true
CheckOpenBrace = $true
CheckOpenParen = $true
CheckOperator = $false
CheckPipe = $true
CheckSeparator = $true
}
}
}
| Add new PSScriptAnalyzer rule options | Add new PSScriptAnalyzer rule options
| PowerShell | mit | ralish/PSWinGlue | powershell | ## Code Before:
@{
IncludeRules = @('*')
Rules = @{
# The statement assignment alignment check applies to the hashtable
# assignment itself and not just its properties.
PSAlignAssignmentStatement = @{
Enable = $false
CheckHashtable = $true
}
PSPlaceCloseBrace = @{
Enable = $true
IgnoreOneLineBlock = $true
NewLineAfter = $false
NoEmptyLineBefore = $false
}
PSPlaceOpenBrace = @{
Enable = $true
IgnoreOneLineBlock = $true
NewLineAfter = $true
OnSameLine = $true
}
PSProvideCommentHelp = @{
Enable = $true
BlockComment = $true
ExportedOnly = $true
Placement = 'begin'
VSCodeSnippetCorrection = $false
}
PSUseConsistentIndentation = @{
Enable = $true
IndentationSize = 4
Kind = 'space'
}
# CheckOperator doesn't work with aligned hashtable assignment
# statements (GitHub Issue #769).
PSUseConsistentWhitespace = @{
Enable = $true
CheckOpenBrace = $true
CheckOpenParen = $true
CheckOperator = $false
CheckSeparator = $true
}
}
}
## Instruction:
Add new PSScriptAnalyzer rule options
## Code After:
@{
IncludeRules = @('*')
Rules = @{
# The statement assignment alignment check applies to the hashtable
# assignment itself and not just its properties.
PSAlignAssignmentStatement = @{
Enable = $false
CheckHashtable = $true
}
PSPlaceCloseBrace = @{
Enable = $true
IgnoreOneLineBlock = $true
NewLineAfter = $false
NoEmptyLineBefore = $false
}
PSPlaceOpenBrace = @{
Enable = $true
IgnoreOneLineBlock = $true
NewLineAfter = $true
OnSameLine = $true
}
PSProvideCommentHelp = @{
Enable = $true
BlockComment = $true
ExportedOnly = $true
Placement = 'begin'
VSCodeSnippetCorrection = $false
}
PSUseConsistentIndentation = @{
Enable = $true
IndentationSize = 4
Kind = 'space'
PipelineIndentation = 'IncreaseIndentationForFirstPipeline'
}
# CheckOperator doesn't work with aligned hashtable assignment
# statements (GitHub Issue #769).
PSUseConsistentWhitespace = @{
Enable = $true
CheckInnerBrace = $true
CheckOpenBrace = $true
CheckOpenParen = $true
CheckOperator = $false
CheckPipe = $true
CheckSeparator = $true
}
}
}
| @{
IncludeRules = @('*')
Rules = @{
# The statement assignment alignment check applies to the hashtable
# assignment itself and not just its properties.
PSAlignAssignmentStatement = @{
Enable = $false
CheckHashtable = $true
}
PSPlaceCloseBrace = @{
Enable = $true
IgnoreOneLineBlock = $true
NewLineAfter = $false
NoEmptyLineBefore = $false
}
PSPlaceOpenBrace = @{
Enable = $true
IgnoreOneLineBlock = $true
NewLineAfter = $true
OnSameLine = $true
}
PSProvideCommentHelp = @{
Enable = $true
BlockComment = $true
ExportedOnly = $true
Placement = 'begin'
VSCodeSnippetCorrection = $false
}
PSUseConsistentIndentation = @{
Enable = $true
IndentationSize = 4
Kind = 'space'
+ PipelineIndentation = 'IncreaseIndentationForFirstPipeline'
}
# CheckOperator doesn't work with aligned hashtable assignment
# statements (GitHub Issue #769).
PSUseConsistentWhitespace = @{
Enable = $true
+ CheckInnerBrace = $true
CheckOpenBrace = $true
CheckOpenParen = $true
CheckOperator = $false
+ CheckPipe = $true
CheckSeparator = $true
}
}
} | 3 | 0.06 | 3 | 0 |
1b40f84588ccaa36d85d84179c05da89ae876fd2 | README.md | README.md | dotfiles
====================
dotfiles for Linux/BSD/Cygwin.
`vimrc` and `gvimrc` are also used by Vim on Windows.
Refer to the `dotfiles_w` repository for what is used on Windows only.
Installation
--------------------
```bash
git clone https://github.com/curipha/dotfiles.git
./dotfiles/_setup.sh
```
or
```bash
git clone git@github.com:curipha/dotfiles.git
./dotfiles/_setup.sh
```
Remarks
--------------------
### bash_profile
Hide bash and run zsh.
I made it because there was an environment where it could not `chsh`.
Links
--------------------
### Fonts
- [Migmix](https://mix-mplus-ipa.osdn.jp/migmix/) (Japanese font)
- [Source Han Code JP](https://github.com/adobe-fonts/source-han-code-jp) (Japanese font)
- [Fira](https://github.com/mozilla/Fira)
- [Source Code Pro](https://github.com/adobe-fonts/source-code-pro)
| dotfiles [](https://circleci.com/gh/curipha/dotfiles)
====================
dotfiles for Linux/BSD/Cygwin.
`vimrc` and `gvimrc` are also used by Vim on Windows.
Refer to the `dotfiles_w` repository for what is used on Windows only.
Installation
--------------------
```bash
git clone https://github.com/curipha/dotfiles.git
./dotfiles/_setup.sh
```
or
```bash
git clone git@github.com:curipha/dotfiles.git
./dotfiles/_setup.sh
```
Remarks
--------------------
### bash_profile
Hide bash and run zsh.
I made it because there was an environment where it could not `chsh`.
Links
--------------------
### Fonts
- [Migmix](https://mix-mplus-ipa.osdn.jp/migmix/) (Japanese font)
- [Source Han Code JP](https://github.com/adobe-fonts/source-han-code-jp) (Japanese font)
- [Fira](https://github.com/mozilla/Fira)
- [Source Code Pro](https://github.com/adobe-fonts/source-code-pro)
| Add status badge of CircleCI | Add status badge of CircleCI
| Markdown | unlicense | curipha/dotfiles | markdown | ## Code Before:
dotfiles
====================
dotfiles for Linux/BSD/Cygwin.
`vimrc` and `gvimrc` are also used by Vim on Windows.
Refer to the `dotfiles_w` repository for what is used on Windows only.
Installation
--------------------
```bash
git clone https://github.com/curipha/dotfiles.git
./dotfiles/_setup.sh
```
or
```bash
git clone git@github.com:curipha/dotfiles.git
./dotfiles/_setup.sh
```
Remarks
--------------------
### bash_profile
Hide bash and run zsh.
I made it because there was an environment where it could not `chsh`.
Links
--------------------
### Fonts
- [Migmix](https://mix-mplus-ipa.osdn.jp/migmix/) (Japanese font)
- [Source Han Code JP](https://github.com/adobe-fonts/source-han-code-jp) (Japanese font)
- [Fira](https://github.com/mozilla/Fira)
- [Source Code Pro](https://github.com/adobe-fonts/source-code-pro)
## Instruction:
Add status badge of CircleCI
## Code After:
dotfiles [](https://circleci.com/gh/curipha/dotfiles)
====================
dotfiles for Linux/BSD/Cygwin.
`vimrc` and `gvimrc` are also used by Vim on Windows.
Refer to the `dotfiles_w` repository for what is used on Windows only.
Installation
--------------------
```bash
git clone https://github.com/curipha/dotfiles.git
./dotfiles/_setup.sh
```
or
```bash
git clone git@github.com:curipha/dotfiles.git
./dotfiles/_setup.sh
```
Remarks
--------------------
### bash_profile
Hide bash and run zsh.
I made it because there was an environment where it could not `chsh`.
Links
--------------------
### Fonts
- [Migmix](https://mix-mplus-ipa.osdn.jp/migmix/) (Japanese font)
- [Source Han Code JP](https://github.com/adobe-fonts/source-han-code-jp) (Japanese font)
- [Fira](https://github.com/mozilla/Fira)
- [Source Code Pro](https://github.com/adobe-fonts/source-code-pro)
| - dotfiles
+ dotfiles [](https://circleci.com/gh/curipha/dotfiles)
====================
dotfiles for Linux/BSD/Cygwin.
`vimrc` and `gvimrc` are also used by Vim on Windows.
Refer to the `dotfiles_w` repository for what is used on Windows only.
Installation
--------------------
```bash
git clone https://github.com/curipha/dotfiles.git
./dotfiles/_setup.sh
```
or
```bash
git clone git@github.com:curipha/dotfiles.git
./dotfiles/_setup.sh
```
Remarks
--------------------
### bash_profile
Hide bash and run zsh.
I made it because there was an environment where it could not `chsh`.
Links
--------------------
### Fonts
- [Migmix](https://mix-mplus-ipa.osdn.jp/migmix/) (Japanese font)
- [Source Han Code JP](https://github.com/adobe-fonts/source-han-code-jp) (Japanese font)
- [Fira](https://github.com/mozilla/Fira)
- [Source Code Pro](https://github.com/adobe-fonts/source-code-pro) | 2 | 0.054054 | 1 | 1 |
8e5c7e9544e67e2ec65e75a2ece463d3f5d7defd | spec/hash_branch_spec.rb | spec/hash_branch_spec.rb | require 'spec_helper'
require 'compo'
describe Compo::HashBranch do
describe '#initialize' do
it 'initialises with a Parentless as parent' do
expect(subject.parent).to be_a(Compo::Parentless)
end
it 'initialises with an ID function returning nil' do
expect(subject.id).to be_nil
end
end
end
| require 'spec_helper'
require 'compo'
require 'hash_composite_spec'
describe Compo::HashBranch do
describe '#initialize' do
it 'initialises with a Parentless as parent' do
expect(subject.parent).to be_a(Compo::Parentless)
end
it 'initialises with an ID function returning nil' do
expect(subject.id).to be_nil
end
end
it_behaves_like 'a hash composite'
end
| Include hash composite examples in HashBranch. | Include hash composite examples in HashBranch.
| Ruby | mit | CaptainHayashi/compo | ruby | ## Code Before:
require 'spec_helper'
require 'compo'
describe Compo::HashBranch do
describe '#initialize' do
it 'initialises with a Parentless as parent' do
expect(subject.parent).to be_a(Compo::Parentless)
end
it 'initialises with an ID function returning nil' do
expect(subject.id).to be_nil
end
end
end
## Instruction:
Include hash composite examples in HashBranch.
## Code After:
require 'spec_helper'
require 'compo'
require 'hash_composite_spec'
describe Compo::HashBranch do
describe '#initialize' do
it 'initialises with a Parentless as parent' do
expect(subject.parent).to be_a(Compo::Parentless)
end
it 'initialises with an ID function returning nil' do
expect(subject.id).to be_nil
end
end
it_behaves_like 'a hash composite'
end
| require 'spec_helper'
require 'compo'
+ require 'hash_composite_spec'
describe Compo::HashBranch do
describe '#initialize' do
it 'initialises with a Parentless as parent' do
expect(subject.parent).to be_a(Compo::Parentless)
end
it 'initialises with an ID function returning nil' do
expect(subject.id).to be_nil
end
end
+
+ it_behaves_like 'a hash composite'
end | 3 | 0.214286 | 3 | 0 |
fc20c3437dbde7e7305c6e2feacad770516f0d02 | package.json | package.json | {
"name": "zooniverse-readymade",
"version": "0.4.0",
"bin": "./bin/zooniverse-readymade",
"dependencies": {
"coffee-script": "1.7.x",
"haw": "^0.5.0",
"jquery": "^2.1.0",
"marking-surface": "^0.6.4",
"publisssh": "~0.2.4",
"stack-of-pages": "~0.1.3",
"zooniverse": "~0.3.8",
"zooniverse-decision-tree": "0.0.2"
},
"scripts": {
"start": "npm run serve & npm run watch",
"watch": "coffee --output ./lib --watch ./src",
"serve": "./bin/zooniverse-readymade serve --verbose --root ./example --project ./example/project",
"stage": "npm run build && publisssh ./build demo.zooniverse.org/readymade && npm run cleanup",
"build": "./bin/zooniverse-readymade build --verbose --force --root ./example --project ./example/project --output ./build",
"cleanup": "rm -rf ./build"
}
}
| {
"name": "zooniverse-readymade",
"version": "0.4.0",
"bin": "./bin/zooniverse-readymade",
"dependencies": {
"coffee-script": "1.7.x",
"haw": "^0.5.0",
"publisssh": "~0.2.4"
},
"peerDependencies": {
"jquery": "^2.1.0",
"marking-surface": "^0.6.4",
"stack-of-pages": "~0.1.3",
"zooniverse": "~0.3.8",
"zooniverse-decision-tree": "0.0.2"
},
"scripts": {
"start": "npm run serve & npm run watch",
"watch": "coffee --output ./lib --watch ./src",
"serve": "./bin/zooniverse-readymade serve --verbose --root ./example --project ./example/project",
"stage": "npm run build && publisssh ./build demo.zooniverse.org/readymade && npm run cleanup",
"build": "./bin/zooniverse-readymade build --verbose --force --root ./example --project ./example/project --output ./build",
"cleanup": "rm -rf ./build"
}
}
| Set front-end libs as peerDependencies | Set front-end libs as peerDependencies | JSON | apache-2.0 | zooniverse/zooniverse-readymade | json | ## Code Before:
{
"name": "zooniverse-readymade",
"version": "0.4.0",
"bin": "./bin/zooniverse-readymade",
"dependencies": {
"coffee-script": "1.7.x",
"haw": "^0.5.0",
"jquery": "^2.1.0",
"marking-surface": "^0.6.4",
"publisssh": "~0.2.4",
"stack-of-pages": "~0.1.3",
"zooniverse": "~0.3.8",
"zooniverse-decision-tree": "0.0.2"
},
"scripts": {
"start": "npm run serve & npm run watch",
"watch": "coffee --output ./lib --watch ./src",
"serve": "./bin/zooniverse-readymade serve --verbose --root ./example --project ./example/project",
"stage": "npm run build && publisssh ./build demo.zooniverse.org/readymade && npm run cleanup",
"build": "./bin/zooniverse-readymade build --verbose --force --root ./example --project ./example/project --output ./build",
"cleanup": "rm -rf ./build"
}
}
## Instruction:
Set front-end libs as peerDependencies
## Code After:
{
"name": "zooniverse-readymade",
"version": "0.4.0",
"bin": "./bin/zooniverse-readymade",
"dependencies": {
"coffee-script": "1.7.x",
"haw": "^0.5.0",
"publisssh": "~0.2.4"
},
"peerDependencies": {
"jquery": "^2.1.0",
"marking-surface": "^0.6.4",
"stack-of-pages": "~0.1.3",
"zooniverse": "~0.3.8",
"zooniverse-decision-tree": "0.0.2"
},
"scripts": {
"start": "npm run serve & npm run watch",
"watch": "coffee --output ./lib --watch ./src",
"serve": "./bin/zooniverse-readymade serve --verbose --root ./example --project ./example/project",
"stage": "npm run build && publisssh ./build demo.zooniverse.org/readymade && npm run cleanup",
"build": "./bin/zooniverse-readymade build --verbose --force --root ./example --project ./example/project --output ./build",
"cleanup": "rm -rf ./build"
}
}
| {
"name": "zooniverse-readymade",
"version": "0.4.0",
"bin": "./bin/zooniverse-readymade",
"dependencies": {
"coffee-script": "1.7.x",
"haw": "^0.5.0",
+ "publisssh": "~0.2.4"
+ },
+ "peerDependencies": {
"jquery": "^2.1.0",
"marking-surface": "^0.6.4",
- "publisssh": "~0.2.4",
"stack-of-pages": "~0.1.3",
"zooniverse": "~0.3.8",
"zooniverse-decision-tree": "0.0.2"
},
"scripts": {
"start": "npm run serve & npm run watch",
"watch": "coffee --output ./lib --watch ./src",
"serve": "./bin/zooniverse-readymade serve --verbose --root ./example --project ./example/project",
"stage": "npm run build && publisssh ./build demo.zooniverse.org/readymade && npm run cleanup",
"build": "./bin/zooniverse-readymade build --verbose --force --root ./example --project ./example/project --output ./build",
"cleanup": "rm -rf ./build"
}
} | 4 | 0.173913 | 3 | 1 |
43361c37317584f51fbcf9bae4fb654d9aa4e433 | basis/io/ports/ports-tests.factor | basis/io/ports/ports-tests.factor | USING: destructors io io.encodings.binary io.files io.directories
io.files.temp io.ports kernel sequences math
specialized-arrays.instances.alien.c-types.int tools.test ;
IN: io.ports.tests
! Make sure that writing malloced storage to a file works, and
! also make sure that writes larger than the buffer size work
[ ] [
"test.txt" temp-file binary [
100,000 iota
0
100,000 malloc-int-array &dispose [ copy ] keep write
] with-file-writer
] unit-test
[ t ] [
"test.txt" temp-file binary [
100,000 4 * read byte-array>int-array 100,000 iota sequence=
] with-file-reader
] unit-test
[ ] [ "test.txt" temp-file delete-file ] unit-test
| USING: destructors io io.encodings.binary io.files io.directories
io.files.temp io.ports kernel sequences math
specialized-arrays.instances.alien.c-types.int tools.test
specialized-arrays alien.c-types classes.struct alien ;
IN: io.ports.tests
! Make sure that writing malloced storage to a file works, and
! also make sure that writes larger than the buffer size work
[ ] [
"test.txt" temp-file binary [
100,000 iota
0
100,000 malloc-int-array &dispose [ copy ] keep write
] with-file-writer
] unit-test
[ t ] [
"test.txt" temp-file binary [
100,000 4 * read byte-array>int-array 100,000 iota sequence=
] with-file-reader
] unit-test
USE: multiline
/*
[ ] [
BV{ 0 1 2 } "test.txt" temp-file binary set-file-contents
] unit-test
[ t ] [
"test.txt" temp-file binary file-contents
B{ 0 1 2 } =
] unit-test
STRUCT: pt { x uint } { y uint } ;
SPECIALIZED-ARRAY: pt
CONSTANT: pt-array-1
pt-array{ S{ pt f 1 1 } S{ pt f 2 2 } S{ pt f 3 3 } }
[ ] [
pt-array-1
"test.txt" temp-file binary set-file-contents
] unit-test
[ t ] [
"test.txt" temp-file binary file-contents
pt-array-1 >c-ptr sequence=
] unit-test
[ ] [
pt-array-1 rest-slice
"test.txt" temp-file binary set-file-contents
] unit-test
[ t ] [
"test.txt" temp-file binary file-contents
pt-array-1 rest-slice >c-ptr sequence=
] unit-test
*/
[ ] [ "test.txt" temp-file delete-file ] unit-test
| Add some commented out unit tests to io.ports.tests that seem like they should be supported | Add some commented out unit tests to io.ports.tests that seem like they should be supported
| Factor | bsd-2-clause | mcandre/factor,erg/factor,ceninan/factor,kingcons/factor,mcandre/factor,kingcons/factor,littledan/Factor,mcandre/factor,erg/factor,erg/factor,littledan/Factor,cataska/factor,littledan/Factor,mcandre/factor,cataska/factor,erg/factor,ceninan/factor,mcandre/factor,cataska/factor,kingcons/factor,ceninan/factor,kingcons/factor,ceninan/factor,cataska/factor,erg/factor,erg/factor,mcandre/factor,erg/factor,mcandre/factor,littledan/Factor | factor | ## Code Before:
USING: destructors io io.encodings.binary io.files io.directories
io.files.temp io.ports kernel sequences math
specialized-arrays.instances.alien.c-types.int tools.test ;
IN: io.ports.tests
! Make sure that writing malloced storage to a file works, and
! also make sure that writes larger than the buffer size work
[ ] [
"test.txt" temp-file binary [
100,000 iota
0
100,000 malloc-int-array &dispose [ copy ] keep write
] with-file-writer
] unit-test
[ t ] [
"test.txt" temp-file binary [
100,000 4 * read byte-array>int-array 100,000 iota sequence=
] with-file-reader
] unit-test
[ ] [ "test.txt" temp-file delete-file ] unit-test
## Instruction:
Add some commented out unit tests to io.ports.tests that seem like they should be supported
## Code After:
USING: destructors io io.encodings.binary io.files io.directories
io.files.temp io.ports kernel sequences math
specialized-arrays.instances.alien.c-types.int tools.test
specialized-arrays alien.c-types classes.struct alien ;
IN: io.ports.tests
! Make sure that writing malloced storage to a file works, and
! also make sure that writes larger than the buffer size work
[ ] [
"test.txt" temp-file binary [
100,000 iota
0
100,000 malloc-int-array &dispose [ copy ] keep write
] with-file-writer
] unit-test
[ t ] [
"test.txt" temp-file binary [
100,000 4 * read byte-array>int-array 100,000 iota sequence=
] with-file-reader
] unit-test
USE: multiline
/*
[ ] [
BV{ 0 1 2 } "test.txt" temp-file binary set-file-contents
] unit-test
[ t ] [
"test.txt" temp-file binary file-contents
B{ 0 1 2 } =
] unit-test
STRUCT: pt { x uint } { y uint } ;
SPECIALIZED-ARRAY: pt
CONSTANT: pt-array-1
pt-array{ S{ pt f 1 1 } S{ pt f 2 2 } S{ pt f 3 3 } }
[ ] [
pt-array-1
"test.txt" temp-file binary set-file-contents
] unit-test
[ t ] [
"test.txt" temp-file binary file-contents
pt-array-1 >c-ptr sequence=
] unit-test
[ ] [
pt-array-1 rest-slice
"test.txt" temp-file binary set-file-contents
] unit-test
[ t ] [
"test.txt" temp-file binary file-contents
pt-array-1 rest-slice >c-ptr sequence=
] unit-test
*/
[ ] [ "test.txt" temp-file delete-file ] unit-test
| USING: destructors io io.encodings.binary io.files io.directories
io.files.temp io.ports kernel sequences math
- specialized-arrays.instances.alien.c-types.int tools.test ;
? --
+ specialized-arrays.instances.alien.c-types.int tools.test
+ specialized-arrays alien.c-types classes.struct alien ;
IN: io.ports.tests
! Make sure that writing malloced storage to a file works, and
! also make sure that writes larger than the buffer size work
[ ] [
"test.txt" temp-file binary [
100,000 iota
0
100,000 malloc-int-array &dispose [ copy ] keep write
] with-file-writer
] unit-test
[ t ] [
"test.txt" temp-file binary [
100,000 4 * read byte-array>int-array 100,000 iota sequence=
] with-file-reader
] unit-test
+ USE: multiline
+ /*
+ [ ] [
+ BV{ 0 1 2 } "test.txt" temp-file binary set-file-contents
+ ] unit-test
+
+ [ t ] [
+ "test.txt" temp-file binary file-contents
+ B{ 0 1 2 } =
+ ] unit-test
+
+ STRUCT: pt { x uint } { y uint } ;
+ SPECIALIZED-ARRAY: pt
+
+ CONSTANT: pt-array-1
+ pt-array{ S{ pt f 1 1 } S{ pt f 2 2 } S{ pt f 3 3 } }
+
+ [ ] [
+ pt-array-1
+ "test.txt" temp-file binary set-file-contents
+ ] unit-test
+
+ [ t ] [
+ "test.txt" temp-file binary file-contents
+ pt-array-1 >c-ptr sequence=
+ ] unit-test
+
+ [ ] [
+ pt-array-1 rest-slice
+ "test.txt" temp-file binary set-file-contents
+ ] unit-test
+
+ [ t ] [
+ "test.txt" temp-file binary file-contents
+ pt-array-1 rest-slice >c-ptr sequence=
+ ] unit-test
+
+ */
+
[ ] [ "test.txt" temp-file delete-file ] unit-test | 42 | 1.826087 | 41 | 1 |
cbfbda501744dced6f196e2001329cbfce8db416 | vagrant-boot.sh | vagrant-boot.sh | apt-get update
apt-get install -y make ruby1.9.1-dev
echo "installing ruby gems"
gem install jekyll
gem install github-pages
| apt-get update
apt-get install -y make ruby1.9.1-dev
echo "installing ruby gems"
gem install jekyll
gem install github-pages
echo "cd /vagrant" >> /home/vagrant/.bashrc
| Add default directory on login to vm bashrc | Add default directory on login to vm bashrc
| Shell | mit | Turistforeningen/www.nasjonalturbase.no,Turistforeningen/www.nasjonalturbase.no | shell | ## Code Before:
apt-get update
apt-get install -y make ruby1.9.1-dev
echo "installing ruby gems"
gem install jekyll
gem install github-pages
## Instruction:
Add default directory on login to vm bashrc
## Code After:
apt-get update
apt-get install -y make ruby1.9.1-dev
echo "installing ruby gems"
gem install jekyll
gem install github-pages
echo "cd /vagrant" >> /home/vagrant/.bashrc
| apt-get update
apt-get install -y make ruby1.9.1-dev
echo "installing ruby gems"
gem install jekyll
gem install github-pages
+
+ echo "cd /vagrant" >> /home/vagrant/.bashrc | 2 | 0.4 | 2 | 0 |
a9296184de71cd3bc8fdb8bc2fb863d6ea21dc07 | www/components/infomation/infomation.html | www/components/infomation/infomation.html | <ion-side-menu side="right">
<ion-header-bar class="bar-stable">
<h1 class="title">Infomation</h1>
</ion-header-bar>
<ion-content>
<div class="list">
<div class="item item-divider">developler</div>
<a class="item item-icon-left" ng-click="openLink('http://mitsuruog.github.io/x-mitsuruog/')">
<i class="icon ion-social-github"></i>
mitsuruog
</a>
<div class="item">version: 0.0.1</div>
<div class="item item-divider">other</div>
<a class="item item-icon-right">
Rate app
<i class="icon ion-android-open"></i>
</a>
</div>
</ion-content>
</ion-side-menu>
| <ion-side-menu side="right">
<ion-header-bar class="bar-stable">
<h1 class="title">Infomation</h1>
</ion-header-bar>
<ion-content>
<div class="list">
<div class="item item-divider">developler</div>
<a class="item item-icon-left item-icon-right">
<i class="icon ion-social-github"></i>
mitsuruog
<i class="icon ion-android-open" ng-click="openLink('http://mitsuruog.github.io/x-mitsuruog/')"></i>
</a>
<div class="item">version: 0.0.1</div>
<div class="item item-divider">other</div>
<a class="item item-icon-right">
Rate app
<i class="icon ion-android-open"></i>
</a>
</div>
</ion-content>
</ion-side-menu>
| Add link to github page | Add link to github page
| HTML | mit | mitsuruog/fxos-sensors,mitsuruog/fxos-sensors | html | ## Code Before:
<ion-side-menu side="right">
<ion-header-bar class="bar-stable">
<h1 class="title">Infomation</h1>
</ion-header-bar>
<ion-content>
<div class="list">
<div class="item item-divider">developler</div>
<a class="item item-icon-left" ng-click="openLink('http://mitsuruog.github.io/x-mitsuruog/')">
<i class="icon ion-social-github"></i>
mitsuruog
</a>
<div class="item">version: 0.0.1</div>
<div class="item item-divider">other</div>
<a class="item item-icon-right">
Rate app
<i class="icon ion-android-open"></i>
</a>
</div>
</ion-content>
</ion-side-menu>
## Instruction:
Add link to github page
## Code After:
<ion-side-menu side="right">
<ion-header-bar class="bar-stable">
<h1 class="title">Infomation</h1>
</ion-header-bar>
<ion-content>
<div class="list">
<div class="item item-divider">developler</div>
<a class="item item-icon-left item-icon-right">
<i class="icon ion-social-github"></i>
mitsuruog
<i class="icon ion-android-open" ng-click="openLink('http://mitsuruog.github.io/x-mitsuruog/')"></i>
</a>
<div class="item">version: 0.0.1</div>
<div class="item item-divider">other</div>
<a class="item item-icon-right">
Rate app
<i class="icon ion-android-open"></i>
</a>
</div>
</ion-content>
</ion-side-menu>
| <ion-side-menu side="right">
<ion-header-bar class="bar-stable">
<h1 class="title">Infomation</h1>
</ion-header-bar>
<ion-content>
<div class="list">
<div class="item item-divider">developler</div>
- <a class="item item-icon-left" ng-click="openLink('http://mitsuruog.github.io/x-mitsuruog/')">
+ <a class="item item-icon-left item-icon-right">
<i class="icon ion-social-github"></i>
mitsuruog
+ <i class="icon ion-android-open" ng-click="openLink('http://mitsuruog.github.io/x-mitsuruog/')"></i>
</a>
<div class="item">version: 0.0.1</div>
<div class="item item-divider">other</div>
<a class="item item-icon-right">
Rate app
<i class="icon ion-android-open"></i>
</a>
</div>
</ion-content>
</ion-side-menu> | 3 | 0.15 | 2 | 1 |
52bfa45ddc69ded40e259e60d1384e14c4ca22b8 | app/assets/javascripts/backbone/views/project_view.js.coffee | app/assets/javascripts/backbone/views/project_view.js.coffee | ProjectMonitor.Views ||= {}
class ProjectMonitor.Views.ProjectView extends Backbone.View
tagName: "li"
className: "project"
initialize: (options) ->
@subviews = []
@subviews.push(new ProjectMonitor.Views.BuildView(model: @model.get("build"))) if @model.get("build")
@subviews.push(new ProjectMonitor.Views.TrackerView(model: @model.get("tracker"))) if @model.get("tracker")
@subviews.push(new ProjectMonitor.Views.NewRelicView(model: @model.get("new_relic"))) if @model.get("new_relic")
@subviews.push(new ProjectMonitor.Views.AirbrakeView(model: @model.get("airbrake"))) if @model.get("airbrake")
@.registerSubView(subview) for subview in @subviews
@$el.data(project_id: @model.get("project_id"))
render: ->
$section = $("<section/>")
@$el.html($section)
$section.addClass(['one-tile', 'two-tile', 'three-tile', 'four-tile'][@subviews.length - 1])
for subview in @subviews
$section.append(subview.render().$el)
@
| ProjectMonitor.Views ||= {}
class ProjectMonitor.Views.ProjectView extends Backbone.View
tagName: "li"
className: "project"
initialize: (options) ->
@subviews = []
@subviews.push(new ProjectMonitor.Views.BuildView(model: @model.get("build"))) if @model.get("build")
@subviews.push(new ProjectMonitor.Views.TrackerView(model: @model.get("tracker"))) if @model.get("tracker")
@subviews.push(new ProjectMonitor.Views.NewRelicView(model: @model.get("new_relic"))) if @model.get("new_relic")
@subviews.push(new ProjectMonitor.Views.AirbrakeView(model: @model.get("airbrake"))) if @model.get("airbrake")
@.registerSubView(subview) for subview in @subviews
@$el.data(project_id: @model.get("project_id"))
render: ->
$section = $("<section/>").
addClass(['one-tile', 'two-tile', 'three-tile', 'four-tile'][@subviews.length - 1])
for subview in @subviews
$section.append(subview.render().$el)
@$el.html($section)
@
| Append ProjectView subviews in 1 operation | Append ProjectView subviews in 1 operation
| CoffeeScript | mit | BuildingSync/projectmonitor,pivotal/projectmonitor,BuildingSync/projectmonitor,BuildingSync/projectmonitor,remind101/projectmonitor,dgodd/projectmonitor,mabounassif/projectmonitor-docker,mabounassif/projectmonitor-docker,pivotal/projectmonitor,remind101/projectmonitor,dgodd/projectmonitor,BuildingSync/projectmonitor,genebygene/projectmonitor,dgodd/projectmonitor,pivotal/projectmonitor,pivotal/projectmonitor,genebygene/projectmonitor,genebygene/projectmonitor,remind101/projectmonitor,mabounassif/projectmonitor-docker,dgodd/projectmonitor,mabounassif/projectmonitor-docker,genebygene/projectmonitor,remind101/projectmonitor | coffeescript | ## Code Before:
ProjectMonitor.Views ||= {}
class ProjectMonitor.Views.ProjectView extends Backbone.View
tagName: "li"
className: "project"
initialize: (options) ->
@subviews = []
@subviews.push(new ProjectMonitor.Views.BuildView(model: @model.get("build"))) if @model.get("build")
@subviews.push(new ProjectMonitor.Views.TrackerView(model: @model.get("tracker"))) if @model.get("tracker")
@subviews.push(new ProjectMonitor.Views.NewRelicView(model: @model.get("new_relic"))) if @model.get("new_relic")
@subviews.push(new ProjectMonitor.Views.AirbrakeView(model: @model.get("airbrake"))) if @model.get("airbrake")
@.registerSubView(subview) for subview in @subviews
@$el.data(project_id: @model.get("project_id"))
render: ->
$section = $("<section/>")
@$el.html($section)
$section.addClass(['one-tile', 'two-tile', 'three-tile', 'four-tile'][@subviews.length - 1])
for subview in @subviews
$section.append(subview.render().$el)
@
## Instruction:
Append ProjectView subviews in 1 operation
## Code After:
ProjectMonitor.Views ||= {}
class ProjectMonitor.Views.ProjectView extends Backbone.View
tagName: "li"
className: "project"
initialize: (options) ->
@subviews = []
@subviews.push(new ProjectMonitor.Views.BuildView(model: @model.get("build"))) if @model.get("build")
@subviews.push(new ProjectMonitor.Views.TrackerView(model: @model.get("tracker"))) if @model.get("tracker")
@subviews.push(new ProjectMonitor.Views.NewRelicView(model: @model.get("new_relic"))) if @model.get("new_relic")
@subviews.push(new ProjectMonitor.Views.AirbrakeView(model: @model.get("airbrake"))) if @model.get("airbrake")
@.registerSubView(subview) for subview in @subviews
@$el.data(project_id: @model.get("project_id"))
render: ->
$section = $("<section/>").
addClass(['one-tile', 'two-tile', 'three-tile', 'four-tile'][@subviews.length - 1])
for subview in @subviews
$section.append(subview.render().$el)
@$el.html($section)
@
| ProjectMonitor.Views ||= {}
class ProjectMonitor.Views.ProjectView extends Backbone.View
tagName: "li"
className: "project"
initialize: (options) ->
@subviews = []
@subviews.push(new ProjectMonitor.Views.BuildView(model: @model.get("build"))) if @model.get("build")
@subviews.push(new ProjectMonitor.Views.TrackerView(model: @model.get("tracker"))) if @model.get("tracker")
@subviews.push(new ProjectMonitor.Views.NewRelicView(model: @model.get("new_relic"))) if @model.get("new_relic")
@subviews.push(new ProjectMonitor.Views.AirbrakeView(model: @model.get("airbrake"))) if @model.get("airbrake")
@.registerSubView(subview) for subview in @subviews
@$el.data(project_id: @model.get("project_id"))
render: ->
- $section = $("<section/>")
+ $section = $("<section/>").
? +
- @$el.html($section)
- $section.addClass(['one-tile', 'two-tile', 'three-tile', 'four-tile'][@subviews.length - 1])
? ^^^^^^^^^
+ addClass(['one-tile', 'two-tile', 'three-tile', 'four-tile'][@subviews.length - 1])
? ^^
for subview in @subviews
$section.append(subview.render().$el)
+ @$el.html($section)
@ | 6 | 0.272727 | 3 | 3 |
8f642c0dd5917f0f229b8f96c4fcb97244be823a | _data/topnav.yml | _data/topnav.yml | topnav:
- title: Topnav
items:
- title: About
url: /about.html
- title: News
url: /news.html
- title: Issues
url: /issues.html
- title: Testimonials
url: /testimonials.html
- title: Kudos
url: /kudos.html
#Topnav dropdowns
topnav_dropdowns:
- title: Topnav dropdowns
folders:
- title: Code
folderitems:
- title: Source
external_url: https://gerrit.googlesource.com/gerrit/
- title: Releases
url: /releases-readme.html
- title: Builds
external_url: https://gerrit-ci.gerritforge.com/
- title: Reviews
external_url: https://gerrit-review.googlesource.com/q/status:open+project:gerrit
- title: Docs
folderitems:
- title: Latest
external_url: https://gerrit-documentation.storage.googleapis.com/Documentation/3.0.0/index.html
- title: Designs
url: /design-docs-index.html
- title: Wiki
external_url: https://gerrit.googlesource.com/homepage/+/master/pages/site/docs/
| topnav:
- title: Topnav
items:
- title: About
url: /about.html
- title: News
url: /news.html
- title: Issues
url: /issues.html
- title: Members
url: /members.html
- title: Testimonials
url: /testimonials.html
- title: Kudos
url: /kudos.html
#Topnav dropdowns
topnav_dropdowns:
- title: Topnav dropdowns
folders:
- title: Code
folderitems:
- title: Source
external_url: https://gerrit.googlesource.com/gerrit/
- title: Releases
url: /releases-readme.html
- title: Builds
external_url: https://gerrit-ci.gerritforge.com/
- title: Reviews
external_url: https://gerrit-review.googlesource.com/q/status:open+project:gerrit
- title: Docs
folderitems:
- title: Latest
external_url: https://gerrit-documentation.storage.googleapis.com/Documentation/3.0.0/index.html
- title: Designs
url: /design-docs-index.html
- title: Wiki
external_url: https://gerrit.googlesource.com/homepage/+/master/pages/site/docs/
| Add top navigation menu link for the Members page | Add top navigation menu link for the Members page
Before this change, that page was unreachable from interactive browsing.
Bug: Issue 11050
Change-Id: If415aca5d30d136027c5d764987aecacbe21220f
| YAML | apache-2.0 | GerritCodeReview/homepage,GerritCodeReview/homepage,GerritCodeReview/homepage,GerritCodeReview/homepage,GerritCodeReview/homepage | yaml | ## Code Before:
topnav:
- title: Topnav
items:
- title: About
url: /about.html
- title: News
url: /news.html
- title: Issues
url: /issues.html
- title: Testimonials
url: /testimonials.html
- title: Kudos
url: /kudos.html
#Topnav dropdowns
topnav_dropdowns:
- title: Topnav dropdowns
folders:
- title: Code
folderitems:
- title: Source
external_url: https://gerrit.googlesource.com/gerrit/
- title: Releases
url: /releases-readme.html
- title: Builds
external_url: https://gerrit-ci.gerritforge.com/
- title: Reviews
external_url: https://gerrit-review.googlesource.com/q/status:open+project:gerrit
- title: Docs
folderitems:
- title: Latest
external_url: https://gerrit-documentation.storage.googleapis.com/Documentation/3.0.0/index.html
- title: Designs
url: /design-docs-index.html
- title: Wiki
external_url: https://gerrit.googlesource.com/homepage/+/master/pages/site/docs/
## Instruction:
Add top navigation menu link for the Members page
Before this change, that page was unreachable from interactive browsing.
Bug: Issue 11050
Change-Id: If415aca5d30d136027c5d764987aecacbe21220f
## Code After:
topnav:
- title: Topnav
items:
- title: About
url: /about.html
- title: News
url: /news.html
- title: Issues
url: /issues.html
- title: Members
url: /members.html
- title: Testimonials
url: /testimonials.html
- title: Kudos
url: /kudos.html
#Topnav dropdowns
topnav_dropdowns:
- title: Topnav dropdowns
folders:
- title: Code
folderitems:
- title: Source
external_url: https://gerrit.googlesource.com/gerrit/
- title: Releases
url: /releases-readme.html
- title: Builds
external_url: https://gerrit-ci.gerritforge.com/
- title: Reviews
external_url: https://gerrit-review.googlesource.com/q/status:open+project:gerrit
- title: Docs
folderitems:
- title: Latest
external_url: https://gerrit-documentation.storage.googleapis.com/Documentation/3.0.0/index.html
- title: Designs
url: /design-docs-index.html
- title: Wiki
external_url: https://gerrit.googlesource.com/homepage/+/master/pages/site/docs/
| topnav:
- title: Topnav
items:
- title: About
url: /about.html
- title: News
url: /news.html
- title: Issues
url: /issues.html
+ - title: Members
+ url: /members.html
- title: Testimonials
url: /testimonials.html
- title: Kudos
url: /kudos.html
#Topnav dropdowns
topnav_dropdowns:
- title: Topnav dropdowns
folders:
- title: Code
folderitems:
- title: Source
external_url: https://gerrit.googlesource.com/gerrit/
- title: Releases
url: /releases-readme.html
- title: Builds
external_url: https://gerrit-ci.gerritforge.com/
- title: Reviews
external_url: https://gerrit-review.googlesource.com/q/status:open+project:gerrit
- title: Docs
folderitems:
- title: Latest
external_url: https://gerrit-documentation.storage.googleapis.com/Documentation/3.0.0/index.html
- title: Designs
url: /design-docs-index.html
- title: Wiki
external_url: https://gerrit.googlesource.com/homepage/+/master/pages/site/docs/ | 2 | 0.057143 | 2 | 0 |
cf78bcf2338c6822ad5e48a23cc43ca2f67957fa | ci_environment/riak/recipes/default.rb | ci_environment/riak/recipes/default.rb | apt_repository 'basho-riak' do
uri 'https://packagecloud.io/basho/riak/ubuntu/'
distribution node["lsb"]["codename"]
components ["main"]
key 'https://packagecloud.io/gpg.key'
remote_file "#{Chef::Config[:file_cache_path]}/riak_script" do
source node["riak"]["package"]["installer"]
owner node["travis_build_environment"]["user"]
group node["travis_build_environment"]["group"]
mode 0755
end
bash "run Riak installer" do
user "root"
code "#{Chef::Config[:file_cache_path]}/riak_script"
end
package 'riak' do
action :install
end
#
# - Stop riak service to customize configuration files
# - Don't enable riak service at server boot time
#
service 'riak' do
supports :status => true, :restart => true
action [:disable, :stop]
end
template "/etc/riak/riak.conf" do
source "riak.conf.erb"
owner 'riak'
group 'riak'
mode 0644
end
| apt_repository 'basho-riak' do
uri 'https://packagecloud.io/basho/riak/ubuntu/'
distribution node["lsb"]["codename"]
components ["main"]
key 'https://packagecloud.io/gpg.key'
action :add
end
package 'riak' do
action :install
end
#
# - Stop riak service to customize configuration files
# - Don't enable riak service at server boot time
#
service 'riak' do
supports :status => true, :restart => true
action [:disable, :stop]
end
template "/etc/riak/riak.conf" do
source "riak.conf.erb"
owner 'riak'
group 'riak'
mode 0644
end | Fix up Riak cookbook merge issue | Fix up Riak cookbook merge issue
| Ruby | mit | Acidburn0zzz/travis-cookbooks,travis-ci/travis-cookbooks,ardock/travis-cookbooks,Distelli/travis-cookbooks,Zarthus/travis-cookbooks,ljharb/travis-cookbooks,gavioto/travis-cookbooks,gavioto/travis-cookbooks,spurti-chopra/travis-cookbooks,dracos/travis-cookbooks,ardock/travis-cookbooks,Distelli/travis-cookbooks,dracos/travis-cookbooks,Zarthus/travis-cookbooks,ljharb/travis-cookbooks,Distelli/travis-cookbooks,dracos/travis-cookbooks,ardock/travis-cookbooks,spurti-chopra/travis-cookbooks,Zarthus/travis-cookbooks,travis-ci/travis-cookbooks,Acidburn0zzz/travis-cookbooks,gavioto/travis-cookbooks,gavioto/travis-cookbooks,Acidburn0zzz/travis-cookbooks,travis-ci/travis-cookbooks,Distelli/travis-cookbooks,ljharb/travis-cookbooks,Acidburn0zzz/travis-cookbooks,spurti-chopra/travis-cookbooks,dracos/travis-cookbooks,ardock/travis-cookbooks,Zarthus/travis-cookbooks | ruby | ## Code Before:
apt_repository 'basho-riak' do
uri 'https://packagecloud.io/basho/riak/ubuntu/'
distribution node["lsb"]["codename"]
components ["main"]
key 'https://packagecloud.io/gpg.key'
remote_file "#{Chef::Config[:file_cache_path]}/riak_script" do
source node["riak"]["package"]["installer"]
owner node["travis_build_environment"]["user"]
group node["travis_build_environment"]["group"]
mode 0755
end
bash "run Riak installer" do
user "root"
code "#{Chef::Config[:file_cache_path]}/riak_script"
end
package 'riak' do
action :install
end
#
# - Stop riak service to customize configuration files
# - Don't enable riak service at server boot time
#
service 'riak' do
supports :status => true, :restart => true
action [:disable, :stop]
end
template "/etc/riak/riak.conf" do
source "riak.conf.erb"
owner 'riak'
group 'riak'
mode 0644
end
## Instruction:
Fix up Riak cookbook merge issue
## Code After:
apt_repository 'basho-riak' do
uri 'https://packagecloud.io/basho/riak/ubuntu/'
distribution node["lsb"]["codename"]
components ["main"]
key 'https://packagecloud.io/gpg.key'
action :add
end
package 'riak' do
action :install
end
#
# - Stop riak service to customize configuration files
# - Don't enable riak service at server boot time
#
service 'riak' do
supports :status => true, :restart => true
action [:disable, :stop]
end
template "/etc/riak/riak.conf" do
source "riak.conf.erb"
owner 'riak'
group 'riak'
mode 0644
end | apt_repository 'basho-riak' do
uri 'https://packagecloud.io/basho/riak/ubuntu/'
distribution node["lsb"]["codename"]
components ["main"]
key 'https://packagecloud.io/gpg.key'
+ action :add
- remote_file "#{Chef::Config[:file_cache_path]}/riak_script" do
- source node["riak"]["package"]["installer"]
- owner node["travis_build_environment"]["user"]
- group node["travis_build_environment"]["group"]
- mode 0755
- end
? --
+ end
-
- bash "run Riak installer" do
- user "root"
- code "#{Chef::Config[:file_cache_path]}/riak_script"
- end
package 'riak' do
action :install
end
#
# - Stop riak service to customize configuration files
# - Don't enable riak service at server boot time
#
service 'riak' do
supports :status => true, :restart => true
action [:disable, :stop]
end
template "/etc/riak/riak.conf" do
source "riak.conf.erb"
owner 'riak'
group 'riak'
mode 0644
end | 13 | 0.351351 | 2 | 11 |
5d25ccb78944d8a5bd216b1d27eacd3504d3705d | args-client-tcp-octet.pl | args-client-tcp-octet.pl |
use strict;
use warnings;
our %args = (
client => {
logsock => { type => "tcp", host => "127.0.0.1", port => 514 },
},
syslogd => {
options => ["-T", "127.0.0.1:514"],
fstat => {
qr/^root .* internet/ => 0,
qr/^_syslogd .* internet/ => 3,
qr/ internet6? stream tcp \w+ (127.0.0.1|\[::1\]):514$/ => 1,
},
},
file => {
loggrep => qr/ localhost syslogd-regress\[\d+\]: /. get_testgrep(),
},
);
1;
|
use strict;
use warnings;
our %args = (
client => {
connect => { domain => AF_INET, proto => "tcp", addr => "127.0.0.1",
port => 514 },
func => sub {
my $self = shift;
print "0 1 a2 bc3 de\n3 fg\0003 hi 4 jk\n\n1 l0 1 m2 n ";
write_log($self);
},
},
syslogd => {
options => ["-T", "127.0.0.1:514"],
loggrep => {
},
},
file => {
loggrep => {
get_testgrep() => 1,
},
},
);
1;
| Write a bunch of octet counted messages. | Write a bunch of octet counted messages.
| Perl | isc | bluhm/syslogd-regress,bluhm/syslogd-regress | perl | ## Code Before:
use strict;
use warnings;
our %args = (
client => {
logsock => { type => "tcp", host => "127.0.0.1", port => 514 },
},
syslogd => {
options => ["-T", "127.0.0.1:514"],
fstat => {
qr/^root .* internet/ => 0,
qr/^_syslogd .* internet/ => 3,
qr/ internet6? stream tcp \w+ (127.0.0.1|\[::1\]):514$/ => 1,
},
},
file => {
loggrep => qr/ localhost syslogd-regress\[\d+\]: /. get_testgrep(),
},
);
1;
## Instruction:
Write a bunch of octet counted messages.
## Code After:
use strict;
use warnings;
our %args = (
client => {
connect => { domain => AF_INET, proto => "tcp", addr => "127.0.0.1",
port => 514 },
func => sub {
my $self = shift;
print "0 1 a2 bc3 de\n3 fg\0003 hi 4 jk\n\n1 l0 1 m2 n ";
write_log($self);
},
},
syslogd => {
options => ["-T", "127.0.0.1:514"],
loggrep => {
},
},
file => {
loggrep => {
get_testgrep() => 1,
},
},
);
1;
|
use strict;
use warnings;
our %args = (
client => {
- logsock => { type => "tcp", host => "127.0.0.1", port => 514 },
+ connect => { domain => AF_INET, proto => "tcp", addr => "127.0.0.1",
+ port => 514 },
+ func => sub {
+ my $self = shift;
+ print "0 1 a2 bc3 de\n3 fg\0003 hi 4 jk\n\n1 l0 1 m2 n ";
+ write_log($self);
+ },
},
syslogd => {
options => ["-T", "127.0.0.1:514"],
+ loggrep => {
- fstat => {
- qr/^root .* internet/ => 0,
- qr/^_syslogd .* internet/ => 3,
- qr/ internet6? stream tcp \w+ (127.0.0.1|\[::1\]):514$/ => 1,
},
},
file => {
- loggrep => qr/ localhost syslogd-regress\[\d+\]: /. get_testgrep(),
+ loggrep => {
+ get_testgrep() => 1,
+ },
},
);
1; | 17 | 0.772727 | 11 | 6 |
c6ac0095d3b1139c559266f9ff266983fbffdbad | setup.cfg | setup.cfg | [bumpversion]
current_version = 2.1.0
commit = True
tag = True
tag_name = {new_version}
[metadata]
author = Seth M. Morton
author_email = drtuba78@gmail.com
url = https://github.com/SethMMorton/fastnumbers
description = Super-fast and clean conversions to numbers.
long_description = file: README.rst
license = MIT
classifiers =
Development Status :: 5 - Production/Stable
Intended Audience :: Science/Research
Intended Audience :: Developers
Intended Audience :: Information Technology
Intended Audience :: System Administrators
Intended Audience :: Financial and Insurance Industry
Operating System :: OS Independent
License :: OSI Approved :: MIT License
Natural Language :: English
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Topic :: Scientific/Engineering :: Information Analysis
Topic :: Utilities
Topic :: Text Processing
Topic :: Text Processing :: Filters
[bumpversion:file:setup.py]
[bumpversion:file:include/version.h]
[bumpversion:file:docs/source/conf.py]
[bumpversion:file:docs/source/changelog.rst]
search = X.X.X
replace = {new_version}
| [bumpversion]
current_version = 2.1.0
commit = True
tag = True
tag_name = {new_version}
[metadata]
author = Seth M. Morton
author_email = drtuba78@gmail.com
url = https://github.com/SethMMorton/fastnumbers
description = Super-fast and clean conversions to numbers.
long_description = file: README.rst
license = MIT
classifiers =
Development Status :: 5 - Production/Stable
Intended Audience :: Science/Research
Intended Audience :: Developers
Intended Audience :: Information Technology
Intended Audience :: System Administrators
Intended Audience :: Financial and Insurance Industry
Operating System :: OS Independent
License :: OSI Approved :: MIT License
Natural Language :: English
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Topic :: Scientific/Engineering :: Information Analysis
Topic :: Utilities
Topic :: Text Processing
Topic :: Text Processing :: Filters
[bumpversion:file:setup.py]
[bumpversion:file:include/fastnumbers/version.h]
[bumpversion:file:docs/source/conf.py]
[bumpversion:file:docs/source/changelog.rst]
search = X.X.X
replace = {new_version}
| Change version.h location in bumpversion config. | Change version.h location in bumpversion config.
| INI | mit | SethMMorton/fastnumbers,SethMMorton/fastnumbers,SethMMorton/fastnumbers | ini | ## Code Before:
[bumpversion]
current_version = 2.1.0
commit = True
tag = True
tag_name = {new_version}
[metadata]
author = Seth M. Morton
author_email = drtuba78@gmail.com
url = https://github.com/SethMMorton/fastnumbers
description = Super-fast and clean conversions to numbers.
long_description = file: README.rst
license = MIT
classifiers =
Development Status :: 5 - Production/Stable
Intended Audience :: Science/Research
Intended Audience :: Developers
Intended Audience :: Information Technology
Intended Audience :: System Administrators
Intended Audience :: Financial and Insurance Industry
Operating System :: OS Independent
License :: OSI Approved :: MIT License
Natural Language :: English
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Topic :: Scientific/Engineering :: Information Analysis
Topic :: Utilities
Topic :: Text Processing
Topic :: Text Processing :: Filters
[bumpversion:file:setup.py]
[bumpversion:file:include/version.h]
[bumpversion:file:docs/source/conf.py]
[bumpversion:file:docs/source/changelog.rst]
search = X.X.X
replace = {new_version}
## Instruction:
Change version.h location in bumpversion config.
## Code After:
[bumpversion]
current_version = 2.1.0
commit = True
tag = True
tag_name = {new_version}
[metadata]
author = Seth M. Morton
author_email = drtuba78@gmail.com
url = https://github.com/SethMMorton/fastnumbers
description = Super-fast and clean conversions to numbers.
long_description = file: README.rst
license = MIT
classifiers =
Development Status :: 5 - Production/Stable
Intended Audience :: Science/Research
Intended Audience :: Developers
Intended Audience :: Information Technology
Intended Audience :: System Administrators
Intended Audience :: Financial and Insurance Industry
Operating System :: OS Independent
License :: OSI Approved :: MIT License
Natural Language :: English
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Topic :: Scientific/Engineering :: Information Analysis
Topic :: Utilities
Topic :: Text Processing
Topic :: Text Processing :: Filters
[bumpversion:file:setup.py]
[bumpversion:file:include/fastnumbers/version.h]
[bumpversion:file:docs/source/conf.py]
[bumpversion:file:docs/source/changelog.rst]
search = X.X.X
replace = {new_version}
| [bumpversion]
current_version = 2.1.0
commit = True
tag = True
tag_name = {new_version}
[metadata]
author = Seth M. Morton
author_email = drtuba78@gmail.com
url = https://github.com/SethMMorton/fastnumbers
description = Super-fast and clean conversions to numbers.
long_description = file: README.rst
license = MIT
classifiers =
Development Status :: 5 - Production/Stable
Intended Audience :: Science/Research
Intended Audience :: Developers
Intended Audience :: Information Technology
Intended Audience :: System Administrators
Intended Audience :: Financial and Insurance Industry
Operating System :: OS Independent
License :: OSI Approved :: MIT License
Natural Language :: English
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Topic :: Scientific/Engineering :: Information Analysis
Topic :: Utilities
Topic :: Text Processing
Topic :: Text Processing :: Filters
[bumpversion:file:setup.py]
- [bumpversion:file:include/version.h]
+ [bumpversion:file:include/fastnumbers/version.h]
? ++++++++++++
[bumpversion:file:docs/source/conf.py]
[bumpversion:file:docs/source/changelog.rst]
search = X.X.X
replace = {new_version}
| 2 | 0.044444 | 1 | 1 |
aee26ebb12ddcc410ad1b0eccf8fd740c6b9b39a | demo.py | demo.py | if __name__ == '__main__':
from NeuroIO import NeuroIO
from PreProcess import PreProcess
from Cluster import Cluster
neuroread = NeuroIO(r"C:\Users\USERNAME\Downloads\Brainbow-demo.tif")
img_data = neuroread.img_data_return()[0]
img_path = neuroread.img_data_return()[1]
pre_processed_data = PreProcess(im_data=img_data, filepath=img_path, snapshotpath=r"C:\UROP\\", multiprocess=True,
cores="auto")
pre_processed_data.blur(blur_sigma=0.5, xyz_scale=(1, 1, 1))
pre_processed_data.find_threshold(method="isodata", snapshot=True)
refined_mask = pre_processed_data.sobel_watershed(threshold="last", snapshot=True)
pre_processed_data.lab_mode()
img_lab = pre_processed_data.return_data()
segment = Cluster(img_data=img_lab, mask=refined_mask)
cluster_results = segment.DBSCAN(start_frame=0, end_frame=100, size_threshold=75, max_dist=19, min_samp=10,
dist_weight=3.0,
color_weight=18.0, metric="euclidean", algo="ball_tree")
neuroread.img_data_write(cluster_results, "C:\Users\USERNAME\Desktop\\")
| if __name__ == '__main__':
from NeuroIO import NeuroIO
from PreProcess import PreProcess
from Cluster import Cluster
neuroread = NeuroIO(r"C:\Users\USERNAME\Downloads\Brainbow-demo.tif")
img_data = neuroread.img_data_return()[0]
img_path = neuroread.img_data_return()[1]
pre_processed_data = PreProcess(im_data=img_data, filepath=img_path, snapshotpath=r"C:\UROP\\",
multiprocess=True, cores="auto")
pre_processed_data.blur(blur_sigma=0.5, xyz_scale=(1, 1, 1))
pre_processed_data.find_threshold(method="isodata", snapshot=True)
refined_mask = pre_processed_data.sobel_watershed(threshold="last", snapshot=True)
pre_processed_data.lab_mode()
img_lab = pre_processed_data.return_data()
segment = Cluster(img_data=img_lab, mask=refined_mask)
cluster_results = segment.super_pixel(start_frame=0, end_frame=100, size_threshold=75, max_dist=19, min_samp=10,
dist_weight=3.0, color_weight=18.0, metric="euclidean", algo="auto",
multiprocess=True, num_cores="auto", num_slices=4)
neuroread.img_data_write(cluster_results, "C:\Users\USERNAME\Desktop\\")
| Enable support for the parallel dbscan. | Enable support for the parallel dbscan.
| Python | apache-2.0 | aluo-x/GRIDFIRE | python | ## Code Before:
if __name__ == '__main__':
from NeuroIO import NeuroIO
from PreProcess import PreProcess
from Cluster import Cluster
neuroread = NeuroIO(r"C:\Users\USERNAME\Downloads\Brainbow-demo.tif")
img_data = neuroread.img_data_return()[0]
img_path = neuroread.img_data_return()[1]
pre_processed_data = PreProcess(im_data=img_data, filepath=img_path, snapshotpath=r"C:\UROP\\", multiprocess=True,
cores="auto")
pre_processed_data.blur(blur_sigma=0.5, xyz_scale=(1, 1, 1))
pre_processed_data.find_threshold(method="isodata", snapshot=True)
refined_mask = pre_processed_data.sobel_watershed(threshold="last", snapshot=True)
pre_processed_data.lab_mode()
img_lab = pre_processed_data.return_data()
segment = Cluster(img_data=img_lab, mask=refined_mask)
cluster_results = segment.DBSCAN(start_frame=0, end_frame=100, size_threshold=75, max_dist=19, min_samp=10,
dist_weight=3.0,
color_weight=18.0, metric="euclidean", algo="ball_tree")
neuroread.img_data_write(cluster_results, "C:\Users\USERNAME\Desktop\\")
## Instruction:
Enable support for the parallel dbscan.
## Code After:
if __name__ == '__main__':
from NeuroIO import NeuroIO
from PreProcess import PreProcess
from Cluster import Cluster
neuroread = NeuroIO(r"C:\Users\USERNAME\Downloads\Brainbow-demo.tif")
img_data = neuroread.img_data_return()[0]
img_path = neuroread.img_data_return()[1]
pre_processed_data = PreProcess(im_data=img_data, filepath=img_path, snapshotpath=r"C:\UROP\\",
multiprocess=True, cores="auto")
pre_processed_data.blur(blur_sigma=0.5, xyz_scale=(1, 1, 1))
pre_processed_data.find_threshold(method="isodata", snapshot=True)
refined_mask = pre_processed_data.sobel_watershed(threshold="last", snapshot=True)
pre_processed_data.lab_mode()
img_lab = pre_processed_data.return_data()
segment = Cluster(img_data=img_lab, mask=refined_mask)
cluster_results = segment.super_pixel(start_frame=0, end_frame=100, size_threshold=75, max_dist=19, min_samp=10,
dist_weight=3.0, color_weight=18.0, metric="euclidean", algo="auto",
multiprocess=True, num_cores="auto", num_slices=4)
neuroread.img_data_write(cluster_results, "C:\Users\USERNAME\Desktop\\")
| if __name__ == '__main__':
from NeuroIO import NeuroIO
from PreProcess import PreProcess
from Cluster import Cluster
neuroread = NeuroIO(r"C:\Users\USERNAME\Downloads\Brainbow-demo.tif")
img_data = neuroread.img_data_return()[0]
img_path = neuroread.img_data_return()[1]
- pre_processed_data = PreProcess(im_data=img_data, filepath=img_path, snapshotpath=r"C:\UROP\\", multiprocess=True,
? -------------------
+ pre_processed_data = PreProcess(im_data=img_data, filepath=img_path, snapshotpath=r"C:\UROP\\",
- cores="auto")
+ multiprocess=True, cores="auto")
? +++++++++++++++++++
pre_processed_data.blur(blur_sigma=0.5, xyz_scale=(1, 1, 1))
pre_processed_data.find_threshold(method="isodata", snapshot=True)
refined_mask = pre_processed_data.sobel_watershed(threshold="last", snapshot=True)
pre_processed_data.lab_mode()
img_lab = pre_processed_data.return_data()
segment = Cluster(img_data=img_lab, mask=refined_mask)
- cluster_results = segment.DBSCAN(start_frame=0, end_frame=100, size_threshold=75, max_dist=19, min_samp=10,
? ^^^^^^
+ cluster_results = segment.super_pixel(start_frame=0, end_frame=100, size_threshold=75, max_dist=19, min_samp=10,
? ^^^^^^^^^^^
- dist_weight=3.0,
- color_weight=18.0, metric="euclidean", algo="ball_tree")
? - ^^^ ^^^ ^
+ dist_weight=3.0, color_weight=18.0, metric="euclidean", algo="auto",
? ++++++++++++++++++++++ ^ ^ ^
+ multiprocess=True, num_cores="auto", num_slices=4)
neuroread.img_data_write(cluster_results, "C:\Users\USERNAME\Desktop\\") | 10 | 0.5 | 5 | 5 |
97a5b85e77701f6fbc980a4465596e4eedefab90 | lib/matasano_crypto_challenges/single_byte_xor_cracker.rb | lib/matasano_crypto_challenges/single_byte_xor_cracker.rb | require 'matasano_crypto_challenges/representations/hexadecimal'
module MatasanoCryptoChallenges
class SingleByteXorCracker
attr_reader :normally_frequent_bytes
def initialize(normally_frequent_bytes=' etaoinshrdlu'.bytes)
@normally_frequent_bytes = Array(normally_frequent_bytes)
end
def crack(hexadecimal)
best = Representations::Hexadecimal.from_bytes([])
1.upto 255 do |key_seed|
key = Representations::Hexadecimal.from_bytes([key_seed] *
hexadecimal.bytes.length)
guess = (hexadecimal ^ key)
if best.normalcy_score < (guess.normalcy_score = normalcy_score(guess))
best = guess
end
end
best
end
private
def frequent_bytes(hexadecimal)
table = {}
hexadecimal.bytes.each do |b|
table[b] = table[b].to_i + 1
end
table.to_a.
sort { |left, right| left.last <=> right.last }.
reverse.
collect(&:first).
slice 0, normally_frequent_bytes.length
end
def normalcy_score(hexadecimal)
normally_frequent_bytes.length -
(frequent_bytes(hexadecimal) - normally_frequent_bytes).length
end
end
end
| require 'matasano_crypto_challenges/representations/hexadecimal'
module MatasanoCryptoChallenges
class SingleByteXorCracker
attr_reader :normally_frequent_bytes
def initialize(normally_frequent_bytes=' etaoinshrdlu'.bytes)
@normally_frequent_bytes = Array(normally_frequent_bytes)
end
def crack(representation)
best = Representations::Hexadecimal.from_bytes([])
1.upto 255 do |key_seed|
key = Representations::Hexadecimal.from_bytes([key_seed] *
representation.bytes.length)
guess = (representation ^ key)
if best.normalcy_score < (guess.normalcy_score = normalcy_score(guess))
best = guess
end
end
best
end
private
def frequent_bytes(representation)
table = {}
representation.bytes.each do |b|
table[b] = table[b].to_i + 1
end
table.to_a.
sort { |left, right| left.last <=> right.last }.
reverse.
collect(&:first).
slice 0, normally_frequent_bytes.length
end
def normalcy_score(representation)
normally_frequent_bytes.length -
(frequent_bytes(representation) - normally_frequent_bytes).length
end
end
end
| Refactor SingleByteXorCracker method parameter names to reflect contract | Refactor SingleByteXorCracker method parameter names to reflect contract | Ruby | mit | njonsson/matasano_crypto_challenges | ruby | ## Code Before:
require 'matasano_crypto_challenges/representations/hexadecimal'
module MatasanoCryptoChallenges
class SingleByteXorCracker
attr_reader :normally_frequent_bytes
def initialize(normally_frequent_bytes=' etaoinshrdlu'.bytes)
@normally_frequent_bytes = Array(normally_frequent_bytes)
end
def crack(hexadecimal)
best = Representations::Hexadecimal.from_bytes([])
1.upto 255 do |key_seed|
key = Representations::Hexadecimal.from_bytes([key_seed] *
hexadecimal.bytes.length)
guess = (hexadecimal ^ key)
if best.normalcy_score < (guess.normalcy_score = normalcy_score(guess))
best = guess
end
end
best
end
private
def frequent_bytes(hexadecimal)
table = {}
hexadecimal.bytes.each do |b|
table[b] = table[b].to_i + 1
end
table.to_a.
sort { |left, right| left.last <=> right.last }.
reverse.
collect(&:first).
slice 0, normally_frequent_bytes.length
end
def normalcy_score(hexadecimal)
normally_frequent_bytes.length -
(frequent_bytes(hexadecimal) - normally_frequent_bytes).length
end
end
end
## Instruction:
Refactor SingleByteXorCracker method parameter names to reflect contract
## Code After:
require 'matasano_crypto_challenges/representations/hexadecimal'
module MatasanoCryptoChallenges
class SingleByteXorCracker
attr_reader :normally_frequent_bytes
def initialize(normally_frequent_bytes=' etaoinshrdlu'.bytes)
@normally_frequent_bytes = Array(normally_frequent_bytes)
end
def crack(representation)
best = Representations::Hexadecimal.from_bytes([])
1.upto 255 do |key_seed|
key = Representations::Hexadecimal.from_bytes([key_seed] *
representation.bytes.length)
guess = (representation ^ key)
if best.normalcy_score < (guess.normalcy_score = normalcy_score(guess))
best = guess
end
end
best
end
private
def frequent_bytes(representation)
table = {}
representation.bytes.each do |b|
table[b] = table[b].to_i + 1
end
table.to_a.
sort { |left, right| left.last <=> right.last }.
reverse.
collect(&:first).
slice 0, normally_frequent_bytes.length
end
def normalcy_score(representation)
normally_frequent_bytes.length -
(frequent_bytes(representation) - normally_frequent_bytes).length
end
end
end
| require 'matasano_crypto_challenges/representations/hexadecimal'
module MatasanoCryptoChallenges
class SingleByteXorCracker
attr_reader :normally_frequent_bytes
def initialize(normally_frequent_bytes=' etaoinshrdlu'.bytes)
@normally_frequent_bytes = Array(normally_frequent_bytes)
end
- def crack(hexadecimal)
+ def crack(representation)
best = Representations::Hexadecimal.from_bytes([])
1.upto 255 do |key_seed|
key = Representations::Hexadecimal.from_bytes([key_seed] *
- hexadecimal.bytes.length)
? ^ ^ ^^^ ^^^
+ representation.bytes.length)
? ^ ^^^^^^^ ^ ^^
- guess = (hexadecimal ^ key)
+ guess = (representation ^ key)
if best.normalcy_score < (guess.normalcy_score = normalcy_score(guess))
best = guess
end
end
best
end
private
- def frequent_bytes(hexadecimal)
+ def frequent_bytes(representation)
table = {}
- hexadecimal.bytes.each do |b|
+ representation.bytes.each do |b|
table[b] = table[b].to_i + 1
end
table.to_a.
sort { |left, right| left.last <=> right.last }.
reverse.
collect(&:first).
slice 0, normally_frequent_bytes.length
end
- def normalcy_score(hexadecimal)
+ def normalcy_score(representation)
normally_frequent_bytes.length -
- (frequent_bytes(hexadecimal) - normally_frequent_bytes).length
? ^ ^ ^^^ ^^^
+ (frequent_bytes(representation) - normally_frequent_bytes).length
? ^ ^^^^^^^ ^ ^^
end
end
end | 14 | 0.297872 | 7 | 7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.