commit stringlengths 40 40 | old_file stringlengths 4 184 | new_file stringlengths 4 184 | old_contents stringlengths 1 3.6k | new_contents stringlengths 5 3.38k | subject stringlengths 15 778 | message stringlengths 16 6.74k | lang stringclasses 201 values | license stringclasses 13 values | repos stringlengths 6 116k | config stringclasses 201 values | content stringlengths 137 7.24k | diff stringlengths 26 5.55k | diff_length int64 1 123 | relative_diff_length float64 0.01 89 | n_lines_added int64 0 108 | n_lines_deleted int64 0 106 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
18f7c6e32c548384b0693e10022308e7f7c1919d | build.sh | build.sh | set -e
PKG=scannerpy
NO_DEPS=false
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-n|--no-deps)
NO_DEPS=true
shift
;;
*)
esac
done
if [[ "$OSTYPE" == "linux-gnu" ]]; then
cores=$(nproc)
# ...
elif [[ "$OSTYPE" == "darwin"* ]]; then
cores=$(gnproc)
# Mac OSX
else
# Unknown.
echo "Unknown OSTYPE: $OSTYPE. Exiting."
exit 1
fi
pushd build
if make -j$cores; then
popd
if rm -rf dist && \
python3 setup.py bdist_wheel;
then
cwd=$(pwd)
# cd to /tmp to avoid name clashes with Python module name and any
# directories of the same name in our cwd
pushd /tmp
(yes | pip3 uninstall $PKG)
if $NO_DEPS; then
(yes | pip3 install --user --no-deps $cwd/dist/*);
else
(yes | pip3 install --user $cwd/dist/*);
fi
popd
fi
else
popd
fi
| set -e
PKG=scannerpy
NO_DEPS=false
FAIL_THROUGH=false
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-n|--no-deps)
NO_DEPS=true
shift
;;
-f|--fail-through)
FAIL_THROUGH=true
shift
;;
*)
esac
done
if [[ "$OSTYPE" == "linux-gnu" ]]; then
cores=$(nproc)
# ...
elif [[ "$OSTYPE" == "darwin"* ]]; then
cores=$(gnproc)
# Mac OSX
else
# Unknown.
echo "Unknown OSTYPE: $OSTYPE. Exiting."
exit 1
fi
pushd build
if make -j$cores; then
popd
if rm -rf dist && \
python3 setup.py bdist_wheel;
then
cwd=$(pwd)
# cd to /tmp to avoid name clashes with Python module name and any
# directories of the same name in our cwd
pushd /tmp
(yes | pip3 uninstall $PKG)
if $NO_DEPS; then
(yes | pip3 install --user --no-deps $cwd/dist/*);
else
(yes | pip3 install --user $cwd/dist/*);
fi
popd
fi
else
popd
if $FAIL_THROUGH; then
exit 1
fi
fi
| Add back fail through as flag | Add back fail through as flag
| Shell | apache-2.0 | scanner-research/scanner,scanner-research/scanner,scanner-research/scanner,scanner-research/scanner | shell | ## Code Before:
set -e
PKG=scannerpy
NO_DEPS=false
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-n|--no-deps)
NO_DEPS=true
shift
;;
*)
esac
done
if [[ "$OSTYPE" == "linux-gnu" ]]; then
cores=$(nproc)
# ...
elif [[ "$OSTYPE" == "darwin"* ]]; then
cores=$(gnproc)
# Mac OSX
else
# Unknown.
echo "Unknown OSTYPE: $OSTYPE. Exiting."
exit 1
fi
pushd build
if make -j$cores; then
popd
if rm -rf dist && \
python3 setup.py bdist_wheel;
then
cwd=$(pwd)
# cd to /tmp to avoid name clashes with Python module name and any
# directories of the same name in our cwd
pushd /tmp
(yes | pip3 uninstall $PKG)
if $NO_DEPS; then
(yes | pip3 install --user --no-deps $cwd/dist/*);
else
(yes | pip3 install --user $cwd/dist/*);
fi
popd
fi
else
popd
fi
## Instruction:
Add back fail through as flag
## Code After:
set -e
PKG=scannerpy
NO_DEPS=false
FAIL_THROUGH=false
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-n|--no-deps)
NO_DEPS=true
shift
;;
-f|--fail-through)
FAIL_THROUGH=true
shift
;;
*)
esac
done
if [[ "$OSTYPE" == "linux-gnu" ]]; then
cores=$(nproc)
# ...
elif [[ "$OSTYPE" == "darwin"* ]]; then
cores=$(gnproc)
# Mac OSX
else
# Unknown.
echo "Unknown OSTYPE: $OSTYPE. Exiting."
exit 1
fi
pushd build
if make -j$cores; then
popd
if rm -rf dist && \
python3 setup.py bdist_wheel;
then
cwd=$(pwd)
# cd to /tmp to avoid name clashes with Python module name and any
# directories of the same name in our cwd
pushd /tmp
(yes | pip3 uninstall $PKG)
if $NO_DEPS; then
(yes | pip3 install --user --no-deps $cwd/dist/*);
else
(yes | pip3 install --user $cwd/dist/*);
fi
popd
fi
else
popd
if $FAIL_THROUGH; then
exit 1
fi
fi
| set -e
PKG=scannerpy
NO_DEPS=false
+ FAIL_THROUGH=false
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-n|--no-deps)
NO_DEPS=true
+ shift
+ ;;
+ -f|--fail-through)
+ FAIL_THROUGH=true
shift
;;
*)
esac
done
if [[ "$OSTYPE" == "linux-gnu" ]]; then
cores=$(nproc)
# ...
elif [[ "$OSTYPE" == "darwin"* ]]; then
cores=$(gnproc)
# Mac OSX
else
# Unknown.
echo "Unknown OSTYPE: $OSTYPE. Exiting."
exit 1
fi
pushd build
if make -j$cores; then
popd
if rm -rf dist && \
python3 setup.py bdist_wheel;
then
cwd=$(pwd)
# cd to /tmp to avoid name clashes with Python module name and any
# directories of the same name in our cwd
pushd /tmp
(yes | pip3 uninstall $PKG)
if $NO_DEPS; then
(yes | pip3 install --user --no-deps $cwd/dist/*);
else
(yes | pip3 install --user $cwd/dist/*);
fi
popd
fi
else
popd
+ if $FAIL_THROUGH; then
+ exit 1
+ fi
fi | 8 | 0.156863 | 8 | 0 |
c77f37f3fa14256ea1f47a7518635ba44c299da2 | src/modules/opengl/filter_deconvolution_sharpen.yml | src/modules/opengl/filter_deconvolution_sharpen.yml | schema_version: 0.1
type: filter
identifier: movit.sharpen
title: Deconvolution Sharpen (GLSL)
version: 1
copyright: Dan Dennedy
creator: Steinar H. Gunderson
license: GPLv2
language: en
tags:
- Video
description: >
Deconvolution Sharpen is a filter that sharpens by way of deconvolution
(i.e., trying to reverse the blur kernel, as opposed to just boosting high
frequencies), more specifically by FIR Wiener filters. It is the same
algorithm as used by the (now largely abandoned) Refocus plug-in for GIMP,
and I suspect the same as in Photoshop's “Smart Sharpen” filter.
The effect gives generally better results than unsharp masking, but can be very
GPU intensive, and requires a fair bit of tweaking to get good results without
ringing and/or excessive noise. It should be mentioned that for the larger
parameters:
- identifier: matrix_size
title: Matrix Size
type: integer
minimum: 0
maximum: 10
default: 5
- identifier: circle_radius
title: Circle Radius
type: float
minimum: 0
default: 2
- identifier: gaussian_radius
title: Gaussian Radius
type: float
minimum: 0
default: 0
- identifier: correlation
title: Correlation
type: float
minimum: 0
default: 0.95
- identifier: noise
title: Noise Level
type: float
minimum: 0
default: 0.01
| schema_version: 0.1
type: filter
identifier: movit.sharpen
title: Deconvolution Sharpen (GLSL)
version: 1
copyright: Dan Dennedy
creator: Steinar H. Gunderson
license: GPLv2
language: en
tags:
- Video
description: >
Deconvolution Sharpen is a filter that sharpens by way of deconvolution
(i.e., trying to reverse the blur kernel, as opposed to just boosting high
frequencies), more specifically by FIR Wiener filters. It is the same
algorithm as used by the (now largely abandoned) Refocus plug-in for GIMP,
and I suspect the same as in Photoshop's “Smart Sharpen” filter.
The effect gives generally better results than unsharp masking, but can be very
GPU intensive, and requires a fair bit of tweaking to get good results without
ringing and/or excessive noise.
parameters:
- identifier: matrix_size
title: Matrix Size
type: integer
minimum: 0
maximum: 10
default: 5
- identifier: circle_radius
title: Circle Radius
type: float
minimum: 0
default: 2
- identifier: gaussian_radius
title: Gaussian Radius
type: float
minimum: 0
default: 0
- identifier: correlation
title: Correlation
type: float
minimum: 0
default: 0.95
- identifier: noise
title: Noise Level
type: float
minimum: 0
default: 0.01
| Fix type in movit.sharpen metadata. | Fix type in movit.sharpen metadata.
| YAML | lgpl-2.1 | zzhhui/mlt,mltframework/mlt,wideioltd/mlt,xzhavilla/mlt,anba8005/mlt,xzhavilla/mlt,mltframework/mlt,j-b-m/mlt,xzhavilla/mlt,xzhavilla/mlt,j-b-m/mlt,anba8005/mlt,j-b-m/mlt,j-b-m/mlt,j-b-m/mlt,siddharudh/mlt,mltframework/mlt,mltframework/mlt,wideioltd/mlt,zzhhui/mlt,j-b-m/mlt,j-b-m/mlt,wideioltd/mlt,siddharudh/mlt,anba8005/mlt,mltframework/mlt,j-b-m/mlt,mltframework/mlt,anba8005/mlt,xzhavilla/mlt,siddharudh/mlt,siddharudh/mlt,zzhhui/mlt,wideioltd/mlt,zzhhui/mlt,anba8005/mlt,j-b-m/mlt,mltframework/mlt,wideioltd/mlt,wideioltd/mlt,anba8005/mlt,wideioltd/mlt,mltframework/mlt,siddharudh/mlt,siddharudh/mlt,mltframework/mlt,siddharudh/mlt,xzhavilla/mlt,siddharudh/mlt,mltframework/mlt,xzhavilla/mlt,xzhavilla/mlt,anba8005/mlt,zzhhui/mlt,wideioltd/mlt,wideioltd/mlt,siddharudh/mlt,zzhhui/mlt,anba8005/mlt,zzhhui/mlt,xzhavilla/mlt,anba8005/mlt,j-b-m/mlt,zzhhui/mlt,zzhhui/mlt | yaml | ## Code Before:
schema_version: 0.1
type: filter
identifier: movit.sharpen
title: Deconvolution Sharpen (GLSL)
version: 1
copyright: Dan Dennedy
creator: Steinar H. Gunderson
license: GPLv2
language: en
tags:
- Video
description: >
Deconvolution Sharpen is a filter that sharpens by way of deconvolution
(i.e., trying to reverse the blur kernel, as opposed to just boosting high
frequencies), more specifically by FIR Wiener filters. It is the same
algorithm as used by the (now largely abandoned) Refocus plug-in for GIMP,
and I suspect the same as in Photoshop's “Smart Sharpen” filter.
The effect gives generally better results than unsharp masking, but can be very
GPU intensive, and requires a fair bit of tweaking to get good results without
ringing and/or excessive noise. It should be mentioned that for the larger
parameters:
- identifier: matrix_size
title: Matrix Size
type: integer
minimum: 0
maximum: 10
default: 5
- identifier: circle_radius
title: Circle Radius
type: float
minimum: 0
default: 2
- identifier: gaussian_radius
title: Gaussian Radius
type: float
minimum: 0
default: 0
- identifier: correlation
title: Correlation
type: float
minimum: 0
default: 0.95
- identifier: noise
title: Noise Level
type: float
minimum: 0
default: 0.01
## Instruction:
Fix type in movit.sharpen metadata.
## Code After:
schema_version: 0.1
type: filter
identifier: movit.sharpen
title: Deconvolution Sharpen (GLSL)
version: 1
copyright: Dan Dennedy
creator: Steinar H. Gunderson
license: GPLv2
language: en
tags:
- Video
description: >
Deconvolution Sharpen is a filter that sharpens by way of deconvolution
(i.e., trying to reverse the blur kernel, as opposed to just boosting high
frequencies), more specifically by FIR Wiener filters. It is the same
algorithm as used by the (now largely abandoned) Refocus plug-in for GIMP,
and I suspect the same as in Photoshop's “Smart Sharpen” filter.
The effect gives generally better results than unsharp masking, but can be very
GPU intensive, and requires a fair bit of tweaking to get good results without
ringing and/or excessive noise.
parameters:
- identifier: matrix_size
title: Matrix Size
type: integer
minimum: 0
maximum: 10
default: 5
- identifier: circle_radius
title: Circle Radius
type: float
minimum: 0
default: 2
- identifier: gaussian_radius
title: Gaussian Radius
type: float
minimum: 0
default: 0
- identifier: correlation
title: Correlation
type: float
minimum: 0
default: 0.95
- identifier: noise
title: Noise Level
type: float
minimum: 0
default: 0.01
| schema_version: 0.1
type: filter
identifier: movit.sharpen
title: Deconvolution Sharpen (GLSL)
version: 1
copyright: Dan Dennedy
creator: Steinar H. Gunderson
license: GPLv2
language: en
tags:
- Video
description: >
Deconvolution Sharpen is a filter that sharpens by way of deconvolution
(i.e., trying to reverse the blur kernel, as opposed to just boosting high
frequencies), more specifically by FIR Wiener filters. It is the same
algorithm as used by the (now largely abandoned) Refocus plug-in for GIMP,
and I suspect the same as in Photoshop's “Smart Sharpen” filter.
The effect gives generally better results than unsharp masking, but can be very
GPU intensive, and requires a fair bit of tweaking to get good results without
- ringing and/or excessive noise. It should be mentioned that for the larger
+ ringing and/or excessive noise.
parameters:
- identifier: matrix_size
title: Matrix Size
type: integer
minimum: 0
maximum: 10
default: 5
- identifier: circle_radius
title: Circle Radius
type: float
minimum: 0
default: 2
- identifier: gaussian_radius
title: Gaussian Radius
type: float
minimum: 0
default: 0
- identifier: correlation
title: Correlation
type: float
minimum: 0
default: 0.95
- identifier: noise
title: Noise Level
type: float
minimum: 0
default: 0.01
| 2 | 0.037736 | 1 | 1 |
c8faef9f288012b4e60f71af9e0f3d541b235c83 | DatabaseCreationScript.sql | DatabaseCreationScript.sql | -- --------------------
-- Author: John Zumbrum
-- Date: 06/25/2016
-- --------------------
IF NOT EXISTS(SELECT * FROM sys.databases WHERE name='SlackerNews')
CREATE DATABASE SlackerNews
GO
Use SlackerNews
GO
IF NOT EXISTS(SELECT * FROM sys.tables WHERE name='articles')
CREATE TABLE articles (
id INT IDENTITY PRIMARY KEY,
hn_article_id INT NOT NULL UNIQUE,
title NVARCHAR(MAX),
content NVARCHAR(MAX),
create_datetime DATETIME NOT NULL,
score INT NOT NULL DEFAULT 0,
num_comments INT NOT NULL DEFAULT 0,
url NVARCHAR(MAX),
top_comment_text NVARCHAR(MAX),
semantic_summary NVARCHAR(MAX),
tags NVARCHAR(MAX)
)
GO
CREATE LOGIN slackernews_user WITH PASSWORD = 'Farfignuegen3'
Use SlackerNews
GO
CREATE USER slackernews_user FOR LOGIN slackernews_user
EXECUTE sp_addrolemember N'db_datawriter', N'slackernews_user'
EXECUTE sp_addrolemember N'db_datareader', N'slackernews_user' | -- --------------------
-- Author: John Zumbrum
-- Date: 06/25/2016
-- --------------------
IF NOT EXISTS(SELECT * FROM sys.databases WHERE name='SlackerNews')
CREATE DATABASE SlackerNews
GO
Use SlackerNews
GO
IF NOT EXISTS(SELECT * FROM sys.tables WHERE name='articles')
CREATE TABLE articles (
id INT IDENTITY PRIMARY KEY,
hn_article_id INT NOT NULL UNIQUE,
title NVARCHAR(MAX),
content NVARCHAR(MAX),
create_datetime DATETIME NOT NULL,
score INT NOT NULL DEFAULT 0,
num_comments INT NOT NULL DEFAULT 0,
url NVARCHAR(MAX),
top_comment_text NVARCHAR(MAX),
semantic_summary NVARCHAR(MAX),
tags NVARCHAR(MAX)
)
GO
CREATE LOGIN slackernews_user WITH PASSWORD = 'Farfignuegen3'
Use SlackerNews
GO
CREATE USER slackernews_user FOR LOGIN slackernews_user
EXECUTE sp_addrolemember N'db_datawriter', N'slackernews_user'
EXECUTE sp_addrolemember N'db_datareader', N'slackernews_user'
-- make sure to enable sql server logins for your SQL Server instance! | Tweak the create script to include instructions for enabling sql logins | Tweak the create script to include instructions for enabling sql logins
| SQL | mit | TheRealJZ/slackernews,TheRealJZ/slackernews | sql | ## Code Before:
-- --------------------
-- Author: John Zumbrum
-- Date: 06/25/2016
-- --------------------
IF NOT EXISTS(SELECT * FROM sys.databases WHERE name='SlackerNews')
CREATE DATABASE SlackerNews
GO
Use SlackerNews
GO
IF NOT EXISTS(SELECT * FROM sys.tables WHERE name='articles')
CREATE TABLE articles (
id INT IDENTITY PRIMARY KEY,
hn_article_id INT NOT NULL UNIQUE,
title NVARCHAR(MAX),
content NVARCHAR(MAX),
create_datetime DATETIME NOT NULL,
score INT NOT NULL DEFAULT 0,
num_comments INT NOT NULL DEFAULT 0,
url NVARCHAR(MAX),
top_comment_text NVARCHAR(MAX),
semantic_summary NVARCHAR(MAX),
tags NVARCHAR(MAX)
)
GO
CREATE LOGIN slackernews_user WITH PASSWORD = 'Farfignuegen3'
Use SlackerNews
GO
CREATE USER slackernews_user FOR LOGIN slackernews_user
EXECUTE sp_addrolemember N'db_datawriter', N'slackernews_user'
EXECUTE sp_addrolemember N'db_datareader', N'slackernews_user'
## Instruction:
Tweak the create script to include instructions for enabling sql logins
## Code After:
-- --------------------
-- Author: John Zumbrum
-- Date: 06/25/2016
-- --------------------
IF NOT EXISTS(SELECT * FROM sys.databases WHERE name='SlackerNews')
CREATE DATABASE SlackerNews
GO
Use SlackerNews
GO
IF NOT EXISTS(SELECT * FROM sys.tables WHERE name='articles')
CREATE TABLE articles (
id INT IDENTITY PRIMARY KEY,
hn_article_id INT NOT NULL UNIQUE,
title NVARCHAR(MAX),
content NVARCHAR(MAX),
create_datetime DATETIME NOT NULL,
score INT NOT NULL DEFAULT 0,
num_comments INT NOT NULL DEFAULT 0,
url NVARCHAR(MAX),
top_comment_text NVARCHAR(MAX),
semantic_summary NVARCHAR(MAX),
tags NVARCHAR(MAX)
)
GO
CREATE LOGIN slackernews_user WITH PASSWORD = 'Farfignuegen3'
Use SlackerNews
GO
CREATE USER slackernews_user FOR LOGIN slackernews_user
EXECUTE sp_addrolemember N'db_datawriter', N'slackernews_user'
EXECUTE sp_addrolemember N'db_datareader', N'slackernews_user'
-- make sure to enable sql server logins for your SQL Server instance! | -- --------------------
-- Author: John Zumbrum
-- Date: 06/25/2016
-- --------------------
IF NOT EXISTS(SELECT * FROM sys.databases WHERE name='SlackerNews')
CREATE DATABASE SlackerNews
GO
Use SlackerNews
GO
IF NOT EXISTS(SELECT * FROM sys.tables WHERE name='articles')
CREATE TABLE articles (
id INT IDENTITY PRIMARY KEY,
hn_article_id INT NOT NULL UNIQUE,
title NVARCHAR(MAX),
content NVARCHAR(MAX),
create_datetime DATETIME NOT NULL,
score INT NOT NULL DEFAULT 0,
num_comments INT NOT NULL DEFAULT 0,
url NVARCHAR(MAX),
top_comment_text NVARCHAR(MAX),
semantic_summary NVARCHAR(MAX),
tags NVARCHAR(MAX)
)
GO
CREATE LOGIN slackernews_user WITH PASSWORD = 'Farfignuegen3'
Use SlackerNews
GO
CREATE USER slackernews_user FOR LOGIN slackernews_user
EXECUTE sp_addrolemember N'db_datawriter', N'slackernews_user'
EXECUTE sp_addrolemember N'db_datareader', N'slackernews_user'
+
+ -- make sure to enable sql server logins for your SQL Server instance! | 2 | 0.060606 | 2 | 0 |
4f8be04f4e51c10fcaa0efd8eb004ea7860f1a56 | activestorage/test/dummy/config/application.rb | activestorage/test/dummy/config/application.rb | require_relative 'boot'
require "rails"
require "active_model/railtie"
require "active_job/railtie"
require "active_record/railtie"
require "action_controller/railtie"
require "action_view/railtie"
require "sprockets/railtie"
#require "action_mailer/railtie"
#require "rails/test_unit/railtie"
#require "action_cable/engine"
Bundler.require(*Rails.groups)
require "active_storage"
module Dummy
class Application < Rails::Application
config.load_defaults 5.1
config.active_storage.service = :local
end
end
| require_relative 'boot'
require "rails"
require "active_model/railtie"
require "active_job/railtie"
require "active_record/railtie"
require "action_controller/railtie"
require "action_view/railtie"
require "sprockets/railtie"
require "active_storage/engine"
#require "action_mailer/railtie"
#require "rails/test_unit/railtie"
#require "action_cable/engine"
Bundler.require(*Rails.groups)
module Dummy
class Application < Rails::Application
config.load_defaults 5.1
config.active_storage.service = :local
end
end
| Fix dummy app for inclusion in Rails | Fix dummy app for inclusion in Rails
| Ruby | mit | kamipo/rails,notapatch/rails,yhirano55/rails,travisofthenorth/rails,kamipo/rails,bogdanvlviv/rails,illacceptanything/illacceptanything,jeremy/rails,mathieujobin/reduced-rails-for-travis,yahonda/rails,Stellenticket/rails,gfvcastro/rails,mechanicles/rails,ledestin/rails,illacceptanything/illacceptanything,georgeclaghorn/rails,tjschuck/rails,eileencodes/rails,yawboakye/rails,mathieujobin/reduced-rails-for-travis,yasslab/railsguides.jp,aditya-kapoor/rails,mathieujobin/reduced-rails-for-travis,aditya-kapoor/rails,rails/rails,odedniv/rails,flanger001/rails,kmayer/rails,printercu/rails,MSP-Greg/rails,deraru/rails,arunagw/rails,eileencodes/rails,MSP-Greg/rails,georgeclaghorn/rails,Stellenticket/rails,felipecvo/rails,baerjam/rails,BlakeWilliams/rails,kaspth/rails,gauravtiwari/rails,deraru/rails,tgxworld/rails,shioyama/rails,eileencodes/rails,illacceptanything/illacceptanything,mohitnatoo/rails,flanger001/rails,assain/rails,prathamesh-sonpatki/rails,palkan/rails,mechanicles/rails,Vasfed/rails,notapatch/rails,Erol/rails,fabianoleittes/rails,betesh/rails,yalab/rails,joonyou/rails,Sen-Zhang/rails,alecspopa/rails,prathamesh-sonpatki/rails,flanger001/rails,tjschuck/rails,deraru/rails,alecspopa/rails,bogdanvlviv/rails,repinel/rails,baerjam/rails,kirs/rails-1,esparta/rails,schuetzm/rails,kddeisz/rails,Edouard-chin/rails,yhirano55/rails,esparta/rails,Envek/rails,printercu/rails,untidy-hair/rails,Stellenticket/rails,illacceptanything/illacceptanything,Edouard-chin/rails,fabianoleittes/rails,yawboakye/rails,tjschuck/rails,mohitnatoo/rails,MSP-Greg/rails,travisofthenorth/rails,shioyama/rails,bogdanvlviv/rails,palkan/rails,alecspopa/rails,kamipo/rails,jeremy/rails,odedniv/rails,assain/rails,starknx/rails,yahonda/rails,illacceptanything/illacceptanything,brchristian/rails,tjschuck/rails,jeremy/rails,yahonda/rails,ledestin/rails,illacceptanything/illacceptanything,kddeisz/rails,illacceptanything/illacceptanything,iainbeeston/rails,esparta/rails,BlakeWilliams/rails,arunagw/rails,mohitnatoo/rails,rafaelfranca/omg-rails,shioyama/rails,vipulnsward/rails,felipecvo/rails,Sen-Zhang/rails,illacceptanything/illacceptanything,palkan/rails,joonyou/rails,gfvcastro/rails,BlakeWilliams/rails,untidy-hair/rails,gcourtemanche/rails,eileencodes/rails,notapatch/rails,utilum/rails,gauravtiwari/rails,lcreid/rails,assain/rails,georgeclaghorn/rails,baerjam/rails,EmmaB/rails-1,prathamesh-sonpatki/rails,yhirano55/rails,Vasfed/rails,ledestin/rails,illacceptanything/illacceptanything,starknx/rails,Envek/rails,utilum/rails,utilum/rails,lcreid/rails,Envek/rails,schuetzm/rails,notapatch/rails,utilum/rails,lcreid/rails,repinel/rails,shioyama/rails,kddeisz/rails,baerjam/rails,joonyou/rails,EmmaB/rails-1,kaspth/rails,aditya-kapoor/rails,georgeclaghorn/rails,tgxworld/rails,betesh/rails,aditya-kapoor/rails,odedniv/rails,illacceptanything/illacceptanything,tgxworld/rails,illacceptanything/illacceptanything,Edouard-chin/rails,schuetzm/rails,brchristian/rails,vipulnsward/rails,kirs/rails-1,iainbeeston/rails,yahonda/rails,prathamesh-sonpatki/rails,yasslab/railsguides.jp,yalab/rails,starknx/rails,kmcphillips/rails,Erol/rails,Stellenticket/rails,palkan/rails,repinel/rails,Edouard-chin/rails,illacceptanything/illacceptanything,yasslab/railsguides.jp,brchristian/rails,yalab/rails,rafaelfranca/omg-rails,travisofthenorth/rails,gfvcastro/rails,deraru/rails,yalab/rails,yhirano55/rails,untidy-hair/rails,lcreid/rails,fabianoleittes/rails,gauravtiwari/rails,Vasfed/rails,Erol/rails,mechanicles/rails,kmayer/rails,tgxworld/rails,felipecvo/rails,betesh/rails,betesh/rails,iainbeeston/rails,arunagw/rails,gfvcastro/rails,yawboakye/rails,kmcphillips/rails,EmmaB/rails-1,fabianoleittes/rails,illacceptanything/illacceptanything,kmcphillips/rails,travisofthenorth/rails,Envek/rails,kmayer/rails,printercu/rails,kddeisz/rails,mohitnatoo/rails,yasslab/railsguides.jp,gcourtemanche/rails,flanger001/rails,yawboakye/rails,vipulnsward/rails,kaspth/rails,mechanicles/rails,printercu/rails,kmcphillips/rails,gcourtemanche/rails,Erol/rails,joonyou/rails,rails/rails,Vasfed/rails,illacceptanything/illacceptanything,rafaelfranca/omg-rails,iainbeeston/rails,Sen-Zhang/rails,repinel/rails,assain/rails,pvalena/rails,jeremy/rails,arunagw/rails,kirs/rails-1,bogdanvlviv/rails,untidy-hair/rails,MSP-Greg/rails,schuetzm/rails,BlakeWilliams/rails,rails/rails,pvalena/rails,illacceptanything/illacceptanything,pvalena/rails,rails/rails,vipulnsward/rails,pvalena/rails,esparta/rails | ruby | ## Code Before:
require_relative 'boot'
require "rails"
require "active_model/railtie"
require "active_job/railtie"
require "active_record/railtie"
require "action_controller/railtie"
require "action_view/railtie"
require "sprockets/railtie"
#require "action_mailer/railtie"
#require "rails/test_unit/railtie"
#require "action_cable/engine"
Bundler.require(*Rails.groups)
require "active_storage"
module Dummy
class Application < Rails::Application
config.load_defaults 5.1
config.active_storage.service = :local
end
end
## Instruction:
Fix dummy app for inclusion in Rails
## Code After:
require_relative 'boot'
require "rails"
require "active_model/railtie"
require "active_job/railtie"
require "active_record/railtie"
require "action_controller/railtie"
require "action_view/railtie"
require "sprockets/railtie"
require "active_storage/engine"
#require "action_mailer/railtie"
#require "rails/test_unit/railtie"
#require "action_cable/engine"
Bundler.require(*Rails.groups)
module Dummy
class Application < Rails::Application
config.load_defaults 5.1
config.active_storage.service = :local
end
end
| require_relative 'boot'
require "rails"
require "active_model/railtie"
require "active_job/railtie"
require "active_record/railtie"
require "action_controller/railtie"
require "action_view/railtie"
require "sprockets/railtie"
+ require "active_storage/engine"
#require "action_mailer/railtie"
#require "rails/test_unit/railtie"
#require "action_cable/engine"
Bundler.require(*Rails.groups)
- require "active_storage"
module Dummy
class Application < Rails::Application
config.load_defaults 5.1
config.active_storage.service = :local
end
end
- | 3 | 0.12 | 1 | 2 |
ca9ad470d72052099a16381430cf6b1f3092d3cb | README.md | README.md | * Project 1: Simple Multi-threaded Web Server (Java)
| * Project 1: Simple Multi-threaded Web Server (Java)
* Project 2: Intro to Packet Sniffing with libpcap (C)
* Project 3: Simple Streaming Video Server (Java)
| Add descriptions for projects 2 and 3 | Add descriptions for projects 2 and 3
| Markdown | bsd-3-clause | sjbarag/ECE-C433,sjbarag/ECE-C433,sjbarag/ECE-C433 | markdown | ## Code Before:
* Project 1: Simple Multi-threaded Web Server (Java)
## Instruction:
Add descriptions for projects 2 and 3
## Code After:
* Project 1: Simple Multi-threaded Web Server (Java)
* Project 2: Intro to Packet Sniffing with libpcap (C)
* Project 3: Simple Streaming Video Server (Java)
| * Project 1: Simple Multi-threaded Web Server (Java)
+ * Project 2: Intro to Packet Sniffing with libpcap (C)
+ * Project 3: Simple Streaming Video Server (Java) | 2 | 2 | 2 | 0 |
4fcce3d1949be78d089eb9628ba79f02c1d63401 | .travis.yml | .travis.yml | language: objective-c
xcode_workspace: iOrwell.xcworkspace
xcode_scheme: iOrwell
xcode_sdk: iphonesimulator
before_install:
- gem install cocoapods
| language: objective-c
#xcode_workspace: iOrwell.xcworkspace
#xcode_scheme: iOrwell
#xcode_sdk: iphonesimulator
before_install:
- gem install cocoapods
- gem install xcpretty
script:
- xcodebuild -workspace iOrwell.xcworkspace -sdk iphonesimulator -scheme iOrwell build test | xcpretty
| Switch to xc|pretty for build as xctool is broken | Switch to xc|pretty for build as xctool is broken
| YAML | bsd-2-clause | orwell-int/client-ios,orwell-int/client-ios | yaml | ## Code Before:
language: objective-c
xcode_workspace: iOrwell.xcworkspace
xcode_scheme: iOrwell
xcode_sdk: iphonesimulator
before_install:
- gem install cocoapods
## Instruction:
Switch to xc|pretty for build as xctool is broken
## Code After:
language: objective-c
#xcode_workspace: iOrwell.xcworkspace
#xcode_scheme: iOrwell
#xcode_sdk: iphonesimulator
before_install:
- gem install cocoapods
- gem install xcpretty
script:
- xcodebuild -workspace iOrwell.xcworkspace -sdk iphonesimulator -scheme iOrwell build test | xcpretty
| language: objective-c
- xcode_workspace: iOrwell.xcworkspace
+ #xcode_workspace: iOrwell.xcworkspace
? +
- xcode_scheme: iOrwell
+ #xcode_scheme: iOrwell
? +
- xcode_sdk: iphonesimulator
+ #xcode_sdk: iphonesimulator
? +
before_install:
- gem install cocoapods
+ - gem install xcpretty
+ script:
+ - xcodebuild -workspace iOrwell.xcworkspace -sdk iphonesimulator -scheme iOrwell build test | xcpretty
+ | 10 | 1.25 | 7 | 3 |
5703bc11337c723dfb313a60516704e885b1559e | client/src/components/StreamField/scss/components/c-sf-add-button.scss | client/src/components/StreamField/scss/components/c-sf-add-button.scss | .c-sf-add-button {
display: grid;
align-items: center;
justify-content: center;
width: theme('spacing.5');
height: theme('spacing.5');
appearance: none;
color: $color-teal;
background-color: $color-white;
padding: 0;
cursor: pointer;
opacity: 0;
pointer-events: none;
border: 1px solid currentColor;
border-radius: theme('borderRadius.full');
margin-inline-start: theme('spacing.[0.5]');
.icon {
width: theme('spacing.3');
height: theme('spacing.3');
transition: transform $add-transition-duration ease-in-out;
}
&--close .icon {
transform: rotate(45deg);
}
&--visible {
opacity: 1;
pointer-events: unset;
@media (hover: hover) {
opacity: 0;
.w-panel--nested:is(:hover, :focus-within) & {
opacity: 1;
}
}
}
&:hover,
&:focus-visible {
color: $color-white;
background-color: $color-teal;
}
&[disabled] {
opacity: 0.2;
pointer-events: none;
@media (forced-colors: active) {
color: GrayText;
}
}
}
| .c-sf-add-button {
display: grid;
align-items: center;
justify-content: center;
width: theme('spacing.5');
height: theme('spacing.5');
appearance: none;
color: $color-teal;
background-color: $color-white;
padding: 0;
cursor: pointer;
opacity: 0;
pointer-events: none;
border: 1px solid currentColor;
border-radius: theme('borderRadius.full');
margin-inline-start: theme('spacing.[0.5]');
.icon {
width: theme('spacing.3');
height: theme('spacing.3');
transition: transform $add-transition-duration ease-in-out;
}
&--close .icon {
transform: rotate(45deg);
}
&--visible {
opacity: 1;
pointer-events: unset;
@media (hover: hover) {
opacity: 0;
.w-panel--nested:is(:hover, :focus-within) & {
opacity: 1;
}
}
}
&:hover,
&:focus-visible {
color: $color-white;
background-color: $color-teal;
}
&[disabled] {
opacity: 0.2;
pointer-events: none;
@media (forced-colors: active) {
color: GrayText;
}
@media (hover: hover) {
opacity: 0;
.w-panel--nested:is(:hover, :focus-within) & {
opacity: 0.2;
}
}
}
}
| Fix disabled style on StreamField add button | Fix disabled style on StreamField add button
Fixes #9512
An `opacity: 0.2` style is defined for the disabled button state, but the `opacity: 1` hover style takes precedence over it. As a result, the only time it kicks in - on media with hover support - is when the StreamField does NOT have hover / focus, which would ordinarily be the time when the button is hidden entirely.
Fix this by adding hover states to the `&[disabled]` case, to match the order of precedence for the normal button state.
| SCSS | bsd-3-clause | wagtail/wagtail,rsalmaso/wagtail,wagtail/wagtail,rsalmaso/wagtail,rsalmaso/wagtail,wagtail/wagtail,wagtail/wagtail,wagtail/wagtail,rsalmaso/wagtail,rsalmaso/wagtail | scss | ## Code Before:
.c-sf-add-button {
display: grid;
align-items: center;
justify-content: center;
width: theme('spacing.5');
height: theme('spacing.5');
appearance: none;
color: $color-teal;
background-color: $color-white;
padding: 0;
cursor: pointer;
opacity: 0;
pointer-events: none;
border: 1px solid currentColor;
border-radius: theme('borderRadius.full');
margin-inline-start: theme('spacing.[0.5]');
.icon {
width: theme('spacing.3');
height: theme('spacing.3');
transition: transform $add-transition-duration ease-in-out;
}
&--close .icon {
transform: rotate(45deg);
}
&--visible {
opacity: 1;
pointer-events: unset;
@media (hover: hover) {
opacity: 0;
.w-panel--nested:is(:hover, :focus-within) & {
opacity: 1;
}
}
}
&:hover,
&:focus-visible {
color: $color-white;
background-color: $color-teal;
}
&[disabled] {
opacity: 0.2;
pointer-events: none;
@media (forced-colors: active) {
color: GrayText;
}
}
}
## Instruction:
Fix disabled style on StreamField add button
Fixes #9512
An `opacity: 0.2` style is defined for the disabled button state, but the `opacity: 1` hover style takes precedence over it. As a result, the only time it kicks in - on media with hover support - is when the StreamField does NOT have hover / focus, which would ordinarily be the time when the button is hidden entirely.
Fix this by adding hover states to the `&[disabled]` case, to match the order of precedence for the normal button state.
## Code After:
.c-sf-add-button {
display: grid;
align-items: center;
justify-content: center;
width: theme('spacing.5');
height: theme('spacing.5');
appearance: none;
color: $color-teal;
background-color: $color-white;
padding: 0;
cursor: pointer;
opacity: 0;
pointer-events: none;
border: 1px solid currentColor;
border-radius: theme('borderRadius.full');
margin-inline-start: theme('spacing.[0.5]');
.icon {
width: theme('spacing.3');
height: theme('spacing.3');
transition: transform $add-transition-duration ease-in-out;
}
&--close .icon {
transform: rotate(45deg);
}
&--visible {
opacity: 1;
pointer-events: unset;
@media (hover: hover) {
opacity: 0;
.w-panel--nested:is(:hover, :focus-within) & {
opacity: 1;
}
}
}
&:hover,
&:focus-visible {
color: $color-white;
background-color: $color-teal;
}
&[disabled] {
opacity: 0.2;
pointer-events: none;
@media (forced-colors: active) {
color: GrayText;
}
@media (hover: hover) {
opacity: 0;
.w-panel--nested:is(:hover, :focus-within) & {
opacity: 0.2;
}
}
}
}
| .c-sf-add-button {
display: grid;
align-items: center;
justify-content: center;
width: theme('spacing.5');
height: theme('spacing.5');
appearance: none;
color: $color-teal;
background-color: $color-white;
padding: 0;
cursor: pointer;
opacity: 0;
pointer-events: none;
border: 1px solid currentColor;
border-radius: theme('borderRadius.full');
margin-inline-start: theme('spacing.[0.5]');
.icon {
width: theme('spacing.3');
height: theme('spacing.3');
transition: transform $add-transition-duration ease-in-out;
}
&--close .icon {
transform: rotate(45deg);
}
&--visible {
opacity: 1;
pointer-events: unset;
@media (hover: hover) {
opacity: 0;
.w-panel--nested:is(:hover, :focus-within) & {
opacity: 1;
}
}
}
&:hover,
&:focus-visible {
color: $color-white;
background-color: $color-teal;
}
&[disabled] {
opacity: 0.2;
pointer-events: none;
@media (forced-colors: active) {
color: GrayText;
}
+
+ @media (hover: hover) {
+ opacity: 0;
+
+ .w-panel--nested:is(:hover, :focus-within) & {
+ opacity: 0.2;
+ }
+ }
}
} | 8 | 0.145455 | 8 | 0 |
8b43dec082048abe0c5f3e1077f818b3ecea1cc0 | .travis.yml | .travis.yml | language: csharp
dist: trusty
mono: none
dotnet: 2.0.0
script:
- cd dotnet-setversion
- dotnet restore
- dotnet build
- dotnet pack -c Release -o artifacts/
| language: csharp
dist: trusty
mono: none
dotnet: 2.0.0
script:
- cd dotnet-setversion
- dotnet restore
- dotnet build
- dotnet pack -c Release -o artifacts/
- dotnet nuget push --source https://www.nuget.org/api/v2/package --api-key $NUGET_APIKEY $(find artifacts -name "*.nupkg")
| Configure NuGet publication during CI build | Configure NuGet publication during CI build
| YAML | mit | TAGC/dotnet-setversion | yaml | ## Code Before:
language: csharp
dist: trusty
mono: none
dotnet: 2.0.0
script:
- cd dotnet-setversion
- dotnet restore
- dotnet build
- dotnet pack -c Release -o artifacts/
## Instruction:
Configure NuGet publication during CI build
## Code After:
language: csharp
dist: trusty
mono: none
dotnet: 2.0.0
script:
- cd dotnet-setversion
- dotnet restore
- dotnet build
- dotnet pack -c Release -o artifacts/
- dotnet nuget push --source https://www.nuget.org/api/v2/package --api-key $NUGET_APIKEY $(find artifacts -name "*.nupkg")
| language: csharp
dist: trusty
mono: none
dotnet: 2.0.0
script:
- cd dotnet-setversion
- dotnet restore
- dotnet build
- dotnet pack -c Release -o artifacts/
+ - dotnet nuget push --source https://www.nuget.org/api/v2/package --api-key $NUGET_APIKEY $(find artifacts -name "*.nupkg") | 1 | 0.111111 | 1 | 0 |
ebca5c5acd6f176287b0f3e0ec9076f7b41f64e3 | usr/vendor/genivi/pkg/audio-manager.lua | usr/vendor/genivi/pkg/audio-manager.lua | return {
source = {
type = 'git',
location = 'https://github.com/GENIVI/AudioManager.git',
branch = '7.5',
ignore_dirty = true
},
patches = {
{ 'audio-manager-pass-all-LDFLAGS-of-the-found-CommonAPI-to-the-build', 1 }
},
build = {
type = 'CMake',
options = {
'-DWITH_TESTS=OFF',
'-DWITH_DOCUMENTATION=OFF',
'-DWITH_DLT=OFF',
'-DWITH_TELNET=OFF',
'-DWITH_SYSTEMD_WATCHDOG=OFF',
'-DGLIB_DBUS_TYPES_TOLERANT=ON',
'-DWITH_CAPI_WRAPPER=ON',
'-DWITH_DBUS_WRAPPER=OFF',
'-DWITH_SHARED_UTILITIES=ON',
'-DWITH_SHARED_CORE=ON',
}
},
requires = {
'capicxx-core-runtime'
}
}
| return {
source = {
type = 'git',
location = 'https://github.com/GENIVI/AudioManager.git',
branch = '7.5',
ignore_dirty = true
},
patches = {
{ 'audio-manager-pass-all-LDFLAGS-to-linker-when-building-wrappers', 1 }
},
build = {
type = 'CMake',
options = {
'-DWITH_TESTS=OFF',
'-DWITH_DOCUMENTATION=OFF',
'-DWITH_DLT=OFF',
'-DWITH_TELNET=OFF',
'-DWITH_SYSTEMD_WATCHDOG=OFF',
'-DGLIB_DBUS_TYPES_TOLERANT=ON',
'-DWITH_CAPI_WRAPPER=ON',
'-DWITH_DBUS_WRAPPER=ON',
'-DWITH_SHARED_UTILITIES=ON',
'-DWITH_SHARED_CORE=ON',
}
},
requires = {
'capicxx-core-runtime'
}
}
| Enable build of DBus wrapper for AudioManager | Enable build of DBus wrapper for AudioManager
| Lua | mit | bazurbat/jagen | lua | ## Code Before:
return {
source = {
type = 'git',
location = 'https://github.com/GENIVI/AudioManager.git',
branch = '7.5',
ignore_dirty = true
},
patches = {
{ 'audio-manager-pass-all-LDFLAGS-of-the-found-CommonAPI-to-the-build', 1 }
},
build = {
type = 'CMake',
options = {
'-DWITH_TESTS=OFF',
'-DWITH_DOCUMENTATION=OFF',
'-DWITH_DLT=OFF',
'-DWITH_TELNET=OFF',
'-DWITH_SYSTEMD_WATCHDOG=OFF',
'-DGLIB_DBUS_TYPES_TOLERANT=ON',
'-DWITH_CAPI_WRAPPER=ON',
'-DWITH_DBUS_WRAPPER=OFF',
'-DWITH_SHARED_UTILITIES=ON',
'-DWITH_SHARED_CORE=ON',
}
},
requires = {
'capicxx-core-runtime'
}
}
## Instruction:
Enable build of DBus wrapper for AudioManager
## Code After:
return {
source = {
type = 'git',
location = 'https://github.com/GENIVI/AudioManager.git',
branch = '7.5',
ignore_dirty = true
},
patches = {
{ 'audio-manager-pass-all-LDFLAGS-to-linker-when-building-wrappers', 1 }
},
build = {
type = 'CMake',
options = {
'-DWITH_TESTS=OFF',
'-DWITH_DOCUMENTATION=OFF',
'-DWITH_DLT=OFF',
'-DWITH_TELNET=OFF',
'-DWITH_SYSTEMD_WATCHDOG=OFF',
'-DGLIB_DBUS_TYPES_TOLERANT=ON',
'-DWITH_CAPI_WRAPPER=ON',
'-DWITH_DBUS_WRAPPER=ON',
'-DWITH_SHARED_UTILITIES=ON',
'-DWITH_SHARED_CORE=ON',
}
},
requires = {
'capicxx-core-runtime'
}
}
| return {
source = {
type = 'git',
location = 'https://github.com/GENIVI/AudioManager.git',
branch = '7.5',
ignore_dirty = true
},
patches = {
- { 'audio-manager-pass-all-LDFLAGS-of-the-found-CommonAPI-to-the-build', 1 }
+ { 'audio-manager-pass-all-LDFLAGS-to-linker-when-building-wrappers', 1 }
},
build = {
type = 'CMake',
options = {
'-DWITH_TESTS=OFF',
'-DWITH_DOCUMENTATION=OFF',
'-DWITH_DLT=OFF',
'-DWITH_TELNET=OFF',
'-DWITH_SYSTEMD_WATCHDOG=OFF',
'-DGLIB_DBUS_TYPES_TOLERANT=ON',
'-DWITH_CAPI_WRAPPER=ON',
- '-DWITH_DBUS_WRAPPER=OFF',
? ^^
+ '-DWITH_DBUS_WRAPPER=ON',
? ^
'-DWITH_SHARED_UTILITIES=ON',
'-DWITH_SHARED_CORE=ON',
}
},
requires = {
'capicxx-core-runtime'
}
} | 4 | 0.137931 | 2 | 2 |
d9c0b90d953c7ffb5b27861cf220787ffde70445 | index.js | index.js | const { send } = require('micro')
const errorHandler = next => async (req, res) => {
try {
return await next(req, res)
} catch (err) {
const code = err.statusCode || 500
const message = err.message || 'Unknown Error'
const payload = {
error: {
code,
message,
}
}
if (process.env.NODE_ENV === 'development') {
payload.error.stack = err.stack;
}
send(res, code, payload)
}
}
module.exports = {
errorHandler,
}
| const { send } = require('micro')
const errorHandler = next => (req, res) => {
try {
return next(req, res)
} catch (err) {
const code = err.statusCode || 500
const message = err.message || 'Unknown Error'
const payload = {
error: {
code,
message,
},
}
if (process.env.NODE_ENV === 'development') {
console.error(err)
payload.error.stack = err.stack
}
return send(res, code, payload)
}
}
module.exports = {
errorHandler,
}
| Clean up and print error in dev mode | Clean up and print error in dev mode
| JavaScript | mit | mariusc23/micro-error-handler | javascript | ## Code Before:
const { send } = require('micro')
const errorHandler = next => async (req, res) => {
try {
return await next(req, res)
} catch (err) {
const code = err.statusCode || 500
const message = err.message || 'Unknown Error'
const payload = {
error: {
code,
message,
}
}
if (process.env.NODE_ENV === 'development') {
payload.error.stack = err.stack;
}
send(res, code, payload)
}
}
module.exports = {
errorHandler,
}
## Instruction:
Clean up and print error in dev mode
## Code After:
const { send } = require('micro')
const errorHandler = next => (req, res) => {
try {
return next(req, res)
} catch (err) {
const code = err.statusCode || 500
const message = err.message || 'Unknown Error'
const payload = {
error: {
code,
message,
},
}
if (process.env.NODE_ENV === 'development') {
console.error(err)
payload.error.stack = err.stack
}
return send(res, code, payload)
}
}
module.exports = {
errorHandler,
}
| const { send } = require('micro')
- const errorHandler = next => async (req, res) => {
? ------
+ const errorHandler = next => (req, res) => {
try {
- return await next(req, res)
? ------
+ return next(req, res)
} catch (err) {
const code = err.statusCode || 500
const message = err.message || 'Unknown Error'
const payload = {
- error: {
+ error: {
? +
- code,
+ code,
? +
- message,
+ message,
? +
- }
+ },
? + +
}
if (process.env.NODE_ENV === 'development') {
+ console.error(err)
- payload.error.stack = err.stack;
? -
+ payload.error.stack = err.stack
}
- send(res, code, payload)
+ return send(res, code, payload)
? +++++++
}
}
module.exports = {
errorHandler,
} | 17 | 0.708333 | 9 | 8 |
2c4d49ae8d4990999a50131469600d62662b7ccf | handlebars-rails.gemspec | handlebars-rails.gemspec | lib = File.expand_path('../lib/', __FILE__)
$:.unshift lib unless $:.include?(lib)
require 'handlebars-rails/version'
Gem::Specification.new do |gem|
gem.version = Handlebars::VERSION
gem.name = 'handlebars-rails'
gem.files = `git ls-files`.split("\n")
gem.summary = "Rails Template Handler for Handlebars"
gem.description = "Use Handlebars.js client- and server-side"
gem.email = "james.a.rosen@gmail.com"
gem.homepage = "http://github.com/jamesarosen/handlebars-rails"
gem.authors = ["James A. Rosen", "Yehuda Katz"]
gem.test_files = []
gem.require_paths = [".", "lib"]
gem.has_rdoc = 'false'
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
gem.specification_version = 2
gem.add_runtime_dependency 'rails', '~> 3.0'
gem.add_runtime_dependency 'handlebars', '~> 0.3.2beta4'
gem.add_development_dependency 'rake'
gem.add_development_dependency 'redgreen', '~> 1.2'
gem.add_development_dependency 'rspec', '~> 2.7'
end
| lib = File.expand_path('../lib/', __FILE__)
$:.unshift lib unless $:.include?(lib)
require 'handlebars-rails/version'
Gem::Specification.new do |gem|
gem.version = Handlebars::VERSION
gem.name = 'handlebars-rails'
gem.files = `git ls-files`.split("\n")
gem.summary = "Rails Template Handler for Handlebars"
gem.description = "Use Handlebars.js client- and server-side"
gem.email = "james.a.rosen@gmail.com"
gem.homepage = "http://github.com/jamesarosen/handlebars-rails"
gem.authors = ["James A. Rosen", "Yehuda Katz", "Charles Lowell"]
gem.test_files = []
gem.require_paths = [".", "lib"]
gem.has_rdoc = 'false'
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
gem.specification_version = 2
gem.add_runtime_dependency 'rails', '~> 3.0'
gem.add_runtime_dependency 'handlebars', '~> 0.3.2beta4'
gem.add_development_dependency 'rake'
gem.add_development_dependency 'redgreen', '~> 1.2'
gem.add_development_dependency 'rspec', '~> 2.7'
end
| Add myself to the authors list | Add myself to the authors list | Ruby | mit | cowboyd/handlebars-rails,cowboyd/handlebars-rails | ruby | ## Code Before:
lib = File.expand_path('../lib/', __FILE__)
$:.unshift lib unless $:.include?(lib)
require 'handlebars-rails/version'
Gem::Specification.new do |gem|
gem.version = Handlebars::VERSION
gem.name = 'handlebars-rails'
gem.files = `git ls-files`.split("\n")
gem.summary = "Rails Template Handler for Handlebars"
gem.description = "Use Handlebars.js client- and server-side"
gem.email = "james.a.rosen@gmail.com"
gem.homepage = "http://github.com/jamesarosen/handlebars-rails"
gem.authors = ["James A. Rosen", "Yehuda Katz"]
gem.test_files = []
gem.require_paths = [".", "lib"]
gem.has_rdoc = 'false'
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
gem.specification_version = 2
gem.add_runtime_dependency 'rails', '~> 3.0'
gem.add_runtime_dependency 'handlebars', '~> 0.3.2beta4'
gem.add_development_dependency 'rake'
gem.add_development_dependency 'redgreen', '~> 1.2'
gem.add_development_dependency 'rspec', '~> 2.7'
end
## Instruction:
Add myself to the authors list
## Code After:
lib = File.expand_path('../lib/', __FILE__)
$:.unshift lib unless $:.include?(lib)
require 'handlebars-rails/version'
Gem::Specification.new do |gem|
gem.version = Handlebars::VERSION
gem.name = 'handlebars-rails'
gem.files = `git ls-files`.split("\n")
gem.summary = "Rails Template Handler for Handlebars"
gem.description = "Use Handlebars.js client- and server-side"
gem.email = "james.a.rosen@gmail.com"
gem.homepage = "http://github.com/jamesarosen/handlebars-rails"
gem.authors = ["James A. Rosen", "Yehuda Katz", "Charles Lowell"]
gem.test_files = []
gem.require_paths = [".", "lib"]
gem.has_rdoc = 'false'
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
gem.specification_version = 2
gem.add_runtime_dependency 'rails', '~> 3.0'
gem.add_runtime_dependency 'handlebars', '~> 0.3.2beta4'
gem.add_development_dependency 'rake'
gem.add_development_dependency 'redgreen', '~> 1.2'
gem.add_development_dependency 'rspec', '~> 2.7'
end
| lib = File.expand_path('../lib/', __FILE__)
$:.unshift lib unless $:.include?(lib)
require 'handlebars-rails/version'
Gem::Specification.new do |gem|
gem.version = Handlebars::VERSION
gem.name = 'handlebars-rails'
gem.files = `git ls-files`.split("\n")
gem.summary = "Rails Template Handler for Handlebars"
gem.description = "Use Handlebars.js client- and server-side"
gem.email = "james.a.rosen@gmail.com"
gem.homepage = "http://github.com/jamesarosen/handlebars-rails"
- gem.authors = ["James A. Rosen", "Yehuda Katz"]
+ gem.authors = ["James A. Rosen", "Yehuda Katz", "Charles Lowell"]
? ++++++++++++++++++
gem.test_files = []
gem.require_paths = [".", "lib"]
gem.has_rdoc = 'false'
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
gem.specification_version = 2
gem.add_runtime_dependency 'rails', '~> 3.0'
gem.add_runtime_dependency 'handlebars', '~> 0.3.2beta4'
gem.add_development_dependency 'rake'
gem.add_development_dependency 'redgreen', '~> 1.2'
gem.add_development_dependency 'rspec', '~> 2.7'
end | 2 | 0.076923 | 1 | 1 |
fa025070c1eeb7e751b4b7210cce4e088781e2bc | app/assets/javascripts/messages.js | app/assets/javascripts/messages.js | function scrollToBottom() {
var $messages = $('#messages');
if ($messages.length > 0) {
$messages.scrollTop($messages[0].scrollHeight);
}
}
$(document).ready(scrollToBottom);
| function scrollToBottom() {
var $messages = $('#messages');
if ($messages.length > 0) {
$messages.scrollTop($messages[0].scrollHeight);
}
}
$(document).ready(scrollToBottom);
$(document).on('turbolinks:load', scrollToBottom);
| Fix scrollToBottom action on turbolinks:load | Fix scrollToBottom action on turbolinks:load
| JavaScript | mit | JulianNicholls/BuffetCar-5,JulianNicholls/BuffetCar-5,JulianNicholls/BuffetCar-5 | javascript | ## Code Before:
function scrollToBottom() {
var $messages = $('#messages');
if ($messages.length > 0) {
$messages.scrollTop($messages[0].scrollHeight);
}
}
$(document).ready(scrollToBottom);
## Instruction:
Fix scrollToBottom action on turbolinks:load
## Code After:
function scrollToBottom() {
var $messages = $('#messages');
if ($messages.length > 0) {
$messages.scrollTop($messages[0].scrollHeight);
}
}
$(document).ready(scrollToBottom);
$(document).on('turbolinks:load', scrollToBottom);
| function scrollToBottom() {
var $messages = $('#messages');
if ($messages.length > 0) {
$messages.scrollTop($messages[0].scrollHeight);
}
}
$(document).ready(scrollToBottom);
+ $(document).on('turbolinks:load', scrollToBottom); | 1 | 0.111111 | 1 | 0 |
d559af6008d90c1102bc85f0edbcb7beb1e3530f | README.md | README.md |
Command-line license generator written in Go.
````
Command-line license generator.
Usage:
license [-y <year>] [-n <name>] [-o <filename>] <license-name>
Examples:
license mit
license -o LICENSE.txt mit
license -y 2013 -n Alice isc
Additional commands:
ls list locally available license names
ls-remote list remote license names
update update local licenses to latest remote versions
help show help information
version print current version
Run "license ls" to see list of available license names.
````
<video id="sampleMovie" src="https://zippy.gfycat.com/JoyfulBlandGermanshorthairedpointer.webm" autoplay muted loop></video>
# Contents
* Install
* Get Started
* Options
* Contributing
* License
# Install
To install license, run:
````
$ go get github.com/nishanths/license
````
Otherwise,
# Get Started
#### Generating a license
To generate a license, simply run `license` followed by the license name. The following command generates the MIT license:
````bash
$ license mit
````
#### Creating a license file
Use the `-o` option to save the license to a file. The following command creates the file `LICENSE.txt` with the contents of the ISC license:
````
$ license -o LICENSE.txt isc
````
More options and commands are described section below.
# Usage |
Command-line license generator written in Go.
````
Usage:
license [-y <year>] [-n <name>] [-o <filename>] <license-name>
Examples:
license mit
license -o LICENSE.txt mit
license -y 2013 -n Alice isc
Additional commands:
ls list locally available license names
ls-remote list remote license names
update update local licenses to latest remote versions
help show help information
version print current version
Run "license ls" to see list of available license names.
````
<img src="https://zippy.gfycat.com/JoyfulBlandGermanshorthairedpointer.gif" autoplay muted loop></video>
# Contents
* Install
* Get Started
* Options
* Contributing
* License
# Install
To install license, run:
````
$ go get github.com/nishanths/license
````
# Get Started
#### Generating a license
To generate a license, simply run `license` followed by the license name. The following command generates the MIT license:
````bash
$ license mit
````
#### Creating a license file
Use the `-o` option to save the license to a file. The following command creates the file `LICENSE.txt` with the contents of the ISC license:
````
$ license -o LICENSE.txt isc
````
More options and commands are described section below.
# Options
# Contributing
# License
Licensed under the [MIT License](https://github.com/nishanths/license/blob/master/LICENSE).
Yep, the license was generated by output from this program.
| Remove <video> tags that do not not work | docs: Remove <video> tags that do not not work
| Markdown | mit | nishanths/license | markdown | ## Code Before:
Command-line license generator written in Go.
````
Command-line license generator.
Usage:
license [-y <year>] [-n <name>] [-o <filename>] <license-name>
Examples:
license mit
license -o LICENSE.txt mit
license -y 2013 -n Alice isc
Additional commands:
ls list locally available license names
ls-remote list remote license names
update update local licenses to latest remote versions
help show help information
version print current version
Run "license ls" to see list of available license names.
````
<video id="sampleMovie" src="https://zippy.gfycat.com/JoyfulBlandGermanshorthairedpointer.webm" autoplay muted loop></video>
# Contents
* Install
* Get Started
* Options
* Contributing
* License
# Install
To install license, run:
````
$ go get github.com/nishanths/license
````
Otherwise,
# Get Started
#### Generating a license
To generate a license, simply run `license` followed by the license name. The following command generates the MIT license:
````bash
$ license mit
````
#### Creating a license file
Use the `-o` option to save the license to a file. The following command creates the file `LICENSE.txt` with the contents of the ISC license:
````
$ license -o LICENSE.txt isc
````
More options and commands are described section below.
# Usage
## Instruction:
docs: Remove <video> tags that do not not work
## Code After:
Command-line license generator written in Go.
````
Usage:
license [-y <year>] [-n <name>] [-o <filename>] <license-name>
Examples:
license mit
license -o LICENSE.txt mit
license -y 2013 -n Alice isc
Additional commands:
ls list locally available license names
ls-remote list remote license names
update update local licenses to latest remote versions
help show help information
version print current version
Run "license ls" to see list of available license names.
````
<img src="https://zippy.gfycat.com/JoyfulBlandGermanshorthairedpointer.gif" autoplay muted loop></video>
# Contents
* Install
* Get Started
* Options
* Contributing
* License
# Install
To install license, run:
````
$ go get github.com/nishanths/license
````
# Get Started
#### Generating a license
To generate a license, simply run `license` followed by the license name. The following command generates the MIT license:
````bash
$ license mit
````
#### Creating a license file
Use the `-o` option to save the license to a file. The following command creates the file `LICENSE.txt` with the contents of the ISC license:
````
$ license -o LICENSE.txt isc
````
More options and commands are described section below.
# Options
# Contributing
# License
Licensed under the [MIT License](https://github.com/nishanths/license/blob/master/LICENSE).
Yep, the license was generated by output from this program.
|
Command-line license generator written in Go.
````
- Command-line license generator.
-
Usage:
license [-y <year>] [-n <name>] [-o <filename>] <license-name>
Examples:
license mit
license -o LICENSE.txt mit
license -y 2013 -n Alice isc
Additional commands:
ls list locally available license names
ls-remote list remote license names
update update local licenses to latest remote versions
help show help information
version print current version
Run "license ls" to see list of available license names.
````
- <video id="sampleMovie" src="https://zippy.gfycat.com/JoyfulBlandGermanshorthairedpointer.webm" autoplay muted loop></video>
? - ---------- ^^^^^^^^^ ^^^^
+ <img src="https://zippy.gfycat.com/JoyfulBlandGermanshorthairedpointer.gif" autoplay muted loop></video>
? ^ ^^^
# Contents
* Install
* Get Started
* Options
* Contributing
* License
# Install
To install license, run:
````
$ go get github.com/nishanths/license
````
-
- Otherwise,
# Get Started
#### Generating a license
To generate a license, simply run `license` followed by the license name. The following command generates the MIT license:
````bash
$ license mit
````
#### Creating a license file
Use the `-o` option to save the license to a file. The following command creates the file `LICENSE.txt` with the contents of the ISC license:
````
$ license -o LICENSE.txt isc
````
More options and commands are described section below.
- # Usage
+ # Options
+
+ # Contributing
+
+ # License
+
+ Licensed under the [MIT License](https://github.com/nishanths/license/blob/master/LICENSE).
+
+ Yep, the license was generated by output from this program.
+ | 17 | 0.265625 | 11 | 6 |
4be5d87b67ad8b76e7ea2cd270bb85eb2417ab23 | package.json | package.json | {
"name": "hallo",
"description": "Simple rich text editor",
"author": "Henri Bergius",
"version": "0.0.1",
"dependencies": {},
"devDependencies": {
"async": ">=0.1.18",
"docco-husky": ">=0.3.2",
"uglify-js": ">=1.2.6"
},
"docco_husky": {
"output_dir": "docs",
"project_name": "Hallo Editor"
}
}
| {
"name": "hallo",
"description": "Simple rich text editor",
"author": "Henri Bergius <henri.bergius@iki.fi>",
"homepage": "http://bergie.github.com/hallo/",
"version": "0.0.1",
"dependencies": {},
"devDependencies": {
"async": ">=0.1.18",
"docco-husky": ">=0.3.2",
"uglify-js": ">=1.2.6"
},
"docco_husky": {
"output_dir": "docs",
"project_name": "Hallo Editor"
}
}
| Add author email and Hallo homepage | Add author email and Hallo homepage
| JSON | mit | GerHobbelt/hallo,GerHobbelt/hallo,cesarmarinhorj/hallo,pazof/hallo,bergie/hallo,roryok/hallo-winrt,iacdingping/hallo,roryok/hallo-winrt,iacdingping/hallo,pazof/hallo,CodericSandbox/hallo,cesarmarinhorj/hallo,Ninir/hallo,bergie/hallo,CodericSandbox/hallo | json | ## Code Before:
{
"name": "hallo",
"description": "Simple rich text editor",
"author": "Henri Bergius",
"version": "0.0.1",
"dependencies": {},
"devDependencies": {
"async": ">=0.1.18",
"docco-husky": ">=0.3.2",
"uglify-js": ">=1.2.6"
},
"docco_husky": {
"output_dir": "docs",
"project_name": "Hallo Editor"
}
}
## Instruction:
Add author email and Hallo homepage
## Code After:
{
"name": "hallo",
"description": "Simple rich text editor",
"author": "Henri Bergius <henri.bergius@iki.fi>",
"homepage": "http://bergie.github.com/hallo/",
"version": "0.0.1",
"dependencies": {},
"devDependencies": {
"async": ">=0.1.18",
"docco-husky": ">=0.3.2",
"uglify-js": ">=1.2.6"
},
"docco_husky": {
"output_dir": "docs",
"project_name": "Hallo Editor"
}
}
| {
"name": "hallo",
"description": "Simple rich text editor",
- "author": "Henri Bergius",
+ "author": "Henri Bergius <henri.bergius@iki.fi>",
+ "homepage": "http://bergie.github.com/hallo/",
"version": "0.0.1",
"dependencies": {},
"devDependencies": {
"async": ">=0.1.18",
"docco-husky": ">=0.3.2",
"uglify-js": ">=1.2.6"
},
"docco_husky": {
"output_dir": "docs",
"project_name": "Hallo Editor"
}
} | 3 | 0.1875 | 2 | 1 |
7bb0607a8a96e15d9708f323942da24465a2c1a8 | DE-foreign-dictlist.txt | DE-foreign-dictlist.txt | ca Katalanisch
cs Tschechisch
eo Esperanto
es Spanisch
fr Französisch
hu Ungarisch
it Italienisch
ja Japanisch
la Latein
nl Niederländisch
pl Polnisch
pt Portugiesisch
ru Russisch
sv Schwedisch
| ca Katalanisch
cs Tschechisch
eo Esperanto
es Spanisch
fr Französisch
hu Ungarisch
it Italienisch
ja Japanisch
la Latein
nl Niederländisch
pl Polnisch
pt Portugiesisch
ru Russisch
sv Schwedisch
cmn Mandarin
| Add DE-cmn dictionary to generation list. | Add DE-cmn dictionary to generation list.
| Text | apache-2.0 | rdoeffinger/DictionaryPC,rdoeffinger/DictionaryPC,rdoeffinger/DictionaryPC | text | ## Code Before:
ca Katalanisch
cs Tschechisch
eo Esperanto
es Spanisch
fr Französisch
hu Ungarisch
it Italienisch
ja Japanisch
la Latein
nl Niederländisch
pl Polnisch
pt Portugiesisch
ru Russisch
sv Schwedisch
## Instruction:
Add DE-cmn dictionary to generation list.
## Code After:
ca Katalanisch
cs Tschechisch
eo Esperanto
es Spanisch
fr Französisch
hu Ungarisch
it Italienisch
ja Japanisch
la Latein
nl Niederländisch
pl Polnisch
pt Portugiesisch
ru Russisch
sv Schwedisch
cmn Mandarin
| ca Katalanisch
cs Tschechisch
eo Esperanto
es Spanisch
fr Französisch
hu Ungarisch
it Italienisch
ja Japanisch
la Latein
nl Niederländisch
pl Polnisch
pt Portugiesisch
ru Russisch
sv Schwedisch
+ cmn Mandarin | 1 | 0.071429 | 1 | 0 |
c9449a6bb409c4e25de278cf239749640c02a893 | AUTHORS.md | AUTHORS.md | * Stephan Jaensch [sjaensch](https://github.com/sjaensch)
* Sven Steinheißer [rockdog](https://github.com/rockdog)
* Yoann Roman [silentsound](https://github.com/silentsound)
# Original Authors
* Adam Rothman [adamrothman](https://github.com/adamrothman)
* Ben Asher [benasher44](https://github.com/benasher44)
* Andrew Martinez-Fonts [amartinezfonts](https://github.com/amartinezfonts)
* Wei Wu [wuhuwei](https://github.com/wuhuwei)
# Contributors
* Alex Levy [mesozoic](https://github.com/mesozoic)
* Jenny Lemmnitz [jetze](https://github.com/jetze)
* Kurtis Freedland [KurtisFreedland](https://github.com/KurtisFreedland)
* Michał Czapko [michalczapko](https://github.com/michalczapko)
| * Stephan Jaensch [sjaensch](https://github.com/sjaensch)
* Sven Steinheißer [rockdog](https://github.com/rockdog)
* Yoann Roman [silentsound](https://github.com/silentsound)
# Original Authors
* Adam Rothman [adamrothman](https://github.com/adamrothman)
* Ben Asher [benasher44](https://github.com/benasher44)
* Andrew Martinez-Fonts [amartinezfonts](https://github.com/amartinezfonts)
* Wei Wu [wuhuwei](https://github.com/wuhuwei)
# Contributors
* Alex Levy [mesozoic](https://github.com/mesozoic)
* Jenny Lemmnitz [jetze](https://github.com/jetze)
* Kurtis Freedland [KurtisFreedland](https://github.com/KurtisFreedland)
* Michał Czapko [michalczapko](https://github.com/michalczapko)
* Stephen Brennan [brenns10](https://github.com/brenns10)
| Add brenns10 to contributors list | Add brenns10 to contributors list
| Markdown | mit | Yelp/love,Yelp/love,Yelp/love | markdown | ## Code Before:
* Stephan Jaensch [sjaensch](https://github.com/sjaensch)
* Sven Steinheißer [rockdog](https://github.com/rockdog)
* Yoann Roman [silentsound](https://github.com/silentsound)
# Original Authors
* Adam Rothman [adamrothman](https://github.com/adamrothman)
* Ben Asher [benasher44](https://github.com/benasher44)
* Andrew Martinez-Fonts [amartinezfonts](https://github.com/amartinezfonts)
* Wei Wu [wuhuwei](https://github.com/wuhuwei)
# Contributors
* Alex Levy [mesozoic](https://github.com/mesozoic)
* Jenny Lemmnitz [jetze](https://github.com/jetze)
* Kurtis Freedland [KurtisFreedland](https://github.com/KurtisFreedland)
* Michał Czapko [michalczapko](https://github.com/michalczapko)
## Instruction:
Add brenns10 to contributors list
## Code After:
* Stephan Jaensch [sjaensch](https://github.com/sjaensch)
* Sven Steinheißer [rockdog](https://github.com/rockdog)
* Yoann Roman [silentsound](https://github.com/silentsound)
# Original Authors
* Adam Rothman [adamrothman](https://github.com/adamrothman)
* Ben Asher [benasher44](https://github.com/benasher44)
* Andrew Martinez-Fonts [amartinezfonts](https://github.com/amartinezfonts)
* Wei Wu [wuhuwei](https://github.com/wuhuwei)
# Contributors
* Alex Levy [mesozoic](https://github.com/mesozoic)
* Jenny Lemmnitz [jetze](https://github.com/jetze)
* Kurtis Freedland [KurtisFreedland](https://github.com/KurtisFreedland)
* Michał Czapko [michalczapko](https://github.com/michalczapko)
* Stephen Brennan [brenns10](https://github.com/brenns10)
| * Stephan Jaensch [sjaensch](https://github.com/sjaensch)
* Sven Steinheißer [rockdog](https://github.com/rockdog)
* Yoann Roman [silentsound](https://github.com/silentsound)
# Original Authors
* Adam Rothman [adamrothman](https://github.com/adamrothman)
* Ben Asher [benasher44](https://github.com/benasher44)
* Andrew Martinez-Fonts [amartinezfonts](https://github.com/amartinezfonts)
* Wei Wu [wuhuwei](https://github.com/wuhuwei)
# Contributors
* Alex Levy [mesozoic](https://github.com/mesozoic)
* Jenny Lemmnitz [jetze](https://github.com/jetze)
* Kurtis Freedland [KurtisFreedland](https://github.com/KurtisFreedland)
* Michał Czapko [michalczapko](https://github.com/michalczapko)
+ * Stephen Brennan [brenns10](https://github.com/brenns10) | 1 | 0.066667 | 1 | 0 |
502819b9c609165931a2decbf2c16fbafaee07d5 | SingularityUI/app/collections/TaskLogFiles.coffee | SingularityUI/app/collections/TaskLogFiles.coffee | Collection = require './collection'
class TaskLogFiles extends Collection
url: =>
fullPath = "#{ @directory }/#{ @path ? ''}"
"http://#{ @offerHostname }:#{ constants.mesosLogsPort }/files/browse.json?path=#{ escape fullPath }&jsonp=?"
initialize: (models, { @taskId, @offerHostname, @directory, @path }) =>
parse: (taskLogFiles) =>
_.map taskLogFiles, (taskLogFile) =>
taskLogFile.shortPath = taskLogFile.path.split(/\//).reverse()[0]
taskLogFile.mtimeHuman = moment(taskLogFile.mtime * 1000).from()
taskLogFile.sizeHuman = Humanize.fileSize(taskLogFile.size)
taskLogFile.downloadLink = "http://#{ @offerHostname }:#{ constants.mesosLogsPort }/files/download.json?path=#{ taskLogFile.path }"
taskLogFile.isDirectory = taskLogFile.mode[0] is 'd'
taskLogFile.relPath = taskLogFile.path.replace(@directory, '')
taskLogFile.taskId = @taskId
taskLogFile
comparator: 'size'
module.exports = TaskLogFiles | Collection = require './collection'
class TaskLogFiles extends Collection
url: =>
fullPath = "#{ @directory }/#{ @path ? ''}"
"http://#{ @offerHostname }:#{ constants.mesosLogsPort }/files/browse.json?path=#{ escape fullPath }&jsonp=?"
initialize: (models, { @taskId, @offerHostname, @directory, @path }) =>
parse: (taskLogFiles) =>
_.map taskLogFiles, (taskLogFile) =>
taskLogFile.shortPath = taskLogFile.path.split(/\//).reverse()[0]
taskLogFile.mtimeHuman = moment(taskLogFile.mtime * 1000).from()
taskLogFile.sizeHuman = Humanize.fileSize(taskLogFile.size)
taskLogFile.downloadLink = "http://#{ @offerHostname }:#{ constants.mesosLogsPort }/files/download.json?path=#{ taskLogFile.path }"
taskLogFile.isDirectory = taskLogFile.mode[0] is 'd'
taskLogFile.relPath = taskLogFile.path.replace(@directory, '')
taskLogFile.taskId = @taskId
taskLogFile
comparator: (a, b) ->
if a.get('isDirectory') and not b.get('isDirectory')
return 1
else if not a.get('isDirectory') and b.get('isDirectory')
return -1
return a.get('size') - b.get('size')
module.exports = TaskLogFiles | Sort files by size but with directories on top | Sort files by size but with directories on top | CoffeeScript | apache-2.0 | stevenschlansker/Singularity,stevenschlansker/Singularity,calebTomlinson/Singularity,acbellini/Singularity,calebTomlinson/Singularity,andrhamm/Singularity,HubSpot/Singularity,mjball/Singularity,nvoron23/Singularity,grepsr/Singularity,stevenschlansker/Singularity,nvoron23/Singularity,andrhamm/Singularity,nvoron23/Singularity,andrhamm/Singularity,calebTomlinson/Singularity,grepsr/Singularity,calebTomlinson/Singularity,stevenschlansker/Singularity,grepsr/Singularity,hs-jenkins-bot/Singularity,evertrue/Singularity,nvoron23/Singularity,evertrue/Singularity,HubSpot/Singularity,evertrue/Singularity,evertrue/Singularity,andrhamm/Singularity,calebTomlinson/Singularity,andrhamm/Singularity,evertrue/Singularity,grepsr/Singularity,hs-jenkins-bot/Singularity,acbellini/Singularity,hs-jenkins-bot/Singularity,nvoron23/Singularity,HubSpot/Singularity,acbellini/Singularity,mjball/Singularity,grepsr/Singularity,stevenschlansker/Singularity,tejasmanohar/Singularity,grepsr/Singularity,evertrue/Singularity,hs-jenkins-bot/Singularity,mjball/Singularity,tejasmanohar/Singularity,HubSpot/Singularity,calebTomlinson/Singularity,HubSpot/Singularity,tejasmanohar/Singularity,acbellini/Singularity,acbellini/Singularity,hs-jenkins-bot/Singularity,acbellini/Singularity,nvoron23/Singularity,tejasmanohar/Singularity,tejasmanohar/Singularity,mjball/Singularity,mjball/Singularity,tejasmanohar/Singularity,stevenschlansker/Singularity | coffeescript | ## Code Before:
Collection = require './collection'
class TaskLogFiles extends Collection
url: =>
fullPath = "#{ @directory }/#{ @path ? ''}"
"http://#{ @offerHostname }:#{ constants.mesosLogsPort }/files/browse.json?path=#{ escape fullPath }&jsonp=?"
initialize: (models, { @taskId, @offerHostname, @directory, @path }) =>
parse: (taskLogFiles) =>
_.map taskLogFiles, (taskLogFile) =>
taskLogFile.shortPath = taskLogFile.path.split(/\//).reverse()[0]
taskLogFile.mtimeHuman = moment(taskLogFile.mtime * 1000).from()
taskLogFile.sizeHuman = Humanize.fileSize(taskLogFile.size)
taskLogFile.downloadLink = "http://#{ @offerHostname }:#{ constants.mesosLogsPort }/files/download.json?path=#{ taskLogFile.path }"
taskLogFile.isDirectory = taskLogFile.mode[0] is 'd'
taskLogFile.relPath = taskLogFile.path.replace(@directory, '')
taskLogFile.taskId = @taskId
taskLogFile
comparator: 'size'
module.exports = TaskLogFiles
## Instruction:
Sort files by size but with directories on top
## Code After:
Collection = require './collection'
class TaskLogFiles extends Collection
url: =>
fullPath = "#{ @directory }/#{ @path ? ''}"
"http://#{ @offerHostname }:#{ constants.mesosLogsPort }/files/browse.json?path=#{ escape fullPath }&jsonp=?"
initialize: (models, { @taskId, @offerHostname, @directory, @path }) =>
parse: (taskLogFiles) =>
_.map taskLogFiles, (taskLogFile) =>
taskLogFile.shortPath = taskLogFile.path.split(/\//).reverse()[0]
taskLogFile.mtimeHuman = moment(taskLogFile.mtime * 1000).from()
taskLogFile.sizeHuman = Humanize.fileSize(taskLogFile.size)
taskLogFile.downloadLink = "http://#{ @offerHostname }:#{ constants.mesosLogsPort }/files/download.json?path=#{ taskLogFile.path }"
taskLogFile.isDirectory = taskLogFile.mode[0] is 'd'
taskLogFile.relPath = taskLogFile.path.replace(@directory, '')
taskLogFile.taskId = @taskId
taskLogFile
comparator: (a, b) ->
if a.get('isDirectory') and not b.get('isDirectory')
return 1
else if not a.get('isDirectory') and b.get('isDirectory')
return -1
return a.get('size') - b.get('size')
module.exports = TaskLogFiles | Collection = require './collection'
class TaskLogFiles extends Collection
url: =>
fullPath = "#{ @directory }/#{ @path ? ''}"
"http://#{ @offerHostname }:#{ constants.mesosLogsPort }/files/browse.json?path=#{ escape fullPath }&jsonp=?"
initialize: (models, { @taskId, @offerHostname, @directory, @path }) =>
parse: (taskLogFiles) =>
_.map taskLogFiles, (taskLogFile) =>
taskLogFile.shortPath = taskLogFile.path.split(/\//).reverse()[0]
taskLogFile.mtimeHuman = moment(taskLogFile.mtime * 1000).from()
taskLogFile.sizeHuman = Humanize.fileSize(taskLogFile.size)
taskLogFile.downloadLink = "http://#{ @offerHostname }:#{ constants.mesosLogsPort }/files/download.json?path=#{ taskLogFile.path }"
taskLogFile.isDirectory = taskLogFile.mode[0] is 'd'
taskLogFile.relPath = taskLogFile.path.replace(@directory, '')
taskLogFile.taskId = @taskId
taskLogFile
- comparator: 'size'
+ comparator: (a, b) ->
+ if a.get('isDirectory') and not b.get('isDirectory')
+ return 1
+ else if not a.get('isDirectory') and b.get('isDirectory')
+ return -1
+ return a.get('size') - b.get('size')
module.exports = TaskLogFiles | 7 | 0.291667 | 6 | 1 |
cd9e23c84812eeb82edcc6b81943e8e15653b6cb | app/assets/stylesheets/modules/_blog.styl | app/assets/stylesheets/modules/_blog.styl | // Blog Feed
.blog-feed
margin-top global-margin * 3
.blog-feed__header
margin-top global-margin * 2
a
text-decoration none
a:hover
text-decoration underline
.blog-feed__posts
margin-top global-margin
display flex
flex-flow row wrap
margin-left: -20px;
margin-right: -20px;
// Blog Post
.blog-post
flex 0 0 33.333333%
padding 0 20px 40px
.blog-post__header
text-decoration none
a
text-decoration none
a:hover
text-decoration underline
.blog-post__image
height 165px
overflow hidden
margin-bottom 20px
position relative
img
display block
position absolute
top 50%
left 0
transform translateY(-50%) | // Blog Feed
.blog-feed
margin-top global-margin * 3
.blog-feed__header
margin-top global-margin * 2
a
text-decoration none
a:hover
text-decoration underline
.blog-feed__posts
margin-top global-margin
display flex
flex-flow row wrap
margin-left: -20px;
margin-right: -20px;
// Blog Post
.blog-post
flex 0 0 33.333333%
padding 0 20px 40px
// Fix for unnecessary screen reader text for 'read more' link in blog feed
.screen-reader-text
display none
.blog-post__header
text-decoration none
a
text-decoration none
a:hover
text-decoration underline
.blog-post__image
height 220px
overflow hidden
margin-bottom 20px
position relative
img
display block
position absolute
top 50%
left 0
transform translateY(-50%)
| Fix display of recent blog posts after theme update | Fix display of recent blog posts after theme update
We've changed the WordPress theme on wikiedu.org, and this changed the format of the RSS feed that we use for blog posts, adding the 'screen-reader-text' span as part of the 'Read More' link. (The link also used to be called 'continued', and that link was not in a new paragraph tag.) This tweak hides the screen-reader-text span, and also makes the images a little taller. Not perfect, but looks good enough.
| Stylus | mit | WikiEducationFoundation/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard | stylus | ## Code Before:
// Blog Feed
.blog-feed
margin-top global-margin * 3
.blog-feed__header
margin-top global-margin * 2
a
text-decoration none
a:hover
text-decoration underline
.blog-feed__posts
margin-top global-margin
display flex
flex-flow row wrap
margin-left: -20px;
margin-right: -20px;
// Blog Post
.blog-post
flex 0 0 33.333333%
padding 0 20px 40px
.blog-post__header
text-decoration none
a
text-decoration none
a:hover
text-decoration underline
.blog-post__image
height 165px
overflow hidden
margin-bottom 20px
position relative
img
display block
position absolute
top 50%
left 0
transform translateY(-50%)
## Instruction:
Fix display of recent blog posts after theme update
We've changed the WordPress theme on wikiedu.org, and this changed the format of the RSS feed that we use for blog posts, adding the 'screen-reader-text' span as part of the 'Read More' link. (The link also used to be called 'continued', and that link was not in a new paragraph tag.) This tweak hides the screen-reader-text span, and also makes the images a little taller. Not perfect, but looks good enough.
## Code After:
// Blog Feed
.blog-feed
margin-top global-margin * 3
.blog-feed__header
margin-top global-margin * 2
a
text-decoration none
a:hover
text-decoration underline
.blog-feed__posts
margin-top global-margin
display flex
flex-flow row wrap
margin-left: -20px;
margin-right: -20px;
// Blog Post
.blog-post
flex 0 0 33.333333%
padding 0 20px 40px
// Fix for unnecessary screen reader text for 'read more' link in blog feed
.screen-reader-text
display none
.blog-post__header
text-decoration none
a
text-decoration none
a:hover
text-decoration underline
.blog-post__image
height 220px
overflow hidden
margin-bottom 20px
position relative
img
display block
position absolute
top 50%
left 0
transform translateY(-50%)
| // Blog Feed
.blog-feed
margin-top global-margin * 3
.blog-feed__header
margin-top global-margin * 2
a
text-decoration none
a:hover
text-decoration underline
.blog-feed__posts
margin-top global-margin
display flex
flex-flow row wrap
margin-left: -20px;
margin-right: -20px;
// Blog Post
.blog-post
flex 0 0 33.333333%
padding 0 20px 40px
+ // Fix for unnecessary screen reader text for 'read more' link in blog feed
+ .screen-reader-text
+ display none
+
.blog-post__header
text-decoration none
a
text-decoration none
a:hover
text-decoration underline
.blog-post__image
- height 165px
? ^^^
+ height 220px
? ^^^
overflow hidden
margin-bottom 20px
position relative
img
display block
position absolute
top 50%
left 0
transform translateY(-50%) | 6 | 0.122449 | 5 | 1 |
abfbf9ec3b4e47f3ba5a9542ea31263db61620d7 | lib/fewer/app.rb | lib/fewer/app.rb | module Fewer
class App
class << self
def [](name)
apps[name]
end
def apps
@apps ||= {}
end
end
attr_reader :name, :engine_klass, :cache, :root
def initialize(name, options = {})
@engine_klass = options[:engine]
@mount = options[:mount]
@root = options[:root]
@cache = options[:cache] || 3600 * 24 * 365
raise 'You need to define an :engine class' unless @engine_klass
raise 'You need to define a :root path' unless @root
self.class.apps[name] = self
end
def call(env)
names = names_from_path(env['PATH_INFO'])
engine = engine_klass.new(root, names)
headers = {
'Content-Type' => engine.content_type,
'Cache-Control' => "public, max-age=#{cache}"
}
[200, headers, [engine.read]]
rescue Fewer::MissingSourceFileError => e
[404, { 'Content-Type' => 'text/plain' }, [e.message]]
rescue => e
[500, { 'Content-Type' => 'text/plain' }, ["#{e.class}: #{e.message}"]]
end
private
def names_from_path(path)
encoded = File.basename(path, '.*')
Serializer.decode(encoded)
end
end
end
| module Fewer
class App
class << self
def [](name)
apps[name]
end
def apps
@apps ||= {}
end
end
attr_reader :name, :engine_klass, :cache, :root
def initialize(name, options = {})
@engine_klass = options[:engine]
@mount = options[:mount]
@root = options[:root]
@cache = options[:cache] || 3600 * 24 * 365
raise 'You need to define an :engine class' unless @engine_klass
raise 'You need to define a :root path' unless @root
self.class.apps[name] = self
end
def call(env)
eng = engine(names_from_path(env['PATH_INFO']))
headers = {
'Content-Type' => eng.content_type,
'Cache-Control' => "public, max-age=#{cache}"
}
[200, headers, [eng.read]]
rescue Fewer::MissingSourceFileError => e
[404, { 'Content-Type' => 'text/plain' }, [e.message]]
rescue => e
[500, { 'Content-Type' => 'text/plain' }, ["#{e.class}: #{e.message}"]]
end
def engine(names)
engine_klass.new(root, names)
end
private
def names_from_path(path)
encoded = File.basename(path, '.*')
Serializer.decode(encoded)
end
end
end
| Add method to fetch instantiated engine directly from App. | Add method to fetch instantiated engine directly from App.
| Ruby | mit | benpickles/fewer | ruby | ## Code Before:
module Fewer
class App
class << self
def [](name)
apps[name]
end
def apps
@apps ||= {}
end
end
attr_reader :name, :engine_klass, :cache, :root
def initialize(name, options = {})
@engine_klass = options[:engine]
@mount = options[:mount]
@root = options[:root]
@cache = options[:cache] || 3600 * 24 * 365
raise 'You need to define an :engine class' unless @engine_klass
raise 'You need to define a :root path' unless @root
self.class.apps[name] = self
end
def call(env)
names = names_from_path(env['PATH_INFO'])
engine = engine_klass.new(root, names)
headers = {
'Content-Type' => engine.content_type,
'Cache-Control' => "public, max-age=#{cache}"
}
[200, headers, [engine.read]]
rescue Fewer::MissingSourceFileError => e
[404, { 'Content-Type' => 'text/plain' }, [e.message]]
rescue => e
[500, { 'Content-Type' => 'text/plain' }, ["#{e.class}: #{e.message}"]]
end
private
def names_from_path(path)
encoded = File.basename(path, '.*')
Serializer.decode(encoded)
end
end
end
## Instruction:
Add method to fetch instantiated engine directly from App.
## Code After:
module Fewer
class App
class << self
def [](name)
apps[name]
end
def apps
@apps ||= {}
end
end
attr_reader :name, :engine_klass, :cache, :root
def initialize(name, options = {})
@engine_klass = options[:engine]
@mount = options[:mount]
@root = options[:root]
@cache = options[:cache] || 3600 * 24 * 365
raise 'You need to define an :engine class' unless @engine_klass
raise 'You need to define a :root path' unless @root
self.class.apps[name] = self
end
def call(env)
eng = engine(names_from_path(env['PATH_INFO']))
headers = {
'Content-Type' => eng.content_type,
'Cache-Control' => "public, max-age=#{cache}"
}
[200, headers, [eng.read]]
rescue Fewer::MissingSourceFileError => e
[404, { 'Content-Type' => 'text/plain' }, [e.message]]
rescue => e
[500, { 'Content-Type' => 'text/plain' }, ["#{e.class}: #{e.message}"]]
end
def engine(names)
engine_klass.new(root, names)
end
private
def names_from_path(path)
encoded = File.basename(path, '.*')
Serializer.decode(encoded)
end
end
end
| module Fewer
class App
class << self
def [](name)
apps[name]
end
def apps
@apps ||= {}
end
end
attr_reader :name, :engine_klass, :cache, :root
def initialize(name, options = {})
@engine_klass = options[:engine]
@mount = options[:mount]
@root = options[:root]
@cache = options[:cache] || 3600 * 24 * 365
raise 'You need to define an :engine class' unless @engine_klass
raise 'You need to define a :root path' unless @root
self.class.apps[name] = self
end
def call(env)
- names = names_from_path(env['PATH_INFO'])
? ^^^^
+ eng = engine(names_from_path(env['PATH_INFO']))
? + ^ +++++++ +
- engine = engine_klass.new(root, names)
headers = {
- 'Content-Type' => engine.content_type,
? ---
+ 'Content-Type' => eng.content_type,
'Cache-Control' => "public, max-age=#{cache}"
}
- [200, headers, [engine.read]]
? ---
+ [200, headers, [eng.read]]
rescue Fewer::MissingSourceFileError => e
[404, { 'Content-Type' => 'text/plain' }, [e.message]]
rescue => e
[500, { 'Content-Type' => 'text/plain' }, ["#{e.class}: #{e.message}"]]
+ end
+
+ def engine(names)
+ engine_klass.new(root, names)
end
private
def names_from_path(path)
encoded = File.basename(path, '.*')
Serializer.decode(encoded)
end
end
end | 11 | 0.23913 | 7 | 4 |
94ecb13bbee620757e82929b828aa8ec27c02491 | composer.json | composer.json | {
"name": "odolbeau/rabbit-mq-admin-toolkit",
"description": "RabbitMQ administration toolkit",
"license": "MIT",
"require": {
"symfony/console": "~2.4",
"symfony/filesystem": "~2.4",
"symfony/yaml": "~2.4",
"swarrot/swarrot": "~2.0"
},
"autoload": {
"psr-0": {
"Bab\\RabbitMq": "src"
}
},
"bin": ["rabbit"],
"extra": {
"branch-alias": {
"dev-master": "2.1.x-dev"
}
},
"require-dev": {
"fabpot/php-cs-fixer": "~1.4"
}
}
| {
"name": "odolbeau/rabbit-mq-admin-toolkit",
"description": "RabbitMQ administration toolkit",
"license": "MIT",
"require": {
"php": "~5.4|~7.0",
"symfony/console": "~2.4",
"symfony/filesystem": "~2.4",
"symfony/yaml": "~2.4",
"swarrot/swarrot": "~2.0"
},
"autoload": {
"psr-0": {
"Bab\\RabbitMq": "src"
}
},
"bin": ["rabbit"],
"extra": {
"branch-alias": {
"dev-master": "2.1.x-dev"
}
},
"require-dev": {
"fabpot/php-cs-fixer": "~1.4"
}
}
| Add the PHP version requirement | Add the PHP version requirement
| JSON | mit | odolbeau/rabbit-mq-admin-toolkit | json | ## Code Before:
{
"name": "odolbeau/rabbit-mq-admin-toolkit",
"description": "RabbitMQ administration toolkit",
"license": "MIT",
"require": {
"symfony/console": "~2.4",
"symfony/filesystem": "~2.4",
"symfony/yaml": "~2.4",
"swarrot/swarrot": "~2.0"
},
"autoload": {
"psr-0": {
"Bab\\RabbitMq": "src"
}
},
"bin": ["rabbit"],
"extra": {
"branch-alias": {
"dev-master": "2.1.x-dev"
}
},
"require-dev": {
"fabpot/php-cs-fixer": "~1.4"
}
}
## Instruction:
Add the PHP version requirement
## Code After:
{
"name": "odolbeau/rabbit-mq-admin-toolkit",
"description": "RabbitMQ administration toolkit",
"license": "MIT",
"require": {
"php": "~5.4|~7.0",
"symfony/console": "~2.4",
"symfony/filesystem": "~2.4",
"symfony/yaml": "~2.4",
"swarrot/swarrot": "~2.0"
},
"autoload": {
"psr-0": {
"Bab\\RabbitMq": "src"
}
},
"bin": ["rabbit"],
"extra": {
"branch-alias": {
"dev-master": "2.1.x-dev"
}
},
"require-dev": {
"fabpot/php-cs-fixer": "~1.4"
}
}
| {
"name": "odolbeau/rabbit-mq-admin-toolkit",
"description": "RabbitMQ administration toolkit",
"license": "MIT",
"require": {
+ "php": "~5.4|~7.0",
"symfony/console": "~2.4",
"symfony/filesystem": "~2.4",
"symfony/yaml": "~2.4",
"swarrot/swarrot": "~2.0"
},
"autoload": {
"psr-0": {
"Bab\\RabbitMq": "src"
}
},
"bin": ["rabbit"],
"extra": {
"branch-alias": {
"dev-master": "2.1.x-dev"
}
},
"require-dev": {
"fabpot/php-cs-fixer": "~1.4"
}
} | 1 | 0.04 | 1 | 0 |
006a8e25c02f800d4b36cc051c46f736fcc940b2 | site/src/main/resources/static/js/findpassword.js | site/src/main/resources/static/js/findpassword.js | jQuery(function ($) {
function d(event) {
event.keyCode === 13 && button.click();
}
function click() {
image.attr('src', src + (src.indexOf('?') < 0 ? '?' : '&') + '_=' + +new Date());
imgv.val('');
(user.val() ? imgv : user).focus();
}
function enable() {
button.removeAttr('disabled');
}
function disable() {
button.attr('disabled', true);
}
var div = $('#findpassword'), user = div.find('[name="username"]'), button = div.find('[type="button"]'),
image = div.find('img'), imgv = div.find('[name="imgVerify"]');
var src = image.attr('src');
image.click(click);
imgv.bind('keypress', d);
user.bind('keypress', d);
button.click(function () {
var uid = user.val(), vcode = imgv.val();
if (!uid) {
alert('请输入用户名');
user.focus();
} else if (!vcode) {
alert('请输入验证码');
imgv.focus();
} else {
disable();
$.post('resetPassword.json', {username: uid, verify: vcode})
.always(click, enable).fail(function (result) {
console.log(arguments);
alert(result.responseJSON && result.responseJSON.message || result.responseText || 'Error Occur');
}).success(function (result) {
alert(result.message);
});
}
});
});
| jQuery(function ($) {
function d(event) {
event.keyCode === 13 && button.click();
}
function click() {
image.attr('src', src + (src.indexOf('?') < 0 ? '?' : '&') + '_=' + +new Date());
imgv.val('');
(user.val() ? imgv : user).focus();
}
function enable() {
button.removeAttr('disabled');
}
function disable() {
button.attr('disabled', true);
}
var div = $('#findpassword'), user = div.find('[name="username"]'), button = div.find('[type="button"]'),
image = div.find('img'), imgv = div.find('[name="imgVerify"]');
var src = image.attr('src');
image.click(click);
imgv.bind('keypress', d);
user.bind('keypress', d);
button.click(function () {
var uid = user.val(), vcode = imgv.val();
if (!uid) {
alert('请输入用户名');
user.focus();
} else if (!vcode) {
alert('请输入验证码');
imgv.focus();
} else {
disable();
$.post('resetPassword.json', {username: uid, verify: vcode})
.always(click, enable).fail(function (result) {
alert(result.responseJSON && result.responseJSON.message || result.responseText || 'Error Occur');
}).success(function (result) {
alert(result.message);
});
}
});
});
| Fix console is undefined on IE 8 | Fix console is undefined on IE 8
| JavaScript | apache-2.0 | zjnu-acm/judge,zjnu-acm/judge,zjnu-acm/judge,zjnu-acm/judge,zjnu-acm/judge | javascript | ## Code Before:
jQuery(function ($) {
function d(event) {
event.keyCode === 13 && button.click();
}
function click() {
image.attr('src', src + (src.indexOf('?') < 0 ? '?' : '&') + '_=' + +new Date());
imgv.val('');
(user.val() ? imgv : user).focus();
}
function enable() {
button.removeAttr('disabled');
}
function disable() {
button.attr('disabled', true);
}
var div = $('#findpassword'), user = div.find('[name="username"]'), button = div.find('[type="button"]'),
image = div.find('img'), imgv = div.find('[name="imgVerify"]');
var src = image.attr('src');
image.click(click);
imgv.bind('keypress', d);
user.bind('keypress', d);
button.click(function () {
var uid = user.val(), vcode = imgv.val();
if (!uid) {
alert('请输入用户名');
user.focus();
} else if (!vcode) {
alert('请输入验证码');
imgv.focus();
} else {
disable();
$.post('resetPassword.json', {username: uid, verify: vcode})
.always(click, enable).fail(function (result) {
console.log(arguments);
alert(result.responseJSON && result.responseJSON.message || result.responseText || 'Error Occur');
}).success(function (result) {
alert(result.message);
});
}
});
});
## Instruction:
Fix console is undefined on IE 8
## Code After:
jQuery(function ($) {
function d(event) {
event.keyCode === 13 && button.click();
}
function click() {
image.attr('src', src + (src.indexOf('?') < 0 ? '?' : '&') + '_=' + +new Date());
imgv.val('');
(user.val() ? imgv : user).focus();
}
function enable() {
button.removeAttr('disabled');
}
function disable() {
button.attr('disabled', true);
}
var div = $('#findpassword'), user = div.find('[name="username"]'), button = div.find('[type="button"]'),
image = div.find('img'), imgv = div.find('[name="imgVerify"]');
var src = image.attr('src');
image.click(click);
imgv.bind('keypress', d);
user.bind('keypress', d);
button.click(function () {
var uid = user.val(), vcode = imgv.val();
if (!uid) {
alert('请输入用户名');
user.focus();
} else if (!vcode) {
alert('请输入验证码');
imgv.focus();
} else {
disable();
$.post('resetPassword.json', {username: uid, verify: vcode})
.always(click, enable).fail(function (result) {
alert(result.responseJSON && result.responseJSON.message || result.responseText || 'Error Occur');
}).success(function (result) {
alert(result.message);
});
}
});
});
| jQuery(function ($) {
function d(event) {
event.keyCode === 13 && button.click();
}
function click() {
image.attr('src', src + (src.indexOf('?') < 0 ? '?' : '&') + '_=' + +new Date());
imgv.val('');
(user.val() ? imgv : user).focus();
}
function enable() {
button.removeAttr('disabled');
}
function disable() {
button.attr('disabled', true);
}
var div = $('#findpassword'), user = div.find('[name="username"]'), button = div.find('[type="button"]'),
image = div.find('img'), imgv = div.find('[name="imgVerify"]');
var src = image.attr('src');
image.click(click);
imgv.bind('keypress', d);
user.bind('keypress', d);
button.click(function () {
var uid = user.val(), vcode = imgv.val();
if (!uid) {
alert('请输入用户名');
user.focus();
} else if (!vcode) {
alert('请输入验证码');
imgv.focus();
} else {
disable();
$.post('resetPassword.json', {username: uid, verify: vcode})
.always(click, enable).fail(function (result) {
- console.log(arguments);
alert(result.responseJSON && result.responseJSON.message || result.responseText || 'Error Occur');
}).success(function (result) {
alert(result.message);
});
}
});
}); | 1 | 0.022222 | 0 | 1 |
f8dc33e384f714cd54ae4eb9258fe4a927b1f26d | .travis.yml | .travis.yml | language: python
python:
- 2.7
branches:
only:
- master
- dev
notifications:
email:
- authors@psiturk.org
on_success: change
on_failure: always
install:
- pip install -r requirements.txt
- pip install coveralls
script:
- python setup.py install
- psiturk-setup-example
- coverage run --source=psiturk setup.py test
after_success:
coveralls
| language: python
python:
- 2.7
branches:
only:
- master
- dev
notifications:
email:
- authors@psiturk.org
on_success: change
on_failure: always
install:
- pip install -r requirements.txt --use-mirrors
- pip install coverage coveralls --use-mirrors
script:
- python setup.py install
- psiturk-setup-example
- coverage run --source=psiturk setup.py test
- coverage report -m
after_success:
coveralls --verbose
| Install Coverage library during build. | Install Coverage library during build.
| YAML | mit | mshvartsman/psiTurk,johnmcdonnell/psiTurk,suchow/psiTurk,NYUCCL/psiTurk,rbtrace/psiTurk,andyh616/psiTurk,pfeyz/psiTurk,michaelpacer/psiTurk,berkeley-cocosci/psiTurk,mshvartsman/psiTurk,berkeley-cocosci/psiTurk,pfeyz/psiTurk,michaelpacer/psiTurk,rbtrace/psiTurk,michaelpacer/psiTurk,berkeley-cocosci/psiTurk,pfeyz/psiTurk,suchow/psiTurk,johnmcdonnell/psiTurk,suchow/psiTurk,andyh616/psiTurk,NYUCCL/psiTurk,kachergis/psiTurk,andyh616/psiTurk,kachergis/psiTurk,kachergis/psiTurk,johnmcdonnell/psiTurk,rbtrace/psiTurk,mshvartsman/psiTurk,NYUCCL/psiTurk | yaml | ## Code Before:
language: python
python:
- 2.7
branches:
only:
- master
- dev
notifications:
email:
- authors@psiturk.org
on_success: change
on_failure: always
install:
- pip install -r requirements.txt
- pip install coveralls
script:
- python setup.py install
- psiturk-setup-example
- coverage run --source=psiturk setup.py test
after_success:
coveralls
## Instruction:
Install Coverage library during build.
## Code After:
language: python
python:
- 2.7
branches:
only:
- master
- dev
notifications:
email:
- authors@psiturk.org
on_success: change
on_failure: always
install:
- pip install -r requirements.txt --use-mirrors
- pip install coverage coveralls --use-mirrors
script:
- python setup.py install
- psiturk-setup-example
- coverage run --source=psiturk setup.py test
- coverage report -m
after_success:
coveralls --verbose
| language: python
python:
- 2.7
branches:
only:
- master
- dev
notifications:
email:
- authors@psiturk.org
on_success: change
on_failure: always
install:
- - pip install -r requirements.txt
+ - pip install -r requirements.txt --use-mirrors
? +++++++++++++++
- - pip install coveralls
+ - pip install coverage coveralls --use-mirrors
script:
- python setup.py install
- psiturk-setup-example
- coverage run --source=psiturk setup.py test
+ - coverage report -m
after_success:
- coveralls
+ coveralls --verbose | 7 | 0.333333 | 4 | 3 |
24b678f4bf3e83d13891eadf7c659ac186333f3b | client/rideshare-sign-up/template.html | client/rideshare-sign-up/template.html | <div class="RideshareSignup">
<div class="content">
<a class="close pull-right" href="#" on-tap="hide"><i class="fa fa-times"></i></a>
<h3>Sign Up for Ridesharing!</h3>
<p>Our network of rideshares are commuting around the DC area together. Join us and get places faster, cheaper and greener!</p>
<form>
<div class="form-group">
<input type="text" name="first-name" class="form-control names" placeholder="First Name">
</div>
<div class="form-group">
<input type="text" name="last-name" class="form-control names" placeholder="Last Name">
</div>
<div class="form-group">
<input type="email" name="email" class="form-control" placeholder="Email">
</div>
<div class="form-group">
What is your commute origin and destination?
<div reactive="locationsView"></div>
</div>
<button type="submit" class="btn btn-block" on-tap="save">Next</button>
</form>
</div>
</div>
| <div class="RideshareSignup">
<div class="content">
<a class="close pull-right" href="#" on-tap="hide"><i class="fa fa-times"></i></a>
<h3>Sign Up for Ridesharing!</h3>
<p>Our network of rideshares are commuting around the DC area together. Join us and get places faster, cheaper and greener!</p>
<form>
<div class="form-group">
<input type="text" name="first-name" class="form-control names" placeholder="First Name">
</div>
<div class="form-group">
<input type="text" name="last-name" class="form-control names" placeholder="Last Name">
</div>
<div class="form-group">
<input type="email" name="email" class="form-control" placeholder="Email">
</div>
<div class="form-group">
What is your commute origin and destination?
<div reactive="locationsView"></div>
</div>
<p>More text explaining what's going to happen when they sign up.</p>
<button type="submit" class="btn btn-block" on-tap="save">Sign Up</button>
</form>
</div>
</div>
| Add additional paragraph of text for explanation. | Add additional paragraph of text for explanation.
| HTML | bsd-3-clause | amigocloud/modified-tripplanner,tismart/modeify,tismart/modeify,arunnair80/modeify,miraculixx/modeify,miraculixx/modeify,miraculixx/modeify,amigocloud/modified-tripplanner,tismart/modeify,arunnair80/modeify-1,arunnair80/modeify-1,amigocloud/modified-tripplanner,miraculixx/modeify,arunnair80/modeify,amigocloud/modeify,arunnair80/modeify,amigocloud/modeify,amigocloud/modeify,arunnair80/modeify,amigocloud/modified-tripplanner,arunnair80/modeify-1,arunnair80/modeify-1,amigocloud/modeify,tismart/modeify | html | ## Code Before:
<div class="RideshareSignup">
<div class="content">
<a class="close pull-right" href="#" on-tap="hide"><i class="fa fa-times"></i></a>
<h3>Sign Up for Ridesharing!</h3>
<p>Our network of rideshares are commuting around the DC area together. Join us and get places faster, cheaper and greener!</p>
<form>
<div class="form-group">
<input type="text" name="first-name" class="form-control names" placeholder="First Name">
</div>
<div class="form-group">
<input type="text" name="last-name" class="form-control names" placeholder="Last Name">
</div>
<div class="form-group">
<input type="email" name="email" class="form-control" placeholder="Email">
</div>
<div class="form-group">
What is your commute origin and destination?
<div reactive="locationsView"></div>
</div>
<button type="submit" class="btn btn-block" on-tap="save">Next</button>
</form>
</div>
</div>
## Instruction:
Add additional paragraph of text for explanation.
## Code After:
<div class="RideshareSignup">
<div class="content">
<a class="close pull-right" href="#" on-tap="hide"><i class="fa fa-times"></i></a>
<h3>Sign Up for Ridesharing!</h3>
<p>Our network of rideshares are commuting around the DC area together. Join us and get places faster, cheaper and greener!</p>
<form>
<div class="form-group">
<input type="text" name="first-name" class="form-control names" placeholder="First Name">
</div>
<div class="form-group">
<input type="text" name="last-name" class="form-control names" placeholder="Last Name">
</div>
<div class="form-group">
<input type="email" name="email" class="form-control" placeholder="Email">
</div>
<div class="form-group">
What is your commute origin and destination?
<div reactive="locationsView"></div>
</div>
<p>More text explaining what's going to happen when they sign up.</p>
<button type="submit" class="btn btn-block" on-tap="save">Sign Up</button>
</form>
</div>
</div>
| <div class="RideshareSignup">
<div class="content">
<a class="close pull-right" href="#" on-tap="hide"><i class="fa fa-times"></i></a>
+
<h3>Sign Up for Ridesharing!</h3>
<p>Our network of rideshares are commuting around the DC area together. Join us and get places faster, cheaper and greener!</p>
<form>
<div class="form-group">
<input type="text" name="first-name" class="form-control names" placeholder="First Name">
</div>
<div class="form-group">
<input type="text" name="last-name" class="form-control names" placeholder="Last Name">
</div>
<div class="form-group">
<input type="email" name="email" class="form-control" placeholder="Email">
</div>
<div class="form-group">
What is your commute origin and destination?
<div reactive="locationsView"></div>
</div>
+ <p>More text explaining what's going to happen when they sign up.</p>
+
- <button type="submit" class="btn btn-block" on-tap="save">Next</button>
? - ^^^^
+ <button type="submit" class="btn btn-block" on-tap="save">Sign Up</button>
? ^^^^^^^
</form>
</div>
</div>
- | 6 | 0.2 | 4 | 2 |
f7cb70a5969c4d6c8166cbd3b03be025bd21b53e | kotlin/app/src/main/res/layout/save_to_googlepay_button.xml | kotlin/app/src/main/res/layout/save_to_googlepay_button.xml | <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:clickable="true"
android:focusable="true"
android:layout_width="match_parent"
android:layout_height="48sp"
android:background="@drawable/googlepay_button_no_shadow_background"
android:padding="2sp"
android:contentDescription="@string/save_to_googlepay_button_content_description">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:duplicateParentState="true"
android:src="@drawable/save_to_google_pay_button"/>
</RelativeLayout>
| <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:clickable="true"
android:focusable="true"
android:layout_width="match_parent"
android:layout_height="48sp"
android:background="@drawable/googlepay_button_no_shadow_background"
android:padding="2sp"
android:contentDescription="@string/save_to_googlepay_button_content_description">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:duplicateParentState="true"
android:src="@drawable/save_to_google_pay_button"/>
</FrameLayout>
| Use a simpler FrameLayout to hold the button | Use a simpler FrameLayout to hold the button
| XML | apache-2.0 | google-pay/android-quickstart,google-pay/android-quickstart | xml | ## Code Before:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:clickable="true"
android:focusable="true"
android:layout_width="match_parent"
android:layout_height="48sp"
android:background="@drawable/googlepay_button_no_shadow_background"
android:padding="2sp"
android:contentDescription="@string/save_to_googlepay_button_content_description">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:duplicateParentState="true"
android:src="@drawable/save_to_google_pay_button"/>
</RelativeLayout>
## Instruction:
Use a simpler FrameLayout to hold the button
## Code After:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:clickable="true"
android:focusable="true"
android:layout_width="match_parent"
android:layout_height="48sp"
android:background="@drawable/googlepay_button_no_shadow_background"
android:padding="2sp"
android:contentDescription="@string/save_to_googlepay_button_content_description">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:duplicateParentState="true"
android:src="@drawable/save_to_google_pay_button"/>
</FrameLayout>
| <?xml version="1.0" encoding="utf-8"?>
- <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
? ^^^ ^^^
+ <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
? ^^ ^
android:clickable="true"
android:focusable="true"
android:layout_width="match_parent"
android:layout_height="48sp"
android:background="@drawable/googlepay_button_no_shadow_background"
android:padding="2sp"
android:contentDescription="@string/save_to_googlepay_button_content_description">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:duplicateParentState="true"
android:src="@drawable/save_to_google_pay_button"/>
- </RelativeLayout>
+ </FrameLayout> | 4 | 0.25 | 2 | 2 |
7e09d5d58965d7f37f325003774d89609ca536cc | lib/themes/dosomething/paraneue_dosomething/tasks/sass.js | lib/themes/dosomething/paraneue_dosomething/tasks/sass.js | var fs = require('fs');
var path = require('path');
var sass = require('node-sass');
module.exports = function(grunt) {
function writeFile(path, contents) {
if(grunt.file.exists(path)) {
grunt.file.delete(path);
}
grunt.file.write(path, contents);
}
grunt.registerTask('sass', function() {
console.log(sass.info());
var inFile = path.resolve('scss/app.scss');
var outFile = path.resolve('dist/app.min.css');
var result = sass.renderSync({
file: inFile,
outFile: outFile,
outputStyle: 'compressed',
sourceMap: false
});
writeFile(outFile, result.css);
});
};
| var fs = require('fs');
var path = require('path');
var sass = require('node-sass');
module.exports = function(grunt) {
function writeFile(path, contents) {
if(grunt.file.exists(path)) {
grunt.file.delete(path);
}
grunt.file.write(path, contents);
}
grunt.registerTask('sass', function() {
grunt.log.writeln(sass.info());
var inFile = path.resolve('scss/app.scss');
var outFile = path.resolve('dist/app.min.css');
var result = sass.renderSync({
file: inFile,
outFile: outFile,
outputStyle: 'compressed',
sourceMap: false
});
writeFile(outFile, result.css);
});
};
| Replace console log with Grunt's logging function. | Replace console log with Grunt's logging function.
| JavaScript | mit | DoSomething/dosomething,sbsmith86/dosomething,chloealee/dosomething,sergii-tkachenko/phoenix,angaither/dosomething,mshmsh5000/dosomething-1,DoSomething/dosomething,mshmsh5000/dosomething-1,jonuy/dosomething,DoSomething/dosomething,deadlybutter/phoenix,DoSomething/phoenix,sbsmith86/dosomething,DoSomething/phoenix,deadlybutter/phoenix,sergii-tkachenko/phoenix,DoSomething/dosomething,jonuy/dosomething,angaither/dosomething,chloealee/dosomething,angaither/dosomething,chloealee/dosomething,sergii-tkachenko/phoenix,jonuy/dosomething,deadlybutter/phoenix,jonuy/dosomething,mshmsh5000/dosomething-1,angaither/dosomething,sergii-tkachenko/phoenix,sbsmith86/dosomething,sbsmith86/dosomething,sbsmith86/dosomething,chloealee/dosomething,chloealee/dosomething,DoSomething/phoenix,DoSomething/phoenix,sbsmith86/dosomething,mshmsh5000/dosomething-1,mshmsh5000/dosomething-1,chloealee/dosomething,deadlybutter/phoenix,angaither/dosomething,DoSomething/dosomething,deadlybutter/phoenix,DoSomething/phoenix,jonuy/dosomething,DoSomething/dosomething,jonuy/dosomething,angaither/dosomething,sergii-tkachenko/phoenix | javascript | ## Code Before:
var fs = require('fs');
var path = require('path');
var sass = require('node-sass');
module.exports = function(grunt) {
function writeFile(path, contents) {
if(grunt.file.exists(path)) {
grunt.file.delete(path);
}
grunt.file.write(path, contents);
}
grunt.registerTask('sass', function() {
console.log(sass.info());
var inFile = path.resolve('scss/app.scss');
var outFile = path.resolve('dist/app.min.css');
var result = sass.renderSync({
file: inFile,
outFile: outFile,
outputStyle: 'compressed',
sourceMap: false
});
writeFile(outFile, result.css);
});
};
## Instruction:
Replace console log with Grunt's logging function.
## Code After:
var fs = require('fs');
var path = require('path');
var sass = require('node-sass');
module.exports = function(grunt) {
function writeFile(path, contents) {
if(grunt.file.exists(path)) {
grunt.file.delete(path);
}
grunt.file.write(path, contents);
}
grunt.registerTask('sass', function() {
grunt.log.writeln(sass.info());
var inFile = path.resolve('scss/app.scss');
var outFile = path.resolve('dist/app.min.css');
var result = sass.renderSync({
file: inFile,
outFile: outFile,
outputStyle: 'compressed',
sourceMap: false
});
writeFile(outFile, result.css);
});
};
| var fs = require('fs');
var path = require('path');
var sass = require('node-sass');
module.exports = function(grunt) {
function writeFile(path, contents) {
if(grunt.file.exists(path)) {
grunt.file.delete(path);
}
grunt.file.write(path, contents);
}
grunt.registerTask('sass', function() {
- console.log(sass.info());
+ grunt.log.writeln(sass.info());
var inFile = path.resolve('scss/app.scss');
var outFile = path.resolve('dist/app.min.css');
var result = sass.renderSync({
file: inFile,
outFile: outFile,
outputStyle: 'compressed',
sourceMap: false
});
writeFile(outFile, result.css);
});
}; | 2 | 0.068966 | 1 | 1 |
0abcc1a99a460c8ef3edfe5afd8daaabb5bd0998 | src/Verifier/SAW/Prelude.hs | src/Verifier/SAW/Prelude.hs | -- Provides access to the preludeLanguage.Haskell.TH
{-# LANGUAGE TemplateHaskell #-}
module Verifier.SAW.Prelude
( Module
, preludeModule
) where
import qualified Data.ByteString.Lazy as BL
import Data.ByteString.Unsafe (unsafePackAddressLen)
import Language.Haskell.TH
import System.IO.Unsafe (unsafePerformIO)
import Verifier.SAW.Grammar
import Verifier.SAW.TypedAST
{-# NOINLINE preludeModule #-}
-- | Returns a module containing the standard prelude for SAW.
preludeModule :: Module
preludeModule = unsafePerformIO $ do
b <- $(runIO $ do b <- BL.readFile "prelude/SAW.core"
case runParser "SAW.core" b parseSAW of
(_,[]) -> return (AppE (AppE packExpr lenExpr) primExpr)
where packExpr = VarE $ mkName "unsafePackAddressLen"
lenExpr = LitE $ IntegerL $ toInteger $ BL.length b
primExpr = LitE $ StringPrimL $ BL.unpack b
(_,errors) -> fail $ "Failed to parse prelude:\n" ++ show errors)
let (decls,[]) = runParser "SAW.core" (BL.fromChunks [b]) parseSAW
return (unsafeMkModule decls) | -- Provides access to the preludeLanguage.Haskell.TH
{-# LANGUAGE CPP #-}
{-# LANGUAGE TemplateHaskell #-}
module Verifier.SAW.Prelude
( Module
, preludeModule
) where
import qualified Data.ByteString.Lazy as BL
#if __GLASGOW_HASKELL__ >= 706
#else
import qualified Data.ByteString.Lazy.UTF8 as UTF8
#endif
import Data.ByteString.Unsafe (unsafePackAddressLen)
import Language.Haskell.TH
import System.IO.Unsafe (unsafePerformIO)
import Verifier.SAW.Grammar
import Verifier.SAW.TypedAST
{-# NOINLINE preludeModule #-}
-- | Returns a module containing the standard prelude for SAW.
preludeModule :: Module
preludeModule = unsafePerformIO $ do
b <- $(runIO $ do b <- BL.readFile "prelude/SAW.core"
case runParser "SAW.core" b parseSAW of
(_,[]) -> return (AppE (AppE packExpr lenExpr) primExpr)
where packExpr = VarE $ mkName "unsafePackAddressLen"
lenExpr = LitE $ IntegerL $ toInteger $ BL.length b
#if __GLASGOW_HASKELL__ >= 706
primExpr = LitE $ StringPrimL $ BL.unpack b
#else
primExpr = LitE $ StringPrimL $ UTF8.toString b
#endif
(_,errors) -> fail $ "Failed to parse prelude:\n" ++ show errors)
let (decls,[]) = runParser "SAW.core" (BL.fromChunks [b]) parseSAW
return (unsafeMkModule decls) | Add compatibility with older versions of TemplateHaskell. | Add compatibility with older versions of TemplateHaskell.
| Haskell | bsd-3-clause | GaloisInc/saw-script,GaloisInc/saw-script,GaloisInc/saw-script,GaloisInc/saw-script,GaloisInc/saw-script | haskell | ## Code Before:
-- Provides access to the preludeLanguage.Haskell.TH
{-# LANGUAGE TemplateHaskell #-}
module Verifier.SAW.Prelude
( Module
, preludeModule
) where
import qualified Data.ByteString.Lazy as BL
import Data.ByteString.Unsafe (unsafePackAddressLen)
import Language.Haskell.TH
import System.IO.Unsafe (unsafePerformIO)
import Verifier.SAW.Grammar
import Verifier.SAW.TypedAST
{-# NOINLINE preludeModule #-}
-- | Returns a module containing the standard prelude for SAW.
preludeModule :: Module
preludeModule = unsafePerformIO $ do
b <- $(runIO $ do b <- BL.readFile "prelude/SAW.core"
case runParser "SAW.core" b parseSAW of
(_,[]) -> return (AppE (AppE packExpr lenExpr) primExpr)
where packExpr = VarE $ mkName "unsafePackAddressLen"
lenExpr = LitE $ IntegerL $ toInteger $ BL.length b
primExpr = LitE $ StringPrimL $ BL.unpack b
(_,errors) -> fail $ "Failed to parse prelude:\n" ++ show errors)
let (decls,[]) = runParser "SAW.core" (BL.fromChunks [b]) parseSAW
return (unsafeMkModule decls)
## Instruction:
Add compatibility with older versions of TemplateHaskell.
## Code After:
-- Provides access to the preludeLanguage.Haskell.TH
{-# LANGUAGE CPP #-}
{-# LANGUAGE TemplateHaskell #-}
module Verifier.SAW.Prelude
( Module
, preludeModule
) where
import qualified Data.ByteString.Lazy as BL
#if __GLASGOW_HASKELL__ >= 706
#else
import qualified Data.ByteString.Lazy.UTF8 as UTF8
#endif
import Data.ByteString.Unsafe (unsafePackAddressLen)
import Language.Haskell.TH
import System.IO.Unsafe (unsafePerformIO)
import Verifier.SAW.Grammar
import Verifier.SAW.TypedAST
{-# NOINLINE preludeModule #-}
-- | Returns a module containing the standard prelude for SAW.
preludeModule :: Module
preludeModule = unsafePerformIO $ do
b <- $(runIO $ do b <- BL.readFile "prelude/SAW.core"
case runParser "SAW.core" b parseSAW of
(_,[]) -> return (AppE (AppE packExpr lenExpr) primExpr)
where packExpr = VarE $ mkName "unsafePackAddressLen"
lenExpr = LitE $ IntegerL $ toInteger $ BL.length b
#if __GLASGOW_HASKELL__ >= 706
primExpr = LitE $ StringPrimL $ BL.unpack b
#else
primExpr = LitE $ StringPrimL $ UTF8.toString b
#endif
(_,errors) -> fail $ "Failed to parse prelude:\n" ++ show errors)
let (decls,[]) = runParser "SAW.core" (BL.fromChunks [b]) parseSAW
return (unsafeMkModule decls) | -- Provides access to the preludeLanguage.Haskell.TH
+ {-# LANGUAGE CPP #-}
{-# LANGUAGE TemplateHaskell #-}
module Verifier.SAW.Prelude
( Module
, preludeModule
) where
import qualified Data.ByteString.Lazy as BL
+ #if __GLASGOW_HASKELL__ >= 706
+ #else
+ import qualified Data.ByteString.Lazy.UTF8 as UTF8
+ #endif
+
import Data.ByteString.Unsafe (unsafePackAddressLen)
import Language.Haskell.TH
import System.IO.Unsafe (unsafePerformIO)
import Verifier.SAW.Grammar
import Verifier.SAW.TypedAST
{-# NOINLINE preludeModule #-}
-- | Returns a module containing the standard prelude for SAW.
preludeModule :: Module
preludeModule = unsafePerformIO $ do
b <- $(runIO $ do b <- BL.readFile "prelude/SAW.core"
case runParser "SAW.core" b parseSAW of
(_,[]) -> return (AppE (AppE packExpr lenExpr) primExpr)
where packExpr = VarE $ mkName "unsafePackAddressLen"
lenExpr = LitE $ IntegerL $ toInteger $ BL.length b
+ #if __GLASGOW_HASKELL__ >= 706
primExpr = LitE $ StringPrimL $ BL.unpack b
+ #else
+ primExpr = LitE $ StringPrimL $ UTF8.toString b
+ #endif
(_,errors) -> fail $ "Failed to parse prelude:\n" ++ show errors)
let (decls,[]) = runParser "SAW.core" (BL.fromChunks [b]) parseSAW
return (unsafeMkModule decls) | 10 | 0.357143 | 10 | 0 |
ee8d7b053422b9750b658fe3b1ab4a5e53af317b | lib/command_issuelink.js | lib/command_issuelink.js | /*
Create an issue link
*/
module.exports = function (task, jira, grunt, callback) {
'use strict';
// ## Create an issue link between two issues ##
// ### Takes ###
//
// * link: a link object
// * callback: for when it’s done
//
// ### Returns ###
// * error: string if there was an issue, null if success
//
// [Jira Doc](http://docs.atlassian.com/jira/REST/latest/#id288232)
//
/* {
* 'linkType': 'Duplicate',
* 'fromIssueKey': 'HSP-1',
* 'toIssueKey': 'MKY-1',
* 'comment': {
* 'body': 'Linked related issue!',
* 'visibility': {
* 'type': 'GROUP',
* 'value': 'jira-users'
* }
* }
* }
*/
var link = task.getValue('link');
jira.issueLink(link, callback);
};
| /*
Create an issue link
*/
module.exports = function (task, jira, grunt, callback) {
'use strict';
// ## Create an issue link between two issues ##
// ### Takes ###
//
// * link: a link object
// * callback: for when it’s done
//
// ### Returns ###
// * error: string if there was an issue, null if success
//
// [Jira Doc](http://docs.atlassian.com/jira/REST/latest/#id288232)
/* {
* 'type': {
* 'name': 'requirement'
* },
* 'inwardIssue': {
* 'key': 'SYS-2080'
* },
* 'outwardIssue': {
* 'key': 'SYS-2081'
* },
* 'comment': {
* 'body': 'Linked related issue!',
* 'visibility': {
* 'type': 'GROUP',
* 'value': 'jira-users'
* }
* }
* }
*/
var link = task.getValue('link');
jira.issueLink(link, callback);
};
| Fix issue link example comment | Fix issue link example comment
| JavaScript | mit | RonaldTreur/grunt-jira | javascript | ## Code Before:
/*
Create an issue link
*/
module.exports = function (task, jira, grunt, callback) {
'use strict';
// ## Create an issue link between two issues ##
// ### Takes ###
//
// * link: a link object
// * callback: for when it’s done
//
// ### Returns ###
// * error: string if there was an issue, null if success
//
// [Jira Doc](http://docs.atlassian.com/jira/REST/latest/#id288232)
//
/* {
* 'linkType': 'Duplicate',
* 'fromIssueKey': 'HSP-1',
* 'toIssueKey': 'MKY-1',
* 'comment': {
* 'body': 'Linked related issue!',
* 'visibility': {
* 'type': 'GROUP',
* 'value': 'jira-users'
* }
* }
* }
*/
var link = task.getValue('link');
jira.issueLink(link, callback);
};
## Instruction:
Fix issue link example comment
## Code After:
/*
Create an issue link
*/
module.exports = function (task, jira, grunt, callback) {
'use strict';
// ## Create an issue link between two issues ##
// ### Takes ###
//
// * link: a link object
// * callback: for when it’s done
//
// ### Returns ###
// * error: string if there was an issue, null if success
//
// [Jira Doc](http://docs.atlassian.com/jira/REST/latest/#id288232)
/* {
* 'type': {
* 'name': 'requirement'
* },
* 'inwardIssue': {
* 'key': 'SYS-2080'
* },
* 'outwardIssue': {
* 'key': 'SYS-2081'
* },
* 'comment': {
* 'body': 'Linked related issue!',
* 'visibility': {
* 'type': 'GROUP',
* 'value': 'jira-users'
* }
* }
* }
*/
var link = task.getValue('link');
jira.issueLink(link, callback);
};
| /*
Create an issue link
*/
module.exports = function (task, jira, grunt, callback) {
'use strict';
// ## Create an issue link between two issues ##
// ### Takes ###
//
// * link: a link object
// * callback: for when it’s done
//
// ### Returns ###
// * error: string if there was an issue, null if success
//
// [Jira Doc](http://docs.atlassian.com/jira/REST/latest/#id288232)
- //
/* {
- * 'linkType': 'Duplicate',
- * 'fromIssueKey': 'HSP-1',
- * 'toIssueKey': 'MKY-1',
+ * 'type': {
+ * 'name': 'requirement'
+ * },
+ * 'inwardIssue': {
+ * 'key': 'SYS-2080'
+ * },
+ * 'outwardIssue': {
+ * 'key': 'SYS-2081'
+ * },
* 'comment': {
* 'body': 'Linked related issue!',
* 'visibility': {
* 'type': 'GROUP',
* 'value': 'jira-users'
* }
* }
* }
*/
var link = task.getValue('link');
jira.issueLink(link, callback);
}; | 13 | 0.371429 | 9 | 4 |
aef60d17607a0819e24a2a61304bd5ca38289d50 | scripts/slave/dart/dart_util.py | scripts/slave/dart/dart_util.py |
import optparse
import os
import sys
from common import chromium_utils
def clobber():
print('Clobbereing platform: %s' % sys.platform)
if sys.platform in ('win32'):
release_dir = os.path.abspath('ReleaseIA32')
print('Removing directory %s' % release_dir)
chromium_utils.RemoveDirectory(release_dir)
debug_dir = os.path.abspath('DebugIA32')
print('Removing directory %s' % debug_dir)
chromium_utils.RemoveDirectory(debug_dir)
elif sys.platform in ('linux2'):
out_dir = os.path.abspath('out')
print('Removing directory %s' % out_dir)
chromium_utils.RemoveDirectory(out_dir)
elif sys.platform.startswith('darwin'):
xcode_dir = os.path.abspath('xcodebuild')
print('Removing directory %s' % xcode_dir)
chromium_utils.RemoveDirectory(xcode_dir)
else:
print("Platform not recognized")
return 0
def main():
parser = optparse.OptionParser()
parser.add_option('',
'--clobber',
default=False,
action='store_true',
help='Clobber the builder')
options, args = parser.parse_args()
# args unused, use.
args.append('')
# Determine what to do based on options passed in.
if options.clobber:
return clobber()
else:
print("Nothing to do")
if '__main__' == __name__ :
sys.exit(main())
|
import optparse
import subprocess
import sys
def clobber():
cmd = [sys.executable,
'./tools/clean_output_directory.py',
'--mode=all']
print 'Clobbering %s' % (' '.join(cmd))
return subprocess.call(cmd)
def main():
parser = optparse.OptionParser()
parser.add_option('',
'--clobber',
default=False,
action='store_true',
help='Clobber the builder')
options, args = parser.parse_args()
# args unused, use.
args.append('')
# Determine what to do based on options passed in.
if options.clobber:
return clobber()
else:
print("Nothing to do")
if '__main__' == __name__ :
sys.exit(main())
| Use the new tools/clean_output_directory.py script for clobbering builders. | Use the new tools/clean_output_directory.py script for clobbering builders.
This will unify our clobbering functionality across builders that use annotated steps and builders with test setup in the buildbot source.
TBR=foo
Review URL: https://chromiumcodereview.appspot.com/10834305
git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@151464 0039d316-1c4b-4281-b951-d872f2087c98
| Python | bsd-3-clause | eunchong/build,eunchong/build,eunchong/build,eunchong/build | python | ## Code Before:
import optparse
import os
import sys
from common import chromium_utils
def clobber():
print('Clobbereing platform: %s' % sys.platform)
if sys.platform in ('win32'):
release_dir = os.path.abspath('ReleaseIA32')
print('Removing directory %s' % release_dir)
chromium_utils.RemoveDirectory(release_dir)
debug_dir = os.path.abspath('DebugIA32')
print('Removing directory %s' % debug_dir)
chromium_utils.RemoveDirectory(debug_dir)
elif sys.platform in ('linux2'):
out_dir = os.path.abspath('out')
print('Removing directory %s' % out_dir)
chromium_utils.RemoveDirectory(out_dir)
elif sys.platform.startswith('darwin'):
xcode_dir = os.path.abspath('xcodebuild')
print('Removing directory %s' % xcode_dir)
chromium_utils.RemoveDirectory(xcode_dir)
else:
print("Platform not recognized")
return 0
def main():
parser = optparse.OptionParser()
parser.add_option('',
'--clobber',
default=False,
action='store_true',
help='Clobber the builder')
options, args = parser.parse_args()
# args unused, use.
args.append('')
# Determine what to do based on options passed in.
if options.clobber:
return clobber()
else:
print("Nothing to do")
if '__main__' == __name__ :
sys.exit(main())
## Instruction:
Use the new tools/clean_output_directory.py script for clobbering builders.
This will unify our clobbering functionality across builders that use annotated steps and builders with test setup in the buildbot source.
TBR=foo
Review URL: https://chromiumcodereview.appspot.com/10834305
git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@151464 0039d316-1c4b-4281-b951-d872f2087c98
## Code After:
import optparse
import subprocess
import sys
def clobber():
cmd = [sys.executable,
'./tools/clean_output_directory.py',
'--mode=all']
print 'Clobbering %s' % (' '.join(cmd))
return subprocess.call(cmd)
def main():
parser = optparse.OptionParser()
parser.add_option('',
'--clobber',
default=False,
action='store_true',
help='Clobber the builder')
options, args = parser.parse_args()
# args unused, use.
args.append('')
# Determine what to do based on options passed in.
if options.clobber:
return clobber()
else:
print("Nothing to do")
if '__main__' == __name__ :
sys.exit(main())
|
import optparse
- import os
+ import subprocess
import sys
- from common import chromium_utils
-
def clobber():
+ cmd = [sys.executable,
+ './tools/clean_output_directory.py',
+ '--mode=all']
+ print 'Clobbering %s' % (' '.join(cmd))
+ return subprocess.call(cmd)
- print('Clobbereing platform: %s' % sys.platform)
- if sys.platform in ('win32'):
- release_dir = os.path.abspath('ReleaseIA32')
- print('Removing directory %s' % release_dir)
- chromium_utils.RemoveDirectory(release_dir)
- debug_dir = os.path.abspath('DebugIA32')
- print('Removing directory %s' % debug_dir)
- chromium_utils.RemoveDirectory(debug_dir)
- elif sys.platform in ('linux2'):
- out_dir = os.path.abspath('out')
- print('Removing directory %s' % out_dir)
- chromium_utils.RemoveDirectory(out_dir)
- elif sys.platform.startswith('darwin'):
- xcode_dir = os.path.abspath('xcodebuild')
- print('Removing directory %s' % xcode_dir)
- chromium_utils.RemoveDirectory(xcode_dir)
- else:
- print("Platform not recognized")
- return 0
-
def main():
parser = optparse.OptionParser()
parser.add_option('',
'--clobber',
default=False,
action='store_true',
help='Clobber the builder')
options, args = parser.parse_args()
# args unused, use.
args.append('')
# Determine what to do based on options passed in.
if options.clobber:
return clobber()
else:
print("Nothing to do")
if '__main__' == __name__ :
sys.exit(main()) | 29 | 0.58 | 6 | 23 |
4b8e8f8adfbee64f3fe619a055809ce551251b46 | gwt-ol3-client/src/main/java/ol/source/WmtsOptions.java | gwt-ol3-client/src/main/java/ol/source/WmtsOptions.java | /*******************************************************************************
* Copyright 2014, 2017 gwt-ol3
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
package ol.source;
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;
/**
* WMTS options.
*
* @author Tino Desjardins
*
*/
@JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object")
public class WmtsOptions extends TileImageOptions {
/**
* Sets the layername.
*
* @param layer layername
*/
@JsProperty
public native void setLayer(String layer);
@JsProperty
public native void setStyle(String style);
@JsProperty
public native void setFormat(String format);
@JsProperty
public native void setVersion(String version);
@JsProperty
public native void setMatrixSet(String matrixSet);
}
| /*******************************************************************************
* Copyright 2014, 2019 gwt-ol
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
package ol.source;
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;
/**
* WMTS options.
*
* @author Tino Desjardins
*
*/
@JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object")
public class WmtsOptions extends TileImageOptions {
/**
* Sets the layername.
*
* @param layer layername
*/
@JsProperty
public native void setLayer(String layer);
/**
* @param requestEncoding Request encoding.
*/
@JsProperty
public native void setRequestEncoding(String requestEncoding);
@JsProperty
public native void setStyle(String style);
@JsProperty
public native void setFormat(String format);
@JsProperty
public native void setVersion(String version);
@JsProperty
public native void setMatrixSet(String matrixSet);
}
| Add request encoding to WMTS source | Add request encoding to WMTS source | Java | apache-2.0 | TDesjardins/GWT-OL3-Playground,TDesjardins/GWT-OL3-Playground,TDesjardins/GWT-OL3-Playground,TDesjardins/gwt-ol3,TDesjardins/gwt-ol3,TDesjardins/gwt-ol3 | java | ## Code Before:
/*******************************************************************************
* Copyright 2014, 2017 gwt-ol3
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
package ol.source;
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;
/**
* WMTS options.
*
* @author Tino Desjardins
*
*/
@JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object")
public class WmtsOptions extends TileImageOptions {
/**
* Sets the layername.
*
* @param layer layername
*/
@JsProperty
public native void setLayer(String layer);
@JsProperty
public native void setStyle(String style);
@JsProperty
public native void setFormat(String format);
@JsProperty
public native void setVersion(String version);
@JsProperty
public native void setMatrixSet(String matrixSet);
}
## Instruction:
Add request encoding to WMTS source
## Code After:
/*******************************************************************************
* Copyright 2014, 2019 gwt-ol
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
package ol.source;
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;
/**
* WMTS options.
*
* @author Tino Desjardins
*
*/
@JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object")
public class WmtsOptions extends TileImageOptions {
/**
* Sets the layername.
*
* @param layer layername
*/
@JsProperty
public native void setLayer(String layer);
/**
* @param requestEncoding Request encoding.
*/
@JsProperty
public native void setRequestEncoding(String requestEncoding);
@JsProperty
public native void setStyle(String style);
@JsProperty
public native void setFormat(String format);
@JsProperty
public native void setVersion(String version);
@JsProperty
public native void setMatrixSet(String matrixSet);
}
| /*******************************************************************************
- * Copyright 2014, 2017 gwt-ol3
? ^ -
+ * Copyright 2014, 2019 gwt-ol
? ^
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
package ol.source;
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;
/**
* WMTS options.
*
* @author Tino Desjardins
*
*/
@JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object")
public class WmtsOptions extends TileImageOptions {
/**
* Sets the layername.
*
* @param layer layername
*/
@JsProperty
public native void setLayer(String layer);
+ /**
+ * @param requestEncoding Request encoding.
+ */
+ @JsProperty
+ public native void setRequestEncoding(String requestEncoding);
+
@JsProperty
public native void setStyle(String style);
@JsProperty
public native void setFormat(String format);
@JsProperty
public native void setVersion(String version);
@JsProperty
public native void setMatrixSet(String matrixSet);
} | 8 | 0.156863 | 7 | 1 |
c507f3b716e923d6000c3db7c6c989a078be8831 | tools/dockerfile/distribtest/python_dev_alpine3.7_x64/Dockerfile | tools/dockerfile/distribtest/python_dev_alpine3.7_x64/Dockerfile |
FROM alpine:3.7
RUN apk add --update build-base python python-dev py-pip
RUN pip install --upgrade pip
RUN pip install virtualenv
# bash is required for our test script invocation
# ideally, we want to fix the invocation mechanism
# so we can remove this, but it has to be here for
# now:
RUN apk add --update bash
|
FROM alpine:3.7
RUN apk add --update build-base linux-headers python python-dev py-pip
RUN pip install --upgrade pip
RUN pip install virtualenv
# bash is required for our test script invocation
# ideally, we want to fix the invocation mechanism
# so we can remove this, but it has to be here for
# now:
RUN apk add --update bash
| Add linux-headers to docker images for alpine linux | Add linux-headers to docker images for alpine linux
| unknown | apache-2.0 | stanley-cheung/grpc,ejona86/grpc,vjpai/grpc,jtattermusch/grpc,ejona86/grpc,grpc/grpc,grpc/grpc,muxi/grpc,vjpai/grpc,nicolasnoble/grpc,jtattermusch/grpc,vjpai/grpc,grpc/grpc,ctiller/grpc,grpc/grpc,grpc/grpc,stanley-cheung/grpc,ejona86/grpc,ejona86/grpc,donnadionne/grpc,vjpai/grpc,vjpai/grpc,jboeuf/grpc,donnadionne/grpc,ejona86/grpc,vjpai/grpc,nicolasnoble/grpc,jboeuf/grpc,donnadionne/grpc,jboeuf/grpc,donnadionne/grpc,firebase/grpc,firebase/grpc,ejona86/grpc,stanley-cheung/grpc,donnadionne/grpc,firebase/grpc,muxi/grpc,jboeuf/grpc,grpc/grpc,donnadionne/grpc,stanley-cheung/grpc,stanley-cheung/grpc,jboeuf/grpc,muxi/grpc,ctiller/grpc,ctiller/grpc,nicolasnoble/grpc,muxi/grpc,stanley-cheung/grpc,jboeuf/grpc,grpc/grpc,stanley-cheung/grpc,nicolasnoble/grpc,stanley-cheung/grpc,donnadionne/grpc,jboeuf/grpc,ctiller/grpc,ejona86/grpc,jboeuf/grpc,vjpai/grpc,firebase/grpc,jtattermusch/grpc,nicolasnoble/grpc,nicolasnoble/grpc,nicolasnoble/grpc,muxi/grpc,nicolasnoble/grpc,stanley-cheung/grpc,ctiller/grpc,vjpai/grpc,jboeuf/grpc,grpc/grpc,jtattermusch/grpc,ejona86/grpc,jtattermusch/grpc,donnadionne/grpc,jtattermusch/grpc,ctiller/grpc,muxi/grpc,muxi/grpc,jtattermusch/grpc,ctiller/grpc,ejona86/grpc,donnadionne/grpc,stanley-cheung/grpc,jboeuf/grpc,jtattermusch/grpc,grpc/grpc,vjpai/grpc,firebase/grpc,vjpai/grpc,firebase/grpc,nicolasnoble/grpc,jtattermusch/grpc,jtattermusch/grpc,ejona86/grpc,firebase/grpc,muxi/grpc,ctiller/grpc,stanley-cheung/grpc,jboeuf/grpc,ctiller/grpc,stanley-cheung/grpc,jtattermusch/grpc,muxi/grpc,jboeuf/grpc,vjpai/grpc,muxi/grpc,firebase/grpc,grpc/grpc,grpc/grpc,vjpai/grpc,ejona86/grpc,jtattermusch/grpc,muxi/grpc,donnadionne/grpc,ctiller/grpc,firebase/grpc,firebase/grpc,ejona86/grpc,firebase/grpc,muxi/grpc,ctiller/grpc,donnadionne/grpc,ctiller/grpc,nicolasnoble/grpc,donnadionne/grpc,firebase/grpc,nicolasnoble/grpc,grpc/grpc,nicolasnoble/grpc | unknown | ## Code Before:
FROM alpine:3.7
RUN apk add --update build-base python python-dev py-pip
RUN pip install --upgrade pip
RUN pip install virtualenv
# bash is required for our test script invocation
# ideally, we want to fix the invocation mechanism
# so we can remove this, but it has to be here for
# now:
RUN apk add --update bash
## Instruction:
Add linux-headers to docker images for alpine linux
## Code After:
FROM alpine:3.7
RUN apk add --update build-base linux-headers python python-dev py-pip
RUN pip install --upgrade pip
RUN pip install virtualenv
# bash is required for our test script invocation
# ideally, we want to fix the invocation mechanism
# so we can remove this, but it has to be here for
# now:
RUN apk add --update bash
|
FROM alpine:3.7
- RUN apk add --update build-base python python-dev py-pip
+ RUN apk add --update build-base linux-headers python python-dev py-pip
? ++++++++++++++
RUN pip install --upgrade pip
RUN pip install virtualenv
# bash is required for our test script invocation
# ideally, we want to fix the invocation mechanism
# so we can remove this, but it has to be here for
# now:
RUN apk add --update bash | 2 | 0.142857 | 1 | 1 |
09cec75821fbd9a078160690a39f93decb2de6b0 | README.md | README.md | A simple program to download files from zippyshare.
# How to use
Please type `zippy_dl -h` to display help
example:
zippy_dl http://www53.zippyshare.com/v/some/file.html http://www53.zippyshare.com/v/some_other/file.html
# build
git clone https://github.com/hare1039/zippy_dl.git
cd zippy_dl && mkdir build && cd build
cmake ..
And that's it!
You can find the binary inside build/zippy_dl, and you can move it anywhere you like!
I use phantomjs. Please make sure you could run `phantomjs` in shell.
| A simple program to download files from zippyshare.
# How to use
Please type `zippy_dl -h` to display help
example:
zippy_dl http://www53.zippyshare.com/v/some/file.html http://www53.zippyshare.com/v/some_other/file.html
# build
git clone https://github.com/hare1039/zippy_dl.git
cd zippy_dl && mkdir build && cd build
cmake ..
make
And that's it!
You can find the binary inside build/zippy_dl, and you can move it anywhere you like!
I use phantomjs. Please make sure you could run `phantomjs` in shell.
| Fix readme missing step: make | Fix readme missing step: make | Markdown | agpl-3.0 | hare1039/zippy_dl | markdown | ## Code Before:
A simple program to download files from zippyshare.
# How to use
Please type `zippy_dl -h` to display help
example:
zippy_dl http://www53.zippyshare.com/v/some/file.html http://www53.zippyshare.com/v/some_other/file.html
# build
git clone https://github.com/hare1039/zippy_dl.git
cd zippy_dl && mkdir build && cd build
cmake ..
And that's it!
You can find the binary inside build/zippy_dl, and you can move it anywhere you like!
I use phantomjs. Please make sure you could run `phantomjs` in shell.
## Instruction:
Fix readme missing step: make
## Code After:
A simple program to download files from zippyshare.
# How to use
Please type `zippy_dl -h` to display help
example:
zippy_dl http://www53.zippyshare.com/v/some/file.html http://www53.zippyshare.com/v/some_other/file.html
# build
git clone https://github.com/hare1039/zippy_dl.git
cd zippy_dl && mkdir build && cd build
cmake ..
make
And that's it!
You can find the binary inside build/zippy_dl, and you can move it anywhere you like!
I use phantomjs. Please make sure you could run `phantomjs` in shell.
| A simple program to download files from zippyshare.
# How to use
Please type `zippy_dl -h` to display help
example:
zippy_dl http://www53.zippyshare.com/v/some/file.html http://www53.zippyshare.com/v/some_other/file.html
# build
git clone https://github.com/hare1039/zippy_dl.git
cd zippy_dl && mkdir build && cd build
cmake ..
+
+ make
And that's it!
You can find the binary inside build/zippy_dl, and you can move it anywhere you like!
I use phantomjs. Please make sure you could run `phantomjs` in shell. | 2 | 0.095238 | 2 | 0 |
f720cea65f804ae43747d47815c55645902cf929 | .travis.yml | .travis.yml | ---
language: node_js
node_js:
- node
- "4"
cache:
yarn: true
directories:
- node_modules
env:
global:
- NODE_ENV=development
matrix:
- JOB=test AST_COMPARE=1
matrix:
fast_finish: true
include:
- node_js: "node"
env: JOB=lint
install:
- yarn install
before_script:
- yarn check-deps
script:
- if [ "${JOB}" = "lint" ]; then yarn lint && yarn lint-docs; fi
- if [ "${JOB}" = "test" ]; then yarn test --maxWorkers=4 --ci; fi
- if [ "${JOB}" = "test" ]; then yarn codecov; fi
branches:
only:
- master
| ---
language: node_js
node_js:
- node
- "4"
cache:
yarn: true
directories:
- node_modules
env:
global:
- NODE_ENV=development
matrix:
- JOB=test AST_COMPARE=1
matrix:
fast_finish: true
include:
- node_js: "node"
env: JOB=lint
install:
- yarn install
before_script:
- yarn check-deps
script:
- if [ "${JOB}" = "lint" ]; then yarn lint && yarn lint-docs; fi
- if [ "${JOB}" = "test" ]; then yarn test --runInBand --ci; fi
- if [ "${JOB}" = "test" ]; then yarn codecov; fi
branches:
only:
- master
| Add --runInBand back to Travis | Add --runInBand back to Travis
| YAML | mit | existentialism/prettier,existentialism/prettier,rattrayalex/prettier,prettier/prettier,rattrayalex/prettier,existentialism/prettier,existentialism/prettier,rattrayalex/prettier,jlongster/prettier,prettier/prettier,prettier/prettier,prettier/prettier | yaml | ## Code Before:
---
language: node_js
node_js:
- node
- "4"
cache:
yarn: true
directories:
- node_modules
env:
global:
- NODE_ENV=development
matrix:
- JOB=test AST_COMPARE=1
matrix:
fast_finish: true
include:
- node_js: "node"
env: JOB=lint
install:
- yarn install
before_script:
- yarn check-deps
script:
- if [ "${JOB}" = "lint" ]; then yarn lint && yarn lint-docs; fi
- if [ "${JOB}" = "test" ]; then yarn test --maxWorkers=4 --ci; fi
- if [ "${JOB}" = "test" ]; then yarn codecov; fi
branches:
only:
- master
## Instruction:
Add --runInBand back to Travis
## Code After:
---
language: node_js
node_js:
- node
- "4"
cache:
yarn: true
directories:
- node_modules
env:
global:
- NODE_ENV=development
matrix:
- JOB=test AST_COMPARE=1
matrix:
fast_finish: true
include:
- node_js: "node"
env: JOB=lint
install:
- yarn install
before_script:
- yarn check-deps
script:
- if [ "${JOB}" = "lint" ]; then yarn lint && yarn lint-docs; fi
- if [ "${JOB}" = "test" ]; then yarn test --runInBand --ci; fi
- if [ "${JOB}" = "test" ]; then yarn codecov; fi
branches:
only:
- master
| ---
language: node_js
node_js:
- node
- "4"
cache:
yarn: true
directories:
- node_modules
env:
global:
- NODE_ENV=development
matrix:
- JOB=test AST_COMPARE=1
matrix:
fast_finish: true
include:
- node_js: "node"
env: JOB=lint
install:
- yarn install
before_script:
- yarn check-deps
script:
- if [ "${JOB}" = "lint" ]; then yarn lint && yarn lint-docs; fi
- - if [ "${JOB}" = "test" ]; then yarn test --maxWorkers=4 --ci; fi
? ^ ^^^^^^^^^^
+ - if [ "${JOB}" = "test" ]; then yarn test --runInBand --ci; fi
? ^^^^^^ ^^
- if [ "${JOB}" = "test" ]; then yarn codecov; fi
branches:
only:
- master | 2 | 0.052632 | 1 | 1 |
81bce7cb0a730cf706131a41e3d847f93c769ca6 | app/views/shared/_test_results_page.html.haml | app/views/shared/_test_results_page.html.haml | .title
%h2
= link_to(@rubygem.name, rubygem_path(@rubygem.name))
= version_select(@rubygem, @version, @platform)
= platform_select(@all_test_results, @rubygem, @platform, @version)
.os-table-wrapper.border
.background
.os-table-centering-wrapper
.os-table-inner-centering-wrapper
%table.os-table
%tr
%td.header
ruby -v
- @ruby_versions.each do |ruby|
%td.header.column-label
= ruby || 'not reported'
- @operating_systems.each do |os|
%tr
%td.ruby-header.row-label
= os.capitalize
- @ruby_versions.each do |ruby|
%td.result-cell{:class => pass_fail(ruby, os)}
= pass_fail(ruby, os) == 'unknown' ? ' ' : "#{@os_matrix[ruby][os][:pass]}/#{@os_matrix[ruby][os][:pass] + @os_matrix[ruby][os][:fail]}"
= render :partial => 'shared/test_results', :locals => {:test_results => @test_results}
| .title
- if @version and @version.prerelease
.prerelease-badge
prerelease
%h2
= link_to(@rubygem.name, rubygem_path(@rubygem.name))
= version_select(@rubygem, @version, @platform)
= platform_select(@all_test_results, @rubygem, @platform, @version)
.os-table-wrapper.border
.background
.os-table-centering-wrapper
.os-table-inner-centering-wrapper
%table.os-table
%tr
%td.header
ruby -v
- @ruby_versions.each do |ruby|
%td.header.column-label
= ruby || 'not reported'
- @operating_systems.each do |os|
%tr
%td.ruby-header.row-label
= os.capitalize
- @ruby_versions.each do |ruby|
%td.result-cell{:class => pass_fail(ruby, os)}
= pass_fail(ruby, os) == 'unknown' ? ' ' : "#{@os_matrix[ruby][os][:pass]}/#{@os_matrix[ruby][os][:pass] + @os_matrix[ruby][os][:fail]}"
= render :partial => 'shared/test_results', :locals => {:test_results => @test_results}
| Add prerelease badge to version pages | Add prerelease badge to version pages
| Haml | mit | capoferro/gem-testers,capoferro/gem-testers | haml | ## Code Before:
.title
%h2
= link_to(@rubygem.name, rubygem_path(@rubygem.name))
= version_select(@rubygem, @version, @platform)
= platform_select(@all_test_results, @rubygem, @platform, @version)
.os-table-wrapper.border
.background
.os-table-centering-wrapper
.os-table-inner-centering-wrapper
%table.os-table
%tr
%td.header
ruby -v
- @ruby_versions.each do |ruby|
%td.header.column-label
= ruby || 'not reported'
- @operating_systems.each do |os|
%tr
%td.ruby-header.row-label
= os.capitalize
- @ruby_versions.each do |ruby|
%td.result-cell{:class => pass_fail(ruby, os)}
= pass_fail(ruby, os) == 'unknown' ? ' ' : "#{@os_matrix[ruby][os][:pass]}/#{@os_matrix[ruby][os][:pass] + @os_matrix[ruby][os][:fail]}"
= render :partial => 'shared/test_results', :locals => {:test_results => @test_results}
## Instruction:
Add prerelease badge to version pages
## Code After:
.title
- if @version and @version.prerelease
.prerelease-badge
prerelease
%h2
= link_to(@rubygem.name, rubygem_path(@rubygem.name))
= version_select(@rubygem, @version, @platform)
= platform_select(@all_test_results, @rubygem, @platform, @version)
.os-table-wrapper.border
.background
.os-table-centering-wrapper
.os-table-inner-centering-wrapper
%table.os-table
%tr
%td.header
ruby -v
- @ruby_versions.each do |ruby|
%td.header.column-label
= ruby || 'not reported'
- @operating_systems.each do |os|
%tr
%td.ruby-header.row-label
= os.capitalize
- @ruby_versions.each do |ruby|
%td.result-cell{:class => pass_fail(ruby, os)}
= pass_fail(ruby, os) == 'unknown' ? ' ' : "#{@os_matrix[ruby][os][:pass]}/#{@os_matrix[ruby][os][:pass] + @os_matrix[ruby][os][:fail]}"
= render :partial => 'shared/test_results', :locals => {:test_results => @test_results}
| .title
+ - if @version and @version.prerelease
+ .prerelease-badge
+ prerelease
%h2
= link_to(@rubygem.name, rubygem_path(@rubygem.name))
= version_select(@rubygem, @version, @platform)
= platform_select(@all_test_results, @rubygem, @platform, @version)
.os-table-wrapper.border
.background
.os-table-centering-wrapper
.os-table-inner-centering-wrapper
%table.os-table
%tr
%td.header
ruby -v
- @ruby_versions.each do |ruby|
%td.header.column-label
= ruby || 'not reported'
- @operating_systems.each do |os|
%tr
%td.ruby-header.row-label
= os.capitalize
- @ruby_versions.each do |ruby|
%td.result-cell{:class => pass_fail(ruby, os)}
= pass_fail(ruby, os) == 'unknown' ? ' ' : "#{@os_matrix[ruby][os][:pass]}/#{@os_matrix[ruby][os][:pass] + @os_matrix[ruby][os][:fail]}"
= render :partial => 'shared/test_results', :locals => {:test_results => @test_results}
| 3 | 0.107143 | 3 | 0 |
dec7f0fa1f2b838d5074e67004250b84b7e70762 | puppet-lint-no_erb_template-check.gemspec | puppet-lint-no_erb_template-check.gemspec | Gem::Specification.new do |spec|
spec.name = 'puppet-lint-no_erb_template-check'
spec.version = '0.1.0'
spec.homepage = 'https://github.com/deanwilson/puppet-lint-no_erb_template-check'
spec.license = 'MIT'
spec.author = 'Dean Wilson'
spec.email = 'dean.wilson@gmail.com'
spec.files = Dir[
'README.md',
'LICENSE',
'lib/**/*',
'spec/**/*',
]
spec.test_files = Dir['spec/**/*']
spec.summary = 'puppet-lint no_erb_template check'
spec.description = <<-EOF
Extends puppet-lint to ensure there are no calls to the template
or inline_template function as an aid to migrating to epp templates.
EOF
spec.add_dependency 'puppet-lint', '~> 1.1'
spec.add_development_dependency 'rspec', '~> 3.0'
spec.add_development_dependency 'rspec-its', '~> 1.0'
spec.add_development_dependency 'rspec-collection_matchers', '~> 1.0'
spec.add_development_dependency 'rake'
spec.add_development_dependency 'pry'
spec.add_development_dependency 'rubocop'
end
| Gem::Specification.new do |spec|
spec.name = 'puppet-lint-no_erb_template-check'
spec.version = '0.1.1'
spec.homepage = 'https://github.com/deanwilson/puppet-lint-no_erb_template-check'
spec.license = 'MIT'
spec.author = 'Dean Wilson'
spec.email = 'dean.wilson@gmail.com'
spec.files = Dir[
'README.md',
'LICENSE',
'lib/**/*',
'spec/**/*',
]
spec.test_files = Dir['spec/**/*']
spec.summary = 'puppet-lint no_erb_template check'
spec.description = <<-EOF
Extends puppet-lint to ensure there are no calls to the template
or inline_template function as an aid to migrating to epp templates.
EOF
spec.add_dependency 'puppet-lint', '>= 1.1', '< 3.0'
spec.add_development_dependency 'rspec', '~> 3.0'
spec.add_development_dependency 'rspec-its', '~> 1.0'
spec.add_development_dependency 'rspec-collection_matchers', '~> 1.0'
spec.add_development_dependency 'rake'
spec.add_development_dependency 'pry'
spec.add_development_dependency 'rubocop'
end
| Allow puppet-lint 2.0 as a dependency and bump check version | Allow puppet-lint 2.0 as a dependency and bump check version
| Ruby | mit | deanwilson/puppet-lint-no_erb_template-check | ruby | ## Code Before:
Gem::Specification.new do |spec|
spec.name = 'puppet-lint-no_erb_template-check'
spec.version = '0.1.0'
spec.homepage = 'https://github.com/deanwilson/puppet-lint-no_erb_template-check'
spec.license = 'MIT'
spec.author = 'Dean Wilson'
spec.email = 'dean.wilson@gmail.com'
spec.files = Dir[
'README.md',
'LICENSE',
'lib/**/*',
'spec/**/*',
]
spec.test_files = Dir['spec/**/*']
spec.summary = 'puppet-lint no_erb_template check'
spec.description = <<-EOF
Extends puppet-lint to ensure there are no calls to the template
or inline_template function as an aid to migrating to epp templates.
EOF
spec.add_dependency 'puppet-lint', '~> 1.1'
spec.add_development_dependency 'rspec', '~> 3.0'
spec.add_development_dependency 'rspec-its', '~> 1.0'
spec.add_development_dependency 'rspec-collection_matchers', '~> 1.0'
spec.add_development_dependency 'rake'
spec.add_development_dependency 'pry'
spec.add_development_dependency 'rubocop'
end
## Instruction:
Allow puppet-lint 2.0 as a dependency and bump check version
## Code After:
Gem::Specification.new do |spec|
spec.name = 'puppet-lint-no_erb_template-check'
spec.version = '0.1.1'
spec.homepage = 'https://github.com/deanwilson/puppet-lint-no_erb_template-check'
spec.license = 'MIT'
spec.author = 'Dean Wilson'
spec.email = 'dean.wilson@gmail.com'
spec.files = Dir[
'README.md',
'LICENSE',
'lib/**/*',
'spec/**/*',
]
spec.test_files = Dir['spec/**/*']
spec.summary = 'puppet-lint no_erb_template check'
spec.description = <<-EOF
Extends puppet-lint to ensure there are no calls to the template
or inline_template function as an aid to migrating to epp templates.
EOF
spec.add_dependency 'puppet-lint', '>= 1.1', '< 3.0'
spec.add_development_dependency 'rspec', '~> 3.0'
spec.add_development_dependency 'rspec-its', '~> 1.0'
spec.add_development_dependency 'rspec-collection_matchers', '~> 1.0'
spec.add_development_dependency 'rake'
spec.add_development_dependency 'pry'
spec.add_development_dependency 'rubocop'
end
| Gem::Specification.new do |spec|
spec.name = 'puppet-lint-no_erb_template-check'
- spec.version = '0.1.0'
? ^
+ spec.version = '0.1.1'
? ^
spec.homepage = 'https://github.com/deanwilson/puppet-lint-no_erb_template-check'
spec.license = 'MIT'
spec.author = 'Dean Wilson'
spec.email = 'dean.wilson@gmail.com'
spec.files = Dir[
'README.md',
'LICENSE',
'lib/**/*',
'spec/**/*',
]
spec.test_files = Dir['spec/**/*']
spec.summary = 'puppet-lint no_erb_template check'
spec.description = <<-EOF
Extends puppet-lint to ensure there are no calls to the template
or inline_template function as an aid to migrating to epp templates.
EOF
- spec.add_dependency 'puppet-lint', '~> 1.1'
? -
+ spec.add_dependency 'puppet-lint', '>= 1.1', '< 3.0'
? + +++++++++
spec.add_development_dependency 'rspec', '~> 3.0'
spec.add_development_dependency 'rspec-its', '~> 1.0'
spec.add_development_dependency 'rspec-collection_matchers', '~> 1.0'
spec.add_development_dependency 'rake'
spec.add_development_dependency 'pry'
spec.add_development_dependency 'rubocop'
end | 4 | 0.142857 | 2 | 2 |
ecee92d9270bc0f951702b14fe7e8f5d23a70dfe | app/models/test.rb | app/models/test.rb | class Test < ActiveRecord::Base
after_initialize :default_values
after_create :create_key
belongs_to :run
default_scope { order('created_at ASC') }
dragonfly_accessor :screenshot
dragonfly_accessor :screenshot_baseline
dragonfly_accessor :screenshot_diff
validates :name, :browser, :platform, :width, :run, presence: true
def self.find_by_key
where(key: key)
end
def self.find_baseline_by_key(key)
where(key: key, baseline: true).first
end
def pass?
pass
end
def url
"#{run.url}#test_#{id}"
end
def create_key
self.key = "#{run.suite.project.name} #{run.suite.name} #{name} #{browser} #{platform} #{width}".parameterize
self.save
end
private
def default_values
self.diff ||= 0
self.baseline ||= false
self.dimensions_changed ||= false
self.pass ||= false
end
end
| class Test < ActiveRecord::Base
after_initialize :default_values
after_create :create_key
belongs_to :run
default_scope { order('created_at ASC') }
dragonfly_accessor :screenshot
dragonfly_accessor :screenshot_baseline
dragonfly_accessor :screenshot_diff
validates :name, :browser, :platform, :width, :run, presence: true
def self.find_by_key
where(key: key)
end
def self.find_baseline_by_key(key)
where(key: key, baseline: true).first
end
def as_json(options)
run = super(options)
run[:url] = self.url
return run
end
def pass?
pass
end
def url
"#{run.url}#test_#{id}"
end
def create_key
self.key = "#{run.suite.project.name} #{run.suite.name} #{name} #{browser} #{platform} #{width}".parameterize
self.save
end
private
def default_values
self.diff ||= 0
self.baseline ||= false
self.dimensions_changed ||= false
self.pass ||= false
end
end
| Add URL to model's JSON output | Add URL to model's JSON output
| Ruby | mit | wearefriday/spectre,wearefriday/spectre,wearefriday/spectre,wearefriday/spectre | ruby | ## Code Before:
class Test < ActiveRecord::Base
after_initialize :default_values
after_create :create_key
belongs_to :run
default_scope { order('created_at ASC') }
dragonfly_accessor :screenshot
dragonfly_accessor :screenshot_baseline
dragonfly_accessor :screenshot_diff
validates :name, :browser, :platform, :width, :run, presence: true
def self.find_by_key
where(key: key)
end
def self.find_baseline_by_key(key)
where(key: key, baseline: true).first
end
def pass?
pass
end
def url
"#{run.url}#test_#{id}"
end
def create_key
self.key = "#{run.suite.project.name} #{run.suite.name} #{name} #{browser} #{platform} #{width}".parameterize
self.save
end
private
def default_values
self.diff ||= 0
self.baseline ||= false
self.dimensions_changed ||= false
self.pass ||= false
end
end
## Instruction:
Add URL to model's JSON output
## Code After:
class Test < ActiveRecord::Base
after_initialize :default_values
after_create :create_key
belongs_to :run
default_scope { order('created_at ASC') }
dragonfly_accessor :screenshot
dragonfly_accessor :screenshot_baseline
dragonfly_accessor :screenshot_diff
validates :name, :browser, :platform, :width, :run, presence: true
def self.find_by_key
where(key: key)
end
def self.find_baseline_by_key(key)
where(key: key, baseline: true).first
end
def as_json(options)
run = super(options)
run[:url] = self.url
return run
end
def pass?
pass
end
def url
"#{run.url}#test_#{id}"
end
def create_key
self.key = "#{run.suite.project.name} #{run.suite.name} #{name} #{browser} #{platform} #{width}".parameterize
self.save
end
private
def default_values
self.diff ||= 0
self.baseline ||= false
self.dimensions_changed ||= false
self.pass ||= false
end
end
| class Test < ActiveRecord::Base
after_initialize :default_values
after_create :create_key
belongs_to :run
default_scope { order('created_at ASC') }
dragonfly_accessor :screenshot
dragonfly_accessor :screenshot_baseline
dragonfly_accessor :screenshot_diff
validates :name, :browser, :platform, :width, :run, presence: true
def self.find_by_key
where(key: key)
end
def self.find_baseline_by_key(key)
where(key: key, baseline: true).first
end
+ def as_json(options)
+ run = super(options)
+ run[:url] = self.url
+ return run
+ end
def pass?
pass
end
def url
"#{run.url}#test_#{id}"
end
def create_key
self.key = "#{run.suite.project.name} #{run.suite.name} #{name} #{browser} #{platform} #{width}".parameterize
self.save
end
private
def default_values
self.diff ||= 0
self.baseline ||= false
self.dimensions_changed ||= false
self.pass ||= false
end
end | 5 | 0.121951 | 5 | 0 |
a77263ceab8ce4dc752f703f56c9b9472d925b53 | pages/app/controllers/refinery/pages/admin/preview_controller.rb | pages/app/controllers/refinery/pages/admin/preview_controller.rb | module Refinery
module Pages
module Admin
class PreviewController < AdminController
include Pages::InstanceMethods
include Pages::RenderOptions
layout :layout
def show
render_with_templates? page, :template => template
end
protected
def admin?
false
end
def find_page
if @page = Refinery::Page.find_by_path_or_id(params[:path], params[:id])
# Preview existing pages
@page.attributes = params[:page]
elsif params[:page]
# Preview a non-persisted page
@page = Page.new params[:page]
end
end
alias_method :page, :find_page
def layout
'application'
end
def template
'/refinery/pages/show'
end
end
end
end
end
| module Refinery
module Pages
module Admin
class PreviewController < AdminController
include Pages::InstanceMethods
include Pages::RenderOptions
before_filter :find_page
layout :layout
def show
render_with_templates? @page, :template => template
end
protected
def admin?
false
end
def find_page
if @page = Refinery::Page.find_by_path_or_id(params[:path], params[:id])
# Preview existing pages
@page.attributes = params[:page]
elsif params[:page]
# Preview a non-persisted page
@page = Page.new params[:page]
end
end
alias_method :page, :find_page
def layout
'application'
end
def template
'/refinery/pages/show'
end
end
end
end
end
| Use find_page as a before filter and use @page. | Use find_page as a before filter and use @page.
The method find_page does not always returns the page. It returns he params hash in the case of hash assignation (preview existing pages).
This break previews view view_templates as object methods are called in RenderOptions::render_options_for_template. | Ruby | mit | mobilityhouse/refinerycms,simi/refinerycms,refinery/refinerycms,aguzubiaga/refinerycms,aguzubiaga/refinerycms,hoopla-software/refinerycms,Eric-Guo/refinerycms,louim/refinerycms,mobilityhouse/refinerycms,sideci-sample/sideci-sample-refinerycms,KingLemuel/refinerycms,simi/refinerycms,sideci-sample/sideci-sample-refinerycms,gwagener/refinerycms,trevornez/refinerycms,Retimont/refinerycms,kappiah/refinerycms,LytayTOUCH/refinerycms,trevornez/refinerycms,mabras/refinerycms,mabras/refinerycms,johanb/refinerycms,gwagener/refinerycms,Eric-Guo/refinerycms,mkaplan9/refinerycms,mlinfoot/refinerycms,LytayTOUCH/refinerycms,mlinfoot/refinerycms,kappiah/refinerycms,trevornez/refinerycms,louim/refinerycms,chrise86/refinerycms,kelkoo-services/refinerycms,johanb/refinerycms,refinery/refinerycms,Retimont/refinerycms,aguzubiaga/refinerycms,simi/refinerycms,kelkoo-services/refinerycms,chrise86/refinerycms,refinery/refinerycms,hoopla-software/refinerycms,anitagraham/refinerycms,mkaplan9/refinerycms,mlinfoot/refinerycms,chrise86/refinerycms,mabras/refinerycms,stefanspicer/refinerycms,anitagraham/refinerycms,gwagener/refinerycms,stefanspicer/refinerycms,kappiah/refinerycms,anitagraham/refinerycms,KingLemuel/refinerycms,Retimont/refinerycms,mkaplan9/refinerycms,LytayTOUCH/refinerycms,bricesanchez/refinerycms,Eric-Guo/refinerycms,KingLemuel/refinerycms,johanb/refinerycms,stefanspicer/refinerycms,hoopla-software/refinerycms,simi/refinerycms,bricesanchez/refinerycms | ruby | ## Code Before:
module Refinery
module Pages
module Admin
class PreviewController < AdminController
include Pages::InstanceMethods
include Pages::RenderOptions
layout :layout
def show
render_with_templates? page, :template => template
end
protected
def admin?
false
end
def find_page
if @page = Refinery::Page.find_by_path_or_id(params[:path], params[:id])
# Preview existing pages
@page.attributes = params[:page]
elsif params[:page]
# Preview a non-persisted page
@page = Page.new params[:page]
end
end
alias_method :page, :find_page
def layout
'application'
end
def template
'/refinery/pages/show'
end
end
end
end
end
## Instruction:
Use find_page as a before filter and use @page.
The method find_page does not always returns the page. It returns he params hash in the case of hash assignation (preview existing pages).
This break previews view view_templates as object methods are called in RenderOptions::render_options_for_template.
## Code After:
module Refinery
module Pages
module Admin
class PreviewController < AdminController
include Pages::InstanceMethods
include Pages::RenderOptions
before_filter :find_page
layout :layout
def show
render_with_templates? @page, :template => template
end
protected
def admin?
false
end
def find_page
if @page = Refinery::Page.find_by_path_or_id(params[:path], params[:id])
# Preview existing pages
@page.attributes = params[:page]
elsif params[:page]
# Preview a non-persisted page
@page = Page.new params[:page]
end
end
alias_method :page, :find_page
def layout
'application'
end
def template
'/refinery/pages/show'
end
end
end
end
end
| module Refinery
module Pages
module Admin
class PreviewController < AdminController
include Pages::InstanceMethods
include Pages::RenderOptions
+ before_filter :find_page
+
layout :layout
def show
- render_with_templates? page, :template => template
+ render_with_templates? @page, :template => template
? +
end
protected
def admin?
false
end
def find_page
if @page = Refinery::Page.find_by_path_or_id(params[:path], params[:id])
# Preview existing pages
@page.attributes = params[:page]
elsif params[:page]
# Preview a non-persisted page
@page = Page.new params[:page]
end
end
alias_method :page, :find_page
def layout
'application'
end
def template
'/refinery/pages/show'
end
end
end
end
end | 4 | 0.1 | 3 | 1 |
671fd328c0590b78273d7d2943138b61786d37b4 | src/3.1/Dockerfile | src/3.1/Dockerfile | FROM java:openjdk-8-jre
ENV NEO4J_SHA256 %%NEO4J_SHA%%
ENV NEO4J_TARBALL %%NEO4J_TARBALL%%
ARG NEO4J_URI=%%NEO4J_DIST_SITE%%/%%NEO4J_TARBALL%%
COPY ./local-package/* /tmp/
RUN curl --fail --silent --show-error --location --remote-name ${NEO4J_URI} \
&& echo "${NEO4J_SHA256} ${NEO4J_TARBALL}" | sha256sum --check --quiet - \
&& tar --extract --file ${NEO4J_TARBALL} --directory /var/lib \
&& mv /var/lib/neo4j-* /var/lib/neo4j \
&& rm ${NEO4J_TARBALL}
WORKDIR /var/lib/neo4j
RUN mv data /data \
&& ln --symbolic /data
VOLUME /data
COPY docker-entrypoint.sh /docker-entrypoint.sh
EXPOSE 7474 7473 7687
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["neo4j"]
| FROM java:openjdk-8-jre-alpine
RUN apk add --no-cache --quiet \
bash \
curl
ENV NEO4J_SHA256 %%NEO4J_SHA%%
ENV NEO4J_TARBALL %%NEO4J_TARBALL%%
ARG NEO4J_URI=%%NEO4J_DIST_SITE%%/%%NEO4J_TARBALL%%
COPY ./local-package/* /tmp/
RUN curl --fail --silent --show-error --location --remote-name ${NEO4J_URI} \
&& echo "${NEO4J_SHA256} ${NEO4J_TARBALL}" | sha256sum -csw - \
&& tar --extract --file ${NEO4J_TARBALL} --directory /var/lib \
&& mv /var/lib/neo4j-* /var/lib/neo4j \
&& rm ${NEO4J_TARBALL}
WORKDIR /var/lib/neo4j
RUN mv data /data \
&& ln -s /data
VOLUME /data
COPY docker-entrypoint.sh /docker-entrypoint.sh
EXPOSE 7474 7473 7687
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["neo4j"]
| Move 3.1 to use an Alpine-based base image | Move 3.1 to use an Alpine-based base image
This is for security reasons: it reduces the attack surface because
Alpine is a "minimal" distro. There are also unfixed security holes in
the Debian base image; the Docker maintainers recommend using Alpine
instead because the upstream reacts quicker to these problems.
We have decided that, although it is a security risk, making the change
in a point release of one of the older release is too much of a change.
| unknown | apache-2.0 | neo4j-contrib/docker-neo4j,neo4j/docker-neo4j,neo4j-contrib/docker-neo4j,neo4j/docker-neo4j | unknown | ## Code Before:
FROM java:openjdk-8-jre
ENV NEO4J_SHA256 %%NEO4J_SHA%%
ENV NEO4J_TARBALL %%NEO4J_TARBALL%%
ARG NEO4J_URI=%%NEO4J_DIST_SITE%%/%%NEO4J_TARBALL%%
COPY ./local-package/* /tmp/
RUN curl --fail --silent --show-error --location --remote-name ${NEO4J_URI} \
&& echo "${NEO4J_SHA256} ${NEO4J_TARBALL}" | sha256sum --check --quiet - \
&& tar --extract --file ${NEO4J_TARBALL} --directory /var/lib \
&& mv /var/lib/neo4j-* /var/lib/neo4j \
&& rm ${NEO4J_TARBALL}
WORKDIR /var/lib/neo4j
RUN mv data /data \
&& ln --symbolic /data
VOLUME /data
COPY docker-entrypoint.sh /docker-entrypoint.sh
EXPOSE 7474 7473 7687
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["neo4j"]
## Instruction:
Move 3.1 to use an Alpine-based base image
This is for security reasons: it reduces the attack surface because
Alpine is a "minimal" distro. There are also unfixed security holes in
the Debian base image; the Docker maintainers recommend using Alpine
instead because the upstream reacts quicker to these problems.
We have decided that, although it is a security risk, making the change
in a point release of one of the older release is too much of a change.
## Code After:
FROM java:openjdk-8-jre-alpine
RUN apk add --no-cache --quiet \
bash \
curl
ENV NEO4J_SHA256 %%NEO4J_SHA%%
ENV NEO4J_TARBALL %%NEO4J_TARBALL%%
ARG NEO4J_URI=%%NEO4J_DIST_SITE%%/%%NEO4J_TARBALL%%
COPY ./local-package/* /tmp/
RUN curl --fail --silent --show-error --location --remote-name ${NEO4J_URI} \
&& echo "${NEO4J_SHA256} ${NEO4J_TARBALL}" | sha256sum -csw - \
&& tar --extract --file ${NEO4J_TARBALL} --directory /var/lib \
&& mv /var/lib/neo4j-* /var/lib/neo4j \
&& rm ${NEO4J_TARBALL}
WORKDIR /var/lib/neo4j
RUN mv data /data \
&& ln -s /data
VOLUME /data
COPY docker-entrypoint.sh /docker-entrypoint.sh
EXPOSE 7474 7473 7687
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["neo4j"]
| - FROM java:openjdk-8-jre
+ FROM java:openjdk-8-jre-alpine
? +++++++
+
+ RUN apk add --no-cache --quiet \
+ bash \
+ curl
ENV NEO4J_SHA256 %%NEO4J_SHA%%
ENV NEO4J_TARBALL %%NEO4J_TARBALL%%
ARG NEO4J_URI=%%NEO4J_DIST_SITE%%/%%NEO4J_TARBALL%%
COPY ./local-package/* /tmp/
RUN curl --fail --silent --show-error --location --remote-name ${NEO4J_URI} \
- && echo "${NEO4J_SHA256} ${NEO4J_TARBALL}" | sha256sum --check --quiet - \
? - ^^^^^^^^^^^^
+ && echo "${NEO4J_SHA256} ${NEO4J_TARBALL}" | sha256sum -csw - \
? + ^^
&& tar --extract --file ${NEO4J_TARBALL} --directory /var/lib \
&& mv /var/lib/neo4j-* /var/lib/neo4j \
&& rm ${NEO4J_TARBALL}
WORKDIR /var/lib/neo4j
RUN mv data /data \
- && ln --symbolic /data
? - -------
+ && ln -s /data
VOLUME /data
COPY docker-entrypoint.sh /docker-entrypoint.sh
EXPOSE 7474 7473 7687
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["neo4j"] | 10 | 0.37037 | 7 | 3 |
5d3cba40d73650de26457475caccf1e3e6ed350e | _sass/base/_text.scss | _sass/base/_text.scss | h1 {
font-size: $font-size--xxl;
color: white;
margin: $spacing--xl 0;
}
h2 {
font-size: $font-size--xl;
font-weight: 300;
color: $black;
}
h3 {
font-size: $font-size--l;
letter-spacing: 1px;
font-weight: 500;
color: $black;
}
h4 {
font-size: $font-size--l;
margin: $spacing--m 0;
}
h5 {
font-size: $font-size--s;
font-weight: 300;
color: $black;
}
h6 {
font-size: .9rem;
font-weight: 500;
color: $black;
}
p {
font-size: $font-size--xs;
font-weight: 300;
line-height: 1rem;
}
p.lead {
font-size: 17px;
font-weight: 400;
}
| h1 {
font-size: $font-size--xxl;
color: white;
margin: $spacing--xl 0;
}
h2 {
font-size: $font-size--xl;
font-weight: 300;
color: $black;
}
h3 {
font-size: $font-size--l;
letter-spacing: 1px;
font-weight: 500;
color: $black;
}
h4 {
font-size: $font-size--l;
margin: $spacing--m 0;
}
h5 {
font-size: $font-size--s;
font-weight: 300;
color: $black;
}
h6 {
font-size: .9rem;
font-weight: 500;
color: $black;
}
p {
font-size: $font-size--xs;
font-weight: 300;
line-height: 1rem;
}
pre code {
font-size: $font-size--xxs;
}
p.lead {
font-size: 17px;
font-weight: 400;
}
| Reduce size of text in code displays | Reduce size of text in code displays
| SCSS | apache-2.0 | abseil/abseil.github.io,manshreck/abseil.github.io,abseil/abseil.github.io,manshreck/abseil.github.io,abseil/abseil.github.io,manshreck/abseil.github.io | scss | ## Code Before:
h1 {
font-size: $font-size--xxl;
color: white;
margin: $spacing--xl 0;
}
h2 {
font-size: $font-size--xl;
font-weight: 300;
color: $black;
}
h3 {
font-size: $font-size--l;
letter-spacing: 1px;
font-weight: 500;
color: $black;
}
h4 {
font-size: $font-size--l;
margin: $spacing--m 0;
}
h5 {
font-size: $font-size--s;
font-weight: 300;
color: $black;
}
h6 {
font-size: .9rem;
font-weight: 500;
color: $black;
}
p {
font-size: $font-size--xs;
font-weight: 300;
line-height: 1rem;
}
p.lead {
font-size: 17px;
font-weight: 400;
}
## Instruction:
Reduce size of text in code displays
## Code After:
h1 {
font-size: $font-size--xxl;
color: white;
margin: $spacing--xl 0;
}
h2 {
font-size: $font-size--xl;
font-weight: 300;
color: $black;
}
h3 {
font-size: $font-size--l;
letter-spacing: 1px;
font-weight: 500;
color: $black;
}
h4 {
font-size: $font-size--l;
margin: $spacing--m 0;
}
h5 {
font-size: $font-size--s;
font-weight: 300;
color: $black;
}
h6 {
font-size: .9rem;
font-weight: 500;
color: $black;
}
p {
font-size: $font-size--xs;
font-weight: 300;
line-height: 1rem;
}
pre code {
font-size: $font-size--xxs;
}
p.lead {
font-size: 17px;
font-weight: 400;
}
| h1 {
font-size: $font-size--xxl;
color: white;
margin: $spacing--xl 0;
}
h2 {
font-size: $font-size--xl;
font-weight: 300;
color: $black;
}
h3 {
font-size: $font-size--l;
letter-spacing: 1px;
font-weight: 500;
color: $black;
}
h4 {
font-size: $font-size--l;
margin: $spacing--m 0;
}
h5 {
font-size: $font-size--s;
font-weight: 300;
color: $black;
}
h6 {
font-size: .9rem;
font-weight: 500;
color: $black;
}
p {
font-size: $font-size--xs;
font-weight: 300;
line-height: 1rem;
}
+ pre code {
+ font-size: $font-size--xxs;
+ }
+
p.lead {
font-size: 17px;
font-weight: 400;
} | 4 | 0.086957 | 4 | 0 |
d8f4763a5c6946c3323f2567cb1554244c844c05 | test/unit/model/view.coffee | test/unit/model/view.coffee | sinon = require 'sinon'
should = require 'should'
describe 'Client model: View', ->
helper = require '../helper'
helper.evalConcatenatedFile 'client/code/model/tool.coffee'
helper.evalConcatenatedFile 'client/code/model/view.coffee'
describe 'URL', ->
beforeEach ->
@tool = Cu.Model.Tool.findOrCreate
name: 'test-plugin'
displayName: 'Test Plugin'
@view = Cu.Model.View.findOrCreate
user: 'test'
box: 'box1'
tool: 'test-plugin'
it 'has a related tool', ->
tool = @view.get('tool')
tool.get('displayName').should.equal 'Test Plugin'
class TestDb
class Model
constructor: (obj) ->
for k of obj
@[k] = obj[k]
toObject: -> @
save: (callback) ->
callback null
@find: (_args, callback) ->
callback null, [ new Model(name: 'test'),
new Model(name: 'test2')
]
View = require('model/view')(TestDb)
describe 'Server model: View', ->
before ->
@saveSpy = sinon.spy TestDb.prototype, 'save'
@findSpy = sinon.spy TestDb, 'find'
@view = new View
user: 'ickle'
name: 'test'
displayName: 'Test'
box: 'sdjfsdf'
context 'when view.save is called', ->
before (done) ->
@view.save done
it 'calls mongoose save method', ->
@saveSpy.calledOnce.should.be.true
context 'when view.findAll is called', ->
before (done) ->
View.findAll (err, res) =>
@results = res
done()
it 'should return View results', ->
@results[0].should.be.an.instanceOf View
@results[0].name.should.equal 'test'
@results.length.should.equal 2
| sinon = require 'sinon'
should = require 'should'
describe 'Client model: View', ->
helper = require '../helper'
helper.evalConcatenatedFile 'client/code/model/tool.coffee'
helper.evalConcatenatedFile 'client/code/model/view.coffee'
describe 'URL', ->
beforeEach ->
@tool = Cu.Model.Tool.findOrCreate
name: 'test-plugin'
displayName: 'Test Plugin'
@view = Cu.Model.View.findOrCreate
user: 'test'
box: 'box1'
tool: 'test-plugin'
it 'has a related tool', ->
tool = @view.get('tool')
tool.get('displayName').should.equal 'Test Plugin'
class TestDb
class Model
constructor: (obj) ->
for k of obj
@[k] = obj[k]
toObject: -> @
save: (callback) ->
callback null
@find: (_args, callback) ->
callback null, [ new Model(name: 'test'),
new Model(name: 'test2')
]
| Remove old View test, which can't possibly work as Views don't have their own persistent model on server side | Remove old View test, which can't possibly work as Views don't have their own persistent model on server side
| CoffeeScript | agpl-3.0 | scraperwiki/custard,scraperwiki/custard,scraperwiki/custard | coffeescript | ## Code Before:
sinon = require 'sinon'
should = require 'should'
describe 'Client model: View', ->
helper = require '../helper'
helper.evalConcatenatedFile 'client/code/model/tool.coffee'
helper.evalConcatenatedFile 'client/code/model/view.coffee'
describe 'URL', ->
beforeEach ->
@tool = Cu.Model.Tool.findOrCreate
name: 'test-plugin'
displayName: 'Test Plugin'
@view = Cu.Model.View.findOrCreate
user: 'test'
box: 'box1'
tool: 'test-plugin'
it 'has a related tool', ->
tool = @view.get('tool')
tool.get('displayName').should.equal 'Test Plugin'
class TestDb
class Model
constructor: (obj) ->
for k of obj
@[k] = obj[k]
toObject: -> @
save: (callback) ->
callback null
@find: (_args, callback) ->
callback null, [ new Model(name: 'test'),
new Model(name: 'test2')
]
View = require('model/view')(TestDb)
describe 'Server model: View', ->
before ->
@saveSpy = sinon.spy TestDb.prototype, 'save'
@findSpy = sinon.spy TestDb, 'find'
@view = new View
user: 'ickle'
name: 'test'
displayName: 'Test'
box: 'sdjfsdf'
context 'when view.save is called', ->
before (done) ->
@view.save done
it 'calls mongoose save method', ->
@saveSpy.calledOnce.should.be.true
context 'when view.findAll is called', ->
before (done) ->
View.findAll (err, res) =>
@results = res
done()
it 'should return View results', ->
@results[0].should.be.an.instanceOf View
@results[0].name.should.equal 'test'
@results.length.should.equal 2
## Instruction:
Remove old View test, which can't possibly work as Views don't have their own persistent model on server side
## Code After:
sinon = require 'sinon'
should = require 'should'
describe 'Client model: View', ->
helper = require '../helper'
helper.evalConcatenatedFile 'client/code/model/tool.coffee'
helper.evalConcatenatedFile 'client/code/model/view.coffee'
describe 'URL', ->
beforeEach ->
@tool = Cu.Model.Tool.findOrCreate
name: 'test-plugin'
displayName: 'Test Plugin'
@view = Cu.Model.View.findOrCreate
user: 'test'
box: 'box1'
tool: 'test-plugin'
it 'has a related tool', ->
tool = @view.get('tool')
tool.get('displayName').should.equal 'Test Plugin'
class TestDb
class Model
constructor: (obj) ->
for k of obj
@[k] = obj[k]
toObject: -> @
save: (callback) ->
callback null
@find: (_args, callback) ->
callback null, [ new Model(name: 'test'),
new Model(name: 'test2')
]
| sinon = require 'sinon'
should = require 'should'
describe 'Client model: View', ->
helper = require '../helper'
helper.evalConcatenatedFile 'client/code/model/tool.coffee'
helper.evalConcatenatedFile 'client/code/model/view.coffee'
describe 'URL', ->
beforeEach ->
@tool = Cu.Model.Tool.findOrCreate
name: 'test-plugin'
displayName: 'Test Plugin'
@view = Cu.Model.View.findOrCreate
user: 'test'
box: 'box1'
tool: 'test-plugin'
it 'has a related tool', ->
tool = @view.get('tool')
tool.get('displayName').should.equal 'Test Plugin'
class TestDb
class Model
constructor: (obj) ->
for k of obj
@[k] = obj[k]
toObject: -> @
save: (callback) ->
callback null
@find: (_args, callback) ->
callback null, [ new Model(name: 'test'),
new Model(name: 'test2')
]
- View = require('model/view')(TestDb)
-
- describe 'Server model: View', ->
-
- before ->
- @saveSpy = sinon.spy TestDb.prototype, 'save'
- @findSpy = sinon.spy TestDb, 'find'
- @view = new View
- user: 'ickle'
- name: 'test'
- displayName: 'Test'
- box: 'sdjfsdf'
-
-
- context 'when view.save is called', ->
- before (done) ->
- @view.save done
-
- it 'calls mongoose save method', ->
- @saveSpy.calledOnce.should.be.true
-
- context 'when view.findAll is called', ->
- before (done) ->
- View.findAll (err, res) =>
- @results = res
- done()
-
- it 'should return View results', ->
- @results[0].should.be.an.instanceOf View
- @results[0].name.should.equal 'test'
- @results.length.should.equal 2 | 31 | 0.449275 | 0 | 31 |
2de80ed1def6937ff9070b9d2d0f7c8ef6256dfd | src/AppBundle/Controller/StartpageController.php | src/AppBundle/Controller/StartpageController.php | <?php
namespace AppBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
class StartpageController extends Controller
{
/**
* @Route("/", name="startpage")
*/
public function indexAction(Request $request)
{
// replace this example code with whatever you need
return $this->render('startpage/index.html.twig', ['type' => 'startpage']);
}
}
| <?php
namespace AppBundle\Controller;
use AppBundle\Controller\API\Listing\OverviewController;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
class StartpageController extends Controller
{
/**
* @Route("/", name="startpage")
*/
public function indexAction(Request $request)
{
$oc = $this->get('app.api.listing.overview');
$overview = $oc->execute('1.0');
return $this->render('startpage/index.html.twig', ['type' => 'startpage', 'overview' => $overview, 'title' => 'Welcome']);
}
}
| Call listing/overview service from startpage | Call listing/overview service from startpage
| PHP | mit | molbiodiv/fennec,molbiodiv/fennec,molbiodiv/fennec,molbiodiv/fennec,molbiodiv/fennec | php | ## Code Before:
<?php
namespace AppBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
class StartpageController extends Controller
{
/**
* @Route("/", name="startpage")
*/
public function indexAction(Request $request)
{
// replace this example code with whatever you need
return $this->render('startpage/index.html.twig', ['type' => 'startpage']);
}
}
## Instruction:
Call listing/overview service from startpage
## Code After:
<?php
namespace AppBundle\Controller;
use AppBundle\Controller\API\Listing\OverviewController;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
class StartpageController extends Controller
{
/**
* @Route("/", name="startpage")
*/
public function indexAction(Request $request)
{
$oc = $this->get('app.api.listing.overview');
$overview = $oc->execute('1.0');
return $this->render('startpage/index.html.twig', ['type' => 'startpage', 'overview' => $overview, 'title' => 'Welcome']);
}
}
| <?php
namespace AppBundle\Controller;
+ use AppBundle\Controller\API\Listing\OverviewController;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
class StartpageController extends Controller
{
/**
* @Route("/", name="startpage")
*/
public function indexAction(Request $request)
{
- // replace this example code with whatever you need
+ $oc = $this->get('app.api.listing.overview');
+ $overview = $oc->execute('1.0');
+
- return $this->render('startpage/index.html.twig', ['type' => 'startpage']);
+ return $this->render('startpage/index.html.twig', ['type' => 'startpage', 'overview' => $overview, 'title' => 'Welcome']);
? +++++++++++++++++++++++++++++++++++++++++++++++
}
} | 7 | 0.368421 | 5 | 2 |
6bbac062b1038f56116d7b90cba6ffcfd026381f | bastion/distribute-local-docker-image.sh | bastion/distribute-local-docker-image.sh |
IMAGE="$1"
for node in $(cat $HOME/address_nodes)
do
echo "FuzzVM: $node"
cat $IMAGE | bzip2 | ssh $node "bunzip2 | docker load;";
done
echo "Removing image from bastion."
rm $IMAGE; |
IMAGE="$1"
for node in $(cat $HOME/address_nodes)
do
echo "FuzzVM: $node"
cat $IMAGE | ssh $node "gunzip | docker load;";
done
echo "Removing image from bastion."
rm $IMAGE; | Switch to gzip compressed docker-image from raw tar | Switch to gzip compressed docker-image from raw tar
Sending gzip compressed image to bastion, saves initial
setup time. Previous implementatio did bzip2 compression
on bastion, for each fuzzvm, which creates a bottleneck
with low CPU bastion VM.
| Shell | apache-2.0 | ouspg/cloudfuzzer,ouspg/cloudfuzzer | shell | ## Code Before:
IMAGE="$1"
for node in $(cat $HOME/address_nodes)
do
echo "FuzzVM: $node"
cat $IMAGE | bzip2 | ssh $node "bunzip2 | docker load;";
done
echo "Removing image from bastion."
rm $IMAGE;
## Instruction:
Switch to gzip compressed docker-image from raw tar
Sending gzip compressed image to bastion, saves initial
setup time. Previous implementatio did bzip2 compression
on bastion, for each fuzzvm, which creates a bottleneck
with low CPU bastion VM.
## Code After:
IMAGE="$1"
for node in $(cat $HOME/address_nodes)
do
echo "FuzzVM: $node"
cat $IMAGE | ssh $node "gunzip | docker load;";
done
echo "Removing image from bastion."
rm $IMAGE; |
IMAGE="$1"
for node in $(cat $HOME/address_nodes)
do
echo "FuzzVM: $node"
- cat $IMAGE | bzip2 | ssh $node "bunzip2 | docker load;";
? -------- ^ -
+ cat $IMAGE | ssh $node "gunzip | docker load;";
? ^
done
echo "Removing image from bastion."
rm $IMAGE; | 2 | 0.166667 | 1 | 1 |
242a3a3766afcf6fdfeabcf82c474a1c878d6482 | src/Laravel/ServiceProvider.php | src/Laravel/ServiceProvider.php | <?php
namespace Sympla\Auth\Laravel;
use GuzzleHttp\Client as Guzzle;
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
use Sympla\Auth\Laravel\OAuthUserProvider;
use Sympla\Auth\PasswordClient;
class ServiceProvider extends BaseServiceProvider
{
public function boot()
{
$this->publishes([$this->configPath() => config_path('sympla.php')]);
$auth = $this->app->make('auth');
$auth->provider('oauth', function ($app, array $config) {
return new OAuthUserProvider(
$app->make('sympla.oauth.password_client'),
$config,
$app->make('request')
);
});
}
public function register()
{
$this->mergeConfigFrom($this->configPath(), 'sympla');
$this->app->bind('sympla.oauth.password_client', function ($app) {
$config = $app->config['sympla']['oauth'];
return new PasswordClient(
new Guzzle(),
$config['client_id'],
$config['client_secret'],
$config['user_endpoint'],
$config['token_endpoint'],
$config['auth_method']
);
});
}
protected function configPath()
{
return __DIR__ . '/../../config/sympla.php';
}
}
| <?php
namespace Sympla\Auth\Laravel;
use GuzzleHttp\Client as Guzzle;
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
use Sympla\Auth\Laravel\OAuthUserProvider;
use Sympla\Auth\PasswordClient;
class ServiceProvider extends BaseServiceProvider
{
public function boot()
{
$this->publishes([$this->configPath() => config_path('sympla.php')]);
$auth = $this->app->make('auth');
$auth->provider('oauth', function ($app, array $config) {
return new OAuthUserProvider(
$app->make('sympla.oauth.password_client'),
$config,
$app->make('request')
);
});
}
public function register()
{
$this->mergeConfigFrom($this->configPath(), 'sympla');
$this->app->bind('sympla.oauth.password_client', function ($app) {
$config = $app->config['sympla']['oauth'];
return new PasswordClient(
new Guzzle(),
$config['client_id'],
$config['client_secret'],
$config['user_endpoint'],
$config['token_endpoint'],
$config['auth_method'],
$config['client_provider'],
$config['client_domain'],
$config['client_service_account']
);
});
}
protected function configPath()
{
return __DIR__ . '/../../config/sympla.php';
}
}
| Fix checkprovider - parameters on service provider missing | Fix checkprovider - parameters on service provider missing
| PHP | mit | sympla/mesa-gold-bar | php | ## Code Before:
<?php
namespace Sympla\Auth\Laravel;
use GuzzleHttp\Client as Guzzle;
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
use Sympla\Auth\Laravel\OAuthUserProvider;
use Sympla\Auth\PasswordClient;
class ServiceProvider extends BaseServiceProvider
{
public function boot()
{
$this->publishes([$this->configPath() => config_path('sympla.php')]);
$auth = $this->app->make('auth');
$auth->provider('oauth', function ($app, array $config) {
return new OAuthUserProvider(
$app->make('sympla.oauth.password_client'),
$config,
$app->make('request')
);
});
}
public function register()
{
$this->mergeConfigFrom($this->configPath(), 'sympla');
$this->app->bind('sympla.oauth.password_client', function ($app) {
$config = $app->config['sympla']['oauth'];
return new PasswordClient(
new Guzzle(),
$config['client_id'],
$config['client_secret'],
$config['user_endpoint'],
$config['token_endpoint'],
$config['auth_method']
);
});
}
protected function configPath()
{
return __DIR__ . '/../../config/sympla.php';
}
}
## Instruction:
Fix checkprovider - parameters on service provider missing
## Code After:
<?php
namespace Sympla\Auth\Laravel;
use GuzzleHttp\Client as Guzzle;
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
use Sympla\Auth\Laravel\OAuthUserProvider;
use Sympla\Auth\PasswordClient;
class ServiceProvider extends BaseServiceProvider
{
public function boot()
{
$this->publishes([$this->configPath() => config_path('sympla.php')]);
$auth = $this->app->make('auth');
$auth->provider('oauth', function ($app, array $config) {
return new OAuthUserProvider(
$app->make('sympla.oauth.password_client'),
$config,
$app->make('request')
);
});
}
public function register()
{
$this->mergeConfigFrom($this->configPath(), 'sympla');
$this->app->bind('sympla.oauth.password_client', function ($app) {
$config = $app->config['sympla']['oauth'];
return new PasswordClient(
new Guzzle(),
$config['client_id'],
$config['client_secret'],
$config['user_endpoint'],
$config['token_endpoint'],
$config['auth_method'],
$config['client_provider'],
$config['client_domain'],
$config['client_service_account']
);
});
}
protected function configPath()
{
return __DIR__ . '/../../config/sympla.php';
}
}
| <?php
namespace Sympla\Auth\Laravel;
use GuzzleHttp\Client as Guzzle;
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
use Sympla\Auth\Laravel\OAuthUserProvider;
use Sympla\Auth\PasswordClient;
class ServiceProvider extends BaseServiceProvider
{
public function boot()
{
$this->publishes([$this->configPath() => config_path('sympla.php')]);
$auth = $this->app->make('auth');
$auth->provider('oauth', function ($app, array $config) {
return new OAuthUserProvider(
$app->make('sympla.oauth.password_client'),
$config,
$app->make('request')
);
});
}
public function register()
{
$this->mergeConfigFrom($this->configPath(), 'sympla');
$this->app->bind('sympla.oauth.password_client', function ($app) {
$config = $app->config['sympla']['oauth'];
return new PasswordClient(
new Guzzle(),
$config['client_id'],
$config['client_secret'],
$config['user_endpoint'],
$config['token_endpoint'],
- $config['auth_method']
+ $config['auth_method'],
? +
+ $config['client_provider'],
+ $config['client_domain'],
+ $config['client_service_account']
);
});
}
protected function configPath()
{
return __DIR__ . '/../../config/sympla.php';
}
} | 5 | 0.102041 | 4 | 1 |
fc523d543392b9ef7d5b8b6c8ec962b151552e42 | tests/test_fields/test_uuid_field.py | tests/test_fields/test_uuid_field.py | from __future__ import unicode_literals
import uuid
from django.core.exceptions import ValidationError
from django.test import TestCase
from model_utils.fields import UUIDField
class UUIDFieldTests(TestCase):
def test_uuid_version_default(self):
instance = UUIDField()
self.assertEqual(instance.default, uuid.uuid4)
def test_uuid_version_1(self):
instance = UUIDField(version=1)
self.assertEqual(instance.default, uuid.uuid1)
def test_uuid_version_2_error(self):
self.assertRaises(ValidationError, UUIDField, 'version', 2)
def test_uuid_version_3(self):
instance = UUIDField(version=3)
self.assertEqual(instance.default, uuid.uuid3)
def test_uuid_version_4(self):
instance = UUIDField(version=4)
self.assertEqual(instance.default, uuid.uuid4)
def test_uuid_version_5(self):
instance = UUIDField(version=5)
self.assertEqual(instance.default, uuid.uuid5)
| from __future__ import unicode_literals
import uuid
from django.core.exceptions import ValidationError
from django.test import TestCase
from model_utils.fields import UUIDField
class UUIDFieldTests(TestCase):
def test_uuid_version_default(self):
instance = UUIDField()
self.assertEqual(instance.default, uuid.uuid4)
def test_uuid_version_1(self):
instance = UUIDField(version=1)
self.assertEqual(instance.default, uuid.uuid1)
def test_uuid_version_2_error(self):
self.assertRaises(ValidationError, UUIDField, 'version', 2)
def test_uuid_version_3(self):
instance = UUIDField(version=3)
self.assertEqual(instance.default, uuid.uuid3)
def test_uuid_version_4(self):
instance = UUIDField(version=4)
self.assertEqual(instance.default, uuid.uuid4)
def test_uuid_version_5(self):
instance = UUIDField(version=5)
self.assertEqual(instance.default, uuid.uuid5)
def test_uuid_version_bellow_min(self):
self.assertRaises(ValidationError, UUIDField, 'version', 0)
def test_uuid_version_above_max(self):
self.assertRaises(ValidationError, UUIDField, 'version', 6)
| Add tdd to increase coverage | Add tdd to increase coverage
| Python | bsd-3-clause | carljm/django-model-utils,carljm/django-model-utils | python | ## Code Before:
from __future__ import unicode_literals
import uuid
from django.core.exceptions import ValidationError
from django.test import TestCase
from model_utils.fields import UUIDField
class UUIDFieldTests(TestCase):
def test_uuid_version_default(self):
instance = UUIDField()
self.assertEqual(instance.default, uuid.uuid4)
def test_uuid_version_1(self):
instance = UUIDField(version=1)
self.assertEqual(instance.default, uuid.uuid1)
def test_uuid_version_2_error(self):
self.assertRaises(ValidationError, UUIDField, 'version', 2)
def test_uuid_version_3(self):
instance = UUIDField(version=3)
self.assertEqual(instance.default, uuid.uuid3)
def test_uuid_version_4(self):
instance = UUIDField(version=4)
self.assertEqual(instance.default, uuid.uuid4)
def test_uuid_version_5(self):
instance = UUIDField(version=5)
self.assertEqual(instance.default, uuid.uuid5)
## Instruction:
Add tdd to increase coverage
## Code After:
from __future__ import unicode_literals
import uuid
from django.core.exceptions import ValidationError
from django.test import TestCase
from model_utils.fields import UUIDField
class UUIDFieldTests(TestCase):
def test_uuid_version_default(self):
instance = UUIDField()
self.assertEqual(instance.default, uuid.uuid4)
def test_uuid_version_1(self):
instance = UUIDField(version=1)
self.assertEqual(instance.default, uuid.uuid1)
def test_uuid_version_2_error(self):
self.assertRaises(ValidationError, UUIDField, 'version', 2)
def test_uuid_version_3(self):
instance = UUIDField(version=3)
self.assertEqual(instance.default, uuid.uuid3)
def test_uuid_version_4(self):
instance = UUIDField(version=4)
self.assertEqual(instance.default, uuid.uuid4)
def test_uuid_version_5(self):
instance = UUIDField(version=5)
self.assertEqual(instance.default, uuid.uuid5)
def test_uuid_version_bellow_min(self):
self.assertRaises(ValidationError, UUIDField, 'version', 0)
def test_uuid_version_above_max(self):
self.assertRaises(ValidationError, UUIDField, 'version', 6)
| from __future__ import unicode_literals
import uuid
from django.core.exceptions import ValidationError
from django.test import TestCase
from model_utils.fields import UUIDField
class UUIDFieldTests(TestCase):
def test_uuid_version_default(self):
instance = UUIDField()
self.assertEqual(instance.default, uuid.uuid4)
def test_uuid_version_1(self):
instance = UUIDField(version=1)
self.assertEqual(instance.default, uuid.uuid1)
def test_uuid_version_2_error(self):
self.assertRaises(ValidationError, UUIDField, 'version', 2)
def test_uuid_version_3(self):
instance = UUIDField(version=3)
self.assertEqual(instance.default, uuid.uuid3)
def test_uuid_version_4(self):
instance = UUIDField(version=4)
self.assertEqual(instance.default, uuid.uuid4)
def test_uuid_version_5(self):
instance = UUIDField(version=5)
self.assertEqual(instance.default, uuid.uuid5)
+
+ def test_uuid_version_bellow_min(self):
+ self.assertRaises(ValidationError, UUIDField, 'version', 0)
+
+ def test_uuid_version_above_max(self):
+ self.assertRaises(ValidationError, UUIDField, 'version', 6) | 6 | 0.176471 | 6 | 0 |
fe95c248003dc8f851e77a70cd30c2ec2142fc28 | README.md | README.md |
A WordPress plugin to report PHP errors and JavaScript errors to [Sentry](https://sentry.io).
|
A WordPress plugin to report PHP errors and JavaScript errors to [Sentry](https://sentry.io).
### Usage
1. Install this plugin by cloning or copying this repository to your `wp-contents/plugins` folder
2. Activate the plugin through the WordPress admin interface
3. Configure your DSN as explained below, this plugin does not report anything by default
### Configuration
(Optionally) track PHP errors by adding this snippet to your `wp-config.php` and replace `DSN` with your actual DSN that you find in Sentry:
```php
define( 'WP_SENTRY_DSN', 'DSN' );
```
---
(Optionally) track JavaScript errors by adding this snippet to your `wp-config.php` and replace `PUBLIC_DSN` with your actual public DSN that you find in Sentry (**never use your private DSN**):
```php
define( 'WP_SENTRY_PUBLIC_DSN', 'PUBLIC_DSN' );
```
---
(Optionally) define a version of your site, by default the theme version will be used. This is used for tracking on which version of your site the error occurred, combined with release tracking this is a very powerfull feature.
```php
define( 'WP_SENTRY_VERSION', 'v1.0.0' );
``` | Add some usage and configuration documentation | Add some usage and configuration documentation
| Markdown | mit | stayallive/wp-sentry,stayallive/wp-sentry,stayallive/wp-sentry | markdown | ## Code Before:
A WordPress plugin to report PHP errors and JavaScript errors to [Sentry](https://sentry.io).
## Instruction:
Add some usage and configuration documentation
## Code After:
A WordPress plugin to report PHP errors and JavaScript errors to [Sentry](https://sentry.io).
### Usage
1. Install this plugin by cloning or copying this repository to your `wp-contents/plugins` folder
2. Activate the plugin through the WordPress admin interface
3. Configure your DSN as explained below, this plugin does not report anything by default
### Configuration
(Optionally) track PHP errors by adding this snippet to your `wp-config.php` and replace `DSN` with your actual DSN that you find in Sentry:
```php
define( 'WP_SENTRY_DSN', 'DSN' );
```
---
(Optionally) track JavaScript errors by adding this snippet to your `wp-config.php` and replace `PUBLIC_DSN` with your actual public DSN that you find in Sentry (**never use your private DSN**):
```php
define( 'WP_SENTRY_PUBLIC_DSN', 'PUBLIC_DSN' );
```
---
(Optionally) define a version of your site, by default the theme version will be used. This is used for tracking on which version of your site the error occurred, combined with release tracking this is a very powerfull feature.
```php
define( 'WP_SENTRY_VERSION', 'v1.0.0' );
``` |
A WordPress plugin to report PHP errors and JavaScript errors to [Sentry](https://sentry.io).
+
+ ### Usage
+
+ 1. Install this plugin by cloning or copying this repository to your `wp-contents/plugins` folder
+ 2. Activate the plugin through the WordPress admin interface
+ 3. Configure your DSN as explained below, this plugin does not report anything by default
+
+ ### Configuration
+
+ (Optionally) track PHP errors by adding this snippet to your `wp-config.php` and replace `DSN` with your actual DSN that you find in Sentry:
+
+ ```php
+ define( 'WP_SENTRY_DSN', 'DSN' );
+ ```
+
+ ---
+
+ (Optionally) track JavaScript errors by adding this snippet to your `wp-config.php` and replace `PUBLIC_DSN` with your actual public DSN that you find in Sentry (**never use your private DSN**):
+
+ ```php
+ define( 'WP_SENTRY_PUBLIC_DSN', 'PUBLIC_DSN' );
+ ```
+
+ ---
+
+ (Optionally) define a version of your site, by default the theme version will be used. This is used for tracking on which version of your site the error occurred, combined with release tracking this is a very powerfull feature.
+
+ ```php
+ define( 'WP_SENTRY_VERSION', 'v1.0.0' );
+ ``` | 30 | 15 | 30 | 0 |
a8fc1c7297055af6afd85cb07d7f883861bfebf6 | src/main/seph/lang/Ground.java | src/main/seph/lang/Ground.java | /*
* See LICENSE file in distribution for copyright and licensing information.
*/
package seph.lang;
import seph.lang.persistent.IPersistentList;
/**
* @author <a href="mailto:ola.bini@gmail.com">Ola Bini</a>
*/
@SephSingleton(parents="SephGround")
public class Ground implements SephObject {
public final static Ground instance = new Ground();
@SephCell
public final static SephObject Something = null;
public SephObject get(String cellName) {
return seph.lang.bim.GroundBase.get(cellName);
}
public boolean isActivatable() {
return false;
}
public SephObject activateWith(LexicalScope scope, SephObject receiver, IPersistentList arguments) {
throw new RuntimeException(" *** couldn't activate: " + this);
}
}// Ground
| /*
* See LICENSE file in distribution for copyright and licensing information.
*/
package seph.lang;
import seph.lang.persistent.IPersistentList;
/**
* @author <a href="mailto:ola.bini@gmail.com">Ola Bini</a>
*/
@SephSingleton(parents="SephGround")
public class Ground implements SephObject {
public final static Ground instance = new Ground();
@SephCell
public final static SephObject Something = null;
@SephCell
public final static SephObject Ground = null;
@SephCell
public final static SephObject SephGround = null;
@SephCell
public final static SephObject Base = null;
@SephCell
public final static SephObject DefaultBehavior = null;
@SephCell
public final static SephObject IODefaultBehavior = null;
public SephObject get(String cellName) {
return seph.lang.bim.GroundBase.get(cellName);
}
public boolean isActivatable() {
return false;
}
public SephObject activateWith(LexicalScope scope, SephObject receiver, IPersistentList arguments) {
throw new RuntimeException(" *** couldn't activate: " + this);
}
}// Ground
| Add references to other singleton objects | Add references to other singleton objects
| Java | mit | seph-lang/seph,seph-lang/seph,seph-lang/seph | java | ## Code Before:
/*
* See LICENSE file in distribution for copyright and licensing information.
*/
package seph.lang;
import seph.lang.persistent.IPersistentList;
/**
* @author <a href="mailto:ola.bini@gmail.com">Ola Bini</a>
*/
@SephSingleton(parents="SephGround")
public class Ground implements SephObject {
public final static Ground instance = new Ground();
@SephCell
public final static SephObject Something = null;
public SephObject get(String cellName) {
return seph.lang.bim.GroundBase.get(cellName);
}
public boolean isActivatable() {
return false;
}
public SephObject activateWith(LexicalScope scope, SephObject receiver, IPersistentList arguments) {
throw new RuntimeException(" *** couldn't activate: " + this);
}
}// Ground
## Instruction:
Add references to other singleton objects
## Code After:
/*
* See LICENSE file in distribution for copyright and licensing information.
*/
package seph.lang;
import seph.lang.persistent.IPersistentList;
/**
* @author <a href="mailto:ola.bini@gmail.com">Ola Bini</a>
*/
@SephSingleton(parents="SephGround")
public class Ground implements SephObject {
public final static Ground instance = new Ground();
@SephCell
public final static SephObject Something = null;
@SephCell
public final static SephObject Ground = null;
@SephCell
public final static SephObject SephGround = null;
@SephCell
public final static SephObject Base = null;
@SephCell
public final static SephObject DefaultBehavior = null;
@SephCell
public final static SephObject IODefaultBehavior = null;
public SephObject get(String cellName) {
return seph.lang.bim.GroundBase.get(cellName);
}
public boolean isActivatable() {
return false;
}
public SephObject activateWith(LexicalScope scope, SephObject receiver, IPersistentList arguments) {
throw new RuntimeException(" *** couldn't activate: " + this);
}
}// Ground
| /*
* See LICENSE file in distribution for copyright and licensing information.
*/
package seph.lang;
import seph.lang.persistent.IPersistentList;
/**
* @author <a href="mailto:ola.bini@gmail.com">Ola Bini</a>
*/
@SephSingleton(parents="SephGround")
public class Ground implements SephObject {
public final static Ground instance = new Ground();
@SephCell
public final static SephObject Something = null;
+ @SephCell
+ public final static SephObject Ground = null;
+
+ @SephCell
+ public final static SephObject SephGround = null;
+
+ @SephCell
+ public final static SephObject Base = null;
+
+ @SephCell
+ public final static SephObject DefaultBehavior = null;
+
+ @SephCell
+ public final static SephObject IODefaultBehavior = null;
+
public SephObject get(String cellName) {
return seph.lang.bim.GroundBase.get(cellName);
}
public boolean isActivatable() {
return false;
}
public SephObject activateWith(LexicalScope scope, SephObject receiver, IPersistentList arguments) {
throw new RuntimeException(" *** couldn't activate: " + this);
}
}// Ground | 15 | 0.517241 | 15 | 0 |
b643d4edd302e689ebdd6654e7a7c4c6c380dcea | app/scripts/views/mixins/settings-mixin.js | app/scripts/views/mixins/settings-mixin.js | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// helper functions for views with a profile image. Meant to be mixed into views.
'use strict';
define([
'lib/session'
], function (Session) {
return {
// user must be authenticated and verified to see Settings pages
mustVerify: true,
initialize: function () {
var self = this;
var uid = self.relier.get('uid');
// A uid param is set by RPs linking directly to the settings
// page for a particular account.
// We set the current account to the one with `uid` if
// it exists in our list of cached accounts. If it doesn't,
// clear the current account.
// The `mustVerify` flag will ensure that the account is valid.
if (! self.user.getAccountByUid(uid).isEmpty()) {
// The account with uid exists; set it to our current account.
self.user.setSignedInAccountByUid(uid);
} else if (uid) {
Session.clear();
self.user.clearSignedInAccount();
}
}
};
});
| /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// helper functions for views with a profile image. Meant to be mixed into views.
'use strict';
define([
'lib/session'
], function (Session) {
return {
// user must be authenticated and verified to see Settings pages
mustVerify: true,
initialize: function () {
var self = this;
var uid = self.relier.get('uid');
// A uid param is set by RPs linking directly to the settings
// page for a particular account.
// We set the current account to the one with `uid` if
// it exists in our list of cached accounts. If it doesn't,
// clear the current account.
// The `mustVerify` flag will ensure that the account is valid.
if (! self.user.getAccountByUid(uid).isEmpty()) {
// The account with uid exists; set it to our current account.
self.user.setSignedInAccountByUid(uid);
} else if (uid) {
// session is expired or user does not exist. Force the user
// to sign in.
Session.clear();
self.user.clearSignedInAccount();
}
}
};
});
| Add a comment about what happens for expired/non-existent uids | Add a comment about what happens for expired/non-existent uids
| JavaScript | mpl-2.0 | vladikoff/fxa-content-server,ReachingOut/fxa-content-server,npestana/fxa-content-server,mozilla/fxa-content-server,chilts/fxa-content-server,chilts/fxa-content-server,ReachingOut/fxa-content-server,riadhchtara/fxa-password-manager,jpetto/fxa-content-server,mozilla/fxa-content-server,chilts/fxa-content-server,TDA/fxa-two-factor-auth,ReachingOut/fxa-content-server,riadhchtara/fxa-password-manager,ofer43211/fxa-content-server,vladikoff/fxa-content-server,vladikoff/fxa-content-server,npestana/fxa-content-server,riadhchtara/fxa-password-manager,TDA/fxa-two-factor-auth,TDA/fxa-two-factor-auth,atiqueahmedziad/fxa-content-server,TDA/fxa-content-server,dannycoates/fxa-content-server,atiqueahmedziad/fxa-content-server,shane-tomlinson/fxa-content-server,swatilk/fxa-content-server,dannycoates/fxa-content-server,shane-tomlinson/fxa-content-server,npestana/fxa-content-server,atiqueahmedziad/fxa-content-server,ofer43211/fxa-content-server,ofer43211/fxa-content-server,TDA/fxa-content-server,dannycoates/fxa-content-server,riadhchtara/fxa-content-server,shane-tomlinson/fxa-content-server,jpetto/fxa-content-server,riadhchtara/fxa-content-server,TDA/fxa-content-server,riadhchtara/fxa-content-server,jpetto/fxa-content-server,swatilk/fxa-content-server,swatilk/fxa-content-server,mozilla/fxa-content-server | javascript | ## Code Before:
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// helper functions for views with a profile image. Meant to be mixed into views.
'use strict';
define([
'lib/session'
], function (Session) {
return {
// user must be authenticated and verified to see Settings pages
mustVerify: true,
initialize: function () {
var self = this;
var uid = self.relier.get('uid');
// A uid param is set by RPs linking directly to the settings
// page for a particular account.
// We set the current account to the one with `uid` if
// it exists in our list of cached accounts. If it doesn't,
// clear the current account.
// The `mustVerify` flag will ensure that the account is valid.
if (! self.user.getAccountByUid(uid).isEmpty()) {
// The account with uid exists; set it to our current account.
self.user.setSignedInAccountByUid(uid);
} else if (uid) {
Session.clear();
self.user.clearSignedInAccount();
}
}
};
});
## Instruction:
Add a comment about what happens for expired/non-existent uids
## Code After:
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// helper functions for views with a profile image. Meant to be mixed into views.
'use strict';
define([
'lib/session'
], function (Session) {
return {
// user must be authenticated and verified to see Settings pages
mustVerify: true,
initialize: function () {
var self = this;
var uid = self.relier.get('uid');
// A uid param is set by RPs linking directly to the settings
// page for a particular account.
// We set the current account to the one with `uid` if
// it exists in our list of cached accounts. If it doesn't,
// clear the current account.
// The `mustVerify` flag will ensure that the account is valid.
if (! self.user.getAccountByUid(uid).isEmpty()) {
// The account with uid exists; set it to our current account.
self.user.setSignedInAccountByUid(uid);
} else if (uid) {
// session is expired or user does not exist. Force the user
// to sign in.
Session.clear();
self.user.clearSignedInAccount();
}
}
};
});
| /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// helper functions for views with a profile image. Meant to be mixed into views.
'use strict';
define([
'lib/session'
], function (Session) {
return {
// user must be authenticated and verified to see Settings pages
mustVerify: true,
initialize: function () {
var self = this;
var uid = self.relier.get('uid');
// A uid param is set by RPs linking directly to the settings
// page for a particular account.
// We set the current account to the one with `uid` if
// it exists in our list of cached accounts. If it doesn't,
// clear the current account.
// The `mustVerify` flag will ensure that the account is valid.
if (! self.user.getAccountByUid(uid).isEmpty()) {
// The account with uid exists; set it to our current account.
self.user.setSignedInAccountByUid(uid);
} else if (uid) {
+ // session is expired or user does not exist. Force the user
+ // to sign in.
Session.clear();
self.user.clearSignedInAccount();
}
}
};
}); | 2 | 0.054054 | 2 | 0 |
200523d20333c17117539552ac9fb51c9f677543 | irrigator_pro/home/views.py | irrigator_pro/home/views.py | from django.views.generic import TemplateView
class HomeView(TemplateView):
template_name = 'home.html'
def get(self, request, *args, **kwargs):
context = {
'some_dynamic_value': 'Now available as a web application!',
}
return self.render_to_response(context)
| from django.views.generic import TemplateView
class HomeView(TemplateView):
template_name = 'home.html'
def get(self, request, *args, **kwargs):
context = {
'some_dynamic_value': 'Coming soon as a web application!',
}
return self.render_to_response(context)
| Change subtext on main page | Change subtext on main page
| Python | mit | warnes/irrigatorpro,warnes/irrigatorpro,warnes/irrigatorpro,warnes/irrigatorpro | python | ## Code Before:
from django.views.generic import TemplateView
class HomeView(TemplateView):
template_name = 'home.html'
def get(self, request, *args, **kwargs):
context = {
'some_dynamic_value': 'Now available as a web application!',
}
return self.render_to_response(context)
## Instruction:
Change subtext on main page
## Code After:
from django.views.generic import TemplateView
class HomeView(TemplateView):
template_name = 'home.html'
def get(self, request, *args, **kwargs):
context = {
'some_dynamic_value': 'Coming soon as a web application!',
}
return self.render_to_response(context)
| from django.views.generic import TemplateView
class HomeView(TemplateView):
template_name = 'home.html'
def get(self, request, *args, **kwargs):
context = {
- 'some_dynamic_value': 'Now available as a web application!',
? ^ ^ ^^^^^^^^^
+ 'some_dynamic_value': 'Coming soon as a web application!',
? ^ ^^^^ ^^^^
}
return self.render_to_response(context) | 2 | 0.2 | 1 | 1 |
13a28337f045c257397807bdb38b52c5514c9c29 | assets/sass/_icons.scss | assets/sass/_icons.scss | // Chevrons in CSS http://codepen.io/jonneal/pen/kptBs
.icon-arrow-right {
background-image: inline('build/latest/img/icons/arrow-right.png');
background-image: none, inline('assets/img/icons/arrow-right.svg') ,
linear-gradient(transparent, transparent);
}
.chevron {
&::before {
border-style: solid;
border-width: 0.25em 0.25em 0 0;
content: '';
display: inline-block;
height: 0.5em;
left: 0.15em;
position: relative;
vertical-align: top;
width: 0.5em;
transition: transform 300ms linear;
}
&.top {
&::before {
top: 0.75em;
transform: rotate(-45deg);
}
}
&.right {
&::before {
left: 0;
transform: rotate(45deg);
}
}
&.bottom {
&::before {
top: 0.5em;
transform: rotate(135deg);
}
}
&.left {
&::before {
left: 0.25em;
transform: rotate(-135deg);
}
}
}
| @mixin inline-background-image($img) {
background-image: inline('build/latest/img/icons/' + $img + '.png');
background-image: none, inline('assets/img/icons/' + $img + '.svg'),
linear-gradient(transparent, transparent);
}
.icon-arrow-right {
@include inline-background-image('arrow-right');
}
.chevron {
&::before {
border-style: solid;
border-width: 0.25em 0.25em 0 0;
content: '';
display: inline-block;
height: 0.5em;
left: 0.15em;
position: relative;
vertical-align: top;
width: 0.5em;
transition: transform 300ms linear;
}
&.top {
&::before {
top: 0.75em;
transform: rotate(-45deg);
}
}
&.right {
&::before {
left: 0;
transform: rotate(45deg);
}
}
&.bottom {
&::before {
top: 0.5em;
transform: rotate(135deg);
}
}
&.left {
&::before {
left: 0.25em;
transform: rotate(-135deg);
}
}
}
| Create a mixin for 'inline-background-image's | Create a mixin for 'inline-background-image's
| SCSS | mit | AusDTO/gov-au-ui-kit,AusDTO/gov-au-ui-kit,AusDTO/gov-au-ui-kit | scss | ## Code Before:
// Chevrons in CSS http://codepen.io/jonneal/pen/kptBs
.icon-arrow-right {
background-image: inline('build/latest/img/icons/arrow-right.png');
background-image: none, inline('assets/img/icons/arrow-right.svg') ,
linear-gradient(transparent, transparent);
}
.chevron {
&::before {
border-style: solid;
border-width: 0.25em 0.25em 0 0;
content: '';
display: inline-block;
height: 0.5em;
left: 0.15em;
position: relative;
vertical-align: top;
width: 0.5em;
transition: transform 300ms linear;
}
&.top {
&::before {
top: 0.75em;
transform: rotate(-45deg);
}
}
&.right {
&::before {
left: 0;
transform: rotate(45deg);
}
}
&.bottom {
&::before {
top: 0.5em;
transform: rotate(135deg);
}
}
&.left {
&::before {
left: 0.25em;
transform: rotate(-135deg);
}
}
}
## Instruction:
Create a mixin for 'inline-background-image's
## Code After:
@mixin inline-background-image($img) {
background-image: inline('build/latest/img/icons/' + $img + '.png');
background-image: none, inline('assets/img/icons/' + $img + '.svg'),
linear-gradient(transparent, transparent);
}
.icon-arrow-right {
@include inline-background-image('arrow-right');
}
.chevron {
&::before {
border-style: solid;
border-width: 0.25em 0.25em 0 0;
content: '';
display: inline-block;
height: 0.5em;
left: 0.15em;
position: relative;
vertical-align: top;
width: 0.5em;
transition: transform 300ms linear;
}
&.top {
&::before {
top: 0.75em;
transform: rotate(-45deg);
}
}
&.right {
&::before {
left: 0;
transform: rotate(45deg);
}
}
&.bottom {
&::before {
top: 0.5em;
transform: rotate(135deg);
}
}
&.left {
&::before {
left: 0.25em;
transform: rotate(-135deg);
}
}
}
| - // Chevrons in CSS http://codepen.io/jonneal/pen/kptBs
+ @mixin inline-background-image($img) {
+ background-image: inline('build/latest/img/icons/' + $img + '.png');
+ background-image: none, inline('assets/img/icons/' + $img + '.svg'),
+ linear-gradient(transparent, transparent);
+ }
.icon-arrow-right {
+ @include inline-background-image('arrow-right');
- background-image: inline('build/latest/img/icons/arrow-right.png');
- background-image: none, inline('assets/img/icons/arrow-right.svg') ,
- linear-gradient(transparent, transparent);
}
.chevron {
&::before {
border-style: solid;
border-width: 0.25em 0.25em 0 0;
content: '';
display: inline-block;
height: 0.5em;
left: 0.15em;
position: relative;
vertical-align: top;
width: 0.5em;
transition: transform 300ms linear;
}
&.top {
&::before {
top: 0.75em;
transform: rotate(-45deg);
}
}
&.right {
&::before {
left: 0;
transform: rotate(45deg);
}
}
&.bottom {
&::before {
top: 0.5em;
transform: rotate(135deg);
}
}
&.left {
&::before {
left: 0.25em;
transform: rotate(-135deg);
}
}
} | 10 | 0.2 | 6 | 4 |
ee2099353c3361e74e4e5b72d277087513f5ee4f | README.md | README.md |
A Symfony bundle of the IntlFormat wrapper library for PHP intl messages.
[](https://travis-ci.org/SenseException/IntlFormatBundle)
[](https://insight.sensiolabs.com/projects/512be750-efeb-4e4c-b711-6457e10fbe0b)
## Installation
You can install this with [Composer](https://getcomposer.org/).
```
composer require senseexception/intl-format-bundle
```
|
A Symfony bundle of the IntlFormat wrapper library for PHP intl messages.
[](https://travis-ci.org/SenseException/IntlFormatBundle)
[](https://insight.symfony.com/projects/8e8f83a8-2bb1-47ce-93a1-7f2914f196b3)
## Installation
You can install this with [Composer](https://getcomposer.org/).
```
composer require senseexception/intl-format-bundle
```
| Replace the Insight badge with smaller one | Replace the Insight badge with smaller one
| Markdown | mit | SenseException/IntlFormatBundle | markdown | ## Code Before:
A Symfony bundle of the IntlFormat wrapper library for PHP intl messages.
[](https://travis-ci.org/SenseException/IntlFormatBundle)
[](https://insight.sensiolabs.com/projects/512be750-efeb-4e4c-b711-6457e10fbe0b)
## Installation
You can install this with [Composer](https://getcomposer.org/).
```
composer require senseexception/intl-format-bundle
```
## Instruction:
Replace the Insight badge with smaller one
## Code After:
A Symfony bundle of the IntlFormat wrapper library for PHP intl messages.
[](https://travis-ci.org/SenseException/IntlFormatBundle)
[](https://insight.symfony.com/projects/8e8f83a8-2bb1-47ce-93a1-7f2914f196b3)
## Installation
You can install this with [Composer](https://getcomposer.org/).
```
composer require senseexception/intl-format-bundle
```
|
A Symfony bundle of the IntlFormat wrapper library for PHP intl messages.
[](https://travis-ci.org/SenseException/IntlFormatBundle)
- [](https://insight.sensiolabs.com/projects/512be750-efeb-4e4c-b711-6457e10fbe0b)
+ [](https://insight.symfony.com/projects/8e8f83a8-2bb1-47ce-93a1-7f2914f196b3)
## Installation
You can install this with [Composer](https://getcomposer.org/).
```
composer require senseexception/intl-format-bundle
``` | 2 | 0.153846 | 1 | 1 |
897c21b83c2b60d96c1acd6e66a7593e6eb86622 | factor/src/malenv/malenv.factor | factor/src/malenv/malenv.factor | ! Copyright (C) 2015 Jordan Lewis.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel hashtables accessors assocs locals math sequences ;
IN: malenv
TUPLE: malenv
{ outer read-only }
{ data hashtable read-only } ;
! set outer to f if top level env
INSTANCE: malenv assoc
C: <malenv> malenv
: new-env ( outer -- malenv ) H{ } malenv boa ;
M:: malenv at* ( key assoc -- value/f ? )
key name>> assoc data>> at*
[ drop assoc outer>>
[ key ?of ]
[ f f ]
if*
]
unless* ;
M: malenv assoc-size ( assoc -- n )
[ data>> ] [ outer>> ] bi [ assoc-size ] bi@ + ;
M: malenv >alist ( assoc -- n )
[ data>> ] [ outer>> ] bi [ >alist ] bi@ append ;
M: malenv set-at ( value key assoc -- )
[ name>> ] [ data>> ] bi* set-at ;
M: malenv delete-at ( key assoc -- )
[ name>> ] [ data>> ] bi* delete-at ;
M: malenv clear-assoc ( assoc -- )
data>> clear-assoc ;
: get-or-throw ( key assoc -- value )
at* [ dup "no variable " append throw ] unless ;
| ! Copyright (C) 2015 Jordan Lewis.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel hashtables accessors assocs locals math sequences ;
IN: malenv
TUPLE: malenv
{ outer read-only }
{ data hashtable read-only } ;
! set outer to f if top level env
INSTANCE: malenv assoc
C: <malenv> malenv
: new-env ( outer -- malenv ) H{ } malenv boa ;
M:: malenv at* ( key assoc -- value/f ? )
key name>> assoc data>> at*
[ drop assoc outer>>
[ key ?of ]
[ f f ]
if*
]
unless* ;
M: malenv assoc-size ( assoc -- n )
[ data>> ] [ outer>> ] bi [ assoc-size ] bi@ + ;
M: malenv >alist ( assoc -- n )
[ data>> ] [ outer>> ] bi [ >alist ] bi@ append ;
M: malenv set-at ( value key assoc -- )
[ name>> ] [ data>> ] bi* set-at ;
M: malenv delete-at ( key assoc -- )
[ name>> ] [ data>> ] bi* delete-at ;
M: malenv clear-assoc ( assoc -- )
data>> clear-assoc ;
: get-or-throw ( key assoc -- value )
?at [ dup name>> "no variable " prepend throw ] unless ;
| Fix env variable not found message | Fix env variable not found message
| Factor | mpl-2.0 | fdserr/mal,tompko/mal,fduch2k/mal,christhekeele/mal,profan/mal,0gajun/mal,treeform/mal,DomBlack/mal,joncol/mal,U-MA/mal,outcastgeek/mal,czchen/mal,rnby-mike/mal,sleep/mal,foresterre/mal,h8gi/mal,jwalsh/mal,christhekeele/mal,fdserr/mal,tompko/mal,keith-rollin/mal,eshamster/mal,eshamster/mal,alantsev/mal,0gajun/mal,tebeka/mal,tompko/mal,moquist/mal,fdserr/mal,slideclick/mal,pocarist/mal,0gajun/mal,tompko/mal,sgerguri/mal,nlfiedler/mal,mohsenil85/mal,keith-rollin/mal,christhekeele/mal,h3rald/mal,0gajun/mal,tompko/mal,sgerguri/mal,outcastgeek/mal,yohanesyuen/mal,moquist/mal,jwalsh/mal,christhekeele/mal,joncol/mal,TheNumberOne/mal,profan/mal,alantsev/mal,sleep/mal,sleep/mal,DomBlack/mal,tebeka/mal,profan/mal,SawyerHood/mal,U-MA/mal,hterkelsen/mal,bestwpw/mal,hterkelsen/mal,mpwillson/mal,sleep/mal,ekmartin/mal,tebeka/mal,martinlschumann/mal,nlfiedler/mal,pocarist/mal,sgerguri/mal,h8gi/mal,alphaKAI/mal,keith-rollin/mal,profan/mal,fduch2k/mal,bestwpw/mal,adamschmideg/mal,fduch2k/mal,treeform/mal,rnby-mike/mal,rhysd/mal,b0oh/mal,alantsev/mal,martinlschumann/mal,0gajun/mal,adamschmideg/mal,christhekeele/mal,alantsev/mal,christhekeele/mal,bestwpw/mal,foresterre/mal,TheNumberOne/mal,martinlschumann/mal,sgerguri/mal,jwalsh/mal,jwalsh/mal,rnby-mike/mal,christhekeele/mal,mpwillson/mal,fduch2k/mal,alcherk/mal,rnby-mike/mal,fduch2k/mal,SawyerHood/mal,czchen/mal,moquist/mal,b0oh/mal,adamschmideg/mal,sgerguri/mal,nlfiedler/mal,TheNumberOne/mal,sgerguri/mal,treeform/mal,h3rald/mal,eshamster/mal,czchen/mal,h3rald/mal,h3rald/mal,yohanesyuen/mal,hterkelsen/mal,ekmartin/mal,DomBlack/mal,tebeka/mal,U-MA/mal,profan/mal,sgerguri/mal,profan/mal,DomBlack/mal,0gajun/mal,alphaKAI/mal,hterkelsen/mal,adamschmideg/mal,hterkelsen/mal,sleep/mal,moquist/mal,U-MA/mal,treeform/mal,ekmartin/mal,U-MA/mal,nlfiedler/mal,tebeka/mal,pocarist/mal,mohsenil85/mal,martinlschumann/mal,alphaKAI/mal,foresterre/mal,fdserr/mal,alphaKAI/mal,bestwpw/mal,U-MA/mal,rnby-mike/mal,christhekeele/mal,martinlschumann/mal,TheNumberOne/mal,b0oh/mal,DomBlack/mal,jwalsh/mal,alantsev/mal,hterkelsen/mal,enitihas/mal,tebeka/mal,yohanesyuen/mal,sleep/mal,hterkelsen/mal,czchen/mal,rnby-mike/mal,rnby-mike/mal,alantsev/mal,ekmartin/mal,hterkelsen/mal,rnby-mike/mal,yohanesyuen/mal,fduch2k/mal,DomBlack/mal,moquist/mal,fdserr/mal,treeform/mal,eshamster/mal,bestwpw/mal,TheNumberOne/mal,h3rald/mal,h3rald/mal,bestwpw/mal,treeform/mal,profan/mal,tompko/mal,alphaKAI/mal,tompko/mal,rnby-mike/mal,rnby-mike/mal,U-MA/mal,eshamster/mal,rnby-mike/mal,enitihas/mal,tebeka/mal,DomBlack/mal,sleexyz/mal,moquist/mal,tompko/mal,sleexyz/mal,alantsev/mal,ekmartin/mal,adamschmideg/mal,b0oh/mal,alphaKAI/mal,treeform/mal,treeform/mal,sleep/mal,czchen/mal,ekmartin/mal,jwalsh/mal,fduch2k/mal,h3rald/mal,fduch2k/mal,ekmartin/mal,outcastgeek/mal,alphaKAI/mal,sleexyz/mal,TheNumberOne/mal,martinlschumann/mal,hterkelsen/mal,adamschmideg/mal,adamschmideg/mal,rhysd/mal,profan/mal,0gajun/mal,h8gi/mal,TheNumberOne/mal,moquist/mal,enitihas/mal,alcherk/mal,nlfiedler/mal,rhysd/mal,h3rald/mal,SawyerHood/mal,alphaKAI/mal,mpwillson/mal,moquist/mal,christhekeele/mal,keith-rollin/mal,jwalsh/mal,keith-rollin/mal,keith-rollin/mal,0gajun/mal,h8gi/mal,jwalsh/mal,slideclick/mal,tebeka/mal,U-MA/mal,adamschmideg/mal,yohanesyuen/mal,0gajun/mal,eshamster/mal,yohanesyuen/mal,treeform/mal,b0oh/mal,jwalsh/mal,slideclick/mal,fdserr/mal,rhysd/mal,alantsev/mal,sgerguri/mal,ekmartin/mal,sleexyz/mal,TheNumberOne/mal,mohsenil85/mal,alphaKAI/mal,pocarist/mal,fduch2k/mal,slideclick/mal,hterkelsen/mal,0gajun/mal,0gajun/mal,sleep/mal,b0oh/mal,czchen/mal,U-MA/mal,fduch2k/mal,h8gi/mal,tompko/mal,joncol/mal,b0oh/mal,tebeka/mal,moquist/mal,fdserr/mal,outcastgeek/mal,profan/mal,tebeka/mal,alphaKAI/mal,outcastgeek/mal,sleep/mal,sleexyz/mal,martinlschumann/mal,nlfiedler/mal,alantsev/mal,ekmartin/mal,czchen/mal,fduch2k/mal,tompko/mal,DomBlack/mal,czchen/mal,U-MA/mal,jwalsh/mal,DomBlack/mal,pocarist/mal,alcherk/mal,tompko/mal,enitihas/mal,moquist/mal,rhysd/mal,bestwpw/mal,martinlschumann/mal,adamschmideg/mal,foresterre/mal,alphaKAI/mal,foresterre/mal,jwalsh/mal,ekmartin/mal,tompko/mal,christhekeele/mal,h8gi/mal,martinlschumann/mal,rhysd/mal,sleep/mal,alphaKAI/mal,alphaKAI/mal,slideclick/mal,fdserr/mal,foresterre/mal,moquist/mal,nlfiedler/mal,enitihas/mal,U-MA/mal,fduch2k/mal,nlfiedler/mal,tebeka/mal,mpwillson/mal,foresterre/mal,ekmartin/mal,martinlschumann/mal,keith-rollin/mal,rnby-mike/mal,slideclick/mal,adamschmideg/mal,nlfiedler/mal,rnby-mike/mal,SawyerHood/mal,alantsev/mal,enitihas/mal,U-MA/mal,keith-rollin/mal,alantsev/mal,alphaKAI/mal,slideclick/mal,treeform/mal,sleexyz/mal,fdserr/mal,b0oh/mal,hterkelsen/mal,alcherk/mal,tompko/mal,rhysd/mal,DomBlack/mal,alantsev/mal,nlfiedler/mal,enitihas/mal,keith-rollin/mal,slideclick/mal,eshamster/mal,sleexyz/mal,TheNumberOne/mal,fduch2k/mal,hterkelsen/mal,mohsenil85/mal,hterkelsen/mal,h3rald/mal,bestwpw/mal,rhysd/mal,jwalsh/mal,mpwillson/mal,outcastgeek/mal,hterkelsen/mal,alcherk/mal,keith-rollin/mal,bestwpw/mal,adamschmideg/mal,profan/mal,pocarist/mal,pocarist/mal,slideclick/mal,fdserr/mal,outcastgeek/mal,slideclick/mal,eshamster/mal,adamschmideg/mal,alcherk/mal,mpwillson/mal,alcherk/mal,mpwillson/mal,hterkelsen/mal,fdserr/mal,martinlschumann/mal,keith-rollin/mal,DomBlack/mal,sleexyz/mal,alantsev/mal,profan/mal,h8gi/mal,mohsenil85/mal,jwalsh/mal,alcherk/mal,nlfiedler/mal,rhysd/mal,outcastgeek/mal,foresterre/mal,hterkelsen/mal,tebeka/mal,hterkelsen/mal,alcherk/mal,alcherk/mal,bestwpw/mal,0gajun/mal,b0oh/mal,h8gi/mal,tompko/mal,DomBlack/mal,fduch2k/mal,rnby-mike/mal,sleep/mal,tompko/mal,yohanesyuen/mal,alcherk/mal,enitihas/mal,profan/mal,mohsenil85/mal,slideclick/mal,martinlschumann/mal,outcastgeek/mal,0gajun/mal,martinlschumann/mal,mpwillson/mal,bestwpw/mal,keith-rollin/mal,enitihas/mal,sleep/mal,martinlschumann/mal,0gajun/mal,foresterre/mal,SawyerHood/mal,mohsenil85/mal,outcastgeek/mal,slideclick/mal,tompko/mal,yohanesyuen/mal,nlfiedler/mal,eshamster/mal,TheNumberOne/mal,SawyerHood/mal,profan/mal,alcherk/mal,h8gi/mal,fdserr/mal,outcastgeek/mal,christhekeele/mal,0gajun/mal,yohanesyuen/mal,christhekeele/mal,mpwillson/mal,foresterre/mal,rhysd/mal,yohanesyuen/mal,slideclick/mal,h8gi/mal,christhekeele/mal,DomBlack/mal,h8gi/mal,alantsev/mal,SawyerHood/mal,enitihas/mal,keith-rollin/mal,keith-rollin/mal,U-MA/mal,fdserr/mal,SawyerHood/mal,DomBlack/mal,czchen/mal,alcherk/mal,ekmartin/mal,alantsev/mal,sleexyz/mal,moquist/mal,DomBlack/mal,pocarist/mal,foresterre/mal,0gajun/mal,mpwillson/mal,h3rald/mal,DomBlack/mal,h8gi/mal,eshamster/mal,0gajun/mal,jwalsh/mal,yohanesyuen/mal,b0oh/mal,bestwpw/mal,h3rald/mal,pocarist/mal,tebeka/mal,sgerguri/mal,TheNumberOne/mal,alantsev/mal,nlfiedler/mal,sgerguri/mal,sgerguri/mal,b0oh/mal,keith-rollin/mal,profan/mal,foresterre/mal,mohsenil85/mal,alantsev/mal,enitihas/mal,SawyerHood/mal,sleexyz/mal,adamschmideg/mal,TheNumberOne/mal,rnby-mike/mal,jwalsh/mal,mohsenil85/mal,h3rald/mal,jwalsh/mal,sgerguri/mal,mohsenil85/mal,sgerguri/mal,rhysd/mal,yohanesyuen/mal,pocarist/mal,czchen/mal,DomBlack/mal,h8gi/mal,ekmartin/mal,yohanesyuen/mal,profan/mal,bestwpw/mal,SawyerHood/mal,martinlschumann/mal,yohanesyuen/mal,sleexyz/mal,0gajun/mal,enitihas/mal,h3rald/mal,pocarist/mal,h8gi/mal,h3rald/mal,outcastgeek/mal,pocarist/mal,tompko/mal,czchen/mal,enitihas/mal,outcastgeek/mal,bestwpw/mal,h8gi/mal,martinlschumann/mal,treeform/mal,adamschmideg/mal,mohsenil85/mal,mohsenil85/mal,TheNumberOne/mal,treeform/mal,jwalsh/mal,rhysd/mal,DomBlack/mal,alphaKAI/mal,eshamster/mal,sleep/mal,hterkelsen/mal,sleexyz/mal,eshamster/mal,czchen/mal,treeform/mal,sleexyz/mal,0gajun/mal,SawyerHood/mal,pocarist/mal,SawyerHood/mal,SawyerHood/mal,mohsenil85/mal,mohsenil85/mal,moquist/mal,czchen/mal,DomBlack/mal,h8gi/mal,christhekeele/mal,rnby-mike/mal,TheNumberOne/mal,sleexyz/mal,tebeka/mal,tebeka/mal,h3rald/mal,fduch2k/mal,sgerguri/mal,nlfiedler/mal,slideclick/mal,SawyerHood/mal,bestwpw/mal,U-MA/mal,b0oh/mal,TheNumberOne/mal,b0oh/mal,sgerguri/mal,sleep/mal,outcastgeek/mal,fdserr/mal,outcastgeek/mal,fdserr/mal,outcastgeek/mal,SawyerHood/mal,nlfiedler/mal,SawyerHood/mal,0gajun/mal,czchen/mal,profan/mal,sleep/mal,foresterre/mal,foresterre/mal,DomBlack/mal,rhysd/mal,eshamster/mal,sgerguri/mal,DomBlack/mal,pocarist/mal,b0oh/mal,h3rald/mal,foresterre/mal,h3rald/mal,bestwpw/mal,mpwillson/mal,moquist/mal,b0oh/mal,fdserr/mal,keith-rollin/mal,tebeka/mal,christhekeele/mal,pocarist/mal,nlfiedler/mal,sleexyz/mal,alcherk/mal,eshamster/mal,TheNumberOne/mal,moquist/mal,b0oh/mal,treeform/mal,mpwillson/mal,fduch2k/mal,eshamster/mal,sleexyz/mal,rhysd/mal,enitihas/mal,adamschmideg/mal,mohsenil85/mal,pocarist/mal,slideclick/mal,mohsenil85/mal,rhysd/mal,hterkelsen/mal,eshamster/mal,alcherk/mal,czchen/mal,alcherk/mal,slideclick/mal,foresterre/mal,alphaKAI/mal,profan/mal,sleep/mal,SawyerHood/mal,sleexyz/mal,rhysd/mal,christhekeele/mal,mpwillson/mal,enitihas/mal,mohsenil85/mal,U-MA/mal,ekmartin/mal,enitihas/mal,yohanesyuen/mal,martinlschumann/mal,foresterre/mal,nlfiedler/mal,U-MA/mal,treeform/mal,mpwillson/mal,ekmartin/mal,SawyerHood/mal,moquist/mal,yohanesyuen/mal,adamschmideg/mal,treeform/mal,sleep/mal,ekmartin/mal,czchen/mal | factor | ## Code Before:
! Copyright (C) 2015 Jordan Lewis.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel hashtables accessors assocs locals math sequences ;
IN: malenv
TUPLE: malenv
{ outer read-only }
{ data hashtable read-only } ;
! set outer to f if top level env
INSTANCE: malenv assoc
C: <malenv> malenv
: new-env ( outer -- malenv ) H{ } malenv boa ;
M:: malenv at* ( key assoc -- value/f ? )
key name>> assoc data>> at*
[ drop assoc outer>>
[ key ?of ]
[ f f ]
if*
]
unless* ;
M: malenv assoc-size ( assoc -- n )
[ data>> ] [ outer>> ] bi [ assoc-size ] bi@ + ;
M: malenv >alist ( assoc -- n )
[ data>> ] [ outer>> ] bi [ >alist ] bi@ append ;
M: malenv set-at ( value key assoc -- )
[ name>> ] [ data>> ] bi* set-at ;
M: malenv delete-at ( key assoc -- )
[ name>> ] [ data>> ] bi* delete-at ;
M: malenv clear-assoc ( assoc -- )
data>> clear-assoc ;
: get-or-throw ( key assoc -- value )
at* [ dup "no variable " append throw ] unless ;
## Instruction:
Fix env variable not found message
## Code After:
! Copyright (C) 2015 Jordan Lewis.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel hashtables accessors assocs locals math sequences ;
IN: malenv
TUPLE: malenv
{ outer read-only }
{ data hashtable read-only } ;
! set outer to f if top level env
INSTANCE: malenv assoc
C: <malenv> malenv
: new-env ( outer -- malenv ) H{ } malenv boa ;
M:: malenv at* ( key assoc -- value/f ? )
key name>> assoc data>> at*
[ drop assoc outer>>
[ key ?of ]
[ f f ]
if*
]
unless* ;
M: malenv assoc-size ( assoc -- n )
[ data>> ] [ outer>> ] bi [ assoc-size ] bi@ + ;
M: malenv >alist ( assoc -- n )
[ data>> ] [ outer>> ] bi [ >alist ] bi@ append ;
M: malenv set-at ( value key assoc -- )
[ name>> ] [ data>> ] bi* set-at ;
M: malenv delete-at ( key assoc -- )
[ name>> ] [ data>> ] bi* delete-at ;
M: malenv clear-assoc ( assoc -- )
data>> clear-assoc ;
: get-or-throw ( key assoc -- value )
?at [ dup name>> "no variable " prepend throw ] unless ;
| ! Copyright (C) 2015 Jordan Lewis.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel hashtables accessors assocs locals math sequences ;
IN: malenv
TUPLE: malenv
{ outer read-only }
{ data hashtable read-only } ;
! set outer to f if top level env
INSTANCE: malenv assoc
C: <malenv> malenv
: new-env ( outer -- malenv ) H{ } malenv boa ;
M:: malenv at* ( key assoc -- value/f ? )
key name>> assoc data>> at*
[ drop assoc outer>>
[ key ?of ]
[ f f ]
if*
]
unless* ;
M: malenv assoc-size ( assoc -- n )
[ data>> ] [ outer>> ] bi [ assoc-size ] bi@ + ;
M: malenv >alist ( assoc -- n )
[ data>> ] [ outer>> ] bi [ >alist ] bi@ append ;
M: malenv set-at ( value key assoc -- )
[ name>> ] [ data>> ] bi* set-at ;
M: malenv delete-at ( key assoc -- )
[ name>> ] [ data>> ] bi* delete-at ;
M: malenv clear-assoc ( assoc -- )
data>> clear-assoc ;
: get-or-throw ( key assoc -- value )
- at* [ dup "no variable " append throw ] unless ;
? - -
+ ?at [ dup name>> "no variable " prepend throw ] unless ;
? + +++++++ ++
| 2 | 0.047619 | 1 | 1 |
f67746750bdd2a1d6e662b1fc36d5a6fa13098c5 | scripts/generate.py | scripts/generate.py |
params = [
("dict(dim=250, dim_mlp=250)", "run1"),
("dict(dim=500, dim_mlp=500)", "run2"),
("dict(rank_n_approx=200)", "run3"),
("dict(rank_n_approx=500)", "run4"),
("dict(avg_word=False)", "run5")
]
for options, name in params:
with open("{}.sh".format(name), "w") as script:
log = "{}.log".format(name)
print >>script, template.format(**locals())
|
params = [
("dict(dim=250, dim_mlp=250, prefix='model_run1_')", "run1"),
("dict(dim=500, dim_mlp=500, prefix='model_run2_')", "run2"),
("dict(rank_n_approx=200, prefix='model_run3_')", "run3"),
("dict(rank_n_approx=500, prefix='model_run4_')", "run4"),
("dict(avg_word=False, prefix='model_run5_')", "run5")
]
for options, name in params:
with open("{}.sh".format(name), "w") as script:
log = "{}.log".format(name)
print >>script, template.format(**locals())
| Add different prefixes for the experiments | Add different prefixes for the experiments
| Python | bsd-3-clause | rizar/groundhog-private | python | ## Code Before:
params = [
("dict(dim=250, dim_mlp=250)", "run1"),
("dict(dim=500, dim_mlp=500)", "run2"),
("dict(rank_n_approx=200)", "run3"),
("dict(rank_n_approx=500)", "run4"),
("dict(avg_word=False)", "run5")
]
for options, name in params:
with open("{}.sh".format(name), "w") as script:
log = "{}.log".format(name)
print >>script, template.format(**locals())
## Instruction:
Add different prefixes for the experiments
## Code After:
params = [
("dict(dim=250, dim_mlp=250, prefix='model_run1_')", "run1"),
("dict(dim=500, dim_mlp=500, prefix='model_run2_')", "run2"),
("dict(rank_n_approx=200, prefix='model_run3_')", "run3"),
("dict(rank_n_approx=500, prefix='model_run4_')", "run4"),
("dict(avg_word=False, prefix='model_run5_')", "run5")
]
for options, name in params:
with open("{}.sh".format(name), "w") as script:
log = "{}.log".format(name)
print >>script, template.format(**locals())
|
params = [
- ("dict(dim=250, dim_mlp=250)", "run1"),
+ ("dict(dim=250, dim_mlp=250, prefix='model_run1_')", "run1"),
? ++++++++++++++++++++++
- ("dict(dim=500, dim_mlp=500)", "run2"),
+ ("dict(dim=500, dim_mlp=500, prefix='model_run2_')", "run2"),
? ++++++++++++++++++++++
- ("dict(rank_n_approx=200)", "run3"),
+ ("dict(rank_n_approx=200, prefix='model_run3_')", "run3"),
? ++++++++++++++++++++++
- ("dict(rank_n_approx=500)", "run4"),
+ ("dict(rank_n_approx=500, prefix='model_run4_')", "run4"),
? ++++++++++++++++++++++
- ("dict(avg_word=False)", "run5")
+ ("dict(avg_word=False, prefix='model_run5_')", "run5")
? ++++++++++++++++++++++
]
for options, name in params:
with open("{}.sh".format(name), "w") as script:
log = "{}.log".format(name)
print >>script, template.format(**locals())
| 10 | 0.714286 | 5 | 5 |
c9aae8a2d63bf8c53867a6d00bc083238046e93a | app/controllers/application_controller.rb | app/controllers/application_controller.rb | class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
before_filter :set_cache_buster
add_flash_types :error
# strong_params in decent exposure
decent_configuration do
strategy DecentExposure::StrongParametersStrategy
end
# cancan
rescue_from CanCan::AccessDenied do |exception|
redirect_to root_path,
status: :forbidden,
error: I18n.t("views.unauthorized")
end
expose(:decorated_current_user) {
decorate current_user
}
def set_cache_buster
response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate"
response.headers["Pragma"] = "no-cache"
response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
end
end
| class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
add_flash_types :error
# strong_params in decent exposure
decent_configuration do
strategy DecentExposure::StrongParametersStrategy
end
# cancan
rescue_from CanCan::AccessDenied do |exception|
redirect_to root_path,
status: :forbidden,
error: I18n.t("views.unauthorized")
end
expose(:decorated_current_user) {
decorate current_user
}
private
def set_cache_buster
response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate"
response.headers["Pragma"] = "no-cache"
response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
end
def after_sign_out_path_for(resource_or_scope)
set_cache_buster
root_path
end
end
| Remove headers cache only on logout | Remove headers cache only on logout
| Ruby | mit | GrowMoi/moi,GrowMoi/moi,GrowMoi/moi | ruby | ## Code Before:
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
before_filter :set_cache_buster
add_flash_types :error
# strong_params in decent exposure
decent_configuration do
strategy DecentExposure::StrongParametersStrategy
end
# cancan
rescue_from CanCan::AccessDenied do |exception|
redirect_to root_path,
status: :forbidden,
error: I18n.t("views.unauthorized")
end
expose(:decorated_current_user) {
decorate current_user
}
def set_cache_buster
response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate"
response.headers["Pragma"] = "no-cache"
response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
end
end
## Instruction:
Remove headers cache only on logout
## Code After:
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
add_flash_types :error
# strong_params in decent exposure
decent_configuration do
strategy DecentExposure::StrongParametersStrategy
end
# cancan
rescue_from CanCan::AccessDenied do |exception|
redirect_to root_path,
status: :forbidden,
error: I18n.t("views.unauthorized")
end
expose(:decorated_current_user) {
decorate current_user
}
private
def set_cache_buster
response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate"
response.headers["Pragma"] = "no-cache"
response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
end
def after_sign_out_path_for(resource_or_scope)
set_cache_buster
root_path
end
end
| class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
- before_filter :set_cache_buster
add_flash_types :error
# strong_params in decent exposure
decent_configuration do
strategy DecentExposure::StrongParametersStrategy
end
# cancan
rescue_from CanCan::AccessDenied do |exception|
redirect_to root_path,
status: :forbidden,
error: I18n.t("views.unauthorized")
end
expose(:decorated_current_user) {
decorate current_user
}
+ private
+
def set_cache_buster
response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate"
response.headers["Pragma"] = "no-cache"
response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
end
+ def after_sign_out_path_for(resource_or_scope)
+ set_cache_buster
+ root_path
+ end
+
end | 8 | 0.258065 | 7 | 1 |
81c2745570193eb19148295225cefa7d82ece582 | ROADMAP.md | ROADMAP.md | simple-settings roadmap
=======================
Available for testing
---------------------
Use `pip install git+https://github.com/drgarcia1986/simple-settings.git` to test this features
* Lazy settings load.
Read the [documentation](http://simple-settings.readthedocs.org/en/latest/) for more informations.
Next versions
-------------
* Read settings from _yaml_ files.
* Read settings from remote files.
| simple-settings roadmap
=======================
Available for testing
---------------------
Use `pip install git+https://github.com/drgarcia1986/simple-settings.git` to test this features
Read the [documentation](http://simple-settings.readthedocs.org/en/latest/) for more informations.
Next versions
-------------
* Read settings from _yaml_ files.
* Read settings from remote files.
| Update roadmap (remove Lazy Settings of beta testing) | Update roadmap (remove Lazy Settings of beta testing)
| Markdown | mit | drgarcia1986/simple-settings | markdown | ## Code Before:
simple-settings roadmap
=======================
Available for testing
---------------------
Use `pip install git+https://github.com/drgarcia1986/simple-settings.git` to test this features
* Lazy settings load.
Read the [documentation](http://simple-settings.readthedocs.org/en/latest/) for more informations.
Next versions
-------------
* Read settings from _yaml_ files.
* Read settings from remote files.
## Instruction:
Update roadmap (remove Lazy Settings of beta testing)
## Code After:
simple-settings roadmap
=======================
Available for testing
---------------------
Use `pip install git+https://github.com/drgarcia1986/simple-settings.git` to test this features
Read the [documentation](http://simple-settings.readthedocs.org/en/latest/) for more informations.
Next versions
-------------
* Read settings from _yaml_ files.
* Read settings from remote files.
| simple-settings roadmap
=======================
Available for testing
---------------------
Use `pip install git+https://github.com/drgarcia1986/simple-settings.git` to test this features
- * Lazy settings load.
-
Read the [documentation](http://simple-settings.readthedocs.org/en/latest/) for more informations.
Next versions
-------------
* Read settings from _yaml_ files.
* Read settings from remote files. | 2 | 0.125 | 0 | 2 |
c83ee39cb8aaae52d63b43f0c0a58c3dc8fe412f | README.md | README.md | hash-selectors
==============
A small set of select methods for Ruby Hashes
{a: 1, b: 2, c: 3}.select_by_keys :a, :b # returns {a: 1, b: 2}
{a: 1, b: 2, c: 3}.select_by_values 1, 3 # returns {a: 1, c: 3}
| hash-selectors
==============
A small set of select methods for Ruby Hashes
# select_by...
{a: 1, b: 2, c: 3}.select_by_keys :a, :b # returns {a: 1, b: 2}
{a: 1, b: 2, c: 3}.select_by_values 1, 3 # returns {a: 1, c: 3}
# reject_by...
{a: 1, b: 2, c: 3}.reject_by_keys :c # returns {a: 1, b: 2}
{a: 1, b: 2, c: 3}.reject_by_values 2 # returns {a: 1, c: 3}
# partition_by...
{a: 1, b: 2, c: 3}.partition_by_keys :a, :b # returns [{a: 1, b: 2}, {c: 3}]
{a: 1, b: 2, c: 3}.partition_by_values 1, 3 # returns [{a: 1, c: 3}, {b: 2}]
| Add reject and partition examples | Add reject and partition examples | Markdown | mit | kbaird/hash-selectors,kbaird/hash-selectors | markdown | ## Code Before:
hash-selectors
==============
A small set of select methods for Ruby Hashes
{a: 1, b: 2, c: 3}.select_by_keys :a, :b # returns {a: 1, b: 2}
{a: 1, b: 2, c: 3}.select_by_values 1, 3 # returns {a: 1, c: 3}
## Instruction:
Add reject and partition examples
## Code After:
hash-selectors
==============
A small set of select methods for Ruby Hashes
# select_by...
{a: 1, b: 2, c: 3}.select_by_keys :a, :b # returns {a: 1, b: 2}
{a: 1, b: 2, c: 3}.select_by_values 1, 3 # returns {a: 1, c: 3}
# reject_by...
{a: 1, b: 2, c: 3}.reject_by_keys :c # returns {a: 1, b: 2}
{a: 1, b: 2, c: 3}.reject_by_values 2 # returns {a: 1, c: 3}
# partition_by...
{a: 1, b: 2, c: 3}.partition_by_keys :a, :b # returns [{a: 1, b: 2}, {c: 3}]
{a: 1, b: 2, c: 3}.partition_by_values 1, 3 # returns [{a: 1, c: 3}, {b: 2}]
| hash-selectors
==============
A small set of select methods for Ruby Hashes
+ # select_by...
{a: 1, b: 2, c: 3}.select_by_keys :a, :b # returns {a: 1, b: 2}
{a: 1, b: 2, c: 3}.select_by_values 1, 3 # returns {a: 1, c: 3}
+
+ # reject_by...
+ {a: 1, b: 2, c: 3}.reject_by_keys :c # returns {a: 1, b: 2}
+
+ {a: 1, b: 2, c: 3}.reject_by_values 2 # returns {a: 1, c: 3}
+
+ # partition_by...
+ {a: 1, b: 2, c: 3}.partition_by_keys :a, :b # returns [{a: 1, b: 2}, {c: 3}]
+
+ {a: 1, b: 2, c: 3}.partition_by_values 1, 3 # returns [{a: 1, c: 3}, {b: 2}] | 11 | 1.375 | 11 | 0 |
9d524748e5ab9773b7960fcbd6f52afa6bfd457b | config/config.js | config/config.js | var path = require('path');
var rootPath = path.normalize(__dirname + '/../');
module.exports = {
development: {
rootPath: rootPath,
dbConn: 'mongodb://localhost:27017/fileuploadsystem',
uploadsPath: path.normalize(rootPath + '/uploads/'),
port: process.env.PORT || 1234
}
} | var path = require('path');
var rootPath = path.normalize(__dirname + '/../');
module.exports = {
development: {
rootPath: rootPath,
// dbConn: 'mongodb://localhost:27017/fileuploadsystem',
dbConn: 'mongodb://fileuploadsys:qweqwe@ds033831.mongolab.com:33831/fileuploadsystem',
uploadsPath: path.normalize(rootPath + '/uploads/'),
port: process.env.PORT || 1234
}
} | Change conn str to use mongolab db | Change conn str to use mongolab db
| JavaScript | mit | georgiwe/FileUploadSystem | javascript | ## Code Before:
var path = require('path');
var rootPath = path.normalize(__dirname + '/../');
module.exports = {
development: {
rootPath: rootPath,
dbConn: 'mongodb://localhost:27017/fileuploadsystem',
uploadsPath: path.normalize(rootPath + '/uploads/'),
port: process.env.PORT || 1234
}
}
## Instruction:
Change conn str to use mongolab db
## Code After:
var path = require('path');
var rootPath = path.normalize(__dirname + '/../');
module.exports = {
development: {
rootPath: rootPath,
// dbConn: 'mongodb://localhost:27017/fileuploadsystem',
dbConn: 'mongodb://fileuploadsys:qweqwe@ds033831.mongolab.com:33831/fileuploadsystem',
uploadsPath: path.normalize(rootPath + '/uploads/'),
port: process.env.PORT || 1234
}
} | var path = require('path');
var rootPath = path.normalize(__dirname + '/../');
module.exports = {
development: {
rootPath: rootPath,
- dbConn: 'mongodb://localhost:27017/fileuploadsystem',
+ // dbConn: 'mongodb://localhost:27017/fileuploadsystem',
? +++
+ dbConn: 'mongodb://fileuploadsys:qweqwe@ds033831.mongolab.com:33831/fileuploadsystem',
uploadsPath: path.normalize(rootPath + '/uploads/'),
port: process.env.PORT || 1234
}
} | 3 | 0.272727 | 2 | 1 |
e7df2d8cdebee8fac86d9885f94641d7298f405a | app/Providers/AppServiceProvider.php | app/Providers/AppServiceProvider.php | <?php
namespace App\Providers;
use App\Services\CsvGenerator;
use App\Services\Response;
use Illuminate\Contracts\Routing\ResponseFactory;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
$this->app->bind(
\App\Solvers\SolverInterface::class,
\App\Solvers\HatSolver::class
);
}
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
//
}
}
| <?php
namespace App\Providers;
use App\Services\CsvGenerator;
use App\Services\Response;
use DrawCrypt;
use Illuminate\Contracts\Routing\ResponseFactory;
use Illuminate\Support\ServiceProvider;
use Queue;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
$this->app->bind(
\App\Solvers\SolverInterface::class,
\App\Solvers\HatSolver::class
);
}
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Queue::createPayloadUsing(function ($connection, $queue, $payload) {
return [
'data' => array_merge($payload['data'], [
'iv' => base64_encode(DrawCrypt::getIV())
])
];
});
$this->app['events']->listen(\Illuminate\Queue\Events\JobProcessing::class, function ($event) {
if (isset($event->job->payload()['data']['iv'])) {
DrawCrypt::setIV(base64_decode($event->job->payload()['data']['iv']));
}
});
}
}
| Add iv in job data when queueing | Add iv in job data when queueing
| PHP | apache-2.0 | Korko/SecretSanta.fr,Korko/SecretSanta.fr | php | ## Code Before:
<?php
namespace App\Providers;
use App\Services\CsvGenerator;
use App\Services\Response;
use Illuminate\Contracts\Routing\ResponseFactory;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
$this->app->bind(
\App\Solvers\SolverInterface::class,
\App\Solvers\HatSolver::class
);
}
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
//
}
}
## Instruction:
Add iv in job data when queueing
## Code After:
<?php
namespace App\Providers;
use App\Services\CsvGenerator;
use App\Services\Response;
use DrawCrypt;
use Illuminate\Contracts\Routing\ResponseFactory;
use Illuminate\Support\ServiceProvider;
use Queue;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
$this->app->bind(
\App\Solvers\SolverInterface::class,
\App\Solvers\HatSolver::class
);
}
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Queue::createPayloadUsing(function ($connection, $queue, $payload) {
return [
'data' => array_merge($payload['data'], [
'iv' => base64_encode(DrawCrypt::getIV())
])
];
});
$this->app['events']->listen(\Illuminate\Queue\Events\JobProcessing::class, function ($event) {
if (isset($event->job->payload()['data']['iv'])) {
DrawCrypt::setIV(base64_decode($event->job->payload()['data']['iv']));
}
});
}
}
| <?php
namespace App\Providers;
use App\Services\CsvGenerator;
use App\Services\Response;
+ use DrawCrypt;
use Illuminate\Contracts\Routing\ResponseFactory;
use Illuminate\Support\ServiceProvider;
+ use Queue;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
$this->app->bind(
\App\Solvers\SolverInterface::class,
\App\Solvers\HatSolver::class
);
}
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
+ Queue::createPayloadUsing(function ($connection, $queue, $payload) {
+ return [
+ 'data' => array_merge($payload['data'], [
+ 'iv' => base64_encode(DrawCrypt::getIV())
+ ])
+ ];
- //
? ^^
+ });
? ^^^
+
+ $this->app['events']->listen(\Illuminate\Queue\Events\JobProcessing::class, function ($event) {
+ if (isset($event->job->payload()['data']['iv'])) {
+ DrawCrypt::setIV(base64_decode($event->job->payload()['data']['iv']));
+ }
+ });
}
} | 16 | 0.470588 | 15 | 1 |
7afa0104ac678a50c7754aada979b48ee4d8393d | lib/index.coffee | lib/index.coffee | 'use strict'
stripEof = require 'strip-eof'
exec = require('child_process').exec
keywords =
'$newVersion':
regex: /\$newVersion/g
replace: '_version'
'$oldVersion':
regex: /\$oldVersion/g
replace: '_oldVersion'
createLogger = (logger) ->
logState = (state, messages) ->
logger[state] message for message in messages when message isnt ''
return logState
replaceAll = (str, bumped, key) ->
str.replace keywords[key].regex, bumped[keywords[key].replace]
module.exports = (bumped, plugin, cb) ->
logState = createLogger plugin.logger
cmd = replaceAll plugin.command, bumped, key for key of keywords
exec cmd, (err, stdout, stderr) ->
if err
code = err.code
err = true
buffer = stderr
type = 'error'
else
buffer = stdout
type = 'success'
logState(type, stripEof(buffer).split('\n'))
plugin.logger.error "Process exited with code #{code}" if code
cb err
| 'use strict'
stripEof = require 'strip-eof'
exec = require('child_process').exec
keywords =
'$newVersion':
regex: /\$newVersion/g
replace: '_version'
'$oldVersion':
regex: /\$oldVersion/g
replace: '_oldVersion'
createLogger = (logger) ->
logState = (state, messages) ->
logger[state] message for message in messages when message isnt ''
return logState
replaceAll = (str, bumped, key) ->
str.replace keywords[key].regex, bumped[keywords[key].replace]
module.exports = (bumped, plugin, cb) ->
logState = createLogger plugin.logger
plugin.command = replaceAll plugin.command, bumped, key for key of keywords
exec plugin.command, (err, stdout, stderr) ->
if err
code = err.code
err = true
buffer = stderr
type = 'error'
else
buffer = stdout
type = 'success'
logState(type, stripEof(buffer).split('\n'))
plugin.logger.error "Process exited with code #{code}" if code
cb err
| Fix replace all under plugin command | Fix replace all under plugin command
| CoffeeScript | mit | bumped/bumped-terminal,bumped/bumped-terminal | coffeescript | ## Code Before:
'use strict'
stripEof = require 'strip-eof'
exec = require('child_process').exec
keywords =
'$newVersion':
regex: /\$newVersion/g
replace: '_version'
'$oldVersion':
regex: /\$oldVersion/g
replace: '_oldVersion'
createLogger = (logger) ->
logState = (state, messages) ->
logger[state] message for message in messages when message isnt ''
return logState
replaceAll = (str, bumped, key) ->
str.replace keywords[key].regex, bumped[keywords[key].replace]
module.exports = (bumped, plugin, cb) ->
logState = createLogger plugin.logger
cmd = replaceAll plugin.command, bumped, key for key of keywords
exec cmd, (err, stdout, stderr) ->
if err
code = err.code
err = true
buffer = stderr
type = 'error'
else
buffer = stdout
type = 'success'
logState(type, stripEof(buffer).split('\n'))
plugin.logger.error "Process exited with code #{code}" if code
cb err
## Instruction:
Fix replace all under plugin command
## Code After:
'use strict'
stripEof = require 'strip-eof'
exec = require('child_process').exec
keywords =
'$newVersion':
regex: /\$newVersion/g
replace: '_version'
'$oldVersion':
regex: /\$oldVersion/g
replace: '_oldVersion'
createLogger = (logger) ->
logState = (state, messages) ->
logger[state] message for message in messages when message isnt ''
return logState
replaceAll = (str, bumped, key) ->
str.replace keywords[key].regex, bumped[keywords[key].replace]
module.exports = (bumped, plugin, cb) ->
logState = createLogger plugin.logger
plugin.command = replaceAll plugin.command, bumped, key for key of keywords
exec plugin.command, (err, stdout, stderr) ->
if err
code = err.code
err = true
buffer = stderr
type = 'error'
else
buffer = stdout
type = 'success'
logState(type, stripEof(buffer).split('\n'))
plugin.logger.error "Process exited with code #{code}" if code
cb err
| 'use strict'
stripEof = require 'strip-eof'
exec = require('child_process').exec
keywords =
'$newVersion':
regex: /\$newVersion/g
replace: '_version'
'$oldVersion':
regex: /\$oldVersion/g
replace: '_oldVersion'
createLogger = (logger) ->
logState = (state, messages) ->
logger[state] message for message in messages when message isnt ''
return logState
replaceAll = (str, bumped, key) ->
str.replace keywords[key].regex, bumped[keywords[key].replace]
module.exports = (bumped, plugin, cb) ->
logState = createLogger plugin.logger
- cmd = replaceAll plugin.command, bumped, key for key of keywords
+ plugin.command = replaceAll plugin.command, bumped, key for key of keywords
? +++++++ + +++
- exec cmd, (err, stdout, stderr) ->
+ exec plugin.command, (err, stdout, stderr) ->
? +++++++ + +++
if err
code = err.code
err = true
buffer = stderr
type = 'error'
else
buffer = stdout
type = 'success'
logState(type, stripEof(buffer).split('\n'))
plugin.logger.error "Process exited with code #{code}" if code
cb err | 4 | 0.102564 | 2 | 2 |
f86b144e4052f74ab67b6f1536db4d738283eda2 | modules/util/uriFromUrl.js | modules/util/uriFromUrl.js | Components.utils.import('resource://greasemonkey/util.js');
var EXPORTED_SYMBOLS = ['uriFromUrl'];
function uriFromUrl(url, base) {
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
var baseUri = null;
if (typeof base === "string") {
baseUri = GM_util.uriFromUrl(base);
} else if (base) {
baseUri = base;
}
try {
return ioService.newURI(url, null, baseUri);
} catch (e) {
return null;
}
}
uriFromUrl = GM_util.memoize(uriFromUrl);
| Components.utils.import('resource://greasemonkey/util.js');
var EXPORTED_SYMBOLS = ['uriFromUrl'];
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
function uriFromUrl(url, base) {
var baseUri = null;
if (typeof base === "string") {
baseUri = GM_util.uriFromUrl(base);
} else if (base) {
baseUri = base;
}
try {
return ioService.newURI(url, null, baseUri);
} catch (e) {
return null;
}
}
uriFromUrl = GM_util.memoize(uriFromUrl);
| Make a single io service, not one per run. | Make a single io service, not one per run.
| JavaScript | bsd-3-clause | Ventero/greasemonkey,HasClass0/greasemonkey,Martii/greasemonkey,Ventero/greasemonkey,HasClass0/greasemonkey,the8472/greasemonkey,the8472/greasemonkey,Martii/greasemonkey | javascript | ## Code Before:
Components.utils.import('resource://greasemonkey/util.js');
var EXPORTED_SYMBOLS = ['uriFromUrl'];
function uriFromUrl(url, base) {
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
var baseUri = null;
if (typeof base === "string") {
baseUri = GM_util.uriFromUrl(base);
} else if (base) {
baseUri = base;
}
try {
return ioService.newURI(url, null, baseUri);
} catch (e) {
return null;
}
}
uriFromUrl = GM_util.memoize(uriFromUrl);
## Instruction:
Make a single io service, not one per run.
## Code After:
Components.utils.import('resource://greasemonkey/util.js');
var EXPORTED_SYMBOLS = ['uriFromUrl'];
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
function uriFromUrl(url, base) {
var baseUri = null;
if (typeof base === "string") {
baseUri = GM_util.uriFromUrl(base);
} else if (base) {
baseUri = base;
}
try {
return ioService.newURI(url, null, baseUri);
} catch (e) {
return null;
}
}
uriFromUrl = GM_util.memoize(uriFromUrl);
| Components.utils.import('resource://greasemonkey/util.js');
var EXPORTED_SYMBOLS = ['uriFromUrl'];
+ var ioService = Components.classes["@mozilla.org/network/io-service;1"]
+ .getService(Components.interfaces.nsIIOService);
+
function uriFromUrl(url, base) {
- var ioService = Components.classes["@mozilla.org/network/io-service;1"]
- .getService(Components.interfaces.nsIIOService);
var baseUri = null;
-
if (typeof base === "string") {
baseUri = GM_util.uriFromUrl(base);
} else if (base) {
baseUri = base;
}
try {
return ioService.newURI(url, null, baseUri);
} catch (e) {
return null;
}
}
uriFromUrl = GM_util.memoize(uriFromUrl); | 6 | 0.272727 | 3 | 3 |
0dc1481667f5a38d0bec27a14d3c55e50960bed7 | src/JavaScriptPlayground.js | src/JavaScriptPlayground.js | "use strict"
var JavaScriptPlaygroundEditor = require("./JavaScriptPlaygroundEditor.js")
, vm = require("vm")
var JavaScriptPlayground = module.exports = function (playgroundElement, jsStubText) {
this._playgroundElem = playgroundElement
var jsEditorElement = document.createElement("div")
jsEditorElement.style.width = "100%"
jsEditorElement.style.height = "100%"
this._playgroundElem.appendChild(jsEditorElement)
this._jsEditor = new JavaScriptPlaygroundEditor(jsEditorElement, jsStubText)
this._jsEditor.on("changeValidJS", this._handleJSChange.bind(this))
}
JavaScriptPlayground.prototype._handleJSChange = function (event) {
try {
var result = vm.runInNewContext(event.documentText(), {
"require": require,
"module": { "exports": {} }
})
result("bar")
}
catch (e) {
console.log(e)
}
}
| "use strict"
var JavaScriptPlaygroundEditor = require("./JavaScriptPlaygroundEditor.js")
, vm = require("vm")
var JavaScriptPlayground = module.exports = function (playgroundElement, jsStubText) {
this._playgroundElem = playgroundElement
var jsEditorElement = document.createElement("div")
jsEditorElement.style.width = "100%"
jsEditorElement.style.height = "100%"
this._playgroundElem.appendChild(jsEditorElement)
this._jsEditor = new JavaScriptPlaygroundEditor(jsEditorElement, jsStubText)
this._jsEditor.on("changeValidJS", this._handleJSChange.bind(this))
}
JavaScriptPlayground.prototype._handleJSChange = function (event) {
var context = {
"require": require,
"module": { "exports": {} }
}
vm.runInNewContext(event.documentText(), context)
context.module.exports.call(undefined, "bar")
try {
}
catch (e) {
console.log(e)
}
}
| Fix for running exported function instead of result of last statement. | Fix for running exported function instead of result of last statement.
| JavaScript | mit | limulus/svg-playground | javascript | ## Code Before:
"use strict"
var JavaScriptPlaygroundEditor = require("./JavaScriptPlaygroundEditor.js")
, vm = require("vm")
var JavaScriptPlayground = module.exports = function (playgroundElement, jsStubText) {
this._playgroundElem = playgroundElement
var jsEditorElement = document.createElement("div")
jsEditorElement.style.width = "100%"
jsEditorElement.style.height = "100%"
this._playgroundElem.appendChild(jsEditorElement)
this._jsEditor = new JavaScriptPlaygroundEditor(jsEditorElement, jsStubText)
this._jsEditor.on("changeValidJS", this._handleJSChange.bind(this))
}
JavaScriptPlayground.prototype._handleJSChange = function (event) {
try {
var result = vm.runInNewContext(event.documentText(), {
"require": require,
"module": { "exports": {} }
})
result("bar")
}
catch (e) {
console.log(e)
}
}
## Instruction:
Fix for running exported function instead of result of last statement.
## Code After:
"use strict"
var JavaScriptPlaygroundEditor = require("./JavaScriptPlaygroundEditor.js")
, vm = require("vm")
var JavaScriptPlayground = module.exports = function (playgroundElement, jsStubText) {
this._playgroundElem = playgroundElement
var jsEditorElement = document.createElement("div")
jsEditorElement.style.width = "100%"
jsEditorElement.style.height = "100%"
this._playgroundElem.appendChild(jsEditorElement)
this._jsEditor = new JavaScriptPlaygroundEditor(jsEditorElement, jsStubText)
this._jsEditor.on("changeValidJS", this._handleJSChange.bind(this))
}
JavaScriptPlayground.prototype._handleJSChange = function (event) {
var context = {
"require": require,
"module": { "exports": {} }
}
vm.runInNewContext(event.documentText(), context)
context.module.exports.call(undefined, "bar")
try {
}
catch (e) {
console.log(e)
}
}
| "use strict"
var JavaScriptPlaygroundEditor = require("./JavaScriptPlaygroundEditor.js")
, vm = require("vm")
var JavaScriptPlayground = module.exports = function (playgroundElement, jsStubText) {
this._playgroundElem = playgroundElement
var jsEditorElement = document.createElement("div")
jsEditorElement.style.width = "100%"
jsEditorElement.style.height = "100%"
this._playgroundElem.appendChild(jsEditorElement)
this._jsEditor = new JavaScriptPlaygroundEditor(jsEditorElement, jsStubText)
this._jsEditor.on("changeValidJS", this._handleJSChange.bind(this))
}
JavaScriptPlayground.prototype._handleJSChange = function (event) {
+ var context = {
+ "require": require,
+ "module": { "exports": {} }
+ }
+
+ vm.runInNewContext(event.documentText(), context)
+ context.module.exports.call(undefined, "bar")
try {
- var result = vm.runInNewContext(event.documentText(), {
- "require": require,
- "module": { "exports": {} }
- })
- result("bar")
}
catch (e) {
console.log(e)
}
}
| 12 | 0.4 | 7 | 5 |
bae109250cc4d487b7142b99f049828b1f59ed1e | pr/apps/iframe/index.html | pr/apps/iframe/index.html | <!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Merchant Website</title>
<link rel="icon" href="/favicon.ico">
<link rel="stylesheet" type="text/css" href="../../style.css">
<link rel="manifest" href="manifest.json">
</head>
<body>
<div id="contents">
<h1>Merchant Website</h1>
<p>This is a merchant website that includes an iframe from a payment
service website. The payment handler name and icon should come from the
web app manifest of the payment handler in the iframe instead of the top
level context of the merchant.</p>
<div id="src">
<p>View the source code:</p>
<ul>
<li><a href="manifest.json">Web app manifest</a></li>
</ul>
</div>
<p>The following iframe is <font color="green">allowed</font> to install the payment handler.</p>
<iframe src="payment-app/index.html" width="800px" height="600px" allow="payment"></iframe>
<p>The following iframe is <font color="red">not allowed</font> to install the payment handler.</p>
<iframe src="payment-app/index.html" width="800px" height="600px"></iframe>
</div>
<script src="/redirect.js"></script>
</body>
</html>
| <!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Merchant Website</title>
<link rel="icon" href="/favicon.ico">
<link rel="stylesheet" type="text/css" href="../../style.css">
<link rel="manifest" href="manifest.json">
</head>
<body>
<div id="contents">
<h1>Merchant Website</h1>
<p>This is a merchant website that includes an iframe from a payment
service website. The payment handler name and icon should come from the
web app manifest of the payment handler in the iframe instead of the top
level context of the merchant.</p>
<div id="src">
<p>View the source code:</p>
<ul>
<li><a href="manifest.json">Web app manifest</a></li>
</ul>
</div>
<p>The following iframe is <font color="green">allowed</font> to install the payment handler.</p>
<iframe src="payment-app/index.html" width="800px" height="600px" allow="payment"></iframe>
<p>The following iframe is <font color="red">not allowed</font> to install the payment handler.</p>
<iframe src="payment-app/index.html" width="800px" height="600px" allow="payment 'none'"></iframe>
</div>
<script src="/redirect.js"></script>
</body>
</html>
| Disable payment in second iframe | Disable payment in second iframe
| HTML | apache-2.0 | rsolomakhin/rsolomakhin.github.io,rsolomakhin/rsolomakhin.github.io | html | ## Code Before:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Merchant Website</title>
<link rel="icon" href="/favicon.ico">
<link rel="stylesheet" type="text/css" href="../../style.css">
<link rel="manifest" href="manifest.json">
</head>
<body>
<div id="contents">
<h1>Merchant Website</h1>
<p>This is a merchant website that includes an iframe from a payment
service website. The payment handler name and icon should come from the
web app manifest of the payment handler in the iframe instead of the top
level context of the merchant.</p>
<div id="src">
<p>View the source code:</p>
<ul>
<li><a href="manifest.json">Web app manifest</a></li>
</ul>
</div>
<p>The following iframe is <font color="green">allowed</font> to install the payment handler.</p>
<iframe src="payment-app/index.html" width="800px" height="600px" allow="payment"></iframe>
<p>The following iframe is <font color="red">not allowed</font> to install the payment handler.</p>
<iframe src="payment-app/index.html" width="800px" height="600px"></iframe>
</div>
<script src="/redirect.js"></script>
</body>
</html>
## Instruction:
Disable payment in second iframe
## Code After:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Merchant Website</title>
<link rel="icon" href="/favicon.ico">
<link rel="stylesheet" type="text/css" href="../../style.css">
<link rel="manifest" href="manifest.json">
</head>
<body>
<div id="contents">
<h1>Merchant Website</h1>
<p>This is a merchant website that includes an iframe from a payment
service website. The payment handler name and icon should come from the
web app manifest of the payment handler in the iframe instead of the top
level context of the merchant.</p>
<div id="src">
<p>View the source code:</p>
<ul>
<li><a href="manifest.json">Web app manifest</a></li>
</ul>
</div>
<p>The following iframe is <font color="green">allowed</font> to install the payment handler.</p>
<iframe src="payment-app/index.html" width="800px" height="600px" allow="payment"></iframe>
<p>The following iframe is <font color="red">not allowed</font> to install the payment handler.</p>
<iframe src="payment-app/index.html" width="800px" height="600px" allow="payment 'none'"></iframe>
</div>
<script src="/redirect.js"></script>
</body>
</html>
| <!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Merchant Website</title>
<link rel="icon" href="/favicon.ico">
<link rel="stylesheet" type="text/css" href="../../style.css">
<link rel="manifest" href="manifest.json">
</head>
<body>
<div id="contents">
<h1>Merchant Website</h1>
<p>This is a merchant website that includes an iframe from a payment
service website. The payment handler name and icon should come from the
web app manifest of the payment handler in the iframe instead of the top
level context of the merchant.</p>
<div id="src">
<p>View the source code:</p>
<ul>
<li><a href="manifest.json">Web app manifest</a></li>
</ul>
</div>
<p>The following iframe is <font color="green">allowed</font> to install the payment handler.</p>
<iframe src="payment-app/index.html" width="800px" height="600px" allow="payment"></iframe>
<p>The following iframe is <font color="red">not allowed</font> to install the payment handler.</p>
- <iframe src="payment-app/index.html" width="800px" height="600px"></iframe>
+ <iframe src="payment-app/index.html" width="800px" height="600px" allow="payment 'none'"></iframe>
? +++++++++++++++++++++++
</div>
<script src="/redirect.js"></script>
</body>
</html> | 2 | 0.04878 | 1 | 1 |
e535d82c454bc7683e3f6d6453b94797af0145c4 | lib/rake/loaders/makefile.rb | lib/rake/loaders/makefile.rb | module Rake
# Makefile loader to be used with the import file loader.
class MakefileLoader
include Rake::DSL
SPACE_MARK = "__&NBSP;__"
# Load the makefile dependencies in +fn+.
def load(fn)
open(fn) do |mf|
lines = mf.read
lines.gsub!(/\\ /, SPACE_MARK)
lines.gsub!(/#[^\n]*\n/m, "")
lines.gsub!(/\\\n/, ' ')
lines.split("\n").each do |line|
process_line(line)
end
end
end
private
# Process one logical line of makefile data.
def process_line(line)
file_tasks, args = line.split(':')
return if args.nil?
dependents = args.split.map { |d| respace(d) }
file_tasks.strip.split.each do |file_task|
file_task = respace(file_task)
file file_task => dependents
end
end
def respace(str)
str.gsub(/#{SPACE_MARK}/, ' ')
end
end
# Install the handler
Rake.application.add_loader('mf', MakefileLoader.new)
end
| module Rake
# Makefile loader to be used with the import file loader.
class MakefileLoader
include Rake::DSL
SPACE_MARK = "\0"
# Load the makefile dependencies in +fn+.
def load(fn)
lines = File.read fn
lines.gsub!(/\\ /, SPACE_MARK)
lines.gsub!(/#[^\n]*\n/m, "")
lines.gsub!(/\\\n/, ' ')
lines.each_line do |line|
process_line(line)
end
end
private
# Process one logical line of makefile data.
def process_line(line)
file_tasks, args = line.split(':', 2)
return if args.nil?
dependents = args.split.map { |d| respace(d) }
file_tasks.scan(/\S+/) do |file_task|
file_task = respace(file_task)
file file_task => dependents
end
end
def respace(str)
str.tr SPACE_MARK, ' '
end
end
# Install the handler
Rake.application.add_loader('mf', MakefileLoader.new)
end
| Deal with escaped spaces better. Ruby commit r22791 | Deal with escaped spaces better. Ruby commit r22791
| Ruby | mit | ipmobiletech/rake,codedogfish/rake,pjump/rake,ruby/rake,zzak/rake,taiganakagawa/rake,bentley/rake,ruby/rake,hsbt/rake,utilum/rake,jaustinhughey/rake,tmornini/rake,Vanzct/rake,esasse/rake,88rabbit/rake,hsbt/rake,envato/rake,askl56/rake,envato/rake | ruby | ## Code Before:
module Rake
# Makefile loader to be used with the import file loader.
class MakefileLoader
include Rake::DSL
SPACE_MARK = "__&NBSP;__"
# Load the makefile dependencies in +fn+.
def load(fn)
open(fn) do |mf|
lines = mf.read
lines.gsub!(/\\ /, SPACE_MARK)
lines.gsub!(/#[^\n]*\n/m, "")
lines.gsub!(/\\\n/, ' ')
lines.split("\n").each do |line|
process_line(line)
end
end
end
private
# Process one logical line of makefile data.
def process_line(line)
file_tasks, args = line.split(':')
return if args.nil?
dependents = args.split.map { |d| respace(d) }
file_tasks.strip.split.each do |file_task|
file_task = respace(file_task)
file file_task => dependents
end
end
def respace(str)
str.gsub(/#{SPACE_MARK}/, ' ')
end
end
# Install the handler
Rake.application.add_loader('mf', MakefileLoader.new)
end
## Instruction:
Deal with escaped spaces better. Ruby commit r22791
## Code After:
module Rake
# Makefile loader to be used with the import file loader.
class MakefileLoader
include Rake::DSL
SPACE_MARK = "\0"
# Load the makefile dependencies in +fn+.
def load(fn)
lines = File.read fn
lines.gsub!(/\\ /, SPACE_MARK)
lines.gsub!(/#[^\n]*\n/m, "")
lines.gsub!(/\\\n/, ' ')
lines.each_line do |line|
process_line(line)
end
end
private
# Process one logical line of makefile data.
def process_line(line)
file_tasks, args = line.split(':', 2)
return if args.nil?
dependents = args.split.map { |d| respace(d) }
file_tasks.scan(/\S+/) do |file_task|
file_task = respace(file_task)
file file_task => dependents
end
end
def respace(str)
str.tr SPACE_MARK, ' '
end
end
# Install the handler
Rake.application.add_loader('mf', MakefileLoader.new)
end
| module Rake
# Makefile loader to be used with the import file loader.
class MakefileLoader
include Rake::DSL
- SPACE_MARK = "__&NBSP;__"
? ^^^^^^^^^^
+ SPACE_MARK = "\0"
? ^^
# Load the makefile dependencies in +fn+.
def load(fn)
- open(fn) do |mf|
- lines = mf.read
? -- ^^
+ lines = File.read fn
? ^^^^ +++
- lines.gsub!(/\\ /, SPACE_MARK)
? --
+ lines.gsub!(/\\ /, SPACE_MARK)
- lines.gsub!(/#[^\n]*\n/m, "")
? --
+ lines.gsub!(/#[^\n]*\n/m, "")
- lines.gsub!(/\\\n/, ' ')
? --
+ lines.gsub!(/\\\n/, ' ')
- lines.split("\n").each do |line|
+ lines.each_line do |line|
- process_line(line)
? --
+ process_line(line)
- end
end
end
private
# Process one logical line of makefile data.
def process_line(line)
- file_tasks, args = line.split(':')
+ file_tasks, args = line.split(':', 2)
? +++
return if args.nil?
dependents = args.split.map { |d| respace(d) }
- file_tasks.strip.split.each do |file_task|
+ file_tasks.scan(/\S+/) do |file_task|
file_task = respace(file_task)
file file_task => dependents
end
end
def respace(str)
- str.gsub(/#{SPACE_MARK}/, ' ')
? ^^^^^^^^ -- -
+ str.tr SPACE_MARK, ' '
? ^^^
end
end
# Install the handler
Rake.application.add_loader('mf', MakefileLoader.new)
end | 22 | 0.52381 | 10 | 12 |
8469c72ddc1303c38a67730dba030be02c3e556c | .kitchen.yml | .kitchen.yml | driver:
name: vagrant
provisioner:
name: chef_zero
platforms:
- name: centos-5.10
- name: centos-6.5
- name: fedora-19
suites:
- name: default
run_list:
- recipe[yum::default]
| driver:
name: vagrant
provisioner:
name: chef_zero
platforms:
- name: centos-5.10
- name: centos-5.10-i386
- name: centos-6.5
- name: centos-6.5-i386
- name: fedora-19
- name: fedora-20
suites:
- name: default
run_list:
- recipe[yum::default]
| Expand test harness to encompass 32-bit boxes as well | [COOK-4417] Expand test harness to encompass 32-bit boxes as well
Signed-off-by: Sean OMeara <4025b808ec3cf11e3d5c9a1a3bd1e7c4003cb3a1@opscode.com>
| YAML | apache-2.0 | hippolin/yum-cookbook,mrb/yum,criteo-forks/yum,edmunds-chef/yum,autotraderuk/yum,autotraderuk/yum,edmunds-chef/yum,GannettDigital/chef-yum,hippolin/yum-cookbook,h4ck3rm1k3/yum,ketan/yum,vkhatri/yum,edmunds-chef/yum,juliandunn/yum,stan928/yum,mattray/yum,autotraderuk/yum,criteo-forks/yum,chef-cookbooks/yum,mattray/yum,stan928/yum,ikkyotech/OpsworksNodeAddons,hippolin/yum-cookbook,xacaxulu/yum,mrb/yum,xacaxulu/yum,ketan/yum,chef-cookbooks/yum,someara/yum,GannettDigital/chef-yum,mrb/yum,GannettDigital/chef-yum,h4ck3rm1k3/yum,h4ck3rm1k3/yum,ikkyotech/OpsworksNodeAddons,vkhatri/yum,xacaxulu/yum,mattray/yum,juliandunn/yum,vkhatri/yum,someara/yum,ketan/yum,stan928/yum,someara/yum | yaml | ## Code Before:
driver:
name: vagrant
provisioner:
name: chef_zero
platforms:
- name: centos-5.10
- name: centos-6.5
- name: fedora-19
suites:
- name: default
run_list:
- recipe[yum::default]
## Instruction:
[COOK-4417] Expand test harness to encompass 32-bit boxes as well
Signed-off-by: Sean OMeara <4025b808ec3cf11e3d5c9a1a3bd1e7c4003cb3a1@opscode.com>
## Code After:
driver:
name: vagrant
provisioner:
name: chef_zero
platforms:
- name: centos-5.10
- name: centos-5.10-i386
- name: centos-6.5
- name: centos-6.5-i386
- name: fedora-19
- name: fedora-20
suites:
- name: default
run_list:
- recipe[yum::default]
| driver:
name: vagrant
provisioner:
name: chef_zero
platforms:
- name: centos-5.10
+ - name: centos-5.10-i386
- name: centos-6.5
+ - name: centos-6.5-i386
- name: fedora-19
+ - name: fedora-20
suites:
- name: default
run_list:
- recipe[yum::default] | 3 | 0.2 | 3 | 0 |
76cfff508a619bcb17c91c7a9943fb8a2c6aa156 | generator/test/resources/generators/play2-client-generator-spec-errors-package.txt | generator/test/resources/generators/play2-client-generator-spec-errors-package.txt | package error {
import apidoc.models.json._
case class ErrorsResponse(
response: play.api.libs.ws.Response,
message: Option[String] = None
) extends Exception(message.getOrElse(response.status + ": " + response.body)){
import apidoc.models.json._
lazy val errors = response.json.as[scala.collection.immutable.Seq[apidoc.models.Error]]
}
}
| package error {
import apidoc.models.json._
case class ErrorsResponse(
response: play.api.libs.ws.Response,
message: Option[String] = None
) extends Exception(message.getOrElse(response.status + ": " + response.body)){
import apidoc.models.json._
lazy val errors = response.json.as[Seq[apidoc.models.Error]]
}
}
| Update test output for Seq | Update test output for Seq
| Text | mit | movio/apidoc,mbryzek/apidoc,gheine/apidoc,apicollective/apibuilder,mbryzek/apidoc,apicollective/apibuilder,apicollective/apibuilder,mbryzek/apidoc,Seanstoppable/apidoc,gheine/apidoc,Seanstoppable/apidoc,movio/apidoc,movio/apidoc,gheine/apidoc,Seanstoppable/apidoc | text | ## Code Before:
package error {
import apidoc.models.json._
case class ErrorsResponse(
response: play.api.libs.ws.Response,
message: Option[String] = None
) extends Exception(message.getOrElse(response.status + ": " + response.body)){
import apidoc.models.json._
lazy val errors = response.json.as[scala.collection.immutable.Seq[apidoc.models.Error]]
}
}
## Instruction:
Update test output for Seq
## Code After:
package error {
import apidoc.models.json._
case class ErrorsResponse(
response: play.api.libs.ws.Response,
message: Option[String] = None
) extends Exception(message.getOrElse(response.status + ": " + response.body)){
import apidoc.models.json._
lazy val errors = response.json.as[Seq[apidoc.models.Error]]
}
}
| package error {
import apidoc.models.json._
case class ErrorsResponse(
response: play.api.libs.ws.Response,
message: Option[String] = None
) extends Exception(message.getOrElse(response.status + ": " + response.body)){
import apidoc.models.json._
- lazy val errors = response.json.as[scala.collection.immutable.Seq[apidoc.models.Error]]
? ---------------------------
+ lazy val errors = response.json.as[Seq[apidoc.models.Error]]
}
} | 2 | 0.166667 | 1 | 1 |
d4cb8a0ffe0e54111a681f4d65b9a1c5cfb618a8 | README.md | README.md | jdleden
=======
[](https://gemnasium.com/jonge-democraten/jdleden)
This tool handles both department-spreadsheets and newsletter-subscriptions of the Jonge Democraten.
## Installation
```
$ git clone https://github.com/jonge-democraten/jdleden.git
$ virtualenv -p python3 env
$ source env/bin/activate
$ pip install -r requirements.txt
```
Copy `jdleden/local_settings_example.py`, name it `jdleden/local_settings.py` and set the settings inside.
## Configuration
All settings can be found in `local_settings.py`.
## Usage
Activate the virtual env before using any of the management commands below,
```
$ source env/bin/activate
```
Update members,
```
$ python manage.py updateleden old_list.xlsx new_list.xlsx
```
Update after change in departments,
```
$ source env/bin/activate
$ python manage.py afdelingrondschuif membesr_list.xlsx
```
See https://trac.jongedemocraten.nl/wiki/UpdateLedenlijst
| jdleden
=======
[](https://travis-ci.org/jonge-democraten/jdleden) [](https://coveralls.io/github/jonge-democraten/jdleden?branch=master) [](https://gemnasium.com/jonge-democraten/jdleden)
This tool handles both department-spreadsheets and newsletter-subscriptions of the Jonge Democraten.
## Installation
```
$ git clone https://github.com/jonge-democraten/jdleden.git
$ virtualenv -p python3 env
$ source env/bin/activate
$ pip install -r requirements.txt
```
Copy `jdleden/local_settings_example.py`, name it `jdleden/local_settings.py` and set the settings inside.
## Configuration
All settings can be found in `local_settings.py`.
## Usage
Activate the virtual env before using any of the management commands below,
```
$ source env/bin/activate
```
Update members,
```
$ python manage.py updateleden old_list.xlsx new_list.xlsx
```
Update after change in departments,
```
$ source env/bin/activate
$ python manage.py afdelingrondschuif membesr_list.xlsx
```
See https://trac.jongedemocraten.nl/wiki/UpdateLedenlijst
| Add travis-ci and coveralls badges to readme | Add travis-ci and coveralls badges to readme | Markdown | mit | jonge-democraten/jdleden,jonge-democraten/jdleden | markdown | ## Code Before:
jdleden
=======
[](https://gemnasium.com/jonge-democraten/jdleden)
This tool handles both department-spreadsheets and newsletter-subscriptions of the Jonge Democraten.
## Installation
```
$ git clone https://github.com/jonge-democraten/jdleden.git
$ virtualenv -p python3 env
$ source env/bin/activate
$ pip install -r requirements.txt
```
Copy `jdleden/local_settings_example.py`, name it `jdleden/local_settings.py` and set the settings inside.
## Configuration
All settings can be found in `local_settings.py`.
## Usage
Activate the virtual env before using any of the management commands below,
```
$ source env/bin/activate
```
Update members,
```
$ python manage.py updateleden old_list.xlsx new_list.xlsx
```
Update after change in departments,
```
$ source env/bin/activate
$ python manage.py afdelingrondschuif membesr_list.xlsx
```
See https://trac.jongedemocraten.nl/wiki/UpdateLedenlijst
## Instruction:
Add travis-ci and coveralls badges to readme
## Code After:
jdleden
=======
[](https://travis-ci.org/jonge-democraten/jdleden) [](https://coveralls.io/github/jonge-democraten/jdleden?branch=master) [](https://gemnasium.com/jonge-democraten/jdleden)
This tool handles both department-spreadsheets and newsletter-subscriptions of the Jonge Democraten.
## Installation
```
$ git clone https://github.com/jonge-democraten/jdleden.git
$ virtualenv -p python3 env
$ source env/bin/activate
$ pip install -r requirements.txt
```
Copy `jdleden/local_settings_example.py`, name it `jdleden/local_settings.py` and set the settings inside.
## Configuration
All settings can be found in `local_settings.py`.
## Usage
Activate the virtual env before using any of the management commands below,
```
$ source env/bin/activate
```
Update members,
```
$ python manage.py updateleden old_list.xlsx new_list.xlsx
```
Update after change in departments,
```
$ source env/bin/activate
$ python manage.py afdelingrondschuif membesr_list.xlsx
```
See https://trac.jongedemocraten.nl/wiki/UpdateLedenlijst
| jdleden
=======
- [](https://gemnasium.com/jonge-democraten/jdleden)
+ [](https://travis-ci.org/jonge-democraten/jdleden) [](https://coveralls.io/github/jonge-democraten/jdleden?branch=master) [](https://gemnasium.com/jonge-democraten/jdleden)
This tool handles both department-spreadsheets and newsletter-subscriptions of the Jonge Democraten.
## Installation
```
$ git clone https://github.com/jonge-democraten/jdleden.git
$ virtualenv -p python3 env
$ source env/bin/activate
$ pip install -r requirements.txt
```
Copy `jdleden/local_settings_example.py`, name it `jdleden/local_settings.py` and set the settings inside.
## Configuration
All settings can be found in `local_settings.py`.
## Usage
Activate the virtual env before using any of the management commands below,
```
$ source env/bin/activate
```
Update members,
```
$ python manage.py updateleden old_list.xlsx new_list.xlsx
```
Update after change in departments,
```
$ source env/bin/activate
$ python manage.py afdelingrondschuif membesr_list.xlsx
```
See https://trac.jongedemocraten.nl/wiki/UpdateLedenlijst | 2 | 0.051282 | 1 | 1 |
87b55c8a3c478fc8bb0c1ec159668bfd9310cbea | app/views/layouts/error.html.erb | app/views/layouts/error.html.erb | <% content_for :content do %>
<%= render 'shared/header' %>
<div class="l-constrained">
<main role="main">
<div class="l-error-page-message">
<%= yield %>
<%= render 'shared/directory', items: category_navigation %>
</div>
</main>
</div>
<footer class="l-footer">
<%= render 'shared/footer_social_links' %>
</footer>
<% end %>
<%= render template: 'layouts/base' %>
| <% content_for :content do %>
<%= render 'shared/header' %>
<div class="l-constrained">
<main role="main">
<div class="l-error-page-message">
<%= yield %>
</div>
<%= render 'shared/directory', items: category_navigation %>
</main>
</div>
<footer class="l-footer">
<%= render 'shared/footer_social_links' %>
</footer>
<% end %>
<%= render template: 'layouts/base' %>
| Move directory outside of container | Move directory outside of container
| HTML+ERB | mit | moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend | html+erb | ## Code Before:
<% content_for :content do %>
<%= render 'shared/header' %>
<div class="l-constrained">
<main role="main">
<div class="l-error-page-message">
<%= yield %>
<%= render 'shared/directory', items: category_navigation %>
</div>
</main>
</div>
<footer class="l-footer">
<%= render 'shared/footer_social_links' %>
</footer>
<% end %>
<%= render template: 'layouts/base' %>
## Instruction:
Move directory outside of container
## Code After:
<% content_for :content do %>
<%= render 'shared/header' %>
<div class="l-constrained">
<main role="main">
<div class="l-error-page-message">
<%= yield %>
</div>
<%= render 'shared/directory', items: category_navigation %>
</main>
</div>
<footer class="l-footer">
<%= render 'shared/footer_social_links' %>
</footer>
<% end %>
<%= render template: 'layouts/base' %>
| <% content_for :content do %>
<%= render 'shared/header' %>
<div class="l-constrained">
<main role="main">
<div class="l-error-page-message">
<%= yield %>
- <%= render 'shared/directory', items: category_navigation %>
</div>
+
+ <%= render 'shared/directory', items: category_navigation %>
</main>
</div>
<footer class="l-footer">
<%= render 'shared/footer_social_links' %>
</footer>
<% end %>
<%= render template: 'layouts/base' %> | 3 | 0.142857 | 2 | 1 |
f4dd8000473efd445076afab7ccbd9ac75a57e15 | README.md | README.md | Ruby on Rails, HTML, CSS
##Frameworks
JQuery, Materialize
##Link to the web
http://hankchentennis.com/
| Ruby on Rails, HTML, CSS, Javascript
##Frameworks and Libraries
JQuery, Materialize, C3.js, HAML
##Test-Driven Development
RSpec, Capybara
##Link to the web
http://hankchentennis.com/
| Make techs used list more plentiful | Make techs used list more plentiful | Markdown | mit | Hank860502/Personal-web,Hank860502/Personal-web,Hank860502/Personal-web | markdown | ## Code Before:
Ruby on Rails, HTML, CSS
##Frameworks
JQuery, Materialize
##Link to the web
http://hankchentennis.com/
## Instruction:
Make techs used list more plentiful
## Code After:
Ruby on Rails, HTML, CSS, Javascript
##Frameworks and Libraries
JQuery, Materialize, C3.js, HAML
##Test-Driven Development
RSpec, Capybara
##Link to the web
http://hankchentennis.com/
| - Ruby on Rails, HTML, CSS
+ Ruby on Rails, HTML, CSS, Javascript
? ++++++++++++
- ##Frameworks
- JQuery, Materialize
+ ##Frameworks and Libraries
+ JQuery, Materialize, C3.js, HAML
+
+ ##Test-Driven Development
+ RSpec, Capybara
##Link to the web
http://hankchentennis.com/ | 9 | 1.285714 | 6 | 3 |
09417c86960917cc241f4ef6a88580702fa1ea98 | 2019/joins/joins-multicolumn.sql | 2019/joins/joins-multicolumn.sql | -- Example like joins.sql but joining on multiple columns.
drop table if exists t1;
drop table if exists t2;
create table t1 (
id int primary key,
name text,
ranking int);
create table t2 (
code char(1) primary key,
id int,
ranking int);
insert into t1 values(1, 'Joanne', 7);
insert into t1 values(2, 'Sam', 7);
insert into t1 values(3, 'Emmanuel', 6);
insert into t1 values(4, 'Brayden', 2);
insert into t2 values('x', 2, 8);
insert into t2 values('z', 3, 6);
select * from t1 inner join t2 on t1.id = t2.id and t1.ranking = t2.ranking;
select * from t1 inner join t2 using (id, ranking);
select * from t1 natural inner join t2;
| -- Example like joins.sql but joining on multiple columns.
drop table if exists t1;
drop table if exists t2;
create table t1 (
id int primary key,
name text,
ranking int);
create table t2 (
code char(1) primary key,
id int,
ranking int);
insert into t1 values(1, 'Joanne', 7);
insert into t1 values(2, 'Sam', 7);
insert into t1 values(3, 'Emmanuel', 6);
insert into t1 values(4, 'Brayden', 2);
insert into t2 values('x', 2, 8);
insert into t2 values('z', 3, 6);
select * from t1;
select * from t2;
select * from t1 inner join t2 on t1.id = t2.id and t1.ranking = t2.ranking;
select * from t1 inner join t2 using (id, ranking);
select * from t1 natural inner join t2;
select * from t1 left outer join t2 using (id, ranking);
| Add more multicolumn sample lines | Add more multicolumn sample lines
| SQL | unlicense | eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog | sql | ## Code Before:
-- Example like joins.sql but joining on multiple columns.
drop table if exists t1;
drop table if exists t2;
create table t1 (
id int primary key,
name text,
ranking int);
create table t2 (
code char(1) primary key,
id int,
ranking int);
insert into t1 values(1, 'Joanne', 7);
insert into t1 values(2, 'Sam', 7);
insert into t1 values(3, 'Emmanuel', 6);
insert into t1 values(4, 'Brayden', 2);
insert into t2 values('x', 2, 8);
insert into t2 values('z', 3, 6);
select * from t1 inner join t2 on t1.id = t2.id and t1.ranking = t2.ranking;
select * from t1 inner join t2 using (id, ranking);
select * from t1 natural inner join t2;
## Instruction:
Add more multicolumn sample lines
## Code After:
-- Example like joins.sql but joining on multiple columns.
drop table if exists t1;
drop table if exists t2;
create table t1 (
id int primary key,
name text,
ranking int);
create table t2 (
code char(1) primary key,
id int,
ranking int);
insert into t1 values(1, 'Joanne', 7);
insert into t1 values(2, 'Sam', 7);
insert into t1 values(3, 'Emmanuel', 6);
insert into t1 values(4, 'Brayden', 2);
insert into t2 values('x', 2, 8);
insert into t2 values('z', 3, 6);
select * from t1;
select * from t2;
select * from t1 inner join t2 on t1.id = t2.id and t1.ranking = t2.ranking;
select * from t1 inner join t2 using (id, ranking);
select * from t1 natural inner join t2;
select * from t1 left outer join t2 using (id, ranking);
| -- Example like joins.sql but joining on multiple columns.
drop table if exists t1;
drop table if exists t2;
create table t1 (
id int primary key,
name text,
ranking int);
create table t2 (
code char(1) primary key,
id int,
ranking int);
insert into t1 values(1, 'Joanne', 7);
insert into t1 values(2, 'Sam', 7);
insert into t1 values(3, 'Emmanuel', 6);
insert into t1 values(4, 'Brayden', 2);
insert into t2 values('x', 2, 8);
insert into t2 values('z', 3, 6);
+ select * from t1;
+ select * from t2;
+
select * from t1 inner join t2 on t1.id = t2.id and t1.ranking = t2.ranking;
select * from t1 inner join t2 using (id, ranking);
select * from t1 natural inner join t2;
+
+
+ select * from t1 left outer join t2 using (id, ranking); | 6 | 0.24 | 6 | 0 |
2677c0c7a6c6e81d92b21b43b20c890de7e3ecb4 | README.md | README.md |
> CLI tool for register new posts on free-time
## Installation
Installing via NPM:
```sh
[sudo] npm i -g freetime-cli
```
## Usage
Just type on terminal:
```sh
freetime
```
## Questions
**Title:** Post title.
> Example: Talk Name
**Speaker:** Speaker's name.
> Example: John Doe
**Duration:** Talk duration.
> Example: 45min
**Tags:** Tags separated by commas.
> Example: NodeJS, Gulp, Automation
**Image Name:** Image name, located inside `/assets/image/speakers/`.
> Example: speaker-name.jpg
**URL:** Talk link
> Example: http://speackerdeck.com/user/talk-name
## License
[MIT](LICENSE.md) © Free-time
|
> CLI tool for register new posts on free-time
## Installation
Installing via NPM:
```sh
[sudo] npm i -g freetime-cli
```
## Usage
Just type on terminal, inside of `freetime` directory:
```sh
freetime
```
## Questions
**Title:** Post title.
> Example: Talk Name
**Speaker:** Speaker's name.
> Example: John Doe
**Duration:** Talk duration.
> Example: 45min
**Tags:** Tags separated by commas.
> Example: NodeJS, Gulp, Automation
**Image Name:** Image name, located inside `/assets/image/speakers/`.
> Example: speaker-name.jpg
**URL:** Talk link
> Example: http://speackerdeck.com/user/talk-name
## License
[MIT](LICENSE.md) © Free-time
| Add instructions to use freetime properly | Add instructions to use freetime properly
| Markdown | mit | fdaciuk/freetime-cli,free-time/freetime-cli | markdown | ## Code Before:
> CLI tool for register new posts on free-time
## Installation
Installing via NPM:
```sh
[sudo] npm i -g freetime-cli
```
## Usage
Just type on terminal:
```sh
freetime
```
## Questions
**Title:** Post title.
> Example: Talk Name
**Speaker:** Speaker's name.
> Example: John Doe
**Duration:** Talk duration.
> Example: 45min
**Tags:** Tags separated by commas.
> Example: NodeJS, Gulp, Automation
**Image Name:** Image name, located inside `/assets/image/speakers/`.
> Example: speaker-name.jpg
**URL:** Talk link
> Example: http://speackerdeck.com/user/talk-name
## License
[MIT](LICENSE.md) © Free-time
## Instruction:
Add instructions to use freetime properly
## Code After:
> CLI tool for register new posts on free-time
## Installation
Installing via NPM:
```sh
[sudo] npm i -g freetime-cli
```
## Usage
Just type on terminal, inside of `freetime` directory:
```sh
freetime
```
## Questions
**Title:** Post title.
> Example: Talk Name
**Speaker:** Speaker's name.
> Example: John Doe
**Duration:** Talk duration.
> Example: 45min
**Tags:** Tags separated by commas.
> Example: NodeJS, Gulp, Automation
**Image Name:** Image name, located inside `/assets/image/speakers/`.
> Example: speaker-name.jpg
**URL:** Talk link
> Example: http://speackerdeck.com/user/talk-name
## License
[MIT](LICENSE.md) © Free-time
|
> CLI tool for register new posts on free-time
## Installation
Installing via NPM:
```sh
[sudo] npm i -g freetime-cli
```
## Usage
- Just type on terminal:
+ Just type on terminal, inside of `freetime` directory:
```sh
freetime
```
## Questions
**Title:** Post title.
> Example: Talk Name
**Speaker:** Speaker's name.
> Example: John Doe
**Duration:** Talk duration.
> Example: 45min
**Tags:** Tags separated by commas.
> Example: NodeJS, Gulp, Automation
**Image Name:** Image name, located inside `/assets/image/speakers/`.
> Example: speaker-name.jpg
**URL:** Talk link
> Example: http://speackerdeck.com/user/talk-name
## License
[MIT](LICENSE.md) © Free-time | 2 | 0.041667 | 1 | 1 |
4c4a5419f2b3f32ec7a6d62e5114b32033b1acd2 | .eslintrc.yaml | .eslintrc.yaml | {
extends: [
'openlayers',
'.eslintrc-es6.yaml'
],
plugins: [
'googshift',
],
rules: {
'googshift/no-duplicate-requires': 'error',
'googshift/no-missing-requires': ['error', {
prefixes: ['olcs', 'ol']
}],
'googshift/no-unused-requires': 'error',
'googshift/one-provide-or-module': ['error', {
entryPoints: ['olcs'],
root: 'src'
}],
'googshift/requires-first': 'error',
'googshift/valid-provide-and-module': ['error', {
entryPoints: ['olcs'],
root: 'src'
}],
'googshift/valid-requires': 'error',
no-console: 0,
no-extra-boolean-cast: 0,
brace-style: 0,
no-multiple-empty-lines: 0,
valid-jsdoc: 0,
indent: [2, 2, {
VariableDeclarator: 2,
SwitchCase: 1,
MemberExpression: 2,
FunctionDeclaration: {
parameters: 2,
body: 1
},
FunctionExpression: {
parameters: 2,
body: 1
},
CallExpression: {
arguments: 2
}
}]
},
globals: {
ol: false,
goog: false,
Cesium: false,
olcs: false,
proj4: false
}
}
| {
root: true,
extends: [
'openlayers',
'.eslintrc-es6.yaml'
],
plugins: [
'googshift',
],
rules: {
'googshift/no-duplicate-requires': 'error',
'googshift/no-missing-requires': ['error', {
prefixes: ['olcs', 'ol']
}],
'googshift/no-unused-requires': 'error',
'googshift/one-provide-or-module': ['error', {
entryPoints: ['olcs'],
root: 'src'
}],
'googshift/requires-first': 'error',
'googshift/valid-provide-and-module': ['error', {
entryPoints: ['olcs'],
root: 'src'
}],
'googshift/valid-requires': 'error',
no-console: 0,
no-extra-boolean-cast: 0,
brace-style: 0,
no-multiple-empty-lines: 0,
valid-jsdoc: 0,
indent: [2, 2, {
VariableDeclarator: 2,
SwitchCase: 1,
MemberExpression: 2,
FunctionDeclaration: {
parameters: 2,
body: 1
},
FunctionExpression: {
parameters: 2,
body: 1
},
CallExpression: {
arguments: 2
}
}]
},
globals: {
ol: false,
goog: false,
Cesium: false,
olcs: false,
proj4: false
}
}
| Set the eslint as the root config file | Set the eslint as the root config file | YAML | bsd-2-clause | openlayers/ol-cesium,openlayers/ol3-cesium,openlayers/ol-cesium,openlayers/ol3-cesium | yaml | ## Code Before:
{
extends: [
'openlayers',
'.eslintrc-es6.yaml'
],
plugins: [
'googshift',
],
rules: {
'googshift/no-duplicate-requires': 'error',
'googshift/no-missing-requires': ['error', {
prefixes: ['olcs', 'ol']
}],
'googshift/no-unused-requires': 'error',
'googshift/one-provide-or-module': ['error', {
entryPoints: ['olcs'],
root: 'src'
}],
'googshift/requires-first': 'error',
'googshift/valid-provide-and-module': ['error', {
entryPoints: ['olcs'],
root: 'src'
}],
'googshift/valid-requires': 'error',
no-console: 0,
no-extra-boolean-cast: 0,
brace-style: 0,
no-multiple-empty-lines: 0,
valid-jsdoc: 0,
indent: [2, 2, {
VariableDeclarator: 2,
SwitchCase: 1,
MemberExpression: 2,
FunctionDeclaration: {
parameters: 2,
body: 1
},
FunctionExpression: {
parameters: 2,
body: 1
},
CallExpression: {
arguments: 2
}
}]
},
globals: {
ol: false,
goog: false,
Cesium: false,
olcs: false,
proj4: false
}
}
## Instruction:
Set the eslint as the root config file
## Code After:
{
root: true,
extends: [
'openlayers',
'.eslintrc-es6.yaml'
],
plugins: [
'googshift',
],
rules: {
'googshift/no-duplicate-requires': 'error',
'googshift/no-missing-requires': ['error', {
prefixes: ['olcs', 'ol']
}],
'googshift/no-unused-requires': 'error',
'googshift/one-provide-or-module': ['error', {
entryPoints: ['olcs'],
root: 'src'
}],
'googshift/requires-first': 'error',
'googshift/valid-provide-and-module': ['error', {
entryPoints: ['olcs'],
root: 'src'
}],
'googshift/valid-requires': 'error',
no-console: 0,
no-extra-boolean-cast: 0,
brace-style: 0,
no-multiple-empty-lines: 0,
valid-jsdoc: 0,
indent: [2, 2, {
VariableDeclarator: 2,
SwitchCase: 1,
MemberExpression: 2,
FunctionDeclaration: {
parameters: 2,
body: 1
},
FunctionExpression: {
parameters: 2,
body: 1
},
CallExpression: {
arguments: 2
}
}]
},
globals: {
ol: false,
goog: false,
Cesium: false,
olcs: false,
proj4: false
}
}
| {
+ root: true,
extends: [
'openlayers',
'.eslintrc-es6.yaml'
],
plugins: [
'googshift',
],
rules: {
'googshift/no-duplicate-requires': 'error',
'googshift/no-missing-requires': ['error', {
prefixes: ['olcs', 'ol']
}],
'googshift/no-unused-requires': 'error',
'googshift/one-provide-or-module': ['error', {
entryPoints: ['olcs'],
root: 'src'
}],
'googshift/requires-first': 'error',
'googshift/valid-provide-and-module': ['error', {
entryPoints: ['olcs'],
root: 'src'
}],
'googshift/valid-requires': 'error',
no-console: 0,
no-extra-boolean-cast: 0,
brace-style: 0,
no-multiple-empty-lines: 0,
valid-jsdoc: 0,
indent: [2, 2, {
VariableDeclarator: 2,
SwitchCase: 1,
MemberExpression: 2,
FunctionDeclaration: {
parameters: 2,
body: 1
},
FunctionExpression: {
parameters: 2,
body: 1
},
CallExpression: {
arguments: 2
}
}]
},
globals: {
ol: false,
goog: false,
Cesium: false,
olcs: false,
proj4: false
}
} | 1 | 0.016667 | 1 | 0 |
8d88bd3094ce8602fa5243eceeafb9ead60276ba | codebrag-rest/src/main/scala/ScalatraBootstrap.scala | codebrag-rest/src/main/scala/ScalatraBootstrap.scala | import com.softwaremill.codebrag.dao.MongoInit
import com.softwaremill.codebrag.rest._
import com.softwaremill.codebrag.Beans
import org.scalatra._
import javax.servlet.ServletContext
/**
* This is the ScalatraBootstrap codebrag file. You can use it to mount servlets or
* filters. It's also a good place to put initialization code which needs to
* run at application start (e.g. database configurations), and init params.
*/
class ScalatraBootstrap extends LifeCycle with Beans {
val Prefix = "/rest/"
override def init(context: ServletContext) {
MongoInit.initialize()
context.mount(new UptimeServlet, Prefix + "uptime")
context.mount(new UsersServlet(authenticator, swagger), Prefix + "users")
context.mount(new CommitsServlet(authenticator, commitListFinder, commentListFinder, commentActivity, commitReviewTaskDao, userDao, swagger, diffWithCommentsService, importerFactory), Prefix + CommitsServlet.MAPPING_PATH)
context.mount(new GithubAuthorizationServlet(authenticator, ghService, userDao), Prefix + "github")
context.mount(new FollowupsServlet(authenticator, swagger, followupFinder, followupService), Prefix + FollowupsServlet.MappingPath)
context.mount(new NotificationCountServlet(authenticator, swagger, notificationCountFinder), Prefix + NotificationCountServlet.MappingPath)
context.mount(new SwaggerApiDoc(swagger), Prefix + "api-docs/*")
context.put("codebrag", this)
}
}
| import com.softwaremill.codebrag.dao.MongoInit
import com.softwaremill.codebrag.rest._
import com.softwaremill.codebrag.Beans
import java.util.Locale
import org.scalatra._
import javax.servlet.ServletContext
/**
* This is the ScalatraBootstrap codebrag file. You can use it to mount servlets or
* filters. It's also a good place to put initialization code which needs to
* run at application start (e.g. database configurations), and init params.
*/
class ScalatraBootstrap extends LifeCycle with Beans {
val Prefix = "/rest/"
override def init(context: ServletContext) {
Locale.setDefault(Locale.US) // set default locale to prevent Scalatra from sending cookie expiration date in polish format :)
MongoInit.initialize()
context.mount(new UptimeServlet, Prefix + "uptime")
context.mount(new UsersServlet(authenticator, swagger), Prefix + "users")
context.mount(new CommitsServlet(authenticator, commitListFinder, commentListFinder, commentActivity, commitReviewTaskDao, userDao, swagger, diffWithCommentsService, importerFactory), Prefix + CommitsServlet.MAPPING_PATH)
context.mount(new GithubAuthorizationServlet(authenticator, ghService, userDao), Prefix + "github")
context.mount(new FollowupsServlet(authenticator, swagger, followupFinder, followupService), Prefix + FollowupsServlet.MappingPath)
context.mount(new NotificationCountServlet(authenticator, swagger, notificationCountFinder), Prefix + NotificationCountServlet.MappingPath)
context.mount(new SwaggerApiDoc(swagger), Prefix + "api-docs/*")
context.put("codebrag", this)
}
}
| Set default locale for scalatra to US | Set default locale for scalatra to US
| Scala | agpl-3.0 | cazacugmihai/codebrag,softwaremill/codebrag,cazacugmihai/codebrag,softwaremill/codebrag,cazacugmihai/codebrag,cazacugmihai/codebrag,cazacugmihai/codebrag,softwaremill/codebrag,softwaremill/codebrag | scala | ## Code Before:
import com.softwaremill.codebrag.dao.MongoInit
import com.softwaremill.codebrag.rest._
import com.softwaremill.codebrag.Beans
import org.scalatra._
import javax.servlet.ServletContext
/**
* This is the ScalatraBootstrap codebrag file. You can use it to mount servlets or
* filters. It's also a good place to put initialization code which needs to
* run at application start (e.g. database configurations), and init params.
*/
class ScalatraBootstrap extends LifeCycle with Beans {
val Prefix = "/rest/"
override def init(context: ServletContext) {
MongoInit.initialize()
context.mount(new UptimeServlet, Prefix + "uptime")
context.mount(new UsersServlet(authenticator, swagger), Prefix + "users")
context.mount(new CommitsServlet(authenticator, commitListFinder, commentListFinder, commentActivity, commitReviewTaskDao, userDao, swagger, diffWithCommentsService, importerFactory), Prefix + CommitsServlet.MAPPING_PATH)
context.mount(new GithubAuthorizationServlet(authenticator, ghService, userDao), Prefix + "github")
context.mount(new FollowupsServlet(authenticator, swagger, followupFinder, followupService), Prefix + FollowupsServlet.MappingPath)
context.mount(new NotificationCountServlet(authenticator, swagger, notificationCountFinder), Prefix + NotificationCountServlet.MappingPath)
context.mount(new SwaggerApiDoc(swagger), Prefix + "api-docs/*")
context.put("codebrag", this)
}
}
## Instruction:
Set default locale for scalatra to US
## Code After:
import com.softwaremill.codebrag.dao.MongoInit
import com.softwaremill.codebrag.rest._
import com.softwaremill.codebrag.Beans
import java.util.Locale
import org.scalatra._
import javax.servlet.ServletContext
/**
* This is the ScalatraBootstrap codebrag file. You can use it to mount servlets or
* filters. It's also a good place to put initialization code which needs to
* run at application start (e.g. database configurations), and init params.
*/
class ScalatraBootstrap extends LifeCycle with Beans {
val Prefix = "/rest/"
override def init(context: ServletContext) {
Locale.setDefault(Locale.US) // set default locale to prevent Scalatra from sending cookie expiration date in polish format :)
MongoInit.initialize()
context.mount(new UptimeServlet, Prefix + "uptime")
context.mount(new UsersServlet(authenticator, swagger), Prefix + "users")
context.mount(new CommitsServlet(authenticator, commitListFinder, commentListFinder, commentActivity, commitReviewTaskDao, userDao, swagger, diffWithCommentsService, importerFactory), Prefix + CommitsServlet.MAPPING_PATH)
context.mount(new GithubAuthorizationServlet(authenticator, ghService, userDao), Prefix + "github")
context.mount(new FollowupsServlet(authenticator, swagger, followupFinder, followupService), Prefix + FollowupsServlet.MappingPath)
context.mount(new NotificationCountServlet(authenticator, swagger, notificationCountFinder), Prefix + NotificationCountServlet.MappingPath)
context.mount(new SwaggerApiDoc(swagger), Prefix + "api-docs/*")
context.put("codebrag", this)
}
}
| import com.softwaremill.codebrag.dao.MongoInit
import com.softwaremill.codebrag.rest._
import com.softwaremill.codebrag.Beans
+ import java.util.Locale
import org.scalatra._
import javax.servlet.ServletContext
/**
* This is the ScalatraBootstrap codebrag file. You can use it to mount servlets or
* filters. It's also a good place to put initialization code which needs to
* run at application start (e.g. database configurations), and init params.
*/
class ScalatraBootstrap extends LifeCycle with Beans {
val Prefix = "/rest/"
override def init(context: ServletContext) {
+ Locale.setDefault(Locale.US) // set default locale to prevent Scalatra from sending cookie expiration date in polish format :)
MongoInit.initialize()
context.mount(new UptimeServlet, Prefix + "uptime")
context.mount(new UsersServlet(authenticator, swagger), Prefix + "users")
context.mount(new CommitsServlet(authenticator, commitListFinder, commentListFinder, commentActivity, commitReviewTaskDao, userDao, swagger, diffWithCommentsService, importerFactory), Prefix + CommitsServlet.MAPPING_PATH)
context.mount(new GithubAuthorizationServlet(authenticator, ghService, userDao), Prefix + "github")
context.mount(new FollowupsServlet(authenticator, swagger, followupFinder, followupService), Prefix + FollowupsServlet.MappingPath)
context.mount(new NotificationCountServlet(authenticator, swagger, notificationCountFinder), Prefix + NotificationCountServlet.MappingPath)
context.mount(new SwaggerApiDoc(swagger), Prefix + "api-docs/*")
context.put("codebrag", this)
}
} | 2 | 0.068966 | 2 | 0 |
9a225f4a5319b7801d4afa622baffd589d892c45 | .travis.yml | .travis.yml | language: python
python: 3.5
os:
- linux
env:
matrix:
- TOX_ENV=py27
- TOX_ENV=py33
- TOX_ENV=py34
- TOX_ENV=py35
- TOX_ENV=pep8
- TOX_ENV=py3pep8
install:
- ./.travis/install.sh
script:
- ./.travis/run.sh
after_success:
- ./.travis/upload_coverage.sh
| language: python
matrix:
include:
- python: 2.7
env: TOX_ENV=py27
- python: 3.3
env: TOX_ENV=py33
- python: 3.4
env: TOX_ENV=py34
- python: 3.5
env: TOX_ENV=py35
- python: 2.7
env: TOX_ENV=pep8
- python: 3.5
env: TOX_ENV=py3pep8
install:
- ./.travis/install.sh
script:
- ./.travis/run.sh
after_success:
- ./.travis/upload_coverage.sh
| Make TravisCI build matrix prettier. | Make TravisCI build matrix prettier.
| YAML | apache-2.0 | Ayrx/python-fastpbkdf2,Ayrx/python-fastpbkdf2 | yaml | ## Code Before:
language: python
python: 3.5
os:
- linux
env:
matrix:
- TOX_ENV=py27
- TOX_ENV=py33
- TOX_ENV=py34
- TOX_ENV=py35
- TOX_ENV=pep8
- TOX_ENV=py3pep8
install:
- ./.travis/install.sh
script:
- ./.travis/run.sh
after_success:
- ./.travis/upload_coverage.sh
## Instruction:
Make TravisCI build matrix prettier.
## Code After:
language: python
matrix:
include:
- python: 2.7
env: TOX_ENV=py27
- python: 3.3
env: TOX_ENV=py33
- python: 3.4
env: TOX_ENV=py34
- python: 3.5
env: TOX_ENV=py35
- python: 2.7
env: TOX_ENV=pep8
- python: 3.5
env: TOX_ENV=py3pep8
install:
- ./.travis/install.sh
script:
- ./.travis/run.sh
after_success:
- ./.travis/upload_coverage.sh
| language: python
- python: 3.5
- os:
- - linux
- env:
- matrix:
? ----
+ matrix:
+ include:
+ - python: 2.7
- - TOX_ENV=py27
? ^
+ env: TOX_ENV=py27
? ^^^^^^
+ - python: 3.3
- - TOX_ENV=py33
? ^
+ env: TOX_ENV=py33
? ^^^^^^
+ - python: 3.4
- - TOX_ENV=py34
? ^
+ env: TOX_ENV=py34
? ^^^^^^
+ - python: 3.5
- - TOX_ENV=py35
? ^
+ env: TOX_ENV=py35
? ^^^^^^
+ - python: 2.7
- - TOX_ENV=pep8
? ^
+ env: TOX_ENV=pep8
? ^^^^^^
+ - python: 3.5
- - TOX_ENV=py3pep8
? ^
+ env: TOX_ENV=py3pep8
? ^^^^^^
install:
- ./.travis/install.sh
script:
- ./.travis/run.sh
after_success:
- ./.travis/upload_coverage.sh | 25 | 1.136364 | 14 | 11 |
47dfa59d96e130d5444ce99c537002e3159175f6 | SQLite/Extensions/Cipher.swift | SQLite/Extensions/Cipher.swift | import SQLCipher
extension Connection {
public func key(_ key: String) throws {
try check(sqlite3_key(handle, key, Int32(key.utf8.count)))
try execute(
"CREATE TABLE \"__SQLCipher.swift__\" (\"cipher key check\");\n" +
"DROP TABLE \"__SQLCipher.swift__\";"
)
}
public func rekey(_ key: String) throws {
try check(sqlite3_rekey(handle, key, Int32(key.utf8.count)))
}
public func key(_ key: Blob) throws {
try check(sqlite3_key(handle, key.bytes, Int32(key.bytes.count)))
try execute(
"CREATE TABLE \"__SQLCipher.swift__\" (\"cipher key check\");\n" +
"DROP TABLE \"__SQLCipher.swift__\";"
)
}
public func rekey(_ key: Blob) throws {
try check(sqlite3_rekey(handle, key.bytes, Int32(key.bytes.count)))
}
}
#endif
| import SQLCipher
extension Connection {
public func key(_ key: String) throws {
try _key(keyPointer: key, keySize: key.utf8.count)
}
public func key(_ key: Blob) throws {
try _key(keyPointer: key.bytes, keySize: key.bytes.count)
}
public func rekey(_ key: String) throws {
try _rekey(keyPointer: key, keySize: key.utf8.count)
}
public func rekey(_ key: Blob) throws {
try _rekey(keyPointer: key.bytes, keySize: key.bytes.count)
}
// MARK: - private
private func _key(keyPointer: UnsafePointer<UInt8>, keySize: Int) throws {
try check(sqlite3_key(handle, keyPointer, Int32(keySize)))
try execute(
"CREATE TABLE \"__SQLCipher.swift__\" (\"cipher key check\");\n" +
"DROP TABLE \"__SQLCipher.swift__\";"
)
}
private func _rekey(keyPointer: UnsafePointer<UInt8>, keySize: Int) throws {
try check(sqlite3_rekey(handle, keyPointer, Int32(keySize)))
}
}
#endif
| Remove some duplication in key/rekey | Remove some duplication in key/rekey | Swift | mit | stephencelis/SQLite.swift,stephencelis/SQLite.swift,hyperconnect/SQLite.swift,stephencelis/SQLite.swift,hyperconnect/SQLite.swift,hyperconnect/SQLite.swift,stephencelis/SQLite.swift | swift | ## Code Before:
import SQLCipher
extension Connection {
public func key(_ key: String) throws {
try check(sqlite3_key(handle, key, Int32(key.utf8.count)))
try execute(
"CREATE TABLE \"__SQLCipher.swift__\" (\"cipher key check\");\n" +
"DROP TABLE \"__SQLCipher.swift__\";"
)
}
public func rekey(_ key: String) throws {
try check(sqlite3_rekey(handle, key, Int32(key.utf8.count)))
}
public func key(_ key: Blob) throws {
try check(sqlite3_key(handle, key.bytes, Int32(key.bytes.count)))
try execute(
"CREATE TABLE \"__SQLCipher.swift__\" (\"cipher key check\");\n" +
"DROP TABLE \"__SQLCipher.swift__\";"
)
}
public func rekey(_ key: Blob) throws {
try check(sqlite3_rekey(handle, key.bytes, Int32(key.bytes.count)))
}
}
#endif
## Instruction:
Remove some duplication in key/rekey
## Code After:
import SQLCipher
extension Connection {
public func key(_ key: String) throws {
try _key(keyPointer: key, keySize: key.utf8.count)
}
public func key(_ key: Blob) throws {
try _key(keyPointer: key.bytes, keySize: key.bytes.count)
}
public func rekey(_ key: String) throws {
try _rekey(keyPointer: key, keySize: key.utf8.count)
}
public func rekey(_ key: Blob) throws {
try _rekey(keyPointer: key.bytes, keySize: key.bytes.count)
}
// MARK: - private
private func _key(keyPointer: UnsafePointer<UInt8>, keySize: Int) throws {
try check(sqlite3_key(handle, keyPointer, Int32(keySize)))
try execute(
"CREATE TABLE \"__SQLCipher.swift__\" (\"cipher key check\");\n" +
"DROP TABLE \"__SQLCipher.swift__\";"
)
}
private func _rekey(keyPointer: UnsafePointer<UInt8>, keySize: Int) throws {
try check(sqlite3_rekey(handle, keyPointer, Int32(keySize)))
}
}
#endif
| import SQLCipher
extension Connection {
public func key(_ key: String) throws {
+ try _key(keyPointer: key, keySize: key.utf8.count)
+ }
+
+ public func key(_ key: Blob) throws {
+ try _key(keyPointer: key.bytes, keySize: key.bytes.count)
+ }
+
+ public func rekey(_ key: String) throws {
+ try _rekey(keyPointer: key, keySize: key.utf8.count)
+ }
+
+ public func rekey(_ key: Blob) throws {
+ try _rekey(keyPointer: key.bytes, keySize: key.bytes.count)
+ }
+
+ // MARK: - private
+ private func _key(keyPointer: UnsafePointer<UInt8>, keySize: Int) throws {
- try check(sqlite3_key(handle, key, Int32(key.utf8.count)))
? ^^^^^^^^^^^
+ try check(sqlite3_key(handle, keyPointer, Int32(keySize)))
? +++++++ ^^^^
try execute(
"CREATE TABLE \"__SQLCipher.swift__\" (\"cipher key check\");\n" +
"DROP TABLE \"__SQLCipher.swift__\";"
)
}
+ private func _rekey(keyPointer: UnsafePointer<UInt8>, keySize: Int) throws {
- public func rekey(_ key: String) throws {
- try check(sqlite3_rekey(handle, key, Int32(key.utf8.count)))
- }
-
- public func key(_ key: Blob) throws {
- try check(sqlite3_key(handle, key.bytes, Int32(key.bytes.count)))
- try execute(
- "CREATE TABLE \"__SQLCipher.swift__\" (\"cipher key check\");\n" +
- "DROP TABLE \"__SQLCipher.swift__\";"
- )
- }
-
- public func rekey(_ key: Blob) throws {
- try check(sqlite3_rekey(handle, key.bytes, Int32(key.bytes.count)))
? ^^^ ^ ^^^^ -------
+ try check(sqlite3_rekey(handle, keyPointer, Int32(keySize)))
? ^^^^ ^ ^^^
}
}
#endif | 35 | 1.25 | 20 | 15 |
99f0b6ff1264c1eb991ada99ddac01e2973f4bae | lib/celluloid/cpu_counter.rb | lib/celluloid/cpu_counter.rb | require 'rbconfig'
module Celluloid
module CPUCounter
case RbConfig::CONFIG['host_os'][/^[A-Za-z]+/]
when 'darwin'
@cores = Integer(`/usr/sbin/sysctl hw.ncpu`[/\d+/])
when 'linux'
@cores = if File.exists?("/sys/devices/system/cpu/present")
File.read("/sys/devices/system/cpu/present").split('-').last.to_i+1
else
Dir["/sys/devices/system/cpu/cpu*"].select { |n| n=~/cpu\d+/ }.count
end
when 'mingw', 'mswin'
@cores = Integer(ENV["NUMBER_OF_PROCESSORS"][/\d+/])
else
@cores = nil
end
def self.cores; @cores; end
end
end
| require 'rbconfig'
module Celluloid
module CPUCounter
case RbConfig::CONFIG['host_os'][/^[A-Za-z]+/]
when 'darwin'
@cores = Integer(`/usr/sbin/sysctl hw.ncpu`[/\d+/])
when 'linux'
@cores = if File.exists?("/sys/devices/system/cpu/present")
File.read("/sys/devices/system/cpu/present").split('-').last.to_i+1
else
Dir["/sys/devices/system/cpu/cpu*"].select { |n| n=~/cpu\d+/ }.count
end
when 'mingw', 'mswin'
@cores = Integer(ENV["NUMBER_OF_PROCESSORS"][/\d+/])
when 'freebsd'
@cores = Integer(`sysctl hw.ncpu`[/\d+/])
else
@cores = nil
end
def self.cores; @cores; end
end
end
| Add FreeBSD support to CPUCounter | Add FreeBSD support to CPUCounter
| Ruby | mit | celluloid/celluloid,jasonm23/celluloid,marshall-lee/celluloid,davydovanton/celluloid,kenichi/celluloid,olleolleolle/celluloid,jstoja/celluloid,dilumn/celluloid,TiagoCardoso1983/celluloid,seuros/celluloid,sideci-sample/sideci-sample-celluloid | ruby | ## Code Before:
require 'rbconfig'
module Celluloid
module CPUCounter
case RbConfig::CONFIG['host_os'][/^[A-Za-z]+/]
when 'darwin'
@cores = Integer(`/usr/sbin/sysctl hw.ncpu`[/\d+/])
when 'linux'
@cores = if File.exists?("/sys/devices/system/cpu/present")
File.read("/sys/devices/system/cpu/present").split('-').last.to_i+1
else
Dir["/sys/devices/system/cpu/cpu*"].select { |n| n=~/cpu\d+/ }.count
end
when 'mingw', 'mswin'
@cores = Integer(ENV["NUMBER_OF_PROCESSORS"][/\d+/])
else
@cores = nil
end
def self.cores; @cores; end
end
end
## Instruction:
Add FreeBSD support to CPUCounter
## Code After:
require 'rbconfig'
module Celluloid
module CPUCounter
case RbConfig::CONFIG['host_os'][/^[A-Za-z]+/]
when 'darwin'
@cores = Integer(`/usr/sbin/sysctl hw.ncpu`[/\d+/])
when 'linux'
@cores = if File.exists?("/sys/devices/system/cpu/present")
File.read("/sys/devices/system/cpu/present").split('-').last.to_i+1
else
Dir["/sys/devices/system/cpu/cpu*"].select { |n| n=~/cpu\d+/ }.count
end
when 'mingw', 'mswin'
@cores = Integer(ENV["NUMBER_OF_PROCESSORS"][/\d+/])
when 'freebsd'
@cores = Integer(`sysctl hw.ncpu`[/\d+/])
else
@cores = nil
end
def self.cores; @cores; end
end
end
| require 'rbconfig'
module Celluloid
module CPUCounter
case RbConfig::CONFIG['host_os'][/^[A-Za-z]+/]
when 'darwin'
@cores = Integer(`/usr/sbin/sysctl hw.ncpu`[/\d+/])
when 'linux'
@cores = if File.exists?("/sys/devices/system/cpu/present")
File.read("/sys/devices/system/cpu/present").split('-').last.to_i+1
else
Dir["/sys/devices/system/cpu/cpu*"].select { |n| n=~/cpu\d+/ }.count
end
when 'mingw', 'mswin'
@cores = Integer(ENV["NUMBER_OF_PROCESSORS"][/\d+/])
+ when 'freebsd'
+ @cores = Integer(`sysctl hw.ncpu`[/\d+/])
else
@cores = nil
end
def self.cores; @cores; end
end
end
| 2 | 0.083333 | 2 | 0 |
f532796a4c8b443a074ef7060d68d83d05a31630 | src/bin/cabal-system-reset/cabal-system-reset.sh | src/bin/cabal-system-reset/cabal-system-reset.sh |
set -e
cd "$HOME"
cabal=$HOME/.cabal
ghc=$HOME/.ghc
hackage=$HOME/.hackage
rm -fr $cabal $ghc $hackage
git diff -R --binary -- $cabal $ghc $hackage | git apply
src=$HOME/src/haskell
mkdir -pv $hackage/repo/package
ln -v $src/*/dist/*.tar.gz $hackage/repo/package
hackage-repo-tool create-keys --keys $hackage/keys
hackage-repo-tool bootstrap --keys $hackage/keys --repo $hackage/repo
hackage-repo-tool update --keys $hackage/keys --repo $hackage/repo
mkdir -pv $cabal/packages/local
cabal update
cabal install hscolour # must be installed first
cabal install `cat $cabal.world`
|
set -e
cd "$HOME"
cabal=$HOME/.cabal
ghc=$HOME/.ghc
hackage=$HOME/.hackage
rm -fr $cabal $ghc $hackage
git diff -R --binary -- $cabal $ghc $hackage | git apply
src=$HOME/src/haskell
mkdir -pv $hackage/repo/package
ln -v $src/*/dist/*.tar.gz $hackage/repo/package
hackage-repo-tool create-keys --keys $hackage/keys
hackage-repo-tool bootstrap --keys $hackage/keys --repo $hackage/repo
hackage-repo-tool update --keys $hackage/keys --repo $hackage/repo
mkdir -pv $cabal/packages/local
cabal update
for package in `cat $cabal.world`; do
case $package in /*) ;; *) continue ;; esac
test -d $package || continue
(cd $package && exec cabal clean)
done
cabal install hscolour # must be installed first
cabal install `cat $cabal.world`
| Clean local package directories when resetting | cabal: Clean local package directories when resetting
| Shell | bsd-3-clause | dragonmaus/home,dragonmaus/home,dragonmaus/home,dragonmaus/home,dragonmaus/home,dragonmaus/home | shell | ## Code Before:
set -e
cd "$HOME"
cabal=$HOME/.cabal
ghc=$HOME/.ghc
hackage=$HOME/.hackage
rm -fr $cabal $ghc $hackage
git diff -R --binary -- $cabal $ghc $hackage | git apply
src=$HOME/src/haskell
mkdir -pv $hackage/repo/package
ln -v $src/*/dist/*.tar.gz $hackage/repo/package
hackage-repo-tool create-keys --keys $hackage/keys
hackage-repo-tool bootstrap --keys $hackage/keys --repo $hackage/repo
hackage-repo-tool update --keys $hackage/keys --repo $hackage/repo
mkdir -pv $cabal/packages/local
cabal update
cabal install hscolour # must be installed first
cabal install `cat $cabal.world`
## Instruction:
cabal: Clean local package directories when resetting
## Code After:
set -e
cd "$HOME"
cabal=$HOME/.cabal
ghc=$HOME/.ghc
hackage=$HOME/.hackage
rm -fr $cabal $ghc $hackage
git diff -R --binary -- $cabal $ghc $hackage | git apply
src=$HOME/src/haskell
mkdir -pv $hackage/repo/package
ln -v $src/*/dist/*.tar.gz $hackage/repo/package
hackage-repo-tool create-keys --keys $hackage/keys
hackage-repo-tool bootstrap --keys $hackage/keys --repo $hackage/repo
hackage-repo-tool update --keys $hackage/keys --repo $hackage/repo
mkdir -pv $cabal/packages/local
cabal update
for package in `cat $cabal.world`; do
case $package in /*) ;; *) continue ;; esac
test -d $package || continue
(cd $package && exec cabal clean)
done
cabal install hscolour # must be installed first
cabal install `cat $cabal.world`
|
set -e
cd "$HOME"
cabal=$HOME/.cabal
ghc=$HOME/.ghc
hackage=$HOME/.hackage
rm -fr $cabal $ghc $hackage
git diff -R --binary -- $cabal $ghc $hackage | git apply
src=$HOME/src/haskell
mkdir -pv $hackage/repo/package
ln -v $src/*/dist/*.tar.gz $hackage/repo/package
hackage-repo-tool create-keys --keys $hackage/keys
hackage-repo-tool bootstrap --keys $hackage/keys --repo $hackage/repo
hackage-repo-tool update --keys $hackage/keys --repo $hackage/repo
mkdir -pv $cabal/packages/local
cabal update
+ for package in `cat $cabal.world`; do
+ case $package in /*) ;; *) continue ;; esac
+ test -d $package || continue
+ (cd $package && exec cabal clean)
+ done
+
cabal install hscolour # must be installed first
cabal install `cat $cabal.world` | 6 | 0.222222 | 6 | 0 |
c6ca20b835f4bb57706d155087dffc563c2fc54a | README.md | README.md |
A thin wrapper around Finagle & Twitter Future
## Building
lein sub install
lein install # in lein-finagle-clojure & finagle-clojure-template
## Create a new project
lein new finagle-clojure project-name
## Libraries
* `core` convenience fns for interacting with Futures
* `thrift` create Thrift clients & servers
## Documentation
* [Overview](doc/intro.md)
* [API Docs](doc/codox/index.html)
|
A thin wrapper around Finagle & Twitter Future
## Building
lein sub install
lein sub -s "lein-finagle-clojure:finagle-clojure-template" install
## Create a new project
lein new finagle-clojure project-name
## Libraries
* `core` convenience fns for interacting with Futures
* `thrift` create Thrift clients & servers
## Documentation
* [Overview](doc/intro.md)
* [API Docs](doc/codox/index.html)
| Improve instructions for building plugin & template | Improve instructions for building plugin & template
| Markdown | apache-2.0 | bguthrie/finagle-clojure,finagle/finagle-clojure | markdown | ## Code Before:
A thin wrapper around Finagle & Twitter Future
## Building
lein sub install
lein install # in lein-finagle-clojure & finagle-clojure-template
## Create a new project
lein new finagle-clojure project-name
## Libraries
* `core` convenience fns for interacting with Futures
* `thrift` create Thrift clients & servers
## Documentation
* [Overview](doc/intro.md)
* [API Docs](doc/codox/index.html)
## Instruction:
Improve instructions for building plugin & template
## Code After:
A thin wrapper around Finagle & Twitter Future
## Building
lein sub install
lein sub -s "lein-finagle-clojure:finagle-clojure-template" install
## Create a new project
lein new finagle-clojure project-name
## Libraries
* `core` convenience fns for interacting with Futures
* `thrift` create Thrift clients & servers
## Documentation
* [Overview](doc/intro.md)
* [API Docs](doc/codox/index.html)
|
A thin wrapper around Finagle & Twitter Future
## Building
lein sub install
- lein install # in lein-finagle-clojure & finagle-clojure-template
? -- ^^^^ ^ ^^^ ^^^
+ lein sub -s "lein-finagle-clojure:finagle-clojure-template" install
? ^^ ^^ ^ ^ +++++++++
## Create a new project
lein new finagle-clojure project-name
## Libraries
* `core` convenience fns for interacting with Futures
* `thrift` create Thrift clients & servers
## Documentation
* [Overview](doc/intro.md)
* [API Docs](doc/codox/index.html) | 2 | 0.095238 | 1 | 1 |
99f41b19926644e1317d6a7d292bc26b90e72cf9 | resources/views/errors/503.blade.php | resources/views/errors/503.blade.php | <html>
<head>
<link href='//fonts.googleapis.com/css?family=Lato:100' rel='stylesheet' type='text/css'>
<style>
body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
color: #B0BEC5;
display: table;
font-weight: 100;
font-family: 'Lato';
}
.container {
text-align: center;
display: table-cell;
vertical-align: middle;
}
.content {
text-align: center;
display: inline-block;
}
.title {
font-size: 72px;
margin-bottom: 40px;
}
</style>
</head>
<body>
<div class="container">
<div class="content">
<div class="title">Be right back.</div>
</div>
</div>
</body>
</html>
| <html>
<head>
<link href='//fonts.googleapis.com/css?family=Lato:100' rel='stylesheet' type='text/css'>
<style>
body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
color: #B0BEC5;
display: table;
font-weight: 100;
font-family: 'Lato';
}
.container {
text-align: center;
display: table-cell;
vertical-align: middle;
}
.content {
text-align: center;
display: inline-block;
}
.title {
font-size: 72px;
margin-bottom: 40px;
}
.brand {
font-weight: bold;
font-size: 24px;
margin-bottom: 40px;
}
</style>
</head>
<body>
<div class="container">
<div class="content">
<div class="title">Be right back.</div>
<div class="title">Enseguida volvemos.</div>
<div class="brand">timegrid.io</div>
</div>
</div>
</body>
</html>
| Add branding and spanish wording | Add branding and spanish wording | PHP | agpl-3.0 | alariva/timegrid,timegridio/timegrid,alariva/timegrid,alariva/timegrid,alariva/timegrid,timegridio/timegrid,timegridio/timegrid | php | ## Code Before:
<html>
<head>
<link href='//fonts.googleapis.com/css?family=Lato:100' rel='stylesheet' type='text/css'>
<style>
body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
color: #B0BEC5;
display: table;
font-weight: 100;
font-family: 'Lato';
}
.container {
text-align: center;
display: table-cell;
vertical-align: middle;
}
.content {
text-align: center;
display: inline-block;
}
.title {
font-size: 72px;
margin-bottom: 40px;
}
</style>
</head>
<body>
<div class="container">
<div class="content">
<div class="title">Be right back.</div>
</div>
</div>
</body>
</html>
## Instruction:
Add branding and spanish wording
## Code After:
<html>
<head>
<link href='//fonts.googleapis.com/css?family=Lato:100' rel='stylesheet' type='text/css'>
<style>
body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
color: #B0BEC5;
display: table;
font-weight: 100;
font-family: 'Lato';
}
.container {
text-align: center;
display: table-cell;
vertical-align: middle;
}
.content {
text-align: center;
display: inline-block;
}
.title {
font-size: 72px;
margin-bottom: 40px;
}
.brand {
font-weight: bold;
font-size: 24px;
margin-bottom: 40px;
}
</style>
</head>
<body>
<div class="container">
<div class="content">
<div class="title">Be right back.</div>
<div class="title">Enseguida volvemos.</div>
<div class="brand">timegrid.io</div>
</div>
</div>
</body>
</html>
| <html>
<head>
<link href='//fonts.googleapis.com/css?family=Lato:100' rel='stylesheet' type='text/css'>
<style>
body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
color: #B0BEC5;
display: table;
font-weight: 100;
font-family: 'Lato';
}
.container {
text-align: center;
display: table-cell;
vertical-align: middle;
}
.content {
text-align: center;
display: inline-block;
}
.title {
font-size: 72px;
margin-bottom: 40px;
}
+
+ .brand {
+ font-weight: bold;
+ font-size: 24px;
+ margin-bottom: 40px;
+ }
</style>
</head>
<body>
<div class="container">
<div class="content">
<div class="title">Be right back.</div>
+ <div class="title">Enseguida volvemos.</div>
+ <div class="brand">timegrid.io</div>
</div>
</div>
</body>
</html> | 8 | 0.195122 | 8 | 0 |
37e6a296b09b6fa5a2297ffe7e39d28f86cedcb8 | config.toml | config.toml | siteTitle="Big L Driving School"
siteDescription="Pass with safe driving skill"
linkPrefix = "/bigl-site"
| siteTitle="Big L Driving School"
siteDescription="Pass with safe driving skill"
linkPrefix = ""
| Modify linkPrefix to empty string fix dns issues | Modify linkPrefix to empty string fix dns issues
| TOML | mit | jishaal/bigl-site | toml | ## Code Before:
siteTitle="Big L Driving School"
siteDescription="Pass with safe driving skill"
linkPrefix = "/bigl-site"
## Instruction:
Modify linkPrefix to empty string fix dns issues
## Code After:
siteTitle="Big L Driving School"
siteDescription="Pass with safe driving skill"
linkPrefix = ""
| siteTitle="Big L Driving School"
siteDescription="Pass with safe driving skill"
- linkPrefix = "/bigl-site"
? ----------
+ linkPrefix = "" | 2 | 0.5 | 1 | 1 |
921b07de15deeb9b392aed9c0fe3aa92d4a592ac | src/redirects.js | src/redirects.js | export function setupRedirects(server) {
server.route({
method: 'GET',
path: '/blog/modified/{year}',
handler: function (request, reply) {
reply.redirect(`/blog/posted/${request.params.year}`).permanent();
}
});
// Note that I'm intentionally not using the stripTrailingSlash: true option because it
// simply serves a second endpoint which is bad for PR juice. 301 is better.
const maxDepth = 6;
let handler = (request, reply) => reply.redirect(`/${request.params.p}`).permanent();
for (var i = 1; i <= maxDepth; i++) {
server.route({
method: 'GET',
path: `/{p*${i}}/`,
handler,
});
}
}
| export function setupRedirects(server) {
server.route({
method: 'GET',
path: '/blog/modified/{year}',
handler: function (request, reply) {
reply.redirect(`/blog/posted/${request.params.year}`).permanent();
}
});
server.route({
method: 'GET',
path: '/blog/id/{id}',
handler: function (request, reply) {
reply.redirect(`/blog/${request.params.id}`).permanent();
}
});
// Note that I'm intentionally not using the stripTrailingSlash: true option because it
// simply serves a second endpoint which is bad for PR juice. 301 is better.
const maxDepth = 6;
let handler = (request, reply) => reply.redirect(`/${request.params.p}`).permanent();
for (var i = 1; i <= maxDepth; i++) {
server.route({
method: 'GET',
path: `/{p*${i}}/`,
handler,
});
}
}
| Support /blog/id/{id} redirect to /blog/{id} | Support /blog/id/{id} redirect to /blog/{id}
| JavaScript | mit | bbondy/brianbondy.node,bbondy/brianbondy.node,bbondy/brianbondy.node | javascript | ## Code Before:
export function setupRedirects(server) {
server.route({
method: 'GET',
path: '/blog/modified/{year}',
handler: function (request, reply) {
reply.redirect(`/blog/posted/${request.params.year}`).permanent();
}
});
// Note that I'm intentionally not using the stripTrailingSlash: true option because it
// simply serves a second endpoint which is bad for PR juice. 301 is better.
const maxDepth = 6;
let handler = (request, reply) => reply.redirect(`/${request.params.p}`).permanent();
for (var i = 1; i <= maxDepth; i++) {
server.route({
method: 'GET',
path: `/{p*${i}}/`,
handler,
});
}
}
## Instruction:
Support /blog/id/{id} redirect to /blog/{id}
## Code After:
export function setupRedirects(server) {
server.route({
method: 'GET',
path: '/blog/modified/{year}',
handler: function (request, reply) {
reply.redirect(`/blog/posted/${request.params.year}`).permanent();
}
});
server.route({
method: 'GET',
path: '/blog/id/{id}',
handler: function (request, reply) {
reply.redirect(`/blog/${request.params.id}`).permanent();
}
});
// Note that I'm intentionally not using the stripTrailingSlash: true option because it
// simply serves a second endpoint which is bad for PR juice. 301 is better.
const maxDepth = 6;
let handler = (request, reply) => reply.redirect(`/${request.params.p}`).permanent();
for (var i = 1; i <= maxDepth; i++) {
server.route({
method: 'GET',
path: `/{p*${i}}/`,
handler,
});
}
}
| export function setupRedirects(server) {
server.route({
method: 'GET',
path: '/blog/modified/{year}',
handler: function (request, reply) {
reply.redirect(`/blog/posted/${request.params.year}`).permanent();
+ }
+ });
+
+ server.route({
+ method: 'GET',
+ path: '/blog/id/{id}',
+ handler: function (request, reply) {
+ reply.redirect(`/blog/${request.params.id}`).permanent();
}
});
// Note that I'm intentionally not using the stripTrailingSlash: true option because it
// simply serves a second endpoint which is bad for PR juice. 301 is better.
const maxDepth = 6;
let handler = (request, reply) => reply.redirect(`/${request.params.p}`).permanent();
for (var i = 1; i <= maxDepth; i++) {
server.route({
method: 'GET',
path: `/{p*${i}}/`,
handler,
});
}
} | 8 | 0.363636 | 8 | 0 |
d0ae10616c037f6f39067dd0d6c76602032817aa | authenticate.js | authenticate.js | const alfy = require('alfy');
const bitbucket = require('./bitbucket/core').bitbucket;
const { clientId, secret } = process.env;
const ACCESS_TOKEN = 'access_token';
const GRANT_TYPE = 'client_credentials';
const ALIVE_TIME = 216000;
const URL = 'https://bitbucket.org/site/oauth2/access_token';
const OPTIONS = {
auth: [clientId, secret].join(':'),
json: true,
method: 'POST',
body: {
grant_type: GRANT_TYPE
},
form: true
};
const loginAttempt = () => {
return new Promise((resolve, _reject) => {
if (!clientId || !secret) {
alfy.error('OAuth2 not set. Refer to README for details');
} else {
const accessToken = alfy.cache.get(ACCESS_TOKEN);
if (accessToken) {
resolve(bitbucket(accessToken));
} else {
alfy.fetch(URL, OPTIONS).then(({ access_token }) => {
alfy.cache.set(ACCESS_TOKEN, access_token, { maxAge: ALIVE_TIME });
resolve(bitbucket(access_token));
}).catch(() => {
alfy.cache.set(ACCESS_TOKEN, null);
});
}
}
});
};
module.exports = loginAttempt;
| const alfy = require('alfy');
const bitbucket = require('./bitbucket/core').bitbucket;
const {clientId, secret, appPassword, username} = process.env;
const ACCESS_TOKEN = 'access_token';
const GRANT_TYPE = 'client_credentials';
const ALIVE_TIME = 216000;
const URL = 'https://bitbucket.org/site/oauth2/access_token';
const OPTIONS = {
auth: [clientId, secret].join(':'),
json: true,
method: 'POST',
body: {
grant_type: GRANT_TYPE
},
form: true
};
const loginAttempt = () => {
return new Promise((resolve, _reject) => {
if ((!username || !appPassword) && (!clientId || !secret)) {
return alfy.error('OAuth2 not set. Refer to README for details');
}
if (username && appPassword) {
return resolve(bitbucket(`Basic ${Buffer.from([username, appPassword].join(':')).toString('base64')}`));
}
const accessToken = alfy.cache.get(ACCESS_TOKEN);
if (accessToken) {
return resolve(bitbucket(accessToken));
}
alfy.fetch(URL, OPTIONS)
.then(({access_token}) => {
const authToken = `Bearer ${access_token}`;
alfy.cache.set(ACCESS_TOKEN, authToken, {
maxAge: ALIVE_TIME
});
resolve(bitbucket(authToken));
})
.catch(() => alfy.cache.set(ACCESS_TOKEN, null));
});
};
module.exports = loginAttempt;
| Add support for app passwords | Add support for app passwords | JavaScript | mit | nicklayb/alfred-bitbucket | javascript | ## Code Before:
const alfy = require('alfy');
const bitbucket = require('./bitbucket/core').bitbucket;
const { clientId, secret } = process.env;
const ACCESS_TOKEN = 'access_token';
const GRANT_TYPE = 'client_credentials';
const ALIVE_TIME = 216000;
const URL = 'https://bitbucket.org/site/oauth2/access_token';
const OPTIONS = {
auth: [clientId, secret].join(':'),
json: true,
method: 'POST',
body: {
grant_type: GRANT_TYPE
},
form: true
};
const loginAttempt = () => {
return new Promise((resolve, _reject) => {
if (!clientId || !secret) {
alfy.error('OAuth2 not set. Refer to README for details');
} else {
const accessToken = alfy.cache.get(ACCESS_TOKEN);
if (accessToken) {
resolve(bitbucket(accessToken));
} else {
alfy.fetch(URL, OPTIONS).then(({ access_token }) => {
alfy.cache.set(ACCESS_TOKEN, access_token, { maxAge: ALIVE_TIME });
resolve(bitbucket(access_token));
}).catch(() => {
alfy.cache.set(ACCESS_TOKEN, null);
});
}
}
});
};
module.exports = loginAttempt;
## Instruction:
Add support for app passwords
## Code After:
const alfy = require('alfy');
const bitbucket = require('./bitbucket/core').bitbucket;
const {clientId, secret, appPassword, username} = process.env;
const ACCESS_TOKEN = 'access_token';
const GRANT_TYPE = 'client_credentials';
const ALIVE_TIME = 216000;
const URL = 'https://bitbucket.org/site/oauth2/access_token';
const OPTIONS = {
auth: [clientId, secret].join(':'),
json: true,
method: 'POST',
body: {
grant_type: GRANT_TYPE
},
form: true
};
const loginAttempt = () => {
return new Promise((resolve, _reject) => {
if ((!username || !appPassword) && (!clientId || !secret)) {
return alfy.error('OAuth2 not set. Refer to README for details');
}
if (username && appPassword) {
return resolve(bitbucket(`Basic ${Buffer.from([username, appPassword].join(':')).toString('base64')}`));
}
const accessToken = alfy.cache.get(ACCESS_TOKEN);
if (accessToken) {
return resolve(bitbucket(accessToken));
}
alfy.fetch(URL, OPTIONS)
.then(({access_token}) => {
const authToken = `Bearer ${access_token}`;
alfy.cache.set(ACCESS_TOKEN, authToken, {
maxAge: ALIVE_TIME
});
resolve(bitbucket(authToken));
})
.catch(() => alfy.cache.set(ACCESS_TOKEN, null));
});
};
module.exports = loginAttempt;
| const alfy = require('alfy');
const bitbucket = require('./bitbucket/core').bitbucket;
- const { clientId, secret } = process.env;
? -
+ const {clientId, secret, appPassword, username} = process.env;
? + +++++++++++++++++++++
const ACCESS_TOKEN = 'access_token';
const GRANT_TYPE = 'client_credentials';
const ALIVE_TIME = 216000;
const URL = 'https://bitbucket.org/site/oauth2/access_token';
const OPTIONS = {
auth: [clientId, secret].join(':'),
json: true,
method: 'POST',
body: {
grant_type: GRANT_TYPE
},
form: true
};
const loginAttempt = () => {
return new Promise((resolve, _reject) => {
- if (!clientId || !secret) {
+ if ((!username || !appPassword) && (!clientId || !secret)) {
- alfy.error('OAuth2 not set. Refer to README for details');
+ return alfy.error('OAuth2 not set. Refer to README for details');
? +++++++
- } else {
+ }
+
+ if (username && appPassword) {
+ return resolve(bitbucket(`Basic ${Buffer.from([username, appPassword].join(':')).toString('base64')}`));
+ }
+
- const accessToken = alfy.cache.get(ACCESS_TOKEN);
? ----
+ const accessToken = alfy.cache.get(ACCESS_TOKEN);
+
- if (accessToken) {
? ----
+ if (accessToken) {
- resolve(bitbucket(accessToken));
? ^^^
+ return resolve(bitbucket(accessToken));
? ^^^^^^
- } else {
- alfy.fetch(URL, OPTIONS).then(({ access_token }) => {
- alfy.cache.set(ACCESS_TOKEN, access_token, { maxAge: ALIVE_TIME });
- resolve(bitbucket(access_token));
- }).catch(() => {
+ }
+
+ alfy.fetch(URL, OPTIONS)
+ .then(({access_token}) => {
+ const authToken = `Bearer ${access_token}`;
+
- alfy.cache.set(ACCESS_TOKEN, null);
? ---- ^^^^^
+ alfy.cache.set(ACCESS_TOKEN, authToken, {
? ++++++++ ^^^
+ maxAge: ALIVE_TIME
});
+ resolve(bitbucket(authToken));
- }
+ })
? +
- }
+ .catch(() => alfy.cache.set(ACCESS_TOKEN, null));
});
};
module.exports = loginAttempt; | 39 | 0.95122 | 24 | 15 |
7f49061dba35e4d993859e5c6287ed26b3704010 | scripts/assess_ldt.sh | scripts/assess_ldt.sh |
mkdir m4a
cd m4a
VERSION=`wget -O - https://anthos-migrate-release.storage.googleapis.com/latest`
wget https://anthos-migrate-release.storage.googleapis.com/${VERSION}/linux/amd64/m4a-fit-collect.sh
chmod +x m4a-fit-collect.sh
wget https://anthos-migrate-release.storage.googleapis.com/${VERSION}/linux/amd64/m4a-fit-analysis
chmod +x m4a-fit-analysis
sudo ./m4a-fit-collect.sh
./m4a-fit-analysis m4a-collect-*-*.tar
|
mkdir m4a
cd m4a
VERSION=`wget -O - https://anthos-migrate-release.storage.googleapis.com/latest`
wget https://anthos-migrate-release.storage.googleapis.com/${VERSION}/linux/amd64/m4a-fit-collect.sh
chmod +x m4a-fit-collect.sh
wget https://anthos-migrate-release.storage.googleapis.com/${VERSION}/linux/amd64/mfit
chmod +x mfit
# Run collection script locally
sudo ./m4a-fit-collect.sh
# Import the VM collection details to mFIT DB
./mfit discover import m4a-collect-*-*.tar
# Assess the discovered VMs
./mfit assess
# Generate an HTML report
./mfit report --format html > mfit-report.html
# Generate a JSON report
./mfit report --format json > mfit-report.json
| Change to use mfit instead of m4a-fit-analysis | Change to use mfit instead of m4a-fit-analysis
Change-Id: Icfeb2fca5cc888dc9a62cf5d0c4325dfb2f89311
| Shell | apache-2.0 | GoogleCloudPlatform/migrate-to-containers | shell | ## Code Before:
mkdir m4a
cd m4a
VERSION=`wget -O - https://anthos-migrate-release.storage.googleapis.com/latest`
wget https://anthos-migrate-release.storage.googleapis.com/${VERSION}/linux/amd64/m4a-fit-collect.sh
chmod +x m4a-fit-collect.sh
wget https://anthos-migrate-release.storage.googleapis.com/${VERSION}/linux/amd64/m4a-fit-analysis
chmod +x m4a-fit-analysis
sudo ./m4a-fit-collect.sh
./m4a-fit-analysis m4a-collect-*-*.tar
## Instruction:
Change to use mfit instead of m4a-fit-analysis
Change-Id: Icfeb2fca5cc888dc9a62cf5d0c4325dfb2f89311
## Code After:
mkdir m4a
cd m4a
VERSION=`wget -O - https://anthos-migrate-release.storage.googleapis.com/latest`
wget https://anthos-migrate-release.storage.googleapis.com/${VERSION}/linux/amd64/m4a-fit-collect.sh
chmod +x m4a-fit-collect.sh
wget https://anthos-migrate-release.storage.googleapis.com/${VERSION}/linux/amd64/mfit
chmod +x mfit
# Run collection script locally
sudo ./m4a-fit-collect.sh
# Import the VM collection details to mFIT DB
./mfit discover import m4a-collect-*-*.tar
# Assess the discovered VMs
./mfit assess
# Generate an HTML report
./mfit report --format html > mfit-report.html
# Generate a JSON report
./mfit report --format json > mfit-report.json
|
mkdir m4a
cd m4a
VERSION=`wget -O - https://anthos-migrate-release.storage.googleapis.com/latest`
wget https://anthos-migrate-release.storage.googleapis.com/${VERSION}/linux/amd64/m4a-fit-collect.sh
chmod +x m4a-fit-collect.sh
- wget https://anthos-migrate-release.storage.googleapis.com/${VERSION}/linux/amd64/m4a-fit-analysis
? --- ---------
+ wget https://anthos-migrate-release.storage.googleapis.com/${VERSION}/linux/amd64/mfit
- chmod +x m4a-fit-analysis
+ chmod +x mfit
+ # Run collection script locally
sudo ./m4a-fit-collect.sh
- ./m4a-fit-analysis m4a-collect-*-*.tar
+ # Import the VM collection details to mFIT DB
+ ./mfit discover import m4a-collect-*-*.tar
+
+ # Assess the discovered VMs
+ ./mfit assess
+ # Generate an HTML report
+ ./mfit report --format html > mfit-report.html
+ # Generate a JSON report
+ ./mfit report --format json > mfit-report.json | 15 | 1 | 12 | 3 |
24b19abf08bc86e02593c33e931af756481b0664 | virtuozzo-7.0/scripts/virtualbox.sh | virtuozzo-7.0/scripts/virtualbox.sh | VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
cd /tmp
mount -o loop $HOME_DIR/VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
sh /mnt/VBoxLinuxAdditions.run
umount /mnt
rm -rf $HOME_DIR/VBoxGuestAdditions_*.iso
| VBOX_VERSION=$(cat $HOME_DIR/.vbox_version)
cd /tmp
mount -o loop $HOME_DIR/VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
sh /mnt/VBoxLinuxAdditions.run
umount /mnt
rm -rf $HOME_DIR/VBoxGuestAdditions_*.iso
| Replace vagrant homedir by variable | Replace vagrant homedir by variable
| Shell | isc | ligurio/openvz-packer-templates,ligurio/packer-templates | shell | ## Code Before:
VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
cd /tmp
mount -o loop $HOME_DIR/VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
sh /mnt/VBoxLinuxAdditions.run
umount /mnt
rm -rf $HOME_DIR/VBoxGuestAdditions_*.iso
## Instruction:
Replace vagrant homedir by variable
## Code After:
VBOX_VERSION=$(cat $HOME_DIR/.vbox_version)
cd /tmp
mount -o loop $HOME_DIR/VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
sh /mnt/VBoxLinuxAdditions.run
umount /mnt
rm -rf $HOME_DIR/VBoxGuestAdditions_*.iso
| - VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
? ^^^^^^^^^^^^^
+ VBOX_VERSION=$(cat $HOME_DIR/.vbox_version)
? ^^^^^^^^^
cd /tmp
mount -o loop $HOME_DIR/VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
sh /mnt/VBoxLinuxAdditions.run
umount /mnt
rm -rf $HOME_DIR/VBoxGuestAdditions_*.iso | 2 | 0.285714 | 1 | 1 |
2e3f613283be0f989c6c938782203698e12bb5df | composer.json | composer.json | {
"name": "schickling/backup",
"description": "Backup and restore database support for Laravel 4 applications",
"authors": [
{
"name": "Johannes Schickling",
"email": "schickling.j@gmail.com"
}
],
"require": {
"php": ">=5.3.0",
"illuminate/support": "4.0.x",
"illuminate/console": "4.0.x"
},
"require-dev": {
"illuminate/foundation": "4.0.x",
"orchestra/testbench": "2.1.*",
"mockery/mockery": "dev-master"
},
"autoload": {
"psr-0": {
"Schickling\\Backup": "src/"
}
},
"minimum-stability": "dev"
} | {
"name": "schickling/backup",
"description": "Backup and restore database support for Laravel 4 applications",
"authors": [
{
"name": "Johannes Schickling",
"email": "schickling.j@gmail.com"
}
],
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"illuminate/foundation": "4.0.x",
"illuminate/support": "4.0.x",
"illuminate/console": "4.0.x",
"orchestra/testbench": "2.0.*",
"mockery/mockery": "dev-master"
},
"autoload": {
"psr-0": {
"Schickling\\Backup": "src/"
}
},
"minimum-stability": "dev"
}
| Move dependencies to require-dev, as it only needed during development. | Move dependencies to require-dev, as it only needed during development.
Signed-off-by: crynobone <e1a543840a942eb68427510a8a483282a7bfeddf@gmail.com>
| JSON | mit | schickling/laravel-backup | json | ## Code Before:
{
"name": "schickling/backup",
"description": "Backup and restore database support for Laravel 4 applications",
"authors": [
{
"name": "Johannes Schickling",
"email": "schickling.j@gmail.com"
}
],
"require": {
"php": ">=5.3.0",
"illuminate/support": "4.0.x",
"illuminate/console": "4.0.x"
},
"require-dev": {
"illuminate/foundation": "4.0.x",
"orchestra/testbench": "2.1.*",
"mockery/mockery": "dev-master"
},
"autoload": {
"psr-0": {
"Schickling\\Backup": "src/"
}
},
"minimum-stability": "dev"
}
## Instruction:
Move dependencies to require-dev, as it only needed during development.
Signed-off-by: crynobone <e1a543840a942eb68427510a8a483282a7bfeddf@gmail.com>
## Code After:
{
"name": "schickling/backup",
"description": "Backup and restore database support for Laravel 4 applications",
"authors": [
{
"name": "Johannes Schickling",
"email": "schickling.j@gmail.com"
}
],
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"illuminate/foundation": "4.0.x",
"illuminate/support": "4.0.x",
"illuminate/console": "4.0.x",
"orchestra/testbench": "2.0.*",
"mockery/mockery": "dev-master"
},
"autoload": {
"psr-0": {
"Schickling\\Backup": "src/"
}
},
"minimum-stability": "dev"
}
| {
"name": "schickling/backup",
"description": "Backup and restore database support for Laravel 4 applications",
"authors": [
{
"name": "Johannes Schickling",
"email": "schickling.j@gmail.com"
}
],
"require": {
- "php": ">=5.3.0",
? -
+ "php": ">=5.3.0"
- "illuminate/support": "4.0.x",
- "illuminate/console": "4.0.x"
},
"require-dev": {
"illuminate/foundation": "4.0.x",
+ "illuminate/support": "4.0.x",
+ "illuminate/console": "4.0.x",
- "orchestra/testbench": "2.1.*",
? ^
+ "orchestra/testbench": "2.0.*",
? ^
"mockery/mockery": "dev-master"
},
"autoload": {
"psr-0": {
"Schickling\\Backup": "src/"
}
},
"minimum-stability": "dev"
} | 8 | 0.307692 | 4 | 4 |
149fbff08ed230a16ae83307af6dc13fc22104ba | dist/sass/style/_tcon-button.scss | dist/sass/style/_tcon-button.scss | .tcon {
appearance: none;
border: none;
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
height: $tcon-size;
transition: $tcon-transition;
user-select: none;
width: $tcon-size;
background: transparent;
> * {
display: block;
}
&:focus {
outline: none; // see issue #36 https://github.com/grayghostvisuals/transformicons/issues/36
}
} | .tcon {
appearance: none;
border: none;
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
height: $tcon-size;
transition: $tcon-transition;
user-select: none;
width: $tcon-size;
background: transparent;
outline: none;
> * {
display: block;
}
&:hover,
&:focus {
outline: none; // see issue #36 https://github.com/grayghostvisuals/transformicons/issues/36
}
&::-moz-focus-inner {
border: 0;
}
}
| Remove dotted outline from icons. | Remove dotted outline from icons.
| SCSS | mit | KM-MFG/transformicons,transformicons/transformicons,marmikbhatt/transformicons,transformicons/transformicons,AkimSolovyov/transformicons,KM-MFG/transformicons | scss | ## Code Before:
.tcon {
appearance: none;
border: none;
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
height: $tcon-size;
transition: $tcon-transition;
user-select: none;
width: $tcon-size;
background: transparent;
> * {
display: block;
}
&:focus {
outline: none; // see issue #36 https://github.com/grayghostvisuals/transformicons/issues/36
}
}
## Instruction:
Remove dotted outline from icons.
## Code After:
.tcon {
appearance: none;
border: none;
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
height: $tcon-size;
transition: $tcon-transition;
user-select: none;
width: $tcon-size;
background: transparent;
outline: none;
> * {
display: block;
}
&:hover,
&:focus {
outline: none; // see issue #36 https://github.com/grayghostvisuals/transformicons/issues/36
}
&::-moz-focus-inner {
border: 0;
}
}
| .tcon {
appearance: none;
border: none;
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
height: $tcon-size;
transition: $tcon-transition;
user-select: none;
width: $tcon-size;
background: transparent;
+ outline: none;
> * {
display: block;
}
+ &:hover,
&:focus {
outline: none; // see issue #36 https://github.com/grayghostvisuals/transformicons/issues/36
}
+ &::-moz-focus-inner {
+ border: 0;
+ }
} | 5 | 0.238095 | 5 | 0 |
7f764f5b236ce8e7faacb99b5dcb60126882002f | spec/spec_helper.rb | spec/spec_helper.rb |
$: << File.join(File.dirname(__FILE__), "/../../lib" )
require 'cucumber_priority'
|
$: << File.join(File.dirname(__FILE__), "/../../lib" )
require 'cucumber_priority'
if defined?(RSpec)
RSpec.configure do |config|
if config.respond_to?(:expect_with)
config.expect_with(:rspec) do |c|
c.syntax = [:expect, :should]
end
end
end
end | Remove deprecation warnings in new RSpecs | Remove deprecation warnings in new RSpecs
| Ruby | mit | makandra/cucumber_priority | ruby | ## Code Before:
$: << File.join(File.dirname(__FILE__), "/../../lib" )
require 'cucumber_priority'
## Instruction:
Remove deprecation warnings in new RSpecs
## Code After:
$: << File.join(File.dirname(__FILE__), "/../../lib" )
require 'cucumber_priority'
if defined?(RSpec)
RSpec.configure do |config|
if config.respond_to?(:expect_with)
config.expect_with(:rspec) do |c|
c.syntax = [:expect, :should]
end
end
end
end |
$: << File.join(File.dirname(__FILE__), "/../../lib" )
require 'cucumber_priority'
+
+ if defined?(RSpec)
+ RSpec.configure do |config|
+ if config.respond_to?(:expect_with)
+ config.expect_with(:rspec) do |c|
+ c.syntax = [:expect, :should]
+ end
+ end
+ end
+ end | 10 | 3.333333 | 10 | 0 |
881a4f8a399de8b557f8f612317a5fb26f0e86c4 | bower.json | bower.json | {
"name": "maps",
"dependencies": {
"angular": "1.4.7",
"lodash": "3.10.1",
"normalize-css": "3.0.3"
}
}
| {
"name": "maps",
"dependencies": {
"angular": "1.4.7",
"normalize-css": "3.0.3"
}
}
| Remove lodash. Not using it | Remove lodash. Not using it
| JSON | mit | michalc/maps,michalc/maps | json | ## Code Before:
{
"name": "maps",
"dependencies": {
"angular": "1.4.7",
"lodash": "3.10.1",
"normalize-css": "3.0.3"
}
}
## Instruction:
Remove lodash. Not using it
## Code After:
{
"name": "maps",
"dependencies": {
"angular": "1.4.7",
"normalize-css": "3.0.3"
}
}
| {
"name": "maps",
"dependencies": {
"angular": "1.4.7",
- "lodash": "3.10.1",
"normalize-css": "3.0.3"
}
} | 1 | 0.125 | 0 | 1 |
ffccb57a0bf7505e4a35daf7bec2aae2d56ff1c0 | app/overrides/spree/checkout/_payment/remove_card_options.html.erb.deface | app/overrides/spree/checkout/_payment/remove_card_options.html.erb.deface | <!-- replace ".card_options" -->
<div class="card_options">
<input id="use_existing_card_no" name="use_existing_card" type="radio" value="yes" style="display:none">
</div>
| <!-- replace ".card_options" -->
<div class="card_options">
<%= radio_button_tag 'use_existing_card', 'yes', false %>
<label for="use_existing_card_yes">Use an existing card on file</label>
<br/>
<%= radio_button_tag 'use_existing_card', 'no', true %>
<label for="use_existing_card_no">Use a new card / payment method</label>
</div>
| Remove card options from checkout. | Remove card options from checkout.
| unknown | bsd-3-clause | clomax/spree_cwilt_theme,clomax/spree_cwilt_theme,clomax/spree_cwilt_theme | unknown | ## Code Before:
<!-- replace ".card_options" -->
<div class="card_options">
<input id="use_existing_card_no" name="use_existing_card" type="radio" value="yes" style="display:none">
</div>
## Instruction:
Remove card options from checkout.
## Code After:
<!-- replace ".card_options" -->
<div class="card_options">
<%= radio_button_tag 'use_existing_card', 'yes', false %>
<label for="use_existing_card_yes">Use an existing card on file</label>
<br/>
<%= radio_button_tag 'use_existing_card', 'no', true %>
<label for="use_existing_card_no">Use a new card / payment method</label>
</div>
| <!-- replace ".card_options" -->
<div class="card_options">
- <input id="use_existing_card_no" name="use_existing_card" type="radio" value="yes" style="display:none">
+ <%= radio_button_tag 'use_existing_card', 'yes', false %>
+ <label for="use_existing_card_yes">Use an existing card on file</label>
+ <br/>
+ <%= radio_button_tag 'use_existing_card', 'no', true %>
+ <label for="use_existing_card_no">Use a new card / payment method</label>
</div> | 6 | 1.5 | 5 | 1 |
341a2e4ee52e929b63333771496bc86eda7dc299 | templates/paging.php | templates/paging.php | <div id="items-paging">
<?php if ($offset > 0): ?>
<a id="previous-page" href="?action=<?= $menu ?>&offset=<?= ($offset - $items_per_page) ?>&order=<?= $order ?>&direction=<?= $direction ?><?= isset($feed_id) ? '&feed_id='.$feed_id : '' ?>">« <?= t('Previous page') ?></a>
<?php endif ?>
<?php if (($nb_items - $offset) > $items_per_page): ?>
<a id="next-page" href="?action=<?= $menu ?>&offset=<?= ($offset + $items_per_page) ?>&order=<?= $order ?>&direction=<?= $direction ?><?= isset($feed_id) ? '&feed_id='.$feed_id : '' ?><?= isset($group_id) ? '&group_id='.$group_id : '' ?>"><?= t('Next page') ?> »</a>
<?php endif ?>
</div> | <div id="items-paging">
<?php if ($offset > 0): ?>
<a id="previous-page" href="?action=<?= $menu ?>&offset=<?= ($offset - $items_per_page) ?>&order=<?= $order ?>&direction=<?= $direction ?><?= isset($feed_id) ? '&feed_id='.$feed_id : '' ?><?= isset($group_id) ? '&group_id='.$group_id : '' ?>">« <?= t('Previous page') ?></a>
<?php endif ?>
<?php if (($nb_items - $offset) > $items_per_page): ?>
<a id="next-page" href="?action=<?= $menu ?>&offset=<?= ($offset + $items_per_page) ?>&order=<?= $order ?>&direction=<?= $direction ?><?= isset($feed_id) ? '&feed_id='.$feed_id : '' ?><?= isset($group_id) ? '&group_id='.$group_id : '' ?>"><?= t('Next page') ?> »</a>
<?php endif ?>
</div> | Add group_id to the previous page link | Add group_id to the previous page link
| PHP | agpl-3.0 | cljnnn/miniflux,denfil/miniflux,mrjovanovic/miniflux,mrjovanovic/miniflux,denfil/miniflux,cljnnn/miniflux,mkresin/miniflux,cljnnn/miniflux,pcwalden/miniflux,pcwalden/miniflux,mkresin/miniflux,pcwalden/miniflux,mrjovanovic/miniflux,mkresin/miniflux,denfil/miniflux | php | ## Code Before:
<div id="items-paging">
<?php if ($offset > 0): ?>
<a id="previous-page" href="?action=<?= $menu ?>&offset=<?= ($offset - $items_per_page) ?>&order=<?= $order ?>&direction=<?= $direction ?><?= isset($feed_id) ? '&feed_id='.$feed_id : '' ?>">« <?= t('Previous page') ?></a>
<?php endif ?>
<?php if (($nb_items - $offset) > $items_per_page): ?>
<a id="next-page" href="?action=<?= $menu ?>&offset=<?= ($offset + $items_per_page) ?>&order=<?= $order ?>&direction=<?= $direction ?><?= isset($feed_id) ? '&feed_id='.$feed_id : '' ?><?= isset($group_id) ? '&group_id='.$group_id : '' ?>"><?= t('Next page') ?> »</a>
<?php endif ?>
</div>
## Instruction:
Add group_id to the previous page link
## Code After:
<div id="items-paging">
<?php if ($offset > 0): ?>
<a id="previous-page" href="?action=<?= $menu ?>&offset=<?= ($offset - $items_per_page) ?>&order=<?= $order ?>&direction=<?= $direction ?><?= isset($feed_id) ? '&feed_id='.$feed_id : '' ?><?= isset($group_id) ? '&group_id='.$group_id : '' ?>">« <?= t('Previous page') ?></a>
<?php endif ?>
<?php if (($nb_items - $offset) > $items_per_page): ?>
<a id="next-page" href="?action=<?= $menu ?>&offset=<?= ($offset + $items_per_page) ?>&order=<?= $order ?>&direction=<?= $direction ?><?= isset($feed_id) ? '&feed_id='.$feed_id : '' ?><?= isset($group_id) ? '&group_id='.$group_id : '' ?>"><?= t('Next page') ?> »</a>
<?php endif ?>
</div> | <div id="items-paging">
<?php if ($offset > 0): ?>
- <a id="previous-page" href="?action=<?= $menu ?>&offset=<?= ($offset - $items_per_page) ?>&order=<?= $order ?>&direction=<?= $direction ?><?= isset($feed_id) ? '&feed_id='.$feed_id : '' ?>">« <?= t('Previous page') ?></a>
+ <a id="previous-page" href="?action=<?= $menu ?>&offset=<?= ($offset - $items_per_page) ?>&order=<?= $order ?>&direction=<?= $direction ?><?= isset($feed_id) ? '&feed_id='.$feed_id : '' ?><?= isset($group_id) ? '&group_id='.$group_id : '' ?>">« <?= t('Previous page') ?></a>
? +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<?php endif ?>
<?php if (($nb_items - $offset) > $items_per_page): ?>
<a id="next-page" href="?action=<?= $menu ?>&offset=<?= ($offset + $items_per_page) ?>&order=<?= $order ?>&direction=<?= $direction ?><?= isset($feed_id) ? '&feed_id='.$feed_id : '' ?><?= isset($group_id) ? '&group_id='.$group_id : '' ?>"><?= t('Next page') ?> »</a>
<?php endif ?>
</div> | 2 | 0.222222 | 1 | 1 |
fa1b5a060a234a1fb225a120780606e9055dedea | spec/presenters/footer_presenter_spec.rb | spec/presenters/footer_presenter_spec.rb | require 'rails_helper'
RSpec.describe FooterPresenter do
let!(:setting) { FactoryGirl.create(:setting,
event_start_date: "2016-07-09",
event_end_date: "2016-07-10",
event_url: "railsgirls.com/lodz")
}
subject { described_class.new(setting) }
it 'presents event dates' do
expect(subject.event_dates).to eq('9-10 July')
end
it 'presents url to event' do
expect(subject.event_url).to eq('railsgirls.com/lodz')
end
end
| require 'rails_helper'
RSpec.describe FooterPresenter do
let!(:setting) do
FactoryGirl.create(:setting,
event_start_date: "2016-07-09",
event_end_date: "2016-07-10",
event_url: "railsgirls.com/lodz"
)
end
subject { described_class.new(setting) }
it 'presents event dates' do
expect(subject.event_dates).to eq('9-10 July')
end
it 'presents url to event' do
expect(subject.event_url).to eq('railsgirls.com/lodz')
end
end
| Use do/end block instead of curly braces | Use do/end block instead of curly braces
| Ruby | mit | LunarLogic/rails-girls-submissions,LunarLogic/rails-girls-submissions,LunarLogic/rails-girls-submissions | ruby | ## Code Before:
require 'rails_helper'
RSpec.describe FooterPresenter do
let!(:setting) { FactoryGirl.create(:setting,
event_start_date: "2016-07-09",
event_end_date: "2016-07-10",
event_url: "railsgirls.com/lodz")
}
subject { described_class.new(setting) }
it 'presents event dates' do
expect(subject.event_dates).to eq('9-10 July')
end
it 'presents url to event' do
expect(subject.event_url).to eq('railsgirls.com/lodz')
end
end
## Instruction:
Use do/end block instead of curly braces
## Code After:
require 'rails_helper'
RSpec.describe FooterPresenter do
let!(:setting) do
FactoryGirl.create(:setting,
event_start_date: "2016-07-09",
event_end_date: "2016-07-10",
event_url: "railsgirls.com/lodz"
)
end
subject { described_class.new(setting) }
it 'presents event dates' do
expect(subject.event_dates).to eq('9-10 July')
end
it 'presents url to event' do
expect(subject.event_url).to eq('railsgirls.com/lodz')
end
end
| require 'rails_helper'
RSpec.describe FooterPresenter do
+ let!(:setting) do
- let!(:setting) { FactoryGirl.create(:setting,
? -------------- -
+ FactoryGirl.create(:setting,
- event_start_date: "2016-07-09",
? ---------------
+ event_start_date: "2016-07-09",
- event_end_date: "2016-07-10",
? ---------------
+ event_end_date: "2016-07-10",
- event_url: "railsgirls.com/lodz")
? --------------- -
+ event_url: "railsgirls.com/lodz"
- }
+ )
+ end
+
subject { described_class.new(setting) }
it 'presents event dates' do
expect(subject.event_dates).to eq('9-10 July')
end
it 'presents url to event' do
expect(subject.event_url).to eq('railsgirls.com/lodz')
end
end | 13 | 0.722222 | 8 | 5 |
dc5ffac75c86b313f434633d42513682f027cba3 | tox.ini | tox.ini | [tox]
minversion = 1.6
envlist =
py26,py27,py32,py33,py34
[testenv]
usedevelop = True
deps =
commands =
python setup.py test -q
python setup.py flake8
[flake8]
select = E,F,W
max_line_length = 79
| [tox]
minversion = 1.6
envlist =
py26,py27,py32,py33,py34
[testenv]
usedevelop = True
deps =
commands =
python setup.py test -q
python setup.py flake8
[flake8]
select = E,F,W
max_line_length = 79
exclude = .git,.tox,dist,docs,*egg
| Make flake8 pass in root directory | Make flake8 pass in root directory
Add exclude list to tox.ini
| INI | mit | wdv4758h/flake8,lericson/flake8 | ini | ## Code Before:
[tox]
minversion = 1.6
envlist =
py26,py27,py32,py33,py34
[testenv]
usedevelop = True
deps =
commands =
python setup.py test -q
python setup.py flake8
[flake8]
select = E,F,W
max_line_length = 79
## Instruction:
Make flake8 pass in root directory
Add exclude list to tox.ini
## Code After:
[tox]
minversion = 1.6
envlist =
py26,py27,py32,py33,py34
[testenv]
usedevelop = True
deps =
commands =
python setup.py test -q
python setup.py flake8
[flake8]
select = E,F,W
max_line_length = 79
exclude = .git,.tox,dist,docs,*egg
| [tox]
minversion = 1.6
envlist =
py26,py27,py32,py33,py34
[testenv]
usedevelop = True
deps =
commands =
python setup.py test -q
python setup.py flake8
[flake8]
select = E,F,W
max_line_length = 79
+ exclude = .git,.tox,dist,docs,*egg | 1 | 0.066667 | 1 | 0 |
886d15c00223b3585659fa6ba017c10e71583cbd | _layouts/page.html | _layouts/page.html | ---
layout: default
---
<div class="row">
<div class="col-md-9" role="main">
<h1 class="page-header">{{ page.title }}</h1>
{{ content }}
</div>
<div class="col-md-3" role="complementary">
{% include sidebar.html %}
</div>
</div> | ---
layout: default
---
<div class="row">
<div class="col-md-3" role="complementary">
{% include sidebar.html %}
</div>
<div class="col-md-9" role="main">
<h1 class="page-header">{{ page.title }}</h1>
{{ content }}
</div>
</div> | Move side menu to the left | Move side menu to the left
| HTML | apache-2.0 | atata-framework/atata-framework.github.io,atata-framework/atata-framework.github.io,atata-framework/atata-framework.github.io | html | ## Code Before:
---
layout: default
---
<div class="row">
<div class="col-md-9" role="main">
<h1 class="page-header">{{ page.title }}</h1>
{{ content }}
</div>
<div class="col-md-3" role="complementary">
{% include sidebar.html %}
</div>
</div>
## Instruction:
Move side menu to the left
## Code After:
---
layout: default
---
<div class="row">
<div class="col-md-3" role="complementary">
{% include sidebar.html %}
</div>
<div class="col-md-9" role="main">
<h1 class="page-header">{{ page.title }}</h1>
{{ content }}
</div>
</div> | ---
layout: default
---
<div class="row">
+ <div class="col-md-3" role="complementary">
+ {% include sidebar.html %}
+ </div>
<div class="col-md-9" role="main">
<h1 class="page-header">{{ page.title }}</h1>
{{ content }}
</div>
- <div class="col-md-3" role="complementary">
- {% include sidebar.html %}
- </div>
</div> | 6 | 0.5 | 3 | 3 |
e72c1e21ec397c18694d73eb6a104ba9d7f2eb11 | code/FacebookMetadataSiteConfig.php | code/FacebookMetadataSiteConfig.php | <?php
class FacebookMetadataSiteConfig extends DataExtension {
static $db = array(
'SkipToMainContentAccessKey' => 'VarChar(1)'
);
static $has_one = array(
'FacebookLogo' => 'Image'
);
public function updateCMSFields(FieldList $fields) {
$tf2 = new TextField('SkipToMainContentAccessKey');
$tf2->setMaxLength(1);
$fields->addFieldToTab('Root.FacebookMetadata', $tf2);
$fields->renameField("SkipToMainContentAccessKey", _t('AccessKey.SKIP_TO_MAIN_CONTENT_ACCESS_KEY'));
$fields->addFieldToTab("Root.FacebookMetadata", new UploadField("FacebookLogo", _t('Facebook.METADATA_LOGO', 'Image that will show in facebook when linking to this site. The image should be a square')));
}
}
?> | <?php
class FacebookMetadataSiteConfig extends DataExtension {
static $db = array(
'SkipToMainContentAccessKey' => 'VarChar(1)'
);
static $has_one = array(
'FacebookLogo' => 'Image'
);
public function updateCMSFields(FieldList $fields) {
$fields->renameField("SkipToMainContentAccessKey", _t('AccessKey.SKIP_TO_MAIN_CONTENT_ACCESS_KEY'));
$fields->addFieldToTab("Root.FacebookMetadata", new UploadField("FacebookLogo", _t('Facebook.METADATA_LOGO',
'Image that will show in facebook when linking to this site. The image should be a square of minimum size 200px')));
}
}
?> | Remove empty field, hangover from access keys module | FIX: Remove empty field, hangover from access keys module
| PHP | bsd-3-clause | gordonbanderson/facebook-tools | php | ## Code Before:
<?php
class FacebookMetadataSiteConfig extends DataExtension {
static $db = array(
'SkipToMainContentAccessKey' => 'VarChar(1)'
);
static $has_one = array(
'FacebookLogo' => 'Image'
);
public function updateCMSFields(FieldList $fields) {
$tf2 = new TextField('SkipToMainContentAccessKey');
$tf2->setMaxLength(1);
$fields->addFieldToTab('Root.FacebookMetadata', $tf2);
$fields->renameField("SkipToMainContentAccessKey", _t('AccessKey.SKIP_TO_MAIN_CONTENT_ACCESS_KEY'));
$fields->addFieldToTab("Root.FacebookMetadata", new UploadField("FacebookLogo", _t('Facebook.METADATA_LOGO', 'Image that will show in facebook when linking to this site. The image should be a square')));
}
}
?>
## Instruction:
FIX: Remove empty field, hangover from access keys module
## Code After:
<?php
class FacebookMetadataSiteConfig extends DataExtension {
static $db = array(
'SkipToMainContentAccessKey' => 'VarChar(1)'
);
static $has_one = array(
'FacebookLogo' => 'Image'
);
public function updateCMSFields(FieldList $fields) {
$fields->renameField("SkipToMainContentAccessKey", _t('AccessKey.SKIP_TO_MAIN_CONTENT_ACCESS_KEY'));
$fields->addFieldToTab("Root.FacebookMetadata", new UploadField("FacebookLogo", _t('Facebook.METADATA_LOGO',
'Image that will show in facebook when linking to this site. The image should be a square of minimum size 200px')));
}
}
?> | <?php
class FacebookMetadataSiteConfig extends DataExtension {
static $db = array(
'SkipToMainContentAccessKey' => 'VarChar(1)'
);
static $has_one = array(
'FacebookLogo' => 'Image'
);
public function updateCMSFields(FieldList $fields) {
+
- $tf2 = new TextField('SkipToMainContentAccessKey');
- $tf2->setMaxLength(1);
- $fields->addFieldToTab('Root.FacebookMetadata', $tf2);
$fields->renameField("SkipToMainContentAccessKey", _t('AccessKey.SKIP_TO_MAIN_CONTENT_ACCESS_KEY'));
- $fields->addFieldToTab("Root.FacebookMetadata", new UploadField("FacebookLogo", _t('Facebook.METADATA_LOGO', 'Image that will show in facebook when linking to this site. The image should be a square')));
+ $fields->addFieldToTab("Root.FacebookMetadata", new UploadField("FacebookLogo", _t('Facebook.METADATA_LOGO',
+ 'Image that will show in facebook when linking to this site. The image should be a square of minimum size 200px')));
}
}
?> | 7 | 0.291667 | 3 | 4 |
86dccd8eec09de13c58277feb8789831fd32ae42 | build_tools/bots/bot_common.sh | build_tools/bots/bot_common.sh |
set -o nounset
set -o errexit
RESULT=0
MESSAGES=
BuildSuccess() {
echo "naclports nacl-install-all: Install SUCCEEDED $1 \
($NACL_PACKAGES_BITSIZE)"
}
BuildFailure() {
MESSAGE="naclports nacl-install-all: Install FAILED for $1 \
($NACL_PACKAGES_BITSIZE)"
echo $MESSAGE
echo "@@@STEP_FAILURE@@@"
MESSAGES="$MESSAGES\n$MESSAGE"
RESULT=1
}
BuildPackage() {
if make $1 ; then
BuildSuccess $1
else
BuildFailure $1
fi
}
BuildExample() {
readonly CURR_DIR=$(cd "$(dirname "$0")" ; pwd)
cd ../examples/$1
if ./nacl-$2.sh ; then
BuildSuccess $2
else
BuildFailure $2
fi
cd ${CURR_DIR}
}
|
set -o nounset
set -o errexit
RESULT=0
MESSAGES=
BuildSuccess() {
echo "naclports nacl-install-all: Install SUCCEEDED $1 \
($NACL_PACKAGES_BITSIZE)"
}
BuildFailure() {
MESSAGE="naclports nacl-install-all: Install FAILED for $1 \
($NACL_PACKAGES_BITSIZE)"
echo $MESSAGE
echo "@@@STEP_FAILURE@@@"
MESSAGES="$MESSAGES\n$MESSAGE"
RESULT=1
}
BuildPackage() {
if make $1 ; then
BuildSuccess $1
else
BuildFailure $1
fi
}
BuildExample() {
echo "@@@BUILD_STEP $NACL_PACKAGES_BITSIZE-bit $2@@@"
readonly CURR_DIR=$(cd "$(dirname "$0")" ; pwd)
cd ../examples/$1
if ./nacl-$2.sh ; then
BuildSuccess $2
else
BuildFailure $2
fi
cd ${CURR_DIR}
}
| Add build stage output for ScummVM port | Add build stage output for ScummVM port
R=bradnelson@google.com
Review URL: http://codereview.chromium.org/7524027
git-svn-id: 84b3587ce119b778414dcb50e18b7479aacf4f1d@355 7dad1e8b-422e-d2af-fbf5-8013b78bd812
| Shell | bsd-3-clause | adlr/naclports,yeyus/naclports,dtkav/naclports,Schibum/naclports,dtkav/naclports,yeyus/naclports,clchiou/naclports,yeyus/naclports,kuscsik/naclports,dtkav/naclports,dtkav/naclports,Schibum/naclports,clchiou/naclports,yeyus/naclports,yeyus/naclports,kosyak/naclports_samsung-smart-tv,kosyak/naclports_samsung-smart-tv,clchiou/naclports,adlr/naclports,kosyak/naclports_samsung-smart-tv,binji/naclports,kuscsik/naclports,kosyak/naclports_samsung-smart-tv,binji/naclports,binji/naclports,Schibum/naclports,clchiou/naclports,clchiou/naclports,kosyak/naclports_samsung-smart-tv,binji/naclports,kuscsik/naclports,adlr/naclports,binji/naclports,Schibum/naclports,Schibum/naclports,Schibum/naclports,kuscsik/naclports,dtkav/naclports,adlr/naclports,adlr/naclports,yeyus/naclports,kuscsik/naclports | shell | ## Code Before:
set -o nounset
set -o errexit
RESULT=0
MESSAGES=
BuildSuccess() {
echo "naclports nacl-install-all: Install SUCCEEDED $1 \
($NACL_PACKAGES_BITSIZE)"
}
BuildFailure() {
MESSAGE="naclports nacl-install-all: Install FAILED for $1 \
($NACL_PACKAGES_BITSIZE)"
echo $MESSAGE
echo "@@@STEP_FAILURE@@@"
MESSAGES="$MESSAGES\n$MESSAGE"
RESULT=1
}
BuildPackage() {
if make $1 ; then
BuildSuccess $1
else
BuildFailure $1
fi
}
BuildExample() {
readonly CURR_DIR=$(cd "$(dirname "$0")" ; pwd)
cd ../examples/$1
if ./nacl-$2.sh ; then
BuildSuccess $2
else
BuildFailure $2
fi
cd ${CURR_DIR}
}
## Instruction:
Add build stage output for ScummVM port
R=bradnelson@google.com
Review URL: http://codereview.chromium.org/7524027
git-svn-id: 84b3587ce119b778414dcb50e18b7479aacf4f1d@355 7dad1e8b-422e-d2af-fbf5-8013b78bd812
## Code After:
set -o nounset
set -o errexit
RESULT=0
MESSAGES=
BuildSuccess() {
echo "naclports nacl-install-all: Install SUCCEEDED $1 \
($NACL_PACKAGES_BITSIZE)"
}
BuildFailure() {
MESSAGE="naclports nacl-install-all: Install FAILED for $1 \
($NACL_PACKAGES_BITSIZE)"
echo $MESSAGE
echo "@@@STEP_FAILURE@@@"
MESSAGES="$MESSAGES\n$MESSAGE"
RESULT=1
}
BuildPackage() {
if make $1 ; then
BuildSuccess $1
else
BuildFailure $1
fi
}
BuildExample() {
echo "@@@BUILD_STEP $NACL_PACKAGES_BITSIZE-bit $2@@@"
readonly CURR_DIR=$(cd "$(dirname "$0")" ; pwd)
cd ../examples/$1
if ./nacl-$2.sh ; then
BuildSuccess $2
else
BuildFailure $2
fi
cd ${CURR_DIR}
}
|
set -o nounset
set -o errexit
RESULT=0
MESSAGES=
BuildSuccess() {
echo "naclports nacl-install-all: Install SUCCEEDED $1 \
($NACL_PACKAGES_BITSIZE)"
}
BuildFailure() {
MESSAGE="naclports nacl-install-all: Install FAILED for $1 \
($NACL_PACKAGES_BITSIZE)"
echo $MESSAGE
echo "@@@STEP_FAILURE@@@"
MESSAGES="$MESSAGES\n$MESSAGE"
RESULT=1
}
BuildPackage() {
if make $1 ; then
BuildSuccess $1
else
BuildFailure $1
fi
}
BuildExample() {
+ echo "@@@BUILD_STEP $NACL_PACKAGES_BITSIZE-bit $2@@@"
readonly CURR_DIR=$(cd "$(dirname "$0")" ; pwd)
cd ../examples/$1
if ./nacl-$2.sh ; then
BuildSuccess $2
else
BuildFailure $2
fi
cd ${CURR_DIR}
} | 1 | 0.025641 | 1 | 0 |
f213984ad3dfd8922578346baeeb97d60fab742a | cinje/inline/use.py | cinje/inline/use.py |
from ..util import pypy, ensure_buffer
PREFIX = '_buffer.extend(' if pypy else '__w('
class Use(object):
"""Consume the result of calling another template function, extending the local buffer.
This is meant to consume non-wrapping template functions. For wrapping functions see ": using" instead.
Syntax:
: use <name-constant> [<arguments>]
The name constant must resolve to a generator function that participates in the cinje "yielded buffer" protocol.
"""
priority = 25
def match(self, context, line):
"""Match code lines prefixed with a "use" keyword."""
return line.kind == 'code' and line.partitioned[0] == "use"
def __call__(self, context):
"""Wrap the expression in a `_buffer.extend()` call."""
input = context.input
declaration = input.next()
parts = declaration.partitioned[1] # Ignore the "use" part, we care about the name and arguments.
name, _, args = parts.partition(' ')
for i in ensure_buffer(context):
yield i
yield declaration.clone(line=PREFIX + name.rstrip() + "(" + args.lstrip() + "))")
context.flag.add('dirty')
|
from ..util import py, pypy, ensure_buffer
PREFIX = '_buffer.extend(' if pypy else '__w('
class Use(object):
"""Consume the result of calling another template function, extending the local buffer.
This is meant to consume non-wrapping template functions. For wrapping functions see ": using" instead.
Syntax:
: use <name-constant> [<arguments>]
The name constant must resolve to a generator function that participates in the cinje "yielded buffer" protocol.
"""
priority = 25
def match(self, context, line):
"""Match code lines prefixed with a "use" keyword."""
return line.kind == 'code' and line.partitioned[0] == "use"
def __call__(self, context):
"""Wrap the expression in a `_buffer.extend()` call."""
input = context.input
declaration = input.next()
parts = declaration.partitioned[1] # Ignore the "use" part, we care about the name and arguments.
name, _, args = parts.partition(' ')
for i in ensure_buffer(context):
yield i
name = name.rstrip()
args = args.lstrip()
if 'buffer' in context.flag:
yield declaration.clone(line=PREFIX + name + "(" + args + "))")
context.flag.add('dirty')
return
if py == 3: # We can use the more efficient "yield from" syntax. Wewt!
yield declaration.clone(line="yield from " + name + "(" + args + ")")
else:
yield declaration.clone(line="for _chunk in " + name + "(" + args + "):")
yield declaration.clone(line="yield _chunk", scope=context.scope + 1)
| Handle buffering and Python 3 "yield from" optimization. | Handle buffering and Python 3 "yield from" optimization.
| Python | mit | marrow/cinje | python | ## Code Before:
from ..util import pypy, ensure_buffer
PREFIX = '_buffer.extend(' if pypy else '__w('
class Use(object):
"""Consume the result of calling another template function, extending the local buffer.
This is meant to consume non-wrapping template functions. For wrapping functions see ": using" instead.
Syntax:
: use <name-constant> [<arguments>]
The name constant must resolve to a generator function that participates in the cinje "yielded buffer" protocol.
"""
priority = 25
def match(self, context, line):
"""Match code lines prefixed with a "use" keyword."""
return line.kind == 'code' and line.partitioned[0] == "use"
def __call__(self, context):
"""Wrap the expression in a `_buffer.extend()` call."""
input = context.input
declaration = input.next()
parts = declaration.partitioned[1] # Ignore the "use" part, we care about the name and arguments.
name, _, args = parts.partition(' ')
for i in ensure_buffer(context):
yield i
yield declaration.clone(line=PREFIX + name.rstrip() + "(" + args.lstrip() + "))")
context.flag.add('dirty')
## Instruction:
Handle buffering and Python 3 "yield from" optimization.
## Code After:
from ..util import py, pypy, ensure_buffer
PREFIX = '_buffer.extend(' if pypy else '__w('
class Use(object):
"""Consume the result of calling another template function, extending the local buffer.
This is meant to consume non-wrapping template functions. For wrapping functions see ": using" instead.
Syntax:
: use <name-constant> [<arguments>]
The name constant must resolve to a generator function that participates in the cinje "yielded buffer" protocol.
"""
priority = 25
def match(self, context, line):
"""Match code lines prefixed with a "use" keyword."""
return line.kind == 'code' and line.partitioned[0] == "use"
def __call__(self, context):
"""Wrap the expression in a `_buffer.extend()` call."""
input = context.input
declaration = input.next()
parts = declaration.partitioned[1] # Ignore the "use" part, we care about the name and arguments.
name, _, args = parts.partition(' ')
for i in ensure_buffer(context):
yield i
name = name.rstrip()
args = args.lstrip()
if 'buffer' in context.flag:
yield declaration.clone(line=PREFIX + name + "(" + args + "))")
context.flag.add('dirty')
return
if py == 3: # We can use the more efficient "yield from" syntax. Wewt!
yield declaration.clone(line="yield from " + name + "(" + args + ")")
else:
yield declaration.clone(line="for _chunk in " + name + "(" + args + "):")
yield declaration.clone(line="yield _chunk", scope=context.scope + 1)
|
- from ..util import pypy, ensure_buffer
+ from ..util import py, pypy, ensure_buffer
? ++++
PREFIX = '_buffer.extend(' if pypy else '__w('
class Use(object):
"""Consume the result of calling another template function, extending the local buffer.
This is meant to consume non-wrapping template functions. For wrapping functions see ": using" instead.
Syntax:
: use <name-constant> [<arguments>]
The name constant must resolve to a generator function that participates in the cinje "yielded buffer" protocol.
"""
priority = 25
def match(self, context, line):
"""Match code lines prefixed with a "use" keyword."""
return line.kind == 'code' and line.partitioned[0] == "use"
def __call__(self, context):
"""Wrap the expression in a `_buffer.extend()` call."""
input = context.input
declaration = input.next()
parts = declaration.partitioned[1] # Ignore the "use" part, we care about the name and arguments.
name, _, args = parts.partition(' ')
for i in ensure_buffer(context):
yield i
- yield declaration.clone(line=PREFIX + name.rstrip() + "(" + args.lstrip() + "))")
+ name = name.rstrip()
+ args = args.lstrip()
+ if 'buffer' in context.flag:
+ yield declaration.clone(line=PREFIX + name + "(" + args + "))")
- context.flag.add('dirty')
+ context.flag.add('dirty')
? +
+ return
+
+ if py == 3: # We can use the more efficient "yield from" syntax. Wewt!
+ yield declaration.clone(line="yield from " + name + "(" + args + ")")
+ else:
+ yield declaration.clone(line="for _chunk in " + name + "(" + args + "):")
+ yield declaration.clone(line="yield _chunk", scope=context.scope + 1)
+ | 17 | 0.425 | 14 | 3 |
8c26cb08dd08b7e34352e51b06ecb9129ac201a1 | stagecraft/libs/schemas/schemas.py | stagecraft/libs/schemas/schemas.py | from django.conf import settings
from json import loads as json_loads
from os import path
def get_schema():
schema_root = path.join(
settings.BASE_DIR,
'stagecraft/apps/datasets/schemas/timestamp.json'
)
with open(schema_root) as f:
json_f = json_loads(f.read())
return json_f
| from django.conf import settings
from json import loads as json_loads
from os import path
def get_schema():
schema_root = path.join(
settings.BASE_DIR,
'stagecraft/apps/datasets/schemas/timestamp.json'
)
with open(schema_root) as f:
schema = json_loads(f.read())
return schema
| Make the schema return object a bit more obvious and descriptive | Make the schema return object a bit more obvious and descriptive
| Python | mit | alphagov/stagecraft,alphagov/stagecraft,alphagov/stagecraft,alphagov/stagecraft | python | ## Code Before:
from django.conf import settings
from json import loads as json_loads
from os import path
def get_schema():
schema_root = path.join(
settings.BASE_DIR,
'stagecraft/apps/datasets/schemas/timestamp.json'
)
with open(schema_root) as f:
json_f = json_loads(f.read())
return json_f
## Instruction:
Make the schema return object a bit more obvious and descriptive
## Code After:
from django.conf import settings
from json import loads as json_loads
from os import path
def get_schema():
schema_root = path.join(
settings.BASE_DIR,
'stagecraft/apps/datasets/schemas/timestamp.json'
)
with open(schema_root) as f:
schema = json_loads(f.read())
return schema
| from django.conf import settings
from json import loads as json_loads
from os import path
def get_schema():
schema_root = path.join(
settings.BASE_DIR,
'stagecraft/apps/datasets/schemas/timestamp.json'
)
with open(schema_root) as f:
- json_f = json_loads(f.read())
? - ^^^^
+ schema = json_loads(f.read())
? ^^^^^
- return json_f
+ return schema | 4 | 0.285714 | 2 | 2 |
a5723e36b29f9db233a61c04e69f476957cce0e0 | src/components/icon.cjsx | src/components/icon.cjsx | React = require 'react'
BS = require 'react-bootstrap'
module.exports = React.createClass
displayName: 'Icon'
propTypes:
type: React.PropTypes.string
className: React.PropTypes.string
tooltip: React.PropTypes.string
tooltipProps: React.PropTypes.object
getDefaultProps: ->
tooltipProps: { placement: 'bottom' }
render: ->
classes = ['tutor-icon', 'fa', "fa-#{@props.type}"]
classes.push(@props.className) if @props.className
icon = <i {...@props} className={classes.join(' ')} />
if @props.tooltip
tooltip = <BS.Tooltip>{@props.tooltip}</BS.Tooltip>
<BS.OverlayTrigger {...@props.tooltipProps} overlay={tooltip}>{icon}</BS.OverlayTrigger>
else
icon
| React = require 'react'
BS = require 'react-bootstrap'
classnames = require 'classnames'
module.exports = React.createClass
displayName: 'Icon'
propTypes:
type: React.PropTypes.string.isRequired
spin: React.PropTypes.bool
className: React.PropTypes.string
tooltip: React.PropTypes.string
tooltipProps: React.PropTypes.object
getDefaultProps: ->
tooltipProps: { placement: 'bottom' }
render: ->
classNames = classnames('tutor-icon', 'fa', "fa-#{@props.type}", @props.className, {
'fa-spin': @props.spin
})
icon = <i {...@props} className={classNames} />
if @props.tooltip
tooltip = <BS.Tooltip>{@props.tooltip}</BS.Tooltip>
<BS.OverlayTrigger {...@props.tooltipProps} overlay={tooltip}>{icon}</BS.OverlayTrigger>
else
icon
| Use classnames and add spin animation support | Use classnames and add spin animation support
| CoffeeScript | agpl-3.0 | openstax/tutor-js,openstax/tutor-js,openstax/tutor-js,openstax/tutor-js,openstax/tutor-js | coffeescript | ## Code Before:
React = require 'react'
BS = require 'react-bootstrap'
module.exports = React.createClass
displayName: 'Icon'
propTypes:
type: React.PropTypes.string
className: React.PropTypes.string
tooltip: React.PropTypes.string
tooltipProps: React.PropTypes.object
getDefaultProps: ->
tooltipProps: { placement: 'bottom' }
render: ->
classes = ['tutor-icon', 'fa', "fa-#{@props.type}"]
classes.push(@props.className) if @props.className
icon = <i {...@props} className={classes.join(' ')} />
if @props.tooltip
tooltip = <BS.Tooltip>{@props.tooltip}</BS.Tooltip>
<BS.OverlayTrigger {...@props.tooltipProps} overlay={tooltip}>{icon}</BS.OverlayTrigger>
else
icon
## Instruction:
Use classnames and add spin animation support
## Code After:
React = require 'react'
BS = require 'react-bootstrap'
classnames = require 'classnames'
module.exports = React.createClass
displayName: 'Icon'
propTypes:
type: React.PropTypes.string.isRequired
spin: React.PropTypes.bool
className: React.PropTypes.string
tooltip: React.PropTypes.string
tooltipProps: React.PropTypes.object
getDefaultProps: ->
tooltipProps: { placement: 'bottom' }
render: ->
classNames = classnames('tutor-icon', 'fa', "fa-#{@props.type}", @props.className, {
'fa-spin': @props.spin
})
icon = <i {...@props} className={classNames} />
if @props.tooltip
tooltip = <BS.Tooltip>{@props.tooltip}</BS.Tooltip>
<BS.OverlayTrigger {...@props.tooltipProps} overlay={tooltip}>{icon}</BS.OverlayTrigger>
else
icon
| React = require 'react'
BS = require 'react-bootstrap'
-
+ classnames = require 'classnames'
module.exports = React.createClass
displayName: 'Icon'
propTypes:
- type: React.PropTypes.string
+ type: React.PropTypes.string.isRequired
? +++++++++++
+ spin: React.PropTypes.bool
className: React.PropTypes.string
tooltip: React.PropTypes.string
tooltipProps: React.PropTypes.object
getDefaultProps: ->
tooltipProps: { placement: 'bottom' }
render: ->
- classes = ['tutor-icon', 'fa', "fa-#{@props.type}"]
- classes.push(@props.className) if @props.className
+ classNames = classnames('tutor-icon', 'fa', "fa-#{@props.type}", @props.className, {
+ 'fa-spin': @props.spin
+ })
+
- icon = <i {...@props} className={classes.join(' ')} />
? ----------
+ icon = <i {...@props} className={classNames} />
? +++
if @props.tooltip
tooltip = <BS.Tooltip>{@props.tooltip}</BS.Tooltip>
<BS.OverlayTrigger {...@props.tooltipProps} overlay={tooltip}>{icon}</BS.OverlayTrigger>
else
icon | 13 | 0.541667 | 8 | 5 |
f40cce13d8f866f54d278c8b65345db8aa9d0a52 | system-status/enable-collection.pl | system-status/enable-collection.pl |
BEGIN { push(@INC, '.'); };
use strict;
use warnings;
our (%config);
require 'system-status-lib.pl';
my $zero = @ARGV ? $ARGV[0] : '';
$zero eq 'none' || $zero =~ /^[1-9][0-9]*$/ && $zero <= 60 ||
die "usage: enable-collection.pl none|<mins>";
$config{'collect_interval'} = $ARGV[0];
&save_module_config();
&setup_collectinfo_job();
|
use strict;
use warnings;
our (%config);
require './system-status-lib.pl';
my $zero = @ARGV ? $ARGV[0] : '';
$zero eq 'none' || $zero =~ /^[1-9][0-9]*$/ && $zero <= 60 ||
die "usage: enable-collection.pl none|<mins>";
$config{'collect_interval'} = $ARGV[0];
&save_module_config();
&setup_collectinfo_job();
| Use ./ in require instead of BEGIN | Use ./ in require instead of BEGIN | Perl | bsd-3-clause | webmin/webmin,webmin/webmin,nawawi/webmin,webmin/webmin,nawawi/webmin,webmin/webmin,webmin/webmin,nawawi/webmin,webmin/webmin,nawawi/webmin,nawawi/webmin,webmin/webmin,nawawi/webmin,webmin/webmin,nawawi/webmin,webmin/webmin,nawawi/webmin,nawawi/webmin,nawawi/webmin,webmin/webmin | perl | ## Code Before:
BEGIN { push(@INC, '.'); };
use strict;
use warnings;
our (%config);
require 'system-status-lib.pl';
my $zero = @ARGV ? $ARGV[0] : '';
$zero eq 'none' || $zero =~ /^[1-9][0-9]*$/ && $zero <= 60 ||
die "usage: enable-collection.pl none|<mins>";
$config{'collect_interval'} = $ARGV[0];
&save_module_config();
&setup_collectinfo_job();
## Instruction:
Use ./ in require instead of BEGIN
## Code After:
use strict;
use warnings;
our (%config);
require './system-status-lib.pl';
my $zero = @ARGV ? $ARGV[0] : '';
$zero eq 'none' || $zero =~ /^[1-9][0-9]*$/ && $zero <= 60 ||
die "usage: enable-collection.pl none|<mins>";
$config{'collect_interval'} = $ARGV[0];
&save_module_config();
&setup_collectinfo_job();
|
- BEGIN { push(@INC, '.'); };
use strict;
use warnings;
our (%config);
- require 'system-status-lib.pl';
+ require './system-status-lib.pl';
? ++
my $zero = @ARGV ? $ARGV[0] : '';
$zero eq 'none' || $zero =~ /^[1-9][0-9]*$/ && $zero <= 60 ||
die "usage: enable-collection.pl none|<mins>";
$config{'collect_interval'} = $ARGV[0];
&save_module_config();
&setup_collectinfo_job(); | 3 | 0.230769 | 1 | 2 |
29a154704466a614c0e13b0f130957e8c53a721b | .semaphore/semaphore.yml | .semaphore/semaphore.yml | version: v1.0
name: First pipeline example
agent:
machine:
type: e1-standard-2
os_image: ubuntu1804
blocks:
- name: "Bundle"
task:
jobs:
- name: bundle gems
commands:
- bundle
- name: "Run tests"
task:
jobs:
- name: tests
commands:
- bundle exec rake
| version: v1.0
name: First pipeline example
agent:
machine:
type: e1-standard-2
os_image: ubuntu1804
blocks:
- name: "Checkout code"
task:
jobs:
- name: checkout code from Github
commands:
- checkout
- name: "Bundle"
task:
jobs:
- name: bundle gems
commands:
- bundle
- name: "Run tests"
task:
jobs:
- name: tests
commands:
- bundle exec rake
| Add git clone step to SemaphoreCI | Add git clone step to SemaphoreCI
| YAML | mit | scottwillson/tabular | yaml | ## Code Before:
version: v1.0
name: First pipeline example
agent:
machine:
type: e1-standard-2
os_image: ubuntu1804
blocks:
- name: "Bundle"
task:
jobs:
- name: bundle gems
commands:
- bundle
- name: "Run tests"
task:
jobs:
- name: tests
commands:
- bundle exec rake
## Instruction:
Add git clone step to SemaphoreCI
## Code After:
version: v1.0
name: First pipeline example
agent:
machine:
type: e1-standard-2
os_image: ubuntu1804
blocks:
- name: "Checkout code"
task:
jobs:
- name: checkout code from Github
commands:
- checkout
- name: "Bundle"
task:
jobs:
- name: bundle gems
commands:
- bundle
- name: "Run tests"
task:
jobs:
- name: tests
commands:
- bundle exec rake
| version: v1.0
name: First pipeline example
agent:
machine:
type: e1-standard-2
os_image: ubuntu1804
blocks:
+ - name: "Checkout code"
+ task:
+ jobs:
+ - name: checkout code from Github
+ commands:
+ - checkout
+
- name: "Bundle"
task:
jobs:
- name: bundle gems
commands:
- bundle
- name: "Run tests"
task:
jobs:
- name: tests
commands:
- bundle exec rake | 7 | 0.333333 | 7 | 0 |
8afdc3425e31048f269cda97396760391ea90f07 | source/APPLICATIONS/UTILITIES/BALLUtilities.cmake | source/APPLICATIONS/UTILITIES/BALLUtilities.cmake | SET(DIRECTORY source/APPLICATIONS/UTILITIES)
### list all filenames of the directory here ###
SET(EXECUTABLES_LIST
add_hydrogens
assign_charges_from_rules
assign_radii_from_rules
assign_typenames_from_rules
atomtyper
calculate_RMSD
clip_protein_around_ligand
compute_docking_RMSD
create_random_numbers
dcd2dcd
export_fragment
hin2mol2
pdb2amber_naming
pdb2dcd
pdb2hin
reconstruct_fragment
rigid_docking
solvent_accessibility
)
IF (BALL_HAS_MPI)
LIST(APPEND EXECUTABLES_LIST geometricFit_slave)
ENDIF()
SET(UTILITIES_EXECUTABLES ${UTILITIES_EXECUTABLES} ${EXECUTABLES_LIST})
### add filenames to Visual Studio solution
SET(UTILITIES_SOURCES)
FOREACH(i ${EXECUTABLES_LIST})
LIST(APPEND UTILITIES_SOURCES "${i}")
ENDFOREACH(i)
SOURCE_GROUP("" FILES ${UTILITIES_SOURCES})
| SET(DIRECTORY source/APPLICATIONS/UTILITIES)
### list all filenames of the directory here ###
SET(EXECUTABLES_LIST
add_hydrogens
assign_charges_from_rules
assign_radii_from_rules
assign_typenames_from_rules
atomtyper
calculate_RMSD
clip_protein_around_ligand
compute_docking_RMSD
create_random_numbers
dcd2dcd
export_fragment
hin2mol2
pdb2amber_naming
pdb2dcd
pdb2hin
reconstruct_fragment
solvent_accessibility
)
IF (BALL_HAS_FFTW)
LIST(APPEND EXECUTABLES_LIST rigid_docking)
IF (BALL_HAS_MPI)
LIST(APPEND EXECUTABLES_LIST geometricFit_slave)
ENDIF()
ENDIF()
SET(UTILITIES_EXECUTABLES ${UTILITIES_EXECUTABLES} ${EXECUTABLES_LIST})
### add filenames to Visual Studio solution
SET(UTILITIES_SOURCES)
FOREACH(i ${EXECUTABLES_LIST})
LIST(APPEND UTILITIES_SOURCES "${i}")
ENDFOREACH(i)
SOURCE_GROUP("" FILES ${UTILITIES_SOURCES})
| Make compilation of rigid_docking dependent on FFTW. | Make compilation of rigid_docking dependent on FFTW.
| CMake | lgpl-2.1 | tkemmer/ball,tkemmer/ball,tkemmer/ball,tkemmer/ball,tkemmer/ball,tkemmer/ball | cmake | ## Code Before:
SET(DIRECTORY source/APPLICATIONS/UTILITIES)
### list all filenames of the directory here ###
SET(EXECUTABLES_LIST
add_hydrogens
assign_charges_from_rules
assign_radii_from_rules
assign_typenames_from_rules
atomtyper
calculate_RMSD
clip_protein_around_ligand
compute_docking_RMSD
create_random_numbers
dcd2dcd
export_fragment
hin2mol2
pdb2amber_naming
pdb2dcd
pdb2hin
reconstruct_fragment
rigid_docking
solvent_accessibility
)
IF (BALL_HAS_MPI)
LIST(APPEND EXECUTABLES_LIST geometricFit_slave)
ENDIF()
SET(UTILITIES_EXECUTABLES ${UTILITIES_EXECUTABLES} ${EXECUTABLES_LIST})
### add filenames to Visual Studio solution
SET(UTILITIES_SOURCES)
FOREACH(i ${EXECUTABLES_LIST})
LIST(APPEND UTILITIES_SOURCES "${i}")
ENDFOREACH(i)
SOURCE_GROUP("" FILES ${UTILITIES_SOURCES})
## Instruction:
Make compilation of rigid_docking dependent on FFTW.
## Code After:
SET(DIRECTORY source/APPLICATIONS/UTILITIES)
### list all filenames of the directory here ###
SET(EXECUTABLES_LIST
add_hydrogens
assign_charges_from_rules
assign_radii_from_rules
assign_typenames_from_rules
atomtyper
calculate_RMSD
clip_protein_around_ligand
compute_docking_RMSD
create_random_numbers
dcd2dcd
export_fragment
hin2mol2
pdb2amber_naming
pdb2dcd
pdb2hin
reconstruct_fragment
solvent_accessibility
)
IF (BALL_HAS_FFTW)
LIST(APPEND EXECUTABLES_LIST rigid_docking)
IF (BALL_HAS_MPI)
LIST(APPEND EXECUTABLES_LIST geometricFit_slave)
ENDIF()
ENDIF()
SET(UTILITIES_EXECUTABLES ${UTILITIES_EXECUTABLES} ${EXECUTABLES_LIST})
### add filenames to Visual Studio solution
SET(UTILITIES_SOURCES)
FOREACH(i ${EXECUTABLES_LIST})
LIST(APPEND UTILITIES_SOURCES "${i}")
ENDFOREACH(i)
SOURCE_GROUP("" FILES ${UTILITIES_SOURCES})
| SET(DIRECTORY source/APPLICATIONS/UTILITIES)
### list all filenames of the directory here ###
SET(EXECUTABLES_LIST
add_hydrogens
assign_charges_from_rules
assign_radii_from_rules
assign_typenames_from_rules
atomtyper
calculate_RMSD
clip_protein_around_ligand
compute_docking_RMSD
create_random_numbers
dcd2dcd
export_fragment
hin2mol2
pdb2amber_naming
pdb2dcd
pdb2hin
reconstruct_fragment
- rigid_docking
solvent_accessibility
)
+ IF (BALL_HAS_FFTW)
+ LIST(APPEND EXECUTABLES_LIST rigid_docking)
+
- IF (BALL_HAS_MPI)
+ IF (BALL_HAS_MPI)
? +
- LIST(APPEND EXECUTABLES_LIST geometricFit_slave)
+ LIST(APPEND EXECUTABLES_LIST geometricFit_slave)
? +
+ ENDIF()
ENDIF()
SET(UTILITIES_EXECUTABLES ${UTILITIES_EXECUTABLES} ${EXECUTABLES_LIST})
### add filenames to Visual Studio solution
SET(UTILITIES_SOURCES)
FOREACH(i ${EXECUTABLES_LIST})
LIST(APPEND UTILITIES_SOURCES "${i}")
ENDFOREACH(i)
SOURCE_GROUP("" FILES ${UTILITIES_SOURCES}) | 9 | 0.25 | 6 | 3 |
176aca3b63a2204bc9bd88048d241b3bc7836afd | package.lisp | package.lisp | ;;;; package.lisp
(defpackage #:spinneret
(:use #:cl #:parenscript #:alexandria)
(:export #:with-html #:with-html-string #:html
#:*html* #:*html-fill-column* #:*html-min-room*
#:*html-lang* #:*html-charset*
#:*html-path*
#:deftemplate #:do-elements
#:deftag
#:*unvalidated-attribute-prefixes*)
(:shadowing-import-from :alexandria :switch))
| ;;;; package.lisp
(defpackage #:spinneret
(:use #:cl #:parenscript #:alexandria)
(:export #:with-html #:with-html-string #:html
#:*html* #:*html-fill-column* #:*html-min-room*
#:*html-lang* #:*html-charset*
#:*html-path*
#:do-elements
#:deftag
#:*unvalidated-attribute-prefixes*)
(:shadowing-import-from :alexandria :switch))
| Remove deftemplate from exported symbols | Remove deftemplate from exported symbols
The functionality was removed on e2cbe0e22dd2e9e6c50daf5d7081fc7a02e64d1c
| Common Lisp | mit | ruricolist/spinneret | common-lisp | ## Code Before:
;;;; package.lisp
(defpackage #:spinneret
(:use #:cl #:parenscript #:alexandria)
(:export #:with-html #:with-html-string #:html
#:*html* #:*html-fill-column* #:*html-min-room*
#:*html-lang* #:*html-charset*
#:*html-path*
#:deftemplate #:do-elements
#:deftag
#:*unvalidated-attribute-prefixes*)
(:shadowing-import-from :alexandria :switch))
## Instruction:
Remove deftemplate from exported symbols
The functionality was removed on e2cbe0e22dd2e9e6c50daf5d7081fc7a02e64d1c
## Code After:
;;;; package.lisp
(defpackage #:spinneret
(:use #:cl #:parenscript #:alexandria)
(:export #:with-html #:with-html-string #:html
#:*html* #:*html-fill-column* #:*html-min-room*
#:*html-lang* #:*html-charset*
#:*html-path*
#:do-elements
#:deftag
#:*unvalidated-attribute-prefixes*)
(:shadowing-import-from :alexandria :switch))
| ;;;; package.lisp
(defpackage #:spinneret
(:use #:cl #:parenscript #:alexandria)
(:export #:with-html #:with-html-string #:html
#:*html* #:*html-fill-column* #:*html-min-room*
#:*html-lang* #:*html-charset*
#:*html-path*
- #:deftemplate #:do-elements
? --------------
+ #:do-elements
#:deftag
#:*unvalidated-attribute-prefixes*)
(:shadowing-import-from :alexandria :switch)) | 2 | 0.166667 | 1 | 1 |
1bd486b4359e8dbb344032cc3d59282fa9b9eadf | .travis.yml | .travis.yml | addons:
apt:
packages:
- libegl1-mesa-dev
- libfreetype6-dev
- libpng-dev
- libxml-parser-perl
- libxtst-dev
- xutils-dev
script:
- ./bootstrap.sh manifest.txt
| addons:
apt:
packages:
- libegl1-mesa-dev
- libfreetype6-dev
- libpng-dev
- libxml-parser-perl
- libxtst-dev
- xutils-dev
script:
- ./bootstrap.sh manifest.txt
- tar cJf deps.txz local
deploy:
provider: releases
api_key:
secure: Bw7wOlzvEx1fsFMy5SAxDHodz4XxyBbscbAGMd4uneNY08hA1pIzHOLfe5HWYsYBknDTATpMVlHFp86rM7YML+S/S1bVd5Bwh37aPZ1fmlXWE0v1G4uN3NMNZAjU1oXrtn8D97LvCqe+NBK4i0lr44VbDaOKX33r3/aIZjAIroTFUp49rrsE9mIf3uUXojFqCxQIjEIUgJmO7yz6bDu7XmFgJePhCvdX/SMwYEycsN+FRgrZDQ7kakqdP+u4D/OYOlNN99ykLq2TegayPRA2X7td63xUY0O4E8kBx0g1L8nAgVK3j83l8y11lIT5gBpm4tyQH2wqB4ncZKgT/jfrFrE3XsEevfjzLEAxj1lu1AEXqWJ78yXB9KxPJ4dHJHRB7/8xa0YzXMkZV04JRsZXaPSwUQUVPRjkXlwiiT1xA3P5wyCotCEVuzsUwkCJPvsacOTDEhwaPu36qqJfYEhLLCk9qDwWZdgOZRnsWti6GmljT5VEthtqU3RHKT2zuNf75rTKp3XZJXLftocAjUrnR/9X1krx8N4fCdRbWxO000eS2gw1vXrQcVK8xb4CIbZ8n6qBosMiUdLsai8j+mSHwuwRbZEnRhqTCxFHHawzvhaA5/DkBKQtk1T4QyP49w+d4lF9KEFn23e5585Gza21FLRTBxHr8ar4OxAO2U+6vaM=
file: deps.txz
skip_cleanup: true
on:
tags: true
| Set up github releases deployment | Set up github releases deployment
| YAML | mit | gkoz/gtk-bootstrap | yaml | ## Code Before:
addons:
apt:
packages:
- libegl1-mesa-dev
- libfreetype6-dev
- libpng-dev
- libxml-parser-perl
- libxtst-dev
- xutils-dev
script:
- ./bootstrap.sh manifest.txt
## Instruction:
Set up github releases deployment
## Code After:
addons:
apt:
packages:
- libegl1-mesa-dev
- libfreetype6-dev
- libpng-dev
- libxml-parser-perl
- libxtst-dev
- xutils-dev
script:
- ./bootstrap.sh manifest.txt
- tar cJf deps.txz local
deploy:
provider: releases
api_key:
secure: Bw7wOlzvEx1fsFMy5SAxDHodz4XxyBbscbAGMd4uneNY08hA1pIzHOLfe5HWYsYBknDTATpMVlHFp86rM7YML+S/S1bVd5Bwh37aPZ1fmlXWE0v1G4uN3NMNZAjU1oXrtn8D97LvCqe+NBK4i0lr44VbDaOKX33r3/aIZjAIroTFUp49rrsE9mIf3uUXojFqCxQIjEIUgJmO7yz6bDu7XmFgJePhCvdX/SMwYEycsN+FRgrZDQ7kakqdP+u4D/OYOlNN99ykLq2TegayPRA2X7td63xUY0O4E8kBx0g1L8nAgVK3j83l8y11lIT5gBpm4tyQH2wqB4ncZKgT/jfrFrE3XsEevfjzLEAxj1lu1AEXqWJ78yXB9KxPJ4dHJHRB7/8xa0YzXMkZV04JRsZXaPSwUQUVPRjkXlwiiT1xA3P5wyCotCEVuzsUwkCJPvsacOTDEhwaPu36qqJfYEhLLCk9qDwWZdgOZRnsWti6GmljT5VEthtqU3RHKT2zuNf75rTKp3XZJXLftocAjUrnR/9X1krx8N4fCdRbWxO000eS2gw1vXrQcVK8xb4CIbZ8n6qBosMiUdLsai8j+mSHwuwRbZEnRhqTCxFHHawzvhaA5/DkBKQtk1T4QyP49w+d4lF9KEFn23e5585Gza21FLRTBxHr8ar4OxAO2U+6vaM=
file: deps.txz
skip_cleanup: true
on:
tags: true
| addons:
apt:
packages:
- libegl1-mesa-dev
- libfreetype6-dev
- libpng-dev
- libxml-parser-perl
- libxtst-dev
- xutils-dev
script:
- - ./bootstrap.sh manifest.txt
? --
+ - ./bootstrap.sh manifest.txt
+ - tar cJf deps.txz local
+ deploy:
+ provider: releases
+ api_key:
+ secure: Bw7wOlzvEx1fsFMy5SAxDHodz4XxyBbscbAGMd4uneNY08hA1pIzHOLfe5HWYsYBknDTATpMVlHFp86rM7YML+S/S1bVd5Bwh37aPZ1fmlXWE0v1G4uN3NMNZAjU1oXrtn8D97LvCqe+NBK4i0lr44VbDaOKX33r3/aIZjAIroTFUp49rrsE9mIf3uUXojFqCxQIjEIUgJmO7yz6bDu7XmFgJePhCvdX/SMwYEycsN+FRgrZDQ7kakqdP+u4D/OYOlNN99ykLq2TegayPRA2X7td63xUY0O4E8kBx0g1L8nAgVK3j83l8y11lIT5gBpm4tyQH2wqB4ncZKgT/jfrFrE3XsEevfjzLEAxj1lu1AEXqWJ78yXB9KxPJ4dHJHRB7/8xa0YzXMkZV04JRsZXaPSwUQUVPRjkXlwiiT1xA3P5wyCotCEVuzsUwkCJPvsacOTDEhwaPu36qqJfYEhLLCk9qDwWZdgOZRnsWti6GmljT5VEthtqU3RHKT2zuNf75rTKp3XZJXLftocAjUrnR/9X1krx8N4fCdRbWxO000eS2gw1vXrQcVK8xb4CIbZ8n6qBosMiUdLsai8j+mSHwuwRbZEnRhqTCxFHHawzvhaA5/DkBKQtk1T4QyP49w+d4lF9KEFn23e5585Gza21FLRTBxHr8ar4OxAO2U+6vaM=
+ file: deps.txz
+ skip_cleanup: true
+ on:
+ tags: true | 11 | 1 | 10 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.