commit stringlengths 40 40 | old_file stringlengths 4 237 | new_file stringlengths 4 237 | old_contents stringlengths 1 4.24k | new_contents stringlengths 5 4.84k | subject stringlengths 15 778 | message stringlengths 16 6.86k | lang stringlengths 1 30 | license stringclasses 13 values | repos stringlengths 5 116k | config stringlengths 1 30 | content stringlengths 105 8.72k |
|---|---|---|---|---|---|---|---|---|---|---|---|
2e8f858671a21f27a6a0b75eb24f897dc872722f | beam/sbm_local.sh | beam/sbm_local.sh |
OUTPUT_PATH="/tmp/sbm"
rm -rf "${OUTPUT_PATH}"
docker-compose run \
--entrypoint "python3 /app/beam_sbm.py \
--output ${OUTPUT_PATH} \
--nsamples 5 \
--nvertex_min 10 --nvertex_max 15 \
--nedges_min 5 --nedges_max 10 \
--runner=DirectRunner" \
research-graph-synthetic
|
OUTPUT_PATH="/tmp/sbm"
rm -rf "${OUTPUT_PATH}"
mkdir -p ${OUTPUT_PATH}
docker-compose run \
--entrypoint "python3 /app/beam_sbm.py \
--output ${OUTPUT_PATH} \
--nsamples 5 \
--nvertex_min 10 --nvertex_max 15 \
--nedges_min 5 --nedges_max 10 \
--runner=DirectRunner" \
research-graph-synthetic
| Make the output dir after deleting it. | Make the output dir after deleting it.
| Shell | apache-2.0 | google-research/graphworld,google-research/graphworld | shell | ## Code Before:
OUTPUT_PATH="/tmp/sbm"
rm -rf "${OUTPUT_PATH}"
docker-compose run \
--entrypoint "python3 /app/beam_sbm.py \
--output ${OUTPUT_PATH} \
--nsamples 5 \
--nvertex_min 10 --nvertex_max 15 \
--nedges_min 5 --nedges_max 10 \
--runner=DirectRunner" \
research-graph-synthetic
## Instruction:
Make the output dir after deleting it.
## Code After:
OUTPUT_PATH="/tmp/sbm"
rm -rf "${OUTPUT_PATH}"
mkdir -p ${OUTPUT_PATH}
docker-compose run \
--entrypoint "python3 /app/beam_sbm.py \
--output ${OUTPUT_PATH} \
--nsamples 5 \
--nvertex_min 10 --nvertex_max 15 \
--nedges_min 5 --nedges_max 10 \
--runner=DirectRunner" \
research-graph-synthetic
|
7ca17e79f8c3dba7bc04377e7746a383a281562d | serverless_helpers/__init__.py | serverless_helpers/__init__.py |
import dotenv
|
from dotenv import load_dotenv, get_key, set_key, unset_key
def load_envs(path):
import os
path, _ = os.path.split(path)
if path == '/':
# bail out when you reach top of the FS
load_dotenv(os.path.join(path, '.env'))
return
# load higher envs first
# closer-to-base environments need higher precedence.
load_envs(path)
load_dotenv(os.path.join(path, '.env'))
| Add `load_envs` to take a base path and recurse up, looking for .envs | Add `load_envs` to take a base path and recurse up, looking for .envs
| Python | mit | serverless/serverless-helpers-py | python | ## Code Before:
import dotenv
## Instruction:
Add `load_envs` to take a base path and recurse up, looking for .envs
## Code After:
from dotenv import load_dotenv, get_key, set_key, unset_key
def load_envs(path):
import os
path, _ = os.path.split(path)
if path == '/':
# bail out when you reach top of the FS
load_dotenv(os.path.join(path, '.env'))
return
# load higher envs first
# closer-to-base environments need higher precedence.
load_envs(path)
load_dotenv(os.path.join(path, '.env'))
|
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;
});
}); |
015bb3ab18eb6fb5a468118bfda8f57fba55b12b | README.md | README.md | [](https://insight.sensiolabs.com/projects/caba99f3-16eb-4bee-8f2a-349a33a61afe)
Description
-----------
Visual Content Layout is a Drupal 8 Module developed to manage text filters HTML content layout and visual elements like iconography, accordions, tabs, non table columns, images, list, CTA’s, etc.
The HTML output of this module is based on Bootstrap components and grid system.
For iconography the module uses FontAwesome icons.
Requirements
------------
Drupal 8.x
Installation
------------
Coming soon…
Support
-------
info@paralleldevs.com
| [](https://insight.sensiolabs.com/projects/caba99f3-16eb-4bee-8f2a-349a33a61afe)
Description
-----------
Visual Content Layout is a Drupal 8 Module developed to manage text filters HTML content layout and visual elements like iconography, accordions, tabs, non table columns, images, list, CTA’s, etc.
The HTML output of this module is based on Bootstrap components and grid system.
For iconography the module uses FontAwesome icons.
Requirements
------------
Drupal 8.x
Installation
------------
1- Install as any other Drupal 8 Module.
2- Go to /admin/config/content/formats and add a new text format.
We recommend you name it VCL. Then check the "Visual Content Layout" checkbox
to activate the plugin.
3- IMPORTANT: Make sure you select "None" on the Text editor select box.
And as simple as that you have the module working on any
text area field.
How to use it
-------------
Now once you are creating content you should select the VCL text format from the Text Format selection field.
Then you need to click on "Enable Visual Content Layout".
From there just hit the + sign to start adding elements or SWAPS as we call it.
You can then drag and drop to move the SWAPS around.
Support
-------
info@paralleldevs.com
| Update Instalation and usage specs. | Update Instalation and usage specs.
| Markdown | mit | ParallelDevs/vcl,ParallelDevs/visual_content_layout,ParallelDevs/visual_content_layout,ParallelDevs/vcl,ParallelDevs/vcl,ParallelDevs/visual_content_layout | markdown | ## Code Before:
[](https://insight.sensiolabs.com/projects/caba99f3-16eb-4bee-8f2a-349a33a61afe)
Description
-----------
Visual Content Layout is a Drupal 8 Module developed to manage text filters HTML content layout and visual elements like iconography, accordions, tabs, non table columns, images, list, CTA’s, etc.
The HTML output of this module is based on Bootstrap components and grid system.
For iconography the module uses FontAwesome icons.
Requirements
------------
Drupal 8.x
Installation
------------
Coming soon…
Support
-------
info@paralleldevs.com
## Instruction:
Update Instalation and usage specs.
## Code After:
[](https://insight.sensiolabs.com/projects/caba99f3-16eb-4bee-8f2a-349a33a61afe)
Description
-----------
Visual Content Layout is a Drupal 8 Module developed to manage text filters HTML content layout and visual elements like iconography, accordions, tabs, non table columns, images, list, CTA’s, etc.
The HTML output of this module is based on Bootstrap components and grid system.
For iconography the module uses FontAwesome icons.
Requirements
------------
Drupal 8.x
Installation
------------
1- Install as any other Drupal 8 Module.
2- Go to /admin/config/content/formats and add a new text format.
We recommend you name it VCL. Then check the "Visual Content Layout" checkbox
to activate the plugin.
3- IMPORTANT: Make sure you select "None" on the Text editor select box.
And as simple as that you have the module working on any
text area field.
How to use it
-------------
Now once you are creating content you should select the VCL text format from the Text Format selection field.
Then you need to click on "Enable Visual Content Layout".
From there just hit the + sign to start adding elements or SWAPS as we call it.
You can then drag and drop to move the SWAPS around.
Support
-------
info@paralleldevs.com
|
31b37c1e2d7ddeaa46a7d145c1f07b9b2e4d44e4 | install.conf.yaml | install.conf.yaml | - defaults:
link:
create: true
relink: true
- clean: ['~', '~/.config', '~/.config/git', '~/.local/bin', '~/.atom']
- link:
~/.config/base16-shell: base16-shell
~/.config/zsh: zsh
~/.config/nvim: nvim
~/.config/git/config: git/config
~/.tmux.conf: tmux/tmux.conf
~/.editorconfig: editorconfig
- shell:
- [mkdir -p ~/bin && ln -s -f $(pwd)/bin/* ~/bin]
- [git submodule update --init --recursive, Installing submodules]
| - defaults:
link:
create: true
relink: true
- clean: ['~', '~/.config', '~/.config/git', '~/.config/zsh', '~/.config/nvim', '~/.config/base16-shell', '~/bin']
- link:
~/.config/base16-shell: base16-shell
~/.config/zsh: zsh
~/.config/nvim: nvim
~/.config/git/config: git/config
~/.tmux.conf: tmux/tmux.conf
~/.editorconfig: editorconfig
- shell:
- [mkdir -p ~/bin && ln -s -f $(pwd)/bin/* ~/bin]
- [git submodule update --init --recursive, Installing submodules]
| Update install script 'clean' directive | Update install script 'clean' directive
| YAML | mit | andrew-dias/dotfiles-base,andrew-dias/dotfiles | yaml | ## Code Before:
- defaults:
link:
create: true
relink: true
- clean: ['~', '~/.config', '~/.config/git', '~/.local/bin', '~/.atom']
- link:
~/.config/base16-shell: base16-shell
~/.config/zsh: zsh
~/.config/nvim: nvim
~/.config/git/config: git/config
~/.tmux.conf: tmux/tmux.conf
~/.editorconfig: editorconfig
- shell:
- [mkdir -p ~/bin && ln -s -f $(pwd)/bin/* ~/bin]
- [git submodule update --init --recursive, Installing submodules]
## Instruction:
Update install script 'clean' directive
## Code After:
- defaults:
link:
create: true
relink: true
- clean: ['~', '~/.config', '~/.config/git', '~/.config/zsh', '~/.config/nvim', '~/.config/base16-shell', '~/bin']
- link:
~/.config/base16-shell: base16-shell
~/.config/zsh: zsh
~/.config/nvim: nvim
~/.config/git/config: git/config
~/.tmux.conf: tmux/tmux.conf
~/.editorconfig: editorconfig
- shell:
- [mkdir -p ~/bin && ln -s -f $(pwd)/bin/* ~/bin]
- [git submodule update --init --recursive, Installing submodules]
|
c5f91728babd01201249c2f06048d57230a4fc26 | public/css/style.css | public/css/style.css | body {
padding-top: 50px;
}
.main-container {
padding-top: 40px;
}
.inline-form {
display: inline;
padding-left: 10px;
}
.form-register {
max-width: 330px;
padding: 15px;
margin: 0 auto;
}
.form-register .form-register-heading,
.form-register .checkbox {
margin-bottom: 10px;
}
.form-register .checkbox {
font-weight: normal;
}
.form-register .form-control {
position: relative;
height: auto;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 10px;
font-size: 16px;
}
.form-register .form-control:focus {
z-index: 2;
}
.form-register input[type="email"] {
margin-bottom: -1px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.form-register input[type="password"] {
margin-bottom: 10px;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
| body {
padding-top: 50px;
}
.main-container {
padding-top: 40px;
}
.inline-form {
display: inline;
}
.form-register {
max-width: 330px;
padding: 15px;
margin: 0 auto;
}
.form-register .form-register-heading,
.form-register .checkbox {
margin-bottom: 10px;
}
.form-register .checkbox {
font-weight: normal;
}
.form-register .form-control {
position: relative;
height: auto;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 10px;
font-size: 16px;
}
.form-register .form-control:focus {
z-index: 2;
}
.form-register input[type="email"] {
margin-bottom: -1px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.form-register input[type="password"] {
margin-bottom: 10px;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
| Remove left padding of the inline form | Remove left padding of the inline form
| CSS | mit | dimitaruzunov/journal,dimitaruzunov/journal,dimitaruzunov/journal | css | ## Code Before:
body {
padding-top: 50px;
}
.main-container {
padding-top: 40px;
}
.inline-form {
display: inline;
padding-left: 10px;
}
.form-register {
max-width: 330px;
padding: 15px;
margin: 0 auto;
}
.form-register .form-register-heading,
.form-register .checkbox {
margin-bottom: 10px;
}
.form-register .checkbox {
font-weight: normal;
}
.form-register .form-control {
position: relative;
height: auto;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 10px;
font-size: 16px;
}
.form-register .form-control:focus {
z-index: 2;
}
.form-register input[type="email"] {
margin-bottom: -1px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.form-register input[type="password"] {
margin-bottom: 10px;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
## Instruction:
Remove left padding of the inline form
## Code After:
body {
padding-top: 50px;
}
.main-container {
padding-top: 40px;
}
.inline-form {
display: inline;
}
.form-register {
max-width: 330px;
padding: 15px;
margin: 0 auto;
}
.form-register .form-register-heading,
.form-register .checkbox {
margin-bottom: 10px;
}
.form-register .checkbox {
font-weight: normal;
}
.form-register .form-control {
position: relative;
height: auto;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 10px;
font-size: 16px;
}
.form-register .form-control:focus {
z-index: 2;
}
.form-register input[type="email"] {
margin-bottom: -1px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.form-register input[type="password"] {
margin-bottom: 10px;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
|
e8aef4b9bf80da660c0374c6d476c87a3233a35e | examples/crasher/main.go | examples/crasher/main.go | package main
import (
"image/color"
"time"
"github.com/voxelbrain/pixelpixel/imageutils"
"github.com/voxelbrain/pixelpixel/protocol"
)
func main() {
c := protocol.PixelPusher()
img := protocol.NewPixel()
dImg := imageutils.DimensionChanger(img, 4, 1)
for i := 0; i < 5; i++ {
if i < 3 {
dImg.Set(i, 0, color.RGBA{uint8(100 + i*70), 0, 0, 255})
} else if i == 3 {
dImg.Set(i, 0, color.RGBA{0, 255, 0, 255})
} else {
panic("CRASH")
}
c <- img
time.Sleep(1 * time.Second)
}
}
| package main
import (
"fmt"
"image"
"time"
"github.com/voxelbrain/pixelpixel/imageutils"
"github.com/voxelbrain/pixelpixel/protocol"
)
func main() {
c := protocol.PixelPusher()
img := protocol.NewPixel()
dImg := imageutils.DimensionChanger(img, 4, 6)
for i := 0; i < 5; i++ {
color := imageutils.Green
if i > 3 {
panic("CRASH")
} else if i == 3 {
color = imageutils.Red
}
imageutils.FillRectangle(dImg, image.Rect(0, 0, 4, 6), imageutils.Black)
imageutils.DrawText(dImg, image.Rect(0, 0, 4, 6), color, fmt.Sprintf("%d", 3-i))
c <- img
time.Sleep(1 * time.Second)
}
}
| Rewrite crash with actual textual countdown | Rewrite crash with actual textual countdown
| Go | mit | voxelbrain/pixelpixel,voxelbrain/pixelpixel,voxelbrain/pixelpixel,voxelbrain/pixelpixel,voxelbrain/pixelpixel,voxelbrain/pixelpixel | go | ## Code Before:
package main
import (
"image/color"
"time"
"github.com/voxelbrain/pixelpixel/imageutils"
"github.com/voxelbrain/pixelpixel/protocol"
)
func main() {
c := protocol.PixelPusher()
img := protocol.NewPixel()
dImg := imageutils.DimensionChanger(img, 4, 1)
for i := 0; i < 5; i++ {
if i < 3 {
dImg.Set(i, 0, color.RGBA{uint8(100 + i*70), 0, 0, 255})
} else if i == 3 {
dImg.Set(i, 0, color.RGBA{0, 255, 0, 255})
} else {
panic("CRASH")
}
c <- img
time.Sleep(1 * time.Second)
}
}
## Instruction:
Rewrite crash with actual textual countdown
## Code After:
package main
import (
"fmt"
"image"
"time"
"github.com/voxelbrain/pixelpixel/imageutils"
"github.com/voxelbrain/pixelpixel/protocol"
)
func main() {
c := protocol.PixelPusher()
img := protocol.NewPixel()
dImg := imageutils.DimensionChanger(img, 4, 6)
for i := 0; i < 5; i++ {
color := imageutils.Green
if i > 3 {
panic("CRASH")
} else if i == 3 {
color = imageutils.Red
}
imageutils.FillRectangle(dImg, image.Rect(0, 0, 4, 6), imageutils.Black)
imageutils.DrawText(dImg, image.Rect(0, 0, 4, 6), color, fmt.Sprintf("%d", 3-i))
c <- img
time.Sleep(1 * time.Second)
}
}
|
fe077e837b29b3c1ce2477cac307829467455e98 | templates/index.html | templates/index.html | <!DOCTYPE html>
<html>
<head>
<title>{{{user}}}'s GitHub Pages Repositories</title>
</head>
<body>
<p>
You can provide a username in the URL, for example, <a href="https://github-gh-pages-list.herokuapp.com/?user=Mark-Simulacrum">https://github-gh-pages-list.herokuapp.com/?user=Mark-Simulacrum</a> would list the GitHub pages respositories for GitHub user Mark-Simulacrum.
</p>
<p>
This application is licensed under MIT; <a href="https://www.github.com/Mark-Simulacrum/github-pages-check">source code</a> is hosted on GitHub.
</p>
<table>
<tr><th>Repository</th><th>GitHub Pages</th></tr>
{{#repos}}
<tr>
<td><a href="{{{html_url}}}">{{{full_name}}}</a></td>
<td><a href="https://{{{owner.login}}}.github.io/{{{name}}}">Pages</a></td>
</tr>
{{/repos}}
</table>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<title>{{{user}}}'s GitHub Pages Repositories</title>
<script>
window.onload = function () {
document.getElementById("username-input").addEventListener("change", function (e) {
var a = document.createElement("a");
a.href = window.location.host + "/?user=" + e.target.value;
document.querySelector("body").appendChild(a);
a.click();
a.parentElement.removeChild(a);
e.target.value = "";
});
};
</script>
</head>
<body>
<p>
You can provide a username in the URL, for example, <a href="https://github-gh-pages-list.herokuapp.com/?user=Mark-Simulacrum">https://github-gh-pages-list.herokuapp.com/?user=Mark-Simulacrum</a> would list the GitHub pages respositories for GitHub user Mark-Simulacrum.
</p>
<p>
Please input a GitHub username to see the user's GitHub pages repositories: <input id="username-input" type="text" />
</p>
<p>
This application is licensed under MIT; <a href="https://www.github.com/Mark-Simulacrum/github-pages-check">source code</a> is hosted on GitHub.
</p>
<table>
<tr><th>Repository</th><th>GitHub Pages</th></tr>
{{#repos}}
<tr>
<td><a href="{{{html_url}}}">{{{full_name}}}</a></td>
<td><a href="https://{{{owner.login}}}.github.io/{{{name}}}">Pages</a></td>
</tr>
{{/repos}}
</table>
</body>
</html>
| Add input to ease inputting usernames for the server to find. | Add input to ease inputting usernames for the server to find.
| HTML | mit | Mark-Simulacrum/github-pages-check | html | ## Code Before:
<!DOCTYPE html>
<html>
<head>
<title>{{{user}}}'s GitHub Pages Repositories</title>
</head>
<body>
<p>
You can provide a username in the URL, for example, <a href="https://github-gh-pages-list.herokuapp.com/?user=Mark-Simulacrum">https://github-gh-pages-list.herokuapp.com/?user=Mark-Simulacrum</a> would list the GitHub pages respositories for GitHub user Mark-Simulacrum.
</p>
<p>
This application is licensed under MIT; <a href="https://www.github.com/Mark-Simulacrum/github-pages-check">source code</a> is hosted on GitHub.
</p>
<table>
<tr><th>Repository</th><th>GitHub Pages</th></tr>
{{#repos}}
<tr>
<td><a href="{{{html_url}}}">{{{full_name}}}</a></td>
<td><a href="https://{{{owner.login}}}.github.io/{{{name}}}">Pages</a></td>
</tr>
{{/repos}}
</table>
</body>
</html>
## Instruction:
Add input to ease inputting usernames for the server to find.
## Code After:
<!DOCTYPE html>
<html>
<head>
<title>{{{user}}}'s GitHub Pages Repositories</title>
<script>
window.onload = function () {
document.getElementById("username-input").addEventListener("change", function (e) {
var a = document.createElement("a");
a.href = window.location.host + "/?user=" + e.target.value;
document.querySelector("body").appendChild(a);
a.click();
a.parentElement.removeChild(a);
e.target.value = "";
});
};
</script>
</head>
<body>
<p>
You can provide a username in the URL, for example, <a href="https://github-gh-pages-list.herokuapp.com/?user=Mark-Simulacrum">https://github-gh-pages-list.herokuapp.com/?user=Mark-Simulacrum</a> would list the GitHub pages respositories for GitHub user Mark-Simulacrum.
</p>
<p>
Please input a GitHub username to see the user's GitHub pages repositories: <input id="username-input" type="text" />
</p>
<p>
This application is licensed under MIT; <a href="https://www.github.com/Mark-Simulacrum/github-pages-check">source code</a> is hosted on GitHub.
</p>
<table>
<tr><th>Repository</th><th>GitHub Pages</th></tr>
{{#repos}}
<tr>
<td><a href="{{{html_url}}}">{{{full_name}}}</a></td>
<td><a href="https://{{{owner.login}}}.github.io/{{{name}}}">Pages</a></td>
</tr>
{{/repos}}
</table>
</body>
</html>
|
ad07405ca877d65f30c9acd19abb4e782d854eaa | workshops/views.py | workshops/views.py | from django.views.generic import ListView, DetailView
from config.utils import get_active_event
from workshops.models import Workshop
class WorkshopListView(ListView):
template_name = 'workshops/list_workshops.html'
model = Workshop
context_object_name = 'workshops'
def get_queryset(self):
event = get_active_event()
return (super().get_queryset()
.filter(event=event)
.prefetch_related('applicants__user', 'skill_level')
.order_by('title'))
class WorkshopDetailView(DetailView):
template_name = 'workshops/view_workshop.html'
model = Workshop
def get_queryset(self):
return super().get_queryset().prefetch_related('applicants__user', 'skill_level')
| from django.views.generic import ListView, DetailView
from config.utils import get_active_event
from workshops.models import Workshop
class WorkshopListView(ListView):
template_name = 'workshops/list_workshops.html'
model = Workshop
context_object_name = 'workshops'
def get_queryset(self):
event = get_active_event()
return (super().get_queryset()
.filter(event=event)
.prefetch_related('applicants__user', 'skill_level')
.order_by('starts_at', 'title'))
class WorkshopDetailView(DetailView):
template_name = 'workshops/view_workshop.html'
model = Workshop
def get_queryset(self):
return super().get_queryset().prefetch_related('applicants__user', 'skill_level')
| Order workshops by start date before title | Order workshops by start date before title
| Python | bsd-3-clause | WebCampZg/conference-web,WebCampZg/conference-web,WebCampZg/conference-web | python | ## Code Before:
from django.views.generic import ListView, DetailView
from config.utils import get_active_event
from workshops.models import Workshop
class WorkshopListView(ListView):
template_name = 'workshops/list_workshops.html'
model = Workshop
context_object_name = 'workshops'
def get_queryset(self):
event = get_active_event()
return (super().get_queryset()
.filter(event=event)
.prefetch_related('applicants__user', 'skill_level')
.order_by('title'))
class WorkshopDetailView(DetailView):
template_name = 'workshops/view_workshop.html'
model = Workshop
def get_queryset(self):
return super().get_queryset().prefetch_related('applicants__user', 'skill_level')
## Instruction:
Order workshops by start date before title
## Code After:
from django.views.generic import ListView, DetailView
from config.utils import get_active_event
from workshops.models import Workshop
class WorkshopListView(ListView):
template_name = 'workshops/list_workshops.html'
model = Workshop
context_object_name = 'workshops'
def get_queryset(self):
event = get_active_event()
return (super().get_queryset()
.filter(event=event)
.prefetch_related('applicants__user', 'skill_level')
.order_by('starts_at', 'title'))
class WorkshopDetailView(DetailView):
template_name = 'workshops/view_workshop.html'
model = Workshop
def get_queryset(self):
return super().get_queryset().prefetch_related('applicants__user', 'skill_level')
|
cd460dadc9bd85f4dc7356b20abf7cb3e3401dd0 | index.js | index.js | const Automerge = require('automerge')
function applyCodeMirrorChangeToAutomerge(state, findList, change, cm) {
const startPos = cm.indexFromPos(change.from)
if (change.to.line === change.from.line && change.to.ch === change.from.ch) {
// nothing was removed.
} else {
// delete.removed contains an array of removed lines as strings, so this adds
// all the lengths. Later change.removed.length - 1 is added for the \n-chars
// (-1 because the linebreak on the last line won't get deleted)
let delLen = 0
for (let rm = 0; rm < change.removed.length; rm++) {
delLen += change.removed[rm].length
}
delLen += change.removed.length - 1
state = Automerge.changeset(state, 'Delete', doc => {
findList(doc).splice(startPos, delLen)
})
}
if (change.text) {
state = Automerge.changeset(state, 'Insert', doc => {
findList(doc).splice(startPos, 0, ...change.text.join('\n').split(''))
})
}
if (change.next) {
state = applyCodeMirrorChangeToAutomerge(state, change.next, cm)
}
return state
}
module.exports = {
applyCodeMirrorChangeToAutomerge,
}
| const Automerge = require('automerge')
function applyCodeMirrorChangeToAutomerge(state, findList, change, cm) {
const startPos = cm.indexFromPos(change.from)
if (change.to.line === change.from.line && change.to.ch === change.from.ch) {
// nothing was removed.
} else {
// delete.removed contains an array of removed lines as strings.
// each removed line does not include the \n, so we add +1
// Finally remove 1 because the last \n won't be deleted
let delLen =
change.removed.reduce((sum, remove) => sum + remove.length + 1, 0) - 1
state = Automerge.changeset(state, 'Delete', doc => {
findList(doc).splice(startPos, delLen)
})
}
if (change.text) {
state = Automerge.changeset(state, 'Insert', doc => {
findList(doc).splice(startPos, 0, ...change.text.join('\n').split(''))
})
}
if (change.next) {
state = applyCodeMirrorChangeToAutomerge(state, change.next, cm)
}
return state
}
module.exports = {
applyCodeMirrorChangeToAutomerge,
}
| Use Array.reduce to compute how much to delete | Use Array.reduce to compute how much to delete
| JavaScript | mit | aslakhellesoy/automerge-codemirror,aslakhellesoy/automerge-codemirror | javascript | ## Code Before:
const Automerge = require('automerge')
function applyCodeMirrorChangeToAutomerge(state, findList, change, cm) {
const startPos = cm.indexFromPos(change.from)
if (change.to.line === change.from.line && change.to.ch === change.from.ch) {
// nothing was removed.
} else {
// delete.removed contains an array of removed lines as strings, so this adds
// all the lengths. Later change.removed.length - 1 is added for the \n-chars
// (-1 because the linebreak on the last line won't get deleted)
let delLen = 0
for (let rm = 0; rm < change.removed.length; rm++) {
delLen += change.removed[rm].length
}
delLen += change.removed.length - 1
state = Automerge.changeset(state, 'Delete', doc => {
findList(doc).splice(startPos, delLen)
})
}
if (change.text) {
state = Automerge.changeset(state, 'Insert', doc => {
findList(doc).splice(startPos, 0, ...change.text.join('\n').split(''))
})
}
if (change.next) {
state = applyCodeMirrorChangeToAutomerge(state, change.next, cm)
}
return state
}
module.exports = {
applyCodeMirrorChangeToAutomerge,
}
## Instruction:
Use Array.reduce to compute how much to delete
## Code After:
const Automerge = require('automerge')
function applyCodeMirrorChangeToAutomerge(state, findList, change, cm) {
const startPos = cm.indexFromPos(change.from)
if (change.to.line === change.from.line && change.to.ch === change.from.ch) {
// nothing was removed.
} else {
// delete.removed contains an array of removed lines as strings.
// each removed line does not include the \n, so we add +1
// Finally remove 1 because the last \n won't be deleted
let delLen =
change.removed.reduce((sum, remove) => sum + remove.length + 1, 0) - 1
state = Automerge.changeset(state, 'Delete', doc => {
findList(doc).splice(startPos, delLen)
})
}
if (change.text) {
state = Automerge.changeset(state, 'Insert', doc => {
findList(doc).splice(startPos, 0, ...change.text.join('\n').split(''))
})
}
if (change.next) {
state = applyCodeMirrorChangeToAutomerge(state, change.next, cm)
}
return state
}
module.exports = {
applyCodeMirrorChangeToAutomerge,
}
|
13aead9124467d533caf274bf4f473ec3773e525 | tests/514-string-multiline.check.sh | tests/514-string-multiline.check.sh |
set -x
OUTPUT=514-string-multiline.out
grep -q 1234 ${OUTPUT} || exit 1
grep -q 4321 ${OUTPUT} || exit 1
grep -q AA ${OUTPUT} || exit 1
grep -q "x=1" ${OUTPUT} || exit 1
echo OK
exit 0
|
set -x
grep -q 1234 ${TURBINE_OUTPUT} || exit 1
grep -q 4321 ${TURBINE_OUTPUT} || exit 1
grep -q AA ${TURBINE_OUTPUT} || exit 1
grep -q "x=1" ${TURBINE_OUTPUT} || exit 1
echo OK
exit 0
| Fix test 514 so it isn't sensitive to test directory | Fix test 514 so it isn't sensitive to test directory
git-svn-id: 47705994653588c662f4ea400dfe88107361c0e2@7696 dc4e9af1-7f46-4ead-bba6-71afc04862de
| Shell | apache-2.0 | swift-lang/swift-t,blue42u/swift-t,JohnPJenkins/swift-t,JohnPJenkins/swift-t,JohnPJenkins/swift-t,blue42u/swift-t,blue42u/swift-t,blue42u/swift-t,basheersubei/swift-t,swift-lang/swift-t,swift-lang/swift-t,swift-lang/swift-t,JohnPJenkins/swift-t,basheersubei/swift-t,JohnPJenkins/swift-t,basheersubei/swift-t,swift-lang/swift-t,blue42u/swift-t,basheersubei/swift-t,basheersubei/swift-t,blue42u/swift-t,JohnPJenkins/swift-t,basheersubei/swift-t,blue42u/swift-t,basheersubei/swift-t,JohnPJenkins/swift-t,swift-lang/swift-t,swift-lang/swift-t | shell | ## Code Before:
set -x
OUTPUT=514-string-multiline.out
grep -q 1234 ${OUTPUT} || exit 1
grep -q 4321 ${OUTPUT} || exit 1
grep -q AA ${OUTPUT} || exit 1
grep -q "x=1" ${OUTPUT} || exit 1
echo OK
exit 0
## Instruction:
Fix test 514 so it isn't sensitive to test directory
git-svn-id: 47705994653588c662f4ea400dfe88107361c0e2@7696 dc4e9af1-7f46-4ead-bba6-71afc04862de
## Code After:
set -x
grep -q 1234 ${TURBINE_OUTPUT} || exit 1
grep -q 4321 ${TURBINE_OUTPUT} || exit 1
grep -q AA ${TURBINE_OUTPUT} || exit 1
grep -q "x=1" ${TURBINE_OUTPUT} || exit 1
echo OK
exit 0
|
62d77d6b44cb24415559a63f6cd43dc8adb6ca74 | src/views/resources/page.blade.php | src/views/resources/page.blade.php | @extends('orchestra/foundation::layout.main')
@section('content')
<div class="row">
<div class="three columns">
<div class="list-group">
<?php foreach ($resources['list'] as $name => $resource) : ?>
<a href="<?php echo resources($name); ?>"
class="list-group-item <?php echo Request::is("*/resources/{$name}*") ? 'active' : ''; ?>">
<?php echo $resource->name; ?>
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
<?php endforeach; ?>
</div>
@placeholder("orchestra.resources: {$resource->name}")
@placeholder('orchestra.resources')
</div>
<div class="nine columns">
<?php echo $content; ?>
</div>
</div>
@stop
| @extends('orchestra/foundation::layout.main')
@section('content')
<div class="row">
<div class="three columns">
<div class="list-group">
<?php foreach ($resources['list'] as $name => $resource) : ?>
<a href="<?php echo resources($name); ?>"
class="list-group-item <?php echo Request::is("*/resources/{$name}*") ? 'active' : ''; ?>">
<?php echo $resource->name; ?>
<span class="glyphicon glyphicon-chevron-right pull-right"></span>
</a>
<?php endforeach; ?>
</div>
@placeholder("orchestra.resources: {$resource->name}")
@placeholder('orchestra.resources')
</div>
<div class="nine columns">
<?php echo $content; ?>
</div>
</div>
@stop
| Add .pull-right to resources sidebar nav. | Add .pull-right to resources sidebar nav.
Signed-off-by: crynobone <e1a543840a942eb68427510a8a483282a7bfeddf@gmail.com>
| PHP | mit | stevebauman/foundation,orchestral/foundation,orchestral/foundation,orchestral/foundation | php | ## Code Before:
@extends('orchestra/foundation::layout.main')
@section('content')
<div class="row">
<div class="three columns">
<div class="list-group">
<?php foreach ($resources['list'] as $name => $resource) : ?>
<a href="<?php echo resources($name); ?>"
class="list-group-item <?php echo Request::is("*/resources/{$name}*") ? 'active' : ''; ?>">
<?php echo $resource->name; ?>
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
<?php endforeach; ?>
</div>
@placeholder("orchestra.resources: {$resource->name}")
@placeholder('orchestra.resources')
</div>
<div class="nine columns">
<?php echo $content; ?>
</div>
</div>
@stop
## Instruction:
Add .pull-right to resources sidebar nav.
Signed-off-by: crynobone <e1a543840a942eb68427510a8a483282a7bfeddf@gmail.com>
## Code After:
@extends('orchestra/foundation::layout.main')
@section('content')
<div class="row">
<div class="three columns">
<div class="list-group">
<?php foreach ($resources['list'] as $name => $resource) : ?>
<a href="<?php echo resources($name); ?>"
class="list-group-item <?php echo Request::is("*/resources/{$name}*") ? 'active' : ''; ?>">
<?php echo $resource->name; ?>
<span class="glyphicon glyphicon-chevron-right pull-right"></span>
</a>
<?php endforeach; ?>
</div>
@placeholder("orchestra.resources: {$resource->name}")
@placeholder('orchestra.resources')
</div>
<div class="nine columns">
<?php echo $content; ?>
</div>
</div>
@stop
|
3a9530e4d278ea3f4e1f4339dfa71f1a7cd2b3fa | app/graphql/types/ticket_type_type.rb | app/graphql/types/ticket_type_type.rb | class Types::TicketTypeType < Types::BaseObject
field :id, Integer, null: false
field :name, String, null: true
field :publicly_available, Boolean, null: false
field :counts_towards_convention_maximum, Boolean, null: false
field :allows_event_signups, Boolean, null: false
field :maximum_event_provided_tickets, Integer, null: false do
argument :event_id, Integer, required: false
end
def maximum_event_provided_tickets(**args)
if args[:event_id]
object.maximum_event_provided_tickets_for_event_id(args[:event_id])
else
object.maximum_event_provided_tickets
end
end
field :description, String, null: true
field :pricing_schedule, Types::ScheduledMoneyValueType, null: true
field :convention, Types::ConventionType, null: false
def convention
RecordLoader.for(Convention).load(object.convention_id)
end
end
| class Types::TicketTypeType < Types::BaseObject
field :id, Integer, null: false
field :name, String, null: true
field :publicly_available, Boolean, null: false
field :counts_towards_convention_maximum, Boolean, null: false
field :allows_event_signups, Boolean, null: false
field :maximum_event_provided_tickets, Integer, null: false do
argument :event_id, Integer, required: false, camelize: false
end
def maximum_event_provided_tickets(**args)
if args[:event_id]
object.maximum_event_provided_tickets_for_event_id(args[:event_id])
else
object.maximum_event_provided_tickets
end
end
field :description, String, null: true
field :pricing_schedule, Types::ScheduledMoneyValueType, null: true
field :convention, Types::ConventionType, null: false
def convention
RecordLoader.for(Convention).load(object.convention_id)
end
end
| Fix one more schema discrepancy | Fix one more schema discrepancy
| Ruby | mit | neinteractiveliterature/intercode,neinteractiveliterature/intercode,neinteractiveliterature/intercode,neinteractiveliterature/intercode,neinteractiveliterature/intercode | ruby | ## Code Before:
class Types::TicketTypeType < Types::BaseObject
field :id, Integer, null: false
field :name, String, null: true
field :publicly_available, Boolean, null: false
field :counts_towards_convention_maximum, Boolean, null: false
field :allows_event_signups, Boolean, null: false
field :maximum_event_provided_tickets, Integer, null: false do
argument :event_id, Integer, required: false
end
def maximum_event_provided_tickets(**args)
if args[:event_id]
object.maximum_event_provided_tickets_for_event_id(args[:event_id])
else
object.maximum_event_provided_tickets
end
end
field :description, String, null: true
field :pricing_schedule, Types::ScheduledMoneyValueType, null: true
field :convention, Types::ConventionType, null: false
def convention
RecordLoader.for(Convention).load(object.convention_id)
end
end
## Instruction:
Fix one more schema discrepancy
## Code After:
class Types::TicketTypeType < Types::BaseObject
field :id, Integer, null: false
field :name, String, null: true
field :publicly_available, Boolean, null: false
field :counts_towards_convention_maximum, Boolean, null: false
field :allows_event_signups, Boolean, null: false
field :maximum_event_provided_tickets, Integer, null: false do
argument :event_id, Integer, required: false, camelize: false
end
def maximum_event_provided_tickets(**args)
if args[:event_id]
object.maximum_event_provided_tickets_for_event_id(args[:event_id])
else
object.maximum_event_provided_tickets
end
end
field :description, String, null: true
field :pricing_schedule, Types::ScheduledMoneyValueType, null: true
field :convention, Types::ConventionType, null: false
def convention
RecordLoader.for(Convention).load(object.convention_id)
end
end
|
789e04879e362ced05ee7b4a1ab534004e7291f2 | requirements-common.txt | requirements-common.txt | Django==1.5.5
Markdown==2.4
Pygments==1.6
South==0.8.4
django-generic-aggregation==0.3.2
django-haystack==2.1.0
django-pagination==1.0.7
django-registration==1.0
django-taggit==0.11.2
-e git+https://github.com/django-de/cab#egg=cab
-e git+https://github.com/jezdez/django-simple-ratings#egg=django-simple-ratings
| Django==1.5.5
Markdown==2.4
Pygments==1.6
South==0.8.4
django-generic-aggregation==0.3.2
django-haystack==2.1.0
django-pagination==1.0.7
django-registration==1.0
django-taggit==0.11.2
django-cab==0.3
django-simple-ratings==0.3.3
| Use released versions of own packages. | Use released versions of own packages.
| Text | bsd-3-clause | django/djangosnippets.org,django-de/djangosnippets.org,django-de/djangosnippets.org,django/djangosnippets.org,django-de/djangosnippets.org,django/djangosnippets.org,django-de/djangosnippets.org,django/djangosnippets.org,django/djangosnippets.org | text | ## Code Before:
Django==1.5.5
Markdown==2.4
Pygments==1.6
South==0.8.4
django-generic-aggregation==0.3.2
django-haystack==2.1.0
django-pagination==1.0.7
django-registration==1.0
django-taggit==0.11.2
-e git+https://github.com/django-de/cab#egg=cab
-e git+https://github.com/jezdez/django-simple-ratings#egg=django-simple-ratings
## Instruction:
Use released versions of own packages.
## Code After:
Django==1.5.5
Markdown==2.4
Pygments==1.6
South==0.8.4
django-generic-aggregation==0.3.2
django-haystack==2.1.0
django-pagination==1.0.7
django-registration==1.0
django-taggit==0.11.2
django-cab==0.3
django-simple-ratings==0.3.3
|
07f320b50de665ea8529f7a6a340f8d287b22814 | noudar-rendering/Logger.cpp | noudar-rendering/Logger.cpp | //
// Created by monty on 26/09/16.
//
#include <string>
#include <cstdarg>
#ifdef __ANDROID__
#include <android/log.h>
#else
#include <cstdio>
#endif
#include "Logger.h"
namespace odb {
void doLog(const char *format, va_list args) {
char buffer[255];
std::vsnprintf(buffer, 255, format, args);
#ifdef __ANDROID__
__android_log_print(ANDROID_LOG_INFO, "Logger::log", "%s", buffer);
#else
std::printf( "%s\n", buffer );
#endif
}
void Logger::log(const char *format, ...) {
va_list args;
va_start(args, format);
doLog(format, args);
va_end(args);
}
void Logger::log(std::string format, ...) {
va_list args;
va_start(args, format);
auto fmt = format.c_str();
doLog(fmt, args);
va_end(args);
}
}
| //
// Created by monty on 26/09/16.
//
#include <string>
#include <cstdarg>
#include <cstring>
#ifdef __ANDROID__
#include <android/log.h>
#else
#include <cstdio>
#endif
#include "Logger.h"
namespace odb {
void doLog(const char *format, va_list args) {
char buffer[255];
return;
memset(&buffer[0], 0, 255);
std::vsnprintf(buffer, 255, format, args);
#ifdef __ANDROID__
__android_log_print(ANDROID_LOG_INFO, "Logger::log", "%s", buffer);
#else
std::printf( "%s\n", buffer );
#endif
}
void Logger::log(const char *format, ...) {
va_list args;
va_start(args, format);
doLog(format, args);
va_end(args);
}
void Logger::log(std::string format, ...) {
va_list args;
va_start(args, format);
auto fmt = format.c_str();
doLog(fmt, args);
va_end(args);
}
}
| Fix compilation error on OSX | Fix compilation error on OSX
| C++ | bsd-2-clause | TheFakeMontyOnTheRun/dungeons-of-noudar,TheFakeMontyOnTheRun/dungeons-of-noudar | c++ | ## Code Before:
//
// Created by monty on 26/09/16.
//
#include <string>
#include <cstdarg>
#ifdef __ANDROID__
#include <android/log.h>
#else
#include <cstdio>
#endif
#include "Logger.h"
namespace odb {
void doLog(const char *format, va_list args) {
char buffer[255];
std::vsnprintf(buffer, 255, format, args);
#ifdef __ANDROID__
__android_log_print(ANDROID_LOG_INFO, "Logger::log", "%s", buffer);
#else
std::printf( "%s\n", buffer );
#endif
}
void Logger::log(const char *format, ...) {
va_list args;
va_start(args, format);
doLog(format, args);
va_end(args);
}
void Logger::log(std::string format, ...) {
va_list args;
va_start(args, format);
auto fmt = format.c_str();
doLog(fmt, args);
va_end(args);
}
}
## Instruction:
Fix compilation error on OSX
## Code After:
//
// Created by monty on 26/09/16.
//
#include <string>
#include <cstdarg>
#include <cstring>
#ifdef __ANDROID__
#include <android/log.h>
#else
#include <cstdio>
#endif
#include "Logger.h"
namespace odb {
void doLog(const char *format, va_list args) {
char buffer[255];
return;
memset(&buffer[0], 0, 255);
std::vsnprintf(buffer, 255, format, args);
#ifdef __ANDROID__
__android_log_print(ANDROID_LOG_INFO, "Logger::log", "%s", buffer);
#else
std::printf( "%s\n", buffer );
#endif
}
void Logger::log(const char *format, ...) {
va_list args;
va_start(args, format);
doLog(format, args);
va_end(args);
}
void Logger::log(std::string format, ...) {
va_list args;
va_start(args, format);
auto fmt = format.c_str();
doLog(fmt, args);
va_end(args);
}
}
|
4ba98c04c130a32a5a88f100e8e919236c17e784 | app/templates/words/index.hbs | app/templates/words/index.hbs | <div class="wrapper words-index">
<h1>Browse Words</h1>
<div class="select-pos">
<div class="title">Part of Speech</div>
<label>
{{input type="checkbox" checked=isChecked}}
<span>Verb</span>
</label>
<label>
{{input type="checkbox" checked=isChecked}}
<span>Adjective</span>
</label>
</div>
<div class="select-label">
<div class="title">Label</div>
<label>
{{input type="checkbox" checked=isChecked}}
<span>Verb</span>
</label>
<label>
{{input type="checkbox" checked=isChecked}}
<span>Adjective</span>
</label>
</div>
</div>
| <div class="wrapper words-index">
<h1>Browse Words</h1>
<div class="select-pos">
<div class="title">Part of Speech</div>
<label>
{{input type="checkbox"}}
<span>Verb</span>
</label>
<label>
{{input type="checkbox"}}
<span>Adjective</span>
</label>
</div>
<div class="select-label">
<div class="title">Label</div>
<label>
{{input type="checkbox"}}
<span>Verb</span>
</label>
<label>
{{input type="checkbox"}}
<span>Adjective</span>
</label>
</div>
<div class="word-list">
</div>
</div>
| Remove attributes from the browse page | Remove attributes from the browse page
| Handlebars | mit | BryanCode/wordset-ui,BryanCode/wordset-ui,BryanCode/wordset-ui,wordset/wordset-ui,wordset/wordset-ui,wordset/wordset-ui | handlebars | ## Code Before:
<div class="wrapper words-index">
<h1>Browse Words</h1>
<div class="select-pos">
<div class="title">Part of Speech</div>
<label>
{{input type="checkbox" checked=isChecked}}
<span>Verb</span>
</label>
<label>
{{input type="checkbox" checked=isChecked}}
<span>Adjective</span>
</label>
</div>
<div class="select-label">
<div class="title">Label</div>
<label>
{{input type="checkbox" checked=isChecked}}
<span>Verb</span>
</label>
<label>
{{input type="checkbox" checked=isChecked}}
<span>Adjective</span>
</label>
</div>
</div>
## Instruction:
Remove attributes from the browse page
## Code After:
<div class="wrapper words-index">
<h1>Browse Words</h1>
<div class="select-pos">
<div class="title">Part of Speech</div>
<label>
{{input type="checkbox"}}
<span>Verb</span>
</label>
<label>
{{input type="checkbox"}}
<span>Adjective</span>
</label>
</div>
<div class="select-label">
<div class="title">Label</div>
<label>
{{input type="checkbox"}}
<span>Verb</span>
</label>
<label>
{{input type="checkbox"}}
<span>Adjective</span>
</label>
</div>
<div class="word-list">
</div>
</div>
|
0e3e30bd9ace8984385796708a8aa547c849cdc0 | salt/apps/ocw/pull_edx_courses_json.sls | salt/apps/ocw/pull_edx_courses_json.sls |
pull_edx_courses_json:
module.run:
- name: s3.get
- bucket: open-learning-course-data
- path: edx_courses.json
- local_file: /var/www/ocw/courses/edx_courses.json
ensure_ownership_and_perms_of_edx_courses_json:
file.managed:
- name: /var/www/ocw/courses/edx_courses.json
- user: fsuser
- group: fsuser
- mode: 0644
|
pull_edx_courses_json:
module.run:
- name: s3.get
- bucket: open-learning-course-data-production
- path: edx_courses.json
- local_file: /var/www/ocw/courses/edx_courses.json
ensure_ownership_and_perms_of_edx_courses_json:
file.managed:
- name: /var/www/ocw/courses/edx_courses.json
- user: fsuser
- group: fsuser
- mode: 0644
| Update bucket for OCW edx_courses.json scheduled task | Update bucket for OCW edx_courses.json scheduled task
| SaltStack | bsd-3-clause | mitodl/salt-ops,mitodl/salt-ops | saltstack | ## Code Before:
pull_edx_courses_json:
module.run:
- name: s3.get
- bucket: open-learning-course-data
- path: edx_courses.json
- local_file: /var/www/ocw/courses/edx_courses.json
ensure_ownership_and_perms_of_edx_courses_json:
file.managed:
- name: /var/www/ocw/courses/edx_courses.json
- user: fsuser
- group: fsuser
- mode: 0644
## Instruction:
Update bucket for OCW edx_courses.json scheduled task
## Code After:
pull_edx_courses_json:
module.run:
- name: s3.get
- bucket: open-learning-course-data-production
- path: edx_courses.json
- local_file: /var/www/ocw/courses/edx_courses.json
ensure_ownership_and_perms_of_edx_courses_json:
file.managed:
- name: /var/www/ocw/courses/edx_courses.json
- user: fsuser
- group: fsuser
- mode: 0644
|
ca0c159e54cde05ef2a1eca02a3b0b4ecfdf1f7a | README.md | README.md |
> Elegantly visualising bundle sizes over time.
Bramble is a bundle analyser. It can be easily composed into your build pipeline. It maintains data about, and generates visualisations for your bundle.
## Install
```sh
npm install bramble
```
## Build integration
The recommended ways to setup bramble are:
### Netlify
This means that you can analyse bundles over time as part of PRs and releases.
1. Configure Netlify to run `bramble` (or an NPM script that does so)
2. Point Netlify at the `bramble/` folder (or your configured folder).
### During prepublish
```json
{
"scripts": {
"prepublish": "webpack && bramble"
}
}
```
## Regression testing
Since bramble tracks the state of your bundle sizes over time, you can run a check at build time to fail the build if your bundle doesn't meet a specific threshold.
For example, you can run this as part of your test step:
```sh
{
"scripts": {
"test": "webpack && bramble check"
}
}
```
|
> Elegantly visualising bundle sizes over time.
Bramble is a bundle analyser. It can be easily composed into your build pipeline. It maintains data about, and generates visualisations for your bundle.
## Install
```sh
npm install bramble
```
## Build integration
The recommended ways to setup bramble are:
### Netlify
This means that you can analyse bundles over time as part of PRs and releases.
1. Configure Netlify to run `bramble` (or an NPM script that does so)
2. Point Netlify at the `bramble/` folder (or your configured folder).
### During prepublish
```json
{
"scripts": {
"prepublish": "webpack && bramble"
}
}
```
## Regression testing
Since bramble tracks the state of your bundle sizes over time, you can run a check at build time to fail the build if your bundle doesn't meet a specific threshold.
For example, you can run this as part of your test step:
```sh
{
"scripts": {
"test": "webpack && bramble check --threshold 10k"
}
}
```
| Add --threshold argument to docs. | Add --threshold argument to docs.
| Markdown | mit | bramblejs/bramble,bramblejs/bramble | markdown | ## Code Before:
> Elegantly visualising bundle sizes over time.
Bramble is a bundle analyser. It can be easily composed into your build pipeline. It maintains data about, and generates visualisations for your bundle.
## Install
```sh
npm install bramble
```
## Build integration
The recommended ways to setup bramble are:
### Netlify
This means that you can analyse bundles over time as part of PRs and releases.
1. Configure Netlify to run `bramble` (or an NPM script that does so)
2. Point Netlify at the `bramble/` folder (or your configured folder).
### During prepublish
```json
{
"scripts": {
"prepublish": "webpack && bramble"
}
}
```
## Regression testing
Since bramble tracks the state of your bundle sizes over time, you can run a check at build time to fail the build if your bundle doesn't meet a specific threshold.
For example, you can run this as part of your test step:
```sh
{
"scripts": {
"test": "webpack && bramble check"
}
}
```
## Instruction:
Add --threshold argument to docs.
## Code After:
> Elegantly visualising bundle sizes over time.
Bramble is a bundle analyser. It can be easily composed into your build pipeline. It maintains data about, and generates visualisations for your bundle.
## Install
```sh
npm install bramble
```
## Build integration
The recommended ways to setup bramble are:
### Netlify
This means that you can analyse bundles over time as part of PRs and releases.
1. Configure Netlify to run `bramble` (or an NPM script that does so)
2. Point Netlify at the `bramble/` folder (or your configured folder).
### During prepublish
```json
{
"scripts": {
"prepublish": "webpack && bramble"
}
}
```
## Regression testing
Since bramble tracks the state of your bundle sizes over time, you can run a check at build time to fail the build if your bundle doesn't meet a specific threshold.
For example, you can run this as part of your test step:
```sh
{
"scripts": {
"test": "webpack && bramble check --threshold 10k"
}
}
```
|
8a9962882ccd1dda3cdb9708d3db3205d40deb4a | builder/hyperv/common/ssh.go | builder/hyperv/common/ssh.go | package common
import (
"log"
"github.com/hashicorp/packer/helper/multistep"
)
func CommHost(host string) func(multistep.StateBag) (string, error) {
return func(state multistep.StateBag) (string, error) {
if host != "" {
log.Println("Using ssh_host value: %s", ipAddress)
return host, nil
}
vmName := state.Get("vmName").(string)
driver := state.Get("driver").(Driver)
mac, err := driver.Mac(vmName)
if err != nil {
return "", err
}
ip, err := driver.IpAddress(mac)
if err != nil {
return "", err
}
return ip, nil
}
}
| package common
import (
"log"
"github.com/hashicorp/packer/helper/multistep"
)
func CommHost(host string) func(multistep.StateBag) (string, error) {
return func(state multistep.StateBag) (string, error) {
if host != "" {
log.Printf("Using ssh_host value: %s", host)
return host, nil
}
vmName := state.Get("vmName").(string)
driver := state.Get("driver").(Driver)
mac, err := driver.Mac(vmName)
if err != nil {
return "", err
}
ip, err := driver.IpAddress(mac)
if err != nil {
return "", err
}
return ip, nil
}
}
| Use Printf not Println. D'oh. | Use Printf not Println. D'oh.
| Go | mpl-2.0 | mitchellh/packer,pecigonzalo/packer,mkuzmin/packer,bryson/packer,ricardclau/packer,paulmey/packer,bryson/packer,ricardclau/packer,paulmey/packer,dave2/packer,pecigonzalo/packer,tas50/packer,bryson/packer,rnaveiras/packer,timsutton/packer,hashicorp/packer,paulmey/packer,timsutton/packer,tas50/packer,grubernaut/packer,youhong316/packer,youhong316/packer,mitchellh/packer,rnaveiras/packer,timsutton/packer,paulmey/packer,paulmey/packer,mitchellh/packer,mitchellh/packer,grubernaut/packer,youhong316/packer,rnaveiras/packer,bryson/packer,hashicorp/packer,tas50/packer,timsutton/packer,dave2/packer,mitchellh/packer,dave2/packer,youhong316/packer,ricardclau/packer,pecigonzalo/packer,mkuzmin/packer,grubernaut/packer,ricardclau/packer,mkuzmin/packer,bryson/packer,dave2/packer,tas50/packer,rnaveiras/packer,grubernaut/packer,dave2/packer,grubernaut/packer,tas50/packer,rnaveiras/packer,youhong316/packer,mkuzmin/packer,ricardclau/packer,timsutton/packer,timsutton/packer,mkuzmin/packer,bryson/packer,tas50/packer,pecigonzalo/packer,dave2/packer,youhong316/packer,grubernaut/packer,paulmey/packer,mkuzmin/packer,rnaveiras/packer,hashicorp/packer,ricardclau/packer,hashicorp/packer | go | ## Code Before:
package common
import (
"log"
"github.com/hashicorp/packer/helper/multistep"
)
func CommHost(host string) func(multistep.StateBag) (string, error) {
return func(state multistep.StateBag) (string, error) {
if host != "" {
log.Println("Using ssh_host value: %s", ipAddress)
return host, nil
}
vmName := state.Get("vmName").(string)
driver := state.Get("driver").(Driver)
mac, err := driver.Mac(vmName)
if err != nil {
return "", err
}
ip, err := driver.IpAddress(mac)
if err != nil {
return "", err
}
return ip, nil
}
}
## Instruction:
Use Printf not Println. D'oh.
## Code After:
package common
import (
"log"
"github.com/hashicorp/packer/helper/multistep"
)
func CommHost(host string) func(multistep.StateBag) (string, error) {
return func(state multistep.StateBag) (string, error) {
if host != "" {
log.Printf("Using ssh_host value: %s", host)
return host, nil
}
vmName := state.Get("vmName").(string)
driver := state.Get("driver").(Driver)
mac, err := driver.Mac(vmName)
if err != nil {
return "", err
}
ip, err := driver.IpAddress(mac)
if err != nil {
return "", err
}
return ip, nil
}
}
|
4d51e8279cdf10b0b4940a7845bd92c87f59881f | dependencies-debian-runtime.txt | dependencies-debian-runtime.txt |
libgstreamer1.0-0 (>= 1.8.3),
gstreamer1.0-tools (>= 1.8.0),
gstreamer1.0-x (>= 1.8.3),
gstreamer1.0-plugins-base (>= 1.8.0),
gstreamer1.0-plugins-good (>= 1.8.0),
gstreamer1.0-plugins-bad (>= 1.8.0),
gstreamer1.0-plugins-ugly (>= 1.8.3),
libxml2 (>= 2.9.3),
libzip4 (>= 1.0.1),
libglib2.0-0 (>= 2.48.2),
libgirepository-1.0-1 (>= 1.46.0),
# usb specific dependencies
libudev1 (>= 229),
libusb-1.0-0 (>= 2:1.0.20),
libuuid1 (>= 2.27),
# aravis specific dependencies
libxml2 (>= 2.9.3),
libpcap0.8 (>= 1.7.4-2),
# tools specific dependencies
python3-pyqt5 (>= 5.5.1),
python3-gi (>= 3.20.0),
|
libgstreamer1.0-0 (>= 1.8.3),
gstreamer1.0-tools (>= 1.8.0),
gstreamer1.0-x (>= 1.8.3),
gstreamer1.0-plugins-base (>= 1.8.0),
gstreamer1.0-plugins-good (>= 1.8.0),
gstreamer1.0-plugins-bad (>= 1.8.0),
gstreamer1.0-plugins-ugly (>= 1.8.3),
libxml2 (>= 2.9.3),
# glob to address different libzip versions
# ubuntu 20.04 has libzip5
# both 4 and 5 have versions greater than
# the documented one
libzip[4-5] (>= 1.0.1),
libglib2.0-0 (>= 2.48.2),
libgirepository-1.0-1 (>= 1.46.0),
# usb specific dependencies
libudev1 (>= 229),
libusb-1.0-0 (>= 2:1.0.20),
libuuid1 (>= 2.27),
# aravis specific dependencies
libxml2 (>= 2.9.3),
libpcap0.8 (>= 1.7.4-2),
# tools specific dependencies
python3-pyqt5 (>= 5.5.1),
python3-gi (>= 3.20.0),
| Use libzip[4-5] in dependency description | dependencies: Use libzip[4-5] in dependency description
| Text | apache-2.0 | TheImagingSource/tiscamera,TheImagingSource/tiscamera,TheImagingSource/tiscamera,TheImagingSource/tiscamera | text | ## Code Before:
libgstreamer1.0-0 (>= 1.8.3),
gstreamer1.0-tools (>= 1.8.0),
gstreamer1.0-x (>= 1.8.3),
gstreamer1.0-plugins-base (>= 1.8.0),
gstreamer1.0-plugins-good (>= 1.8.0),
gstreamer1.0-plugins-bad (>= 1.8.0),
gstreamer1.0-plugins-ugly (>= 1.8.3),
libxml2 (>= 2.9.3),
libzip4 (>= 1.0.1),
libglib2.0-0 (>= 2.48.2),
libgirepository-1.0-1 (>= 1.46.0),
# usb specific dependencies
libudev1 (>= 229),
libusb-1.0-0 (>= 2:1.0.20),
libuuid1 (>= 2.27),
# aravis specific dependencies
libxml2 (>= 2.9.3),
libpcap0.8 (>= 1.7.4-2),
# tools specific dependencies
python3-pyqt5 (>= 5.5.1),
python3-gi (>= 3.20.0),
## Instruction:
dependencies: Use libzip[4-5] in dependency description
## Code After:
libgstreamer1.0-0 (>= 1.8.3),
gstreamer1.0-tools (>= 1.8.0),
gstreamer1.0-x (>= 1.8.3),
gstreamer1.0-plugins-base (>= 1.8.0),
gstreamer1.0-plugins-good (>= 1.8.0),
gstreamer1.0-plugins-bad (>= 1.8.0),
gstreamer1.0-plugins-ugly (>= 1.8.3),
libxml2 (>= 2.9.3),
# glob to address different libzip versions
# ubuntu 20.04 has libzip5
# both 4 and 5 have versions greater than
# the documented one
libzip[4-5] (>= 1.0.1),
libglib2.0-0 (>= 2.48.2),
libgirepository-1.0-1 (>= 1.46.0),
# usb specific dependencies
libudev1 (>= 229),
libusb-1.0-0 (>= 2:1.0.20),
libuuid1 (>= 2.27),
# aravis specific dependencies
libxml2 (>= 2.9.3),
libpcap0.8 (>= 1.7.4-2),
# tools specific dependencies
python3-pyqt5 (>= 5.5.1),
python3-gi (>= 3.20.0),
|
4cf4487e326f45b6d3639513b76c8833eb8d1d3e | app/models/item.rb | app/models/item.rb | class Item < ApplicationRecord
has_attached_file :image, styles: { thumbnail: "150x150" }
validates_attachment_content_type :image, content_type: /\Aimage\/.*\z/
belongs_to :category
has_many :order_items
has_many :orders, through: :order_items
validates :title, :description, :price, :inventory_status, :image, presence: true
validates :title, uniqueness: true
enum inventory_status: ["in-stock", "out-of-stock", "retired"]
end
| class Item < ApplicationRecord
has_attached_file :image, styles: { thumbnail: "150x150" }
validates_attachment_content_type :image, content_type: /\Aimage\/.*\z/
belongs_to :category
has_many :order_items
has_many :orders, through: :order_items
validates :title, :description, :price,
:inventory_status, :image, presence: true
validates :title, uniqueness: true
enum inventory_status: ["in-stock", "out-of-stock", "retired"]
end
| Move validation to new line | Move validation to new line
Style for 80 char limit. | Ruby | mit | nickedwards109/little-shop,nickedwards109/little-shop,nickedwards109/little-shop | ruby | ## Code Before:
class Item < ApplicationRecord
has_attached_file :image, styles: { thumbnail: "150x150" }
validates_attachment_content_type :image, content_type: /\Aimage\/.*\z/
belongs_to :category
has_many :order_items
has_many :orders, through: :order_items
validates :title, :description, :price, :inventory_status, :image, presence: true
validates :title, uniqueness: true
enum inventory_status: ["in-stock", "out-of-stock", "retired"]
end
## Instruction:
Move validation to new line
Style for 80 char limit.
## Code After:
class Item < ApplicationRecord
has_attached_file :image, styles: { thumbnail: "150x150" }
validates_attachment_content_type :image, content_type: /\Aimage\/.*\z/
belongs_to :category
has_many :order_items
has_many :orders, through: :order_items
validates :title, :description, :price,
:inventory_status, :image, presence: true
validates :title, uniqueness: true
enum inventory_status: ["in-stock", "out-of-stock", "retired"]
end
|
b5b2611475e387c4eda6d22ac6d8802ac75968f1 | appveyor.yml | appveyor.yml | environment:
ELECTRON_RUN_AS_NODE: 1
VSCODE_BUILD_VERBOSE: true
platform:
- x86
- x64
install:
- ps: Install-Product node 8
cache:
- node_modules
- "%APPDATA%\\npm-cache"
test_script:
- node --version
- npm --version
- npm run lint
- npm run vscode:prepublish
- npm run test --silent
# - .\scripts\test.bat
# - .\scripts\test-integration.bat
# Don't actually build.
build: off
| environment:
ELECTRON_RUN_AS_NODE: 1
VSCODE_BUILD_VERBOSE: true
platform:
- x86
- x64
install:
- ps: Install-Product node 8
- npm install
cache:
- node_modules
- "%APPDATA%\\npm-cache"
test_script:
- node --version
- npm --version
- npm run lint
- npm run vscode:prepublish
- npm run test --silent
# - .\scripts\test.bat
# - .\scripts\test-integration.bat
# Don't actually build.
build: off
| Add missing npm install task | Add missing npm install task
| YAML | apache-2.0 | KamiKillertO/vscode-colorize,KamiKillertO/vscode-colorize | yaml | ## Code Before:
environment:
ELECTRON_RUN_AS_NODE: 1
VSCODE_BUILD_VERBOSE: true
platform:
- x86
- x64
install:
- ps: Install-Product node 8
cache:
- node_modules
- "%APPDATA%\\npm-cache"
test_script:
- node --version
- npm --version
- npm run lint
- npm run vscode:prepublish
- npm run test --silent
# - .\scripts\test.bat
# - .\scripts\test-integration.bat
# Don't actually build.
build: off
## Instruction:
Add missing npm install task
## Code After:
environment:
ELECTRON_RUN_AS_NODE: 1
VSCODE_BUILD_VERBOSE: true
platform:
- x86
- x64
install:
- ps: Install-Product node 8
- npm install
cache:
- node_modules
- "%APPDATA%\\npm-cache"
test_script:
- node --version
- npm --version
- npm run lint
- npm run vscode:prepublish
- npm run test --silent
# - .\scripts\test.bat
# - .\scripts\test-integration.bat
# Don't actually build.
build: off
|
3a0c7caadb46a69fb29fe34bd64de28c9b263fd6 | restconverter.py | restconverter.py |
from docutils import core
from docutils.writers.html4css1 import Writer, HTMLTranslator
class HTMLFragmentTranslator(HTMLTranslator):
def __init__(self, document):
HTMLTranslator.__init__(self, document)
self.head_prefix = ['','','','','']
self.body_prefix = []
self.body_suffix = []
self.stylesheet = []
def astext(self):
return ''.join(self.body)
html_fragment_writer = Writer()
html_fragment_writer.translator_class = HTMLFragmentTranslator
def rest_to_html(s):
"""Convert ReST input to HTML output"""
return core.publish_string(s, writer=html_fragment_writer)
|
from docutils import core
from docutils.writers.html4css1 import Writer, HTMLTranslator
class HTMLFragmentTranslator(HTMLTranslator):
def __init__(self, document):
HTMLTranslator.__init__(self, document)
self.head_prefix = ['','','','','']
self.body_prefix = []
self.body_suffix = []
self.stylesheet = []
def astext(self):
return ''.join(self.body)
html_fragment_writer = Writer()
html_fragment_writer.translator_class = HTMLFragmentTranslator
def rest_to_html(s):
"""Convert ReST input to HTML output"""
return core.publish_string(s, writer=html_fragment_writer)
def rest_to_html_fragment(s):
parts = core.publish_parts(
source=s,
writer_name='html')
return parts['body_pre_docinfo']+parts['fragment']
| Add rest_to_html_fragment to be able to convert just the body part | Add rest_to_html_fragment to be able to convert just the body part
| Python | bsd-2-clause | jkossen/flaskjk | python | ## Code Before:
from docutils import core
from docutils.writers.html4css1 import Writer, HTMLTranslator
class HTMLFragmentTranslator(HTMLTranslator):
def __init__(self, document):
HTMLTranslator.__init__(self, document)
self.head_prefix = ['','','','','']
self.body_prefix = []
self.body_suffix = []
self.stylesheet = []
def astext(self):
return ''.join(self.body)
html_fragment_writer = Writer()
html_fragment_writer.translator_class = HTMLFragmentTranslator
def rest_to_html(s):
"""Convert ReST input to HTML output"""
return core.publish_string(s, writer=html_fragment_writer)
## Instruction:
Add rest_to_html_fragment to be able to convert just the body part
## Code After:
from docutils import core
from docutils.writers.html4css1 import Writer, HTMLTranslator
class HTMLFragmentTranslator(HTMLTranslator):
def __init__(self, document):
HTMLTranslator.__init__(self, document)
self.head_prefix = ['','','','','']
self.body_prefix = []
self.body_suffix = []
self.stylesheet = []
def astext(self):
return ''.join(self.body)
html_fragment_writer = Writer()
html_fragment_writer.translator_class = HTMLFragmentTranslator
def rest_to_html(s):
"""Convert ReST input to HTML output"""
return core.publish_string(s, writer=html_fragment_writer)
def rest_to_html_fragment(s):
parts = core.publish_parts(
source=s,
writer_name='html')
return parts['body_pre_docinfo']+parts['fragment']
|
925f6ba2f764c1579adb86da5da7eb20486c4c30 | test/koans/map_sets_koans_test.exs | test/koans/map_sets_koans_test.exs | defmodule MapSetsTest do
use ExUnit.Case
import TestHarness
test "MapSets" do
answers = [
true,
{:multiple, [true, false]},
true,
false,
5,
false,
true,
3,
7,
[1, 2, 3, 4, 5],
]
test_all(MapSets, answers)
end
end | defmodule MapSetsTest do
use ExUnit.Case
import TestHarness
test "MapSets" do
answers = [
{:multiple, [true, false]},
3,
true,
true,
false,
5,
false,
true,
7,
[1, 2, 3, 4, 5],
]
test_all(MapSets, answers)
end
end | Change order of answers to make unit tests pass | Change order of answers to make unit tests pass
| Elixir | mit | samstarling/elixir-koans,elixirkoans/elixir-koans | elixir | ## Code Before:
defmodule MapSetsTest do
use ExUnit.Case
import TestHarness
test "MapSets" do
answers = [
true,
{:multiple, [true, false]},
true,
false,
5,
false,
true,
3,
7,
[1, 2, 3, 4, 5],
]
test_all(MapSets, answers)
end
end
## Instruction:
Change order of answers to make unit tests pass
## Code After:
defmodule MapSetsTest do
use ExUnit.Case
import TestHarness
test "MapSets" do
answers = [
{:multiple, [true, false]},
3,
true,
true,
false,
5,
false,
true,
7,
[1, 2, 3, 4, 5],
]
test_all(MapSets, answers)
end
end |
260121fec45c0a4c4135159be19fe181aa328b48 | org.metaborg.meta.lang.dynsem.interpreter/src/main/java/org/metaborg/meta/lang/dynsem/interpreter/nodes/matching/IntLiteralTermMatchPattern.java | org.metaborg.meta.lang.dynsem.interpreter/src/main/java/org/metaborg/meta/lang/dynsem/interpreter/nodes/matching/IntLiteralTermMatchPattern.java | package org.metaborg.meta.lang.dynsem.interpreter.nodes.matching;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.source.SourceSection;
public abstract class IntLiteralTermMatchPattern extends LiteralMatchPattern {
protected final int lit;
public IntLiteralTermMatchPattern(int lit, SourceSection source) {
super(source);
this.lit = lit;
}
@Specialization(guards = "i == lit")
public void doSuccess(int i) {
}
@Specialization
public void doFailure(int i) {
throw PatternMatchFailure.INSTANCE;
}
} | package org.metaborg.meta.lang.dynsem.interpreter.nodes.matching;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.profiles.ConditionProfile;
import com.oracle.truffle.api.source.SourceSection;
public abstract class IntLiteralTermMatchPattern extends LiteralMatchPattern {
protected final int lit;
public IntLiteralTermMatchPattern(int lit, SourceSection source) {
super(source);
this.lit = lit;
}
private final ConditionProfile profile = ConditionProfile.createCountingProfile();
@Specialization
public void doSuccess(int i) {
if (profile.profile(i != lit)) {
throw PatternMatchFailure.INSTANCE;
}
}
} | Fix competely invalid value specialization in integer literal matching | Fix competely invalid value specialization in integer literal matching
Fixes #124.
| Java | apache-2.0 | metaborg/dynsem,metaborg/dynsem | java | ## Code Before:
package org.metaborg.meta.lang.dynsem.interpreter.nodes.matching;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.source.SourceSection;
public abstract class IntLiteralTermMatchPattern extends LiteralMatchPattern {
protected final int lit;
public IntLiteralTermMatchPattern(int lit, SourceSection source) {
super(source);
this.lit = lit;
}
@Specialization(guards = "i == lit")
public void doSuccess(int i) {
}
@Specialization
public void doFailure(int i) {
throw PatternMatchFailure.INSTANCE;
}
}
## Instruction:
Fix competely invalid value specialization in integer literal matching
Fixes #124.
## Code After:
package org.metaborg.meta.lang.dynsem.interpreter.nodes.matching;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.profiles.ConditionProfile;
import com.oracle.truffle.api.source.SourceSection;
public abstract class IntLiteralTermMatchPattern extends LiteralMatchPattern {
protected final int lit;
public IntLiteralTermMatchPattern(int lit, SourceSection source) {
super(source);
this.lit = lit;
}
private final ConditionProfile profile = ConditionProfile.createCountingProfile();
@Specialization
public void doSuccess(int i) {
if (profile.profile(i != lit)) {
throw PatternMatchFailure.INSTANCE;
}
}
} |
d90358d861e2436fc468b199943bb7e53b31290b | test/jobs/clean_abandoned_site_channels_job_test.rb | test/jobs/clean_abandoned_site_channels_job_test.rb | require 'test_helper'
class CleanAbandonedSiteChannelsJobTest < ActiveJob::TestCase
test "cleans abandoned site channels older than one day" do
publisher = publishers(:medium_media_group)
assert SiteChannelDetails.find_by(brave_publisher_id: "medium_2.org")
assert_difference("Channel.count", -1) do
assert_difference("publisher.channels.count", -1) do
CleanAbandonedSiteChannelsJob.perform_now
end
end
refute SiteChannelDetails.find_by(brave_publisher_id: "medium_2.org")
end
test "cleans abandoned site channel details older than one day" do
assert SiteChannelDetails.find_by(brave_publisher_id: "medium_2.org")
assert_difference("SiteChannelDetails.count", -1) do
CleanAbandonedSiteChannelsJob.perform_now
end
refute SiteChannelDetails.find_by(brave_publisher_id: "medium_2.org")
end
end | require 'test_helper'
class CleanAbandonedSiteChannelsJobTest < ActiveJob::TestCase
test "cleans non-visible (abandoned) site channels older than one day" do
publisher = publishers(:medium_media_group)
assert SiteChannelDetails.find_by(brave_publisher_id: "medium_2.org")
assert_difference("Channel.count", -1 * Channel.not_visible_site_channels.count) do
assert_difference("publisher.channels.count", -1 ) do
CleanAbandonedSiteChannelsJob.perform_now
end
end
refute SiteChannelDetails.find_by(brave_publisher_id: "medium_2.org")
end
test "cleans non-visible (abandoned) site channel details older than one day" do
assert SiteChannelDetails.find_by(brave_publisher_id: "medium_2.org")
assert_difference("SiteChannelDetails.count", -1 * Channel.not_visible_site_channels.count) do
CleanAbandonedSiteChannelsJob.perform_now
end
refute SiteChannelDetails.find_by(brave_publisher_id: "medium_2.org")
end
end
| Change requirements for abandoned channels | Change requirements for abandoned channels
| Ruby | mpl-2.0 | brave/publishers,brave/publishers,brave/publishers | ruby | ## Code Before:
require 'test_helper'
class CleanAbandonedSiteChannelsJobTest < ActiveJob::TestCase
test "cleans abandoned site channels older than one day" do
publisher = publishers(:medium_media_group)
assert SiteChannelDetails.find_by(brave_publisher_id: "medium_2.org")
assert_difference("Channel.count", -1) do
assert_difference("publisher.channels.count", -1) do
CleanAbandonedSiteChannelsJob.perform_now
end
end
refute SiteChannelDetails.find_by(brave_publisher_id: "medium_2.org")
end
test "cleans abandoned site channel details older than one day" do
assert SiteChannelDetails.find_by(brave_publisher_id: "medium_2.org")
assert_difference("SiteChannelDetails.count", -1) do
CleanAbandonedSiteChannelsJob.perform_now
end
refute SiteChannelDetails.find_by(brave_publisher_id: "medium_2.org")
end
end
## Instruction:
Change requirements for abandoned channels
## Code After:
require 'test_helper'
class CleanAbandonedSiteChannelsJobTest < ActiveJob::TestCase
test "cleans non-visible (abandoned) site channels older than one day" do
publisher = publishers(:medium_media_group)
assert SiteChannelDetails.find_by(brave_publisher_id: "medium_2.org")
assert_difference("Channel.count", -1 * Channel.not_visible_site_channels.count) do
assert_difference("publisher.channels.count", -1 ) do
CleanAbandonedSiteChannelsJob.perform_now
end
end
refute SiteChannelDetails.find_by(brave_publisher_id: "medium_2.org")
end
test "cleans non-visible (abandoned) site channel details older than one day" do
assert SiteChannelDetails.find_by(brave_publisher_id: "medium_2.org")
assert_difference("SiteChannelDetails.count", -1 * Channel.not_visible_site_channels.count) do
CleanAbandonedSiteChannelsJob.perform_now
end
refute SiteChannelDetails.find_by(brave_publisher_id: "medium_2.org")
end
end
|
f8cc074dc127b863054cfdf51f5769bf34fc2cbf | lib/genera/function.rb | lib/genera/function.rb | module Genera
class Function
attr_reader :prototype
def initialize(*args, &body)
if args.first.kind_of?(Prototype)
proto = args.first
else
proto = Prototype.new(*args)
end
validate(proto, body)
@prototype = proto
@func = generate(@prototype, &body)
end
def arity
@prototype.arity
end
def call(*args)
Genera.runtime.run_function(self, *args)
end
def to_proc
@proc ||= Proc.new { |*args| call(*args) }
end
def to_ptr
@func.to_ptr
end
private
def generate(proto)
mod = Genera.runtime.module
func = mod.functions.add(proto.name, proto.target_type)
entry = func.basic_blocks.append("entry")
builder = LLVM::Builder.create
begin
builder.position_at_end(entry)
context = Context.new(mod, func, builder)
args = func.params.zip(proto.arg_types).map { |arg, ty|
ty.new(Data.new(arg))
}
value = yield(*args).generate(context)
context.builder.ret(value)
return func
ensure
builder.dispose
end
end
def validate(proto, body)
args = proto.arg_types.map { |ty| ty.new(UNREACHABLE) }
val = body.call(*args) rescue nil
unless proto.return_type === val
raise TypeError, "Expected #{proto}."
end
end
end
end
| module Genera
class Function
attr_reader :prototype
def initialize(*args, &body)
if args.first.kind_of?(Prototype)
proto = args.first
else
proto = Prototype.new(*args)
end
validate(proto, body)
@prototype = proto
@func = generate(@prototype, &body)
end
def arity
@prototype.arity
end
def call(*args)
Genera.runtime.run_function(self, *args)
end
def to_proc
@proc ||= Proc.new { |*args| call(*args) }
end
def to_ptr
@func.to_ptr
end
private
def generate(proto)
mod = Genera.runtime.module
func = mod.functions.add(proto.name, proto.target_type)
entry = func.basic_blocks.append("entry")
builder = LLVM::Builder.create
begin
builder.position_at_end(entry)
context = Context.new(mod, func, builder)
args = func.params.zip(proto.arg_types).map { |arg, ty|
ty.new(Data.new(arg))
}
value = yield(*args).generate(context)
context.builder.ret(value)
return func
ensure
builder.dispose
end
end
def validate(proto, body)
args = proto.arg_types.map { |ty| ty.new(UNREACHABLE) }
val = body.call(*args)
unless val.kind_of?(proto.return_type)
raise TypeError, "Expected #{proto.return_type} but got #{val.class}."
end
end
end
end
| Simplify error handling for Genera::Function. Don't swallow/rethrow exceptions unrelated to the return type. | Simplify error handling for Genera::Function.
Don't swallow/rethrow exceptions unrelated to the
return type. | Ruby | bsd-3-clause | jvoorhis/Genera | ruby | ## Code Before:
module Genera
class Function
attr_reader :prototype
def initialize(*args, &body)
if args.first.kind_of?(Prototype)
proto = args.first
else
proto = Prototype.new(*args)
end
validate(proto, body)
@prototype = proto
@func = generate(@prototype, &body)
end
def arity
@prototype.arity
end
def call(*args)
Genera.runtime.run_function(self, *args)
end
def to_proc
@proc ||= Proc.new { |*args| call(*args) }
end
def to_ptr
@func.to_ptr
end
private
def generate(proto)
mod = Genera.runtime.module
func = mod.functions.add(proto.name, proto.target_type)
entry = func.basic_blocks.append("entry")
builder = LLVM::Builder.create
begin
builder.position_at_end(entry)
context = Context.new(mod, func, builder)
args = func.params.zip(proto.arg_types).map { |arg, ty|
ty.new(Data.new(arg))
}
value = yield(*args).generate(context)
context.builder.ret(value)
return func
ensure
builder.dispose
end
end
def validate(proto, body)
args = proto.arg_types.map { |ty| ty.new(UNREACHABLE) }
val = body.call(*args) rescue nil
unless proto.return_type === val
raise TypeError, "Expected #{proto}."
end
end
end
end
## Instruction:
Simplify error handling for Genera::Function.
Don't swallow/rethrow exceptions unrelated to the
return type.
## Code After:
module Genera
class Function
attr_reader :prototype
def initialize(*args, &body)
if args.first.kind_of?(Prototype)
proto = args.first
else
proto = Prototype.new(*args)
end
validate(proto, body)
@prototype = proto
@func = generate(@prototype, &body)
end
def arity
@prototype.arity
end
def call(*args)
Genera.runtime.run_function(self, *args)
end
def to_proc
@proc ||= Proc.new { |*args| call(*args) }
end
def to_ptr
@func.to_ptr
end
private
def generate(proto)
mod = Genera.runtime.module
func = mod.functions.add(proto.name, proto.target_type)
entry = func.basic_blocks.append("entry")
builder = LLVM::Builder.create
begin
builder.position_at_end(entry)
context = Context.new(mod, func, builder)
args = func.params.zip(proto.arg_types).map { |arg, ty|
ty.new(Data.new(arg))
}
value = yield(*args).generate(context)
context.builder.ret(value)
return func
ensure
builder.dispose
end
end
def validate(proto, body)
args = proto.arg_types.map { |ty| ty.new(UNREACHABLE) }
val = body.call(*args)
unless val.kind_of?(proto.return_type)
raise TypeError, "Expected #{proto.return_type} but got #{val.class}."
end
end
end
end
|
64f4ec5b40a6668f171cbeabb5d05606e68f2d6c | teleport/teleport-palcu-back.cpp | teleport/teleport-palcu-back.cpp |
using namespace std;
const int NMAX = 100000,
PASI_INFINITI = NMAX*2;
int v[NMAX],
nVector, sizeOfCheat;
int back(int pozitieCurenta, int cheatsAvailable) {
if (pozitieCurenta > nVector)
return PASI_INFINITI;
if (pozitieCurenta == nVector)
return 0;
int sol = min(back(pozitieCurenta+1, cheatsAvailable) + 1,
back(pozitieCurenta+v[pozitieCurenta], cheatsAvailable) + 1);
if (cheatsAvailable)
sol = min(sol, back(pozitieCurenta+sizeOfCheat, cheatsAvailable-1) + 1);
return sol;
}
int main() {
freopen("teleport.in", "r", stdin);
freopen("teleport.out", "w", stdout);
int nCheats;
scanf("%d%d%d", &nVector, &nCheats, &sizeOfCheat);
for(int i=0; i<nVector; i++)
scanf("%d", &v[i]);
printf("%d\n", back(0, nCheats));
return 0;
}
| // @palcu
// InfoOltenia 2015, teleport, backtracking
#include <cstdio>
#include <algorithm>
using namespace std;
const int NMAX = 100000,
PASI_INFINITI = NMAX*2;
int v[NMAX],
nVector, sizeOfCheat;
int back(int pozitieCurenta, int cheatsAvailable) {
if (pozitieCurenta > nVector)
return PASI_INFINITI;
if (pozitieCurenta == nVector)
return 0;
int sol = min(back(pozitieCurenta+1, cheatsAvailable) + 1,
back(pozitieCurenta+v[pozitieCurenta], cheatsAvailable) + 1);
if (cheatsAvailable)
sol = min(sol, back(pozitieCurenta+sizeOfCheat, cheatsAvailable-1) + 1);
return sol;
}
int main() {
freopen("teleport.in", "r", stdin);
freopen("teleport.out", "w", stdout);
int nCheats;
scanf("%d%d%d", &nVector, &nCheats, &sizeOfCheat);
for(int i=0; i<nVector; i++)
scanf("%d", &v[i]);
printf("%d\n", back(0, nCheats));
return 0;
}
| Add comments in the source code | Add comments in the source code
| C++ | mit | palcu/infooltenia,palcu/infooltenia,palcu/infooltenia,palcu/infooltenia,palcu/infooltenia,palcu/infooltenia | c++ | ## Code Before:
using namespace std;
const int NMAX = 100000,
PASI_INFINITI = NMAX*2;
int v[NMAX],
nVector, sizeOfCheat;
int back(int pozitieCurenta, int cheatsAvailable) {
if (pozitieCurenta > nVector)
return PASI_INFINITI;
if (pozitieCurenta == nVector)
return 0;
int sol = min(back(pozitieCurenta+1, cheatsAvailable) + 1,
back(pozitieCurenta+v[pozitieCurenta], cheatsAvailable) + 1);
if (cheatsAvailable)
sol = min(sol, back(pozitieCurenta+sizeOfCheat, cheatsAvailable-1) + 1);
return sol;
}
int main() {
freopen("teleport.in", "r", stdin);
freopen("teleport.out", "w", stdout);
int nCheats;
scanf("%d%d%d", &nVector, &nCheats, &sizeOfCheat);
for(int i=0; i<nVector; i++)
scanf("%d", &v[i]);
printf("%d\n", back(0, nCheats));
return 0;
}
## Instruction:
Add comments in the source code
## Code After:
// @palcu
// InfoOltenia 2015, teleport, backtracking
#include <cstdio>
#include <algorithm>
using namespace std;
const int NMAX = 100000,
PASI_INFINITI = NMAX*2;
int v[NMAX],
nVector, sizeOfCheat;
int back(int pozitieCurenta, int cheatsAvailable) {
if (pozitieCurenta > nVector)
return PASI_INFINITI;
if (pozitieCurenta == nVector)
return 0;
int sol = min(back(pozitieCurenta+1, cheatsAvailable) + 1,
back(pozitieCurenta+v[pozitieCurenta], cheatsAvailable) + 1);
if (cheatsAvailable)
sol = min(sol, back(pozitieCurenta+sizeOfCheat, cheatsAvailable-1) + 1);
return sol;
}
int main() {
freopen("teleport.in", "r", stdin);
freopen("teleport.out", "w", stdout);
int nCheats;
scanf("%d%d%d", &nVector, &nCheats, &sizeOfCheat);
for(int i=0; i<nVector; i++)
scanf("%d", &v[i]);
printf("%d\n", back(0, nCheats));
return 0;
}
|
f26e3e703f4cf3f0400a50114b54d32e1f1b4277 | modules/capture/benchmark/CMakeLists.txt | modules/capture/benchmark/CMakeLists.txt |
find_package(PCAP REQUIRED)
if(PCAP_FOUND)
add_library(benchmark MODULE main.c)
include_directories(${PCAP_INCLUDE_DIR})
target_link_libraries(benchmark LINK_PRIVATE ${PCAP_LIBRARY})
DEPENDS_MODULE(benchmark pcap capture)
INSTALL_MODULE(benchmark capture)
endif()
|
find_package(PCAP REQUIRED)
if(PCAP_FOUND)
INCLUDE_MODULE(pcap capture)
add_library(benchmark MODULE main.c)
include_directories(${PCAP_INCLUDE_DIR})
target_link_libraries(benchmark LINK_PRIVATE ${PCAP_LIBRARY})
DEPENDS_MODULE(benchmark capture-pcap capture)
INSTALL_MODULE(benchmark capture)
endif()
| Revert benchmark capture module build | Revert benchmark capture module build
| Text | mpl-2.0 | haka-security/haka,haka-security/haka,nabilbendafi/haka,nabilbendafi/haka,nabilbendafi/haka,haka-security/haka | text | ## Code Before:
find_package(PCAP REQUIRED)
if(PCAP_FOUND)
add_library(benchmark MODULE main.c)
include_directories(${PCAP_INCLUDE_DIR})
target_link_libraries(benchmark LINK_PRIVATE ${PCAP_LIBRARY})
DEPENDS_MODULE(benchmark pcap capture)
INSTALL_MODULE(benchmark capture)
endif()
## Instruction:
Revert benchmark capture module build
## Code After:
find_package(PCAP REQUIRED)
if(PCAP_FOUND)
INCLUDE_MODULE(pcap capture)
add_library(benchmark MODULE main.c)
include_directories(${PCAP_INCLUDE_DIR})
target_link_libraries(benchmark LINK_PRIVATE ${PCAP_LIBRARY})
DEPENDS_MODULE(benchmark capture-pcap capture)
INSTALL_MODULE(benchmark capture)
endif()
|
d6922a6f030c8b16e5d1e293281d2de9c58551fb | src/main/page/home/index.html | src/main/page/home/index.html | {% extends 'layout.html' %}
{% set id = 'contents' %}
{% set title = false %}
{% set description = title + ': The comprehensive documentation' %}
{% set keywords = [ 'overview', 'topics', 'table of contents' ] %}
{% block content %}
{{ section( 'page/home/contents.html', level = 0, class = 'toc' ) }}
{{ section_further_reading( [ 'hello-scala', 'android', 'scala', 'sbt-plugin' ] ) }}
{% endblock %} | {% extends 'layout.html' %}
{% set id = 'contents' %}
{% set title = false %}
{% set description = 'Scala on Android: The comprehensive documentation' %}
{% set keywords = [ 'overview', 'topics', 'table of contents' ] %}
{% block content %}
{{ section( 'page/home/contents.html', level = 0, class = 'toc' ) }}
{{ section_further_reading( [ 'hello-scala', 'android', 'scala', 'sbt-plugin' ] ) }}
{% endblock %} | Fix home title containing 'false' | Fix home title containing 'false'
| HTML | mit | Taig/Scala-on-Android,Taig/Scala-on-Android,Taig/Scala-on-Android,Taig/Scala-on-Android | html | ## Code Before:
{% extends 'layout.html' %}
{% set id = 'contents' %}
{% set title = false %}
{% set description = title + ': The comprehensive documentation' %}
{% set keywords = [ 'overview', 'topics', 'table of contents' ] %}
{% block content %}
{{ section( 'page/home/contents.html', level = 0, class = 'toc' ) }}
{{ section_further_reading( [ 'hello-scala', 'android', 'scala', 'sbt-plugin' ] ) }}
{% endblock %}
## Instruction:
Fix home title containing 'false'
## Code After:
{% extends 'layout.html' %}
{% set id = 'contents' %}
{% set title = false %}
{% set description = 'Scala on Android: The comprehensive documentation' %}
{% set keywords = [ 'overview', 'topics', 'table of contents' ] %}
{% block content %}
{{ section( 'page/home/contents.html', level = 0, class = 'toc' ) }}
{{ section_further_reading( [ 'hello-scala', 'android', 'scala', 'sbt-plugin' ] ) }}
{% endblock %} |
b2c69dbb27d7398b5c89e0211263dd32943900c5 | modules/custom/ga_front/src/FrontUtils.php | modules/custom/ga_front/src/FrontUtils.php | <?php
namespace Drupal\ga_front;
class FrontUtils
{
public static function getPreliveConfiguration()
{
$config = \Drupal::config('ga_ticket.settings');
$variables['edition_name'] = $config->get('edition_name');
$variables['event_title'] = $config->get('event_title');
$variables['event_text'] = $config->get('event_text');
$variables['event_cta'] = $config->get('event_cta');
$variables['planning_text'] = $config->get('planning_text');
$variables['planning_cta'] = $config->get('planning_cta');
$variables['ticket_text'] = $config->get('ticket_text');
$variables['ticket_cta'] = $config->get('ticket_cta');
return $variables;
}
}
| <?php
namespace Drupal\ga_front;
class FrontUtils
{
public static function getPreliveConfiguration()
{
$config = \Drupal::config('ga_front.prelive.settings');
$variables['edition_name'] = $config->get('edition_name');
$variables['event_title'] = $config->get('event_title');
$variables['event_text'] = $config->get('event_text');
$variables['event_cta'] = $config->get('event_cta');
$variables['planning_text'] = $config->get('planning_text');
$variables['planning_cta'] = $config->get('planning_cta');
$variables['ticket_text'] = $config->get('ticket_text');
$variables['ticket_cta'] = $config->get('ticket_cta');
return $variables;
}
}
| Fix bug on homepage configuration | Fix bug on homepage configuration
| PHP | agpl-3.0 | Futurolan/ga-website,Futurolan/ga-website,Futurolan/ga-website,Futurolan/ga-website | php | ## Code Before:
<?php
namespace Drupal\ga_front;
class FrontUtils
{
public static function getPreliveConfiguration()
{
$config = \Drupal::config('ga_ticket.settings');
$variables['edition_name'] = $config->get('edition_name');
$variables['event_title'] = $config->get('event_title');
$variables['event_text'] = $config->get('event_text');
$variables['event_cta'] = $config->get('event_cta');
$variables['planning_text'] = $config->get('planning_text');
$variables['planning_cta'] = $config->get('planning_cta');
$variables['ticket_text'] = $config->get('ticket_text');
$variables['ticket_cta'] = $config->get('ticket_cta');
return $variables;
}
}
## Instruction:
Fix bug on homepage configuration
## Code After:
<?php
namespace Drupal\ga_front;
class FrontUtils
{
public static function getPreliveConfiguration()
{
$config = \Drupal::config('ga_front.prelive.settings');
$variables['edition_name'] = $config->get('edition_name');
$variables['event_title'] = $config->get('event_title');
$variables['event_text'] = $config->get('event_text');
$variables['event_cta'] = $config->get('event_cta');
$variables['planning_text'] = $config->get('planning_text');
$variables['planning_cta'] = $config->get('planning_cta');
$variables['ticket_text'] = $config->get('ticket_text');
$variables['ticket_cta'] = $config->get('ticket_cta');
return $variables;
}
}
|
13d9cf933e49849a3c5343e7bdbf887b9aee6097 | busbus/entity.py | busbus/entity.py | from busbus import util
class LazyEntityProperty(object):
def __init__(self, f, *args, **kwargs):
self.f = f
self.args = args
self.kwargs = kwargs
def __call__(self):
return self.f(*self.args, **self.kwargs)
class BaseEntity(object):
def __init__(self, provider, **kwargs):
self._provider = provider
self._lazy_properties = {}
for attr in getattr(self, '__attrs__', []):
if isinstance(kwargs.get(attr, None), LazyEntityProperty):
self._lazy_properties[attr] = kwargs[attr]
else:
setattr(self, attr, kwargs.get(attr, None))
provider._new_entity(self)
def __repr__(self, args=['id']):
return u'<{0}({1})>'.format(
util.clsname(self),
','.join('{0}={1!r}'.format(i, getattr(self, i)) for i in args))
def __getattr__(self, name):
if name in self._lazy_properties:
value = self._lazy_properties[name]()
del self._lazy_properties[name]
setattr(self, name, value)
return value
else:
raise AttributeError(name)
def to_dict(self):
return dict((attr, getattr(self, attr)) for attr in self.__attrs__
if getattr(self, attr))
| from busbus import util
class LazyEntityProperty(object):
def __init__(self, f, *args, **kwargs):
self.f = f
self.args = args
self.kwargs = kwargs
def __call__(self):
return self.f(*self.args, **self.kwargs)
class BaseEntity(object):
__repr_attrs__ = ('id',)
def __init__(self, provider, **kwargs):
self._provider = provider
self._lazy_properties = {}
for attr in getattr(self, '__attrs__', []):
if isinstance(kwargs.get(attr, None), LazyEntityProperty):
self._lazy_properties[attr] = kwargs[attr]
else:
setattr(self, attr, kwargs.get(attr, None))
provider._new_entity(self)
def __repr__(self):
return u'<{0}({1})>'.format(
util.clsname(self), ','.join(
'{0}={1!r}'.format(i, getattr(self, i))
for i in self.__repr_attrs__))
def __getattr__(self, name):
if name in self._lazy_properties:
value = self._lazy_properties[name]()
del self._lazy_properties[name]
setattr(self, name, value)
return value
else:
raise AttributeError(name)
def to_dict(self):
return dict((attr, getattr(self, attr)) for attr in self.__attrs__
if getattr(self, attr))
| Use an instance variable instead of a non-standard argument to __repr__ | Use an instance variable instead of a non-standard argument to __repr__
| Python | mit | spaceboats/busbus | python | ## Code Before:
from busbus import util
class LazyEntityProperty(object):
def __init__(self, f, *args, **kwargs):
self.f = f
self.args = args
self.kwargs = kwargs
def __call__(self):
return self.f(*self.args, **self.kwargs)
class BaseEntity(object):
def __init__(self, provider, **kwargs):
self._provider = provider
self._lazy_properties = {}
for attr in getattr(self, '__attrs__', []):
if isinstance(kwargs.get(attr, None), LazyEntityProperty):
self._lazy_properties[attr] = kwargs[attr]
else:
setattr(self, attr, kwargs.get(attr, None))
provider._new_entity(self)
def __repr__(self, args=['id']):
return u'<{0}({1})>'.format(
util.clsname(self),
','.join('{0}={1!r}'.format(i, getattr(self, i)) for i in args))
def __getattr__(self, name):
if name in self._lazy_properties:
value = self._lazy_properties[name]()
del self._lazy_properties[name]
setattr(self, name, value)
return value
else:
raise AttributeError(name)
def to_dict(self):
return dict((attr, getattr(self, attr)) for attr in self.__attrs__
if getattr(self, attr))
## Instruction:
Use an instance variable instead of a non-standard argument to __repr__
## Code After:
from busbus import util
class LazyEntityProperty(object):
def __init__(self, f, *args, **kwargs):
self.f = f
self.args = args
self.kwargs = kwargs
def __call__(self):
return self.f(*self.args, **self.kwargs)
class BaseEntity(object):
__repr_attrs__ = ('id',)
def __init__(self, provider, **kwargs):
self._provider = provider
self._lazy_properties = {}
for attr in getattr(self, '__attrs__', []):
if isinstance(kwargs.get(attr, None), LazyEntityProperty):
self._lazy_properties[attr] = kwargs[attr]
else:
setattr(self, attr, kwargs.get(attr, None))
provider._new_entity(self)
def __repr__(self):
return u'<{0}({1})>'.format(
util.clsname(self), ','.join(
'{0}={1!r}'.format(i, getattr(self, i))
for i in self.__repr_attrs__))
def __getattr__(self, name):
if name in self._lazy_properties:
value = self._lazy_properties[name]()
del self._lazy_properties[name]
setattr(self, name, value)
return value
else:
raise AttributeError(name)
def to_dict(self):
return dict((attr, getattr(self, attr)) for attr in self.__attrs__
if getattr(self, attr))
|
150e67103dc9107f0b52a444809e821c3c744076 | lib/bricks/builder_set.rb | lib/bricks/builder_set.rb | require 'bricks/dsl'
module Bricks
class BuilderSet
include Bricks::DSL
def build(klass)
(@builders << super).last
end
def build!(klass)
(@builders << super).last
end
def clear
@builders.clear
end
def create(klass)
(@builders << super).last
end
def create!(klass)
(@builders << super).last
end
def initialize(klass)
@class = klass
@builders = []
end
def method_missing(name, *args)
build(@class).send(name, *args)
end
def generate(parent = nil)
@builders.map { |b| b.generate(parent) }
end
end
end
| require 'bricks/dsl'
module Bricks
class BuilderSet
include Bricks::DSL
def build(klass = @class)
(@builders << super).last
end
def build!(klass = @class)
(@builders << super).last
end
def clear
@builders.clear
end
def create(klass = @class)
(@builders << super).last
end
def create!(klass = @class)
(@builders << super).last
end
def initialize(klass)
@class = klass
@builders = []
end
def method_missing(name, *args)
build(@class).send(name, *args)
end
def generate(parent = nil)
@builders.map { |b| b.generate(parent) }
end
end
end
| Use the BuilderSet class as the default for BuilderSet DSL methods. | Use the BuilderSet class as the default for BuilderSet DSL methods.
| Ruby | mit | mojotech/bricks | ruby | ## Code Before:
require 'bricks/dsl'
module Bricks
class BuilderSet
include Bricks::DSL
def build(klass)
(@builders << super).last
end
def build!(klass)
(@builders << super).last
end
def clear
@builders.clear
end
def create(klass)
(@builders << super).last
end
def create!(klass)
(@builders << super).last
end
def initialize(klass)
@class = klass
@builders = []
end
def method_missing(name, *args)
build(@class).send(name, *args)
end
def generate(parent = nil)
@builders.map { |b| b.generate(parent) }
end
end
end
## Instruction:
Use the BuilderSet class as the default for BuilderSet DSL methods.
## Code After:
require 'bricks/dsl'
module Bricks
class BuilderSet
include Bricks::DSL
def build(klass = @class)
(@builders << super).last
end
def build!(klass = @class)
(@builders << super).last
end
def clear
@builders.clear
end
def create(klass = @class)
(@builders << super).last
end
def create!(klass = @class)
(@builders << super).last
end
def initialize(klass)
@class = klass
@builders = []
end
def method_missing(name, *args)
build(@class).send(name, *args)
end
def generate(parent = nil)
@builders.map { |b| b.generate(parent) }
end
end
end
|
b5dd7072d4c98c04f55e0503509f27f6fc1ed2fc | README.txt | README.txt | Building with Maven 2
Requires maven 2.0.4
Before building:
mvn install:install-file -Dfile=xstream-website/lib/sitemesh-20051115.jar -DgroupId=opensymphony -DartifactId=sitemesh -Dversion=20051115 -Dpackaging=jar
To build:
mvn clean install
Before deploying:
copy settings-template.xml to ~/.m2/settings.xml adding your Codehaus DAV username and passwords.
To deploy (optionally adding sources and javadoc jars):
mvn deploy [-DperformRelease=true]
| Building with Maven 2
Requires maven 2.0.4
Before building:
mvn install:install-file -Dfile=xstream-website/lib/sitemesh-20051115.jar
-DgroupId=opensymphony -DartifactId=sitemesh -Dversion=20051115
-Dpackaging=jar -DgeneratePom=true
To build:
mvn clean install
Before deploying:
copy settings-template.xml to ~/.m2/settings.xml adding your Codehaus DAV username and passwords.
To deploy (optionally adding sources and javadoc jars):
mvn deploy [-DperformRelease=true]
| Build breaks without auto-generated POM. | Build breaks without auto-generated POM. | Text | bsd-3-clause | codehaus/xstream,codehaus/xstream | text | ## Code Before:
Building with Maven 2
Requires maven 2.0.4
Before building:
mvn install:install-file -Dfile=xstream-website/lib/sitemesh-20051115.jar -DgroupId=opensymphony -DartifactId=sitemesh -Dversion=20051115 -Dpackaging=jar
To build:
mvn clean install
Before deploying:
copy settings-template.xml to ~/.m2/settings.xml adding your Codehaus DAV username and passwords.
To deploy (optionally adding sources and javadoc jars):
mvn deploy [-DperformRelease=true]
## Instruction:
Build breaks without auto-generated POM.
## Code After:
Building with Maven 2
Requires maven 2.0.4
Before building:
mvn install:install-file -Dfile=xstream-website/lib/sitemesh-20051115.jar
-DgroupId=opensymphony -DartifactId=sitemesh -Dversion=20051115
-Dpackaging=jar -DgeneratePom=true
To build:
mvn clean install
Before deploying:
copy settings-template.xml to ~/.m2/settings.xml adding your Codehaus DAV username and passwords.
To deploy (optionally adding sources and javadoc jars):
mvn deploy [-DperformRelease=true]
|
3bca087ce549093e20b9d1860c887e4e693cff36 | tests/check_ios_test.sh | tests/check_ios_test.sh |
while true; do
BUILD_STATUS=`curl --header "Accept: application/json" https://circleci.com/api/v1/project/mnaza/objcthemis-tests/$1 | python -c 'import sys; import json; print(json.load(sys.stdin)["status"])'`
if [[ $? -ne 0 ]]
echo "Can't get build $1 status"
then exit 1
fi
echo $BUILD_STATUS
if [[ $BUILD_STATUS = "success" ]]
then exit 0
fi
if [[ $BUILD_STATUS = "canceled" ]]
then exit 0
fi
if [[ $BUILD_STATUS = "failed" ]]
then exit 1
fi
sleep 10
done
|
while true; do
BUILD_STATUS=`curl --header "Accept: application/json" https://circleci.com/api/v1/project/mnaza/objcthemis-tests/$1 | python -c 'import sys; import json; print(json.load(sys.stdin)["status"])'`
if [ "$?" != "0" ]
then echo "Can't get build $1 status"
exit 1
fi
echo $BUILD_STATUS
if [[ $BUILD_STATUS = "success" ]]
then exit 0
fi
if [[ $BUILD_STATUS = "canceled" ]]
then exit 0
fi
if [[ $BUILD_STATUS = "failed" ]]
then exit 1
fi
sleep 10
done
| Add ios test to main test script | Add ios test to main test script
| Shell | apache-2.0 | mnaza/themis,mnaza/themis,cossacklabs/themis,Lagovas/themis,cossacklabs/themis,Lagovas/themis,mnaza/themis,cossacklabs/themis,Lagovas/themis,mnaza/themis,storojs72/themis,storojs72/themis,Lagovas/themis,Lagovas/themis,storojs72/themis,storojs72/themis,storojs72/themis,mnaza/themis,storojs72/themis,Lagovas/themis,Lagovas/themis,cossacklabs/themis,mnaza/themis,mnaza/themis,cossacklabs/themis,cossacklabs/themis,cossacklabs/themis,cossacklabs/themis,Lagovas/themis,cossacklabs/themis,cossacklabs/themis,cossacklabs/themis,storojs72/themis,mnaza/themis,mnaza/themis,storojs72/themis,storojs72/themis,Lagovas/themis,cossacklabs/themis,storojs72/themis,cossacklabs/themis | shell | ## Code Before:
while true; do
BUILD_STATUS=`curl --header "Accept: application/json" https://circleci.com/api/v1/project/mnaza/objcthemis-tests/$1 | python -c 'import sys; import json; print(json.load(sys.stdin)["status"])'`
if [[ $? -ne 0 ]]
echo "Can't get build $1 status"
then exit 1
fi
echo $BUILD_STATUS
if [[ $BUILD_STATUS = "success" ]]
then exit 0
fi
if [[ $BUILD_STATUS = "canceled" ]]
then exit 0
fi
if [[ $BUILD_STATUS = "failed" ]]
then exit 1
fi
sleep 10
done
## Instruction:
Add ios test to main test script
## Code After:
while true; do
BUILD_STATUS=`curl --header "Accept: application/json" https://circleci.com/api/v1/project/mnaza/objcthemis-tests/$1 | python -c 'import sys; import json; print(json.load(sys.stdin)["status"])'`
if [ "$?" != "0" ]
then echo "Can't get build $1 status"
exit 1
fi
echo $BUILD_STATUS
if [[ $BUILD_STATUS = "success" ]]
then exit 0
fi
if [[ $BUILD_STATUS = "canceled" ]]
then exit 0
fi
if [[ $BUILD_STATUS = "failed" ]]
then exit 1
fi
sleep 10
done
|
dcc4f4a874d4421431e5e857ca8156b4d32b7ea4 | tests/dummy/test/integration/controllers/Errors.test.js | tests/dummy/test/integration/controllers/Errors.test.js | var request = require('supertest');
var JSONAPIValidator = require('jsonapi-validator').Validator;
validateJSONapi = function(res) {
var validator = new JSONAPIValidator();
validator.validate(res.body);
}
describe('Error handling', function() {
describe('GET /fake', function() {
it('Should return 404', function(done) {
request(sails.hooks.http.app)
.get('/fake')
.expect(404)
.expect(validateJSONapi)
.end(done);
});
});
describe('GET /users/42', function() {
it('Should return 404', function(done) {
request(sails.hooks.http.app)
.get('/users/42')
.expect(404)
.expect(validateJSONapi)
describe('GET categories?invalid=true', function() {
it('Should return 400', function(done) {
request(sails.hooks.http.app)
.get('/categories?invalid=true')
.expect(400)
.expect(validateJSONapi)
.expect({
'errors': [
{
status: "400",
title: 'Bad request'
}
]
})
.end(done);
});
});
});
| var request = require('supertest');
var JSONAPIValidator = require('jsonapi-validator').Validator;
validateJSONapi = function(res) {
var validator = new JSONAPIValidator();
validator.validate(res.body);
}
describe('Error handling', function() {
describe('GET /fake', function() {
it('Should return 404', function(done) {
request(sails.hooks.http.app)
.get('/fake')
.expect(404)
.expect(validateJSONapi)
.expect({
'errors': [
{
status: "404",
title: 'Resource not found'
}
]
})
.end(done);
});
});
describe('GET /users/42', function() {
it('Should return 404', function(done) {
request(sails.hooks.http.app)
.get('/users/42')
.expect(404)
.expect(validateJSONapi)
.expect({
'errors': [
{
status: "404",
title: 'Resource not found',
detail: 'No record found with the specified id.'
}
]
})
.end(done);
});
});
describe('GET categories?invalid=true', function() {
it('Should return 400', function(done) {
request(sails.hooks.http.app)
.get('/categories?invalid=true')
.expect(400)
.expect(validateJSONapi)
.expect({
'errors': [
{
status: "400",
title: 'Bad request'
}
]
})
.end(done);
});
});
});
| Add expectation on Error output | Add expectation on Error output
| JavaScript | mit | dynamiccast/sails-json-api-blueprints | javascript | ## Code Before:
var request = require('supertest');
var JSONAPIValidator = require('jsonapi-validator').Validator;
validateJSONapi = function(res) {
var validator = new JSONAPIValidator();
validator.validate(res.body);
}
describe('Error handling', function() {
describe('GET /fake', function() {
it('Should return 404', function(done) {
request(sails.hooks.http.app)
.get('/fake')
.expect(404)
.expect(validateJSONapi)
.end(done);
});
});
describe('GET /users/42', function() {
it('Should return 404', function(done) {
request(sails.hooks.http.app)
.get('/users/42')
.expect(404)
.expect(validateJSONapi)
describe('GET categories?invalid=true', function() {
it('Should return 400', function(done) {
request(sails.hooks.http.app)
.get('/categories?invalid=true')
.expect(400)
.expect(validateJSONapi)
.expect({
'errors': [
{
status: "400",
title: 'Bad request'
}
]
})
.end(done);
});
});
});
## Instruction:
Add expectation on Error output
## Code After:
var request = require('supertest');
var JSONAPIValidator = require('jsonapi-validator').Validator;
validateJSONapi = function(res) {
var validator = new JSONAPIValidator();
validator.validate(res.body);
}
describe('Error handling', function() {
describe('GET /fake', function() {
it('Should return 404', function(done) {
request(sails.hooks.http.app)
.get('/fake')
.expect(404)
.expect(validateJSONapi)
.expect({
'errors': [
{
status: "404",
title: 'Resource not found'
}
]
})
.end(done);
});
});
describe('GET /users/42', function() {
it('Should return 404', function(done) {
request(sails.hooks.http.app)
.get('/users/42')
.expect(404)
.expect(validateJSONapi)
.expect({
'errors': [
{
status: "404",
title: 'Resource not found',
detail: 'No record found with the specified id.'
}
]
})
.end(done);
});
});
describe('GET categories?invalid=true', function() {
it('Should return 400', function(done) {
request(sails.hooks.http.app)
.get('/categories?invalid=true')
.expect(400)
.expect(validateJSONapi)
.expect({
'errors': [
{
status: "400",
title: 'Bad request'
}
]
})
.end(done);
});
});
});
|
ac685a42dcec3bc4dd178a9d7a1ed1da7d63bc52 | app/models/payload.rb | app/models/payload.rb | require 'json'
# https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/web_hooks/web_hooks.md#merge-request-events
class Payload
pattr_initialize :unparsed_data
def data
@data ||= parse_data
end
def gitlab_repo_id
merge_request["target_project_id"]
end
def full_repo_name
"#{repository['namespace']} / #{repository['name']}"
end
def merge_request_id
merge_request["id"]
end
def state
merge_request["state"]
end
def source_branch
merge_request["source_branch"]
end
def target_branch
merge_request["target_branch"]
end
private
def parse_data
if unparsed_data.is_a? String
JSON.parse(unparsed_data)
else
unparsed_data
end
end
def merge_request
@merge_request ||= data.fetch("object_attributes", {})
end
def repository
@repository ||= merge_request["target"]
end
end
| require 'json'
# https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/web_hooks/web_hooks.md#merge-request-events
class Payload
pattr_initialize :unparsed_data
def data
@data ||= parse_data
end
def gitlab_repo_id
merge_request["target_project_id"]
end
def full_repo_name
"#{repository['namespace']} / #{repository['name']}"
end
def merge_request_id
merge_request["id"]
end
def state
merge_request["state"]
end
def source_branch
merge_request["last_commit"]["id"]
end
def target_branch
merge_request["target_branch"]
end
private
def parse_data
if unparsed_data.is_a? String
JSON.parse(unparsed_data)
else
unparsed_data
end
end
def merge_request
@merge_request ||= data.fetch("object_attributes", {})
end
def repository
@repository ||= merge_request["target"]
end
end
| Fix bug when branch name contains slash. | Fix bug when branch name contains slash.
| Ruby | mit | larrylv/hound-gitlab,e-sabelhaus/gitlab-doge,larrylv/hound-gitlab,e-sabelhaus/gitlab-doge,e-sabelhaus/gitlab-doge,larrylv/hound-gitlab,e-sabelhaus/gitlab-doge | ruby | ## Code Before:
require 'json'
# https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/web_hooks/web_hooks.md#merge-request-events
class Payload
pattr_initialize :unparsed_data
def data
@data ||= parse_data
end
def gitlab_repo_id
merge_request["target_project_id"]
end
def full_repo_name
"#{repository['namespace']} / #{repository['name']}"
end
def merge_request_id
merge_request["id"]
end
def state
merge_request["state"]
end
def source_branch
merge_request["source_branch"]
end
def target_branch
merge_request["target_branch"]
end
private
def parse_data
if unparsed_data.is_a? String
JSON.parse(unparsed_data)
else
unparsed_data
end
end
def merge_request
@merge_request ||= data.fetch("object_attributes", {})
end
def repository
@repository ||= merge_request["target"]
end
end
## Instruction:
Fix bug when branch name contains slash.
## Code After:
require 'json'
# https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/web_hooks/web_hooks.md#merge-request-events
class Payload
pattr_initialize :unparsed_data
def data
@data ||= parse_data
end
def gitlab_repo_id
merge_request["target_project_id"]
end
def full_repo_name
"#{repository['namespace']} / #{repository['name']}"
end
def merge_request_id
merge_request["id"]
end
def state
merge_request["state"]
end
def source_branch
merge_request["last_commit"]["id"]
end
def target_branch
merge_request["target_branch"]
end
private
def parse_data
if unparsed_data.is_a? String
JSON.parse(unparsed_data)
else
unparsed_data
end
end
def merge_request
@merge_request ||= data.fetch("object_attributes", {})
end
def repository
@repository ||= merge_request["target"]
end
end
|
6d2a7cb0593ea00a711359e34f1bf2c974f53ccb | src/PostgRESTWS/HasqlBroadcast.hs | src/PostgRESTWS/HasqlBroadcast.hs | module PostgRESTWS.HasqlBroadcast
( newHasqlBroadcaster
-- re-export
, acquire
, relayMessages
, relayMessagesForever
) where
import Protolude
import Hasql.Connection
import PostgRESTWS.Database
import PostgRESTWS.Broadcast
newHasqlBroadcaster :: Connection -> IO Multiplexer
newHasqlBroadcaster con = newMultiplexer (\cmds msgs-> do
waitForNotifications
(\c m-> atomically $ writeTQueue msgs $ Message c m)
con
forever $ do
cmd <- atomically $ readTQueue cmds
case cmd of
Open ch -> listen con ch
Close ch -> unlisten con ch
) (\_ -> return ())
| {-|
Module : PostgRESTWS.HasqlBroadcast
Description : Uses Broadcast module adding database as a source producer.
This module provides a function to produce a 'Multiplexer' from a Hasql 'Connection'.
The producer issues a LISTEN command upon Open commands and UNLISTEN upon Close.
-}
module PostgRESTWS.HasqlBroadcast
( newHasqlBroadcaster
-- re-export
, acquire
, relayMessages
, relayMessagesForever
) where
import Protolude
import Hasql.Connection
import PostgRESTWS.Database
import PostgRESTWS.Broadcast
{- | Returns a multiplexer from a connection, listen for different database notification channels using that connection.
To listen on channels *chat*
@
import Protolude
import PostgRESTWS.HasqlBroadcast
import PostgRESTWS.Broadcast
import Hasql.Connection
main = do
conOrError <- H.acquire "postgres://localhost/test_database"
let con = either (panic . show) id conOrError :: Connection
multi <- newHasqlBroadcaster con
onMessage multi "chat" (\ch ->
forever $ fmap print (atomically $ readTChan ch)
@
-}
newHasqlBroadcaster :: Connection -> IO Multiplexer
newHasqlBroadcaster con = newMultiplexer (\cmds msgs-> do
waitForNotifications
(\c m-> atomically $ writeTQueue msgs $ Message c m)
con
forever $ do
cmd <- atomically $ readTQueue cmds
case cmd of
Open ch -> listen con ch
Close ch -> unlisten con ch
) (\_ -> return ())
| Add haddock comments to give example of database multiplexer. | Add haddock comments to give example of database multiplexer.
| Haskell | mit | diogob/postgrest-ws,diogob/postgrest-ws,diogob/postgrest-ws | haskell | ## Code Before:
module PostgRESTWS.HasqlBroadcast
( newHasqlBroadcaster
-- re-export
, acquire
, relayMessages
, relayMessagesForever
) where
import Protolude
import Hasql.Connection
import PostgRESTWS.Database
import PostgRESTWS.Broadcast
newHasqlBroadcaster :: Connection -> IO Multiplexer
newHasqlBroadcaster con = newMultiplexer (\cmds msgs-> do
waitForNotifications
(\c m-> atomically $ writeTQueue msgs $ Message c m)
con
forever $ do
cmd <- atomically $ readTQueue cmds
case cmd of
Open ch -> listen con ch
Close ch -> unlisten con ch
) (\_ -> return ())
## Instruction:
Add haddock comments to give example of database multiplexer.
## Code After:
{-|
Module : PostgRESTWS.HasqlBroadcast
Description : Uses Broadcast module adding database as a source producer.
This module provides a function to produce a 'Multiplexer' from a Hasql 'Connection'.
The producer issues a LISTEN command upon Open commands and UNLISTEN upon Close.
-}
module PostgRESTWS.HasqlBroadcast
( newHasqlBroadcaster
-- re-export
, acquire
, relayMessages
, relayMessagesForever
) where
import Protolude
import Hasql.Connection
import PostgRESTWS.Database
import PostgRESTWS.Broadcast
{- | Returns a multiplexer from a connection, listen for different database notification channels using that connection.
To listen on channels *chat*
@
import Protolude
import PostgRESTWS.HasqlBroadcast
import PostgRESTWS.Broadcast
import Hasql.Connection
main = do
conOrError <- H.acquire "postgres://localhost/test_database"
let con = either (panic . show) id conOrError :: Connection
multi <- newHasqlBroadcaster con
onMessage multi "chat" (\ch ->
forever $ fmap print (atomically $ readTChan ch)
@
-}
newHasqlBroadcaster :: Connection -> IO Multiplexer
newHasqlBroadcaster con = newMultiplexer (\cmds msgs-> do
waitForNotifications
(\c m-> atomically $ writeTQueue msgs $ Message c m)
con
forever $ do
cmd <- atomically $ readTQueue cmds
case cmd of
Open ch -> listen con ch
Close ch -> unlisten con ch
) (\_ -> return ())
|
cb8fe1698fe5fe121df5bd530af9ce0fccc5adaf | README.md | README.md | Peak calling tool for CLIP-seq data
## License
[ICSL](https://en.wikipedia.org/wiki/ISC_license)
(Internet Systems Consortium license ~ simplified BSD license) - see LICENSE
## Development
* The git braching model is very close to the one
proposed [here](http://nvie.com/posts/a-successful-git-branching-model/).
There two main branches:
* master
* dev(elopment)
And there are further supporting branches:
* feature branches - branched off and back to the dev branch
* release branches - branched off from dev and merged back into
dev and master
* hotfix branches - branched off from master and merged back into
dev and master
| Peak calling tool for CLIP-seq data
## Installation
$ make readme_rst
$ make package
$ pip3 install --user dist/PEAKachu-0.1.dev0.tar.gz
## License
[ICSL](https://en.wikipedia.org/wiki/ISC_license)
(Internet Systems Consortium license ~ simplified BSD license) - see LICENSE
## Development
* The git braching model is very close to the one
proposed [here](http://nvie.com/posts/a-successful-git-branching-model/).
There two main branches:
* master
* dev(elopment)
And there are further supporting branches:
* feature branches - branched off and back to the dev branch
* release branches - branched off from dev and merged back into
dev and master
* hotfix branches - branched off from master and merged back into
dev and master
| Add description of current installation | Add description of current installation
| Markdown | isc | tbischler/PEAKachu | markdown | ## Code Before:
Peak calling tool for CLIP-seq data
## License
[ICSL](https://en.wikipedia.org/wiki/ISC_license)
(Internet Systems Consortium license ~ simplified BSD license) - see LICENSE
## Development
* The git braching model is very close to the one
proposed [here](http://nvie.com/posts/a-successful-git-branching-model/).
There two main branches:
* master
* dev(elopment)
And there are further supporting branches:
* feature branches - branched off and back to the dev branch
* release branches - branched off from dev and merged back into
dev and master
* hotfix branches - branched off from master and merged back into
dev and master
## Instruction:
Add description of current installation
## Code After:
Peak calling tool for CLIP-seq data
## Installation
$ make readme_rst
$ make package
$ pip3 install --user dist/PEAKachu-0.1.dev0.tar.gz
## License
[ICSL](https://en.wikipedia.org/wiki/ISC_license)
(Internet Systems Consortium license ~ simplified BSD license) - see LICENSE
## Development
* The git braching model is very close to the one
proposed [here](http://nvie.com/posts/a-successful-git-branching-model/).
There two main branches:
* master
* dev(elopment)
And there are further supporting branches:
* feature branches - branched off and back to the dev branch
* release branches - branched off from dev and merged back into
dev and master
* hotfix branches - branched off from master and merged back into
dev and master
|
f36b74f606249367ed007a9d91c92f4b1b5c0ecb | action/createschema.go | action/createschema.go | package action
import (
"encoding/gob"
"fmt"
)
type CreateSchema struct {
SchemaName string
}
// Register type for gob
func init() {
gob.Register(&CreateSchema{})
}
func (a *CreateSchema) Execute(c *Context) error {
_, err := c.Tx.Exec(
fmt.Sprintf("CREATE SCHEMA IF NOT EXISTS \"%s\";", a.SchemaName),
)
return err
}
func (a *CreateSchema) Filter(targetExpression string) bool {
return IsInTargetExpression(&targetExpression, &a.SchemaName, nil)
}
func (a *CreateSchema) NeedsSeparatedBatch() bool {
return false
}
| package action
import (
"encoding/gob"
"fmt"
)
type CreateSchema struct {
SchemaName string
}
// Register type for gob
func init() {
gob.Register(&CreateSchema{})
}
func (a *CreateSchema) Execute(c *Context) error {
_, err := c.Tx.Exec(
fmt.Sprintf(`
DO $$
BEGIN
IF NOT EXISTS (SELECT 1 FROM pg_namespace WHERE nspname = '%s') THEN
CREATE SCHEMA %s;
END IF;
END
$$
`, a.SchemaName, a.SchemaName),
)
return err
}
func (a *CreateSchema) Filter(targetExpression string) bool {
return IsInTargetExpression(&targetExpression, &a.SchemaName, nil)
}
func (a *CreateSchema) NeedsSeparatedBatch() bool {
return false
}
| Fix create schema action on postgres 9.2. | Fix create schema action on postgres 9.2.
| Go | mit | pagarme/teleport,pagarme/teleport | go | ## Code Before:
package action
import (
"encoding/gob"
"fmt"
)
type CreateSchema struct {
SchemaName string
}
// Register type for gob
func init() {
gob.Register(&CreateSchema{})
}
func (a *CreateSchema) Execute(c *Context) error {
_, err := c.Tx.Exec(
fmt.Sprintf("CREATE SCHEMA IF NOT EXISTS \"%s\";", a.SchemaName),
)
return err
}
func (a *CreateSchema) Filter(targetExpression string) bool {
return IsInTargetExpression(&targetExpression, &a.SchemaName, nil)
}
func (a *CreateSchema) NeedsSeparatedBatch() bool {
return false
}
## Instruction:
Fix create schema action on postgres 9.2.
## Code After:
package action
import (
"encoding/gob"
"fmt"
)
type CreateSchema struct {
SchemaName string
}
// Register type for gob
func init() {
gob.Register(&CreateSchema{})
}
func (a *CreateSchema) Execute(c *Context) error {
_, err := c.Tx.Exec(
fmt.Sprintf(`
DO $$
BEGIN
IF NOT EXISTS (SELECT 1 FROM pg_namespace WHERE nspname = '%s') THEN
CREATE SCHEMA %s;
END IF;
END
$$
`, a.SchemaName, a.SchemaName),
)
return err
}
func (a *CreateSchema) Filter(targetExpression string) bool {
return IsInTargetExpression(&targetExpression, &a.SchemaName, nil)
}
func (a *CreateSchema) NeedsSeparatedBatch() bool {
return false
}
|
78b4ab0eaf829b0318496f8f14777ae84c0263fc | src/run-header-components.js | src/run-header-components.js | import { select } from 'd3-selection'
export function createRunHeaderComponents() {
function runHeaderComponents(s) {
s.selectAll('.zambezi-grid-headers .zambezi-grid-header')
.each(runComponents)
}
return runHeaderComponents
function runComponents(d, i) {
const components = d.headerComponents
, target = d3.select(this)
if (!components) return
components.forEach(component => target.each(component))
}
}
| import { select } from 'd3-selection'
import { selectionChanged, rebind } from '@zambezi/d3-utils'
export function createRunHeaderComponents() {
const changed = selectionChanged().key(columnChangeKey)
const api = rebind().from(changed, 'key')
function runHeaderComponents(s) {
s.selectAll('.zambezi-grid-headers .zambezi-grid-header')
.select(changed)
.each(runComponents)
}
return api(runHeaderComponents)
function runComponents(d, i) {
const components = d.headerComponents
, target = d3.select(this)
if (!components) return
components.forEach(component => target.each(component))
}
}
function columnChangeKey(column) {
return [
column.id
, column.label || '·'
, column.key || '·'
, ~~column.offset
, ~~column.absoluteOffset
, ~~column.width
, column.sortAscending || '·'
, column.sortDescending || '·'
]
.concat(
column.children ?
( '(' + column.children.map(columnChangeKey).join(',') + ')' )
: []
)
.join('|')
}
| Implement optionally running header components only on column change | Implement optionally running header components only on column change
| JavaScript | mit | zambezi/grid-components | javascript | ## Code Before:
import { select } from 'd3-selection'
export function createRunHeaderComponents() {
function runHeaderComponents(s) {
s.selectAll('.zambezi-grid-headers .zambezi-grid-header')
.each(runComponents)
}
return runHeaderComponents
function runComponents(d, i) {
const components = d.headerComponents
, target = d3.select(this)
if (!components) return
components.forEach(component => target.each(component))
}
}
## Instruction:
Implement optionally running header components only on column change
## Code After:
import { select } from 'd3-selection'
import { selectionChanged, rebind } from '@zambezi/d3-utils'
export function createRunHeaderComponents() {
const changed = selectionChanged().key(columnChangeKey)
const api = rebind().from(changed, 'key')
function runHeaderComponents(s) {
s.selectAll('.zambezi-grid-headers .zambezi-grid-header')
.select(changed)
.each(runComponents)
}
return api(runHeaderComponents)
function runComponents(d, i) {
const components = d.headerComponents
, target = d3.select(this)
if (!components) return
components.forEach(component => target.each(component))
}
}
function columnChangeKey(column) {
return [
column.id
, column.label || '·'
, column.key || '·'
, ~~column.offset
, ~~column.absoluteOffset
, ~~column.width
, column.sortAscending || '·'
, column.sortDescending || '·'
]
.concat(
column.children ?
( '(' + column.children.map(columnChangeKey).join(',') + ')' )
: []
)
.join('|')
}
|
8a61d1b06b0cc4b0a2cbc4e2a81f1a28c97479af | sitting.php | sitting.php | <?php
include 'header.php';
require_once 'dbconfig.php';
require_once 'database.php';
$db = new Database(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_DATABASE);
$db->openConnection();
if(!$db->isConnected()) {
header("Location: cannotConnect.php");
exit();
}
$sittings = $db->getSitting();
$db->closeConnection();
?>
<div class="content">
<div class="title">
Sittningar HT15
</div>
<div class="sitting-content">
<?php
foreach($sittings as $row => $s) {
$date = date('j/n', strtotime($s[0]));
?>
<div class="event-window" id="<?php echo $date; ?>">
<div class="event-window-date">
<?php echo $date; ?>
</div>
<div class="event-window-spots">
Antal platser: 200
</div>
<div class="event-window-button">
<a href="#"> Se mer </a>
</div>
<button class="event-remove-button">Remove</button>
</div>
<?php } ?>
</div>
</div>
<?php include 'footer.php'; ?> | <?php
require_once 'header.php';
$dbHandler = new DatabaseHandler();
$restaurant = $dbHandler->getRestaurant('Nilles nation');
$sitting = $dbHandler->getSitting($_GET['sittDate']);
$parties = $dbHandler->getParties($_GET['sittDate']);
$dbHandler->disconnect();
?>
<div class="content">
<div class="title">
Sittning <?php echo $sitting->date; ?>
</div>
<div class="single-sitting">
<div class="left">
<h1>Välkomna!</h1>
<table>
<tr>
<th>Sällskap</th>
<th>Antal</th>
</tr>
<?php
foreach ($parties as $key => $p) {
?>
<tr>
<td><?php echo $p->name?></td>
<td><?php echo $p->prel?></td>
</tr>
<?php
}
?>
</table>
</div>
<div class="right">
</div>
</div>
</div>
<?php include 'footer.php'; ?> | Refactor to use dataconverted results | Refactor to use dataconverted results
| PHP | mit | cNille/lundasittning,cNille/lundasittning | php | ## Code Before:
<?php
include 'header.php';
require_once 'dbconfig.php';
require_once 'database.php';
$db = new Database(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_DATABASE);
$db->openConnection();
if(!$db->isConnected()) {
header("Location: cannotConnect.php");
exit();
}
$sittings = $db->getSitting();
$db->closeConnection();
?>
<div class="content">
<div class="title">
Sittningar HT15
</div>
<div class="sitting-content">
<?php
foreach($sittings as $row => $s) {
$date = date('j/n', strtotime($s[0]));
?>
<div class="event-window" id="<?php echo $date; ?>">
<div class="event-window-date">
<?php echo $date; ?>
</div>
<div class="event-window-spots">
Antal platser: 200
</div>
<div class="event-window-button">
<a href="#"> Se mer </a>
</div>
<button class="event-remove-button">Remove</button>
</div>
<?php } ?>
</div>
</div>
<?php include 'footer.php'; ?>
## Instruction:
Refactor to use dataconverted results
## Code After:
<?php
require_once 'header.php';
$dbHandler = new DatabaseHandler();
$restaurant = $dbHandler->getRestaurant('Nilles nation');
$sitting = $dbHandler->getSitting($_GET['sittDate']);
$parties = $dbHandler->getParties($_GET['sittDate']);
$dbHandler->disconnect();
?>
<div class="content">
<div class="title">
Sittning <?php echo $sitting->date; ?>
</div>
<div class="single-sitting">
<div class="left">
<h1>Välkomna!</h1>
<table>
<tr>
<th>Sällskap</th>
<th>Antal</th>
</tr>
<?php
foreach ($parties as $key => $p) {
?>
<tr>
<td><?php echo $p->name?></td>
<td><?php echo $p->prel?></td>
</tr>
<?php
}
?>
</table>
</div>
<div class="right">
</div>
</div>
</div>
<?php include 'footer.php'; ?> |
e937804e7ed3952d044cff127e3460e2be660c12 | demo/case1/router2-content.js | demo/case1/router2-content.js | ;(_ => {
'use strict';
class Router2Content extends HTMLElement {
createdCallback() {
this.hidden = true; // by default
}
}
window.addEventListener('hashchange', (e) => {
var containers = document.querySelectorAll('router2-content');
for (var i = 0; i < containers.length; i++) {
containers[i].hidden = true;
}
var hash = window.location.hash.slice(1);
var matched = document.querySelector(`router2-content[hash="${hash}"]`);
if (matched) {
matched.hidden = false;
}
});
document.registerElement('router2-content', Router2Content);
})();
| ;(_ => {
'use strict';
function matchHash() {
var containers = document.querySelectorAll('router2-content');
for (var i = 0; i < containers.length; i++) {
containers[i].hidden = true;
}
var hash = window.location.hash.slice(1);
// nothing to unhide...
if (!hash) {
return;
}
var matched = document.querySelector(`router2-content[hash="${hash}"]`);
if (matched) {
matched.hidden = false;
} else {
throw new Error(`hash "${hash}" does not match any content`);
}
}
class Router2Content extends HTMLElement {
createdCallback() {
this.hidden = true; // by default
}
}
window.addEventListener('hashchange', (e) => {
matchHash();
});
window.addEventListener('load', (e) => {
matchHash();
});
document.registerElement('router2-content', Router2Content);
})();
| Add more complexity to the simple example | Add more complexity to the simple example
| JavaScript | isc | m3co/router3,m3co/router3 | javascript | ## Code Before:
;(_ => {
'use strict';
class Router2Content extends HTMLElement {
createdCallback() {
this.hidden = true; // by default
}
}
window.addEventListener('hashchange', (e) => {
var containers = document.querySelectorAll('router2-content');
for (var i = 0; i < containers.length; i++) {
containers[i].hidden = true;
}
var hash = window.location.hash.slice(1);
var matched = document.querySelector(`router2-content[hash="${hash}"]`);
if (matched) {
matched.hidden = false;
}
});
document.registerElement('router2-content', Router2Content);
})();
## Instruction:
Add more complexity to the simple example
## Code After:
;(_ => {
'use strict';
function matchHash() {
var containers = document.querySelectorAll('router2-content');
for (var i = 0; i < containers.length; i++) {
containers[i].hidden = true;
}
var hash = window.location.hash.slice(1);
// nothing to unhide...
if (!hash) {
return;
}
var matched = document.querySelector(`router2-content[hash="${hash}"]`);
if (matched) {
matched.hidden = false;
} else {
throw new Error(`hash "${hash}" does not match any content`);
}
}
class Router2Content extends HTMLElement {
createdCallback() {
this.hidden = true; // by default
}
}
window.addEventListener('hashchange', (e) => {
matchHash();
});
window.addEventListener('load', (e) => {
matchHash();
});
document.registerElement('router2-content', Router2Content);
})();
|
92f18cc15c31152aa81d0f012ff20799f58b3c31 | Cargo.toml | Cargo.toml | [package]
name = "soa_derive"
version = "0.5.0"
authors = ["Guillaume Fraux <guillaume.fraux@chimie-paristech.fr>"]
license = "MIT/Apache-2.0"
readme = "README.md"
repository = "https://github.com/lumol-org/soa-derive"
homepage = "https://github.com/lumol-org/soa-derive"
documentation = "https://docs.rs/soa_derive/"
description = """
Automatic Struct of Array generation
"""
[workspace]
members = [
"soa-derive-internal",
"example",
]
[dependencies]
soa_derive_internal = {path = "soa-derive-internal"}
[dev-dependencies]
bencher = "0.1"
[[bench]]
name = "soa"
harness = false
| [package]
name = "soa_derive"
version = "0.5.0"
authors = ["Guillaume Fraux <guillaume.fraux@chimie-paristech.fr>"]
license = "MIT/Apache-2.0"
readme = "README.md"
repository = "https://github.com/lumol-org/soa-derive"
homepage = "https://github.com/lumol-org/soa-derive"
documentation = "https://docs.rs/soa_derive/"
description = """
Automatic Struct of Array generation
"""
[workspace]
members = [
"soa-derive-internal",
"example",
]
[dependencies]
soa_derive_internal = {path = "soa-derive-internal", version = "0.5"}
[dev-dependencies]
bencher = "0.1"
[[bench]]
name = "soa"
harness = false
| Set a version for soa-derive-internal | Set a version for soa-derive-internal
| TOML | apache-2.0 | lumol-org/soa-derive,lumol-org/soa-derive | toml | ## Code Before:
[package]
name = "soa_derive"
version = "0.5.0"
authors = ["Guillaume Fraux <guillaume.fraux@chimie-paristech.fr>"]
license = "MIT/Apache-2.0"
readme = "README.md"
repository = "https://github.com/lumol-org/soa-derive"
homepage = "https://github.com/lumol-org/soa-derive"
documentation = "https://docs.rs/soa_derive/"
description = """
Automatic Struct of Array generation
"""
[workspace]
members = [
"soa-derive-internal",
"example",
]
[dependencies]
soa_derive_internal = {path = "soa-derive-internal"}
[dev-dependencies]
bencher = "0.1"
[[bench]]
name = "soa"
harness = false
## Instruction:
Set a version for soa-derive-internal
## Code After:
[package]
name = "soa_derive"
version = "0.5.0"
authors = ["Guillaume Fraux <guillaume.fraux@chimie-paristech.fr>"]
license = "MIT/Apache-2.0"
readme = "README.md"
repository = "https://github.com/lumol-org/soa-derive"
homepage = "https://github.com/lumol-org/soa-derive"
documentation = "https://docs.rs/soa_derive/"
description = """
Automatic Struct of Array generation
"""
[workspace]
members = [
"soa-derive-internal",
"example",
]
[dependencies]
soa_derive_internal = {path = "soa-derive-internal", version = "0.5"}
[dev-dependencies]
bencher = "0.1"
[[bench]]
name = "soa"
harness = false
|
2625af663ac4eabc953c712f39fac1e6c5e6896c | lib/runoff/commands/command.rb | lib/runoff/commands/command.rb | module Runoff
# Commands that can be executed by the application.
module Commands
# The base class for every runoff command.
class Command
def self.get_file_writer_components(args, options)
if args.empty? && !options.from
raise ArgumentError.new 'Error: You must specify the Skype username or a --from option'
end
main_db_path = Runoff::Location.get_database_path args[0], options
export_path = Runoff::Location.get_export_path options
db_handler = Sequel.sqlite main_db_path
return Runoff::FileWriter.new(db_handler), export_path
end
end
end
end | module Runoff
# Commands that can be executed by the application.
module Commands
# The base class for every runoff command.
class Command
# Public: Provides a FileWriter object and the destination path for the command.
#
# args - an array of command line arguments
# options - an object with options passed to the command
#
# Examples
#
# file_writer, path = get_file_writer_components [], nil
#
# Raises an ArgumentError.
# Returns a FileWriter object and a string with file path.
def self.get_file_writer_components(args, options)
if args.empty? && !options.from
fail ArgumentError, 'Error: You must specify the Skype username or a --from option'
end
main_db_path = Runoff::Location.get_database_path args[0], options
export_path = Runoff::Location.get_export_path options
db_handler = Sequel.sqlite main_db_path
return Runoff::FileWriter.new(db_handler), export_path
end
end
end
end | Use instead of and add a documentation comment | Use instead of and add a documentation comment
| Ruby | mit | aigarsdz/runoff | ruby | ## Code Before:
module Runoff
# Commands that can be executed by the application.
module Commands
# The base class for every runoff command.
class Command
def self.get_file_writer_components(args, options)
if args.empty? && !options.from
raise ArgumentError.new 'Error: You must specify the Skype username or a --from option'
end
main_db_path = Runoff::Location.get_database_path args[0], options
export_path = Runoff::Location.get_export_path options
db_handler = Sequel.sqlite main_db_path
return Runoff::FileWriter.new(db_handler), export_path
end
end
end
end
## Instruction:
Use instead of and add a documentation comment
## Code After:
module Runoff
# Commands that can be executed by the application.
module Commands
# The base class for every runoff command.
class Command
# Public: Provides a FileWriter object and the destination path for the command.
#
# args - an array of command line arguments
# options - an object with options passed to the command
#
# Examples
#
# file_writer, path = get_file_writer_components [], nil
#
# Raises an ArgumentError.
# Returns a FileWriter object and a string with file path.
def self.get_file_writer_components(args, options)
if args.empty? && !options.from
fail ArgumentError, 'Error: You must specify the Skype username or a --from option'
end
main_db_path = Runoff::Location.get_database_path args[0], options
export_path = Runoff::Location.get_export_path options
db_handler = Sequel.sqlite main_db_path
return Runoff::FileWriter.new(db_handler), export_path
end
end
end
end |
c1343c392a45d2069b893841f82bf426462bef55 | threadmanager.py | threadmanager.py | import logsupport
from logsupport import ConsoleWarning
HelperThreads = {}
class ThreadItem(object):
def __init__(self, name, start, restart):
self.name = name
self.StartThread = start
self.RestartThread = restart
self.Thread = None
def CheckThreads():
for T in HelperThreads.values():
if not T.Thread.is_alive():
logsupport.Logs.Log("Thread for: "+T.name+" died; restarting",severity=ConsoleWarning)
T.RestartThread()
def StartThreads():
for T in HelperThreads.values():
T.StartThread()
logsupport.Logs.Log("Starting helper thread for: ", T.name)
| import logsupport
from logsupport import ConsoleWarning
HelperThreads = {}
class ThreadItem(object):
def __init__(self, name, start, restart):
self.name = name
self.StartThread = start
self.RestartThread = restart
self.Thread = None
def StopThread(self):
self.Thread.stop()
def CheckThreads():
for T in HelperThreads.values():
if not T.Thread.is_alive():
logsupport.Logs.Log("Thread for: "+T.name+" died; restarting",severity=ConsoleWarning)
T.Thread = T.RestartThread(T)
def StartThreads():
for T in HelperThreads.values():
logsupport.Logs.Log("Starting helper thread for: ", T.name)
T.Thread = T.StartThread()
| Add a stop thread - may be needed for loss of heartbeat case | Add a stop thread - may be needed for loss of heartbeat case
| Python | apache-2.0 | kevinkahn/softconsole,kevinkahn/softconsole | python | ## Code Before:
import logsupport
from logsupport import ConsoleWarning
HelperThreads = {}
class ThreadItem(object):
def __init__(self, name, start, restart):
self.name = name
self.StartThread = start
self.RestartThread = restart
self.Thread = None
def CheckThreads():
for T in HelperThreads.values():
if not T.Thread.is_alive():
logsupport.Logs.Log("Thread for: "+T.name+" died; restarting",severity=ConsoleWarning)
T.RestartThread()
def StartThreads():
for T in HelperThreads.values():
T.StartThread()
logsupport.Logs.Log("Starting helper thread for: ", T.name)
## Instruction:
Add a stop thread - may be needed for loss of heartbeat case
## Code After:
import logsupport
from logsupport import ConsoleWarning
HelperThreads = {}
class ThreadItem(object):
def __init__(self, name, start, restart):
self.name = name
self.StartThread = start
self.RestartThread = restart
self.Thread = None
def StopThread(self):
self.Thread.stop()
def CheckThreads():
for T in HelperThreads.values():
if not T.Thread.is_alive():
logsupport.Logs.Log("Thread for: "+T.name+" died; restarting",severity=ConsoleWarning)
T.Thread = T.RestartThread(T)
def StartThreads():
for T in HelperThreads.values():
logsupport.Logs.Log("Starting helper thread for: ", T.name)
T.Thread = T.StartThread()
|
47950cf16a857cefcf0dde86e9696640fba5e7fc | src/coffee/game/enums.coffee | src/coffee/game/enums.coffee | angular.module 'gameDefinition.enums', []
.factory 'enums', () ->
origins:
illusionist: 'an illusionist'
hallucinist: 'a hallucinist'
hypnotist: 'a hypnotist'
leads:
none: undefined
jackie: 'Jackie'
employer: 'KB&S'
cop: 'Officer Dentley'
student: 'Ms. Denotto'
| angular.module 'gameDefinition.enums', []
.factory 'enums', () ->
origins:
illusionist: 'an illusionist'
hallucinist: 'a hallucinist'
hypnotist: 'a hypnotist'
leads:
none: undefined
jackie: 'Jackie'
employer: 'KB&S'
cop: 'Officer Dentley'
student: 'Ms. Denotto'
roxy: 'Roxy'
| Add Roxy Lead to Enums | Add Roxy Lead to Enums
| CoffeeScript | unlicense | arashikou/exper3-2015 | coffeescript | ## Code Before:
angular.module 'gameDefinition.enums', []
.factory 'enums', () ->
origins:
illusionist: 'an illusionist'
hallucinist: 'a hallucinist'
hypnotist: 'a hypnotist'
leads:
none: undefined
jackie: 'Jackie'
employer: 'KB&S'
cop: 'Officer Dentley'
student: 'Ms. Denotto'
## Instruction:
Add Roxy Lead to Enums
## Code After:
angular.module 'gameDefinition.enums', []
.factory 'enums', () ->
origins:
illusionist: 'an illusionist'
hallucinist: 'a hallucinist'
hypnotist: 'a hypnotist'
leads:
none: undefined
jackie: 'Jackie'
employer: 'KB&S'
cop: 'Officer Dentley'
student: 'Ms. Denotto'
roxy: 'Roxy'
|
974160117e2f36b12b52df13d4a35726a4ff0907 | boxsdk/object/api_json_object.py | boxsdk/object/api_json_object.py |
from __future__ import unicode_literals, absolute_import
from collections import Mapping
from abc import ABCMeta
from .base_api_json_object import BaseAPIJSONObject, BaseAPIJSONObjectMeta
from ..util.compat import with_metaclass
class APIJSONObjectMeta(BaseAPIJSONObjectMeta, ABCMeta):
"""
Avoid conflicting metaclass definitions for APIJSONObject.
http://code.activestate.com/recipes/204197-solving-the-metaclass-conflict/
"""
pass
class APIJSONObject(with_metaclass(APIJSONObjectMeta, BaseAPIJSONObject, Mapping)):
"""Class representing objects that are not part of the REST API."""
def __len__(self):
return len(self._response_object)
def __iter__(self):
return iter(self._response_object)
|
from __future__ import unicode_literals, absolute_import
from collections import Mapping
from abc import ABCMeta
from .base_api_json_object import BaseAPIJSONObject, BaseAPIJSONObjectMeta
from ..util.compat import with_metaclass
class APIJSONObjectMeta(BaseAPIJSONObjectMeta, ABCMeta):
"""
Avoid conflicting metaclass definitions for APIJSONObject.
http://code.activestate.com/recipes/204197-solving-the-metaclass-conflict/
"""
pass
class APIJSONObject(with_metaclass(APIJSONObjectMeta, BaseAPIJSONObject, Mapping)):
"""Class representing objects that are not part of the REST API."""
def __len__(self):
return len(self._response_object)
| Remove redundant __iter__ from APIJsonObject base class | Remove redundant __iter__ from APIJsonObject base class
| Python | apache-2.0 | box/box-python-sdk | python | ## Code Before:
from __future__ import unicode_literals, absolute_import
from collections import Mapping
from abc import ABCMeta
from .base_api_json_object import BaseAPIJSONObject, BaseAPIJSONObjectMeta
from ..util.compat import with_metaclass
class APIJSONObjectMeta(BaseAPIJSONObjectMeta, ABCMeta):
"""
Avoid conflicting metaclass definitions for APIJSONObject.
http://code.activestate.com/recipes/204197-solving-the-metaclass-conflict/
"""
pass
class APIJSONObject(with_metaclass(APIJSONObjectMeta, BaseAPIJSONObject, Mapping)):
"""Class representing objects that are not part of the REST API."""
def __len__(self):
return len(self._response_object)
def __iter__(self):
return iter(self._response_object)
## Instruction:
Remove redundant __iter__ from APIJsonObject base class
## Code After:
from __future__ import unicode_literals, absolute_import
from collections import Mapping
from abc import ABCMeta
from .base_api_json_object import BaseAPIJSONObject, BaseAPIJSONObjectMeta
from ..util.compat import with_metaclass
class APIJSONObjectMeta(BaseAPIJSONObjectMeta, ABCMeta):
"""
Avoid conflicting metaclass definitions for APIJSONObject.
http://code.activestate.com/recipes/204197-solving-the-metaclass-conflict/
"""
pass
class APIJSONObject(with_metaclass(APIJSONObjectMeta, BaseAPIJSONObject, Mapping)):
"""Class representing objects that are not part of the REST API."""
def __len__(self):
return len(self._response_object)
|
b7810ae58d85ecf2d3988815f77749e5c344fbef | lib/jumubase_web/views/error_view.ex | lib/jumubase_web/views/error_view.ex | defmodule JumubaseWeb.ErrorView do
use JumubaseWeb, :view
def render("404.html", assigns) do
render_error_layout(
assigns,
dgettext("errors", "The page was not found."),
dgettext("errors", "Maybe try one of the links above?")
)
end
def render("500.html", assigns) do
render_error_layout(
assigns,
dgettext("errors", "Oh no…"),
dgettext("errors", "Something went wrong on the server. We’re on it!")
)
end
# In case no render clause matches or no
# template is found, let's render it as 500
def template_not_found(_template, assigns) do
render("500.html", assigns)
end
# Private helpers
defp render_error_layout(assigns, heading, message) do
render(
JumubaseWeb.LayoutView,
"error.html",
assigns
|> Map.put(:heading, heading)
|> Map.put(:message, message)
)
end
end
| defmodule JumubaseWeb.ErrorView do
use JumubaseWeb, :view
alias JumubaseWeb.LayoutView
def render("404.html", assigns) do
render_error_layout(
assigns,
dgettext("errors", "The page was not found."),
dgettext("errors", "Maybe try one of the links above?")
)
end
def render("500.html", assigns) do
render_error_layout(
assigns,
dgettext("errors", "Oh no…"),
dgettext("errors", "Something went wrong on the server. We’re on it!")
)
end
# In case no render clause matches or no
# template is found, let's render it as 500
def template_not_found(_template, assigns) do
render("500.html", assigns)
end
# Private helpers
defp render_error_layout(assigns, heading, message) do
render(
LayoutView,
"error.html",
assigns
|> Map.put(:layout, {LayoutView, "root.html"})
|> Map.put(:heading, heading)
|> Map.put(:message, message)
)
end
end
| Use root layout to render errors | Use root layout to render errors
This is a bit risky as it can lead to recursion (if the layout itself contains errors), but looks a lot better to the user when hitting a 404.
| Elixir | mit | richeterre/jumubase-phoenix,richeterre/jumubase-phoenix | elixir | ## Code Before:
defmodule JumubaseWeb.ErrorView do
use JumubaseWeb, :view
def render("404.html", assigns) do
render_error_layout(
assigns,
dgettext("errors", "The page was not found."),
dgettext("errors", "Maybe try one of the links above?")
)
end
def render("500.html", assigns) do
render_error_layout(
assigns,
dgettext("errors", "Oh no…"),
dgettext("errors", "Something went wrong on the server. We’re on it!")
)
end
# In case no render clause matches or no
# template is found, let's render it as 500
def template_not_found(_template, assigns) do
render("500.html", assigns)
end
# Private helpers
defp render_error_layout(assigns, heading, message) do
render(
JumubaseWeb.LayoutView,
"error.html",
assigns
|> Map.put(:heading, heading)
|> Map.put(:message, message)
)
end
end
## Instruction:
Use root layout to render errors
This is a bit risky as it can lead to recursion (if the layout itself contains errors), but looks a lot better to the user when hitting a 404.
## Code After:
defmodule JumubaseWeb.ErrorView do
use JumubaseWeb, :view
alias JumubaseWeb.LayoutView
def render("404.html", assigns) do
render_error_layout(
assigns,
dgettext("errors", "The page was not found."),
dgettext("errors", "Maybe try one of the links above?")
)
end
def render("500.html", assigns) do
render_error_layout(
assigns,
dgettext("errors", "Oh no…"),
dgettext("errors", "Something went wrong on the server. We’re on it!")
)
end
# In case no render clause matches or no
# template is found, let's render it as 500
def template_not_found(_template, assigns) do
render("500.html", assigns)
end
# Private helpers
defp render_error_layout(assigns, heading, message) do
render(
LayoutView,
"error.html",
assigns
|> Map.put(:layout, {LayoutView, "root.html"})
|> Map.put(:heading, heading)
|> Map.put(:message, message)
)
end
end
|
5a920d9c940132f4a69a993aceccae560be00483 | requirements.txt | requirements.txt | Flask==1.1.2
Flask-Login==0.5.0
Flask-Webpack==0.1.0
mediacloud==3.11.2
pymongo==3.10.1
requests==2.23.0
raven[flask]==6.10.0
redis==2.10.6
networkx==1.9
Flask-Mail==0.9.1
mediacloud-cliff==2.6.1
gunicorn==20.0.4
dogpile.cache==0.7.1 # upgrading dogpile.cache caused problems - leave it on this version
python-dateutil==2.8.1
python-slugify==4.0.0
greenlet==0.4.15
deco==0.5.2
psaw==0.0.12
Flask-Executor==0.9.3
newspaper3k==0.2.8
pytest==5.4.1
| Flask==1.1.2
Flask-Login==0.5.0
Flask-Webpack==0.1.0
mediacloud==3.11.2
pymongo==3.10.1
requests==2.23.0
raven[flask]==6.10.0
redis==2.10.6
networkx==1.9
Flask-Mail==0.9.1
mediacloud-cliff==2.6.1
gunicorn==20.0.4
dogpile.cache==0.7.1 # upgrading dogpile.cache caused problems - leave it on this version
python-dateutil==2.8.1
python-slugify==4.0.0
greenlet==0.4.15
deco==0.5.2
psaw==0.0.12
Flask-Executor==0.9.3
newspaper3k==0.2.8
pytest==5.4.1
gevent==20.5.0
| Add back ing event dependency | Add back ing event dependency
| Text | apache-2.0 | mitmedialab/MediaCloud-Web-Tools,mitmedialab/MediaCloud-Web-Tools,mitmedialab/MediaCloud-Web-Tools,mitmedialab/MediaCloud-Web-Tools | text | ## Code Before:
Flask==1.1.2
Flask-Login==0.5.0
Flask-Webpack==0.1.0
mediacloud==3.11.2
pymongo==3.10.1
requests==2.23.0
raven[flask]==6.10.0
redis==2.10.6
networkx==1.9
Flask-Mail==0.9.1
mediacloud-cliff==2.6.1
gunicorn==20.0.4
dogpile.cache==0.7.1 # upgrading dogpile.cache caused problems - leave it on this version
python-dateutil==2.8.1
python-slugify==4.0.0
greenlet==0.4.15
deco==0.5.2
psaw==0.0.12
Flask-Executor==0.9.3
newspaper3k==0.2.8
pytest==5.4.1
## Instruction:
Add back ing event dependency
## Code After:
Flask==1.1.2
Flask-Login==0.5.0
Flask-Webpack==0.1.0
mediacloud==3.11.2
pymongo==3.10.1
requests==2.23.0
raven[flask]==6.10.0
redis==2.10.6
networkx==1.9
Flask-Mail==0.9.1
mediacloud-cliff==2.6.1
gunicorn==20.0.4
dogpile.cache==0.7.1 # upgrading dogpile.cache caused problems - leave it on this version
python-dateutil==2.8.1
python-slugify==4.0.0
greenlet==0.4.15
deco==0.5.2
psaw==0.0.12
Flask-Executor==0.9.3
newspaper3k==0.2.8
pytest==5.4.1
gevent==20.5.0
|
4218488ed9b55d0bb16c6614f89645fb47d2d120 | app/views/gobierto_admin/shared/_save_widget.html.erb | app/views/gobierto_admin/shared/_save_widget.html.erb | <div class="pure-u-1 pure-u-md-1-4 ">
<div class="widget_save stick_in_parent">
<% if levels.any? %>
<div class="form_item person-visibility-level-radio-buttons">
<div class="options compact">
<%= f.collection_radio_buttons(:visibility_level, levels, :first, :first) do |b| %>
<div class="option">
<%= b.radio_button %>
<%= b.label do %>
<span></span>
<%= t(".visibility_level.#{b.text}") %>
<% end %>
</div>
<% end %>
</div>
</div>
<% end %>
<%= f.submit defined?(custom_submit_text) ? custom_submit_text : nil, class: "button" %>
</div>
</div>
| <div class="pure-u-1 pure-u-md-1-4 ">
<div class="stick_in_parent">
<div class="widget_save">
<% if levels.any? %>
<div class="form_item person-visibility-level-radio-buttons">
<div class="options compact">
<%= f.collection_radio_buttons(:visibility_level, levels, :first, :first) do |b| %>
<div class="option">
<%= b.radio_button %>
<%= b.label do %>
<span></span>
<%= t(".visibility_level.#{b.text}") %>
<% end %>
</div>
<% end %>
</div>
</div>
<% end %>
<%= f.submit defined?(custom_submit_text) ? custom_submit_text : nil, class: "button" %>
</div>
<%= yield %>
</div>
</div>
| Allow save widget to include yielded content | Allow save widget to include yielded content
| HTML+ERB | agpl-3.0 | PopulateTools/gobierto,PopulateTools/gobierto-dev,PopulateTools/gobierto,PopulateTools/gobierto-dev,PopulateTools/gobierto,PopulateTools/gobierto,PopulateTools/gobierto-dev,PopulateTools/gobierto-dev | html+erb | ## Code Before:
<div class="pure-u-1 pure-u-md-1-4 ">
<div class="widget_save stick_in_parent">
<% if levels.any? %>
<div class="form_item person-visibility-level-radio-buttons">
<div class="options compact">
<%= f.collection_radio_buttons(:visibility_level, levels, :first, :first) do |b| %>
<div class="option">
<%= b.radio_button %>
<%= b.label do %>
<span></span>
<%= t(".visibility_level.#{b.text}") %>
<% end %>
</div>
<% end %>
</div>
</div>
<% end %>
<%= f.submit defined?(custom_submit_text) ? custom_submit_text : nil, class: "button" %>
</div>
</div>
## Instruction:
Allow save widget to include yielded content
## Code After:
<div class="pure-u-1 pure-u-md-1-4 ">
<div class="stick_in_parent">
<div class="widget_save">
<% if levels.any? %>
<div class="form_item person-visibility-level-radio-buttons">
<div class="options compact">
<%= f.collection_radio_buttons(:visibility_level, levels, :first, :first) do |b| %>
<div class="option">
<%= b.radio_button %>
<%= b.label do %>
<span></span>
<%= t(".visibility_level.#{b.text}") %>
<% end %>
</div>
<% end %>
</div>
</div>
<% end %>
<%= f.submit defined?(custom_submit_text) ? custom_submit_text : nil, class: "button" %>
</div>
<%= yield %>
</div>
</div>
|
7b5d45ddca83ae2e3dd97f5da270c885496a75a4 | server/startup/migrations/v096.js | server/startup/migrations/v096.js | RocketChat.Migrations.add({
version: 96,
up() {
const query = {
$or: [{
's3.path': {
$exists: true
}
}, {
'googleCloudStorage.path': {
$exists: true
}
}]
};
RocketChat.models.Uploads.find(query).forEach((record) => {
if (record.s3) {
RocketChat.models.Uploads.model.direct.update({_id: record._id}, {
$set: {
'store': 'AmazonS3:Uploads',
AmazonS3: {
path: record.s3.path + record._id
}
},
$unset: {
s3: 1
}
}, {multi: true});
} else {
RocketChat.models.Uploads.model.direct.update({_id: record._id}, {
$set: {
store: 'GoogleCloudStorage:Uploads',
GoogleStorage: {
path: record.googleCloudStorage.path + record._id
}
},
$unset: {
googleCloudStorage: 1
}
}, {multi: true});
}
});
}
});
| RocketChat.Migrations.add({
version: 96,
up() {
const query = {
$or: [{
's3.path': {
$exists: true
}
}, {
'googleCloudStorage.path': {
$exists: true
}
}]
};
RocketChat.models.Uploads.find(query).forEach((record) => {
if (record.s3) {
RocketChat.models.Uploads.model.direct.update({_id: record._id}, {
$set: {
'store': 'AmazonS3:Uploads',
AmazonS3: {
path: record.s3.path + record._id
}
},
$unset: {
s3: 1
}
}, {multi: true});
} else {
RocketChat.models.Uploads.model.direct.update({_id: record._id}, {
$set: {
store: 'GoogleCloudStorage:Uploads',
GoogleStorage: {
path: record.googleCloudStorage.path + record._id
}
},
$unset: {
googleCloudStorage: 1
}
}, {multi: true});
}
});
RocketChat.models.Uploads.model.direct.update({
store: 'fileSystem'
}, {
$set: {
store: 'FileSystem:Uploads'
}
}, {
multi: true
});
RocketChat.models.Uploads.model.direct.update({
store: 'rocketchat_uploads'
}, {
$set: {
store: 'GridFS:Uploads'
}
}, {
multi: true
});
}
});
| Migrate old FS and GridFS store names | Uploads: Migrate old FS and GridFS store names
| JavaScript | mit | inoio/Rocket.Chat,pitamar/Rocket.Chat,cnash/Rocket.Chat,nishimaki10/Rocket.Chat,Kiran-Rao/Rocket.Chat,flaviogrossi/Rocket.Chat,flaviogrossi/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,Kiran-Rao/Rocket.Chat,cnash/Rocket.Chat,pkgodara/Rocket.Chat,fatihwk/Rocket.Chat,mrinaldhar/Rocket.Chat,VoiSmart/Rocket.Chat,mrinaldhar/Rocket.Chat,Sing-Li/Rocket.Chat,pitamar/Rocket.Chat,galrotem1993/Rocket.Chat,danielbressan/Rocket.Chat,subesokun/Rocket.Chat,subesokun/Rocket.Chat,mrsimpson/Rocket.Chat,mrinaldhar/Rocket.Chat,Achaikos/Rocket.Chat,nishimaki10/Rocket.Chat,Sing-Li/Rocket.Chat,mrinaldhar/Rocket.Chat,VoiSmart/Rocket.Chat,4thParty/Rocket.Chat,pachox/Rocket.Chat,flaviogrossi/Rocket.Chat,danielbressan/Rocket.Chat,Achaikos/Rocket.Chat,pkgodara/Rocket.Chat,pachox/Rocket.Chat,fatihwk/Rocket.Chat,pitamar/Rocket.Chat,inoio/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,Achaikos/Rocket.Chat,galrotem1993/Rocket.Chat,cnash/Rocket.Chat,Achaikos/Rocket.Chat,inoio/Rocket.Chat,galrotem1993/Rocket.Chat,mrsimpson/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,pkgodara/Rocket.Chat,fatihwk/Rocket.Chat,Kiran-Rao/Rocket.Chat,pkgodara/Rocket.Chat,subesokun/Rocket.Chat,pitamar/Rocket.Chat,subesokun/Rocket.Chat,Sing-Li/Rocket.Chat,flaviogrossi/Rocket.Chat,pachox/Rocket.Chat,4thParty/Rocket.Chat,nishimaki10/Rocket.Chat,Kiran-Rao/Rocket.Chat,danielbressan/Rocket.Chat,4thParty/Rocket.Chat,4thParty/Rocket.Chat,mrsimpson/Rocket.Chat,galrotem1993/Rocket.Chat,pachox/Rocket.Chat,Sing-Li/Rocket.Chat,nishimaki10/Rocket.Chat,danielbressan/Rocket.Chat,cnash/Rocket.Chat,fatihwk/Rocket.Chat,VoiSmart/Rocket.Chat,trt15-ssci-organization/Rocket.Chat,mrsimpson/Rocket.Chat | javascript | ## Code Before:
RocketChat.Migrations.add({
version: 96,
up() {
const query = {
$or: [{
's3.path': {
$exists: true
}
}, {
'googleCloudStorage.path': {
$exists: true
}
}]
};
RocketChat.models.Uploads.find(query).forEach((record) => {
if (record.s3) {
RocketChat.models.Uploads.model.direct.update({_id: record._id}, {
$set: {
'store': 'AmazonS3:Uploads',
AmazonS3: {
path: record.s3.path + record._id
}
},
$unset: {
s3: 1
}
}, {multi: true});
} else {
RocketChat.models.Uploads.model.direct.update({_id: record._id}, {
$set: {
store: 'GoogleCloudStorage:Uploads',
GoogleStorage: {
path: record.googleCloudStorage.path + record._id
}
},
$unset: {
googleCloudStorage: 1
}
}, {multi: true});
}
});
}
});
## Instruction:
Uploads: Migrate old FS and GridFS store names
## Code After:
RocketChat.Migrations.add({
version: 96,
up() {
const query = {
$or: [{
's3.path': {
$exists: true
}
}, {
'googleCloudStorage.path': {
$exists: true
}
}]
};
RocketChat.models.Uploads.find(query).forEach((record) => {
if (record.s3) {
RocketChat.models.Uploads.model.direct.update({_id: record._id}, {
$set: {
'store': 'AmazonS3:Uploads',
AmazonS3: {
path: record.s3.path + record._id
}
},
$unset: {
s3: 1
}
}, {multi: true});
} else {
RocketChat.models.Uploads.model.direct.update({_id: record._id}, {
$set: {
store: 'GoogleCloudStorage:Uploads',
GoogleStorage: {
path: record.googleCloudStorage.path + record._id
}
},
$unset: {
googleCloudStorage: 1
}
}, {multi: true});
}
});
RocketChat.models.Uploads.model.direct.update({
store: 'fileSystem'
}, {
$set: {
store: 'FileSystem:Uploads'
}
}, {
multi: true
});
RocketChat.models.Uploads.model.direct.update({
store: 'rocketchat_uploads'
}, {
$set: {
store: 'GridFS:Uploads'
}
}, {
multi: true
});
}
});
|
b9fc486eb24ff551e61c460a62dbc7e5cc162856 | lib/nyaplot/charts/base.rb | lib/nyaplot/charts/base.rb | module Nyaplot
module Charts
class ChartBase
class << self
def allow(x, y)
@@allow_x = x
@@allow_y = y
end
def need(*args)
@@needs = args
end
end
attr_reader :glyphs, :deps
def initialize(**opts)
@glyphs = []
@deps = []
@@needs.each do |sym|
raise "lack argument" if opts[sym].nil?
end
create(**opts)
end
def create
## over-write this
end
private
def add_dependency(layer)
@deps.push(layer)
layer
end
alias :ad :add_dependency
private
def add_glyph(glyph)
@glyphs.push(glyph)
glyph
end
alias :ag :add_glyph
private
def create_ordinal_position(xscale, yscale, label, xy=:x)
scale = xy==:x ? xscale : yscale
d2c = ad Layers::D2c.new({scale: scale, label: label})
arg = {x: xscale, y: yscale}
arg[xy] = d2c
ad Layers::Position2d.new(arg)
end
end
end
end
| module Nyaplot
module Charts
class ChartBase
class << self
def allow(x, y)
@@allow_x = x
@@allow_y = y
end
def need(*args)
@@needs = args
end
end
attr_reader :glyphs, :deps, :xdomain, :ydomain
def initialize(**opts)
@glyphs = []
@deps = []
@@needs.each do |sym|
raise "lack argument" if opts[sym].nil?
end
create(**opts)
end
def create
## over-write this
end
private
def add_dependency(layer)
@deps.push(layer)
layer
end
alias :ad :add_dependency
private
def add_glyph(glyph)
@glyphs.push(glyph)
glyph
end
alias :ag :add_glyph
private
def create_ordinal_position(xscale, yscale, label, xy=:x)
scale = xy==:x ? xscale : yscale
d2c = ad Layers::D2c.new({scale: scale, label: label})
arg = {x: xscale, y: yscale}
arg[xy] = d2c
ad Layers::Position2d.new(arg)
end
end
end
end
| Add reader for xdomain and ydomain of Charts | Add reader for xdomain and ydomain of Charts
| Ruby | mit | domitry/nyaplot,domitry/nyaplot | ruby | ## Code Before:
module Nyaplot
module Charts
class ChartBase
class << self
def allow(x, y)
@@allow_x = x
@@allow_y = y
end
def need(*args)
@@needs = args
end
end
attr_reader :glyphs, :deps
def initialize(**opts)
@glyphs = []
@deps = []
@@needs.each do |sym|
raise "lack argument" if opts[sym].nil?
end
create(**opts)
end
def create
## over-write this
end
private
def add_dependency(layer)
@deps.push(layer)
layer
end
alias :ad :add_dependency
private
def add_glyph(glyph)
@glyphs.push(glyph)
glyph
end
alias :ag :add_glyph
private
def create_ordinal_position(xscale, yscale, label, xy=:x)
scale = xy==:x ? xscale : yscale
d2c = ad Layers::D2c.new({scale: scale, label: label})
arg = {x: xscale, y: yscale}
arg[xy] = d2c
ad Layers::Position2d.new(arg)
end
end
end
end
## Instruction:
Add reader for xdomain and ydomain of Charts
## Code After:
module Nyaplot
module Charts
class ChartBase
class << self
def allow(x, y)
@@allow_x = x
@@allow_y = y
end
def need(*args)
@@needs = args
end
end
attr_reader :glyphs, :deps, :xdomain, :ydomain
def initialize(**opts)
@glyphs = []
@deps = []
@@needs.each do |sym|
raise "lack argument" if opts[sym].nil?
end
create(**opts)
end
def create
## over-write this
end
private
def add_dependency(layer)
@deps.push(layer)
layer
end
alias :ad :add_dependency
private
def add_glyph(glyph)
@glyphs.push(glyph)
glyph
end
alias :ag :add_glyph
private
def create_ordinal_position(xscale, yscale, label, xy=:x)
scale = xy==:x ? xscale : yscale
d2c = ad Layers::D2c.new({scale: scale, label: label})
arg = {x: xscale, y: yscale}
arg[xy] = d2c
ad Layers::Position2d.new(arg)
end
end
end
end
|
991c0707a2aa9913424361787be8d9c60260de33 | README.md | README.md | A Select2 v4 [Theme](https://select2.github.io/examples.html#themes) for Bootstrap 3
Demonstrations available at
http://fk.github.io/select2-bootstrap-theme/
Tested with Bootstrap v3.3.4 and Select2 v4.0.0
in latest Chrome.
##### Installation
The Select2 Bootstrap Theme only works with Select2 v4.x. Applying the theme requires `select2-bootstrap.css` referenced after the default `select2.css` that comes with Select2:
<link rel="stylesheet" href="select2.css">
<link rel="stylesheet" href="select2-bootstrap.css">
To apply the theme, tell Select2 to do so by passing `bootstrap` to the [`theme`](https://select2.github.io/examples.html#themes) option when initializing Select2:
$( document ).ready(function() {
$( "#dropdown" ).select2({
theme: "bootstrap"
});
});
##### Known issues
##### Changelog
###### 0.1.0-beta.2
* Added Less version.
###### 0.1.0-beta.1
##### Credits
##### Contributing
| A Select2 v4 [Theme](https://select2.github.io/examples.html#themes) for Bootstrap 3
Demonstrations available at
http://fk.github.io/select2-bootstrap-theme/
Tested with Bootstrap v3.3.4 and Select2 v4.0.0
in latest Chrome.
##### Installation
The Select2 Bootstrap Theme only works with Select2 v4.x. Applying the theme requires `select2-bootstrap.css` referenced after the default `select2.css` that comes with Select2:
<link rel="stylesheet" href="select2.css">
<link rel="stylesheet" href="select2-bootstrap.css">
To apply the theme, tell Select2 to do so by passing `bootstrap` to the [`theme`](https://select2.github.io/examples.html#themes) option when initializing Select2:
$( "#dropdown" ).select2({
theme: "bootstrap"
});
##### Known issues
##### Changelog
###### 0.1.0-beta.2
* Added Less version.
###### 0.1.0-beta.1
##### Credits
##### Contributing
| Remove `$( document ).ready()` from the installation example. | Remove `$( document ).ready()` from the installation example.
| Markdown | mit | ivelum/select2-bootstrap-theme,inway/select2-bootstrap-theme,blackbricksoftware/select2-bootstrap-theme,borodulin/select2-bootstrap-theme,kartik-v/select2-bootstrap-theme,select2/select2-bootstrap-theme | markdown | ## Code Before:
A Select2 v4 [Theme](https://select2.github.io/examples.html#themes) for Bootstrap 3
Demonstrations available at
http://fk.github.io/select2-bootstrap-theme/
Tested with Bootstrap v3.3.4 and Select2 v4.0.0
in latest Chrome.
##### Installation
The Select2 Bootstrap Theme only works with Select2 v4.x. Applying the theme requires `select2-bootstrap.css` referenced after the default `select2.css` that comes with Select2:
<link rel="stylesheet" href="select2.css">
<link rel="stylesheet" href="select2-bootstrap.css">
To apply the theme, tell Select2 to do so by passing `bootstrap` to the [`theme`](https://select2.github.io/examples.html#themes) option when initializing Select2:
$( document ).ready(function() {
$( "#dropdown" ).select2({
theme: "bootstrap"
});
});
##### Known issues
##### Changelog
###### 0.1.0-beta.2
* Added Less version.
###### 0.1.0-beta.1
##### Credits
##### Contributing
## Instruction:
Remove `$( document ).ready()` from the installation example.
## Code After:
A Select2 v4 [Theme](https://select2.github.io/examples.html#themes) for Bootstrap 3
Demonstrations available at
http://fk.github.io/select2-bootstrap-theme/
Tested with Bootstrap v3.3.4 and Select2 v4.0.0
in latest Chrome.
##### Installation
The Select2 Bootstrap Theme only works with Select2 v4.x. Applying the theme requires `select2-bootstrap.css` referenced after the default `select2.css` that comes with Select2:
<link rel="stylesheet" href="select2.css">
<link rel="stylesheet" href="select2-bootstrap.css">
To apply the theme, tell Select2 to do so by passing `bootstrap` to the [`theme`](https://select2.github.io/examples.html#themes) option when initializing Select2:
$( "#dropdown" ).select2({
theme: "bootstrap"
});
##### Known issues
##### Changelog
###### 0.1.0-beta.2
* Added Less version.
###### 0.1.0-beta.1
##### Credits
##### Contributing
|
babdd57bb9452032c0299d117c975dc246366eae | src/main/java/org/purescript/psi/expression/ExpressionConstructorReference.kt | src/main/java/org/purescript/psi/expression/ExpressionConstructorReference.kt | package org.purescript.psi.expression
import com.intellij.codeInspection.LocalQuickFix
import com.intellij.codeInspection.LocalQuickFixProvider
import com.intellij.psi.PsiNamedElement
import com.intellij.psi.PsiReferenceBase
import com.intellij.psi.SmartPointerManager
class ExpressionConstructorReference(expressionConstructor: PSExpressionConstructor) :
LocalQuickFixProvider,
PsiReferenceBase<PSExpressionConstructor>(
expressionConstructor,
expressionConstructor.qualifiedProperName.properName.textRangeInParent,
false
) {
override fun getVariants(): Array<Any> =
candidates.toList().toTypedArray()
override fun resolve(): PsiNamedElement? =
candidates.firstOrNull { it.name == element.name }
private val candidates: Sequence<PsiNamedElement>
get() {
val module = element.module ?: return emptySequence()
return sequence {
yieldAll(module.newTypeConstructors)
yieldAll(module.dataConstructors)
val importDeclarations = module.importDeclarations
yieldAll(importDeclarations.flatMap { it.importedNewTypeConstructors })
yieldAll(importDeclarations.flatMap { it.importedDataConstructors })
}
}
override fun getQuickFixes(): Array<LocalQuickFix> =
arrayOf(ImportExpressionConstructorQuickFix(SmartPointerManager.createPointer(element)))
}
| package org.purescript.psi.expression
import com.intellij.codeInspection.LocalQuickFix
import com.intellij.codeInspection.LocalQuickFixProvider
import com.intellij.psi.PsiNamedElement
import com.intellij.psi.PsiReferenceBase
import com.intellij.psi.SmartPointerManager
class ExpressionConstructorReference(expressionConstructor: PSExpressionConstructor) :
LocalQuickFixProvider,
PsiReferenceBase<PSExpressionConstructor>(
expressionConstructor,
expressionConstructor.qualifiedProperName.properName.textRangeInParent,
false
) {
override fun getVariants(): Array<Any> =
candidates.toList().toTypedArray()
override fun resolve(): PsiNamedElement? =
candidates.firstOrNull { it.name == element.name }
private val candidates: Sequence<PsiNamedElement>
get() {
val module = element.module ?: return emptySequence()
val qualifyingName = element.qualifiedProperName.moduleName?.name
if (qualifyingName != null) {
val importDeclaration = module.importDeclarations
.firstOrNull { it.importAlias?.name == qualifyingName }
?: return emptySequence()
return sequence {
yieldAll(importDeclaration.importedNewTypeConstructors)
yieldAll(importDeclaration.importedDataConstructors)
}
} else {
return sequence {
yieldAll(module.newTypeConstructors)
yieldAll(module.dataConstructors)
val importDeclarations = module.importDeclarations
.filter { it.importAlias == null }
yieldAll(importDeclarations.flatMap { it.importedNewTypeConstructors })
yieldAll(importDeclarations.flatMap { it.importedDataConstructors })
}
}
}
override fun getQuickFixes(): Array<LocalQuickFix> =
arrayOf(ImportExpressionConstructorQuickFix(SmartPointerManager.createPointer(element)))
}
| Implement navigation for qualified expression constructors | Implement navigation for qualified expression constructors
| Kotlin | bsd-3-clause | intellij-purescript/intellij-purescript,intellij-purescript/intellij-purescript | kotlin | ## Code Before:
package org.purescript.psi.expression
import com.intellij.codeInspection.LocalQuickFix
import com.intellij.codeInspection.LocalQuickFixProvider
import com.intellij.psi.PsiNamedElement
import com.intellij.psi.PsiReferenceBase
import com.intellij.psi.SmartPointerManager
class ExpressionConstructorReference(expressionConstructor: PSExpressionConstructor) :
LocalQuickFixProvider,
PsiReferenceBase<PSExpressionConstructor>(
expressionConstructor,
expressionConstructor.qualifiedProperName.properName.textRangeInParent,
false
) {
override fun getVariants(): Array<Any> =
candidates.toList().toTypedArray()
override fun resolve(): PsiNamedElement? =
candidates.firstOrNull { it.name == element.name }
private val candidates: Sequence<PsiNamedElement>
get() {
val module = element.module ?: return emptySequence()
return sequence {
yieldAll(module.newTypeConstructors)
yieldAll(module.dataConstructors)
val importDeclarations = module.importDeclarations
yieldAll(importDeclarations.flatMap { it.importedNewTypeConstructors })
yieldAll(importDeclarations.flatMap { it.importedDataConstructors })
}
}
override fun getQuickFixes(): Array<LocalQuickFix> =
arrayOf(ImportExpressionConstructorQuickFix(SmartPointerManager.createPointer(element)))
}
## Instruction:
Implement navigation for qualified expression constructors
## Code After:
package org.purescript.psi.expression
import com.intellij.codeInspection.LocalQuickFix
import com.intellij.codeInspection.LocalQuickFixProvider
import com.intellij.psi.PsiNamedElement
import com.intellij.psi.PsiReferenceBase
import com.intellij.psi.SmartPointerManager
class ExpressionConstructorReference(expressionConstructor: PSExpressionConstructor) :
LocalQuickFixProvider,
PsiReferenceBase<PSExpressionConstructor>(
expressionConstructor,
expressionConstructor.qualifiedProperName.properName.textRangeInParent,
false
) {
override fun getVariants(): Array<Any> =
candidates.toList().toTypedArray()
override fun resolve(): PsiNamedElement? =
candidates.firstOrNull { it.name == element.name }
private val candidates: Sequence<PsiNamedElement>
get() {
val module = element.module ?: return emptySequence()
val qualifyingName = element.qualifiedProperName.moduleName?.name
if (qualifyingName != null) {
val importDeclaration = module.importDeclarations
.firstOrNull { it.importAlias?.name == qualifyingName }
?: return emptySequence()
return sequence {
yieldAll(importDeclaration.importedNewTypeConstructors)
yieldAll(importDeclaration.importedDataConstructors)
}
} else {
return sequence {
yieldAll(module.newTypeConstructors)
yieldAll(module.dataConstructors)
val importDeclarations = module.importDeclarations
.filter { it.importAlias == null }
yieldAll(importDeclarations.flatMap { it.importedNewTypeConstructors })
yieldAll(importDeclarations.flatMap { it.importedDataConstructors })
}
}
}
override fun getQuickFixes(): Array<LocalQuickFix> =
arrayOf(ImportExpressionConstructorQuickFix(SmartPointerManager.createPointer(element)))
}
|
a35295bd484decde161a45e93d75a5115938af8b | breadwallet/src/Views/TransactionCells/MaskedShadow.swift | breadwallet/src/Views/TransactionCells/MaskedShadow.swift | //
// ShadowView.swift
// breadwallet
//
// Created by Adrian Corscadden on 2016-11-17.
// Copyright © 2016 breadwallet LLC. All rights reserved.
//
import UIKit
class MaskedShadow: UIView {
var style: TransactionCellStyle = .middle {
didSet {
setNeedsLayout()
}
}
private let shadowSize: CGFloat = 8.0
override func layoutSubviews() {
var shadowRect = bounds.insetBy(dx: 0, dy: -shadowSize)
var maskRect = bounds.insetBy(dx: -shadowSize, dy: 0)
if style == .first {
maskRect.origin.y -= shadowSize
maskRect.size.height += shadowSize
shadowRect.origin.y += shadowSize
}
if style == .last {
maskRect.size.height += shadowSize
shadowRect.size.height -= shadowSize
}
let maskLayer = CAShapeLayer()
maskLayer.path = UIBezierPath(rect: maskRect).cgPath
layer.mask = maskLayer
layer.shadowPath = UIBezierPath(rect: shadowRect).cgPath
}
}
| //
// ShadowView.swift
// breadwallet
//
// Created by Adrian Corscadden on 2016-11-17.
// Copyright © 2016 breadwallet LLC. All rights reserved.
//
import UIKit
class MaskedShadow: UIView {
var style: TransactionCellStyle = .middle {
didSet {
setNeedsLayout()
}
}
private let shadowSize: CGFloat = 8.0
override func layoutSubviews() {
guard style != .single else {
layer.shadowPath = UIBezierPath(rect: bounds).cgPath
return
}
var shadowRect = bounds.insetBy(dx: 0, dy: -shadowSize)
var maskRect = bounds.insetBy(dx: -shadowSize, dy: 0)
if style == .first {
maskRect.origin.y -= shadowSize
maskRect.size.height += shadowSize
shadowRect.origin.y += shadowSize
}
if style == .last {
maskRect.size.height += shadowSize
shadowRect.size.height -= shadowSize
}
let maskLayer = CAShapeLayer()
maskLayer.path = UIBezierPath(rect: maskRect).cgPath
layer.mask = maskLayer
layer.shadowPath = UIBezierPath(rect: shadowRect).cgPath
}
}
| Make transaction cells work with single transaction | Make transaction cells work with single transaction
| Swift | mit | breadwallet/breadwallet-ios,breadwallet/breadwallet-ios,breadwallet/breadwallet-ios,breadwallet/breadwallet-ios,breadwallet/breadwallet-ios | swift | ## Code Before:
//
// ShadowView.swift
// breadwallet
//
// Created by Adrian Corscadden on 2016-11-17.
// Copyright © 2016 breadwallet LLC. All rights reserved.
//
import UIKit
class MaskedShadow: UIView {
var style: TransactionCellStyle = .middle {
didSet {
setNeedsLayout()
}
}
private let shadowSize: CGFloat = 8.0
override func layoutSubviews() {
var shadowRect = bounds.insetBy(dx: 0, dy: -shadowSize)
var maskRect = bounds.insetBy(dx: -shadowSize, dy: 0)
if style == .first {
maskRect.origin.y -= shadowSize
maskRect.size.height += shadowSize
shadowRect.origin.y += shadowSize
}
if style == .last {
maskRect.size.height += shadowSize
shadowRect.size.height -= shadowSize
}
let maskLayer = CAShapeLayer()
maskLayer.path = UIBezierPath(rect: maskRect).cgPath
layer.mask = maskLayer
layer.shadowPath = UIBezierPath(rect: shadowRect).cgPath
}
}
## Instruction:
Make transaction cells work with single transaction
## Code After:
//
// ShadowView.swift
// breadwallet
//
// Created by Adrian Corscadden on 2016-11-17.
// Copyright © 2016 breadwallet LLC. All rights reserved.
//
import UIKit
class MaskedShadow: UIView {
var style: TransactionCellStyle = .middle {
didSet {
setNeedsLayout()
}
}
private let shadowSize: CGFloat = 8.0
override func layoutSubviews() {
guard style != .single else {
layer.shadowPath = UIBezierPath(rect: bounds).cgPath
return
}
var shadowRect = bounds.insetBy(dx: 0, dy: -shadowSize)
var maskRect = bounds.insetBy(dx: -shadowSize, dy: 0)
if style == .first {
maskRect.origin.y -= shadowSize
maskRect.size.height += shadowSize
shadowRect.origin.y += shadowSize
}
if style == .last {
maskRect.size.height += shadowSize
shadowRect.size.height -= shadowSize
}
let maskLayer = CAShapeLayer()
maskLayer.path = UIBezierPath(rect: maskRect).cgPath
layer.mask = maskLayer
layer.shadowPath = UIBezierPath(rect: shadowRect).cgPath
}
}
|
2bea0c8d746076bb7e6a86d229646d3dd48ea282 | README.md | README.md |
A daemon that consumes assignments from the message queue, builds and runs them
and then sends results back.
## How to run it
- Install ZeroMQ, version at least 4.0. Package name should be `libzmq3-dev`
- Install dependencies with `git submodule update --init`
- Install CMake, GNU Make, G++ > 5
- Install isolate
- Build as `cmake . && make`
- Run `./basic-worker`
| [](https://travis-ci.org/ReCodEx/BasicWorker)
A daemon that consumes assignments from the message queue, builds and runs them
and then sends results back.
## How to run it
- Install ZeroMQ, version at least 4.0. Package name should be `libzmq3-dev`
- Install dependencies with `git submodule update --init`
- Install CMake, GNU Make, G++ > 5
- Install isolate
- Build as `cmake . && make`
- Run `./basic-worker`
| Add a fancy build status indicator | Add a fancy build status indicator | Markdown | mit | ReCodEx/worker,ReCodEx/worker,ReCodEx/worker | markdown | ## Code Before:
A daemon that consumes assignments from the message queue, builds and runs them
and then sends results back.
## How to run it
- Install ZeroMQ, version at least 4.0. Package name should be `libzmq3-dev`
- Install dependencies with `git submodule update --init`
- Install CMake, GNU Make, G++ > 5
- Install isolate
- Build as `cmake . && make`
- Run `./basic-worker`
## Instruction:
Add a fancy build status indicator
## Code After:
[](https://travis-ci.org/ReCodEx/BasicWorker)
A daemon that consumes assignments from the message queue, builds and runs them
and then sends results back.
## How to run it
- Install ZeroMQ, version at least 4.0. Package name should be `libzmq3-dev`
- Install dependencies with `git submodule update --init`
- Install CMake, GNU Make, G++ > 5
- Install isolate
- Build as `cmake . && make`
- Run `./basic-worker`
|
2e79c42b8d003df020076511f0b978897245d1ea | packages/no/non-empty-zipper.yaml | packages/no/non-empty-zipper.yaml | homepage: ''
changelog-type: markdown
hash: 7cb42774a3712b82037e1705b8414d1d2684ce59b0454379ada0c3a4edac9009
test-bench-deps:
checkers: -any
base: -any
QuickCheck: -any
non-empty-zipper: -any
maintainer: fresheyeball@gmail.com
synopsis: The Zipper for NonEmpty
changelog: ! '# Revision history for NonEmptyZipper
## 0.1.0.0 -- YYYY-mm-dd
* First version. Released on an unsuspecting world.
'
basic-deps:
base: ! '>=4.9 && <4.10'
all-versions:
- '0.1.0.0'
- '0.1.0.1'
- '0.1.0.2'
- '0.1.0.3'
- '0.1.0.4'
author: Isaac Shapira
latest: '0.1.0.4'
description-type: haddock
description: ! 'The Zipper for NonEmpty. Useful for things like tabs,
button groups, and slideshows. Basically any case in which
you want to ensure you have one selected value from a
list of values.'
license-name: BSD3
| homepage: ''
changelog-type: markdown
hash: 607814b4dc4149540c3dbc50c38b04574e9cf4c5650b5983936725d3faf7d8a1
test-bench-deps:
checkers: -any
base: -any
QuickCheck: -any
non-empty-zipper: -any
maintainer: fresheyeball@gmail.com
synopsis: The Zipper for NonEmpty
changelog: ! '# Revision history for NonEmptyZipper
## 0.1.0.0 -- YYYY-mm-dd
* First version. Released on an unsuspecting world.
'
basic-deps:
base: ! '>=4.9 && <4.10'
all-versions:
- '0.1.0.0'
- '0.1.0.1'
- '0.1.0.2'
- '0.1.0.3'
- '0.1.0.4'
- '0.1.0.5'
author: Isaac Shapira
latest: '0.1.0.5'
description-type: haddock
description: ! 'The Zipper for NonEmpty. Useful for things like tabs,
button groups, and slideshows. Basically any case in which
you want to ensure you have one selected value from a
list of values.'
license-name: BSD3
| Update from Hackage at 2017-01-24T06:13:47Z | Update from Hackage at 2017-01-24T06:13:47Z
| YAML | mit | commercialhaskell/all-cabal-metadata | yaml | ## Code Before:
homepage: ''
changelog-type: markdown
hash: 7cb42774a3712b82037e1705b8414d1d2684ce59b0454379ada0c3a4edac9009
test-bench-deps:
checkers: -any
base: -any
QuickCheck: -any
non-empty-zipper: -any
maintainer: fresheyeball@gmail.com
synopsis: The Zipper for NonEmpty
changelog: ! '# Revision history for NonEmptyZipper
## 0.1.0.0 -- YYYY-mm-dd
* First version. Released on an unsuspecting world.
'
basic-deps:
base: ! '>=4.9 && <4.10'
all-versions:
- '0.1.0.0'
- '0.1.0.1'
- '0.1.0.2'
- '0.1.0.3'
- '0.1.0.4'
author: Isaac Shapira
latest: '0.1.0.4'
description-type: haddock
description: ! 'The Zipper for NonEmpty. Useful for things like tabs,
button groups, and slideshows. Basically any case in which
you want to ensure you have one selected value from a
list of values.'
license-name: BSD3
## Instruction:
Update from Hackage at 2017-01-24T06:13:47Z
## Code After:
homepage: ''
changelog-type: markdown
hash: 607814b4dc4149540c3dbc50c38b04574e9cf4c5650b5983936725d3faf7d8a1
test-bench-deps:
checkers: -any
base: -any
QuickCheck: -any
non-empty-zipper: -any
maintainer: fresheyeball@gmail.com
synopsis: The Zipper for NonEmpty
changelog: ! '# Revision history for NonEmptyZipper
## 0.1.0.0 -- YYYY-mm-dd
* First version. Released on an unsuspecting world.
'
basic-deps:
base: ! '>=4.9 && <4.10'
all-versions:
- '0.1.0.0'
- '0.1.0.1'
- '0.1.0.2'
- '0.1.0.3'
- '0.1.0.4'
- '0.1.0.5'
author: Isaac Shapira
latest: '0.1.0.5'
description-type: haddock
description: ! 'The Zipper for NonEmpty. Useful for things like tabs,
button groups, and slideshows. Basically any case in which
you want to ensure you have one selected value from a
list of values.'
license-name: BSD3
|
65954ba3b3c69863bd413c1d727c18d38b973860 | src/test/java/specs/MutableWrapperSpec.java | src/test/java/specs/MutableWrapperSpec.java | package specs;
import static com.greghaskins.spectrum.Spectrum.describe;
import static com.greghaskins.spectrum.Spectrum.it;
import static com.greghaskins.spectrum.Spectrum.value;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
import com.greghaskins.spectrum.Spectrum;
import com.greghaskins.spectrum.Spectrum.Value;
import org.junit.runner.RunWith;
@RunWith(Spectrum.class)
public class MutableWrapperSpec {
{
describe("The Value convenience type", () -> {
it("allows you to set the value of a 'final' variable", () -> {
final Value<Integer> counter = value();
counter.value = 0;
counter.value = 1;
assertThat(counter.value, is(1));
});
it("can be given a starting value", () -> {
final Value<Double> pi = value(3.14);
assertThat(pi.value, is(3.14));
});
it("has a default value of null if not specified", () -> {
final Value<String> name = value();
assertThat(name.value, is(nullValue()));
});
});
}
}
| package specs;
import static com.greghaskins.spectrum.Spectrum.describe;
import static com.greghaskins.spectrum.Spectrum.it;
import static com.greghaskins.spectrum.Spectrum.value;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
import com.greghaskins.spectrum.Spectrum;
import com.greghaskins.spectrum.Spectrum.Value;
import org.junit.runner.RunWith;
@RunWith(Spectrum.class)
@SuppressWarnings("deprecation")
public class MutableWrapperSpec {
{
describe("The Value convenience type", () -> {
it("allows you to set the value of a 'final' variable", () -> {
final Value<Integer> counter = value();
counter.value = 0;
counter.value = 1;
assertThat(counter.value, is(1));
});
it("can be given a starting value", () -> {
final Value<Double> pi = value(3.14);
assertThat(pi.value, is(3.14));
});
it("has a default value of null if not specified", () -> {
final Value<String> name = value();
assertThat(name.value, is(nullValue()));
});
it("can take an explicit class parameter, for backward compatibility with ~0.6.1", () -> {
final Value<String> stringValue = value(String.class);
assertThat(stringValue.value, is(nullValue()));
});
});
}
}
| Make sure tests cover deprecated value(Class<T>) method | Make sure tests cover deprecated value(Class<T>) method
| Java | mit | greghaskins/spectrum | java | ## Code Before:
package specs;
import static com.greghaskins.spectrum.Spectrum.describe;
import static com.greghaskins.spectrum.Spectrum.it;
import static com.greghaskins.spectrum.Spectrum.value;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
import com.greghaskins.spectrum.Spectrum;
import com.greghaskins.spectrum.Spectrum.Value;
import org.junit.runner.RunWith;
@RunWith(Spectrum.class)
public class MutableWrapperSpec {
{
describe("The Value convenience type", () -> {
it("allows you to set the value of a 'final' variable", () -> {
final Value<Integer> counter = value();
counter.value = 0;
counter.value = 1;
assertThat(counter.value, is(1));
});
it("can be given a starting value", () -> {
final Value<Double> pi = value(3.14);
assertThat(pi.value, is(3.14));
});
it("has a default value of null if not specified", () -> {
final Value<String> name = value();
assertThat(name.value, is(nullValue()));
});
});
}
}
## Instruction:
Make sure tests cover deprecated value(Class<T>) method
## Code After:
package specs;
import static com.greghaskins.spectrum.Spectrum.describe;
import static com.greghaskins.spectrum.Spectrum.it;
import static com.greghaskins.spectrum.Spectrum.value;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
import com.greghaskins.spectrum.Spectrum;
import com.greghaskins.spectrum.Spectrum.Value;
import org.junit.runner.RunWith;
@RunWith(Spectrum.class)
@SuppressWarnings("deprecation")
public class MutableWrapperSpec {
{
describe("The Value convenience type", () -> {
it("allows you to set the value of a 'final' variable", () -> {
final Value<Integer> counter = value();
counter.value = 0;
counter.value = 1;
assertThat(counter.value, is(1));
});
it("can be given a starting value", () -> {
final Value<Double> pi = value(3.14);
assertThat(pi.value, is(3.14));
});
it("has a default value of null if not specified", () -> {
final Value<String> name = value();
assertThat(name.value, is(nullValue()));
});
it("can take an explicit class parameter, for backward compatibility with ~0.6.1", () -> {
final Value<String> stringValue = value(String.class);
assertThat(stringValue.value, is(nullValue()));
});
});
}
}
|
fd0c64a1ec00338417f5309d095781d59d10d293 | README.md | README.md | Programme PHP pour lire le télérelevé
# Install
Clone the project or download the tarball.
Open terminal and execute :
```
$ php composer.phar install --no-dev -o
```
If you want use InfluxDB storage, exetute this command
```
$ php composer.phar require influxdb/influxdb-php:^1.4
```
# Usage
In the terminal :
```
$ ./telereleve
```
# Tests
Open terminal and execute :
```
$ php composer.phar install -o
$ ./run-unit
```
| Programme PHP pour lire le télérelevé
# Install
Clone the project or download the tarball.
Open terminal and execute :
```bash
$ php composer.phar install --no-dev -o
```
If you want use InfluxDB storage, exetute this command
```bash
$ php composer.phar require influxdb/influxdb-php:^1.4
```
# Configuration
Make the configuration file into the destination folder.
```bash
$ touch config.yml
```
## Set the serial device for your Electric Counter
The `compteur` key is the model of your electric counter. Only `CBEMM` and `CBETM` supported now.
The `device` key is the path to the serial device socket.
```yaml
compteur: CBEMM
device: /dev/ttyAMA0
```
By default, the storage is SQLite into `data.sqlite` file.
# Usage
In the terminal :
```bash
$ ./telereleve
```
# Tests
Open terminal and execute :
```bash
$ php composer.phar install -o
$ ./run-unit
```
# Configuration definition
```yaml
compteur: CBEMM #this value is by default
device: /dev/ttyAMA0 # this value is the GPIO serial port for the Raspberry Pi
storage:
driver: Sqlite # This is the default value. Another storage supported is 'InfluxDb'.
parameters: # This is the default value. This constains arbitrary array configuration key for the driver.
path: datas.sqlite
# Parameters array for the InfluxDB driver :
host: localhost
port: 8086
database: telereleve
enable_email: false # By default, the email sending is disabled.
template: default.text.twig # The name file for default template for email body content.
smtp:
server: 127.0.0.1
port: 25
security: null
username: null
password: null
mime: text/plain
from:
display_name: TeleReleve
email: me@localhost
to:
display_name: Me
email: me@localhost
```
| Add config definition and config part | Add config definition and config part
| Markdown | mit | Mactronique/edf-telereleve,Mactronique/edf-telereleve | markdown | ## Code Before:
Programme PHP pour lire le télérelevé
# Install
Clone the project or download the tarball.
Open terminal and execute :
```
$ php composer.phar install --no-dev -o
```
If you want use InfluxDB storage, exetute this command
```
$ php composer.phar require influxdb/influxdb-php:^1.4
```
# Usage
In the terminal :
```
$ ./telereleve
```
# Tests
Open terminal and execute :
```
$ php composer.phar install -o
$ ./run-unit
```
## Instruction:
Add config definition and config part
## Code After:
Programme PHP pour lire le télérelevé
# Install
Clone the project or download the tarball.
Open terminal and execute :
```bash
$ php composer.phar install --no-dev -o
```
If you want use InfluxDB storage, exetute this command
```bash
$ php composer.phar require influxdb/influxdb-php:^1.4
```
# Configuration
Make the configuration file into the destination folder.
```bash
$ touch config.yml
```
## Set the serial device for your Electric Counter
The `compteur` key is the model of your electric counter. Only `CBEMM` and `CBETM` supported now.
The `device` key is the path to the serial device socket.
```yaml
compteur: CBEMM
device: /dev/ttyAMA0
```
By default, the storage is SQLite into `data.sqlite` file.
# Usage
In the terminal :
```bash
$ ./telereleve
```
# Tests
Open terminal and execute :
```bash
$ php composer.phar install -o
$ ./run-unit
```
# Configuration definition
```yaml
compteur: CBEMM #this value is by default
device: /dev/ttyAMA0 # this value is the GPIO serial port for the Raspberry Pi
storage:
driver: Sqlite # This is the default value. Another storage supported is 'InfluxDb'.
parameters: # This is the default value. This constains arbitrary array configuration key for the driver.
path: datas.sqlite
# Parameters array for the InfluxDB driver :
host: localhost
port: 8086
database: telereleve
enable_email: false # By default, the email sending is disabled.
template: default.text.twig # The name file for default template for email body content.
smtp:
server: 127.0.0.1
port: 25
security: null
username: null
password: null
mime: text/plain
from:
display_name: TeleReleve
email: me@localhost
to:
display_name: Me
email: me@localhost
```
|
29ab95ebcf56ca146cef2351fded14a0896f4cb7 | app/views/home/facebook_login.html.haml | app/views/home/facebook_login.html.haml | .container.large-6
.center
.row.large-8
%h2 Please login to Facebook to start searching...
#status
%br
%fb:login-button{ onlogin: 'FacebookLogin.checkLoginState();',
data: { 'max-rows' => '1', size: 'medium', 'show-faces' => 'true' } }
- content_for :javascript do
= javascript_include_tag 'facebook_login'
| .container.large-6
.center
.row.large-8
%h2 Please login to Facebook to start searching for new events...
.row.large-4
%fb:login-button{ onlogin: 'FacebookLogin.checkLoginState();',
data: { 'max-rows' => '1', size: 'medium', 'show-faces' => 'true' } }
%br
.row.large-8
%h4.subheader *No information from your profile is saved in our servers.
- content_for :javascript do
= javascript_include_tag 'facebook_login'
| Update text in facebook login layout | Update text in facebook login layout
| Haml | mit | davidochoa/happenin | haml | ## Code Before:
.container.large-6
.center
.row.large-8
%h2 Please login to Facebook to start searching...
#status
%br
%fb:login-button{ onlogin: 'FacebookLogin.checkLoginState();',
data: { 'max-rows' => '1', size: 'medium', 'show-faces' => 'true' } }
- content_for :javascript do
= javascript_include_tag 'facebook_login'
## Instruction:
Update text in facebook login layout
## Code After:
.container.large-6
.center
.row.large-8
%h2 Please login to Facebook to start searching for new events...
.row.large-4
%fb:login-button{ onlogin: 'FacebookLogin.checkLoginState();',
data: { 'max-rows' => '1', size: 'medium', 'show-faces' => 'true' } }
%br
.row.large-8
%h4.subheader *No information from your profile is saved in our servers.
- content_for :javascript do
= javascript_include_tag 'facebook_login'
|
4412942712a52664c1561a3d82b6caa93b548de2 | cloudbuild.yaml | cloudbuild.yaml | options:
substitution_option: ALLOW_LOOSE
steps:
- name: 'gcr.io/k8s-testimages/gcb-docker-gcloud:v20200422-b25d964'
entrypoint: bash
env:
- DOCKER_CLI_EXPERIMENTAL=enabled
- TAG=$_GIT_TAG
- BASE_REF=$_PULL_BASE_REF
- REGISTRY=gcr.io/k8s-staging-ingress-nginx
- HOME=/root
args:
- -c
- |
gcloud auth configure-docker \
&& make release
substitutions:
# _GIT_TAG will be filled with a git-based tag for the image, of the form vYYYYMMDD-hash, and
# can be used as a substitution
_GIT_TAG: "12345"
# _PULL_BASE_REF will contain the ref that was pushed to to trigger this build -
# a branch like 'master' or 'release-0.2', or a tag like 'v0.2'.
_PULL_BASE_REF: "master"
| options:
substitution_option: ALLOW_LOOSE
steps:
- name: 'gcr.io/k8s-testimages/gcb-docker-gcloud:v20200422-b25d964'
entrypoint: bash
env:
- DOCKER_CLI_EXPERIMENTAL=enabled
- TAG=$_GIT_TAG
- BASE_REF=$_PULL_BASE_REF
- REGISTRY=gcr.io/k8s-staging-ingress-nginx
- HOME=/root
- USER=root
args:
- -c
- |
gcloud auth configure-docker \
&& make release
substitutions:
# _GIT_TAG will be filled with a git-based tag for the image, of the form vYYYYMMDD-hash, and
# can be used as a substitution
_GIT_TAG: "12345"
# _PULL_BASE_REF will contain the ref that was pushed to to trigger this build -
# a branch like 'master' or 'release-0.2', or a tag like 'v0.2'.
_PULL_BASE_REF: "master"
| Set missing USER in cloud-build | Set missing USER in cloud-build | YAML | apache-2.0 | canhnt/ingress,caicloud/ingress,aledbf/ingress-nginx,caicloud/ingress,aledbf/ingress-nginx,canhnt/ingress,caicloud/ingress,caicloud/ingress,kubernetes/ingress-nginx,canhnt/ingress,canhnt/ingress,kubernetes/ingress-nginx,kubernetes/ingress-nginx,aledbf/ingress-nginx,kubernetes/ingress-nginx,kubernetes/ingress-nginx,aledbf/ingress-nginx | yaml | ## Code Before:
options:
substitution_option: ALLOW_LOOSE
steps:
- name: 'gcr.io/k8s-testimages/gcb-docker-gcloud:v20200422-b25d964'
entrypoint: bash
env:
- DOCKER_CLI_EXPERIMENTAL=enabled
- TAG=$_GIT_TAG
- BASE_REF=$_PULL_BASE_REF
- REGISTRY=gcr.io/k8s-staging-ingress-nginx
- HOME=/root
args:
- -c
- |
gcloud auth configure-docker \
&& make release
substitutions:
# _GIT_TAG will be filled with a git-based tag for the image, of the form vYYYYMMDD-hash, and
# can be used as a substitution
_GIT_TAG: "12345"
# _PULL_BASE_REF will contain the ref that was pushed to to trigger this build -
# a branch like 'master' or 'release-0.2', or a tag like 'v0.2'.
_PULL_BASE_REF: "master"
## Instruction:
Set missing USER in cloud-build
## Code After:
options:
substitution_option: ALLOW_LOOSE
steps:
- name: 'gcr.io/k8s-testimages/gcb-docker-gcloud:v20200422-b25d964'
entrypoint: bash
env:
- DOCKER_CLI_EXPERIMENTAL=enabled
- TAG=$_GIT_TAG
- BASE_REF=$_PULL_BASE_REF
- REGISTRY=gcr.io/k8s-staging-ingress-nginx
- HOME=/root
- USER=root
args:
- -c
- |
gcloud auth configure-docker \
&& make release
substitutions:
# _GIT_TAG will be filled with a git-based tag for the image, of the form vYYYYMMDD-hash, and
# can be used as a substitution
_GIT_TAG: "12345"
# _PULL_BASE_REF will contain the ref that was pushed to to trigger this build -
# a branch like 'master' or 'release-0.2', or a tag like 'v0.2'.
_PULL_BASE_REF: "master"
|
774ba9672ac0ba3f403768920d36d0657021b8a9 | Magento_Checkout/layout/checkout_cart_index.xml | Magento_Checkout/layout/checkout_cart_index.xml | <?xml version="1.0"?>
<!--
/**
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<update handle="checkout_cart_item_renderers"/>
<body>
<referenceContainer name="content">
<referenceContainer name="checkout.cart.items" as="with-items">
<referenceContainer name="checkout.cart.container" htmlTag="div" htmlClass="cart-container row" before="-">
<referenceContainer name="cart.summary" label="Cart Summary Container" htmlTag="div" htmlClass="cart-summary col-sm-3 pull-right" after="-">
<block class="Magento\Framework\View\Element\Template" name="checkout.cart.summary.title" before="-" template="Magento_Theme::text.phtml">
<arguments>
<argument translate="true" name="text" xsi:type="string"></argument>
<argument name="tag" xsi:type="string">strong</argument>
<argument name="css_class" xsi:type="string"></argument>
</arguments>
</block>
</referenceContainer>
</referenceContainer>
</referenceContainer>
</referenceContainer>
</body>
</page>
| <?xml version="1.0"?>
<!--
/**
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<update handle="checkout_cart_item_renderers"/>
<body>
<referenceContainer name="content">
<referenceContainer name="checkout.cart.items">
<referenceContainer name="checkout.cart.container" htmlTag="div" htmlClass="cart-container row" before="-">
<referenceContainer name="cart.summary" label="Cart Summary Container" htmlTag="div" htmlClass="cart-summary col-sm-3 pull-right" after="-">
<block class="Magento\Framework\View\Element\Template" name="checkout.cart.summary.title" before="-" template="Magento_Theme::text.phtml">
<arguments>
<argument translate="true" name="text" xsi:type="string"></argument>
<argument name="tag" xsi:type="string">strong</argument>
<argument name="css_class" xsi:type="string"></argument>
</arguments>
</block>
</referenceContainer>
</referenceContainer>
</referenceContainer>
</referenceContainer>
</body>
</page>
| Remove with-items as invalid reference | Remove with-items as invalid reference
| XML | mit | webgriffe/theme-bootstrap,webgriffe/theme-bootstrap,webgriffe/theme-bootstrap | xml | ## Code Before:
<?xml version="1.0"?>
<!--
/**
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<update handle="checkout_cart_item_renderers"/>
<body>
<referenceContainer name="content">
<referenceContainer name="checkout.cart.items" as="with-items">
<referenceContainer name="checkout.cart.container" htmlTag="div" htmlClass="cart-container row" before="-">
<referenceContainer name="cart.summary" label="Cart Summary Container" htmlTag="div" htmlClass="cart-summary col-sm-3 pull-right" after="-">
<block class="Magento\Framework\View\Element\Template" name="checkout.cart.summary.title" before="-" template="Magento_Theme::text.phtml">
<arguments>
<argument translate="true" name="text" xsi:type="string"></argument>
<argument name="tag" xsi:type="string">strong</argument>
<argument name="css_class" xsi:type="string"></argument>
</arguments>
</block>
</referenceContainer>
</referenceContainer>
</referenceContainer>
</referenceContainer>
</body>
</page>
## Instruction:
Remove with-items as invalid reference
## Code After:
<?xml version="1.0"?>
<!--
/**
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<update handle="checkout_cart_item_renderers"/>
<body>
<referenceContainer name="content">
<referenceContainer name="checkout.cart.items">
<referenceContainer name="checkout.cart.container" htmlTag="div" htmlClass="cart-container row" before="-">
<referenceContainer name="cart.summary" label="Cart Summary Container" htmlTag="div" htmlClass="cart-summary col-sm-3 pull-right" after="-">
<block class="Magento\Framework\View\Element\Template" name="checkout.cart.summary.title" before="-" template="Magento_Theme::text.phtml">
<arguments>
<argument translate="true" name="text" xsi:type="string"></argument>
<argument name="tag" xsi:type="string">strong</argument>
<argument name="css_class" xsi:type="string"></argument>
</arguments>
</block>
</referenceContainer>
</referenceContainer>
</referenceContainer>
</referenceContainer>
</body>
</page>
|
86aedc2fcb50a06ca5890917df1d83c3e27264f7 | requirements/build_windows.txt | requirements/build_windows.txt | -r common.txt
flake8==2.5.4
isort==4.2.2
marshmallow==2.6.0
pytest==2.9.0
wheel==0.29.0
| -r common.txt
flake8==2.5.4
isort==4.2.2
marshmallow==2.6.0
pytest==2.9.0
wheel==0.29.0
pytest-xdist==1.15.0
| Add xdist requirements to windows | Add xdist requirements to windows
| Text | mit | MuhammadAlkarouri/hug,timothycrosley/hug,timothycrosley/hug,MuhammadAlkarouri/hug,timothycrosley/hug,MuhammadAlkarouri/hug | text | ## Code Before:
-r common.txt
flake8==2.5.4
isort==4.2.2
marshmallow==2.6.0
pytest==2.9.0
wheel==0.29.0
## Instruction:
Add xdist requirements to windows
## Code After:
-r common.txt
flake8==2.5.4
isort==4.2.2
marshmallow==2.6.0
pytest==2.9.0
wheel==0.29.0
pytest-xdist==1.15.0
|
c3e6c4dfa125198fddd50e84704026d73995846b | src/isaac-generator.ts | src/isaac-generator.ts | import { SeedProvider } from './seed-provider';
export class IsaacGenerator {
private _count: number;
private _memory: any;
constructor(seed: Array<number>) {
this._count = 0;
this._memory = SeedProvider.getMemory(seed);
}
public getValue(): number {
if (this._count <= 0) {
this._randomise();
}
return 0;
}
private _randomise(): void {
}
}
| import { SeedProvider } from './seed-provider';
export class IsaacGenerator {
private _count: number;
private _accumulatorShifts: Array<(x: number) => number>;
private _memory: any;
constructor(seed: Array<number>) {
this._count = 0;
this._accumulatorShifts = [
(x: number) => x << 13,
(x: number) => x >>> 6,
(x: number) => x << 2,
(x: number) => x >>> 16
];
this._memory = SeedProvider.getMemory(seed);
}
public getValue(): number {
if (this._count <= 0) {
this._randomise();
}
return 0;
}
private _randomise(): void {
}
}
| Store required accumulator shifts (in order) | Store required accumulator shifts (in order)
| TypeScript | mit | Jameskmonger/isaac-crypto | typescript | ## Code Before:
import { SeedProvider } from './seed-provider';
export class IsaacGenerator {
private _count: number;
private _memory: any;
constructor(seed: Array<number>) {
this._count = 0;
this._memory = SeedProvider.getMemory(seed);
}
public getValue(): number {
if (this._count <= 0) {
this._randomise();
}
return 0;
}
private _randomise(): void {
}
}
## Instruction:
Store required accumulator shifts (in order)
## Code After:
import { SeedProvider } from './seed-provider';
export class IsaacGenerator {
private _count: number;
private _accumulatorShifts: Array<(x: number) => number>;
private _memory: any;
constructor(seed: Array<number>) {
this._count = 0;
this._accumulatorShifts = [
(x: number) => x << 13,
(x: number) => x >>> 6,
(x: number) => x << 2,
(x: number) => x >>> 16
];
this._memory = SeedProvider.getMemory(seed);
}
public getValue(): number {
if (this._count <= 0) {
this._randomise();
}
return 0;
}
private _randomise(): void {
}
}
|
f86bc40fbc753e0e9e27405d697eaee4d768c7e1 | README.md | README.md | [](http://issuestats.com/github/fsprojects/FSharpx.Collections)
[](http://issuestats.com/github/fsprojects/FSharpx.Collections)
# FSharpx.Collections [](https://www.nuget.org/packages/FSharpx.Collections/)
**FSharpx.Collections** is a collection of datastructures for use with F# and C#.
See [the home page](http://fsprojects.github.io/FSharpx.Collections/) and [API docs](http://fsprojects.github.io/FSharpx.Collections/reference/index.html) for details.
Please contribute to this project. Don't ask for permission, just fork the repository and send pull requests.
## Maintainer(s)
- [@forki](https://github.com/forki)
The default maintainer account for projects under "fsprojects" is [@fsprojectsgit](https://github.com/fsprojectsgit) - F# Community Project Incubation Space (repo management)
| [](http://issuestats.com/github/fsprojects/FSharpx.Collections)
[](http://issuestats.com/github/fsprojects/FSharpx.Collections)
# FSharpx.Collections [](https://www.nuget.org/packages/FSharpx.Collections/)
**FSharpx.Collections** is a collection of datastructures for use with F# and C#.
See [the home page](http://fsprojects.github.io/FSharpx.Collections/) and [API docs](http://fsprojects.github.io/FSharpx.Collections/reference/index.html) for details.
Please contribute to this project. Don't ask for permission, just fork the repository and send pull requests.
## Build Status
Travis-CI | AppVeyor
--------- | --------
[](https://travis-ci.org/fsprojects/FSharpx.Collections) | [](https://ci.appveyor.com/project/fsgit/fsharpx-collections)
## Maintainer(s)
- [@forki](https://github.com/forki)
The default maintainer account for projects under "fsprojects" is [@fsprojectsgit](https://github.com/fsprojectsgit) - F# Community Project Incubation Space (repo management)
| Add build status badges for travis and appveyor | Add build status badges for travis and appveyor | Markdown | apache-2.0 | fsprojects/FSharpx.Collections,fsprojects/FSharpx.Collections,yever/FSharpx.Collections | markdown | ## Code Before:
[](http://issuestats.com/github/fsprojects/FSharpx.Collections)
[](http://issuestats.com/github/fsprojects/FSharpx.Collections)
# FSharpx.Collections [](https://www.nuget.org/packages/FSharpx.Collections/)
**FSharpx.Collections** is a collection of datastructures for use with F# and C#.
See [the home page](http://fsprojects.github.io/FSharpx.Collections/) and [API docs](http://fsprojects.github.io/FSharpx.Collections/reference/index.html) for details.
Please contribute to this project. Don't ask for permission, just fork the repository and send pull requests.
## Maintainer(s)
- [@forki](https://github.com/forki)
The default maintainer account for projects under "fsprojects" is [@fsprojectsgit](https://github.com/fsprojectsgit) - F# Community Project Incubation Space (repo management)
## Instruction:
Add build status badges for travis and appveyor
## Code After:
[](http://issuestats.com/github/fsprojects/FSharpx.Collections)
[](http://issuestats.com/github/fsprojects/FSharpx.Collections)
# FSharpx.Collections [](https://www.nuget.org/packages/FSharpx.Collections/)
**FSharpx.Collections** is a collection of datastructures for use with F# and C#.
See [the home page](http://fsprojects.github.io/FSharpx.Collections/) and [API docs](http://fsprojects.github.io/FSharpx.Collections/reference/index.html) for details.
Please contribute to this project. Don't ask for permission, just fork the repository and send pull requests.
## Build Status
Travis-CI | AppVeyor
--------- | --------
[](https://travis-ci.org/fsprojects/FSharpx.Collections) | [](https://ci.appveyor.com/project/fsgit/fsharpx-collections)
## Maintainer(s)
- [@forki](https://github.com/forki)
The default maintainer account for projects under "fsprojects" is [@fsprojectsgit](https://github.com/fsprojectsgit) - F# Community Project Incubation Space (repo management)
|
dad3aef53d4dc4a036c3acea51590609056bb80f | src/main/web/templates/handlebars/list/t9-7.handlebars | src/main/web/templates/handlebars/list/t9-7.handlebars | {{!-- {{#partial "block-title"}}
{{#last breadcrumb}}{{description.title}}{{/last}} methodology
{{/partial}} --}}
{{#partial "block-results-text"}}
<div class="col col--md-28 col--lg-38">
{{> list/partials/list-results-text-number result resultsLabel="methodology"}}
</div>
{{/partial}}
{{#partial "block-filters"}}
{{> list/filters/keywords}}
{{> list/filters/methodology docCounts=result.docCounts}}
{{/partial}}
{{!-- Inheriting from base list template --}}
{{> list/base/list showBreadcrumb=true breadcrumbLabel="Methodology"}} | {{!-- {{#partial "block-title"}}
{{#last breadcrumb}}{{description.title}}{{/last}} methodology
{{/partial}} --}}
{{#partial "block-results-text"}}
<div class="col col--md-28 col--lg-38">
{{> list/partials/list-results-text-number result resultsLabel="methodology"}}
</div>
{{/partial}}
{{#partial "block-filters"}}
{{> list/filters/keywords}}
{{/partial}}
{{!-- Inheriting from base list template --}}
{{> list/base/list showBreadcrumb=true breadcrumbLabel="Methodology"}} | Remove methodology type partial from filters block | Remove methodology type partial from filters block
| Handlebars | mit | ONSdigital/babbage,ONSdigital/babbage,ONSdigital/babbage,ONSdigital/babbage | handlebars | ## Code Before:
{{!-- {{#partial "block-title"}}
{{#last breadcrumb}}{{description.title}}{{/last}} methodology
{{/partial}} --}}
{{#partial "block-results-text"}}
<div class="col col--md-28 col--lg-38">
{{> list/partials/list-results-text-number result resultsLabel="methodology"}}
</div>
{{/partial}}
{{#partial "block-filters"}}
{{> list/filters/keywords}}
{{> list/filters/methodology docCounts=result.docCounts}}
{{/partial}}
{{!-- Inheriting from base list template --}}
{{> list/base/list showBreadcrumb=true breadcrumbLabel="Methodology"}}
## Instruction:
Remove methodology type partial from filters block
## Code After:
{{!-- {{#partial "block-title"}}
{{#last breadcrumb}}{{description.title}}{{/last}} methodology
{{/partial}} --}}
{{#partial "block-results-text"}}
<div class="col col--md-28 col--lg-38">
{{> list/partials/list-results-text-number result resultsLabel="methodology"}}
</div>
{{/partial}}
{{#partial "block-filters"}}
{{> list/filters/keywords}}
{{/partial}}
{{!-- Inheriting from base list template --}}
{{> list/base/list showBreadcrumb=true breadcrumbLabel="Methodology"}} |
c987ed375da13f53928157f14528bed0c148eeac | tasks.py | tasks.py | import asyncio
import threading
class Tasks:
loop = asyncio.new_event_loop()
@classmethod
def _run(cls):
try:
cls.loop.run_forever()
finally:
cls.loop.close()
@classmethod
def do(cls, func, *args, **kwargs):
cls.loop.call_soon(lambda: func(*args, **kwargs))
cls.loop._write_to_self()
@classmethod
def later(cls, func, *args, after=None, **kwargs):
cls.loop.call_later(after, lambda: func(*args, **kwargs))
cls.loop._write_to_self()
@classmethod
def periodic(cls, func, *args, interval=None, **kwargs):
@asyncio.coroutine
def f():
while True:
yield from asyncio.sleep(interval)
func(*args, **kwargs)
cls.loop.create_task(f())
cls.loop._write_to_self()
threading.Thread(name="tasks", target=Tasks._run, daemon=True).start()
| import asyncio
import threading
class Tasks:
loop = asyncio.new_event_loop()
@classmethod
def _run(cls):
asyncio.set_event_loop(cls.loop)
try:
cls.loop.run_forever()
finally:
cls.loop.close()
@classmethod
def do(cls, func, *args, **kwargs):
cls.loop.call_soon(lambda: func(*args, **kwargs))
cls.loop._write_to_self()
@classmethod
def later(cls, func, *args, after=None, **kwargs):
cls.loop.call_later(after, lambda: func(*args, **kwargs))
cls.loop._write_to_self()
@classmethod
def periodic(cls, func, *args, interval=None, **kwargs):
@asyncio.coroutine
def f():
while True:
yield from asyncio.sleep(interval)
func(*args, **kwargs)
cls.loop.create_task(f())
cls.loop._write_to_self()
threading.Thread(name="tasks", target=Tasks._run, daemon=True).start()
| Set implicit loop for Python <3.6 | Set implicit loop for Python <3.6 | Python | apache-2.0 | Charcoal-SE/SmokeDetector,Charcoal-SE/SmokeDetector | python | ## Code Before:
import asyncio
import threading
class Tasks:
loop = asyncio.new_event_loop()
@classmethod
def _run(cls):
try:
cls.loop.run_forever()
finally:
cls.loop.close()
@classmethod
def do(cls, func, *args, **kwargs):
cls.loop.call_soon(lambda: func(*args, **kwargs))
cls.loop._write_to_self()
@classmethod
def later(cls, func, *args, after=None, **kwargs):
cls.loop.call_later(after, lambda: func(*args, **kwargs))
cls.loop._write_to_self()
@classmethod
def periodic(cls, func, *args, interval=None, **kwargs):
@asyncio.coroutine
def f():
while True:
yield from asyncio.sleep(interval)
func(*args, **kwargs)
cls.loop.create_task(f())
cls.loop._write_to_self()
threading.Thread(name="tasks", target=Tasks._run, daemon=True).start()
## Instruction:
Set implicit loop for Python <3.6
## Code After:
import asyncio
import threading
class Tasks:
loop = asyncio.new_event_loop()
@classmethod
def _run(cls):
asyncio.set_event_loop(cls.loop)
try:
cls.loop.run_forever()
finally:
cls.loop.close()
@classmethod
def do(cls, func, *args, **kwargs):
cls.loop.call_soon(lambda: func(*args, **kwargs))
cls.loop._write_to_self()
@classmethod
def later(cls, func, *args, after=None, **kwargs):
cls.loop.call_later(after, lambda: func(*args, **kwargs))
cls.loop._write_to_self()
@classmethod
def periodic(cls, func, *args, interval=None, **kwargs):
@asyncio.coroutine
def f():
while True:
yield from asyncio.sleep(interval)
func(*args, **kwargs)
cls.loop.create_task(f())
cls.loop._write_to_self()
threading.Thread(name="tasks", target=Tasks._run, daemon=True).start()
|
2a0df796f230824d5564f2aedaeac1da5172152c | documentation/source/users/rmg/installation/index.rst | documentation/source/users/rmg/installation/index.rst | .. _installation:
************
Installation
************
.. NOTE::
RMG has been tested on the Python 2.5, 2.6, and 2.7 releases; dependency issues render it incompatible with Python 3.x releases
Briefly, RMG depends on the following packages:
* **NumPy:** fast matrix operations
* **SciPy:** fast mathematical toolkit
* **matplotlib:** generating plots
* **guppy:** memory profiling tools
* **OpenBabel:** species format conversion
* **Cython:** compiling Python modules to C
* **quantities:** unit conversion
* **nose:** advanced unit test controls
* **Sphinx:** documentation generation
* **pydot:** interface to Dot graph language
* **cairo:** molecular diagram generation
* **psutil:** system utilization diagnostic tool
* **xlwt:** generating Excel output files
* **Graphviz:** generating flux diagrams
* **PyDAS:** differential algebraic system solver
* **PyDQED:** constrained nonlinear optimization
* **RMG-database:** thermodynamic and kinetic libraries
Refer to these platform-specific instructions for details on the best ways to install these packages before attempting to build RMG-Py:
.. toctree::
:maxdepth: 1
windows
linux
macos
| .. _installation:
************
Installation
************
.. NOTE::
RMG has been tested on the Python 2.5, 2.6, and 2.7 releases; dependency issues render it incompatible with Python 3.x releases
Briefly, RMG depends on the following packages:
* **NumPy:** fast matrix operations
* **SciPy:** fast mathematical toolkit
* **matplotlib:** generating plots
* **guppy:** memory profiling tools
* **OpenBabel:** species format conversion
* **Cython:** compiling Python modules to C
* **quantities:** unit conversion
* **nose:** advanced unit test controls
* **Sphinx:** documentation generation
* **pydot:** interface to Dot graph language
* **cairo:** molecular diagram generation
* **psutil:** system utilization diagnostic tool
* **xlwt:** generating Excel output files
* **Graphviz:** generating flux diagrams
* **PyDAS:** differential algebraic system solver
* **PyDQED:** constrained nonlinear optimization
* **RMG-database:** thermodynamic and kinetic libraries
Refer to these platform-specific instructions for details on the best ways to install these packages before attempting to build RMG-Py:
.. toctree::
:maxdepth: 1
windows
linux
macos
| Correct line endings in installation instructions. | Correct line endings in installation instructions.
Accidentally ended up with some DOS line endings in here somehow. | reStructuredText | mit | chatelak/RMG-Py,comocheng/RMG-Py,KEHANG/RMG-Py,comocheng/RMG-Py,chatelak/RMG-Py,nickvandewiele/RMG-Py,pierrelb/RMG-Py,enochd/RMG-Py,KEHANG/RMG-Py,nyee/RMG-Py,nyee/RMG-Py,faribas/RMG-Py,nickvandewiele/RMG-Py,pierrelb/RMG-Py,enochd/RMG-Py,faribas/RMG-Py | restructuredtext | ## Code Before:
.. _installation:
************
Installation
************
.. NOTE::
RMG has been tested on the Python 2.5, 2.6, and 2.7 releases; dependency issues render it incompatible with Python 3.x releases
Briefly, RMG depends on the following packages:
* **NumPy:** fast matrix operations
* **SciPy:** fast mathematical toolkit
* **matplotlib:** generating plots
* **guppy:** memory profiling tools
* **OpenBabel:** species format conversion
* **Cython:** compiling Python modules to C
* **quantities:** unit conversion
* **nose:** advanced unit test controls
* **Sphinx:** documentation generation
* **pydot:** interface to Dot graph language
* **cairo:** molecular diagram generation
* **psutil:** system utilization diagnostic tool
* **xlwt:** generating Excel output files
* **Graphviz:** generating flux diagrams
* **PyDAS:** differential algebraic system solver
* **PyDQED:** constrained nonlinear optimization
* **RMG-database:** thermodynamic and kinetic libraries
Refer to these platform-specific instructions for details on the best ways to install these packages before attempting to build RMG-Py:
.. toctree::
:maxdepth: 1
windows
linux
macos
## Instruction:
Correct line endings in installation instructions.
Accidentally ended up with some DOS line endings in here somehow.
## Code After:
.. _installation:
************
Installation
************
.. NOTE::
RMG has been tested on the Python 2.5, 2.6, and 2.7 releases; dependency issues render it incompatible with Python 3.x releases
Briefly, RMG depends on the following packages:
* **NumPy:** fast matrix operations
* **SciPy:** fast mathematical toolkit
* **matplotlib:** generating plots
* **guppy:** memory profiling tools
* **OpenBabel:** species format conversion
* **Cython:** compiling Python modules to C
* **quantities:** unit conversion
* **nose:** advanced unit test controls
* **Sphinx:** documentation generation
* **pydot:** interface to Dot graph language
* **cairo:** molecular diagram generation
* **psutil:** system utilization diagnostic tool
* **xlwt:** generating Excel output files
* **Graphviz:** generating flux diagrams
* **PyDAS:** differential algebraic system solver
* **PyDQED:** constrained nonlinear optimization
* **RMG-database:** thermodynamic and kinetic libraries
Refer to these platform-specific instructions for details on the best ways to install these packages before attempting to build RMG-Py:
.. toctree::
:maxdepth: 1
windows
linux
macos
|
3b874cb26b038d3d477afe90e810ecfff0f7b2c6 | src/App.jsx | src/App.jsx | import React, { Component } from "react";
import GoogleAnalytics from "react-ga";
import { BrowserRouter, Route } from "react-router-dom";
import ListPage from "./ListPage";
import RunPage from "./RunPage";
import config from "./config";
import "./App.css";
class App extends Component {
constructor(props) {
super(props);
if (config.GOOGLE_ANALYTICS_CODE) {
GoogleAnalytics.initialize(config.GOOGLE_ANALYTICS_CODE);
}
}
render() {
return (
<BrowserRouter>
<div className="App">
<Route exact path="/" component={ListPage} />
<Route exact path="/run/:rom" component={RunPage} />
<Route path="/" render={this.recordPageview} />
</div>
</BrowserRouter>
);
}
recordPageview = ({location}) => {
GoogleAnalytics.pageview(location.pathname);
return null;
};
}
export default App;
| import React, { Component } from "react";
import GoogleAnalytics from "react-ga";
import { BrowserRouter, Route } from "react-router-dom";
import ListPage from "./ListPage";
import RunPage from "./RunPage";
import config from "./config";
import "./App.css";
class App extends Component {
constructor(props) {
super(props);
if (config.GOOGLE_ANALYTICS_CODE) {
GoogleAnalytics.initialize(config.GOOGLE_ANALYTICS_CODE);
}
}
render() {
return (
<BrowserRouter>
<div className="App">
<Route exact path="/" component={ListPage} />
<Route exact path="/run" component={RunPage} />
<Route exact path="/run/:rom" component={RunPage} />
<Route path="/" render={this.recordPageview} />
</div>
</BrowserRouter>
);
}
recordPageview = ({location}) => {
GoogleAnalytics.pageview(location.pathname);
return null;
};
}
export default App;
| Add route for drag & drop ROMs | Add route for drag & drop ROMs
| JSX | apache-2.0 | bfirsh/jsnes-web,bfirsh/jsnes-web | jsx | ## Code Before:
import React, { Component } from "react";
import GoogleAnalytics from "react-ga";
import { BrowserRouter, Route } from "react-router-dom";
import ListPage from "./ListPage";
import RunPage from "./RunPage";
import config from "./config";
import "./App.css";
class App extends Component {
constructor(props) {
super(props);
if (config.GOOGLE_ANALYTICS_CODE) {
GoogleAnalytics.initialize(config.GOOGLE_ANALYTICS_CODE);
}
}
render() {
return (
<BrowserRouter>
<div className="App">
<Route exact path="/" component={ListPage} />
<Route exact path="/run/:rom" component={RunPage} />
<Route path="/" render={this.recordPageview} />
</div>
</BrowserRouter>
);
}
recordPageview = ({location}) => {
GoogleAnalytics.pageview(location.pathname);
return null;
};
}
export default App;
## Instruction:
Add route for drag & drop ROMs
## Code After:
import React, { Component } from "react";
import GoogleAnalytics from "react-ga";
import { BrowserRouter, Route } from "react-router-dom";
import ListPage from "./ListPage";
import RunPage from "./RunPage";
import config from "./config";
import "./App.css";
class App extends Component {
constructor(props) {
super(props);
if (config.GOOGLE_ANALYTICS_CODE) {
GoogleAnalytics.initialize(config.GOOGLE_ANALYTICS_CODE);
}
}
render() {
return (
<BrowserRouter>
<div className="App">
<Route exact path="/" component={ListPage} />
<Route exact path="/run" component={RunPage} />
<Route exact path="/run/:rom" component={RunPage} />
<Route path="/" render={this.recordPageview} />
</div>
</BrowserRouter>
);
}
recordPageview = ({location}) => {
GoogleAnalytics.pageview(location.pathname);
return null;
};
}
export default App;
|
90247df35d3e6c006a45a980c7284eebb95b82cf | .github/workflows/release-demo-functions.yaml | .github/workflows/release-demo-functions.yaml | name: release-demo-functions
on:
push:
tags:
- release-demo-functions-*
jobs:
e2e-ci:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v1
- name: Set up gcloud
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
with:
version: '275.0.0'
service_account_email: ${{ secrets.GCP_SA_EMAIL }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://npm.pkg.github.com'
- name: Install NPM packages
run: |
cd ts/demo-functions
npm ci
envsubst < $NPM_CONFIG_USERCONFIG > .npmrc
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build docker images
run: |
cd ts/demo-functions
npm run kpt:docker-build -- --tag=latest
- name: Run e2e tests
run: |
npm install -g bats
TAG=latest bats tests/e2e.bats
- name: Push docker images
run: |
cd ts/demo-functions
npm run kpt:docker-push -- --tag=latest
| name: release-demo-functions
on:
push:
tags:
- release-demo-functions-*
jobs:
e2e-ci:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v1
- name: Set up gcloud
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
with:
version: '275.0.0'
service_account_email: ${{ secrets.GCP_SA_EMAIL }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
- run: gcloud auth configure-docker
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://npm.pkg.github.com'
- name: Install NPM packages
run: |
cd ts/demo-functions
npm ci
npm test
envsubst < $NPM_CONFIG_USERCONFIG > .npmrc
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build docker images
run: |
cd ts/demo-functions
npm run kpt:docker-build -- --tag=latest
- name: Run e2e tests
run: |
npm install -g bats
TAG=latest bats tests/e2e.bats
- name: Push docker images
run: |
cd ts/demo-functions
npm run kpt:docker-push -- --tag=latest
| Use gcloud to configure docker during release | Use gcloud to configure docker during release | YAML | apache-2.0 | GoogleContainerTools/kpt-functions-sdk,GoogleContainerTools/kpt-functions-sdk,GoogleContainerTools/kpt-functions-sdk,GoogleContainerTools/kpt-functions-sdk | yaml | ## Code Before:
name: release-demo-functions
on:
push:
tags:
- release-demo-functions-*
jobs:
e2e-ci:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v1
- name: Set up gcloud
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
with:
version: '275.0.0'
service_account_email: ${{ secrets.GCP_SA_EMAIL }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://npm.pkg.github.com'
- name: Install NPM packages
run: |
cd ts/demo-functions
npm ci
envsubst < $NPM_CONFIG_USERCONFIG > .npmrc
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build docker images
run: |
cd ts/demo-functions
npm run kpt:docker-build -- --tag=latest
- name: Run e2e tests
run: |
npm install -g bats
TAG=latest bats tests/e2e.bats
- name: Push docker images
run: |
cd ts/demo-functions
npm run kpt:docker-push -- --tag=latest
## Instruction:
Use gcloud to configure docker during release
## Code After:
name: release-demo-functions
on:
push:
tags:
- release-demo-functions-*
jobs:
e2e-ci:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v1
- name: Set up gcloud
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
with:
version: '275.0.0'
service_account_email: ${{ secrets.GCP_SA_EMAIL }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
- run: gcloud auth configure-docker
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://npm.pkg.github.com'
- name: Install NPM packages
run: |
cd ts/demo-functions
npm ci
npm test
envsubst < $NPM_CONFIG_USERCONFIG > .npmrc
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build docker images
run: |
cd ts/demo-functions
npm run kpt:docker-build -- --tag=latest
- name: Run e2e tests
run: |
npm install -g bats
TAG=latest bats tests/e2e.bats
- name: Push docker images
run: |
cd ts/demo-functions
npm run kpt:docker-push -- --tag=latest
|
e9046cd448f57d035c9891dd40746b993cb0ec67 | app/scripts/modules/payments/components/payment-create.jsx | app/scripts/modules/payments/components/payment-create.jsx | 'use strict';
var React = require('react');
var PaymentHistory = React.createClass({
componentDidMount: function() {
this.props.model.on('change', function() {
// ???
});
},
componentWillUnmout: function() {
this.props.model.off('change');
},
render: function() {
return ();
}
});
module.exports = PaymentHistory;
| 'use strict';
var React = require('react');
var Navigation = require('react-router').Navigation;
var Input = require('react-bootstrap').Input;
var Button = require('react-bootstrap').Button;
var paymentActions = require('../actions');
var PaymentHistory = React.createClass({
mixins: [Navigation],
formatInput: function(rawInputRef, type) {
var formattedInput = rawInputRef.getValue().trim();
return type === 'number' ? formattedInput * 1 : formattedInput;
},
handleSubmit: function(e) {
e.preventDefault();
var payment = {
address: this.formatInput(this.refs.address, 'string'),
amount: this.formatInput(this.refs.amount, 'number'),
currency: this.formatInput(this.refs.currency, 'string'),
destinationTag: this.formatInput(this.refs.destinationTag, 'number') || null,
sourceTag: this.formatInput(this.refs.sourceTag, 'number') || null, // not implemented yet
invoiceId: this.formatInput(this.refs.invoiceId, 'string') || null, // not implemented yet
memo: this.formatInput(this.refs.memo, 'string') || null // not implemented yet
};
paymentActions.sendPayment(payment);
},
componentDidMount: function() {
var _this = this;
this.props.model.on('sync', function() {
_this.transitionTo('/payments/outgoing');
});
this.props.model.on('addNewSentPayment', function(payment) {
paymentActions.addNewSentPayment(payment);
});
},
render: function() {
return (
<div>
<h2>Send Payment</h2>
<form onSubmit={this.handleSubmit}>
<Input type="text" ref="address" label="Destination Address:" required />
<Input type="text" ref="destinationTag" label="Destination Tag:" />
<Input type="text" ref="sourceTag" label="Source Tag:" />
<Input type="text" ref="invoiceId" label="Invoice Id:" />
<Input type="text" ref="amount" label="Amount:" required />
<Input type="text" ref="currency" label="Currency:" required />
<Input type="textarea" ref="memo" label="Memo:" />
<Button bsStyle="primary" type="submit">Submit Payment</Button>
</form>
</div>
);
}
});
module.exports = PaymentHistory;
| Create form for sending payments | [TASK] Create form for sending payments
| JSX | isc | dabibbit/dream-stack-seed,dabibbit/dream-stack-seed | jsx | ## Code Before:
'use strict';
var React = require('react');
var PaymentHistory = React.createClass({
componentDidMount: function() {
this.props.model.on('change', function() {
// ???
});
},
componentWillUnmout: function() {
this.props.model.off('change');
},
render: function() {
return ();
}
});
module.exports = PaymentHistory;
## Instruction:
[TASK] Create form for sending payments
## Code After:
'use strict';
var React = require('react');
var Navigation = require('react-router').Navigation;
var Input = require('react-bootstrap').Input;
var Button = require('react-bootstrap').Button;
var paymentActions = require('../actions');
var PaymentHistory = React.createClass({
mixins: [Navigation],
formatInput: function(rawInputRef, type) {
var formattedInput = rawInputRef.getValue().trim();
return type === 'number' ? formattedInput * 1 : formattedInput;
},
handleSubmit: function(e) {
e.preventDefault();
var payment = {
address: this.formatInput(this.refs.address, 'string'),
amount: this.formatInput(this.refs.amount, 'number'),
currency: this.formatInput(this.refs.currency, 'string'),
destinationTag: this.formatInput(this.refs.destinationTag, 'number') || null,
sourceTag: this.formatInput(this.refs.sourceTag, 'number') || null, // not implemented yet
invoiceId: this.formatInput(this.refs.invoiceId, 'string') || null, // not implemented yet
memo: this.formatInput(this.refs.memo, 'string') || null // not implemented yet
};
paymentActions.sendPayment(payment);
},
componentDidMount: function() {
var _this = this;
this.props.model.on('sync', function() {
_this.transitionTo('/payments/outgoing');
});
this.props.model.on('addNewSentPayment', function(payment) {
paymentActions.addNewSentPayment(payment);
});
},
render: function() {
return (
<div>
<h2>Send Payment</h2>
<form onSubmit={this.handleSubmit}>
<Input type="text" ref="address" label="Destination Address:" required />
<Input type="text" ref="destinationTag" label="Destination Tag:" />
<Input type="text" ref="sourceTag" label="Source Tag:" />
<Input type="text" ref="invoiceId" label="Invoice Id:" />
<Input type="text" ref="amount" label="Amount:" required />
<Input type="text" ref="currency" label="Currency:" required />
<Input type="textarea" ref="memo" label="Memo:" />
<Button bsStyle="primary" type="submit">Submit Payment</Button>
</form>
</div>
);
}
});
module.exports = PaymentHistory;
|
e1eb1ac412fa33ef9f895ec6bf21b1743cb2c75e | config/initializers/marshal_autoloader.rb | config/initializers/marshal_autoloader.rb | module Marshal
def self.load_with_autoload_missing_constants(data)
load_without_autoload_missing_constants(data)
rescue ArgumentError => error
if error.to_s.include?('undefined class')
begin
error.to_s.split.last.constantize
rescue NameError
raise error
end
retry
end
raise error
end
class << self
alias_method_chain :load, :autoload_missing_constants
end
end
| module MarshalAutoloader
def load(data)
super
rescue ArgumentError => error
if error.to_s.include?('undefined class')
begin
error.to_s.split.last.constantize
rescue NameError
raise error
end
retry
end
raise error
end
end
module Marshal
class << self
prepend MarshalAutoloader
end
end
| Use prepend instead of alias_method_chain | Use prepend instead of alias_method_chain
| Ruby | apache-2.0 | fbladilo/manageiq,tinaafitz/manageiq,NaNi-Z/manageiq,billfitzgerald0120/manageiq,romaintb/manageiq,ManageIQ/manageiq,djberg96/manageiq,gmcculloug/manageiq,josejulio/manageiq,romaintb/manageiq,syncrou/manageiq,mzazrivec/manageiq,ilackarms/manageiq,billfitzgerald0120/manageiq,djberg96/manageiq,maas-ufcg/manageiq,d-m-u/manageiq,NickLaMuro/manageiq,maas-ufcg/manageiq,billfitzgerald0120/manageiq,romanblanco/manageiq,borod108/manageiq,jvlcek/manageiq,syncrou/manageiq,borod108/manageiq,ilackarms/manageiq,chessbyte/manageiq,syncrou/manageiq,branic/manageiq,fbladilo/manageiq,matobet/manageiq,romaintb/manageiq,mzazrivec/manageiq,mkanoor/manageiq,andyvesel/manageiq,lpichler/manageiq,maas-ufcg/manageiq,agrare/manageiq,yaacov/manageiq,jameswnl/manageiq,agrare/manageiq,yaacov/manageiq,ailisp/manageiq,durandom/manageiq,durandom/manageiq,lpichler/manageiq,jrafanie/manageiq,yaacov/manageiq,maas-ufcg/manageiq,kbrock/manageiq,juliancheal/manageiq,maas-ufcg/manageiq,ManageIQ/manageiq,KevinLoiseau/manageiq,mkanoor/manageiq,yaacov/manageiq,chessbyte/manageiq,NickLaMuro/manageiq,jntullo/manageiq,tinaafitz/manageiq,kbrock/manageiq,chessbyte/manageiq,pkomanek/manageiq,juliancheal/manageiq,ailisp/manageiq,d-m-u/manageiq,NickLaMuro/manageiq,gerikis/manageiq,ManageIQ/manageiq,tinaafitz/manageiq,mfeifer/manageiq,djberg96/manageiq,borod108/manageiq,KevinLoiseau/manageiq,jrafanie/manageiq,romanblanco/manageiq,jameswnl/manageiq,jntullo/manageiq,lpichler/manageiq,KevinLoiseau/manageiq,tzumainn/manageiq,NaNi-Z/manageiq,agrare/manageiq,josejulio/manageiq,jvlcek/manageiq,mkanoor/manageiq,jrafanie/manageiq,aufi/manageiq,mresti/manageiq,israel-hdez/manageiq,chessbyte/manageiq,tinaafitz/manageiq,hstastna/manageiq,maas-ufcg/manageiq,mzazrivec/manageiq,hstastna/manageiq,d-m-u/manageiq,kbrock/manageiq,pkomanek/manageiq,gmcculloug/manageiq,branic/manageiq,juliancheal/manageiq,hstastna/manageiq,gmcculloug/manageiq,matobet/manageiq,aufi/manageiq,jameswnl/manageiq,josejulio/manageiq,ilackarms/manageiq,tzumainn/manageiq,durandom/manageiq,romaintb/manageiq,NaNi-Z/manageiq,skateman/manageiq,romaintb/manageiq,tzumainn/manageiq,syncrou/manageiq,fbladilo/manageiq,mresti/manageiq,mfeifer/manageiq,KevinLoiseau/manageiq,lpichler/manageiq,jvlcek/manageiq,borod108/manageiq,skateman/manageiq,romanblanco/manageiq,jntullo/manageiq,kbrock/manageiq,tzumainn/manageiq,gmcculloug/manageiq,pkomanek/manageiq,jameswnl/manageiq,israel-hdez/manageiq,aufi/manageiq,ilackarms/manageiq,jrafanie/manageiq,pkomanek/manageiq,jvlcek/manageiq,romanblanco/manageiq,durandom/manageiq,agrare/manageiq,djberg96/manageiq,gerikis/manageiq,juliancheal/manageiq,andyvesel/manageiq,matobet/manageiq,israel-hdez/manageiq,branic/manageiq,josejulio/manageiq,billfitzgerald0120/manageiq,matobet/manageiq,branic/manageiq,aufi/manageiq,mfeifer/manageiq,mzazrivec/manageiq,israel-hdez/manageiq,skateman/manageiq,andyvesel/manageiq,gerikis/manageiq,mresti/manageiq,mfeifer/manageiq,ailisp/manageiq,fbladilo/manageiq,NaNi-Z/manageiq,andyvesel/manageiq,romaintb/manageiq,mkanoor/manageiq,hstastna/manageiq,ManageIQ/manageiq,jntullo/manageiq,skateman/manageiq,gerikis/manageiq,mresti/manageiq,KevinLoiseau/manageiq,KevinLoiseau/manageiq,NickLaMuro/manageiq,ailisp/manageiq,d-m-u/manageiq | ruby | ## Code Before:
module Marshal
def self.load_with_autoload_missing_constants(data)
load_without_autoload_missing_constants(data)
rescue ArgumentError => error
if error.to_s.include?('undefined class')
begin
error.to_s.split.last.constantize
rescue NameError
raise error
end
retry
end
raise error
end
class << self
alias_method_chain :load, :autoload_missing_constants
end
end
## Instruction:
Use prepend instead of alias_method_chain
## Code After:
module MarshalAutoloader
def load(data)
super
rescue ArgumentError => error
if error.to_s.include?('undefined class')
begin
error.to_s.split.last.constantize
rescue NameError
raise error
end
retry
end
raise error
end
end
module Marshal
class << self
prepend MarshalAutoloader
end
end
|
909f993be317a1c85d4cca69bc5f31e46d2a6f90 | .travis.yml | .travis.yml | language: php
php:
- 5.3.3
- 5.3
- 5.4
- 5.5
- 5.6
- hhvm
- hhvm-nightly
matrix:
allow_failures:
- php: hhvm
- php: hhvm-nightly
- php: 5.6
before_script:
- composer update --prefer-source
script:
- vendor/bin/php-cs-fixer fix src --dry-run -v
- mkdir -p build/logs
- ./vendor/bin/phpunit -c travis.phpunit.xml --coverage-clover build/logs/clover.xml
after_script:
- php vendor/bin/coveralls -v
| language: php
php:
- 5.3
- 5.4
- 5.5
- 5.6
- hhvm
- hhvm-nightly
matrix:
allow_failures:
- php: hhvm
- php: hhvm-nightly
- php: 5.6
before_script:
- composer update --prefer-source
script:
- vendor/bin/php-cs-fixer fix src --dry-run -v
- mkdir -p build/logs
- ./vendor/bin/phpunit -c travis.phpunit.xml --coverage-clover build/logs/clover.xml
after_script:
- php vendor/bin/coveralls -v
| Remove PHP 5.3.3 check (since ZF also need 5.3.23) | Remove PHP 5.3.3 check (since ZF also need 5.3.23) | YAML | mit | zfc-datagrid/zfc-datagrid,kokspflanze/ZfcDatagrid,kokspflanze/ZfcDatagrid,FraGoTe/ZfcDatagrid,weckx/ZfcDatagrid,zfc-datagrid/zfc-datagrid,ThaDafinser/ZfcDatagrid,weckx/ZfcDatagrid,ThaDafinser/ZfcDatagrid,FraGoTe/ZfcDatagrid | yaml | ## Code Before:
language: php
php:
- 5.3.3
- 5.3
- 5.4
- 5.5
- 5.6
- hhvm
- hhvm-nightly
matrix:
allow_failures:
- php: hhvm
- php: hhvm-nightly
- php: 5.6
before_script:
- composer update --prefer-source
script:
- vendor/bin/php-cs-fixer fix src --dry-run -v
- mkdir -p build/logs
- ./vendor/bin/phpunit -c travis.phpunit.xml --coverage-clover build/logs/clover.xml
after_script:
- php vendor/bin/coveralls -v
## Instruction:
Remove PHP 5.3.3 check (since ZF also need 5.3.23)
## Code After:
language: php
php:
- 5.3
- 5.4
- 5.5
- 5.6
- hhvm
- hhvm-nightly
matrix:
allow_failures:
- php: hhvm
- php: hhvm-nightly
- php: 5.6
before_script:
- composer update --prefer-source
script:
- vendor/bin/php-cs-fixer fix src --dry-run -v
- mkdir -p build/logs
- ./vendor/bin/phpunit -c travis.phpunit.xml --coverage-clover build/logs/clover.xml
after_script:
- php vendor/bin/coveralls -v
|
0c8f75f03020c53bcf4c6be258faf433d24b2c2b | lib/multi_json/adapters/oj.rb | lib/multi_json/adapters/oj.rb | require 'oj' unless defined?(::Oj)
module MultiJson
module Adapters
# Use the Oj library to dump/load.
class Oj
ParseError = SyntaxError
::Oj.default_options = {:mode => :compat}
def self.load(string, options={}) #:nodoc:
::Oj.load(string, :symbol_keys => options[:symbolize_keys])
end
def self.dump(object, options={}) #:nodoc:
::Oj.dump(object, options)
end
end
end
end
| require 'oj' unless defined?(::Oj)
module MultiJson
module Adapters
# Use the Oj library to dump/load.
class Oj
ParseError = SyntaxError
::Oj.default_options = {:mode => :compat}
def self.load(string, options={}) #:nodoc:
::Oj.load(string, :symbol_keys => options[:symbolize_keys])
end
def self.dump(object, options={}) #:nodoc:
options.merge!(:indent => 2) if options[:pretty] || options['pretty']
::Oj.dump(object, options)
end
end
end
end
| Add pretty support to Oj adapter | Add pretty support to Oj adapter
Fixes #51.
| Ruby | mit | intridea/multi_json | ruby | ## Code Before:
require 'oj' unless defined?(::Oj)
module MultiJson
module Adapters
# Use the Oj library to dump/load.
class Oj
ParseError = SyntaxError
::Oj.default_options = {:mode => :compat}
def self.load(string, options={}) #:nodoc:
::Oj.load(string, :symbol_keys => options[:symbolize_keys])
end
def self.dump(object, options={}) #:nodoc:
::Oj.dump(object, options)
end
end
end
end
## Instruction:
Add pretty support to Oj adapter
Fixes #51.
## Code After:
require 'oj' unless defined?(::Oj)
module MultiJson
module Adapters
# Use the Oj library to dump/load.
class Oj
ParseError = SyntaxError
::Oj.default_options = {:mode => :compat}
def self.load(string, options={}) #:nodoc:
::Oj.load(string, :symbol_keys => options[:symbolize_keys])
end
def self.dump(object, options={}) #:nodoc:
options.merge!(:indent => 2) if options[:pretty] || options['pretty']
::Oj.dump(object, options)
end
end
end
end
|
e61bc8e29f3061e7356ff9fd2b16c8d901d1b5ce | actionpack/test/template/safe_buffer_test.rb | actionpack/test/template/safe_buffer_test.rb | require 'abstract_unit'
class SafeBufferTest < ActionView::TestCase
def setup
@buffer = ActionView::SafeBuffer.new
end
test "Should look like a string" do
assert @buffer.is_a?(String)
assert_equal "", @buffer
end
test "Should escape a raw string which is passed to them" do
@buffer << "<script>"
assert_equal "<script>", @buffer
end
test "Should NOT escape a safe value passed to it" do
@buffer << "<script>".html_safe!
assert_equal "<script>", @buffer
end
test "Should not mess with an innocuous string" do
@buffer << "Hello"
assert_equal "Hello", @buffer
end
test "Should not mess with a previously escape test" do
@buffer << CGI.escapeHTML("<script>")
assert_equal "<script>", @buffer
end
test "Should be considered safe" do
assert @buffer.html_safe?
end
test "Should return a safe buffer when calling to_s" do
new_buffer = @buffer.to_s
assert_equal ActionView::SafeBuffer, new_buffer.class
end
end
| require 'abstract_unit'
class SafeBufferTest < ActionView::TestCase
def setup
@buffer = ActionView::SafeBuffer.new
end
test "Should look like a string" do
assert @buffer.is_a?(String)
assert_equal "", @buffer
end
test "Should escape a raw string which is passed to them" do
@buffer << "<script>"
assert_equal "<script>", @buffer
end
test "Should NOT escape a safe value passed to it" do
@buffer << "<script>".html_safe!
assert_equal "<script>", @buffer
end
test "Should not mess with an innocuous string" do
@buffer << "Hello"
assert_equal "Hello", @buffer
end
test "Should not mess with a previously escape test" do
@buffer << ERB::Util.html_escape("<script>")
assert_equal "<script>", @buffer
end
test "Should be considered safe" do
assert @buffer.html_safe?
end
test "Should return a safe buffer when calling to_s" do
new_buffer = @buffer.to_s
assert_equal ActionView::SafeBuffer, new_buffer.class
end
end
| Fix failing safe buffer test. We don't patch CGI.escapeHTML, only ERB:Util. | Fix failing safe buffer test. We don't patch CGI.escapeHTML, only ERB:Util.
| Ruby | mit | flanger001/rails,mtsmfm/rails,tgxworld/rails,notapatch/rails,elfassy/rails,lcreid/rails,ngpestelos/rails,jeremy/rails,illacceptanything/illacceptanything,brchristian/rails,illacceptanything/illacceptanything,ngpestelos/rails,bolek/rails,mtsmfm/rails,samphilipd/rails,tijwelch/rails,gfvcastro/rails,tgxworld/rails,Envek/rails,rafaelfranca/omg-rails,kmcphillips/rails,travisofthenorth/rails,hanystudy/rails,arunagw/rails,Sen-Zhang/rails,gcourtemanche/rails,rails/rails,mechanicles/rails,Edouard-chin/rails,repinel/rails,utilum/rails,assain/rails,88rabbit/newRails,travisofthenorth/rails,amoody2108/TechForJustice,kaspth/rails,rails/rails,georgeclaghorn/rails,kenta-s/rails,illacceptanything/illacceptanything,mijoharas/rails,gfvcastro/rails,kmayer/rails,vassilevsky/rails,hanystudy/rails,iainbeeston/rails,utilum/rails,shioyama/rails,Stellenticket/rails,elfassy/rails,yhirano55/rails,voray/rails,illacceptanything/illacceptanything,eileencodes/rails,starknx/rails,Stellenticket/rails,yawboakye/rails,notapatch/rails,kachick/rails,Vasfed/rails,matrinox/rails,mtsmfm/railstest,pschambacher/rails,rossta/rails,georgeclaghorn/rails,notapatch/rails,palkan/rails,yasslab/railsguides.jp,BlakeWilliams/rails,deraru/rails,riseshia/railsguides.kr,joonyou/rails,yalab/rails,illacceptanything/illacceptanything,printercu/rails,kmayer/rails,MSP-Greg/rails,fabianoleittes/rails,georgeclaghorn/rails,arjes/rails,joonyou/rails,hanystudy/rails,arunagw/rails,EmmaB/rails-1,yasslab/railsguides.jp,iainbeeston/rails,yahonda/rails,sealocal/rails,BlakeWilliams/rails,bradleypriest/rails,yalab/rails,gavingmiller/rails,mathieujobin/reduced-rails-for-travis,ttanimichi/rails,kmayer/rails,Envek/rails,aditya-kapoor/rails,kirs/rails-1,marklocklear/rails,arjes/rails,kddeisz/rails,Erol/rails,gfvcastro/rails,jeremy/rails,koic/rails,schuetzm/rails,felipecvo/rails,MichaelSp/rails,matrinox/rails,xlymian/rails,esparta/rails,gauravtiwari/rails,palkan/rails,pvalena/rails,betesh/rails,rafaelfranca/omg-rails,rossta/rails,deraru/rails,lucasmazza/rails,shioyama/rails,marklocklear/rails,betesh/rails,prathamesh-sonpatki/rails,vipulnsward/rails,flanger001/rails,lcreid/rails,tjschuck/rails,stefanmb/rails,illacceptanything/illacceptanything,bogdanvlviv/rails,stefanmb/rails,mijoharas/rails,lcreid/rails,untidy-hair/rails,ledestin/rails,mohitnatoo/rails,maicher/rails,joonyou/rails,lcreid/rails,gcourtemanche/rails,tgxworld/rails,printercu/rails,Envek/rails,Stellenticket/rails,lucasmazza/rails,illacceptanything/illacceptanything,coreyward/rails,rafaelfranca/omg-rails,baerjam/rails,yasslab/railsguides.jp,bradleypriest/rails,yawboakye/rails,kamipo/rails,mathieujobin/reduced-rails-for-travis,gauravtiwari/rails,pvalena/rails,kmcphillips/rails,baerjam/rails,Spin42/rails,gavingmiller/rails,mechanicles/rails,eileencodes/rails,maicher/rails,EmmaB/rails-1,elfassy/rails,betesh/rails,fabianoleittes/rails,vipulnsward/rails,georgeclaghorn/rails,prathamesh-sonpatki/rails,iainbeeston/rails,printercu/rails,felipecvo/rails,kaspth/rails,kirs/rails-1,iainbeeston/rails,kddeisz/rails,palkan/rails,Edouard-chin/rails,EmmaB/rails-1,ttanimichi/rails,utilum/rails,maicher/rails,deraru/rails,voray/rails,mtsmfm/railstest,riseshia/railsguides.kr,tjschuck/rails,aditya-kapoor/rails,koic/rails,alecspopa/rails,gfvcastro/rails,Vasfed/rails,gcourtemanche/rails,koic/rails,yawboakye/rails,assain/rails,rails/rails,kaspth/rails,MSP-Greg/rails,palkan/rails,coreyward/rails,MSP-Greg/rails,arunagw/rails,richseviora/rails,lucasmazza/rails,tjschuck/rails,jeremy/rails,mechanicles/rails,aditya-kapoor/rails,sergey-alekseev/rails,illacceptanything/illacceptanything,schuetzm/rails,Erol/rails,eileencodes/rails,yahonda/rails,kddeisz/rails,mathieujobin/reduced-rails-for-travis,bolek/rails,fabianoleittes/rails,eileencodes/rails,esparta/rails,pschambacher/rails,starknx/rails,Edouard-chin/rails,kamipo/rails,illacceptanything/illacceptanything,joonyou/rails,baerjam/rails,matrinox/rails,mijoharas/rails,rossta/rails,schuetzm/rails,fabianoleittes/rails,MichaelSp/rails,shioyama/rails,prathamesh-sonpatki/rails,deraru/rails,rbhitchcock/rails,odedniv/rails,Edouard-chin/rails,schuetzm/rails,mtsmfm/railstest,yhirano55/rails,Stellenticket/rails,baerjam/rails,arunagw/rails,xlymian/rails,esparta/rails,yahonda/rails,Spin42/rails,bogdanvlviv/rails,Erol/rails,Erol/rails,pvalena/rails,utilum/rails,repinel/rails,BlakeWilliams/rails,brchristian/rails,gauravtiwari/rails,yhirano55/rails,printercu/rails,riseshia/railsguides.kr,ttanimichi/rails,Sen-Zhang/rails,xlymian/rails,illacceptanything/illacceptanything,yalab/rails,yasslab/railsguides.jp,kenta-s/rails,illacceptanything/illacceptanything,vipulnsward/rails,marklocklear/rails,jeremy/rails,assain/rails,repinel/rails,travisofthenorth/rails,MichaelSp/rails,vipulnsward/rails,pvalena/rails,untidy-hair/rails,Vasfed/rails,odedniv/rails,mohitnatoo/rails,alecspopa/rails,kenta-s/rails,aditya-kapoor/rails,ngpestelos/rails,amoody2108/TechForJustice,prathamesh-sonpatki/rails,samphilipd/rails,vassilevsky/rails,riseshia/railsguides.kr,kmcphillips/rails,ledestin/rails,felipecvo/rails,kirs/rails-1,Vasfed/rails,pschambacher/rails,mtsmfm/rails,88rabbit/newRails,sealocal/rails,voray/rails,kamipo/rails,esparta/rails,sealocal/rails,bogdanvlviv/rails,kachick/rails,odedniv/rails,shioyama/rails,yahonda/rails,bolek/rails,flanger001/rails,mechanicles/rails,mohitnatoo/rails,sergey-alekseev/rails,Envek/rails,illacceptanything/illacceptanything,illacceptanything/illacceptanything,Spin42/rails,gavingmiller/rails,illacceptanything/illacceptanything,richseviora/rails,rbhitchcock/rails,BlakeWilliams/rails,rails/rails,yalab/rails,88rabbit/newRails,kmcphillips/rails,brchristian/rails,illacceptanything/illacceptanything,Sen-Zhang/rails,tijwelch/rails,tjschuck/rails,assain/rails,amoody2108/TechForJustice,coreyward/rails,richseviora/rails,betesh/rails,alecspopa/rails,notapatch/rails,flanger001/rails,mohitnatoo/rails,yhirano55/rails,samphilipd/rails,sergey-alekseev/rails,tijwelch/rails,rbhitchcock/rails,tgxworld/rails,yawboakye/rails,kachick/rails,kddeisz/rails,stefanmb/rails,bradleypriest/rails,arjes/rails,MSP-Greg/rails,starknx/rails,repinel/rails,vassilevsky/rails,ledestin/rails,untidy-hair/rails,travisofthenorth/rails,untidy-hair/rails,bogdanvlviv/rails | ruby | ## Code Before:
require 'abstract_unit'
class SafeBufferTest < ActionView::TestCase
def setup
@buffer = ActionView::SafeBuffer.new
end
test "Should look like a string" do
assert @buffer.is_a?(String)
assert_equal "", @buffer
end
test "Should escape a raw string which is passed to them" do
@buffer << "<script>"
assert_equal "<script>", @buffer
end
test "Should NOT escape a safe value passed to it" do
@buffer << "<script>".html_safe!
assert_equal "<script>", @buffer
end
test "Should not mess with an innocuous string" do
@buffer << "Hello"
assert_equal "Hello", @buffer
end
test "Should not mess with a previously escape test" do
@buffer << CGI.escapeHTML("<script>")
assert_equal "<script>", @buffer
end
test "Should be considered safe" do
assert @buffer.html_safe?
end
test "Should return a safe buffer when calling to_s" do
new_buffer = @buffer.to_s
assert_equal ActionView::SafeBuffer, new_buffer.class
end
end
## Instruction:
Fix failing safe buffer test. We don't patch CGI.escapeHTML, only ERB:Util.
## Code After:
require 'abstract_unit'
class SafeBufferTest < ActionView::TestCase
def setup
@buffer = ActionView::SafeBuffer.new
end
test "Should look like a string" do
assert @buffer.is_a?(String)
assert_equal "", @buffer
end
test "Should escape a raw string which is passed to them" do
@buffer << "<script>"
assert_equal "<script>", @buffer
end
test "Should NOT escape a safe value passed to it" do
@buffer << "<script>".html_safe!
assert_equal "<script>", @buffer
end
test "Should not mess with an innocuous string" do
@buffer << "Hello"
assert_equal "Hello", @buffer
end
test "Should not mess with a previously escape test" do
@buffer << ERB::Util.html_escape("<script>")
assert_equal "<script>", @buffer
end
test "Should be considered safe" do
assert @buffer.html_safe?
end
test "Should return a safe buffer when calling to_s" do
new_buffer = @buffer.to_s
assert_equal ActionView::SafeBuffer, new_buffer.class
end
end
|
586ed8350562a4aefc3b43b3a1bfac5e0b9f3322 | app/views/layouts/comfy/admin/cms/_body.html.haml | app/views/layouts/comfy/admin/cms/_body.html.haml | %body#comfy.theme.theme--cms{:class => "c-#{params[:controller].slugify} a-#{params[:action].slugify}"}
.l-app
= render 'comfy/admin/cms/partials/body_before'
= render :partial => 'layouts/comfy/admin/cms/nav_main'
= render :partial => 'layouts/comfy/admin/cms/nav_secondary'
/ = render :partial => 'layouts/comfy/admin/cms/right'
= render :partial => 'layouts/comfy/admin/cms/main'
= render :partial => 'layouts/comfy/admin/cms/footer'
= render :partial => 'layouts/comfy/admin/cms/footer_js'
| %body#comfy.theme.theme--cms{:class => "c-#{params[:controller].slugify} a-#{params[:action].slugify} lang-#{@site.label}"}
.l-app
= render 'comfy/admin/cms/partials/body_before'
= render :partial => 'layouts/comfy/admin/cms/nav_main'
= render :partial => 'layouts/comfy/admin/cms/nav_secondary'
/ = render :partial => 'layouts/comfy/admin/cms/right'
= render :partial => 'layouts/comfy/admin/cms/main'
= render :partial => 'layouts/comfy/admin/cms/footer'
= render :partial => 'layouts/comfy/admin/cms/footer_js'
| Add lang helper class to body | Add lang helper class to body
| Haml | mit | moneyadviceservice/cms,moneyadviceservice/cms,moneyadviceservice/cms,moneyadviceservice/cms | haml | ## Code Before:
%body#comfy.theme.theme--cms{:class => "c-#{params[:controller].slugify} a-#{params[:action].slugify}"}
.l-app
= render 'comfy/admin/cms/partials/body_before'
= render :partial => 'layouts/comfy/admin/cms/nav_main'
= render :partial => 'layouts/comfy/admin/cms/nav_secondary'
/ = render :partial => 'layouts/comfy/admin/cms/right'
= render :partial => 'layouts/comfy/admin/cms/main'
= render :partial => 'layouts/comfy/admin/cms/footer'
= render :partial => 'layouts/comfy/admin/cms/footer_js'
## Instruction:
Add lang helper class to body
## Code After:
%body#comfy.theme.theme--cms{:class => "c-#{params[:controller].slugify} a-#{params[:action].slugify} lang-#{@site.label}"}
.l-app
= render 'comfy/admin/cms/partials/body_before'
= render :partial => 'layouts/comfy/admin/cms/nav_main'
= render :partial => 'layouts/comfy/admin/cms/nav_secondary'
/ = render :partial => 'layouts/comfy/admin/cms/right'
= render :partial => 'layouts/comfy/admin/cms/main'
= render :partial => 'layouts/comfy/admin/cms/footer'
= render :partial => 'layouts/comfy/admin/cms/footer_js'
|
c2963e7a14999bafa3d1a803ab7c833ee7f59833 | app/src/main/res/values/colors.xml | app/src/main/res/values/colors.xml | <?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#00E676</color>
<color name="colorPrimaryDark">#00C853</color>
<color name="colorAccent">#ffb300</color>
<color name="colorAccentDark">#FFA000</color>
<color name="colorGreyDark">#212121</color>
<color name="colorGreyDarker">#181818</color>
<color name="colorRed">#d50000</color>
</resources>
| <?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#00E676</color>
<color name="colorPrimaryDark">#00C853</color>
<color name="colorAccent">#ffb300</color>
<color name="colorAccentDark">#FFA000</color>
<color name="colorGreyDark">#212121</color>
<color name="colorGreyDarker">#181818</color>
<color name="colorRed">#F44336</color>
<color name="colorRedDark">#E53935</color>
</resources>
| Add color red and red dark | Add color red and red dark
| XML | mit | naijab/nextzytimeline,naijab/nextzytimeline | xml | ## Code Before:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#00E676</color>
<color name="colorPrimaryDark">#00C853</color>
<color name="colorAccent">#ffb300</color>
<color name="colorAccentDark">#FFA000</color>
<color name="colorGreyDark">#212121</color>
<color name="colorGreyDarker">#181818</color>
<color name="colorRed">#d50000</color>
</resources>
## Instruction:
Add color red and red dark
## Code After:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#00E676</color>
<color name="colorPrimaryDark">#00C853</color>
<color name="colorAccent">#ffb300</color>
<color name="colorAccentDark">#FFA000</color>
<color name="colorGreyDark">#212121</color>
<color name="colorGreyDarker">#181818</color>
<color name="colorRed">#F44336</color>
<color name="colorRedDark">#E53935</color>
</resources>
|
47259a936e7e58b0c96c55081e1e3f67c98dffa9 | x3-assignment/x3-assignment-preamble.tex | x3-assignment/x3-assignment-preamble.tex | \documentclass[a4paper,ngerman]{article}
% Make it possible to enable or disable TOC
\newif\ifShowTOC
| \documentclass[a4paper,ngerman]{article}
% Make it possible to enable or disable TOC
\newif\ifShowTOC
% Utility stuff, used, for example, in x3-mmd-compat
% That is why we need to include it here, and not in -begin
\usepackage{etoolbox}
| Use etoolbox, mainly for checking for undefined macros | Use etoolbox, mainly for checking for undefined macros
| TeX | mit | x3ro/x3-latex | tex | ## Code Before:
\documentclass[a4paper,ngerman]{article}
% Make it possible to enable or disable TOC
\newif\ifShowTOC
## Instruction:
Use etoolbox, mainly for checking for undefined macros
## Code After:
\documentclass[a4paper,ngerman]{article}
% Make it possible to enable or disable TOC
\newif\ifShowTOC
% Utility stuff, used, for example, in x3-mmd-compat
% That is why we need to include it here, and not in -begin
\usepackage{etoolbox}
|
8be765427b1a64aace278314b6d9fa97edc47f78 | init/ctrlp.vim | init/ctrlp.vim | let g:ctrlp_max_height = 20
let g:ctrlp_match_window_reversed = 0
let g:ctrlp_dotfiles = 0
" When a file is chosen that's already open in a window, don't jump that
" window.
let g:ctrlp_jump_to_buffer = 0
| let g:ctrlp_max_height = 20
let g:ctrlp_match_window_reversed = 0
let g:ctrlp_dotfiles = 0
| Revert "CtrlP: Don't jump to an existing window with buff." | Revert "CtrlP: Don't jump to an existing window with buff."
This reverts commit a04208df01b7160e993f553ee2e51248fe6b3459.
| VimL | mit | danfinnie/vim-config,compozed/vim-config,pivotalcommon/vim-config,gust/vim-config,miketierney/vim-config,brittlewis12/vim-config,brittlewis12/vim-config,brittlewis12/vim-config,wenzowski/vim-config,mntj/vim,kmarter/vim-config,benliscio/vim,davgomgar/vim-config,LaunchAcademy/vim-config,austenito/vim-config,kmarter/vim-config,evandrewry/.vim,krishicks/casecommons-vim-config,genagain/vim-config,brittlewis12/vim-config,jgeiger/vim-config,miketierney/vim-config,Casecommons/vim-config,diegodesouza/dotfiles,abhisharma2/vim-config,evandrewry/vim-config,micahyoung/vim-config,RetSKU-development/vim-config,mntj/vim,benliscio/vim,buildgroundwork/vim-config,kmarter/vim-config | viml | ## Code Before:
let g:ctrlp_max_height = 20
let g:ctrlp_match_window_reversed = 0
let g:ctrlp_dotfiles = 0
" When a file is chosen that's already open in a window, don't jump that
" window.
let g:ctrlp_jump_to_buffer = 0
## Instruction:
Revert "CtrlP: Don't jump to an existing window with buff."
This reverts commit a04208df01b7160e993f553ee2e51248fe6b3459.
## Code After:
let g:ctrlp_max_height = 20
let g:ctrlp_match_window_reversed = 0
let g:ctrlp_dotfiles = 0
|
c5a2bed3a95d43862a1750e9b8af556cd02268e3 | .ci/install-silo-on-github.sh | .ci/install-silo-on-github.sh | sudo apt update
sudo apt install libsilo-dev
curl -L -O https://wci.llnl.gov/content/assets/docs/simulation/computer-codes/silo/silo-4.10.2/silo-4.10.2-bsd-smalltest.tar.gz
tar xfz silo-4.10.2-bsd-smalltest.tar.gz
sudo cp silo-4.10.2-bsd/src/silo/silo_exports.h /usr/include
sudo chmod a+rX /usr/include/silo_exports.h
| sudo apt update
sudo apt install libsilo-dev
# As of 2021-01-04, the download links at https://wci.llnl.gov/simulation/computer-codes/silo are dead.
curl -L -O https://deb.debian.org/debian/pool/main/s/silo-llnl/silo-llnl_4.10.2.real.orig.tar.xz
tar xfa silo-llnl_4.10.2.real.orig.tar.xz
sudo cp silo-llnl-4.10.2.real/src/silo/silo_exports.h /usr/include
sudo chmod a+rX /usr/include/silo_exports.h
| Fix libsilo download URL for Github CI | Fix libsilo download URL for Github CI | Shell | mit | inducer/pyvisfile,inducer/pyvisfile,inducer/pyvisfile | shell | ## Code Before:
sudo apt update
sudo apt install libsilo-dev
curl -L -O https://wci.llnl.gov/content/assets/docs/simulation/computer-codes/silo/silo-4.10.2/silo-4.10.2-bsd-smalltest.tar.gz
tar xfz silo-4.10.2-bsd-smalltest.tar.gz
sudo cp silo-4.10.2-bsd/src/silo/silo_exports.h /usr/include
sudo chmod a+rX /usr/include/silo_exports.h
## Instruction:
Fix libsilo download URL for Github CI
## Code After:
sudo apt update
sudo apt install libsilo-dev
# As of 2021-01-04, the download links at https://wci.llnl.gov/simulation/computer-codes/silo are dead.
curl -L -O https://deb.debian.org/debian/pool/main/s/silo-llnl/silo-llnl_4.10.2.real.orig.tar.xz
tar xfa silo-llnl_4.10.2.real.orig.tar.xz
sudo cp silo-llnl-4.10.2.real/src/silo/silo_exports.h /usr/include
sudo chmod a+rX /usr/include/silo_exports.h
|
8e06b70a7c711a5ad950222c039d04af92f2341c | tasks/editor.yml | tasks/editor.yml | ---
- name: check Visual Studio Code installed
shell: code -v
register: vscode_check
ignore_errors: true
- name: install Visual Studio Code
apt:
deb: https://vscode-update.azurewebsites.net/latest/linux-deb-x64/stable
become: true
when: vscode_check.rc
- name: install Visual Studio Code extensions
command: "{{ home | quote }}/.config/Code/User/restore"
| ---
- name: add Visual Studio Code repository
apt_repository:
repo: deb [arch=amd64] http://packages.microsoft.com/repos/vscode stable main
become: true
- name: install Visual Studio Code
apt:
name: code
become: true
- name: install Visual Studio Code extensions
command: "{{ home | quote }}/.yadm/vscode/restore"
| Install vscode from microsoft repository | Install vscode from microsoft repository
| YAML | mit | mskrajnowski/dev-setup | yaml | ## Code Before:
---
- name: check Visual Studio Code installed
shell: code -v
register: vscode_check
ignore_errors: true
- name: install Visual Studio Code
apt:
deb: https://vscode-update.azurewebsites.net/latest/linux-deb-x64/stable
become: true
when: vscode_check.rc
- name: install Visual Studio Code extensions
command: "{{ home | quote }}/.config/Code/User/restore"
## Instruction:
Install vscode from microsoft repository
## Code After:
---
- name: add Visual Studio Code repository
apt_repository:
repo: deb [arch=amd64] http://packages.microsoft.com/repos/vscode stable main
become: true
- name: install Visual Studio Code
apt:
name: code
become: true
- name: install Visual Studio Code extensions
command: "{{ home | quote }}/.yadm/vscode/restore"
|
496bb8c672b22ce832c887ad255246ae15fbf2cc | challenge-0020.cpp | challenge-0020.cpp |
int main(int argc, char ** argv)
{
std::ifstream input{argv[1]};
std::string line;
std::getline(input, line);
while(input)
{
std::for_each(std::begin(line), std::end(line), [](char c) {
std::cout << static_cast<char>(std::tolower(c));
});
std::cout << '\n';
std::getline(input, line);
}
return 0;
}
|
int main(int argc, char ** argv)
{
std::ifstream input{argv[1]};
std::string line;
std::getline(input, line);
while(input)
{
std::transform(std::begin(line), std::end(line), std::begin(line), [](char c) {
return static_cast<char>(std::tolower(c));
});
std::cout << line << '\n';
std::getline(input, line);
}
return 0;
}
| Use transform instead of for_each | Use transform instead of for_each
| C++ | mit | snewell/codeeval,snewell/codeeval | c++ | ## Code Before:
int main(int argc, char ** argv)
{
std::ifstream input{argv[1]};
std::string line;
std::getline(input, line);
while(input)
{
std::for_each(std::begin(line), std::end(line), [](char c) {
std::cout << static_cast<char>(std::tolower(c));
});
std::cout << '\n';
std::getline(input, line);
}
return 0;
}
## Instruction:
Use transform instead of for_each
## Code After:
int main(int argc, char ** argv)
{
std::ifstream input{argv[1]};
std::string line;
std::getline(input, line);
while(input)
{
std::transform(std::begin(line), std::end(line), std::begin(line), [](char c) {
return static_cast<char>(std::tolower(c));
});
std::cout << line << '\n';
std::getline(input, line);
}
return 0;
}
|
f8a670f3ab0e1022206ba5dfaccb85d42609f1d3 | app/io/sphere/sdk/play/metrics/MetricHttpClient.java | app/io/sphere/sdk/play/metrics/MetricHttpClient.java | package io.sphere.sdk.play.metrics;
import io.sphere.sdk.http.HttpClient;
import io.sphere.sdk.http.HttpRequest;
import io.sphere.sdk.http.HttpResponse;
import play.mvc.Http;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.CompletionStage;
public class MetricHttpClient implements HttpClient {
private final HttpClient underlying;
private MetricHttpClient(final HttpClient underlying) {
this.underlying = underlying;
}
@Override
public CompletionStage<HttpResponse> execute(final HttpRequest httpRequest) {
final Optional<Http.Context> contextOptional = Optional.ofNullable(Http.Context.current.get());
final CompletionStage<HttpResponse> result = underlying.execute(httpRequest);
final long startTimestamp = System.currentTimeMillis();
contextOptional.ifPresent(context ->
result.thenAccept(response -> {
final long stopTimestamp = System.currentTimeMillis();
report(context, httpRequest, response, startTimestamp, stopTimestamp);
}));
return result;
}
@SuppressWarnings("unchecked")
private void report(final Http.Context context, final HttpRequest httpRequest, final HttpResponse response, long startTimestamp, long stopTimestamp) {
final List<ReportRawData> data = (List<ReportRawData>) context.args.get(MetricAction.KEY);
data.add(new ReportRawData(httpRequest, response, startTimestamp, stopTimestamp));
}
@Override
public void close() {
underlying.close();
}
public static MetricHttpClient of(final HttpClient underlying) {
return new MetricHttpClient(underlying);
}
} | package io.sphere.sdk.play.metrics;
import io.sphere.sdk.http.HttpClient;
import io.sphere.sdk.http.HttpRequest;
import io.sphere.sdk.http.HttpResponse;
import play.mvc.Http;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.CompletionStage;
public class MetricHttpClient implements HttpClient {
private final HttpClient underlying;
private MetricHttpClient(final HttpClient underlying) {
this.underlying = underlying;
}
@Override
public CompletionStage<HttpResponse> execute(final HttpRequest httpRequest) {
final Optional<Http.Context> contextOptional = Optional.ofNullable(Http.Context.current.get());
final CompletionStage<HttpResponse> result = underlying.execute(httpRequest);
final long startTimestamp = System.currentTimeMillis();
contextOptional.ifPresent(context ->
result.thenAccept(response -> {
final long stopTimestamp = System.currentTimeMillis();
report(context, httpRequest, response, startTimestamp, stopTimestamp);
}));
return result;
}
@SuppressWarnings("unchecked")
private void report(final Http.Context context, final HttpRequest httpRequest, final HttpResponse response, long startTimestamp, long stopTimestamp) {
final Optional<List<ReportRawData>> dataOption = Optional.ofNullable((List<ReportRawData>) context.args.get(MetricAction.KEY));
dataOption.ifPresent(data -> data.add(new ReportRawData(httpRequest, response, startTimestamp, stopTimestamp)));
}
@Override
public void close() {
underlying.close();
}
public static MetricHttpClient of(final HttpClient underlying) {
return new MetricHttpClient(underlying);
}
} | Improve metric http client to deal with missing report data list. | Improve metric http client to deal with missing report data list.
| Java | apache-2.0 | commercetools/commercetools-sunrise-java,sphereio/sphere-sunrise,rfuertesp/pruebas2,sphereio/sphere-sunrise,commercetools/commercetools-sunrise-java,sphereio/sphere-sunrise,commercetools/commercetools-sunrise-java,rfuertesp/pruebas2,sphereio/commercetools-sunrise-java,sphereio/commercetools-sunrise-java,commercetools/commercetools-sunrise-java,rfuertesp/pruebas2,sphereio/sphere-sunrise,rfuertesp/pruebas2,sphereio/commercetools-sunrise-java,sphereio/commercetools-sunrise-java | java | ## Code Before:
package io.sphere.sdk.play.metrics;
import io.sphere.sdk.http.HttpClient;
import io.sphere.sdk.http.HttpRequest;
import io.sphere.sdk.http.HttpResponse;
import play.mvc.Http;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.CompletionStage;
public class MetricHttpClient implements HttpClient {
private final HttpClient underlying;
private MetricHttpClient(final HttpClient underlying) {
this.underlying = underlying;
}
@Override
public CompletionStage<HttpResponse> execute(final HttpRequest httpRequest) {
final Optional<Http.Context> contextOptional = Optional.ofNullable(Http.Context.current.get());
final CompletionStage<HttpResponse> result = underlying.execute(httpRequest);
final long startTimestamp = System.currentTimeMillis();
contextOptional.ifPresent(context ->
result.thenAccept(response -> {
final long stopTimestamp = System.currentTimeMillis();
report(context, httpRequest, response, startTimestamp, stopTimestamp);
}));
return result;
}
@SuppressWarnings("unchecked")
private void report(final Http.Context context, final HttpRequest httpRequest, final HttpResponse response, long startTimestamp, long stopTimestamp) {
final List<ReportRawData> data = (List<ReportRawData>) context.args.get(MetricAction.KEY);
data.add(new ReportRawData(httpRequest, response, startTimestamp, stopTimestamp));
}
@Override
public void close() {
underlying.close();
}
public static MetricHttpClient of(final HttpClient underlying) {
return new MetricHttpClient(underlying);
}
}
## Instruction:
Improve metric http client to deal with missing report data list.
## Code After:
package io.sphere.sdk.play.metrics;
import io.sphere.sdk.http.HttpClient;
import io.sphere.sdk.http.HttpRequest;
import io.sphere.sdk.http.HttpResponse;
import play.mvc.Http;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.CompletionStage;
public class MetricHttpClient implements HttpClient {
private final HttpClient underlying;
private MetricHttpClient(final HttpClient underlying) {
this.underlying = underlying;
}
@Override
public CompletionStage<HttpResponse> execute(final HttpRequest httpRequest) {
final Optional<Http.Context> contextOptional = Optional.ofNullable(Http.Context.current.get());
final CompletionStage<HttpResponse> result = underlying.execute(httpRequest);
final long startTimestamp = System.currentTimeMillis();
contextOptional.ifPresent(context ->
result.thenAccept(response -> {
final long stopTimestamp = System.currentTimeMillis();
report(context, httpRequest, response, startTimestamp, stopTimestamp);
}));
return result;
}
@SuppressWarnings("unchecked")
private void report(final Http.Context context, final HttpRequest httpRequest, final HttpResponse response, long startTimestamp, long stopTimestamp) {
final Optional<List<ReportRawData>> dataOption = Optional.ofNullable((List<ReportRawData>) context.args.get(MetricAction.KEY));
dataOption.ifPresent(data -> data.add(new ReportRawData(httpRequest, response, startTimestamp, stopTimestamp)));
}
@Override
public void close() {
underlying.close();
}
public static MetricHttpClient of(final HttpClient underlying) {
return new MetricHttpClient(underlying);
}
} |
9d4f0ee09fb9c73d12263f928d2ea5d06148fcda | example/testagent/test/runtests.sh | example/testagent/test/runtests.sh |
set -e
CURRENT_SOURCE_DIR=`dirname "$0"`
TESTAGENT=$1
LIBOFP_DEFAULT_PORT=${LIBOFP_DEFAULT_PORT:-6653}
echo "Working Directory:" `pwd`
for input in $CURRENT_SOURCE_DIR/*.in ; do
name=`basename $input .in`
output=$name.out
echo "Run testagent to convert $input into $output"
# Remove lines with timestamps from output.
$TESTAGENT "127.0.0.1:$LIBOFP_DEFAULT_PORT" < $input | grep -Ev "^time: +[1-9][0-9]*\.[0-9]+$" > $output
echo "Compare $output and $CURRENT_SOURCE_DIR/$output"
diff $output $CURRENT_SOURCE_DIR/$output
done
exit 0
|
set -e
CURRENT_SOURCE_DIR=`dirname "$0"`
TESTAGENT=$1
LIBOFP_DEFAULT_PORT=${LIBOFP_DEFAULT_PORT:-6653}
echo "Working Directory:" `pwd`
for input in $CURRENT_SOURCE_DIR/*.in ; do
name=`basename $input .in`
output=$name.out
output_tmp="$name-${LIBOFP_DEFAULT_PORT}.out"
echo "Run testagent to convert $input into $output"
# Remove lines with timestamps from output.
$TESTAGENT "127.0.0.1:$LIBOFP_DEFAULT_PORT" < $input | grep -Ev "^time: +[1-9][0-9]*\.[0-9]+$" > $output_tmp
echo "Compare $output and $CURRENT_SOURCE_DIR/$output"
diff $output_tmp $CURRENT_SOURCE_DIR/$output
done
exit 0
| Make sure multiple tests can run in parallel. | Make sure multiple tests can run in parallel.
| Shell | mit | byllyfish/oftr,byllyfish/oftr,byllyfish/libofp,byllyfish/libofp,byllyfish/libofp,byllyfish/oftr,byllyfish/oftr,byllyfish/oftr | shell | ## Code Before:
set -e
CURRENT_SOURCE_DIR=`dirname "$0"`
TESTAGENT=$1
LIBOFP_DEFAULT_PORT=${LIBOFP_DEFAULT_PORT:-6653}
echo "Working Directory:" `pwd`
for input in $CURRENT_SOURCE_DIR/*.in ; do
name=`basename $input .in`
output=$name.out
echo "Run testagent to convert $input into $output"
# Remove lines with timestamps from output.
$TESTAGENT "127.0.0.1:$LIBOFP_DEFAULT_PORT" < $input | grep -Ev "^time: +[1-9][0-9]*\.[0-9]+$" > $output
echo "Compare $output and $CURRENT_SOURCE_DIR/$output"
diff $output $CURRENT_SOURCE_DIR/$output
done
exit 0
## Instruction:
Make sure multiple tests can run in parallel.
## Code After:
set -e
CURRENT_SOURCE_DIR=`dirname "$0"`
TESTAGENT=$1
LIBOFP_DEFAULT_PORT=${LIBOFP_DEFAULT_PORT:-6653}
echo "Working Directory:" `pwd`
for input in $CURRENT_SOURCE_DIR/*.in ; do
name=`basename $input .in`
output=$name.out
output_tmp="$name-${LIBOFP_DEFAULT_PORT}.out"
echo "Run testagent to convert $input into $output"
# Remove lines with timestamps from output.
$TESTAGENT "127.0.0.1:$LIBOFP_DEFAULT_PORT" < $input | grep -Ev "^time: +[1-9][0-9]*\.[0-9]+$" > $output_tmp
echo "Compare $output and $CURRENT_SOURCE_DIR/$output"
diff $output_tmp $CURRENT_SOURCE_DIR/$output
done
exit 0
|
53be5c9c86d544567f8171baba58128b5ad0502a | tests/test_io.py | tests/test_io.py | import nonstdlib
def test_capture_output():
import sys
with nonstdlib.capture_output() as output:
print('std', end='', file=sys.stdout)
print('st', end='', file=sys.stderr)
print('out', file=sys.stdout)
print('derr', file=sys.stderr)
assert 'stdout' in output
assert 'stderr' in output
assert output.stdout == 'stdout\n'
assert output.stderr == 'stderr\n'
def test_muffle():
with nonstdlib.muffle():
print("""\
This test doesn't really test anything, it just makes sure the
muffle function returns without raising any exceptions. You shouldn't ever see
this message.""")
|
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import nonstdlib
def test_capture_output():
import sys
with nonstdlib.capture_output() as output:
print('std', end='', file=sys.stdout)
print('st', end='', file=sys.stderr)
print('out', file=sys.stdout)
print('derr', file=sys.stderr)
assert 'stdout' in output
assert 'stderr' in output
assert output.stdout == 'stdout\n'
assert output.stderr == 'stderr\n'
def test_muffle():
with nonstdlib.muffle():
print("""\
This test doesn't really test anything, it just makes sure the
muffle function returns without raising any exceptions. You shouldn't ever see
this message.""")
| Make the tests compatible with python2. | Make the tests compatible with python2.
| Python | mit | kalekundert/nonstdlib,KenKundert/nonstdlib,KenKundert/nonstdlib,kalekundert/nonstdlib | python | ## Code Before:
import nonstdlib
def test_capture_output():
import sys
with nonstdlib.capture_output() as output:
print('std', end='', file=sys.stdout)
print('st', end='', file=sys.stderr)
print('out', file=sys.stdout)
print('derr', file=sys.stderr)
assert 'stdout' in output
assert 'stderr' in output
assert output.stdout == 'stdout\n'
assert output.stderr == 'stderr\n'
def test_muffle():
with nonstdlib.muffle():
print("""\
This test doesn't really test anything, it just makes sure the
muffle function returns without raising any exceptions. You shouldn't ever see
this message.""")
## Instruction:
Make the tests compatible with python2.
## Code After:
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import nonstdlib
def test_capture_output():
import sys
with nonstdlib.capture_output() as output:
print('std', end='', file=sys.stdout)
print('st', end='', file=sys.stderr)
print('out', file=sys.stdout)
print('derr', file=sys.stderr)
assert 'stdout' in output
assert 'stderr' in output
assert output.stdout == 'stdout\n'
assert output.stderr == 'stderr\n'
def test_muffle():
with nonstdlib.muffle():
print("""\
This test doesn't really test anything, it just makes sure the
muffle function returns without raising any exceptions. You shouldn't ever see
this message.""")
|
439b401d44571300fcf3689ed41a48f16f211187 | README.md | README.md | <p align="center">
<a href="https://github.com/hipacc/hipacc/actions?query=workflow%3A%22Build+and+Test%22+branch%3Asiemens-dev"><img alt="Build and Test Status" src="https://github.com/hipacc/hipacc/workflows/Build%20and%20Test/badge.svg?branch=siemens-dev"></a>
</p>
# Hipacc
A domain-specific language and compiler for image processing
Hipacc allows to design image processing kernels and algorithms in a domain-specific language (DSL).
From this high-level description, low-level target code for GPU accelerators is generated using source-to-source translation.
As back ends, the framework supports C/C++, CUDA, OpenCL, and Renderscript.
There is also a fork of Hipacc that targets [FPGAs](https://github.com/hipacc/hipacc-fpga).
## Install
See [Hipacc documentation](http://hipacc-lang.org/install.html) and [Install notes](doc/INSTALL.md) for detailed information.
## Integration
See [Integration](./doc/INTEGRATION.md) for how to add Hipacc to cmake targets.
| <p align="center">
<a href="https://github.com/hipacc/hipacc/actions?query=workflow%3A%22Build+and+Test%22+branch%3Asiemens-dev"><img alt="Build and Test Status" src="https://github.com/hipacc/hipacc/workflows/Build%20and%20Test/badge.svg?branch=siemens-dev&event=push"></a>
</p>
# Hipacc
A domain-specific language and compiler for image processing
Hipacc allows to design image processing kernels and algorithms in a domain-specific language (DSL).
From this high-level description, low-level target code for GPU accelerators is generated using source-to-source translation.
As back ends, the framework supports C/C++, CUDA, OpenCL, and Renderscript.
There is also a fork of Hipacc that targets [FPGAs](https://github.com/hipacc/hipacc-fpga).
## Install
See [Hipacc documentation](http://hipacc-lang.org/install.html) and [Install notes](doc/INSTALL.md) for detailed information.
## Integration
See [Integration](./doc/INTEGRATION.md) for how to add Hipacc to cmake targets.
| Update badge to show only push events | Update badge to show only push events | Markdown | bsd-2-clause | hipacc/hipacc,hipacc/hipacc | markdown | ## Code Before:
<p align="center">
<a href="https://github.com/hipacc/hipacc/actions?query=workflow%3A%22Build+and+Test%22+branch%3Asiemens-dev"><img alt="Build and Test Status" src="https://github.com/hipacc/hipacc/workflows/Build%20and%20Test/badge.svg?branch=siemens-dev"></a>
</p>
# Hipacc
A domain-specific language and compiler for image processing
Hipacc allows to design image processing kernels and algorithms in a domain-specific language (DSL).
From this high-level description, low-level target code for GPU accelerators is generated using source-to-source translation.
As back ends, the framework supports C/C++, CUDA, OpenCL, and Renderscript.
There is also a fork of Hipacc that targets [FPGAs](https://github.com/hipacc/hipacc-fpga).
## Install
See [Hipacc documentation](http://hipacc-lang.org/install.html) and [Install notes](doc/INSTALL.md) for detailed information.
## Integration
See [Integration](./doc/INTEGRATION.md) for how to add Hipacc to cmake targets.
## Instruction:
Update badge to show only push events
## Code After:
<p align="center">
<a href="https://github.com/hipacc/hipacc/actions?query=workflow%3A%22Build+and+Test%22+branch%3Asiemens-dev"><img alt="Build and Test Status" src="https://github.com/hipacc/hipacc/workflows/Build%20and%20Test/badge.svg?branch=siemens-dev&event=push"></a>
</p>
# Hipacc
A domain-specific language and compiler for image processing
Hipacc allows to design image processing kernels and algorithms in a domain-specific language (DSL).
From this high-level description, low-level target code for GPU accelerators is generated using source-to-source translation.
As back ends, the framework supports C/C++, CUDA, OpenCL, and Renderscript.
There is also a fork of Hipacc that targets [FPGAs](https://github.com/hipacc/hipacc-fpga).
## Install
See [Hipacc documentation](http://hipacc-lang.org/install.html) and [Install notes](doc/INSTALL.md) for detailed information.
## Integration
See [Integration](./doc/INTEGRATION.md) for how to add Hipacc to cmake targets.
|
31c9a8e3915438487f067df3d68420d0b4436a25 | lib/puppet/parser/functions/query_nodes.rb | lib/puppet/parser/functions/query_nodes.rb | Puppet::Parser::Functions.newfunction(:query_nodes, :type => :rvalue, :doc => <<-EOT
accepts two arguments, a query used to discover nodes, and a filter used to
specify the fact that should be returned.
The query specified should conform to the following format:
(Type[title] and fact_name<operator>fact_value) or ...
Package[mysql-server] and cluster_id=my_first_cluster
The filter provided should be a single fact (this argument is optional)
EOT
) do |args|
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', 'puppetdb'))
query, filter = args
raise(Puppet::Error, 'Query is a required parameter') unless query
PuppetDB.new.query_nodes(:query => query, :filter => filter, :only_active => true)
end
| Puppet::Parser::Functions.newfunction(:query_nodes, :type => :rvalue, :doc => <<-EOT
accepts two arguments, a query used to discover nodes, and a filter used to
specify the fact that should be returned.
The query specified should conform to the following format:
(Type[title] and fact_name<operator>fact_value) or ...
Package[mysql-server] and cluster_id=my_first_cluster
The filter provided should be a single fact (this argument is optional)
EOT
) do |args|
query, filter = args
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', 'puppetdb'))
raise(Puppet::Error, 'Query is a required parameter') unless query
PuppetDB.new.query_nodes(:query => query, :filter => filter)
end
| Fix query node to remove active only filter. | Fix query node to remove active only filter.
Query node should not filter by active_only node.
| Ruby | apache-2.0 | gwdg/puppet-puppetdbquery,pyther/puppet-puppetdbquery,redhat-cip/puppet-puppetdbquery,gcmalloc/puppet-puppetdbquery,baptistejammet/puppet-puppetdbquery,unki/puppet-puppetdbquery,natemccurdy/puppet-puppetdbquery,danieldreier/puppet-puppetdbquery,MelanieGault/puppet-puppetdbquery,ccin2p3/puppet-puppetdbquery,dalen/puppet-puppetdbquery | ruby | ## Code Before:
Puppet::Parser::Functions.newfunction(:query_nodes, :type => :rvalue, :doc => <<-EOT
accepts two arguments, a query used to discover nodes, and a filter used to
specify the fact that should be returned.
The query specified should conform to the following format:
(Type[title] and fact_name<operator>fact_value) or ...
Package[mysql-server] and cluster_id=my_first_cluster
The filter provided should be a single fact (this argument is optional)
EOT
) do |args|
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', 'puppetdb'))
query, filter = args
raise(Puppet::Error, 'Query is a required parameter') unless query
PuppetDB.new.query_nodes(:query => query, :filter => filter, :only_active => true)
end
## Instruction:
Fix query node to remove active only filter.
Query node should not filter by active_only node.
## Code After:
Puppet::Parser::Functions.newfunction(:query_nodes, :type => :rvalue, :doc => <<-EOT
accepts two arguments, a query used to discover nodes, and a filter used to
specify the fact that should be returned.
The query specified should conform to the following format:
(Type[title] and fact_name<operator>fact_value) or ...
Package[mysql-server] and cluster_id=my_first_cluster
The filter provided should be a single fact (this argument is optional)
EOT
) do |args|
query, filter = args
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', 'puppetdb'))
raise(Puppet::Error, 'Query is a required parameter') unless query
PuppetDB.new.query_nodes(:query => query, :filter => filter)
end
|
e44bda9b82b15cfa30717b36815e81df3025238e | test/factories/teaching_period_factory.rb | test/factories/teaching_period_factory.rb | require 'date'
FactoryBot.define do
factory :teaching_period do
sequence(:period, (1..3).cycle) { |n| "T#{n}" }
sequence(:start_date, (1..3).cycle) { |n| Time.zone.now + n * 15.weeks }
year { start_date.year }
end_date { start_date + 14.weeks }
active_until { end_date + rand(1..2).weeks }
end
end
| require 'date'
FactoryBot.define do
factory :teaching_period do
sequence(:period, (1..3).cycle) { |n| "T#{n}" }
sequence(:start_date, (1..3).cycle) { |n| Time.zone.now + n * 15.weeks }
year { start_date.year }
end_date { start_date + 14.weeks }
active_until { end_date + rand(1..2).weeks }
end
factory :breaks do
start_date {start_date.Time.zone.now}
number_of_weeks {number_of_weeks.rand(1..3)}
end
end
| Add breaks to teaching period factory | TEST: Add breaks to teaching period factory
| Ruby | agpl-3.0 | jakerenzella/doubtfire-api,jakerenzella/doubtfire-api,jakerenzella/doubtfire-api,doubtfire-lms/doubtfire-api,doubtfire-lms/doubtfire-api,doubtfire-lms/doubtfire-api,jakerenzella/doubtfire-api,jakerenzella/doubtfire-api,doubtfire-lms/doubtfire-api,doubtfire-lms/doubtfire-api,jakerenzella/doubtfire-api,jakerenzella/doubtfire-api,doubtfire-lms/doubtfire-api,doubtfire-lms/doubtfire-api | ruby | ## Code Before:
require 'date'
FactoryBot.define do
factory :teaching_period do
sequence(:period, (1..3).cycle) { |n| "T#{n}" }
sequence(:start_date, (1..3).cycle) { |n| Time.zone.now + n * 15.weeks }
year { start_date.year }
end_date { start_date + 14.weeks }
active_until { end_date + rand(1..2).weeks }
end
end
## Instruction:
TEST: Add breaks to teaching period factory
## Code After:
require 'date'
FactoryBot.define do
factory :teaching_period do
sequence(:period, (1..3).cycle) { |n| "T#{n}" }
sequence(:start_date, (1..3).cycle) { |n| Time.zone.now + n * 15.weeks }
year { start_date.year }
end_date { start_date + 14.weeks }
active_until { end_date + rand(1..2).weeks }
end
factory :breaks do
start_date {start_date.Time.zone.now}
number_of_weeks {number_of_weeks.rand(1..3)}
end
end
|
37300646f1b814095e2add27eaa8170e02a3453f | README.md | README.md |
Personal ESLint config.
## Installation
[](https://nodei.co/npm/eslint-config-njakob/)
```
$ npm install eslint-config-njakob --sav-dev
```
## Usage
```json
{
"extends": "njakob"
}
```
## Licences
[MIT](LICENSE) |
Personal ESLint config.
## Rules sets
* [Flowtype](/rules/flow.js)
* [Import](/rules/import.js)
* [ES6](/rules/es6.js)
## Installation
[](https://nodei.co/npm/eslint-config-njakob/)
```
$ npm install eslint-config-njakob --sav-dev
```
## Usage
```json
{
"extends": "njakob"
}
```
## Licences
[MIT](LICENSE) | Update readme with extended sets of rules | Update readme with extended sets of rules
| Markdown | mit | njakob/eslint-config | markdown | ## Code Before:
Personal ESLint config.
## Installation
[](https://nodei.co/npm/eslint-config-njakob/)
```
$ npm install eslint-config-njakob --sav-dev
```
## Usage
```json
{
"extends": "njakob"
}
```
## Licences
[MIT](LICENSE)
## Instruction:
Update readme with extended sets of rules
## Code After:
Personal ESLint config.
## Rules sets
* [Flowtype](/rules/flow.js)
* [Import](/rules/import.js)
* [ES6](/rules/es6.js)
## Installation
[](https://nodei.co/npm/eslint-config-njakob/)
```
$ npm install eslint-config-njakob --sav-dev
```
## Usage
```json
{
"extends": "njakob"
}
```
## Licences
[MIT](LICENSE) |
746df99d416599a2c7c33b5b35f5685af9bbb832 | bower.json | bower.json | {
"name": "pinny",
"version": "2.0.2",
"homepage": "https://github.com/mobify/pinny",
"authors": [
"Mobify <jobs@mobify.com>"
],
"description": "A mobile first content fly-in UI plugin",
"main": "dist/pinny.min.js",
"keywords": [
"pinny",
"fly-in",
"modal",
"mobile",
"mobify"
],
"license": "MIT",
"ignore": [
"./!(src|dist|lib|templates)"
],
"dependencies": {
"plugin": "~3.0.0",
"mobify-velocity": "~1.1.2",
"requirejs-text": "~2.0.12",
"requirejs": "~2.1.14",
"bouncefix.js": "~0.3.0",
"shade": "~1.1.1",
"lockup": "~1.1.1",
"deckard": "~1.0.0",
"selector-utils": "https://github.com/mobify/selector-utils.git"
}
}
| {
"name": "pinny",
"version": "2.0.2",
"homepage": "https://github.com/mobify/pinny",
"authors": [
"Mobify <jobs@mobify.com>"
],
"description": "A mobile first content fly-in UI plugin",
"main": "dist/pinny.min.js",
"keywords": [
"pinny",
"fly-in",
"modal",
"mobile",
"mobify"
],
"license": "MIT",
"ignore": [
"./!(src|dist|lib|templates)"
],
"dependencies": {
"plugin": "~3.0.0",
"mobify-velocity": "~1.1.2",
"requirejs-text": "~2.0.12",
"requirejs": "~2.1.14",
"bouncefix.js": "~0.3.0",
"shade": "~1.1.1",
"lockup": "git://github.com/mobify/lockup#btr-fixes",
"deckard": "~1.0.0",
"selector-utils": "https://github.com/mobify/selector-utils.git"
}
}
| Use new bugfix release of lockup | Use new bugfix release of lockup
| JSON | mit | mobify/pinny,mobify/pinny | json | ## Code Before:
{
"name": "pinny",
"version": "2.0.2",
"homepage": "https://github.com/mobify/pinny",
"authors": [
"Mobify <jobs@mobify.com>"
],
"description": "A mobile first content fly-in UI plugin",
"main": "dist/pinny.min.js",
"keywords": [
"pinny",
"fly-in",
"modal",
"mobile",
"mobify"
],
"license": "MIT",
"ignore": [
"./!(src|dist|lib|templates)"
],
"dependencies": {
"plugin": "~3.0.0",
"mobify-velocity": "~1.1.2",
"requirejs-text": "~2.0.12",
"requirejs": "~2.1.14",
"bouncefix.js": "~0.3.0",
"shade": "~1.1.1",
"lockup": "~1.1.1",
"deckard": "~1.0.0",
"selector-utils": "https://github.com/mobify/selector-utils.git"
}
}
## Instruction:
Use new bugfix release of lockup
## Code After:
{
"name": "pinny",
"version": "2.0.2",
"homepage": "https://github.com/mobify/pinny",
"authors": [
"Mobify <jobs@mobify.com>"
],
"description": "A mobile first content fly-in UI plugin",
"main": "dist/pinny.min.js",
"keywords": [
"pinny",
"fly-in",
"modal",
"mobile",
"mobify"
],
"license": "MIT",
"ignore": [
"./!(src|dist|lib|templates)"
],
"dependencies": {
"plugin": "~3.0.0",
"mobify-velocity": "~1.1.2",
"requirejs-text": "~2.0.12",
"requirejs": "~2.1.14",
"bouncefix.js": "~0.3.0",
"shade": "~1.1.1",
"lockup": "git://github.com/mobify/lockup#btr-fixes",
"deckard": "~1.0.0",
"selector-utils": "https://github.com/mobify/selector-utils.git"
}
}
|
e0ac6b9b91385983b7f371eb0849283493845495 | bower.json | bower.json | {
"name": "experiment",
"description": "Experiment",
"main": "gulpfile.js",
"authors": [
"Thomas Lecoeur <tlecoeur@agencenetdesign.com>"
],
"license": "ISC",
"moduleType": [],
"homepage": "src/index.html",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"devDependencies": {},
"dependencies": {
"three.js": "^0.75.0",
"gsap": "^1.18.2",
"DeviceOrientationControls": "https://raw.githubusercontent.com/mrdoob/three.js/master/examples/js/controls/DeviceOrientationControls.js",
"OrbitControls": "https://raw.githubusercontent.com/mrdoob/three.js/master/examples/js/controls/OrbitControls.js",
"VRControls": "https://raw.githubusercontent.com/mrdoob/three.js/master/examples/js/controls/VRControls.js",
"CardboardEffect": "https://raw.githubusercontent.com/mrdoob/three.js/master/examples/js/effects/CardboardEffect.js",
"ImprovedNoise": "http://mrdoob.github.io/three.js/examples/js/ImprovedNoise.js",
"PointerLockControls": "https://raw.githubusercontent.com/mrdoob/three.js/master/examples/js/controls/PointerLockControls.js"
}
}
| {
"name": "experiment",
"description": "Experiment",
"main": "gulpfile.js",
"authors": [
"Thomas Lecoeur <tlecoeur@agencenetdesign.com>"
],
"license": "ISC",
"moduleType": [],
"homepage": "src/index.html",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"devDependencies": {},
"dependencies": {
"three.js": "^0.75.0",
"gsap": "^1.18.2",
"DeviceOrientationControls": "https://raw.githubusercontent.com/mrdoob/three.js/master/examples/js/controls/DeviceOrientationControls.js",
"OrbitControls": "https://raw.githubusercontent.com/mrdoob/three.js/master/examples/js/controls/OrbitControls.js",
"VRControls": "https://raw.githubusercontent.com/mrdoob/three.js/master/examples/js/controls/VRControls.js",
"CardboardEffect": "https://raw.githubusercontent.com/mrdoob/three.js/master/examples/js/effects/CardboardEffect.js",
"ImprovedNoise": "http://mrdoob.github.io/three.js/examples/js/ImprovedNoise.js"
}
}
| Remove three.js pointerLock intergration dep | Remove three.js pointerLock intergration dep
| JSON | mit | Thomeuxe/LUMA-VR-experiment,Thomeuxe/LUMA-VR-experiment | json | ## Code Before:
{
"name": "experiment",
"description": "Experiment",
"main": "gulpfile.js",
"authors": [
"Thomas Lecoeur <tlecoeur@agencenetdesign.com>"
],
"license": "ISC",
"moduleType": [],
"homepage": "src/index.html",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"devDependencies": {},
"dependencies": {
"three.js": "^0.75.0",
"gsap": "^1.18.2",
"DeviceOrientationControls": "https://raw.githubusercontent.com/mrdoob/three.js/master/examples/js/controls/DeviceOrientationControls.js",
"OrbitControls": "https://raw.githubusercontent.com/mrdoob/three.js/master/examples/js/controls/OrbitControls.js",
"VRControls": "https://raw.githubusercontent.com/mrdoob/three.js/master/examples/js/controls/VRControls.js",
"CardboardEffect": "https://raw.githubusercontent.com/mrdoob/three.js/master/examples/js/effects/CardboardEffect.js",
"ImprovedNoise": "http://mrdoob.github.io/three.js/examples/js/ImprovedNoise.js",
"PointerLockControls": "https://raw.githubusercontent.com/mrdoob/three.js/master/examples/js/controls/PointerLockControls.js"
}
}
## Instruction:
Remove three.js pointerLock intergration dep
## Code After:
{
"name": "experiment",
"description": "Experiment",
"main": "gulpfile.js",
"authors": [
"Thomas Lecoeur <tlecoeur@agencenetdesign.com>"
],
"license": "ISC",
"moduleType": [],
"homepage": "src/index.html",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"devDependencies": {},
"dependencies": {
"three.js": "^0.75.0",
"gsap": "^1.18.2",
"DeviceOrientationControls": "https://raw.githubusercontent.com/mrdoob/three.js/master/examples/js/controls/DeviceOrientationControls.js",
"OrbitControls": "https://raw.githubusercontent.com/mrdoob/three.js/master/examples/js/controls/OrbitControls.js",
"VRControls": "https://raw.githubusercontent.com/mrdoob/three.js/master/examples/js/controls/VRControls.js",
"CardboardEffect": "https://raw.githubusercontent.com/mrdoob/three.js/master/examples/js/effects/CardboardEffect.js",
"ImprovedNoise": "http://mrdoob.github.io/three.js/examples/js/ImprovedNoise.js"
}
}
|
a1f8182123ec7c255173ffa5e7d80a51159edc3e | src/main/kotlin/net/moltendorf/Bukkit/IntelliDoors/IntelliDoors.kt | src/main/kotlin/net/moltendorf/Bukkit/IntelliDoors/IntelliDoors.kt | package net.moltendorf.Bukkit.IntelliDoors
import net.moltendorf.Bukkit.IntelliDoors.listener.Interact
import net.moltendorf.Bukkit.IntelliDoors.listener.Redstone
import org.bukkit.plugin.java.JavaPlugin
/**
* Created by moltendorf on 15/05/23.
* @author moltendorf
*/
class IntelliDoors : JavaPlugin() {
// Variable data.
lateinit var settings: Settings
private set
lateinit var timer: Timer
private set
override fun onEnable() {
instance = this
// Construct new settings.
settings = Settings()
// Construct new timer.
timer = Timer()
// Are we enabled?
enabled = settings.enabled
if (enabled) {
// Register listeners.
val manager = server.pluginManager
if (settings.interact) {
manager.registerEvents(Interact(), this)
}
if (settings.redstone) {
manager.registerEvents(Redstone(), this)
}
}
}
override fun onDisable() {
timer.shutAllDoors()
enabled = false
}
companion object {
var enabled = false
private set
lateinit var instance: IntelliDoors
private set
}
}
| package net.moltendorf.Bukkit.IntelliDoors
import net.moltendorf.Bukkit.IntelliDoors.listener.Interact
import net.moltendorf.Bukkit.IntelliDoors.listener.Redstone
import org.bukkit.plugin.java.JavaPlugin
import kotlin.concurrent.timer
/**
* Created by moltendorf on 15/05/23.
* @author moltendorf
*/
class IntelliDoors : JavaPlugin() {
// Variable data.
lateinit var settings: Settings
private set
lateinit var timer: Timer
private set
override fun onEnable() {
instance = this
// Construct new settings.
settings = Settings()
// Construct new timer.
timer = Timer()
// Are we enabled?
enabled = settings.enabled
if (enabled) {
// Register listeners.
val manager = server.pluginManager
if (settings.interact) {
manager.registerEvents(Interact(), this)
logger.info("Enabled interact listeners.")
}
if (settings.redstone) {
manager.registerEvents(Redstone(), this)
logger.info("Enabled redstone listeners.")
}
}
}
override fun onDisable() {
timer.shutAllDoors()
enabled = false
}
companion object {
var enabled = false
private set
lateinit var instance: IntelliDoors
private set
}
}
| Add some more logs for when the plugin enables | Add some more logs for when the plugin enables
| Kotlin | mit | moltendorf/IntelliDoors | kotlin | ## Code Before:
package net.moltendorf.Bukkit.IntelliDoors
import net.moltendorf.Bukkit.IntelliDoors.listener.Interact
import net.moltendorf.Bukkit.IntelliDoors.listener.Redstone
import org.bukkit.plugin.java.JavaPlugin
/**
* Created by moltendorf on 15/05/23.
* @author moltendorf
*/
class IntelliDoors : JavaPlugin() {
// Variable data.
lateinit var settings: Settings
private set
lateinit var timer: Timer
private set
override fun onEnable() {
instance = this
// Construct new settings.
settings = Settings()
// Construct new timer.
timer = Timer()
// Are we enabled?
enabled = settings.enabled
if (enabled) {
// Register listeners.
val manager = server.pluginManager
if (settings.interact) {
manager.registerEvents(Interact(), this)
}
if (settings.redstone) {
manager.registerEvents(Redstone(), this)
}
}
}
override fun onDisable() {
timer.shutAllDoors()
enabled = false
}
companion object {
var enabled = false
private set
lateinit var instance: IntelliDoors
private set
}
}
## Instruction:
Add some more logs for when the plugin enables
## Code After:
package net.moltendorf.Bukkit.IntelliDoors
import net.moltendorf.Bukkit.IntelliDoors.listener.Interact
import net.moltendorf.Bukkit.IntelliDoors.listener.Redstone
import org.bukkit.plugin.java.JavaPlugin
import kotlin.concurrent.timer
/**
* Created by moltendorf on 15/05/23.
* @author moltendorf
*/
class IntelliDoors : JavaPlugin() {
// Variable data.
lateinit var settings: Settings
private set
lateinit var timer: Timer
private set
override fun onEnable() {
instance = this
// Construct new settings.
settings = Settings()
// Construct new timer.
timer = Timer()
// Are we enabled?
enabled = settings.enabled
if (enabled) {
// Register listeners.
val manager = server.pluginManager
if (settings.interact) {
manager.registerEvents(Interact(), this)
logger.info("Enabled interact listeners.")
}
if (settings.redstone) {
manager.registerEvents(Redstone(), this)
logger.info("Enabled redstone listeners.")
}
}
}
override fun onDisable() {
timer.shutAllDoors()
enabled = false
}
companion object {
var enabled = false
private set
lateinit var instance: IntelliDoors
private set
}
}
|
0b9285b0f3808d33b17c5aea8763e8194412eabf | package.json | package.json | {
"name": "koser.us-metalsmith",
"private": true,
"dependencies": {
"metalsmith": "^1.0.0"
}
} | {
"name": "koser.us-metalsmith",
"private": true,
"dependencies": {
"metalsmith": "1.7.x",
"metalsmith-in-place": "1.3.x",
"metalsmith-layouts": "1.4.x",
"metalsmith-markdown": "0.2.x"
}
} | Update metalsmith and plugin versions | Update metalsmith and plugin versions
| JSON | mit | briankoser/koser.us-metalsmith,briankoser/koser.us-metalsmith | json | ## Code Before:
{
"name": "koser.us-metalsmith",
"private": true,
"dependencies": {
"metalsmith": "^1.0.0"
}
}
## Instruction:
Update metalsmith and plugin versions
## Code After:
{
"name": "koser.us-metalsmith",
"private": true,
"dependencies": {
"metalsmith": "1.7.x",
"metalsmith-in-place": "1.3.x",
"metalsmith-layouts": "1.4.x",
"metalsmith-markdown": "0.2.x"
}
} |
f283ed1c9df5b8daee0fe32d9670d23100733d33 | test/style-examples.test.js | test/style-examples.test.js | var test = require('tape');
var tm = require('../lib/tm');
var style = require('../lib/style');
var source = require('../lib/source');
var mockOauth = require('../lib/mapbox-mock')(require('express')());
var tmppath = tm.join(require('os').tmpdir(), 'Examples ШЖФ -' + (+new Date));
var server;
test('setup', function(t) {
tm.config({
log: false,
db: tm.join(tmppath, 'app.db'),
cache: tm.join(tmppath, 'cache'),
fonts: tm.join(tmppath, 'fonts'),
mapboxauth: 'http://localhost:3001'
}, t.end);
});
test('setup: mockserver', function(t) {
tm.db.set('oauth', {
account: 'test',
accesstoken: 'testaccesstoken'
});
tm._config.mapboxauth = 'http://localhost:3001',
tm._config.mapboxtile = 'http://localhost:3001/v4';
server = mockOauth.listen(3001, t.end);
});
for (var key in style.examples) (function(key) {
test(key, function(t) {
style(style.examples[key], function(err, s) {
t.ifError(err);
t.end();
});
});
})(key);
test('cleanup', function(t) {
server.close(function() { t.end(); });
});
| var test = require('tape');
var tm = require('../lib/tm');
var style = require('../lib/style');
var source = require('../lib/source');
var mockOauth = require('../lib/mapbox-mock')(require('express')());
var tmppath = tm.join(require('os').tmpdir(), 'Examples ШЖФ -' + (+new Date));
var server;
test('setup', function(t) {
tm.config({
log: false,
db: tm.join(tmppath, 'app.db'),
cache: tm.join(tmppath, 'cache'),
fonts: tm.join(tmppath, 'fonts'),
mapboxauth: 'http://localhost:3001'
}, t.end);
});
test('setup: mockserver', function(t) {
tm.db.set('oauth', {
account: 'test',
accesstoken: 'testaccesstoken'
});
tm._config.mapboxauth = 'http://localhost:3001',
tm._config.mapboxtile = 'http://localhost:3001/v4';
server = mockOauth.listen(3001, t.end);
});
for (var key in style.examples) (function(key) {
test(key, function(t) {
style(style.examples[key], function(err, s) {
t.ifError(err);
t.ok(!s.data._prefs.mapid, 'no mapid set');
t.end();
});
});
})(key);
test('cleanup', function(t) {
server.close(function() { t.end(); });
});
| Test that no mapid is set on example styles. | Test that no mapid is set on example styles.
| JavaScript | bsd-3-clause | wakermahmud/mapbox-studio,tizzybec/mapbox-studio,wakermahmud/mapbox-studio,tizzybec/mapbox-studio,adozenlines/mapbox-studio,mapbox/mapbox-studio-classic,wakermahmud/mapbox-studio,crowdcover/mapbox-studio,danieljoppi/mapbox-studio,Zhao-Qi/mapbox-studio-classic,AbelSu131/mapbox-studio,Zhao-Qi/mapbox-studio-classic,ali/mapbox-studio,tizzybec/mapbox-studio,crowdcover/mapbox-studio,danieljoppi/mapbox-studio,mapbox/mapbox-studio,mapbox/mapbox-studio,ali/mapbox-studio,xrwang/mapbox-studio,tizzybec/mapbox-studio,wakermahmud/mapbox-studio,AbelSu131/mapbox-studio,mapbox/mapbox-studio-classic,xrwang/mapbox-studio,AbelSu131/mapbox-studio,mapbox/mapbox-studio,crowdcover/mapbox-studio,mapbox/mapbox-studio,ali/mapbox-studio,xrwang/mapbox-studio,mapbox/mapbox-studio,adozenlines/mapbox-studio,danieljoppi/mapbox-studio,wakermahmud/mapbox-studio,xrwang/mapbox-studio,tizzybec/mapbox-studio,mapbox/mapbox-studio-classic,xrwang/mapbox-studio,ali/mapbox-studio,Zhao-Qi/mapbox-studio-classic,mapbox/mapbox-studio-classic,AbelSu131/mapbox-studio,Zhao-Qi/mapbox-studio-classic,AbelSu131/mapbox-studio,ali/mapbox-studio,crowdcover/mapbox-studio,Zhao-Qi/mapbox-studio-classic,adozenlines/mapbox-studio,adozenlines/mapbox-studio,danieljoppi/mapbox-studio,crowdcover/mapbox-studio,danieljoppi/mapbox-studio,adozenlines/mapbox-studio | javascript | ## Code Before:
var test = require('tape');
var tm = require('../lib/tm');
var style = require('../lib/style');
var source = require('../lib/source');
var mockOauth = require('../lib/mapbox-mock')(require('express')());
var tmppath = tm.join(require('os').tmpdir(), 'Examples ШЖФ -' + (+new Date));
var server;
test('setup', function(t) {
tm.config({
log: false,
db: tm.join(tmppath, 'app.db'),
cache: tm.join(tmppath, 'cache'),
fonts: tm.join(tmppath, 'fonts'),
mapboxauth: 'http://localhost:3001'
}, t.end);
});
test('setup: mockserver', function(t) {
tm.db.set('oauth', {
account: 'test',
accesstoken: 'testaccesstoken'
});
tm._config.mapboxauth = 'http://localhost:3001',
tm._config.mapboxtile = 'http://localhost:3001/v4';
server = mockOauth.listen(3001, t.end);
});
for (var key in style.examples) (function(key) {
test(key, function(t) {
style(style.examples[key], function(err, s) {
t.ifError(err);
t.end();
});
});
})(key);
test('cleanup', function(t) {
server.close(function() { t.end(); });
});
## Instruction:
Test that no mapid is set on example styles.
## Code After:
var test = require('tape');
var tm = require('../lib/tm');
var style = require('../lib/style');
var source = require('../lib/source');
var mockOauth = require('../lib/mapbox-mock')(require('express')());
var tmppath = tm.join(require('os').tmpdir(), 'Examples ШЖФ -' + (+new Date));
var server;
test('setup', function(t) {
tm.config({
log: false,
db: tm.join(tmppath, 'app.db'),
cache: tm.join(tmppath, 'cache'),
fonts: tm.join(tmppath, 'fonts'),
mapboxauth: 'http://localhost:3001'
}, t.end);
});
test('setup: mockserver', function(t) {
tm.db.set('oauth', {
account: 'test',
accesstoken: 'testaccesstoken'
});
tm._config.mapboxauth = 'http://localhost:3001',
tm._config.mapboxtile = 'http://localhost:3001/v4';
server = mockOauth.listen(3001, t.end);
});
for (var key in style.examples) (function(key) {
test(key, function(t) {
style(style.examples[key], function(err, s) {
t.ifError(err);
t.ok(!s.data._prefs.mapid, 'no mapid set');
t.end();
});
});
})(key);
test('cleanup', function(t) {
server.close(function() { t.end(); });
});
|
317b91044c9f07648c1bbed943c586103519f874 | .config/sh/config.sh | .config/sh/config.sh |
set -o vi
. ~/.env
case "$(uname)" in
Darwin)
test -z ${HOMEBREW_PREFIX:+null} && test -x /usr/local/bin/brew && eval "$(SHELL=/bin/sh /usr/local/bin/brew shellenv)"
command -v docker-machine >/dev/null && eval $(docker-machine env 2>/dev/null)
;;
Linux)
test -z ${HOMEBREW_PREFIX:+null} && test -x /home/linuxbrew/.linuxbrew/bin/brew && eval "$(SHELL=/bin/sh /home/linuxbrew/.linuxbrew/bin/brew shellenv)"
test -z ${HOMEBREW_PREFIX:+null} && test -x ~/.linuxbrew/bin/brew && eval "$(SHELL=/bin/sh ~/.linuxbrew/bin/brew shellenv)"
alias ls='ls --color=auto'
;;
esac
alias ll='ls -lh'
alias la='ls -lAh'
alias grep='grep --color=auto'
|
set -o vi
. ~/.env
case "$(uname)" in
Darwin)
test -z ${HOMEBREW_PREFIX:+null} && test -x /usr/local/bin/brew && eval "$(SHELL=/bin/sh /usr/local/bin/brew shellenv)"
JAVA_HOME="$(/usr/libexec/java_home 2>/dev/null)"
test -n "$JAVA_HOME" && export JAVA_HOME || unset JAVA_HOME
command -v docker-machine >/dev/null && eval $(docker-machine env 2>/dev/null)
;;
Linux)
test -z ${HOMEBREW_PREFIX:+null} && test -x /home/linuxbrew/.linuxbrew/bin/brew && eval "$(SHELL=/bin/sh /home/linuxbrew/.linuxbrew/bin/brew shellenv)"
test -z ${HOMEBREW_PREFIX:+null} && test -x ~/.linuxbrew/bin/brew && eval "$(SHELL=/bin/sh ~/.linuxbrew/bin/brew shellenv)"
alias ls='ls --color=auto'
;;
esac
alias ll='ls -lh'
alias la='ls -lAh'
alias grep='grep --color=auto'
| Set JAVA_HOME to current default JDK on macOS | Set JAVA_HOME to current default JDK on macOS
- brew hardwires many commands to its own openjdk if JAVA_HOME is not
set, which causes lots of unexpected behaviors, such as keystore
being different.
| Shell | bsd-2-clause | ntkme/ntkme,ntkme/ntkme | shell | ## Code Before:
set -o vi
. ~/.env
case "$(uname)" in
Darwin)
test -z ${HOMEBREW_PREFIX:+null} && test -x /usr/local/bin/brew && eval "$(SHELL=/bin/sh /usr/local/bin/brew shellenv)"
command -v docker-machine >/dev/null && eval $(docker-machine env 2>/dev/null)
;;
Linux)
test -z ${HOMEBREW_PREFIX:+null} && test -x /home/linuxbrew/.linuxbrew/bin/brew && eval "$(SHELL=/bin/sh /home/linuxbrew/.linuxbrew/bin/brew shellenv)"
test -z ${HOMEBREW_PREFIX:+null} && test -x ~/.linuxbrew/bin/brew && eval "$(SHELL=/bin/sh ~/.linuxbrew/bin/brew shellenv)"
alias ls='ls --color=auto'
;;
esac
alias ll='ls -lh'
alias la='ls -lAh'
alias grep='grep --color=auto'
## Instruction:
Set JAVA_HOME to current default JDK on macOS
- brew hardwires many commands to its own openjdk if JAVA_HOME is not
set, which causes lots of unexpected behaviors, such as keystore
being different.
## Code After:
set -o vi
. ~/.env
case "$(uname)" in
Darwin)
test -z ${HOMEBREW_PREFIX:+null} && test -x /usr/local/bin/brew && eval "$(SHELL=/bin/sh /usr/local/bin/brew shellenv)"
JAVA_HOME="$(/usr/libexec/java_home 2>/dev/null)"
test -n "$JAVA_HOME" && export JAVA_HOME || unset JAVA_HOME
command -v docker-machine >/dev/null && eval $(docker-machine env 2>/dev/null)
;;
Linux)
test -z ${HOMEBREW_PREFIX:+null} && test -x /home/linuxbrew/.linuxbrew/bin/brew && eval "$(SHELL=/bin/sh /home/linuxbrew/.linuxbrew/bin/brew shellenv)"
test -z ${HOMEBREW_PREFIX:+null} && test -x ~/.linuxbrew/bin/brew && eval "$(SHELL=/bin/sh ~/.linuxbrew/bin/brew shellenv)"
alias ls='ls --color=auto'
;;
esac
alias ll='ls -lh'
alias la='ls -lAh'
alias grep='grep --color=auto'
|
0eb8b9eca262cfb32ca5bb5d473c4b637169d0a5 | app/assets/javascripts/modules/track-brexit-qa-choices.js | app/assets/javascripts/modules/track-brexit-qa-choices.js | window.GOVUK = window.GOVUK || {}
window.GOVUK.Modules = window.GOVUK.Modules || {};
(function (global, GOVUK) {
'use strict'
GOVUK.Modules.TrackBrexitQaChoices = function () {
this.start = function (element) {
track(element)
}
function track (element) {
element.on('submit', function (event) {
var $checkedOption, eventLabel, options
var $submittedForm = event.target
var $checkedOptions = $submittedForm.querySelectorAll('input:checked')
var questionKey = $submittedForm.data('question-key')
if ($checkedOptions.length) {
$checkedOptions.each(function (index) {
$checkedOption = $(this)
var checkedOptionId = $checkedOption.attr('id')
var checkedOptionLabel = $submittedForm.find('label[for="' + checkedOptionId + '"]').text().trim()
eventLabel = checkedOptionLabel.length
? checkedOptionLabel
: $checkedOption.val()
options = { transport: 'beacon', label: eventLabel }
GOVUK.SearchAnalytics.trackEvent('brexit-checker-qa', questionKey, options)
})
} else {
// Skipped questions
options = { transport: 'beacon', label: 'no choice' }
GOVUK.SearchAnalytics.trackEvent('brexit-checker-qa', questionKey, options)
}
})
}
}
})(window, window.GOVUK)
| window.GOVUK = window.GOVUK || {}
window.GOVUK.Modules = window.GOVUK.Modules || {};
(function (global, GOVUK) {
'use strict'
GOVUK.Modules.TrackBrexitQaChoices = function () {
this.start = function (element) {
track(element)
}
function track (element) {
element.on('submit', function (event) {
var eventLabel, options
var $submittedForm = event.target
var $checkedOptions = $submittedForm.querySelectorAll('input:checked')
var questionKey = $submittedForm.data('question-key')
if ($checkedOptions.length) {
for (var i = 0; i < $checkedOptions.length; i++) {
var checkedOptionId = $checkedOptions[i].getAttribute('id')
var checkedOptionLabel = $submittedForm.find('label[for="' + checkedOptionId + '"]').text().trim()
eventLabel = checkedOptionLabel.length
? checkedOptionLabel
: $checkedOptions[i].val()
options = { transport: 'beacon', label: eventLabel }
GOVUK.SearchAnalytics.trackEvent('brexit-checker-qa', questionKey, options)
}
} else {
// Skipped questions
options = { transport: 'beacon', label: 'no choice' }
GOVUK.SearchAnalytics.trackEvent('brexit-checker-qa', questionKey, options)
}
})
}
}
})(window, window.GOVUK)
| Replace jQuery `each` method with for loop | Replace jQuery `each` method with for loop
| JavaScript | mit | alphagov/finder-frontend,alphagov/finder-frontend,alphagov/finder-frontend,alphagov/finder-frontend | javascript | ## Code Before:
window.GOVUK = window.GOVUK || {}
window.GOVUK.Modules = window.GOVUK.Modules || {};
(function (global, GOVUK) {
'use strict'
GOVUK.Modules.TrackBrexitQaChoices = function () {
this.start = function (element) {
track(element)
}
function track (element) {
element.on('submit', function (event) {
var $checkedOption, eventLabel, options
var $submittedForm = event.target
var $checkedOptions = $submittedForm.querySelectorAll('input:checked')
var questionKey = $submittedForm.data('question-key')
if ($checkedOptions.length) {
$checkedOptions.each(function (index) {
$checkedOption = $(this)
var checkedOptionId = $checkedOption.attr('id')
var checkedOptionLabel = $submittedForm.find('label[for="' + checkedOptionId + '"]').text().trim()
eventLabel = checkedOptionLabel.length
? checkedOptionLabel
: $checkedOption.val()
options = { transport: 'beacon', label: eventLabel }
GOVUK.SearchAnalytics.trackEvent('brexit-checker-qa', questionKey, options)
})
} else {
// Skipped questions
options = { transport: 'beacon', label: 'no choice' }
GOVUK.SearchAnalytics.trackEvent('brexit-checker-qa', questionKey, options)
}
})
}
}
})(window, window.GOVUK)
## Instruction:
Replace jQuery `each` method with for loop
## Code After:
window.GOVUK = window.GOVUK || {}
window.GOVUK.Modules = window.GOVUK.Modules || {};
(function (global, GOVUK) {
'use strict'
GOVUK.Modules.TrackBrexitQaChoices = function () {
this.start = function (element) {
track(element)
}
function track (element) {
element.on('submit', function (event) {
var eventLabel, options
var $submittedForm = event.target
var $checkedOptions = $submittedForm.querySelectorAll('input:checked')
var questionKey = $submittedForm.data('question-key')
if ($checkedOptions.length) {
for (var i = 0; i < $checkedOptions.length; i++) {
var checkedOptionId = $checkedOptions[i].getAttribute('id')
var checkedOptionLabel = $submittedForm.find('label[for="' + checkedOptionId + '"]').text().trim()
eventLabel = checkedOptionLabel.length
? checkedOptionLabel
: $checkedOptions[i].val()
options = { transport: 'beacon', label: eventLabel }
GOVUK.SearchAnalytics.trackEvent('brexit-checker-qa', questionKey, options)
}
} else {
// Skipped questions
options = { transport: 'beacon', label: 'no choice' }
GOVUK.SearchAnalytics.trackEvent('brexit-checker-qa', questionKey, options)
}
})
}
}
})(window, window.GOVUK)
|
7e7f33146dbc60ecdd3e3183ceb8254fa6fb8eca | lib/spring/commands/cucumber.rb | lib/spring/commands/cucumber.rb | module Spring
module Commands
class Cucumber
class << self
attr_accessor :environment_matchers
end
self.environment_matchers = {
:default => "test",
/^features($|\/)/ => "test" # if a path is passed, make sure the default env is applied
}
def env(args)
# This is an adaption of the matching that Rake itself does.
# See: https://github.com/jimweirich/rake/blob/3754a7639b3f42c2347857a0878beb3523542aee/lib/rake/application.rb#L691-L692
if env = args.grep(/^(RAILS|RACK)_ENV=(.*)$/m).last
return env.split("=").last
end
self.class.environment_matchers.each do |matcher, environment|
return environment if matcher === (args.first || :default)
end
nil
end
end
Spring.register_command "cucumber", Cucumber.new
end
end
| module Spring
module Commands
class Cucumber
class << self
attr_accessor :environment_matchers
end
self.environment_matchers = {
:default => "test",
/^features($|\/)/ => "test" # if a path is passed, make sure the default env is applied
}
def env(args)
return ENV['RAILS_ENV'] if ENV['RAILS_ENV']
self.class.environment_matchers.each do |matcher, environment|
return environment if matcher === (args.first || :default)
end
nil
end
end
Spring.register_command "cucumber", Cucumber.new
end
end
| Replace Rake env variable handling with usual | Replace Rake env variable handling with usual
| Ruby | mit | jonleighton/spring-commands-cucumber | ruby | ## Code Before:
module Spring
module Commands
class Cucumber
class << self
attr_accessor :environment_matchers
end
self.environment_matchers = {
:default => "test",
/^features($|\/)/ => "test" # if a path is passed, make sure the default env is applied
}
def env(args)
# This is an adaption of the matching that Rake itself does.
# See: https://github.com/jimweirich/rake/blob/3754a7639b3f42c2347857a0878beb3523542aee/lib/rake/application.rb#L691-L692
if env = args.grep(/^(RAILS|RACK)_ENV=(.*)$/m).last
return env.split("=").last
end
self.class.environment_matchers.each do |matcher, environment|
return environment if matcher === (args.first || :default)
end
nil
end
end
Spring.register_command "cucumber", Cucumber.new
end
end
## Instruction:
Replace Rake env variable handling with usual
## Code After:
module Spring
module Commands
class Cucumber
class << self
attr_accessor :environment_matchers
end
self.environment_matchers = {
:default => "test",
/^features($|\/)/ => "test" # if a path is passed, make sure the default env is applied
}
def env(args)
return ENV['RAILS_ENV'] if ENV['RAILS_ENV']
self.class.environment_matchers.each do |matcher, environment|
return environment if matcher === (args.first || :default)
end
nil
end
end
Spring.register_command "cucumber", Cucumber.new
end
end
|
4d6a3b00595860f990e6d549bfc41e2fbaf0a8cf | templates/search.php | templates/search.php | <h2 class="govuk-heading-l">Search results for <?php the_search_query(); ?> </h2>
<?php if (have_posts()) { ?>
<?php while (have_posts()) : the_post() ?>
<article <?php post_class() ?>>
<header>
<h3 class=govuk-heading-m"><a href="<?php the_permalink() ?>"><?php the_title() ?></a></h3>
<?php get_template_part('templates/entry-meta') ?>
<?php if (has_post_thumbnail()) {
the_post_thumbnail('large');
} ?>
</header>
<?php the_excerpt() ?>
<?php get_template_part('templates/entry-footer') ?>
</article>
<?php endwhile ?>
<?php } else { ?>
<article>
<p>No results found on <strong><?php echo get_bloginfo('name'); ?></strong>.</p>
<p>Please try searching again using different words or try this search on <a href="https://www.gov.uk/">GOV.UK</a>.</p>
</article>
<?php } ?>
| <hr class="govuk-section-break govuk-section-break--l govuk-section-break--visible">
<h2 class="govuk-heading-l">Search results for <?php the_search_query(); ?> </h2>
<?php if (have_posts()) { ?>
<?php while (have_posts()) : the_post() ?>
<article <?php post_class() ?>>
<header>
<h3 class=govuk-heading-m"><a href="<?php the_permalink() ?>"><?php the_title() ?></a></h3>
<?php get_template_part('templates/entry-meta') ?>
<?php if (has_post_thumbnail()) {
the_post_thumbnail('large');
} ?>
</header>
<?php the_excerpt() ?>
<?php get_template_part('templates/entry-footer') ?>
</article>
<?php endwhile ?>
<?php } else { ?>
<article>
<p>No results found on <strong><?php echo get_bloginfo('name'); ?></strong>.</p>
<p>Please try searching again using different words or try this search on <a href="https://www.gov.uk/">GOV.UK</a>.</p>
</article>
<?php } ?>
| Add horizontal line element to header | Add horizontal line element to header
| PHP | mit | dxw/govuk-blogs,dxw/govuk-blogs,dxw/govuk-blogs | php | ## Code Before:
<h2 class="govuk-heading-l">Search results for <?php the_search_query(); ?> </h2>
<?php if (have_posts()) { ?>
<?php while (have_posts()) : the_post() ?>
<article <?php post_class() ?>>
<header>
<h3 class=govuk-heading-m"><a href="<?php the_permalink() ?>"><?php the_title() ?></a></h3>
<?php get_template_part('templates/entry-meta') ?>
<?php if (has_post_thumbnail()) {
the_post_thumbnail('large');
} ?>
</header>
<?php the_excerpt() ?>
<?php get_template_part('templates/entry-footer') ?>
</article>
<?php endwhile ?>
<?php } else { ?>
<article>
<p>No results found on <strong><?php echo get_bloginfo('name'); ?></strong>.</p>
<p>Please try searching again using different words or try this search on <a href="https://www.gov.uk/">GOV.UK</a>.</p>
</article>
<?php } ?>
## Instruction:
Add horizontal line element to header
## Code After:
<hr class="govuk-section-break govuk-section-break--l govuk-section-break--visible">
<h2 class="govuk-heading-l">Search results for <?php the_search_query(); ?> </h2>
<?php if (have_posts()) { ?>
<?php while (have_posts()) : the_post() ?>
<article <?php post_class() ?>>
<header>
<h3 class=govuk-heading-m"><a href="<?php the_permalink() ?>"><?php the_title() ?></a></h3>
<?php get_template_part('templates/entry-meta') ?>
<?php if (has_post_thumbnail()) {
the_post_thumbnail('large');
} ?>
</header>
<?php the_excerpt() ?>
<?php get_template_part('templates/entry-footer') ?>
</article>
<?php endwhile ?>
<?php } else { ?>
<article>
<p>No results found on <strong><?php echo get_bloginfo('name'); ?></strong>.</p>
<p>Please try searching again using different words or try this search on <a href="https://www.gov.uk/">GOV.UK</a>.</p>
</article>
<?php } ?>
|
ae18815f96933a7fcf98dda9ac7ea0de2ef22cba | src/app/core/error-handler/app-error-handler.service.ts | src/app/core/error-handler/app-error-handler.service.ts | import { Injectable, ErrorHandler } from '@angular/core';
import { HttpErrorResponse } from '@angular/common/http';
import { environment } from '@env/environment';
import { NotificationService } from '../notifications/notification.service';
import { NotificationStyles } from '../notifications/notification-styles';
/** Application-wide error handler that adds a UI notification to the error handling
* provided by the default Angular ErrorHandler.
*/
@Injectable()
export class AppErrorHandler extends ErrorHandler {
constructor(private notificationsService: NotificationService) {
super();
}
handleError(error: Error | HttpErrorResponse) {
let displayMessage = 'An error occurred.';
if (!environment.production) {
displayMessage += ' See console for details.';
}
this.notificationsService.error(displayMessage);
super.handleError(error);
}
}
| import { Injectable, ErrorHandler } from '@angular/core';
import { HttpErrorResponse } from '@angular/common/http';
import { environment } from '@env/environment';
import { NotificationService } from '../notifications/notification.service';
/** Application-wide error handler that adds a UI notification to the error handling
* provided by the default Angular ErrorHandler.
*/
@Injectable()
export class AppErrorHandler extends ErrorHandler {
constructor(private notificationsService: NotificationService) {
super();
}
handleError(error: Error | HttpErrorResponse) {
let displayMessage = 'An error occurred.';
if (!environment.production) {
displayMessage += ' See console for details.';
}
this.notificationsService.error(displayMessage);
super.handleError(error);
}
}
| Remove non existing import NotificationStyles | fix: Remove non existing import NotificationStyles
Remove a non existing import in the error handler service for NotificationStyles.
Can cause an error when typescript compiling the application. | TypeScript | mit | tomastrajan/angular-ngrx-material-starter,tomastrajan/angular-ngrx-material-starter,tomastrajan/angular-ngrx-material-starter,tomastrajan/angular-ngrx-material-starter | typescript | ## Code Before:
import { Injectable, ErrorHandler } from '@angular/core';
import { HttpErrorResponse } from '@angular/common/http';
import { environment } from '@env/environment';
import { NotificationService } from '../notifications/notification.service';
import { NotificationStyles } from '../notifications/notification-styles';
/** Application-wide error handler that adds a UI notification to the error handling
* provided by the default Angular ErrorHandler.
*/
@Injectable()
export class AppErrorHandler extends ErrorHandler {
constructor(private notificationsService: NotificationService) {
super();
}
handleError(error: Error | HttpErrorResponse) {
let displayMessage = 'An error occurred.';
if (!environment.production) {
displayMessage += ' See console for details.';
}
this.notificationsService.error(displayMessage);
super.handleError(error);
}
}
## Instruction:
fix: Remove non existing import NotificationStyles
Remove a non existing import in the error handler service for NotificationStyles.
Can cause an error when typescript compiling the application.
## Code After:
import { Injectable, ErrorHandler } from '@angular/core';
import { HttpErrorResponse } from '@angular/common/http';
import { environment } from '@env/environment';
import { NotificationService } from '../notifications/notification.service';
/** Application-wide error handler that adds a UI notification to the error handling
* provided by the default Angular ErrorHandler.
*/
@Injectable()
export class AppErrorHandler extends ErrorHandler {
constructor(private notificationsService: NotificationService) {
super();
}
handleError(error: Error | HttpErrorResponse) {
let displayMessage = 'An error occurred.';
if (!environment.production) {
displayMessage += ' See console for details.';
}
this.notificationsService.error(displayMessage);
super.handleError(error);
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.