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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6f158ca4a8a4f88d395763ff726d5a12533d808c | lib/qspec/helper.rb | lib/qspec/helper.rb | module Qspec
class Helper
include SporkHelper
def initialize(argv)
@argv = argv
end
def serve
case @argv.last
when 'init'
puts "Creating template"
Config.create_template
when 'spork'
@config = Config.new
puts "Start #{@config['workers']} sporks"
start_spork_workers(@config['workers'])
end
end
end
end
| module Qspec
class Helper
include SporkHelper
def initialize(argv)
@argv = argv
end
def serve
case @argv.last
when 'init'
puts "Creating template"
Config.create_template
when 'spork'
Qspec.create_tmp_directory_if_not_exist
@config = Config.new
puts "Start #{@config['workers']} sporks"
start_spork_workers(@config['workers'])
end
end
end
end
| Create temporary directory before start spork | Create temporary directory before start spork
| Ruby | mit | tomykaira/qspec | ruby | ## Code Before:
module Qspec
class Helper
include SporkHelper
def initialize(argv)
@argv = argv
end
def serve
case @argv.last
when 'init'
puts "Creating template"
Config.create_template
when 'spork'
@config = Config.new
puts "Start #{@config['workers']} sporks"
start_spork_workers(@config['workers'])
end
end
end
end
## Instruction:
Create temporary directory before start spork
## Code After:
module Qspec
class Helper
include SporkHelper
def initialize(argv)
@argv = argv
end
def serve
case @argv.last
when 'init'
puts "Creating template"
Config.create_template
when 'spork'
Qspec.create_tmp_directory_if_not_exist
@config = Config.new
puts "Start #{@config['workers']} sporks"
start_spork_workers(@config['workers'])
end
end
end
end
| module Qspec
class Helper
include SporkHelper
def initialize(argv)
@argv = argv
end
def serve
case @argv.last
when 'init'
puts "Creating template"
Config.create_template
when 'spork'
+ Qspec.create_tmp_directory_if_not_exist
@config = Config.new
puts "Start #{@config['workers']} sporks"
start_spork_workers(@config['workers'])
end
end
end
end | 1 | 0.047619 | 1 | 0 |
a35a28d861bef43d18a6d2345456401a626f3a60 | pelab/monitor/run-monitor-libnetmon.sh | pelab/monitor/run-monitor-libnetmon.sh |
if [ $# != 2 ]; then
if [ $# != 3 ]; then
echo "Usage: $0 <project/experiment> <my-ip> [stub-ip]"
exit 1;
fi
fi
PID=$1
EID=$2
SID=$3
SCRIPT=`which $0`
SCRIPT_LOCATION=`dirname $SCRIPT`
BIN_LOCATION=$SCRIPT_LOCATION/../libnetmon/
BIN=netmond
if ! [ -x $BIN_LOCATION/$BIN ]; then
echo "$BIN_LOCATION/$BIN missing - run 'gmake' in $BIN_LOCATION to build it"
exit 1;
fi
echo "Starting up netmond for $PID $EID $SID";
$BIN_LOCATION/$BIN | python monitor.py ip-mapping.txt $PID $EID $SID
|
if [ $# != 3 ]; then
if [ $# != 4 ]; then
echo "Usage: $0 <project> <experiment> <my-ip> [stub-ip]"
exit 1;
fi
SIP=$4
fi
PID=$1
EID=$2
MIP=$3
SCRIPT=`which $0`
SCRIPT_LOCATION=`dirname $SCRIPT`
BIN_LOCATION=$SCRIPT_LOCATION/../libnetmon/
BIN=netmond
if ! [ -x $BIN_LOCATION/$BIN ]; then
echo "$BIN_LOCATION/$BIN missing - run 'gmake' in $BIN_LOCATION to build it"
exit 1;
fi
echo "Starting up netmond for $PID/$EID $MIP $SIP";
$BIN_LOCATION/$BIN | python monitor.py ip-mapping.txt $PID/$EID $MIP $SIP
| Fix to be more in line with the current command line args of the monitor. | Fix to be more in line with the current command line args of the
monitor.
| Shell | agpl-3.0 | nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome,nmc-probe/emulab-nome | shell | ## Code Before:
if [ $# != 2 ]; then
if [ $# != 3 ]; then
echo "Usage: $0 <project/experiment> <my-ip> [stub-ip]"
exit 1;
fi
fi
PID=$1
EID=$2
SID=$3
SCRIPT=`which $0`
SCRIPT_LOCATION=`dirname $SCRIPT`
BIN_LOCATION=$SCRIPT_LOCATION/../libnetmon/
BIN=netmond
if ! [ -x $BIN_LOCATION/$BIN ]; then
echo "$BIN_LOCATION/$BIN missing - run 'gmake' in $BIN_LOCATION to build it"
exit 1;
fi
echo "Starting up netmond for $PID $EID $SID";
$BIN_LOCATION/$BIN | python monitor.py ip-mapping.txt $PID $EID $SID
## Instruction:
Fix to be more in line with the current command line args of the
monitor.
## Code After:
if [ $# != 3 ]; then
if [ $# != 4 ]; then
echo "Usage: $0 <project> <experiment> <my-ip> [stub-ip]"
exit 1;
fi
SIP=$4
fi
PID=$1
EID=$2
MIP=$3
SCRIPT=`which $0`
SCRIPT_LOCATION=`dirname $SCRIPT`
BIN_LOCATION=$SCRIPT_LOCATION/../libnetmon/
BIN=netmond
if ! [ -x $BIN_LOCATION/$BIN ]; then
echo "$BIN_LOCATION/$BIN missing - run 'gmake' in $BIN_LOCATION to build it"
exit 1;
fi
echo "Starting up netmond for $PID/$EID $MIP $SIP";
$BIN_LOCATION/$BIN | python monitor.py ip-mapping.txt $PID/$EID $MIP $SIP
|
- if [ $# != 2 ]; then
? ^
+ if [ $# != 3 ]; then
? ^
- if [ $# != 3 ]; then
? ^
+ if [ $# != 4 ]; then
? ^
- echo "Usage: $0 <project/experiment> <my-ip> [stub-ip]"
? ^
+ echo "Usage: $0 <project> <experiment> <my-ip> [stub-ip]"
? ^^^
exit 1;
fi
+ SIP=$4
fi
PID=$1
EID=$2
- SID=$3
+ MIP=$3
SCRIPT=`which $0`
SCRIPT_LOCATION=`dirname $SCRIPT`
BIN_LOCATION=$SCRIPT_LOCATION/../libnetmon/
BIN=netmond
if ! [ -x $BIN_LOCATION/$BIN ]; then
echo "$BIN_LOCATION/$BIN missing - run 'gmake' in $BIN_LOCATION to build it"
exit 1;
fi
- echo "Starting up netmond for $PID $EID $SID";
? ^ ^
+ echo "Starting up netmond for $PID/$EID $MIP $SIP";
? ^ +++++ ^
- $BIN_LOCATION/$BIN | python monitor.py ip-mapping.txt $PID $EID $SID
? ^ ^
+ $BIN_LOCATION/$BIN | python monitor.py ip-mapping.txt $PID/$EID $MIP $SIP
? ^ +++++ ^
| 13 | 0.541667 | 7 | 6 |
0003ee31f78d7861713a2bb7daacb9701b26a1b9 | cinder/wsgi/wsgi.py | cinder/wsgi/wsgi.py |
"""Cinder OS API WSGI application."""
import sys
import warnings
from cinder import objects
warnings.simplefilter('once', DeprecationWarning)
from oslo_config import cfg
from oslo_log import log as logging
from oslo_service import wsgi
from cinder import i18n
i18n.enable_lazy()
# Need to register global_opts
from cinder.common import config
from cinder import rpc
from cinder import version
CONF = cfg.CONF
def initialize_application():
objects.register_all()
CONF(sys.argv[1:], project='cinder',
version=version.version_string())
logging.setup(CONF, "cinder")
config.set_middleware_defaults()
rpc.init(CONF)
return wsgi.Loader(CONF).load_app(name='osapi_volume')
|
"""Cinder OS API WSGI application."""
import sys
import warnings
from cinder import objects
warnings.simplefilter('once', DeprecationWarning)
from oslo_config import cfg
from oslo_log import log as logging
from oslo_service import wsgi
from cinder import i18n
i18n.enable_lazy()
# Need to register global_opts
from cinder.common import config
from cinder.common import constants
from cinder import rpc
from cinder import service
from cinder import version
CONF = cfg.CONF
def initialize_application():
objects.register_all()
CONF(sys.argv[1:], project='cinder',
version=version.version_string())
logging.setup(CONF, "cinder")
config.set_middleware_defaults()
rpc.init(CONF)
service.setup_profiler(constants.API_BINARY, CONF.host)
return wsgi.Loader(CONF).load_app(name='osapi_volume')
| Initialize osprofiler in WSGI application | Initialize osprofiler in WSGI application
This patch adds missing initialization of OSProfiler
when Cinder API is running as WSGI application.
Change-Id: Ifaffa2d58eeadf5d47fafbdde5538d26bcd346a6
| Python | apache-2.0 | Datera/cinder,phenoxim/cinder,mahak/cinder,openstack/cinder,j-griffith/cinder,Datera/cinder,j-griffith/cinder,mahak/cinder,openstack/cinder,phenoxim/cinder | python | ## Code Before:
"""Cinder OS API WSGI application."""
import sys
import warnings
from cinder import objects
warnings.simplefilter('once', DeprecationWarning)
from oslo_config import cfg
from oslo_log import log as logging
from oslo_service import wsgi
from cinder import i18n
i18n.enable_lazy()
# Need to register global_opts
from cinder.common import config
from cinder import rpc
from cinder import version
CONF = cfg.CONF
def initialize_application():
objects.register_all()
CONF(sys.argv[1:], project='cinder',
version=version.version_string())
logging.setup(CONF, "cinder")
config.set_middleware_defaults()
rpc.init(CONF)
return wsgi.Loader(CONF).load_app(name='osapi_volume')
## Instruction:
Initialize osprofiler in WSGI application
This patch adds missing initialization of OSProfiler
when Cinder API is running as WSGI application.
Change-Id: Ifaffa2d58eeadf5d47fafbdde5538d26bcd346a6
## Code After:
"""Cinder OS API WSGI application."""
import sys
import warnings
from cinder import objects
warnings.simplefilter('once', DeprecationWarning)
from oslo_config import cfg
from oslo_log import log as logging
from oslo_service import wsgi
from cinder import i18n
i18n.enable_lazy()
# Need to register global_opts
from cinder.common import config
from cinder.common import constants
from cinder import rpc
from cinder import service
from cinder import version
CONF = cfg.CONF
def initialize_application():
objects.register_all()
CONF(sys.argv[1:], project='cinder',
version=version.version_string())
logging.setup(CONF, "cinder")
config.set_middleware_defaults()
rpc.init(CONF)
service.setup_profiler(constants.API_BINARY, CONF.host)
return wsgi.Loader(CONF).load_app(name='osapi_volume')
|
"""Cinder OS API WSGI application."""
import sys
import warnings
from cinder import objects
warnings.simplefilter('once', DeprecationWarning)
from oslo_config import cfg
from oslo_log import log as logging
from oslo_service import wsgi
from cinder import i18n
i18n.enable_lazy()
# Need to register global_opts
from cinder.common import config
+ from cinder.common import constants
from cinder import rpc
+ from cinder import service
from cinder import version
CONF = cfg.CONF
def initialize_application():
objects.register_all()
CONF(sys.argv[1:], project='cinder',
version=version.version_string())
logging.setup(CONF, "cinder")
config.set_middleware_defaults()
rpc.init(CONF)
+ service.setup_profiler(constants.API_BINARY, CONF.host)
+
return wsgi.Loader(CONF).load_app(name='osapi_volume') | 4 | 0.114286 | 4 | 0 |
6a234d7851b0c78c1f9656f940bf7c2a64fdf277 | Utilities/CollectionView.swift | Utilities/CollectionView.swift | //
// CollectionView.swift
// Utilities
//
// Created by Caio Mello on August 17, 2017.
// Copyright © 2017 Caio Mello. All rights reserved.
//
import UIKit
extension UICollectionView {
public func scrollToTop(animated: Bool) {
guard let cell = cellForItem(at: IndexPath(item: 0, section: 0)) else { return }
guard let indexPath = indexPath(for: cell) else { return }
scrollToItem(at: indexPath, at: .top, animated: animated)
}
}
extension UICollectionViewFlowLayout {
public func itemSize(withColumns numberOfColumns: Int) -> CGSize {
let numberOfColumns = CGFloat(numberOfColumns)
let totalMargin = sectionInset.left + sectionInset.right
let totalSpacing = minimumInteritemSpacing * (numberOfColumns - 1)
let itemWidth = (collectionView!.bounds.width - totalMargin - totalSpacing)/numberOfColumns
let size = CGSize(size: itemSize, aspectFitToWidth: itemWidth)
return CGSize(width: size.width, height: size.height)
}
}
| //
// CollectionView.swift
// Utilities
//
// Created by Caio Mello on August 17, 2017.
// Copyright © 2017 Caio Mello. All rights reserved.
//
import UIKit
extension UICollectionView {
public func scrollToTop(animated: Bool) {
guard let cell = cellForItem(at: IndexPath(item: 0, section: 0)) else { return }
guard let indexPath = indexPath(for: cell) else { return }
scrollToItem(at: indexPath, at: .top, animated: animated)
}
}
extension UICollectionViewFlowLayout {
public func itemSize(withColumns numberOfColumns: Int) -> CGSize {
let numberOfColumns = CGFloat(numberOfColumns)
let totalMargin = sectionInset.left + sectionInset.right + collectionView!.safeAreaInsets.left + collectionView!.safeAreaInsets.right
let totalSpacing = minimumInteritemSpacing * (numberOfColumns - 1)
let itemWidth = (collectionView!.bounds.width - totalMargin - totalSpacing)/numberOfColumns
let size = CGSize(size: itemSize, aspectFitToWidth: itemWidth)
return CGSize(width: size.width, height: size.height)
}
}
| Adjust flow layout item size for safe area insets | Adjust flow layout item size for safe area insets
| Swift | mit | caiomello/utilities | swift | ## Code Before:
//
// CollectionView.swift
// Utilities
//
// Created by Caio Mello on August 17, 2017.
// Copyright © 2017 Caio Mello. All rights reserved.
//
import UIKit
extension UICollectionView {
public func scrollToTop(animated: Bool) {
guard let cell = cellForItem(at: IndexPath(item: 0, section: 0)) else { return }
guard let indexPath = indexPath(for: cell) else { return }
scrollToItem(at: indexPath, at: .top, animated: animated)
}
}
extension UICollectionViewFlowLayout {
public func itemSize(withColumns numberOfColumns: Int) -> CGSize {
let numberOfColumns = CGFloat(numberOfColumns)
let totalMargin = sectionInset.left + sectionInset.right
let totalSpacing = minimumInteritemSpacing * (numberOfColumns - 1)
let itemWidth = (collectionView!.bounds.width - totalMargin - totalSpacing)/numberOfColumns
let size = CGSize(size: itemSize, aspectFitToWidth: itemWidth)
return CGSize(width: size.width, height: size.height)
}
}
## Instruction:
Adjust flow layout item size for safe area insets
## Code After:
//
// CollectionView.swift
// Utilities
//
// Created by Caio Mello on August 17, 2017.
// Copyright © 2017 Caio Mello. All rights reserved.
//
import UIKit
extension UICollectionView {
public func scrollToTop(animated: Bool) {
guard let cell = cellForItem(at: IndexPath(item: 0, section: 0)) else { return }
guard let indexPath = indexPath(for: cell) else { return }
scrollToItem(at: indexPath, at: .top, animated: animated)
}
}
extension UICollectionViewFlowLayout {
public func itemSize(withColumns numberOfColumns: Int) -> CGSize {
let numberOfColumns = CGFloat(numberOfColumns)
let totalMargin = sectionInset.left + sectionInset.right + collectionView!.safeAreaInsets.left + collectionView!.safeAreaInsets.right
let totalSpacing = minimumInteritemSpacing * (numberOfColumns - 1)
let itemWidth = (collectionView!.bounds.width - totalMargin - totalSpacing)/numberOfColumns
let size = CGSize(size: itemSize, aspectFitToWidth: itemWidth)
return CGSize(width: size.width, height: size.height)
}
}
| //
// CollectionView.swift
// Utilities
//
// Created by Caio Mello on August 17, 2017.
// Copyright © 2017 Caio Mello. All rights reserved.
//
import UIKit
extension UICollectionView {
public func scrollToTop(animated: Bool) {
guard let cell = cellForItem(at: IndexPath(item: 0, section: 0)) else { return }
guard let indexPath = indexPath(for: cell) else { return }
scrollToItem(at: indexPath, at: .top, animated: animated)
}
}
extension UICollectionViewFlowLayout {
public func itemSize(withColumns numberOfColumns: Int) -> CGSize {
let numberOfColumns = CGFloat(numberOfColumns)
- let totalMargin = sectionInset.left + sectionInset.right
+ let totalMargin = sectionInset.left + sectionInset.right + collectionView!.safeAreaInsets.left + collectionView!.safeAreaInsets.right
let totalSpacing = minimumInteritemSpacing * (numberOfColumns - 1)
let itemWidth = (collectionView!.bounds.width - totalMargin - totalSpacing)/numberOfColumns
let size = CGSize(size: itemSize, aspectFitToWidth: itemWidth)
return CGSize(width: size.width, height: size.height)
}
} | 2 | 0.0625 | 1 | 1 |
3d6fd4d2b51816f253829c26d34b87ed8e0cb300 | maven-meeper/src/bin/m1-m2-conversion/java.net/sync-repoclean.sh | maven-meeper/src/bin/m1-m2-conversion/java.net/sync-repoclean.sh |
dir=/home/maven/repository-staging/to-ibiblio
repocleanhome=$HOME/repository-tools/repoclean
log=$repocleanhome/last-changes-java.net.log
src=maven2-repoclean-java.net/com/sun
dst=maven2/com/sun
cd $dir/maven-java.net
cvs update -P
$repocleanhome/repoclean.sh ~/components/maven-meeper/src/bin/repoclean/java.net/synchronize.properties
rsync --ignore-existing -rvpl $dir/$src/ $dir/$dst/ > $log
for f in `cat $log | grep maven-metadata.xml$` ; do
md5sum $dir/$dst/$f > $dir/$dst/$f.md5;
sha1sum $dir/$dst/$f > $dir/$dst/$f.sha1;
md5sum $dir/$src/$f > $dir/$src/$f.md5;
sha1sum $dir/$src/$f > $dir/$src/$f.sha1;
done
|
dir=/home/maven/repository-staging/to-ibiblio
repocleanhome=$HOME/repository-tools/repoclean
log=$repocleanhome/last-changes-java.net.log
src=maven2-repoclean-java.net/com/sun
dst=maven2/com/sun
cd $dir/maven-java.net
cvs update -P
$repocleanhome/repoclean.sh ~/components/maven-meeper/src/bin/m1-m2-conversion/java.net/synchronize.properties
rsync --ignore-existing -rvpl $dir/$src/ $dir/$dst/ > $log
for f in `cat $log | grep maven-metadata.xml$` ; do
md5sum $dir/$dst/$f > $dir/$dst/$f.md5;
sha1sum $dir/$dst/$f > $dir/$dst/$f.sha1;
md5sum $dir/$src/$f > $dir/$src/$f.md5;
sha1sum $dir/$src/$f > $dir/$src/$f.sha1;
done
| Use new location in script | Use new location in script
git-svn-id: f25645bd54002203a47bb62c0b0afba5efd98acb@463950 13f79535-47bb-0310-9956-ffa450edef68
| Shell | apache-2.0 | Altiscale/archiva,apache/archiva,Altiscale/archiva,Altiscale/archiva,sadlil/archiva,emsouza/archiva,olamy/archiva,ricardojbasilio/archiva,olamy/archiva,apache/archiva,sadlil/archiva,flomotlik/archiva,Altiscale/archiva,sadlil/archiva,flomotlik/archiva,olamy/archiva,ricardojbasilio/archiva,flomotlik/archiva,sadlil/archiva,apache/archiva,emsouza/archiva,emsouza/archiva,apache/archiva,sadlil/archiva,emsouza/archiva,apache/archiva,ricardojbasilio/archiva,flomotlik/archiva,ricardojbasilio/archiva,olamy/archiva | shell | ## Code Before:
dir=/home/maven/repository-staging/to-ibiblio
repocleanhome=$HOME/repository-tools/repoclean
log=$repocleanhome/last-changes-java.net.log
src=maven2-repoclean-java.net/com/sun
dst=maven2/com/sun
cd $dir/maven-java.net
cvs update -P
$repocleanhome/repoclean.sh ~/components/maven-meeper/src/bin/repoclean/java.net/synchronize.properties
rsync --ignore-existing -rvpl $dir/$src/ $dir/$dst/ > $log
for f in `cat $log | grep maven-metadata.xml$` ; do
md5sum $dir/$dst/$f > $dir/$dst/$f.md5;
sha1sum $dir/$dst/$f > $dir/$dst/$f.sha1;
md5sum $dir/$src/$f > $dir/$src/$f.md5;
sha1sum $dir/$src/$f > $dir/$src/$f.sha1;
done
## Instruction:
Use new location in script
git-svn-id: f25645bd54002203a47bb62c0b0afba5efd98acb@463950 13f79535-47bb-0310-9956-ffa450edef68
## Code After:
dir=/home/maven/repository-staging/to-ibiblio
repocleanhome=$HOME/repository-tools/repoclean
log=$repocleanhome/last-changes-java.net.log
src=maven2-repoclean-java.net/com/sun
dst=maven2/com/sun
cd $dir/maven-java.net
cvs update -P
$repocleanhome/repoclean.sh ~/components/maven-meeper/src/bin/m1-m2-conversion/java.net/synchronize.properties
rsync --ignore-existing -rvpl $dir/$src/ $dir/$dst/ > $log
for f in `cat $log | grep maven-metadata.xml$` ; do
md5sum $dir/$dst/$f > $dir/$dst/$f.md5;
sha1sum $dir/$dst/$f > $dir/$dst/$f.sha1;
md5sum $dir/$src/$f > $dir/$src/$f.md5;
sha1sum $dir/$src/$f > $dir/$src/$f.sha1;
done
|
dir=/home/maven/repository-staging/to-ibiblio
repocleanhome=$HOME/repository-tools/repoclean
log=$repocleanhome/last-changes-java.net.log
src=maven2-repoclean-java.net/com/sun
dst=maven2/com/sun
cd $dir/maven-java.net
cvs update -P
- $repocleanhome/repoclean.sh ~/components/maven-meeper/src/bin/repoclean/java.net/synchronize.properties
? ^^ ----
+ $repocleanhome/repoclean.sh ~/components/maven-meeper/src/bin/m1-m2-conversion/java.net/synchronize.properties
? +++++++++++ ^^
rsync --ignore-existing -rvpl $dir/$src/ $dir/$dst/ > $log
for f in `cat $log | grep maven-metadata.xml$` ; do
md5sum $dir/$dst/$f > $dir/$dst/$f.md5;
sha1sum $dir/$dst/$f > $dir/$dst/$f.sha1;
md5sum $dir/$src/$f > $dir/$src/$f.md5;
sha1sum $dir/$src/$f > $dir/$src/$f.sha1;
done | 2 | 0.090909 | 1 | 1 |
c29e247df81887a4c0f9ecc2de0f42c3e7bcff40 | app/serializers/skirmish/player_serializer.rb | app/serializers/skirmish/player_serializer.rb | class Skirmish::PlayerSerializer < ActiveModel::Serializer
attributes :id, :name, :user_id
has_many :cities
end
| require 'digest/md5'
class Skirmish::PlayerSerializer < ActiveModel::Serializer
attributes :id, :name, :user_id, :gravatar_hash
has_many :cities
def gravatar_hash
formatted_email = object.user.present? ? object.user.email.strip.downcase : 'barbarian'
email_hash = Digest::MD5.hexdigest(formatted_email)
email_hash
end
end
| Include gravatar hash in generated Player json | Include gravatar hash in generated Player json
| Ruby | mit | RantGames/skirmish,RantGames/skirmish,RantGames/skirmish | ruby | ## Code Before:
class Skirmish::PlayerSerializer < ActiveModel::Serializer
attributes :id, :name, :user_id
has_many :cities
end
## Instruction:
Include gravatar hash in generated Player json
## Code After:
require 'digest/md5'
class Skirmish::PlayerSerializer < ActiveModel::Serializer
attributes :id, :name, :user_id, :gravatar_hash
has_many :cities
def gravatar_hash
formatted_email = object.user.present? ? object.user.email.strip.downcase : 'barbarian'
email_hash = Digest::MD5.hexdigest(formatted_email)
email_hash
end
end
| + require 'digest/md5'
+
class Skirmish::PlayerSerializer < ActiveModel::Serializer
- attributes :id, :name, :user_id
+ attributes :id, :name, :user_id, :gravatar_hash
? ++++++++++++++++
has_many :cities
+
+ def gravatar_hash
+ formatted_email = object.user.present? ? object.user.email.strip.downcase : 'barbarian'
+ email_hash = Digest::MD5.hexdigest(formatted_email)
+ email_hash
+ end
end | 10 | 2.5 | 9 | 1 |
989437883ed480ddd37703aee4a29c652ed485d1 | spec/controllers/spree/admin/variants_controller_spec.rb | spec/controllers/spree/admin/variants_controller_spec.rb | RSpec.describe Spree::Admin::VariantsController, type: :controller do
stub_authorization!
context 'PUT #update' do
it 'creates a volume price' do
variant = create :variant
expect do
spree_put :update,
product_id: variant.product.slug,
id: variant.id,
variant: {
'volume_prices_attributes' => {
'1335830259720' => {
'name' => '5-10',
'discount_type' => 'price',
'range' => '5..10',
'amount' => '90',
'position' => '1',
'_destroy' => 'false'
}
}
}
end.to change(variant.volume_prices, :count).by(1)
end
end
end
| RSpec.describe Spree::Admin::VariantsController, type: :controller do
stub_authorization!
context 'PUT #update' do
it 'creates a volume price' do
variant = create :variant
expect do
put :update, params: {
product_id: variant.product.slug,
id: variant.id,
variant: {
'volume_prices_attributes' => {
'1335830259720' => {
'name' => '5-10',
'discount_type' => 'price',
'range' => '5..10',
'amount' => '90',
'position' => '1',
'_destroy' => 'false'
}
}
}
}
end.to change(variant.volume_prices, :count).by(1)
end
end
end
| Fix failing admin/variants controller spec | Fix failing admin/variants controller spec
| Ruby | bsd-3-clause | solidusio-contrib/solidus_volume_pricing,solidusio-contrib/solidus_volume_pricing,solidusio-contrib/solidus_volume_pricing,solidusio-contrib/solidus_volume_pricing | ruby | ## Code Before:
RSpec.describe Spree::Admin::VariantsController, type: :controller do
stub_authorization!
context 'PUT #update' do
it 'creates a volume price' do
variant = create :variant
expect do
spree_put :update,
product_id: variant.product.slug,
id: variant.id,
variant: {
'volume_prices_attributes' => {
'1335830259720' => {
'name' => '5-10',
'discount_type' => 'price',
'range' => '5..10',
'amount' => '90',
'position' => '1',
'_destroy' => 'false'
}
}
}
end.to change(variant.volume_prices, :count).by(1)
end
end
end
## Instruction:
Fix failing admin/variants controller spec
## Code After:
RSpec.describe Spree::Admin::VariantsController, type: :controller do
stub_authorization!
context 'PUT #update' do
it 'creates a volume price' do
variant = create :variant
expect do
put :update, params: {
product_id: variant.product.slug,
id: variant.id,
variant: {
'volume_prices_attributes' => {
'1335830259720' => {
'name' => '5-10',
'discount_type' => 'price',
'range' => '5..10',
'amount' => '90',
'position' => '1',
'_destroy' => 'false'
}
}
}
}
end.to change(variant.volume_prices, :count).by(1)
end
end
end
| RSpec.describe Spree::Admin::VariantsController, type: :controller do
stub_authorization!
context 'PUT #update' do
it 'creates a volume price' do
variant = create :variant
expect do
- spree_put :update,
+ put :update, params: {
- product_id: variant.product.slug,
? --------
+ product_id: variant.product.slug,
- id: variant.id,
? --------
+ id: variant.id,
- variant: {
? --------
+ variant: {
- 'volume_prices_attributes' => {
? --------
+ 'volume_prices_attributes' => {
- '1335830259720' => {
? --------
+ '1335830259720' => {
- 'name' => '5-10',
? --------
+ 'name' => '5-10',
- 'discount_type' => 'price',
? --------
+ 'discount_type' => 'price',
- 'range' => '5..10',
? --------
+ 'range' => '5..10',
- 'amount' => '90',
? --------
+ 'amount' => '90',
- 'position' => '1',
? --------
+ 'position' => '1',
- '_destroy' => 'false'
? --------
+ '_destroy' => 'false'
- }
- }
- }
? ----
+ }
+ }
+ }
+ }
end.to change(variant.volume_prices, :count).by(1)
end
end
end | 31 | 1.148148 | 16 | 15 |
91ed9040ccd112ac47e36612d0b8342c2a9eb90c | git-duet.rb | git-duet.rb | class GitDuet < Formula
desc "Pairing tool for Git"
homepage "https://github.com/git-duet/git-duet"
version "0.5.0"
if OS.mac?
url "https://github.com/git-duet/git-duet/releases/download/0.5.0/darwin_amd64.tar.gz"
sha256 "adc9fe97c99e92fdb160ad29413ec437e125d454590f41be1b91924a4c9efb09"
elsif OS.linux?
url "https://github.com/git-duet/git-duet/releases/download/0.5.0/linux_amd64.tar.gz"
sha256 "e4f767b4c41772641b9178ed3f1d45f6f5f1d3b9b8509fe7016f5376aa181474"
end
depends_on :arch => :x86_64
def install
%w[git-duet git-duet-commit git-duet-revert git-duet-install-hook git-duet-merge git-duet-pre-commit git-solo].each do |exe|
bin.install exe
end
end
test do
system "git", "duet", "-h"
end
end
| class GitDuet < Formula
desc "Pairing tool for Git"
homepage "https://github.com/git-duet/git-duet"
version "0.5.0"
if OS.mac?
url "https://github.com/git-duet/git-duet/releases/download/0.5.0/darwin_amd64.tar.gz"
sha256 "88050ceb98480a7917106180c4d81764f94db5719ad3b458b90ac7af6cee9849"
elsif OS.linux?
url "https://github.com/git-duet/git-duet/releases/download/0.5.0/linux_amd64.tar.gz"
sha256 "37ddd1285b5a58c4c3f03cc310a5b0d4af7eaa7a24ce44fd69206fe25aabd949"
end
depends_on :arch => :x86_64
def install
%w[git-duet git-duet-commit git-duet-revert git-duet-install-hook git-duet-merge git-duet-pre-commit git-solo].each do |exe|
bin.install exe
end
end
test do
system "git", "duet", "-h"
end
end
| Update SHAs of 0.5.0 tarballs | Update SHAs of 0.5.0 tarballs
The initial release of 0.5.0 contained the wrong binaries, see:
https://github.com/git-duet/git-duet/issues/40
| Ruby | mit | git-duet/homebrew-tap | ruby | ## Code Before:
class GitDuet < Formula
desc "Pairing tool for Git"
homepage "https://github.com/git-duet/git-duet"
version "0.5.0"
if OS.mac?
url "https://github.com/git-duet/git-duet/releases/download/0.5.0/darwin_amd64.tar.gz"
sha256 "adc9fe97c99e92fdb160ad29413ec437e125d454590f41be1b91924a4c9efb09"
elsif OS.linux?
url "https://github.com/git-duet/git-duet/releases/download/0.5.0/linux_amd64.tar.gz"
sha256 "e4f767b4c41772641b9178ed3f1d45f6f5f1d3b9b8509fe7016f5376aa181474"
end
depends_on :arch => :x86_64
def install
%w[git-duet git-duet-commit git-duet-revert git-duet-install-hook git-duet-merge git-duet-pre-commit git-solo].each do |exe|
bin.install exe
end
end
test do
system "git", "duet", "-h"
end
end
## Instruction:
Update SHAs of 0.5.0 tarballs
The initial release of 0.5.0 contained the wrong binaries, see:
https://github.com/git-duet/git-duet/issues/40
## Code After:
class GitDuet < Formula
desc "Pairing tool for Git"
homepage "https://github.com/git-duet/git-duet"
version "0.5.0"
if OS.mac?
url "https://github.com/git-duet/git-duet/releases/download/0.5.0/darwin_amd64.tar.gz"
sha256 "88050ceb98480a7917106180c4d81764f94db5719ad3b458b90ac7af6cee9849"
elsif OS.linux?
url "https://github.com/git-duet/git-duet/releases/download/0.5.0/linux_amd64.tar.gz"
sha256 "37ddd1285b5a58c4c3f03cc310a5b0d4af7eaa7a24ce44fd69206fe25aabd949"
end
depends_on :arch => :x86_64
def install
%w[git-duet git-duet-commit git-duet-revert git-duet-install-hook git-duet-merge git-duet-pre-commit git-solo].each do |exe|
bin.install exe
end
end
test do
system "git", "duet", "-h"
end
end
| class GitDuet < Formula
desc "Pairing tool for Git"
homepage "https://github.com/git-duet/git-duet"
version "0.5.0"
if OS.mac?
url "https://github.com/git-duet/git-duet/releases/download/0.5.0/darwin_amd64.tar.gz"
- sha256 "adc9fe97c99e92fdb160ad29413ec437e125d454590f41be1b91924a4c9efb09"
+ sha256 "88050ceb98480a7917106180c4d81764f94db5719ad3b458b90ac7af6cee9849"
elsif OS.linux?
url "https://github.com/git-duet/git-duet/releases/download/0.5.0/linux_amd64.tar.gz"
- sha256 "e4f767b4c41772641b9178ed3f1d45f6f5f1d3b9b8509fe7016f5376aa181474"
+ sha256 "37ddd1285b5a58c4c3f03cc310a5b0d4af7eaa7a24ce44fd69206fe25aabd949"
end
depends_on :arch => :x86_64
def install
%w[git-duet git-duet-commit git-duet-revert git-duet-install-hook git-duet-merge git-duet-pre-commit git-solo].each do |exe|
bin.install exe
end
end
test do
system "git", "duet", "-h"
end
end | 4 | 0.166667 | 2 | 2 |
adcee1cb849943aa555eb5f0f6d6fe51197f0dfe | share/qtcreator/templates/qtquickapp/qmlapplicationviewer/qmlapplicationviewer.pri | share/qtcreator/templates/qtquickapp/qmlapplicationviewer/qmlapplicationviewer.pri |
QT += declarative
SOURCES += $$PWD/qmlapplicationviewer.cpp
HEADERS += $$PWD/qmlapplicationviewer.h
INCLUDEPATH += $$PWD
# Include JS debugger library if QMLJSDEBUGGER_PATH is set
!isEmpty(QMLJSDEBUGGER_PATH) {
include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
} else {
DEFINES -= QMLJSDEBUGGER
}
|
QT += declarative
SOURCES += $$PWD/qmlapplicationviewer.cpp
HEADERS += $$PWD/qmlapplicationviewer.h
INCLUDEPATH += $$PWD
| Remove qmljs debugging helper setup code from QtQuickApp template | Remove qmljs debugging helper setup code from QtQuickApp template
Change-Id: Ia979c37c8f0ae77e2390951a547098461474313c
Reviewed-by: Kai Koehne <077bc265216106fb22408e62f2d97925ede69d10@digia.com>
| QMake | lgpl-2.1 | colede/qtcreator,omniacreator/qtcreator,danimo/qt-creator,farseerri/git_code,xianian/qt-creator,xianian/qt-creator,richardmg/qtcreator,amyvmiwei/qt-creator,omniacreator/qtcreator,maui-packages/qt-creator,darksylinc/qt-creator,AltarBeastiful/qt-creator,Distrotech/qtcreator,Distrotech/qtcreator,Distrotech/qtcreator,xianian/qt-creator,colede/qtcreator,richardmg/qtcreator,danimo/qt-creator,martyone/sailfish-qtcreator,martyone/sailfish-qtcreator,danimo/qt-creator,martyone/sailfish-qtcreator,danimo/qt-creator,richardmg/qtcreator,farseerri/git_code,kuba1/qtcreator,xianian/qt-creator,farseerri/git_code,maui-packages/qt-creator,colede/qtcreator,darksylinc/qt-creator,martyone/sailfish-qtcreator,AltarBeastiful/qt-creator,colede/qtcreator,martyone/sailfish-qtcreator,omniacreator/qtcreator,danimo/qt-creator,amyvmiwei/qt-creator,omniacreator/qtcreator,xianian/qt-creator,kuba1/qtcreator,maui-packages/qt-creator,kuba1/qtcreator,darksylinc/qt-creator,kuba1/qtcreator,AltarBeastiful/qt-creator,maui-packages/qt-creator,Distrotech/qtcreator,colede/qtcreator,richardmg/qtcreator,kuba1/qtcreator,amyvmiwei/qt-creator,AltarBeastiful/qt-creator,amyvmiwei/qt-creator,martyone/sailfish-qtcreator,kuba1/qtcreator,martyone/sailfish-qtcreator,richardmg/qtcreator,farseerri/git_code,AltarBeastiful/qt-creator,farseerri/git_code,omniacreator/qtcreator,darksylinc/qt-creator,colede/qtcreator,danimo/qt-creator,danimo/qt-creator,farseerri/git_code,AltarBeastiful/qt-creator,farseerri/git_code,Distrotech/qtcreator,xianian/qt-creator,danimo/qt-creator,colede/qtcreator,maui-packages/qt-creator,Distrotech/qtcreator,farseerri/git_code,danimo/qt-creator,darksylinc/qt-creator,richardmg/qtcreator,amyvmiwei/qt-creator,omniacreator/qtcreator,amyvmiwei/qt-creator,kuba1/qtcreator,omniacreator/qtcreator,martyone/sailfish-qtcreator,xianian/qt-creator,darksylinc/qt-creator,xianian/qt-creator,maui-packages/qt-creator,amyvmiwei/qt-creator,maui-packages/qt-creator,AltarBeastiful/qt-creator,darksylinc/qt-creator,darksylinc/qt-creator,richardmg/qtcreator,martyone/sailfish-qtcreator,amyvmiwei/qt-creator,kuba1/qtcreator,xianian/qt-creator,kuba1/qtcreator,Distrotech/qtcreator,AltarBeastiful/qt-creator | qmake | ## Code Before:
QT += declarative
SOURCES += $$PWD/qmlapplicationviewer.cpp
HEADERS += $$PWD/qmlapplicationviewer.h
INCLUDEPATH += $$PWD
# Include JS debugger library if QMLJSDEBUGGER_PATH is set
!isEmpty(QMLJSDEBUGGER_PATH) {
include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
} else {
DEFINES -= QMLJSDEBUGGER
}
## Instruction:
Remove qmljs debugging helper setup code from QtQuickApp template
Change-Id: Ia979c37c8f0ae77e2390951a547098461474313c
Reviewed-by: Kai Koehne <077bc265216106fb22408e62f2d97925ede69d10@digia.com>
## Code After:
QT += declarative
SOURCES += $$PWD/qmlapplicationviewer.cpp
HEADERS += $$PWD/qmlapplicationviewer.h
INCLUDEPATH += $$PWD
|
QT += declarative
SOURCES += $$PWD/qmlapplicationviewer.cpp
HEADERS += $$PWD/qmlapplicationviewer.h
INCLUDEPATH += $$PWD
-
- # Include JS debugger library if QMLJSDEBUGGER_PATH is set
- !isEmpty(QMLJSDEBUGGER_PATH) {
- include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
- } else {
- DEFINES -= QMLJSDEBUGGER
- } | 7 | 0.538462 | 0 | 7 |
96e80a3ebb8e207adf5ccdc30bb9eca72ae652c8 | README.md | README.md | Raspberrywhite
==============
[![Build Status][travis-image]][travis-url] [![Coveralls Status][coveralls-image]][coveralls-url]
Your tiny social player. Use your MP3 collection to create a modern, portable and funny jukebox with Raspberry Pi.
Install dependencies
--------------------
$ pip install -r requirements.txt
Make it running
---------------
$ ./run.sh
Hacking ideas
-------------
Coming soon...
Test
----
Enter your virtual env and install requirements
$ pip install -r requirements-test.txt
Launch
$ python manage.py test
[travis-url]: https://travis-ci.org/raspberrywhite/raspberrywhite
[travis-image]: http://img.shields.io/travis/raspberrywhite/raspberrywhite.svg
[coveralls-url]: https://coveralls.io/r/raspberrywhite/raspberrywhite
[coveralls-image]: http://img.shields.io/coveralls/raspberrywhite/raspberrywhite/master.svg
| Raspberrywhite
==============
[![Build Status][travis-image]][travis-url] [![Coveralls Status][coveralls-image]][coveralls-url]
Your tiny social player. Use your MP3 collection to create a modern, portable and funny jukebox with Raspberry Pi.
Install dependencies
--------------------
$ pip install -r requirements.txt
Troubleshouting
---------------
Under OSX 10.10.5 and 10.11.x is it possible to get an error while installing ```gevent`` package from **pip** it can be fixed installing gevent with this command:
```
CFLAGS='-std=c99' pip install gevent==1.0.1
```
Make it running
---------------
$ ./run.sh
Hacking ideas
-------------
Coming soon...
Test
----
Enter your virtual env and install requirements
$ pip install -r requirements-test.txt
Launch
$ python manage.py test
[travis-url]: https://travis-ci.org/raspberrywhite/raspberrywhite
[travis-image]: http://img.shields.io/travis/raspberrywhite/raspberrywhite.svg
[coveralls-url]: https://coveralls.io/r/raspberrywhite/raspberrywhite
[coveralls-image]: http://img.shields.io/coveralls/raspberrywhite/raspberrywhite/master.svg
| Update instructions to correctly fix gevent installation | Update instructions to correctly fix gevent installation | Markdown | bsd-3-clause | raspberrywhite/raspberrywhite,raspberrywhite/raspberrywhite,raspberrywhite/raspberrywhite,raspberrywhite/raspberrywhite | markdown | ## Code Before:
Raspberrywhite
==============
[![Build Status][travis-image]][travis-url] [![Coveralls Status][coveralls-image]][coveralls-url]
Your tiny social player. Use your MP3 collection to create a modern, portable and funny jukebox with Raspberry Pi.
Install dependencies
--------------------
$ pip install -r requirements.txt
Make it running
---------------
$ ./run.sh
Hacking ideas
-------------
Coming soon...
Test
----
Enter your virtual env and install requirements
$ pip install -r requirements-test.txt
Launch
$ python manage.py test
[travis-url]: https://travis-ci.org/raspberrywhite/raspberrywhite
[travis-image]: http://img.shields.io/travis/raspberrywhite/raspberrywhite.svg
[coveralls-url]: https://coveralls.io/r/raspberrywhite/raspberrywhite
[coveralls-image]: http://img.shields.io/coveralls/raspberrywhite/raspberrywhite/master.svg
## Instruction:
Update instructions to correctly fix gevent installation
## Code After:
Raspberrywhite
==============
[![Build Status][travis-image]][travis-url] [![Coveralls Status][coveralls-image]][coveralls-url]
Your tiny social player. Use your MP3 collection to create a modern, portable and funny jukebox with Raspberry Pi.
Install dependencies
--------------------
$ pip install -r requirements.txt
Troubleshouting
---------------
Under OSX 10.10.5 and 10.11.x is it possible to get an error while installing ```gevent`` package from **pip** it can be fixed installing gevent with this command:
```
CFLAGS='-std=c99' pip install gevent==1.0.1
```
Make it running
---------------
$ ./run.sh
Hacking ideas
-------------
Coming soon...
Test
----
Enter your virtual env and install requirements
$ pip install -r requirements-test.txt
Launch
$ python manage.py test
[travis-url]: https://travis-ci.org/raspberrywhite/raspberrywhite
[travis-image]: http://img.shields.io/travis/raspberrywhite/raspberrywhite.svg
[coveralls-url]: https://coveralls.io/r/raspberrywhite/raspberrywhite
[coveralls-image]: http://img.shields.io/coveralls/raspberrywhite/raspberrywhite/master.svg
| Raspberrywhite
==============
[![Build Status][travis-image]][travis-url] [![Coveralls Status][coveralls-image]][coveralls-url]
Your tiny social player. Use your MP3 collection to create a modern, portable and funny jukebox with Raspberry Pi.
Install dependencies
--------------------
$ pip install -r requirements.txt
+
+ Troubleshouting
+ ---------------
+
+ Under OSX 10.10.5 and 10.11.x is it possible to get an error while installing ```gevent`` package from **pip** it can be fixed installing gevent with this command:
+
+ ```
+ CFLAGS='-std=c99' pip install gevent==1.0.1
+ ```
Make it running
---------------
$ ./run.sh
Hacking ideas
-------------
Coming soon...
Test
----
Enter your virtual env and install requirements
$ pip install -r requirements-test.txt
Launch
$ python manage.py test
[travis-url]: https://travis-ci.org/raspberrywhite/raspberrywhite
[travis-image]: http://img.shields.io/travis/raspberrywhite/raspberrywhite.svg
[coveralls-url]: https://coveralls.io/r/raspberrywhite/raspberrywhite
[coveralls-image]: http://img.shields.io/coveralls/raspberrywhite/raspberrywhite/master.svg | 9 | 0.257143 | 9 | 0 |
07de15e271618283ea5a93d63262fbe92cbabc05 | 201-vmss-msi/nestedtemplates/setUpRBAC.json | 201-vmss-msi/nestedtemplates/setUpRBAC.json | {
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"principalId": {
"type": "string",
"metadata": {
"description": "Principal ID to set the access for"
}
},
"storageAccountName": {
"type": "string",
"metadata": {
"description": "The storage account to set access for"
}
}
},
"variables": {
"contributor": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/', 'b24988ac-6180-42a0-ab88-20f7382dd24c')]",
"RBACResourceName": "[concat(parameters('storageAccountName'), '/Microsoft.Authorization/', parameters('principalId'))]"
},
"resources": [
{
"apiVersion": "2016-07-01",
"name": "[variables('RBACResourceName')]",
"type": "Microsoft.Storage/storageAccounts/providers/roleAssignments",
"properties": {
"roleDefinitionId": "[variables('contributor')]",
"principalId": "[parameters('principalId')]",
"scope": "[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName'))]"
}
}
]
}
| {
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"principalId": {
"type": "string",
"metadata": {
"description": "Principal ID to set the access for"
}
},
"storageAccountName": {
"type": "string",
"metadata": {
"description": "The storage account to set access for"
}
}
},
"variables": {
"contributor": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/', 'b24988ac-6180-42a0-ab88-20f7382dd24c')]",
"RBACResourceName": "[concat(parameters('storageAccountName'), '/Microsoft.Authorization/', parameters('principalId'))]"
},
"resources": [
{
"apiVersion": "2018-09-01-preview",
"name": "[variables('RBACResourceName')]",
"type": "Microsoft.Storage/storageAccounts/providers/roleAssignments",
"properties": {
"roleDefinitionId": "[variables('contributor')]",
"principalId": "[parameters('principalId')]",
"principalType":"ServicePrincipal",
"scope": "[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName'))]"
}
}
]
}
| Add principleType to avoid race condition | Add principleType to avoid race condition
Setting the principleType to ServicePrincipal to avoid possible race conditions that exist when attempting to use a new service principal before it has replicated throughout the AAD tenant. I also updated the API version to the version that supports the principleType property. | JSON | mit | takekazuomi/azure-quickstart-templates,MCKLMT/azure-quickstart-templates,mumian/azure-quickstart-templates,simongdavies/azure-quickstart-templates,takekazuomi/azure-quickstart-templates,robotechredmond/azure-quickstart-templates,mumian/azure-quickstart-templates,bmoore-msft/azure-quickstart-templates,MCKLMT/azure-quickstart-templates,bmoore-msft/azure-quickstart-templates,tfitzmac/azure-quickstart-templates,daltskin/azure-quickstart-templates,takekazuomi/azure-quickstart-templates,johndowns/azure-quickstart-templates,sabbour/azure-quickstart-templates,tfitzmac/azure-quickstart-templates,simongdavies/azure-quickstart-templates,nilaydshah/azure-quickstart-templates,mumian/azure-quickstart-templates,nzthiago/azure-quickstart-templates,Azure/azure-quickstart-templates,johndowns/azure-quickstart-templates,johndowns/azure-quickstart-templates,daltskin/azure-quickstart-templates,nilaydshah/azure-quickstart-templates,simongdavies/azure-quickstart-templates,takekazuomi/azure-quickstart-templates,nzthiago/azure-quickstart-templates,jmservera/azure-quickstart-templates,neudesic/azure-quickstart-templates,Azure/azure-quickstart-templates,matt1883/azure-quickstart-templates,mumian/azure-quickstart-templates,mumian/azure-quickstart-templates,MCKLMT/azure-quickstart-templates,matt1883/azure-quickstart-templates,robotechredmond/azure-quickstart-templates,takekazuomi/azure-quickstart-templates,Azure/azure-quickstart-templates,robotechredmond/azure-quickstart-templates,tfitzmac/azure-quickstart-templates,robotechredmond/azure-quickstart-templates,bmoore-msft/azure-quickstart-templates,johndowns/azure-quickstart-templates,MCKLMT/azure-quickstart-templates,nzthiago/azure-quickstart-templates,sabbour/azure-quickstart-templates,simongdavies/azure-quickstart-templates,jmservera/azure-quickstart-templates,daltskin/azure-quickstart-templates,nzthiago/azure-quickstart-templates,bmoore-msft/azure-quickstart-templates,mumian/azure-quickstart-templates,nilaydshah/azure-quickstart-templates,neudesic/azure-quickstart-templates,Azure/azure-quickstart-templates,bmoore-msft/azure-quickstart-templates,robotechredmond/azure-quickstart-templates,nilaydshah/azure-quickstart-templates,MCKLMT/azure-quickstart-templates,mumian/azure-quickstart-templates,robotechredmond/azure-quickstart-templates,simongdavies/azure-quickstart-templates,neudesic/azure-quickstart-templates,robotechredmond/azure-quickstart-templates,mumian/azure-quickstart-templates,simongdavies/azure-quickstart-templates,neudesic/azure-quickstart-templates,daltskin/azure-quickstart-templates,simongdavies/azure-quickstart-templates,matt1883/azure-quickstart-templates,jmservera/azure-quickstart-templates,bmoore-msft/azure-quickstart-templates,jmservera/azure-quickstart-templates,tfitzmac/azure-quickstart-templates,slapointe/azure-quickstart-templates,slapointe/azure-quickstart-templates,takekazuomi/azure-quickstart-templates,sabbour/azure-quickstart-templates,tfitzmac/azure-quickstart-templates,slapointe/azure-quickstart-templates,Azure/azure-quickstart-templates,mumian/azure-quickstart-templates,sabbour/azure-quickstart-templates,nzthiago/azure-quickstart-templates,MCKLMT/azure-quickstart-templates,simongdavies/azure-quickstart-templates,nzthiago/azure-quickstart-templates,jmservera/azure-quickstart-templates,slapointe/azure-quickstart-templates,Azure/azure-quickstart-templates,robotechredmond/azure-quickstart-templates,nilaydshah/azure-quickstart-templates,nilaydshah/azure-quickstart-templates,slapointe/azure-quickstart-templates,simongdavies/azure-quickstart-templates,jmservera/azure-quickstart-templates,matt1883/azure-quickstart-templates,MCKLMT/azure-quickstart-templates,takekazuomi/azure-quickstart-templates,takekazuomi/azure-quickstart-templates,neudesic/azure-quickstart-templates,slapointe/azure-quickstart-templates,tfitzmac/azure-quickstart-templates,robotechredmond/azure-quickstart-templates,johndowns/azure-quickstart-templates,johndowns/azure-quickstart-templates,neudesic/azure-quickstart-templates,MCKLMT/azure-quickstart-templates | json | ## Code Before:
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"principalId": {
"type": "string",
"metadata": {
"description": "Principal ID to set the access for"
}
},
"storageAccountName": {
"type": "string",
"metadata": {
"description": "The storage account to set access for"
}
}
},
"variables": {
"contributor": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/', 'b24988ac-6180-42a0-ab88-20f7382dd24c')]",
"RBACResourceName": "[concat(parameters('storageAccountName'), '/Microsoft.Authorization/', parameters('principalId'))]"
},
"resources": [
{
"apiVersion": "2016-07-01",
"name": "[variables('RBACResourceName')]",
"type": "Microsoft.Storage/storageAccounts/providers/roleAssignments",
"properties": {
"roleDefinitionId": "[variables('contributor')]",
"principalId": "[parameters('principalId')]",
"scope": "[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName'))]"
}
}
]
}
## Instruction:
Add principleType to avoid race condition
Setting the principleType to ServicePrincipal to avoid possible race conditions that exist when attempting to use a new service principal before it has replicated throughout the AAD tenant. I also updated the API version to the version that supports the principleType property.
## Code After:
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"principalId": {
"type": "string",
"metadata": {
"description": "Principal ID to set the access for"
}
},
"storageAccountName": {
"type": "string",
"metadata": {
"description": "The storage account to set access for"
}
}
},
"variables": {
"contributor": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/', 'b24988ac-6180-42a0-ab88-20f7382dd24c')]",
"RBACResourceName": "[concat(parameters('storageAccountName'), '/Microsoft.Authorization/', parameters('principalId'))]"
},
"resources": [
{
"apiVersion": "2018-09-01-preview",
"name": "[variables('RBACResourceName')]",
"type": "Microsoft.Storage/storageAccounts/providers/roleAssignments",
"properties": {
"roleDefinitionId": "[variables('contributor')]",
"principalId": "[parameters('principalId')]",
"principalType":"ServicePrincipal",
"scope": "[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName'))]"
}
}
]
}
| {
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"principalId": {
"type": "string",
"metadata": {
"description": "Principal ID to set the access for"
}
},
"storageAccountName": {
"type": "string",
"metadata": {
"description": "The storage account to set access for"
}
}
},
"variables": {
"contributor": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/', 'b24988ac-6180-42a0-ab88-20f7382dd24c')]",
"RBACResourceName": "[concat(parameters('storageAccountName'), '/Microsoft.Authorization/', parameters('principalId'))]"
},
"resources": [
{
- "apiVersion": "2016-07-01",
? ^ ^
+ "apiVersion": "2018-09-01-preview",
? ^ ^ ++++++++
"name": "[variables('RBACResourceName')]",
"type": "Microsoft.Storage/storageAccounts/providers/roleAssignments",
"properties": {
"roleDefinitionId": "[variables('contributor')]",
"principalId": "[parameters('principalId')]",
+ "principalType":"ServicePrincipal",
"scope": "[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName'))]"
}
}
]
} | 3 | 0.088235 | 2 | 1 |
9f5280521cb3d5937b18d1a40ea6ba0a80fcd1c2 | test/chpldoc/classes/methodOutsideClassDef.chpl | test/chpldoc/classes/methodOutsideClassDef.chpl | /* This class will declare a method inside itself, but will have a
method declared outside it as well */
class Foo {
proc internalMeth() {
}
}
// We expect these two methods to be printed outside of the class indentation
// level
proc Foo.externalMeth1() {
}
/* This method has a comment attached to it */
proc Foo.externalMeth2() {
}
| /* This class will declare a method inside itself, but will have a
method declared outside it as well */
class Foo {
proc internalMeth() {
}
}
// We expect these two methods to be printed outside of the class indentation
// level
proc Foo.externalMeth1() {
}
/* This method has a comment attached to it */
proc Foo.externalMeth2() {
}
/* Declares one primary and one secondary method... */
record Bar {
/* A primary method declaration. */
proc internal() {}
}
/* A secondary method declaration. */
proc Bar.external() {}
| Add record with secondary method to chpldoc/ tests. | Add record with secondary method to chpldoc/ tests.
| Chapel | apache-2.0 | hildeth/chapel,chizarlicious/chapel,CoryMcCartan/chapel,hildeth/chapel,chizarlicious/chapel,hildeth/chapel,hildeth/chapel,chizarlicious/chapel,CoryMcCartan/chapel,chizarlicious/chapel,CoryMcCartan/chapel,chizarlicious/chapel,CoryMcCartan/chapel,chizarlicious/chapel,hildeth/chapel,hildeth/chapel,CoryMcCartan/chapel,chizarlicious/chapel,CoryMcCartan/chapel,CoryMcCartan/chapel,hildeth/chapel | chapel | ## Code Before:
/* This class will declare a method inside itself, but will have a
method declared outside it as well */
class Foo {
proc internalMeth() {
}
}
// We expect these two methods to be printed outside of the class indentation
// level
proc Foo.externalMeth1() {
}
/* This method has a comment attached to it */
proc Foo.externalMeth2() {
}
## Instruction:
Add record with secondary method to chpldoc/ tests.
## Code After:
/* This class will declare a method inside itself, but will have a
method declared outside it as well */
class Foo {
proc internalMeth() {
}
}
// We expect these two methods to be printed outside of the class indentation
// level
proc Foo.externalMeth1() {
}
/* This method has a comment attached to it */
proc Foo.externalMeth2() {
}
/* Declares one primary and one secondary method... */
record Bar {
/* A primary method declaration. */
proc internal() {}
}
/* A secondary method declaration. */
proc Bar.external() {}
| /* This class will declare a method inside itself, but will have a
method declared outside it as well */
class Foo {
proc internalMeth() {
}
}
// We expect these two methods to be printed outside of the class indentation
// level
proc Foo.externalMeth1() {
}
/* This method has a comment attached to it */
proc Foo.externalMeth2() {
}
+
+ /* Declares one primary and one secondary method... */
+ record Bar {
+ /* A primary method declaration. */
+ proc internal() {}
+ }
+
+ /* A secondary method declaration. */
+ proc Bar.external() {} | 9 | 0.5 | 9 | 0 |
be08302ec56fd55179725859b47758e934263b08 | __tests__/index.js | __tests__/index.js | /* eslint comma-dangle: 0 */
import createCachedSelector from '../index';
let memoizedFunction;
beforeEach(() => {
memoizedFunction = jest.fn();
});
describe('createCachedSelector', () => {
it('Should use the same cached selector when resolver function returns the same string', () => {
const cachedSelector = createCachedSelector(
memoizedFunction,
)(
(arg1, arg2) => arg2, // Resolver
);
const firstCall = cachedSelector('foo', 'bar');
const secondCallWithSameResolver = cachedSelector('foo', 'bar');
expect(memoizedFunction.mock.calls.length).toBe(1);
});
it('Should create 2 different selectors when resolver function returns different strings', () => {
const cachedSelector = createCachedSelector(
memoizedFunction,
)(
(arg1, arg2) => arg2, // Resolver
);
const firstCallResult = cachedSelector('foo', 'bar');
const secondCallWithDifferentResolver = cachedSelector('foo', 'moo');
expect(memoizedFunction.mock.calls.length).toBe(2);
});
});
| /* eslint comma-dangle: 0 */
import createCachedSelector from '../index';
let memoizedFunction;
beforeEach(() => {
memoizedFunction = jest.fn();
});
describe('createCachedSelector', () => {
it('Should use the same cached selector when resolver function returns the same string', () => {
const cachedSelector = createCachedSelector(
memoizedFunction,
)(
(arg1, arg2) => arg2, // Resolver
);
const firstCall = cachedSelector('foo', 'bar');
const secondCallWithSameResolver = cachedSelector('foo', 'bar');
expect(memoizedFunction.mock.calls.length).toBe(1);
});
it('Should create 2 different selectors when resolver function returns different strings', () => {
const cachedSelector = createCachedSelector(
memoizedFunction,
)(
(arg1, arg2) => arg2, // Resolver
);
const firstCallResult = cachedSelector('foo', 'bar');
const secondCallWithDifferentResolver = cachedSelector('foo', 'moo');
expect(memoizedFunction.mock.calls.length).toBe(2);
});
it('Should return "undefined" if provided resolver does not return a string', () => {
const cachedSelector = createCachedSelector(
memoizedFunction,
)(
() => {}, // Resolver
);
const firstCallResult = cachedSelector('foo', 'bar');
expect(memoizedFunction.mock.calls.length).toBe(0);
expect(firstCallResult).toBe(undefined);
});
});
| Extend test cases to resolver function returning a non string | Extend test cases to resolver function returning a non string
| JavaScript | mit | rufman/re-reselect,toomuchdesign/re-reselect,toomuchdesign/re-reselect | javascript | ## Code Before:
/* eslint comma-dangle: 0 */
import createCachedSelector from '../index';
let memoizedFunction;
beforeEach(() => {
memoizedFunction = jest.fn();
});
describe('createCachedSelector', () => {
it('Should use the same cached selector when resolver function returns the same string', () => {
const cachedSelector = createCachedSelector(
memoizedFunction,
)(
(arg1, arg2) => arg2, // Resolver
);
const firstCall = cachedSelector('foo', 'bar');
const secondCallWithSameResolver = cachedSelector('foo', 'bar');
expect(memoizedFunction.mock.calls.length).toBe(1);
});
it('Should create 2 different selectors when resolver function returns different strings', () => {
const cachedSelector = createCachedSelector(
memoizedFunction,
)(
(arg1, arg2) => arg2, // Resolver
);
const firstCallResult = cachedSelector('foo', 'bar');
const secondCallWithDifferentResolver = cachedSelector('foo', 'moo');
expect(memoizedFunction.mock.calls.length).toBe(2);
});
});
## Instruction:
Extend test cases to resolver function returning a non string
## Code After:
/* eslint comma-dangle: 0 */
import createCachedSelector from '../index';
let memoizedFunction;
beforeEach(() => {
memoizedFunction = jest.fn();
});
describe('createCachedSelector', () => {
it('Should use the same cached selector when resolver function returns the same string', () => {
const cachedSelector = createCachedSelector(
memoizedFunction,
)(
(arg1, arg2) => arg2, // Resolver
);
const firstCall = cachedSelector('foo', 'bar');
const secondCallWithSameResolver = cachedSelector('foo', 'bar');
expect(memoizedFunction.mock.calls.length).toBe(1);
});
it('Should create 2 different selectors when resolver function returns different strings', () => {
const cachedSelector = createCachedSelector(
memoizedFunction,
)(
(arg1, arg2) => arg2, // Resolver
);
const firstCallResult = cachedSelector('foo', 'bar');
const secondCallWithDifferentResolver = cachedSelector('foo', 'moo');
expect(memoizedFunction.mock.calls.length).toBe(2);
});
it('Should return "undefined" if provided resolver does not return a string', () => {
const cachedSelector = createCachedSelector(
memoizedFunction,
)(
() => {}, // Resolver
);
const firstCallResult = cachedSelector('foo', 'bar');
expect(memoizedFunction.mock.calls.length).toBe(0);
expect(firstCallResult).toBe(undefined);
});
});
| /* eslint comma-dangle: 0 */
import createCachedSelector from '../index';
let memoizedFunction;
beforeEach(() => {
memoizedFunction = jest.fn();
});
describe('createCachedSelector', () => {
it('Should use the same cached selector when resolver function returns the same string', () => {
const cachedSelector = createCachedSelector(
memoizedFunction,
)(
(arg1, arg2) => arg2, // Resolver
);
const firstCall = cachedSelector('foo', 'bar');
const secondCallWithSameResolver = cachedSelector('foo', 'bar');
expect(memoizedFunction.mock.calls.length).toBe(1);
});
it('Should create 2 different selectors when resolver function returns different strings', () => {
const cachedSelector = createCachedSelector(
memoizedFunction,
)(
(arg1, arg2) => arg2, // Resolver
);
const firstCallResult = cachedSelector('foo', 'bar');
const secondCallWithDifferentResolver = cachedSelector('foo', 'moo');
expect(memoizedFunction.mock.calls.length).toBe(2);
});
+
+ it('Should return "undefined" if provided resolver does not return a string', () => {
+ const cachedSelector = createCachedSelector(
+ memoizedFunction,
+ )(
+ () => {}, // Resolver
+ );
+ const firstCallResult = cachedSelector('foo', 'bar');
+
+ expect(memoizedFunction.mock.calls.length).toBe(0);
+ expect(firstCallResult).toBe(undefined);
+ });
}); | 12 | 0.352941 | 12 | 0 |
7b697cbcddf29412ac94a186817bd9db1880a0f2 | nbody/snapshots/util.py | nbody/snapshots/util.py | """Various utility functions, mostly dealing with input/output"""
import os
import numpy as np
def load_snapshots(directory_name, stack_coords=False):
"""Loads files by traversing a directory and reading in a filename sorted order"""
data = []
for root, dirs, files in os.walk(directory_name):
for file_name in sorted(files, key=lambda x: int(x.split(".")[-2])):
#This needs fixing, but I'll leave it like this until we unify our formats
if file_name.endswith("csv"):
bodies = np.loadtxt(os.path.join(root, file_name), delimiter=",", skiprows=1, unpack=stack_coords)
data.append(bodies)
return np.array(data)
def save_snapshot(snapshot, file_name):
f = open(file_name, 'w')
f.write("x,y,z\n")
for i in range(snapshot.shape[0]):
f.write("%e,%e,%e\n" % (snapshot[i, 0], snapshot[i, 1], snapshot[i, 2]))
f.close()
def construct_snapshot_name(directory, num):
return os.path.join(directory, "nbody_snapshot." + str(num) + ".csv") | """Various utility functions, mostly dealing with input/output"""
import os
import numpy as np
def load_snapshots(directory_name, stack_coords=False):
"""Loads files by traversing a directory and reading in a filename sorted order"""
data = []
for root, dirs, files in os.walk(directory_name):
for file_name in sorted(files, key=lambda x: int(x.split(".")[-2])):
#This needs fixing, but I'll leave it like this until we unify our formats
if file_name.endswith("csv"):
bodies = np.loadtxt(os.path.join(root, file_name), delimiter=",", unpack=stack_coords)
data.append(bodies)
return np.array(data)
def save_snapshot(snapshot, file_name):
np.savetxt(file_name, snapshot, delimiter=",")
def construct_snapshot_name(directory, num):
return os.path.join(directory, "nbody_snapshot." + str(num) + ".csv") | Fix csv saving for arbitrary parameter sets | Fix csv saving for arbitrary parameter sets
| Python | mit | kostassabulis/nbody-workshop-2015 | python | ## Code Before:
"""Various utility functions, mostly dealing with input/output"""
import os
import numpy as np
def load_snapshots(directory_name, stack_coords=False):
"""Loads files by traversing a directory and reading in a filename sorted order"""
data = []
for root, dirs, files in os.walk(directory_name):
for file_name in sorted(files, key=lambda x: int(x.split(".")[-2])):
#This needs fixing, but I'll leave it like this until we unify our formats
if file_name.endswith("csv"):
bodies = np.loadtxt(os.path.join(root, file_name), delimiter=",", skiprows=1, unpack=stack_coords)
data.append(bodies)
return np.array(data)
def save_snapshot(snapshot, file_name):
f = open(file_name, 'w')
f.write("x,y,z\n")
for i in range(snapshot.shape[0]):
f.write("%e,%e,%e\n" % (snapshot[i, 0], snapshot[i, 1], snapshot[i, 2]))
f.close()
def construct_snapshot_name(directory, num):
return os.path.join(directory, "nbody_snapshot." + str(num) + ".csv")
## Instruction:
Fix csv saving for arbitrary parameter sets
## Code After:
"""Various utility functions, mostly dealing with input/output"""
import os
import numpy as np
def load_snapshots(directory_name, stack_coords=False):
"""Loads files by traversing a directory and reading in a filename sorted order"""
data = []
for root, dirs, files in os.walk(directory_name):
for file_name in sorted(files, key=lambda x: int(x.split(".")[-2])):
#This needs fixing, but I'll leave it like this until we unify our formats
if file_name.endswith("csv"):
bodies = np.loadtxt(os.path.join(root, file_name), delimiter=",", unpack=stack_coords)
data.append(bodies)
return np.array(data)
def save_snapshot(snapshot, file_name):
np.savetxt(file_name, snapshot, delimiter=",")
def construct_snapshot_name(directory, num):
return os.path.join(directory, "nbody_snapshot." + str(num) + ".csv") | """Various utility functions, mostly dealing with input/output"""
import os
import numpy as np
def load_snapshots(directory_name, stack_coords=False):
"""Loads files by traversing a directory and reading in a filename sorted order"""
data = []
for root, dirs, files in os.walk(directory_name):
for file_name in sorted(files, key=lambda x: int(x.split(".")[-2])):
#This needs fixing, but I'll leave it like this until we unify our formats
if file_name.endswith("csv"):
- bodies = np.loadtxt(os.path.join(root, file_name), delimiter=",", skiprows=1, unpack=stack_coords)
? ------------
+ bodies = np.loadtxt(os.path.join(root, file_name), delimiter=",", unpack=stack_coords)
data.append(bodies)
return np.array(data)
def save_snapshot(snapshot, file_name):
+ np.savetxt(file_name, snapshot, delimiter=",")
- f = open(file_name, 'w')
- f.write("x,y,z\n")
- for i in range(snapshot.shape[0]):
- f.write("%e,%e,%e\n" % (snapshot[i, 0], snapshot[i, 1], snapshot[i, 2]))
- f.close()
def construct_snapshot_name(directory, num):
return os.path.join(directory, "nbody_snapshot." + str(num) + ".csv") | 8 | 0.296296 | 2 | 6 |
1d7b29f88602cd7da39e3305dd6dc04eb711e338 | views/layout.jade | views/layout.jade | doctype html
html
head
title= title
link(rel='stylesheet', href='/stylesheets/style.css')
script(src="https://cdn.auth0.com/js/lock/10.3/lock.min.js")
body
block content
| doctype html
html
head
title= title
link(rel='stylesheet', href='/stylesheets/style.css')
body
block content
| Remove unused Lock script reference | Remove unused Lock script reference
| Jade | mit | auth0-samples/auth0-multitenant-website,auth0-samples/auth0-multitenant-website | jade | ## Code Before:
doctype html
html
head
title= title
link(rel='stylesheet', href='/stylesheets/style.css')
script(src="https://cdn.auth0.com/js/lock/10.3/lock.min.js")
body
block content
## Instruction:
Remove unused Lock script reference
## Code After:
doctype html
html
head
title= title
link(rel='stylesheet', href='/stylesheets/style.css')
body
block content
| doctype html
html
head
title= title
link(rel='stylesheet', href='/stylesheets/style.css')
- script(src="https://cdn.auth0.com/js/lock/10.3/lock.min.js")
body
block content | 1 | 0.125 | 0 | 1 |
dc7974ee93d1fa199fbf2ae73f3aa1386ecccd7a | spec/spec_helper.rb | spec/spec_helper.rb | require 'bundler/setup'
require 'mongoid-embedded-errors'
require 'database_cleaner'
current_path = File.dirname(__FILE__)
Dir[File.join(current_path, 'support/**/*.rb')].each { |f| require f }
Mongoid.load! File.join(current_path, 'support/mongoid.yml'), :test
RSpec.configure do |config|
config.run_all_when_everything_filtered = true
config.filter_run :focus
config.filter_run_excluding :skip
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
expectations.syntax = :expect
end
config.mock_with :rspec do |mocks|
mocks.verify_partial_doubles = true
end
config.disable_monkey_patching!
config.before(:suite) do
DatabaseCleaner.strategy = :truncation
end
config.around(:each) do |example|
DatabaseCleaner.cleaning { example.run }
end
end
| require 'bundler/setup'
require 'mongoid-embedded-errors'
require 'database_cleaner'
current_path = File.dirname(__FILE__)
SPEC_MODELS_PATH = File.join(current_path, 'support/**/*.rb').freeze
Dir[SPEC_MODELS_PATH].each { |f| require f }
Mongoid.load! File.join(current_path, 'support/mongoid.yml'), :test
RSpec.configure do |config|
config.run_all_when_everything_filtered = true
config.filter_run :focus
config.filter_run_excluding :skip
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
expectations.syntax = :expect
end
config.mock_with :rspec do |mocks|
mocks.verify_partial_doubles = true
end
config.disable_monkey_patching!
config.before(:suite) do
DatabaseCleaner.strategy = :truncation
end
config.around(:each) do |example|
DatabaseCleaner.cleaning { example.run }
end
config.before(:each) do
# Need to manually reload spec models for mutant to work as expected
if ENV['MUTANT']
Dir[SPEC_MODELS_PATH].each do |filename|
Object.send(:remove_const, File.basename(filename, '.rb').capitalize)
load filename
end
end
end
end
| Add spec model reloading when using mutant | Add spec model reloading when using mutant
| Ruby | mit | glooko/mongoid-embedded-errors,markbates/mongoid-embedded-errors | ruby | ## Code Before:
require 'bundler/setup'
require 'mongoid-embedded-errors'
require 'database_cleaner'
current_path = File.dirname(__FILE__)
Dir[File.join(current_path, 'support/**/*.rb')].each { |f| require f }
Mongoid.load! File.join(current_path, 'support/mongoid.yml'), :test
RSpec.configure do |config|
config.run_all_when_everything_filtered = true
config.filter_run :focus
config.filter_run_excluding :skip
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
expectations.syntax = :expect
end
config.mock_with :rspec do |mocks|
mocks.verify_partial_doubles = true
end
config.disable_monkey_patching!
config.before(:suite) do
DatabaseCleaner.strategy = :truncation
end
config.around(:each) do |example|
DatabaseCleaner.cleaning { example.run }
end
end
## Instruction:
Add spec model reloading when using mutant
## Code After:
require 'bundler/setup'
require 'mongoid-embedded-errors'
require 'database_cleaner'
current_path = File.dirname(__FILE__)
SPEC_MODELS_PATH = File.join(current_path, 'support/**/*.rb').freeze
Dir[SPEC_MODELS_PATH].each { |f| require f }
Mongoid.load! File.join(current_path, 'support/mongoid.yml'), :test
RSpec.configure do |config|
config.run_all_when_everything_filtered = true
config.filter_run :focus
config.filter_run_excluding :skip
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
expectations.syntax = :expect
end
config.mock_with :rspec do |mocks|
mocks.verify_partial_doubles = true
end
config.disable_monkey_patching!
config.before(:suite) do
DatabaseCleaner.strategy = :truncation
end
config.around(:each) do |example|
DatabaseCleaner.cleaning { example.run }
end
config.before(:each) do
# Need to manually reload spec models for mutant to work as expected
if ENV['MUTANT']
Dir[SPEC_MODELS_PATH].each do |filename|
Object.send(:remove_const, File.basename(filename, '.rb').capitalize)
load filename
end
end
end
end
| require 'bundler/setup'
require 'mongoid-embedded-errors'
require 'database_cleaner'
current_path = File.dirname(__FILE__)
- Dir[File.join(current_path, 'support/**/*.rb')].each { |f| require f }
+ SPEC_MODELS_PATH = File.join(current_path, 'support/**/*.rb').freeze
+ Dir[SPEC_MODELS_PATH].each { |f| require f }
+
Mongoid.load! File.join(current_path, 'support/mongoid.yml'), :test
RSpec.configure do |config|
config.run_all_when_everything_filtered = true
config.filter_run :focus
config.filter_run_excluding :skip
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
expectations.syntax = :expect
end
config.mock_with :rspec do |mocks|
mocks.verify_partial_doubles = true
end
config.disable_monkey_patching!
config.before(:suite) do
DatabaseCleaner.strategy = :truncation
end
config.around(:each) do |example|
DatabaseCleaner.cleaning { example.run }
end
+
+ config.before(:each) do
+ # Need to manually reload spec models for mutant to work as expected
+ if ENV['MUTANT']
+ Dir[SPEC_MODELS_PATH].each do |filename|
+ Object.send(:remove_const, File.basename(filename, '.rb').capitalize)
+ load filename
+ end
+ end
+ end
end | 14 | 0.451613 | 13 | 1 |
311a97eb74cb99ae92edeeed66aaa8d175ea9371 | client/lanes/models/ChangeSet.coffee | client/lanes/models/ChangeSet.coffee | class Lanes.Models.ChangeSet extends Lanes.Models.Base
constructor: ->
super
this.created_at = new Date
session:
update: 'object'
by: 'object'
created_at: { type: 'date', setOnce: true }
derived:
record: { deps: ['collection'], fn: -> @collection.parent }
record_name: { deps: ['record'], fn: -> _.field2title @record.api_path() }
fields: { deps: ['update'], fn: -> _.keys(@update) }
displayed_fields: { deps:['fields'], fn: -> _.without(@fields, 'updated_by_id', 'updated_at') }
displayed_changes:
deps: ['displayed_fields'], fn: ->
_.map @displayed_fields, (field) =>
c = @update[field]
{ name: field, from: c[0], to: c[1] }
value: ->
set = {}
for field, change of @update
set[field] = change[1]
set
class ChangeSetCollection extends Lanes.Models.BasicCollection
model: Lanes.Models.ChangeSet
constructor: (options) ->
super([], options)
comparator: (a, b) ->
if b.created_at < a.created_at then -1 else if b.created_at > a.created_at then 1 else 0
Lanes.Models.ChangeSet.Collection = ChangeSetCollection
| class Lanes.Models.ChangeSet extends Lanes.Models.Base
constructor: ->
super
this.created_at = new Date
session:
update: 'object'
by: 'object'
created_at: { type: 'date', setOnce: true }
derived:
record: { deps: ['collection'], fn: -> @collection.parent }
record_name: { deps: ['record'], fn: -> _.field2title @record.api_path() }
fields: { deps: ['update'], fn: -> _.keys(@update) }
displayed_fields: { deps:['fields'], fn: -> _.without(@fields, 'updated_by_id', 'updated_at') }
displayed_changes:
deps: ['displayed_fields'], fn: ->
_.map @displayed_fields, (field) =>
c = @update[field]
{ name: field, from: c[0], to: c[1] }
value: ->
set = {}
for field, change of @update
set[field] = if _.isArray(change) then _.last(change) else change
set
class ChangeSetCollection extends Lanes.Models.BasicCollection
model: Lanes.Models.ChangeSet
constructor: (options) ->
super([], options)
comparator: (a, b) ->
if b.created_at < a.created_at then -1 else if b.created_at > a.created_at then 1 else 0
Lanes.Models.ChangeSet.Collection = ChangeSetCollection
| Deal with change sets that are not arrays | Deal with change sets that are not arrays
| CoffeeScript | mit | argosity/lanes,argosity/lanes,argosity/hippo,argosity/hippo,argosity/lanes,argosity/hippo | coffeescript | ## Code Before:
class Lanes.Models.ChangeSet extends Lanes.Models.Base
constructor: ->
super
this.created_at = new Date
session:
update: 'object'
by: 'object'
created_at: { type: 'date', setOnce: true }
derived:
record: { deps: ['collection'], fn: -> @collection.parent }
record_name: { deps: ['record'], fn: -> _.field2title @record.api_path() }
fields: { deps: ['update'], fn: -> _.keys(@update) }
displayed_fields: { deps:['fields'], fn: -> _.without(@fields, 'updated_by_id', 'updated_at') }
displayed_changes:
deps: ['displayed_fields'], fn: ->
_.map @displayed_fields, (field) =>
c = @update[field]
{ name: field, from: c[0], to: c[1] }
value: ->
set = {}
for field, change of @update
set[field] = change[1]
set
class ChangeSetCollection extends Lanes.Models.BasicCollection
model: Lanes.Models.ChangeSet
constructor: (options) ->
super([], options)
comparator: (a, b) ->
if b.created_at < a.created_at then -1 else if b.created_at > a.created_at then 1 else 0
Lanes.Models.ChangeSet.Collection = ChangeSetCollection
## Instruction:
Deal with change sets that are not arrays
## Code After:
class Lanes.Models.ChangeSet extends Lanes.Models.Base
constructor: ->
super
this.created_at = new Date
session:
update: 'object'
by: 'object'
created_at: { type: 'date', setOnce: true }
derived:
record: { deps: ['collection'], fn: -> @collection.parent }
record_name: { deps: ['record'], fn: -> _.field2title @record.api_path() }
fields: { deps: ['update'], fn: -> _.keys(@update) }
displayed_fields: { deps:['fields'], fn: -> _.without(@fields, 'updated_by_id', 'updated_at') }
displayed_changes:
deps: ['displayed_fields'], fn: ->
_.map @displayed_fields, (field) =>
c = @update[field]
{ name: field, from: c[0], to: c[1] }
value: ->
set = {}
for field, change of @update
set[field] = if _.isArray(change) then _.last(change) else change
set
class ChangeSetCollection extends Lanes.Models.BasicCollection
model: Lanes.Models.ChangeSet
constructor: (options) ->
super([], options)
comparator: (a, b) ->
if b.created_at < a.created_at then -1 else if b.created_at > a.created_at then 1 else 0
Lanes.Models.ChangeSet.Collection = ChangeSetCollection
| class Lanes.Models.ChangeSet extends Lanes.Models.Base
constructor: ->
super
this.created_at = new Date
session:
update: 'object'
by: 'object'
created_at: { type: 'date', setOnce: true }
derived:
record: { deps: ['collection'], fn: -> @collection.parent }
record_name: { deps: ['record'], fn: -> _.field2title @record.api_path() }
fields: { deps: ['update'], fn: -> _.keys(@update) }
displayed_fields: { deps:['fields'], fn: -> _.without(@fields, 'updated_by_id', 'updated_at') }
displayed_changes:
deps: ['displayed_fields'], fn: ->
_.map @displayed_fields, (field) =>
c = @update[field]
{ name: field, from: c[0], to: c[1] }
value: ->
set = {}
for field, change of @update
- set[field] = change[1]
+ set[field] = if _.isArray(change) then _.last(change) else change
set
class ChangeSetCollection extends Lanes.Models.BasicCollection
model: Lanes.Models.ChangeSet
constructor: (options) ->
super([], options)
comparator: (a, b) ->
if b.created_at < a.created_at then -1 else if b.created_at > a.created_at then 1 else 0
Lanes.Models.ChangeSet.Collection = ChangeSetCollection | 2 | 0.051282 | 1 | 1 |
41c4603134c88859218d56a3680f45dfaa02b80a | src/C++/helpers.h | src/C++/helpers.h |
using std::cout;
using std::cin;
using std::endl;
string get_device_id() {
cout << concol::RED << "Enumerating devices" << concol::RESET << endl;
int numDevices = get_numDevices();
cout << concol::RED << numDevices << " APS device" << (numDevices > 1 ? "s": "") << " found" << concol::RESET << endl;
if (numDevices < 1)
return 0;
cout << concol::RED << "Attempting to get serials" << concol::RESET << endl;
const char ** serialBuffer = new const char*[numDevices];
get_deviceSerials(serialBuffer);
for (int cnt=0; cnt < numDevices; cnt++) {
cout << concol::RED << "Device " << cnt << " serial #: " << serialBuffer[cnt] << concol::RESET << endl;
}
string deviceSerial;
if (numDevices == 1) {
deviceSerial = string(serialBuffer[0]);
}
else {
cout << "Choose device ID [0]: ";
string input = "";
getline(cin, input);
int device_id = 0;
if (input.length() != 0) {
std::stringstream mystream(input);
mystream >> device_id;
}
deviceSerial = string(serialBuffer[device_id]);
}
delete[] serialBuffer;
return deviceSerial;
} |
using std::cout;
using std::cin;
using std::endl;
using std::string;
string get_device_id() {
cout << concol::RED << "Enumerating devices" << concol::RESET << endl;
int numDevices = get_numDevices();
cout << concol::RED << numDevices << " APS device" << (numDevices > 1 ? "s": "") << " found" << concol::RESET << endl;
if (numDevices < 1)
return 0;
cout << concol::RED << "Attempting to get serials" << concol::RESET << endl;
const char ** serialBuffer = new const char*[numDevices];
get_deviceSerials(serialBuffer);
for (int cnt=0; cnt < numDevices; cnt++) {
cout << concol::RED << "Device " << cnt << " serial #: " << serialBuffer[cnt] << concol::RESET << endl;
}
string deviceSerial;
if (numDevices == 1) {
deviceSerial = string(serialBuffer[0]);
}
else {
cout << "Choose device ID [0]: ";
string input = "";
getline(cin, input);
int device_id = 0;
if (input.length() != 0) {
std::stringstream mystream(input);
mystream >> device_id;
}
deviceSerial = string(serialBuffer[device_id]);
}
delete[] serialBuffer;
return deviceSerial;
} | Add necessary include to get_device_id helper | Add necessary include to get_device_id helper
| C | apache-2.0 | BBN-Q/libaps2,BBN-Q/libaps2,BBN-Q/libaps2,BBN-Q/libaps2,BBN-Q/libaps2 | c | ## Code Before:
using std::cout;
using std::cin;
using std::endl;
string get_device_id() {
cout << concol::RED << "Enumerating devices" << concol::RESET << endl;
int numDevices = get_numDevices();
cout << concol::RED << numDevices << " APS device" << (numDevices > 1 ? "s": "") << " found" << concol::RESET << endl;
if (numDevices < 1)
return 0;
cout << concol::RED << "Attempting to get serials" << concol::RESET << endl;
const char ** serialBuffer = new const char*[numDevices];
get_deviceSerials(serialBuffer);
for (int cnt=0; cnt < numDevices; cnt++) {
cout << concol::RED << "Device " << cnt << " serial #: " << serialBuffer[cnt] << concol::RESET << endl;
}
string deviceSerial;
if (numDevices == 1) {
deviceSerial = string(serialBuffer[0]);
}
else {
cout << "Choose device ID [0]: ";
string input = "";
getline(cin, input);
int device_id = 0;
if (input.length() != 0) {
std::stringstream mystream(input);
mystream >> device_id;
}
deviceSerial = string(serialBuffer[device_id]);
}
delete[] serialBuffer;
return deviceSerial;
}
## Instruction:
Add necessary include to get_device_id helper
## Code After:
using std::cout;
using std::cin;
using std::endl;
using std::string;
string get_device_id() {
cout << concol::RED << "Enumerating devices" << concol::RESET << endl;
int numDevices = get_numDevices();
cout << concol::RED << numDevices << " APS device" << (numDevices > 1 ? "s": "") << " found" << concol::RESET << endl;
if (numDevices < 1)
return 0;
cout << concol::RED << "Attempting to get serials" << concol::RESET << endl;
const char ** serialBuffer = new const char*[numDevices];
get_deviceSerials(serialBuffer);
for (int cnt=0; cnt < numDevices; cnt++) {
cout << concol::RED << "Device " << cnt << " serial #: " << serialBuffer[cnt] << concol::RESET << endl;
}
string deviceSerial;
if (numDevices == 1) {
deviceSerial = string(serialBuffer[0]);
}
else {
cout << "Choose device ID [0]: ";
string input = "";
getline(cin, input);
int device_id = 0;
if (input.length() != 0) {
std::stringstream mystream(input);
mystream >> device_id;
}
deviceSerial = string(serialBuffer[device_id]);
}
delete[] serialBuffer;
return deviceSerial;
} |
using std::cout;
using std::cin;
using std::endl;
+ using std::string;
string get_device_id() {
cout << concol::RED << "Enumerating devices" << concol::RESET << endl;
int numDevices = get_numDevices();
cout << concol::RED << numDevices << " APS device" << (numDevices > 1 ? "s": "") << " found" << concol::RESET << endl;
if (numDevices < 1)
return 0;
cout << concol::RED << "Attempting to get serials" << concol::RESET << endl;
const char ** serialBuffer = new const char*[numDevices];
get_deviceSerials(serialBuffer);
for (int cnt=0; cnt < numDevices; cnt++) {
cout << concol::RED << "Device " << cnt << " serial #: " << serialBuffer[cnt] << concol::RESET << endl;
}
string deviceSerial;
if (numDevices == 1) {
deviceSerial = string(serialBuffer[0]);
}
else {
cout << "Choose device ID [0]: ";
string input = "";
getline(cin, input);
int device_id = 0;
if (input.length() != 0) {
std::stringstream mystream(input);
mystream >> device_id;
}
deviceSerial = string(serialBuffer[device_id]);
}
delete[] serialBuffer;
return deviceSerial;
} | 1 | 0.020833 | 1 | 0 |
e45eb30ada06bcb68c54ff9c630c60cf3813a4fc | junit-bom/junit-bom.gradle.kts | junit-bom/junit-bom.gradle.kts | description = "${rootProject.description} (Bill of Materials)"
apply(from = "$rootDir/gradle/publishing.gradle.kts")
dependencies {
constraints {
val mavenizedProjects: List<Project> by rootProject.extra
mavenizedProjects.sorted()
.filter { it.name != "junit-platform-console-standalone" }
.forEach { api("${it.group}:${it.name}:${it.version}") }
}
}
the<PublishingExtension>().publications.named<MavenPublication>("maven") {
from(components["javaLibraryPlatform"])
pom {
description.set("This Bill of Materials POM can be used to ease dependency management " +
"when referencing multiple JUnit artifacts using Gradle or Maven.")
}
}
| description = "${rootProject.description} (Bill of Materials)"
apply(from = "$rootDir/gradle/publishing.gradle.kts")
dependencies {
constraints {
val mavenizedProjects: List<Project> by rootProject.extra
mavenizedProjects.sorted()
.filter { it.name != "junit-platform-console-standalone" }
.forEach { api("${it.group}:${it.name}:${it.version}") }
}
}
the<PublishingExtension>().publications.named<MavenPublication>("maven") {
from(components["javaLibraryPlatform"])
pom {
description.set("This Bill of Materials POM can be used to ease dependency management " +
"when referencing multiple JUnit artifacts using Gradle or Maven.")
}
}
tasks.withType<GenerateMavenPom> {
doLast {
val xml = destination.readText()
require (xml.indexOf("<dependencies>") == xml.lastIndexOf("<dependencies>")) {
"BOM must contain exactly one <dependencies> element but contained multiple:\n$destination"
}
require(xml.contains("<dependencyManagement>")) {
"BOM must contain a <dependencyManagement> element:\n$destination"
}
}
}
| Add sanity checks for BOM generation | Add sanity checks for BOM generation
| Kotlin | epl-1.0 | sbrannen/junit-lambda,junit-team/junit-lambda | kotlin | ## Code Before:
description = "${rootProject.description} (Bill of Materials)"
apply(from = "$rootDir/gradle/publishing.gradle.kts")
dependencies {
constraints {
val mavenizedProjects: List<Project> by rootProject.extra
mavenizedProjects.sorted()
.filter { it.name != "junit-platform-console-standalone" }
.forEach { api("${it.group}:${it.name}:${it.version}") }
}
}
the<PublishingExtension>().publications.named<MavenPublication>("maven") {
from(components["javaLibraryPlatform"])
pom {
description.set("This Bill of Materials POM can be used to ease dependency management " +
"when referencing multiple JUnit artifacts using Gradle or Maven.")
}
}
## Instruction:
Add sanity checks for BOM generation
## Code After:
description = "${rootProject.description} (Bill of Materials)"
apply(from = "$rootDir/gradle/publishing.gradle.kts")
dependencies {
constraints {
val mavenizedProjects: List<Project> by rootProject.extra
mavenizedProjects.sorted()
.filter { it.name != "junit-platform-console-standalone" }
.forEach { api("${it.group}:${it.name}:${it.version}") }
}
}
the<PublishingExtension>().publications.named<MavenPublication>("maven") {
from(components["javaLibraryPlatform"])
pom {
description.set("This Bill of Materials POM can be used to ease dependency management " +
"when referencing multiple JUnit artifacts using Gradle or Maven.")
}
}
tasks.withType<GenerateMavenPom> {
doLast {
val xml = destination.readText()
require (xml.indexOf("<dependencies>") == xml.lastIndexOf("<dependencies>")) {
"BOM must contain exactly one <dependencies> element but contained multiple:\n$destination"
}
require(xml.contains("<dependencyManagement>")) {
"BOM must contain a <dependencyManagement> element:\n$destination"
}
}
}
| description = "${rootProject.description} (Bill of Materials)"
apply(from = "$rootDir/gradle/publishing.gradle.kts")
dependencies {
constraints {
val mavenizedProjects: List<Project> by rootProject.extra
mavenizedProjects.sorted()
.filter { it.name != "junit-platform-console-standalone" }
.forEach { api("${it.group}:${it.name}:${it.version}") }
}
}
the<PublishingExtension>().publications.named<MavenPublication>("maven") {
from(components["javaLibraryPlatform"])
pom {
description.set("This Bill of Materials POM can be used to ease dependency management " +
"when referencing multiple JUnit artifacts using Gradle or Maven.")
}
}
+
+ tasks.withType<GenerateMavenPom> {
+ doLast {
+ val xml = destination.readText()
+ require (xml.indexOf("<dependencies>") == xml.lastIndexOf("<dependencies>")) {
+ "BOM must contain exactly one <dependencies> element but contained multiple:\n$destination"
+ }
+ require(xml.contains("<dependencyManagement>")) {
+ "BOM must contain a <dependencyManagement> element:\n$destination"
+ }
+ }
+ } | 12 | 0.6 | 12 | 0 |
7361aa3e36272dfe8a138df011894d79e79b4448 | tasks/docco.js | tasks/docco.js | // grunt-docco
// https://github.com/DavidSouther/grunt-docco
//
// Copyright (c) 2012 David Souther
// Licensed under the MIT license.
"use strict"
var docco = require('docco');
module.exports = function(grunt) {
grunt.registerMultiTask('docco', 'Docco processor.', function() {
var options = this.options({ output: this.file.dest }),
_this = this,
files = this.file.src,
fdone = 0;
var done = _this.async();
files.forEach(function(file) {
var files = grunt.file.expandFiles(file);
docco.document(files, options, function(err, result, code){
if(fdone++ == files.length) done();
});
});
});
};
| // grunt-docco
// https://github.com/DavidSouther/grunt-docco
//
// Copyright (c) 2012 David Souther
// Licensed under the MIT license.
"use strict"
var docco = require('docco');
module.exports = function(grunt) {
grunt.registerMultiTask('docco', 'Docco processor.', function() {
var fdone = 0;
var flength = this.files.length;
var done = this.async();
this.files.forEach(function(file) {
var files = grunt.file.expand(file.src);
docco.document(files, { output: file.dest }, function(err, result, code){
if(++fdone === flength) done();
});
});
});
};
| Update to be compatible with grunt 0.4rc6 | Update to be compatible with grunt 0.4rc6
| JavaScript | mit | joseph-jja/grunt-docco-dir,DavidSouther/grunt-docco,joseph-jja/grunt-docco-dir,neocotic/grunt-docco | javascript | ## Code Before:
// grunt-docco
// https://github.com/DavidSouther/grunt-docco
//
// Copyright (c) 2012 David Souther
// Licensed under the MIT license.
"use strict"
var docco = require('docco');
module.exports = function(grunt) {
grunt.registerMultiTask('docco', 'Docco processor.', function() {
var options = this.options({ output: this.file.dest }),
_this = this,
files = this.file.src,
fdone = 0;
var done = _this.async();
files.forEach(function(file) {
var files = grunt.file.expandFiles(file);
docco.document(files, options, function(err, result, code){
if(fdone++ == files.length) done();
});
});
});
};
## Instruction:
Update to be compatible with grunt 0.4rc6
## Code After:
// grunt-docco
// https://github.com/DavidSouther/grunt-docco
//
// Copyright (c) 2012 David Souther
// Licensed under the MIT license.
"use strict"
var docco = require('docco');
module.exports = function(grunt) {
grunt.registerMultiTask('docco', 'Docco processor.', function() {
var fdone = 0;
var flength = this.files.length;
var done = this.async();
this.files.forEach(function(file) {
var files = grunt.file.expand(file.src);
docco.document(files, { output: file.dest }, function(err, result, code){
if(++fdone === flength) done();
});
});
});
};
| // grunt-docco
// https://github.com/DavidSouther/grunt-docco
//
// Copyright (c) 2012 David Souther
// Licensed under the MIT license.
"use strict"
var docco = require('docco');
module.exports = function(grunt) {
grunt.registerMultiTask('docco', 'Docco processor.', function() {
- var options = this.options({ output: this.file.dest }),
- _this = this,
- files = this.file.src,
- fdone = 0;
? ^^^
+ var fdone = 0;
? ^^^
+ var flength = this.files.length;
- var done = _this.async();
? -
+ var done = this.async();
- files.forEach(function(file) {
+ this.files.forEach(function(file) {
? +++++
- var files = grunt.file.expandFiles(file);
? -----
+ var files = grunt.file.expand(file.src);
? ++++
- docco.document(files, options, function(err, result, code){
? ^^
+ docco.document(files, { output: file.dest }, function(err, result, code){
? ++ ++ + +++ ^^^^^ +++
- if(fdone++ == files.length) done();
? -- -----
+ if(++fdone === flength) done();
? ++ +
});
});
});
}; | 16 | 0.666667 | 7 | 9 |
2f75f716091022cbb63988d722d6734a1a46384f | resources/views/layouts/app/auth/sidebar.blade.php | resources/views/layouts/app/auth/sidebar.blade.php | @php
/**
* @var string[] $sectionNames
* @var \App\ValueObjects\Sidebar $sidebar
*/
@endphp
<div id="sidebar-wrapper">
<div id="sidebar">
{{-- Section list --}}
<select id="section-select" class="form-control">
@foreach ($sectionNames as $sectionName)
<option value="{{ $sectionName }}">
{{ __(sprintf('common/sections.%s.name', $sectionName)) }}
</option>
@endforeach
</select>
<hr>
{{-- Current section's sidebar links --}}
<div class="panel-group" id="sidebar-menu">
@each('layouts.app.auth.sidebar.items', $sidebar->getItems(), 'sidebarItem')
</div>
</div>
</div> | @php
/**
* @var string[] $sectionNames
* @var string $sectionName
* @var \App\ValueObjects\Sidebar $sidebar
*/
@endphp
<div id="sidebar-wrapper">
<div id="sidebar">
{{-- Section list --}}
<select id="section-select" class="form-control">
@foreach ($sectionNames as $itSectionName)
<option value="{{ $itSectionName }}" {{ $sectionName === $itSectionName ? 'selected' : '' }}>
{{ __(sprintf('common/sections.%s.name', $itSectionName)) }}
</option>
@endforeach
</select>
<hr>
{{-- Current section's sidebar --}}
<div class="panel-group" id="sidebar-menu">
@each('layouts.app.auth.sidebar.items', $sidebar->getItems(), 'sidebarItem')
</div>
</div>
</div> | Mark current section as selected in the sidebar. | Mark current section as selected in the sidebar.
| PHP | mit | Patryk27/Domownik,Patryk27/Domownik,Patryk27/Domownik | php | ## Code Before:
@php
/**
* @var string[] $sectionNames
* @var \App\ValueObjects\Sidebar $sidebar
*/
@endphp
<div id="sidebar-wrapper">
<div id="sidebar">
{{-- Section list --}}
<select id="section-select" class="form-control">
@foreach ($sectionNames as $sectionName)
<option value="{{ $sectionName }}">
{{ __(sprintf('common/sections.%s.name', $sectionName)) }}
</option>
@endforeach
</select>
<hr>
{{-- Current section's sidebar links --}}
<div class="panel-group" id="sidebar-menu">
@each('layouts.app.auth.sidebar.items', $sidebar->getItems(), 'sidebarItem')
</div>
</div>
</div>
## Instruction:
Mark current section as selected in the sidebar.
## Code After:
@php
/**
* @var string[] $sectionNames
* @var string $sectionName
* @var \App\ValueObjects\Sidebar $sidebar
*/
@endphp
<div id="sidebar-wrapper">
<div id="sidebar">
{{-- Section list --}}
<select id="section-select" class="form-control">
@foreach ($sectionNames as $itSectionName)
<option value="{{ $itSectionName }}" {{ $sectionName === $itSectionName ? 'selected' : '' }}>
{{ __(sprintf('common/sections.%s.name', $itSectionName)) }}
</option>
@endforeach
</select>
<hr>
{{-- Current section's sidebar --}}
<div class="panel-group" id="sidebar-menu">
@each('layouts.app.auth.sidebar.items', $sidebar->getItems(), 'sidebarItem')
</div>
</div>
</div> | @php
/**
* @var string[] $sectionNames
+ * @var string $sectionName
* @var \App\ValueObjects\Sidebar $sidebar
*/
@endphp
<div id="sidebar-wrapper">
<div id="sidebar">
{{-- Section list --}}
<select id="section-select" class="form-control">
- @foreach ($sectionNames as $sectionName)
? ^
+ @foreach ($sectionNames as $itSectionName)
? ^^^
- <option value="{{ $sectionName }}">
+ <option value="{{ $itSectionName }}" {{ $sectionName === $itSectionName ? 'selected' : '' }}>
- {{ __(sprintf('common/sections.%s.name', $sectionName)) }}
? ^
+ {{ __(sprintf('common/sections.%s.name', $itSectionName)) }}
? ^^^
</option>
@endforeach
</select>
<hr>
- {{-- Current section's sidebar links --}}
? ------
+ {{-- Current section's sidebar --}}
<div class="panel-group" id="sidebar-menu">
@each('layouts.app.auth.sidebar.items', $sidebar->getItems(), 'sidebarItem')
</div>
</div>
</div> | 9 | 0.346154 | 5 | 4 |
e791a65932b9c83365a0fa5148d685131867b729 | subprojects/core/src/main/java/org/gradle/internal/fingerprint/GenericFileTreeSnapshotter.java | subprojects/core/src/main/java/org/gradle/internal/fingerprint/GenericFileTreeSnapshotter.java | /*
* Copyright 2019 the original author or authors.
*
* 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 org.gradle.internal.fingerprint;
import org.gradle.api.file.FileVisitor;
import org.gradle.api.internal.file.FileTreeInternal;
import org.gradle.internal.snapshot.FileSystemSnapshot;
/**
* A snapshotter for generic file trees, which are not based on a directory on disk.
*
* This is needed to build a Merkle directory tree from the elements of a file tree obtained by {@link org.gradle.api.file.FileTree#visit(FileVisitor)}.
*/
public interface GenericFileTreeSnapshotter {
FileSystemSnapshot snapshotFileTree(FileTreeInternal tree);
}
| /*
* Copyright 2019 the original author or authors.
*
* 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 org.gradle.internal.fingerprint;
import org.gradle.api.file.FileVisitor;
import org.gradle.api.internal.file.FileTreeInternal;
import org.gradle.internal.snapshot.FileSystemSnapshot;
/**
* A snapshotter for generic file trees, which are not based on a directory on disk.
*
* Examples of a generic file tree is a {@link org.gradle.api.internal.file.archive.TarFileTree} backed by a non-file resource.
* This is needed to build a Merkle directory tree from the elements of a file tree obtained by {@link org.gradle.api.file.FileTree#visit(FileVisitor)}.
*/
public interface GenericFileTreeSnapshotter {
FileSystemSnapshot snapshotFileTree(FileTreeInternal tree);
}
| Add example for generic file tree to Javadoc | Add example for generic file tree to Javadoc
`SingletonFileTree`s aren't generic file trees.
| Java | apache-2.0 | blindpirate/gradle,gradle/gradle,gradle/gradle,blindpirate/gradle,gradle/gradle,blindpirate/gradle,gradle/gradle,blindpirate/gradle,gradle/gradle,gradle/gradle,blindpirate/gradle,blindpirate/gradle,blindpirate/gradle,blindpirate/gradle,gradle/gradle,gradle/gradle,gradle/gradle,blindpirate/gradle,blindpirate/gradle,gradle/gradle | java | ## Code Before:
/*
* Copyright 2019 the original author or authors.
*
* 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 org.gradle.internal.fingerprint;
import org.gradle.api.file.FileVisitor;
import org.gradle.api.internal.file.FileTreeInternal;
import org.gradle.internal.snapshot.FileSystemSnapshot;
/**
* A snapshotter for generic file trees, which are not based on a directory on disk.
*
* This is needed to build a Merkle directory tree from the elements of a file tree obtained by {@link org.gradle.api.file.FileTree#visit(FileVisitor)}.
*/
public interface GenericFileTreeSnapshotter {
FileSystemSnapshot snapshotFileTree(FileTreeInternal tree);
}
## Instruction:
Add example for generic file tree to Javadoc
`SingletonFileTree`s aren't generic file trees.
## Code After:
/*
* Copyright 2019 the original author or authors.
*
* 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 org.gradle.internal.fingerprint;
import org.gradle.api.file.FileVisitor;
import org.gradle.api.internal.file.FileTreeInternal;
import org.gradle.internal.snapshot.FileSystemSnapshot;
/**
* A snapshotter for generic file trees, which are not based on a directory on disk.
*
* Examples of a generic file tree is a {@link org.gradle.api.internal.file.archive.TarFileTree} backed by a non-file resource.
* This is needed to build a Merkle directory tree from the elements of a file tree obtained by {@link org.gradle.api.file.FileTree#visit(FileVisitor)}.
*/
public interface GenericFileTreeSnapshotter {
FileSystemSnapshot snapshotFileTree(FileTreeInternal tree);
}
| /*
* Copyright 2019 the original author or authors.
*
* 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 org.gradle.internal.fingerprint;
import org.gradle.api.file.FileVisitor;
import org.gradle.api.internal.file.FileTreeInternal;
import org.gradle.internal.snapshot.FileSystemSnapshot;
/**
* A snapshotter for generic file trees, which are not based on a directory on disk.
*
+ * Examples of a generic file tree is a {@link org.gradle.api.internal.file.archive.TarFileTree} backed by a non-file resource.
* This is needed to build a Merkle directory tree from the elements of a file tree obtained by {@link org.gradle.api.file.FileTree#visit(FileVisitor)}.
*/
public interface GenericFileTreeSnapshotter {
FileSystemSnapshot snapshotFileTree(FileTreeInternal tree);
} | 1 | 0.033333 | 1 | 0 |
a26bb6b0d76c94d97737de41f7e02ed665748528 | test/support/check.js | test/support/check.js | import stripSharedIndent from '../../src/utils/stripSharedIndent.js';
import { convert } from '../../dist/decaffeinate.cjs.js';
import { strictEqual } from 'assert';
export default function check(source, expected) {
let converted = convert(stripSharedIndent(source));
strictEqual(converted.code, stripSharedIndent(expected));
}
| import PatchError from '../../src/utils/PatchError.js';
import stripSharedIndent from '../../src/utils/stripSharedIndent.js';
import { convert } from '../../dist/decaffeinate.cjs.js';
import { strictEqual } from 'assert';
export default function check(source, expected) {
try {
let converted = convert(stripSharedIndent(source));
strictEqual(converted.code, stripSharedIndent(expected));
} catch (err) {
if (PatchError.isA(err)) {
console.error(PatchError.prettyPrint(err));
}
throw err;
}
}
| Print more information about PatchErrors in tests. | Print more information about PatchErrors in tests.
| JavaScript | mit | decaffeinate/decaffeinate,eventualbuddha/decaffeinate,decaffeinate/decaffeinate,alangpierce/decaffeinate,alangpierce/decaffeinate,alangpierce/decaffeinate,eventualbuddha/decaffeinate | javascript | ## Code Before:
import stripSharedIndent from '../../src/utils/stripSharedIndent.js';
import { convert } from '../../dist/decaffeinate.cjs.js';
import { strictEqual } from 'assert';
export default function check(source, expected) {
let converted = convert(stripSharedIndent(source));
strictEqual(converted.code, stripSharedIndent(expected));
}
## Instruction:
Print more information about PatchErrors in tests.
## Code After:
import PatchError from '../../src/utils/PatchError.js';
import stripSharedIndent from '../../src/utils/stripSharedIndent.js';
import { convert } from '../../dist/decaffeinate.cjs.js';
import { strictEqual } from 'assert';
export default function check(source, expected) {
try {
let converted = convert(stripSharedIndent(source));
strictEqual(converted.code, stripSharedIndent(expected));
} catch (err) {
if (PatchError.isA(err)) {
console.error(PatchError.prettyPrint(err));
}
throw err;
}
}
| + import PatchError from '../../src/utils/PatchError.js';
import stripSharedIndent from '../../src/utils/stripSharedIndent.js';
import { convert } from '../../dist/decaffeinate.cjs.js';
import { strictEqual } from 'assert';
export default function check(source, expected) {
+ try {
- let converted = convert(stripSharedIndent(source));
+ let converted = convert(stripSharedIndent(source));
? ++
- strictEqual(converted.code, stripSharedIndent(expected));
+ strictEqual(converted.code, stripSharedIndent(expected));
? ++
+ } catch (err) {
+ if (PatchError.isA(err)) {
+ console.error(PatchError.prettyPrint(err));
+ }
+ throw err;
+ }
} | 12 | 1.5 | 10 | 2 |
2e2af04fd1f1cefae61a4bc87f6fbdd9398f5f3e | build.sh | build.sh | rm -rf build
mkdir ./build
# copy all the resources
cp chrome.manifest build/
cp install.rdf build/
rsync -av --exclude=".*" locale build/
rsync -av --exclude=".*" content build/
rsync -av --exclude=".*" defaults build/
# Create zip
pushd build
zip -r ../scicalc.xpi .
popd
# cleanup
rm -rf ./build
| rm -f scicalc.xpi
rm -rf build
mkdir ./build
# copy all the resources
cp chrome.manifest build/
cp install.rdf build/
rsync -av --exclude=".*" locale build/
rsync -av --exclude=".*" content build/
rsync -av --exclude=".*" defaults build/
# Create zip
pushd build
zip -r ../scicalc.xpi .
popd
# cleanup
rm -rf ./build
| Build script: Remove old .xpi (which was updated instead of being replaced before) | Build script: Remove old .xpi (which was updated instead of being replaced before)
| Shell | mit | sunnygoyal/scienfic-calculator,sunnygoyal/scienfic-calculator,sunnygoyal/scienfic-calculator | shell | ## Code Before:
rm -rf build
mkdir ./build
# copy all the resources
cp chrome.manifest build/
cp install.rdf build/
rsync -av --exclude=".*" locale build/
rsync -av --exclude=".*" content build/
rsync -av --exclude=".*" defaults build/
# Create zip
pushd build
zip -r ../scicalc.xpi .
popd
# cleanup
rm -rf ./build
## Instruction:
Build script: Remove old .xpi (which was updated instead of being replaced before)
## Code After:
rm -f scicalc.xpi
rm -rf build
mkdir ./build
# copy all the resources
cp chrome.manifest build/
cp install.rdf build/
rsync -av --exclude=".*" locale build/
rsync -av --exclude=".*" content build/
rsync -av --exclude=".*" defaults build/
# Create zip
pushd build
zip -r ../scicalc.xpi .
popd
# cleanup
rm -rf ./build
| + rm -f scicalc.xpi
rm -rf build
mkdir ./build
# copy all the resources
cp chrome.manifest build/
cp install.rdf build/
rsync -av --exclude=".*" locale build/
rsync -av --exclude=".*" content build/
rsync -av --exclude=".*" defaults build/
# Create zip
pushd build
zip -r ../scicalc.xpi .
popd
# cleanup
rm -rf ./build | 1 | 0.058824 | 1 | 0 |
f7c833242d948a7f5a1128449986d49d5b49d799 | lib/util/nw_crosswalk.json | lib/util/nw_crosswalk.json | {
"0.9.1": "0.11.9",
"0.9.0": "0.11.9",
"0.8.4": "0.10.22",
"0.8.3": "0.10.22",
"0.8.2": "0.10.22",
"0.8.1": "0.10.22",
"0.8.0": "0.10.18"
} | {
"0.9.1": "0.11.9",
"0.9.0": "0.11.9",
"0.8.5": "0.10.22",
"0.8.4": "0.10.22",
"0.8.3": "0.10.22",
"0.8.2": "0.10.22",
"0.8.1": "0.10.22",
"0.8.0": "0.10.18"
} | Add node-webkit v0.8.5 (TODO - find a way to track this dynamically) | Add node-webkit v0.8.5 (TODO - find a way to track this dynamically)
| JSON | bsd-3-clause | mojodna/node-pre-gyp,fengmk2/node-pre-gyp,mapbox/node-pre-gyp,mapbox/node-pre-gyp,hybridgroup/node-pre-gyp,hybridgroup/node-pre-gyp,synthetos/node-pre-gyp,mapbox/node-pre-gyp,mojodna/node-pre-gyp,fengmk2/node-pre-gyp,fengmk2/node-pre-gyp,mojodna/node-pre-gyp,synthetos/node-pre-gyp,hybridgroup/node-pre-gyp,synthetos/node-pre-gyp,etiktin/node-pre-gyp,etiktin/node-pre-gyp,hybridgroup/node-pre-gyp,etiktin/node-pre-gyp,fengmk2/node-pre-gyp,synthetos/node-pre-gyp,fengmk2/node-pre-gyp,etiktin/node-pre-gyp,etiktin/node-pre-gyp,mapbox/node-pre-gyp,mojodna/node-pre-gyp,synthetos/node-pre-gyp,mapbox/node-pre-gyp,mojodna/node-pre-gyp | json | ## Code Before:
{
"0.9.1": "0.11.9",
"0.9.0": "0.11.9",
"0.8.4": "0.10.22",
"0.8.3": "0.10.22",
"0.8.2": "0.10.22",
"0.8.1": "0.10.22",
"0.8.0": "0.10.18"
}
## Instruction:
Add node-webkit v0.8.5 (TODO - find a way to track this dynamically)
## Code After:
{
"0.9.1": "0.11.9",
"0.9.0": "0.11.9",
"0.8.5": "0.10.22",
"0.8.4": "0.10.22",
"0.8.3": "0.10.22",
"0.8.2": "0.10.22",
"0.8.1": "0.10.22",
"0.8.0": "0.10.18"
} | {
"0.9.1": "0.11.9",
"0.9.0": "0.11.9",
+ "0.8.5": "0.10.22",
"0.8.4": "0.10.22",
"0.8.3": "0.10.22",
"0.8.2": "0.10.22",
"0.8.1": "0.10.22",
"0.8.0": "0.10.18"
} | 1 | 0.111111 | 1 | 0 |
f5ee0cd3d94bf8a51b752d40d0d67dccf7e3524b | sandcats/sandcats.js | sandcats/sandcats.js | if (Meteor.isServer) {
Meteor.startup(function () {
// Validate that the config file contains the data we need.
validateSettings();
// Create our DNS zone for PowerDNS, if necessary.
mysqlQuery = createWrappedQuery();
createDomainIfNeeded(mysqlQuery);
// Bind handlers for UDP-based client ping system.
startListeningForUdpPings();
});
}
// Always route all URLs, though we carefully set where: 'server' for
// HTTP API-type URL handling.
Router.map(function() {
// Provide a trivial front page, to avoid the Iron Router default.
this.route('root', {
path: '/'
});
this.route('register', {
path: '/register',
where: 'server',
action: function() {
doRegister(this.request, this.response);
}
});
this.route('sendrecoverytoken', {
path: '/sendrecoverytoken',
where: 'server',
action: function() {
doSendRecoveryToken(this.request, this.response);
}
});
this.route('recover', {
path: '/recover',
where: 'server',
action: function() {
doRecover(this.request, this.response);
}
});
this.route('update', {
path: '/update',
where: 'server',
action: function() {
doUpdate(this.request, this.response);
}
});
});
| if (Meteor.isServer) {
Meteor.startup(function () {
// Validate that the config file contains the data we need.
validateSettings();
// Create our DNS zone for PowerDNS, if necessary.
mysqlQuery = createWrappedQuery();
createDomainIfNeeded(mysqlQuery);
// Bind handlers for UDP-based client ping system.
startListeningForUdpPings();
});
}
// Always route all URLs, though we carefully set where: 'server' for
// HTTP API-type URL handling.
Router.map(function() {
// Redirect the front page to the Sandstorm wiki.
this.route('root', {
path: '/',
where: 'server',
action: function() {
this.response.writeHead(302, {
'Location': 'https://github.com/sandstorm-io/sandstorm/wiki/Sandcats-dynamic-DNS'
});
this.response.end();
}
});
this.route('register', {
path: '/register',
where: 'server',
action: function() {
doRegister(this.request, this.response);
}
});
this.route('sendrecoverytoken', {
path: '/sendrecoverytoken',
where: 'server',
action: function() {
doSendRecoveryToken(this.request, this.response);
}
});
this.route('recover', {
path: '/recover',
where: 'server',
action: function() {
doRecover(this.request, this.response);
}
});
this.route('update', {
path: '/update',
where: 'server',
action: function() {
doUpdate(this.request, this.response);
}
});
});
| Make front page redirect to wiki | Make front page redirect to wiki
| JavaScript | apache-2.0 | sandstorm-io/sandcats,sandstorm-io/sandcats,sandstorm-io/sandcats,sandstorm-io/sandcats | javascript | ## Code Before:
if (Meteor.isServer) {
Meteor.startup(function () {
// Validate that the config file contains the data we need.
validateSettings();
// Create our DNS zone for PowerDNS, if necessary.
mysqlQuery = createWrappedQuery();
createDomainIfNeeded(mysqlQuery);
// Bind handlers for UDP-based client ping system.
startListeningForUdpPings();
});
}
// Always route all URLs, though we carefully set where: 'server' for
// HTTP API-type URL handling.
Router.map(function() {
// Provide a trivial front page, to avoid the Iron Router default.
this.route('root', {
path: '/'
});
this.route('register', {
path: '/register',
where: 'server',
action: function() {
doRegister(this.request, this.response);
}
});
this.route('sendrecoverytoken', {
path: '/sendrecoverytoken',
where: 'server',
action: function() {
doSendRecoveryToken(this.request, this.response);
}
});
this.route('recover', {
path: '/recover',
where: 'server',
action: function() {
doRecover(this.request, this.response);
}
});
this.route('update', {
path: '/update',
where: 'server',
action: function() {
doUpdate(this.request, this.response);
}
});
});
## Instruction:
Make front page redirect to wiki
## Code After:
if (Meteor.isServer) {
Meteor.startup(function () {
// Validate that the config file contains the data we need.
validateSettings();
// Create our DNS zone for PowerDNS, if necessary.
mysqlQuery = createWrappedQuery();
createDomainIfNeeded(mysqlQuery);
// Bind handlers for UDP-based client ping system.
startListeningForUdpPings();
});
}
// Always route all URLs, though we carefully set where: 'server' for
// HTTP API-type URL handling.
Router.map(function() {
// Redirect the front page to the Sandstorm wiki.
this.route('root', {
path: '/',
where: 'server',
action: function() {
this.response.writeHead(302, {
'Location': 'https://github.com/sandstorm-io/sandstorm/wiki/Sandcats-dynamic-DNS'
});
this.response.end();
}
});
this.route('register', {
path: '/register',
where: 'server',
action: function() {
doRegister(this.request, this.response);
}
});
this.route('sendrecoverytoken', {
path: '/sendrecoverytoken',
where: 'server',
action: function() {
doSendRecoveryToken(this.request, this.response);
}
});
this.route('recover', {
path: '/recover',
where: 'server',
action: function() {
doRecover(this.request, this.response);
}
});
this.route('update', {
path: '/update',
where: 'server',
action: function() {
doUpdate(this.request, this.response);
}
});
});
| if (Meteor.isServer) {
Meteor.startup(function () {
// Validate that the config file contains the data we need.
validateSettings();
// Create our DNS zone for PowerDNS, if necessary.
mysqlQuery = createWrappedQuery();
createDomainIfNeeded(mysqlQuery);
// Bind handlers for UDP-based client ping system.
startListeningForUdpPings();
});
}
// Always route all URLs, though we carefully set where: 'server' for
// HTTP API-type URL handling.
Router.map(function() {
- // Provide a trivial front page, to avoid the Iron Router default.
+ // Redirect the front page to the Sandstorm wiki.
this.route('root', {
- path: '/'
+ path: '/',
? +
+ where: 'server',
+ action: function() {
+ this.response.writeHead(302, {
+ 'Location': 'https://github.com/sandstorm-io/sandstorm/wiki/Sandcats-dynamic-DNS'
+ });
+ this.response.end();
+ }
});
this.route('register', {
path: '/register',
where: 'server',
action: function() {
doRegister(this.request, this.response);
}
});
this.route('sendrecoverytoken', {
path: '/sendrecoverytoken',
where: 'server',
action: function() {
doSendRecoveryToken(this.request, this.response);
}
});
this.route('recover', {
path: '/recover',
where: 'server',
action: function() {
doRecover(this.request, this.response);
}
});
this.route('update', {
path: '/update',
where: 'server',
action: function() {
doUpdate(this.request, this.response);
}
});
}); | 11 | 0.2 | 9 | 2 |
6f31664c3d4ce3deef2402d655bad308bb90055d | tasks/jasmine.js | tasks/jasmine.js | /**
* jasmine
* =======
*
* Test settings
*
* Link: https://github.com/gruntjs/grunt-contrib-jasmine
*/
'use strict';
module.exports = function (grunt) {
return {
dist: {
src: [
'<%= pkg.config.src %>/scripts/core.js',
'<%= pkg.config.src %>/scripts/event.js',
'<%= pkg.config.src %>/scripts/class.js',
'<%= pkg.config.src %>/scripts/base.js',
'<%= pkg.config.src %>/scripts/svg.js',
'<%= pkg.config.src %>/scripts/charts/line.js',
'<%= pkg.config.src %>/scripts/charts/bar.js',
'<%= pkg.config.src %>/scripts/charts/pie.js'
],
options: {
specs: '<%= pkg.config.test %>/spec/**/spec-*.js',
helpers: '<%= pkg.config.test %>/spec/**/helper-*.js',
phantomjs: {
'ignore-ssl-errors': true
}
}
}
};
};
| /**
* jasmine
* =======
*
* Test settings
*
* Link: https://github.com/gruntjs/grunt-contrib-jasmine
*/
'use strict';
module.exports = function (grunt) {
return {
dist: {
src: [
'<%= pkg.config.src %>/scripts/core.js',
'<%= pkg.config.src %>/scripts/event.js',
'<%= pkg.config.src %>/scripts/class.js',
'<%= pkg.config.src %>/scripts/base.js',
'<%= pkg.config.src %>/scripts/svg.js',
'<%= pkg.config.src %>/scripts/charts/line.js',
'<%= pkg.config.src %>/scripts/charts/bar.js',
'<%= pkg.config.src %>/scripts/charts/pie.js'
],
options: {
specs: '<%= pkg.config.test %>/spec/**/spec-*.js',
helpers: '<%= pkg.config.test %>/spec/**/helper-*.js',
vendor: [
'http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js'
],
phantomjs: {
'ignore-ssl-errors': true
}
}
}
};
};
| Include jQuery in Jasmine specs | Include jQuery in Jasmine specs
| JavaScript | mit | cr3ative/chartist-js,hansmaad/chartist-js,cr3ative/chartist-js,hansmaad/chartist-js,gionkunz/chartist-js,chartist-js/chartist,chartist-js/chartist,chartist-js/chartist,gionkunz/chartist-js | javascript | ## Code Before:
/**
* jasmine
* =======
*
* Test settings
*
* Link: https://github.com/gruntjs/grunt-contrib-jasmine
*/
'use strict';
module.exports = function (grunt) {
return {
dist: {
src: [
'<%= pkg.config.src %>/scripts/core.js',
'<%= pkg.config.src %>/scripts/event.js',
'<%= pkg.config.src %>/scripts/class.js',
'<%= pkg.config.src %>/scripts/base.js',
'<%= pkg.config.src %>/scripts/svg.js',
'<%= pkg.config.src %>/scripts/charts/line.js',
'<%= pkg.config.src %>/scripts/charts/bar.js',
'<%= pkg.config.src %>/scripts/charts/pie.js'
],
options: {
specs: '<%= pkg.config.test %>/spec/**/spec-*.js',
helpers: '<%= pkg.config.test %>/spec/**/helper-*.js',
phantomjs: {
'ignore-ssl-errors': true
}
}
}
};
};
## Instruction:
Include jQuery in Jasmine specs
## Code After:
/**
* jasmine
* =======
*
* Test settings
*
* Link: https://github.com/gruntjs/grunt-contrib-jasmine
*/
'use strict';
module.exports = function (grunt) {
return {
dist: {
src: [
'<%= pkg.config.src %>/scripts/core.js',
'<%= pkg.config.src %>/scripts/event.js',
'<%= pkg.config.src %>/scripts/class.js',
'<%= pkg.config.src %>/scripts/base.js',
'<%= pkg.config.src %>/scripts/svg.js',
'<%= pkg.config.src %>/scripts/charts/line.js',
'<%= pkg.config.src %>/scripts/charts/bar.js',
'<%= pkg.config.src %>/scripts/charts/pie.js'
],
options: {
specs: '<%= pkg.config.test %>/spec/**/spec-*.js',
helpers: '<%= pkg.config.test %>/spec/**/helper-*.js',
vendor: [
'http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js'
],
phantomjs: {
'ignore-ssl-errors': true
}
}
}
};
};
| /**
* jasmine
* =======
*
* Test settings
*
* Link: https://github.com/gruntjs/grunt-contrib-jasmine
*/
'use strict';
module.exports = function (grunt) {
return {
dist: {
src: [
'<%= pkg.config.src %>/scripts/core.js',
'<%= pkg.config.src %>/scripts/event.js',
'<%= pkg.config.src %>/scripts/class.js',
'<%= pkg.config.src %>/scripts/base.js',
'<%= pkg.config.src %>/scripts/svg.js',
'<%= pkg.config.src %>/scripts/charts/line.js',
'<%= pkg.config.src %>/scripts/charts/bar.js',
'<%= pkg.config.src %>/scripts/charts/pie.js'
],
options: {
specs: '<%= pkg.config.test %>/spec/**/spec-*.js',
helpers: '<%= pkg.config.test %>/spec/**/helper-*.js',
+ vendor: [
+ 'http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js'
+ ],
phantomjs: {
'ignore-ssl-errors': true
}
}
}
};
}; | 3 | 0.088235 | 3 | 0 |
bcb0e4b1f4f6cef0405e203b1f228d106dcced7e | spec/support/capybara.rb | spec/support/capybara.rb | require 'capybara/rspec'
require 'capybara/poltergeist'
Capybara.javascript_driver = :poltergeist
| require 'capybara/rspec'
require 'capybara/poltergeist'
Capybara.register_driver :poltergeist do |app|
Capybara::Poltergeist::Driver.new(app, { phantomjs_options: ['--ssl-protocol=TLSv1'] })
end
Capybara.javascript_driver = :poltergeist
| Fix broken PhantomJS tests, due to SSL | Fix broken PhantomJS tests, due to SSL
phantomjs defaults to using SSLv3, which has now been disabled
everywhere. The protocol used can be changed with an option:
--ssl-protocol=<val> Sets the SSL protocol
(supported protocols: 'SSLv3' (default), 'SSLv2', 'TLSv1', 'any')
This PR makes poltergeist and the task set this option when invoking phantomjs.
| Ruby | mit | alphagov/business-support-finder,alphagov/business-support-finder,alphagov/business-support-finder,alphagov/business-support-finder | ruby | ## Code Before:
require 'capybara/rspec'
require 'capybara/poltergeist'
Capybara.javascript_driver = :poltergeist
## Instruction:
Fix broken PhantomJS tests, due to SSL
phantomjs defaults to using SSLv3, which has now been disabled
everywhere. The protocol used can be changed with an option:
--ssl-protocol=<val> Sets the SSL protocol
(supported protocols: 'SSLv3' (default), 'SSLv2', 'TLSv1', 'any')
This PR makes poltergeist and the task set this option when invoking phantomjs.
## Code After:
require 'capybara/rspec'
require 'capybara/poltergeist'
Capybara.register_driver :poltergeist do |app|
Capybara::Poltergeist::Driver.new(app, { phantomjs_options: ['--ssl-protocol=TLSv1'] })
end
Capybara.javascript_driver = :poltergeist
| require 'capybara/rspec'
require 'capybara/poltergeist'
+ Capybara.register_driver :poltergeist do |app|
+ Capybara::Poltergeist::Driver.new(app, { phantomjs_options: ['--ssl-protocol=TLSv1'] })
+ end
+
Capybara.javascript_driver = :poltergeist | 4 | 1 | 4 | 0 |
66dade78b5990c89fa61fb0f99332de6490aa287 | analyze.js | analyze.js | function analyze_textfield() {
var text = document.getElementById("TEXTAREA").value;
var analyzer = new Analyzer(text);
setOutputText(analyzer.toString());
}
function setOutputText(unescaped) {
var div = document.createElement('div');
div.appendChild(document.createTextNode(unescaped));
var escaped = div.innerHTML;
var outputDiv = document.getElementById("OUTPUT");
outputDiv.innerHTML = escaped;
}
// Create an analyzer object
function Analyzer(text) {
this.text = text;
this.toString = function() {
return this.text;
};
}
| function analyze_textfield() {
var text = document.getElementById("TEXTAREA").value;
var analyzer = new Analyzer(text);
setOutputText(analyzer.toString());
}
function setOutputText(unescaped) {
var div = document.createElement('div');
div.appendChild(document.createTextNode(unescaped));
var escaped = div.innerHTML;
var outputDiv = document.getElementById("OUTPUT");
outputDiv.innerHTML = escaped;
}
// Create an analyzer object
function Analyzer(text) {
this._analyze = function(text) {
var lines = text.split('\n');
for (var i = 0; i < lines.length; i++) {
var line = lines[i];
this.asString += line + '\n';
}
};
this.toString = function() {
return this.asString;
};
this.asString = "";
this._analyze(text);
}
| Read thread dump line by line | Read thread dump line by line
| JavaScript | apache-2.0 | spotify/threaddump-analyzer,rprabhat/threaddump-analyzer,rprabhat/threaddump-analyzer,spotify/threaddump-analyzer | javascript | ## Code Before:
function analyze_textfield() {
var text = document.getElementById("TEXTAREA").value;
var analyzer = new Analyzer(text);
setOutputText(analyzer.toString());
}
function setOutputText(unescaped) {
var div = document.createElement('div');
div.appendChild(document.createTextNode(unescaped));
var escaped = div.innerHTML;
var outputDiv = document.getElementById("OUTPUT");
outputDiv.innerHTML = escaped;
}
// Create an analyzer object
function Analyzer(text) {
this.text = text;
this.toString = function() {
return this.text;
};
}
## Instruction:
Read thread dump line by line
## Code After:
function analyze_textfield() {
var text = document.getElementById("TEXTAREA").value;
var analyzer = new Analyzer(text);
setOutputText(analyzer.toString());
}
function setOutputText(unescaped) {
var div = document.createElement('div');
div.appendChild(document.createTextNode(unescaped));
var escaped = div.innerHTML;
var outputDiv = document.getElementById("OUTPUT");
outputDiv.innerHTML = escaped;
}
// Create an analyzer object
function Analyzer(text) {
this._analyze = function(text) {
var lines = text.split('\n');
for (var i = 0; i < lines.length; i++) {
var line = lines[i];
this.asString += line + '\n';
}
};
this.toString = function() {
return this.asString;
};
this.asString = "";
this._analyze(text);
}
| function analyze_textfield() {
var text = document.getElementById("TEXTAREA").value;
var analyzer = new Analyzer(text);
setOutputText(analyzer.toString());
}
function setOutputText(unescaped) {
var div = document.createElement('div');
div.appendChild(document.createTextNode(unescaped));
var escaped = div.innerHTML;
var outputDiv = document.getElementById("OUTPUT");
outputDiv.innerHTML = escaped;
}
// Create an analyzer object
function Analyzer(text) {
- this.text = text;
+ this._analyze = function(text) {
+ var lines = text.split('\n');
+ for (var i = 0; i < lines.length; i++) {
+ var line = lines[i];
+
+ this.asString += line + '\n';
+ }
+ };
this.toString = function() {
- return this.text;
? ^^^
+ return this.asString;
? +++ ^^^^
};
+
+ this.asString = "";
+ this._analyze(text);
} | 14 | 0.583333 | 12 | 2 |
bc34139888606ce956ba6b0b7a0a73a7c5da6b03 | test/SemaCXX/no-exceptions.cpp | test/SemaCXX/no-exceptions.cpp | // RUN: %clang_cc1 -fsyntax-only -verify %s
// Various tests for -fno-exceptions
typedef __typeof(sizeof(int)) size_t;
namespace test0 {
// rdar://problem/7878149
class Foo {
public:
void* operator new(size_t x);
private:
void operator delete(void *x);
};
void test() {
// Under -fexceptions, this does access control for the associated
// 'operator delete'.
(void) new Foo();
}
}
| // RUN: %clang_cc1 -fsyntax-only -verify %s
// Various tests for -fno-exceptions
typedef __SIZE_TYPE__ size_t;
namespace test0 {
// rdar://problem/7878149
class Foo {
public:
void* operator new(size_t x);
private:
void operator delete(void *x);
};
void test() {
// Under -fexceptions, this does access control for the associated
// 'operator delete'.
(void) new Foo();
}
}
| Use __SIZE_TYPE__ as suggested by dgregor. | Use __SIZE_TYPE__ as suggested by dgregor.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@101857 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang | c++ | ## Code Before:
// RUN: %clang_cc1 -fsyntax-only -verify %s
// Various tests for -fno-exceptions
typedef __typeof(sizeof(int)) size_t;
namespace test0 {
// rdar://problem/7878149
class Foo {
public:
void* operator new(size_t x);
private:
void operator delete(void *x);
};
void test() {
// Under -fexceptions, this does access control for the associated
// 'operator delete'.
(void) new Foo();
}
}
## Instruction:
Use __SIZE_TYPE__ as suggested by dgregor.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@101857 91177308-0d34-0410-b5e6-96231b3b80d8
## Code After:
// RUN: %clang_cc1 -fsyntax-only -verify %s
// Various tests for -fno-exceptions
typedef __SIZE_TYPE__ size_t;
namespace test0 {
// rdar://problem/7878149
class Foo {
public:
void* operator new(size_t x);
private:
void operator delete(void *x);
};
void test() {
// Under -fexceptions, this does access control for the associated
// 'operator delete'.
(void) new Foo();
}
}
| // RUN: %clang_cc1 -fsyntax-only -verify %s
// Various tests for -fno-exceptions
- typedef __typeof(sizeof(int)) size_t;
+ typedef __SIZE_TYPE__ size_t;
namespace test0 {
// rdar://problem/7878149
class Foo {
public:
void* operator new(size_t x);
private:
void operator delete(void *x);
};
void test() {
// Under -fexceptions, this does access control for the associated
// 'operator delete'.
(void) new Foo();
}
} | 2 | 0.095238 | 1 | 1 |
5c192fbe450d0a541a40cbbf4746b6957015dc89 | lib/Target/MSP430/MSP430MCAsmInfo.cpp | lib/Target/MSP430/MSP430MCAsmInfo.cpp | //===-- MSP430MCAsmInfo.cpp - MSP430 asm properties -----------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file contains the declarations of the MSP430MCAsmInfo properties.
//
//===----------------------------------------------------------------------===//
#include "MSP430MCAsmInfo.h"
using namespace llvm;
MSP430MCAsmInfo::MSP430MCAsmInfo(const Target &T, const StringRef &TT) {
AlignmentIsInBytes = false;
AllowNameToStartWithDigit = true;
}
| //===-- MSP430MCAsmInfo.cpp - MSP430 asm properties -----------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file contains the declarations of the MSP430MCAsmInfo properties.
//
//===----------------------------------------------------------------------===//
#include "MSP430MCAsmInfo.h"
using namespace llvm;
MSP430MCAsmInfo::MSP430MCAsmInfo(const Target &T, const StringRef &TT) {
AlignmentIsInBytes = false;
AllowNameToStartWithDigit = true;
PrivateGlobalPrefix = ".L";
}
| Use '.L' for global private prefix (as mspgcc) | Use '.L' for global private prefix (as mspgcc)
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@86380 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | GPUOpen-Drivers/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,chubbymaggie/asap,dslab-epfl/asap,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,chubbymaggie/asap,llvm-mirror/llvm,llvm-mirror/llvm,dslab-epfl/asap | c++ | ## Code Before:
//===-- MSP430MCAsmInfo.cpp - MSP430 asm properties -----------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file contains the declarations of the MSP430MCAsmInfo properties.
//
//===----------------------------------------------------------------------===//
#include "MSP430MCAsmInfo.h"
using namespace llvm;
MSP430MCAsmInfo::MSP430MCAsmInfo(const Target &T, const StringRef &TT) {
AlignmentIsInBytes = false;
AllowNameToStartWithDigit = true;
}
## Instruction:
Use '.L' for global private prefix (as mspgcc)
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@86380 91177308-0d34-0410-b5e6-96231b3b80d8
## Code After:
//===-- MSP430MCAsmInfo.cpp - MSP430 asm properties -----------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file contains the declarations of the MSP430MCAsmInfo properties.
//
//===----------------------------------------------------------------------===//
#include "MSP430MCAsmInfo.h"
using namespace llvm;
MSP430MCAsmInfo::MSP430MCAsmInfo(const Target &T, const StringRef &TT) {
AlignmentIsInBytes = false;
AllowNameToStartWithDigit = true;
PrivateGlobalPrefix = ".L";
}
| //===-- MSP430MCAsmInfo.cpp - MSP430 asm properties -----------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file contains the declarations of the MSP430MCAsmInfo properties.
//
//===----------------------------------------------------------------------===//
#include "MSP430MCAsmInfo.h"
using namespace llvm;
MSP430MCAsmInfo::MSP430MCAsmInfo(const Target &T, const StringRef &TT) {
AlignmentIsInBytes = false;
AllowNameToStartWithDigit = true;
+ PrivateGlobalPrefix = ".L";
} | 1 | 0.05 | 1 | 0 |
dfc293e7a56d06ed3ad58c280b70367b33f9c29a | docs/readme.md | docs/readme.md | Code is more often read than written. Style guides exist to make reading code more pleasant and efficient by
standardizing formatting. Whether you follow our style guides precisely or use them as the basis for your
own, you will find that using a style guide makes developing software in a team easier.
## [Best Practices](best-practices/readme.md)
The best practices described here were collected and honed by developers at Palantir. Whether
you’re just starting a new project and wondering what tooling to use, want to get better at
giving code reviews, or are trying to improve your test coverage, you can benefit from others
who have done it before.
## License
This project is made available under the [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/).
|
*[Chesterton's fence](https://en.wikipedia.org/wiki/Wikipedia:Chesterton%27s_fence) is the principle that reforms should not be made until the reasoning behind the existing state of affairs is understood.*
## [Java Style Guide](java-style-guide/readme.md)
Code is more often read than written. Style guides exist to make reading code more pleasant and efficient by
standardizing formatting. Whether you follow our style guides precisely or use them as the basis for your
own, you will find that using a style guide makes developing software in a team easier.
## [Best Practices](best-practices/readme.md)
The best practices described here were collected and honed by developers at Palantir. Whether
you’re just starting a new project and wondering what tooling to use, want to get better at
giving code reviews, or are trying to improve your test coverage, you can benefit from others
who have done it before.
## License
This project is made available under the [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/).
| Add note on Chesterton's fence | Add note on Chesterton's fence | Markdown | apache-2.0 | palantir/gradle-baseline,palantir/gradle-baseline,robert3005/gradle-baseline | markdown | ## Code Before:
Code is more often read than written. Style guides exist to make reading code more pleasant and efficient by
standardizing formatting. Whether you follow our style guides precisely or use them as the basis for your
own, you will find that using a style guide makes developing software in a team easier.
## [Best Practices](best-practices/readme.md)
The best practices described here were collected and honed by developers at Palantir. Whether
you’re just starting a new project and wondering what tooling to use, want to get better at
giving code reviews, or are trying to improve your test coverage, you can benefit from others
who have done it before.
## License
This project is made available under the [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/).
## Instruction:
Add note on Chesterton's fence
## Code After:
*[Chesterton's fence](https://en.wikipedia.org/wiki/Wikipedia:Chesterton%27s_fence) is the principle that reforms should not be made until the reasoning behind the existing state of affairs is understood.*
## [Java Style Guide](java-style-guide/readme.md)
Code is more often read than written. Style guides exist to make reading code more pleasant and efficient by
standardizing formatting. Whether you follow our style guides precisely or use them as the basis for your
own, you will find that using a style guide makes developing software in a team easier.
## [Best Practices](best-practices/readme.md)
The best practices described here were collected and honed by developers at Palantir. Whether
you’re just starting a new project and wondering what tooling to use, want to get better at
giving code reviews, or are trying to improve your test coverage, you can benefit from others
who have done it before.
## License
This project is made available under the [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/).
| +
+ *[Chesterton's fence](https://en.wikipedia.org/wiki/Wikipedia:Chesterton%27s_fence) is the principle that reforms should not be made until the reasoning behind the existing state of affairs is understood.*
+
+ ## [Java Style Guide](java-style-guide/readme.md)
Code is more often read than written. Style guides exist to make reading code more pleasant and efficient by
standardizing formatting. Whether you follow our style guides precisely or use them as the basis for your
own, you will find that using a style guide makes developing software in a team easier.
## [Best Practices](best-practices/readme.md)
The best practices described here were collected and honed by developers at Palantir. Whether
you’re just starting a new project and wondering what tooling to use, want to get better at
giving code reviews, or are trying to improve your test coverage, you can benefit from others
who have done it before.
## License
This project is made available under the [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/). | 4 | 0.333333 | 4 | 0 |
17ba77dc326b44b0d4c275203eefd0d109e8bab9 | golden/k8s-instances/flutter-engine/flutter-engine-frontend.json5 | golden/k8s-instances/flutter-engine/flutter-engine-frontend.json5 | {
authorized_users: [
"google.com",
],
client_secret_file: "/etc/skia.org/login.json",
disable_sql_exp_cl: true,
flaky_trace_threshold: 10000, // no trace is flaky
frontend: {
baseRepoURL: "<inherited from git_repo_url>",
defaultCorpus: "flutter-engine",
title: "Flutter Engine Gold",
},
prom_port: ":20000",
ready_port: ":8000",
resources_path: "/usr/local/share/frontend/dist",
tile_freshness: "1m",
trace_bt_table: "gold-flutter-engine",
// These values affect the k8s deployment; they are not read in by the binary.
K8S_CPU: 4,
K8S_LOGIN_SECRETS: "skia-org-legacy-login-secrets",
K8S_MEMORY: "4Gi",
}
| {
authorized_users: [
"google.com",
"flutter-try-builder@chops-service-accounts.iam.gserviceaccount.com",
"flutter-staging-builder@chops-service-accounts.iam.gserviceaccount.com",
"flutter-prod-builder@chops-service-accounts.iam.gserviceaccount.com",
],
client_secret_file: "/etc/skia.org/login.json",
disable_sql_exp_cl: true,
flaky_trace_threshold: 10000, // no trace is flaky
frontend: {
baseRepoURL: "<inherited from git_repo_url>",
defaultCorpus: "flutter-engine",
title: "Flutter Engine Gold",
},
prom_port: ":20000",
ready_port: ":8000",
resources_path: "/usr/local/share/frontend/dist",
tile_freshness: "1m",
trace_bt_table: "gold-flutter-engine",
// These values affect the k8s deployment; they are not read in by the binary.
K8S_CPU: 4,
K8S_LOGIN_SECRETS: "skia-org-legacy-login-secrets",
K8S_MEMORY: "4Gi",
}
| Add flutter-engine service account to authorized_users | [gold] Add flutter-engine service account to authorized_users
Change-Id: I1bee9c0d7f99b70863ee1e07c534d83f9b5746e6
Reviewed-on: https://skia-review.googlesource.com/c/buildbot/+/476278
Reviewed-by: Leandro Lovisolo <f558143c2568be8d55575d13f30a1fc5cb8009d5@google.com>
| JSON5 | bsd-3-clause | google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot | json5 | ## Code Before:
{
authorized_users: [
"google.com",
],
client_secret_file: "/etc/skia.org/login.json",
disable_sql_exp_cl: true,
flaky_trace_threshold: 10000, // no trace is flaky
frontend: {
baseRepoURL: "<inherited from git_repo_url>",
defaultCorpus: "flutter-engine",
title: "Flutter Engine Gold",
},
prom_port: ":20000",
ready_port: ":8000",
resources_path: "/usr/local/share/frontend/dist",
tile_freshness: "1m",
trace_bt_table: "gold-flutter-engine",
// These values affect the k8s deployment; they are not read in by the binary.
K8S_CPU: 4,
K8S_LOGIN_SECRETS: "skia-org-legacy-login-secrets",
K8S_MEMORY: "4Gi",
}
## Instruction:
[gold] Add flutter-engine service account to authorized_users
Change-Id: I1bee9c0d7f99b70863ee1e07c534d83f9b5746e6
Reviewed-on: https://skia-review.googlesource.com/c/buildbot/+/476278
Reviewed-by: Leandro Lovisolo <f558143c2568be8d55575d13f30a1fc5cb8009d5@google.com>
## Code After:
{
authorized_users: [
"google.com",
"flutter-try-builder@chops-service-accounts.iam.gserviceaccount.com",
"flutter-staging-builder@chops-service-accounts.iam.gserviceaccount.com",
"flutter-prod-builder@chops-service-accounts.iam.gserviceaccount.com",
],
client_secret_file: "/etc/skia.org/login.json",
disable_sql_exp_cl: true,
flaky_trace_threshold: 10000, // no trace is flaky
frontend: {
baseRepoURL: "<inherited from git_repo_url>",
defaultCorpus: "flutter-engine",
title: "Flutter Engine Gold",
},
prom_port: ":20000",
ready_port: ":8000",
resources_path: "/usr/local/share/frontend/dist",
tile_freshness: "1m",
trace_bt_table: "gold-flutter-engine",
// These values affect the k8s deployment; they are not read in by the binary.
K8S_CPU: 4,
K8S_LOGIN_SECRETS: "skia-org-legacy-login-secrets",
K8S_MEMORY: "4Gi",
}
| {
authorized_users: [
"google.com",
+ "flutter-try-builder@chops-service-accounts.iam.gserviceaccount.com",
+ "flutter-staging-builder@chops-service-accounts.iam.gserviceaccount.com",
+ "flutter-prod-builder@chops-service-accounts.iam.gserviceaccount.com",
],
client_secret_file: "/etc/skia.org/login.json",
disable_sql_exp_cl: true,
flaky_trace_threshold: 10000, // no trace is flaky
frontend: {
baseRepoURL: "<inherited from git_repo_url>",
defaultCorpus: "flutter-engine",
title: "Flutter Engine Gold",
},
prom_port: ":20000",
ready_port: ":8000",
resources_path: "/usr/local/share/frontend/dist",
tile_freshness: "1m",
trace_bt_table: "gold-flutter-engine",
// These values affect the k8s deployment; they are not read in by the binary.
K8S_CPU: 4,
K8S_LOGIN_SECRETS: "skia-org-legacy-login-secrets",
K8S_MEMORY: "4Gi",
} | 3 | 0.130435 | 3 | 0 |
ecdf853441c274fd31abcf4464d0814107ff39b7 | source/main.cpp | source/main.cpp |
void shutdown3DS()
{
Handle nssHandle = 0;
Result result = srvGetServiceHandle(&nssHandle, "ns:s");
if (result != 0)
return;
// http://3dbrew.org/wiki/NSS:ShutdownAsync
u32 *commandBuffer = getThreadCommandBuffer();
commandBuffer[0] = 0x000E0000;
svcSendSyncRequest(nssHandle);
svcCloseHandle(nssHandle);
}
int main(int argc, char **argv)
{
shutdown3DS();
// Hack: the 3ds crashes ("An error has occcurred.") for some reason
// without one iteration of the APT main loop.
aptMainLoop();
return 0;
}
|
// http://3dbrew.org/wiki/NSS:ShutdownAsync
void NSS_ShutdownAsync(void)
{
Handle nssHandle = 0;
Result result = srvGetServiceHandle(&nssHandle, "ns:s");
if (result != 0)
return;
u32 *commandBuffer = getThreadCommandBuffer();
commandBuffer[0] = 0x000E0000;
svcSendSyncRequest(nssHandle);
svcCloseHandle(nssHandle);
}
int main(int argc, char **argv)
{
NSS_ShutdownAsync();
// Hack: the 3ds crashes ("An error has occcurred.") for some reason
// without one iteration of the APT main loop.
aptMainLoop();
return 0;
}
| Call it NSS_ShutdownAsync instead of shutdown3DS. | Call it NSS_ShutdownAsync instead of shutdown3DS.
| C++ | mit | Asellus/3DS_Quick_Shutdown | c++ | ## Code Before:
void shutdown3DS()
{
Handle nssHandle = 0;
Result result = srvGetServiceHandle(&nssHandle, "ns:s");
if (result != 0)
return;
// http://3dbrew.org/wiki/NSS:ShutdownAsync
u32 *commandBuffer = getThreadCommandBuffer();
commandBuffer[0] = 0x000E0000;
svcSendSyncRequest(nssHandle);
svcCloseHandle(nssHandle);
}
int main(int argc, char **argv)
{
shutdown3DS();
// Hack: the 3ds crashes ("An error has occcurred.") for some reason
// without one iteration of the APT main loop.
aptMainLoop();
return 0;
}
## Instruction:
Call it NSS_ShutdownAsync instead of shutdown3DS.
## Code After:
// http://3dbrew.org/wiki/NSS:ShutdownAsync
void NSS_ShutdownAsync(void)
{
Handle nssHandle = 0;
Result result = srvGetServiceHandle(&nssHandle, "ns:s");
if (result != 0)
return;
u32 *commandBuffer = getThreadCommandBuffer();
commandBuffer[0] = 0x000E0000;
svcSendSyncRequest(nssHandle);
svcCloseHandle(nssHandle);
}
int main(int argc, char **argv)
{
NSS_ShutdownAsync();
// Hack: the 3ds crashes ("An error has occcurred.") for some reason
// without one iteration of the APT main loop.
aptMainLoop();
return 0;
}
|
- void shutdown3DS()
+ // http://3dbrew.org/wiki/NSS:ShutdownAsync
+ void NSS_ShutdownAsync(void)
{
Handle nssHandle = 0;
Result result = srvGetServiceHandle(&nssHandle, "ns:s");
if (result != 0)
return;
-
- // http://3dbrew.org/wiki/NSS:ShutdownAsync
u32 *commandBuffer = getThreadCommandBuffer();
commandBuffer[0] = 0x000E0000;
svcSendSyncRequest(nssHandle);
svcCloseHandle(nssHandle);
}
int main(int argc, char **argv)
{
- shutdown3DS();
+ NSS_ShutdownAsync();
// Hack: the 3ds crashes ("An error has occcurred.") for some reason
// without one iteration of the APT main loop.
aptMainLoop();
return 0;
} | 7 | 0.269231 | 3 | 4 |
fe38a8a9b7a31aecf575c8be691fc44ed340e7c9 | deploy/docker-setup-site.sh | deploy/docker-setup-site.sh |
cd /var/www/
find .
# What this image calls html, we call htdocs
if [ ! -f htdocs ]; then
ln -s html htdocs
fi
# Install Composer dependencies
cd htdocs
composer install
cd ..
# Move over the settings file.
cp deploy/settings-docker.inc.php htdocs/includes/settings.inc.php
|
cd /var/www/
# What this image calls html, we call htdocs
if [ -f html ]; then
rmdir html
ln -s htdocs html
fi
# Install Composer dependencies
composer install
# Move over the settings file.
cp deploy/settings-docker.inc.php htdocs/includes/settings.inc.php
| Delete /var/www/html if it exists | Delete /var/www/html if it exists
We use /var/www/htdocs instead.
| Shell | mit | openva/richmondsunlight.com,openva/richmondsunlight.com,openva/richmondsunlight.com,openva/richmondsunlight.com,openva/richmondsunlight.com | shell | ## Code Before:
cd /var/www/
find .
# What this image calls html, we call htdocs
if [ ! -f htdocs ]; then
ln -s html htdocs
fi
# Install Composer dependencies
cd htdocs
composer install
cd ..
# Move over the settings file.
cp deploy/settings-docker.inc.php htdocs/includes/settings.inc.php
## Instruction:
Delete /var/www/html if it exists
We use /var/www/htdocs instead.
## Code After:
cd /var/www/
# What this image calls html, we call htdocs
if [ -f html ]; then
rmdir html
ln -s htdocs html
fi
# Install Composer dependencies
composer install
# Move over the settings file.
cp deploy/settings-docker.inc.php htdocs/includes/settings.inc.php
|
cd /var/www/
- find .
-
# What this image calls html, we call htdocs
- if [ ! -f htdocs ]; then
? -- ^^^^
+ if [ -f html ]; then
? ^^
+ rmdir html
- ln -s html htdocs
? -----
+ ln -s htdocs html
? +++++
fi
# Install Composer dependencies
- cd htdocs
composer install
- cd ..
# Move over the settings file.
cp deploy/settings-docker.inc.php htdocs/includes/settings.inc.php | 9 | 0.529412 | 3 | 6 |
79bdb147127d6edef258090f6d259abbe725798f | lib/cloudstrap/amazon/route53.rb | lib/cloudstrap/amazon/route53.rb | require 'aws-sdk'
require 'contracts'
require_relative 'service'
module Cloudstrap
module Amazon
class Route53 < Service
include ::Contracts::Core
include ::Contracts::Builtin
Contract None => ArrayOf[::Aws::Route53::Types::HostedZone]
def zones
@zones ||= zones!
end
Contract None => ArrayOf[::Aws::Route53::Types::HostedZone]
def zones!
@zones = call_api(:list_hosted_zones).hosted_zones
end
Contract String => Maybe[::Aws::Route53::Types::HostedZone]
def zone(name)
name.tap { |string| string.concat('.') unless string.end_with?('.') }
zones.find { |zone| zone.name == name }
end
private
def client
::Aws::Route53::Client
end
end
end
end
| require 'aws-sdk'
require 'contracts'
require_relative 'service'
module Cloudstrap
module Amazon
class Route53 < Service
include ::Contracts::Core
include ::Contracts::Builtin
Contract None => ArrayOf[::Aws::Route53::Types::HostedZone]
def zones
@zones ||= zones!
end
Contract None => ArrayOf[::Aws::Route53::Types::HostedZone]
def zones!
@zones = call_api(:list_hosted_zones).hosted_zones
end
Contract String => Maybe[::Aws::Route53::Types::HostedZone]
def zone(name)
name.tap { |string| string.concat('.') unless string.end_with?('.') }
zones.find { |zone| zone.name == name }
end
Contract String => Maybe[String]
def zone_id(name)
return unless zone = zone(name)
zone(name).id.split('/').last
end
private
def client
::Aws::Route53::Client
end
end
end
end
| Add method to extract zone ID | Add method to extract zone ID
| Ruby | mit | colstrom/cloudstrap | ruby | ## Code Before:
require 'aws-sdk'
require 'contracts'
require_relative 'service'
module Cloudstrap
module Amazon
class Route53 < Service
include ::Contracts::Core
include ::Contracts::Builtin
Contract None => ArrayOf[::Aws::Route53::Types::HostedZone]
def zones
@zones ||= zones!
end
Contract None => ArrayOf[::Aws::Route53::Types::HostedZone]
def zones!
@zones = call_api(:list_hosted_zones).hosted_zones
end
Contract String => Maybe[::Aws::Route53::Types::HostedZone]
def zone(name)
name.tap { |string| string.concat('.') unless string.end_with?('.') }
zones.find { |zone| zone.name == name }
end
private
def client
::Aws::Route53::Client
end
end
end
end
## Instruction:
Add method to extract zone ID
## Code After:
require 'aws-sdk'
require 'contracts'
require_relative 'service'
module Cloudstrap
module Amazon
class Route53 < Service
include ::Contracts::Core
include ::Contracts::Builtin
Contract None => ArrayOf[::Aws::Route53::Types::HostedZone]
def zones
@zones ||= zones!
end
Contract None => ArrayOf[::Aws::Route53::Types::HostedZone]
def zones!
@zones = call_api(:list_hosted_zones).hosted_zones
end
Contract String => Maybe[::Aws::Route53::Types::HostedZone]
def zone(name)
name.tap { |string| string.concat('.') unless string.end_with?('.') }
zones.find { |zone| zone.name == name }
end
Contract String => Maybe[String]
def zone_id(name)
return unless zone = zone(name)
zone(name).id.split('/').last
end
private
def client
::Aws::Route53::Client
end
end
end
end
| require 'aws-sdk'
require 'contracts'
require_relative 'service'
module Cloudstrap
module Amazon
class Route53 < Service
include ::Contracts::Core
include ::Contracts::Builtin
Contract None => ArrayOf[::Aws::Route53::Types::HostedZone]
def zones
@zones ||= zones!
end
Contract None => ArrayOf[::Aws::Route53::Types::HostedZone]
def zones!
@zones = call_api(:list_hosted_zones).hosted_zones
end
Contract String => Maybe[::Aws::Route53::Types::HostedZone]
def zone(name)
name.tap { |string| string.concat('.') unless string.end_with?('.') }
zones.find { |zone| zone.name == name }
end
+ Contract String => Maybe[String]
+ def zone_id(name)
+ return unless zone = zone(name)
+
+ zone(name).id.split('/').last
+ end
+
private
def client
::Aws::Route53::Client
end
end
end
end | 7 | 0.2 | 7 | 0 |
eb36e4d26346ce4f70ed19fdd2ec7894e3474e56 | scripts/checkupdates.sh | scripts/checkupdates.sh | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
UPDATE_URL=www.gamoeba.com/stagehand_updates
PLATFORM=`uname`
AVAIL_VERSION=`curl -s $UPDATE_URL/version_$PLATFORM.txt`
CURRENT_VERSION=`cat $DIR/CURRENT_VERSION`
NEWVER=`echo $AVAIL_VERSION'>'$CURRENT_VERSION | bc -l`
if (( $NEWVER == 1 ));then
echo "update available. fetching $AVAIL_VERSION"
UPDATE_FILE=$PLATFORM"_update"$AVAIL_VERSION".zip"
curl $UPDATE_URL/$UPDATE_FILE -o $DIR/$UPDATE_FILE && unzip $DIR/$UPDATE_FILE && rm $DIR/$UPDATE_FILE
fi
| DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
UPDATE_URL="http://www.gamoeba.com/stagehand_updates"
PLATFORM=`uname`
AVAIL_VERSION=`wget -qO- $UPDATE_URL/version_$PLATFORM.txt`
CURRENT_VERSION=`cat $DIR/CURRENT_VERSION`
NEWVER=`echo $AVAIL_VERSION'>'$CURRENT_VERSION | bc -l`
if (( $NEWVER == 1 ));then
echo "update available. fetching $AVAIL_VERSION"
UPDATE_FILE=$PLATFORM"_update"$AVAIL_VERSION".zip"
wget $UPDATE_URL/$UPDATE_FILE -O $DIR/$UPDATE_FILE && unzip -o $DIR/$UPDATE_FILE && rm $DIR/$UPDATE_FILE
fi
| Change update script to work with wget | Change update script to work with wget
| Shell | apache-2.0 | gamoeba/stagehand,gamoeba/stagehand,gamoeba/stagehand | shell | ## Code Before:
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
UPDATE_URL=www.gamoeba.com/stagehand_updates
PLATFORM=`uname`
AVAIL_VERSION=`curl -s $UPDATE_URL/version_$PLATFORM.txt`
CURRENT_VERSION=`cat $DIR/CURRENT_VERSION`
NEWVER=`echo $AVAIL_VERSION'>'$CURRENT_VERSION | bc -l`
if (( $NEWVER == 1 ));then
echo "update available. fetching $AVAIL_VERSION"
UPDATE_FILE=$PLATFORM"_update"$AVAIL_VERSION".zip"
curl $UPDATE_URL/$UPDATE_FILE -o $DIR/$UPDATE_FILE && unzip $DIR/$UPDATE_FILE && rm $DIR/$UPDATE_FILE
fi
## Instruction:
Change update script to work with wget
## Code After:
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
UPDATE_URL="http://www.gamoeba.com/stagehand_updates"
PLATFORM=`uname`
AVAIL_VERSION=`wget -qO- $UPDATE_URL/version_$PLATFORM.txt`
CURRENT_VERSION=`cat $DIR/CURRENT_VERSION`
NEWVER=`echo $AVAIL_VERSION'>'$CURRENT_VERSION | bc -l`
if (( $NEWVER == 1 ));then
echo "update available. fetching $AVAIL_VERSION"
UPDATE_FILE=$PLATFORM"_update"$AVAIL_VERSION".zip"
wget $UPDATE_URL/$UPDATE_FILE -O $DIR/$UPDATE_FILE && unzip -o $DIR/$UPDATE_FILE && rm $DIR/$UPDATE_FILE
fi
| DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
- UPDATE_URL=www.gamoeba.com/stagehand_updates
+ UPDATE_URL="http://www.gamoeba.com/stagehand_updates"
? ++++++++ +
PLATFORM=`uname`
- AVAIL_VERSION=`curl -s $UPDATE_URL/version_$PLATFORM.txt`
? ^^^^ ^
+ AVAIL_VERSION=`wget -qO- $UPDATE_URL/version_$PLATFORM.txt`
? ^^^^ ^^^
CURRENT_VERSION=`cat $DIR/CURRENT_VERSION`
NEWVER=`echo $AVAIL_VERSION'>'$CURRENT_VERSION | bc -l`
if (( $NEWVER == 1 ));then
echo "update available. fetching $AVAIL_VERSION"
UPDATE_FILE=$PLATFORM"_update"$AVAIL_VERSION".zip"
- curl $UPDATE_URL/$UPDATE_FILE -o $DIR/$UPDATE_FILE && unzip $DIR/$UPDATE_FILE && rm $DIR/$UPDATE_FILE
? ^^^^ ^
+ wget $UPDATE_URL/$UPDATE_FILE -O $DIR/$UPDATE_FILE && unzip -o $DIR/$UPDATE_FILE && rm $DIR/$UPDATE_FILE
? ^^^^ ^ +++
fi | 6 | 0.5 | 3 | 3 |
0631cf1707a0bb8c2405c60e87c83e459db8579f | travis-deploy.sh | travis-deploy.sh | if [ "${TRAVIS_PULL_REQUEST}" = "false" ]
then
openssl aes-256-cbc -K $encrypted_f7a019a5ba96_key -iv $encrypted_f7a019a5ba96_iv -in config/deploy-keys.tar.enc -out config/deploy-keys.tar -d
tar xvf config/deploy-keys.tar
chmod 600 config/github_deploy
chmod 600 config/travis_deploy
eval `ssh-agent -s`
ssh-add config/github_deploy
ssh-add config/travis_deploy
if [ $TRAVIS_BRANCH = "production" ]
then
bundle exec cap production deploy skip_gulp=true;
elif [ $TRAVIS_BRANCH = "staging" ]
then
bundle exec cap staging deploy skip_gulp=true;
fi
fi
| if [ "${TRAVIS_PULL_REQUEST}" = "false" ]
then
openssl aes-256-cbc -K $encrypted_f7a019a5ba96_key -iv $encrypted_f7a019a5ba96_iv -in config/deploy-keys.tar.enc -out config/deploy-keys.tar -d
tar xvf config/deploy-keys.tar -C config
chmod 600 config/github_deploy
chmod 600 config/travis_deploy
eval `ssh-agent -s`
ssh-add config/github_deploy
ssh-add config/travis_deploy
if [ $TRAVIS_BRANCH = "production" ]
then
bundle exec cap production deploy skip_gulp=true;
elif [ $TRAVIS_BRANCH = "staging" ]
then
bundle exec cap staging deploy skip_gulp=true;
fi
fi
| Add target destination for tar x | Add target destination for tar x
| Shell | mit | sejalkhatri/WikiEduDashboard,feelfreelinux/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,sejalkhatri/WikiEduDashboard,ragesoss/WikiEduDashboard,MusikAnimal/WikiEduDashboard,Wowu/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,KarmaHater/WikiEduDashboard,Wowu/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,alpha721/WikiEduDashboard,MusikAnimal/WikiEduDashboard,majakomel/WikiEduDashboard,adamwight/WikiEduDashboard,MusikAnimal/WikiEduDashboard,alpha721/WikiEduDashboard,MusikAnimal/WikiEduDashboard,majakomel/WikiEduDashboard,feelfreelinux/WikiEduDashboard,sejalkhatri/WikiEduDashboard,feelfreelinux/WikiEduDashboard,sejalkhatri/WikiEduDashboard,KarmaHater/WikiEduDashboard,KarmaHater/WikiEduDashboard,majakomel/WikiEduDashboard,majakomel/WikiEduDashboard,Wowu/WikiEduDashboard,ragesoss/WikiEduDashboard,Wowu/WikiEduDashboard,KarmaHater/WikiEduDashboard,adamwight/WikiEduDashboard,alpha721/WikiEduDashboard,sejalkhatri/WikiEduDashboard,adamwight/WikiEduDashboard,feelfreelinux/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,ragesoss/WikiEduDashboard,alpha721/WikiEduDashboard | shell | ## Code Before:
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]
then
openssl aes-256-cbc -K $encrypted_f7a019a5ba96_key -iv $encrypted_f7a019a5ba96_iv -in config/deploy-keys.tar.enc -out config/deploy-keys.tar -d
tar xvf config/deploy-keys.tar
chmod 600 config/github_deploy
chmod 600 config/travis_deploy
eval `ssh-agent -s`
ssh-add config/github_deploy
ssh-add config/travis_deploy
if [ $TRAVIS_BRANCH = "production" ]
then
bundle exec cap production deploy skip_gulp=true;
elif [ $TRAVIS_BRANCH = "staging" ]
then
bundle exec cap staging deploy skip_gulp=true;
fi
fi
## Instruction:
Add target destination for tar x
## Code After:
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]
then
openssl aes-256-cbc -K $encrypted_f7a019a5ba96_key -iv $encrypted_f7a019a5ba96_iv -in config/deploy-keys.tar.enc -out config/deploy-keys.tar -d
tar xvf config/deploy-keys.tar -C config
chmod 600 config/github_deploy
chmod 600 config/travis_deploy
eval `ssh-agent -s`
ssh-add config/github_deploy
ssh-add config/travis_deploy
if [ $TRAVIS_BRANCH = "production" ]
then
bundle exec cap production deploy skip_gulp=true;
elif [ $TRAVIS_BRANCH = "staging" ]
then
bundle exec cap staging deploy skip_gulp=true;
fi
fi
| if [ "${TRAVIS_PULL_REQUEST}" = "false" ]
then
openssl aes-256-cbc -K $encrypted_f7a019a5ba96_key -iv $encrypted_f7a019a5ba96_iv -in config/deploy-keys.tar.enc -out config/deploy-keys.tar -d
- tar xvf config/deploy-keys.tar
+ tar xvf config/deploy-keys.tar -C config
? ++++++++++
chmod 600 config/github_deploy
chmod 600 config/travis_deploy
eval `ssh-agent -s`
ssh-add config/github_deploy
ssh-add config/travis_deploy
if [ $TRAVIS_BRANCH = "production" ]
then
bundle exec cap production deploy skip_gulp=true;
elif [ $TRAVIS_BRANCH = "staging" ]
then
bundle exec cap staging deploy skip_gulp=true;
fi
fi | 2 | 0.105263 | 1 | 1 |
21144972d185d3dfd47cd9641901ba8d34921e84 | src/lib/eina_main.c | src/lib/eina_main.c | /* EINA - EFL data type library
* Copyright (C) 2008 Cedric Bail
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library;
* if not, see <http://www.gnu.org/licenses/>.
*/
#include "Eina.h"
EAPI int
eina_init(void)
{
int r;
r = eina_error_init();
r += eina_hash_init();
r += eina_stringshare_init();
r += eina_list_init();
r += eina_array_init();
return r;
}
EAPI int
eina_shutdown(void)
{
int r;
eina_array_shutdown();
eina_list_shutdown();
r = eina_stringshare_shutdown();
r += eina_hash_shutdown();
r += eina_error_shutdown();
return r;
}
| /* EINA - EFL data type library
* Copyright (C) 2008 Cedric Bail
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library;
* if not, see <http://www.gnu.org/licenses/>.
*/
#include "eina_error.h"
#include "eina_hash.h"
#include "eina_stringshare.h"
#include "eina_list.h"
#include "eina_array.h"
EAPI int
eina_init(void)
{
int r;
r = eina_error_init();
r += eina_hash_init();
r += eina_stringshare_init();
r += eina_list_init();
r += eina_array_init();
return r;
}
EAPI int
eina_shutdown(void)
{
int r;
eina_array_shutdown();
eina_list_shutdown();
r = eina_stringshare_shutdown();
r += eina_hash_shutdown();
r += eina_error_shutdown();
return r;
}
| Remove warning and only include needed stuff. | Remove warning and only include needed stuff.
git-svn-id: b99a075ee42e317ef7d0e499fd315684e5f6d838@35456 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33
| C | lgpl-2.1 | OpenInkpot-archive/iplinux-eina,jordemort/eina,OpenInkpot-archive/iplinux-eina,jordemort/eina,OpenInkpot-archive/iplinux-eina,jordemort/eina | c | ## Code Before:
/* EINA - EFL data type library
* Copyright (C) 2008 Cedric Bail
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library;
* if not, see <http://www.gnu.org/licenses/>.
*/
#include "Eina.h"
EAPI int
eina_init(void)
{
int r;
r = eina_error_init();
r += eina_hash_init();
r += eina_stringshare_init();
r += eina_list_init();
r += eina_array_init();
return r;
}
EAPI int
eina_shutdown(void)
{
int r;
eina_array_shutdown();
eina_list_shutdown();
r = eina_stringshare_shutdown();
r += eina_hash_shutdown();
r += eina_error_shutdown();
return r;
}
## Instruction:
Remove warning and only include needed stuff.
git-svn-id: b99a075ee42e317ef7d0e499fd315684e5f6d838@35456 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33
## Code After:
/* EINA - EFL data type library
* Copyright (C) 2008 Cedric Bail
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library;
* if not, see <http://www.gnu.org/licenses/>.
*/
#include "eina_error.h"
#include "eina_hash.h"
#include "eina_stringshare.h"
#include "eina_list.h"
#include "eina_array.h"
EAPI int
eina_init(void)
{
int r;
r = eina_error_init();
r += eina_hash_init();
r += eina_stringshare_init();
r += eina_list_init();
r += eina_array_init();
return r;
}
EAPI int
eina_shutdown(void)
{
int r;
eina_array_shutdown();
eina_list_shutdown();
r = eina_stringshare_shutdown();
r += eina_hash_shutdown();
r += eina_error_shutdown();
return r;
}
| /* EINA - EFL data type library
* Copyright (C) 2008 Cedric Bail
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library;
* if not, see <http://www.gnu.org/licenses/>.
*/
+ #include "eina_error.h"
- #include "Eina.h"
? ^
+ #include "eina_hash.h"
? ^ +++++
+ #include "eina_stringshare.h"
+ #include "eina_list.h"
+ #include "eina_array.h"
EAPI int
eina_init(void)
{
int r;
r = eina_error_init();
r += eina_hash_init();
r += eina_stringshare_init();
r += eina_list_init();
r += eina_array_init();
return r;
}
EAPI int
eina_shutdown(void)
{
int r;
eina_array_shutdown();
eina_list_shutdown();
r = eina_stringshare_shutdown();
r += eina_hash_shutdown();
r += eina_error_shutdown();
return r;
}
| 6 | 0.125 | 5 | 1 |
c0495ed7e86ede7b334bd4a38e9b3aeec4b36f84 | Resources/windows/image_background.js | Resources/windows/image_background.js | W.ImageBackground = function() {
var win = UI.Win({
title:'Background Images',
layout:'vertical'
});
var label = Ti.UI.createLabel({
text:'It seems like background images for buttons and views are always stretched',
height:'auto',
width:'auto',
top:10
});
var button = Ti.UI.createButton({
title:'Stretched Button',
top:20,
width:200,
height:50,
backgroundImage:Ti.Filesystem.resourcesDirectory + 'images/sky.jpg',
borderRadius:10
});
var view = Ti.UI.createView({
top:20,
width:100,
height:100,
backgroundImage:Ti.Filesystem.resourcesDirectory + 'images/sky.jpg'
});
var viewRepeat = Ti.UI.createView({
top:20,
width:150,
height:150,
backgroundImage:Ti.Filesystem.resourcesDirectory + 'KS_nav_ui.png',
backgroundRepeat:true
});
win.add(label);
win.add(button);
win.add(view);
win.add(viewRepeat);
return win;
}
| W.ImageBackground = function() {
var win = UI.Win({
title:'Background Images',
});
var scrollView = Ti.UI.createScrollView({
layout:'vertical',
contentWidth:'100%',
contentHeight:'auto',
showVerticalScrollIndicator:true,
showHorizontalScrollIndicator:false,
});
var label = Ti.UI.createLabel({
text:'It seems like background images for buttons and views are always stretched',
height:'auto',
width:'auto',
top:10
});
var button = Ti.UI.createButton({
title:'Stretched Button',
top:20,
width:200,
height:50,
backgroundImage:Ti.Filesystem.resourcesDirectory + 'images/sky.jpg',
borderRadius:10
});
var view = Ti.UI.createView({
top:20,
width:100,
height:100,
backgroundImage:Ti.Filesystem.resourcesDirectory + 'images/sky.jpg'
});
var viewRepeat = Ti.UI.createView({
top:20,
width:150,
height:150,
backgroundImage:Ti.Filesystem.resourcesDirectory + 'KS_nav_ui.png',
backgroundRepeat:true
});
scrollView.add(label);
scrollView.add(button);
scrollView.add(view);
scrollView.add(viewRepeat);
win.add(scrollView);
return win;
}
| Convert background image example screen to using scroll view. | Convert background image example screen to using scroll view.
| JavaScript | apache-2.0 | danielhanold/DannySink | javascript | ## Code Before:
W.ImageBackground = function() {
var win = UI.Win({
title:'Background Images',
layout:'vertical'
});
var label = Ti.UI.createLabel({
text:'It seems like background images for buttons and views are always stretched',
height:'auto',
width:'auto',
top:10
});
var button = Ti.UI.createButton({
title:'Stretched Button',
top:20,
width:200,
height:50,
backgroundImage:Ti.Filesystem.resourcesDirectory + 'images/sky.jpg',
borderRadius:10
});
var view = Ti.UI.createView({
top:20,
width:100,
height:100,
backgroundImage:Ti.Filesystem.resourcesDirectory + 'images/sky.jpg'
});
var viewRepeat = Ti.UI.createView({
top:20,
width:150,
height:150,
backgroundImage:Ti.Filesystem.resourcesDirectory + 'KS_nav_ui.png',
backgroundRepeat:true
});
win.add(label);
win.add(button);
win.add(view);
win.add(viewRepeat);
return win;
}
## Instruction:
Convert background image example screen to using scroll view.
## Code After:
W.ImageBackground = function() {
var win = UI.Win({
title:'Background Images',
});
var scrollView = Ti.UI.createScrollView({
layout:'vertical',
contentWidth:'100%',
contentHeight:'auto',
showVerticalScrollIndicator:true,
showHorizontalScrollIndicator:false,
});
var label = Ti.UI.createLabel({
text:'It seems like background images for buttons and views are always stretched',
height:'auto',
width:'auto',
top:10
});
var button = Ti.UI.createButton({
title:'Stretched Button',
top:20,
width:200,
height:50,
backgroundImage:Ti.Filesystem.resourcesDirectory + 'images/sky.jpg',
borderRadius:10
});
var view = Ti.UI.createView({
top:20,
width:100,
height:100,
backgroundImage:Ti.Filesystem.resourcesDirectory + 'images/sky.jpg'
});
var viewRepeat = Ti.UI.createView({
top:20,
width:150,
height:150,
backgroundImage:Ti.Filesystem.resourcesDirectory + 'KS_nav_ui.png',
backgroundRepeat:true
});
scrollView.add(label);
scrollView.add(button);
scrollView.add(view);
scrollView.add(viewRepeat);
win.add(scrollView);
return win;
}
| W.ImageBackground = function() {
var win = UI.Win({
title:'Background Images',
+ });
+
+ var scrollView = Ti.UI.createScrollView({
- layout:'vertical'
+ layout:'vertical',
? +
+ contentWidth:'100%',
+ contentHeight:'auto',
+ showVerticalScrollIndicator:true,
+ showHorizontalScrollIndicator:false,
});
var label = Ti.UI.createLabel({
text:'It seems like background images for buttons and views are always stretched',
height:'auto',
width:'auto',
top:10
});
var button = Ti.UI.createButton({
title:'Stretched Button',
top:20,
width:200,
height:50,
backgroundImage:Ti.Filesystem.resourcesDirectory + 'images/sky.jpg',
borderRadius:10
});
var view = Ti.UI.createView({
top:20,
width:100,
height:100,
backgroundImage:Ti.Filesystem.resourcesDirectory + 'images/sky.jpg'
});
var viewRepeat = Ti.UI.createView({
top:20,
width:150,
height:150,
backgroundImage:Ti.Filesystem.resourcesDirectory + 'KS_nav_ui.png',
backgroundRepeat:true
});
- win.add(label);
- win.add(button);
+ scrollView.add(label);
+ scrollView.add(button);
+ scrollView.add(view);
+ scrollView.add(viewRepeat);
- win.add(view);
? ^
+ win.add(scrollView);
? ^^^^^^^
- win.add(viewRepeat);
return win;
} | 18 | 0.409091 | 13 | 5 |
29aaf5011dc9b1f02858d0d008ed801aa8d4cc23 | README.md | README.md |
Official Docker image for [OWASP OWTF](http://owtf.org).
### Building the image:
* Install **Docker**.(specific instructions can be found [here](https://docs.docker.com/installation/)).
* Then run these commands, please notice that the first time these commands are run the script will download docker images from the registry,
which might take a while depending on your internet connection.
```
git clone https://github.com/owtf/owtf-docker.git
```
* Run `docker build -t <yourpreferredname> <path to Dockerfile>`.
### Usage
* You can launch your **OWTF** container by running `docker run -itd --privileged -p 8009:8009 -p 8010:8010 <image name>`.
- `-d` launches the container as a *daemon*.
- `-p 8009:8009` maps the port 8009 of the host machine to the port 8009 of the container. (syntax: `<host port>:<container port>`)
- Get the image name by running `docker images`.
* Point your browser to `<hostip>:8009`.
|
Official Docker image for [OWASP OWTF](http://owtf.org).
### Building the image:
* Install **Docker**.(specific instructions can be found [here](https://docs.docker.com/installation/)).
* Then run these commands, please notice that the first time these commands are run the script will download docker images from the registry,
which might take a while depending on your internet connection.
```
git clone https://github.com/owtf/owtf-docker.git
```
* Run `docker build -t <yourpreferredname> <path to Dockerfile>`.
### Usage
* You can launch your **OWTF** container by running `docker run -itd --privileged --net=host <image name>`.
- `-d` launches the container as a *daemon*.
- `-p 8009:8009` maps the port 8009 of the host machine to the port 8009 of the container. (syntax: `<host port>:<container port>`)
- Get the image name by running `docker images`.
* Point your browser to `<hostip>:8009`.
| Fix owtf ui server access issue using --net=host flag | Fix owtf ui server access issue using --net=host flag
| Markdown | bsd-3-clause | owtf/owtf-docker | markdown | ## Code Before:
Official Docker image for [OWASP OWTF](http://owtf.org).
### Building the image:
* Install **Docker**.(specific instructions can be found [here](https://docs.docker.com/installation/)).
* Then run these commands, please notice that the first time these commands are run the script will download docker images from the registry,
which might take a while depending on your internet connection.
```
git clone https://github.com/owtf/owtf-docker.git
```
* Run `docker build -t <yourpreferredname> <path to Dockerfile>`.
### Usage
* You can launch your **OWTF** container by running `docker run -itd --privileged -p 8009:8009 -p 8010:8010 <image name>`.
- `-d` launches the container as a *daemon*.
- `-p 8009:8009` maps the port 8009 of the host machine to the port 8009 of the container. (syntax: `<host port>:<container port>`)
- Get the image name by running `docker images`.
* Point your browser to `<hostip>:8009`.
## Instruction:
Fix owtf ui server access issue using --net=host flag
## Code After:
Official Docker image for [OWASP OWTF](http://owtf.org).
### Building the image:
* Install **Docker**.(specific instructions can be found [here](https://docs.docker.com/installation/)).
* Then run these commands, please notice that the first time these commands are run the script will download docker images from the registry,
which might take a while depending on your internet connection.
```
git clone https://github.com/owtf/owtf-docker.git
```
* Run `docker build -t <yourpreferredname> <path to Dockerfile>`.
### Usage
* You can launch your **OWTF** container by running `docker run -itd --privileged --net=host <image name>`.
- `-d` launches the container as a *daemon*.
- `-p 8009:8009` maps the port 8009 of the host machine to the port 8009 of the container. (syntax: `<host port>:<container port>`)
- Get the image name by running `docker images`.
* Point your browser to `<hostip>:8009`.
|
Official Docker image for [OWASP OWTF](http://owtf.org).
### Building the image:
* Install **Docker**.(specific instructions can be found [here](https://docs.docker.com/installation/)).
* Then run these commands, please notice that the first time these commands are run the script will download docker images from the registry,
which might take a while depending on your internet connection.
```
git clone https://github.com/owtf/owtf-docker.git
```
* Run `docker build -t <yourpreferredname> <path to Dockerfile>`.
### Usage
- * You can launch your **OWTF** container by running `docker run -itd --privileged -p 8009:8009 -p 8010:8010 <image name>`.
? ------------ ^^^^^^^^^^^
+ * You can launch your **OWTF** container by running `docker run -itd --privileged --net=host <image name>`.
? ^^^^^^^^
- `-d` launches the container as a *daemon*.
- `-p 8009:8009` maps the port 8009 of the host machine to the port 8009 of the container. (syntax: `<host port>:<container port>`)
- Get the image name by running `docker images`.
* Point your browser to `<hostip>:8009`. | 2 | 0.08 | 1 | 1 |
6bfee1db62ed27506c541018b54486fe6172198f | .travis.yml | .travis.yml | language: java
sudo: false
jdk:
- oraclejdk8
cache:
directories:
- $HOME/.cache/bower
- $HOME/.gradle
- $HOME/.npm
- .gradle
# some npm modules need a newer g++ compiler
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-6
- g++-6
env:
- CXX=g++-6
| language: java
sudo: required
jdk:
- oraclejdk8
services:
- docker
# some npm modules need a newer g++ compiler
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-6
- g++-6
env:
- CXX=g++-6
cache:
directories:
- $HOME/.cache/bower
- $HOME/.gradle
- $HOME/.npm
- .gradle
script:
- ./gradlew assemble check &&
docker build -t georocket/georocket-website . &&
if [ "$TRAVIS_REPO_SLUG" == "georocket/georocket-website" ] && ([ "$TRAVIS_BRANCH" == "master" ] || [ ! -z "$TRAVIS_TAG" ]) && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
docker push georocket/georocket-website;
fi
| Build docker image on CI server and push it to registry | Build docker image on CI server and push it to registry
| YAML | apache-2.0 | georocket/georocket-website,georocket/georocket-website,georocket/georocket-website | yaml | ## Code Before:
language: java
sudo: false
jdk:
- oraclejdk8
cache:
directories:
- $HOME/.cache/bower
- $HOME/.gradle
- $HOME/.npm
- .gradle
# some npm modules need a newer g++ compiler
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-6
- g++-6
env:
- CXX=g++-6
## Instruction:
Build docker image on CI server and push it to registry
## Code After:
language: java
sudo: required
jdk:
- oraclejdk8
services:
- docker
# some npm modules need a newer g++ compiler
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-6
- g++-6
env:
- CXX=g++-6
cache:
directories:
- $HOME/.cache/bower
- $HOME/.gradle
- $HOME/.npm
- .gradle
script:
- ./gradlew assemble check &&
docker build -t georocket/georocket-website . &&
if [ "$TRAVIS_REPO_SLUG" == "georocket/georocket-website" ] && ([ "$TRAVIS_BRANCH" == "master" ] || [ ! -z "$TRAVIS_TAG" ]) && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
docker push georocket/georocket-website;
fi
| language: java
- sudo: false
+
+ sudo: required
+
jdk:
- oraclejdk8
+
+ services:
+ - docker
- cache:
- directories:
- - $HOME/.cache/bower
- - $HOME/.gradle
- - $HOME/.npm
- - .gradle
# some npm modules need a newer g++ compiler
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-6
- g++-6
env:
- CXX=g++-6
+
+ cache:
+ directories:
+ - $HOME/.cache/bower
+ - $HOME/.gradle
+ - $HOME/.npm
+ - .gradle
+
+ script:
+ - ./gradlew assemble check &&
+ docker build -t georocket/georocket-website . &&
+ if [ "$TRAVIS_REPO_SLUG" == "georocket/georocket-website" ] && ([ "$TRAVIS_BRANCH" == "master" ] || [ ! -z "$TRAVIS_TAG" ]) && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
+ docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
+ docker push georocket/georocket-website;
+ fi | 28 | 1.333333 | 21 | 7 |
3043538d3cb3d052e2f1b2c17f7d596b80020d58 | composer.json | composer.json | {
"name": "kilianr/survey",
"type": "phpbb-extension",
"description": "This Extension adds the possibility of permofming surveys with multiple people to your topics.",
"homepage": "https://github.com/kilianr/phpbb-ext-survey/",
"version": "1.0.0-b1",
"time": "2015-08-26",
"license": "AGPL-3.0",
"authors": [
{
"name": "Kilian Röhner",
"email": "kilian@mirdan.de",
"role": "Lead Developer"
}
],
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpbb/epv": "dev-master"
},
"extra": {
"display-name": "Survey",
"soft-require": {
"phpbb/phpbb": ">=3.1.5,<3.2.*@dev"
},
"version-check": {
"host": "raw.githubusercontent.com",
"directory": "/kilianr/phpbb-ext-survey/master",
"filename": "version-check.json",
"ssl": true
}
}
}
| {
"name": "kilianr/survey",
"type": "phpbb-extension",
"description": "This Extension adds the possibility of permofming surveys with multiple people to your topics.",
"homepage": "https://github.com/kilianr/phpbb-ext-survey/",
"version": "1.0.0-b1",
"time": "2015-08-26",
"license": "AGPL-3.0",
"authors": [
{
"name": "Kilian Röhner",
"email": "kilian@mirdan.de",
"role": "Lead Developer"
}
],
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpbb/epv": "dev-master"
},
"extra": {
"display-name": "Survey",
"soft-require": {
"phpbb/phpbb": ">=3.1.5,<3.2.*@dev"
},
"version-check": {
"host": "kilianr.github.io",
"directory": "/phpbb-ext-survey",
"filename": "version-check.json"
}
}
}
| Use github.io pages for version check (for now), since version check over HTTPS is not working in phpBB | Use github.io pages for version check (for now), since version check over HTTPS is not working in phpBB
| JSON | agpl-3.0 | kilianr/phpbb-ext-survey,kilianr/phpbb-ext-survey | json | ## Code Before:
{
"name": "kilianr/survey",
"type": "phpbb-extension",
"description": "This Extension adds the possibility of permofming surveys with multiple people to your topics.",
"homepage": "https://github.com/kilianr/phpbb-ext-survey/",
"version": "1.0.0-b1",
"time": "2015-08-26",
"license": "AGPL-3.0",
"authors": [
{
"name": "Kilian Röhner",
"email": "kilian@mirdan.de",
"role": "Lead Developer"
}
],
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpbb/epv": "dev-master"
},
"extra": {
"display-name": "Survey",
"soft-require": {
"phpbb/phpbb": ">=3.1.5,<3.2.*@dev"
},
"version-check": {
"host": "raw.githubusercontent.com",
"directory": "/kilianr/phpbb-ext-survey/master",
"filename": "version-check.json",
"ssl": true
}
}
}
## Instruction:
Use github.io pages for version check (for now), since version check over HTTPS is not working in phpBB
## Code After:
{
"name": "kilianr/survey",
"type": "phpbb-extension",
"description": "This Extension adds the possibility of permofming surveys with multiple people to your topics.",
"homepage": "https://github.com/kilianr/phpbb-ext-survey/",
"version": "1.0.0-b1",
"time": "2015-08-26",
"license": "AGPL-3.0",
"authors": [
{
"name": "Kilian Röhner",
"email": "kilian@mirdan.de",
"role": "Lead Developer"
}
],
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpbb/epv": "dev-master"
},
"extra": {
"display-name": "Survey",
"soft-require": {
"phpbb/phpbb": ">=3.1.5,<3.2.*@dev"
},
"version-check": {
"host": "kilianr.github.io",
"directory": "/phpbb-ext-survey",
"filename": "version-check.json"
}
}
}
| {
"name": "kilianr/survey",
"type": "phpbb-extension",
"description": "This Extension adds the possibility of permofming surveys with multiple people to your topics.",
"homepage": "https://github.com/kilianr/phpbb-ext-survey/",
"version": "1.0.0-b1",
"time": "2015-08-26",
"license": "AGPL-3.0",
"authors": [
{
"name": "Kilian Röhner",
"email": "kilian@mirdan.de",
"role": "Lead Developer"
}
],
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpbb/epv": "dev-master"
},
"extra": {
"display-name": "Survey",
"soft-require": {
"phpbb/phpbb": ">=3.1.5,<3.2.*@dev"
},
"version-check": {
- "host": "raw.githubusercontent.com",
+ "host": "kilianr.github.io",
- "directory": "/kilianr/phpbb-ext-survey/master",
? -------- -------
+ "directory": "/phpbb-ext-survey",
- "filename": "version-check.json",
? -
+ "filename": "version-check.json"
- "ssl": true
}
}
} | 7 | 0.205882 | 3 | 4 |
f05508d6189e5cef1266a66f5548062f6c65797f | metadata/com.darkempire78.opencalculator.yml | metadata/com.darkempire78.opencalculator.yml | Categories:
- System
License: GPL-3.0-only
AuthorName: Darkempire78
AuthorEmail: darkempirepro@gmail.com
SourceCode: https://github.com/Darkempire78/OpenCalc
IssueTracker: https://github.com/Darkempire78/OpenCalc/issues
Changelog: https://github.com/Darkempire78/OpenCalc/releases
AutoName: OpenCalc
RepoType: git
Repo: https://github.com/Darkempire78/OpenCalc
Builds:
- versionName: 1.0.0
versionCode: 1
commit: 49b96ed30a60c97c58c6a29253c1b8f864369f97
subdir: app
sudo:
- apt-get update || apt-get update
- apt-get install -y openjdk-11-jdk-headless
- update-alternatives --auto java
gradle:
- yes
AutoUpdateMode: Version
UpdateCheckMode: Tags
CurrentVersion: 1.0.0
CurrentVersionCode: 1
| Categories:
- System
License: GPL-3.0-only
AuthorName: Darkempire78
AuthorEmail: darkempirepro@gmail.com
SourceCode: https://github.com/Darkempire78/OpenCalc
IssueTracker: https://github.com/Darkempire78/OpenCalc/issues
Changelog: https://github.com/Darkempire78/OpenCalc/releases
AutoName: OpenCalc
RepoType: git
Repo: https://github.com/Darkempire78/OpenCalc
Builds:
- versionName: 1.0.0
versionCode: 1
commit: 49b96ed30a60c97c58c6a29253c1b8f864369f97
subdir: app
sudo:
- apt-get update || apt-get update
- apt-get install -y openjdk-11-jdk-headless
- update-alternatives --auto java
gradle:
- yes
- versionName: 1.1.0
versionCode: 2
commit: d3c8ca4bc9733762cea04985aa20e7f8341d1fea
subdir: app
sudo:
- apt-get update || apt-get update
- apt-get install -y openjdk-11-jdk-headless
- update-alternatives --auto java
gradle:
- yes
AutoUpdateMode: Version
UpdateCheckMode: Tags
CurrentVersion: 1.1.0
CurrentVersionCode: 2
| Update OpenCalc to 1.1.0 (2) | Update OpenCalc to 1.1.0 (2)
| YAML | agpl-3.0 | f-droid/fdroiddata,f-droid/fdroiddata | yaml | ## Code Before:
Categories:
- System
License: GPL-3.0-only
AuthorName: Darkempire78
AuthorEmail: darkempirepro@gmail.com
SourceCode: https://github.com/Darkempire78/OpenCalc
IssueTracker: https://github.com/Darkempire78/OpenCalc/issues
Changelog: https://github.com/Darkempire78/OpenCalc/releases
AutoName: OpenCalc
RepoType: git
Repo: https://github.com/Darkempire78/OpenCalc
Builds:
- versionName: 1.0.0
versionCode: 1
commit: 49b96ed30a60c97c58c6a29253c1b8f864369f97
subdir: app
sudo:
- apt-get update || apt-get update
- apt-get install -y openjdk-11-jdk-headless
- update-alternatives --auto java
gradle:
- yes
AutoUpdateMode: Version
UpdateCheckMode: Tags
CurrentVersion: 1.0.0
CurrentVersionCode: 1
## Instruction:
Update OpenCalc to 1.1.0 (2)
## Code After:
Categories:
- System
License: GPL-3.0-only
AuthorName: Darkempire78
AuthorEmail: darkempirepro@gmail.com
SourceCode: https://github.com/Darkempire78/OpenCalc
IssueTracker: https://github.com/Darkempire78/OpenCalc/issues
Changelog: https://github.com/Darkempire78/OpenCalc/releases
AutoName: OpenCalc
RepoType: git
Repo: https://github.com/Darkempire78/OpenCalc
Builds:
- versionName: 1.0.0
versionCode: 1
commit: 49b96ed30a60c97c58c6a29253c1b8f864369f97
subdir: app
sudo:
- apt-get update || apt-get update
- apt-get install -y openjdk-11-jdk-headless
- update-alternatives --auto java
gradle:
- yes
- versionName: 1.1.0
versionCode: 2
commit: d3c8ca4bc9733762cea04985aa20e7f8341d1fea
subdir: app
sudo:
- apt-get update || apt-get update
- apt-get install -y openjdk-11-jdk-headless
- update-alternatives --auto java
gradle:
- yes
AutoUpdateMode: Version
UpdateCheckMode: Tags
CurrentVersion: 1.1.0
CurrentVersionCode: 2
| Categories:
- System
License: GPL-3.0-only
AuthorName: Darkempire78
AuthorEmail: darkempirepro@gmail.com
SourceCode: https://github.com/Darkempire78/OpenCalc
IssueTracker: https://github.com/Darkempire78/OpenCalc/issues
Changelog: https://github.com/Darkempire78/OpenCalc/releases
AutoName: OpenCalc
RepoType: git
Repo: https://github.com/Darkempire78/OpenCalc
Builds:
- versionName: 1.0.0
versionCode: 1
commit: 49b96ed30a60c97c58c6a29253c1b8f864369f97
subdir: app
sudo:
- apt-get update || apt-get update
- apt-get install -y openjdk-11-jdk-headless
- update-alternatives --auto java
gradle:
- yes
+ - versionName: 1.1.0
+ versionCode: 2
+ commit: d3c8ca4bc9733762cea04985aa20e7f8341d1fea
+ subdir: app
+ sudo:
+ - apt-get update || apt-get update
+ - apt-get install -y openjdk-11-jdk-headless
+ - update-alternatives --auto java
+ gradle:
+ - yes
+
AutoUpdateMode: Version
UpdateCheckMode: Tags
- CurrentVersion: 1.0.0
? ^
+ CurrentVersion: 1.1.0
? ^
- CurrentVersionCode: 1
? ^
+ CurrentVersionCode: 2
? ^
| 15 | 0.5 | 13 | 2 |
d0378873c5457cb1239bf586c72b77bcfdcc8589 | src/main/resources/application.properties | src/main/resources/application.properties |
flyway.locations = classpath:db/migrations/common, classpath:db/migrations/${spring.datasource.platform}
management.contextPath = /api/system
security.user.name = euregjug
security.user.password = test |
flyway.locations = classpath:db/migrations/common, classpath:db/migrations/${spring.datasource.platform:postgresql}
management.contextPath = /api/system
security.user.name = euregjug
security.user.password = test | Add fallback if no platform is set | Add fallback if no platform is set
| INI | apache-2.0 | EuregJUG-Maas-Rhine/site,EuregJUG-Maas-Rhine/site,EuregJUG-Maas-Rhine/site | ini | ## Code Before:
flyway.locations = classpath:db/migrations/common, classpath:db/migrations/${spring.datasource.platform}
management.contextPath = /api/system
security.user.name = euregjug
security.user.password = test
## Instruction:
Add fallback if no platform is set
## Code After:
flyway.locations = classpath:db/migrations/common, classpath:db/migrations/${spring.datasource.platform:postgresql}
management.contextPath = /api/system
security.user.name = euregjug
security.user.password = test |
- flyway.locations = classpath:db/migrations/common, classpath:db/migrations/${spring.datasource.platform}
+ flyway.locations = classpath:db/migrations/common, classpath:db/migrations/${spring.datasource.platform:postgresql}
? +++++++++++
management.contextPath = /api/system
security.user.name = euregjug
security.user.password = test | 2 | 0.285714 | 1 | 1 |
2966f9690e9b5ec920d5cc183f4e3f42f02aac9a | lib/router.rb | lib/router.rb |
class Router
attr_reader :languages
def initialize
@languages = {}
Dir[File.dirname(__FILE__) + "/languages/*/language.rb"].each {|file|
require file
lang = /languages\/(.*)\/language\.rb/.match(file)[1]
@languages[lang] = Object.const_get(lang.capitalize).new
}
end
public
# Return a list of languages available.
def languages
@languages.keys
end
# Return a list of verbs available for a given language.
def list_verbs(language)
lang = @languages[language] or raise LanguageException, "Language #{language} not found."
lang.verbs
end
# Process a user inputs by conjugating the verb and applying a subject.
def conjugate_verb(language, verb, tense)
lang = @languages[language] or raise LanguageException, "Language #{language} not found."
lang.conjugate(verb, tense)
end
end
|
class Router
attr_reader :languages
def initialize
@languages = {}
Dir[File.dirname(__FILE__) + "/languages/*/language.rb"].each {|file|
require file
lang = /languages\/(.*)\/language\.rb/.match(file)[1]
@languages[lang] = Object.const_get(lang.capitalize).new
}
end
public
# Return a list of languages available.
def languages
@languages.keys
end
# Return a list of verbs available for a given language.
def list_verbs(language)
@languages[language].verbs or raise LanguageException, "Language #{language} not found."
end
# Process a user inputs by conjugating the verb and applying a subject.
def conjugate_verb(language, verb, tense)
lang = @languages[language] or raise LanguageException, "Language #{language} not found."
lang.conjugate(verb, tense)
end
end
| Simplify code by removing unnecessary use of a variable to hold the verb list call. | Simplify code by removing unnecessary use of a variable to hold the verb list call.
| Ruby | mit | benjaminasmith/grokily | ruby | ## Code Before:
class Router
attr_reader :languages
def initialize
@languages = {}
Dir[File.dirname(__FILE__) + "/languages/*/language.rb"].each {|file|
require file
lang = /languages\/(.*)\/language\.rb/.match(file)[1]
@languages[lang] = Object.const_get(lang.capitalize).new
}
end
public
# Return a list of languages available.
def languages
@languages.keys
end
# Return a list of verbs available for a given language.
def list_verbs(language)
lang = @languages[language] or raise LanguageException, "Language #{language} not found."
lang.verbs
end
# Process a user inputs by conjugating the verb and applying a subject.
def conjugate_verb(language, verb, tense)
lang = @languages[language] or raise LanguageException, "Language #{language} not found."
lang.conjugate(verb, tense)
end
end
## Instruction:
Simplify code by removing unnecessary use of a variable to hold the verb list call.
## Code After:
class Router
attr_reader :languages
def initialize
@languages = {}
Dir[File.dirname(__FILE__) + "/languages/*/language.rb"].each {|file|
require file
lang = /languages\/(.*)\/language\.rb/.match(file)[1]
@languages[lang] = Object.const_get(lang.capitalize).new
}
end
public
# Return a list of languages available.
def languages
@languages.keys
end
# Return a list of verbs available for a given language.
def list_verbs(language)
@languages[language].verbs or raise LanguageException, "Language #{language} not found."
end
# Process a user inputs by conjugating the verb and applying a subject.
def conjugate_verb(language, verb, tense)
lang = @languages[language] or raise LanguageException, "Language #{language} not found."
lang.conjugate(verb, tense)
end
end
|
class Router
attr_reader :languages
def initialize
@languages = {}
Dir[File.dirname(__FILE__) + "/languages/*/language.rb"].each {|file|
require file
lang = /languages\/(.*)\/language\.rb/.match(file)[1]
@languages[lang] = Object.const_get(lang.capitalize).new
}
end
public
# Return a list of languages available.
def languages
@languages.keys
end
# Return a list of verbs available for a given language.
def list_verbs(language)
- lang = @languages[language] or raise LanguageException, "Language #{language} not found."
? -------
+ @languages[language].verbs or raise LanguageException, "Language #{language} not found."
? ++++++
- lang.verbs
end
# Process a user inputs by conjugating the verb and applying a subject.
def conjugate_verb(language, verb, tense)
lang = @languages[language] or raise LanguageException, "Language #{language} not found."
lang.conjugate(verb, tense)
end
end
| 3 | 0.088235 | 1 | 2 |
e0009189e7b76d696d1e189f7060e3ff8da9a788 | guides/calculators/tax-calculator.md | guides/calculators/tax-calculator.md |
Solidus comes with a tax calculator that is used to calculate both sales tax
(United States-style taxes) and value-added tax (VAT):
[`Spree::Calculator::DefaultTax`][default-tax-calculator]. Typically, this
calculator should be the only tax calculator required by your store.
Taxes can apply to line items, shipments, or an entire order.
The tax calculator uses its calculable – a `Spree::TaxRate` – to calculate tax
totals. Tax rates are represented as decimal between `0` and `1`.
For more comprehensive documentation about taxes in Solidus, see the
[Taxation][taxation] documentation.
If your store's tax requirements are more complicated, you may want to create a
[custom tax calculator][custom-tax-calculator] or use an extension like
[`solidus_tax_cloud`][solidus-tax-cloud].
[custom-tax-calculator]: ../taxation/custom-tax-calculators.md
[default-tax-calculator]: https://github.com/solidusio/solidus/blob/master/core/app/models/spree/calculator/default_tax.rb
[solidus-tax-cloud]: https://github.com/solidusio-contrib/solidus_tax_cloud
[taxation]: ../taxation/overview.md
|
Solidus comes with a tax calculator that is used to calculate both sales tax
(United States-style taxes) and value-added tax (VAT):
[`Spree::Calculator::DefaultTax`][default-tax-calculator]. Typically, this
calculator should be the only tax calculator required by your store.
Using this calculator, all tax rates are represented as a decimal. So, a tax
rate of 5% should be represented as `0.05`.
Taxes can apply to line items, shipments, or an entire order.
The tax calculator uses its calculable – a `Spree::TaxRate` – to calculate tax
totals.
For more comprehensive documentation about taxes in Solidus, see the
[Taxation][taxation] documentation.
If your store's tax requirements are more complicated, you may want to create a
[custom tax calculator][custom-tax-calculator] or use an extension like
[`solidus_tax_cloud`][solidus-tax-cloud].
[custom-tax-calculator]: ../taxation/custom-tax-calculators.md
[default-tax-calculator]: https://github.com/solidusio/solidus/blob/master/core/app/models/spree/calculator/default_tax.rb
[solidus-tax-cloud]: https://github.com/solidusio-contrib/solidus_tax_cloud
[taxation]: ../taxation/overview.md
| Revise explanation of how tax rates are represented | Revise explanation of how tax rates are represented
| Markdown | bsd-3-clause | pervino/solidus,pervino/solidus,pervino/solidus,pervino/solidus | markdown | ## Code Before:
Solidus comes with a tax calculator that is used to calculate both sales tax
(United States-style taxes) and value-added tax (VAT):
[`Spree::Calculator::DefaultTax`][default-tax-calculator]. Typically, this
calculator should be the only tax calculator required by your store.
Taxes can apply to line items, shipments, or an entire order.
The tax calculator uses its calculable – a `Spree::TaxRate` – to calculate tax
totals. Tax rates are represented as decimal between `0` and `1`.
For more comprehensive documentation about taxes in Solidus, see the
[Taxation][taxation] documentation.
If your store's tax requirements are more complicated, you may want to create a
[custom tax calculator][custom-tax-calculator] or use an extension like
[`solidus_tax_cloud`][solidus-tax-cloud].
[custom-tax-calculator]: ../taxation/custom-tax-calculators.md
[default-tax-calculator]: https://github.com/solidusio/solidus/blob/master/core/app/models/spree/calculator/default_tax.rb
[solidus-tax-cloud]: https://github.com/solidusio-contrib/solidus_tax_cloud
[taxation]: ../taxation/overview.md
## Instruction:
Revise explanation of how tax rates are represented
## Code After:
Solidus comes with a tax calculator that is used to calculate both sales tax
(United States-style taxes) and value-added tax (VAT):
[`Spree::Calculator::DefaultTax`][default-tax-calculator]. Typically, this
calculator should be the only tax calculator required by your store.
Using this calculator, all tax rates are represented as a decimal. So, a tax
rate of 5% should be represented as `0.05`.
Taxes can apply to line items, shipments, or an entire order.
The tax calculator uses its calculable – a `Spree::TaxRate` – to calculate tax
totals.
For more comprehensive documentation about taxes in Solidus, see the
[Taxation][taxation] documentation.
If your store's tax requirements are more complicated, you may want to create a
[custom tax calculator][custom-tax-calculator] or use an extension like
[`solidus_tax_cloud`][solidus-tax-cloud].
[custom-tax-calculator]: ../taxation/custom-tax-calculators.md
[default-tax-calculator]: https://github.com/solidusio/solidus/blob/master/core/app/models/spree/calculator/default_tax.rb
[solidus-tax-cloud]: https://github.com/solidusio-contrib/solidus_tax_cloud
[taxation]: ../taxation/overview.md
|
Solidus comes with a tax calculator that is used to calculate both sales tax
(United States-style taxes) and value-added tax (VAT):
[`Spree::Calculator::DefaultTax`][default-tax-calculator]. Typically, this
calculator should be the only tax calculator required by your store.
+ Using this calculator, all tax rates are represented as a decimal. So, a tax
+ rate of 5% should be represented as `0.05`.
+
Taxes can apply to line items, shipments, or an entire order.
The tax calculator uses its calculable – a `Spree::TaxRate` – to calculate tax
- totals. Tax rates are represented as decimal between `0` and `1`.
+ totals.
For more comprehensive documentation about taxes in Solidus, see the
[Taxation][taxation] documentation.
If your store's tax requirements are more complicated, you may want to create a
[custom tax calculator][custom-tax-calculator] or use an extension like
[`solidus_tax_cloud`][solidus-tax-cloud].
[custom-tax-calculator]: ../taxation/custom-tax-calculators.md
[default-tax-calculator]: https://github.com/solidusio/solidus/blob/master/core/app/models/spree/calculator/default_tax.rb
- [solidus-tax-cloud]: https://github.com/solidusio-contrib/solidus_tax_cloud
? -
+ [solidus-tax-cloud]: https://github.com/solidusio-contrib/solidus_tax_cloud
[taxation]: ../taxation/overview.md
| 7 | 0.304348 | 5 | 2 |
c75cb871fa03912dac7d3e94cf6decaeadfcba66 | stubs/go-nethttp/run.go | stubs/go-nethttp/run.go | package main
import (
"fmt"
"net/http"
"os"
"strings"
)
func main() {
if len(os.Args) == 4 {
fmt.Println("UNSUPPORTED")
os.Exit(0)
} else if len(os.Args) != 3 {
fmt.Printf("usage: %v <host> <port>\n", os.Args[0])
os.Exit(1)
}
url := "https://" + os.Args[1] + ":" + os.Args[2]
// Perform an HTTP(S) Request
_, err := http.Get(url)
if err != nil {
fatalError := strings.Contains(err.Error(), "no such host")
fmt.Println(err.Error())
if fatalError {
os.Exit(1)
}
fmt.Println("REJECT")
} else {
fmt.Println("ACCEPT")
}
os.Exit(0)
}
| package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io/ioutil"
"net/http"
"os"
"strings"
)
func main() {
if len(os.Args) < 3 || len(os.Args) > 4 {
fmt.Printf("usage: %v <host> <port> [cafile]\n", os.Args[0])
os.Exit(1)
}
client := http.DefaultClient
if len(os.Args) == 4 {
cadata, err := ioutil.ReadFile(os.Args[3])
if err != nil {
fmt.Println(err)
os.Exit(1)
}
pool := x509.NewCertPool()
if !pool.AppendCertsFromPEM(cadata) {
fmt.Println("Couldn't append certs")
os.Exit(1)
}
client = &http.Client{
Transport: &http.Transport{
TLSClientConfig: &tls.Config{RootCAs: pool},
},
}
}
// Perform an HTTPS Request
_, err := client.Get("https://" + os.Args[1] + ":" + os.Args[2])
if err != nil {
fatalError := strings.Contains(err.Error(), "no such host")
fmt.Println(err.Error())
if fatalError {
os.Exit(1)
}
fmt.Println("REJECT")
} else {
fmt.Println("ACCEPT")
}
os.Exit(0)
}
| Add cafile support to the go-nethttp stub | Add cafile support to the go-nethttp stub
| Go | mit | ouspg/trytls,ouspg/trytls,ouspg/trytls,ouspg/trytls,ouspg/trytls,ouspg/trytls,ouspg/trytls,ouspg/trytls | go | ## Code Before:
package main
import (
"fmt"
"net/http"
"os"
"strings"
)
func main() {
if len(os.Args) == 4 {
fmt.Println("UNSUPPORTED")
os.Exit(0)
} else if len(os.Args) != 3 {
fmt.Printf("usage: %v <host> <port>\n", os.Args[0])
os.Exit(1)
}
url := "https://" + os.Args[1] + ":" + os.Args[2]
// Perform an HTTP(S) Request
_, err := http.Get(url)
if err != nil {
fatalError := strings.Contains(err.Error(), "no such host")
fmt.Println(err.Error())
if fatalError {
os.Exit(1)
}
fmt.Println("REJECT")
} else {
fmt.Println("ACCEPT")
}
os.Exit(0)
}
## Instruction:
Add cafile support to the go-nethttp stub
## Code After:
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io/ioutil"
"net/http"
"os"
"strings"
)
func main() {
if len(os.Args) < 3 || len(os.Args) > 4 {
fmt.Printf("usage: %v <host> <port> [cafile]\n", os.Args[0])
os.Exit(1)
}
client := http.DefaultClient
if len(os.Args) == 4 {
cadata, err := ioutil.ReadFile(os.Args[3])
if err != nil {
fmt.Println(err)
os.Exit(1)
}
pool := x509.NewCertPool()
if !pool.AppendCertsFromPEM(cadata) {
fmt.Println("Couldn't append certs")
os.Exit(1)
}
client = &http.Client{
Transport: &http.Transport{
TLSClientConfig: &tls.Config{RootCAs: pool},
},
}
}
// Perform an HTTPS Request
_, err := client.Get("https://" + os.Args[1] + ":" + os.Args[2])
if err != nil {
fatalError := strings.Contains(err.Error(), "no such host")
fmt.Println(err.Error())
if fatalError {
os.Exit(1)
}
fmt.Println("REJECT")
} else {
fmt.Println("ACCEPT")
}
os.Exit(0)
}
| package main
import (
+ "crypto/tls"
+ "crypto/x509"
"fmt"
+ "io/ioutil"
"net/http"
"os"
"strings"
)
func main() {
+ if len(os.Args) < 3 || len(os.Args) > 4 {
- if len(os.Args) == 4 {
- fmt.Println("UNSUPPORTED")
- os.Exit(0)
- } else if len(os.Args) != 3 {
- fmt.Printf("usage: %v <host> <port>\n", os.Args[0])
+ fmt.Printf("usage: %v <host> <port> [cafile]\n", os.Args[0])
? +++++++++
os.Exit(1)
}
- url := "https://" + os.Args[1] + ":" + os.Args[2]
+ client := http.DefaultClient
+ if len(os.Args) == 4 {
+ cadata, err := ioutil.ReadFile(os.Args[3])
+ if err != nil {
+ fmt.Println(err)
+ os.Exit(1)
+ }
+ pool := x509.NewCertPool()
+ if !pool.AppendCertsFromPEM(cadata) {
+ fmt.Println("Couldn't append certs")
+ os.Exit(1)
+ }
+
+ client = &http.Client{
+ Transport: &http.Transport{
+ TLSClientConfig: &tls.Config{RootCAs: pool},
+ },
+ }
+ }
+
- // Perform an HTTP(S) Request
? - -
+ // Perform an HTTPS Request
- _, err := http.Get(url)
+ _, err := client.Get("https://" + os.Args[1] + ":" + os.Args[2])
if err != nil {
fatalError := strings.Contains(err.Error(), "no such host")
fmt.Println(err.Error())
if fatalError {
os.Exit(1)
}
fmt.Println("REJECT")
} else {
fmt.Println("ACCEPT")
}
os.Exit(0)
} | 35 | 1.029412 | 27 | 8 |
18cd9a1db083db1ce0822bab2f502357eeec97b5 | blog/tests/test_templatetags.py | blog/tests/test_templatetags.py | from django.test import TestCase
from django.template import Context, Template
class BlogTemplatetagsTestCase(TestCase):
def test_md_as_html5(self):
body = """# H1 heading
**Paragraph** text
## H2 heading
~~~~{.python}
if True:
print("Some Python code in markdown")
~~~~
1 First
2. Second
* sub
3. Last"""
expected = """<h1>H1 heading</h1>
<p><strong>Paragraph</strong> text</p>
<h2>H2 heading</h2>
<pre><code class="python">if True:
print("Some Python code in markdown")
</code></pre>
<p>1 First
2. Second
* sub
3. Last</p>"""
out = Template(
"{% load markdown %}"
"{{ body|md_as_html5 }}"
).render(Context({'body': body}))
self.assertEqual(out, expected)
| from django.test import TestCase
from django.template import Context, Template
class BlogTemplatetagsTestCase(TestCase):
def test_md_as_html5(self):
body = """# H1 heading
**Paragraph** text
<strong>html markup works</strong>
## H2 heading
~~~~{.python}
if True:
print("Some <b>Python</b> code in markdown")
~~~~
1 First
2. Second
* sub
3. Last"""
expected = """<h1>H1 heading</h1>
<p><strong>Paragraph</strong> text
<strong>html markup works</strong></p>
<h2>H2 heading</h2>
<pre><code class="python">if True:
print("Some <b>Python</b> code in markdown")
</code></pre>
<p>1 First
2. Second
* sub
3. Last</p>"""
out = Template(
"{% load markdown %}"
"{{ body|md_as_html5 }}"
).render(Context({'body': body}))
self.assertEqual(out, expected)
| Test HTML handling in markdown | Test HTML handling in markdown
| Python | agpl-3.0 | node13h/droll,node13h/droll | python | ## Code Before:
from django.test import TestCase
from django.template import Context, Template
class BlogTemplatetagsTestCase(TestCase):
def test_md_as_html5(self):
body = """# H1 heading
**Paragraph** text
## H2 heading
~~~~{.python}
if True:
print("Some Python code in markdown")
~~~~
1 First
2. Second
* sub
3. Last"""
expected = """<h1>H1 heading</h1>
<p><strong>Paragraph</strong> text</p>
<h2>H2 heading</h2>
<pre><code class="python">if True:
print("Some Python code in markdown")
</code></pre>
<p>1 First
2. Second
* sub
3. Last</p>"""
out = Template(
"{% load markdown %}"
"{{ body|md_as_html5 }}"
).render(Context({'body': body}))
self.assertEqual(out, expected)
## Instruction:
Test HTML handling in markdown
## Code After:
from django.test import TestCase
from django.template import Context, Template
class BlogTemplatetagsTestCase(TestCase):
def test_md_as_html5(self):
body = """# H1 heading
**Paragraph** text
<strong>html markup works</strong>
## H2 heading
~~~~{.python}
if True:
print("Some <b>Python</b> code in markdown")
~~~~
1 First
2. Second
* sub
3. Last"""
expected = """<h1>H1 heading</h1>
<p><strong>Paragraph</strong> text
<strong>html markup works</strong></p>
<h2>H2 heading</h2>
<pre><code class="python">if True:
print("Some <b>Python</b> code in markdown")
</code></pre>
<p>1 First
2. Second
* sub
3. Last</p>"""
out = Template(
"{% load markdown %}"
"{{ body|md_as_html5 }}"
).render(Context({'body': body}))
self.assertEqual(out, expected)
| from django.test import TestCase
from django.template import Context, Template
class BlogTemplatetagsTestCase(TestCase):
def test_md_as_html5(self):
body = """# H1 heading
**Paragraph** text
-
+ <strong>html markup works</strong>
## H2 heading
~~~~{.python}
if True:
- print("Some Python code in markdown")
+ print("Some <b>Python</b> code in markdown")
? +++ ++++
~~~~
1 First
2. Second
* sub
3. Last"""
expected = """<h1>H1 heading</h1>
- <p><strong>Paragraph</strong> text</p>
? ----
+ <p><strong>Paragraph</strong> text
+ <strong>html markup works</strong></p>
<h2>H2 heading</h2>
<pre><code class="python">if True:
- print("Some Python code in markdown")
+ print("Some <b>Python</b> code in markdown")
? +++++++++ ++++++++++
</code></pre>
<p>1 First
2. Second
* sub
3. Last</p>"""
out = Template(
"{% load markdown %}"
"{{ body|md_as_html5 }}"
).render(Context({'body': body}))
self.assertEqual(out, expected) | 9 | 0.219512 | 5 | 4 |
0b57aafe6e629a57520005d9af09fb0f4a875c47 | package.json | package.json | {
"name": "virustotal.js",
"version": "0.3.1",
"main": "./lib/virustotal.js",
"description": "VirusTotal API client for node.js.",
"engines": {
"node": ">=0.8.5"
},
"dependencies": {
"http-request": ">= 0.6.0"
},
"devDependencies": {
"jslint": ">= 0.1.9",
"js-beautify": ">= 0.4.2",
"mocha": ">= 1.14.0",
"chai": ">= 1.8.1"
},
"homepage": "https://github.com/SaltwaterC/virustotal.js",
"author": {
"name": "Stefan Rusu",
"url": "http://www.saltwaterc.eu/"
},
"repository": {
"type": "git",
"url": "git://github.com/SaltwaterC/virustotal.js.git"
},
"keywords": ["virustotal", "api", "https", "scan"]
} | {
"name": "virustotal.js",
"version": "0.3.1",
"main": "./lib/virustotal.js",
"description": "VirusTotal API client for node.js.",
"engines": {
"node": ">=0.8.5"
},
"dependencies": {
"request": "^2.67.0"
},
"devDependencies": {
"jslint": ">= 0.1.9",
"js-beautify": ">= 0.4.2",
"mocha": ">= 1.14.0",
"chai": ">= 1.8.1"
},
"homepage": "https://github.com/SaltwaterC/virustotal.js",
"author": {
"name": "Stefan Rusu",
"url": "http://www.saltwaterc.eu/"
},
"repository": {
"type": "git",
"url": "git://github.com/SaltwaterC/virustotal.js.git"
},
"keywords": ["virustotal", "api", "https", "scan"]
}
| Change dependency to request instead of http-request | Change dependency to request instead of http-request | JSON | bsd-3-clause | yeya/virustotal.js | json | ## Code Before:
{
"name": "virustotal.js",
"version": "0.3.1",
"main": "./lib/virustotal.js",
"description": "VirusTotal API client for node.js.",
"engines": {
"node": ">=0.8.5"
},
"dependencies": {
"http-request": ">= 0.6.0"
},
"devDependencies": {
"jslint": ">= 0.1.9",
"js-beautify": ">= 0.4.2",
"mocha": ">= 1.14.0",
"chai": ">= 1.8.1"
},
"homepage": "https://github.com/SaltwaterC/virustotal.js",
"author": {
"name": "Stefan Rusu",
"url": "http://www.saltwaterc.eu/"
},
"repository": {
"type": "git",
"url": "git://github.com/SaltwaterC/virustotal.js.git"
},
"keywords": ["virustotal", "api", "https", "scan"]
}
## Instruction:
Change dependency to request instead of http-request
## Code After:
{
"name": "virustotal.js",
"version": "0.3.1",
"main": "./lib/virustotal.js",
"description": "VirusTotal API client for node.js.",
"engines": {
"node": ">=0.8.5"
},
"dependencies": {
"request": "^2.67.0"
},
"devDependencies": {
"jslint": ">= 0.1.9",
"js-beautify": ">= 0.4.2",
"mocha": ">= 1.14.0",
"chai": ">= 1.8.1"
},
"homepage": "https://github.com/SaltwaterC/virustotal.js",
"author": {
"name": "Stefan Rusu",
"url": "http://www.saltwaterc.eu/"
},
"repository": {
"type": "git",
"url": "git://github.com/SaltwaterC/virustotal.js.git"
},
"keywords": ["virustotal", "api", "https", "scan"]
}
| {
"name": "virustotal.js",
"version": "0.3.1",
"main": "./lib/virustotal.js",
"description": "VirusTotal API client for node.js.",
"engines": {
"node": ">=0.8.5"
},
"dependencies": {
- "http-request": ">= 0.6.0"
? ----- ^^^^
+ "request": "^2.67.0"
? ^^ +
},
"devDependencies": {
"jslint": ">= 0.1.9",
"js-beautify": ">= 0.4.2",
"mocha": ">= 1.14.0",
"chai": ">= 1.8.1"
},
"homepage": "https://github.com/SaltwaterC/virustotal.js",
"author": {
"name": "Stefan Rusu",
"url": "http://www.saltwaterc.eu/"
},
"repository": {
"type": "git",
"url": "git://github.com/SaltwaterC/virustotal.js.git"
},
"keywords": ["virustotal", "api", "https", "scan"]
} | 2 | 0.071429 | 1 | 1 |
dfb83676417b301eea8915fb0f9d11c131970bd0 | index.php | index.php | <?php
include 'includes/constant/config.inc.php';
session_start();
return_meta();
?>
<head>
<title>Home</title></head>
<body>
<div id="container">
<div id="headerplaced">
<?php include 'includes/constant/nav.inc.php'; ?>
</div>
<div class="content">
<div class="sidebarhome">
<h2>What would you like to do?</h2>
<p>A CHANGE </p>
<p><strong>Volunteer </strong>button</p>
<p><strong>Get Pet Assistance </strong>button</p>
<p class="note"><strong>Register first!</strong> When volunteering or requesting assistance for the first time, you will be first directed to register on the Pet Project website. </p>
</div>
<div class="mainhome">
<p>Home page content/photo.</p>
<img src="images/unpurchased_photo.jpg">
</div>
</div>
<div id="footer">
<p>Here's some content for the footer. Need to use an include for this.</p>
</div>
</div>
</body>
</html>
| <?php
include 'includes/constant/config.inc.php';
session_start();
return_meta();
?>
<head>
<title>Home</title></head>
<body>
<div id="container">
<div id="headerplaced">
<?php include 'includes/constant/nav.inc.php'; ?>
</div>
<div class="content">
<div class="sidebarhome">
<h2>What would you like to do?</h2>
<p><strong>Volunteer </strong>button</p>
<p><strong>Get Pet Assistance </strong>button</p>
<p class="note"><strong>Register first!</strong> When volunteering or requesting assistance for the first time, you will be first directed to register on the Pet Project website. </p>
</div>
<div class="mainhome">
<p>Home page content/photo.</p>
<img src="images/unpurchased_photo.jpg">
</div>
</div>
<div id="footer">
<p>Here's some content for the footer. Need to use an include for this.</p>
</div>
</div>
</body>
</html>
| Revert "Dummy commit to test" | Revert "Dummy commit to test"
This reverts commit dd95013be87c409d6aac0b302a06fc426ef60339.
| PHP | mit | TSA-HCI573/PetProject,TSA-HCI573/PetProject | php | ## Code Before:
<?php
include 'includes/constant/config.inc.php';
session_start();
return_meta();
?>
<head>
<title>Home</title></head>
<body>
<div id="container">
<div id="headerplaced">
<?php include 'includes/constant/nav.inc.php'; ?>
</div>
<div class="content">
<div class="sidebarhome">
<h2>What would you like to do?</h2>
<p>A CHANGE </p>
<p><strong>Volunteer </strong>button</p>
<p><strong>Get Pet Assistance </strong>button</p>
<p class="note"><strong>Register first!</strong> When volunteering or requesting assistance for the first time, you will be first directed to register on the Pet Project website. </p>
</div>
<div class="mainhome">
<p>Home page content/photo.</p>
<img src="images/unpurchased_photo.jpg">
</div>
</div>
<div id="footer">
<p>Here's some content for the footer. Need to use an include for this.</p>
</div>
</div>
</body>
</html>
## Instruction:
Revert "Dummy commit to test"
This reverts commit dd95013be87c409d6aac0b302a06fc426ef60339.
## Code After:
<?php
include 'includes/constant/config.inc.php';
session_start();
return_meta();
?>
<head>
<title>Home</title></head>
<body>
<div id="container">
<div id="headerplaced">
<?php include 'includes/constant/nav.inc.php'; ?>
</div>
<div class="content">
<div class="sidebarhome">
<h2>What would you like to do?</h2>
<p><strong>Volunteer </strong>button</p>
<p><strong>Get Pet Assistance </strong>button</p>
<p class="note"><strong>Register first!</strong> When volunteering or requesting assistance for the first time, you will be first directed to register on the Pet Project website. </p>
</div>
<div class="mainhome">
<p>Home page content/photo.</p>
<img src="images/unpurchased_photo.jpg">
</div>
</div>
<div id="footer">
<p>Here's some content for the footer. Need to use an include for this.</p>
</div>
</div>
</body>
</html>
| <?php
include 'includes/constant/config.inc.php';
session_start();
return_meta();
?>
<head>
<title>Home</title></head>
<body>
<div id="container">
<div id="headerplaced">
<?php include 'includes/constant/nav.inc.php'; ?>
</div>
<div class="content">
<div class="sidebarhome">
<h2>What would you like to do?</h2>
-
- <p>A CHANGE </p>
<p><strong>Volunteer </strong>button</p>
<p><strong>Get Pet Assistance </strong>button</p>
<p class="note"><strong>Register first!</strong> When volunteering or requesting assistance for the first time, you will be first directed to register on the Pet Project website. </p>
</div>
<div class="mainhome">
<p>Home page content/photo.</p>
<img src="images/unpurchased_photo.jpg">
</div>
</div>
<div id="footer">
<p>Here's some content for the footer. Need to use an include for this.</p>
</div>
</div>
</body>
</html>
| 2 | 0.038462 | 0 | 2 |
18eb6c6030cc855a5f7a2efb1fa3cebdcdca7228 | app/assets/javascripts/task-manager/extjs/app/view/plan/SelectAssignables.js | app/assets/javascripts/task-manager/extjs/app/view/plan/SelectAssignables.js | Ext.define('TM.view.plan.SelectAssignables', {
extend: 'Ext.panel.Panel',
xtype: 'plan_selectassignables',
requires: [
'TM.view.plan.SelectAssignablesGrid',
],
items: [{
xtype: 'plan_selectassignablesGrid',
flex: 1
}],
buttons: [{
text: '确定',
action: 'save'
}, {
text: '取消',
action: 'cancel'
}]
}); | Ext.define('TM.view.plan.SelectAssignables', {
extend: 'Ext.panel.Panel',
xtype: 'plan_selectassignables',
requires: [
//'TM.view.plan.SelectAssignablesGrid',
'TM.view.plan.SelectAssignablesTree'
],
items: [{
xtype: 'plan_selectassignablestree',
flex: 1
}],
buttons: [{
text: '确定',
action: 'save'
}, {
text: '取消',
action: 'cancel'
}]
});
| Change assignees grid to tree | Change assignees grid to tree
| JavaScript | mit | menglifang/task-manager,menglifang/task-manager | javascript | ## Code Before:
Ext.define('TM.view.plan.SelectAssignables', {
extend: 'Ext.panel.Panel',
xtype: 'plan_selectassignables',
requires: [
'TM.view.plan.SelectAssignablesGrid',
],
items: [{
xtype: 'plan_selectassignablesGrid',
flex: 1
}],
buttons: [{
text: '确定',
action: 'save'
}, {
text: '取消',
action: 'cancel'
}]
});
## Instruction:
Change assignees grid to tree
## Code After:
Ext.define('TM.view.plan.SelectAssignables', {
extend: 'Ext.panel.Panel',
xtype: 'plan_selectassignables',
requires: [
//'TM.view.plan.SelectAssignablesGrid',
'TM.view.plan.SelectAssignablesTree'
],
items: [{
xtype: 'plan_selectassignablestree',
flex: 1
}],
buttons: [{
text: '确定',
action: 'save'
}, {
text: '取消',
action: 'cancel'
}]
});
| Ext.define('TM.view.plan.SelectAssignables', {
extend: 'Ext.panel.Panel',
xtype: 'plan_selectassignables',
-
+
requires: [
- 'TM.view.plan.SelectAssignablesGrid',
+ //'TM.view.plan.SelectAssignablesGrid',
? ++
+ 'TM.view.plan.SelectAssignablesTree'
],
items: [{
- xtype: 'plan_selectassignablesGrid',
? ^ ^^
+ xtype: 'plan_selectassignablestree',
? ^ ^^
flex: 1
}],
buttons: [{
text: '确定',
action: 'save'
}, {
text: '取消',
action: 'cancel'
}]
}); | 7 | 0.333333 | 4 | 3 |
d98e3b69832cc54bf34ad324c44eb0a1c0d2d19d | src/main/java/info/u_team/u_team_core/util/ModelUtil.java | src/main/java/info/u_team/u_team_core/util/ModelUtil.java | package info.u_team.u_team_core.util;
import static net.minecraft.client.renderer.model.ModelBakery.STATE_CONTAINER_OVERRIDES;
import java.util.*;
import com.google.common.collect.*;
import net.minecraft.block.*;
import net.minecraft.state.StateContainer;
import net.minecraft.util.ResourceLocation;
public class ModelUtil {
static {
if (STATE_CONTAINER_OVERRIDES instanceof ImmutableMap) {
final Map<ResourceLocation, StateContainer<Block, BlockState>> mutableMap = new HashMap<>();
STATE_CONTAINER_OVERRIDES.forEach(mutableMap::put);
STATE_CONTAINER_OVERRIDES = mutableMap;
}
}
public static void addCustomStateContainer(ResourceLocation location, StateContainer<Block, BlockState> container) {
STATE_CONTAINER_OVERRIDES.put(location, container);
}
public static class EmptyStateContainer extends StateContainer<Block, BlockState> {
public EmptyStateContainer(Block block) {
super(Block::getDefaultState, block, BlockState::new, new HashMap<>());
}
@Override
public ImmutableList<BlockState> getValidStates() {
return getOwner().getStateContainer().getValidStates();
}
}
}
| package info.u_team.u_team_core.util;
import static net.minecraft.client.renderer.model.ModelBakery.*;
import java.util.*;
import com.google.common.collect.*;
import net.minecraft.block.*;
import net.minecraft.client.renderer.model.RenderMaterial;
import net.minecraft.state.StateContainer;
import net.minecraft.util.ResourceLocation;
public class ModelUtil {
static {
if (STATE_CONTAINER_OVERRIDES instanceof ImmutableMap) {
final Map<ResourceLocation, StateContainer<Block, BlockState>> mutableMap = new HashMap<>();
STATE_CONTAINER_OVERRIDES.forEach(mutableMap::put);
STATE_CONTAINER_OVERRIDES = mutableMap;
}
}
public static void addCustomStateContainer(ResourceLocation location, StateContainer<Block, BlockState> container) {
STATE_CONTAINER_OVERRIDES.put(location, container);
}
public static void addTexture(RenderMaterial material) {
LOCATIONS_BUILTIN_TEXTURES.add(material);
}
public static class EmptyStateContainer extends StateContainer<Block, BlockState> {
public EmptyStateContainer(Block block) {
super(Block::getDefaultState, block, BlockState::new, new HashMap<>());
}
@Override
public ImmutableList<BlockState> getValidStates() {
return getOwner().getStateContainer().getValidStates();
}
}
}
| Add method to add custom texture | Add method to add custom texture | Java | apache-2.0 | MC-U-Team/U-Team-Core,MC-U-Team/U-Team-Core | java | ## Code Before:
package info.u_team.u_team_core.util;
import static net.minecraft.client.renderer.model.ModelBakery.STATE_CONTAINER_OVERRIDES;
import java.util.*;
import com.google.common.collect.*;
import net.minecraft.block.*;
import net.minecraft.state.StateContainer;
import net.minecraft.util.ResourceLocation;
public class ModelUtil {
static {
if (STATE_CONTAINER_OVERRIDES instanceof ImmutableMap) {
final Map<ResourceLocation, StateContainer<Block, BlockState>> mutableMap = new HashMap<>();
STATE_CONTAINER_OVERRIDES.forEach(mutableMap::put);
STATE_CONTAINER_OVERRIDES = mutableMap;
}
}
public static void addCustomStateContainer(ResourceLocation location, StateContainer<Block, BlockState> container) {
STATE_CONTAINER_OVERRIDES.put(location, container);
}
public static class EmptyStateContainer extends StateContainer<Block, BlockState> {
public EmptyStateContainer(Block block) {
super(Block::getDefaultState, block, BlockState::new, new HashMap<>());
}
@Override
public ImmutableList<BlockState> getValidStates() {
return getOwner().getStateContainer().getValidStates();
}
}
}
## Instruction:
Add method to add custom texture
## Code After:
package info.u_team.u_team_core.util;
import static net.minecraft.client.renderer.model.ModelBakery.*;
import java.util.*;
import com.google.common.collect.*;
import net.minecraft.block.*;
import net.minecraft.client.renderer.model.RenderMaterial;
import net.minecraft.state.StateContainer;
import net.minecraft.util.ResourceLocation;
public class ModelUtil {
static {
if (STATE_CONTAINER_OVERRIDES instanceof ImmutableMap) {
final Map<ResourceLocation, StateContainer<Block, BlockState>> mutableMap = new HashMap<>();
STATE_CONTAINER_OVERRIDES.forEach(mutableMap::put);
STATE_CONTAINER_OVERRIDES = mutableMap;
}
}
public static void addCustomStateContainer(ResourceLocation location, StateContainer<Block, BlockState> container) {
STATE_CONTAINER_OVERRIDES.put(location, container);
}
public static void addTexture(RenderMaterial material) {
LOCATIONS_BUILTIN_TEXTURES.add(material);
}
public static class EmptyStateContainer extends StateContainer<Block, BlockState> {
public EmptyStateContainer(Block block) {
super(Block::getDefaultState, block, BlockState::new, new HashMap<>());
}
@Override
public ImmutableList<BlockState> getValidStates() {
return getOwner().getStateContainer().getValidStates();
}
}
}
| package info.u_team.u_team_core.util;
- import static net.minecraft.client.renderer.model.ModelBakery.STATE_CONTAINER_OVERRIDES;
? ^^^^^^^^^^^^^^^^^^^^^^^^^
+ import static net.minecraft.client.renderer.model.ModelBakery.*;
? ^
import java.util.*;
import com.google.common.collect.*;
import net.minecraft.block.*;
+ import net.minecraft.client.renderer.model.RenderMaterial;
import net.minecraft.state.StateContainer;
import net.minecraft.util.ResourceLocation;
public class ModelUtil {
static {
if (STATE_CONTAINER_OVERRIDES instanceof ImmutableMap) {
final Map<ResourceLocation, StateContainer<Block, BlockState>> mutableMap = new HashMap<>();
STATE_CONTAINER_OVERRIDES.forEach(mutableMap::put);
STATE_CONTAINER_OVERRIDES = mutableMap;
}
}
public static void addCustomStateContainer(ResourceLocation location, StateContainer<Block, BlockState> container) {
STATE_CONTAINER_OVERRIDES.put(location, container);
}
+ public static void addTexture(RenderMaterial material) {
+ LOCATIONS_BUILTIN_TEXTURES.add(material);
+ }
+
public static class EmptyStateContainer extends StateContainer<Block, BlockState> {
public EmptyStateContainer(Block block) {
super(Block::getDefaultState, block, BlockState::new, new HashMap<>());
}
@Override
public ImmutableList<BlockState> getValidStates() {
return getOwner().getStateContainer().getValidStates();
}
}
} | 7 | 0.175 | 6 | 1 |
8d0243a52d23037045d310beb94e94bd4e25e152 | bosh_cli/lib/cli/file_with_progress_bar.rb | bosh_cli/lib/cli/file_with_progress_bar.rb | module Bosh
module Cli
class FileWithProgressBar < ::File
def progress_bar
return @progress_bar if @progress_bar
out = Bosh::Cli::Config.output || StringIO.new
@progress_bar = ProgressBar.new(file_name, size, out)
@progress_bar.file_transfer_mode
@progress_bar
end
def file_name
File.basename(self.path)
end
def stop_progress_bar
progress_bar.halt unless progress_bar.finished?
end
def size
@size || File.size(self.path)
end
def size=(size)
@size=size
end
def read(*args)
result = super(*args)
if result && result.size > 0
progress_bar.inc(result.size)
else
progress_bar.finish
end
result
end
def write(*args)
count = super(*args)
if count
progress_bar.inc(count)
else
progress_bar.finish
end
count
end
end
end
end
| module Bosh
module Cli
class FileWithProgressBar < ::File
def progress_bar
return @progress_bar if @progress_bar
out = Bosh::Cli::Config.output || StringIO.new
@progress_bar = ProgressBar.new(file_name, size, out)
@progress_bar.file_transfer_mode
@progress_bar
end
def file_name
File.basename(self.path)
end
def stop_progress_bar
progress_bar.halt unless progress_bar.finished?
end
def size
@size || File.size(self.path)
end
def size=(size)
@size=size
end
def read(*args)
result = super(*args)
if result && result.size > 0
progress_bar.inc(result.size)
else
progress_bar.set(size)
progress_bar.finish
end
result
end
def write(*args)
count = super(*args)
if count
progress_bar.inc(count)
else
progress_bar.set(size)
progress_bar.finish
end
count
end
end
end
end
| Make sure the progress bar goes to 100% | Make sure the progress bar goes to 100%
No one likes it when an operation ends and the progress bar never went all the way to 100%. @zachgersh was showing me some concourseci output and the progress bars always ended at 96%. Rather than sort out exactly why the chunks never match up exactly, just set the progress bar to 100% when we're done. | Ruby | apache-2.0 | barthy1/bosh,barthy1/bosh,barthy1/bosh,barthy1/bosh | ruby | ## Code Before:
module Bosh
module Cli
class FileWithProgressBar < ::File
def progress_bar
return @progress_bar if @progress_bar
out = Bosh::Cli::Config.output || StringIO.new
@progress_bar = ProgressBar.new(file_name, size, out)
@progress_bar.file_transfer_mode
@progress_bar
end
def file_name
File.basename(self.path)
end
def stop_progress_bar
progress_bar.halt unless progress_bar.finished?
end
def size
@size || File.size(self.path)
end
def size=(size)
@size=size
end
def read(*args)
result = super(*args)
if result && result.size > 0
progress_bar.inc(result.size)
else
progress_bar.finish
end
result
end
def write(*args)
count = super(*args)
if count
progress_bar.inc(count)
else
progress_bar.finish
end
count
end
end
end
end
## Instruction:
Make sure the progress bar goes to 100%
No one likes it when an operation ends and the progress bar never went all the way to 100%. @zachgersh was showing me some concourseci output and the progress bars always ended at 96%. Rather than sort out exactly why the chunks never match up exactly, just set the progress bar to 100% when we're done.
## Code After:
module Bosh
module Cli
class FileWithProgressBar < ::File
def progress_bar
return @progress_bar if @progress_bar
out = Bosh::Cli::Config.output || StringIO.new
@progress_bar = ProgressBar.new(file_name, size, out)
@progress_bar.file_transfer_mode
@progress_bar
end
def file_name
File.basename(self.path)
end
def stop_progress_bar
progress_bar.halt unless progress_bar.finished?
end
def size
@size || File.size(self.path)
end
def size=(size)
@size=size
end
def read(*args)
result = super(*args)
if result && result.size > 0
progress_bar.inc(result.size)
else
progress_bar.set(size)
progress_bar.finish
end
result
end
def write(*args)
count = super(*args)
if count
progress_bar.inc(count)
else
progress_bar.set(size)
progress_bar.finish
end
count
end
end
end
end
| module Bosh
module Cli
class FileWithProgressBar < ::File
def progress_bar
return @progress_bar if @progress_bar
out = Bosh::Cli::Config.output || StringIO.new
@progress_bar = ProgressBar.new(file_name, size, out)
@progress_bar.file_transfer_mode
@progress_bar
end
def file_name
File.basename(self.path)
end
def stop_progress_bar
progress_bar.halt unless progress_bar.finished?
end
def size
@size || File.size(self.path)
end
def size=(size)
@size=size
end
def read(*args)
result = super(*args)
if result && result.size > 0
progress_bar.inc(result.size)
else
+ progress_bar.set(size)
progress_bar.finish
end
result
end
def write(*args)
count = super(*args)
if count
progress_bar.inc(count)
else
+ progress_bar.set(size)
progress_bar.finish
end
count
end
end
end
end | 2 | 0.038462 | 2 | 0 |
7f67db50f3a61145ea67727ea1d3ba09cb2a98e6 | cfp/fixtures/initial_data.json | cfp/fixtures/initial_data.json | [
{
"pk": 10,
"model": "cfp.audienceskilllevel",
"fields": {
"name": "Elementary"
}
},
{
"pk": 20,
"model": "cfp.audienceskilllevel",
"fields": {
"name": "Intermediate"
}
},
{
"pk": 30,
"model": "cfp.audienceskilllevel",
"fields": {
"name": "Advanced"
}
}
] | [
{
"pk": 10,
"model": "cfp.audienceskilllevel",
"fields": {
"name": "Elementary"
}
},
{
"pk": 20,
"model": "cfp.audienceskilllevel",
"fields": {
"name": "Intermediate"
}
},
{
"pk": 30,
"model": "cfp.audienceskilllevel",
"fields": {
"name": "Advanced"
}
},
{
"fields": {
"begin_date": "2015-03-16",
"description": "<ul>\r\n<li>Conference takes place on Saturday, 3rd of October, in Zagreb.</li>\r\n<li>Talks are either 25 or 45 minutes, including 5 minutes for Q&A.</li>\r\n<li>Prior experience is not a prerequisite, we welcome first timers.</li>\r\n<li>Talks must be in English.</li>\r\n<li>Multiple talk submissions are welcome.</li>\r\n</ul>\r\n<p><strong>Our speaker package includes:</strong></p>\r\n<ul>\r\n<li>Full conference pass</li>\r\n<li>2 complimentary hotel nights for speakers remote to the area</li>\r\n<li>Lunch and other activities included in the regular conference</li>\r\n<li>Speakers dinner on October 2nd</li>\r\n<li>A goodie bag with a speaker's T-shirt and other swag</li>\r\n</ul>",
"end_date": "2015-06-30",
"title": "CFP 2015"
},
"model": "cfp.callforpaper",
"pk": 1
}
]
| Add fixtures for 2015 CFP. | Add fixtures for 2015 CFP.
This is just temporary but it will be useful for dev.
| JSON | bsd-3-clause | WebCampZg/conference-web,denibertovic/conference-web,WebCampZg/conference-web,denibertovic/conference-web,denibertovic/conference-web,denibertovic/conference-web,denibertovic/conference-web,WebCampZg/conference-web | json | ## Code Before:
[
{
"pk": 10,
"model": "cfp.audienceskilllevel",
"fields": {
"name": "Elementary"
}
},
{
"pk": 20,
"model": "cfp.audienceskilllevel",
"fields": {
"name": "Intermediate"
}
},
{
"pk": 30,
"model": "cfp.audienceskilllevel",
"fields": {
"name": "Advanced"
}
}
]
## Instruction:
Add fixtures for 2015 CFP.
This is just temporary but it will be useful for dev.
## Code After:
[
{
"pk": 10,
"model": "cfp.audienceskilllevel",
"fields": {
"name": "Elementary"
}
},
{
"pk": 20,
"model": "cfp.audienceskilllevel",
"fields": {
"name": "Intermediate"
}
},
{
"pk": 30,
"model": "cfp.audienceskilllevel",
"fields": {
"name": "Advanced"
}
},
{
"fields": {
"begin_date": "2015-03-16",
"description": "<ul>\r\n<li>Conference takes place on Saturday, 3rd of October, in Zagreb.</li>\r\n<li>Talks are either 25 or 45 minutes, including 5 minutes for Q&A.</li>\r\n<li>Prior experience is not a prerequisite, we welcome first timers.</li>\r\n<li>Talks must be in English.</li>\r\n<li>Multiple talk submissions are welcome.</li>\r\n</ul>\r\n<p><strong>Our speaker package includes:</strong></p>\r\n<ul>\r\n<li>Full conference pass</li>\r\n<li>2 complimentary hotel nights for speakers remote to the area</li>\r\n<li>Lunch and other activities included in the regular conference</li>\r\n<li>Speakers dinner on October 2nd</li>\r\n<li>A goodie bag with a speaker's T-shirt and other swag</li>\r\n</ul>",
"end_date": "2015-06-30",
"title": "CFP 2015"
},
"model": "cfp.callforpaper",
"pk": 1
}
]
| [
{
"pk": 10,
"model": "cfp.audienceskilllevel",
"fields": {
"name": "Elementary"
}
},
{
"pk": 20,
"model": "cfp.audienceskilllevel",
"fields": {
"name": "Intermediate"
}
},
{
"pk": 30,
"model": "cfp.audienceskilllevel",
"fields": {
"name": "Advanced"
}
+ },
+ {
+ "fields": {
+ "begin_date": "2015-03-16",
+ "description": "<ul>\r\n<li>Conference takes place on Saturday, 3rd of October, in Zagreb.</li>\r\n<li>Talks are either 25 or 45 minutes, including 5 minutes for Q&A.</li>\r\n<li>Prior experience is not a prerequisite, we welcome first timers.</li>\r\n<li>Talks must be in English.</li>\r\n<li>Multiple talk submissions are welcome.</li>\r\n</ul>\r\n<p><strong>Our speaker package includes:</strong></p>\r\n<ul>\r\n<li>Full conference pass</li>\r\n<li>2 complimentary hotel nights for speakers remote to the area</li>\r\n<li>Lunch and other activities included in the regular conference</li>\r\n<li>Speakers dinner on October 2nd</li>\r\n<li>A goodie bag with a speaker's T-shirt and other swag</li>\r\n</ul>",
+ "end_date": "2015-06-30",
+ "title": "CFP 2015"
+ },
+ "model": "cfp.callforpaper",
+ "pk": 1
}
+
] | 11 | 0.478261 | 11 | 0 |
33469c7b081a0750f602f61b31c2b761700bd95d | .travis.yml | .travis.yml | language: node_js
node_js:
- node
services:
- docker
addons:
sauce_connect: true
before_install:
- docker run -dit --name emscripten -v $(pwd):/src trzeci/emscripten:sdk-tag-1.37.36-64bit bash
before_script:
- python -m SimpleHTTPServer &
script:
- docker exec -it emscripten make
- node test-browser/runner --file full.html --browser chrome --browser safari --browser firefox
- node test-browser/runner --file lite.html --browser chrome --browser safari --browser firefox
- node test-browser/runner --file full-fabric.html --browser chrome --browser safari --browser firefox --browser MicrosoftEdge --browser "internet explorer"
- node test-browser/runner --file lite-fabric.html --browser chrome --browser safari --browser firefox --browser MicrosoftEdge --browser "internet explorer"
- node_modules/.bin/tsc --project test-types
before_deploy:
- rvm $(travis_internal_ruby) do ruby -S gem install octokit git
- printf "//registry.npmjs.org/:_authToken=%s\n" "$NPM_TOKEN" >> ~/.npmrc
deploy:
provider: script
script: rvm $(travis_internal_ruby) do ruby -rubygems deploy.rb
skip_cleanup: true
on:
tags: true
| language: node_js
node_js:
- node
services:
- docker
addons:
sauce_connect: true
before_install:
- docker run -dit --name emscripten -v $(pwd):/src trzeci/emscripten:sdk-tag-1.37.36-64bit bash
before_script:
- python -m SimpleHTTPServer &
script:
- docker exec -it emscripten make
- node test-browser/runner --file full.html --browser chrome --browser safari --browser firefox
- node test-browser/runner --file lite.html --browser chrome --browser safari --browser firefox
- node test-browser/runner --file full-fabric.html --browser chrome --browser safari --browser firefox --browser MicrosoftEdge --browser "internet explorer"
- node test-browser/runner --file lite-fabric.html --browser chrome --browser safari --browser firefox --browser MicrosoftEdge --browser "internet explorer"
- node_modules/.bin/tsc --project test-types
- ls -l viz.js viz-lite.js
before_deploy:
- rvm $(travis_internal_ruby) do ruby -S gem install octokit git
- printf "//registry.npmjs.org/:_authToken=%s\n" "$NPM_TOKEN" >> ~/.npmrc
deploy:
provider: script
script: rvm $(travis_internal_ruby) do ruby -rubygems deploy.rb
skip_cleanup: true
on:
tags: true
| Print out the sizes of viz.js and viz-lite.js at the end of the build. | Print out the sizes of viz.js and viz-lite.js at the end of the build.
| YAML | mit | mdaines/viz.js,mdaines/viz.js,mdaines/viz.js,mdaines/viz.js | yaml | ## Code Before:
language: node_js
node_js:
- node
services:
- docker
addons:
sauce_connect: true
before_install:
- docker run -dit --name emscripten -v $(pwd):/src trzeci/emscripten:sdk-tag-1.37.36-64bit bash
before_script:
- python -m SimpleHTTPServer &
script:
- docker exec -it emscripten make
- node test-browser/runner --file full.html --browser chrome --browser safari --browser firefox
- node test-browser/runner --file lite.html --browser chrome --browser safari --browser firefox
- node test-browser/runner --file full-fabric.html --browser chrome --browser safari --browser firefox --browser MicrosoftEdge --browser "internet explorer"
- node test-browser/runner --file lite-fabric.html --browser chrome --browser safari --browser firefox --browser MicrosoftEdge --browser "internet explorer"
- node_modules/.bin/tsc --project test-types
before_deploy:
- rvm $(travis_internal_ruby) do ruby -S gem install octokit git
- printf "//registry.npmjs.org/:_authToken=%s\n" "$NPM_TOKEN" >> ~/.npmrc
deploy:
provider: script
script: rvm $(travis_internal_ruby) do ruby -rubygems deploy.rb
skip_cleanup: true
on:
tags: true
## Instruction:
Print out the sizes of viz.js and viz-lite.js at the end of the build.
## Code After:
language: node_js
node_js:
- node
services:
- docker
addons:
sauce_connect: true
before_install:
- docker run -dit --name emscripten -v $(pwd):/src trzeci/emscripten:sdk-tag-1.37.36-64bit bash
before_script:
- python -m SimpleHTTPServer &
script:
- docker exec -it emscripten make
- node test-browser/runner --file full.html --browser chrome --browser safari --browser firefox
- node test-browser/runner --file lite.html --browser chrome --browser safari --browser firefox
- node test-browser/runner --file full-fabric.html --browser chrome --browser safari --browser firefox --browser MicrosoftEdge --browser "internet explorer"
- node test-browser/runner --file lite-fabric.html --browser chrome --browser safari --browser firefox --browser MicrosoftEdge --browser "internet explorer"
- node_modules/.bin/tsc --project test-types
- ls -l viz.js viz-lite.js
before_deploy:
- rvm $(travis_internal_ruby) do ruby -S gem install octokit git
- printf "//registry.npmjs.org/:_authToken=%s\n" "$NPM_TOKEN" >> ~/.npmrc
deploy:
provider: script
script: rvm $(travis_internal_ruby) do ruby -rubygems deploy.rb
skip_cleanup: true
on:
tags: true
| language: node_js
node_js:
- node
services:
- docker
addons:
sauce_connect: true
before_install:
- docker run -dit --name emscripten -v $(pwd):/src trzeci/emscripten:sdk-tag-1.37.36-64bit bash
before_script:
- python -m SimpleHTTPServer &
script:
- docker exec -it emscripten make
- node test-browser/runner --file full.html --browser chrome --browser safari --browser firefox
- node test-browser/runner --file lite.html --browser chrome --browser safari --browser firefox
- node test-browser/runner --file full-fabric.html --browser chrome --browser safari --browser firefox --browser MicrosoftEdge --browser "internet explorer"
- node test-browser/runner --file lite-fabric.html --browser chrome --browser safari --browser firefox --browser MicrosoftEdge --browser "internet explorer"
- node_modules/.bin/tsc --project test-types
+ - ls -l viz.js viz-lite.js
before_deploy:
- rvm $(travis_internal_ruby) do ruby -S gem install octokit git
- printf "//registry.npmjs.org/:_authToken=%s\n" "$NPM_TOKEN" >> ~/.npmrc
deploy:
provider: script
script: rvm $(travis_internal_ruby) do ruby -rubygems deploy.rb
skip_cleanup: true
on:
tags: true | 1 | 0.028571 | 1 | 0 |
97999510fad024e30e965c79ed302ebf3cc2c855 | GameKit/GKSound.hx | GameKit/GKSound.hx | //
// GKSound.hx
//
// Created by Cristi Baluta on 2010-12-09.
// Copyright (c) 2010 ralcr.com.
// This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
//
class GKSound {
static var mp3s :Hash<RCAudio>;
public static function init () :Void {
if (mp3s != null) return;
//sounds = new Hash<Sound>();
mp3s = new Hash<RCAudio>();
}
public static function registerSound (id:String, linkage:String) {
}
public static function registerMp3 (id:String, mp3:RCAudio) {
mp3s.set (id, mp3);
}
public static function playMp3 (id:String) :Void {
if (mp3s.get ( id ) != null)
mp3s.get ( id ).start();
}
public static function stopMp3 (id:String) :Void {
if (mp3s.get ( id ) != null)
mp3s.get ( id ).stop();
}
} | //
// GKSound.hx
//
// Created by Cristi Baluta on 2010-12-09.
// Copyright (c) 2010 ralcr.com.
// This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
//
class GKSound {
static var mp3s :Hash<RCAudio>;
public static function init () :Void {
if (mp3s != null) return;
//sounds = new Hash<Sound>();
mp3s = new Hash<RCAudio>();
}
public static function registerSound (id:String, linkage:String) {
}
public static function registerMp3 (id:String, mp3:RCAudio) {
mp3s.set (id, mp3);
}
public static function playMp3 (id:String) :Void {
if (mp3s.get ( id ) != null)
mp3s.get ( id ).start();
}
public static function stopMp3 (id:String) :Void {
if (mp3s.get ( id ) != null)
mp3s.get ( id ).stop();
}
public static function mute (b:Bool) :Void {
for (mp3 in mp3s)
mp3.setVolume ( b ? 1 : 0 );
}
} | Add mute/unmute to all running sounds | Add mute/unmute to all running sounds
| Haxe | mit | ralcr/sdk.ralcr,ralcr/sdk.ralcr,ralcr/sdk.ralcr,ralcr/sdk.ralcr,ralcr/sdk.ralcr,ralcr/sdk.ralcr | haxe | ## Code Before:
//
// GKSound.hx
//
// Created by Cristi Baluta on 2010-12-09.
// Copyright (c) 2010 ralcr.com.
// This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
//
class GKSound {
static var mp3s :Hash<RCAudio>;
public static function init () :Void {
if (mp3s != null) return;
//sounds = new Hash<Sound>();
mp3s = new Hash<RCAudio>();
}
public static function registerSound (id:String, linkage:String) {
}
public static function registerMp3 (id:String, mp3:RCAudio) {
mp3s.set (id, mp3);
}
public static function playMp3 (id:String) :Void {
if (mp3s.get ( id ) != null)
mp3s.get ( id ).start();
}
public static function stopMp3 (id:String) :Void {
if (mp3s.get ( id ) != null)
mp3s.get ( id ).stop();
}
}
## Instruction:
Add mute/unmute to all running sounds
## Code After:
//
// GKSound.hx
//
// Created by Cristi Baluta on 2010-12-09.
// Copyright (c) 2010 ralcr.com.
// This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
//
class GKSound {
static var mp3s :Hash<RCAudio>;
public static function init () :Void {
if (mp3s != null) return;
//sounds = new Hash<Sound>();
mp3s = new Hash<RCAudio>();
}
public static function registerSound (id:String, linkage:String) {
}
public static function registerMp3 (id:String, mp3:RCAudio) {
mp3s.set (id, mp3);
}
public static function playMp3 (id:String) :Void {
if (mp3s.get ( id ) != null)
mp3s.get ( id ).start();
}
public static function stopMp3 (id:String) :Void {
if (mp3s.get ( id ) != null)
mp3s.get ( id ).stop();
}
public static function mute (b:Bool) :Void {
for (mp3 in mp3s)
mp3.setVolume ( b ? 1 : 0 );
}
} | //
// GKSound.hx
//
// Created by Cristi Baluta on 2010-12-09.
// Copyright (c) 2010 ralcr.com.
// This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
//
class GKSound {
static var mp3s :Hash<RCAudio>;
public static function init () :Void {
if (mp3s != null) return;
//sounds = new Hash<Sound>();
mp3s = new Hash<RCAudio>();
}
public static function registerSound (id:String, linkage:String) {
}
public static function registerMp3 (id:String, mp3:RCAudio) {
mp3s.set (id, mp3);
}
public static function playMp3 (id:String) :Void {
if (mp3s.get ( id ) != null)
mp3s.get ( id ).start();
}
public static function stopMp3 (id:String) :Void {
if (mp3s.get ( id ) != null)
mp3s.get ( id ).stop();
}
+ public static function mute (b:Bool) :Void {
+ for (mp3 in mp3s)
+ mp3.setVolume ( b ? 1 : 0 );
+ }
} | 4 | 0.102564 | 4 | 0 |
c637a6cd2d1ae89f4c2f11d923a5a7d323043f71 | startDisplayBot.sh | startDisplayBot.sh |
mplayer http://direct.fipradio.fr/live/fip-midfi.mp3 2>&1 /dev/null &
python DisplayBot.py
|
python DisplayBot.py
| Remove mplayer call from start script | Remove mplayer call from start script
| Shell | mit | ciex/displaybot,ciex/displaybot | shell | ## Code Before:
mplayer http://direct.fipradio.fr/live/fip-midfi.mp3 2>&1 /dev/null &
python DisplayBot.py
## Instruction:
Remove mplayer call from start script
## Code After:
python DisplayBot.py
|
- mplayer http://direct.fipradio.fr/live/fip-midfi.mp3 2>&1 /dev/null &
python DisplayBot.py | 1 | 0.333333 | 0 | 1 |
4212950a4a6b036f563a236cb005604e1c096f04 | .zuul.d/project.yaml | .zuul.d/project.yaml | - project:
templates:
- check-requirements
- horizon-cross-jobs
- horizon-nodejs-jobs
- horizon-non-primary-django-jobs
- openstack-lower-constraints-jobs
- openstack-python3-zed-jobs
- periodic-stable-jobs
- publish-openstack-docs-pti
- release-notes-jobs-python3
check:
jobs:
- horizon-selenium-headless
- horizon-integration-tests
- horizon-dsvm-tempest-plugin
- horizon-tox-bandit-baseline
- horizon-tempest-plugin-ipv6
gate:
queue: horizon
jobs:
- horizon-dsvm-tempest-plugin
- horizon-selenium-headless
- horizon-integration-tests
- horizon-tempest-plugin-ipv6
experimental:
jobs:
- horizon-integration-tests-xstatic-master
- horizon-tox-py36-xstatic-master
- horizon-nodejs16-run-test-xstatic-master
periodic:
jobs:
- horizon-nodejs16-run-test
- horizon-integration-tests
| - project:
queue: horizon
templates:
- check-requirements
- horizon-cross-jobs
- horizon-nodejs-jobs
- horizon-non-primary-django-jobs
- openstack-lower-constraints-jobs
- openstack-python3-zed-jobs
- periodic-stable-jobs
- publish-openstack-docs-pti
- release-notes-jobs-python3
check:
jobs:
- horizon-selenium-headless
- horizon-integration-tests
- horizon-dsvm-tempest-plugin
- horizon-tox-bandit-baseline
- horizon-tempest-plugin-ipv6
gate:
jobs:
- horizon-dsvm-tempest-plugin
- horizon-selenium-headless
- horizon-integration-tests
- horizon-tempest-plugin-ipv6
experimental:
jobs:
- horizon-integration-tests-xstatic-master
- horizon-tox-py36-xstatic-master
- horizon-nodejs16-run-test-xstatic-master
periodic:
jobs:
- horizon-nodejs16-run-test
- horizon-integration-tests
| Declare queue at top level | zuul: Declare queue at top level
Zuul deprecated declaring shared queues at a pipeline level with
release 4.1.0[1]. This updates the job definition to use the top level
declaration instead.
See [2] for details.
[1] https://zuul-ci.org/docs/zuul/latest/releasenotes.html#relnotes-4-1-0-deprecation-notes
[2] http://lists.openstack.org/pipermail/openstack-discuss/2022-May/028603.html
Change-Id: Ie63dd3b161cb8fd9be89002027d699ce2c4a67a5
| YAML | apache-2.0 | openstack/horizon,openstack/horizon,openstack/horizon,openstack/horizon | yaml | ## Code Before:
- project:
templates:
- check-requirements
- horizon-cross-jobs
- horizon-nodejs-jobs
- horizon-non-primary-django-jobs
- openstack-lower-constraints-jobs
- openstack-python3-zed-jobs
- periodic-stable-jobs
- publish-openstack-docs-pti
- release-notes-jobs-python3
check:
jobs:
- horizon-selenium-headless
- horizon-integration-tests
- horizon-dsvm-tempest-plugin
- horizon-tox-bandit-baseline
- horizon-tempest-plugin-ipv6
gate:
queue: horizon
jobs:
- horizon-dsvm-tempest-plugin
- horizon-selenium-headless
- horizon-integration-tests
- horizon-tempest-plugin-ipv6
experimental:
jobs:
- horizon-integration-tests-xstatic-master
- horizon-tox-py36-xstatic-master
- horizon-nodejs16-run-test-xstatic-master
periodic:
jobs:
- horizon-nodejs16-run-test
- horizon-integration-tests
## Instruction:
zuul: Declare queue at top level
Zuul deprecated declaring shared queues at a pipeline level with
release 4.1.0[1]. This updates the job definition to use the top level
declaration instead.
See [2] for details.
[1] https://zuul-ci.org/docs/zuul/latest/releasenotes.html#relnotes-4-1-0-deprecation-notes
[2] http://lists.openstack.org/pipermail/openstack-discuss/2022-May/028603.html
Change-Id: Ie63dd3b161cb8fd9be89002027d699ce2c4a67a5
## Code After:
- project:
queue: horizon
templates:
- check-requirements
- horizon-cross-jobs
- horizon-nodejs-jobs
- horizon-non-primary-django-jobs
- openstack-lower-constraints-jobs
- openstack-python3-zed-jobs
- periodic-stable-jobs
- publish-openstack-docs-pti
- release-notes-jobs-python3
check:
jobs:
- horizon-selenium-headless
- horizon-integration-tests
- horizon-dsvm-tempest-plugin
- horizon-tox-bandit-baseline
- horizon-tempest-plugin-ipv6
gate:
jobs:
- horizon-dsvm-tempest-plugin
- horizon-selenium-headless
- horizon-integration-tests
- horizon-tempest-plugin-ipv6
experimental:
jobs:
- horizon-integration-tests-xstatic-master
- horizon-tox-py36-xstatic-master
- horizon-nodejs16-run-test-xstatic-master
periodic:
jobs:
- horizon-nodejs16-run-test
- horizon-integration-tests
| - project:
+ queue: horizon
templates:
- check-requirements
- horizon-cross-jobs
- horizon-nodejs-jobs
- horizon-non-primary-django-jobs
- openstack-lower-constraints-jobs
- openstack-python3-zed-jobs
- periodic-stable-jobs
- publish-openstack-docs-pti
- release-notes-jobs-python3
check:
jobs:
- horizon-selenium-headless
- horizon-integration-tests
- horizon-dsvm-tempest-plugin
- horizon-tox-bandit-baseline
- horizon-tempest-plugin-ipv6
gate:
- queue: horizon
jobs:
- horizon-dsvm-tempest-plugin
- horizon-selenium-headless
- horizon-integration-tests
- horizon-tempest-plugin-ipv6
experimental:
jobs:
- horizon-integration-tests-xstatic-master
- horizon-tox-py36-xstatic-master
- horizon-nodejs16-run-test-xstatic-master
periodic:
jobs:
- horizon-nodejs16-run-test
- horizon-integration-tests | 2 | 0.058824 | 1 | 1 |
c660776e8ee633bb78bceede94ac88b7d2b095da | shared/script.js | shared/script.js |
document.addEventListener("DOMContentLoaded", function() {
var h1 = document.querySelector("h1");
if (h1 && !document.title) {
document.title = "DevTools Demos - " + h1.textContent;
}
var body = document.body;
if (body.classList.contains("header")) {
var header = document.createElement("header");
var link = document.createElement("a");
link.setAttribute("href", "../");
link.textContent = "DevTools Demos";
header.appendChild(link);
var repoLink = document.createElement("a");
repoLink.className = "repo-link";
repoLink.setAttribute("href", "https://github.com/bgrins/devtools-demos");
repoLink.textContent = "repository";
header.appendChild(repoLink);
body.insertBefore(header, body.firstChild);
}
});
|
document.addEventListener("DOMContentLoaded", function() {
var h1 = document.querySelector("h1");
if (h1 && !document.title) {
document.title = "DevTools Demos - " + h1.textContent;
}
var body = document.body;
if (body.classList.contains("header")) {
var header = document.createElement("header");
var link = document.createElement("a");
link.setAttribute("href", "../index.html");
link.textContent = "DevTools Demos";
header.appendChild(link);
var repoLink = document.createElement("a");
repoLink.className = "repo-link";
repoLink.setAttribute("href", "https://github.com/bgrins/devtools-demos");
repoLink.textContent = "repository";
header.appendChild(repoLink);
body.insertBefore(header, body.firstChild);
}
});
| Make header link to index.html so it works on the filesystem | Make header link to index.html so it works on the filesystem
| JavaScript | mit | bgrins/devtools-demos,bgrins/devtools-demos | javascript | ## Code Before:
document.addEventListener("DOMContentLoaded", function() {
var h1 = document.querySelector("h1");
if (h1 && !document.title) {
document.title = "DevTools Demos - " + h1.textContent;
}
var body = document.body;
if (body.classList.contains("header")) {
var header = document.createElement("header");
var link = document.createElement("a");
link.setAttribute("href", "../");
link.textContent = "DevTools Demos";
header.appendChild(link);
var repoLink = document.createElement("a");
repoLink.className = "repo-link";
repoLink.setAttribute("href", "https://github.com/bgrins/devtools-demos");
repoLink.textContent = "repository";
header.appendChild(repoLink);
body.insertBefore(header, body.firstChild);
}
});
## Instruction:
Make header link to index.html so it works on the filesystem
## Code After:
document.addEventListener("DOMContentLoaded", function() {
var h1 = document.querySelector("h1");
if (h1 && !document.title) {
document.title = "DevTools Demos - " + h1.textContent;
}
var body = document.body;
if (body.classList.contains("header")) {
var header = document.createElement("header");
var link = document.createElement("a");
link.setAttribute("href", "../index.html");
link.textContent = "DevTools Demos";
header.appendChild(link);
var repoLink = document.createElement("a");
repoLink.className = "repo-link";
repoLink.setAttribute("href", "https://github.com/bgrins/devtools-demos");
repoLink.textContent = "repository";
header.appendChild(repoLink);
body.insertBefore(header, body.firstChild);
}
});
|
document.addEventListener("DOMContentLoaded", function() {
var h1 = document.querySelector("h1");
if (h1 && !document.title) {
document.title = "DevTools Demos - " + h1.textContent;
}
var body = document.body;
if (body.classList.contains("header")) {
var header = document.createElement("header");
var link = document.createElement("a");
- link.setAttribute("href", "../");
+ link.setAttribute("href", "../index.html");
? ++++++++++
link.textContent = "DevTools Demos";
header.appendChild(link);
var repoLink = document.createElement("a");
repoLink.className = "repo-link";
repoLink.setAttribute("href", "https://github.com/bgrins/devtools-demos");
repoLink.textContent = "repository";
header.appendChild(repoLink);
body.insertBefore(header, body.firstChild);
}
}); | 2 | 0.083333 | 1 | 1 |
ff6949ce7edb886843ecc8d971df26b59747230a | .travis.yml | .travis.yml | language: node_js
env: SKIP_SASS_BINARY_DOWNLOAD_FOR_CI=true
compiler: gcc
node_js:
- 0.10
- node # will fetch the latest node.js version
- iojs # will fetch the latest io.js version
matrix:
fast_finish: true
allow_failures:
- node_js: iojs
before_install:
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update
- sudo apt-get install gcc-4.7 g++-4.7
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 20
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.7 20
- g++ --version
- sudo apt-get update -qq
- git submodule update --init --recursive
after_success: npm run-script coverage
cache:
directories:
- node_modules
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/8dddd234a441d0d07664
on_success: change
| language: node_js
env: SKIP_SASS_BINARY_DOWNLOAD_FOR_CI=true
compiler: gcc
node_js:
- 0.10
- node # will fetch the latest node.js version
- iojs # will fetch the latest io.js version
matrix:
fast_finish: true
before_install:
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update
- sudo apt-get install gcc-4.7 g++-4.7
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 20
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.7 20
- g++ --version
- sudo apt-get update -qq
- git submodule update --init --recursive
after_success: npm run-script coverage
cache:
directories:
- node_modules
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/8dddd234a441d0d07664
on_success: change
| Make Travis CI to report failures on io.js 3.0 | Make Travis CI to report failures on io.js 3.0
| YAML | mit | paulcbetts/node-sass,pmq20/node-sass,JTKnox91/node-sass,saper/node-sass,cfebs/node-sass,gdi2290/node-sass,chriseppstein/node-sass,glassdimly/node-sass,am11/node-sass,am11/node-sass,JTKnox91/node-sass,nschonni/node-sass,nschonni/node-sass,Smartbank/node-sass,greyhwndz/node-sass,plora/node-sass,am11/node-sass,xzyfer/node-sass,nibblebot/node-sass,paulcbetts/node-sass,deanrather/node-sass,kylecho/node-sass,gdi2290/node-sass,gravityrail/node-sass,saper/node-sass,justame/node-sass,alanhogan/node-sass,sass/node-sass,alanhogan/node-sass,ankurp/node-sass,quentinyang/node-sass,dazld/node-sass,Cydrobolt/node-sass,gravityrail/node-sass,paulcbetts/node-sass,Vitogee/node-sass,Smartbank/node-sass,sass/node-sass,chriseppstein/node-sass,cfebs/node-sass,Smartbank/node-sass,sass/node-sass,nibblebot/node-sass,kylecho/node-sass,xzyfer/node-sass,plora/node-sass,sass/node-sass,kylecho/node-sass,kylecho/node-sass,xzyfer/node-sass,cfebs/node-sass,quentinyang/node-sass,gdi2290/node-sass,cvibhagool/node-sass,am11/node-sass,jnbt/node-sass,JTKnox91/node-sass,paulcbetts/node-sass,nibblebot/node-sass,ekskimn/node-sass,dazld/node-sass,xzyfer/node-sass,cvibhagool/node-sass,Smartbank/node-sass,bigcommerce-labs/node-sass,Vitogee/node-sass,gravityrail/node-sass,deanrather/node-sass,ekskimn/node-sass,sass/node-sass,quentinyang/node-sass,Cydrobolt/node-sass,JTKnox91/node-sass,pmq20/node-sass,cfebs/node-sass,nschonni/node-sass,sass/node-sass,chriseppstein/node-sass,nschonni/node-sass,ankurp/node-sass,ankurp/node-sass,gravityrail/node-sass,Cydrobolt/node-sass,glassdimly/node-sass,justame/node-sass,pmq20/node-sass,Smartbank/node-sass,sass/node-sass,xzyfer/node-sass,ekskimn/node-sass,justame/node-sass,saper/node-sass,deanrather/node-sass,greyhwndz/node-sass,cvibhagool/node-sass,Cydrobolt/node-sass,nschonni/node-sass,pmq20/node-sass,saper/node-sass,nibblebot/node-sass,alanhogan/node-sass,Vitogee/node-sass,jnbt/node-sass,greyhwndz/node-sass,ankurp/node-sass,xzyfer/node-sass,deanrather/node-sass,greyhwndz/node-sass,nschonni/node-sass,dazld/node-sass,ekskimn/node-sass,quentinyang/node-sass,gdi2290/node-sass,cvibhagool/node-sass,glassdimly/node-sass,xzyfer/node-sass,jnbt/node-sass,Smartbank/node-sass,jnbt/node-sass,saper/node-sass,bigcommerce-labs/node-sass,bigcommerce-labs/node-sass,alanhogan/node-sass,saper/node-sass,Smartbank/node-sass,plora/node-sass,nschonni/node-sass,dazld/node-sass,bigcommerce-labs/node-sass,glassdimly/node-sass,saper/node-sass,justame/node-sass,chriseppstein/node-sass,Vitogee/node-sass,plora/node-sass | yaml | ## Code Before:
language: node_js
env: SKIP_SASS_BINARY_DOWNLOAD_FOR_CI=true
compiler: gcc
node_js:
- 0.10
- node # will fetch the latest node.js version
- iojs # will fetch the latest io.js version
matrix:
fast_finish: true
allow_failures:
- node_js: iojs
before_install:
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update
- sudo apt-get install gcc-4.7 g++-4.7
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 20
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.7 20
- g++ --version
- sudo apt-get update -qq
- git submodule update --init --recursive
after_success: npm run-script coverage
cache:
directories:
- node_modules
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/8dddd234a441d0d07664
on_success: change
## Instruction:
Make Travis CI to report failures on io.js 3.0
## Code After:
language: node_js
env: SKIP_SASS_BINARY_DOWNLOAD_FOR_CI=true
compiler: gcc
node_js:
- 0.10
- node # will fetch the latest node.js version
- iojs # will fetch the latest io.js version
matrix:
fast_finish: true
before_install:
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update
- sudo apt-get install gcc-4.7 g++-4.7
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 20
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.7 20
- g++ --version
- sudo apt-get update -qq
- git submodule update --init --recursive
after_success: npm run-script coverage
cache:
directories:
- node_modules
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/8dddd234a441d0d07664
on_success: change
| language: node_js
env: SKIP_SASS_BINARY_DOWNLOAD_FOR_CI=true
compiler: gcc
node_js:
- 0.10
- node # will fetch the latest node.js version
- iojs # will fetch the latest io.js version
matrix:
fast_finish: true
- allow_failures:
- - node_js: iojs
before_install:
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get update
- sudo apt-get install gcc-4.7 g++-4.7
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 20
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.7 20
- g++ --version
- sudo apt-get update -qq
- git submodule update --init --recursive
after_success: npm run-script coverage
cache:
directories:
- node_modules
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/8dddd234a441d0d07664
on_success: change | 2 | 0.054054 | 0 | 2 |
a5bb2a2939df529c711ea2f5f56eeadba066ef5b | README.md | README.md | My github.io website. I use this space to
* write blog posts / articles
* capture study, conference, reading notes on a variety of topics
* link to content from other sources, so that this site can act as a central table of contents
## Using categories for posts
### Special categories
* highlight - show on homepage
* blog - every post should have this category. Don't have a good use for this
at the moment but I suspect it will come in handy at some point ;)
| My github.io website. I use this space to
* write blog posts / articles
* capture study, conference, reading notes on a variety of topics
* link to content from other sources, so that this site can act as a central table of contents
## Using categories for posts
### Special categories
* highlight - show on homepage
| Remove note on blog category as it is not used. | Remove note on blog category as it is not used.
| Markdown | cc0-1.0 | anuragkapur/anuragkapur.github.io,anuragkapur/anuragkapur.github.io | markdown | ## Code Before:
My github.io website. I use this space to
* write blog posts / articles
* capture study, conference, reading notes on a variety of topics
* link to content from other sources, so that this site can act as a central table of contents
## Using categories for posts
### Special categories
* highlight - show on homepage
* blog - every post should have this category. Don't have a good use for this
at the moment but I suspect it will come in handy at some point ;)
## Instruction:
Remove note on blog category as it is not used.
## Code After:
My github.io website. I use this space to
* write blog posts / articles
* capture study, conference, reading notes on a variety of topics
* link to content from other sources, so that this site can act as a central table of contents
## Using categories for posts
### Special categories
* highlight - show on homepage
| My github.io website. I use this space to
* write blog posts / articles
* capture study, conference, reading notes on a variety of topics
* link to content from other sources, so that this site can act as a central table of contents
## Using categories for posts
### Special categories
* highlight - show on homepage
- * blog - every post should have this category. Don't have a good use for this
- at the moment but I suspect it will come in handy at some point ;) | 2 | 0.166667 | 0 | 2 |
e82538d4e6de14f62bf19b88ecb42dd73495c8fb | 189252/A.hs | 189252/A.hs | import Control.Monad
import Data.List
import Data.Maybe
import Text.Printf
main = do
tests <- readLn
forM_ [1..tests] $ \ caseNum -> do
str <- getLine
let digify c = case elemIndex c (nub str) of
Just 0 -> 1
Just 1 -> 0
Just n -> n
Nothing -> error "The impossible happened!"
let base = succ . maximum . map digify $ str
let ans = foldl (\x y -> x*base + y) 0 . map digify $ str
printf "Case #%d: %d\n" (caseNum::Int) (ans::Int)
| import Control.Monad
import Data.List
import Data.Maybe
import Text.Printf
main = do
tests <- readLn
forM_ [1..tests] $ \ caseNum -> do
str <- getLine
let ans = foldl (\x y -> x*base + y) 0 . map digify $ str where
digify c = case elemIndex c (nub str) of
Just 0 -> 1
Just 1 -> 0
Just n -> n
Nothing -> error "The impossible happened!"
base = succ . maximum . map digify $ str
printf "Case #%d: %d\n" (caseNum::Int) (ans::Int)
| Move intermediates into where clause | Move intermediates into where clause
| Haskell | mit | marknsikora/codejam,marknsikora/codejam | haskell | ## Code Before:
import Control.Monad
import Data.List
import Data.Maybe
import Text.Printf
main = do
tests <- readLn
forM_ [1..tests] $ \ caseNum -> do
str <- getLine
let digify c = case elemIndex c (nub str) of
Just 0 -> 1
Just 1 -> 0
Just n -> n
Nothing -> error "The impossible happened!"
let base = succ . maximum . map digify $ str
let ans = foldl (\x y -> x*base + y) 0 . map digify $ str
printf "Case #%d: %d\n" (caseNum::Int) (ans::Int)
## Instruction:
Move intermediates into where clause
## Code After:
import Control.Monad
import Data.List
import Data.Maybe
import Text.Printf
main = do
tests <- readLn
forM_ [1..tests] $ \ caseNum -> do
str <- getLine
let ans = foldl (\x y -> x*base + y) 0 . map digify $ str where
digify c = case elemIndex c (nub str) of
Just 0 -> 1
Just 1 -> 0
Just n -> n
Nothing -> error "The impossible happened!"
base = succ . maximum . map digify $ str
printf "Case #%d: %d\n" (caseNum::Int) (ans::Int)
| import Control.Monad
import Data.List
import Data.Maybe
import Text.Printf
main = do
tests <- readLn
forM_ [1..tests] $ \ caseNum -> do
str <- getLine
+ let ans = foldl (\x y -> x*base + y) 0 . map digify $ str where
- let digify c = case elemIndex c (nub str) of
? ^^^
+ digify c = case elemIndex c (nub str) of
? ^^^^^
- Just 0 -> 1
+ Just 0 -> 1
? ++
- Just 1 -> 0
+ Just 1 -> 0
? ++
- Just n -> n
+ Just n -> n
? ++
- Nothing -> error "The impossible happened!"
+ Nothing -> error "The impossible happened!"
? ++
-
- let base = succ . maximum . map digify $ str
? ^^^
+ base = succ . maximum . map digify $ str
? ^^^^^
-
- let ans = foldl (\x y -> x*base + y) 0 . map digify $ str
printf "Case #%d: %d\n" (caseNum::Int) (ans::Int) | 16 | 0.727273 | 7 | 9 |
397e4b8de7b6a7f1aee4ae5607d96089345c4499 | Cargo.toml | Cargo.toml | [package]
name = "rudy"
version = "0.1.0"
authors = ["Aaron DeVore <aaron.devore@gmail.com>"]
license = "MIT/Apache-2.0"
[dependencies]
nodrop = "0.1"
num-traits = "0.1"
| [package]
name = "rudy"
version = "0.0.1"
authors = ["Aaron DeVore <aaron.devore@gmail.com>"]
license = "MIT/Apache-2.0"
description = "Judy array implementation in pure Rust"
documentation = "https://docs.rs/rudy"
repository = "https://www.github.com/adevore/rudy/"
homepage = "https://www.github.com/adevore/rudy/"
[dependencies]
nodrop = "0.1"
num-traits = "0.1"
| Add necessary metadata for crates.io | Add necessary metadata for crates.io
| TOML | apache-2.0 | adevore/rudy | toml | ## Code Before:
[package]
name = "rudy"
version = "0.1.0"
authors = ["Aaron DeVore <aaron.devore@gmail.com>"]
license = "MIT/Apache-2.0"
[dependencies]
nodrop = "0.1"
num-traits = "0.1"
## Instruction:
Add necessary metadata for crates.io
## Code After:
[package]
name = "rudy"
version = "0.0.1"
authors = ["Aaron DeVore <aaron.devore@gmail.com>"]
license = "MIT/Apache-2.0"
description = "Judy array implementation in pure Rust"
documentation = "https://docs.rs/rudy"
repository = "https://www.github.com/adevore/rudy/"
homepage = "https://www.github.com/adevore/rudy/"
[dependencies]
nodrop = "0.1"
num-traits = "0.1"
| [package]
name = "rudy"
- version = "0.1.0"
? --
+ version = "0.0.1"
? ++
authors = ["Aaron DeVore <aaron.devore@gmail.com>"]
license = "MIT/Apache-2.0"
+ description = "Judy array implementation in pure Rust"
+ documentation = "https://docs.rs/rudy"
+ repository = "https://www.github.com/adevore/rudy/"
+ homepage = "https://www.github.com/adevore/rudy/"
[dependencies]
nodrop = "0.1"
num-traits = "0.1" | 6 | 0.666667 | 5 | 1 |
19a08709ab1c8b84e1c1a7af8983a0dc961b32c1 | _includes/event-map.html | _includes/event-map.html | <section id="locations">
<h2 class="h2-main-page">Global Day of Coderetreat</h2>
<p class="subtitle">November 16th (or 15th), 2019</p>
<p class="subtitle">Last year, there have been <a href="/events">{{site.data.events_gdcr2018 | size}} GDCR 2018 events</a> around the world!</p>
<div id="map">
<div id="popup"></div>
</div>
</section>
<script>
$(function() {
$.get("/events/gdcr2018.json", function(eventsJson) {
var gdcrEvents = mapEventsDataToMapFormat(eventsJson);
addEventsToMap(gdcrEvents);
});
});
</script>
| <section id="locations">
<h2 class="h2-main-page">Global Day of Coderetreat</h2>
<p class="subtitle">November 16th (or 15th), 2019</p>
<p>For the 10th anniversary, we will promote events that happen either on Friday, Nov 15th or Saturday, Nov 16th.
Traditionally, the Global Day of Coderetreat takes place on Saturdays, but we also want to invite companies to provide paid educational
leave for their employees to participate in a coderetreat, as well as open the event to people who can not participate in events over the weekend. </p>
<p>As a local event organizer, it is up to you to decide wether to host an event on Friday or Saturday, or even both 🎉.</p>
<p class="subtitle">Last year, there have been <a href="/events">{{site.data.events_gdcr2018 | size}} GDCR 2018 events</a> around the world!</p>
<div id="map">
<div id="popup"></div>
</div>
</section>
<script>
$(function() {
$.get("/events/gdcr2018.json", function(eventsJson) {
var gdcrEvents = mapEventsDataToMapFormat(eventsJson);
addEventsToMap(gdcrEvents);
});
});
</script>
| Add message to the organizers explaining why we have two dates this year | Add message to the organizers explaining why we have two dates this year
| HTML | mit | svenlange/coderetreat.github.io,svenlange/coderetreat.github.io,coderetreat/coderetreat.github.io,coderetreat/coderetreat.github.io,coderetreat/coderetreat.github.io,svenlange/coderetreat.github.io,coderetreat/coderetreat.github.io,svenlange/coderetreat.github.io | html | ## Code Before:
<section id="locations">
<h2 class="h2-main-page">Global Day of Coderetreat</h2>
<p class="subtitle">November 16th (or 15th), 2019</p>
<p class="subtitle">Last year, there have been <a href="/events">{{site.data.events_gdcr2018 | size}} GDCR 2018 events</a> around the world!</p>
<div id="map">
<div id="popup"></div>
</div>
</section>
<script>
$(function() {
$.get("/events/gdcr2018.json", function(eventsJson) {
var gdcrEvents = mapEventsDataToMapFormat(eventsJson);
addEventsToMap(gdcrEvents);
});
});
</script>
## Instruction:
Add message to the organizers explaining why we have two dates this year
## Code After:
<section id="locations">
<h2 class="h2-main-page">Global Day of Coderetreat</h2>
<p class="subtitle">November 16th (or 15th), 2019</p>
<p>For the 10th anniversary, we will promote events that happen either on Friday, Nov 15th or Saturday, Nov 16th.
Traditionally, the Global Day of Coderetreat takes place on Saturdays, but we also want to invite companies to provide paid educational
leave for their employees to participate in a coderetreat, as well as open the event to people who can not participate in events over the weekend. </p>
<p>As a local event organizer, it is up to you to decide wether to host an event on Friday or Saturday, or even both 🎉.</p>
<p class="subtitle">Last year, there have been <a href="/events">{{site.data.events_gdcr2018 | size}} GDCR 2018 events</a> around the world!</p>
<div id="map">
<div id="popup"></div>
</div>
</section>
<script>
$(function() {
$.get("/events/gdcr2018.json", function(eventsJson) {
var gdcrEvents = mapEventsDataToMapFormat(eventsJson);
addEventsToMap(gdcrEvents);
});
});
</script>
| <section id="locations">
- <h2 class="h2-main-page">Global Day of Coderetreat</h2>
+ <h2 class="h2-main-page">Global Day of Coderetreat</h2>
? ++
- <p class="subtitle">November 16th (or 15th), 2019</p>
+ <p class="subtitle">November 16th (or 15th), 2019</p>
? ++
+ <p>For the 10th anniversary, we will promote events that happen either on Friday, Nov 15th or Saturday, Nov 16th.
+ Traditionally, the Global Day of Coderetreat takes place on Saturdays, but we also want to invite companies to provide paid educational
+ leave for their employees to participate in a coderetreat, as well as open the event to people who can not participate in events over the weekend. </p>
+ <p>As a local event organizer, it is up to you to decide wether to host an event on Friday or Saturday, or even both 🎉.</p>
- <p class="subtitle">Last year, there have been <a href="/events">{{site.data.events_gdcr2018 | size}} GDCR 2018 events</a> around the world!</p>
+ <p class="subtitle">Last year, there have been <a href="/events">{{site.data.events_gdcr2018 | size}} GDCR 2018 events</a> around the world!</p>
? ++
- <div id="map">
+ <div id="map">
? ++
- <div id="popup"></div>
+ <div id="popup"></div>
? ++++
- </div>
+ </div>
? ++
</section>
<script>
- $(function() {
+ $(function() {
? ++++
- $.get("/events/gdcr2018.json", function(eventsJson) {
+ $.get("/events/gdcr2018.json", function(eventsJson) {
? ++++++
- var gdcrEvents = mapEventsDataToMapFormat(eventsJson);
+ var gdcrEvents = mapEventsDataToMapFormat(eventsJson);
? ++++++++
- addEventsToMap(gdcrEvents);
+ addEventsToMap(gdcrEvents);
? ++++++++
+ });
- });
+ });
? ++
- });
</script> | 28 | 1.555556 | 16 | 12 |
e9d3404496111b93f6d14adde38dbb31fd57227b | lib/mementus/node_proxy.rb | lib/mementus/node_proxy.rb | module Mementus
class NodeProxy
def initialize(node, graph)
@node = node
@graph = graph
end
def id
@node.id
end
def label
@node.label
end
def [](prop)
@node[prop]
end
def props
@node.props
end
def out_e
Pipeline::Step.new(adjacent_edges, Pipeline::Pipe.new(@graph), @graph)
end
def each_adjacent(&block)
@graph.each_adjacent(@node.id, &block)
end
def adjacent(match=nil)
@graph.adjacent(@node.id, match)
end
def incoming(match=nil)
@graph.incoming(@node.id, match)
end
def adjacent_edges(match=nil)
@graph.adjacent_edges(@node.id, match)
end
end
end
| module Mementus
class NodeProxy
def initialize(node, graph)
@node = node
@graph = graph
end
def id
@node.id
end
def label
@node.label
end
def [](prop)
@node[prop]
end
def props
@node.props
end
def each_adjacent(&block)
@graph.each_adjacent(@node.id, &block)
end
def adjacent(match=nil)
@graph.adjacent(@node.id, match)
end
def incoming(match=nil)
@graph.incoming(@node.id, match)
end
def adjacent_edges(match=nil)
@graph.adjacent_edges(@node.id, match)
end
end
end
| Remove outgoing node pipeline from NodeProxy | Remove outgoing node pipeline from NodeProxy
| Ruby | mit | maetl/mementus | ruby | ## Code Before:
module Mementus
class NodeProxy
def initialize(node, graph)
@node = node
@graph = graph
end
def id
@node.id
end
def label
@node.label
end
def [](prop)
@node[prop]
end
def props
@node.props
end
def out_e
Pipeline::Step.new(adjacent_edges, Pipeline::Pipe.new(@graph), @graph)
end
def each_adjacent(&block)
@graph.each_adjacent(@node.id, &block)
end
def adjacent(match=nil)
@graph.adjacent(@node.id, match)
end
def incoming(match=nil)
@graph.incoming(@node.id, match)
end
def adjacent_edges(match=nil)
@graph.adjacent_edges(@node.id, match)
end
end
end
## Instruction:
Remove outgoing node pipeline from NodeProxy
## Code After:
module Mementus
class NodeProxy
def initialize(node, graph)
@node = node
@graph = graph
end
def id
@node.id
end
def label
@node.label
end
def [](prop)
@node[prop]
end
def props
@node.props
end
def each_adjacent(&block)
@graph.each_adjacent(@node.id, &block)
end
def adjacent(match=nil)
@graph.adjacent(@node.id, match)
end
def incoming(match=nil)
@graph.incoming(@node.id, match)
end
def adjacent_edges(match=nil)
@graph.adjacent_edges(@node.id, match)
end
end
end
| module Mementus
class NodeProxy
def initialize(node, graph)
@node = node
@graph = graph
end
def id
@node.id
end
def label
@node.label
end
def [](prop)
@node[prop]
end
def props
@node.props
end
- def out_e
- Pipeline::Step.new(adjacent_edges, Pipeline::Pipe.new(@graph), @graph)
- end
-
def each_adjacent(&block)
@graph.each_adjacent(@node.id, &block)
end
def adjacent(match=nil)
@graph.adjacent(@node.id, match)
end
def incoming(match=nil)
@graph.incoming(@node.id, match)
end
def adjacent_edges(match=nil)
@graph.adjacent_edges(@node.id, match)
end
end
end | 4 | 0.090909 | 0 | 4 |
133ef1d2c1b86a7b767c70cb22196eec65d45096 | app/views/renalware/pd_summaries/show.html.slim | app/views/renalware/pd_summaries/show.html.slim | = render layout: "renalware/patients/layout", locals: { title: "PD Summary" } do
= render partial: 'renalware/pd_regimes/current_regime' unless @current_regime.nil?
h6= "CAPD Regimes (#{@capd_regimes.length})"
= render partial: 'renalware/patients/capd_regimes'
h6= "APD Regimes (#{@apd_regimes.length})"
= render partial: 'renalware/patients/apd_regimes'
h6= "Peritonitis Episodes (#{@peritonitis_episodes.length})"
= render partial: "renalware/patients/peritonitis_episodes"
h6= "Exit Site Infections (#{@exit_site_infections.length})"
= render partial: "renalware/patients/exit_site_infections"
| = render layout: "renalware/patients/layout", locals: { title: "PD Summary" } do
= render partial: 'renalware/pd_regimes/current_regime' unless @current_regime.nil?
= field_set_tag "CAPD Regimes (#{@capd_regimes.length})" do
= render partial: 'renalware/patients/capd_regimes'
= field_set_tag "APD Regimes (#{@apd_regimes.length})" do
= render partial: 'renalware/patients/apd_regimes'
= field_set_tag "Peritonitis Episodes (#{@peritonitis_episodes.length})" do
= render partial: "renalware/patients/peritonitis_episodes"
= field_set_tag "Exit Site Infections (#{@exit_site_infections.length})"
= render partial: "renalware/patients/exit_site_infections"
| Introduce field sets for groups | Introduce field sets for groups
| Slim | mit | airslie/renalware-core,airslie/renalware-core,airslie/renalware-core,airslie/renalware-core | slim | ## Code Before:
= render layout: "renalware/patients/layout", locals: { title: "PD Summary" } do
= render partial: 'renalware/pd_regimes/current_regime' unless @current_regime.nil?
h6= "CAPD Regimes (#{@capd_regimes.length})"
= render partial: 'renalware/patients/capd_regimes'
h6= "APD Regimes (#{@apd_regimes.length})"
= render partial: 'renalware/patients/apd_regimes'
h6= "Peritonitis Episodes (#{@peritonitis_episodes.length})"
= render partial: "renalware/patients/peritonitis_episodes"
h6= "Exit Site Infections (#{@exit_site_infections.length})"
= render partial: "renalware/patients/exit_site_infections"
## Instruction:
Introduce field sets for groups
## Code After:
= render layout: "renalware/patients/layout", locals: { title: "PD Summary" } do
= render partial: 'renalware/pd_regimes/current_regime' unless @current_regime.nil?
= field_set_tag "CAPD Regimes (#{@capd_regimes.length})" do
= render partial: 'renalware/patients/capd_regimes'
= field_set_tag "APD Regimes (#{@apd_regimes.length})" do
= render partial: 'renalware/patients/apd_regimes'
= field_set_tag "Peritonitis Episodes (#{@peritonitis_episodes.length})" do
= render partial: "renalware/patients/peritonitis_episodes"
= field_set_tag "Exit Site Infections (#{@exit_site_infections.length})"
= render partial: "renalware/patients/exit_site_infections"
| = render layout: "renalware/patients/layout", locals: { title: "PD Summary" } do
= render partial: 'renalware/pd_regimes/current_regime' unless @current_regime.nil?
- h6= "CAPD Regimes (#{@capd_regimes.length})"
? --
+ = field_set_tag "CAPD Regimes (#{@capd_regimes.length})" do
? ++++++++++++++ +++
- = render partial: 'renalware/patients/capd_regimes'
+ = render partial: 'renalware/patients/capd_regimes'
? ++
- h6= "APD Regimes (#{@apd_regimes.length})"
? --
+ = field_set_tag "APD Regimes (#{@apd_regimes.length})" do
? ++++++++++++++ +++
- = render partial: 'renalware/patients/apd_regimes'
+ = render partial: 'renalware/patients/apd_regimes'
? ++
- h6= "Peritonitis Episodes (#{@peritonitis_episodes.length})"
? --
+ = field_set_tag "Peritonitis Episodes (#{@peritonitis_episodes.length})" do
? ++++++++++++++ +++
- = render partial: "renalware/patients/peritonitis_episodes"
+ = render partial: "renalware/patients/peritonitis_episodes"
? ++
- h6= "Exit Site Infections (#{@exit_site_infections.length})"
? --
+ = field_set_tag "Exit Site Infections (#{@exit_site_infections.length})"
? ++++++++++++++
- = render partial: "renalware/patients/exit_site_infections"
+ = render partial: "renalware/patients/exit_site_infections"
? ++
| 16 | 1.142857 | 8 | 8 |
5f12d4f0aa69a7db9828824049d77909d06f3c84 | public/assets/views/phonebook/phonebook.html | public/assets/views/phonebook/phonebook.html | <div ng-controller="PhonebookController">
</div>
<h4 ng-controller="PhonebookController">Data : {{Data}}</h4>
<div ng-controller="PhonebookController">
<table border="1">
<tr ng-repeat="i in Data">
<td>{{i.id}}</td>
<td>{{i.firstName}}</td>
<td>{{i.lastName}}</td>
<td>{{i.phoneNumber}}</td></tr>
</table>
</div>
| <div ng-controller="PhonebookController">
<table border="1">
<tr ng-repeat="i in Data">
<td>{{i.id}}</td>
<td>{{i.firstName}}</td>
<td>{{i.lastName}}</td>
<td>{{i.phoneNumber}}</td></tr>
</table>
</div>
| REMOVE redundant data in view | REMOVE redundant data in view
Signed-off-by: Mislav Novakovic <5678c0d5a488e1fbc1213419c52ed0f667208fac@gmail.com>
| HTML | mit | kristijan-pajtasev/angular-phonebook,kristijan-pajtasev/angular-phonebook | html | ## Code Before:
<div ng-controller="PhonebookController">
</div>
<h4 ng-controller="PhonebookController">Data : {{Data}}</h4>
<div ng-controller="PhonebookController">
<table border="1">
<tr ng-repeat="i in Data">
<td>{{i.id}}</td>
<td>{{i.firstName}}</td>
<td>{{i.lastName}}</td>
<td>{{i.phoneNumber}}</td></tr>
</table>
</div>
## Instruction:
REMOVE redundant data in view
Signed-off-by: Mislav Novakovic <5678c0d5a488e1fbc1213419c52ed0f667208fac@gmail.com>
## Code After:
<div ng-controller="PhonebookController">
<table border="1">
<tr ng-repeat="i in Data">
<td>{{i.id}}</td>
<td>{{i.firstName}}</td>
<td>{{i.lastName}}</td>
<td>{{i.phoneNumber}}</td></tr>
</table>
</div>
| - <div ng-controller="PhonebookController">
- </div>
- <h4 ng-controller="PhonebookController">Data : {{Data}}</h4>
<div ng-controller="PhonebookController">
<table border="1">
<tr ng-repeat="i in Data">
<td>{{i.id}}</td>
<td>{{i.firstName}}</td>
<td>{{i.lastName}}</td>
<td>{{i.phoneNumber}}</td></tr>
</table>
</div> | 3 | 0.25 | 0 | 3 |
0c4503e7e49686db265df9202817cb2597fdd733 | spec/replication/util/schema_structure_spec.rb | spec/replication/util/schema_structure_spec.rb | describe "database schema" do
it "is structured as expected" do
ret = EvmDatabase.check_schema
expect(ret).to be_nil, <<-EOS.gsub!(/^ +/, "")
#{Rails.configuration.database_configuration[Rails.env]["database"]} is not structured as expected.
#{ret}
EOS
end
end
| describe "database schema" do
it "is structured as expected" do
ret = EvmDatabase.check_schema
expect(ret).to be_nil, <<-EOS.gsub!(/^ +/, "")
#{Rails.configuration.database_configuration[Rails.env]["database"]} is not structured as expected.
#{ret}
Refer to http://talk.manageiq.org/t/new-schema-specs-for-new-replication/1404 for detail
EOS
end
end
| Add href to explain schema validation spec in error message | Add href to explain schema validation spec in error message
| Ruby | apache-2.0 | tzumainn/manageiq,KevinLoiseau/manageiq,gerikis/manageiq,aufi/manageiq,juliancheal/manageiq,ailisp/manageiq,mzazrivec/manageiq,mkanoor/manageiq,pkomanek/manageiq,jameswnl/manageiq,tinaafitz/manageiq,matobet/manageiq,romanblanco/manageiq,billfitzgerald0120/manageiq,jvlcek/manageiq,ailisp/manageiq,syncrou/manageiq,skateman/manageiq,NaNi-Z/manageiq,branic/manageiq,mkanoor/manageiq,agrare/manageiq,billfitzgerald0120/manageiq,andyvesel/manageiq,matobet/manageiq,d-m-u/manageiq,gerikis/manageiq,maas-ufcg/manageiq,branic/manageiq,mresti/manageiq,ailisp/manageiq,durandom/manageiq,branic/manageiq,NaNi-Z/manageiq,borod108/manageiq,KevinLoiseau/manageiq,lpichler/manageiq,hstastna/manageiq,tzumainn/manageiq,mresti/manageiq,gmcculloug/manageiq,syncrou/manageiq,jameswnl/manageiq,mzazrivec/manageiq,aufi/manageiq,gmcculloug/manageiq,ilackarms/manageiq,djberg96/manageiq,maas-ufcg/manageiq,jvlcek/manageiq,jrafanie/manageiq,romaintb/manageiq,gerikis/manageiq,borod108/manageiq,romanblanco/manageiq,fbladilo/manageiq,romaintb/manageiq,mfeifer/manageiq,mkanoor/manageiq,d-m-u/manageiq,romaintb/manageiq,maas-ufcg/manageiq,KevinLoiseau/manageiq,israel-hdez/manageiq,fbladilo/manageiq,NaNi-Z/manageiq,lpichler/manageiq,ilackarms/manageiq,jntullo/manageiq,NickLaMuro/manageiq,KevinLoiseau/manageiq,romaintb/manageiq,NaNi-Z/manageiq,jameswnl/manageiq,mzazrivec/manageiq,billfitzgerald0120/manageiq,djberg96/manageiq,mresti/manageiq,hstastna/manageiq,maas-ufcg/manageiq,jrafanie/manageiq,d-m-u/manageiq,agrare/manageiq,gmcculloug/manageiq,maas-ufcg/manageiq,andyvesel/manageiq,ManageIQ/manageiq,djberg96/manageiq,matobet/manageiq,jntullo/manageiq,syncrou/manageiq,josejulio/manageiq,KevinLoiseau/manageiq,ilackarms/manageiq,ailisp/manageiq,yaacov/manageiq,israel-hdez/manageiq,skateman/manageiq,jameswnl/manageiq,KevinLoiseau/manageiq,tzumainn/manageiq,jvlcek/manageiq,josejulio/manageiq,josejulio/manageiq,pkomanek/manageiq,syncrou/manageiq,NickLaMuro/manageiq,borod108/manageiq,mkanoor/manageiq,romaintb/manageiq,durandom/manageiq,jrafanie/manageiq,borod108/manageiq,jvlcek/manageiq,ManageIQ/manageiq,tinaafitz/manageiq,branic/manageiq,kbrock/manageiq,aufi/manageiq,andyvesel/manageiq,lpichler/manageiq,pkomanek/manageiq,romanblanco/manageiq,yaacov/manageiq,chessbyte/manageiq,mresti/manageiq,israel-hdez/manageiq,gerikis/manageiq,tzumainn/manageiq,agrare/manageiq,matobet/manageiq,juliancheal/manageiq,hstastna/manageiq,ManageIQ/manageiq,tinaafitz/manageiq,pkomanek/manageiq,yaacov/manageiq,romaintb/manageiq,ilackarms/manageiq,durandom/manageiq,ManageIQ/manageiq,agrare/manageiq,chessbyte/manageiq,kbrock/manageiq,andyvesel/manageiq,yaacov/manageiq,fbladilo/manageiq,maas-ufcg/manageiq,durandom/manageiq,tinaafitz/manageiq,romanblanco/manageiq,chessbyte/manageiq,kbrock/manageiq,skateman/manageiq,jntullo/manageiq,lpichler/manageiq,billfitzgerald0120/manageiq,fbladilo/manageiq,NickLaMuro/manageiq,mzazrivec/manageiq,juliancheal/manageiq,NickLaMuro/manageiq,d-m-u/manageiq,mfeifer/manageiq,chessbyte/manageiq,hstastna/manageiq,kbrock/manageiq,juliancheal/manageiq,djberg96/manageiq,mfeifer/manageiq,gmcculloug/manageiq,israel-hdez/manageiq,jntullo/manageiq,josejulio/manageiq,aufi/manageiq,mfeifer/manageiq,jrafanie/manageiq,skateman/manageiq | ruby | ## Code Before:
describe "database schema" do
it "is structured as expected" do
ret = EvmDatabase.check_schema
expect(ret).to be_nil, <<-EOS.gsub!(/^ +/, "")
#{Rails.configuration.database_configuration[Rails.env]["database"]} is not structured as expected.
#{ret}
EOS
end
end
## Instruction:
Add href to explain schema validation spec in error message
## Code After:
describe "database schema" do
it "is structured as expected" do
ret = EvmDatabase.check_schema
expect(ret).to be_nil, <<-EOS.gsub!(/^ +/, "")
#{Rails.configuration.database_configuration[Rails.env]["database"]} is not structured as expected.
#{ret}
Refer to http://talk.manageiq.org/t/new-schema-specs-for-new-replication/1404 for detail
EOS
end
end
| describe "database schema" do
it "is structured as expected" do
ret = EvmDatabase.check_schema
expect(ret).to be_nil, <<-EOS.gsub!(/^ +/, "")
#{Rails.configuration.database_configuration[Rails.env]["database"]} is not structured as expected.
-
#{ret}
+ Refer to http://talk.manageiq.org/t/new-schema-specs-for-new-replication/1404 for detail
EOS
end
end | 2 | 0.181818 | 1 | 1 |
8b7109cb26130876117a12b81a707c0b1d32d745 | README.md | README.md | lz-node-utils
=============
Useful utility functions for node
## Usage
```bash
npm install --save-dev git+http://git@github.com/lzilioli/lz-node-utils.git
```
```javascript
var util = require( 'lz-node-utils' );
// Identical to grunt.file.expand without the grunt dependancy
util.file.expand([ /* list of file patterns */ ]);
// Will check if pathToFile exists, if not, will console.log a message, and return ''
// if so, returns the file's contents
util.file.read(pathToFile);
```
| lz-node-utils
=============
Useful utility functions for node
## Usage
```bash
npm install --save-dev git+http://git@github.com/lzilioli/lz-node-utils.git
```
```javascript
var util = require( 'lz-node-utils' );
// Identical to grunt.file.expand without the grunt dependancy
util.file.expand([ /* list of file patterns */ ]);
// Will check if pathToFile exists, if not, will console.log a message, and return ''
// if so, returns the file's contents
util.file.read(pathToFile);
```
| Kill unnecessary indents in readme | Kill unnecessary indents in readme | Markdown | mit | lzilioli/lz-node-utils | markdown | ## Code Before:
lz-node-utils
=============
Useful utility functions for node
## Usage
```bash
npm install --save-dev git+http://git@github.com/lzilioli/lz-node-utils.git
```
```javascript
var util = require( 'lz-node-utils' );
// Identical to grunt.file.expand without the grunt dependancy
util.file.expand([ /* list of file patterns */ ]);
// Will check if pathToFile exists, if not, will console.log a message, and return ''
// if so, returns the file's contents
util.file.read(pathToFile);
```
## Instruction:
Kill unnecessary indents in readme
## Code After:
lz-node-utils
=============
Useful utility functions for node
## Usage
```bash
npm install --save-dev git+http://git@github.com/lzilioli/lz-node-utils.git
```
```javascript
var util = require( 'lz-node-utils' );
// Identical to grunt.file.expand without the grunt dependancy
util.file.expand([ /* list of file patterns */ ]);
// Will check if pathToFile exists, if not, will console.log a message, and return ''
// if so, returns the file's contents
util.file.read(pathToFile);
```
| lz-node-utils
=============
Useful utility functions for node
## Usage
```bash
npm install --save-dev git+http://git@github.com/lzilioli/lz-node-utils.git
```
```javascript
- var util = require( 'lz-node-utils' );
? --
+ var util = require( 'lz-node-utils' );
- // Identical to grunt.file.expand without the grunt dependancy
? --
+ // Identical to grunt.file.expand without the grunt dependancy
- util.file.expand([ /* list of file patterns */ ]);
? --
+ util.file.expand([ /* list of file patterns */ ]);
- // Will check if pathToFile exists, if not, will console.log a message, and return ''
? --
+ // Will check if pathToFile exists, if not, will console.log a message, and return ''
- // if so, returns the file's contents
? --
+ // if so, returns the file's contents
- util.file.read(pathToFile);
? --
+ util.file.read(pathToFile);
``` | 12 | 0.631579 | 6 | 6 |
1223b5783fd74b83cfffb6608abdb6632e1e75f1 | app/controllers/things_controller.rb | app/controllers/things_controller.rb | get '/things' do
@things = Thing.all
erb :"/things/index"
end
get '/things/new' do
erb :"/things/new"
end
get '/things/:id' do
@thing = Thing.find_by(id: params[:id])
@user = @thing.user
erb :"/things/show"
end
post "/things" do
@thing = Thing.new(params[:thing])
@thing.user = current_user
if @thing.save
redirect "/things/#{@thing.id}"
else
@errors = @thing.errors.full_messages
erb :"/things/edit"
end
end
get '/things/:id/edit' do
@thing = Thing.find_by(id: params[:id])
erb :"/things/edit"
end
put '/things/:id' do
@thing = Thing.find_by(id: params[:id])
if @thing.update(params[:thing])
redirect "/things/#{@thing.id}"
else
@errors = @thing.errors.full_messages
erb :"/things/edit"
end
end
delete "/things/:id" do
Thing.find_by(id: params[:id]).destroy
redirect "/users/#{current_user.id}"
end
| get '/things' do
@things = Thing.all
erb :"/things/index"
end
get '/things/new' do
erb :"/things/new"
end
get '/things/:id' do
@thing = Thing.find_by(id: params[:id])
@user = @thing.user
erb :"/things/show"
end
post "/things" do
thing = Thing.new(params[:thing])
thing.user = current_user
if thing.save
redirect "/things/#{thing.id}"
else
errors = thing.errors.full_messages
redirect "/things/new?errors=#{errors}"
end
end
get '/things/:id/edit' do
@thing = Thing.find_by(id: params[:id])
@errors = params[:errors]
erb :"/things/edit"
end
put '/things/:id' do
thing = Thing.find_by(id: params[:id])
if thing.update(params[:thing])
redirect "/things/#{thing.id}"
else
errors = thing.errors.full_messages
redirect "/things/#{thing.id}/edit?errors=#{errors}"
end
end
delete "/things/:id" do
Thing.find_by(id: params[:id]).destroy
redirect "/users/#{current_user.id}"
end
| Convert fail routes for things/post, /put, /delete routes from erb's to redirects | Convert fail routes for things/post, /put, /delete routes from erb's to redirects
| Ruby | mit | webdevjeffus/sinatra_template,webdevjeffus/sinatra_template,webdevjeffus/sinatra_template | ruby | ## Code Before:
get '/things' do
@things = Thing.all
erb :"/things/index"
end
get '/things/new' do
erb :"/things/new"
end
get '/things/:id' do
@thing = Thing.find_by(id: params[:id])
@user = @thing.user
erb :"/things/show"
end
post "/things" do
@thing = Thing.new(params[:thing])
@thing.user = current_user
if @thing.save
redirect "/things/#{@thing.id}"
else
@errors = @thing.errors.full_messages
erb :"/things/edit"
end
end
get '/things/:id/edit' do
@thing = Thing.find_by(id: params[:id])
erb :"/things/edit"
end
put '/things/:id' do
@thing = Thing.find_by(id: params[:id])
if @thing.update(params[:thing])
redirect "/things/#{@thing.id}"
else
@errors = @thing.errors.full_messages
erb :"/things/edit"
end
end
delete "/things/:id" do
Thing.find_by(id: params[:id]).destroy
redirect "/users/#{current_user.id}"
end
## Instruction:
Convert fail routes for things/post, /put, /delete routes from erb's to redirects
## Code After:
get '/things' do
@things = Thing.all
erb :"/things/index"
end
get '/things/new' do
erb :"/things/new"
end
get '/things/:id' do
@thing = Thing.find_by(id: params[:id])
@user = @thing.user
erb :"/things/show"
end
post "/things" do
thing = Thing.new(params[:thing])
thing.user = current_user
if thing.save
redirect "/things/#{thing.id}"
else
errors = thing.errors.full_messages
redirect "/things/new?errors=#{errors}"
end
end
get '/things/:id/edit' do
@thing = Thing.find_by(id: params[:id])
@errors = params[:errors]
erb :"/things/edit"
end
put '/things/:id' do
thing = Thing.find_by(id: params[:id])
if thing.update(params[:thing])
redirect "/things/#{thing.id}"
else
errors = thing.errors.full_messages
redirect "/things/#{thing.id}/edit?errors=#{errors}"
end
end
delete "/things/:id" do
Thing.find_by(id: params[:id]).destroy
redirect "/users/#{current_user.id}"
end
| get '/things' do
@things = Thing.all
erb :"/things/index"
end
get '/things/new' do
erb :"/things/new"
end
get '/things/:id' do
@thing = Thing.find_by(id: params[:id])
@user = @thing.user
erb :"/things/show"
end
post "/things" do
- @thing = Thing.new(params[:thing])
? -
+ thing = Thing.new(params[:thing])
- @thing.user = current_user
? -
+ thing.user = current_user
- if @thing.save
? -
+ if thing.save
- redirect "/things/#{@thing.id}"
? -
+ redirect "/things/#{thing.id}"
else
- @errors = @thing.errors.full_messages
? - -
+ errors = thing.errors.full_messages
- erb :"/things/edit"
+ redirect "/things/new?errors=#{errors}"
end
end
get '/things/:id/edit' do
@thing = Thing.find_by(id: params[:id])
+ @errors = params[:errors]
erb :"/things/edit"
end
put '/things/:id' do
- @thing = Thing.find_by(id: params[:id])
? -
+ thing = Thing.find_by(id: params[:id])
- if @thing.update(params[:thing])
? -
+ if thing.update(params[:thing])
- redirect "/things/#{@thing.id}"
? -
+ redirect "/things/#{thing.id}"
else
- @errors = @thing.errors.full_messages
? - -
+ errors = thing.errors.full_messages
- erb :"/things/edit"
+ redirect "/things/#{thing.id}/edit?errors=#{errors}"
end
end
delete "/things/:id" do
Thing.find_by(id: params[:id]).destroy
redirect "/users/#{current_user.id}"
end | 23 | 0.511111 | 12 | 11 |
76074b321f01d08e55822408281d9489e2327b6e | Casks/adobe-dng-converter.rb | Casks/adobe-dng-converter.rb | cask :v1 => 'adobe-dng-converter' do
version '8.6'
sha256 '3bb43ca608b7e62727512c813b395ea46aad545f68f9323cc78c9c5f47145650'
url "http://download.adobe.com/pub/adobe/dng/mac/DNGConverter_#{version.gsub('.', '_')}.dmg"
name 'Adobe Camera Raw and DNG Converter'
homepage 'http://www.adobe.com/support/downloads/product.jsp?product=106&platform=Macintosh'
license :gratis
pkg 'Adobe DNG Converter.pkg'
uninstall :pkgutil => 'com.adobe.adobeDngConverter*',
:quit => 'com.adobe.DNGConverter'
end
| cask :v1 => 'adobe-dng-converter' do
version '9.0'
sha256 'db3b25518c0f93af021bdec599c25f55924403b5199c5dfb92e9e47558c614b5'
url "http://download.adobe.com/pub/adobe/dng/mac/DNGConverter_#{version.gsub('.', '_')}.dmg"
name 'Adobe Camera Raw and DNG Converter'
homepage 'http://www.adobe.com/support/downloads/product.jsp?product=106&platform=Macintosh'
license :gratis
pkg "DNGConverter_#{version.gsub('.', '_')}.pkg"
uninstall :delete => '/Applications/Adobe DNG Converter.app',
:pkgutil => 'com.adobe.adobeDngConverter*',
:quit => 'com.adobe.DNGConverter'
end
| Upgrade Adobe Camera Raw and DNG Converter to version 9.0 | Upgrade Adobe Camera Raw and DNG Converter to version 9.0
| Ruby | bsd-2-clause | mazehall/homebrew-cask,FranklinChen/homebrew-cask,reitermarkus/homebrew-cask,morganestes/homebrew-cask,kevyau/homebrew-cask,flaviocamilo/homebrew-cask,opsdev-ws/homebrew-cask,christophermanning/homebrew-cask,13k/homebrew-cask,guylabs/homebrew-cask,wesen/homebrew-cask,jawshooah/homebrew-cask,n8henrie/homebrew-cask,ahundt/homebrew-cask,amatos/homebrew-cask,kamilboratynski/homebrew-cask,dlovitch/homebrew-cask,skatsuta/homebrew-cask,winkelsdorf/homebrew-cask,andrewdisley/homebrew-cask,xyb/homebrew-cask,paulombcosta/homebrew-cask,elyscape/homebrew-cask,yurikoles/homebrew-cask,samnung/homebrew-cask,uetchy/homebrew-cask,hellosky806/homebrew-cask,mjgardner/homebrew-cask,nrlquaker/homebrew-cask,nrlquaker/homebrew-cask,RJHsiao/homebrew-cask,6uclz1/homebrew-cask,farmerchris/homebrew-cask,mjdescy/homebrew-cask,albertico/homebrew-cask,jgarber623/homebrew-cask,kingthorin/homebrew-cask,chuanxd/homebrew-cask,linc01n/homebrew-cask,yurikoles/homebrew-cask,0xadada/homebrew-cask,napaxton/homebrew-cask,chrisfinazzo/homebrew-cask,chino/homebrew-cask,wmorin/homebrew-cask,fly19890211/homebrew-cask,tjt263/homebrew-cask,JacopKane/homebrew-cask,yumitsu/homebrew-cask,joshka/homebrew-cask,leipert/homebrew-cask,BahtiyarB/homebrew-cask,kamilboratynski/homebrew-cask,CameronGarrett/homebrew-cask,katoquro/homebrew-cask,stonehippo/homebrew-cask,kievechua/homebrew-cask,ctrevino/homebrew-cask,tedski/homebrew-cask,afh/homebrew-cask,bgandon/homebrew-cask,slnovak/homebrew-cask,kassi/homebrew-cask,shoichiaizawa/homebrew-cask,sparrc/homebrew-cask,0rax/homebrew-cask,jeanregisser/homebrew-cask,sanyer/homebrew-cask,patresi/homebrew-cask,neverfox/homebrew-cask,illusionfield/homebrew-cask,Gasol/homebrew-cask,n0ts/homebrew-cask,helloIAmPau/homebrew-cask,diguage/homebrew-cask,cfillion/homebrew-cask,markthetech/homebrew-cask,gibsjose/homebrew-cask,nysthee/homebrew-cask,claui/homebrew-cask,singingwolfboy/homebrew-cask,jangalinski/homebrew-cask,paulombcosta/homebrew-cask,alloy/homebrew-cask,mgryszko/homebrew-cask,FredLackeyOfficial/homebrew-cask,m3nu/homebrew-cask,dieterdemeyer/homebrew-cask,dspeckhard/homebrew-cask,gabrielizaias/homebrew-cask,jbeagley52/homebrew-cask,wastrachan/homebrew-cask,Amorymeltzer/homebrew-cask,sscotth/homebrew-cask,samdoran/homebrew-cask,supriyantomaftuh/homebrew-cask,slack4u/homebrew-cask,exherb/homebrew-cask,gerrypower/homebrew-cask,enriclluelles/homebrew-cask,nysthee/homebrew-cask,lukeadams/homebrew-cask,fharbe/homebrew-cask,wesen/homebrew-cask,bchatard/homebrew-cask,markhuber/homebrew-cask,seanorama/homebrew-cask,jeroenseegers/homebrew-cask,pablote/homebrew-cask,corbt/homebrew-cask,thomanq/homebrew-cask,dictcp/homebrew-cask,xight/homebrew-cask,inz/homebrew-cask,morganestes/homebrew-cask,malford/homebrew-cask,iAmGhost/homebrew-cask,xight/homebrew-cask,hyuna917/homebrew-cask,jppelteret/homebrew-cask,zorosteven/homebrew-cask,nivanchikov/homebrew-cask,elyscape/homebrew-cask,tjt263/homebrew-cask,dwihn0r/homebrew-cask,alebcay/homebrew-cask,johndbritton/homebrew-cask,tolbkni/homebrew-cask,mfpierre/homebrew-cask,bendoerr/homebrew-cask,adrianchia/homebrew-cask,kolomiichenko/homebrew-cask,jeroenj/homebrew-cask,gyugyu/homebrew-cask,MatzFan/homebrew-cask,d/homebrew-cask,JosephViolago/homebrew-cask,daften/homebrew-cask,leonmachadowilcox/homebrew-cask,chrisRidgers/homebrew-cask,askl56/homebrew-cask,nickpellant/homebrew-cask,mjgardner/homebrew-cask,dictcp/homebrew-cask,tedbundyjr/homebrew-cask,alexg0/homebrew-cask,jmeridth/homebrew-cask,inta/homebrew-cask,stephenwade/homebrew-cask,deiga/homebrew-cask,aktau/homebrew-cask,AnastasiaSulyagina/homebrew-cask,ianyh/homebrew-cask,zmwangx/homebrew-cask,JosephViolago/homebrew-cask,gilesdring/homebrew-cask,goxberry/homebrew-cask,mfpierre/homebrew-cask,fwiesel/homebrew-cask,caskroom/homebrew-cask,y00rb/homebrew-cask,jonathanwiesel/homebrew-cask,hristozov/homebrew-cask,zeusdeux/homebrew-cask,Fedalto/homebrew-cask,6uclz1/homebrew-cask,pacav69/homebrew-cask,bric3/homebrew-cask,giannitm/homebrew-cask,cobyism/homebrew-cask,pkq/homebrew-cask,moogar0880/homebrew-cask,thomanq/homebrew-cask,leipert/homebrew-cask,anbotero/homebrew-cask,ksato9700/homebrew-cask,vmrob/homebrew-cask,andrewdisley/homebrew-cask,lukeadams/homebrew-cask,stonehippo/homebrew-cask,moogar0880/homebrew-cask,vitorgalvao/homebrew-cask,doits/homebrew-cask,koenrh/homebrew-cask,haha1903/homebrew-cask,royalwang/homebrew-cask,My2ndAngelic/homebrew-cask,ajbw/homebrew-cask,andersonba/homebrew-cask,andyli/homebrew-cask,squid314/homebrew-cask,SentinelWarren/homebrew-cask,mazehall/homebrew-cask,lifepillar/homebrew-cask,timsutton/homebrew-cask,kostasdizas/homebrew-cask,renaudguerin/homebrew-cask,fharbe/homebrew-cask,sanyer/homebrew-cask,wickedsp1d3r/homebrew-cask,winkelsdorf/homebrew-cask,brianshumate/homebrew-cask,barravi/homebrew-cask,pinut/homebrew-cask,arranubels/homebrew-cask,blogabe/homebrew-cask,jellyfishcoder/homebrew-cask,rhendric/homebrew-cask,buo/homebrew-cask,mauricerkelly/homebrew-cask,taherio/homebrew-cask,scribblemaniac/homebrew-cask,sgnh/homebrew-cask,squid314/homebrew-cask,RickWong/homebrew-cask,johan/homebrew-cask,rogeriopradoj/homebrew-cask,nickpellant/homebrew-cask,chadcatlett/caskroom-homebrew-cask,barravi/homebrew-cask,tyage/homebrew-cask,FranklinChen/homebrew-cask,AnastasiaSulyagina/homebrew-cask,Hywan/homebrew-cask,kolomiichenko/homebrew-cask,otaran/homebrew-cask,ctrevino/homebrew-cask,bcaceiro/homebrew-cask,franklouwers/homebrew-cask,frapposelli/homebrew-cask,markhuber/homebrew-cask,timsutton/homebrew-cask,nathanielvarona/homebrew-cask,kpearson/homebrew-cask,johntrandall/homebrew-cask,githubutilities/homebrew-cask,victorpopkov/homebrew-cask,JikkuJose/homebrew-cask,bkono/homebrew-cask,claui/homebrew-cask,markthetech/homebrew-cask,JikkuJose/homebrew-cask,Whoaa512/homebrew-cask,JoelLarson/homebrew-cask,forevergenin/homebrew-cask,onlynone/homebrew-cask,seanorama/homebrew-cask,lalyos/homebrew-cask,BahtiyarB/homebrew-cask,scribblemaniac/homebrew-cask,sirodoht/homebrew-cask,ebraminio/homebrew-cask,farmerchris/homebrew-cask,troyxmccall/homebrew-cask,bcomnes/homebrew-cask,greg5green/homebrew-cask,elnappo/homebrew-cask,kTitan/homebrew-cask,dwkns/homebrew-cask,timsutton/homebrew-cask,adriweb/homebrew-cask,coneman/homebrew-cask,mariusbutuc/homebrew-cask,johnste/homebrew-cask,gwaldo/homebrew-cask,danielbayley/homebrew-cask,linc01n/homebrew-cask,jaredsampson/homebrew-cask,troyxmccall/homebrew-cask,0rax/homebrew-cask,Hywan/homebrew-cask,mwean/homebrew-cask,syscrusher/homebrew-cask,nathansgreen/homebrew-cask,a1russell/homebrew-cask,exherb/homebrew-cask,williamboman/homebrew-cask,underyx/homebrew-cask,Bombenleger/homebrew-cask,tarwich/homebrew-cask,ninjahoahong/homebrew-cask,hvisage/homebrew-cask,shanonvl/homebrew-cask,huanzhang/homebrew-cask,cfillion/homebrew-cask,christer155/homebrew-cask,malob/homebrew-cask,Labutin/homebrew-cask,kievechua/homebrew-cask,zorosteven/homebrew-cask,seanzxx/homebrew-cask,jamesmlees/homebrew-cask,optikfluffel/homebrew-cask,MisumiRize/homebrew-cask,julionc/homebrew-cask,mrmachine/homebrew-cask,boydj/homebrew-cask,dwkns/homebrew-cask,retrography/homebrew-cask,lifepillar/homebrew-cask,zhuzihhhh/homebrew-cask,yutarody/homebrew-cask,jayshao/homebrew-cask,bsiddiqui/homebrew-cask,FredLackeyOfficial/homebrew-cask,daften/homebrew-cask,lumaxis/homebrew-cask,miguelfrde/homebrew-cask,andrewdisley/homebrew-cask,xtian/homebrew-cask,delphinus35/homebrew-cask,kryhear/homebrew-cask,lauantai/homebrew-cask,a-x-/homebrew-cask,nathanielvarona/homebrew-cask,kteru/homebrew-cask,n8henrie/homebrew-cask,stevenmaguire/homebrew-cask,robertgzr/homebrew-cask,zerrot/homebrew-cask,bric3/homebrew-cask,CameronGarrett/homebrew-cask,santoshsahoo/homebrew-cask,shanonvl/homebrew-cask,arronmabrey/homebrew-cask,jeroenseegers/homebrew-cask,joshka/homebrew-cask,thehunmonkgroup/homebrew-cask,mwean/homebrew-cask,alloy/homebrew-cask,gerrymiller/homebrew-cask,tranc99/homebrew-cask,okket/homebrew-cask,Gasol/homebrew-cask,Saklad5/homebrew-cask,jpodlech/homebrew-cask,coeligena/homebrew-customized,jaredsampson/homebrew-cask,artdevjs/homebrew-cask,hanxue/caskroom,mchlrmrz/homebrew-cask,MicTech/homebrew-cask,hanxue/caskroom,nightscape/homebrew-cask,jayshao/homebrew-cask,akiomik/homebrew-cask,asins/homebrew-cask,BenjaminHCCarr/homebrew-cask,alexg0/homebrew-cask,kryhear/homebrew-cask,toonetown/homebrew-cask,FinalDes/homebrew-cask,jiashuw/homebrew-cask,moonboots/homebrew-cask,psibre/homebrew-cask,sebcode/homebrew-cask,tsparber/homebrew-cask,williamboman/homebrew-cask,lukasbestle/homebrew-cask,MircoT/homebrew-cask,Whoaa512/homebrew-cask,gyndav/homebrew-cask,mishari/homebrew-cask,inz/homebrew-cask,taherio/homebrew-cask,sebcode/homebrew-cask,neil-ca-moore/homebrew-cask,crmne/homebrew-cask,cohei/homebrew-cask,gurghet/homebrew-cask,coeligena/homebrew-customized,lolgear/homebrew-cask,moimikey/homebrew-cask,JacopKane/homebrew-cask,kronicd/homebrew-cask,tedbundyjr/homebrew-cask,paulbreslin/homebrew-cask,paour/homebrew-cask,danielgomezrico/homebrew-cask,dictcp/homebrew-cask,ahvigil/homebrew-cask,gyugyu/homebrew-cask,d/homebrew-cask,klane/homebrew-cask,Saklad5/homebrew-cask,jconley/homebrew-cask,samshadwell/homebrew-cask,cobyism/homebrew-cask,mathbunnyru/homebrew-cask,tangestani/homebrew-cask,atsuyim/homebrew-cask,arranubels/homebrew-cask,feniix/homebrew-cask,fkrone/homebrew-cask,wastrachan/homebrew-cask,coneman/homebrew-cask,pacav69/homebrew-cask,MerelyAPseudonym/homebrew-cask,JacopKane/homebrew-cask,Keloran/homebrew-cask,rajiv/homebrew-cask,antogg/homebrew-cask,thehunmonkgroup/homebrew-cask,maxnordlund/homebrew-cask,lvicentesanchez/homebrew-cask,atsuyim/homebrew-cask,Ephemera/homebrew-cask,lantrix/homebrew-cask,ayohrling/homebrew-cask,ninjahoahong/homebrew-cask,lolgear/homebrew-cask,caskroom/homebrew-cask,adrianchia/homebrew-cask,katoquro/homebrew-cask,jgarber623/homebrew-cask,johndbritton/homebrew-cask,jalaziz/homebrew-cask,colindunn/homebrew-cask,lantrix/homebrew-cask,kostasdizas/homebrew-cask,githubutilities/homebrew-cask,phpwutz/homebrew-cask,nathancahill/homebrew-cask,akiomik/homebrew-cask,nightscape/homebrew-cask,bendoerr/homebrew-cask,winkelsdorf/homebrew-cask,gmkey/homebrew-cask,doits/homebrew-cask,mishari/homebrew-cask,optikfluffel/homebrew-cask,dcondrey/homebrew-cask,janlugt/homebrew-cask,tangestani/homebrew-cask,schneidmaster/homebrew-cask,scw/homebrew-cask,frapposelli/homebrew-cask,hakamadare/homebrew-cask,mwilmer/homebrew-cask,artdevjs/homebrew-cask,xight/homebrew-cask,0xadada/homebrew-cask,adelinofaria/homebrew-cask,genewoo/homebrew-cask,renaudguerin/homebrew-cask,howie/homebrew-cask,aguynamedryan/homebrew-cask,jhowtan/homebrew-cask,BenjaminHCCarr/homebrew-cask,KosherBacon/homebrew-cask,bcomnes/homebrew-cask,jhowtan/homebrew-cask,mathbunnyru/homebrew-cask,retbrown/homebrew-cask,underyx/homebrew-cask,gyndav/homebrew-cask,paour/homebrew-cask,kei-yamazaki/homebrew-cask,iAmGhost/homebrew-cask,stigkj/homebrew-caskroom-cask,retbrown/homebrew-cask,Ephemera/homebrew-cask,yutarody/homebrew-cask,afdnlw/homebrew-cask,axodys/homebrew-cask,SamiHiltunen/homebrew-cask,lcasey001/homebrew-cask,scw/homebrew-cask,afdnlw/homebrew-cask,diguage/homebrew-cask,feigaochn/homebrew-cask,renard/homebrew-cask,ericbn/homebrew-cask,pkq/homebrew-cask,mlocher/homebrew-cask,danielgomezrico/homebrew-cask,skyyuan/homebrew-cask,johnste/homebrew-cask,xcezx/homebrew-cask,hristozov/homebrew-cask,diogodamiani/homebrew-cask,dieterdemeyer/homebrew-cask,sanchezm/homebrew-cask,hackhandslabs/homebrew-cask,Ngrd/homebrew-cask,seanzxx/homebrew-cask,epardee/homebrew-cask,mattrobenolt/homebrew-cask,danielbayley/homebrew-cask,ywfwj2008/homebrew-cask,jamesmlees/homebrew-cask,hvisage/homebrew-cask,yumitsu/homebrew-cask,jonathanwiesel/homebrew-cask,illusionfield/homebrew-cask,kirikiriyamama/homebrew-cask,mlocher/homebrew-cask,a-x-/homebrew-cask,crmne/homebrew-cask,moimikey/homebrew-cask,jrwesolo/homebrew-cask,kirikiriyamama/homebrew-cask,zmwangx/homebrew-cask,michelegera/homebrew-cask,nicolas-brousse/homebrew-cask,Amorymeltzer/homebrew-cask,josa42/homebrew-cask,jmeridth/homebrew-cask,colindean/homebrew-cask,asbachb/homebrew-cask,wuman/homebrew-cask,nathancahill/homebrew-cask,elnappo/homebrew-cask,malob/homebrew-cask,cblecker/homebrew-cask,shoichiaizawa/homebrew-cask,kpearson/homebrew-cask,vitorgalvao/homebrew-cask,jpodlech/homebrew-cask,maxnordlund/homebrew-cask,mwilmer/homebrew-cask,MircoT/homebrew-cask,nathansgreen/homebrew-cask,gurghet/homebrew-cask,malob/homebrew-cask,colindean/homebrew-cask,miccal/homebrew-cask,rhendric/homebrew-cask,toonetown/homebrew-cask,scribblemaniac/homebrew-cask,sanyer/homebrew-cask,SentinelWarren/homebrew-cask,genewoo/homebrew-cask,fazo96/homebrew-cask,Nitecon/homebrew-cask,ahvigil/homebrew-cask,bdhess/homebrew-cask,robbiethegeek/homebrew-cask,jconley/homebrew-cask,tmoreira2020/homebrew,mauricerkelly/homebrew-cask,mchlrmrz/homebrew-cask,mattrobenolt/homebrew-cask,qbmiller/homebrew-cask,samdoran/homebrew-cask,franklouwers/homebrew-cask,sohtsuka/homebrew-cask,jacobdam/homebrew-cask,greg5green/homebrew-cask,chrisfinazzo/homebrew-cask,gyndav/homebrew-cask,rcuza/homebrew-cask,chrisfinazzo/homebrew-cask,kesara/homebrew-cask,dvdoliveira/homebrew-cask,13k/homebrew-cask,phpwutz/homebrew-cask,af/homebrew-cask,alebcay/homebrew-cask,jeroenj/homebrew-cask,uetchy/homebrew-cask,esebastian/homebrew-cask,usami-k/homebrew-cask,danielbayley/homebrew-cask,inta/homebrew-cask,sohtsuka/homebrew-cask,chadcatlett/caskroom-homebrew-cask,hovancik/homebrew-cask,stonehippo/homebrew-cask,crzrcn/homebrew-cask,coeligena/homebrew-customized,haha1903/homebrew-cask,mikem/homebrew-cask,giannitm/homebrew-cask,codeurge/homebrew-cask,chrisRidgers/homebrew-cask,dustinblackman/homebrew-cask,jacobdam/homebrew-cask,mindriot101/homebrew-cask,a1russell/homebrew-cask,remko/homebrew-cask,antogg/homebrew-cask,norio-nomura/homebrew-cask,christophermanning/homebrew-cask,iamso/homebrew-cask,fazo96/homebrew-cask,brianshumate/homebrew-cask,malford/homebrew-cask,sparrc/homebrew-cask,gilesdring/homebrew-cask,mwek/homebrew-cask,jawshooah/homebrew-cask,a1russell/homebrew-cask,Dremora/homebrew-cask,Ketouem/homebrew-cask,athrunsun/homebrew-cask,zerrot/homebrew-cask,casidiablo/homebrew-cask,faun/homebrew-cask,ksato9700/homebrew-cask,feniix/homebrew-cask,mhubig/homebrew-cask,spruceb/homebrew-cask,okket/homebrew-cask,kassi/homebrew-cask,epmatsw/homebrew-cask,shishi/homebrew-cask,renard/homebrew-cask,epmatsw/homebrew-cask,usami-k/homebrew-cask,dlovitch/homebrew-cask,LaurentFough/homebrew-cask,janlugt/homebrew-cask,diogodamiani/homebrew-cask,boecko/homebrew-cask,thii/homebrew-cask,wickedsp1d3r/homebrew-cask,MicTech/homebrew-cask,muan/homebrew-cask,kesara/homebrew-cask,bgandon/homebrew-cask,jacobbednarz/homebrew-cask,deiga/homebrew-cask,Ketouem/homebrew-cask,devmynd/homebrew-cask,yurrriq/homebrew-cask,tmoreira2020/homebrew,slnovak/homebrew-cask,tarwich/homebrew-cask,victorpopkov/homebrew-cask,stevenmaguire/homebrew-cask,cedwardsmedia/homebrew-cask,bdhess/homebrew-cask,aktau/homebrew-cask,rogeriopradoj/homebrew-cask,lvicentesanchez/homebrew-cask,imgarylai/homebrew-cask,gerrymiller/homebrew-cask,larseggert/homebrew-cask,hanxue/caskroom,mahori/homebrew-cask,josa42/homebrew-cask,fkrone/homebrew-cask,ohammersmith/homebrew-cask,guerrero/homebrew-cask,pkq/homebrew-cask,jrwesolo/homebrew-cask,faun/homebrew-cask,vuquoctuan/homebrew-cask,m3nu/homebrew-cask,nshemonsky/homebrew-cask,kevyau/homebrew-cask,Ngrd/homebrew-cask,leonmachadowilcox/homebrew-cask,blogabe/homebrew-cask,unasuke/homebrew-cask,crzrcn/homebrew-cask,shonjir/homebrew-cask,sscotth/homebrew-cask,boydj/homebrew-cask,klane/homebrew-cask,aki77/homebrew-cask,gibsjose/homebrew-cask,iamso/homebrew-cask,paulbreslin/homebrew-cask,deiga/homebrew-cask,drostron/homebrew-cask,tjnycum/homebrew-cask,jedahan/homebrew-cask,ebraminio/homebrew-cask,samshadwell/homebrew-cask,jiashuw/homebrew-cask,moimikey/homebrew-cask,fanquake/homebrew-cask,zchee/homebrew-cask,jen20/homebrew-cask,mhubig/homebrew-cask,reitermarkus/homebrew-cask,xyb/homebrew-cask,kingthorin/homebrew-cask,ksylvan/homebrew-cask,stephenwade/homebrew-cask,cliffcotino/homebrew-cask,ldong/homebrew-cask,zeusdeux/homebrew-cask,shonjir/homebrew-cask,ftiff/homebrew-cask,rajiv/homebrew-cask,MichaelPei/homebrew-cask,reelsense/homebrew-cask,Cottser/homebrew-cask,cprecioso/homebrew-cask,cliffcotino/homebrew-cask,casidiablo/homebrew-cask,pablote/homebrew-cask,jalaziz/homebrew-cask,kTitan/homebrew-cask,axodys/homebrew-cask,sgnh/homebrew-cask,ohammersmith/homebrew-cask,spruceb/homebrew-cask,aki77/homebrew-cask,n0ts/homebrew-cask,kiliankoe/homebrew-cask,cblecker/homebrew-cask,lucasmezencio/homebrew-cask,miccal/homebrew-cask,moonboots/homebrew-cask,rickychilcott/homebrew-cask,vin047/homebrew-cask,puffdad/homebrew-cask,andyli/homebrew-cask,lumaxis/homebrew-cask,chuanxd/homebrew-cask,goxberry/homebrew-cask,stevehedrick/homebrew-cask,decrement/homebrew-cask,MatzFan/homebrew-cask,kronicd/homebrew-cask,bkono/homebrew-cask,mgryszko/homebrew-cask,puffdad/homebrew-cask,xakraz/homebrew-cask,3van/homebrew-cask,djakarta-trap/homebrew-myCask,tjnycum/homebrew-cask,neverfox/homebrew-cask,LaurentFough/homebrew-cask,nivanchikov/homebrew-cask,boecko/homebrew-cask,gerrypower/homebrew-cask,psibre/homebrew-cask,kkdd/homebrew-cask,nicolas-brousse/homebrew-cask,singingwolfboy/homebrew-cask,schneidmaster/homebrew-cask,johnjelinek/homebrew-cask,howie/homebrew-cask,cohei/homebrew-cask,mokagio/homebrew-cask,mkozjak/homebrew-cask,jacobbednarz/homebrew-cask,neil-ca-moore/homebrew-cask,antogg/homebrew-cask,jellyfishcoder/homebrew-cask,bchatard/homebrew-cask,cclauss/homebrew-cask,uetchy/homebrew-cask,blogabe/homebrew-cask,ericbn/homebrew-cask,lcasey001/homebrew-cask,shorshe/homebrew-cask,lucasmezencio/homebrew-cask,Nitecon/homebrew-cask,riyad/homebrew-cask,miku/homebrew-cask,arronmabrey/homebrew-cask,drostron/homebrew-cask,Keloran/homebrew-cask,wickles/homebrew-cask,tangestani/homebrew-cask,jedahan/homebrew-cask,skatsuta/homebrew-cask,joschi/homebrew-cask,perfide/homebrew-cask,wuman/homebrew-cask,m3nu/homebrew-cask,Fedalto/homebrew-cask,ianyh/homebrew-cask,claui/homebrew-cask,Cottser/homebrew-cask,tedski/homebrew-cask,mindriot101/homebrew-cask,KosherBacon/homebrew-cask,adriweb/homebrew-cask,royalwang/homebrew-cask,kei-yamazaki/homebrew-cask,mingzhi22/homebrew-cask,wmorin/homebrew-cask,colindunn/homebrew-cask,riyad/homebrew-cask,vuquoctuan/homebrew-cask,ddm/homebrew-cask,tolbkni/homebrew-cask,aguynamedryan/homebrew-cask,ksylvan/homebrew-cask,imgarylai/homebrew-cask,blainesch/homebrew-cask,ptb/homebrew-cask,shonjir/homebrew-cask,jangalinski/homebrew-cask,paour/homebrew-cask,JosephViolago/homebrew-cask,nathanielvarona/homebrew-cask,syscrusher/homebrew-cask,supriyantomaftuh/homebrew-cask,bcaceiro/homebrew-cask,xakraz/homebrew-cask,sirodoht/homebrew-cask,Ephemera/homebrew-cask,af/homebrew-cask,mchlrmrz/homebrew-cask,robertgzr/homebrew-cask,xtian/homebrew-cask,kiliankoe/homebrew-cask,vigosan/homebrew-cask,tsparber/homebrew-cask,mathbunnyru/homebrew-cask,cclauss/homebrew-cask,yuhki50/homebrew-cask,MichaelPei/homebrew-cask,blainesch/homebrew-cask,joschi/homebrew-cask,JoelLarson/homebrew-cask,SamiHiltunen/homebrew-cask,napaxton/homebrew-cask,tranc99/homebrew-cask,flaviocamilo/homebrew-cask,codeurge/homebrew-cask,slack4u/homebrew-cask,wizonesolutions/homebrew-cask,RogerThiede/homebrew-cask,astorije/homebrew-cask,MoOx/homebrew-cask,michelegera/homebrew-cask,skyyuan/homebrew-cask,qnm/homebrew-cask,guerrero/homebrew-cask,djakarta-trap/homebrew-myCask,ericbn/homebrew-cask,sjackman/homebrew-cask,vin047/homebrew-cask,FinalDes/homebrew-cask,gguillotte/homebrew-cask,onlynone/homebrew-cask,stevehedrick/homebrew-cask,vigosan/homebrew-cask,chino/homebrew-cask,rajiv/homebrew-cask,shorshe/homebrew-cask,tan9/homebrew-cask,julionc/homebrew-cask,theoriginalgri/homebrew-cask,jpmat296/homebrew-cask,miccal/homebrew-cask,perfide/homebrew-cask,kuno/homebrew-cask,dunn/homebrew-cask,mkozjak/homebrew-cask,zchee/homebrew-cask,dustinblackman/homebrew-cask,hovancik/homebrew-cask,dspeckhard/homebrew-cask,reelsense/homebrew-cask,mwek/homebrew-cask,ywfwj2008/homebrew-cask,fly19890211/homebrew-cask,mattrobenolt/homebrew-cask,larseggert/homebrew-cask,thii/homebrew-cask,tjnycum/homebrew-cask,Ibuprofen/homebrew-cask,reitermarkus/homebrew-cask,sanchezm/homebrew-cask,mahori/homebrew-cask,englishm/homebrew-cask,sosedoff/homebrew-cask,jasmas/homebrew-cask,deanmorin/homebrew-cask,qnm/homebrew-cask,wizonesolutions/homebrew-cask,MoOx/homebrew-cask,lalyos/homebrew-cask,bsiddiqui/homebrew-cask,mjgardner/homebrew-cask,RogerThiede/homebrew-cask,bric3/homebrew-cask,yurikoles/homebrew-cask,pinut/homebrew-cask,albertico/homebrew-cask,ddm/homebrew-cask,adelinofaria/homebrew-cask,wmorin/homebrew-cask,vmrob/homebrew-cask,enriclluelles/homebrew-cask,gabrielizaias/homebrew-cask,hakamadare/homebrew-cask,robbiethegeek/homebrew-cask,rubenerd/homebrew-cask,ayohrling/homebrew-cask,wKovacs64/homebrew-cask,nshemonsky/homebrew-cask,neverfox/homebrew-cask,yutarody/homebrew-cask,kuno/homebrew-cask,MerelyAPseudonym/homebrew-cask,esebastian/homebrew-cask,xyb/homebrew-cask,unasuke/homebrew-cask,zhuzihhhh/homebrew-cask,mattfelsen/homebrew-cask,forevergenin/homebrew-cask,asbachb/homebrew-cask,patresi/homebrew-cask,askl56/homebrew-cask,alexg0/homebrew-cask,cedwardsmedia/homebrew-cask,stephenwade/homebrew-cask,Labutin/homebrew-cask,hellosky806/homebrew-cask,retrography/homebrew-cask,amatos/homebrew-cask,ptb/homebrew-cask,johnjelinek/homebrew-cask,hackhandslabs/homebrew-cask,alebcay/homebrew-cask,rcuza/homebrew-cask,corbt/homebrew-cask,Dremora/homebrew-cask,anbotero/homebrew-cask,tan9/homebrew-cask,imgarylai/homebrew-cask,mokagio/homebrew-cask,adrianchia/homebrew-cask,Ibuprofen/homebrew-cask,kteru/homebrew-cask,RickWong/homebrew-cask,wayou/homebrew-cask,gguillotte/homebrew-cask,jeanregisser/homebrew-cask,rickychilcott/homebrew-cask,ajbw/homebrew-cask,lauantai/homebrew-cask,cprecioso/homebrew-cask,scottsuch/homebrew-cask,fanquake/homebrew-cask,mahori/homebrew-cask,scottsuch/homebrew-cask,gwaldo/homebrew-cask,mattfelsen/homebrew-cask,Bombenleger/homebrew-cask,wayou/homebrew-cask,RJHsiao/homebrew-cask,joshka/homebrew-cask,athrunsun/homebrew-cask,stigkj/homebrew-caskroom-cask,miguelfrde/homebrew-cask,nrlquaker/homebrew-cask,bosr/homebrew-cask,koenrh/homebrew-cask,ldong/homebrew-cask,rubenerd/homebrew-cask,josa42/homebrew-cask,wickles/homebrew-cask,shoichiaizawa/homebrew-cask,kingthorin/homebrew-cask,xcezx/homebrew-cask,dcondrey/homebrew-cask,deanmorin/homebrew-cask,santoshsahoo/homebrew-cask,cblecker/homebrew-cask,dvdoliveira/homebrew-cask,christer155/homebrew-cask,jgarber623/homebrew-cask,kongslund/homebrew-cask,hyuna917/homebrew-cask,fwiesel/homebrew-cask,asins/homebrew-cask,sosedoff/homebrew-cask,jpmat296/homebrew-cask,otaran/homebrew-cask,mingzhi22/homebrew-cask,samnung/homebrew-cask,shishi/homebrew-cask,y00rb/homebrew-cask,decrement/homebrew-cask,sjackman/homebrew-cask,jasmas/homebrew-cask,ftiff/homebrew-cask,kkdd/homebrew-cask,julionc/homebrew-cask,delphinus35/homebrew-cask,yuhki50/homebrew-cask,bosr/homebrew-cask,sscotth/homebrew-cask,johntrandall/homebrew-cask,mariusbutuc/homebrew-cask,jalaziz/homebrew-cask,dunn/homebrew-cask,tyage/homebrew-cask,jppelteret/homebrew-cask,astorije/homebrew-cask,dwihn0r/homebrew-cask,yurrriq/homebrew-cask,qbmiller/homebrew-cask,mjdescy/homebrew-cask,Amorymeltzer/homebrew-cask,MisumiRize/homebrew-cask,devmynd/homebrew-cask,joschi/homebrew-cask,optikfluffel/homebrew-cask,afh/homebrew-cask,wKovacs64/homebrew-cask,singingwolfboy/homebrew-cask,kongslund/homebrew-cask,remko/homebrew-cask,andersonba/homebrew-cask,jen20/homebrew-cask,norio-nomura/homebrew-cask,scottsuch/homebrew-cask,lukasbestle/homebrew-cask,huanzhang/homebrew-cask,muan/homebrew-cask,kesara/homebrew-cask,mrmachine/homebrew-cask,guylabs/homebrew-cask,buo/homebrew-cask,ahundt/homebrew-cask,helloIAmPau/homebrew-cask,3van/homebrew-cask,jbeagley52/homebrew-cask,theoriginalgri/homebrew-cask,englishm/homebrew-cask,miku/homebrew-cask,gmkey/homebrew-cask,epardee/homebrew-cask,BenjaminHCCarr/homebrew-cask,esebastian/homebrew-cask,mikem/homebrew-cask,opsdev-ws/homebrew-cask,cobyism/homebrew-cask,rogeriopradoj/homebrew-cask,johan/homebrew-cask,feigaochn/homebrew-cask,My2ndAngelic/homebrew-cask | ruby | ## Code Before:
cask :v1 => 'adobe-dng-converter' do
version '8.6'
sha256 '3bb43ca608b7e62727512c813b395ea46aad545f68f9323cc78c9c5f47145650'
url "http://download.adobe.com/pub/adobe/dng/mac/DNGConverter_#{version.gsub('.', '_')}.dmg"
name 'Adobe Camera Raw and DNG Converter'
homepage 'http://www.adobe.com/support/downloads/product.jsp?product=106&platform=Macintosh'
license :gratis
pkg 'Adobe DNG Converter.pkg'
uninstall :pkgutil => 'com.adobe.adobeDngConverter*',
:quit => 'com.adobe.DNGConverter'
end
## Instruction:
Upgrade Adobe Camera Raw and DNG Converter to version 9.0
## Code After:
cask :v1 => 'adobe-dng-converter' do
version '9.0'
sha256 'db3b25518c0f93af021bdec599c25f55924403b5199c5dfb92e9e47558c614b5'
url "http://download.adobe.com/pub/adobe/dng/mac/DNGConverter_#{version.gsub('.', '_')}.dmg"
name 'Adobe Camera Raw and DNG Converter'
homepage 'http://www.adobe.com/support/downloads/product.jsp?product=106&platform=Macintosh'
license :gratis
pkg "DNGConverter_#{version.gsub('.', '_')}.pkg"
uninstall :delete => '/Applications/Adobe DNG Converter.app',
:pkgutil => 'com.adobe.adobeDngConverter*',
:quit => 'com.adobe.DNGConverter'
end
| cask :v1 => 'adobe-dng-converter' do
- version '8.6'
? ^ ^
+ version '9.0'
? ^ ^
- sha256 '3bb43ca608b7e62727512c813b395ea46aad545f68f9323cc78c9c5f47145650'
+ sha256 'db3b25518c0f93af021bdec599c25f55924403b5199c5dfb92e9e47558c614b5'
url "http://download.adobe.com/pub/adobe/dng/mac/DNGConverter_#{version.gsub('.', '_')}.dmg"
name 'Adobe Camera Raw and DNG Converter'
homepage 'http://www.adobe.com/support/downloads/product.jsp?product=106&platform=Macintosh'
license :gratis
- pkg 'Adobe DNG Converter.pkg'
+ pkg "DNGConverter_#{version.gsub('.', '_')}.pkg"
+ uninstall :delete => '/Applications/Adobe DNG Converter.app',
- uninstall :pkgutil => 'com.adobe.adobeDngConverter*',
? ^^^^^^^^^
+ :pkgutil => 'com.adobe.adobeDngConverter*',
? ^^^^^^^^^
:quit => 'com.adobe.DNGConverter'
end | 9 | 0.642857 | 5 | 4 |
9a34badcc5628810653bfb349f012c5d86f65b77 | resources/views/store.blade.php | resources/views/store.blade.php | @extends ('app')
@section('title', 'Created')
@section('content')
<pre>{{ $secret->uuid4 }}</pre>
@stop | @extends ('app')
@section('title', 'Created')
@section('content')
<pre>{{ Request::root() }}/show/{{ $secret->uuid4 }}</pre>
@stop | Add url prefix to generated URL. | Add url prefix to generated URL.
| PHP | mit | unicalabs/agrippa,unicalabs/agrippa,unicalabs/agrippa | php | ## Code Before:
@extends ('app')
@section('title', 'Created')
@section('content')
<pre>{{ $secret->uuid4 }}</pre>
@stop
## Instruction:
Add url prefix to generated URL.
## Code After:
@extends ('app')
@section('title', 'Created')
@section('content')
<pre>{{ Request::root() }}/show/{{ $secret->uuid4 }}</pre>
@stop | @extends ('app')
@section('title', 'Created')
@section('content')
- <pre>{{ $secret->uuid4 }}</pre>
+ <pre>{{ Request::root() }}/show/{{ $secret->uuid4 }}</pre>
@stop | 2 | 0.285714 | 1 | 1 |
9d3377a062026c8547330da20d3a1153b47e8f67 | nixpkgs/home/packages.nix | nixpkgs/home/packages.nix | { pkgs, config, ... }:
{
# "The set of packages to appear in the user environment."
home.packages = with pkgs; [
acpi
ardour
audacity
blueman
byzanz
calc
calibre
cargo
coreutils
ctags
curl
dict
diction
exfat
file
firefox
gnome3.adwaita-icon-theme
gnumake
gnupg
golly
gparted
hsetroot
hugo
imagemagick
libreoffice
musescore
nextcloud-client
p7zip
pandoc
pass
pasystray
psmisc
pwgen
python
python3
qrencode
ranger
rofi-pass
rsync
rustc
rxvt_unicode_with-plugins
scrot
spotify
sshfs
sxiv
texlive.combined.scheme-full
thunderbird
tomb
transmission_gtk
trash-cli
tree
unclutter
unzip
vlc
w3m
wget
xclip
xdg-user-dirs
xdg_utils
xorg.xbacklight
xorg.xev
xorg.xwininfo
xsel
youtube-dl
zathura
zip
zotero
];
}
| { pkgs, config, ... }:
{
# "The set of packages to appear in the user environment."
home.packages = with pkgs; [
acpi
ardour
audacity
blueman
byzanz
calc
calibre
cargo
coreutils
ctags
curl
dict
diction
exfat
file
firefox
gnome3.adwaita-icon-theme
gnumake
gnupg
golly
gparted
hsetroot
hugo
imagemagick
libreoffice.libreoffice
musescore
nextcloud-client
p7zip
pandoc
pass
pasystray
psmisc
pwgen
python
python3
qrencode
ranger
rofi-pass
rsync
rustc
rxvt_unicode_with-plugins
scrot
spotify
sshfs
sxiv
texlive.combined.scheme-full
thunderbird
tomb
transmission_gtk
trash-cli
tree
unclutter
unzip
vlc
w3m
wget
xclip
xdg-user-dirs
xdg_utils
xorg.xbacklight
xorg.xev
xorg.xwininfo
xsel
youtube-dl
zathura
zip
zotero
];
}
| Fix libreoffice font bug (introducing high cpu usage...) | Fix libreoffice font bug (introducing high cpu usage...)
| Nix | mit | gmarmstrong/dotfiles | nix | ## Code Before:
{ pkgs, config, ... }:
{
# "The set of packages to appear in the user environment."
home.packages = with pkgs; [
acpi
ardour
audacity
blueman
byzanz
calc
calibre
cargo
coreutils
ctags
curl
dict
diction
exfat
file
firefox
gnome3.adwaita-icon-theme
gnumake
gnupg
golly
gparted
hsetroot
hugo
imagemagick
libreoffice
musescore
nextcloud-client
p7zip
pandoc
pass
pasystray
psmisc
pwgen
python
python3
qrencode
ranger
rofi-pass
rsync
rustc
rxvt_unicode_with-plugins
scrot
spotify
sshfs
sxiv
texlive.combined.scheme-full
thunderbird
tomb
transmission_gtk
trash-cli
tree
unclutter
unzip
vlc
w3m
wget
xclip
xdg-user-dirs
xdg_utils
xorg.xbacklight
xorg.xev
xorg.xwininfo
xsel
youtube-dl
zathura
zip
zotero
];
}
## Instruction:
Fix libreoffice font bug (introducing high cpu usage...)
## Code After:
{ pkgs, config, ... }:
{
# "The set of packages to appear in the user environment."
home.packages = with pkgs; [
acpi
ardour
audacity
blueman
byzanz
calc
calibre
cargo
coreutils
ctags
curl
dict
diction
exfat
file
firefox
gnome3.adwaita-icon-theme
gnumake
gnupg
golly
gparted
hsetroot
hugo
imagemagick
libreoffice.libreoffice
musescore
nextcloud-client
p7zip
pandoc
pass
pasystray
psmisc
pwgen
python
python3
qrencode
ranger
rofi-pass
rsync
rustc
rxvt_unicode_with-plugins
scrot
spotify
sshfs
sxiv
texlive.combined.scheme-full
thunderbird
tomb
transmission_gtk
trash-cli
tree
unclutter
unzip
vlc
w3m
wget
xclip
xdg-user-dirs
xdg_utils
xorg.xbacklight
xorg.xev
xorg.xwininfo
xsel
youtube-dl
zathura
zip
zotero
];
}
| { pkgs, config, ... }:
{
# "The set of packages to appear in the user environment."
home.packages = with pkgs; [
acpi
ardour
audacity
blueman
byzanz
calc
calibre
cargo
coreutils
ctags
curl
dict
diction
exfat
file
firefox
gnome3.adwaita-icon-theme
gnumake
gnupg
golly
gparted
hsetroot
hugo
imagemagick
- libreoffice
+ libreoffice.libreoffice
musescore
nextcloud-client
p7zip
pandoc
pass
pasystray
psmisc
pwgen
python
python3
qrencode
ranger
rofi-pass
rsync
rustc
rxvt_unicode_with-plugins
scrot
spotify
sshfs
sxiv
texlive.combined.scheme-full
thunderbird
tomb
transmission_gtk
trash-cli
tree
unclutter
unzip
vlc
w3m
wget
xclip
xdg-user-dirs
xdg_utils
xorg.xbacklight
xorg.xev
xorg.xwininfo
xsel
youtube-dl
zathura
zip
zotero
];
} | 2 | 0.027027 | 1 | 1 |
940d4d92bdd220aaa74d817c2ae03c8c33848ff4 | _app/assets/sass/modules/_back-to-top-button.sass | _app/assets/sass/modules/_back-to-top-button.sass | .back-to-top-button
display: block
background-color: rgba(0,0,0,0.7)
color: white
font-size: 0.8rem
position: fixed
right: 3%
bottom: 3%
padding: 0.8em
opacity: 0
visibility: hidden
&:hover
color: $orange
&.show
opacity: 1
visibility: visible
| .back-to-top-button
display: block
background-color: rgba(0,0,0,0.7)
color: white
font-size: 0.8rem
position: fixed
right: 3%
bottom: 3%
padding: 0.8em
border-radius: 9999px
opacity: 0
visibility: hidden
&:hover
color: $orange
&.show
opacity: 1
visibility: visible
| Make Back to top Button rounded | Make Back to top Button rounded
| Sass | mit | jr-cologne/jr-cologne.de,jr-cologne/jr-cologne.de | sass | ## Code Before:
.back-to-top-button
display: block
background-color: rgba(0,0,0,0.7)
color: white
font-size: 0.8rem
position: fixed
right: 3%
bottom: 3%
padding: 0.8em
opacity: 0
visibility: hidden
&:hover
color: $orange
&.show
opacity: 1
visibility: visible
## Instruction:
Make Back to top Button rounded
## Code After:
.back-to-top-button
display: block
background-color: rgba(0,0,0,0.7)
color: white
font-size: 0.8rem
position: fixed
right: 3%
bottom: 3%
padding: 0.8em
border-radius: 9999px
opacity: 0
visibility: hidden
&:hover
color: $orange
&.show
opacity: 1
visibility: visible
| .back-to-top-button
display: block
background-color: rgba(0,0,0,0.7)
color: white
font-size: 0.8rem
position: fixed
right: 3%
bottom: 3%
padding: 0.8em
+ border-radius: 9999px
opacity: 0
visibility: hidden
&:hover
color: $orange
&.show
opacity: 1
visibility: visible | 1 | 0.055556 | 1 | 0 |
fa68297cc2ea08db7ce71a2f9066c53c1a5c1b56 | test/effect_test.js | test/effect_test.js | import expect from "expect.js";
describe("Effect", () => {
it("works", () => {
// TODO
expect(1).to.be(1);
});
});
| import expect from "expect.js";
import { Effect, isEmpty } from "../dist/effect";
describe("Effect", () => {
describe("isEmpty", () => {
it("returns true for the empty effect", () => {
expect(isEmpty(Effect.empty())).to.be(true);
});
it("returns false for standard effects", () => {
expect(isEmpty(Effect())).to.be(false);
expect(isEmpty(Effect(_ => {}))).to.be(false);
});
})
});
| Add a test for `isEmpty` | Add a test for `isEmpty`
| JavaScript | mit | hojberg/gongfu,hojberg/gongfu | javascript | ## Code Before:
import expect from "expect.js";
describe("Effect", () => {
it("works", () => {
// TODO
expect(1).to.be(1);
});
});
## Instruction:
Add a test for `isEmpty`
## Code After:
import expect from "expect.js";
import { Effect, isEmpty } from "../dist/effect";
describe("Effect", () => {
describe("isEmpty", () => {
it("returns true for the empty effect", () => {
expect(isEmpty(Effect.empty())).to.be(true);
});
it("returns false for standard effects", () => {
expect(isEmpty(Effect())).to.be(false);
expect(isEmpty(Effect(_ => {}))).to.be(false);
});
})
});
| import expect from "expect.js";
+ import { Effect, isEmpty } from "../dist/effect";
describe("Effect", () => {
- it("works", () => {
- // TODO
- expect(1).to.be(1);
+ describe("isEmpty", () => {
+ it("returns true for the empty effect", () => {
+ expect(isEmpty(Effect.empty())).to.be(true);
+ });
+ it("returns false for standard effects", () => {
+ expect(isEmpty(Effect())).to.be(false);
+ expect(isEmpty(Effect(_ => {}))).to.be(false);
+ });
- });
? -
+ })
}); | 14 | 1.75 | 10 | 4 |
5cd667412a2706ad3deae4b6a9fc6892204ceedd | medium.css | medium.css | /**
* medium.css
* Contains default styles to inject into Medium publications.
*/
.postMeterBar {
display: none;
}
| /**
* medium.css
* Contains default styles to inject into Medium publications.
*/
.postMeterBar, .openInAppButton {
display: none;
}
| Hide "open in app" button | Hide "open in app" button
This closes #11
| CSS | mit | thebaer/MMRA,thebaer/MMRA | css | ## Code Before:
/**
* medium.css
* Contains default styles to inject into Medium publications.
*/
.postMeterBar {
display: none;
}
## Instruction:
Hide "open in app" button
This closes #11
## Code After:
/**
* medium.css
* Contains default styles to inject into Medium publications.
*/
.postMeterBar, .openInAppButton {
display: none;
}
| /**
* medium.css
* Contains default styles to inject into Medium publications.
*/
- .postMeterBar {
+ .postMeterBar, .openInAppButton {
display: none;
} | 2 | 0.285714 | 1 | 1 |
c763ce6d152597312f2b40d40311a85bf156af60 | src/test/java/ml/shifu/shifu/core/ConvergeJudgerTest.java | src/test/java/ml/shifu/shifu/core/ConvergeJudgerTest.java | package ml.shifu.shifu.core;
import org.testng.Assert;
import org.testng.annotations.Test;
public class ConvergeJudgerTest {
@Test
public void testJudge() {
ConvergeJudger judger = new ConvergeJudger();
Assert.assertTrue(judger.judge(1.0, 2.0));
Assert.assertTrue(judger.judge(1.0, 1.0));
Assert.assertFalse(judger.judge(1.0, 0.1));
}
}
| package ml.shifu.shifu.core;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class ConvergeJudgerTest {
private ConvergeJudger judger;
@BeforeClass
public void setUp() {
this.judger = new ConvergeJudger();
}
@Test
public void testJudge() {
Assert.assertTrue(judger.judge(1.0, 2.0));
Assert.assertTrue(judger.judge(1.0, 1.0));
Assert.assertFalse(judger.judge(1.0, 0.1));
}
}
| Use setup to initialize judger instance. | Use setup to initialize judger instance. | Java | apache-2.0 | ShifuML/shifu,ShifuML/shifu,ShifuML/shifu | java | ## Code Before:
package ml.shifu.shifu.core;
import org.testng.Assert;
import org.testng.annotations.Test;
public class ConvergeJudgerTest {
@Test
public void testJudge() {
ConvergeJudger judger = new ConvergeJudger();
Assert.assertTrue(judger.judge(1.0, 2.0));
Assert.assertTrue(judger.judge(1.0, 1.0));
Assert.assertFalse(judger.judge(1.0, 0.1));
}
}
## Instruction:
Use setup to initialize judger instance.
## Code After:
package ml.shifu.shifu.core;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class ConvergeJudgerTest {
private ConvergeJudger judger;
@BeforeClass
public void setUp() {
this.judger = new ConvergeJudger();
}
@Test
public void testJudge() {
Assert.assertTrue(judger.judge(1.0, 2.0));
Assert.assertTrue(judger.judge(1.0, 1.0));
Assert.assertFalse(judger.judge(1.0, 0.1));
}
}
| package ml.shifu.shifu.core;
import org.testng.Assert;
+ import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class ConvergeJudgerTest {
+ private ConvergeJudger judger;
+
+ @BeforeClass
+ public void setUp() {
+ this.judger = new ConvergeJudger();
+ }
+
@Test
public void testJudge() {
- ConvergeJudger judger = new ConvergeJudger();
-
Assert.assertTrue(judger.judge(1.0, 2.0));
Assert.assertTrue(judger.judge(1.0, 1.0));
Assert.assertFalse(judger.judge(1.0, 0.1));
}
-
+
} | 12 | 0.705882 | 9 | 3 |
b8f85119f8857c46bddf2530b79fa88b5ced5ff4 | app/helpers/generic_object_helper/textual_summary.rb | app/helpers/generic_object_helper/textual_summary.rb | module GenericObjectHelper::TextualSummary
include TextualMixins::TextualName
def textual_group_properties
TextualGroup.new(_("Properties"), %i(name))
end
def textual_name
{:label => _("Name"), :value => @record.name}
end
def textual_group_attribute_details_list
TextualMultilabel.new(
_("Attributes (#{@record.property_attributes.count})"),
:additional_table_class => "table-fixed",
:labels => [_("Name"), _("Value")],
:values => attributes_array
)
end
def attributes_array
@record.property_attributes.each do |var|
[var[0], var[1]]
end
end
end
| module GenericObjectHelper::TextualSummary
include TextualMixins::TextualName
def textual_group_properties
TextualGroup.new(_("Properties"), %i(name created updated))
end
def textual_name
{:label => _("Name"), :value => @record.name}
end
def textual_created
{:label => _("Created"), :value => format_timezone(@record.created_at)}
end
def textual_updated
{:label => _("Updated"), :value => format_timezone(@record.updated_at)}
end
def textual_group_attribute_details_list
TextualMultilabel.new(
_("Attributes (#{@record.property_attributes.count})"),
:additional_table_class => "table-fixed",
:labels => [_("Name"), _("Value")],
:values => attributes_array
)
end
def attributes_array
@record.property_attributes.each do |var|
[var[0], var[1]]
end
end
end
| Add Created and Updated to Summary screen | Add Created and Updated to Summary screen
| Ruby | apache-2.0 | ManageIQ/manageiq-ui-classic,ManageIQ/manageiq-ui-classic,ManageIQ/manageiq-ui-classic,ManageIQ/manageiq-ui-classic | ruby | ## Code Before:
module GenericObjectHelper::TextualSummary
include TextualMixins::TextualName
def textual_group_properties
TextualGroup.new(_("Properties"), %i(name))
end
def textual_name
{:label => _("Name"), :value => @record.name}
end
def textual_group_attribute_details_list
TextualMultilabel.new(
_("Attributes (#{@record.property_attributes.count})"),
:additional_table_class => "table-fixed",
:labels => [_("Name"), _("Value")],
:values => attributes_array
)
end
def attributes_array
@record.property_attributes.each do |var|
[var[0], var[1]]
end
end
end
## Instruction:
Add Created and Updated to Summary screen
## Code After:
module GenericObjectHelper::TextualSummary
include TextualMixins::TextualName
def textual_group_properties
TextualGroup.new(_("Properties"), %i(name created updated))
end
def textual_name
{:label => _("Name"), :value => @record.name}
end
def textual_created
{:label => _("Created"), :value => format_timezone(@record.created_at)}
end
def textual_updated
{:label => _("Updated"), :value => format_timezone(@record.updated_at)}
end
def textual_group_attribute_details_list
TextualMultilabel.new(
_("Attributes (#{@record.property_attributes.count})"),
:additional_table_class => "table-fixed",
:labels => [_("Name"), _("Value")],
:values => attributes_array
)
end
def attributes_array
@record.property_attributes.each do |var|
[var[0], var[1]]
end
end
end
| module GenericObjectHelper::TextualSummary
include TextualMixins::TextualName
def textual_group_properties
- TextualGroup.new(_("Properties"), %i(name))
+ TextualGroup.new(_("Properties"), %i(name created updated))
? ++++++++++++++++
end
def textual_name
{:label => _("Name"), :value => @record.name}
+ end
+
+ def textual_created
+ {:label => _("Created"), :value => format_timezone(@record.created_at)}
+ end
+
+ def textual_updated
+ {:label => _("Updated"), :value => format_timezone(@record.updated_at)}
end
def textual_group_attribute_details_list
TextualMultilabel.new(
_("Attributes (#{@record.property_attributes.count})"),
:additional_table_class => "table-fixed",
:labels => [_("Name"), _("Value")],
:values => attributes_array
)
end
def attributes_array
@record.property_attributes.each do |var|
[var[0], var[1]]
end
end
end | 10 | 0.384615 | 9 | 1 |
0211143b65fbec7ae5c1c6591d5486709a7e2876 | docs/TESTS.md | docs/TESTS.md | Load the test file into your running Lisp implementation, for example,
`(load "point-mutations-test")`. This will run the tests the first
time automatically. After that you can run the test suite in the REPL
with `(lisp-unit:run-tests :all :point-mutations-test)`.
## Making your first Common Lisp solution
To create lisp code that can be loaded with `(load "dna")`
for the first exercise, put this code in `dna.lisp`:
```lisp
(in-package #:cl-user)
(defpackage #:dna
(:use #:common-lisp)
(:export #:hamming-distance))
(in-package #:dna)
(defun hamming-distance (dna1 dna2)
"Determine number of mutations between DNA strands by computing the Hamming Distance."
)
```
| Start up your Lisp implementation in the directory of the exercise you
are working on (or change the current directory for an already running
Lisp implementation to that directory).
Load the test file into your running Lisp implementation, for example,
`(load "point-mutations-test")`. This will run the tests the first
time automatically. After that you can run the test suite in the REPL
with `(lisp-unit:run-tests :all :point-mutations-test)`.
## Making your first Common Lisp solution
To create lisp code that can be loaded with `(load "dna")`
for the first exercise, put this code in `dna.lisp`:
```lisp
(in-package #:cl-user)
(defpackage #:dna
(:use #:common-lisp)
(:export #:hamming-distance))
(in-package #:dna)
(defun hamming-distance (dna1 dna2)
"Determine number of mutations between DNA strands by computing the Hamming Distance."
)
```
| Add instruction of default-directory for implementation. | Add instruction of default-directory for implementation.
| Markdown | mit | wobh/xlisp,exercism/xlisp,exercism/xlisp,wobh/xlisp,verdammelt/xlisp,verdammelt/xlisp | markdown | ## Code Before:
Load the test file into your running Lisp implementation, for example,
`(load "point-mutations-test")`. This will run the tests the first
time automatically. After that you can run the test suite in the REPL
with `(lisp-unit:run-tests :all :point-mutations-test)`.
## Making your first Common Lisp solution
To create lisp code that can be loaded with `(load "dna")`
for the first exercise, put this code in `dna.lisp`:
```lisp
(in-package #:cl-user)
(defpackage #:dna
(:use #:common-lisp)
(:export #:hamming-distance))
(in-package #:dna)
(defun hamming-distance (dna1 dna2)
"Determine number of mutations between DNA strands by computing the Hamming Distance."
)
```
## Instruction:
Add instruction of default-directory for implementation.
## Code After:
Start up your Lisp implementation in the directory of the exercise you
are working on (or change the current directory for an already running
Lisp implementation to that directory).
Load the test file into your running Lisp implementation, for example,
`(load "point-mutations-test")`. This will run the tests the first
time automatically. After that you can run the test suite in the REPL
with `(lisp-unit:run-tests :all :point-mutations-test)`.
## Making your first Common Lisp solution
To create lisp code that can be loaded with `(load "dna")`
for the first exercise, put this code in `dna.lisp`:
```lisp
(in-package #:cl-user)
(defpackage #:dna
(:use #:common-lisp)
(:export #:hamming-distance))
(in-package #:dna)
(defun hamming-distance (dna1 dna2)
"Determine number of mutations between DNA strands by computing the Hamming Distance."
)
```
| + Start up your Lisp implementation in the directory of the exercise you
+ are working on (or change the current directory for an already running
+ Lisp implementation to that directory).
+
Load the test file into your running Lisp implementation, for example,
`(load "point-mutations-test")`. This will run the tests the first
time automatically. After that you can run the test suite in the REPL
with `(lisp-unit:run-tests :all :point-mutations-test)`.
## Making your first Common Lisp solution
To create lisp code that can be loaded with `(load "dna")`
for the first exercise, put this code in `dna.lisp`:
```lisp
(in-package #:cl-user)
(defpackage #:dna
(:use #:common-lisp)
(:export #:hamming-distance))
(in-package #:dna)
(defun hamming-distance (dna1 dna2)
"Determine number of mutations between DNA strands by computing the Hamming Distance."
)
``` | 4 | 0.181818 | 4 | 0 |
d6554729fca87823c25ecc4d94267632f7569303 | index.js | index.js | module.exports = function fnStringify (fn) {
return /\*([^*]*)\*/.exec(fn.toString())[1].trim()
}
| module.exports = function fnStringify (fn) {
var comment = /\*([^*]*)\*/.exec(fn.toString())[1]
var indent = /([^\n]\s+)/.exec(comment)[1].length
return comment.split('\n').map(function (line) {
return line.slice(indent)
}).join('\n').trim()
}
| Fix example and basic test | Fix example and basic test
| JavaScript | mit | joshgillies/function-stringify | javascript | ## Code Before:
module.exports = function fnStringify (fn) {
return /\*([^*]*)\*/.exec(fn.toString())[1].trim()
}
## Instruction:
Fix example and basic test
## Code After:
module.exports = function fnStringify (fn) {
var comment = /\*([^*]*)\*/.exec(fn.toString())[1]
var indent = /([^\n]\s+)/.exec(comment)[1].length
return comment.split('\n').map(function (line) {
return line.slice(indent)
}).join('\n').trim()
}
| module.exports = function fnStringify (fn) {
- return /\*([^*]*)\*/.exec(fn.toString())[1].trim()
? ^^^ -------
+ var comment = /\*([^*]*)\*/.exec(fn.toString())[1]
? ++ +++++ + ^^
+ var indent = /([^\n]\s+)/.exec(comment)[1].length
+ return comment.split('\n').map(function (line) {
+ return line.slice(indent)
+ }).join('\n').trim()
} | 6 | 2 | 5 | 1 |
8325665b2e3afdd601b84cda3c9fef3d6f44d5bf | lib/puppet/type/repository_sync.rb | lib/puppet/type/repository_sync.rb |
Puppet::Type.newtype(:repository_sync) do
@doc = "Synchronizes an Artifactory repoisitory on the local file system."
ensurable
newparam(:repository, :namevar => true) do
desc "The artifactory repository we are looking to synchronize locally."
validate do |value|
raise ArgumentError, "Repository name must not be empty." if value.empty?
end
end
newparam(:artifactory_host) do
desc "The host of the artifactory server."
validate do |value|
raise ArgumentError, "Artifactory host name must not be empty." if value.empty?
end
end
newparam(:destination) do
desc "The file system destination for the repository synchronization."
munge do |value|
case value
when /^.*\/$/
value
else
value + '/'
end
end
validate do |value|
raise ArgumentError, "The destination of the repository synchronization must not be empty." if value.empty?
end
end
newparam(:user) do
desc "The user for Artifactory basic auth."
end
newparam(:password) do
desc "The user password for Artifactory basic auth."
end
end
| Puppet::Type.newtype(:repository_sync) do
@doc = "Synchronizes an Artifactory repoisitory on the local file system."
ensurable
# autorequire(:package) do
# 'rest-client'
# end
# Validate mandatory params
validate do
raise Puppet::Error, 'artifactory_host is required.' unless self[:artifactory_host]
raise Puppet::Error, 'destination is required.' unless self[:destination]
raise Pupper::Error, "expected catalog to contain Package['rest-client']" unless defined(Package['rest-client'])
end
# unless defined(Package['rest-client']) do
# fail("expected catalog to contain Package['rest-client']")
# end
newparam(:repository, :namevar => true) do
desc "The artifactory repository we are looking to synchronize locally."
validate do |value|
raise ArgumentError, "Repository name must not be empty." if value.empty?
end
end
newparam(:artifactory_host) do
desc "The host of the artifactory server."
validate do |value|
raise ArgumentError, "Artifactory host name must not be empty." if value.empty?
end
end
newparam(:destination) do
desc "The file system destination for the repository synchronization."
munge do |value|
case value
when /^.*\/$/
value
else
value + '/'
end
end
validate do |value|
raise ArgumentError, "The destination of the repository synchronization must not be empty." if value.empty?
end
end
newparam(:user) do
desc "The user for Artifactory basic auth."
end
newparam(:password) do
desc "The user password for Artifactory basic auth."
end
end
| Add validatio to repo sync | Add validatio to repo sync
| Ruby | apache-2.0 | autostructure/artifactory_utils | ruby | ## Code Before:
Puppet::Type.newtype(:repository_sync) do
@doc = "Synchronizes an Artifactory repoisitory on the local file system."
ensurable
newparam(:repository, :namevar => true) do
desc "The artifactory repository we are looking to synchronize locally."
validate do |value|
raise ArgumentError, "Repository name must not be empty." if value.empty?
end
end
newparam(:artifactory_host) do
desc "The host of the artifactory server."
validate do |value|
raise ArgumentError, "Artifactory host name must not be empty." if value.empty?
end
end
newparam(:destination) do
desc "The file system destination for the repository synchronization."
munge do |value|
case value
when /^.*\/$/
value
else
value + '/'
end
end
validate do |value|
raise ArgumentError, "The destination of the repository synchronization must not be empty." if value.empty?
end
end
newparam(:user) do
desc "The user for Artifactory basic auth."
end
newparam(:password) do
desc "The user password for Artifactory basic auth."
end
end
## Instruction:
Add validatio to repo sync
## Code After:
Puppet::Type.newtype(:repository_sync) do
@doc = "Synchronizes an Artifactory repoisitory on the local file system."
ensurable
# autorequire(:package) do
# 'rest-client'
# end
# Validate mandatory params
validate do
raise Puppet::Error, 'artifactory_host is required.' unless self[:artifactory_host]
raise Puppet::Error, 'destination is required.' unless self[:destination]
raise Pupper::Error, "expected catalog to contain Package['rest-client']" unless defined(Package['rest-client'])
end
# unless defined(Package['rest-client']) do
# fail("expected catalog to contain Package['rest-client']")
# end
newparam(:repository, :namevar => true) do
desc "The artifactory repository we are looking to synchronize locally."
validate do |value|
raise ArgumentError, "Repository name must not be empty." if value.empty?
end
end
newparam(:artifactory_host) do
desc "The host of the artifactory server."
validate do |value|
raise ArgumentError, "Artifactory host name must not be empty." if value.empty?
end
end
newparam(:destination) do
desc "The file system destination for the repository synchronization."
munge do |value|
case value
when /^.*\/$/
value
else
value + '/'
end
end
validate do |value|
raise ArgumentError, "The destination of the repository synchronization must not be empty." if value.empty?
end
end
newparam(:user) do
desc "The user for Artifactory basic auth."
end
newparam(:password) do
desc "The user password for Artifactory basic auth."
end
end
| -
Puppet::Type.newtype(:repository_sync) do
@doc = "Synchronizes an Artifactory repoisitory on the local file system."
ensurable
+
+ # autorequire(:package) do
+ # 'rest-client'
+ # end
+
+ # Validate mandatory params
+ validate do
+ raise Puppet::Error, 'artifactory_host is required.' unless self[:artifactory_host]
+ raise Puppet::Error, 'destination is required.' unless self[:destination]
+ raise Pupper::Error, "expected catalog to contain Package['rest-client']" unless defined(Package['rest-client'])
+ end
+
+ # unless defined(Package['rest-client']) do
+ # fail("expected catalog to contain Package['rest-client']")
+ # end
newparam(:repository, :namevar => true) do
desc "The artifactory repository we are looking to synchronize locally."
validate do |value|
raise ArgumentError, "Repository name must not be empty." if value.empty?
end
end
newparam(:artifactory_host) do
desc "The host of the artifactory server."
validate do |value|
raise ArgumentError, "Artifactory host name must not be empty." if value.empty?
end
end
newparam(:destination) do
desc "The file system destination for the repository synchronization."
munge do |value|
case value
when /^.*\/$/
value
else
value + '/'
end
end
validate do |value|
raise ArgumentError, "The destination of the repository synchronization must not be empty." if value.empty?
end
end
newparam(:user) do
desc "The user for Artifactory basic auth."
end
newparam(:password) do
desc "The user password for Artifactory basic auth."
end
end | 16 | 0.347826 | 15 | 1 |
e269be3b873cf810789bddb3000a39f526c7ac82 | lib/wrapper-end.js | lib/wrapper-end.js | }
// auto-load Promise polyfill if needed in the browser
var doPolyfill = typeof Promise === 'undefined';
// document.write
if (typeof document !== 'undefined') {
var scripts = document.getElementsByTagName('script');
$__curScript = scripts[scripts.length - 1];
if ($__curScript.defer || $__curScript.async)
$__curScript = document.currentScript;
if (doPolyfill) {
var curPath = $__curScript.src;
var basePath = curPath.substr(0, curPath.lastIndexOf('/') + 1);
window.systemJSBootstrap = bootstrap;
document.write(
'<' + 'script type="text/javascript" src="' + basePath + 'system-polyfills.js">' + '<' + '/script>'
);
}
else {
bootstrap();
}
}
// importScripts
else if (typeof importScripts !== 'undefined') {
var basePath = '';
try {
throw new Error('_');
} catch (e) {
e.stack.replace(/(?:at|@).*(http.+):[\d]+:[\d]+/, function(m, url) {
$__curScript = { src: url };
basePath = url.replace(/\/[^\/]*$/, '/');
});
}
if (doPolyfill)
importScripts(basePath + 'system-polyfills.js');
bootstrap();
}
else {
$__curScript = typeof __filename != 'undefined' ? { src: __filename } : null;
bootstrap();
}
})(); | }
// auto-load Promise polyfill if needed in the browser
var doPolyfill = typeof Promise === 'undefined';
// document.write
if (typeof document !== 'undefined') {
var scripts = document.getElementsByTagName('script');
$__curScript = scripts[scripts.length - 1];
if (document.currentScript && ($__curScript.defer || $__curScript.async))
$__curScript = document.currentScript;
if (doPolyfill) {
var curPath = $__curScript.src;
var basePath = curPath.substr(0, curPath.lastIndexOf('/') + 1);
window.systemJSBootstrap = bootstrap;
document.write(
'<' + 'script type="text/javascript" src="' + basePath + 'system-polyfills.js">' + '<' + '/script>'
);
}
else {
bootstrap();
}
}
// importScripts
else if (typeof importScripts !== 'undefined') {
var basePath = '';
try {
throw new Error('_');
} catch (e) {
e.stack.replace(/(?:at|@).*(http.+):[\d]+:[\d]+/, function(m, url) {
$__curScript = { src: url };
basePath = url.replace(/\/[^\/]*$/, '/');
});
}
if (doPolyfill)
importScripts(basePath + 'system-polyfills.js');
bootstrap();
}
else {
$__curScript = typeof __filename != 'undefined' ? { src: __filename } : null;
bootstrap();
}
})(); | Check for document.currentScript before assigning it | Check for document.currentScript before assigning it
IE>10 supports HTMLScriptElement.async but not document.currentScript.
| JavaScript | mit | systemjs/systemjs,systemjs/systemjs | javascript | ## Code Before:
}
// auto-load Promise polyfill if needed in the browser
var doPolyfill = typeof Promise === 'undefined';
// document.write
if (typeof document !== 'undefined') {
var scripts = document.getElementsByTagName('script');
$__curScript = scripts[scripts.length - 1];
if ($__curScript.defer || $__curScript.async)
$__curScript = document.currentScript;
if (doPolyfill) {
var curPath = $__curScript.src;
var basePath = curPath.substr(0, curPath.lastIndexOf('/') + 1);
window.systemJSBootstrap = bootstrap;
document.write(
'<' + 'script type="text/javascript" src="' + basePath + 'system-polyfills.js">' + '<' + '/script>'
);
}
else {
bootstrap();
}
}
// importScripts
else if (typeof importScripts !== 'undefined') {
var basePath = '';
try {
throw new Error('_');
} catch (e) {
e.stack.replace(/(?:at|@).*(http.+):[\d]+:[\d]+/, function(m, url) {
$__curScript = { src: url };
basePath = url.replace(/\/[^\/]*$/, '/');
});
}
if (doPolyfill)
importScripts(basePath + 'system-polyfills.js');
bootstrap();
}
else {
$__curScript = typeof __filename != 'undefined' ? { src: __filename } : null;
bootstrap();
}
})();
## Instruction:
Check for document.currentScript before assigning it
IE>10 supports HTMLScriptElement.async but not document.currentScript.
## Code After:
}
// auto-load Promise polyfill if needed in the browser
var doPolyfill = typeof Promise === 'undefined';
// document.write
if (typeof document !== 'undefined') {
var scripts = document.getElementsByTagName('script');
$__curScript = scripts[scripts.length - 1];
if (document.currentScript && ($__curScript.defer || $__curScript.async))
$__curScript = document.currentScript;
if (doPolyfill) {
var curPath = $__curScript.src;
var basePath = curPath.substr(0, curPath.lastIndexOf('/') + 1);
window.systemJSBootstrap = bootstrap;
document.write(
'<' + 'script type="text/javascript" src="' + basePath + 'system-polyfills.js">' + '<' + '/script>'
);
}
else {
bootstrap();
}
}
// importScripts
else if (typeof importScripts !== 'undefined') {
var basePath = '';
try {
throw new Error('_');
} catch (e) {
e.stack.replace(/(?:at|@).*(http.+):[\d]+:[\d]+/, function(m, url) {
$__curScript = { src: url };
basePath = url.replace(/\/[^\/]*$/, '/');
});
}
if (doPolyfill)
importScripts(basePath + 'system-polyfills.js');
bootstrap();
}
else {
$__curScript = typeof __filename != 'undefined' ? { src: __filename } : null;
bootstrap();
}
})(); | }
// auto-load Promise polyfill if needed in the browser
var doPolyfill = typeof Promise === 'undefined';
// document.write
if (typeof document !== 'undefined') {
var scripts = document.getElementsByTagName('script');
$__curScript = scripts[scripts.length - 1];
- if ($__curScript.defer || $__curScript.async)
+ if (document.currentScript && ($__curScript.defer || $__curScript.async))
? +++++++++++++++++++++++++++ +
$__curScript = document.currentScript;
if (doPolyfill) {
var curPath = $__curScript.src;
var basePath = curPath.substr(0, curPath.lastIndexOf('/') + 1);
window.systemJSBootstrap = bootstrap;
document.write(
'<' + 'script type="text/javascript" src="' + basePath + 'system-polyfills.js">' + '<' + '/script>'
);
}
else {
bootstrap();
}
}
// importScripts
else if (typeof importScripts !== 'undefined') {
var basePath = '';
try {
throw new Error('_');
} catch (e) {
e.stack.replace(/(?:at|@).*(http.+):[\d]+:[\d]+/, function(m, url) {
$__curScript = { src: url };
basePath = url.replace(/\/[^\/]*$/, '/');
});
}
if (doPolyfill)
importScripts(basePath + 'system-polyfills.js');
bootstrap();
}
else {
$__curScript = typeof __filename != 'undefined' ? { src: __filename } : null;
bootstrap();
}
})(); | 2 | 0.044444 | 1 | 1 |
c7b9dad1e635a60ce0d866c7de295a55df050001 | lib/range-finder.js | lib/range-finder.js | const {Range} = require('atom')
module.exports =
class RangeFinder {
// Public
static rangesFor (editor) {
return new RangeFinder(editor).ranges()
}
// Public
constructor (editor) {
this.editor = editor
}
// Public
ranges () {
const selectionRanges = this.selectionRanges()
if (selectionRanges.length === 0) {
return [this.sortableRangeFrom(this.sortableRangeForEntireBuffer())]
} else {
return selectionRanges.map((selectionRange) => {
return this.sortableRangeFrom(selectionRange)
})
}
}
// Internal
selectionRanges () {
return this.editor.getSelectedBufferRanges().filter((range) => !range.isEmpty())
}
// Internal
sortableRangeForEntireBuffer () {
return this.editor.getBuffer().getRange()
}
// Internal
sortableRangeFrom (selectionRange) {
const startRow = selectionRange.start.row
const startCol = 0
const endRow = this.endRowForSelectionRange(selectionRange)
const endCol = this.editor.lineTextForBufferRow(endRow).length
return new Range([startRow, startCol], [endRow, endCol])
}
// Internal
endRowForSelectionRange (selectionRange) {
const row = selectionRange.end.row
const column = selectionRange.end.column
if (column !== 0) {
return row
} else {
return Math.max(0, row - 1)
}
}
}
| const {Range} = require('atom')
module.exports =
class RangeFinder {
// Public
static rangesFor (editor) {
return new RangeFinder(editor).ranges()
}
// Public
constructor (editor) {
this.editor = editor
}
// Public
ranges () {
const selectionRanges = this.selectionRanges()
if (selectionRanges.length === 0) {
return [this.sortableRangeFrom(this.sortableRangeForEntireBuffer())]
} else {
return selectionRanges.map((selectionRange) => {
return this.sortableRangeFrom(selectionRange)
})
}
}
// Internal
selectionRanges () {
return this.editor.getSelectedBufferRanges().filter((range) => !range.isEmpty())
}
// Internal
sortableRangeForEntireBuffer () {
return this.editor.getBuffer().getRange()
}
// Internal
sortableRangeFrom (selectionRange) {
const startRow = selectionRange.start.row
const startCol = 0
const endRow = endRowForSelectionRange(selectionRange)
const endCol = this.editor.lineTextForBufferRow(endRow).length
return new Range([startRow, startCol], [endRow, endCol])
}
}
function endRowForSelectionRange (selectionRange) {
const row = selectionRange.end.row
const column = selectionRange.end.column
if (column !== 0) {
return row
} else {
return Math.max(0, row - 1)
}
}
| Move function outside of class | :art: Move function outside of class
Since the endRowForSelectionRange method doesn't use any of the class's
internal state, make it a function that lives outside the class.
| JavaScript | mit | atom/sort-lines,garethbjohnson/sort-css | javascript | ## Code Before:
const {Range} = require('atom')
module.exports =
class RangeFinder {
// Public
static rangesFor (editor) {
return new RangeFinder(editor).ranges()
}
// Public
constructor (editor) {
this.editor = editor
}
// Public
ranges () {
const selectionRanges = this.selectionRanges()
if (selectionRanges.length === 0) {
return [this.sortableRangeFrom(this.sortableRangeForEntireBuffer())]
} else {
return selectionRanges.map((selectionRange) => {
return this.sortableRangeFrom(selectionRange)
})
}
}
// Internal
selectionRanges () {
return this.editor.getSelectedBufferRanges().filter((range) => !range.isEmpty())
}
// Internal
sortableRangeForEntireBuffer () {
return this.editor.getBuffer().getRange()
}
// Internal
sortableRangeFrom (selectionRange) {
const startRow = selectionRange.start.row
const startCol = 0
const endRow = this.endRowForSelectionRange(selectionRange)
const endCol = this.editor.lineTextForBufferRow(endRow).length
return new Range([startRow, startCol], [endRow, endCol])
}
// Internal
endRowForSelectionRange (selectionRange) {
const row = selectionRange.end.row
const column = selectionRange.end.column
if (column !== 0) {
return row
} else {
return Math.max(0, row - 1)
}
}
}
## Instruction:
:art: Move function outside of class
Since the endRowForSelectionRange method doesn't use any of the class's
internal state, make it a function that lives outside the class.
## Code After:
const {Range} = require('atom')
module.exports =
class RangeFinder {
// Public
static rangesFor (editor) {
return new RangeFinder(editor).ranges()
}
// Public
constructor (editor) {
this.editor = editor
}
// Public
ranges () {
const selectionRanges = this.selectionRanges()
if (selectionRanges.length === 0) {
return [this.sortableRangeFrom(this.sortableRangeForEntireBuffer())]
} else {
return selectionRanges.map((selectionRange) => {
return this.sortableRangeFrom(selectionRange)
})
}
}
// Internal
selectionRanges () {
return this.editor.getSelectedBufferRanges().filter((range) => !range.isEmpty())
}
// Internal
sortableRangeForEntireBuffer () {
return this.editor.getBuffer().getRange()
}
// Internal
sortableRangeFrom (selectionRange) {
const startRow = selectionRange.start.row
const startCol = 0
const endRow = endRowForSelectionRange(selectionRange)
const endCol = this.editor.lineTextForBufferRow(endRow).length
return new Range([startRow, startCol], [endRow, endCol])
}
}
function endRowForSelectionRange (selectionRange) {
const row = selectionRange.end.row
const column = selectionRange.end.column
if (column !== 0) {
return row
} else {
return Math.max(0, row - 1)
}
}
| const {Range} = require('atom')
module.exports =
class RangeFinder {
// Public
static rangesFor (editor) {
return new RangeFinder(editor).ranges()
}
// Public
constructor (editor) {
this.editor = editor
}
// Public
ranges () {
const selectionRanges = this.selectionRanges()
if (selectionRanges.length === 0) {
return [this.sortableRangeFrom(this.sortableRangeForEntireBuffer())]
} else {
return selectionRanges.map((selectionRange) => {
return this.sortableRangeFrom(selectionRange)
})
}
}
// Internal
selectionRanges () {
return this.editor.getSelectedBufferRanges().filter((range) => !range.isEmpty())
}
// Internal
sortableRangeForEntireBuffer () {
return this.editor.getBuffer().getRange()
}
// Internal
sortableRangeFrom (selectionRange) {
const startRow = selectionRange.start.row
const startCol = 0
- const endRow = this.endRowForSelectionRange(selectionRange)
? -----
+ const endRow = endRowForSelectionRange(selectionRange)
const endCol = this.editor.lineTextForBufferRow(endRow).length
return new Range([startRow, startCol], [endRow, endCol])
}
+ }
- // Internal
- endRowForSelectionRange (selectionRange) {
? ^
+ function endRowForSelectionRange (selectionRange) {
? ^^^^^^^^
- const row = selectionRange.end.row
? --
+ const row = selectionRange.end.row
- const column = selectionRange.end.column
? --
+ const column = selectionRange.end.column
- if (column !== 0) {
? --
+ if (column !== 0) {
- return row
? --
+ return row
- } else {
? --
+ } else {
- return Math.max(0, row - 1)
? --
+ return Math.max(0, row - 1)
- }
}
} | 19 | 0.327586 | 9 | 10 |
4bbcce6d97caab47fc23d6f2a62bf10b9d3dd419 | lib/pah/files/spec/support/factory_girl.rb | lib/pah/files/spec/support/factory_girl.rb | RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.start
FactoryGirl.lint
DatabaseCleaner.clean
end
end | RSpec.configure do |config|
config.before(:suite) do
begin
DatabaseCleaner.start
FactoryGirl.lint
ensure
DatabaseCleaner.clean
end
end
end
| Add FactoryGirl.lint config as recommended | Add FactoryGirl.lint config as recommended
| Ruby | mit | Helabs/pah,ffscalco/pah,Helabs/pah,ffscalco/pah | ruby | ## Code Before:
RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.start
FactoryGirl.lint
DatabaseCleaner.clean
end
end
## Instruction:
Add FactoryGirl.lint config as recommended
## Code After:
RSpec.configure do |config|
config.before(:suite) do
begin
DatabaseCleaner.start
FactoryGirl.lint
ensure
DatabaseCleaner.clean
end
end
end
| RSpec.configure do |config|
config.before(:suite) do
+ begin
- DatabaseCleaner.start
+ DatabaseCleaner.start
? ++
- FactoryGirl.lint
+ FactoryGirl.lint
? ++
+ ensure
- DatabaseCleaner.clean
+ DatabaseCleaner.clean
? ++
+ end
end
end | 9 | 1.285714 | 6 | 3 |
b6b70eeb85cb0ed9729d13e2fb52aa2dcb9c3d87 | lib/cli.js | lib/cli.js | var Clairvoyance = require('./clairvoyance');
module.exports = new CLI();
function CLI() {}
CLI.prototype.start = function(options) {
this.parser = new Clairvoyance(options);
this.parser.run(function(result) {
console.log(result);
});
}
| var Clairvoyance = require('./clairvoyance'),
fs = require('fs');
module.exports = new CLI();
function CLI() {}
CLI.prototype.start = function(options) {
this.parser = new Clairvoyance(options);
this.parser.run(function(result) {
fs.mkdir('coverage', function(err) {
var data = JSON.stringify(result);
fs.writeFile('coverage/css-coverage.json', data);
});
});
}
| Use a json file instead of console | Use a json file instead of console
| JavaScript | mit | sinsoku/clairvoyance,sinsoku/clairvoyance | javascript | ## Code Before:
var Clairvoyance = require('./clairvoyance');
module.exports = new CLI();
function CLI() {}
CLI.prototype.start = function(options) {
this.parser = new Clairvoyance(options);
this.parser.run(function(result) {
console.log(result);
});
}
## Instruction:
Use a json file instead of console
## Code After:
var Clairvoyance = require('./clairvoyance'),
fs = require('fs');
module.exports = new CLI();
function CLI() {}
CLI.prototype.start = function(options) {
this.parser = new Clairvoyance(options);
this.parser.run(function(result) {
fs.mkdir('coverage', function(err) {
var data = JSON.stringify(result);
fs.writeFile('coverage/css-coverage.json', data);
});
});
}
| - var Clairvoyance = require('./clairvoyance');
? ^
+ var Clairvoyance = require('./clairvoyance'),
? ^
+ fs = require('fs');
module.exports = new CLI();
function CLI() {}
CLI.prototype.start = function(options) {
this.parser = new Clairvoyance(options);
this.parser.run(function(result) {
- console.log(result);
+ fs.mkdir('coverage', function(err) {
+ var data = JSON.stringify(result);
+ fs.writeFile('coverage/css-coverage.json', data);
+ });
});
} | 8 | 0.666667 | 6 | 2 |
cb228b210e6f94701e85463fcab5c42861f34a54 | inventory/group_vars/all/vars.yml | inventory/group_vars/all/vars.yml | project: "catalyst-ansible"
version: "0.2.0"
login_user: "deploy"
# ssh vars
ssh_port: 22
# uncomment after first run (if not 22):
# ansible_ssh_port: "{{ ssh_port }}"
mode: "dev" # dev || deploy
app_repo: "git@github.com:jhu-sheridan-libraries/blacklight-rails.git" #"https://github.com/jhu-sheridan-libraries/blacklight-rails"
app_branch: "master"
app_name: "catalyst"
app_user: "{{ login_user }}" #"{{ app_name }}"
app_group: "{{ app_user }}"
base_deploy_dir: "/opt"
deploy_dir: "{{ base_deploy_dir }}/{{ app_name }}"
# deploy keys vars
deploy_private_key: "{{ vault_deploy_private_key }}"
deploy_public_key: "{{ vault_deploy_public_key }}"
deploy_user: "{{ login_user }}"
deploy_key_name: "catalyst_deploy_key"
deploy_key_full_path: "/home/{{ deploy_user }}/.ssh/{{ deploy_key_name }}"
# rails vars
rails_env: "development"
| project: "catalyst-ansible"
version: "0.3.0"
login_user: "deploy"
# ssh vars
ssh_port: 22
# uncomment after first run (if not 22):
# ansible_ssh_port: "{{ ssh_port }}"
mode: "dev" # dev || deploy
app_repo: "git@github.com:jhu-sheridan-libraries/blacklight-rails.git" #"https://github.com/jhu-sheridan-libraries/blacklight-rails"
app_branch: "ansibilize"
app_name: "catalyst"
app_user: "{{ login_user }}" #"{{ app_name }}"
app_group: "{{ app_user }}"
base_deploy_dir: "/opt"
deploy_dir: "{{ base_deploy_dir }}/{{ app_name }}"
# deploy keys vars
deploy_private_key: "{{ vault_deploy_private_key }}"
deploy_public_key: "{{ vault_deploy_public_key }}"
deploy_user: "{{ login_user }}"
deploy_key_name: "catalyst_deploy_key"
deploy_key_full_path: "/home/{{ deploy_user }}/.ssh/{{ deploy_key_name }}"
# rails vars
rails_env: "development"
| Use ansibilize branch of catalyst repo | Use ansibilize branch of catalyst repo
| YAML | cc0-1.0 | jiaola/catalyst-ansible,dheles/catalyst-ansible | yaml | ## Code Before:
project: "catalyst-ansible"
version: "0.2.0"
login_user: "deploy"
# ssh vars
ssh_port: 22
# uncomment after first run (if not 22):
# ansible_ssh_port: "{{ ssh_port }}"
mode: "dev" # dev || deploy
app_repo: "git@github.com:jhu-sheridan-libraries/blacklight-rails.git" #"https://github.com/jhu-sheridan-libraries/blacklight-rails"
app_branch: "master"
app_name: "catalyst"
app_user: "{{ login_user }}" #"{{ app_name }}"
app_group: "{{ app_user }}"
base_deploy_dir: "/opt"
deploy_dir: "{{ base_deploy_dir }}/{{ app_name }}"
# deploy keys vars
deploy_private_key: "{{ vault_deploy_private_key }}"
deploy_public_key: "{{ vault_deploy_public_key }}"
deploy_user: "{{ login_user }}"
deploy_key_name: "catalyst_deploy_key"
deploy_key_full_path: "/home/{{ deploy_user }}/.ssh/{{ deploy_key_name }}"
# rails vars
rails_env: "development"
## Instruction:
Use ansibilize branch of catalyst repo
## Code After:
project: "catalyst-ansible"
version: "0.3.0"
login_user: "deploy"
# ssh vars
ssh_port: 22
# uncomment after first run (if not 22):
# ansible_ssh_port: "{{ ssh_port }}"
mode: "dev" # dev || deploy
app_repo: "git@github.com:jhu-sheridan-libraries/blacklight-rails.git" #"https://github.com/jhu-sheridan-libraries/blacklight-rails"
app_branch: "ansibilize"
app_name: "catalyst"
app_user: "{{ login_user }}" #"{{ app_name }}"
app_group: "{{ app_user }}"
base_deploy_dir: "/opt"
deploy_dir: "{{ base_deploy_dir }}/{{ app_name }}"
# deploy keys vars
deploy_private_key: "{{ vault_deploy_private_key }}"
deploy_public_key: "{{ vault_deploy_public_key }}"
deploy_user: "{{ login_user }}"
deploy_key_name: "catalyst_deploy_key"
deploy_key_full_path: "/home/{{ deploy_user }}/.ssh/{{ deploy_key_name }}"
# rails vars
rails_env: "development"
| - project: "catalyst-ansible"
+ project: "catalyst-ansible"
? ++++++++++++
- version: "0.2.0"
? ^
+ version: "0.3.0"
? ++++++++++++ ^
- login_user: "deploy"
+ login_user: "deploy"
? ++++++++++++
# ssh vars
ssh_port: 22
# uncomment after first run (if not 22):
# ansible_ssh_port: "{{ ssh_port }}"
- mode: "dev" # dev || deploy
+ mode: "dev" # dev || deploy
? ++++++++++++
- app_repo: "git@github.com:jhu-sheridan-libraries/blacklight-rails.git" #"https://github.com/jhu-sheridan-libraries/blacklight-rails"
+ app_repo: "git@github.com:jhu-sheridan-libraries/blacklight-rails.git" #"https://github.com/jhu-sheridan-libraries/blacklight-rails"
? ++++++++++++
- app_branch: "master"
+ app_branch: "ansibilize"
- app_name: "catalyst"
+ app_name: "catalyst"
? ++++++++++++
- app_user: "{{ login_user }}" #"{{ app_name }}"
+ app_user: "{{ login_user }}" #"{{ app_name }}"
? ++++++++++++
- app_group: "{{ app_user }}"
+ app_group: "{{ app_user }}"
? ++++++++++++
- base_deploy_dir: "/opt"
+ base_deploy_dir: "/opt"
? ++++++++++++
- deploy_dir: "{{ base_deploy_dir }}/{{ app_name }}"
+ deploy_dir: "{{ base_deploy_dir }}/{{ app_name }}"
? ++++++++++++
# deploy keys vars
deploy_private_key: "{{ vault_deploy_private_key }}"
deploy_public_key: "{{ vault_deploy_public_key }}"
deploy_user: "{{ login_user }}"
deploy_key_name: "catalyst_deploy_key"
deploy_key_full_path: "/home/{{ deploy_user }}/.ssh/{{ deploy_key_name }}"
# rails vars
rails_env: "development" | 22 | 0.785714 | 11 | 11 |
cc9bfdb3185c2fbb6c7d0f6f2cb8b36f8e5024ed | setup.py | setup.py |
from setuptools import setup, find_packages
# Match releases to redis-py versions
__version__ = '2.7.2'
# Jenkins will replace __build__ with a unique value.
__build__ = ''
setup(name='mockredis',
version=__version__ + __build__,
description='Mock for redis-py',
url='http://www.github.com/locationlabs/mockredis',
license='Apache2',
packages=find_packages(exclude=['*.tests']),
setup_requires=[
'nose==1.2.1'
],
install_requires=[
'bintrees==1.0.1'
],
tests_require=[
'redis>=2.7.2'
],
test_suite='mockredis.tests',
)
|
from setuptools import setup, find_packages
# Match releases to redis-py versions
__version__ = '2.7.2'
# Jenkins will replace __build__ with a unique value.
__build__ = ''
setup(name='mockredis',
version=__version__ + __build__,
description='Mock for redis-py',
url='http://www.github.com/locationlabs/mockredis',
license='Apache2',
packages=find_packages(exclude=['*.tests']),
setup_requires=[
'nose==1.2.1'
],
install_requires=[
],
tests_require=[
'redis>=2.7.2'
],
test_suite='mockredis.tests',
)
| Revert use of bintrees; it's not a great fit. | Revert use of bintrees; it's not a great fit.
| Python | apache-2.0 | yossigo/mockredis,matejkloska/mockredis,path/mockredis,locationlabs/mockredis,optimizely/mockredis | python | ## Code Before:
from setuptools import setup, find_packages
# Match releases to redis-py versions
__version__ = '2.7.2'
# Jenkins will replace __build__ with a unique value.
__build__ = ''
setup(name='mockredis',
version=__version__ + __build__,
description='Mock for redis-py',
url='http://www.github.com/locationlabs/mockredis',
license='Apache2',
packages=find_packages(exclude=['*.tests']),
setup_requires=[
'nose==1.2.1'
],
install_requires=[
'bintrees==1.0.1'
],
tests_require=[
'redis>=2.7.2'
],
test_suite='mockredis.tests',
)
## Instruction:
Revert use of bintrees; it's not a great fit.
## Code After:
from setuptools import setup, find_packages
# Match releases to redis-py versions
__version__ = '2.7.2'
# Jenkins will replace __build__ with a unique value.
__build__ = ''
setup(name='mockredis',
version=__version__ + __build__,
description='Mock for redis-py',
url='http://www.github.com/locationlabs/mockredis',
license='Apache2',
packages=find_packages(exclude=['*.tests']),
setup_requires=[
'nose==1.2.1'
],
install_requires=[
],
tests_require=[
'redis>=2.7.2'
],
test_suite='mockredis.tests',
)
|
from setuptools import setup, find_packages
# Match releases to redis-py versions
__version__ = '2.7.2'
# Jenkins will replace __build__ with a unique value.
__build__ = ''
setup(name='mockredis',
version=__version__ + __build__,
description='Mock for redis-py',
url='http://www.github.com/locationlabs/mockredis',
license='Apache2',
packages=find_packages(exclude=['*.tests']),
setup_requires=[
'nose==1.2.1'
],
install_requires=[
- 'bintrees==1.0.1'
],
tests_require=[
'redis>=2.7.2'
],
test_suite='mockredis.tests',
) | 1 | 0.038462 | 0 | 1 |
02cfb614a15bff66fd76091f659312276131bf1c | stack.yaml | stack.yaml | resolver: lts-5.13
packages:
- '.'
- location:
git: git@github.com:RyanGlScott/bindings-dsl
commit: e918a9eea5b153c78f4a95c30262fdf917603d2c
extra-dep: true
- location:
git: git@github.com:iu-parfunc/bindings-hpx
commit: 15cfbd634de6c4f8f026ef26af47c9ca47f834ee
extra-dep: true
extra-deps:
- bindings-dsl-1.0.23
- bindings-hpx-0.1
- bindings-libffi-0.3
# [2015.09.19] Disabling for now and just running stack *inside* the
# docker image. That way is safer currently.
# docker:
# enable: true
# # repo: "fpco/stack-build"
# repo: "haskell-hpx:1.0"
# auto-pull: true
| resolver: lts-5.13
packages:
- '.'
- location:
git: git@github.com:RyanGlScott/bindings-dsl
commit: e918a9eea5b153c78f4a95c30262fdf917603d2c
extra-dep: true
- location:
git: git@github.com:iu-parfunc/bindings-hpx
commit: 8a40caee411867101c90802fe4bd1166043a8712
extra-dep: true
extra-deps:
- bindings-dsl-1.0.23
- bindings-hpx-0.1
- bindings-libffi-0.3
# [2015.09.19] Disabling for now and just running stack *inside* the
# docker image. That way is safer currently.
# docker:
# enable: true
# # repo: "fpco/stack-build"
# repo: "haskell-hpx:1.0"
# auto-pull: true
| Bump git commit for bindings-hpx | Bump git commit for bindings-hpx
| YAML | bsd-3-clause | iu-parfunc/haskell-hpx,iu-parfunc/haskell-hpx | yaml | ## Code Before:
resolver: lts-5.13
packages:
- '.'
- location:
git: git@github.com:RyanGlScott/bindings-dsl
commit: e918a9eea5b153c78f4a95c30262fdf917603d2c
extra-dep: true
- location:
git: git@github.com:iu-parfunc/bindings-hpx
commit: 15cfbd634de6c4f8f026ef26af47c9ca47f834ee
extra-dep: true
extra-deps:
- bindings-dsl-1.0.23
- bindings-hpx-0.1
- bindings-libffi-0.3
# [2015.09.19] Disabling for now and just running stack *inside* the
# docker image. That way is safer currently.
# docker:
# enable: true
# # repo: "fpco/stack-build"
# repo: "haskell-hpx:1.0"
# auto-pull: true
## Instruction:
Bump git commit for bindings-hpx
## Code After:
resolver: lts-5.13
packages:
- '.'
- location:
git: git@github.com:RyanGlScott/bindings-dsl
commit: e918a9eea5b153c78f4a95c30262fdf917603d2c
extra-dep: true
- location:
git: git@github.com:iu-parfunc/bindings-hpx
commit: 8a40caee411867101c90802fe4bd1166043a8712
extra-dep: true
extra-deps:
- bindings-dsl-1.0.23
- bindings-hpx-0.1
- bindings-libffi-0.3
# [2015.09.19] Disabling for now and just running stack *inside* the
# docker image. That way is safer currently.
# docker:
# enable: true
# # repo: "fpco/stack-build"
# repo: "haskell-hpx:1.0"
# auto-pull: true
| resolver: lts-5.13
packages:
- '.'
- location:
git: git@github.com:RyanGlScott/bindings-dsl
commit: e918a9eea5b153c78f4a95c30262fdf917603d2c
extra-dep: true
- location:
git: git@github.com:iu-parfunc/bindings-hpx
- commit: 15cfbd634de6c4f8f026ef26af47c9ca47f834ee
+ commit: 8a40caee411867101c90802fe4bd1166043a8712
extra-dep: true
extra-deps:
- bindings-dsl-1.0.23
- bindings-hpx-0.1
- bindings-libffi-0.3
# [2015.09.19] Disabling for now and just running stack *inside* the
# docker image. That way is safer currently.
# docker:
# enable: true
# # repo: "fpco/stack-build"
# repo: "haskell-hpx:1.0"
# auto-pull: true | 2 | 0.076923 | 1 | 1 |
8f615db65992dff21069df908e7a50a0632b92d5 | examples/cordova/app.js | examples/cordova/app.js | const {Button, Page, NavigationView, ScrollView, ui} = require('tabris');
const ToastPage = require('./ToastPage');
const SharingPage = require('./SharingPage');
const MotionPage = require('./MotionPage');
const NetworkPage = require('./NetworkPage');
const MediaPage = require('./MediaPage');
const CameraPage = require('./CameraPage');
const ActionSheetPage = require('./ActionSheetPage');
const BarcodeScannerPage = require('./BarcodeScannerPage');
let navigationView = new NavigationView({left: 0, top: 0, right: 0, bottom: 0})
.appendTo(ui.contentView);
let mainPage = new Page({
title: 'Cordova Examples'
}).appendTo(navigationView);
let contentContainer = new ScrollView({
left: 0, top: 0, right: 0, bottom: 0
}).appendTo(mainPage);
[
SharingPage,
ToastPage,
MotionPage,
NetworkPage,
CameraPage,
BarcodeScannerPage,
MediaPage,
ActionSheetPage
].forEach(Page => {
let page = new Page();
addPageSelector(page);
});
function addPageSelector(page) {
new Button({
left: 16, top: 'prev() 8', right: 16,
text: page.title
}).on('select', () => page.appendTo(navigationView))
.appendTo(contentContainer);
}
| const {Button, Page, NavigationView, ScrollView, device, ui} = require('tabris');
const ToastPage = require('./ToastPage');
const SharingPage = require('./SharingPage');
const MotionPage = require('./MotionPage');
const NetworkPage = require('./NetworkPage');
const MediaPage = require('./MediaPage');
const CameraPage = require('./CameraPage');
const ActionSheetPage = require('./ActionSheetPage');
const BarcodeScannerPage = require('./BarcodeScannerPage');
let navigationView = new NavigationView({left: 0, top: 0, right: 0, bottom: 0})
.appendTo(ui.contentView);
let mainPage = new Page({
title: 'Cordova Examples'
}).appendTo(navigationView);
let contentContainer = new ScrollView({
left: 0, top: 0, right: 0, bottom: 0
}).appendTo(mainPage);
(
device.platform === 'windows' ? [
MotionPage,
NetworkPage
] : [
SharingPage,
ToastPage,
MotionPage,
NetworkPage,
CameraPage,
BarcodeScannerPage,
MediaPage,
ActionSheetPage
]
).forEach(Page => {
let page = new Page();
addPageSelector(page);
});
function addPageSelector(page) {
new Button({
left: 16, top: 'prev() 8', right: 16,
text: page.title
}).on('select', () => page.appendTo(navigationView))
.appendTo(contentContainer);
}
| Reduce cordova demo on windows | Reduce cordova demo on windows
It can later be investigated how to improve windows support for cordova
plug-ins, but for now include only the two that acually work.
Change-Id: I1839ab1604d8191d5ed67e76d7e2f3398a1d8bbb
| JavaScript | bsd-3-clause | eclipsesource/tabris-js,eclipsesource/tabris-js,eclipsesource/tabris-js | javascript | ## Code Before:
const {Button, Page, NavigationView, ScrollView, ui} = require('tabris');
const ToastPage = require('./ToastPage');
const SharingPage = require('./SharingPage');
const MotionPage = require('./MotionPage');
const NetworkPage = require('./NetworkPage');
const MediaPage = require('./MediaPage');
const CameraPage = require('./CameraPage');
const ActionSheetPage = require('./ActionSheetPage');
const BarcodeScannerPage = require('./BarcodeScannerPage');
let navigationView = new NavigationView({left: 0, top: 0, right: 0, bottom: 0})
.appendTo(ui.contentView);
let mainPage = new Page({
title: 'Cordova Examples'
}).appendTo(navigationView);
let contentContainer = new ScrollView({
left: 0, top: 0, right: 0, bottom: 0
}).appendTo(mainPage);
[
SharingPage,
ToastPage,
MotionPage,
NetworkPage,
CameraPage,
BarcodeScannerPage,
MediaPage,
ActionSheetPage
].forEach(Page => {
let page = new Page();
addPageSelector(page);
});
function addPageSelector(page) {
new Button({
left: 16, top: 'prev() 8', right: 16,
text: page.title
}).on('select', () => page.appendTo(navigationView))
.appendTo(contentContainer);
}
## Instruction:
Reduce cordova demo on windows
It can later be investigated how to improve windows support for cordova
plug-ins, but for now include only the two that acually work.
Change-Id: I1839ab1604d8191d5ed67e76d7e2f3398a1d8bbb
## Code After:
const {Button, Page, NavigationView, ScrollView, device, ui} = require('tabris');
const ToastPage = require('./ToastPage');
const SharingPage = require('./SharingPage');
const MotionPage = require('./MotionPage');
const NetworkPage = require('./NetworkPage');
const MediaPage = require('./MediaPage');
const CameraPage = require('./CameraPage');
const ActionSheetPage = require('./ActionSheetPage');
const BarcodeScannerPage = require('./BarcodeScannerPage');
let navigationView = new NavigationView({left: 0, top: 0, right: 0, bottom: 0})
.appendTo(ui.contentView);
let mainPage = new Page({
title: 'Cordova Examples'
}).appendTo(navigationView);
let contentContainer = new ScrollView({
left: 0, top: 0, right: 0, bottom: 0
}).appendTo(mainPage);
(
device.platform === 'windows' ? [
MotionPage,
NetworkPage
] : [
SharingPage,
ToastPage,
MotionPage,
NetworkPage,
CameraPage,
BarcodeScannerPage,
MediaPage,
ActionSheetPage
]
).forEach(Page => {
let page = new Page();
addPageSelector(page);
});
function addPageSelector(page) {
new Button({
left: 16, top: 'prev() 8', right: 16,
text: page.title
}).on('select', () => page.appendTo(navigationView))
.appendTo(contentContainer);
}
| - const {Button, Page, NavigationView, ScrollView, ui} = require('tabris');
+ const {Button, Page, NavigationView, ScrollView, device, ui} = require('tabris');
? ++++++++
const ToastPage = require('./ToastPage');
const SharingPage = require('./SharingPage');
const MotionPage = require('./MotionPage');
const NetworkPage = require('./NetworkPage');
const MediaPage = require('./MediaPage');
const CameraPage = require('./CameraPage');
const ActionSheetPage = require('./ActionSheetPage');
const BarcodeScannerPage = require('./BarcodeScannerPage');
let navigationView = new NavigationView({left: 0, top: 0, right: 0, bottom: 0})
.appendTo(ui.contentView);
let mainPage = new Page({
title: 'Cordova Examples'
}).appendTo(navigationView);
let contentContainer = new ScrollView({
left: 0, top: 0, right: 0, bottom: 0
}).appendTo(mainPage);
- [
+ (
+ device.platform === 'windows' ? [
+ MotionPage,
+ NetworkPage
+ ] : [
- SharingPage,
+ SharingPage,
? ++
- ToastPage,
+ ToastPage,
? ++
- MotionPage,
+ MotionPage,
? ++
- NetworkPage,
+ NetworkPage,
? ++
- CameraPage,
+ CameraPage,
? ++
- BarcodeScannerPage,
+ BarcodeScannerPage,
? ++
- MediaPage,
+ MediaPage,
? ++
- ActionSheetPage
+ ActionSheetPage
? ++
+ ]
- ].forEach(Page => {
? ^
+ ).forEach(Page => {
? ^
let page = new Page();
addPageSelector(page);
});
function addPageSelector(page) {
new Button({
left: 16, top: 'prev() 8', right: 16,
text: page.title
}).on('select', () => page.appendTo(navigationView))
.appendTo(contentContainer);
} | 27 | 0.642857 | 16 | 11 |
e299c410fc619175764cfb0c42b72471317c4674 | lib/fog/aws/requests/storage/get_service.rb | lib/fog/aws/requests/storage/get_service.rb | module Fog
module AWS
class Storage
class Real
require 'fog/aws/parsers/storage/get_service'
# List information about S3 buckets for authorized user
#
# @return [Excon::Response] response:
# * body [Hash]:
# * Buckets [Hash]:
# * Name [String] - Name of bucket
# * CreationTime [Time] - Timestamp of bucket creation
# * Owner [Hash]:
# * DisplayName [String] - Display name of bucket owner
# * ID [String] - Id of bucket owner
#
# @see http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTServiceGET.html
#
def get_service
request({
:expects => 200,
:headers => {},
:host => @host,
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::AWS::Storage::GetService.new
})
end
end
class Mock # :nodoc:all
def get_service
response = Excon::Response.new
response.headers['Status'] = 200
buckets = self.data[:buckets].values.map do |bucket|
bucket.reject do |key, value|
!['CreationDate', 'Name'].include?(key)
end
end
response.body = {
'Buckets' => buckets,
'Owner' => { 'DisplayName' => 'owner', 'ID' => 'some_id'}
}
response
end
end
end
end
end
| module Fog
module AWS
class Storage
class Real
require 'fog/aws/parsers/storage/get_service'
# List information about S3 buckets for authorized user
#
# @return [Excon::Response] response:
# * body [Hash]:
# * Buckets [Hash]:
# * Name [String] - Name of bucket
# * CreationTime [Time] - Timestamp of bucket creation
# * Owner [Hash]:
# * DisplayName [String] - Display name of bucket owner
# * ID [String] - Id of bucket owner
#
# @see https://docs.aws.amazon.com/AmazonS3/latest/API/RESTServiceGET.html
#
def get_service
request({
:expects => 200,
:headers => {},
:host => 's3.amazonaws.com',
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::AWS::Storage::GetService.new
})
end
end
class Mock # :nodoc:all
def get_service
response = Excon::Response.new
response.headers['Status'] = 200
buckets = self.data[:buckets].values.map do |bucket|
bucket.reject do |key, value|
!['CreationDate', 'Name'].include?(key)
end
end
response.body = {
'Buckets' => buckets,
'Owner' => { 'DisplayName' => 'owner', 'ID' => 'some_id'}
}
response
end
end
end
end
end
| Set correct host for get service operation | Set correct host for get service operation
| Ruby | mit | fog/fog-aws,fog/fog-aws,fog/fog-aws | ruby | ## Code Before:
module Fog
module AWS
class Storage
class Real
require 'fog/aws/parsers/storage/get_service'
# List information about S3 buckets for authorized user
#
# @return [Excon::Response] response:
# * body [Hash]:
# * Buckets [Hash]:
# * Name [String] - Name of bucket
# * CreationTime [Time] - Timestamp of bucket creation
# * Owner [Hash]:
# * DisplayName [String] - Display name of bucket owner
# * ID [String] - Id of bucket owner
#
# @see http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTServiceGET.html
#
def get_service
request({
:expects => 200,
:headers => {},
:host => @host,
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::AWS::Storage::GetService.new
})
end
end
class Mock # :nodoc:all
def get_service
response = Excon::Response.new
response.headers['Status'] = 200
buckets = self.data[:buckets].values.map do |bucket|
bucket.reject do |key, value|
!['CreationDate', 'Name'].include?(key)
end
end
response.body = {
'Buckets' => buckets,
'Owner' => { 'DisplayName' => 'owner', 'ID' => 'some_id'}
}
response
end
end
end
end
end
## Instruction:
Set correct host for get service operation
## Code After:
module Fog
module AWS
class Storage
class Real
require 'fog/aws/parsers/storage/get_service'
# List information about S3 buckets for authorized user
#
# @return [Excon::Response] response:
# * body [Hash]:
# * Buckets [Hash]:
# * Name [String] - Name of bucket
# * CreationTime [Time] - Timestamp of bucket creation
# * Owner [Hash]:
# * DisplayName [String] - Display name of bucket owner
# * ID [String] - Id of bucket owner
#
# @see https://docs.aws.amazon.com/AmazonS3/latest/API/RESTServiceGET.html
#
def get_service
request({
:expects => 200,
:headers => {},
:host => 's3.amazonaws.com',
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::AWS::Storage::GetService.new
})
end
end
class Mock # :nodoc:all
def get_service
response = Excon::Response.new
response.headers['Status'] = 200
buckets = self.data[:buckets].values.map do |bucket|
bucket.reject do |key, value|
!['CreationDate', 'Name'].include?(key)
end
end
response.body = {
'Buckets' => buckets,
'Owner' => { 'DisplayName' => 'owner', 'ID' => 'some_id'}
}
response
end
end
end
end
end
| module Fog
module AWS
class Storage
class Real
require 'fog/aws/parsers/storage/get_service'
# List information about S3 buckets for authorized user
#
# @return [Excon::Response] response:
# * body [Hash]:
# * Buckets [Hash]:
# * Name [String] - Name of bucket
# * CreationTime [Time] - Timestamp of bucket creation
# * Owner [Hash]:
# * DisplayName [String] - Display name of bucket owner
# * ID [String] - Id of bucket owner
#
- # @see http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTServiceGET.html
? -----------
+ # @see https://docs.aws.amazon.com/AmazonS3/latest/API/RESTServiceGET.html
? + ++++
#
def get_service
request({
:expects => 200,
:headers => {},
- :host => @host,
+ :host => 's3.amazonaws.com',
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::AWS::Storage::GetService.new
})
end
end
class Mock # :nodoc:all
def get_service
response = Excon::Response.new
response.headers['Status'] = 200
buckets = self.data[:buckets].values.map do |bucket|
bucket.reject do |key, value|
!['CreationDate', 'Name'].include?(key)
end
end
response.body = {
'Buckets' => buckets,
'Owner' => { 'DisplayName' => 'owner', 'ID' => 'some_id'}
}
response
end
end
end
end
end | 4 | 0.08 | 2 | 2 |
8d2611cc898dfaaa560c07c32328e2a466027c74 | gulpfile.js | gulpfile.js | 'use strict';
var gulp = require('gulp');
var to5 = require('gulp-6to5');
var watch = require('gulp-watch');
var deploy = require('gulp-gh-pages');
var jshint = require('gulp-jshint');
var options = {
cacheDir: './tmp'
};
gulp.task('deploy', ['js:lint', 'js:compile'], function () {
return gulp.src(['./**/*', '!./node_modules/**'])
.pipe(deploy(options));
});
gulp.task('js:compile', function() {
return gulp.src('src/**/*.js')
.pipe(to5())
.pipe(gulp.dest('dist'));
});
gulp.task('js:lint', function() {
return gulp.src('./src/**/*.js')
.pipe(jshint({ esnext: true }))
.pipe(jshint.reporter('default'));
});
gulp.task('default', function () {
watch('./src/**/*.js', function () {
gulp.start('js:lint');
gulp.start('js:compile');
});
});
| 'use strict';
var gulp = require('gulp');
var to5 = require('gulp-6to5');
var watch = require('gulp-watch');
var deploy = require('gulp-gh-pages');
var jshint = require('gulp-jshint');
var options = {
cacheDir: './tmp'
};
gulp.task('deploy', ['js:lint', 'js:compile'], function () {
return gulp.src(['./**/*', '!./node_modules/**', '!./tmp/**'])
.pipe(deploy(options));
});
gulp.task('js:compile', function() {
return gulp.src('src/**/*.js')
.pipe(to5())
.pipe(gulp.dest('dist'));
});
gulp.task('js:lint', function() {
return gulp.src('./src/**/*.js')
.pipe(jshint({ esnext: true }))
.pipe(jshint.reporter('default'));
});
gulp.task('default', function () {
watch('./src/**/*.js', function () {
gulp.start('js:lint');
gulp.start('js:compile');
});
});
| Add tmp directory to deploy exclude list | Add tmp directory to deploy exclude list
| JavaScript | mit | alexgibson/wavepad,alexgibson/wavepad | javascript | ## Code Before:
'use strict';
var gulp = require('gulp');
var to5 = require('gulp-6to5');
var watch = require('gulp-watch');
var deploy = require('gulp-gh-pages');
var jshint = require('gulp-jshint');
var options = {
cacheDir: './tmp'
};
gulp.task('deploy', ['js:lint', 'js:compile'], function () {
return gulp.src(['./**/*', '!./node_modules/**'])
.pipe(deploy(options));
});
gulp.task('js:compile', function() {
return gulp.src('src/**/*.js')
.pipe(to5())
.pipe(gulp.dest('dist'));
});
gulp.task('js:lint', function() {
return gulp.src('./src/**/*.js')
.pipe(jshint({ esnext: true }))
.pipe(jshint.reporter('default'));
});
gulp.task('default', function () {
watch('./src/**/*.js', function () {
gulp.start('js:lint');
gulp.start('js:compile');
});
});
## Instruction:
Add tmp directory to deploy exclude list
## Code After:
'use strict';
var gulp = require('gulp');
var to5 = require('gulp-6to5');
var watch = require('gulp-watch');
var deploy = require('gulp-gh-pages');
var jshint = require('gulp-jshint');
var options = {
cacheDir: './tmp'
};
gulp.task('deploy', ['js:lint', 'js:compile'], function () {
return gulp.src(['./**/*', '!./node_modules/**', '!./tmp/**'])
.pipe(deploy(options));
});
gulp.task('js:compile', function() {
return gulp.src('src/**/*.js')
.pipe(to5())
.pipe(gulp.dest('dist'));
});
gulp.task('js:lint', function() {
return gulp.src('./src/**/*.js')
.pipe(jshint({ esnext: true }))
.pipe(jshint.reporter('default'));
});
gulp.task('default', function () {
watch('./src/**/*.js', function () {
gulp.start('js:lint');
gulp.start('js:compile');
});
});
| 'use strict';
var gulp = require('gulp');
var to5 = require('gulp-6to5');
var watch = require('gulp-watch');
var deploy = require('gulp-gh-pages');
var jshint = require('gulp-jshint');
var options = {
cacheDir: './tmp'
};
gulp.task('deploy', ['js:lint', 'js:compile'], function () {
- return gulp.src(['./**/*', '!./node_modules/**'])
+ return gulp.src(['./**/*', '!./node_modules/**', '!./tmp/**'])
? +++++++++++++
.pipe(deploy(options));
});
gulp.task('js:compile', function() {
return gulp.src('src/**/*.js')
.pipe(to5())
.pipe(gulp.dest('dist'));
});
gulp.task('js:lint', function() {
return gulp.src('./src/**/*.js')
.pipe(jshint({ esnext: true }))
.pipe(jshint.reporter('default'));
});
gulp.task('default', function () {
watch('./src/**/*.js', function () {
gulp.start('js:lint');
gulp.start('js:compile');
});
}); | 2 | 0.057143 | 1 | 1 |
b8dd32cf3bcd5d14c12543d767f8db68b31a6a9b | lib/font_awesome/sass/rails/engine.rb | lib/font_awesome/sass/rails/engine.rb | module FontAwesome
module Sass
module Rails
class Engine < ::Rails::Engine
initializer 'font-awesome-sass.assets.precompile', group: :all do |app|
%w(stylesheets fonts).each do |sub|
app.config.assets.paths << root.join('assets', sub).to_s
end
app.config.assets.precompile << %r(font-awesome/fontawesome-webfont\.(?:eot|svg|ttf|woff|woff2?)$)
end
end
end
end
end
| module FontAwesome
module Sass
module Rails
class Engine < ::Rails::Engine
initializer 'font-awesome-sass.assets.precompile', group: :all do |app|
%w(stylesheets fonts).each do |sub|
app.config.assets.paths << root.join('assets', sub).to_s
end
%w(eot svg ttf woff woff2).each do |ext|
app.config.assets.precompile << "font-awesome/fontawesome-webfont.#{ext}"
end
end
end
end
end
end
| Add compatibility with sprockets 4 | Add compatibility with sprockets 4
| Ruby | mit | FortAwesome/font-awesome-sass,Swrve/font-awesome-sass,rmwbweb/font-awesome-sass,mromulus/font-awesome-sass | ruby | ## Code Before:
module FontAwesome
module Sass
module Rails
class Engine < ::Rails::Engine
initializer 'font-awesome-sass.assets.precompile', group: :all do |app|
%w(stylesheets fonts).each do |sub|
app.config.assets.paths << root.join('assets', sub).to_s
end
app.config.assets.precompile << %r(font-awesome/fontawesome-webfont\.(?:eot|svg|ttf|woff|woff2?)$)
end
end
end
end
end
## Instruction:
Add compatibility with sprockets 4
## Code After:
module FontAwesome
module Sass
module Rails
class Engine < ::Rails::Engine
initializer 'font-awesome-sass.assets.precompile', group: :all do |app|
%w(stylesheets fonts).each do |sub|
app.config.assets.paths << root.join('assets', sub).to_s
end
%w(eot svg ttf woff woff2).each do |ext|
app.config.assets.precompile << "font-awesome/fontawesome-webfont.#{ext}"
end
end
end
end
end
end
| module FontAwesome
module Sass
module Rails
class Engine < ::Rails::Engine
initializer 'font-awesome-sass.assets.precompile', group: :all do |app|
%w(stylesheets fonts).each do |sub|
app.config.assets.paths << root.join('assets', sub).to_s
end
+ %w(eot svg ttf woff woff2).each do |ext|
- app.config.assets.precompile << %r(font-awesome/fontawesome-webfont\.(?:eot|svg|ttf|woff|woff2?)$)
? ^^^ - ^^^ ^ ^^^^^^^^^^^^^^^^^^^^^^^
+ app.config.assets.precompile << "font-awesome/fontawesome-webfont.#{ext}"
? ++ ^ ^^ ^ ^^
+ end
end
end
end
end
end | 4 | 0.266667 | 3 | 1 |
30c4ef85bba3557cc872dc290c0ca2f74571ed52 | kontact/plugins/akregator/CMakeLists.txt | kontact/plugins/akregator/CMakeLists.txt |
include_directories(${CMAKE_SOURCE_DIR}/akregator/src)
########### next target ###############
set(kontact_akregator_PART_SRCS akregator_plugin.cpp)
qt4_add_dbus_interfaces(kontact_akregator_PART_SRCS ${CMAKE_SOURCE_DIR}/akregator/src/org.kde.akregator.part.xml)
kde4_add_plugin(kontact_akregatorplugin ${kontact_akregator_PART_SRCS})
kdepim4_link_unique_libraries(kontact_akregatorplugin ${KDE4_KPARTS_LIBS} kontactinterfaces)
########### install files ###############
install(TARGETS kontact_akregatorplugin DESTINATION ${PLUGIN_INSTALL_DIR})
install(FILES akregatorplugin.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kontact)
install(FILES akregator.setdlg DESTINATION ${DATA_INSTALL_DIR}/kontact/ksettingsdialog)
|
include_directories(${CMAKE_SOURCE_DIR}/akregator/src)
include_directories( ${Boost_INCLUDE_DIRS} )
########### next target ###############
set(kontact_akregator_PART_SRCS akregator_plugin.cpp)
qt4_add_dbus_interfaces(kontact_akregator_PART_SRCS ${CMAKE_SOURCE_DIR}/akregator/src/org.kde.akregator.part.xml)
kde4_add_plugin(kontact_akregatorplugin ${kontact_akregator_PART_SRCS})
kdepim4_link_unique_libraries(kontact_akregatorplugin ${KDE4_KPARTS_LIBS} kontactinterfaces)
########### install files ###############
install(TARGETS kontact_akregatorplugin DESTINATION ${PLUGIN_INSTALL_DIR})
install(FILES akregatorplugin.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kontact)
install(FILES akregator.setdlg DESTINATION ${DATA_INSTALL_DIR}/kontact/ksettingsdialog)
| Add boost includedir as this plugin uses boost indirectly | Add boost includedir as this plugin uses boost indirectly
svn path=/trunk/KDE/kdepim/kontact/plugins/; revision=909514
| Text | lgpl-2.1 | lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi | text | ## Code Before:
include_directories(${CMAKE_SOURCE_DIR}/akregator/src)
########### next target ###############
set(kontact_akregator_PART_SRCS akregator_plugin.cpp)
qt4_add_dbus_interfaces(kontact_akregator_PART_SRCS ${CMAKE_SOURCE_DIR}/akregator/src/org.kde.akregator.part.xml)
kde4_add_plugin(kontact_akregatorplugin ${kontact_akregator_PART_SRCS})
kdepim4_link_unique_libraries(kontact_akregatorplugin ${KDE4_KPARTS_LIBS} kontactinterfaces)
########### install files ###############
install(TARGETS kontact_akregatorplugin DESTINATION ${PLUGIN_INSTALL_DIR})
install(FILES akregatorplugin.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kontact)
install(FILES akregator.setdlg DESTINATION ${DATA_INSTALL_DIR}/kontact/ksettingsdialog)
## Instruction:
Add boost includedir as this plugin uses boost indirectly
svn path=/trunk/KDE/kdepim/kontact/plugins/; revision=909514
## Code After:
include_directories(${CMAKE_SOURCE_DIR}/akregator/src)
include_directories( ${Boost_INCLUDE_DIRS} )
########### next target ###############
set(kontact_akregator_PART_SRCS akregator_plugin.cpp)
qt4_add_dbus_interfaces(kontact_akregator_PART_SRCS ${CMAKE_SOURCE_DIR}/akregator/src/org.kde.akregator.part.xml)
kde4_add_plugin(kontact_akregatorplugin ${kontact_akregator_PART_SRCS})
kdepim4_link_unique_libraries(kontact_akregatorplugin ${KDE4_KPARTS_LIBS} kontactinterfaces)
########### install files ###############
install(TARGETS kontact_akregatorplugin DESTINATION ${PLUGIN_INSTALL_DIR})
install(FILES akregatorplugin.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kontact)
install(FILES akregator.setdlg DESTINATION ${DATA_INSTALL_DIR}/kontact/ksettingsdialog)
|
include_directories(${CMAKE_SOURCE_DIR}/akregator/src)
+ include_directories( ${Boost_INCLUDE_DIRS} )
########### next target ###############
set(kontact_akregator_PART_SRCS akregator_plugin.cpp)
qt4_add_dbus_interfaces(kontact_akregator_PART_SRCS ${CMAKE_SOURCE_DIR}/akregator/src/org.kde.akregator.part.xml)
kde4_add_plugin(kontact_akregatorplugin ${kontact_akregator_PART_SRCS})
kdepim4_link_unique_libraries(kontact_akregatorplugin ${KDE4_KPARTS_LIBS} kontactinterfaces)
########### install files ###############
install(TARGETS kontact_akregatorplugin DESTINATION ${PLUGIN_INSTALL_DIR})
install(FILES akregatorplugin.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kontact)
install(FILES akregator.setdlg DESTINATION ${DATA_INSTALL_DIR}/kontact/ksettingsdialog)
| 1 | 0.043478 | 1 | 0 |
f91da81e6c1174be8117c451440506989226330a | web-js/generate-long-lived-token/README.md | web-js/generate-long-lived-token/README.md | [Generate Long-lived Token Sample](https://dl.dropboxusercontent.com/u/79881075/LongLivedToken.html)
##About
The Identity Manager included with the JavaScript API will allow you to generate a short-lived token from ArcGIS Server or ArcGIS Online(which usually have a life span of 60 minutes). If you need to generate a token with a longer or shorter life span you will need to use esriRequest as it will allow you to explicitly set the life span of the token. Generating a token with a specified life span requires the request to include a Client ID that is associated with the token using either an IP address or an HTTP Referer. This token will only be valid when used with requests originating from that IP or Referer and is required as an extra security precaution. This sample uses an HTTP Referer and retrieves the application address from the browser window to avoid hard-coding the Referer into the application.
##Caution
It is always a bad idea to hard-code a username and password into a JavaScript application as anyone can view the source of the application and obtain your login credentials. You should prompt the user to enter credentials in a form, access those credentials and then use them to generate the token. Please view this sample as a demonstration of how to use esriRequest with the generate token endpoint of ArcGIS Server and not a recommendation on application security.
| [Generate Long-lived Token Sample](http://esri.github.io/developer-support/web-js/generate-long-lived-token/index.html)
##About
The Identity Manager included with the JavaScript API will allow you to generate a short-lived token from ArcGIS Server or ArcGIS Online(which usually have a life span of 60 minutes). If you need to generate a token with a longer or shorter life span you will need to use esriRequest as it will allow you to explicitly set the life span of the token. Generating a token with a specified life span requires the request to include a Client ID that is associated with the token using either an IP address or an HTTP Referer. This token will only be valid when used with requests originating from that IP or Referer and is required as an extra security precaution. This sample uses an HTTP Referer and retrieves the application address from the browser window to avoid hard-coding the Referer into the application.
##Caution
It is always a bad idea to hard-code a username and password into a JavaScript application as anyone can view the source of the application and obtain your login credentials. You should prompt the user to enter credentials in a form, access those credentials and then use them to generate the token. Please view this sample as a demonstration of how to use esriRequest with the generate token endpoint of ArcGIS Server and not a recommendation on application security.
| Update readme to reflect gh-pages | Update readme to reflect gh-pages | Markdown | apache-2.0 | nhaney90/developer-support,hanhansun/developer-support,briantwatson/developer-support,briantwatson/developer-support,benstoltz/developer-support,goldenlimit/developer-support,marlak/developer-support,goldenlimit/developer-support,Esri/developer-support,jgravois/developer-support,hhkaos/developer-support,jgravois/developer-support,NoashX/developer-support,hanhansun/developer-support,AkshayHarshe/developer-support,benstoltz/developer-support,AkshayHarshe/developer-support,NoashX/developer-support,hanhansun/developer-support,Esri/developer-support,briantwatson/developer-support,aOrtego/developer-support,bsnider/developer-support,hanhansun/developer-support,briantwatson/developer-support,AkshayHarshe/developer-support,nohe427/developer-support,Esri/developer-support,NoashX/developer-support,hanhansun/developer-support,Esri/developer-support,nhaney90/developer-support,jgravois/developer-support,nhaney90/developer-support,goldenlimit/developer-support,nohe427/developer-support,phpmaps/developer-support,marlak/developer-support,phpmaps/developer-support,Esri/developer-support,nhaney90/developer-support,goldenlimit/developer-support,nohe427/developer-support,nhaney90/developer-support,Esri/developer-support,aOrtego/developer-support,NoashX/developer-support,Esri/developer-support,nohe427/developer-support,marlak/developer-support,AkshayHarshe/developer-support,jgravois/developer-support,goldenlimit/developer-support,briantwatson/developer-support,benstoltz/developer-support,AkshayHarshe/developer-support,benstoltz/developer-support,bsnider/developer-support,briantwatson/developer-support,nhaney90/developer-support,marlak/developer-support,NoashX/developer-support,nohe427/developer-support,benstoltz/developer-support,hhkaos/developer-support,bsnider/developer-support,phpmaps/developer-support,benstoltz/developer-support,hhkaos/developer-support,benstoltz/developer-support,NoashX/developer-support,marlak/developer-support,briantwatson/developer-support,nhaney90/developer-support,jgravois/developer-support,nohe427/developer-support,nohe427/developer-support,goldenlimit/developer-support,NoashX/developer-support,goldenlimit/developer-support,briantwatson/developer-support,nohe427/developer-support,hhkaos/developer-support,Esri/developer-support,briantwatson/developer-support,bsnider/developer-support,phpmaps/developer-support,aOrtego/developer-support,AkshayHarshe/developer-support,bsnider/developer-support,briantwatson/developer-support,marlak/developer-support,nhaney90/developer-support,hanhansun/developer-support,hhkaos/developer-support,bsnider/developer-support,Esri/developer-support,bsnider/developer-support,nhaney90/developer-support,jgravois/developer-support,hhkaos/developer-support,phpmaps/developer-support,Esri/developer-support,aOrtego/developer-support,bsnider/developer-support,jgravois/developer-support,hhkaos/developer-support,hanhansun/developer-support,bsnider/developer-support,aOrtego/developer-support,nhaney90/developer-support,marlak/developer-support,aOrtego/developer-support,nhaney90/developer-support,nohe427/developer-support,hhkaos/developer-support,AkshayHarshe/developer-support,jgravois/developer-support,goldenlimit/developer-support,nohe427/developer-support,nohe427/developer-support,jgravois/developer-support,hanhansun/developer-support,nohe427/developer-support,briantwatson/developer-support,briantwatson/developer-support,nohe427/developer-support,marlak/developer-support,Esri/developer-support,phpmaps/developer-support,goldenlimit/developer-support,hhkaos/developer-support,aOrtego/developer-support,marlak/developer-support,goldenlimit/developer-support,NoashX/developer-support,bsnider/developer-support,phpmaps/developer-support,phpmaps/developer-support,bsnider/developer-support,goldenlimit/developer-support,phpmaps/developer-support,benstoltz/developer-support,jgravois/developer-support,aOrtego/developer-support,NoashX/developer-support,hanhansun/developer-support,Esri/developer-support,Esri/developer-support,jgravois/developer-support,briantwatson/developer-support,hhkaos/developer-support,hhkaos/developer-support,AkshayHarshe/developer-support,phpmaps/developer-support,marlak/developer-support,AkshayHarshe/developer-support | markdown | ## Code Before:
[Generate Long-lived Token Sample](https://dl.dropboxusercontent.com/u/79881075/LongLivedToken.html)
##About
The Identity Manager included with the JavaScript API will allow you to generate a short-lived token from ArcGIS Server or ArcGIS Online(which usually have a life span of 60 minutes). If you need to generate a token with a longer or shorter life span you will need to use esriRequest as it will allow you to explicitly set the life span of the token. Generating a token with a specified life span requires the request to include a Client ID that is associated with the token using either an IP address or an HTTP Referer. This token will only be valid when used with requests originating from that IP or Referer and is required as an extra security precaution. This sample uses an HTTP Referer and retrieves the application address from the browser window to avoid hard-coding the Referer into the application.
##Caution
It is always a bad idea to hard-code a username and password into a JavaScript application as anyone can view the source of the application and obtain your login credentials. You should prompt the user to enter credentials in a form, access those credentials and then use them to generate the token. Please view this sample as a demonstration of how to use esriRequest with the generate token endpoint of ArcGIS Server and not a recommendation on application security.
## Instruction:
Update readme to reflect gh-pages
## Code After:
[Generate Long-lived Token Sample](http://esri.github.io/developer-support/web-js/generate-long-lived-token/index.html)
##About
The Identity Manager included with the JavaScript API will allow you to generate a short-lived token from ArcGIS Server or ArcGIS Online(which usually have a life span of 60 minutes). If you need to generate a token with a longer or shorter life span you will need to use esriRequest as it will allow you to explicitly set the life span of the token. Generating a token with a specified life span requires the request to include a Client ID that is associated with the token using either an IP address or an HTTP Referer. This token will only be valid when used with requests originating from that IP or Referer and is required as an extra security precaution. This sample uses an HTTP Referer and retrieves the application address from the browser window to avoid hard-coding the Referer into the application.
##Caution
It is always a bad idea to hard-code a username and password into a JavaScript application as anyone can view the source of the application and obtain your login credentials. You should prompt the user to enter credentials in a form, access those credentials and then use them to generate the token. Please view this sample as a demonstration of how to use esriRequest with the generate token endpoint of ArcGIS Server and not a recommendation on application security.
| - [Generate Long-lived Token Sample](https://dl.dropboxusercontent.com/u/79881075/LongLivedToken.html)
+ [Generate Long-lived Token Sample](http://esri.github.io/developer-support/web-js/generate-long-lived-token/index.html)
##About
The Identity Manager included with the JavaScript API will allow you to generate a short-lived token from ArcGIS Server or ArcGIS Online(which usually have a life span of 60 minutes). If you need to generate a token with a longer or shorter life span you will need to use esriRequest as it will allow you to explicitly set the life span of the token. Generating a token with a specified life span requires the request to include a Client ID that is associated with the token using either an IP address or an HTTP Referer. This token will only be valid when used with requests originating from that IP or Referer and is required as an extra security precaution. This sample uses an HTTP Referer and retrieves the application address from the browser window to avoid hard-coding the Referer into the application.
##Caution
It is always a bad idea to hard-code a username and password into a JavaScript application as anyone can view the source of the application and obtain your login credentials. You should prompt the user to enter credentials in a form, access those credentials and then use them to generate the token. Please view this sample as a demonstration of how to use esriRequest with the generate token endpoint of ArcGIS Server and not a recommendation on application security.
| 2 | 0.333333 | 1 | 1 |
c8ee7c96b6fe8c7280881a6f182f6836c0438bb5 | .travis.yml | .travis.yml | language: android
sudo: false
jdk: oraclejdk8
android:
components:
- android-23
- tools
- build-tools-23.0.3
- extra
script:
- ./gradlew -s -PdisablePreDex clean build
env:
- GRADLE_OPTS="-Xmx1024m -XX:MaxPermSize=1024m"
cache:
directories:
- $HOME/.gradle/caches/2.13
- $HOME/.gradle/caches/jars-1
- $HOME/.gradle/daemon
- $HOME/.gradle/native
- $HOME/.gradle/wrapper | language: android
sudo: false
jdk: oraclejdk8
android:
components:
- android-23
- tools
- build-tools-23.0.3
- extra
script:
- ./gradlew -s -PdisablePreDex clean build
env:
global:
- GRADLE_OPTS="-Xmx4g"
cache:
directories:
- $HOME/.gradle/caches/2.13
- $HOME/.gradle/caches/jars-1
- $HOME/.gradle/daemon
- $HOME/.gradle/native
- $HOME/.gradle/wrapper | Remove MaxPermSize from gradle opts | Remove MaxPermSize from gradle opts
Fix warning: Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=1024m; support was removed in 8.0. Xmx was increased to use gradle daemon
| YAML | mit | ViliusKraujutis/tvarkau-vilniu,vilnius/tvarkau-vilniu,vilnius/tvarkau-vilniu | yaml | ## Code Before:
language: android
sudo: false
jdk: oraclejdk8
android:
components:
- android-23
- tools
- build-tools-23.0.3
- extra
script:
- ./gradlew -s -PdisablePreDex clean build
env:
- GRADLE_OPTS="-Xmx1024m -XX:MaxPermSize=1024m"
cache:
directories:
- $HOME/.gradle/caches/2.13
- $HOME/.gradle/caches/jars-1
- $HOME/.gradle/daemon
- $HOME/.gradle/native
- $HOME/.gradle/wrapper
## Instruction:
Remove MaxPermSize from gradle opts
Fix warning: Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=1024m; support was removed in 8.0. Xmx was increased to use gradle daemon
## Code After:
language: android
sudo: false
jdk: oraclejdk8
android:
components:
- android-23
- tools
- build-tools-23.0.3
- extra
script:
- ./gradlew -s -PdisablePreDex clean build
env:
global:
- GRADLE_OPTS="-Xmx4g"
cache:
directories:
- $HOME/.gradle/caches/2.13
- $HOME/.gradle/caches/jars-1
- $HOME/.gradle/daemon
- $HOME/.gradle/native
- $HOME/.gradle/wrapper | language: android
sudo: false
jdk: oraclejdk8
android:
components:
- android-23
- tools
- build-tools-23.0.3
- extra
script:
- ./gradlew -s -PdisablePreDex clean build
env:
- - GRADLE_OPTS="-Xmx1024m -XX:MaxPermSize=1024m"
+ global:
+ - GRADLE_OPTS="-Xmx4g"
cache:
directories:
- $HOME/.gradle/caches/2.13
- $HOME/.gradle/caches/jars-1
- $HOME/.gradle/daemon
- $HOME/.gradle/native
- $HOME/.gradle/wrapper | 3 | 0.115385 | 2 | 1 |
4c7e4e629d154424acf5590a3c65c7e4d30c5aff | tests/test_person.py | tests/test_person.py | from unittest import TestCase
class PersonTestCase(TestCase):
def test_get_groups(self):
pass | from unittest import TestCase
from address_book import Person
class PersonTestCase(TestCase):
def test_get_groups(self):
pass
def test_add_address(self):
basic_address = ['Russian Federation, Kemerovo region, Kemerovo, Kirova street 23, apt. 42'],
person = Person(
'John',
'Doe',
basic_address,
['+79834772053'],
['john@gmail.com']
)
person.add_address('new address')
self.assertEqual(
person.addresses,
basic_address + ['new address']
)
def test_add_phone(self):
pass
def test_add_email(self):
pass | Test the ability to add some address to the person | Test the ability to add some address to the person
| Python | mit | dizpers/python-address-book-assignment | python | ## Code Before:
from unittest import TestCase
class PersonTestCase(TestCase):
def test_get_groups(self):
pass
## Instruction:
Test the ability to add some address to the person
## Code After:
from unittest import TestCase
from address_book import Person
class PersonTestCase(TestCase):
def test_get_groups(self):
pass
def test_add_address(self):
basic_address = ['Russian Federation, Kemerovo region, Kemerovo, Kirova street 23, apt. 42'],
person = Person(
'John',
'Doe',
basic_address,
['+79834772053'],
['john@gmail.com']
)
person.add_address('new address')
self.assertEqual(
person.addresses,
basic_address + ['new address']
)
def test_add_phone(self):
pass
def test_add_email(self):
pass | from unittest import TestCase
+
+ from address_book import Person
class PersonTestCase(TestCase):
def test_get_groups(self):
pass
+
+ def test_add_address(self):
+ basic_address = ['Russian Federation, Kemerovo region, Kemerovo, Kirova street 23, apt. 42'],
+ person = Person(
+ 'John',
+ 'Doe',
+ basic_address,
+ ['+79834772053'],
+ ['john@gmail.com']
+ )
+ person.add_address('new address')
+ self.assertEqual(
+ person.addresses,
+ basic_address + ['new address']
+ )
+
+ def test_add_phone(self):
+ pass
+
+ def test_add_email(self):
+ pass | 23 | 3.285714 | 23 | 0 |
ba60586f87af3f35d0a2eb361d1f02623498199c | .travis.yml | .travis.yml | language: cpp
os:
- linux
services:
- docker
before_script:
- docker run -ti --rm -v $PWD:/qflex:ro debian:bullseye /bin/bash -c "apt update && apt install -y yapf3 clang-format && bash /qflex/scripts/check_format.sh"
- docker-compose build
script:
- docker run -ti --rm qflex-tests:latest
- docker run -ti --rm qflex-py-tests:latest
- docker run -ti --rm qflex:latest /qflex/config/circuits/bristlecone_48_1-24-1_0.txt /qflex/config/ordering/bristlecone_48.txt /qflex/config/grid/bristlecone_48.txt
| language: cpp
os:
- linux
services:
- docker
before_script:
- docker run -ti --rm -v $PWD:/qflex:ro alpine:3.10.3 /bin/sh -c "apk update && apk add bash py3-pip clang && pip3 install yapf && bash /qflex/scripts/check_format.sh"
- docker-compose build
script:
- docker run -ti --rm qflex-tests:latest
- docker run -ti --rm qflex-py-tests:latest
- docker run -ti --rm qflex:latest /qflex/config/circuits/bristlecone_48_1-24-1_0.txt /qflex/config/ordering/bristlecone_48.txt /qflex/config/grid/bristlecone_48.txt
| Use alpine instead of debian. | Use alpine instead of debian.
| YAML | apache-2.0 | ngnrsaa/qflex,ngnrsaa/qflex,ngnrsaa/qflex,ngnrsaa/qflex | yaml | ## Code Before:
language: cpp
os:
- linux
services:
- docker
before_script:
- docker run -ti --rm -v $PWD:/qflex:ro debian:bullseye /bin/bash -c "apt update && apt install -y yapf3 clang-format && bash /qflex/scripts/check_format.sh"
- docker-compose build
script:
- docker run -ti --rm qflex-tests:latest
- docker run -ti --rm qflex-py-tests:latest
- docker run -ti --rm qflex:latest /qflex/config/circuits/bristlecone_48_1-24-1_0.txt /qflex/config/ordering/bristlecone_48.txt /qflex/config/grid/bristlecone_48.txt
## Instruction:
Use alpine instead of debian.
## Code After:
language: cpp
os:
- linux
services:
- docker
before_script:
- docker run -ti --rm -v $PWD:/qflex:ro alpine:3.10.3 /bin/sh -c "apk update && apk add bash py3-pip clang && pip3 install yapf && bash /qflex/scripts/check_format.sh"
- docker-compose build
script:
- docker run -ti --rm qflex-tests:latest
- docker run -ti --rm qflex-py-tests:latest
- docker run -ti --rm qflex:latest /qflex/config/circuits/bristlecone_48_1-24-1_0.txt /qflex/config/ordering/bristlecone_48.txt /qflex/config/grid/bristlecone_48.txt
| language: cpp
os:
- linux
services:
- docker
before_script:
- - docker run -ti --rm -v $PWD:/qflex:ro debian:bullseye /bin/bash -c "apt update && apt install -y yapf3 clang-format && bash /qflex/scripts/check_format.sh"
? ^ ---- ^^^^^^^^ -- ^ ^ --- --------------
+ - docker run -ti --rm -v $PWD:/qflex:ro alpine:3.10.3 /bin/sh -c "apk update && apk add bash py3-pip clang && pip3 install yapf && bash /qflex/scripts/check_format.sh"
? ^^^^^ ^^^^^^ ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- docker-compose build
script:
- docker run -ti --rm qflex-tests:latest
- docker run -ti --rm qflex-py-tests:latest
- docker run -ti --rm qflex:latest /qflex/config/circuits/bristlecone_48_1-24-1_0.txt /qflex/config/ordering/bristlecone_48.txt /qflex/config/grid/bristlecone_48.txt | 2 | 0.125 | 1 | 1 |
1a6344ea1fac51a8024e1803a0391662d4ab81e0 | pyeda/boolalg/vexpr.py | pyeda/boolalg/vexpr.py |
from pyeda.boolalg import expr
from pyeda.boolalg import bfarray
def bitvec(name, *dims):
"""Return a new array of given dimensions, filled with Expressions.
Parameters
----------
name : str
dims : (int or (int, int))
An int N means a slice from [0:N]
A tuple (M, N) means a slice from [M:N]
"""
if dims:
return bfarray.exprvars(name, *dims)
else:
return expr.exprvar(name)
|
from warnings import warn
from pyeda.boolalg import expr
from pyeda.boolalg import bfarray
def bitvec(name, *dims):
"""Return a new array of given dimensions, filled with Expressions.
Parameters
----------
name : str
dims : (int or (int, int))
An int N means a slice from [0:N]
A tuple (M, N) means a slice from [M:N]
"""
warn("The 'bitvec' function is deprecated. Use 'exprvars' instead.")
if dims:
return bfarray.exprvars(name, *dims)
else:
return expr.exprvar(name)
| Add deprecation warning to bitvec function | Add deprecation warning to bitvec function
| Python | bsd-2-clause | pombredanne/pyeda,GtTmy/pyeda,karissa/pyeda,sschnug/pyeda,sschnug/pyeda,cjdrake/pyeda,sschnug/pyeda,cjdrake/pyeda,GtTmy/pyeda,GtTmy/pyeda,karissa/pyeda,pombredanne/pyeda,karissa/pyeda,cjdrake/pyeda,pombredanne/pyeda | python | ## Code Before:
from pyeda.boolalg import expr
from pyeda.boolalg import bfarray
def bitvec(name, *dims):
"""Return a new array of given dimensions, filled with Expressions.
Parameters
----------
name : str
dims : (int or (int, int))
An int N means a slice from [0:N]
A tuple (M, N) means a slice from [M:N]
"""
if dims:
return bfarray.exprvars(name, *dims)
else:
return expr.exprvar(name)
## Instruction:
Add deprecation warning to bitvec function
## Code After:
from warnings import warn
from pyeda.boolalg import expr
from pyeda.boolalg import bfarray
def bitvec(name, *dims):
"""Return a new array of given dimensions, filled with Expressions.
Parameters
----------
name : str
dims : (int or (int, int))
An int N means a slice from [0:N]
A tuple (M, N) means a slice from [M:N]
"""
warn("The 'bitvec' function is deprecated. Use 'exprvars' instead.")
if dims:
return bfarray.exprvars(name, *dims)
else:
return expr.exprvar(name)
| +
+ from warnings import warn
from pyeda.boolalg import expr
from pyeda.boolalg import bfarray
def bitvec(name, *dims):
"""Return a new array of given dimensions, filled with Expressions.
Parameters
----------
name : str
dims : (int or (int, int))
An int N means a slice from [0:N]
A tuple (M, N) means a slice from [M:N]
"""
+ warn("The 'bitvec' function is deprecated. Use 'exprvars' instead.")
if dims:
return bfarray.exprvars(name, *dims)
else:
return expr.exprvar(name)
| 3 | 0.157895 | 3 | 0 |
23626df15ba6b7ad1da1adf36ec2b16c827ec80c | wagtailcodeblock/templates/wagtailcodeblock/code_block.html | wagtailcodeblock/templates/wagtailcodeblock/code_block.html | {% spaceless %}
{% with prism_version="1.6.0" %}
{% for key, val in self.items %}
{% if key == "language" %}
{% block extra_css %}
<link href="https://cdnjs.cloudflare.com/ajax/libs/prism/{{ prism_version }}/themes/prism.min.css" rel="stylesheet" />
{% endblock extra_css %}
{% block extra_js %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/{{ prism_version }}/prism.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/{{ prism_version }}/components/prism-{{ val }}.min.js"></script>
{% endblock extra_js %}
<input id="code_block_language" type="hidden" value="language-{{ val }}">
{% endif %}
{% if key == "code" %}
<pre>
<code id="target-element">{{ val }}</code>
</pre>
<script>document.getElementById('target-element').className = document.getElementById('code_block_language').value;</script>
{% endif %}
{% endfor %}
{% endwith %}
{% endspaceless %}
| {% spaceless %}
{% with prism_version="1.6.0" %}
{% for key, val in self.items %}
{% if key == "language" %}
{% block extra_css %}
<link href="https://cdnjs.cloudflare.com/ajax/libs/prism/{{ prism_version }}/themes/prism.min.css" rel="stylesheet" />
{% endblock extra_css %}
{% block extra_js %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/{{ prism_version }}/prism.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/{{ prism_version }}/components/prism-{{ val }}.min.js"></script>
{% endblock extra_js %}
<script>
language_class_name = 'language-{{ val }}';
</script>
{% endif %}
{% if key == "code" %}
<pre>
<code id="target-element-current">{{ val }}</code>
</pre>
<script>
var block_num = (typeof block_num === 'undefined') ? 0 : block_num;
block_num++;
document.getElementById('target-element-current').className = language_class_name;
document.getElementById('target-element-current').id = 'target-element-' + block_num;
</script>
{% endif %}
{% endfor %}
{% endwith %}
{% endspaceless %}
| Support for multiple code blocks on a single page. | Support for multiple code blocks on a single page.
| HTML | bsd-3-clause | FlipperPA/wagtailcodeblock,FlipperPA/wagtailcodeblock,FlipperPA/wagtailcodeblock | html | ## Code Before:
{% spaceless %}
{% with prism_version="1.6.0" %}
{% for key, val in self.items %}
{% if key == "language" %}
{% block extra_css %}
<link href="https://cdnjs.cloudflare.com/ajax/libs/prism/{{ prism_version }}/themes/prism.min.css" rel="stylesheet" />
{% endblock extra_css %}
{% block extra_js %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/{{ prism_version }}/prism.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/{{ prism_version }}/components/prism-{{ val }}.min.js"></script>
{% endblock extra_js %}
<input id="code_block_language" type="hidden" value="language-{{ val }}">
{% endif %}
{% if key == "code" %}
<pre>
<code id="target-element">{{ val }}</code>
</pre>
<script>document.getElementById('target-element').className = document.getElementById('code_block_language').value;</script>
{% endif %}
{% endfor %}
{% endwith %}
{% endspaceless %}
## Instruction:
Support for multiple code blocks on a single page.
## Code After:
{% spaceless %}
{% with prism_version="1.6.0" %}
{% for key, val in self.items %}
{% if key == "language" %}
{% block extra_css %}
<link href="https://cdnjs.cloudflare.com/ajax/libs/prism/{{ prism_version }}/themes/prism.min.css" rel="stylesheet" />
{% endblock extra_css %}
{% block extra_js %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/{{ prism_version }}/prism.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/{{ prism_version }}/components/prism-{{ val }}.min.js"></script>
{% endblock extra_js %}
<script>
language_class_name = 'language-{{ val }}';
</script>
{% endif %}
{% if key == "code" %}
<pre>
<code id="target-element-current">{{ val }}</code>
</pre>
<script>
var block_num = (typeof block_num === 'undefined') ? 0 : block_num;
block_num++;
document.getElementById('target-element-current').className = language_class_name;
document.getElementById('target-element-current').id = 'target-element-' + block_num;
</script>
{% endif %}
{% endfor %}
{% endwith %}
{% endspaceless %}
| {% spaceless %}
{% with prism_version="1.6.0" %}
{% for key, val in self.items %}
{% if key == "language" %}
{% block extra_css %}
<link href="https://cdnjs.cloudflare.com/ajax/libs/prism/{{ prism_version }}/themes/prism.min.css" rel="stylesheet" />
{% endblock extra_css %}
{% block extra_js %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/{{ prism_version }}/prism.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/{{ prism_version }}/components/prism-{{ val }}.min.js"></script>
{% endblock extra_js %}
- <input id="code_block_language" type="hidden" value="language-{{ val }}">
+ <script>
+ language_class_name = 'language-{{ val }}';
+ </script>
{% endif %}
{% if key == "code" %}
<pre>
- <code id="target-element">{{ val }}</code>
+ <code id="target-element-current">{{ val }}</code>
? ++++++++
</pre>
- <script>document.getElementById('target-element').className = document.getElementById('code_block_language').value;</script>
+ <script>
+ var block_num = (typeof block_num === 'undefined') ? 0 : block_num;
+ block_num++;
+ document.getElementById('target-element-current').className = language_class_name;
+ document.getElementById('target-element-current').id = 'target-element-' + block_num;
+ </script>
{% endif %}
{% endfor %}
{% endwith %}
{% endspaceless %} | 13 | 0.590909 | 10 | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.