commit
stringlengths 40
40
| old_file
stringlengths 4
237
| new_file
stringlengths 4
237
| old_contents
stringlengths 1
4.24k
| new_contents
stringlengths 5
4.84k
| subject
stringlengths 15
778
| message
stringlengths 16
6.86k
| lang
stringlengths 1
30
| license
stringclasses 13
values | repos
stringlengths 5
116k
| config
stringlengths 1
30
| content
stringlengths 105
8.72k
|
---|---|---|---|---|---|---|---|---|---|---|---|
6c2d21022b67e09004651dc953cb5279bc45fa8b | ubuntu/install_docker.sh | ubuntu/install_docker.sh |
if [ $UID -ne 0 ]; then
echo 'requires superuser privilege' 1>&2
exit 13
fi
# Install packages to allow apt to use a repository over HTTPS:
https_packages=(
apt-transport-https
ca-certificates
curl
software-properties-common
)
apt update
apt -y install "${https_packages[@]}"
# Add Docker’s official GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
# Set up the stable Docker repository
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
apt update
# Install Docker CE
apt install docker-ce
|
if [ $UID -ne 0 ]; then
echo 'requires superuser privilege' 1>&2
exit 13
fi
# Uninstall older versions of Docker
sudo apt remove docker docker-engine docker.io
# Install packages to allow apt to use a repository over HTTPS:
https_packages=(
apt-transport-https
ca-certificates
curl
software-properties-common
)
apt update
apt -y install "${https_packages[@]}"
# Add Docker’s official GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
# Set up the stable Docker repository
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
apt update
# Install Docker CE
apt install docker-ce
# Reference:
# Post-installation steps for Linux | Docker Documentation
# https://docs.docker.com/install/linux/linux-postinstall/
# Manage Docker as a non-root user
groupadd docker
gpasswd -a $USER docker
| Update the docker installation script | Update the docker installation script
| Shell | mit | thombashi/dotfiles,thombashi/dotfiles | shell | ## Code Before:
if [ $UID -ne 0 ]; then
echo 'requires superuser privilege' 1>&2
exit 13
fi
# Install packages to allow apt to use a repository over HTTPS:
https_packages=(
apt-transport-https
ca-certificates
curl
software-properties-common
)
apt update
apt -y install "${https_packages[@]}"
# Add Docker’s official GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
# Set up the stable Docker repository
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
apt update
# Install Docker CE
apt install docker-ce
## Instruction:
Update the docker installation script
## Code After:
if [ $UID -ne 0 ]; then
echo 'requires superuser privilege' 1>&2
exit 13
fi
# Uninstall older versions of Docker
sudo apt remove docker docker-engine docker.io
# Install packages to allow apt to use a repository over HTTPS:
https_packages=(
apt-transport-https
ca-certificates
curl
software-properties-common
)
apt update
apt -y install "${https_packages[@]}"
# Add Docker’s official GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
# Set up the stable Docker repository
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
apt update
# Install Docker CE
apt install docker-ce
# Reference:
# Post-installation steps for Linux | Docker Documentation
# https://docs.docker.com/install/linux/linux-postinstall/
# Manage Docker as a non-root user
groupadd docker
gpasswd -a $USER docker
|
3450f3f8730c061183fb8898b9c1fe11e2d98a22 | project_1.html | project_1.html | <!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="d3/d3.min.js"></script>
</head>
<body>
<p>Hello!</p>
</body>
</html> | <!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="d3/d3.min.js"></script>
</head>
<body>
</body>
<script>
var jsonCircles = [
{ "x_axis": 30, "y_axis": 30, "radius": 20, "color" : "green" },
{ "x_axis": 100, "y_axis": 100, "radius": 40, "color" : "purple"},
{ "x_axis": 200, "y_axis": 200, "radius": 50, "color" : "red"}];
var svgContainer = d3.select("body").append("svg")
.attr("width", 600)
.attr("height", 600)
.style("border", "1px solid black");
var circles = svgContainer.selectAll("circle")
.data(jsonCircles)
.enter()
.append("circle");
var circleAttributes = circles
.attr("cx", function (d) { return d.x_axis; })
.attr("cy", function (d) { return d.y_axis; })
.attr("r", function (d) { return d.radius; })
.style("fill", function(d) { return d.color; });
</script>
</html> | Add JSON based data to create SVG circles | Add JSON based data to create SVG circles
| HTML | apache-2.0 | gsluthra/d3js_projects | html | ## Code Before:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="d3/d3.min.js"></script>
</head>
<body>
<p>Hello!</p>
</body>
</html>
## Instruction:
Add JSON based data to create SVG circles
## Code After:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="d3/d3.min.js"></script>
</head>
<body>
</body>
<script>
var jsonCircles = [
{ "x_axis": 30, "y_axis": 30, "radius": 20, "color" : "green" },
{ "x_axis": 100, "y_axis": 100, "radius": 40, "color" : "purple"},
{ "x_axis": 200, "y_axis": 200, "radius": 50, "color" : "red"}];
var svgContainer = d3.select("body").append("svg")
.attr("width", 600)
.attr("height", 600)
.style("border", "1px solid black");
var circles = svgContainer.selectAll("circle")
.data(jsonCircles)
.enter()
.append("circle");
var circleAttributes = circles
.attr("cx", function (d) { return d.x_axis; })
.attr("cy", function (d) { return d.y_axis; })
.attr("r", function (d) { return d.radius; })
.style("fill", function(d) { return d.color; });
</script>
</html> |
d3019abd9e043cb088caa62ccc33056604f485e1 | src/services/fileStorage/utils/filePathHelper.js | src/services/fileStorage/utils/filePathHelper.js | const removeLeadingSlash = path => (path[0] === '/' ? path.substring(1) : path);
const generateFileNameSuffix = fileName => `${Date.now()}-${fileName}`;
const returnFileType = fileName => ({
docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
ppt: 'application/vnd.ms-powerpoint',
xls: 'application/vnd.ms-excel',
doc: 'application/vnd.ms-word',
odt: 'application/vnd.oasis.opendocument.text',
txt: 'text/plain',
pdf: 'application/pdf',
png: 'image/png',
}[fileName.split('.').pop()]);
module.exports = {
removeLeadingSlash,
generateFileNameSuffix,
returnFileType,
};
| const removeLeadingSlash = path => (path[0] === '/' ? path.substring(1) : path);
const generateFileNameSuffix = fileName => `${Date.now()}-${fileName}`;
const returnFileType = fileName => ({
docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
ppt: 'application/vnd.ms-powerpoint',
xls: 'application/vnd.ms-excel',
doc: 'application/vnd.ms-word',
odt: 'application/vnd.oasis.opendocument.text',
txt: 'text/plain',
pdf: 'application/pdf',
png: 'image/png',
jpg: 'image/jpeg',
jpeg: 'image/jpeg',
jpe: 'image/jpeg',
gif: 'image/gif',
tiff: 'image/tiff',
tif: 'image/tiff',
}[fileName.split('.').pop()]);
module.exports = {
removeLeadingSlash,
generateFileNameSuffix,
returnFileType,
};
| Add some image mime types. | Add some image mime types.
| JavaScript | agpl-3.0 | schul-cloud/schulcloud-server,schul-cloud/schulcloud-server,schul-cloud/schulcloud-server | javascript | ## Code Before:
const removeLeadingSlash = path => (path[0] === '/' ? path.substring(1) : path);
const generateFileNameSuffix = fileName => `${Date.now()}-${fileName}`;
const returnFileType = fileName => ({
docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
ppt: 'application/vnd.ms-powerpoint',
xls: 'application/vnd.ms-excel',
doc: 'application/vnd.ms-word',
odt: 'application/vnd.oasis.opendocument.text',
txt: 'text/plain',
pdf: 'application/pdf',
png: 'image/png',
}[fileName.split('.').pop()]);
module.exports = {
removeLeadingSlash,
generateFileNameSuffix,
returnFileType,
};
## Instruction:
Add some image mime types.
## Code After:
const removeLeadingSlash = path => (path[0] === '/' ? path.substring(1) : path);
const generateFileNameSuffix = fileName => `${Date.now()}-${fileName}`;
const returnFileType = fileName => ({
docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
ppt: 'application/vnd.ms-powerpoint',
xls: 'application/vnd.ms-excel',
doc: 'application/vnd.ms-word',
odt: 'application/vnd.oasis.opendocument.text',
txt: 'text/plain',
pdf: 'application/pdf',
png: 'image/png',
jpg: 'image/jpeg',
jpeg: 'image/jpeg',
jpe: 'image/jpeg',
gif: 'image/gif',
tiff: 'image/tiff',
tif: 'image/tiff',
}[fileName.split('.').pop()]);
module.exports = {
removeLeadingSlash,
generateFileNameSuffix,
returnFileType,
};
|
e549552a6e0f8da38cd4ffee99be79a2cb1656bf | .travis.yml | .travis.yml | language: python
python:
- "2.7"
install: "pip install -r pytx/requirements.txt"
env:
- TEST_DIR=pytx
script: cd $TEST_DIR && make test
| language: python
python:
- "2.7"
install: "pip install -r pytx/requirements.txt"
env:
- TEST_DIR=pytx
before_install:
- pip install tox
script: cd $TEST_DIR && make test
| Test requires tox to be installed. | Test requires tox to be installed.
Travis needs to know to install tox so tests can be run.
| YAML | bsd-3-clause | theCatWisel/ThreatExchange,RyPeck/ThreatExchange,tiegz/ThreatExchange,theCatWisel/ThreatExchange,mgoffin/ThreatExchange,wxsBSD/ThreatExchange,mgoffin/ThreatExchange,RyPeck/ThreatExchange,wxsBSD/ThreatExchange,wxsBSD/ThreatExchange,theCatWisel/ThreatExchange,mgoffin/ThreatExchange,mgoffin/ThreatExchange,mgoffin/ThreatExchange,RyPeck/ThreatExchange,tiegz/ThreatExchange,wxsBSD/ThreatExchange,tiegz/ThreatExchange,tiegz/ThreatExchange,RyPeck/ThreatExchange,tiegz/ThreatExchange,RyPeck/ThreatExchange,theCatWisel/ThreatExchange,arirubinstein/ThreatExchange,wxsBSD/ThreatExchange,theCatWisel/ThreatExchange,mgoffin/ThreatExchange,RyPeck/ThreatExchange,wxsBSD/ThreatExchange,tiegz/ThreatExchange,theCatWisel/ThreatExchange | yaml | ## Code Before:
language: python
python:
- "2.7"
install: "pip install -r pytx/requirements.txt"
env:
- TEST_DIR=pytx
script: cd $TEST_DIR && make test
## Instruction:
Test requires tox to be installed.
Travis needs to know to install tox so tests can be run.
## Code After:
language: python
python:
- "2.7"
install: "pip install -r pytx/requirements.txt"
env:
- TEST_DIR=pytx
before_install:
- pip install tox
script: cd $TEST_DIR && make test
|
14752671d56eb3004083b47df88b29b1105e4819 | scripts/ubuntu/networking.sh | scripts/ubuntu/networking.sh |
rm /etc/udev/rules.d/70-persistent-net.rules
mkdir /etc/udev/rules.d/70-persistent-net.rules
rm /lib/udev/rules.d/75-persistent-net-generator.rules
rm -rf /dev/.udev/ /var/lib/dhcp3/*
echo "pre-up sleep 2" >> /etc/network/interfaces
|
rm /etc/udev/rules.d/70-persistent-net.rules
mkdir /etc/udev/rules.d/70-persistent-net.rules
rm /lib/udev/rules.d/75-persistent-net-generator.rules
rm -rf /dev/.udev/ /var/lib/dhcp3/*
| Remove unnecessary 2s sleep in interface pre-up | Remove unnecessary 2s sleep in interface pre-up
| Shell | mit | mayflower/baseboxes | shell | ## Code Before:
rm /etc/udev/rules.d/70-persistent-net.rules
mkdir /etc/udev/rules.d/70-persistent-net.rules
rm /lib/udev/rules.d/75-persistent-net-generator.rules
rm -rf /dev/.udev/ /var/lib/dhcp3/*
echo "pre-up sleep 2" >> /etc/network/interfaces
## Instruction:
Remove unnecessary 2s sleep in interface pre-up
## Code After:
rm /etc/udev/rules.d/70-persistent-net.rules
mkdir /etc/udev/rules.d/70-persistent-net.rules
rm /lib/udev/rules.d/75-persistent-net-generator.rules
rm -rf /dev/.udev/ /var/lib/dhcp3/*
|
345794f454642d3a313b8da4c87a874ed9521c09 | preprocessing/collect_unigrams.py | preprocessing/collect_unigrams.py | from __future__ import absolute_import, division, print_function, unicode_literals
import os
from model.unigrams import Unigrams
CURRENT_DIR = os.path.dirname(os.path.realpath(__file__))
ARTICLES_FILEPATH = "/media/aj/grab/nlp/corpus/processed/wikipedia-ner/annotated-fulltext.txt"
WRITE_UNIGRAMS_FILEPATH = os.path.join(CURRENT_DIR, "unigrams.txt")
WRITE_UNIGRAMS_PERSON_FILEPATH = os.path.join(CURRENT_DIR, "unigrams_per.txt")
def main():
print("Collecting unigrams...")
ug_all = Unigrams()
ug_all.fill_from_articles(ARTICLES_FILEPATH, verbose=True)
ug_all.write_to_file(WRITE_UNIGRAMS_FILEPATH)
ug_all = None
print("Collecting person names (label=PER)...")
ug_names = Unigrams()
ug_names.fill_from_articles_labels(ARTICLES_FILEPATH, ["PER"], verbose=True)
ug_names.write_to_file(WRITE_UNIGRAMS_PERSON_FILEPATH)
print("Finished.")
if __name__ == "__main__":
main()
| from __future__ import absolute_import, division, print_function, unicode_literals
import os
from model.unigrams import Unigrams
from config import *
def main():
"""Main function."""
# collect all unigrams (all labels, including "O")
print("Collecting unigrams...")
ug_all = Unigrams()
ug_all.fill_from_articles(ARTICLES_FILEPATH, verbose=True)
ug_all.write_to_file(UNIGRAMS_FILEPATH)
ug_all = None
# collect only unigrams of label PER
print("Collecting person names (label=PER)...")
ug_names = Unigrams()
ug_names.fill_from_articles_labels(ARTICLES_FILEPATH, ["PER"], verbose=True)
ug_names.write_to_file(UNIGRAMS_PERSON_FILEPATH)
print("Finished.")
if __name__ == "__main__":
main()
| Add documentation, refactor to use config | Add documentation, refactor to use config
| Python | mit | aleju/ner-crf | python | ## Code Before:
from __future__ import absolute_import, division, print_function, unicode_literals
import os
from model.unigrams import Unigrams
CURRENT_DIR = os.path.dirname(os.path.realpath(__file__))
ARTICLES_FILEPATH = "/media/aj/grab/nlp/corpus/processed/wikipedia-ner/annotated-fulltext.txt"
WRITE_UNIGRAMS_FILEPATH = os.path.join(CURRENT_DIR, "unigrams.txt")
WRITE_UNIGRAMS_PERSON_FILEPATH = os.path.join(CURRENT_DIR, "unigrams_per.txt")
def main():
print("Collecting unigrams...")
ug_all = Unigrams()
ug_all.fill_from_articles(ARTICLES_FILEPATH, verbose=True)
ug_all.write_to_file(WRITE_UNIGRAMS_FILEPATH)
ug_all = None
print("Collecting person names (label=PER)...")
ug_names = Unigrams()
ug_names.fill_from_articles_labels(ARTICLES_FILEPATH, ["PER"], verbose=True)
ug_names.write_to_file(WRITE_UNIGRAMS_PERSON_FILEPATH)
print("Finished.")
if __name__ == "__main__":
main()
## Instruction:
Add documentation, refactor to use config
## Code After:
from __future__ import absolute_import, division, print_function, unicode_literals
import os
from model.unigrams import Unigrams
from config import *
def main():
"""Main function."""
# collect all unigrams (all labels, including "O")
print("Collecting unigrams...")
ug_all = Unigrams()
ug_all.fill_from_articles(ARTICLES_FILEPATH, verbose=True)
ug_all.write_to_file(UNIGRAMS_FILEPATH)
ug_all = None
# collect only unigrams of label PER
print("Collecting person names (label=PER)...")
ug_names = Unigrams()
ug_names.fill_from_articles_labels(ARTICLES_FILEPATH, ["PER"], verbose=True)
ug_names.write_to_file(UNIGRAMS_PERSON_FILEPATH)
print("Finished.")
if __name__ == "__main__":
main()
|
39649bbf59bb62085d26d7314f2cd0ed2bce893b | config/schedule.rb | config/schedule.rb | set :output, { error: 'log/cron.error.log', standard: 'log/cron.log'}
every 1.hour do
rake "tariff:download"
end
every 1.day, at: '5am' do
rake "tariff:sync"
end
| set :output, { error: 'log/cron.error.log', standard: 'log/cron.log'}
every 1.hour do
rake "tariff:sync:download"
end
every 1.day, at: '5am' do
rake "tariff:sync:apply"
end
| Fix task names, add sync namespace. | Fix task names, add sync namespace.
| Ruby | mit | alphagov/trade-tariff-backend,alphagov/trade-tariff-backend,leftees/trade-tariff-backend,leftees/trade-tariff-backend,bitzesty/trade-tariff-backend,alphagov/trade-tariff-backend,bitzesty/trade-tariff-backend,bitzesty/trade-tariff-backend,leftees/trade-tariff-backend | ruby | ## Code Before:
set :output, { error: 'log/cron.error.log', standard: 'log/cron.log'}
every 1.hour do
rake "tariff:download"
end
every 1.day, at: '5am' do
rake "tariff:sync"
end
## Instruction:
Fix task names, add sync namespace.
## Code After:
set :output, { error: 'log/cron.error.log', standard: 'log/cron.log'}
every 1.hour do
rake "tariff:sync:download"
end
every 1.day, at: '5am' do
rake "tariff:sync:apply"
end
|
b32e73bd0090bcb2dc661141a4196416391a75e0 | emacs/.doom.d/config.el | emacs/.doom.d/config.el | ;;; ~/.doom.d/config.el -*- lexical-binding: t; -*-
(setq doom-font (font-spec :family "Source Code Pro" :size 20)
doom-big-font (font-spec :family "Source Code Pro" :size 26)
display-line-numbers-type nil
org-log-done 'time
evil-escape-excluded-states '(normal multiedit emacs motion)
)
;;
;; Key bindings
(map! :leader
(:prefix "c"
:desc "Sort lines alphabetically" :v "s" #'sort-lines)
(:prefix "w"
"F" #'make-frame))
(after! projectile
(projectile-register-project-type
'bazel '("WORKSPACE")
:compile "bazel build //..."
:test "bazel test //..."))
(after! org
(load "~/Sync/org/orgmode.el"))
(direnv-mode)
| ;;; ~/.doom.d/config.el -*- lexical-binding: t; -*-
(setq doom-font (font-spec :family "Source Code Pro" :size 20)
doom-big-font (font-spec :family "Source Code Pro" :size 26)
display-line-numbers-type nil
org-log-done 'time
evil-escape-excluded-states '(normal multiedit emacs motion)
)
;;
;; Key bindings
(map! :leader
(:prefix "c"
:desc "Sort lines alphabetically" :v "s" #'sort-lines)
(:prefix "w"
"F" #'make-frame)
(:prefix "/"
; Universal argument doesn't seem to work with the function wrapper
:desc "Search project" "p" #'counsel-rg))
(after! projectile
(projectile-register-project-type
'bazel '("WORKSPACE")
:compile "bazel build //..."
:test "bazel test //..."))
(after! org
(load "~/Sync/org/orgmode.el"))
(direnv-mode)
| Support universal argument when searching project | Support universal argument when searching project
| Emacs Lisp | unlicense | jdnavarro/dotfiles | emacs-lisp | ## Code Before:
;;; ~/.doom.d/config.el -*- lexical-binding: t; -*-
(setq doom-font (font-spec :family "Source Code Pro" :size 20)
doom-big-font (font-spec :family "Source Code Pro" :size 26)
display-line-numbers-type nil
org-log-done 'time
evil-escape-excluded-states '(normal multiedit emacs motion)
)
;;
;; Key bindings
(map! :leader
(:prefix "c"
:desc "Sort lines alphabetically" :v "s" #'sort-lines)
(:prefix "w"
"F" #'make-frame))
(after! projectile
(projectile-register-project-type
'bazel '("WORKSPACE")
:compile "bazel build //..."
:test "bazel test //..."))
(after! org
(load "~/Sync/org/orgmode.el"))
(direnv-mode)
## Instruction:
Support universal argument when searching project
## Code After:
;;; ~/.doom.d/config.el -*- lexical-binding: t; -*-
(setq doom-font (font-spec :family "Source Code Pro" :size 20)
doom-big-font (font-spec :family "Source Code Pro" :size 26)
display-line-numbers-type nil
org-log-done 'time
evil-escape-excluded-states '(normal multiedit emacs motion)
)
;;
;; Key bindings
(map! :leader
(:prefix "c"
:desc "Sort lines alphabetically" :v "s" #'sort-lines)
(:prefix "w"
"F" #'make-frame)
(:prefix "/"
; Universal argument doesn't seem to work with the function wrapper
:desc "Search project" "p" #'counsel-rg))
(after! projectile
(projectile-register-project-type
'bazel '("WORKSPACE")
:compile "bazel build //..."
:test "bazel test //..."))
(after! org
(load "~/Sync/org/orgmode.el"))
(direnv-mode)
|
8be6da3b9e29bc5701fad75f3253a30805f28cf4 | writer_unsafe.go | writer_unsafe.go | // +build !appengine,!tinygo
package fwd
import (
"reflect"
"unsafe"
)
// unsafe cast string as []byte
func unsafestr(b string) []byte {
l := len(b)
return *(*[]byte)(unsafe.Pointer(&reflect.SliceHeader{
Len: l,
Cap: l,
Data: (*reflect.StringHeader)(unsafe.Pointer(&b)).Data,
}))
}
| // +build !appengine,!tinygo
package fwd
import (
"reflect"
"unsafe"
)
// unsafe cast string as []byte
func unsafestr(s string) []byte {
var b []byte
sHdr := (*reflect.StringHeader)(unsafe.Pointer(&s))
bHdr := (*reflect.SliceHeader)(unsafe.Pointer(&b))
bHdr.Data = sHdr.Data
bHdr.Len = sHdr.Len
bHdr.Cap = sHdr.Len
return b
}
| Fix invalid usage of reflect.SliceHeader | Fix invalid usage of reflect.SliceHeader
Using plain reflect.SliceHeader struct violates unsafe pointer 6th rule.
| Go | mit | philhofer/fwd | go | ## Code Before:
// +build !appengine,!tinygo
package fwd
import (
"reflect"
"unsafe"
)
// unsafe cast string as []byte
func unsafestr(b string) []byte {
l := len(b)
return *(*[]byte)(unsafe.Pointer(&reflect.SliceHeader{
Len: l,
Cap: l,
Data: (*reflect.StringHeader)(unsafe.Pointer(&b)).Data,
}))
}
## Instruction:
Fix invalid usage of reflect.SliceHeader
Using plain reflect.SliceHeader struct violates unsafe pointer 6th rule.
## Code After:
// +build !appengine,!tinygo
package fwd
import (
"reflect"
"unsafe"
)
// unsafe cast string as []byte
func unsafestr(s string) []byte {
var b []byte
sHdr := (*reflect.StringHeader)(unsafe.Pointer(&s))
bHdr := (*reflect.SliceHeader)(unsafe.Pointer(&b))
bHdr.Data = sHdr.Data
bHdr.Len = sHdr.Len
bHdr.Cap = sHdr.Len
return b
}
|
0b387150ba1906e912d66f70fb094612eb86564c | kernel/sources.cmake | kernel/sources.cmake | cmake_minimum_required(VERSION 3.2)
set(
KERNEL_NOARCH_SOURCES_GLOB
"${CMAKE_SOURCE_DIR}/kernel/*.c"
"${CMAKE_SOURCE_DIR}/kernel/*/*.c"
"${CMAKE_SOURCE_DIR}/kernel/fs/*/*.c"
"${CMAKE_SOURCE_DIR}/common/*.c"
"${CMAKE_SOURCE_DIR}/common/3rd_party/datetime.c"
"${CMAKE_SOURCE_DIR}/common/3rd_party/crc32.c"
)
if (KERNEL_SELFTESTS)
list(
APPEND
KERNEL_NOARCH_SOURCES_GLOB
"${CMAKE_SOURCE_DIR}/tests/self/*.c"
)
endif()
file(GLOB KERNEL_NOARCH_SOURCES ${KERNEL_NOARCH_SOURCES_GLOB})
| cmake_minimum_required(VERSION 3.2)
set(
KERNEL_NOARCH_SOURCES_GLOB
"${CMAKE_SOURCE_DIR}/kernel/*.c"
"${CMAKE_SOURCE_DIR}/kernel/*.cpp"
"${CMAKE_SOURCE_DIR}/kernel/*/*.c"
"${CMAKE_SOURCE_DIR}/kernel/*/*.cpp"
"${CMAKE_SOURCE_DIR}/kernel/fs/*/*.c"
"${CMAKE_SOURCE_DIR}/kernel/fs/*/*.cpp"
"${CMAKE_SOURCE_DIR}/common/*.c"
"${CMAKE_SOURCE_DIR}/common/3rd_party/datetime.c"
"${CMAKE_SOURCE_DIR}/common/3rd_party/crc32.c"
)
if (KERNEL_SELFTESTS)
list(
APPEND
KERNEL_NOARCH_SOURCES_GLOB
"${CMAKE_SOURCE_DIR}/tests/self/*.c"
)
endif()
file(GLOB KERNEL_NOARCH_SOURCES ${KERNEL_NOARCH_SOURCES_GLOB})
| Allow C++ files also in the kernel/ directory | [cmake] Allow C++ files also in the kernel/ directory
| CMake | bsd-2-clause | vvaltchev/experimentOs,vvaltchev/experimentOs,vvaltchev/experimentOs,vvaltchev/experimentOs | cmake | ## Code Before:
cmake_minimum_required(VERSION 3.2)
set(
KERNEL_NOARCH_SOURCES_GLOB
"${CMAKE_SOURCE_DIR}/kernel/*.c"
"${CMAKE_SOURCE_DIR}/kernel/*/*.c"
"${CMAKE_SOURCE_DIR}/kernel/fs/*/*.c"
"${CMAKE_SOURCE_DIR}/common/*.c"
"${CMAKE_SOURCE_DIR}/common/3rd_party/datetime.c"
"${CMAKE_SOURCE_DIR}/common/3rd_party/crc32.c"
)
if (KERNEL_SELFTESTS)
list(
APPEND
KERNEL_NOARCH_SOURCES_GLOB
"${CMAKE_SOURCE_DIR}/tests/self/*.c"
)
endif()
file(GLOB KERNEL_NOARCH_SOURCES ${KERNEL_NOARCH_SOURCES_GLOB})
## Instruction:
[cmake] Allow C++ files also in the kernel/ directory
## Code After:
cmake_minimum_required(VERSION 3.2)
set(
KERNEL_NOARCH_SOURCES_GLOB
"${CMAKE_SOURCE_DIR}/kernel/*.c"
"${CMAKE_SOURCE_DIR}/kernel/*.cpp"
"${CMAKE_SOURCE_DIR}/kernel/*/*.c"
"${CMAKE_SOURCE_DIR}/kernel/*/*.cpp"
"${CMAKE_SOURCE_DIR}/kernel/fs/*/*.c"
"${CMAKE_SOURCE_DIR}/kernel/fs/*/*.cpp"
"${CMAKE_SOURCE_DIR}/common/*.c"
"${CMAKE_SOURCE_DIR}/common/3rd_party/datetime.c"
"${CMAKE_SOURCE_DIR}/common/3rd_party/crc32.c"
)
if (KERNEL_SELFTESTS)
list(
APPEND
KERNEL_NOARCH_SOURCES_GLOB
"${CMAKE_SOURCE_DIR}/tests/self/*.c"
)
endif()
file(GLOB KERNEL_NOARCH_SOURCES ${KERNEL_NOARCH_SOURCES_GLOB})
|
fb66bb4a8adb122cf73ee126d06c6ae0f2801517 | src/main/scripts/PageRank.sh | src/main/scripts/PageRank.sh |
hadoop jar page-rank.jar com.github.ygf.pagerank.PageRank \
-D pagerank.block_size=10000 \
-D pagerank.damping_factor=0.85 \
-D pagerank.max_iterations=2 \
-D pagerank.top_results=100 \
-D yarn.am.liveness-monitor.expiry-interval-ms=3600000 \
-D yarn.nm.liveness-monitor.expiry-interval-ms=3600000 \
-D yarn.resourcemanager.container.liveness-monitor.interval-ms=3600000 \
-D mapreduce.jobtracker.expire.trackers.interval=3600000 \
-D mapreduce.task.timeout=3600000 \
"$@"
|
hadoop jar page-rank.jar com.github.ygf.pagerank.PageRank \
-D pagerank.block_size=10000 \
-D pagerank.damping_factor=0.85 \
-D pagerank.max_iterations=2 \
-D pagerank.top_results=100 \
"$@"
| Remove the timeout settings used during development in pseudo-distributed mode. | Remove the timeout settings used during development in pseudo-distributed mode.
| Shell | apache-2.0 | yasserglez/pagerank-hadoop,yasserglez/pagerank-hadoop | shell | ## Code Before:
hadoop jar page-rank.jar com.github.ygf.pagerank.PageRank \
-D pagerank.block_size=10000 \
-D pagerank.damping_factor=0.85 \
-D pagerank.max_iterations=2 \
-D pagerank.top_results=100 \
-D yarn.am.liveness-monitor.expiry-interval-ms=3600000 \
-D yarn.nm.liveness-monitor.expiry-interval-ms=3600000 \
-D yarn.resourcemanager.container.liveness-monitor.interval-ms=3600000 \
-D mapreduce.jobtracker.expire.trackers.interval=3600000 \
-D mapreduce.task.timeout=3600000 \
"$@"
## Instruction:
Remove the timeout settings used during development in pseudo-distributed mode.
## Code After:
hadoop jar page-rank.jar com.github.ygf.pagerank.PageRank \
-D pagerank.block_size=10000 \
-D pagerank.damping_factor=0.85 \
-D pagerank.max_iterations=2 \
-D pagerank.top_results=100 \
"$@"
|
3b7b15db24ac738c143e3d2d38c740500ac73fd0 | jinja2_time/jinja2_time.py | jinja2_time/jinja2_time.py |
import arrow
from jinja2 import nodes
from jinja2.ext import Extension
class TimeExtension(Extension):
tags = set(['now'])
def __init__(self, environment):
super(TimeExtension, self).__init__(environment)
# add the defaults to the environment
environment.extend(
date_format='%Y-%m-%d',
)
def _now(self, timezone, date_format):
date_format = date_format or self.environment.date_format
return arrow.now(timezone).strftime(date_format)
def parse(self, parser):
lineno = next(parser.stream).lineno
args = [parser.parse_expression()]
if parser.stream.skip_if('comma'):
args.append(parser.parse_expression())
else:
args.append(nodes.Const(None))
call = self.call_method('_now', args, lineno=lineno)
return nodes.Output([call], lineno=lineno)
|
import arrow
from jinja2 import nodes
from jinja2.ext import Extension
class TimeExtension(Extension):
tags = set(['now'])
def __init__(self, environment):
super(TimeExtension, self).__init__(environment)
# add the defaults to the environment
environment.extend(
datetime_format='%Y-%m-%d',
)
def _now(self, timezone, datetime_format):
datetime_format = datetime_format or self.environment.datetime_format
return arrow.now(timezone).strftime(datetime_format)
def parse(self, parser):
lineno = next(parser.stream).lineno
args = [parser.parse_expression()]
if parser.stream.skip_if('comma'):
args.append(parser.parse_expression())
else:
args.append(nodes.Const(None))
call = self.call_method('_now', args, lineno=lineno)
return nodes.Output([call], lineno=lineno)
| Change environment attribute name to datetime_format | Change environment attribute name to datetime_format
| Python | mit | hackebrot/jinja2-time | python | ## Code Before:
import arrow
from jinja2 import nodes
from jinja2.ext import Extension
class TimeExtension(Extension):
tags = set(['now'])
def __init__(self, environment):
super(TimeExtension, self).__init__(environment)
# add the defaults to the environment
environment.extend(
date_format='%Y-%m-%d',
)
def _now(self, timezone, date_format):
date_format = date_format or self.environment.date_format
return arrow.now(timezone).strftime(date_format)
def parse(self, parser):
lineno = next(parser.stream).lineno
args = [parser.parse_expression()]
if parser.stream.skip_if('comma'):
args.append(parser.parse_expression())
else:
args.append(nodes.Const(None))
call = self.call_method('_now', args, lineno=lineno)
return nodes.Output([call], lineno=lineno)
## Instruction:
Change environment attribute name to datetime_format
## Code After:
import arrow
from jinja2 import nodes
from jinja2.ext import Extension
class TimeExtension(Extension):
tags = set(['now'])
def __init__(self, environment):
super(TimeExtension, self).__init__(environment)
# add the defaults to the environment
environment.extend(
datetime_format='%Y-%m-%d',
)
def _now(self, timezone, datetime_format):
datetime_format = datetime_format or self.environment.datetime_format
return arrow.now(timezone).strftime(datetime_format)
def parse(self, parser):
lineno = next(parser.stream).lineno
args = [parser.parse_expression()]
if parser.stream.skip_if('comma'):
args.append(parser.parse_expression())
else:
args.append(nodes.Const(None))
call = self.call_method('_now', args, lineno=lineno)
return nodes.Output([call], lineno=lineno)
|
5c40cbfcb89649738945eda02c1bfb804e2ecdae | us_ignite/mailinglist/views.py | us_ignite/mailinglist/views.py | import hashlib
import mailchimp
from django.contrib import messages
from django.conf import settings
from django.shortcuts import redirect
from django.template.response import TemplateResponse
from us_ignite.mailinglist.forms import EmailForm
def subscribe_email(email):
master = mailchimp.Mailchimp(settings.MAILCHIMP_API_KEY)
mailing_list = mailchimp.Lists(master)
uid = hashlib.md5(email).hexdigest()
email_data = {
'email': email,
'euid': uid,
'leid': uid,
}
return mailing_list.subscribe(
settings.MAILCHIMP_LIST, email_data)
def mailing_subscribe(request):
"""Handles MailChimp email registration."""
if request.method == 'POST':
form = EmailForm(request.POST)
if form.is_valid():
try:
subscribe_email(form.cleaned_data['email'])
messages.success(request, 'Successfully subscribed.')
redirect_to = 'home'
except mailchimp.ListAlreadySubscribedError:
messages.error(request, 'Already subscribed.')
redirect_to = 'mailing_subscribe'
return redirect(redirect_to)
else:
form = EmailForm()
context = {
'form': form,
}
return TemplateResponse(request, 'mailinglist/form.html', context)
| import hashlib
import logging
import mailchimp
from django.contrib import messages
from django.conf import settings
from django.shortcuts import redirect
from django.template.response import TemplateResponse
from us_ignite.mailinglist.forms import EmailForm
logger = logging.getLogger('us_ignite.mailinglist.views')
def subscribe_email(email):
master = mailchimp.Mailchimp(settings.MAILCHIMP_API_KEY)
mailing_list = mailchimp.Lists(master)
uid = hashlib.md5(email).hexdigest()
email_data = {
'email': email,
'euid': uid,
'leid': uid,
}
return mailing_list.subscribe(
settings.MAILCHIMP_LIST, email_data)
def mailing_subscribe(request):
"""Handles MailChimp email registration."""
if request.method == 'POST':
form = EmailForm(request.POST)
if form.is_valid():
try:
subscribe_email(form.cleaned_data['email'])
messages.success(request, 'Successfully subscribed.')
redirect_to = 'home'
except mailchimp.ListAlreadySubscribedError:
messages.error(request, 'Already subscribed.')
redirect_to = 'mailing_subscribe'
except Exception, e:
logger.exception(e)
msg = (u'There is a problem with the maling list. '
'Please try again later.')
messages.error(request, msg)
redirect_to = 'mailing_subscribe'
return redirect(redirect_to)
else:
form = EmailForm()
context = {
'form': form,
}
return TemplateResponse(request, 'mailinglist/form.html', context)
| Improve handling of errors during mailing list subscription. | Improve handling of errors during mailing list subscription.
https://github.com/madewithbytes/us_ignite/issues/209
Any exception thrown by the mailchimp component will
be handled gracefully and logged.
| Python | bsd-3-clause | us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite | python | ## Code Before:
import hashlib
import mailchimp
from django.contrib import messages
from django.conf import settings
from django.shortcuts import redirect
from django.template.response import TemplateResponse
from us_ignite.mailinglist.forms import EmailForm
def subscribe_email(email):
master = mailchimp.Mailchimp(settings.MAILCHIMP_API_KEY)
mailing_list = mailchimp.Lists(master)
uid = hashlib.md5(email).hexdigest()
email_data = {
'email': email,
'euid': uid,
'leid': uid,
}
return mailing_list.subscribe(
settings.MAILCHIMP_LIST, email_data)
def mailing_subscribe(request):
"""Handles MailChimp email registration."""
if request.method == 'POST':
form = EmailForm(request.POST)
if form.is_valid():
try:
subscribe_email(form.cleaned_data['email'])
messages.success(request, 'Successfully subscribed.')
redirect_to = 'home'
except mailchimp.ListAlreadySubscribedError:
messages.error(request, 'Already subscribed.')
redirect_to = 'mailing_subscribe'
return redirect(redirect_to)
else:
form = EmailForm()
context = {
'form': form,
}
return TemplateResponse(request, 'mailinglist/form.html', context)
## Instruction:
Improve handling of errors during mailing list subscription.
https://github.com/madewithbytes/us_ignite/issues/209
Any exception thrown by the mailchimp component will
be handled gracefully and logged.
## Code After:
import hashlib
import logging
import mailchimp
from django.contrib import messages
from django.conf import settings
from django.shortcuts import redirect
from django.template.response import TemplateResponse
from us_ignite.mailinglist.forms import EmailForm
logger = logging.getLogger('us_ignite.mailinglist.views')
def subscribe_email(email):
master = mailchimp.Mailchimp(settings.MAILCHIMP_API_KEY)
mailing_list = mailchimp.Lists(master)
uid = hashlib.md5(email).hexdigest()
email_data = {
'email': email,
'euid': uid,
'leid': uid,
}
return mailing_list.subscribe(
settings.MAILCHIMP_LIST, email_data)
def mailing_subscribe(request):
"""Handles MailChimp email registration."""
if request.method == 'POST':
form = EmailForm(request.POST)
if form.is_valid():
try:
subscribe_email(form.cleaned_data['email'])
messages.success(request, 'Successfully subscribed.')
redirect_to = 'home'
except mailchimp.ListAlreadySubscribedError:
messages.error(request, 'Already subscribed.')
redirect_to = 'mailing_subscribe'
except Exception, e:
logger.exception(e)
msg = (u'There is a problem with the maling list. '
'Please try again later.')
messages.error(request, msg)
redirect_to = 'mailing_subscribe'
return redirect(redirect_to)
else:
form = EmailForm()
context = {
'form': form,
}
return TemplateResponse(request, 'mailinglist/form.html', context)
|
3d2529bf96735b419295ff0a8ab62c6fb235f853 | private.html | private.html | <html>
<body>
</body>
<a href="https://mega.co.nz/#F!nh9nHYjD!iqC350Q-09JUEqwfnTXcHg">Image Library</a>
<a href="http://www.smbc-comics.com/?id=3432">Object Sense Organ</a><br />
<a href="http://imgur.com/a/tgcdw">Pranking Cats</a><br />
<a href="http://i.imgur.com/KlDDjhf.gif">Crow asking for water</a><br />
</html>
| <html>
<body>
</body>
<a href="https://mega.co.nz/#F!nh9nHYjD!iqC350Q-09JUEqwfnTXcHg">Image Library</a>
<a href="http://www.smbc-comics.com/?id=3432">Object Sense Organ</a><br />
<a href="http://imgur.com/a/tgcdw">Pranking Cats</a><br />
<a href="http://i.imgur.com/KlDDjhf.gif">Crow asking for water</a><br />
<a href="https://www.youtube.com/watch?v=EdRMVhlNP5I&index=4&list=FLGAHaGyPeVvsfuX14LSTqmg">I Just bought this one.</a>
</html>
| Add best buy's outdate world video. | Add best buy's outdate world video.
| HTML | apache-2.0 | wparad/wparad.github.io,wparad/wparad.github.io | html | ## Code Before:
<html>
<body>
</body>
<a href="https://mega.co.nz/#F!nh9nHYjD!iqC350Q-09JUEqwfnTXcHg">Image Library</a>
<a href="http://www.smbc-comics.com/?id=3432">Object Sense Organ</a><br />
<a href="http://imgur.com/a/tgcdw">Pranking Cats</a><br />
<a href="http://i.imgur.com/KlDDjhf.gif">Crow asking for water</a><br />
</html>
## Instruction:
Add best buy's outdate world video.
## Code After:
<html>
<body>
</body>
<a href="https://mega.co.nz/#F!nh9nHYjD!iqC350Q-09JUEqwfnTXcHg">Image Library</a>
<a href="http://www.smbc-comics.com/?id=3432">Object Sense Organ</a><br />
<a href="http://imgur.com/a/tgcdw">Pranking Cats</a><br />
<a href="http://i.imgur.com/KlDDjhf.gif">Crow asking for water</a><br />
<a href="https://www.youtube.com/watch?v=EdRMVhlNP5I&index=4&list=FLGAHaGyPeVvsfuX14LSTqmg">I Just bought this one.</a>
</html>
|
d30ccade13f8937c1662aee95a7abb259b996d27 | packages/st/stable-marriage.yaml | packages/st/stable-marriage.yaml | homepage: http://github.com/cutsea110/stable-marriage
changelog-type: markdown
hash: 1e29215f2d71ce5b4ec698fc49dd5264cbb58a6baca67183ccdca1fed56394aa
test-bench-deps: {}
maintainer: [email protected]
synopsis: algorithms around stable marriage
changelog: |+
RELEASE-0.1.3.0
================
* maintenance
basic-deps:
base: ^>=4.12.0.0
ghc-prim: '>=0.4 && <0.6'
all-versions:
- 0.1.0.0
- 0.1.1.0
- 0.1.2.0
- 0.1.3.0
author: cutsea110
latest: 0.1.3.0
description-type: haddock
description: algorithms around stable marriage, in the field of operations research.
license-name: BSD-3-Clause
| homepage: http://github.com/cutsea110/stable-marriage
changelog-type: markdown
hash: 7ee37f2c44cf79b513614a1a7b48d0576f4c50b6e30cf7db726ce80d0178c508
test-bench-deps:
base: '>=4.12.0.0 && <4.14'
ghc-prim: ^>=0.5.3
maintainer: [email protected]
synopsis: algorithms around stable marriage
changelog: |+
RELEASE-0.1.3.0
================
* maintenance
basic-deps:
base: '>=4.12.0.0 && <4.14'
ghc-prim: '>=0.4 && <0.6'
all-versions:
- 0.1.0.0
- 0.1.1.0
- 0.1.2.0
- 0.1.3.0
- 0.2.0.0
author: cutsea110
latest: 0.2.0.0
description-type: haddock
description: algorithms around stable marriage, in the field of operations research.
license-name: BSD-3-Clause
| Update from Hackage at 2020-07-12T05:28:10Z | Update from Hackage at 2020-07-12T05:28:10Z
| YAML | mit | commercialhaskell/all-cabal-metadata | yaml | ## Code Before:
homepage: http://github.com/cutsea110/stable-marriage
changelog-type: markdown
hash: 1e29215f2d71ce5b4ec698fc49dd5264cbb58a6baca67183ccdca1fed56394aa
test-bench-deps: {}
maintainer: [email protected]
synopsis: algorithms around stable marriage
changelog: |+
RELEASE-0.1.3.0
================
* maintenance
basic-deps:
base: ^>=4.12.0.0
ghc-prim: '>=0.4 && <0.6'
all-versions:
- 0.1.0.0
- 0.1.1.0
- 0.1.2.0
- 0.1.3.0
author: cutsea110
latest: 0.1.3.0
description-type: haddock
description: algorithms around stable marriage, in the field of operations research.
license-name: BSD-3-Clause
## Instruction:
Update from Hackage at 2020-07-12T05:28:10Z
## Code After:
homepage: http://github.com/cutsea110/stable-marriage
changelog-type: markdown
hash: 7ee37f2c44cf79b513614a1a7b48d0576f4c50b6e30cf7db726ce80d0178c508
test-bench-deps:
base: '>=4.12.0.0 && <4.14'
ghc-prim: ^>=0.5.3
maintainer: [email protected]
synopsis: algorithms around stable marriage
changelog: |+
RELEASE-0.1.3.0
================
* maintenance
basic-deps:
base: '>=4.12.0.0 && <4.14'
ghc-prim: '>=0.4 && <0.6'
all-versions:
- 0.1.0.0
- 0.1.1.0
- 0.1.2.0
- 0.1.3.0
- 0.2.0.0
author: cutsea110
latest: 0.2.0.0
description-type: haddock
description: algorithms around stable marriage, in the field of operations research.
license-name: BSD-3-Clause
|
bc58effd53f4b2d3968b4cbe375bf5ea1fac4d0c | fcrepo-integrationtest/fcrepo-integrationtest-core/src/main/resources/scripts/tomcat-run.xml | fcrepo-integrationtest/fcrepo-integrationtest-core/src/main/resources/scripts/tomcat-run.xml | <project name="tomcat-run">
<taskdef resource="net/sf/antcontrib/antcontrib.properties" />
<target name="tomcat-start">
<java jar="${tomcat.home}/bin/bootstrap.jar" fork="yes" dir="${tomcat.home}" spawn="true">
<jvmarg value="-Djava.io.tmpdir=${tomcat.home}/temp" />
<jvmarg value="-XX:MaxPermSize=512M" />
<jvmarg value="-Xmx512M" />
<env key="FEDORA_HOME" value="${fedora.home}" />
<arg line="start" />
</java>
</target>
<target name="tomcat-stop">
<java jar="${tomcat.home}/bin/bootstrap.jar" fork="yes" dir="${tomcat.home}" spawn="true">
<jvmarg value="-Djava.io.tmpdir=${tomcat.home}/temp" />
<env key="FEDORA_HOME" value="${fedora.home}" />
<arg line="stop" />
</java>
</target>
</project> | <project name="tomcat-run">
<taskdef resource="net/sf/antcontrib/antcontrib.properties" />
<target name="tomcat-start">
<parallel>
<java jar="${tomcat.home}/bin/bootstrap.jar" fork="yes" dir="${tomcat.home}" spawn="true">
<jvmarg value="-Djava.io.tmpdir=${tomcat.home}/temp" />
<jvmarg value="-XX:MaxPermSize=512M" />
<jvmarg value="-Xmx512M" />
<env key="FEDORA_HOME" value="${fedora.home}" />
<arg line="start" />
</java>
<sequential>
<waitfor maxwait="30" maxwaitunit="second" checkevery="2">
<socket server="127.0.0.1" port="${fedora.port}"/>
</waitfor>
<echo>Fedora started</echo>
</sequential>
</parallel>
</target>
<target name="tomcat-stop">
<java jar="${tomcat.home}/bin/bootstrap.jar" fork="yes" dir="${tomcat.home}" spawn="true">
<jvmarg value="-Djava.io.tmpdir=${tomcat.home}/temp" />
<env key="FEDORA_HOME" value="${fedora.home}" />
<arg line="stop" />
</java>
</target>
</project> | Check that tomcat is started bedore tests start | FCREPO-829: Check that tomcat is started bedore tests start
| XML | apache-2.0 | andreasnef/fcrepo,DBCDK/fcrepo-3.5-patched,DBCDK/fcrepo-3.5-patched,fcrepo3/fcrepo,DBCDK/fcrepo-3.5-patched,fcrepo3/fcrepo,DBCDK/fcrepo-3.5-patched,andreasnef/fcrepo,fcrepo3/fcrepo,andreasnef/fcrepo,andreasnef/fcrepo,fcrepo3/fcrepo | xml | ## Code Before:
<project name="tomcat-run">
<taskdef resource="net/sf/antcontrib/antcontrib.properties" />
<target name="tomcat-start">
<java jar="${tomcat.home}/bin/bootstrap.jar" fork="yes" dir="${tomcat.home}" spawn="true">
<jvmarg value="-Djava.io.tmpdir=${tomcat.home}/temp" />
<jvmarg value="-XX:MaxPermSize=512M" />
<jvmarg value="-Xmx512M" />
<env key="FEDORA_HOME" value="${fedora.home}" />
<arg line="start" />
</java>
</target>
<target name="tomcat-stop">
<java jar="${tomcat.home}/bin/bootstrap.jar" fork="yes" dir="${tomcat.home}" spawn="true">
<jvmarg value="-Djava.io.tmpdir=${tomcat.home}/temp" />
<env key="FEDORA_HOME" value="${fedora.home}" />
<arg line="stop" />
</java>
</target>
</project>
## Instruction:
FCREPO-829: Check that tomcat is started bedore tests start
## Code After:
<project name="tomcat-run">
<taskdef resource="net/sf/antcontrib/antcontrib.properties" />
<target name="tomcat-start">
<parallel>
<java jar="${tomcat.home}/bin/bootstrap.jar" fork="yes" dir="${tomcat.home}" spawn="true">
<jvmarg value="-Djava.io.tmpdir=${tomcat.home}/temp" />
<jvmarg value="-XX:MaxPermSize=512M" />
<jvmarg value="-Xmx512M" />
<env key="FEDORA_HOME" value="${fedora.home}" />
<arg line="start" />
</java>
<sequential>
<waitfor maxwait="30" maxwaitunit="second" checkevery="2">
<socket server="127.0.0.1" port="${fedora.port}"/>
</waitfor>
<echo>Fedora started</echo>
</sequential>
</parallel>
</target>
<target name="tomcat-stop">
<java jar="${tomcat.home}/bin/bootstrap.jar" fork="yes" dir="${tomcat.home}" spawn="true">
<jvmarg value="-Djava.io.tmpdir=${tomcat.home}/temp" />
<env key="FEDORA_HOME" value="${fedora.home}" />
<arg line="stop" />
</java>
</target>
</project> |
de9fa610b9e6d0a8fa3cfd49bc76c08e80cc14f7 | requirements_demo.txt | requirements_demo.txt | https://github.com/django-oscar/django-oscar-stores/archive/feature/oscar-1.1.zip#egg=django-oscar-stores==1.0-dev
django-oscar-paypal==0.9.1
django-oscar-datacash==0.8.3
# We need PostGIS as the stores extension uses GeoDjango.
psycopg2==2.5.1
# To use Solr, we need pysolr
pysolr==3.2
raven==4.0.3
| https://github.com/django-oscar/django-oscar-stores/archive/630aa146066cd327085fe9206dc50f6e520cc023.zip#egg=django-oscar-stores==1.0-dev
django-oscar-paypal==0.9.1
django-oscar-datacash==0.8.3
# We need PostGIS as the stores extension uses GeoDjango.
psycopg2==2.5.1
# To use Solr, we need pysolr
pysolr==3.2
raven==4.0.3
| Update requirement for django-oscar-stores (demo site) | Update requirement for django-oscar-stores (demo site)
| Text | bsd-3-clause | lijoantony/django-oscar,pdonadeo/django-oscar,john-parton/django-oscar,kapari/django-oscar,pdonadeo/django-oscar,john-parton/django-oscar,nfletton/django-oscar,bschuon/django-oscar,spartonia/django-oscar,MatthewWilkes/django-oscar,monikasulik/django-oscar,solarissmoke/django-oscar,sonofatailor/django-oscar,taedori81/django-oscar,faratro/django-oscar,anentropic/django-oscar,QLGu/django-oscar,Bogh/django-oscar,nfletton/django-oscar,amirrpp/django-oscar,WillisXChen/django-oscar,itbabu/django-oscar,rocopartners/django-oscar,pasqualguerrero/django-oscar,taedori81/django-oscar,dongguangming/django-oscar,eddiep1101/django-oscar,django-oscar/django-oscar,nfletton/django-oscar,monikasulik/django-oscar,pdonadeo/django-oscar,sonofatailor/django-oscar,WadeYuChen/django-oscar,sasha0/django-oscar,binarydud/django-oscar,bnprk/django-oscar,michaelkuty/django-oscar,okfish/django-oscar,QLGu/django-oscar,rocopartners/django-oscar,binarydud/django-oscar,vovanbo/django-oscar,sasha0/django-oscar,django-oscar/django-oscar,sasha0/django-oscar,dongguangming/django-oscar,Jannes123/django-oscar,nickpack/django-oscar,mexeniz/django-oscar,amirrpp/django-oscar,ka7eh/django-oscar,django-oscar/django-oscar,mexeniz/django-oscar,ka7eh/django-oscar,WillisXChen/django-oscar,jmt4/django-oscar,kapari/django-oscar,pdonadeo/django-oscar,saadatqadri/django-oscar,itbabu/django-oscar,vovanbo/django-oscar,saadatqadri/django-oscar,jlmadurga/django-oscar,Bogh/django-oscar,jlmadurga/django-oscar,taedori81/django-oscar,binarydud/django-oscar,WadeYuChen/django-oscar,sonofatailor/django-oscar,faratro/django-oscar,bschuon/django-oscar,thechampanurag/django-oscar,QLGu/django-oscar,Jannes123/django-oscar,dongguangming/django-oscar,solarissmoke/django-oscar,john-parton/django-oscar,kapari/django-oscar,rocopartners/django-oscar,vovanbo/django-oscar,pasqualguerrero/django-oscar,Jannes123/django-oscar,nickpack/django-oscar,WillisXChen/django-oscar,binarydud/django-oscar,monikasulik/django-oscar,ka7eh/django-oscar,thechampanurag/django-oscar,nfletton/django-oscar,pasqualguerrero/django-oscar,WadeYuChen/django-oscar,thechampanurag/django-oscar,WillisXChen/django-oscar,itbabu/django-oscar,monikasulik/django-oscar,eddiep1101/django-oscar,rocopartners/django-oscar,anentropic/django-oscar,bnprk/django-oscar,Bogh/django-oscar,bschuon/django-oscar,MatthewWilkes/django-oscar,django-oscar/django-oscar,WillisXChen/django-oscar,MatthewWilkes/django-oscar,thechampanurag/django-oscar,lijoantony/django-oscar,okfish/django-oscar,eddiep1101/django-oscar,jmt4/django-oscar,pasqualguerrero/django-oscar,faratro/django-oscar,faratro/django-oscar,taedori81/django-oscar,ka7eh/django-oscar,jlmadurga/django-oscar,solarissmoke/django-oscar,WillisXChen/django-oscar,bnprk/django-oscar,Jannes123/django-oscar,nickpack/django-oscar,itbabu/django-oscar,QLGu/django-oscar,bschuon/django-oscar,sonofatailor/django-oscar,mexeniz/django-oscar,MatthewWilkes/django-oscar,kapari/django-oscar,lijoantony/django-oscar,anentropic/django-oscar,dongguangming/django-oscar,eddiep1101/django-oscar,jlmadurga/django-oscar,john-parton/django-oscar,okfish/django-oscar,spartonia/django-oscar,saadatqadri/django-oscar,michaelkuty/django-oscar,spartonia/django-oscar,mexeniz/django-oscar,saadatqadri/django-oscar,Bogh/django-oscar,nickpack/django-oscar,solarissmoke/django-oscar,okfish/django-oscar,vovanbo/django-oscar,amirrpp/django-oscar,anentropic/django-oscar,WadeYuChen/django-oscar,amirrpp/django-oscar,lijoantony/django-oscar,michaelkuty/django-oscar,sasha0/django-oscar,michaelkuty/django-oscar,jmt4/django-oscar,bnprk/django-oscar,jmt4/django-oscar,spartonia/django-oscar | text | ## Code Before:
https://github.com/django-oscar/django-oscar-stores/archive/feature/oscar-1.1.zip#egg=django-oscar-stores==1.0-dev
django-oscar-paypal==0.9.1
django-oscar-datacash==0.8.3
# We need PostGIS as the stores extension uses GeoDjango.
psycopg2==2.5.1
# To use Solr, we need pysolr
pysolr==3.2
raven==4.0.3
## Instruction:
Update requirement for django-oscar-stores (demo site)
## Code After:
https://github.com/django-oscar/django-oscar-stores/archive/630aa146066cd327085fe9206dc50f6e520cc023.zip#egg=django-oscar-stores==1.0-dev
django-oscar-paypal==0.9.1
django-oscar-datacash==0.8.3
# We need PostGIS as the stores extension uses GeoDjango.
psycopg2==2.5.1
# To use Solr, we need pysolr
pysolr==3.2
raven==4.0.3
|
938840b27fd218eeaf9c253e9162392e653dff0b | snippet_parser/it.py | snippet_parser/it.py | from __future__ import unicode_literals
from core import *
def handle_bandiera(template):
return template.get(1)
def handle_citazione(template):
if template.params:
return '« ' + sp(template.params[0]) + ' »'
class SnippetParser(SnippetParserBase):
def strip_template(self, template, normalize, collapse):
if template.name.matches('bandiera'):
return handle_bandiera(template)
elif template.name.matches('citazione'):
return handle_citazione(template)
return super(SnippetParser, self).strip_template(
template, normalize, collapse)
| from __future__ import unicode_literals
from core import *
class SnippetParser(SnippetParserBase):
def strip_template(self, template, normalize, collapse):
if template.name.matches('bandiera'):
return self.handle_bandiera(template)
elif template.name.matches('citazione'):
return self.handle_citazione(template)
return super(SnippetParser, self).strip_template(
template, normalize, collapse)
def handle_bandiera(template):
return template.get(1)
def handle_citazione(template):
if template.params:
return '« ' + self.sp(template.params[0]) + ' »'
| Fix snippet parser for Italian. | Fix snippet parser for Italian.
Former-commit-id: bb8d10f5f8301fbcd4f4232612bf722d380a3d10 | Python | mit | guilherme-pg/citationhunt,eggpi/citationhunt,eggpi/citationhunt,guilherme-pg/citationhunt,guilherme-pg/citationhunt,eggpi/citationhunt,eggpi/citationhunt,guilherme-pg/citationhunt | python | ## Code Before:
from __future__ import unicode_literals
from core import *
def handle_bandiera(template):
return template.get(1)
def handle_citazione(template):
if template.params:
return '« ' + sp(template.params[0]) + ' »'
class SnippetParser(SnippetParserBase):
def strip_template(self, template, normalize, collapse):
if template.name.matches('bandiera'):
return handle_bandiera(template)
elif template.name.matches('citazione'):
return handle_citazione(template)
return super(SnippetParser, self).strip_template(
template, normalize, collapse)
## Instruction:
Fix snippet parser for Italian.
Former-commit-id: bb8d10f5f8301fbcd4f4232612bf722d380a3d10
## Code After:
from __future__ import unicode_literals
from core import *
class SnippetParser(SnippetParserBase):
def strip_template(self, template, normalize, collapse):
if template.name.matches('bandiera'):
return self.handle_bandiera(template)
elif template.name.matches('citazione'):
return self.handle_citazione(template)
return super(SnippetParser, self).strip_template(
template, normalize, collapse)
def handle_bandiera(template):
return template.get(1)
def handle_citazione(template):
if template.params:
return '« ' + self.sp(template.params[0]) + ' »'
|
e9080e6b220b585cbb17d4e36a633d389ca234d0 | .github/workflows/build.yml | .github/workflows/build.yml | name: Build
on: [push]
jobs:
extras:
# Run coverage and extra tests only once
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: 3.8
- run: pip install --upgrade pip
- run: make install
- run: make pycodestyle
- run: make test-cover
- run: make codecov-upload
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_REPO_TOKEN }}
- run: make test-dist
test:
# Run core HTTPie tests everywhere
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
python-version: [3.6, 3.7, 3.8]
exclude:
- os: windows-latest
python-version: 3.8
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- run: python -m pip install --upgrade pip
- run: pip install --upgrade --editable .
- run: python setup.py test
| name: Build
on: [push, pull_request]
jobs:
extras:
# Run coverage and extra tests only once
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: 3.8
- run: pip install --upgrade pip
- run: make install
- run: make pycodestyle
- run: make test-cover
- run: make codecov-upload
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_REPO_TOKEN }}
- run: make test-dist
test:
# Run core HTTPie tests everywhere
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
python-version: [3.6, 3.7, 3.8]
exclude:
- os: windows-latest
python-version: 3.8
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- run: python -m pip install --upgrade pip
- run: pip install --upgrade --editable .
- run: python setup.py test
| Build on PRs as well | Build on PRs as well
| YAML | bsd-3-clause | jakubroztocil/httpie,PKRoma/httpie,jkbrzt/httpie,jakubroztocil/httpie,jakubroztocil/httpie,jkbrzt/httpie,jkbrzt/httpie,PKRoma/httpie | yaml | ## Code Before:
name: Build
on: [push]
jobs:
extras:
# Run coverage and extra tests only once
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: 3.8
- run: pip install --upgrade pip
- run: make install
- run: make pycodestyle
- run: make test-cover
- run: make codecov-upload
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_REPO_TOKEN }}
- run: make test-dist
test:
# Run core HTTPie tests everywhere
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
python-version: [3.6, 3.7, 3.8]
exclude:
- os: windows-latest
python-version: 3.8
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- run: python -m pip install --upgrade pip
- run: pip install --upgrade --editable .
- run: python setup.py test
## Instruction:
Build on PRs as well
## Code After:
name: Build
on: [push, pull_request]
jobs:
extras:
# Run coverage and extra tests only once
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: 3.8
- run: pip install --upgrade pip
- run: make install
- run: make pycodestyle
- run: make test-cover
- run: make codecov-upload
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_REPO_TOKEN }}
- run: make test-dist
test:
# Run core HTTPie tests everywhere
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
python-version: [3.6, 3.7, 3.8]
exclude:
- os: windows-latest
python-version: 3.8
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- run: python -m pip install --upgrade pip
- run: pip install --upgrade --editable .
- run: python setup.py test
|
2c1f0be44943e324debafec303490b698ad5d91b | bootstrap.php | bootstrap.php | <?php
require_once __DIR__.'/vendor/autoload.php';
define('MANALIZE_DIR', __DIR__);
define('MANALIZE_TMP_ROOT_DIR', sys_get_temp_dir().'/Manala');
define('UPDATE_FIXTURES', filter_var(getenv('UPDATE_FIXTURES'), FILTER_VALIDATE_BOOLEAN));
/**
* Creates a unique tmp dir.
*
* @param string $prefix
*
* @return string The path to the tmp dir created
*/
function manala_get_tmp_dir($prefix = '')
{
if (!is_dir(MANALIZE_TMP_ROOT_DIR)) {
@mkdir(MANALIZE_TMP_ROOT_DIR);
}
$tmp = @tempnam(MANALIZE_TMP_ROOT_DIR, $prefix);
unlink($tmp);
mkdir($tmp, 0777, true);
return $tmp;
}
| <?php
foreach (array(__DIR__.'/../../autoload.php', __DIR__.'/../vendor/autoload.php', __DIR__.'/vendor/autoload.php') as $autoload) {
if (file_exists($autoload)) {
require_once $autoload;
break;
}
}
define('MANALIZE_DIR', __DIR__);
define('MANALIZE_TMP_ROOT_DIR', sys_get_temp_dir().'/Manala');
define('UPDATE_FIXTURES', filter_var(getenv('UPDATE_FIXTURES'), FILTER_VALIDATE_BOOLEAN));
/**
* Creates a unique tmp dir.
*
* @param string $prefix
*
* @return string The path to the tmp dir created
*/
function manala_get_tmp_dir($prefix = '')
{
if (!is_dir(MANALIZE_TMP_ROOT_DIR)) {
@mkdir(MANALIZE_TMP_ROOT_DIR);
}
$tmp = @tempnam(MANALIZE_TMP_ROOT_DIR, $prefix);
unlink($tmp);
mkdir($tmp, 0777, true);
return $tmp;
}
| Fix not found autoload on local install | Fix not found autoload on local install
| PHP | mit | manala/manalize,manala/manalize | php | ## Code Before:
<?php
require_once __DIR__.'/vendor/autoload.php';
define('MANALIZE_DIR', __DIR__);
define('MANALIZE_TMP_ROOT_DIR', sys_get_temp_dir().'/Manala');
define('UPDATE_FIXTURES', filter_var(getenv('UPDATE_FIXTURES'), FILTER_VALIDATE_BOOLEAN));
/**
* Creates a unique tmp dir.
*
* @param string $prefix
*
* @return string The path to the tmp dir created
*/
function manala_get_tmp_dir($prefix = '')
{
if (!is_dir(MANALIZE_TMP_ROOT_DIR)) {
@mkdir(MANALIZE_TMP_ROOT_DIR);
}
$tmp = @tempnam(MANALIZE_TMP_ROOT_DIR, $prefix);
unlink($tmp);
mkdir($tmp, 0777, true);
return $tmp;
}
## Instruction:
Fix not found autoload on local install
## Code After:
<?php
foreach (array(__DIR__.'/../../autoload.php', __DIR__.'/../vendor/autoload.php', __DIR__.'/vendor/autoload.php') as $autoload) {
if (file_exists($autoload)) {
require_once $autoload;
break;
}
}
define('MANALIZE_DIR', __DIR__);
define('MANALIZE_TMP_ROOT_DIR', sys_get_temp_dir().'/Manala');
define('UPDATE_FIXTURES', filter_var(getenv('UPDATE_FIXTURES'), FILTER_VALIDATE_BOOLEAN));
/**
* Creates a unique tmp dir.
*
* @param string $prefix
*
* @return string The path to the tmp dir created
*/
function manala_get_tmp_dir($prefix = '')
{
if (!is_dir(MANALIZE_TMP_ROOT_DIR)) {
@mkdir(MANALIZE_TMP_ROOT_DIR);
}
$tmp = @tempnam(MANALIZE_TMP_ROOT_DIR, $prefix);
unlink($tmp);
mkdir($tmp, 0777, true);
return $tmp;
}
|
64538943aeaf3008ba8e2ca5e3f39a0a15868835 | js/app/views/templates/item-listing.html | js/app/views/templates/item-listing.html | <div class="thumbnail media listing">
<img class="pull-left" height="64px" width="64px" src="<%= imageUrl %>" />
<div class="media-body">
<h4 class="media-heading"><%= name %></h4>
<div class="item-expiry"><span class="glyphicon glyphicon-calendar"></span><%= dateExpire %></div>
<div class="item-location"><span class="glyphicon glyphicon-globe"></span><%= location %></div>
<div class="item-price"><span class="glyphicon glyphicon-usd"></span><%= price %></div>
<div class="item-buyers"><span class="glyphicon glyphicon-user"></span><%= buyers.length + 1 %>
<% if(buyers.length == 0) { %> buyer <% } else { %> buyers <% } %></div>
</div>
<div class="pull-right btn-group-vertical">
<% if (owner !== userId && (buyers.indexOf(userId) === -1)) { %>
<button type="button" id="btn-pledge" class="btn btn-success pull-right">I'm in!</button>
<% } else if (buyers.indexOf(userId) !== -1) { %>
<button type="button" id="btn-unpledge" class="btn btn-warning pull-right">I want out.</button>
<% } else { %>
<span class="pull-right">You're buying this!</span>
<% } %>
</div>
</div> | <div class="thumbnail media listing">
<img class="pull-left" height="64px" width="64px" src="<%= imageUrl %>" />
<div class="media-body">
<h4 class="media-heading"><%= name %></h4>
<div class="item-expiry"><span class="glyphicon glyphicon-calendar"></span><%= dateExpire %></div>
<div class="item-location"><span class="glyphicon glyphicon-globe"></span><%= location %></div>
<div class="item-price"><span class="glyphicon glyphicon-usd"></span><%= price %></div>
<div class="item-buyers"><span class="glyphicon glyphicon-user"></span><%= buyers.length + 1 %>
<% if(buyers.length == 0) { %> buyer <% } else { %> buyers <% } %></div>
</div>
<div class="pull-right btn-group-vertical">
<% if (owner !== userId && (buyers.indexOf(userId) === -1)) { %>
<button type="button" id="btn-pledge" class="btn btn-success pull-right">I'm in!</button>
<% } else if (buyers.indexOf(userId) !== -1) { %>
<button type="button" id="btn-unpledge" class="btn btn-warning pull-right">I want out.</button>
<% } %>
</div>
</div> | Remove message saying you're buying an item. It's obvious. | Remove message saying you're buying an item. It's obvious.
| HTML | mit | burnflare/CrowdBuy,burnflare/CrowdBuy | html | ## Code Before:
<div class="thumbnail media listing">
<img class="pull-left" height="64px" width="64px" src="<%= imageUrl %>" />
<div class="media-body">
<h4 class="media-heading"><%= name %></h4>
<div class="item-expiry"><span class="glyphicon glyphicon-calendar"></span><%= dateExpire %></div>
<div class="item-location"><span class="glyphicon glyphicon-globe"></span><%= location %></div>
<div class="item-price"><span class="glyphicon glyphicon-usd"></span><%= price %></div>
<div class="item-buyers"><span class="glyphicon glyphicon-user"></span><%= buyers.length + 1 %>
<% if(buyers.length == 0) { %> buyer <% } else { %> buyers <% } %></div>
</div>
<div class="pull-right btn-group-vertical">
<% if (owner !== userId && (buyers.indexOf(userId) === -1)) { %>
<button type="button" id="btn-pledge" class="btn btn-success pull-right">I'm in!</button>
<% } else if (buyers.indexOf(userId) !== -1) { %>
<button type="button" id="btn-unpledge" class="btn btn-warning pull-right">I want out.</button>
<% } else { %>
<span class="pull-right">You're buying this!</span>
<% } %>
</div>
</div>
## Instruction:
Remove message saying you're buying an item. It's obvious.
## Code After:
<div class="thumbnail media listing">
<img class="pull-left" height="64px" width="64px" src="<%= imageUrl %>" />
<div class="media-body">
<h4 class="media-heading"><%= name %></h4>
<div class="item-expiry"><span class="glyphicon glyphicon-calendar"></span><%= dateExpire %></div>
<div class="item-location"><span class="glyphicon glyphicon-globe"></span><%= location %></div>
<div class="item-price"><span class="glyphicon glyphicon-usd"></span><%= price %></div>
<div class="item-buyers"><span class="glyphicon glyphicon-user"></span><%= buyers.length + 1 %>
<% if(buyers.length == 0) { %> buyer <% } else { %> buyers <% } %></div>
</div>
<div class="pull-right btn-group-vertical">
<% if (owner !== userId && (buyers.indexOf(userId) === -1)) { %>
<button type="button" id="btn-pledge" class="btn btn-success pull-right">I'm in!</button>
<% } else if (buyers.indexOf(userId) !== -1) { %>
<button type="button" id="btn-unpledge" class="btn btn-warning pull-right">I want out.</button>
<% } %>
</div>
</div> |
0373a7750a8a35521ad7afb854379434c9da7ad1 | rules/babel.js | rules/babel.js | 'use strict'
const _ = require('lodash')
const extendConfig = require('../lib/extendConfig')
const mainRules = require('./main')
const eslintConfigAirbnb = extendConfig({
extends: 'airbnb'
})
const migratedRules = {}
const migrateRuleNames = [
'array-bracket-spacing',
'arrow-parens',
'generator-star-spacing',
'new-cap',
'object-curly-spacing',
'object-shorthand'
]
for (const migrateRuleName of migrateRuleNames) {
migratedRules[migrateRuleName] = 'off'
let migratedRuleVal = mainRules.rules[migrateRuleName]
if (migratedRuleVal === undefined) {
migratedRuleVal = eslintConfigAirbnb.rules[migrateRuleName]
}
migratedRules[`babel/${migrateRuleName}`] = migratedRuleVal
}
module.exports = {
parser: 'babel-eslint',
plugins: [
'babel'
],
rules: _.merge(migratedRules, {
'babel/flow-object-type': 'off',
'babel/func-params-comma-dangle': ['error', 'never'],
'babel/no-await-in-loop': 'off'
})
}
| 'use strict'
const _ = require('lodash')
const extendConfig = require('../lib/extendConfig')
const mainRules = require('./main')
const eslintConfigAirbnb = extendConfig({
extends: 'eslint-config-airbnb'
})
const migratedRules = {}
const migrateRuleNames = [
'array-bracket-spacing',
'arrow-parens',
'generator-star-spacing',
'new-cap',
'object-curly-spacing',
'object-shorthand'
]
for (const migrateRuleName of migrateRuleNames) {
migratedRules[migrateRuleName] = 'off'
let migratedRuleVal = mainRules.rules[migrateRuleName]
if (migratedRuleVal === undefined) {
migratedRuleVal = eslintConfigAirbnb.rules[migrateRuleName]
}
migratedRules[`babel/${migrateRuleName}`] = migratedRuleVal
}
module.exports = {
parser: 'babel-eslint',
plugins: [
'babel'
],
rules: _.merge(migratedRules, {
'babel/flow-object-type': 'off',
'babel/func-params-comma-dangle': ['error', 'never'],
'babel/no-await-in-loop': 'off'
})
}
| Use full path for eslint-config-airbnb | Use full path for eslint-config-airbnb
| JavaScript | mit | foray1010/eslint-config-foray1010,foray1010/eslint-config-foray1010 | javascript | ## Code Before:
'use strict'
const _ = require('lodash')
const extendConfig = require('../lib/extendConfig')
const mainRules = require('./main')
const eslintConfigAirbnb = extendConfig({
extends: 'airbnb'
})
const migratedRules = {}
const migrateRuleNames = [
'array-bracket-spacing',
'arrow-parens',
'generator-star-spacing',
'new-cap',
'object-curly-spacing',
'object-shorthand'
]
for (const migrateRuleName of migrateRuleNames) {
migratedRules[migrateRuleName] = 'off'
let migratedRuleVal = mainRules.rules[migrateRuleName]
if (migratedRuleVal === undefined) {
migratedRuleVal = eslintConfigAirbnb.rules[migrateRuleName]
}
migratedRules[`babel/${migrateRuleName}`] = migratedRuleVal
}
module.exports = {
parser: 'babel-eslint',
plugins: [
'babel'
],
rules: _.merge(migratedRules, {
'babel/flow-object-type': 'off',
'babel/func-params-comma-dangle': ['error', 'never'],
'babel/no-await-in-loop': 'off'
})
}
## Instruction:
Use full path for eslint-config-airbnb
## Code After:
'use strict'
const _ = require('lodash')
const extendConfig = require('../lib/extendConfig')
const mainRules = require('./main')
const eslintConfigAirbnb = extendConfig({
extends: 'eslint-config-airbnb'
})
const migratedRules = {}
const migrateRuleNames = [
'array-bracket-spacing',
'arrow-parens',
'generator-star-spacing',
'new-cap',
'object-curly-spacing',
'object-shorthand'
]
for (const migrateRuleName of migrateRuleNames) {
migratedRules[migrateRuleName] = 'off'
let migratedRuleVal = mainRules.rules[migrateRuleName]
if (migratedRuleVal === undefined) {
migratedRuleVal = eslintConfigAirbnb.rules[migrateRuleName]
}
migratedRules[`babel/${migrateRuleName}`] = migratedRuleVal
}
module.exports = {
parser: 'babel-eslint',
plugins: [
'babel'
],
rules: _.merge(migratedRules, {
'babel/flow-object-type': 'off',
'babel/func-params-comma-dangle': ['error', 'never'],
'babel/no-await-in-loop': 'off'
})
}
|
faa007e535289ee435df9ec4a92f3b229bbd9227 | app_server/app/controllers/AdminController.js | app_server/app/controllers/AdminController.js | /**
* Admin Controller
* @module AdminController
*/
var rfr = require('rfr');
var Joi = require('joi');
var Boom = require('boom');
var Utility = rfr('app/util/Utility');
var Service = rfr('app/services/Service');
var logger = Utility.createLogger(__filename);
function AdminController(server, options) {
this.server = server;
this.options = options;
}
var Class = AdminController.prototype;
Class.registerRoutes = function () {
this.server.route({
method: 'POST', path: '/',
config: {
auth: false
},
handler: this.createAdmin
});
};
/* Routes handlers */
Class.createAdmin = function (request, reply) {
};
exports.register = function (server, options, next) {
var adminController = new AdminController(server, options);
server.bind(adminController);
adminController.registerRoutes();
next();
};
exports.register.attributes = {
name: 'AdminController'
};
| /**
* Admin Controller
* @module AdminController
*/
var rfr = require('rfr');
var Joi = require('joi');
var Boom = require('boom');
var bcrypt = require('bcryptjs');
var Utility = rfr('app/util/Utility');
var Authenticator = rfr('app/policies/Authenticator');
var Service = rfr('app/services/Service');
var logger = Utility.createLogger(__filename);
function AdminController(server, options) {
this.server = server;
this.options = options;
}
var Class = AdminController.prototype;
Class.registerRoutes = function () {
this.server.route({
method: 'POST', path: '/',
config: {
auth: {scope: Authenticator.SCOPE.ADMIN}
},
handler: this.createAdmin
});
};
/* Routes handlers */
Class.createAdmin = function (request, reply) {
var credentials = {
username: request.payload.username,
password: encrypt(request.payload.password)
};
Service.createNewAdmin(credentials)
.then(function (admin) {
if (!admin || admin instanceof Error) {
return reply(Boom.badRequest('Unable to create admin ' + credentials));
}
// overwrite with unencrypted password
admin.password = request.payload.password;
reply(admin).created();
});
};
/* Helpers for everything above */
var encrypt = function (password) {
var salt = bcrypt.genSaltSync(10);
return bcrypt.hashSync(password, salt);
};
exports.register = function (server, options, next) {
var adminController = new AdminController(server, options);
server.bind(adminController);
adminController.registerRoutes();
next();
};
exports.register.attributes = {
name: 'AdminController'
};
| Implement basic create admin with username / password only | Implement basic create admin with username / password only
| JavaScript | mit | nus-mtp/worldscope,nus-mtp/worldscope,nus-mtp/worldscope,nus-mtp/worldscope | javascript | ## Code Before:
/**
* Admin Controller
* @module AdminController
*/
var rfr = require('rfr');
var Joi = require('joi');
var Boom = require('boom');
var Utility = rfr('app/util/Utility');
var Service = rfr('app/services/Service');
var logger = Utility.createLogger(__filename);
function AdminController(server, options) {
this.server = server;
this.options = options;
}
var Class = AdminController.prototype;
Class.registerRoutes = function () {
this.server.route({
method: 'POST', path: '/',
config: {
auth: false
},
handler: this.createAdmin
});
};
/* Routes handlers */
Class.createAdmin = function (request, reply) {
};
exports.register = function (server, options, next) {
var adminController = new AdminController(server, options);
server.bind(adminController);
adminController.registerRoutes();
next();
};
exports.register.attributes = {
name: 'AdminController'
};
## Instruction:
Implement basic create admin with username / password only
## Code After:
/**
* Admin Controller
* @module AdminController
*/
var rfr = require('rfr');
var Joi = require('joi');
var Boom = require('boom');
var bcrypt = require('bcryptjs');
var Utility = rfr('app/util/Utility');
var Authenticator = rfr('app/policies/Authenticator');
var Service = rfr('app/services/Service');
var logger = Utility.createLogger(__filename);
function AdminController(server, options) {
this.server = server;
this.options = options;
}
var Class = AdminController.prototype;
Class.registerRoutes = function () {
this.server.route({
method: 'POST', path: '/',
config: {
auth: {scope: Authenticator.SCOPE.ADMIN}
},
handler: this.createAdmin
});
};
/* Routes handlers */
Class.createAdmin = function (request, reply) {
var credentials = {
username: request.payload.username,
password: encrypt(request.payload.password)
};
Service.createNewAdmin(credentials)
.then(function (admin) {
if (!admin || admin instanceof Error) {
return reply(Boom.badRequest('Unable to create admin ' + credentials));
}
// overwrite with unencrypted password
admin.password = request.payload.password;
reply(admin).created();
});
};
/* Helpers for everything above */
var encrypt = function (password) {
var salt = bcrypt.genSaltSync(10);
return bcrypt.hashSync(password, salt);
};
exports.register = function (server, options, next) {
var adminController = new AdminController(server, options);
server.bind(adminController);
adminController.registerRoutes();
next();
};
exports.register.attributes = {
name: 'AdminController'
};
|
2f4b8c712601edde144aaeeddf3b1dad5eddb8f2 | lib/ruby-lint/helper/methods.rb | lib/ruby-lint/helper/methods.rb | module RubyLint
module Helper
##
# Helper module that provides various methods for looking up methods,
# checking if they exist, etc.
#
module Methods
include CurrentScope
##
# Checks if the method for the given node is defined or not.
#
# @param [RubyLint::Node] node
# @return [TrueClass|FalseClass]
#
def method_defined?(node)
return method_scope(node).has_definition?(node.method_type, node.name)
end
##
# Looks up the method definition for the specified method call.
#
# @param [RubyLint::Node] node
# @return [RubyLint::Definition::RubyMethod]
#
def lookup_method(node)
return method_scope(node).lookup(node.method_type, node.name)
end
private
##
# Determines the scope to use for a method call.
#
# @param [RubyLint::Node] node
# @return [RubyLint::Definition::RubyObject]
#
def method_scope(node)
scope = current_scope
if node.receiver
scope = scope.lookup(node.receiver.type, node.receiver.name)
end
return scope
end
end # Methods
end # Helper
end # RubyLint
| module RubyLint
module Helper
##
# Helper module that provides various methods for looking up methods,
# checking if they exist, etc.
#
module Methods
include CurrentScope
##
# Checks if the method for the given node is defined or not.
#
# @param [RubyLint::Node] node
# @return [TrueClass|FalseClass]
#
def method_defined?(node)
scope = method_scope(node)
if scope
return scope.has_definition?(node.method_type, node.name)
else
return false
end
end
##
# Looks up the method definition for the specified method call.
#
# @param [RubyLint::Node] node
# @return [RubyLint::Definition::RubyMethod]
#
def lookup_method(node)
return method_scope(node).lookup(node.method_type, node.name)
end
private
##
# Determines the scope to use for a method call.
#
# @param [RubyLint::Node] node
# @return [RubyLint::Definition::RubyObject]
#
def method_scope(node)
scope = current_scope
if node.receiver
scope = scope.lookup(node.receiver.type, node.receiver.name)
end
return scope
end
end # Methods
end # Helper
end # RubyLint
| Handle non existing method scopes. | Handle non existing method scopes.
Signed-off-by: Yorick Peterse <[email protected]>
| Ruby | mpl-2.0 | cabo/ruby-lint,cabo/ruby-lint,YorickPeterse/ruby-lint,YorickPeterse/ruby-lint | ruby | ## Code Before:
module RubyLint
module Helper
##
# Helper module that provides various methods for looking up methods,
# checking if they exist, etc.
#
module Methods
include CurrentScope
##
# Checks if the method for the given node is defined or not.
#
# @param [RubyLint::Node] node
# @return [TrueClass|FalseClass]
#
def method_defined?(node)
return method_scope(node).has_definition?(node.method_type, node.name)
end
##
# Looks up the method definition for the specified method call.
#
# @param [RubyLint::Node] node
# @return [RubyLint::Definition::RubyMethod]
#
def lookup_method(node)
return method_scope(node).lookup(node.method_type, node.name)
end
private
##
# Determines the scope to use for a method call.
#
# @param [RubyLint::Node] node
# @return [RubyLint::Definition::RubyObject]
#
def method_scope(node)
scope = current_scope
if node.receiver
scope = scope.lookup(node.receiver.type, node.receiver.name)
end
return scope
end
end # Methods
end # Helper
end # RubyLint
## Instruction:
Handle non existing method scopes.
Signed-off-by: Yorick Peterse <[email protected]>
## Code After:
module RubyLint
module Helper
##
# Helper module that provides various methods for looking up methods,
# checking if they exist, etc.
#
module Methods
include CurrentScope
##
# Checks if the method for the given node is defined or not.
#
# @param [RubyLint::Node] node
# @return [TrueClass|FalseClass]
#
def method_defined?(node)
scope = method_scope(node)
if scope
return scope.has_definition?(node.method_type, node.name)
else
return false
end
end
##
# Looks up the method definition for the specified method call.
#
# @param [RubyLint::Node] node
# @return [RubyLint::Definition::RubyMethod]
#
def lookup_method(node)
return method_scope(node).lookup(node.method_type, node.name)
end
private
##
# Determines the scope to use for a method call.
#
# @param [RubyLint::Node] node
# @return [RubyLint::Definition::RubyObject]
#
def method_scope(node)
scope = current_scope
if node.receiver
scope = scope.lookup(node.receiver.type, node.receiver.name)
end
return scope
end
end # Methods
end # Helper
end # RubyLint
|
a1d1c0d75e20aae8890915705ced7816efd7045c | CHANGELOG.md | CHANGELOG.md |
* Initial release
|
* Add support for `data-lazy-url-horizontal` and `data-lazy-url-context` options
### 0.0.1
* Initial release
| Update changelog for 0.0.2 release | Update changelog for 0.0.2 release
Change-Id: If51488778aca979e75b817f5b05936b6575f978f
Reviewed-on: https://gerrit.causes.com/26497
Reviewed-by: Greg Hurrell <[email protected]>
Tested-by: Greg Hurrell <[email protected]>
| Markdown | mit | causes/replacejs | markdown | ## Code Before:
* Initial release
## Instruction:
Update changelog for 0.0.2 release
Change-Id: If51488778aca979e75b817f5b05936b6575f978f
Reviewed-on: https://gerrit.causes.com/26497
Reviewed-by: Greg Hurrell <[email protected]>
Tested-by: Greg Hurrell <[email protected]>
## Code After:
* Add support for `data-lazy-url-horizontal` and `data-lazy-url-context` options
### 0.0.1
* Initial release
|
89926dac73b54d6afec341be485f5e905daae970 | app/index.html | app/index.html | <!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hotshot</title>
<link href="css/bootstrap.css" rel="stylesheet" type="text/css"/>
<link href="css/app.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="main" class="container-fluid">
<div class="row">
<ul class="shots">
</ul>
</div>
</div>
<div id="refresh">
<h1>Refreshing Shots...</h1>
</div>
<script src="js/index.js"></script>
</body>
</html>
| <!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hotshot</title>
<link href="css/bootstrap.css" rel="stylesheet" type="text/css"/>
<link href="css/app.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<header class="site-header header-down">
<button class="btn btn-default nav-button"><span class="glyphicon glyphicon-cog" aria-hidden="true"></span></button>
<h2 class="site-header-title">Top 100</h2>
</header>
<div id="main">
<!-- React Dumps content here! -->
</div>
<button class="scroll-to-top button-down btn btn-default">
<span class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span>
</button>
<script>
require('babel/register');
require('./js/index.js');
</script>
</body>
</html>
| Add button to html to allow for easy scrolling to top. Begin implementation of header bar and settings | Add button to html to allow for easy scrolling to top. Begin implementation of header bar and settings
| HTML | cc0-1.0 | andrewnaumann/hotshot,andrewnaumann/hotshot | html | ## Code Before:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hotshot</title>
<link href="css/bootstrap.css" rel="stylesheet" type="text/css"/>
<link href="css/app.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="main" class="container-fluid">
<div class="row">
<ul class="shots">
</ul>
</div>
</div>
<div id="refresh">
<h1>Refreshing Shots...</h1>
</div>
<script src="js/index.js"></script>
</body>
</html>
## Instruction:
Add button to html to allow for easy scrolling to top. Begin implementation of header bar and settings
## Code After:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hotshot</title>
<link href="css/bootstrap.css" rel="stylesheet" type="text/css"/>
<link href="css/app.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<header class="site-header header-down">
<button class="btn btn-default nav-button"><span class="glyphicon glyphicon-cog" aria-hidden="true"></span></button>
<h2 class="site-header-title">Top 100</h2>
</header>
<div id="main">
<!-- React Dumps content here! -->
</div>
<button class="scroll-to-top button-down btn btn-default">
<span class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span>
</button>
<script>
require('babel/register');
require('./js/index.js');
</script>
</body>
</html>
|
64ee9131d68eb195dd7ce5af3db47fab0d0402d9 | templates/Includes/Picturefill.ss | templates/Includes/Picturefill.ss |
<%-- Args: $Title, $Link, $DesktopImage [, $MobileImage [, $TabletImage ]] --%>
<span class="picturefill" data-picture="" data-alt="$Title.ATT" data-link="$Link">
<% if $DesktopImage.exists %>
<noscript>
<img src="$DesktopImage.getURL" alt="$Title.ATT" />
</noscript>
<span data-src="$DesktopImage.getURL"></span>
<% end_if %>
<% if $MobileImage.exists %>
<span data-src="$MobileImage.getURL" data-media="(max-width: 768px)"></span>
<% end_if %>
<% if $TabletImage.exists %>
<span data-src="$TabletImage.getURL" data-media="(max-width: 1024px)"></span>
<% end_if %>
</span>
|
<%-- Args: $Title, $Link, $DesktopImage [, $MobileImage [, $TabletImage ]] --%>
<span class="picturefill" data-picture="" data-alt="$Title.ATT" data-link="$Link">
<% if $DesktopImage.exists %>
<noscript>
<img src="$DesktopImage.getURL" alt="$Title.ATT" />
</noscript>
<span data-src="$DesktopImage.getURL"></span>
<% end_if %>
<% if $TabletImage.exists %>
<span data-src="$TabletImage.getURL" data-media="(max-width: 1024px)"></span>
<% end_if %>
<% if $MobileImage.exists %>
<span data-src="$MobileImage.getURL" data-media="(max-width: 768px)"></span>
<% end_if %>
</span>
| Allow the MobileImage to be displayed. | Allow the MobileImage to be displayed.
| Scheme | bsd-3-clause | edlund/silverstripe-patchwork,edlund/silverstripe-patchwork,redema/silverstripe-patchwork,redema/silverstripe-patchwork,edlund/silverstripe-patchwork,redema/silverstripe-patchwork | scheme | ## Code Before:
<%-- Args: $Title, $Link, $DesktopImage [, $MobileImage [, $TabletImage ]] --%>
<span class="picturefill" data-picture="" data-alt="$Title.ATT" data-link="$Link">
<% if $DesktopImage.exists %>
<noscript>
<img src="$DesktopImage.getURL" alt="$Title.ATT" />
</noscript>
<span data-src="$DesktopImage.getURL"></span>
<% end_if %>
<% if $MobileImage.exists %>
<span data-src="$MobileImage.getURL" data-media="(max-width: 768px)"></span>
<% end_if %>
<% if $TabletImage.exists %>
<span data-src="$TabletImage.getURL" data-media="(max-width: 1024px)"></span>
<% end_if %>
</span>
## Instruction:
Allow the MobileImage to be displayed.
## Code After:
<%-- Args: $Title, $Link, $DesktopImage [, $MobileImage [, $TabletImage ]] --%>
<span class="picturefill" data-picture="" data-alt="$Title.ATT" data-link="$Link">
<% if $DesktopImage.exists %>
<noscript>
<img src="$DesktopImage.getURL" alt="$Title.ATT" />
</noscript>
<span data-src="$DesktopImage.getURL"></span>
<% end_if %>
<% if $TabletImage.exists %>
<span data-src="$TabletImage.getURL" data-media="(max-width: 1024px)"></span>
<% end_if %>
<% if $MobileImage.exists %>
<span data-src="$MobileImage.getURL" data-media="(max-width: 768px)"></span>
<% end_if %>
</span>
|
85db1ae442e9fcc559da1a12e1cc5be4f026f514 | govuk_frontend_toolkit.gemspec | govuk_frontend_toolkit.gemspec | $:.push File.expand_path("../lib", __FILE__)
require "govuk_frontend_toolkit/version"
Gem::Specification.new do |s|
s.name = "govuk_frontend_toolkit"
s.version = GovUKFrontendToolkit::VERSION
s.summary = 'Tools for building frontend applications'
s.authors = ['Bradley Wright']
s.email = '[email protected]'
s.homepage = 'https://github.com/alphagov/govuk_frontend_toolkit'
s.add_dependency "rails", ">= 3.1.0"
s.add_development_dependency "gem_publisher", "~> 1.1.1"
s.add_development_dependency "rake", "0.9.2.2"
s.add_development_dependency "gemfury", "0.4.8"
s.require_path = 'lib'
end
| $:.push File.expand_path("../lib", __FILE__)
require "govuk_frontend_toolkit/version"
Gem::Specification.new do |s|
s.name = "govuk_frontend_toolkit"
s.version = GovUKFrontendToolkit::VERSION
s.summary = 'Tools for building frontend applications'
s.authors = ['Bradley Wright']
s.email = '[email protected]'
s.homepage = 'https://github.com/alphagov/govuk_frontend_toolkit'
s.add_dependency "rails", ">= 3.1.0"
s.add_development_dependency "gem_publisher", "~> 1.1.1"
s.add_development_dependency "rake", "0.9.2.2"
s.add_development_dependency "gemfury", "0.4.8"
s.require_paths = ["lib", "app"]
s.files = `git ls-files`.split($\)
end
| Fix built files in Gemspec | Fix built files in Gemspec
| Ruby | mit | TFOH/govuk_frontend_toolkit,quis/govuk_frontend_toolkit,ministryofjustice/govuk_frontend_toolkit,ministryofjustice/govuk_frontend_toolkit,alphagov/govuk_frontend_toolkit,alphagov/govuk_frontend_toolkit,TFOH/govuk_frontend_toolkit,alphagov/govuk_frontend_toolkit,TFOH/govuk_frontend_toolkit,alphagov/govuk_frontend_toolkit,TFOH/govuk_frontend_toolkit,quis/govuk_frontend_toolkit,quis/govuk_frontend_toolkit,quis/govuk_frontend_toolkit | ruby | ## Code Before:
$:.push File.expand_path("../lib", __FILE__)
require "govuk_frontend_toolkit/version"
Gem::Specification.new do |s|
s.name = "govuk_frontend_toolkit"
s.version = GovUKFrontendToolkit::VERSION
s.summary = 'Tools for building frontend applications'
s.authors = ['Bradley Wright']
s.email = '[email protected]'
s.homepage = 'https://github.com/alphagov/govuk_frontend_toolkit'
s.add_dependency "rails", ">= 3.1.0"
s.add_development_dependency "gem_publisher", "~> 1.1.1"
s.add_development_dependency "rake", "0.9.2.2"
s.add_development_dependency "gemfury", "0.4.8"
s.require_path = 'lib'
end
## Instruction:
Fix built files in Gemspec
## Code After:
$:.push File.expand_path("../lib", __FILE__)
require "govuk_frontend_toolkit/version"
Gem::Specification.new do |s|
s.name = "govuk_frontend_toolkit"
s.version = GovUKFrontendToolkit::VERSION
s.summary = 'Tools for building frontend applications'
s.authors = ['Bradley Wright']
s.email = '[email protected]'
s.homepage = 'https://github.com/alphagov/govuk_frontend_toolkit'
s.add_dependency "rails", ">= 3.1.0"
s.add_development_dependency "gem_publisher", "~> 1.1.1"
s.add_development_dependency "rake", "0.9.2.2"
s.add_development_dependency "gemfury", "0.4.8"
s.require_paths = ["lib", "app"]
s.files = `git ls-files`.split($\)
end
|
15c8215415d36da4fac9c7333e62239f7b81c12d | test/support/mock_definitions.py | test/support/mock_definitions.py | class MockDefinitions(object):
def __init__(self, session_key=None):
self.session_key = session_key if session_key is not None else '123456789'
@property
def metadata(self):
host = os.getenv('SPLUNK_API_HOST', 'localhost')
port = os.getenv('SPLUNK_API_PORT', 8089),
return {'server_uri': 'https://{host}:{port}/', 'session_key': self.session_key,
'name': 'amp4e_events_test_input'}
| import os
# Generates validation/input definitions as if they were created by splunk for tests
class MockDefinitions(object):
def __init__(self, session_key=None):
self.session_key = session_key if session_key is not None else '123456789'
@property
def metadata(self):
host = os.getenv('SPLUNK_API_HOST', '127.0.0.1')
return {'server_uri': 'https://{host}:8089/'.format(host=host), 'session_key': self.session_key,
'name': 'amp4e_events_test_input'}
| Change mock to be env dependant | Change mock to be env dependant
| Python | bsd-2-clause | Cisco-AMP/amp4e_splunk_events_input,Cisco-AMP/amp4e_splunk_events_input,Cisco-AMP/amp4e_splunk_events_input,Cisco-AMP/amp4e_splunk_events_input | python | ## Code Before:
class MockDefinitions(object):
def __init__(self, session_key=None):
self.session_key = session_key if session_key is not None else '123456789'
@property
def metadata(self):
host = os.getenv('SPLUNK_API_HOST', 'localhost')
port = os.getenv('SPLUNK_API_PORT', 8089),
return {'server_uri': 'https://{host}:{port}/', 'session_key': self.session_key,
'name': 'amp4e_events_test_input'}
## Instruction:
Change mock to be env dependant
## Code After:
import os
# Generates validation/input definitions as if they were created by splunk for tests
class MockDefinitions(object):
def __init__(self, session_key=None):
self.session_key = session_key if session_key is not None else '123456789'
@property
def metadata(self):
host = os.getenv('SPLUNK_API_HOST', '127.0.0.1')
return {'server_uri': 'https://{host}:8089/'.format(host=host), 'session_key': self.session_key,
'name': 'amp4e_events_test_input'}
|
04212886e3c20af7e86183c170bc66d266a6d23f | authentication.html | authentication.html | <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<script src="scripts/lib/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
var host = 'https://login.zooniverse.org/';
if (!!~location.host.indexOf('localhost')) host = 'http://localhost:3000';
var commandMap = {
'authenticate': '/login',
'log-out': '/logout'
};
$(window).on('message', function(e) {
var commands = e.originalEvent.data;
for (var command in commands) {
var url = host + commandMap[command]
var params = commands[command];
$.getJSON(url + '?callback=?', params, function(response) {
parent.postMessage({command: command, response: response}, location.protocol + '//' + location.host);
});
}
});
</script>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<script src="scripts/lib/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
var host = 'https://login.zooniverse.org/';
if (!!~location.host.indexOf('localhost')) host = 'http://localhost:3000';
var commandMap = {
'authenticate': '/login',
'log-out': '/logout'
};
$(window).on('message', function(e) {
var commands = e.originalEvent.data;
for (var command in commands) {
var url = host + commandMap[command]
var params = commands[command];
$.getJSON(url + '?callback=?', params, function(response) {
parent.postMessage({command: command, response: response}, location.protocol + '//' + location.host);
});
}
});
// Check for current user.
$.getJSON(host + '/current_user?callback=?', function(response) {
if (response.success !== true) return;
parent.postMessage({command: 'authenticate', response: response}, location.protocol + '//' + location.host);
})
</script>
</body>
</html>
| Check for current user on load. | Check for current user on load. | HTML | apache-2.0 | powolnymarcel/Bat-Detective,powolnymarcel/Bat-Detective,powolnymarcel/Bat-Detective,zooniverse/Bat-Detective,zooniverse/Bat-Detective,zooniverse/Bat-Detective | html | ## Code Before:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<script src="scripts/lib/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
var host = 'https://login.zooniverse.org/';
if (!!~location.host.indexOf('localhost')) host = 'http://localhost:3000';
var commandMap = {
'authenticate': '/login',
'log-out': '/logout'
};
$(window).on('message', function(e) {
var commands = e.originalEvent.data;
for (var command in commands) {
var url = host + commandMap[command]
var params = commands[command];
$.getJSON(url + '?callback=?', params, function(response) {
parent.postMessage({command: command, response: response}, location.protocol + '//' + location.host);
});
}
});
</script>
</body>
</html>
## Instruction:
Check for current user on load.
## Code After:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<script src="scripts/lib/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
var host = 'https://login.zooniverse.org/';
if (!!~location.host.indexOf('localhost')) host = 'http://localhost:3000';
var commandMap = {
'authenticate': '/login',
'log-out': '/logout'
};
$(window).on('message', function(e) {
var commands = e.originalEvent.data;
for (var command in commands) {
var url = host + commandMap[command]
var params = commands[command];
$.getJSON(url + '?callback=?', params, function(response) {
parent.postMessage({command: command, response: response}, location.protocol + '//' + location.host);
});
}
});
// Check for current user.
$.getJSON(host + '/current_user?callback=?', function(response) {
if (response.success !== true) return;
parent.postMessage({command: 'authenticate', response: response}, location.protocol + '//' + location.host);
})
</script>
</body>
</html>
|
3ec2d2e2a24bc8f6f54e7e38bdfc78aca2c10f8b | lib/autocomplete/provider.coffee | lib/autocomplete/provider.coffee | {filter} = require 'fuzzaldrin'
AutoCompletePlusProvider =
selector: '.source.dart'
disableForSelector: '.source.dart .comment'
inclusionPriority: 1
excludeLowerPriority: true
# Our analysis API service object
analysisApi: null
# Required: Return a promise, an array of suggestions, or null.
getSuggestions: ({editor, bufferPosition, scopeDescriptor, prefix}) ->
new Promise (resolve) =>
if @analysisApi
path = editor.getPath()
offset = editor.buffer.characterIndexForPosition(bufferPosition)
@analysisApi.updateFile path, editor.getText()
@analysisApi.completion.getSuggestions(path, offset)
.then (autocompleteInfo) ->
items = []
results = autocompleteInfo.params.results
sortedResults = if prefix == "."
results
else
filter(results, prefix, { key: 'completion'})
for result in sortedResults
items.push
text: result.completion,
rightLabel: result.element.kind
resolve(items)
# (optional): called _after_ the suggestion `replacementPrefix` is replaced
# by the suggestion `text` in the buffer
onDidInsertSuggestion: ({editor, triggerPosition, suggestion}) ->
# (optional): called when your provider needs to be cleaned up. Unsubscribe
# from things, kill any processes, etc.
dispose: ->
module.exports = AutoCompletePlusProvider
| {filter} = require 'fuzzaldrin'
{_} = require 'lodash'
AutoCompletePlusProvider =
selector: '.source.dart'
disableForSelector: '.source.dart .comment'
inclusionPriority: 1
excludeLowerPriority: true
# Our analysis API service object
analysisApi: null
# Required: Return a promise, an array of suggestions, or null.
getSuggestions: ({editor, bufferPosition, scopeDescriptor, prefix}) ->
new Promise (resolve) =>
if @analysisApi
path = editor.getPath()
offset = editor.buffer.characterIndexForPosition(bufferPosition)
@analysisApi.updateFile path, editor.getText()
@analysisApi.completion.getSuggestions(path, offset)
.then (autocompleteInfo) ->
items = []
results = autocompleteInfo.params.results
sortedResults = _.chain(results)
.where((i) -> i.relevance > 500) # 500 = garbage tier
.sort( (a, b) -> a.relevance - b.relevance)
.value()
# Side-step the analzyer's sad, sad relevance scores.
# Both "XmlDocument" and "XmlName" have the same relevance score
# for the fragment "XmlDocumen"
if prefix != "."
sortedResults = filter(results, prefix, { key: 'completion'})
for result in sortedResults
items.push
text: result.completion,
rightLabel: result.element?.kind
resolve(items)
# (optional): called _after_ the suggestion `replacementPrefix` is replaced
# by the suggestion `text` in the buffer
onDidInsertSuggestion: ({editor, triggerPosition, suggestion}) ->
# (optional): called when your provider needs to be cleaned up. Unsubscribe
# from things, kill any processes, etc.
dispose: ->
module.exports = AutoCompletePlusProvider
| Make some fixes to the autocompleter. | Make some fixes to the autocompleter.
Missing "element" no longer causes failures.
Also, sorting is slightly improved, maybe.
Probably.
Possibly.
| CoffeeScript | mit | radicaled/dart-tools | coffeescript | ## Code Before:
{filter} = require 'fuzzaldrin'
AutoCompletePlusProvider =
selector: '.source.dart'
disableForSelector: '.source.dart .comment'
inclusionPriority: 1
excludeLowerPriority: true
# Our analysis API service object
analysisApi: null
# Required: Return a promise, an array of suggestions, or null.
getSuggestions: ({editor, bufferPosition, scopeDescriptor, prefix}) ->
new Promise (resolve) =>
if @analysisApi
path = editor.getPath()
offset = editor.buffer.characterIndexForPosition(bufferPosition)
@analysisApi.updateFile path, editor.getText()
@analysisApi.completion.getSuggestions(path, offset)
.then (autocompleteInfo) ->
items = []
results = autocompleteInfo.params.results
sortedResults = if prefix == "."
results
else
filter(results, prefix, { key: 'completion'})
for result in sortedResults
items.push
text: result.completion,
rightLabel: result.element.kind
resolve(items)
# (optional): called _after_ the suggestion `replacementPrefix` is replaced
# by the suggestion `text` in the buffer
onDidInsertSuggestion: ({editor, triggerPosition, suggestion}) ->
# (optional): called when your provider needs to be cleaned up. Unsubscribe
# from things, kill any processes, etc.
dispose: ->
module.exports = AutoCompletePlusProvider
## Instruction:
Make some fixes to the autocompleter.
Missing "element" no longer causes failures.
Also, sorting is slightly improved, maybe.
Probably.
Possibly.
## Code After:
{filter} = require 'fuzzaldrin'
{_} = require 'lodash'
AutoCompletePlusProvider =
selector: '.source.dart'
disableForSelector: '.source.dart .comment'
inclusionPriority: 1
excludeLowerPriority: true
# Our analysis API service object
analysisApi: null
# Required: Return a promise, an array of suggestions, or null.
getSuggestions: ({editor, bufferPosition, scopeDescriptor, prefix}) ->
new Promise (resolve) =>
if @analysisApi
path = editor.getPath()
offset = editor.buffer.characterIndexForPosition(bufferPosition)
@analysisApi.updateFile path, editor.getText()
@analysisApi.completion.getSuggestions(path, offset)
.then (autocompleteInfo) ->
items = []
results = autocompleteInfo.params.results
sortedResults = _.chain(results)
.where((i) -> i.relevance > 500) # 500 = garbage tier
.sort( (a, b) -> a.relevance - b.relevance)
.value()
# Side-step the analzyer's sad, sad relevance scores.
# Both "XmlDocument" and "XmlName" have the same relevance score
# for the fragment "XmlDocumen"
if prefix != "."
sortedResults = filter(results, prefix, { key: 'completion'})
for result in sortedResults
items.push
text: result.completion,
rightLabel: result.element?.kind
resolve(items)
# (optional): called _after_ the suggestion `replacementPrefix` is replaced
# by the suggestion `text` in the buffer
onDidInsertSuggestion: ({editor, triggerPosition, suggestion}) ->
# (optional): called when your provider needs to be cleaned up. Unsubscribe
# from things, kill any processes, etc.
dispose: ->
module.exports = AutoCompletePlusProvider
|
44aed626bf56b72af4934768e9fa31ad4439935a | src/test/run-pass/syntax-extension-fmt.rs | src/test/run-pass/syntax-extension-fmt.rs | // xfail-boot
// xfail-stage0
use std;
import std._str;
fn test(str actual, str expected) {
log actual;
log expected;
check (_str.eq(actual, expected));
}
fn main() {
test(#fmt("hello %d friends and %s things", 10, "formatted"),
"hello 10 friends and formatted things");
// Simple tests for types
test(#fmt("%d", 1), "1");
test(#fmt("%i", 2), "2");
test(#fmt("%i", -1), "-1");
test(#fmt("%s", "test"), "test");
test(#fmt("%b", true), "true");
test(#fmt("%b", false), "false");
test(#fmt("%c", 'A'), "A");
}
| // xfail-boot
// xfail-stage0
use std;
import std._str;
fn test(str actual, str expected) {
log actual;
log expected;
check (_str.eq(actual, expected));
}
fn main() {
test(#fmt("hello %d friends and %s things", 10, "formatted"),
"hello 10 friends and formatted things");
// Simple tests for types
test(#fmt("%d", 1), "1");
test(#fmt("%i", 2), "2");
test(#fmt("%i", -1), "-1");
test(#fmt("%u", 10u), "10");
test(#fmt("%s", "test"), "test");
test(#fmt("%b", true), "true");
test(#fmt("%b", false), "false");
test(#fmt("%c", 'A'), "A");
}
| Add ExtFmt test for unsigned type | Add ExtFmt test for unsigned type
| Rust | apache-2.0 | mitsuhiko/rust,LeoTestard/rust,vhbit/rust,rohitjoshi/rust,barosl/rust,kmcallister/rust,l0kod/rust,andars/rust,kimroen/rust,dinfuehr/rust,defuz/rust,fabricedesre/rust,0x73/rust,GBGamer/rust,seanrivera/rust,j16r/rust,robertg/rust,SiegeLord/rust,ktossell/rust,GBGamer/rust,AerialX/rust,ejjeong/rust,kimroen/rust,zachwick/rust,stepancheg/rust-ide-rust,jbclements/rust,dinfuehr/rust,bombless/rust-docs-chinese,mahkoh/rust,carols10cents/rust,aneeshusa/rust,reem/rust,KokaKiwi/rust,vhbit/rust,waynenilsen/rand,krzysz00/rust,cllns/rust,ktossell/rust,michaelballantyne/rust-gpu,hauleth/rust,XMPPwocky/rust,kwantam/rust,hauleth/rust,avdi/rust,TheNeikos/rust,nwin/rust,servo/rust,vhbit/rust,GBGamer/rust,seanrivera/rust,ruud-v-a/rust,dwillmer/rust,michaelballantyne/rust-gpu,mahkoh/rust,graydon/rust,gifnksm/rust,stepancheg/rust-ide-rust,vhbit/rust,aturon/rust,gifnksm/rust,aidancully/rust,robertg/rust,avdi/rust,dwillmer/rust,j16r/rust,AerialX/rust,jashank/rust,j16r/rust,mihneadb/rust,ruud-v-a/rust,miniupnp/rust,pshc/rust,richo/rust,erickt/rust,rohitjoshi/rust,bombless/rust,carols10cents/rust,Ryman/rust,pshc/rust,jbclements/rust,victorvde/rust,jbclements/rust,carols10cents/rust,j16r/rust,rohitjoshi/rust,krzysz00/rust,erickt/rust,Ryman/rust,kmcallister/rust,philyoon/rust,pelmers/rust,seanrivera/rust,kwantam/rust,seanrivera/rust,richo/rust,LeoTestard/rust,dwillmer/rust,pythonesque/rust,KokaKiwi/rust,zaeleus/rust,philyoon/rust,defuz/rust,kimroen/rust,LeoTestard/rust,dinfuehr/rust,pythonesque/rust,mdinger/rust,jbclements/rust,mdinger/rust,rohitjoshi/rust,zubron/rust,TheNeikos/rust,dwillmer/rust,sae-bom/rust,defuz/rust,Ryman/rust,untitaker/rust,l0kod/rust,0x73/rust,AerialX/rust-rt-minimal,0x73/rust,dwillmer/rust,ruud-v-a/rust,nham/rust,gifnksm/rust,defuz/rust,quornian/rust,zaeleus/rust,stepancheg/rust-ide-rust,erickt/rust,emk/rust,barosl/rust,ktossell/rust,P1start/rust,victorvde/rust,sarojaba/rust-doc-korean,nwin/rust,mihneadb/rust,bluss/rand,omasanori/rust,cllns/rust,jbclements/rust,P1start/rust,ejjeong/rust,mahkoh/rust,miniupnp/rust,aneeshusa/rust,aepsil0n/rust,ebfull/rust,zubron/rust,TheNeikos/rust,AerialX/rust-rt-minimal,jbclements/rust,aturon/rust,richo/rust,emk/rust,andars/rust,nham/rust,GBGamer/rust,LeoTestard/rust,mitsuhiko/rust,cllns/rust,reem/rust,ruud-v-a/rust,arthurprs/rand,aepsil0n/rust,emk/rust,krzysz00/rust,KokaKiwi/rust,l0kod/rust,jroesch/rust,kmcallister/rust,seanrivera/rust,kimroen/rust,TheNeikos/rust,SiegeLord/rust,mihneadb/rust,reem/rust,ebfull/rust,pczarn/rust,pelmers/rust,sae-bom/rust,P1start/rust,aidancully/rust,gifnksm/rust,SiegeLord/rust,fabricedesre/rust,pelmers/rust,robertg/rust,pczarn/rust,avdi/rust,defuz/rust,jroesch/rust,mvdnes/rust,zachwick/rust,jashank/rust,barosl/rust,zubron/rust,dwillmer/rust,dwillmer/rust,cllns/rust,rprichard/rust,0x73/rust,emk/rust,hauleth/rust,philyoon/rust,KokaKiwi/rust,AerialX/rust-rt-minimal,philyoon/rust,mvdnes/rust,mdinger/rust,dinfuehr/rust,mitsuhiko/rust,avdi/rust,XMPPwocky/rust,omasanori/rust,mihneadb/rust,stepancheg/rust-ide-rust,pczarn/rust,ruud-v-a/rust,Ryman/rust,untitaker/rust,michaelballantyne/rust-gpu,graydon/rust,j16r/rust,quornian/rust,miniupnp/rust,Ryman/rust,rprichard/rust,ejjeong/rust,bombless/rust,aidancully/rust,mvdnes/rust,AerialX/rust,zachwick/rust,pshc/rust,aturon/rust,fabricedesre/rust,pythonesque/rust,j16r/rust,rprichard/rust,jashank/rust,SiegeLord/rust,victorvde/rust,zubron/rust,gifnksm/rust,zaeleus/rust,Ryman/rust,kimroen/rust,zubron/rust,fabricedesre/rust,dinfuehr/rust,zachwick/rust,huonw/rand,reem/rust,miniupnp/rust,sae-bom/rust,servo/rust,LeoTestard/rust,aepsil0n/rust,l0kod/rust,miniupnp/rust,quornian/rust,servo/rust,cllns/rust,hauleth/rust,robertg/rust,AerialX/rust-rt-minimal,jroesch/rust,kimroen/rust,philyoon/rust,nwin/rust,zaeleus/rust,jashank/rust,GBGamer/rust,aneeshusa/rust,carols10cents/rust,servo/rust,gifnksm/rust,bhickey/rand,pshc/rust,untitaker/rust,XMPPwocky/rust,bombless/rust,dinfuehr/rust,bombless/rust,jashank/rust,quornian/rust,mvdnes/rust,GBGamer/rust,P1start/rust,aneeshusa/rust,jroesch/rust,mitsuhiko/rust,omasanori/rust,fabricedesre/rust,aidancully/rust,aidancully/rust,ebfull/rand,retep998/rand,mdinger/rust,mitsuhiko/rust,aturon/rust,nham/rust,ejjeong/rust,j16r/rust,miniupnp/rust,kwantam/rust,hauleth/rust,krzysz00/rust,victorvde/rust,michaelballantyne/rust-gpu,kmcallister/rust,mihneadb/rust,carols10cents/rust,sae-bom/rust,rprichard/rust,LeoTestard/rust,aturon/rust,avdi/rust,graydon/rust,AerialX/rust,l0kod/rust,TheNeikos/rust,rprichard/rust,sarojaba/rust-doc-korean,sarojaba/rust-doc-korean,nham/rust,kwantam/rust,barosl/rust,sarojaba/rust-doc-korean,mitsuhiko/rust,pshc/rust,kimroen/rust,jashank/rust,richo/rust,michaelballantyne/rust-gpu,nwin/rust,quornian/rust,rohitjoshi/rust,jbclements/rust,erickt/rust,0x73/rust,rohitjoshi/rust,jashank/rust,pshc/rust,l0kod/rust,LeoTestard/rust,barosl/rust,erickt/rust,miniupnp/rust,ejjeong/rust,nwin/rust,quornian/rust,pczarn/rust,miniupnp/rust,hauleth/rust,vhbit/rust,stepancheg/rust-ide-rust,ktossell/rust,l0kod/rust,stepancheg/rust-ide-rust,mdinger/rust,pshc/rust,victorvde/rust,pelmers/rust,zubron/rust,l0kod/rust,P1start/rust,zaeleus/rust,bombless/rust,richo/rust,erickt/rust,aepsil0n/rust,barosl/rust,kmcallister/rust,jroesch/rust,victorvde/rust,KokaKiwi/rust,richo/rust,zubron/rust,sarojaba/rust-doc-korean,ruud-v-a/rust,zubron/rust,emk/rust,reem/rust,seanrivera/rust,vhbit/rust,kwantam/rust,AerialX/rust-rt-minimal,pythonesque/rust,quornian/rust,pczarn/rust,barosl/rust,philyoon/rust,SiegeLord/rust,untitaker/rust,emk/rust,rprichard/rust,servo/rust,andars/rust,aneeshusa/rust,nham/rust,P1start/rust,SiegeLord/rust,ebfull/rust,vhbit/rust,jbclements/rust,andars/rust,TheNeikos/rust,0x73/rust,aturon/rust,graydon/rust,XMPPwocky/rust,sarojaba/rust-doc-korean,robertg/rust,kmcallister/rust,defuz/rust,kwantam/rust,avdi/rust,ejjeong/rust,GBGamer/rust,sarojaba/rust-doc-korean,servo/rust,KokaKiwi/rust,omasanori/rust,shepmaster/rand,erickt/rust,fabricedesre/rust,ebfull/rust,pythonesque/rust,jbclements/rust,andars/rust,bombless/rust,zachwick/rust,mahkoh/rust,0x73/rust,fabricedesre/rust,pythonesque/rust,P1start/rust,ktossell/rust,SiegeLord/rust,untitaker/rust,servo/rust,jroesch/rust,aepsil0n/rust,jashank/rust,aturon/rust,mitsuhiko/rust,pczarn/rust,nham/rust,pczarn/rust,ebfull/rust,kmcallister/rust,cllns/rust,graydon/rust,Ryman/rust,zaeleus/rust,ktossell/rust,achanda/rand,jroesch/rust,sae-bom/rust,XMPPwocky/rust,mvdnes/rust,pshc/rust,mahkoh/rust,andars/rust,zachwick/rust,XMPPwocky/rust,nwin/rust,pelmers/rust,ktossell/rust,mvdnes/rust,vhbit/rust,aneeshusa/rust,pythonesque/rust,michaelballantyne/rust-gpu,AerialX/rust,nwin/rust,nham/rust,reem/rust,krzysz00/rust,mahkoh/rust,stepancheg/rust-ide-rust,GrahamDennis/rand,pelmers/rust,omasanori/rust,AerialX/rust,omasanori/rust,mihneadb/rust,sae-bom/rust,aidancully/rust,dwillmer/rust,jroesch/rust,krzysz00/rust,GBGamer/rust,carols10cents/rust,untitaker/rust,graydon/rust,ebfull/rust,mdinger/rust,robertg/rust,aepsil0n/rust,emk/rust,AerialX/rust-rt-minimal,nwin/rust,michaelballantyne/rust-gpu | rust | ## Code Before:
// xfail-boot
// xfail-stage0
use std;
import std._str;
fn test(str actual, str expected) {
log actual;
log expected;
check (_str.eq(actual, expected));
}
fn main() {
test(#fmt("hello %d friends and %s things", 10, "formatted"),
"hello 10 friends and formatted things");
// Simple tests for types
test(#fmt("%d", 1), "1");
test(#fmt("%i", 2), "2");
test(#fmt("%i", -1), "-1");
test(#fmt("%s", "test"), "test");
test(#fmt("%b", true), "true");
test(#fmt("%b", false), "false");
test(#fmt("%c", 'A'), "A");
}
## Instruction:
Add ExtFmt test for unsigned type
## Code After:
// xfail-boot
// xfail-stage0
use std;
import std._str;
fn test(str actual, str expected) {
log actual;
log expected;
check (_str.eq(actual, expected));
}
fn main() {
test(#fmt("hello %d friends and %s things", 10, "formatted"),
"hello 10 friends and formatted things");
// Simple tests for types
test(#fmt("%d", 1), "1");
test(#fmt("%i", 2), "2");
test(#fmt("%i", -1), "-1");
test(#fmt("%u", 10u), "10");
test(#fmt("%s", "test"), "test");
test(#fmt("%b", true), "true");
test(#fmt("%b", false), "false");
test(#fmt("%c", 'A'), "A");
}
|
d119d6e3b0e4fd1afd7a38542e1c70df3e719572 | validation-test/IDE/crashers_fixed/extension-protocol-composition.swift | validation-test/IDE/crashers_fixed/extension-protocol-composition.swift | // RUN: %target-swift-ide-test -code-completion -code-completion-token=A -source-filename=%s | FileCheck %s
// RUN: %target-swift-ide-test -code-completion -code-completion-token=B -source-filename=%s | FileCheck %s
typealias X = protocol<CustomStringConvertible>
typealias Y = protocol<CustomStringConvertible>
extension protocol<X, Y> {
func x() { #^A^# }
}
extension AnyObject {
func x() { #^B^# }
}
// Sanity check results.
// CHECK: Keyword/None: let
| // RUN: %target-swift-ide-test -code-completion -code-completion-token=A -source-filename=%s | FileCheck %s
// RUN: %target-swift-ide-test -code-completion -code-completion-token=B -source-filename=%s | FileCheck %s
typealias X = protocol<CustomStringConvertible>
typealias Y = protocol<CustomStringConvertible>
extension protocol<X, Y> {
func x() { #^A^# }
}
extension AnyObject {
func x() { #^B^# }
}
// Sanity check results.
// CHECK: Keyword[let]/None: let
| Update validation-test/IDE after keyword changes | [CodeCompletion] Update validation-test/IDE after keyword changes
| Swift | apache-2.0 | JaSpa/swift,parkera/swift,kperryua/swift,khizkhiz/swift,tkremenek/swift,ben-ng/swift,khizkhiz/swift,austinzheng/swift,tinysun212/swift-windows,emilstahl/swift,kentya6/swift,danielmartin/swift,huonw/swift,kstaring/swift,rudkx/swift,devincoughlin/swift,ahoppen/swift,calebd/swift,sschiau/swift,jckarter/swift,Jnosh/swift,shahmishal/swift,sdulal/swift,CodaFi/swift,aschwaighofer/swift,swiftix/swift.old,kentya6/swift,gottesmm/swift,amraboelela/swift,emilstahl/swift,JGiola/swift,IngmarStein/swift,mightydeveloper/swift,kentya6/swift,swiftix/swift.old,russbishop/swift,gregomni/swift,gmilos/swift,amraboelela/swift,devincoughlin/swift,adrfer/swift,zisko/swift,natecook1000/swift,kperryua/swift,russbishop/swift,shahmishal/swift,hughbe/swift,natecook1000/swift,jopamer/swift,zisko/swift,parkera/swift,shajrawi/swift,gmilos/swift,atrick/swift,glessard/swift,swiftix/swift,kentya6/swift,xwu/swift,swiftix/swift,felix91gr/swift,KrishMunot/swift,xwu/swift,dreamsxin/swift,slavapestov/swift,bitjammer/swift,arvedviehweger/swift,OscarSwanros/swift,mightydeveloper/swift,slavapestov/swift,kstaring/swift,hughbe/swift,nathawes/swift,IngmarStein/swift,nathawes/swift,IngmarStein/swift,manavgabhawala/swift,shahmishal/swift,nathawes/swift,swiftix/swift.old,gribozavr/swift,karwa/swift,brentdax/swift,atrick/swift,milseman/swift,atrick/swift,devincoughlin/swift,manavgabhawala/swift,kstaring/swift,return/swift,allevato/swift,sschiau/swift,OscarSwanros/swift,IngmarStein/swift,benlangmuir/swift,devincoughlin/swift,xwu/swift,manavgabhawala/swift,adrfer/swift,gregomni/swift,mightydeveloper/swift,gribozavr/swift,johnno1962d/swift,dduan/swift,arvedviehweger/swift,deyton/swift,SwiftAndroid/swift,danielmartin/swift,practicalswift/swift,JaSpa/swift,calebd/swift,glessard/swift,lorentey/swift,LeoShimonaka/swift,rudkx/swift,gmilos/swift,huonw/swift,apple/swift,deyton/swift,tinysun212/swift-windows,return/swift,djwbrown/swift,glessard/swift,frootloops/swift,emilstahl/swift,kstaring/swift,sschiau/swift,OscarSwanros/swift,roambotics/swift,tjw/swift,natecook1000/swift,mightydeveloper/swift,russbishop/swift,amraboelela/swift,tardieu/swift,Ivacker/swift,glessard/swift,zisko/swift,jtbandes/swift,shajrawi/swift,huonw/swift,sdulal/swift,therealbnut/swift,shahmishal/swift,Ivacker/swift,codestergit/swift,ahoppen/swift,return/swift,slavapestov/swift,adrfer/swift,brentdax/swift,allevato/swift,jckarter/swift,atrick/swift,gmilos/swift,MukeshKumarS/Swift,Ivacker/swift,felix91gr/swift,airspeedswift/swift,jtbandes/swift,johnno1962d/swift,aschwaighofer/swift,gregomni/swift,Ivacker/swift,swiftix/swift.old,shajrawi/swift,deyton/swift,codestergit/swift,frootloops/swift,frootloops/swift,return/swift,slavapestov/swift,kperryua/swift,therealbnut/swift,airspeedswift/swift,airspeedswift/swift,kusl/swift,gribozavr/swift,allevato/swift,slavapestov/swift,kperryua/swift,hughbe/swift,kentya6/swift,arvedviehweger/swift,jopamer/swift,return/swift,apple/swift,benlangmuir/swift,gribozavr/swift,OscarSwanros/swift,emilstahl/swift,SwiftAndroid/swift,parkera/swift,lorentey/swift,khizkhiz/swift,practicalswift/swift,johnno1962d/swift,zisko/swift,JGiola/swift,ben-ng/swift,dduan/swift,harlanhaskins/swift,karwa/swift,felix91gr/swift,bitjammer/swift,stephentyrone/swift,ken0nek/swift,allevato/swift,kperryua/swift,modocache/swift,karwa/swift,jmgc/swift,djwbrown/swift,JaSpa/swift,felix91gr/swift,milseman/swift,hughbe/swift,JaSpa/swift,aschwaighofer/swift,xedin/swift,apple/swift,hooman/swift,apple/swift,uasys/swift,swiftix/swift,hughbe/swift,benlangmuir/swift,gribozavr/swift,kusl/swift,karwa/swift,kusl/swift,jckarter/swift,CodaFi/swift,khizkhiz/swift,LeoShimonaka/swift,apple/swift,jopamer/swift,CodaFi/swift,stephentyrone/swift,gregomni/swift,modocache/swift,kusl/swift,danielmartin/swift,austinzheng/swift,alblue/swift,tardieu/swift,johnno1962d/swift,sdulal/swift,swiftix/swift.old,gmilos/swift,hughbe/swift,russbishop/swift,arvedviehweger/swift,kusl/swift,kusl/swift,tjw/swift,CodaFi/swift,gregomni/swift,harlanhaskins/swift,cbrentharris/swift,hooman/swift,kusl/swift,jmgc/swift,Ivacker/swift,Ivacker/swift,alblue/swift,modocache/swift,gmilos/swift,harlanhaskins/swift,natecook1000/swift,gottesmm/swift,nathawes/swift,IngmarStein/swift,roambotics/swift,modocache/swift,JaSpa/swift,KrishMunot/swift,emilstahl/swift,milseman/swift,glessard/swift,sschiau/swift,codestergit/swift,MukeshKumarS/Swift,mightydeveloper/swift,parkera/swift,cbrentharris/swift,modocache/swift,dduan/swift,roambotics/swift,stephentyrone/swift,swiftix/swift,emilstahl/swift,natecook1000/swift,tjw/swift,bitjammer/swift,manavgabhawala/swift,huonw/swift,karwa/swift,aschwaighofer/swift,devincoughlin/swift,SwiftAndroid/swift,dduan/swift,gottesmm/swift,jckarter/swift,kentya6/swift,slavapestov/swift,allevato/swift,parkera/swift,therealbnut/swift,tjw/swift,harlanhaskins/swift,arvedviehweger/swift,modocache/swift,xedin/swift,KrishMunot/swift,rudkx/swift,parkera/swift,kstaring/swift,benlangmuir/swift,apple/swift,tardieu/swift,ken0nek/swift,bitjammer/swift,milseman/swift,sdulal/swift,xedin/swift,lorentey/swift,allevato/swift,JGiola/swift,tinysun212/swift-windows,hooman/swift,xedin/swift,sschiau/swift,khizkhiz/swift,tjw/swift,ken0nek/swift,lorentey/swift,calebd/swift,sschiau/swift,gottesmm/swift,djwbrown/swift,kusl/swift,jopamer/swift,sschiau/swift,lorentey/swift,practicalswift/swift,Ivacker/swift,rudkx/swift,MukeshKumarS/Swift,codestergit/swift,hooman/swift,austinzheng/swift,adrfer/swift,deyton/swift,airspeedswift/swift,tkremenek/swift,SwiftAndroid/swift,alblue/swift,stephentyrone/swift,Jnosh/swift,deyton/swift,therealbnut/swift,practicalswift/swift,danielmartin/swift,KrishMunot/swift,zisko/swift,brentdax/swift,KrishMunot/swift,bitjammer/swift,tardieu/swift,shajrawi/swift,amraboelela/swift,JGiola/swift,devincoughlin/swift,jckarter/swift,jmgc/swift,nathawes/swift,jopamer/swift,gribozavr/swift,cbrentharris/swift,kstaring/swift,Ivacker/swift,codestergit/swift,tinysun212/swift-windows,rudkx/swift,xwu/swift,russbishop/swift,jtbandes/swift,austinzheng/swift,atrick/swift,kperryua/swift,MukeshKumarS/Swift,xedin/swift,jopamer/swift,nathawes/swift,MukeshKumarS/Swift,khizkhiz/swift,ahoppen/swift,jtbandes/swift,parkera/swift,ken0nek/swift,jtbandes/swift,sdulal/swift,manavgabhawala/swift,airspeedswift/swift,emilstahl/swift,jmgc/swift,OscarSwanros/swift,danielmartin/swift,alblue/swift,therealbnut/swift,tjw/swift,huonw/swift,shahmishal/swift,devincoughlin/swift,LeoShimonaka/swift,hooman/swift,CodaFi/swift,zisko/swift,parkera/swift,deyton/swift,djwbrown/swift,felix91gr/swift,russbishop/swift,mightydeveloper/swift,calebd/swift,hooman/swift,gottesmm/swift,danielmartin/swift,russbishop/swift,ken0nek/swift,stephentyrone/swift,shajrawi/swift,cbrentharris/swift,tkremenek/swift,ben-ng/swift,djwbrown/swift,xedin/swift,ben-ng/swift,OscarSwanros/swift,djwbrown/swift,benlangmuir/swift,karwa/swift,practicalswift/swift,natecook1000/swift,adrfer/swift,swiftix/swift.old,shahmishal/swift,practicalswift/swift,felix91gr/swift,roambotics/swift,swiftix/swift,sdulal/swift,practicalswift/swift,swiftix/swift.old,gregomni/swift,cbrentharris/swift,adrfer/swift,johnno1962d/swift,jtbandes/swift,KrishMunot/swift,jopamer/swift,amraboelela/swift,amraboelela/swift,shahmishal/swift,mightydeveloper/swift,dduan/swift,arvedviehweger/swift,Jnosh/swift,airspeedswift/swift,austinzheng/swift,brentdax/swift,therealbnut/swift,aschwaighofer/swift,tinysun212/swift-windows,tjw/swift,gottesmm/swift,milseman/swift,swiftix/swift.old,Jnosh/swift,xwu/swift,cbrentharris/swift,ken0nek/swift,uasys/swift,OscarSwanros/swift,johnno1962d/swift,ken0nek/swift,cbrentharris/swift,stephentyrone/swift,frootloops/swift,uasys/swift,JGiola/swift,brentdax/swift,tardieu/swift,aschwaighofer/swift,devincoughlin/swift,allevato/swift,amraboelela/swift,sdulal/swift,calebd/swift,austinzheng/swift,JaSpa/swift,JaSpa/swift,roambotics/swift,dreamsxin/swift,adrfer/swift,bitjammer/swift,hooman/swift,austinzheng/swift,return/swift,jmgc/swift,uasys/swift,swiftix/swift,mightydeveloper/swift,djwbrown/swift,gribozavr/swift,tkremenek/swift,shahmishal/swift,IngmarStein/swift,lorentey/swift,LeoShimonaka/swift,Jnosh/swift,jmgc/swift,calebd/swift,sschiau/swift,shajrawi/swift,alblue/swift,xwu/swift,jckarter/swift,SwiftAndroid/swift,harlanhaskins/swift,jmgc/swift,bitjammer/swift,karwa/swift,Jnosh/swift,LeoShimonaka/swift,alblue/swift,roambotics/swift,uasys/swift,ahoppen/swift,atrick/swift,huonw/swift,gribozavr/swift,ben-ng/swift,swiftix/swift,manavgabhawala/swift,jtbandes/swift,kentya6/swift,karwa/swift,slavapestov/swift,aschwaighofer/swift,danielmartin/swift,MukeshKumarS/Swift,tinysun212/swift-windows,tkremenek/swift,kstaring/swift,modocache/swift,johnno1962d/swift,LeoShimonaka/swift,tkremenek/swift,LeoShimonaka/swift,manavgabhawala/swift,ben-ng/swift,SwiftAndroid/swift,brentdax/swift,gmilos/swift,JGiola/swift,airspeedswift/swift,xwu/swift,milseman/swift,lorentey/swift,SwiftAndroid/swift,IngmarStein/swift,xedin/swift,shajrawi/swift,LeoShimonaka/swift,felix91gr/swift,ahoppen/swift,uasys/swift,xedin/swift,alblue/swift,nathawes/swift,dduan/swift,codestergit/swift,calebd/swift,return/swift,stephentyrone/swift,tkremenek/swift,sdulal/swift,harlanhaskins/swift,khizkhiz/swift,gottesmm/swift,lorentey/swift,rudkx/swift,benlangmuir/swift,codestergit/swift,practicalswift/swift,kentya6/swift,ahoppen/swift,uasys/swift,harlanhaskins/swift,frootloops/swift,milseman/swift,tardieu/swift,emilstahl/swift,hughbe/swift,therealbnut/swift,glessard/swift,shajrawi/swift,huonw/swift,ben-ng/swift,MukeshKumarS/Swift,jckarter/swift,tardieu/swift,arvedviehweger/swift,kperryua/swift,CodaFi/swift,zisko/swift,tinysun212/swift-windows,Jnosh/swift,frootloops/swift,KrishMunot/swift,frootloops/swift,dduan/swift,CodaFi/swift,deyton/swift,cbrentharris/swift,natecook1000/swift,brentdax/swift | swift | ## Code Before:
// RUN: %target-swift-ide-test -code-completion -code-completion-token=A -source-filename=%s | FileCheck %s
// RUN: %target-swift-ide-test -code-completion -code-completion-token=B -source-filename=%s | FileCheck %s
typealias X = protocol<CustomStringConvertible>
typealias Y = protocol<CustomStringConvertible>
extension protocol<X, Y> {
func x() { #^A^# }
}
extension AnyObject {
func x() { #^B^# }
}
// Sanity check results.
// CHECK: Keyword/None: let
## Instruction:
[CodeCompletion] Update validation-test/IDE after keyword changes
## Code After:
// RUN: %target-swift-ide-test -code-completion -code-completion-token=A -source-filename=%s | FileCheck %s
// RUN: %target-swift-ide-test -code-completion -code-completion-token=B -source-filename=%s | FileCheck %s
typealias X = protocol<CustomStringConvertible>
typealias Y = protocol<CustomStringConvertible>
extension protocol<X, Y> {
func x() { #^A^# }
}
extension AnyObject {
func x() { #^B^# }
}
// Sanity check results.
// CHECK: Keyword[let]/None: let
|
957637fdd18d860b759c07312916d4cf0ee2dcc8 | src/Windows/Setup/WixInstall/project.json | src/Windows/Setup/WixInstall/project.json | {
"dependencies": {
"MicroBuild.Core": "0.2.0",
"WiX": "3.11.0"
},
"frameworks": {
"net46": {}
},
"runtimes": {
"win": {}
}
} | {
"dependencies": {
"MicroBuild.Core": "0.2.0",
"VS.Tools.Wix": "1.0.15100801",
"DDWixExt": "14.0.22823.1",
"WiX": "3.11.0"
},
"frameworks": {
"net46": {}
},
"runtimes": {
"win": {}
}
} | Add Vs Wix to the install list | Add Vs Wix to the install list
| JSON | mit | karthiknadig/RTVS,MikhailArkhipov/RTVS,karthiknadig/RTVS,AlexanderSher/RTVS,karthiknadig/RTVS,karthiknadig/RTVS,AlexanderSher/RTVS,karthiknadig/RTVS,MikhailArkhipov/RTVS,AlexanderSher/RTVS,karthiknadig/RTVS,MikhailArkhipov/RTVS,MikhailArkhipov/RTVS,AlexanderSher/RTVS,karthiknadig/RTVS,MikhailArkhipov/RTVS,AlexanderSher/RTVS,MikhailArkhipov/RTVS,MikhailArkhipov/RTVS,AlexanderSher/RTVS,AlexanderSher/RTVS | json | ## Code Before:
{
"dependencies": {
"MicroBuild.Core": "0.2.0",
"WiX": "3.11.0"
},
"frameworks": {
"net46": {}
},
"runtimes": {
"win": {}
}
}
## Instruction:
Add Vs Wix to the install list
## Code After:
{
"dependencies": {
"MicroBuild.Core": "0.2.0",
"VS.Tools.Wix": "1.0.15100801",
"DDWixExt": "14.0.22823.1",
"WiX": "3.11.0"
},
"frameworks": {
"net46": {}
},
"runtimes": {
"win": {}
}
} |
9f90f64aa998c814b4994bba3e3c82c350363b41 | www/deviceinformation.js | www/deviceinformation.js | var DeviceInformationLoader = function (require, exports, module) {
var exec = require("cordova/exec");
function DeviceInformation () {}
DeviceInformation.prototype.get = function (successFunc, failFunc) {
exec(successFunc, failFunc, "DeviceInformation","get",[]);
};
var deviceInformation = new DeviceInformation();
module.exports = deviceInformation;
};
DeviceInformationLoader(require, exports, module);
cordova.define("cordova/plugin/DeviceInformation", DeviceInformationLoader);
| var exec = require("cordova/exec");
var DeviceInformationLoader = function (require, exports, module) {
function DeviceInformation () {}
DeviceInformation.prototype.get = function (successFunc, failFunc) {
exec(successFunc, failFunc, "DeviceInformation","get",[]);
};
var deviceInformation = new DeviceInformation();
module.exports = deviceInformation;
};
DeviceInformationLoader(require, exports, module);
cordova.define("cordova/plugin/DeviceInformation", DeviceInformationLoader);
| Move require outside of function call. Maybe this will help. | Move require outside of function call. Maybe this will help.
| JavaScript | mit | UpChannel/DeviceInformationPlugin,UpChannel/DeviceInformationPlugin | javascript | ## Code Before:
var DeviceInformationLoader = function (require, exports, module) {
var exec = require("cordova/exec");
function DeviceInformation () {}
DeviceInformation.prototype.get = function (successFunc, failFunc) {
exec(successFunc, failFunc, "DeviceInformation","get",[]);
};
var deviceInformation = new DeviceInformation();
module.exports = deviceInformation;
};
DeviceInformationLoader(require, exports, module);
cordova.define("cordova/plugin/DeviceInformation", DeviceInformationLoader);
## Instruction:
Move require outside of function call. Maybe this will help.
## Code After:
var exec = require("cordova/exec");
var DeviceInformationLoader = function (require, exports, module) {
function DeviceInformation () {}
DeviceInformation.prototype.get = function (successFunc, failFunc) {
exec(successFunc, failFunc, "DeviceInformation","get",[]);
};
var deviceInformation = new DeviceInformation();
module.exports = deviceInformation;
};
DeviceInformationLoader(require, exports, module);
cordova.define("cordova/plugin/DeviceInformation", DeviceInformationLoader);
|
e2e161eb238762c54e31ffa07aa2f641eedc3e21 | src/mac/helper-scripts/build.sh | src/mac/helper-scripts/build.sh |
set -e
project=$1
if [ ! -d $project ]; then
git clone https://github.com/evancz/$project.git
fi
cd $project
# May report a "fatal" error, but that is okay.
tag=$(git describe --exact-match HEAD || echo "failure")
if [ $tag != $2 ]; then
git checkout master
git pull
git checkout tags/$2
fi
cabal install
|
set -e
project=$1
# Clone the project if necessary
if [ ! -d $project ]; then
git clone https://github.com/evancz/$project.git
fi
cd $project
# Build the project if necessary.
# "git describe" may report a fatal error, but it does not matter if that happens.
tag=$(git describe --exact-match HEAD || echo "failure")
if [ $tag != $2 ]; then
git checkout master
git pull
git checkout tags/$2
cabal install
fi
| Add comments and run "cabal install" only if we had to jump to the correct tag | Add comments and run "cabal install" only if we had to jump to the correct tag
| Shell | bsd-3-clause | mseri/elm-platform,rtorr/elm-platform,jonathanperret/elm-platform,wskplho/elm-platform,jvoigtlaender/elm-platform,jvoigtlaender/elm-platform,cored/elm-platform | shell | ## Code Before:
set -e
project=$1
if [ ! -d $project ]; then
git clone https://github.com/evancz/$project.git
fi
cd $project
# May report a "fatal" error, but that is okay.
tag=$(git describe --exact-match HEAD || echo "failure")
if [ $tag != $2 ]; then
git checkout master
git pull
git checkout tags/$2
fi
cabal install
## Instruction:
Add comments and run "cabal install" only if we had to jump to the correct tag
## Code After:
set -e
project=$1
# Clone the project if necessary
if [ ! -d $project ]; then
git clone https://github.com/evancz/$project.git
fi
cd $project
# Build the project if necessary.
# "git describe" may report a fatal error, but it does not matter if that happens.
tag=$(git describe --exact-match HEAD || echo "failure")
if [ $tag != $2 ]; then
git checkout master
git pull
git checkout tags/$2
cabal install
fi
|
d5dec78e34e1ad983292774e15fbd4d3edb618a2 | command_line/dash_r_spec.rb | command_line/dash_r_spec.rb | require_relative '../spec_helper'
describe "The -r command line option" do
before :each do
@script = fixture __FILE__, "require.rb"
@test_file = fixture __FILE__, "test_file"
end
it "requires the specified file" do
out = ruby_exe(@script, options: "-r #{@test_file}")
out.should include("REQUIRED")
out.should include(@test_file + ".rb")
end
it "requires the file before parsing the main script" do
out = ruby_exe(fixture(__FILE__, "bad_syntax.rb"), options: "-r #{@test_file}", args: "2>&1")
$?.should_not.success?
out.should include("REQUIRED")
out.should include("syntax error")
end
end
| require_relative '../spec_helper'
describe "The -r command line option" do
before :each do
@script = fixture __FILE__, "require.rb"
@test_file = fixture __FILE__, "test_file"
end
it "requires the specified file" do
out = ruby_exe(@script, options: "-r #{@test_file}")
out.should include("REQUIRED")
out.should include(@test_file + ".rb")
end
it "requires the file before parsing the main script" do
out = ruby_exe(fixture(__FILE__, "bad_syntax.rb"), options: "-r #{@test_file}", args: "2>&1")
$?.should_not.success?
out.should include("REQUIRED")
out.should include("syntax error")
end
it "does not require the file if the main script file does not exist" do
out = `#{ruby_exe.to_a.join(' ')} -r #{@test_file} #{fixture(__FILE__, "does_not_exist.rb")} 2>&1`
$?.should_not.success?
out.should_not.include?("REQUIRED")
out.should.include?("No such file or directory")
end
end
| Add spec for -r when the main script file does not exist | Add spec for -r when the main script file does not exist
| Ruby | mit | nobu/rubyspec,eregon/rubyspec,nobu/rubyspec,ruby/spec,eregon/rubyspec,ruby/spec,nobu/rubyspec,eregon/rubyspec,ruby/spec | ruby | ## Code Before:
require_relative '../spec_helper'
describe "The -r command line option" do
before :each do
@script = fixture __FILE__, "require.rb"
@test_file = fixture __FILE__, "test_file"
end
it "requires the specified file" do
out = ruby_exe(@script, options: "-r #{@test_file}")
out.should include("REQUIRED")
out.should include(@test_file + ".rb")
end
it "requires the file before parsing the main script" do
out = ruby_exe(fixture(__FILE__, "bad_syntax.rb"), options: "-r #{@test_file}", args: "2>&1")
$?.should_not.success?
out.should include("REQUIRED")
out.should include("syntax error")
end
end
## Instruction:
Add spec for -r when the main script file does not exist
## Code After:
require_relative '../spec_helper'
describe "The -r command line option" do
before :each do
@script = fixture __FILE__, "require.rb"
@test_file = fixture __FILE__, "test_file"
end
it "requires the specified file" do
out = ruby_exe(@script, options: "-r #{@test_file}")
out.should include("REQUIRED")
out.should include(@test_file + ".rb")
end
it "requires the file before parsing the main script" do
out = ruby_exe(fixture(__FILE__, "bad_syntax.rb"), options: "-r #{@test_file}", args: "2>&1")
$?.should_not.success?
out.should include("REQUIRED")
out.should include("syntax error")
end
it "does not require the file if the main script file does not exist" do
out = `#{ruby_exe.to_a.join(' ')} -r #{@test_file} #{fixture(__FILE__, "does_not_exist.rb")} 2>&1`
$?.should_not.success?
out.should_not.include?("REQUIRED")
out.should.include?("No such file or directory")
end
end
|
23d24a47df06ba1efb26d63af7edbc52d36e4d56 | src/join-arrays.ts | src/join-arrays.ts | import { cloneDeep, isFunction, isPlainObject, mergeWith } from "lodash";
import { Customize, Key } from "./types";
const isArray = Array.isArray;
export default function joinArrays({
customizeArray,
customizeObject,
key,
}: {
customizeArray?: Customize;
customizeObject?: Customize;
key?: Key;
} = {}) {
return function _joinArrays(a: any, b: any, k: Key): any {
const newKey = key ? `${key}.${k}` : k;
if (isFunction(a) && isFunction(b)) {
return (...args: any[]) => _joinArrays(a(...args), b(...args), k);
}
if (isArray(a) && isArray(b)) {
const customResult = customizeArray && customizeArray(a, b, newKey);
return customResult || [...a, ...b];
}
if (isPlainObject(a) && isPlainObject(b)) {
const customResult = customizeObject && customizeObject(a, b, newKey);
return (
customResult ||
mergeWith(
{},
a,
b,
joinArrays({
customizeArray,
customizeObject,
key: newKey,
})
)
);
}
if (isPlainObject(b)) {
return cloneDeep(b);
}
if (isArray(b)) {
return [...b];
}
return b;
};
}
| import { cloneDeep, isPlainObject, mergeWith } from "lodash";
import { Customize, Key } from "./types";
const isArray = Array.isArray;
export default function joinArrays({
customizeArray,
customizeObject,
key,
}: {
customizeArray?: Customize;
customizeObject?: Customize;
key?: Key;
} = {}) {
return function _joinArrays(a: any, b: any, k: Key): any {
const newKey = key ? `${key}.${k}` : k;
if (isFunction(a) && isFunction(b)) {
return (...args: any[]) => _joinArrays(a(...args), b(...args), k);
}
if (isArray(a) && isArray(b)) {
const customResult = customizeArray && customizeArray(a, b, newKey);
return customResult || [...a, ...b];
}
if (isPlainObject(a) && isPlainObject(b)) {
const customResult = customizeObject && customizeObject(a, b, newKey);
return (
customResult ||
mergeWith(
{},
a,
b,
joinArrays({
customizeArray,
customizeObject,
key: newKey,
})
)
);
}
if (isPlainObject(b)) {
return cloneDeep(b);
}
if (isArray(b)) {
return [...b];
}
return b;
};
}
// https://stackoverflow.com/a/7356528/228885
function isFunction(functionToCheck) {
return (
functionToCheck && {}.toString.call(functionToCheck) === "[object Function]"
);
}
| Drop dependency on lodash isFunction | refactor: Drop dependency on lodash isFunction
Related to #134.
| TypeScript | mit | survivejs/webpack-merge,survivejs/webpack-merge | typescript | ## Code Before:
import { cloneDeep, isFunction, isPlainObject, mergeWith } from "lodash";
import { Customize, Key } from "./types";
const isArray = Array.isArray;
export default function joinArrays({
customizeArray,
customizeObject,
key,
}: {
customizeArray?: Customize;
customizeObject?: Customize;
key?: Key;
} = {}) {
return function _joinArrays(a: any, b: any, k: Key): any {
const newKey = key ? `${key}.${k}` : k;
if (isFunction(a) && isFunction(b)) {
return (...args: any[]) => _joinArrays(a(...args), b(...args), k);
}
if (isArray(a) && isArray(b)) {
const customResult = customizeArray && customizeArray(a, b, newKey);
return customResult || [...a, ...b];
}
if (isPlainObject(a) && isPlainObject(b)) {
const customResult = customizeObject && customizeObject(a, b, newKey);
return (
customResult ||
mergeWith(
{},
a,
b,
joinArrays({
customizeArray,
customizeObject,
key: newKey,
})
)
);
}
if (isPlainObject(b)) {
return cloneDeep(b);
}
if (isArray(b)) {
return [...b];
}
return b;
};
}
## Instruction:
refactor: Drop dependency on lodash isFunction
Related to #134.
## Code After:
import { cloneDeep, isPlainObject, mergeWith } from "lodash";
import { Customize, Key } from "./types";
const isArray = Array.isArray;
export default function joinArrays({
customizeArray,
customizeObject,
key,
}: {
customizeArray?: Customize;
customizeObject?: Customize;
key?: Key;
} = {}) {
return function _joinArrays(a: any, b: any, k: Key): any {
const newKey = key ? `${key}.${k}` : k;
if (isFunction(a) && isFunction(b)) {
return (...args: any[]) => _joinArrays(a(...args), b(...args), k);
}
if (isArray(a) && isArray(b)) {
const customResult = customizeArray && customizeArray(a, b, newKey);
return customResult || [...a, ...b];
}
if (isPlainObject(a) && isPlainObject(b)) {
const customResult = customizeObject && customizeObject(a, b, newKey);
return (
customResult ||
mergeWith(
{},
a,
b,
joinArrays({
customizeArray,
customizeObject,
key: newKey,
})
)
);
}
if (isPlainObject(b)) {
return cloneDeep(b);
}
if (isArray(b)) {
return [...b];
}
return b;
};
}
// https://stackoverflow.com/a/7356528/228885
function isFunction(functionToCheck) {
return (
functionToCheck && {}.toString.call(functionToCheck) === "[object Function]"
);
}
|
9a39d3b95887e1dd1acb9722b7d05b3eba7fc3f6 | package.json | package.json | {
"name": "trumpet",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start --skipflow",
"test": "yarn build && jest",
"lint": "tslint --project tsconfig.json --type-check",
"build": "tsc",
"build:watch": "tsc --watch"
},
"jest": {
"preset": "react-native",
"testRegex": "dist/__tests__/.*.jsx?$"
},
"dependencies": {
"react": "16.0.0-alpha.6",
"react-native": "0.43.3"
},
"devDependencies": {
"@types/jest": "^19.2.2",
"@types/react": "^15.0.21",
"@types/react-native": "^0.43.1",
"@types/react-test-renderer": "^15.4.5",
"axios": "^0.16.1",
"jest": "^19.0.2",
"react-test-renderer": "16.0.0-alpha.6",
"tslint": "^5.1.0",
"typescript": "^2.2.2"
}
}
| {
"name": "trumpet",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start --skipflow",
"android": "node node_modules/react-native/local-cli/cli.js run-android",
"ios": "node node_modules/react-native/local-cli/cli.js run-ios",
"test": "yarn build && jest",
"lint": "tslint --project tsconfig.json --type-check",
"build": "tsc",
"build:watch": "tsc --watch"
},
"jest": {
"preset": "react-native",
"testRegex": "dist/__tests__/.*.jsx?$"
},
"dependencies": {
"react": "16.0.0-alpha.6",
"react-native": "0.43.3"
},
"devDependencies": {
"@types/jest": "^19.2.2",
"@types/react": "^15.0.21",
"@types/react-native": "^0.43.1",
"@types/react-test-renderer": "^15.4.5",
"axios": "^0.16.1",
"jest": "^19.0.2",
"react-test-renderer": "16.0.0-alpha.6",
"tslint": "^5.1.0",
"typescript": "^2.2.2"
}
}
| Add android and ios npm script for development | Add android and ios npm script for development
| JSON | mit | y0za/trumpet,y0za/trumpet,y0za/trumpet,y0za/trumpet | json | ## Code Before:
{
"name": "trumpet",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start --skipflow",
"test": "yarn build && jest",
"lint": "tslint --project tsconfig.json --type-check",
"build": "tsc",
"build:watch": "tsc --watch"
},
"jest": {
"preset": "react-native",
"testRegex": "dist/__tests__/.*.jsx?$"
},
"dependencies": {
"react": "16.0.0-alpha.6",
"react-native": "0.43.3"
},
"devDependencies": {
"@types/jest": "^19.2.2",
"@types/react": "^15.0.21",
"@types/react-native": "^0.43.1",
"@types/react-test-renderer": "^15.4.5",
"axios": "^0.16.1",
"jest": "^19.0.2",
"react-test-renderer": "16.0.0-alpha.6",
"tslint": "^5.1.0",
"typescript": "^2.2.2"
}
}
## Instruction:
Add android and ios npm script for development
## Code After:
{
"name": "trumpet",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start --skipflow",
"android": "node node_modules/react-native/local-cli/cli.js run-android",
"ios": "node node_modules/react-native/local-cli/cli.js run-ios",
"test": "yarn build && jest",
"lint": "tslint --project tsconfig.json --type-check",
"build": "tsc",
"build:watch": "tsc --watch"
},
"jest": {
"preset": "react-native",
"testRegex": "dist/__tests__/.*.jsx?$"
},
"dependencies": {
"react": "16.0.0-alpha.6",
"react-native": "0.43.3"
},
"devDependencies": {
"@types/jest": "^19.2.2",
"@types/react": "^15.0.21",
"@types/react-native": "^0.43.1",
"@types/react-test-renderer": "^15.4.5",
"axios": "^0.16.1",
"jest": "^19.0.2",
"react-test-renderer": "16.0.0-alpha.6",
"tslint": "^5.1.0",
"typescript": "^2.2.2"
}
}
|
607a98e1038ac8cfda62e6b9b00d1e1387cfeca3 | Set/Set.h | Set/Set.h | //
// Set.h
// Set
//
// Created by Rob Rix on 2014-06-22.
// Copyright (c) 2014 Rob Rix. All rights reserved.
//
#import <Cocoa/Cocoa.h>
//! Project version number for Set.
FOUNDATION_EXPORT double SetVersionNumber;
//! Project version string for Set.
FOUNDATION_EXPORT const unsigned char SetVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <Set/PublicHeader.h>
| // Copyright (c) 2014 Rob Rix. All rights reserved.
/// Project version number for Set.
extern double SetVersionNumber;
/// Project version string for Set.
extern const unsigned char SetVersionString[];
| Tidy up the umbrella header. | Tidy up the umbrella header.
| C | mit | IngmarStein/Set,IngmarStein/Set,madbat/Set,IngmarStein/Set,robrix/Set,robrix/Set,natecook1000/Set,natecook1000/Set,natecook1000/Set,madbat/Set,madbat/Set,robrix/Set | c | ## Code Before:
//
// Set.h
// Set
//
// Created by Rob Rix on 2014-06-22.
// Copyright (c) 2014 Rob Rix. All rights reserved.
//
#import <Cocoa/Cocoa.h>
//! Project version number for Set.
FOUNDATION_EXPORT double SetVersionNumber;
//! Project version string for Set.
FOUNDATION_EXPORT const unsigned char SetVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <Set/PublicHeader.h>
## Instruction:
Tidy up the umbrella header.
## Code After:
// Copyright (c) 2014 Rob Rix. All rights reserved.
/// Project version number for Set.
extern double SetVersionNumber;
/// Project version string for Set.
extern const unsigned char SetVersionString[];
|
6e9d992e8b771797538db6639fecfb298b402686 | includes/inject-loader.js | includes/inject-loader.js |
describe('My module', () => {
beforeEach(() => {
myModule = injectLoaderCompatibility(
__dirname,
'../src/my-module.js',
{
'events': eventsMock,
'../lib/dispatcher': dispatcherMock,
'../lib/handle-action': handleActionMock
}
);
});
});
| import injector from 'inject!../src/my-module.js';
describe('My module', () => {
beforeEach(() => {
myModule = injector({
'events': eventsMock,
'../lib/dispatcher': dispatcherMock,
'../lib/handle-action': handleActionMock
});
});
});
| Undo applying macro to example | Undo applying macro to example
| JavaScript | mit | 0xR/graphql-clients-slides,0xR/graphql-clients-slides | javascript | ## Code Before:
describe('My module', () => {
beforeEach(() => {
myModule = injectLoaderCompatibility(
__dirname,
'../src/my-module.js',
{
'events': eventsMock,
'../lib/dispatcher': dispatcherMock,
'../lib/handle-action': handleActionMock
}
);
});
});
## Instruction:
Undo applying macro to example
## Code After:
import injector from 'inject!../src/my-module.js';
describe('My module', () => {
beforeEach(() => {
myModule = injector({
'events': eventsMock,
'../lib/dispatcher': dispatcherMock,
'../lib/handle-action': handleActionMock
});
});
});
|
a89c4711deaaf37b1fb32ccd2d58c5630ec1099a | .travis.yml | .travis.yml | language: d
d:
- dmd-2.073.1
- ldc-1.1.0
- ldc-1.0.0
script:
- dub build
| language: d
d:
- dmd-2.073.1
- ldc-1.1.0
cript:
- dub build
| Remove ldc-1.0.0 from Travis, too old to deal with anymore | Remove ldc-1.0.0 from Travis, too old to deal with anymore
| YAML | mpl-2.0 | gnunn1/tilix,gnunn1/terminix,gnunn1/terminix,dsboger/tilix,dsboger/tilix,gnunn1/tilix,gnunn1/tilix | yaml | ## Code Before:
language: d
d:
- dmd-2.073.1
- ldc-1.1.0
- ldc-1.0.0
script:
- dub build
## Instruction:
Remove ldc-1.0.0 from Travis, too old to deal with anymore
## Code After:
language: d
d:
- dmd-2.073.1
- ldc-1.1.0
cript:
- dub build
|
e380d669bc09e047282be1d91cc95a7651300141 | farms/tests/test_models.py | farms/tests/test_models.py | """Unit test the farms models."""
from farms.factories import AddressFactory
from mock import MagicMock
def test_address_factory_generates_valid_addresses_sort_of(mocker):
"""Same test, but using pytest-mock."""
mocker.patch('farms.models.Address.save', MagicMock(name="save"))
address = AddressFactory.create()
assert address.street is not ''
assert address.postal_code is not ''
assert len(address.postal_code) == 5
assert address.city is not ''
| """Unit test the farms models."""
from ..factories import AddressFactory
from ..models import Address
import pytest
def test_address_factory_generates_valid_address():
# GIVEN any state
# WHEN building a new address
address = AddressFactory.build()
# THEN it has all the information we want
assert address.street is not ''
assert address.postal_code is not ''
assert len(address.postal_code) == 5
assert address.city is not ''
@pytest.mark.django_db
def test_address_can_be_saved_and_retrieved():
# GIVEN a fresh address instance
address = AddressFactory.build()
street = address.street
postal_code = address.postal_code
# WHEN saving it to the database
address.save()
# THEN the db entry is correct
saved_address = Address.objects.last()
assert saved_address.street == street
assert saved_address.postal_code == postal_code
| Add integration test for Address model | Add integration test for Address model
| Python | mit | FlowFX/sturdy-potato,FlowFX/sturdy-potato,FlowFX/sturdy-potato | python | ## Code Before:
"""Unit test the farms models."""
from farms.factories import AddressFactory
from mock import MagicMock
def test_address_factory_generates_valid_addresses_sort_of(mocker):
"""Same test, but using pytest-mock."""
mocker.patch('farms.models.Address.save', MagicMock(name="save"))
address = AddressFactory.create()
assert address.street is not ''
assert address.postal_code is not ''
assert len(address.postal_code) == 5
assert address.city is not ''
## Instruction:
Add integration test for Address model
## Code After:
"""Unit test the farms models."""
from ..factories import AddressFactory
from ..models import Address
import pytest
def test_address_factory_generates_valid_address():
# GIVEN any state
# WHEN building a new address
address = AddressFactory.build()
# THEN it has all the information we want
assert address.street is not ''
assert address.postal_code is not ''
assert len(address.postal_code) == 5
assert address.city is not ''
@pytest.mark.django_db
def test_address_can_be_saved_and_retrieved():
# GIVEN a fresh address instance
address = AddressFactory.build()
street = address.street
postal_code = address.postal_code
# WHEN saving it to the database
address.save()
# THEN the db entry is correct
saved_address = Address.objects.last()
assert saved_address.street == street
assert saved_address.postal_code == postal_code
|
77567b0280eb5f326b0860096f473bb69064e672 | iOSNativeiPadApp/EdKeyNote/EdKeyNote/EdKeyNote/EKNAppDelegate.h | iOSNativeiPadApp/EdKeyNote/EdKeyNote/EdKeyNote/EKNAppDelegate.h | //
// EKNAppDelegate.h
// EdKeyNote
//
// Created by canviz on 9/22/14.
// Copyright (c) 2014 canviz. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "EKNDeskTopViewController.h"
#import "EKNLoginViewController.h"
@interface EKNAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) EKNLoginViewController *viewController;
@property (strong, nonatomic) UINavigationController *naviController;
@end
| //
// EKNAppDelegate.h
// EdKeyNote
//
// Created by canviz on 9/22/14.
// Copyright (c) 2014 canviz. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "EKNLoginViewController.h"
@interface EKNAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) EKNLoginViewController *viewController;
@property (strong, nonatomic) UINavigationController *naviController;
@end
| Remove the import for EKNDeskTopViewController.h | Remove the import for EKNDeskTopViewController.h
| C | apache-2.0 | weshackett/Property-Inspection-Code-Sample,mslaugh/Property-Inspection-Code-Sample,OfficeDev/Property-Inspection-Code-Sample,weshackett/Property-Inspection-Code-Sample,OfficeDev/Property-Inspection-Code-Sample,mslaugh/Property-Inspection-Code-Sample,OfficeDev/Property-Inspection-Code-Sample,weshackett/Property-Inspection-Code-Sample,OfficeDev/Property-Inspection-Code-Sample,mslaugh/Property-Inspection-Code-Sample,mslaugh/Property-Inspection-Code-Sample,OfficeDev/Property-Inspection-Code-Sample,weshackett/Property-Inspection-Code-Sample,weshackett/Property-Inspection-Code-Sample,mslaugh/Property-Inspection-Code-Sample,mslaugh/Property-Inspection-Code-Sample,weshackett/Property-Inspection-Code-Sample,OfficeDev/Property-Inspection-Code-Sample,OfficeDev/Property-Inspection-Code-Sample | c | ## Code Before:
//
// EKNAppDelegate.h
// EdKeyNote
//
// Created by canviz on 9/22/14.
// Copyright (c) 2014 canviz. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "EKNDeskTopViewController.h"
#import "EKNLoginViewController.h"
@interface EKNAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) EKNLoginViewController *viewController;
@property (strong, nonatomic) UINavigationController *naviController;
@end
## Instruction:
Remove the import for EKNDeskTopViewController.h
## Code After:
//
// EKNAppDelegate.h
// EdKeyNote
//
// Created by canviz on 9/22/14.
// Copyright (c) 2014 canviz. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "EKNLoginViewController.h"
@interface EKNAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) EKNLoginViewController *viewController;
@property (strong, nonatomic) UINavigationController *naviController;
@end
|
e209c667a3c3e43f15cd598627da079654ec3cbb | src/DateFns.js | src/DateFns.js | import moment from "moment";
function initLocale(name, config) {
try {
moment.locale(name, config);
} catch (error) {
throw new Error(
"Locale prop is not in the correct format. \n Locale has to be in form of object, with keys of name and config. " +
error.message
);
}
}
function initMoment(date, locale) {
if (locale && locale.name) {
return moment(date).startOf("day").locale(locale.name);
} else {
return moment(date).startOf("day");
}
}
function getStartOfWeek(moment, isoStartDay = 1) {
let result = moment.clone().isoWeekday(isoStartDay);
if (moment.isoWeekday() < isoStartDay) {
return result.subtract(1, "week");
} else {
return result.isoWeekday(isoStartDay);
}
}
function getSelectedDayOfWeek(selectedDate, isoStartDay) {
let result = selectedDate.isoWeekday() - isoStartDay;
if (result < 0) {
result += 7;
}
return result;
}
export default { getSelectedDayOfWeek, getStartOfWeek, initLocale, initMoment };
| import moment from "moment";
function initLocale(name, config) {
try {
moment.locale(name, config);
} catch (error) {
throw new Error(
"Locale prop is not in the correct format. \n Locale has to be in form of object, with keys of name and config. " +
error.message
);
}
}
function initMoment(date, locale) {
if (locale && locale.name) {
return moment(date).startOf("day").locale(locale.name);
} else {
return moment(date).startOf("day");
}
}
function getStartOfWeek(moment, isoStartDay = 1) {
let result = moment.clone().isoWeekday(isoStartDay);
if (moment.isoWeekday() < isoStartDay) {
return result.subtract(1, "week");
} else {
return result;
}
}
function getSelectedDayOfWeek(selectedDate, isoStartDay) {
let result = selectedDate.isoWeekday() - isoStartDay;
if (result < 0) {
result += 7;
}
return result;
}
export default { getSelectedDayOfWeek, getStartOfWeek, initLocale, initMoment };
| Remove unnecessary call to isoWeekday | Remove unnecessary call to isoWeekday
| JavaScript | mit | samcolby/react-native-date-slider | javascript | ## Code Before:
import moment from "moment";
function initLocale(name, config) {
try {
moment.locale(name, config);
} catch (error) {
throw new Error(
"Locale prop is not in the correct format. \n Locale has to be in form of object, with keys of name and config. " +
error.message
);
}
}
function initMoment(date, locale) {
if (locale && locale.name) {
return moment(date).startOf("day").locale(locale.name);
} else {
return moment(date).startOf("day");
}
}
function getStartOfWeek(moment, isoStartDay = 1) {
let result = moment.clone().isoWeekday(isoStartDay);
if (moment.isoWeekday() < isoStartDay) {
return result.subtract(1, "week");
} else {
return result.isoWeekday(isoStartDay);
}
}
function getSelectedDayOfWeek(selectedDate, isoStartDay) {
let result = selectedDate.isoWeekday() - isoStartDay;
if (result < 0) {
result += 7;
}
return result;
}
export default { getSelectedDayOfWeek, getStartOfWeek, initLocale, initMoment };
## Instruction:
Remove unnecessary call to isoWeekday
## Code After:
import moment from "moment";
function initLocale(name, config) {
try {
moment.locale(name, config);
} catch (error) {
throw new Error(
"Locale prop is not in the correct format. \n Locale has to be in form of object, with keys of name and config. " +
error.message
);
}
}
function initMoment(date, locale) {
if (locale && locale.name) {
return moment(date).startOf("day").locale(locale.name);
} else {
return moment(date).startOf("day");
}
}
function getStartOfWeek(moment, isoStartDay = 1) {
let result = moment.clone().isoWeekday(isoStartDay);
if (moment.isoWeekday() < isoStartDay) {
return result.subtract(1, "week");
} else {
return result;
}
}
function getSelectedDayOfWeek(selectedDate, isoStartDay) {
let result = selectedDate.isoWeekday() - isoStartDay;
if (result < 0) {
result += 7;
}
return result;
}
export default { getSelectedDayOfWeek, getStartOfWeek, initLocale, initMoment };
|
6654352253f41597fd1ba79a06d839a09f57514d | app/controllers/File.java | app/controllers/File.java | package controllers;
import play.db.jpa.JPA;
import play.db.jpa.Transactional;
import play.mvc.Result;
import java.io.IOException;
import static play.mvc.Results.ok;
public class File {
@Transactional
public Result get(Long id) {
models.FileMeta fileMeta = JPA.em().find(models.FileMeta.class, id);
java.io.File file = models.FileManager.getFile(fileMeta);
return ok(file).as(fileMeta.getMimeType());
}
@Transactional
public Result getPreview(Long id) throws IOException {
models.FileMeta fileMeta = JPA.em().find(models.FileMeta.class, id);
java.io.File file = models.FileManager.getThumbnail(fileMeta);
return ok(file).as(fileMeta.getMimeType());
}
}
| package controllers;
import play.db.jpa.JPA;
import play.db.jpa.Transactional;
import play.mvc.Result;
import java.io.IOException;
import static play.mvc.Results.ok;
public class File {
@Transactional
public Result get(Long id) {
models.FileMeta fileMeta = JPA.em().find(models.FileMeta.class, id);
java.io.File file = models.FileManager.getFile(fileMeta);
return ok(file).as(fileMeta.getMimeType());
}
@Transactional
public Result getPreview(Long id) throws IOException {
models.FileMeta fileMeta = JPA.em().find(models.FileMeta.class, id);
java.io.File file = models.FileManager.getThumbnail(fileMeta);
return ok(file);
}
}
| Fix wrong Content-Type header in /file/min/ | Fix wrong Content-Type header in /file/min/
| Java | agpl-3.0 | m4tx/arroch,m4tx/arroch | java | ## Code Before:
package controllers;
import play.db.jpa.JPA;
import play.db.jpa.Transactional;
import play.mvc.Result;
import java.io.IOException;
import static play.mvc.Results.ok;
public class File {
@Transactional
public Result get(Long id) {
models.FileMeta fileMeta = JPA.em().find(models.FileMeta.class, id);
java.io.File file = models.FileManager.getFile(fileMeta);
return ok(file).as(fileMeta.getMimeType());
}
@Transactional
public Result getPreview(Long id) throws IOException {
models.FileMeta fileMeta = JPA.em().find(models.FileMeta.class, id);
java.io.File file = models.FileManager.getThumbnail(fileMeta);
return ok(file).as(fileMeta.getMimeType());
}
}
## Instruction:
Fix wrong Content-Type header in /file/min/
## Code After:
package controllers;
import play.db.jpa.JPA;
import play.db.jpa.Transactional;
import play.mvc.Result;
import java.io.IOException;
import static play.mvc.Results.ok;
public class File {
@Transactional
public Result get(Long id) {
models.FileMeta fileMeta = JPA.em().find(models.FileMeta.class, id);
java.io.File file = models.FileManager.getFile(fileMeta);
return ok(file).as(fileMeta.getMimeType());
}
@Transactional
public Result getPreview(Long id) throws IOException {
models.FileMeta fileMeta = JPA.em().find(models.FileMeta.class, id);
java.io.File file = models.FileManager.getThumbnail(fileMeta);
return ok(file);
}
}
|
479eb7901f7087bac243ab1894adde80d49d5296 | .travis.yml | .travis.yml | language: python
python:
- "2.7"
- "3.5"
- "3.6"
- "3.7"
- "3.8"
dist: bionic
env:
- DJANGO_SPEC= CELERY_SPEC= TENANT_SCHEMAS="django-tenant-schemas"
- DJANGO_SPEC= CELERY_SPEC= TENANT_SCHEMAS="django-tenants"
matrix:
exclude:
- python: "2.7"
env: DJANGO_SPEC= CELERY_SPEC= TENANT_SCHEMAS="django-tenants"
install:
- "pip install \"Django${DJANGO_SPEC}\" \"celery${CELERY_SPEC}\" \"${TENANT_SCHEMAS}\""
- pip install -r requirements.txt -e .
services:
- postgresql
- rabbitmq
addons:
postgresql: "9.5"
sudo: required
before_script:
- psql -c "create user tenant_celery with password 'qwe123'" -U postgres
- psql -c "alter role tenant_celery createdb" -U postgres
- psql -c "create database tenant_celery with owner tenant_celery" -U postgres
script: "./run-tests"
| language: python
python:
- "2.7"
- "3.5"
- "3.6"
dist: trusty
env:
- DJANGO_SPEC= CELERY_SPEC= TENANT_SCHEMAS="django-tenant-schemas"
- DJANGO_SPEC= CELERY_SPEC= TENANT_SCHEMAS="django-tenants"
matrix:
exclude:
- python: "2.7"
env: DJANGO_SPEC= CELERY_SPEC= TENANT_SCHEMAS="django-tenants"
install:
- "pip install \"Django${DJANGO_SPEC}\" \"celery${CELERY_SPEC}\" \"${TENANT_SCHEMAS}\""
- pip install -r requirements.txt -e .
services:
- postgresql
- rabbitmq
addons:
postgresql: "9.5"
sudo: required
before_script:
- psql -c "create user tenant_celery with password 'qwe123'" -U postgres
- psql -c "alter role tenant_celery createdb" -U postgres
- psql -c "create database tenant_celery with owner tenant_celery" -U postgres
script: "./run-tests"
| Rollback python and ubuntu bump | Rollback python and ubuntu bump
| YAML | mit | maciej-gol/tenant-schemas-celery,maciej-gol/tenant-schemas-celery | yaml | ## Code Before:
language: python
python:
- "2.7"
- "3.5"
- "3.6"
- "3.7"
- "3.8"
dist: bionic
env:
- DJANGO_SPEC= CELERY_SPEC= TENANT_SCHEMAS="django-tenant-schemas"
- DJANGO_SPEC= CELERY_SPEC= TENANT_SCHEMAS="django-tenants"
matrix:
exclude:
- python: "2.7"
env: DJANGO_SPEC= CELERY_SPEC= TENANT_SCHEMAS="django-tenants"
install:
- "pip install \"Django${DJANGO_SPEC}\" \"celery${CELERY_SPEC}\" \"${TENANT_SCHEMAS}\""
- pip install -r requirements.txt -e .
services:
- postgresql
- rabbitmq
addons:
postgresql: "9.5"
sudo: required
before_script:
- psql -c "create user tenant_celery with password 'qwe123'" -U postgres
- psql -c "alter role tenant_celery createdb" -U postgres
- psql -c "create database tenant_celery with owner tenant_celery" -U postgres
script: "./run-tests"
## Instruction:
Rollback python and ubuntu bump
## Code After:
language: python
python:
- "2.7"
- "3.5"
- "3.6"
dist: trusty
env:
- DJANGO_SPEC= CELERY_SPEC= TENANT_SCHEMAS="django-tenant-schemas"
- DJANGO_SPEC= CELERY_SPEC= TENANT_SCHEMAS="django-tenants"
matrix:
exclude:
- python: "2.7"
env: DJANGO_SPEC= CELERY_SPEC= TENANT_SCHEMAS="django-tenants"
install:
- "pip install \"Django${DJANGO_SPEC}\" \"celery${CELERY_SPEC}\" \"${TENANT_SCHEMAS}\""
- pip install -r requirements.txt -e .
services:
- postgresql
- rabbitmq
addons:
postgresql: "9.5"
sudo: required
before_script:
- psql -c "create user tenant_celery with password 'qwe123'" -U postgres
- psql -c "alter role tenant_celery createdb" -U postgres
- psql -c "create database tenant_celery with owner tenant_celery" -U postgres
script: "./run-tests"
|
395e258d18fa000b74c1af33e0dfcb21fdfd2375 | src/components/search-box.jsx | src/components/search-box.jsx | import React, {PropTypes} from "react"
const SearchBox = React.createClass({
propTypes: {
query: PropTypes.string,
onQueryChange: PropTypes.func,
},
onInputChange(event) {
this.props.onQueryChange(event.target.value)
},
render() {
return (
<div className="panel panel-default">
<div className="panel-heading">
<h3 className="panel-title">Recherche</h3>
</div>
<div className="panel-body">
<div className="form-group">
<label htmlFor="search-box-input">
Nom
</label>
<input
className="form-control"
id="search-box-input"
onChange={this.onInputChange}
placeholder="Nom"
value={this.props.query}
/>
</div>
</div>
</div>
)
},
})
export default SearchBox
| import React, {PropTypes} from "react"
const SearchBox = React.createClass({
propTypes: {
query: PropTypes.string,
onQueryChange: PropTypes.func,
},
handleSubmit(event) {
event.preventDefault();
this.props.onQueryChange(this.input.value)
},
render() {
return (
<div className="panel panel-default">
<div className="panel-heading">
<h3 className="panel-title">Recherche</h3>
</div>
<div className="panel-body">
<form onSubmit={this.handleSubmit}>
<div className="form-group">
<label htmlFor="search-box-input">
Nom
</label>
<input
className="form-control"
defaultValue={this.props.query}
id="search-box-input"
placeholder="Nom"
ref={(input) => this.input = input}
/>
</div>
<button className="btn btn-primary">Rechercher</button>
</form>
</div>
</div>
)
},
})
export default SearchBox
| Use a search button to reduce computations on each char typed | Use a search button to reduce computations on each char typed
| JSX | agpl-3.0 | openfisca/legislation-explorer | jsx | ## Code Before:
import React, {PropTypes} from "react"
const SearchBox = React.createClass({
propTypes: {
query: PropTypes.string,
onQueryChange: PropTypes.func,
},
onInputChange(event) {
this.props.onQueryChange(event.target.value)
},
render() {
return (
<div className="panel panel-default">
<div className="panel-heading">
<h3 className="panel-title">Recherche</h3>
</div>
<div className="panel-body">
<div className="form-group">
<label htmlFor="search-box-input">
Nom
</label>
<input
className="form-control"
id="search-box-input"
onChange={this.onInputChange}
placeholder="Nom"
value={this.props.query}
/>
</div>
</div>
</div>
)
},
})
export default SearchBox
## Instruction:
Use a search button to reduce computations on each char typed
## Code After:
import React, {PropTypes} from "react"
const SearchBox = React.createClass({
propTypes: {
query: PropTypes.string,
onQueryChange: PropTypes.func,
},
handleSubmit(event) {
event.preventDefault();
this.props.onQueryChange(this.input.value)
},
render() {
return (
<div className="panel panel-default">
<div className="panel-heading">
<h3 className="panel-title">Recherche</h3>
</div>
<div className="panel-body">
<form onSubmit={this.handleSubmit}>
<div className="form-group">
<label htmlFor="search-box-input">
Nom
</label>
<input
className="form-control"
defaultValue={this.props.query}
id="search-box-input"
placeholder="Nom"
ref={(input) => this.input = input}
/>
</div>
<button className="btn btn-primary">Rechercher</button>
</form>
</div>
</div>
)
},
})
export default SearchBox
|
81a02c41a4489953352178a01360f63fe5bbf255 | .travis.yml | .travis.yml | language: ruby
rvm:
- 1.9.3
- 2.0.0
- 2.1.2
- ruby-head
| language: ruby
rvm:
- 1.9.3
- 2.0.0
- 2.1.2
- ruby-head
env:
- WITH_LIBXML=true
- WITH_LIBXML=false
before_script: |
if [ "$WITH_LIBXML" == "false" ]; then
sudo apt-get remove libxml2-dev
fi
| Build with and without libxml | Build with and without libxml
| YAML | apache-2.0 | rubys/nokogumbo,jbotelho2-bb/nokogumbo,rubys/nokogumbo,jbotelho2-bb/nokogumbo,rubys/nokogumbo,rubys/nokogumbo | yaml | ## Code Before:
language: ruby
rvm:
- 1.9.3
- 2.0.0
- 2.1.2
- ruby-head
## Instruction:
Build with and without libxml
## Code After:
language: ruby
rvm:
- 1.9.3
- 2.0.0
- 2.1.2
- ruby-head
env:
- WITH_LIBXML=true
- WITH_LIBXML=false
before_script: |
if [ "$WITH_LIBXML" == "false" ]; then
sudo apt-get remove libxml2-dev
fi
|
5c660b471c394d7d143d10ebf575a460fbf2b583 | memento/lib/velvet_fog_machine.dart | memento/lib/velvet_fog_machine.dart | library velvet_fog_machine;
import 'dart:math';
// The "Originator"
class VelvetFogMachine {
// The Memento
Playing _nowPlaying;
// Set the state
void play(String title, String album, [double time = 0.0]) {
print("Playing $title // $album @ ${time.toStringAsFixed(2)}");
_nowPlaying = new Playing(title, album, time);
}
Playing get nowPlaying {
_nowPlaying.time = 5*rand.nextDouble();
return _nowPlaying;
}
// Restore from memento
void backTo(Playing memento) {
print(" *** Whoa! This was a good one, let's hear it again :) ***");
play(memento.title, memento.album, memento.time);
}
}
final rand = new Random(1);
// The Memento
class Playing {
String title, album;
double time;
Playing(this.title, this.album, this.time);
}
| library velvet_fog_machine;
import 'dart:math';
final rand = new Random(1);
// The "Originator"
class VelvetFogMachine {
Song currentSong;
double currentTime;
// Set the state
void play(String title, String album, [double time = 0.0]) {
_play(new Song(title, album), time);
}
void _play(Song s, double t) {
currentSong = s;
currentTime = t;
print("Playing $currentSong @ ${currentTime.toStringAsFixed(2)}");
}
// Create a memento of the current state
Playing get nowPlaying {
// Simulate playing at some time later:
var time = 5*rand.nextDouble();
return new Playing(currentSong, time);
}
// Restore from memento
void backTo(Playing p) {
print(" *** Whoa! This was a good one, let's hear it again :) ***");
_play(p.song, p.time);
}
}
class Song {
String title, album;
Song(this.title, this.album);
String toString() => "$title // $album";
}
// The Memento
class Playing {
Song song;
double time;
Playing(this.song, this.time);
}
| Improve memento example w/ more realistic originator structure | Improve memento example w/ more realistic originator structure
| Dart | mit | eee-c/design-patterns-in-dart,eee-c/design-patterns-in-dart,eee-c/design-patterns-in-dart | dart | ## Code Before:
library velvet_fog_machine;
import 'dart:math';
// The "Originator"
class VelvetFogMachine {
// The Memento
Playing _nowPlaying;
// Set the state
void play(String title, String album, [double time = 0.0]) {
print("Playing $title // $album @ ${time.toStringAsFixed(2)}");
_nowPlaying = new Playing(title, album, time);
}
Playing get nowPlaying {
_nowPlaying.time = 5*rand.nextDouble();
return _nowPlaying;
}
// Restore from memento
void backTo(Playing memento) {
print(" *** Whoa! This was a good one, let's hear it again :) ***");
play(memento.title, memento.album, memento.time);
}
}
final rand = new Random(1);
// The Memento
class Playing {
String title, album;
double time;
Playing(this.title, this.album, this.time);
}
## Instruction:
Improve memento example w/ more realistic originator structure
## Code After:
library velvet_fog_machine;
import 'dart:math';
final rand = new Random(1);
// The "Originator"
class VelvetFogMachine {
Song currentSong;
double currentTime;
// Set the state
void play(String title, String album, [double time = 0.0]) {
_play(new Song(title, album), time);
}
void _play(Song s, double t) {
currentSong = s;
currentTime = t;
print("Playing $currentSong @ ${currentTime.toStringAsFixed(2)}");
}
// Create a memento of the current state
Playing get nowPlaying {
// Simulate playing at some time later:
var time = 5*rand.nextDouble();
return new Playing(currentSong, time);
}
// Restore from memento
void backTo(Playing p) {
print(" *** Whoa! This was a good one, let's hear it again :) ***");
_play(p.song, p.time);
}
}
class Song {
String title, album;
Song(this.title, this.album);
String toString() => "$title // $album";
}
// The Memento
class Playing {
Song song;
double time;
Playing(this.song, this.time);
}
|
cc8cc05480e85c9a66450f1655083e87d00ba3f4 | usersettings/shortcuts.py | usersettings/shortcuts.py | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
def get_usersettings_model():
"""
Returns the ``UserSettings`` model that is active in this project.
"""
from django.db.models import get_model
try:
app_label, model_name = settings.USERSETTINGS_MODEL.split('.')
except ValueError:
raise ImproperlyConfigured('USERSETTINGS_MODEL must be of the '
'form "app_label.model_name"')
usersettings_model = get_model(app_label, model_name)
if usersettings_model is None:
raise ImproperlyConfigured('USERSETTINGS_MODEL refers to model "%s" that has '
'not been installed' % settings.USERSETTINGS_MODEL)
return usersettings_model
def get_current_usersettings():
"""
Returns the current ``UserSettings`` based on
the SITE_ID in the project's settings
"""
USERSETTINGS_MODEL = get_usersettings_model()
current_usersettings = USERSETTINGS_MODEL.objects.get_current()
return current_usersettings
| from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
def get_usersettings_model():
"""
Returns the ``UserSettings`` model that is active in this project.
"""
from django.db.models import get_model
try:
app_label, model_name = settings.USERSETTINGS_MODEL.split('.')
except ValueError:
raise ImproperlyConfigured('USERSETTINGS_MODEL must be of the '
'form "app_label.model_name"')
usersettings_model = get_model(app_label, model_name)
if usersettings_model is None:
raise ImproperlyConfigured('USERSETTINGS_MODEL refers to model "%s" that has '
'not been installed' % settings.USERSETTINGS_MODEL)
return usersettings_model
def get_current_usersettings():
"""
Returns the current ``UserSettings`` based on
the SITE_ID in the project's settings
"""
USERSETTINGS_MODEL = get_usersettings_model()
try:
current_usersettings = USERSETTINGS_MODEL.objects.get_current()
except USERSETTINGS_MODEL.DoesNotExist:
current_usersettings = None
return current_usersettings
| Update 'get_current_usersettings' to catch 'DoesNotExist' error | Update 'get_current_usersettings' to catch 'DoesNotExist' error
| Python | bsd-3-clause | mishbahr/django-usersettings2,mishbahr/django-usersettings2 | python | ## Code Before:
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
def get_usersettings_model():
"""
Returns the ``UserSettings`` model that is active in this project.
"""
from django.db.models import get_model
try:
app_label, model_name = settings.USERSETTINGS_MODEL.split('.')
except ValueError:
raise ImproperlyConfigured('USERSETTINGS_MODEL must be of the '
'form "app_label.model_name"')
usersettings_model = get_model(app_label, model_name)
if usersettings_model is None:
raise ImproperlyConfigured('USERSETTINGS_MODEL refers to model "%s" that has '
'not been installed' % settings.USERSETTINGS_MODEL)
return usersettings_model
def get_current_usersettings():
"""
Returns the current ``UserSettings`` based on
the SITE_ID in the project's settings
"""
USERSETTINGS_MODEL = get_usersettings_model()
current_usersettings = USERSETTINGS_MODEL.objects.get_current()
return current_usersettings
## Instruction:
Update 'get_current_usersettings' to catch 'DoesNotExist' error
## Code After:
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
def get_usersettings_model():
"""
Returns the ``UserSettings`` model that is active in this project.
"""
from django.db.models import get_model
try:
app_label, model_name = settings.USERSETTINGS_MODEL.split('.')
except ValueError:
raise ImproperlyConfigured('USERSETTINGS_MODEL must be of the '
'form "app_label.model_name"')
usersettings_model = get_model(app_label, model_name)
if usersettings_model is None:
raise ImproperlyConfigured('USERSETTINGS_MODEL refers to model "%s" that has '
'not been installed' % settings.USERSETTINGS_MODEL)
return usersettings_model
def get_current_usersettings():
"""
Returns the current ``UserSettings`` based on
the SITE_ID in the project's settings
"""
USERSETTINGS_MODEL = get_usersettings_model()
try:
current_usersettings = USERSETTINGS_MODEL.objects.get_current()
except USERSETTINGS_MODEL.DoesNotExist:
current_usersettings = None
return current_usersettings
|
6d5e21db305efbf31b9f888cf4168c2c4a90dd74 | src/Entities/Spawner.ts | src/Entities/Spawner.ts |
import Entity, {EntityState, EntityStateOptions} from "../Engine/Entity"
/**
* Spawns stuff.
*/
export default class Spawner extends Entity {
static type = "Nanoshooter/Entities/Spawner"
private mesh: BABYLON.Mesh
private keybindCallback
protected initialize() {
this.keybindCallback = (event: KeyboardEvent) => {
if (event.keyCode === 32) {
this.game.addEntity(new EntityState({
type: "Nanoshooter/Entities/Cube",
label: "SpawnedCube"
}))
}
}
window.addEventListener("keyup", this.keybindCallback)
}
removal() {
window.removeEventListener("keyup", this.keybindCallback)
}
}
|
import Entity, {EntityState, EntityStateOptions} from "../Engine/Entity"
/**
* Spawns stuff.
*/
export default class Spawner extends Entity {
static type = "Nanoshooter/Entities/Spawner"
private mesh: BABYLON.Mesh
private keyupAction: (event: KeyboardEvent) => void
protected initialize() {
this.keyupAction = (event: KeyboardEvent) => {
if (event.keyCode === 32) {
this.game.addEntity(new EntityState({
type: "Nanoshooter/Entities/Cube",
label: "SpawnedCube"
}))
}
}
window.addEventListener("keyup", this.keyupAction)
}
removal() {
window.removeEventListener("keyup", this.keyupAction)
}
}
| Tweak spawner semantics slightly for almost no reason. | Tweak spawner semantics slightly for almost no reason.
| TypeScript | mit | ChaseMoskal/Nanoshooter,ChaseMoskal/Nanoshooter | typescript | ## Code Before:
import Entity, {EntityState, EntityStateOptions} from "../Engine/Entity"
/**
* Spawns stuff.
*/
export default class Spawner extends Entity {
static type = "Nanoshooter/Entities/Spawner"
private mesh: BABYLON.Mesh
private keybindCallback
protected initialize() {
this.keybindCallback = (event: KeyboardEvent) => {
if (event.keyCode === 32) {
this.game.addEntity(new EntityState({
type: "Nanoshooter/Entities/Cube",
label: "SpawnedCube"
}))
}
}
window.addEventListener("keyup", this.keybindCallback)
}
removal() {
window.removeEventListener("keyup", this.keybindCallback)
}
}
## Instruction:
Tweak spawner semantics slightly for almost no reason.
## Code After:
import Entity, {EntityState, EntityStateOptions} from "../Engine/Entity"
/**
* Spawns stuff.
*/
export default class Spawner extends Entity {
static type = "Nanoshooter/Entities/Spawner"
private mesh: BABYLON.Mesh
private keyupAction: (event: KeyboardEvent) => void
protected initialize() {
this.keyupAction = (event: KeyboardEvent) => {
if (event.keyCode === 32) {
this.game.addEntity(new EntityState({
type: "Nanoshooter/Entities/Cube",
label: "SpawnedCube"
}))
}
}
window.addEventListener("keyup", this.keyupAction)
}
removal() {
window.removeEventListener("keyup", this.keyupAction)
}
}
|
8eaaab332616469bec567ad159b315cc0d1e35fc | vumi/persist/tests/test_fields.py | vumi/persist/tests/test_fields.py |
"""Tests for vumi.persist.fields."""
from twisted.trial.unittest import TestCase
from vumi.persist.fields import Field, ValidationError, Integer, Unicode
class TestInteger(TestCase):
def test_unbounded(self):
i = Integer()
i.validate(5)
i.validate(-3)
self.assertRaises(ValidationError, i.validate, 5.0)
self.assertRaises(ValidationError, i.validate, "5")
def test_minimum(self):
i = Integer(min=3)
i.validate(3)
i.validate(4)
self.assertRaises(ValidationError, i.validate, 2)
def test_maximum(self):
i = Integer(max=5)
i.validate(5)
i.validate(4)
self.assertRaises(ValidationError, i.validate, 6)
class TestUnicode(TestCase):
def test_unicode(self):
u = Unicode()
u.validate(u"")
u.validate(u"a")
u.validate(u"æ")
u.validate(u"foé")
self.assertRaises(ValidationError, u.validate, "")
self.assertRaises(ValidationError, u.validate, "foo")
self.assertRaises(ValidationError, u.validate, 3)
|
"""Tests for vumi.persist.fields."""
from twisted.trial.unittest import TestCase
from vumi.persist.fields import (
ValidationError, Field, FieldDescriptor, Integer, Unicode, ForeignKey,
ForeignKeyDescriptor)
class TestBaseField(TestCase):
def test_validate(self):
f = Field()
f.validate("foo")
f.validate(object())
def test_get_descriptor(self):
f = Field()
descriptor = f.get_descriptor("foo")
self.assertEqual(descriptor.key, "foo")
self.assertEqual(descriptor.field, f)
class TestInteger(TestCase):
def test_unbounded(self):
i = Integer()
i.validate(5)
i.validate(-3)
self.assertRaises(ValidationError, i.validate, 5.0)
self.assertRaises(ValidationError, i.validate, "5")
def test_minimum(self):
i = Integer(min=3)
i.validate(3)
i.validate(4)
self.assertRaises(ValidationError, i.validate, 2)
def test_maximum(self):
i = Integer(max=5)
i.validate(5)
i.validate(4)
self.assertRaises(ValidationError, i.validate, 6)
class TestUnicode(TestCase):
def test_unicode(self):
u = Unicode()
u.validate(u"")
u.validate(u"a")
u.validate(u"æ")
u.validate(u"foé")
self.assertRaises(ValidationError, u.validate, "")
self.assertRaises(ValidationError, u.validate, "foo")
self.assertRaises(ValidationError, u.validate, 3)
| Add tests for the Field class. | Add tests for the Field class.
| Python | bsd-3-clause | TouK/vumi,TouK/vumi,vishwaprakashmishra/xmatrix,harrissoerja/vumi,vishwaprakashmishra/xmatrix,TouK/vumi,harrissoerja/vumi,harrissoerja/vumi,vishwaprakashmishra/xmatrix | python | ## Code Before:
"""Tests for vumi.persist.fields."""
from twisted.trial.unittest import TestCase
from vumi.persist.fields import Field, ValidationError, Integer, Unicode
class TestInteger(TestCase):
def test_unbounded(self):
i = Integer()
i.validate(5)
i.validate(-3)
self.assertRaises(ValidationError, i.validate, 5.0)
self.assertRaises(ValidationError, i.validate, "5")
def test_minimum(self):
i = Integer(min=3)
i.validate(3)
i.validate(4)
self.assertRaises(ValidationError, i.validate, 2)
def test_maximum(self):
i = Integer(max=5)
i.validate(5)
i.validate(4)
self.assertRaises(ValidationError, i.validate, 6)
class TestUnicode(TestCase):
def test_unicode(self):
u = Unicode()
u.validate(u"")
u.validate(u"a")
u.validate(u"æ")
u.validate(u"foé")
self.assertRaises(ValidationError, u.validate, "")
self.assertRaises(ValidationError, u.validate, "foo")
self.assertRaises(ValidationError, u.validate, 3)
## Instruction:
Add tests for the Field class.
## Code After:
"""Tests for vumi.persist.fields."""
from twisted.trial.unittest import TestCase
from vumi.persist.fields import (
ValidationError, Field, FieldDescriptor, Integer, Unicode, ForeignKey,
ForeignKeyDescriptor)
class TestBaseField(TestCase):
def test_validate(self):
f = Field()
f.validate("foo")
f.validate(object())
def test_get_descriptor(self):
f = Field()
descriptor = f.get_descriptor("foo")
self.assertEqual(descriptor.key, "foo")
self.assertEqual(descriptor.field, f)
class TestInteger(TestCase):
def test_unbounded(self):
i = Integer()
i.validate(5)
i.validate(-3)
self.assertRaises(ValidationError, i.validate, 5.0)
self.assertRaises(ValidationError, i.validate, "5")
def test_minimum(self):
i = Integer(min=3)
i.validate(3)
i.validate(4)
self.assertRaises(ValidationError, i.validate, 2)
def test_maximum(self):
i = Integer(max=5)
i.validate(5)
i.validate(4)
self.assertRaises(ValidationError, i.validate, 6)
class TestUnicode(TestCase):
def test_unicode(self):
u = Unicode()
u.validate(u"")
u.validate(u"a")
u.validate(u"æ")
u.validate(u"foé")
self.assertRaises(ValidationError, u.validate, "")
self.assertRaises(ValidationError, u.validate, "foo")
self.assertRaises(ValidationError, u.validate, 3)
|
27499c6ee648742be9eac1300fe3936381e7886a | scripts/configure_brew.sh | scripts/configure_brew.sh |
echo "Configuring brew autoupdate..."
brew autoupdate --upgrade --cleanup --enable-notificationn --start
|
echo "Configuring brew autoupdate..."
if brew autoupdate --status | grep -v 'Autoupdate is installed and running.' > /dev/null; then
brew autoupdate --upgrade --cleanup --enable-notification --start
else
echo "Autoupdate is enabled. Nothing to do."
fi
| Check before enabling brew autoupdate | Check before enabling brew autoupdate
| Shell | mit | ikuwow/dotfiles,ikuwow/dotfiles,ikuwow/dotfiles | shell | ## Code Before:
echo "Configuring brew autoupdate..."
brew autoupdate --upgrade --cleanup --enable-notificationn --start
## Instruction:
Check before enabling brew autoupdate
## Code After:
echo "Configuring brew autoupdate..."
if brew autoupdate --status | grep -v 'Autoupdate is installed and running.' > /dev/null; then
brew autoupdate --upgrade --cleanup --enable-notification --start
else
echo "Autoupdate is enabled. Nothing to do."
fi
|
5c5ed45289c2f0a1dac9533155a28cacf56c4a76 | app/assets/stylesheets/comfortable_mexican_sofa/admin/components/_toolbar-button.scss | app/assets/stylesheets/comfortable_mexican_sofa/admin/components/_toolbar-button.scss | // Toolbar button
//
// Styleguide Toolbar button
.toolbar-button {
background: lighten($color-toolbar-button-disabled-background, .5);
border: none;
border-radius: 3px;
color: white;
font-size: 15px;
font-weight: bold;
height: 30px;
line-height: 25px;
position: relative;
text-align: center;
transition: background, $transition-hover-params;
width: 32px;
&:focus {
outline: none;
border-color: none;
}
}
.is-active .toolbar-button {
background-color: rgba($color-toolbar-button-background,.5);
}
.is-active .toolbar-button.active,
.is-active .toolbar-button.active:hover {
background-color: darken($color-toolbar-button-background,10%);
}
.is-active .toolbar-button:hover {
background-color: $color-toolbar-button-background;
}
.toolbar-button[disabled],
.is-active .toolbar-button[disabled] {
background: lighten($color-toolbar-button-disabled-background, .5);
}
.toolbar-button__icon {
vertical-align: text-top;
}
.toolbar-button .unstyled-button {
height: 100%;
width: 100%;
}
| // Toolbar button
//
// Styleguide Toolbar button
.toolbar-button {
background: lighten($color-toolbar-button-disabled-background, .5);
border: none;
border-radius: 3px;
color: white;
font-size: 15px;
font-weight: bold;
height: 30px;
line-height: 25px;
position: relative;
text-align: center;
transition: background, $transition-hover-params;
width: 32px;
&:focus {
border-color: none;
}
}
.is-active .toolbar-button {
background-color: rgba($color-toolbar-button-background,.5);
}
.is-active .toolbar-button.active,
.is-active .toolbar-button.active:hover {
background-color: darken($color-toolbar-button-background,10%);
}
.is-active .toolbar-button:hover {
background-color: $color-toolbar-button-background;
}
.toolbar-button[disabled],
.is-active .toolbar-button[disabled] {
background: lighten($color-toolbar-button-disabled-background, .5);
}
.toolbar-button__icon {
vertical-align: text-top;
}
.toolbar-button .unstyled-button {
height: 100%;
width: 100%;
}
| Add outline on toolbar buttons | Add outline on toolbar buttons
| SCSS | mit | moneyadviceservice/cms,moneyadviceservice/cms,moneyadviceservice/cms,moneyadviceservice/cms | scss | ## Code Before:
// Toolbar button
//
// Styleguide Toolbar button
.toolbar-button {
background: lighten($color-toolbar-button-disabled-background, .5);
border: none;
border-radius: 3px;
color: white;
font-size: 15px;
font-weight: bold;
height: 30px;
line-height: 25px;
position: relative;
text-align: center;
transition: background, $transition-hover-params;
width: 32px;
&:focus {
outline: none;
border-color: none;
}
}
.is-active .toolbar-button {
background-color: rgba($color-toolbar-button-background,.5);
}
.is-active .toolbar-button.active,
.is-active .toolbar-button.active:hover {
background-color: darken($color-toolbar-button-background,10%);
}
.is-active .toolbar-button:hover {
background-color: $color-toolbar-button-background;
}
.toolbar-button[disabled],
.is-active .toolbar-button[disabled] {
background: lighten($color-toolbar-button-disabled-background, .5);
}
.toolbar-button__icon {
vertical-align: text-top;
}
.toolbar-button .unstyled-button {
height: 100%;
width: 100%;
}
## Instruction:
Add outline on toolbar buttons
## Code After:
// Toolbar button
//
// Styleguide Toolbar button
.toolbar-button {
background: lighten($color-toolbar-button-disabled-background, .5);
border: none;
border-radius: 3px;
color: white;
font-size: 15px;
font-weight: bold;
height: 30px;
line-height: 25px;
position: relative;
text-align: center;
transition: background, $transition-hover-params;
width: 32px;
&:focus {
border-color: none;
}
}
.is-active .toolbar-button {
background-color: rgba($color-toolbar-button-background,.5);
}
.is-active .toolbar-button.active,
.is-active .toolbar-button.active:hover {
background-color: darken($color-toolbar-button-background,10%);
}
.is-active .toolbar-button:hover {
background-color: $color-toolbar-button-background;
}
.toolbar-button[disabled],
.is-active .toolbar-button[disabled] {
background: lighten($color-toolbar-button-disabled-background, .5);
}
.toolbar-button__icon {
vertical-align: text-top;
}
.toolbar-button .unstyled-button {
height: 100%;
width: 100%;
}
|
4fed2df34384730bd020899444e051acff041ab7 | .travis.yml | .travis.yml | language: csharp
mono: none
dotnet: 2.1.300
install:
- dotnet restore
script:
- dotnet build
- dotnet test
| language: csharp
mono: none
dotnet: 2.1.300
install:
- dotnet restore
script:
- dotnet build
- dotnet test ./Core/Msg.Core.Specs/Msg.Core.Specs.csproj
| Use more specific test command | Use more specific test command
I think that the older version of MSBuild/dotnet being used on Travis
causes the build to fail where newer versions don't. By using a more
specific path to the test assembly it should hopefully solve this.
| YAML | apache-2.0 | jagrem/msg | yaml | ## Code Before:
language: csharp
mono: none
dotnet: 2.1.300
install:
- dotnet restore
script:
- dotnet build
- dotnet test
## Instruction:
Use more specific test command
I think that the older version of MSBuild/dotnet being used on Travis
causes the build to fail where newer versions don't. By using a more
specific path to the test assembly it should hopefully solve this.
## Code After:
language: csharp
mono: none
dotnet: 2.1.300
install:
- dotnet restore
script:
- dotnet build
- dotnet test ./Core/Msg.Core.Specs/Msg.Core.Specs.csproj
|
40bdc9112450727c63fc292ea6663d4c72b52f99 | lib/path/separator.js | lib/path/separator.js | 'use strict';
module.exports = (process.env.OS === 'Windows_NT') ? '\\' : '/';
| 'use strict';
module.exports = (process.platform === 'win32') ? '\\' : '/';
| Check for Windows as they do internally in Node | Check for Windows as they do internally in Node
| JavaScript | mit | medikoo/node-ext | javascript | ## Code Before:
'use strict';
module.exports = (process.env.OS === 'Windows_NT') ? '\\' : '/';
## Instruction:
Check for Windows as they do internally in Node
## Code After:
'use strict';
module.exports = (process.platform === 'win32') ? '\\' : '/';
|
7d39a0c9c3c399a3abdda5287662a242344e657a | proxy.php | proxy.php | <?php
header("Content-Type:application/json");
if(isset($_GET["channel"])){
$channel = $_GET["channel"];
}
else{
$channel = "aia_0094";
}
$rss_feed = file_get_contents('http://sdo.gsfc.nasa.gov/feeds/' . $channel . '.rss');
$rss_feed = str_replace(array("\n", "\r", "\t"), "", $rss_feed);
$simpleXml = simplexml_load_string($rss_feed);
$items = $simpleXml->xpath("//item[position()>1]");
while(list( , $node) = each($items)) {
unset($node[0][0]);
}
$json = json_encode($simpleXml, JSON_UNESCAPED_SLASHES);
echo $json;
?>
| <?php
header("Content-Type:application/json; charset=utf-8");
if(isset($_GET["channel"])){
$channel = $_GET["channel"];
}
else{
$channel = "aia_0094";
}
/*
Test code to simulate network error.
if($channel == "aia_0094"){
header("HTTP/1.0 404 Not Found");
exit();
}*/
$rss_feed = file_get_contents('http://sdo.gsfc.nasa.gov/feeds/' . $channel . '.rss');
$rss_feed = str_replace(array("\n", "\r", "\t"), "", $rss_feed);
$simpleXml = simplexml_load_string($rss_feed);
$items = $simpleXml->xpath("//item[position()>1]");
while(list( , $node) = each($items)) {
unset($node[0][0]);
}
$json = json_encode($simpleXml, JSON_UNESCAPED_SLASHES);
echo $json;
?>
| Include character encoding in header | Include character encoding in header
| PHP | mit | deVinnnie/SDO_Live,deVinnnie/SDO_Live,deVinnnie/SDO_Live | php | ## Code Before:
<?php
header("Content-Type:application/json");
if(isset($_GET["channel"])){
$channel = $_GET["channel"];
}
else{
$channel = "aia_0094";
}
$rss_feed = file_get_contents('http://sdo.gsfc.nasa.gov/feeds/' . $channel . '.rss');
$rss_feed = str_replace(array("\n", "\r", "\t"), "", $rss_feed);
$simpleXml = simplexml_load_string($rss_feed);
$items = $simpleXml->xpath("//item[position()>1]");
while(list( , $node) = each($items)) {
unset($node[0][0]);
}
$json = json_encode($simpleXml, JSON_UNESCAPED_SLASHES);
echo $json;
?>
## Instruction:
Include character encoding in header
## Code After:
<?php
header("Content-Type:application/json; charset=utf-8");
if(isset($_GET["channel"])){
$channel = $_GET["channel"];
}
else{
$channel = "aia_0094";
}
/*
Test code to simulate network error.
if($channel == "aia_0094"){
header("HTTP/1.0 404 Not Found");
exit();
}*/
$rss_feed = file_get_contents('http://sdo.gsfc.nasa.gov/feeds/' . $channel . '.rss');
$rss_feed = str_replace(array("\n", "\r", "\t"), "", $rss_feed);
$simpleXml = simplexml_load_string($rss_feed);
$items = $simpleXml->xpath("//item[position()>1]");
while(list( , $node) = each($items)) {
unset($node[0][0]);
}
$json = json_encode($simpleXml, JSON_UNESCAPED_SLASHES);
echo $json;
?>
|
44c45f87837a7d45be7eac14d383907ec95fd91e | _includes/category_posts.html | _includes/category_posts.html | {% assign current_category = page.category %}
{% if current_category == blank %}
{% assign current_category = page.categories | first %}
{% endif %}
{% assign sorted_posts = site.categories[current_category] | sort: 'position' %}
{% assign first_post = sorted_posts.first %}
<ul class="clear">
{% if current_category == 'brands-and-agencies' %}
<li><a href="https://www.talenthouse.com/business" target="_blank" rel="noopener noreferrer">About Talenthouse</a></li>
{% endif %}
{% for post in sorted_posts %}
{% if post.show_in_nav != false %}
<li{% if page.url == post.url %} class="current"{% endif %}><a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a></li>
{% endif %}
{% endfor %}
</ul>
| {% assign current_category = page.category %}
{% if current_category == blank %}
{% assign current_category = page.categories | first %}
{% endif %}
{% assign sorted_posts = site.categories[current_category] | sort: 'position' %}
{% assign first_post = sorted_posts.first %}
<ul class="clear">
{% if current_category == 'brands-and-agencies' %}
<li><a href="https://www.talenthouse.com/business" target="_blank" rel="noopener noreferrer">About Talenthouse</a></li>
{% endif %}
{% for post in sorted_posts %}
<!-- Inject external link before last item -->
{% if current_category == 'artists' and post.position == 8 %}
<li><a href="https://weare.talenthouse.com/" target="_blank" rel="noopener noreferrer">We Are Talenthouse</a></li>
{% endif %}
{% if post.show_in_nav != false %}
<li{% if page.url == post.url %} class="current"{% endif %}><a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a></li>
{% endif %}
{% endfor %}
</ul>
| Add link to B2C page | Add link to B2C page
| HTML | mit | ello/wtf,ello/wtf,ello/wtf | html | ## Code Before:
{% assign current_category = page.category %}
{% if current_category == blank %}
{% assign current_category = page.categories | first %}
{% endif %}
{% assign sorted_posts = site.categories[current_category] | sort: 'position' %}
{% assign first_post = sorted_posts.first %}
<ul class="clear">
{% if current_category == 'brands-and-agencies' %}
<li><a href="https://www.talenthouse.com/business" target="_blank" rel="noopener noreferrer">About Talenthouse</a></li>
{% endif %}
{% for post in sorted_posts %}
{% if post.show_in_nav != false %}
<li{% if page.url == post.url %} class="current"{% endif %}><a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a></li>
{% endif %}
{% endfor %}
</ul>
## Instruction:
Add link to B2C page
## Code After:
{% assign current_category = page.category %}
{% if current_category == blank %}
{% assign current_category = page.categories | first %}
{% endif %}
{% assign sorted_posts = site.categories[current_category] | sort: 'position' %}
{% assign first_post = sorted_posts.first %}
<ul class="clear">
{% if current_category == 'brands-and-agencies' %}
<li><a href="https://www.talenthouse.com/business" target="_blank" rel="noopener noreferrer">About Talenthouse</a></li>
{% endif %}
{% for post in sorted_posts %}
<!-- Inject external link before last item -->
{% if current_category == 'artists' and post.position == 8 %}
<li><a href="https://weare.talenthouse.com/" target="_blank" rel="noopener noreferrer">We Are Talenthouse</a></li>
{% endif %}
{% if post.show_in_nav != false %}
<li{% if page.url == post.url %} class="current"{% endif %}><a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a></li>
{% endif %}
{% endfor %}
</ul>
|
91323d951ca78fad97e73db2d98df7d2c2d676af | app/styles/ilios-common/components/offering-url-display.scss | app/styles/ilios-common/components/offering-url-display.scss | .offering-url-display {
.copy-btn {
@include ilios-link-button;
&.copying {
color: $ilios-green;
}
}
}
// tooltips are outside the document flow so have to be styled outside the component
.offering-url-display-success-message-tooltip {
padding: 0;
.arrow {
display: none;
}
.content {
background-color: $ilios-green;
color: $white;
}
}
| .offering-url-display {
.copy-btn {
@include ilios-link-button;
margin-left: .25em;
&.copying {
color: $ilios-green;
}
}
}
// tooltips are outside the document flow so have to be styled outside the component
.offering-url-display-success-message-tooltip {
padding: 0;
.arrow {
display: none;
}
.content {
background-color: $ilios-green;
color: $white;
}
}
| Add a bit of space between text and button | Add a bit of space between text and button
| SCSS | mit | ilios/common,ilios/common | scss | ## Code Before:
.offering-url-display {
.copy-btn {
@include ilios-link-button;
&.copying {
color: $ilios-green;
}
}
}
// tooltips are outside the document flow so have to be styled outside the component
.offering-url-display-success-message-tooltip {
padding: 0;
.arrow {
display: none;
}
.content {
background-color: $ilios-green;
color: $white;
}
}
## Instruction:
Add a bit of space between text and button
## Code After:
.offering-url-display {
.copy-btn {
@include ilios-link-button;
margin-left: .25em;
&.copying {
color: $ilios-green;
}
}
}
// tooltips are outside the document flow so have to be styled outside the component
.offering-url-display-success-message-tooltip {
padding: 0;
.arrow {
display: none;
}
.content {
background-color: $ilios-green;
color: $white;
}
}
|
166478814b8e5000d7721c8af72fa71835502dc7 | UM/Qt/qml/UM/Preferences/PreferencesPage.qml | UM/Qt/qml/UM/Preferences/PreferencesPage.qml | import QtQuick 2.1
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
ColumnLayout {
property alias title: titleLabel.text;
property alias contents: contentsItem.children;
Label {
id: titleLabel;
}
Item {
id: contentsItem;
Layout.fillWidth: true;
Layout.fillHeight: true;
clip: true;
}
}
| import QtQuick 2.1
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
import QtQuick.Window 2.1
import UM 1.0 as UM
ColumnLayout {
property alias title: titleLabel.text;
property alias contents: contentsItem.children;
function reset()
{
}
Label {
id: titleLabel;
Layout.fillWidth: true;
font.pointSize: 18;
}
Item {
id: contentsItem;
Layout.fillWidth: true;
Layout.fillHeight: true;
clip: true;
}
}
| Update preferences page styling and add a reset() base method | Update preferences page styling and add a reset() base method
| QML | agpl-3.0 | onitake/Uranium,onitake/Uranium | qml | ## Code Before:
import QtQuick 2.1
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
ColumnLayout {
property alias title: titleLabel.text;
property alias contents: contentsItem.children;
Label {
id: titleLabel;
}
Item {
id: contentsItem;
Layout.fillWidth: true;
Layout.fillHeight: true;
clip: true;
}
}
## Instruction:
Update preferences page styling and add a reset() base method
## Code After:
import QtQuick 2.1
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
import QtQuick.Window 2.1
import UM 1.0 as UM
ColumnLayout {
property alias title: titleLabel.text;
property alias contents: contentsItem.children;
function reset()
{
}
Label {
id: titleLabel;
Layout.fillWidth: true;
font.pointSize: 18;
}
Item {
id: contentsItem;
Layout.fillWidth: true;
Layout.fillHeight: true;
clip: true;
}
}
|
15e493c5402d07cb735fb8773ad499d1e5b19e19 | setup.py | setup.py | from setuptools import setup, find_packages
version = '0.2'
setup(
name='ckanext-oaipmh',
version=version,
description="OAI-PMH harvester for CKAN",
long_description="""\
""",
classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
keywords='',
author='Mikael Karlsson',
author_email='[email protected]',
url='https://github.com/kata-csc/ckanext-oaipmh',
license='AGPL',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
namespace_packages=['ckanext', 'ckanext.oaipmh'],
include_package_data=True,
zip_safe=False,
install_requires=[
# -*- Extra requirements: -*-
'pyoai',
'ckanext-harvest',
'lxml',
'rdflib',
'beautifulsoup4',
'pointfree',
'functionally',
'fn',
],
entry_points=\
"""
[ckan.plugins]
# Add plugins here, eg
oaipmh_harvester=ckanext.oaipmh.harvester:OAIPMHHarvester
""",
)
| from setuptools import setup, find_packages
version = '0.2'
setup(
name='ckanext-oaipmh',
version=version,
description="OAI-PMH harvester for CKAN",
long_description="""\
""",
classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
keywords='',
author='CSC - IT Center for Science Ltd.',
author_email='[email protected]',
url='https://github.com/kata-csc/ckanext-oaipmh',
license='AGPL',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
namespace_packages=['ckanext', 'ckanext.oaipmh'],
include_package_data=True,
zip_safe=False,
install_requires=[
# -*- Extra requirements: -*-
'pyoai',
'ckanext-harvest',
'lxml',
'rdflib',
'beautifulsoup4',
'pointfree',
'functionally',
'fn',
],
entry_points=\
"""
[ckan.plugins]
# Add plugins here, eg
oaipmh_harvester=ckanext.oaipmh.harvester:OAIPMHHarvester
""",
)
| Update author to CSC - IT Center for Science Ltd. | Update author to CSC - IT Center for Science Ltd.
| Python | agpl-3.0 | kata-csc/ckanext-oaipmh,kata-csc/ckanext-oaipmh,kata-csc/ckanext-oaipmh | python | ## Code Before:
from setuptools import setup, find_packages
version = '0.2'
setup(
name='ckanext-oaipmh',
version=version,
description="OAI-PMH harvester for CKAN",
long_description="""\
""",
classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
keywords='',
author='Mikael Karlsson',
author_email='[email protected]',
url='https://github.com/kata-csc/ckanext-oaipmh',
license='AGPL',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
namespace_packages=['ckanext', 'ckanext.oaipmh'],
include_package_data=True,
zip_safe=False,
install_requires=[
# -*- Extra requirements: -*-
'pyoai',
'ckanext-harvest',
'lxml',
'rdflib',
'beautifulsoup4',
'pointfree',
'functionally',
'fn',
],
entry_points=\
"""
[ckan.plugins]
# Add plugins here, eg
oaipmh_harvester=ckanext.oaipmh.harvester:OAIPMHHarvester
""",
)
## Instruction:
Update author to CSC - IT Center for Science Ltd.
## Code After:
from setuptools import setup, find_packages
version = '0.2'
setup(
name='ckanext-oaipmh',
version=version,
description="OAI-PMH harvester for CKAN",
long_description="""\
""",
classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
keywords='',
author='CSC - IT Center for Science Ltd.',
author_email='[email protected]',
url='https://github.com/kata-csc/ckanext-oaipmh',
license='AGPL',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
namespace_packages=['ckanext', 'ckanext.oaipmh'],
include_package_data=True,
zip_safe=False,
install_requires=[
# -*- Extra requirements: -*-
'pyoai',
'ckanext-harvest',
'lxml',
'rdflib',
'beautifulsoup4',
'pointfree',
'functionally',
'fn',
],
entry_points=\
"""
[ckan.plugins]
# Add plugins here, eg
oaipmh_harvester=ckanext.oaipmh.harvester:OAIPMHHarvester
""",
)
|
c80c695be5f785fd45fb282a38ff6dad3e5e69e8 | src/CSBill/CoreBundle/Menu/Core/AuthenticatedMenu.php | src/CSBill/CoreBundle/Menu/Core/AuthenticatedMenu.php | <?php
namespace CSBill\CoreBundle\Menu\Core;
use CSBill\CoreBundle\Menu\Builder\BuilderInterface;
use Symfony\Component\DependencyInjection\ContainerAware;
use SYmfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException;
class AuthenticatedMenu extends ContainerAware implements BuilderInterface
{
public function validate()
{
try {
$security = $this->container->get('security.context');
} catch (AuthenticationCredentialsNotFoundException $e) {
return false;
}
return $security->isGranted('IS_AUTHENTICATED_FULLY');
}
}
| <?php
namespace CSBill\CoreBundle\Menu\Core;
use CSBill\CoreBundle\Menu\Builder\BuilderInterface;
use Symfony\Component\DependencyInjection\ContainerAware;
use SYmfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException;
class AuthenticatedMenu extends ContainerAware implements BuilderInterface
{
public function validate()
{
try {
$security = $this->container->get('security.context');
} catch (AuthenticationCredentialsNotFoundException $e) {
return false;
}
return $security->isGranted('IS_AUTHENTICATED_REMEMBERED');
}
}
| Change authenticated menu to check for authenticated remembered | [CoreBundle] Change authenticated menu to check for authenticated remembered
| PHP | mit | SolidInvoice/SolidInvoice,CSBill/CSBill,pierredup/CSBill,pierredup/CSBill,pierredup/CSBill,CSBill/CSBill,pierredup/CSBill,pierredup/SolidInvoice,SolidInvoice/SolidInvoice,SolidInvoice/SolidInvoice,pierredup/SolidInvoice,CSBill/CSBill,CSBill/CSBill | php | ## Code Before:
<?php
namespace CSBill\CoreBundle\Menu\Core;
use CSBill\CoreBundle\Menu\Builder\BuilderInterface;
use Symfony\Component\DependencyInjection\ContainerAware;
use SYmfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException;
class AuthenticatedMenu extends ContainerAware implements BuilderInterface
{
public function validate()
{
try {
$security = $this->container->get('security.context');
} catch (AuthenticationCredentialsNotFoundException $e) {
return false;
}
return $security->isGranted('IS_AUTHENTICATED_FULLY');
}
}
## Instruction:
[CoreBundle] Change authenticated menu to check for authenticated remembered
## Code After:
<?php
namespace CSBill\CoreBundle\Menu\Core;
use CSBill\CoreBundle\Menu\Builder\BuilderInterface;
use Symfony\Component\DependencyInjection\ContainerAware;
use SYmfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException;
class AuthenticatedMenu extends ContainerAware implements BuilderInterface
{
public function validate()
{
try {
$security = $this->container->get('security.context');
} catch (AuthenticationCredentialsNotFoundException $e) {
return false;
}
return $security->isGranted('IS_AUTHENTICATED_REMEMBERED');
}
}
|
fe4d01e1c1d7e2e788e18a392cbefec83d817857 | attributes/default.rb | attributes/default.rb | default['aws-sdk'] = {
'version' => '1.41.0'
}
default['consul'] = {
'install_type' => 'binary',
'version' => '0.2.1',
'user' => 'root',
'group' => 'root',
'agent' => {
'path' => '/usr/local/bin/consul',
'config' => {
'name' => node.fqdn,
'advertise' => nil,
'bootstrap' => false,
'bind_addr' => '0.0.0.0',
'client_addr' => '127.0.0.1',
'config_file' => nil,
'config_dir' => '/etc/consul.d',
'data_dir' => '/var/opt/consul',
'dc' => 'dc1',
'join' => [],
'log_level' => 'info',
'previous_protocol' => false,
'server' => false,
'ui_dir' => nil,
'pid_file' => '/var/run/consul_agent.pid'
},
'upstart' => {
'gomaxprocs' => 2,
'respawn' => {
'enable' => true,
'limit' => '5',
'duration' => '60',
}
}
}
}
| default['consul']['install_type'] = 'binary'
default['consul']['version'] = '0.2.1'
default['consul']['user'] = 'root'
default['consul']['group'] = 'root'
default['consul']['agent']['path'] = '/usr/local/bin/consul'
default['consul']['agent']['config']['name'] = node.fqdn
default['consul']['agent']['config']['advertise'] = nil
default['consul']['agent']['config']['bootstrap'] = false
default['consul']['agent']['config']['bind_addr'] = '0.0.0.0'
default['consul']['agent']['config']['client_addr'] = '127.0.0.1'
default['consul']['agent']['config']['config_file'] = nil
default['consul']['agent']['config']['config_dir'] = '/etc/consul.d'
default['consul']['agent']['config']['data_dir'] = '/var/opt/consul'
default['consul']['agent']['config']['dc'] = 'dc1'
default['consul']['agent']['config']['join'] = []
default['consul']['agent']['config']['log_level'] = 'info'
default['consul']['agent']['config']['previous_protocol'] = false
default['consul']['agent']['config']['server'] = false
default['consul']['agent']['config']['ui_dir'] = nil
default['consul']['agent']['config']['pid_file'] = '/var/run/consul_agent.pid'
default['consul']['agent']['upstart']['gomaxprocs'] = 2
default['consul']['agent']['upstart']['respawn']['enable'] = true
default['consul']['agent']['upstart']['respawn']['limit'] = '5'
default['consul']['agent']['upstart']['respawn']['duration'] = '60'
| Change atributes to 'chef style' | Change atributes to 'chef style'
| Ruby | mit | KYCK/consul_cookbook | ruby | ## Code Before:
default['aws-sdk'] = {
'version' => '1.41.0'
}
default['consul'] = {
'install_type' => 'binary',
'version' => '0.2.1',
'user' => 'root',
'group' => 'root',
'agent' => {
'path' => '/usr/local/bin/consul',
'config' => {
'name' => node.fqdn,
'advertise' => nil,
'bootstrap' => false,
'bind_addr' => '0.0.0.0',
'client_addr' => '127.0.0.1',
'config_file' => nil,
'config_dir' => '/etc/consul.d',
'data_dir' => '/var/opt/consul',
'dc' => 'dc1',
'join' => [],
'log_level' => 'info',
'previous_protocol' => false,
'server' => false,
'ui_dir' => nil,
'pid_file' => '/var/run/consul_agent.pid'
},
'upstart' => {
'gomaxprocs' => 2,
'respawn' => {
'enable' => true,
'limit' => '5',
'duration' => '60',
}
}
}
}
## Instruction:
Change atributes to 'chef style'
## Code After:
default['consul']['install_type'] = 'binary'
default['consul']['version'] = '0.2.1'
default['consul']['user'] = 'root'
default['consul']['group'] = 'root'
default['consul']['agent']['path'] = '/usr/local/bin/consul'
default['consul']['agent']['config']['name'] = node.fqdn
default['consul']['agent']['config']['advertise'] = nil
default['consul']['agent']['config']['bootstrap'] = false
default['consul']['agent']['config']['bind_addr'] = '0.0.0.0'
default['consul']['agent']['config']['client_addr'] = '127.0.0.1'
default['consul']['agent']['config']['config_file'] = nil
default['consul']['agent']['config']['config_dir'] = '/etc/consul.d'
default['consul']['agent']['config']['data_dir'] = '/var/opt/consul'
default['consul']['agent']['config']['dc'] = 'dc1'
default['consul']['agent']['config']['join'] = []
default['consul']['agent']['config']['log_level'] = 'info'
default['consul']['agent']['config']['previous_protocol'] = false
default['consul']['agent']['config']['server'] = false
default['consul']['agent']['config']['ui_dir'] = nil
default['consul']['agent']['config']['pid_file'] = '/var/run/consul_agent.pid'
default['consul']['agent']['upstart']['gomaxprocs'] = 2
default['consul']['agent']['upstart']['respawn']['enable'] = true
default['consul']['agent']['upstart']['respawn']['limit'] = '5'
default['consul']['agent']['upstart']['respawn']['duration'] = '60'
|
1e0b8cf8ec46453a41373c61451c516975dc1902 | src/kolmogorov_music/kolmogorov.clj | src/kolmogorov_music/kolmogorov.clj | (ns kolmogorov-music.kolmogorov
(:require [clojure.repl :as repl]))
(defn in-ns? [sym ns]
(contains? (ns-interns ns) sym))
(defn sexpr [sym]
(-> sym repl/source-fn read-string))
(defn definition [sym]
(-> sym sexpr last))
(defn complexity-sym [sym ns]
(if (in-ns? sym ns)
(->> (definition sym)
flatten
(map #(-> % (complexity-sym ns) inc))
(apply +))
0))
(defn complexity-sexpr [sexpr ns]
(if (seq? sexpr)
(->> sexpr
(map #(-> % (complexity-fn ns) inc))
(apply +))
(complexity-fn sexpr ns)))
(defmacro complexity [sexpr]
(complexity-sexpr sexpr *ns*))
(complexity (+ 4 4))
| (ns kolmogorov-music.kolmogorov
(:require [clojure.repl :as repl]))
(defn in-ns? [sym ns]
(contains? (ns-interns ns) sym))
(defn sexpr [sym]
(-> sym repl/source-fn read-string))
(defn definition [sym]
(-> sym sexpr last))
(declare complexity-sexpr)
(defn complexity-sym [sym ns]
(if (in-ns? sym ns)
(->> (definition sym)
flatten
(complexity-sexpr ns))
0))
(defn complexity-sexpr [ns sexpr]
(->> sexpr
(map #(complexity-sym % ns))
(reduce + (count sexpr))))
(defmacro complexity [expr]
(if (seq? expr)
(complexity-sexpr *ns* expr)
(complexity-sym expr *ns*)))
| Use mutual recursion to make the sym/sexpr dance clearer. | Use mutual recursion to make the sym/sexpr dance clearer.
| Clojure | mit | ctford/kolmogorov-music,ctford/kolmogorov-music | clojure | ## Code Before:
(ns kolmogorov-music.kolmogorov
(:require [clojure.repl :as repl]))
(defn in-ns? [sym ns]
(contains? (ns-interns ns) sym))
(defn sexpr [sym]
(-> sym repl/source-fn read-string))
(defn definition [sym]
(-> sym sexpr last))
(defn complexity-sym [sym ns]
(if (in-ns? sym ns)
(->> (definition sym)
flatten
(map #(-> % (complexity-sym ns) inc))
(apply +))
0))
(defn complexity-sexpr [sexpr ns]
(if (seq? sexpr)
(->> sexpr
(map #(-> % (complexity-fn ns) inc))
(apply +))
(complexity-fn sexpr ns)))
(defmacro complexity [sexpr]
(complexity-sexpr sexpr *ns*))
(complexity (+ 4 4))
## Instruction:
Use mutual recursion to make the sym/sexpr dance clearer.
## Code After:
(ns kolmogorov-music.kolmogorov
(:require [clojure.repl :as repl]))
(defn in-ns? [sym ns]
(contains? (ns-interns ns) sym))
(defn sexpr [sym]
(-> sym repl/source-fn read-string))
(defn definition [sym]
(-> sym sexpr last))
(declare complexity-sexpr)
(defn complexity-sym [sym ns]
(if (in-ns? sym ns)
(->> (definition sym)
flatten
(complexity-sexpr ns))
0))
(defn complexity-sexpr [ns sexpr]
(->> sexpr
(map #(complexity-sym % ns))
(reduce + (count sexpr))))
(defmacro complexity [expr]
(if (seq? expr)
(complexity-sexpr *ns* expr)
(complexity-sym expr *ns*)))
|
d533a00235e2e93776a3823f6e34b8db4641ae2a | spf13-vim-windows-install.cmd | spf13-vim-windows-install.cmd | @if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH%
@if not exist "%HOME%" @set HOME=%USERPROFILE%
@set BASE_DIR=%HOME%\.spf13-vim-3
call git clone --recursive -b 3.0 git://github.com/spf13/spf13-vim.git "%BASE_DIR%"
call mkdir "%BASE_DIR%\.vim\bundle"
call mklink /J "%HOME%\.vim" "%BASE_DIR%\.vim"
call mklink "%HOME%\.vimrc" "%BASE_DIR%\.vimrc"
call mklink "%HOME%\_vimrc" "%BASE_DIR%\.vimrc"
call mklink "%HOME%\.vimrc.bundles" "%BASE_DIR%\.vimrc.bundles"
call git clone http://github.com/gmarik/vundle.git "%HOME%/.vim/bundle/vundle"
call vim -u "%BASE_DIR%/.vimrc.bundles" +BundleInstall! +BundleClean +qall
| @if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH%
@if not exist "%HOME%" @set HOME=%USERPROFILE%
@set BASE_DIR=%HOME%\.spf13-vim-3
IF NOT EXIST "%BASE_DIR%" (
call git clone --recursive -b 3.0 https://github.com/spf13/spf13-vim.git "%BASE_DIR%"
) ELSE (
@set ORIGINAL_DIR=%CD%
echo updating spf13-vim
chdir /d "%BASE_DIR%"
call git pull
chdir /d "%ORIGINAL_DIR%"
call cd "%BASE_DIR%"
)
call mklink "%HOME%\.vimrc" "%BASE_DIR%\.vimrc"
call mklink "%HOME%\_vimrc" "%BASE_DIR%\.vimrc"
call mklink "%HOME%\.vimrc.fork" "%BASE_DIR%\.vimrc.fork"
call mklink "%HOME%\.vimrc.bundles" "%BASE_DIR%\.vimrc.bundles"
call mklink "%HOME%\.vimrc.bundles.fork" "%BASE_DIR%\.vimrc.bundles.fork"
call mklink /J "%HOME%\.vim" "%BASE_DIR%\.vim"
IF NOT EXIST "%BASE_DIR%\.vim\bundle" (
call mkdir "%BASE_DIR%\.vim\bundle"
)
IF NOT EXIST "%HOME%/.vim/bundle/vundle" (
call git clone https://github.com/gmarik/vundle.git "%HOME%/.vim/bundle/vundle"
)
call vim -u "%BASE_DIR%/.vimrc.bundles" +BundleInstall! +BundleClean +qall
| Make Windows Installer more robust & auto updating | Make Windows Installer more robust & auto updating | Batchfile | apache-2.0 | jswk/spf13-vim,lhh411291769/spf13-vim,lightcn/spf13-vim,wongsyrone/spf13-vim,qingzew/spf13-vim,jadewizard/spf13-vim,IdVincentYang/spf13-vim,dawnsong/spf13-vim,darcylee/magic-vim,diogro/spf13-vim,fuhongxue/spf13-vim,carakan/supra-vim,huhuang03/spf13-vim,dawnsong/spf13-vim,xiaoDC/vim,zzzzzsh/spf13-vim,millerdw06/spf13-vim,frtmelody/spf13-vim,pebcac/spf13-vim,Acanthostega/spf13-vim,iBreaker/vimrc,AaronYee/spf13-vim,chenyaqiuqiu/spf13-vim,zacchen/spf13-vim,theand/spf13-vim,dawnsong/spf13-vim,AkemiHomura/VimConf,brg-liuwei/spf13-vim,wenzhucjy/spf13-vim,caibo2014/spf13-vim,jimgle/spf13-vim,nacerix/vim-install,alex-zhang/spf13-vim,heartsentwined/spf13-vim,konqui/spf13-vim,yangao118/spf13-vim,14roiron/spf13-vim,libichong/spf13-vim,phlizik/spf13-vim,Ph0enixxx/spf13-vim,perfectworks/pw-vim,wmudge/spf13-vim,qingzew/spf13-vim,yougth/spf13-vim,russellb/spf13-vim,tttlkkkl/spf13-vim,rewiko/conf-vim,lk1ngaa7/spf13-vim,nevernet/spf13-vim,metcalfc/spf13-vim,Chuenfai/spf13-vim,dawnsong/spf13-vim,NoviaDroid/spf13-vim,nxsy/spf13-vim,myszek123/spf13-vim,dawnsong/spf13-vim,pjvds/spf13-vim,cgideon/spf13-vim,sunshinemyson/spf13-vim,dawnsong/spf13-vim,Mucid/spf13-vim,spf13/spf13-vim,myself659/spf13-vim,dawnsong/spf13-vim,toejough/spf13-vim,Alexoner/spf13-vim,samwangzhibo/spf13-vim,pietrushnic/spf13-vim,cklsoft/spf13-vim,taohs/spf13-vim,zachywang/spf13-vim,mirans-tec/spf13-vim,cyberyoung/spf13-vim,Anden/spf13-vim,Frank1993/spf13-vim,taogogo/spf13-vim,jf87/spf13-vim,mikezuff/spf13-vim,y8y/my-spf13-vim,veelion/spf13-vim,0xItx/spf13-vim,liuyun1217/spf13-vim,Xiaolang0/spf13-vim,AkemiHomura/VimConf,kumasento/spf13-vim,dawnsong/spf13-vim,yograf/spf13-vim,osxi/spf13-vim,shaunstanislaus/spf13-vim,Eastegg/My-spf13,hahaliu005/spf13-vim,taohaoge/spf13-vim,Eastegg/My-spf13,dawnsong/spf13-vim,mightyguava/spf13-vim,pavgup/spf13-vim,dawnsong/spf13-vim,dawnsong/spf13-vim,all3n/spf13-vim,teasp00n/spf13-vim,francoisjacques/spf13-vim,chenpiao/spf13-vim,chrxn/spf13-vim,paddy-w/spf13-vim,mmikitka/spf13-vim,ArkBriar/VimConf,chenzhongjie/.spf13-vim,u9520107/spf13-vim,ProteusCortex/spf13-vim,xuzhenglun/spf13-vim,zhangtuoparis13/spf13-vim,sit-in/spf13-vim,RiceParty/spf13-vim,dengyh/spf13-vim,botord/spf13-vim,qingzew/spf13-vim,r3jack/spf13-vim,qiufozhe/spf13-vim,Eastegg/My-spf13,Denniskevin/spf13-vim,kevinushey/spf13-vim,IdVincentYang/spf13-vim,ZiboWang/spf13-vim,farrrr/far-vim,qingzew/spf13-vim,leitu/spf13-vim,amorwilliams/spf13-vim,zhlinh/spf13-vim,dawnsong/spf13-vim,ArkBriar/VimConf,lanffy/spf13-vim,bucketzxm/spf13-vim,chenshuiyin/spf13-vim,dawnsong/spf13-vim,anto-daniel/spf13-vim,JanChw/spf13-vim,Alkaid-seven/spf13-vim,dawnsong/spf13-vim,wangbiaobiao/spf13-vim,lzhenyu0/spf13-vim,demon386/spf13-vim,lisijie/spf13-vim,raincoatrun/spf13-vim,bronzehedwick/spf13-vim,sreadfox/spf13-vim,dawnsong/spf13-vim,haoli001/spf13-vim,codedogfish/spf13-vim,ucfree/spf13-vim | batchfile | ## Code Before:
@if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH%
@if not exist "%HOME%" @set HOME=%USERPROFILE%
@set BASE_DIR=%HOME%\.spf13-vim-3
call git clone --recursive -b 3.0 git://github.com/spf13/spf13-vim.git "%BASE_DIR%"
call mkdir "%BASE_DIR%\.vim\bundle"
call mklink /J "%HOME%\.vim" "%BASE_DIR%\.vim"
call mklink "%HOME%\.vimrc" "%BASE_DIR%\.vimrc"
call mklink "%HOME%\_vimrc" "%BASE_DIR%\.vimrc"
call mklink "%HOME%\.vimrc.bundles" "%BASE_DIR%\.vimrc.bundles"
call git clone http://github.com/gmarik/vundle.git "%HOME%/.vim/bundle/vundle"
call vim -u "%BASE_DIR%/.vimrc.bundles" +BundleInstall! +BundleClean +qall
## Instruction:
Make Windows Installer more robust & auto updating
## Code After:
@if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH%
@if not exist "%HOME%" @set HOME=%USERPROFILE%
@set BASE_DIR=%HOME%\.spf13-vim-3
IF NOT EXIST "%BASE_DIR%" (
call git clone --recursive -b 3.0 https://github.com/spf13/spf13-vim.git "%BASE_DIR%"
) ELSE (
@set ORIGINAL_DIR=%CD%
echo updating spf13-vim
chdir /d "%BASE_DIR%"
call git pull
chdir /d "%ORIGINAL_DIR%"
call cd "%BASE_DIR%"
)
call mklink "%HOME%\.vimrc" "%BASE_DIR%\.vimrc"
call mklink "%HOME%\_vimrc" "%BASE_DIR%\.vimrc"
call mklink "%HOME%\.vimrc.fork" "%BASE_DIR%\.vimrc.fork"
call mklink "%HOME%\.vimrc.bundles" "%BASE_DIR%\.vimrc.bundles"
call mklink "%HOME%\.vimrc.bundles.fork" "%BASE_DIR%\.vimrc.bundles.fork"
call mklink /J "%HOME%\.vim" "%BASE_DIR%\.vim"
IF NOT EXIST "%BASE_DIR%\.vim\bundle" (
call mkdir "%BASE_DIR%\.vim\bundle"
)
IF NOT EXIST "%HOME%/.vim/bundle/vundle" (
call git clone https://github.com/gmarik/vundle.git "%HOME%/.vim/bundle/vundle"
)
call vim -u "%BASE_DIR%/.vimrc.bundles" +BundleInstall! +BundleClean +qall
|
9ed27e3fa3fd6e684a9b5f13772acea015351533 | config/scripts/post-config.d/hooks.sh | config/scripts/post-config.d/hooks.sh | source /config/user-data/edgerouter-backup.conf
# This script runs at boot of the EdgeRouter
# Generate symlinks to hook script(s)
sudo ln -fs /config/user-data/hooks/* /etc/commit/post-hooks.d/
# Ensure scripts are executable
sudo chmod +x /config/user-data/hooks/*
exit 0 | source /config/user-data/edgerouter-backup.conf
# Fix ownership
sudo chown -R root:vyattacfg /config/userdata
sudo chown -R root:vyattacfg /config/scripts
# Ensure scripts are executable
sudo chmod +x /config/user-data/hooks/*
# Generate symlinks to hook script(s)
sudo ln -fs /config/user-data/hooks/* /etc/commit/post-hooks.d/
exit 0
| Update ownship of /config/scripts and /config/userdata to root:vyattacfg. | Update ownship of /config/scripts and /config/userdata to root:vyattacfg.
| Shell | mit | tbyehl/edgerouter-backup | shell | ## Code Before:
source /config/user-data/edgerouter-backup.conf
# This script runs at boot of the EdgeRouter
# Generate symlinks to hook script(s)
sudo ln -fs /config/user-data/hooks/* /etc/commit/post-hooks.d/
# Ensure scripts are executable
sudo chmod +x /config/user-data/hooks/*
exit 0
## Instruction:
Update ownship of /config/scripts and /config/userdata to root:vyattacfg.
## Code After:
source /config/user-data/edgerouter-backup.conf
# Fix ownership
sudo chown -R root:vyattacfg /config/userdata
sudo chown -R root:vyattacfg /config/scripts
# Ensure scripts are executable
sudo chmod +x /config/user-data/hooks/*
# Generate symlinks to hook script(s)
sudo ln -fs /config/user-data/hooks/* /etc/commit/post-hooks.d/
exit 0
|
5841c48ffd9cfc97f4c2d8f1aee4be875a18fd2a | step-capstone/src/components/Map.js | step-capstone/src/components/Map.js | import React, { createRef } from 'react'
/**
* Props:
* zoom : 13 - higher the number, the more zoomed the map is on center
* center: {lat:0.0, lng:0.0} - coordinates for center of map
*/
class Map extends React.Component {
componentDidMount() {
const loadGoogleMapScript = document.createElement('script');
loadGoogleMapScript.src =
'https://maps.googleapis.com/maps/api/js?key='+process.env.REACT_APP_API_KEY+'&libraries=place';
window.document.body.appendChild(loadGoogleMapScript);
loadGoogleMapScript.addEventListener('load', () => {
this.googleMap = this.createMap();
});
}
googleMapRef = createRef();
createMap() {
new window.google.maps.Map(this.googleMapRef.current, {
zoom: this.props.zoom,
center: this.props.center,
})
}
render() {
return(
<div
id = 'map'
ref = {this.googleMapRef}
/>
)
}
}
export default Map | import React, { createRef } from 'react'
/**
* Props:
* zoom : 13 - higher the number, the more zoomed the map is on center
* center: {lat:0.0, lng:0.0} - coordinates for center of map
*/
class Map extends React.Component {
constructor(props) {
super(props);
this.state = {
coordinates: [
{
lat: 51.511645,
lng: -0.131944
},
{
lat: 51.509963,
lng: -0.129336
}
]
}
this.googleMapRef = createRef();
}
componentDidMount() {
console.log("mounting")
const loadGoogleMapScript = document.createElement('script');
loadGoogleMapScript.src =
'https://maps.googleapis.com/maps/api/js?key='+process.env.REACT_APP_API_KEY+'&libraries=place';
window.document.body.appendChild(loadGoogleMapScript);
loadGoogleMapScript.addEventListener('load', () => {
var googleMap = this.createMap();
let bounds = this.addMarkers(googleMap)
googleMap.fitBounds(bounds);
});
}
createMap() {
return new window.google.maps.Map(this.googleMapRef.current, {
zoom: this.props.zoom,
center: this.props.center,
})
}
addMarkers(map) {
var bounds = new window.google.maps.LatLngBounds();
this.state.coordinates.map((coord) => {
console.log(coord)
new window.google.maps.Marker({
position: coord,
map: map,
animation: window.google.maps.Animation.DROP
})
bounds.extend(coord)
})
return bounds;
}
render() {
return(
<div
id = 'map'
ref = {this.googleMapRef}
/>
)
}
}
export default Map | Add markers on map and adjust window size based on all markers | Add markers on map and adjust window size based on all markers
| JavaScript | apache-2.0 | googleinterns/step98-2020,googleinterns/step98-2020 | javascript | ## Code Before:
import React, { createRef } from 'react'
/**
* Props:
* zoom : 13 - higher the number, the more zoomed the map is on center
* center: {lat:0.0, lng:0.0} - coordinates for center of map
*/
class Map extends React.Component {
componentDidMount() {
const loadGoogleMapScript = document.createElement('script');
loadGoogleMapScript.src =
'https://maps.googleapis.com/maps/api/js?key='+process.env.REACT_APP_API_KEY+'&libraries=place';
window.document.body.appendChild(loadGoogleMapScript);
loadGoogleMapScript.addEventListener('load', () => {
this.googleMap = this.createMap();
});
}
googleMapRef = createRef();
createMap() {
new window.google.maps.Map(this.googleMapRef.current, {
zoom: this.props.zoom,
center: this.props.center,
})
}
render() {
return(
<div
id = 'map'
ref = {this.googleMapRef}
/>
)
}
}
export default Map
## Instruction:
Add markers on map and adjust window size based on all markers
## Code After:
import React, { createRef } from 'react'
/**
* Props:
* zoom : 13 - higher the number, the more zoomed the map is on center
* center: {lat:0.0, lng:0.0} - coordinates for center of map
*/
class Map extends React.Component {
constructor(props) {
super(props);
this.state = {
coordinates: [
{
lat: 51.511645,
lng: -0.131944
},
{
lat: 51.509963,
lng: -0.129336
}
]
}
this.googleMapRef = createRef();
}
componentDidMount() {
console.log("mounting")
const loadGoogleMapScript = document.createElement('script');
loadGoogleMapScript.src =
'https://maps.googleapis.com/maps/api/js?key='+process.env.REACT_APP_API_KEY+'&libraries=place';
window.document.body.appendChild(loadGoogleMapScript);
loadGoogleMapScript.addEventListener('load', () => {
var googleMap = this.createMap();
let bounds = this.addMarkers(googleMap)
googleMap.fitBounds(bounds);
});
}
createMap() {
return new window.google.maps.Map(this.googleMapRef.current, {
zoom: this.props.zoom,
center: this.props.center,
})
}
addMarkers(map) {
var bounds = new window.google.maps.LatLngBounds();
this.state.coordinates.map((coord) => {
console.log(coord)
new window.google.maps.Marker({
position: coord,
map: map,
animation: window.google.maps.Animation.DROP
})
bounds.extend(coord)
})
return bounds;
}
render() {
return(
<div
id = 'map'
ref = {this.googleMapRef}
/>
)
}
}
export default Map |
fa047159f72a3746438a6914488f8b221d17bfc2 | public/css/theme.css | public/css/theme.css | /* This file is used for custom styles */
.messages-wrapper {
margin-top: 10px;
}
.radio-station {
cursor: default;
}
.swipe-container > div {
min-height: 100%;
height: 100% !important;
}
.swipe-view-content {
padding: 0 5px;
}
| /* This file is used for custom styles */
.messages-wrapper {
margin-top: 10px;
}
.radio-station {
cursor: default;
}
.nav a {
cursor: pointer;
}
.swipe-container > div {
min-height: 100%;
height: 100% !important;
}
.swipe-view-content {
padding: 0 5px;
}
| Use correct cursor on nav menu | Use correct cursor on nav menu
| CSS | apache-2.0 | JustBlackBird/bluethroat,JustBlackBird/bluethroat,JustBlackBird/bluethroat | css | ## Code Before:
/* This file is used for custom styles */
.messages-wrapper {
margin-top: 10px;
}
.radio-station {
cursor: default;
}
.swipe-container > div {
min-height: 100%;
height: 100% !important;
}
.swipe-view-content {
padding: 0 5px;
}
## Instruction:
Use correct cursor on nav menu
## Code After:
/* This file is used for custom styles */
.messages-wrapper {
margin-top: 10px;
}
.radio-station {
cursor: default;
}
.nav a {
cursor: pointer;
}
.swipe-container > div {
min-height: 100%;
height: 100% !important;
}
.swipe-view-content {
padding: 0 5px;
}
|
16f3bcfc027dca3dc3d62a4bdd170dddeb0463ac | lib/erlef/admins/notifications.ex | lib/erlef/admins/notifications.ex | defmodule Erlef.Admins.Notifications do
@moduledoc false
import Swoosh.Email
@type notification_type() :: :new_email_request
@type params() :: map()
@spec new(notification_type(), params()) :: Swoosh.Email.t()
def new(:new_email_request, _) do
msg = """
A new email request was created. Visit https://erlef.org/admin/ to view outstanding requests.
"""
new()
|> to({"Infrastructure Requests", "[email protected]"})
|> from({"Erlef Notifications", "[email protected]"})
|> subject("A new email request was created")
|> text_body(msg)
end
@spec new(notification_type(), params()) :: Swoosh.Email.t()
def new(:new_slack_invite, %{member: member}) do
msg = """
A member has requested access to the Erlef slack.
A workspace owner or admin must now go on the Erlef slack workspace and create
an invite for the member by typing the following :
/invite
And then enter the members's email : #{member.email}
Note: You may be prompted to approve this invitation as well.
"""
new()
|> to({"Infrastructure Working Group", "[email protected]"})
|> bcc({"Infrastructure Requests", "[email protected]"})
|> from({"Erlef Notifications", "[email protected]"})
|> subject("A member is requesting a new slack invite")
|> text_body(msg)
end
end
| defmodule Erlef.Admins.Notifications do
@moduledoc false
import Swoosh.Email
@type notification_type() :: :new_email_request
@type params() :: map()
@spec new(notification_type(), params()) :: Swoosh.Email.t()
def new(:new_email_request, _) do
msg = """
A new email request was created. Visit https://erlef.org/admin/ to view outstanding requests.
"""
new()
|> to({"Infrastructure Requests", "[email protected]"})
|> from({"Erlef Notifications", "[email protected]"})
|> subject("A new email request was created")
|> text_body(msg)
end
def new(:new_slack_invite, %{member: member}) do
msg = """
A member has requested access to the Erlef slack.
A workspace owner or admin must now go on the Erlef slack workspace and create
an invite for the member by typing the following :
/invite
And then enter the members's email : #{member.email}
Note: You may be prompted to approve this invitation as well.
"""
new()
|> to({"Infrastructure Working Group", "[email protected]"})
|> bcc({"Infrastructure Requests", "[email protected]"})
|> from({"Erlef Notifications", "[email protected]"})
|> subject("A member is requesting a new slack invite")
|> text_body(msg)
end
end
| Remove redundant (overloaded) spec from Admins.notify/2 | Remove redundant (overloaded) spec from Admins.notify/2
| Elixir | apache-2.0 | simplabs/website,simplabs/website | elixir | ## Code Before:
defmodule Erlef.Admins.Notifications do
@moduledoc false
import Swoosh.Email
@type notification_type() :: :new_email_request
@type params() :: map()
@spec new(notification_type(), params()) :: Swoosh.Email.t()
def new(:new_email_request, _) do
msg = """
A new email request was created. Visit https://erlef.org/admin/ to view outstanding requests.
"""
new()
|> to({"Infrastructure Requests", "[email protected]"})
|> from({"Erlef Notifications", "[email protected]"})
|> subject("A new email request was created")
|> text_body(msg)
end
@spec new(notification_type(), params()) :: Swoosh.Email.t()
def new(:new_slack_invite, %{member: member}) do
msg = """
A member has requested access to the Erlef slack.
A workspace owner or admin must now go on the Erlef slack workspace and create
an invite for the member by typing the following :
/invite
And then enter the members's email : #{member.email}
Note: You may be prompted to approve this invitation as well.
"""
new()
|> to({"Infrastructure Working Group", "[email protected]"})
|> bcc({"Infrastructure Requests", "[email protected]"})
|> from({"Erlef Notifications", "[email protected]"})
|> subject("A member is requesting a new slack invite")
|> text_body(msg)
end
end
## Instruction:
Remove redundant (overloaded) spec from Admins.notify/2
## Code After:
defmodule Erlef.Admins.Notifications do
@moduledoc false
import Swoosh.Email
@type notification_type() :: :new_email_request
@type params() :: map()
@spec new(notification_type(), params()) :: Swoosh.Email.t()
def new(:new_email_request, _) do
msg = """
A new email request was created. Visit https://erlef.org/admin/ to view outstanding requests.
"""
new()
|> to({"Infrastructure Requests", "[email protected]"})
|> from({"Erlef Notifications", "[email protected]"})
|> subject("A new email request was created")
|> text_body(msg)
end
def new(:new_slack_invite, %{member: member}) do
msg = """
A member has requested access to the Erlef slack.
A workspace owner or admin must now go on the Erlef slack workspace and create
an invite for the member by typing the following :
/invite
And then enter the members's email : #{member.email}
Note: You may be prompted to approve this invitation as well.
"""
new()
|> to({"Infrastructure Working Group", "[email protected]"})
|> bcc({"Infrastructure Requests", "[email protected]"})
|> from({"Erlef Notifications", "[email protected]"})
|> subject("A member is requesting a new slack invite")
|> text_body(msg)
end
end
|
6c30e96cae58f0c61f78ae7386f9640daf18e0dd | app/src/main/java/com/samourai/wallet/bip47/SendNotifTxFactory.java | app/src/main/java/com/samourai/wallet/bip47/SendNotifTxFactory.java | package com.samourai.wallet.bip47;
import com.samourai.wallet.SamouraiWallet;
import java.math.BigInteger;
public class SendNotifTxFactory {
public static final BigInteger _bNotifTxValue = SamouraiWallet.bDust;
public static final BigInteger _bSWFee = SamouraiWallet.bFee;
// public static final BigInteger _bSWCeilingFee = BigInteger.valueOf(50000L);
public static final String SAMOURAI_NOTIF_TX_FEE_ADDRESS = "bc1qncfysagz0072a894kvzyxqwpvj5ckfj5kctmtk";
public static final String TESTNET_SAMOURAI_NOTIF_TX_FEE_ADDRESS = "tb1qh287jqsh6mkpqmd8euumyfam00fkr78qhrdnde";
// public static final double _dSWFeeUSD = 0.5;
private SendNotifTxFactory () { ; }
}
| package com.samourai.wallet.bip47;
import android.util.Log;
import com.samourai.wallet.SamouraiWallet;
import java.math.BigInteger;
public class SendNotifTxFactory {
public static final BigInteger _bNotifTxValue = SamouraiWallet.bDust;
public static final BigInteger _bSWFee = SamouraiWallet.bFee;
// public static final BigInteger _bSWCeilingFee = BigInteger.valueOf(50000L);
static SendNotifTxFactory _instance = null;
public String SAMOURAI_NOTIF_TX_FEE_ADDRESS = "bc1qncfysagz0072a894kvzyxqwpvj5ckfj5kctmtk";
public String TESTNET_SAMOURAI_NOTIF_TX_FEE_ADDRESS = "tb1qh287jqsh6mkpqmd8euumyfam00fkr78qhrdnde";
// public static final double _dSWFeeUSD = 0.5;
private SendNotifTxFactory() {
}
public static SendNotifTxFactory getInstance() {
if (_instance == null) {
_instance = new SendNotifTxFactory();
}
return _instance;
}
public void setAddress(String address) {
if(SamouraiWallet.getInstance().isTestNet()){
TESTNET_SAMOURAI_NOTIF_TX_FEE_ADDRESS = address;
}else {
SAMOURAI_NOTIF_TX_FEE_ADDRESS = address;
}
Log.i("TAG","address BIP47 ".concat(address));
}
}
| Allow BIP47 custom fee address option | Allow BIP47 custom fee address option
| Java | unlicense | Samourai-Wallet/samourai-wallet-android | java | ## Code Before:
package com.samourai.wallet.bip47;
import com.samourai.wallet.SamouraiWallet;
import java.math.BigInteger;
public class SendNotifTxFactory {
public static final BigInteger _bNotifTxValue = SamouraiWallet.bDust;
public static final BigInteger _bSWFee = SamouraiWallet.bFee;
// public static final BigInteger _bSWCeilingFee = BigInteger.valueOf(50000L);
public static final String SAMOURAI_NOTIF_TX_FEE_ADDRESS = "bc1qncfysagz0072a894kvzyxqwpvj5ckfj5kctmtk";
public static final String TESTNET_SAMOURAI_NOTIF_TX_FEE_ADDRESS = "tb1qh287jqsh6mkpqmd8euumyfam00fkr78qhrdnde";
// public static final double _dSWFeeUSD = 0.5;
private SendNotifTxFactory () { ; }
}
## Instruction:
Allow BIP47 custom fee address option
## Code After:
package com.samourai.wallet.bip47;
import android.util.Log;
import com.samourai.wallet.SamouraiWallet;
import java.math.BigInteger;
public class SendNotifTxFactory {
public static final BigInteger _bNotifTxValue = SamouraiWallet.bDust;
public static final BigInteger _bSWFee = SamouraiWallet.bFee;
// public static final BigInteger _bSWCeilingFee = BigInteger.valueOf(50000L);
static SendNotifTxFactory _instance = null;
public String SAMOURAI_NOTIF_TX_FEE_ADDRESS = "bc1qncfysagz0072a894kvzyxqwpvj5ckfj5kctmtk";
public String TESTNET_SAMOURAI_NOTIF_TX_FEE_ADDRESS = "tb1qh287jqsh6mkpqmd8euumyfam00fkr78qhrdnde";
// public static final double _dSWFeeUSD = 0.5;
private SendNotifTxFactory() {
}
public static SendNotifTxFactory getInstance() {
if (_instance == null) {
_instance = new SendNotifTxFactory();
}
return _instance;
}
public void setAddress(String address) {
if(SamouraiWallet.getInstance().isTestNet()){
TESTNET_SAMOURAI_NOTIF_TX_FEE_ADDRESS = address;
}else {
SAMOURAI_NOTIF_TX_FEE_ADDRESS = address;
}
Log.i("TAG","address BIP47 ".concat(address));
}
}
|
92d43dcefe87199e3c7b541b81565ad4164039dd | .travis.yml | .travis.yml | language: node_js
node_js:
- 0.10
before_script:
- npm install -g grunt-cli
| language: node_js
node_js:
- 0.10
before_script:
- npm install -g grunt-cli
notifications:
email: false
irc:
channels:
- "irc.freenode.org#gittip"
on_success: change
on_failure: always
template:
- "%{repository} (%{branch}:%{commit} by %{author}): %{message} (%{build_url})"
skip_join: true
| Make Travis behave similarly to how it behaves on the www.gittip.com repository. | Make Travis behave similarly to how it behaves on the www.gittip.com repository.
| YAML | mit | gratipay/grtp.co,gratipay/grtp.co,gratipay/grtp.co | yaml | ## Code Before:
language: node_js
node_js:
- 0.10
before_script:
- npm install -g grunt-cli
## Instruction:
Make Travis behave similarly to how it behaves on the www.gittip.com repository.
## Code After:
language: node_js
node_js:
- 0.10
before_script:
- npm install -g grunt-cli
notifications:
email: false
irc:
channels:
- "irc.freenode.org#gittip"
on_success: change
on_failure: always
template:
- "%{repository} (%{branch}:%{commit} by %{author}): %{message} (%{build_url})"
skip_join: true
|
8c82b987c373f4e47dea80e7d3837aaea0bad162 | README.md | README.md |
When compressing a tarball it is far more efficient to have similar files one after the other so that the compression can find the similarities close by and get a better compression ratio. The similar files may be across different directories and a common trick is to do:
find $DIR | rev | sort | rev | tar -cvj -T - --no-recursion -f $OUTPUT.tar.bz2
Sometimes this is not good enough to find the similarities and sortedtar is my attempt to improve upon this and require less memorization by having a single script do the bulk of the work instead of a large chain of pipes.
# Usage
sortedtar-list $DIR | sortedtar -j -f $OUTPUT.tar.bz2
# Author
Baruch Even <[email protected]>
|
When compressing a tarball it is far more efficient to have similar files one after the other so that the compression can find the similarities close by and get a better compression ratio. The similar files may be across different directories and a common trick is to do:
find $DIR | rev | sort | rev | tar -cvj -T - --no-recursion -f $OUTPUT.tar.bz2
or:
tar zcf $(file **/*(.) | sort -T: -k2 | cut -d: -f1)
The second option assumes you don't have too many files as they are all provided on the command line and that has a limited size.
Sometimes this is not good enough to find the similarities and sortedtar is my attempt to improve upon this and require less memorization by having a single script do the bulk of the work instead of a large chain of pipes.
# Usage
sortedtar-list $DIR | sortedtar -j -f $OUTPUT.tar.bz2
# Author
Baruch Even <[email protected]>
| Document another command line method only | Document another command line method only
| Markdown | mit | baruch/sortedtar,baruch/sortedtar | markdown | ## Code Before:
When compressing a tarball it is far more efficient to have similar files one after the other so that the compression can find the similarities close by and get a better compression ratio. The similar files may be across different directories and a common trick is to do:
find $DIR | rev | sort | rev | tar -cvj -T - --no-recursion -f $OUTPUT.tar.bz2
Sometimes this is not good enough to find the similarities and sortedtar is my attempt to improve upon this and require less memorization by having a single script do the bulk of the work instead of a large chain of pipes.
# Usage
sortedtar-list $DIR | sortedtar -j -f $OUTPUT.tar.bz2
# Author
Baruch Even <[email protected]>
## Instruction:
Document another command line method only
## Code After:
When compressing a tarball it is far more efficient to have similar files one after the other so that the compression can find the similarities close by and get a better compression ratio. The similar files may be across different directories and a common trick is to do:
find $DIR | rev | sort | rev | tar -cvj -T - --no-recursion -f $OUTPUT.tar.bz2
or:
tar zcf $(file **/*(.) | sort -T: -k2 | cut -d: -f1)
The second option assumes you don't have too many files as they are all provided on the command line and that has a limited size.
Sometimes this is not good enough to find the similarities and sortedtar is my attempt to improve upon this and require less memorization by having a single script do the bulk of the work instead of a large chain of pipes.
# Usage
sortedtar-list $DIR | sortedtar -j -f $OUTPUT.tar.bz2
# Author
Baruch Even <[email protected]>
|
d0f2cab9c8a671445e3c2d8c1b7a9206d8d5811d | Cargo.toml | Cargo.toml | [package]
name = "cjdrs"
version = "0.0.1"
authors = ["Vanhala Antti <[email protected]>"]
license = "MIT"
[lib]
name = "cjdrs"
path = "src/cjdrs/lib.rs"
[dependencies.tuntap]
#git = "https://github.com/randati/tuntap-rust.git"
path = "../tuntap-rust"
[dependencies.rust-crypto]
git = "https://github.com/DaGenix/rust-crypto.git"
[dependencies.mio]
#git = "https://github.com/carllerche/mio.git"
path = "../mio"
| [package]
name = "cjdrs"
version = "0.0.1"
authors = ["Vanhala Antti <[email protected]>"]
license = "MIT"
[lib]
name = "cjdrs"
path = "src/cjdrs/lib.rs"
[dependencies.tuntap]
git = "https://github.com/Randati/tuntap-rust.git"
#path = "../tuntap-rust"
[dependencies.rust-crypto]
git = "https://github.com/DaGenix/rust-crypto.git"
[dependencies.mio]
git = "https://github.com/Randati/mio.git"
#path = "../mio"
| Use Github repositories for dependecies | Use Github repositories for dependecies | TOML | mit | Randati/cjdrs | toml | ## Code Before:
[package]
name = "cjdrs"
version = "0.0.1"
authors = ["Vanhala Antti <[email protected]>"]
license = "MIT"
[lib]
name = "cjdrs"
path = "src/cjdrs/lib.rs"
[dependencies.tuntap]
#git = "https://github.com/randati/tuntap-rust.git"
path = "../tuntap-rust"
[dependencies.rust-crypto]
git = "https://github.com/DaGenix/rust-crypto.git"
[dependencies.mio]
#git = "https://github.com/carllerche/mio.git"
path = "../mio"
## Instruction:
Use Github repositories for dependecies
## Code After:
[package]
name = "cjdrs"
version = "0.0.1"
authors = ["Vanhala Antti <[email protected]>"]
license = "MIT"
[lib]
name = "cjdrs"
path = "src/cjdrs/lib.rs"
[dependencies.tuntap]
git = "https://github.com/Randati/tuntap-rust.git"
#path = "../tuntap-rust"
[dependencies.rust-crypto]
git = "https://github.com/DaGenix/rust-crypto.git"
[dependencies.mio]
git = "https://github.com/Randati/mio.git"
#path = "../mio"
|
5af61cae2ca438880357f88533cfa77ea161efac | corehq/ex-submodules/pillow_retry/admin.py | corehq/ex-submodules/pillow_retry/admin.py | from django.contrib import admin
from .models import PillowError
class PillowErrorAdmin(admin.ModelAdmin):
model = PillowError
list_display = [
'pillow',
'doc_id',
'error_type',
'date_created',
'date_last_attempt',
'date_next_attempt'
]
list_filter = ('pillow', 'error_type')
admin.site.register(PillowError, PillowErrorAdmin)
| from django.contrib import admin
from pillow_retry.models import PillowError
@admin.register(PillowError)
class PillowErrorAdmin(admin.ModelAdmin):
model = PillowError
list_display = [
'pillow',
'doc_id',
'error_type',
'date_created',
'date_last_attempt',
'date_next_attempt'
]
list_filter = ('pillow', 'error_type')
actions = [
'delete_selected'
]
| Add delete action to PillowRetry | Add delete action to PillowRetry
| Python | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | python | ## Code Before:
from django.contrib import admin
from .models import PillowError
class PillowErrorAdmin(admin.ModelAdmin):
model = PillowError
list_display = [
'pillow',
'doc_id',
'error_type',
'date_created',
'date_last_attempt',
'date_next_attempt'
]
list_filter = ('pillow', 'error_type')
admin.site.register(PillowError, PillowErrorAdmin)
## Instruction:
Add delete action to PillowRetry
## Code After:
from django.contrib import admin
from pillow_retry.models import PillowError
@admin.register(PillowError)
class PillowErrorAdmin(admin.ModelAdmin):
model = PillowError
list_display = [
'pillow',
'doc_id',
'error_type',
'date_created',
'date_last_attempt',
'date_next_attempt'
]
list_filter = ('pillow', 'error_type')
actions = [
'delete_selected'
]
|
e7f6d125c44cea71a99a4ebf81e5089209ac6f75 | metadata/us.spotco.maps.yml | metadata/us.spotco.maps.yml | AntiFeatures:
- NonFreeNet
Categories:
- Navigation
License: GPL-3.0-or-later
AuthorName: Divested Computing Group
AuthorWebSite: https://divestos.org
SourceCode: https://gitlab.com/divested-mobile/maps
IssueTracker: https://gitlab.com/divested-mobile/maps/issues
Donate: https://divestos.org/index.php?page=about#donate
Bitcoin: bc1qkjtp2k7cc4kuv8k9wjdlxkeuqczenrpv5mwasl
AutoName: GMaps WV
RepoType: git
Repo: https://gitlab.com/divested-mobile/maps
Builds:
- versionName: '1.3'
versionCode: 15
commit: v1.3-15
subdir: app
gradle:
- yes
AutoUpdateMode: Version v%v-%c
UpdateCheckMode: Tags
CurrentVersion: '1.3'
CurrentVersionCode: 15
| AntiFeatures:
- NonFreeNet
Categories:
- Navigation
License: GPL-3.0-or-later
AuthorName: Divested Computing Group
AuthorWebSite: https://divestos.org
SourceCode: https://gitlab.com/divested-mobile/maps
IssueTracker: https://gitlab.com/divested-mobile/maps/issues
Donate: https://divestos.org/index.php?page=about#donate
Bitcoin: bc1qkjtp2k7cc4kuv8k9wjdlxkeuqczenrpv5mwasl
AutoName: GMaps WV
RepoType: git
Repo: https://gitlab.com/divested-mobile/maps
Builds:
- versionName: '1.3'
versionCode: 15
commit: v1.3-15
subdir: app
gradle:
- yes
- versionName: '1.4'
versionCode: 16
commit: d8e52c557e831289da6b15239795210f548d3c5d
subdir: app
gradle:
- yes
AutoUpdateMode: Version v%v-%c
UpdateCheckMode: Tags
CurrentVersion: '1.4'
CurrentVersionCode: 16
| Update GMaps WV to 1.4 (16) | Update GMaps WV to 1.4 (16)
| YAML | agpl-3.0 | f-droid/fdroiddata,f-droid/fdroiddata | yaml | ## Code Before:
AntiFeatures:
- NonFreeNet
Categories:
- Navigation
License: GPL-3.0-or-later
AuthorName: Divested Computing Group
AuthorWebSite: https://divestos.org
SourceCode: https://gitlab.com/divested-mobile/maps
IssueTracker: https://gitlab.com/divested-mobile/maps/issues
Donate: https://divestos.org/index.php?page=about#donate
Bitcoin: bc1qkjtp2k7cc4kuv8k9wjdlxkeuqczenrpv5mwasl
AutoName: GMaps WV
RepoType: git
Repo: https://gitlab.com/divested-mobile/maps
Builds:
- versionName: '1.3'
versionCode: 15
commit: v1.3-15
subdir: app
gradle:
- yes
AutoUpdateMode: Version v%v-%c
UpdateCheckMode: Tags
CurrentVersion: '1.3'
CurrentVersionCode: 15
## Instruction:
Update GMaps WV to 1.4 (16)
## Code After:
AntiFeatures:
- NonFreeNet
Categories:
- Navigation
License: GPL-3.0-or-later
AuthorName: Divested Computing Group
AuthorWebSite: https://divestos.org
SourceCode: https://gitlab.com/divested-mobile/maps
IssueTracker: https://gitlab.com/divested-mobile/maps/issues
Donate: https://divestos.org/index.php?page=about#donate
Bitcoin: bc1qkjtp2k7cc4kuv8k9wjdlxkeuqczenrpv5mwasl
AutoName: GMaps WV
RepoType: git
Repo: https://gitlab.com/divested-mobile/maps
Builds:
- versionName: '1.3'
versionCode: 15
commit: v1.3-15
subdir: app
gradle:
- yes
- versionName: '1.4'
versionCode: 16
commit: d8e52c557e831289da6b15239795210f548d3c5d
subdir: app
gradle:
- yes
AutoUpdateMode: Version v%v-%c
UpdateCheckMode: Tags
CurrentVersion: '1.4'
CurrentVersionCode: 16
|
2a55fe08c7ab9b2162f191bc95a9b48c58684506 | tox.ini | tox.ini | [tox]
envlist = py27,py35
[testenv]
commands =
{envpython} setup.py test
deps = cython
| [tox]
envlist = py26,py27,py33,py34,py35
[testenv]
commands =
{envpython} setup.py test
deps = cython
| Add a few more python environments. | Add a few more python environments.
py26: commands succeeded
py27: commands succeeded
py33: commands succeeded
py34: commands succeeded
py35: commands succeeded
congratulations :)
| INI | mit | aeroevan/pysnappy | ini | ## Code Before:
[tox]
envlist = py27,py35
[testenv]
commands =
{envpython} setup.py test
deps = cython
## Instruction:
Add a few more python environments.
py26: commands succeeded
py27: commands succeeded
py33: commands succeeded
py34: commands succeeded
py35: commands succeeded
congratulations :)
## Code After:
[tox]
envlist = py26,py27,py33,py34,py35
[testenv]
commands =
{envpython} setup.py test
deps = cython
|
39132175178dd8dfb0861f30630e4a06003670b7 | packages/ht/http-client-extra.yaml | packages/ht/http-client-extra.yaml | homepage: ''
changelog-type: ''
hash: f05a14b55f7b469517f018f7d4f8b6313baed835ee93b946a26c10faa92bfbfd
test-bench-deps: {}
maintainer: [email protected]
synopsis: wrapper for http-client exposing cookies
changelog: ''
basic-deps:
http-client: -any
exceptions: -any
bytestring: -any
case-insensitive: -any
base: ! '>=4.7 && <5'
base64-bytestring: -any
text: -any
data-default: -any
array: -any
containers: -any
blaze-builder: -any
transformers: -any
random: -any
http-types: -any
aeson: -any
all-versions:
- '0.1.1.0'
- '0.1.2.0'
author: Marcin Tolysz
latest: '0.1.2.0'
description-type: haddock
description: wrapper for http-client exposing cookies
license-name: BSD3
| homepage: ''
changelog-type: ''
hash: a86cd56c917e9b616c11c48c2ee7d6875f0de7cf277a1dbf182bb87e6f8b3dde
test-bench-deps: {}
maintainer: [email protected]
synopsis: wrapper for http-client exposing cookies
changelog: ''
basic-deps:
http-client: -any
exceptions: -any
bytestring: -any
case-insensitive: -any
base: ! '>=4.7 && <5'
base64-bytestring: -any
text: -any
data-default: -any
array: -any
containers: -any
blaze-builder: -any
transformers: -any
random: -any
http-types: -any
aeson: -any
all-versions:
- '0.1.1.0'
- '0.1.2.0'
- '0.1.3.0'
author: Marcin Tolysz
latest: '0.1.3.0'
description-type: haddock
description: wrapper for http-client exposing cookies
license-name: BSD3
| Update from Hackage at 2018-06-29T18:19:04Z | Update from Hackage at 2018-06-29T18:19:04Z
| YAML | mit | commercialhaskell/all-cabal-metadata | yaml | ## Code Before:
homepage: ''
changelog-type: ''
hash: f05a14b55f7b469517f018f7d4f8b6313baed835ee93b946a26c10faa92bfbfd
test-bench-deps: {}
maintainer: [email protected]
synopsis: wrapper for http-client exposing cookies
changelog: ''
basic-deps:
http-client: -any
exceptions: -any
bytestring: -any
case-insensitive: -any
base: ! '>=4.7 && <5'
base64-bytestring: -any
text: -any
data-default: -any
array: -any
containers: -any
blaze-builder: -any
transformers: -any
random: -any
http-types: -any
aeson: -any
all-versions:
- '0.1.1.0'
- '0.1.2.0'
author: Marcin Tolysz
latest: '0.1.2.0'
description-type: haddock
description: wrapper for http-client exposing cookies
license-name: BSD3
## Instruction:
Update from Hackage at 2018-06-29T18:19:04Z
## Code After:
homepage: ''
changelog-type: ''
hash: a86cd56c917e9b616c11c48c2ee7d6875f0de7cf277a1dbf182bb87e6f8b3dde
test-bench-deps: {}
maintainer: [email protected]
synopsis: wrapper for http-client exposing cookies
changelog: ''
basic-deps:
http-client: -any
exceptions: -any
bytestring: -any
case-insensitive: -any
base: ! '>=4.7 && <5'
base64-bytestring: -any
text: -any
data-default: -any
array: -any
containers: -any
blaze-builder: -any
transformers: -any
random: -any
http-types: -any
aeson: -any
all-versions:
- '0.1.1.0'
- '0.1.2.0'
- '0.1.3.0'
author: Marcin Tolysz
latest: '0.1.3.0'
description-type: haddock
description: wrapper for http-client exposing cookies
license-name: BSD3
|
d5e3d6c3ca285f1037f284cfb78e279c2d1032ec | dojopuzzles/core/urls.py | dojopuzzles/core/urls.py | from django.urls import path
from core import views
app_name = "core"
urlpatterns = [
path("home/", views.home, name="home"),
path("about/", views.about, name="about"),
]
| from core import views
from django.urls import path
app_name = "core"
urlpatterns = [
path("", views.home, name="home"),
path("about/", views.about, name="about"),
]
| Fix route for main page | Fix route for main page
| Python | mit | rennerocha/dojopuzzles | python | ## Code Before:
from django.urls import path
from core import views
app_name = "core"
urlpatterns = [
path("home/", views.home, name="home"),
path("about/", views.about, name="about"),
]
## Instruction:
Fix route for main page
## Code After:
from core import views
from django.urls import path
app_name = "core"
urlpatterns = [
path("", views.home, name="home"),
path("about/", views.about, name="about"),
]
|
4607c2fdb39301cc60d49280dd1253e3d62845be | st2api/setup.py | st2api/setup.py |
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
setup(
name='st2api',
version='0.4.0',
description='',
author='StackStorm',
author_email='[email protected]',
install_requires=[
"pecan",
],
test_suite='st2api',
zip_safe=False,
include_package_data=True,
packages=find_packages(exclude=['ez_setup'])
)
|
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
setup(
name='st2api',
version='0.4.0',
description='',
author='StackStorm',
author_email='[email protected]',
install_requires=[
"pecan",
],
package_data={
'st2api': ['templates/*.html']
},
test_suite='st2api',
zip_safe=False,
include_package_data=True,
packages=find_packages(exclude=['ez_setup'])
)
| Fix a packaging bug and make sure we also include templates directory. | Fix a packaging bug and make sure we also include templates directory.
| Python | apache-2.0 | pixelrebel/st2,jtopjian/st2,nzlosh/st2,Itxaka/st2,Plexxi/st2,grengojbo/st2,lakshmi-kannan/st2,armab/st2,Plexxi/st2,peak6/st2,pixelrebel/st2,emedvedev/st2,emedvedev/st2,Plexxi/st2,Itxaka/st2,tonybaloney/st2,lakshmi-kannan/st2,pixelrebel/st2,jtopjian/st2,jtopjian/st2,dennybaa/st2,punalpatel/st2,dennybaa/st2,alfasin/st2,alfasin/st2,StackStorm/st2,Itxaka/st2,peak6/st2,grengojbo/st2,nzlosh/st2,emedvedev/st2,nzlosh/st2,alfasin/st2,StackStorm/st2,lakshmi-kannan/st2,pinterb/st2,Plexxi/st2,punalpatel/st2,dennybaa/st2,armab/st2,nzlosh/st2,StackStorm/st2,grengojbo/st2,armab/st2,StackStorm/st2,tonybaloney/st2,tonybaloney/st2,pinterb/st2,peak6/st2,punalpatel/st2,pinterb/st2 | python | ## Code Before:
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
setup(
name='st2api',
version='0.4.0',
description='',
author='StackStorm',
author_email='[email protected]',
install_requires=[
"pecan",
],
test_suite='st2api',
zip_safe=False,
include_package_data=True,
packages=find_packages(exclude=['ez_setup'])
)
## Instruction:
Fix a packaging bug and make sure we also include templates directory.
## Code After:
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
setup(
name='st2api',
version='0.4.0',
description='',
author='StackStorm',
author_email='[email protected]',
install_requires=[
"pecan",
],
package_data={
'st2api': ['templates/*.html']
},
test_suite='st2api',
zip_safe=False,
include_package_data=True,
packages=find_packages(exclude=['ez_setup'])
)
|
dd7513f4146679d11aff6d528f11927131dc692f | feder/monitorings/factories.py | feder/monitorings/factories.py | from .models import Monitoring
from feder.users.factories import UserFactory
import factory
class MonitoringFactory(factory.django.DjangoModelFactory):
name = factory.Sequence(lambda n: 'monitoring-%04d' % n)
user = factory.SubFactory(UserFactory)
class Meta:
model = Monitoring
django_get_or_create = ('name', )
| from .models import Monitoring
from feder.users.factories import UserFactory
import factory
class MonitoringFactory(factory.django.DjangoModelFactory):
name = factory.Sequence(lambda n: 'monitoring-%04d' % n)
user = factory.SubFactory(UserFactory)
description = factory.Sequence(lambda n: 'description no.%04d' % n)
template = factory.Sequence(lambda n:
'template no.%04d. reply to {{EMAIL}}' % n)
class Meta:
model = Monitoring
django_get_or_create = ('name', )
| Add description and template to MonitoringFactory | Add description and template to MonitoringFactory
| Python | mit | watchdogpolska/feder,watchdogpolska/feder,watchdogpolska/feder,watchdogpolska/feder | python | ## Code Before:
from .models import Monitoring
from feder.users.factories import UserFactory
import factory
class MonitoringFactory(factory.django.DjangoModelFactory):
name = factory.Sequence(lambda n: 'monitoring-%04d' % n)
user = factory.SubFactory(UserFactory)
class Meta:
model = Monitoring
django_get_or_create = ('name', )
## Instruction:
Add description and template to MonitoringFactory
## Code After:
from .models import Monitoring
from feder.users.factories import UserFactory
import factory
class MonitoringFactory(factory.django.DjangoModelFactory):
name = factory.Sequence(lambda n: 'monitoring-%04d' % n)
user = factory.SubFactory(UserFactory)
description = factory.Sequence(lambda n: 'description no.%04d' % n)
template = factory.Sequence(lambda n:
'template no.%04d. reply to {{EMAIL}}' % n)
class Meta:
model = Monitoring
django_get_or_create = ('name', )
|
0a6dcc84a2a7562229599a03cbcc2a2d720e581c | Configuration/Settings.yaml | Configuration/Settings.yaml | Neos:
Neos:
userInterface:
translation:
autoInclude:
'Flownative.Neos.CacheManagement': ['Modules']
modules:
administration:
submodules:
flownativeCacheManagementCaches:
label: 'Caches'
icon: 'icon-bolt'
controller: 'Flownative\Neos\CacheManagement\Controller\Module\Administration\CachesController'
description: 'Provides administration tools for maintaining caches.'
privilegeTarget: 'Flownative.Neos.CacheManagement:Backend.Module.Administration.Caches'
| Neos:
Neos:
modules:
administration:
submodules:
flownativeCacheManagementCaches:
label: 'Caches'
icon: 'icon-bolt'
controller: 'Flownative\Neos\CacheManagement\Controller\Module\Administration\CachesController'
description: 'Provides administration tools for maintaining caches.'
privilegeTarget: 'Flownative.Neos.CacheManagement:Backend.Module.Administration.Caches'
| Remove translation auto includes because there are no translations | Remove translation auto includes because there are no translations
Flownative.Cachemanagement does not have own translation files, yet they are included in the Settings.yaml. | YAML | mit | Flownative/neos-cachemanagement,Flownative/neos-cachemanagement | yaml | ## Code Before:
Neos:
Neos:
userInterface:
translation:
autoInclude:
'Flownative.Neos.CacheManagement': ['Modules']
modules:
administration:
submodules:
flownativeCacheManagementCaches:
label: 'Caches'
icon: 'icon-bolt'
controller: 'Flownative\Neos\CacheManagement\Controller\Module\Administration\CachesController'
description: 'Provides administration tools for maintaining caches.'
privilegeTarget: 'Flownative.Neos.CacheManagement:Backend.Module.Administration.Caches'
## Instruction:
Remove translation auto includes because there are no translations
Flownative.Cachemanagement does not have own translation files, yet they are included in the Settings.yaml.
## Code After:
Neos:
Neos:
modules:
administration:
submodules:
flownativeCacheManagementCaches:
label: 'Caches'
icon: 'icon-bolt'
controller: 'Flownative\Neos\CacheManagement\Controller\Module\Administration\CachesController'
description: 'Provides administration tools for maintaining caches.'
privilegeTarget: 'Flownative.Neos.CacheManagement:Backend.Module.Administration.Caches'
|
612052c8003861cf719f8f68687e672e6d5d0d1a | settings/settings.php | settings/settings.php | <?php
/**
* ownCloud - spreedwebrtc
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Leon <[email protected]>
* @copyright Leon 2015
*/
namespace OCA\SpreedWebRTC\Settings;
class Settings {
const APP_ID = 'spreedwebrtc';
const APP_TITLE = 'Spreed WebRTC';
const APP_ICON = 'app.svg';
const SPREED_WEBRTC_MAX_USERCOMBO_AGE = 60 * 60 * 24;
private function __construct() {
}
}
| <?php
/**
* ownCloud - spreedwebrtc
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Leon <[email protected]>
* @copyright Leon 2015
*/
namespace OCA\SpreedWebRTC\Settings;
class Settings {
const APP_ID = 'spreedwebrtc';
const APP_TITLE = 'Spreed WebRTC';
const APP_ICON = 'app.svg';
const SPREED_WEBRTC_MAX_USERCOMBO_AGE = 20;
private function __construct() {
}
}
| Decrease SPREED_WEBRTC_MAX_USERCOMBO_AGE to 20 seconds | Decrease SPREED_WEBRTC_MAX_USERCOMBO_AGE to 20 seconds
| PHP | agpl-3.0 | strukturag/owncloud-spreedme,strukturag/owncloud-spreedme,strukturag/nextcloud-spreedme,strukturag/owncloud-spreedme,strukturag/nextcloud-spreedme,strukturag/nextcloud-spreedme,strukturag/nextcloud-spreedme | php | ## Code Before:
<?php
/**
* ownCloud - spreedwebrtc
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Leon <[email protected]>
* @copyright Leon 2015
*/
namespace OCA\SpreedWebRTC\Settings;
class Settings {
const APP_ID = 'spreedwebrtc';
const APP_TITLE = 'Spreed WebRTC';
const APP_ICON = 'app.svg';
const SPREED_WEBRTC_MAX_USERCOMBO_AGE = 60 * 60 * 24;
private function __construct() {
}
}
## Instruction:
Decrease SPREED_WEBRTC_MAX_USERCOMBO_AGE to 20 seconds
## Code After:
<?php
/**
* ownCloud - spreedwebrtc
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Leon <[email protected]>
* @copyright Leon 2015
*/
namespace OCA\SpreedWebRTC\Settings;
class Settings {
const APP_ID = 'spreedwebrtc';
const APP_TITLE = 'Spreed WebRTC';
const APP_ICON = 'app.svg';
const SPREED_WEBRTC_MAX_USERCOMBO_AGE = 20;
private function __construct() {
}
}
|
458b35d82cbe72a1f8d22070c9c032ef186ee4c6 | src/navigation/replace.tsx | src/navigation/replace.tsx | import React from "react";
import { domToReact } from "html-react-parser";
import attributesToProps from "html-react-parser/lib/attributes-to-props";
import { HashLink as Link } from "react-router-hash-link";
export function replace(domNode: any) {
if (domNode.name && domNode.name === "a") {
const { href, ...rest } = domNode.attribs;
const props = attributesToProps(rest);
if(href && !href.startsWith("http:") && !href.startsWith("https:") && !href.startsWith("mailto:")){
// Local (relative) links pimped with react router navigation
return (
<Link to={href} {...props}>
{domToReact(domNode.children, { replace })}
</Link>
);
}else{
// Default behaviour for links to fully qualified URLs
}
}
// !whitelist.includes(domNode.name) &&
// domNode.type !== "text" &&
// console.dir(domNode, { depth: null });
}
export const whitelist = [
"a",
"span",
"li",
"ul",
"div",
"i",
"br",
"img",
"input",
"form",
"nav",
"small",
];
| import React from "react";
import { domToReact } from "html-react-parser";
import attributesToProps from "html-react-parser/lib/attributes-to-props";
import { HashLink as Link } from "react-router-hash-link";
export function replace(domNode: any) {
if (domNode.name && domNode.name === "a") {
const { href, ...rest } = domNode.attribs;
const props = attributesToProps(rest);
if (
href &&
!href.startsWith("http:") &&
!href.startsWith("https:") &&
!href.startsWith("mailto:") &&
!href.startsWith("//assets.ctfassets.net")
) {
// Local (relative) links pimped with react router navigation
return (
<Link to={href} {...props}>
{domToReact(domNode.children, { replace })}
</Link>
);
} else {
// Default behaviour for links to fully qualified URLs
}
}
// !whitelist.includes(domNode.name) &&
// domNode.type !== "text" &&
// console.dir(domNode, { depth: null });
}
export const whitelist = [
"a",
"span",
"li",
"ul",
"div",
"i",
"br",
"img",
"input",
"form",
"nav",
"small",
];
| Fix external links for example reports breaking | DS: Fix external links for example reports breaking
| TypeScript | apache-2.0 | saasquatch/saasquatch-docs,saasquatch/saasquatch-docs,saasquatch/saasquatch-docs | typescript | ## Code Before:
import React from "react";
import { domToReact } from "html-react-parser";
import attributesToProps from "html-react-parser/lib/attributes-to-props";
import { HashLink as Link } from "react-router-hash-link";
export function replace(domNode: any) {
if (domNode.name && domNode.name === "a") {
const { href, ...rest } = domNode.attribs;
const props = attributesToProps(rest);
if(href && !href.startsWith("http:") && !href.startsWith("https:") && !href.startsWith("mailto:")){
// Local (relative) links pimped with react router navigation
return (
<Link to={href} {...props}>
{domToReact(domNode.children, { replace })}
</Link>
);
}else{
// Default behaviour for links to fully qualified URLs
}
}
// !whitelist.includes(domNode.name) &&
// domNode.type !== "text" &&
// console.dir(domNode, { depth: null });
}
export const whitelist = [
"a",
"span",
"li",
"ul",
"div",
"i",
"br",
"img",
"input",
"form",
"nav",
"small",
];
## Instruction:
DS: Fix external links for example reports breaking
## Code After:
import React from "react";
import { domToReact } from "html-react-parser";
import attributesToProps from "html-react-parser/lib/attributes-to-props";
import { HashLink as Link } from "react-router-hash-link";
export function replace(domNode: any) {
if (domNode.name && domNode.name === "a") {
const { href, ...rest } = domNode.attribs;
const props = attributesToProps(rest);
if (
href &&
!href.startsWith("http:") &&
!href.startsWith("https:") &&
!href.startsWith("mailto:") &&
!href.startsWith("//assets.ctfassets.net")
) {
// Local (relative) links pimped with react router navigation
return (
<Link to={href} {...props}>
{domToReact(domNode.children, { replace })}
</Link>
);
} else {
// Default behaviour for links to fully qualified URLs
}
}
// !whitelist.includes(domNode.name) &&
// domNode.type !== "text" &&
// console.dir(domNode, { depth: null });
}
export const whitelist = [
"a",
"span",
"li",
"ul",
"div",
"i",
"br",
"img",
"input",
"form",
"nav",
"small",
];
|
d1eb1eab0e768b1960b50cae2b3d3836c27e8d48 | awa/plugins/awa-counters/db/counter-update.xml | awa/plugins/awa-counters/db/counter-update.xml | <query-mapping package='AWA.Counters.Models'>
<description>
Queries to update counters
</description>
<class name="AWA.Counters.Models.Stat_Info" bean="yes">
<comment>The month statistics.</comment>
<property type='Date' name="date">
<comment>the counter date.</comment>
</property>
<property type='Natural' name="count">
<comment>the counter value.</comment>
</property>
</class>
<query name='counter-update'>
<comment>Update counter</comment>
<sql driver='mysql'>
INSERT INTO awa_counter (object_id, definition_id, date, counter) VALUES(:id, :definition, :date, :counter)
ON DUPLICATE KEY UPDATE counter = counter + :counter
</sql>
<sql driver='sqlite'>
INSERT OR REPLACE INTO awa_counter (object_id, definition_id, date, counter)
VALUES(:id, :definition, :date,
COALESCE((SELECT counter + :counter FROM awa_counter WHERE object_id = :id AND definition_id = :definition AND date = :date),:counter))
</sql>
</query>
<query name='counter-update-field'>
<comment>Update a target field counter</comment>
<sql>
UPDATE :table SET :field = :field + :counter WHERE id = :id
</sql>
</query>
</query-mapping>
| <query-mapping package='AWA.Counters.Models'>
<description>
Queries to update counters
</description>
<class name="AWA.Counters.Models.Stat_Info" bean="yes">
<comment>The month statistics.</comment>
<property type='Date' name="date">
<comment>the counter date.</comment>
</property>
<property type='Natural' name="count">
<comment>the counter value.</comment>
</property>
</class>
<query name='counter-update'>
<comment>Update counter</comment>
<sql driver='mysql'>
INSERT INTO awa_counter (object_id, definition_id, date, counter) VALUES(:id, :definition, :date, :counter)
ON DUPLICATE KEY UPDATE counter = counter + :counter
</sql>
<sql driver='postgresql'>
INSERT INTO awa_counter (object_id, definition_id, date, counter) VALUES(:id, :definition, :date, :counter)
ON CONFLICT (object_id, definition_id, date) DO UPDATE
SET counter = awa_counter.counter + :counter
</sql>
<sql driver='sqlite'>
INSERT OR REPLACE INTO awa_counter (object_id, definition_id, date, counter)
VALUES(:id, :definition, :date,
COALESCE((SELECT counter + :counter FROM awa_counter WHERE object_id = :id AND definition_id = :definition AND date = :date),:counter))
</sql>
</query>
<query name='counter-update-field'>
<comment>Update a target field counter</comment>
<sql>
UPDATE :table SET :field = :field + :counter WHERE id = :id
</sql>
</query>
</query-mapping>
| Add specific query for Postgresql to update the counter | Add specific query for Postgresql to update the counter
| XML | apache-2.0 | stcarrez/ada-awa,stcarrez/ada-awa,stcarrez/ada-awa,stcarrez/ada-awa | xml | ## Code Before:
<query-mapping package='AWA.Counters.Models'>
<description>
Queries to update counters
</description>
<class name="AWA.Counters.Models.Stat_Info" bean="yes">
<comment>The month statistics.</comment>
<property type='Date' name="date">
<comment>the counter date.</comment>
</property>
<property type='Natural' name="count">
<comment>the counter value.</comment>
</property>
</class>
<query name='counter-update'>
<comment>Update counter</comment>
<sql driver='mysql'>
INSERT INTO awa_counter (object_id, definition_id, date, counter) VALUES(:id, :definition, :date, :counter)
ON DUPLICATE KEY UPDATE counter = counter + :counter
</sql>
<sql driver='sqlite'>
INSERT OR REPLACE INTO awa_counter (object_id, definition_id, date, counter)
VALUES(:id, :definition, :date,
COALESCE((SELECT counter + :counter FROM awa_counter WHERE object_id = :id AND definition_id = :definition AND date = :date),:counter))
</sql>
</query>
<query name='counter-update-field'>
<comment>Update a target field counter</comment>
<sql>
UPDATE :table SET :field = :field + :counter WHERE id = :id
</sql>
</query>
</query-mapping>
## Instruction:
Add specific query for Postgresql to update the counter
## Code After:
<query-mapping package='AWA.Counters.Models'>
<description>
Queries to update counters
</description>
<class name="AWA.Counters.Models.Stat_Info" bean="yes">
<comment>The month statistics.</comment>
<property type='Date' name="date">
<comment>the counter date.</comment>
</property>
<property type='Natural' name="count">
<comment>the counter value.</comment>
</property>
</class>
<query name='counter-update'>
<comment>Update counter</comment>
<sql driver='mysql'>
INSERT INTO awa_counter (object_id, definition_id, date, counter) VALUES(:id, :definition, :date, :counter)
ON DUPLICATE KEY UPDATE counter = counter + :counter
</sql>
<sql driver='postgresql'>
INSERT INTO awa_counter (object_id, definition_id, date, counter) VALUES(:id, :definition, :date, :counter)
ON CONFLICT (object_id, definition_id, date) DO UPDATE
SET counter = awa_counter.counter + :counter
</sql>
<sql driver='sqlite'>
INSERT OR REPLACE INTO awa_counter (object_id, definition_id, date, counter)
VALUES(:id, :definition, :date,
COALESCE((SELECT counter + :counter FROM awa_counter WHERE object_id = :id AND definition_id = :definition AND date = :date),:counter))
</sql>
</query>
<query name='counter-update-field'>
<comment>Update a target field counter</comment>
<sql>
UPDATE :table SET :field = :field + :counter WHERE id = :id
</sql>
</query>
</query-mapping>
|
148e386aa9d053188e68489670d2225753182b0a | tox.ini | tox.ini | [tox]
envlist =
py{36,37,38,39}-dj{22,30,31,32}
py{38,39}-dj{main}
style
[testenv]
usedevelop = true
extras = tests
commands =
python -Wd {envbindir}/coverage run tests/manage.py test -v2 --keepdb {posargs:testapp}
coverage report -m
deps =
dj22: Django>=2.2,<3.0
dj30: Django>=3.0,<3.1
dj31: Django>=3.1,<3.2
dj32: Django>=3.2a1,<4.0
djmain: https://github.com/django/django/archive/main.tar.gz
[testenv:style]
deps =
black
flake8
isort
changedir = {toxinidir}
commands =
black .
isort --profile=black --lines-after-import=2 --combine-as .
flake8 .
skip_install = true
| [tox]
envlist =
py{36,37,38,39}-dj{22,30,31,32}
py{38,39}-dj{40,main}
style
[testenv]
usedevelop = true
extras = tests
commands =
python -Wd {envbindir}/coverage run tests/manage.py test -v2 --keepdb {posargs:testapp}
coverage report -m
deps =
dj22: Django>=2.2,<3.0
dj30: Django>=3.0,<3.1
dj31: Django>=3.1,<3.2
dj32: Django>=3.2,<4.0
dj40: Django>=4.0a1,<4.1
djmain: https://github.com/django/django/archive/main.tar.gz
[testenv:style]
deps =
black
flake8
isort
changedir = {toxinidir}
commands =
black .
isort --profile=black --lines-after-import=2 --combine-as .
flake8 .
skip_install = true
| Add Django 4.0a1 to the CI matrix | Add Django 4.0a1 to the CI matrix
| INI | bsd-3-clause | feincms/form_designer,feincms/form_designer | ini | ## Code Before:
[tox]
envlist =
py{36,37,38,39}-dj{22,30,31,32}
py{38,39}-dj{main}
style
[testenv]
usedevelop = true
extras = tests
commands =
python -Wd {envbindir}/coverage run tests/manage.py test -v2 --keepdb {posargs:testapp}
coverage report -m
deps =
dj22: Django>=2.2,<3.0
dj30: Django>=3.0,<3.1
dj31: Django>=3.1,<3.2
dj32: Django>=3.2a1,<4.0
djmain: https://github.com/django/django/archive/main.tar.gz
[testenv:style]
deps =
black
flake8
isort
changedir = {toxinidir}
commands =
black .
isort --profile=black --lines-after-import=2 --combine-as .
flake8 .
skip_install = true
## Instruction:
Add Django 4.0a1 to the CI matrix
## Code After:
[tox]
envlist =
py{36,37,38,39}-dj{22,30,31,32}
py{38,39}-dj{40,main}
style
[testenv]
usedevelop = true
extras = tests
commands =
python -Wd {envbindir}/coverage run tests/manage.py test -v2 --keepdb {posargs:testapp}
coverage report -m
deps =
dj22: Django>=2.2,<3.0
dj30: Django>=3.0,<3.1
dj31: Django>=3.1,<3.2
dj32: Django>=3.2,<4.0
dj40: Django>=4.0a1,<4.1
djmain: https://github.com/django/django/archive/main.tar.gz
[testenv:style]
deps =
black
flake8
isort
changedir = {toxinidir}
commands =
black .
isort --profile=black --lines-after-import=2 --combine-as .
flake8 .
skip_install = true
|
17514b14e9b4bddacc72dcb6fe273e93f74523af | Libraries/Http/native_method_type_info.txt | Libraries/Http/native_method_type_info.txt | bool _lib_graphicstext_loadFont(bool isSystemFont, string fontNameOrPath, int id);
void _lib_http_getResponseBytes(object obj, Array<Value> intCache, List<Value> list);
bool _lib_http_pollRequest(Array<object> objArray);
void _lib_http_readResponseData(object nativeRequestObject, Array<int> intOut, Array<string> stringOut, Array<object> objOut, List<string> headerPairs);
void _lib_http_sendRequestAsynchronous(Array<object> objArray, string method, string url, List<string> headers, int objectState, object bodyStringOrBytes, bool getResponseAsText);
bool _lib_http_sendRequestSynchronous(Array<object> objArray, string method, string url, List<string> headers, int objectState, object bodyStringOrBytes, bool getResponseAsText, int executionContextId);
| void _lib_http_getResponseBytes(object obj, Array<Value> intCache, List<Value> list);
bool _lib_http_pollRequest(Array<object> objArray);
void _lib_http_readResponseData(object nativeRequestObject, Array<int> intOut, Array<string> stringOut, Array<object> objOut, List<string> headerPairs);
void _lib_http_sendRequestAsynchronous(Array<object> objArray, string method, string url, List<string> headers, int objectState, object bodyStringOrBytes, bool getResponseAsText);
bool _lib_http_sendRequestSynchronous(Array<object> objArray, string method, string url, List<string> headers, int objectState, object bodyStringOrBytes, bool getResponseAsText, int executionContextId);
| Remove stray function type definition in the HTTP library, likely a copy-and-paste artifact at some point. | Remove stray function type definition in the HTTP library, likely a copy-and-paste artifact at some point.
| Text | mit | blakeohare/crayon,blakeohare/crayon,blakeohare/crayon,blakeohare/crayon,blakeohare/crayon,blakeohare/crayon,blakeohare/crayon,blakeohare/crayon | text | ## Code Before:
bool _lib_graphicstext_loadFont(bool isSystemFont, string fontNameOrPath, int id);
void _lib_http_getResponseBytes(object obj, Array<Value> intCache, List<Value> list);
bool _lib_http_pollRequest(Array<object> objArray);
void _lib_http_readResponseData(object nativeRequestObject, Array<int> intOut, Array<string> stringOut, Array<object> objOut, List<string> headerPairs);
void _lib_http_sendRequestAsynchronous(Array<object> objArray, string method, string url, List<string> headers, int objectState, object bodyStringOrBytes, bool getResponseAsText);
bool _lib_http_sendRequestSynchronous(Array<object> objArray, string method, string url, List<string> headers, int objectState, object bodyStringOrBytes, bool getResponseAsText, int executionContextId);
## Instruction:
Remove stray function type definition in the HTTP library, likely a copy-and-paste artifact at some point.
## Code After:
void _lib_http_getResponseBytes(object obj, Array<Value> intCache, List<Value> list);
bool _lib_http_pollRequest(Array<object> objArray);
void _lib_http_readResponseData(object nativeRequestObject, Array<int> intOut, Array<string> stringOut, Array<object> objOut, List<string> headerPairs);
void _lib_http_sendRequestAsynchronous(Array<object> objArray, string method, string url, List<string> headers, int objectState, object bodyStringOrBytes, bool getResponseAsText);
bool _lib_http_sendRequestSynchronous(Array<object> objArray, string method, string url, List<string> headers, int objectState, object bodyStringOrBytes, bool getResponseAsText, int executionContextId);
|
ecf61fcd79817c0396292faf75fd72b50728171c | es6.js | es6.js | 'use strict';
const path = require('path');
/*
* ECMAScript 6
*/
module.exports = {
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
ecmaFeatures: {
experimentalObjectRestSpread: true
}
},
rules: {
'arrow-body-style': [
'error',
'as-needed',
{
requireReturnForObjectLiteral: true
}
],
'arrow-parens': ['error', 'as-needed'],
'arrow-spacing': [
'error',
{
before: true,
after: true
}
],
'generator-star-spacing': ['error', 'after'],
'no-confusing-arrow': [
'warn',
{
allowParens: true
}
],
'no-duplicate-imports': 'error',
'no-var': 'error',
'object-shorthand': [
'error',
'always',
{
avoidQuotes: true
}
],
'prefer-spread': 'warn',
'prefer-template': 'error'
},
env: {
es6: true
},
extends: path.resolve(__dirname, './index.js')
};
| 'use strict';
const path = require('path');
/*
* ECMAScript 6
*/
module.exports = {
extends: path.resolve(__dirname, './index.js'),
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
ecmaFeatures: {
experimentalObjectRestSpread: true
}
},
env: {
es6: true
},
rules: {
'arrow-body-style': [
'error',
'as-needed',
{
requireReturnForObjectLiteral: true
}
],
'arrow-parens': ['error', 'as-needed'],
'arrow-spacing': [
'error',
{
before: true,
after: true
}
],
'generator-star-spacing': ['error', 'after'],
'no-confusing-arrow': [
'warn',
{
allowParens: true
}
],
'no-duplicate-imports': 'error',
'no-var': 'error',
'object-shorthand': [
'error',
'always',
{
avoidQuotes: true
}
],
'prefer-spread': 'warn',
'prefer-template': 'error'
}
};
| Move `extends` and `env` up | :recycle: Move `extends` and `env` up
| JavaScript | mit | gluons/eslint-config-gluons,gluons/eslint-config-gluons | javascript | ## Code Before:
'use strict';
const path = require('path');
/*
* ECMAScript 6
*/
module.exports = {
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
ecmaFeatures: {
experimentalObjectRestSpread: true
}
},
rules: {
'arrow-body-style': [
'error',
'as-needed',
{
requireReturnForObjectLiteral: true
}
],
'arrow-parens': ['error', 'as-needed'],
'arrow-spacing': [
'error',
{
before: true,
after: true
}
],
'generator-star-spacing': ['error', 'after'],
'no-confusing-arrow': [
'warn',
{
allowParens: true
}
],
'no-duplicate-imports': 'error',
'no-var': 'error',
'object-shorthand': [
'error',
'always',
{
avoidQuotes: true
}
],
'prefer-spread': 'warn',
'prefer-template': 'error'
},
env: {
es6: true
},
extends: path.resolve(__dirname, './index.js')
};
## Instruction:
:recycle: Move `extends` and `env` up
## Code After:
'use strict';
const path = require('path');
/*
* ECMAScript 6
*/
module.exports = {
extends: path.resolve(__dirname, './index.js'),
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
ecmaFeatures: {
experimentalObjectRestSpread: true
}
},
env: {
es6: true
},
rules: {
'arrow-body-style': [
'error',
'as-needed',
{
requireReturnForObjectLiteral: true
}
],
'arrow-parens': ['error', 'as-needed'],
'arrow-spacing': [
'error',
{
before: true,
after: true
}
],
'generator-star-spacing': ['error', 'after'],
'no-confusing-arrow': [
'warn',
{
allowParens: true
}
],
'no-duplicate-imports': 'error',
'no-var': 'error',
'object-shorthand': [
'error',
'always',
{
avoidQuotes: true
}
],
'prefer-spread': 'warn',
'prefer-template': 'error'
}
};
|
d1e345a13ca28825b672aa8e75e9f5d0f48be1bd | overseer.c | overseer.c | // vim: sw=4 ts=4 et filetype=c
#include <stdio.h>
#include <stdlib.h>
#include "overseer.h"
#include "iface_lcd.h"
#include "iface_uart.h"
#include "iface_w1_gpio.h"
int main()
{
sensor_t *sensor_array = malloc(SENSOR_ARRAY_LENGTH * sizeof(*sensor_array));
size_t actualsize = getSensorList(sensor_array);
char outbuf[16];
(void)uartInit();
lcdClear();
int i = 0;
for (i = 0; i < (int)actualsize; i++)
{
printf("Sensor %d (%s) = %g degrees C\n",
i, sensor_array[i].filename, sensor_array[i].reading);
snprintf(outbuf, 16, "s%d = %3.1f", i, sensor_array[i].reading);
lcdWrite(outbuf);
}
return 0;
}
| // vim: sw=4 ts=4 et filetype=c
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "overseer.h"
#include "iface_lcd.h"
#include "iface_uart.h"
#include "iface_w1_gpio.h"
int main()
{
sensor_t *sensor_array = malloc(SENSOR_ARRAY_LENGTH * sizeof(*sensor_array));
size_t actualsize = getSensorList(sensor_array);
char outbuf[16];
int i = 0;
time_t t;
struct tm *tmp;
// Initialize the display
(void)uartInit();
lcdClear();
// Produce a hunk of output for munin
for (i = 0; i < (int)actualsize; i++)
{
printf("sensor_%s.value %g\n",
sensor_array[i].filename, sensor_array[i].reading);
}
// Output the current time to the display
t = time(NULL);
tmp = localtime(&t);
if (tmp == NULL)
{
snprintf(outbuf, 16, "Time: NULL");
}
else if (strftime(outbuf, 16, "%a %H:%M", tmp) == 0)
{
snprintf(outbuf, 16, "Time: INVALID");
}
lcdWrite(outbuf);
// Output two temperatures to the display
if((int)actualsize > 1)
{
snprintf(outbuf, 16, "0=%3.1f 1=%3.1f",
sensor_array[0].reading, sensor_array[1].reading);
}
else if((int)actualsize > 0)
{
snprintf(outbuf, 16, "Temp: %3.1f", sensor_array[0].reading);
}
else
{
snprintf(outbuf, 16, "NO DATA");
}
lcdWrite(outbuf);
return 0;
}
| Adjust output to LCD and console | Adjust output to LCD and console
Better kitchen usefulness w/ a timestamp.
Also munin support!
| C | mit | rtucker/raspi-fridge-overseer,rtucker/raspi-fridge-overseer | c | ## Code Before:
// vim: sw=4 ts=4 et filetype=c
#include <stdio.h>
#include <stdlib.h>
#include "overseer.h"
#include "iface_lcd.h"
#include "iface_uart.h"
#include "iface_w1_gpio.h"
int main()
{
sensor_t *sensor_array = malloc(SENSOR_ARRAY_LENGTH * sizeof(*sensor_array));
size_t actualsize = getSensorList(sensor_array);
char outbuf[16];
(void)uartInit();
lcdClear();
int i = 0;
for (i = 0; i < (int)actualsize; i++)
{
printf("Sensor %d (%s) = %g degrees C\n",
i, sensor_array[i].filename, sensor_array[i].reading);
snprintf(outbuf, 16, "s%d = %3.1f", i, sensor_array[i].reading);
lcdWrite(outbuf);
}
return 0;
}
## Instruction:
Adjust output to LCD and console
Better kitchen usefulness w/ a timestamp.
Also munin support!
## Code After:
// vim: sw=4 ts=4 et filetype=c
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "overseer.h"
#include "iface_lcd.h"
#include "iface_uart.h"
#include "iface_w1_gpio.h"
int main()
{
sensor_t *sensor_array = malloc(SENSOR_ARRAY_LENGTH * sizeof(*sensor_array));
size_t actualsize = getSensorList(sensor_array);
char outbuf[16];
int i = 0;
time_t t;
struct tm *tmp;
// Initialize the display
(void)uartInit();
lcdClear();
// Produce a hunk of output for munin
for (i = 0; i < (int)actualsize; i++)
{
printf("sensor_%s.value %g\n",
sensor_array[i].filename, sensor_array[i].reading);
}
// Output the current time to the display
t = time(NULL);
tmp = localtime(&t);
if (tmp == NULL)
{
snprintf(outbuf, 16, "Time: NULL");
}
else if (strftime(outbuf, 16, "%a %H:%M", tmp) == 0)
{
snprintf(outbuf, 16, "Time: INVALID");
}
lcdWrite(outbuf);
// Output two temperatures to the display
if((int)actualsize > 1)
{
snprintf(outbuf, 16, "0=%3.1f 1=%3.1f",
sensor_array[0].reading, sensor_array[1].reading);
}
else if((int)actualsize > 0)
{
snprintf(outbuf, 16, "Temp: %3.1f", sensor_array[0].reading);
}
else
{
snprintf(outbuf, 16, "NO DATA");
}
lcdWrite(outbuf);
return 0;
}
|
009bb0f4c07ff18b7e0b29bb9410face0a384680 | src/actions/options.js | src/actions/options.js | import {
SET_SPEED,
SET_PAUSE,
SET_PAUSE_HOVER,
SET_FALLOFF,
SET_RADII_SCALE,
SET_BOUNCE_BODIES,
SET_BOUNCE_SCREEN,
} from './types'
export function speed(s) {
return {
type: SET_SPEED,
speed: s,
}
}
export function pause(pause) {
return {
type: SET_PAUSE,
paused: pause,
}
}
export function pauseHover(pause) {
return {
type: SET_PAUSE_HOVER,
pauseHover: pause,
}
}
export function falloff(f) {
return {
type: SET_FALLOFF,
falloff: f,
}
}
export function radiiScale(scale) {
return {
type: SET_RADII_SCALE,
radiiScale: scale,
}
}
export function bounceBodies(b) {
return {
type: SET_BOUNCE_BODIES,
bounceBodies: b,
}
}
export function bounceScreen(b) {
return {
type: SET_BOUNCE_SCREEN,
bounceScreen: b,
}
}
| import {
SET_SPEED,
SET_PAUSE,
SET_PAUSE_HOVER,
SET_FALLOFF,
SET_RADII_SCALE,
SET_BOUNCE_BODIES,
SET_BOUNCE_SCREEN,
} from './types'
export function speed(speed) {
return {
type: SET_SPEED,
speed,
}
}
export function pause(paused) {
return {
type: SET_PAUSE,
paused,
}
}
export function pauseHover(pauseHover) {
return {
type: SET_PAUSE_HOVER,
pauseHover,
}
}
export function falloff(falloff) {
return {
type: SET_FALLOFF,
falloff,
}
}
export function radiiScale(radiiScale) {
return {
type: SET_RADII_SCALE,
radiiScale,
}
}
export function bounceBodies(bounceBodies) {
return {
type: SET_BOUNCE_BODIES,
bounceBodies,
}
}
export function bounceScreen(bounceScreen) {
return {
type: SET_BOUNCE_SCREEN,
bounceScreen,
}
}
| Clean up option action creators | Clean up option action creators
| JavaScript | mit | JohnTasto/EverythingIsFalling,JohnTasto/EverythingIsFalling | javascript | ## Code Before:
import {
SET_SPEED,
SET_PAUSE,
SET_PAUSE_HOVER,
SET_FALLOFF,
SET_RADII_SCALE,
SET_BOUNCE_BODIES,
SET_BOUNCE_SCREEN,
} from './types'
export function speed(s) {
return {
type: SET_SPEED,
speed: s,
}
}
export function pause(pause) {
return {
type: SET_PAUSE,
paused: pause,
}
}
export function pauseHover(pause) {
return {
type: SET_PAUSE_HOVER,
pauseHover: pause,
}
}
export function falloff(f) {
return {
type: SET_FALLOFF,
falloff: f,
}
}
export function radiiScale(scale) {
return {
type: SET_RADII_SCALE,
radiiScale: scale,
}
}
export function bounceBodies(b) {
return {
type: SET_BOUNCE_BODIES,
bounceBodies: b,
}
}
export function bounceScreen(b) {
return {
type: SET_BOUNCE_SCREEN,
bounceScreen: b,
}
}
## Instruction:
Clean up option action creators
## Code After:
import {
SET_SPEED,
SET_PAUSE,
SET_PAUSE_HOVER,
SET_FALLOFF,
SET_RADII_SCALE,
SET_BOUNCE_BODIES,
SET_BOUNCE_SCREEN,
} from './types'
export function speed(speed) {
return {
type: SET_SPEED,
speed,
}
}
export function pause(paused) {
return {
type: SET_PAUSE,
paused,
}
}
export function pauseHover(pauseHover) {
return {
type: SET_PAUSE_HOVER,
pauseHover,
}
}
export function falloff(falloff) {
return {
type: SET_FALLOFF,
falloff,
}
}
export function radiiScale(radiiScale) {
return {
type: SET_RADII_SCALE,
radiiScale,
}
}
export function bounceBodies(bounceBodies) {
return {
type: SET_BOUNCE_BODIES,
bounceBodies,
}
}
export function bounceScreen(bounceScreen) {
return {
type: SET_BOUNCE_SCREEN,
bounceScreen,
}
}
|
586a8129f7fecb97fd123d75863a197edc95bb37 | usr/vendor/genivi/pkg/persistence-client-library.lua | usr/vendor/genivi/pkg/persistence-client-library.lua | return {
source = {
type = 'git',
location = 'https://github.com/GENIVI/persistence-client-library.git',
branch = 'v1.1.0',
},
build = {
type = 'GNU',
autoreconf = true,
in_source = true
},
requires = {
'dbus',
'persistence-common-object',
}
}
| return {
source = {
type = 'git',
location = 'https://github.com/GENIVI/persistence-client-library.git',
branch = 'v1.1.0',
},
build = {
type = 'GNU',
autoreconf = true,
in_source = true,
options = {
'--enable-pasinterface'
}
},
requires = {
'dbus',
'persistence-common-object',
}
}
| Add '--enable-pasinterface' to PCL pkg | Add '--enable-pasinterface' to PCL pkg
| Lua | mit | bazurbat/jagen | lua | ## Code Before:
return {
source = {
type = 'git',
location = 'https://github.com/GENIVI/persistence-client-library.git',
branch = 'v1.1.0',
},
build = {
type = 'GNU',
autoreconf = true,
in_source = true
},
requires = {
'dbus',
'persistence-common-object',
}
}
## Instruction:
Add '--enable-pasinterface' to PCL pkg
## Code After:
return {
source = {
type = 'git',
location = 'https://github.com/GENIVI/persistence-client-library.git',
branch = 'v1.1.0',
},
build = {
type = 'GNU',
autoreconf = true,
in_source = true,
options = {
'--enable-pasinterface'
}
},
requires = {
'dbus',
'persistence-common-object',
}
}
|
a5b387cdd4baaa04d205da4a218d1ce8ec637d34 | lib/liquid/interrupts.rb | lib/liquid/interrupts.rb | module Liquid
# An interrupt is any command that breaks processing of a block (ex: a for loop).
class Interrupt
attr_reader :message
def initialize(message = nil)
@message = message || "interrupt".freeze
end
end
# Interrupt that is thrown whenever a {% break %} is called.
class BreakInterrupt < RuntimeError; end
# Interrupt that is thrown whenever a {% continue %} is called.
class ContinueInterrupt < RuntimeError; end
end
| module Liquid
# A block interrupt is any command that breaks processing of a block (ex: a for loop).
class BlockInterrupt
attr_reader :message
def initialize(message = nil)
@message = message || "interrupt".freeze
end
end
# Interrupt that is thrown whenever a {% break %} is called.
class BreakInterrupt < BlockInterrupt; end
# Interrupt that is thrown whenever a {% continue %} is called.
class ContinueInterrupt < BlockInterrupt; end
end
| Remove reserved word Interrupt to avoid confusion | Remove reserved word Interrupt to avoid confusion
Also resolves rubocop conflicts
| Ruby | mit | Shopify/liquid,locomotivecms/liquid | ruby | ## Code Before:
module Liquid
# An interrupt is any command that breaks processing of a block (ex: a for loop).
class Interrupt
attr_reader :message
def initialize(message = nil)
@message = message || "interrupt".freeze
end
end
# Interrupt that is thrown whenever a {% break %} is called.
class BreakInterrupt < RuntimeError; end
# Interrupt that is thrown whenever a {% continue %} is called.
class ContinueInterrupt < RuntimeError; end
end
## Instruction:
Remove reserved word Interrupt to avoid confusion
Also resolves rubocop conflicts
## Code After:
module Liquid
# A block interrupt is any command that breaks processing of a block (ex: a for loop).
class BlockInterrupt
attr_reader :message
def initialize(message = nil)
@message = message || "interrupt".freeze
end
end
# Interrupt that is thrown whenever a {% break %} is called.
class BreakInterrupt < BlockInterrupt; end
# Interrupt that is thrown whenever a {% continue %} is called.
class ContinueInterrupt < BlockInterrupt; end
end
|
8823acb41f9810e07f09ea9fe660deebc657f451 | lib/menus/contextMenu.js | lib/menus/contextMenu.js | 'use babel';
const init = () => {
const copyEnabled = () => atom.config.get('remote-ftp.context.enableCopyFilename');
const contextMenu = {
'.remote-ftp-view .entries.list-tree:not(.multi-select) .directory .header': {
enabled: copyEnabled(),
command: [{
label: 'Copy name',
command: 'remote-ftp:copy-name',
}, {
type: 'separator',
}],
},
'.remote-ftp-view .entries.list-tree:not(.multi-select) .file': {
enabled: copyEnabled(),
command: [{
label: 'Copy filename',
command: 'remote-ftp:copy-name',
}, {
type: 'separator',
}],
},
};
return contextMenu;
};
export default init;
| 'use babel';
const init = () => {
const contextMenu = {
'.remote-ftp-view .entries.list-tree:not(.multi-select) .directory': {
enabled: atom.config.get('remote-ftp.context.enableCopyFilename'),
command: [{
label: 'Copy name',
command: 'remote-ftp:copy-name',
}, {
type: 'separator',
}],
},
'.remote-ftp-view .entries.list-tree:not(.multi-select) .file': {
enabled: atom.config.get('remote-ftp.context.enableCopyFilename'),
command: [{
label: 'Copy filename',
command: 'remote-ftp:copy-name',
}, {
type: 'separator',
}],
},
};
return contextMenu;
};
export default init;
| Fix directory "Copy name" function | Fix directory "Copy name" function
| JavaScript | mit | mgrenier/remote-ftp,icetee/remote-ftp | javascript | ## Code Before:
'use babel';
const init = () => {
const copyEnabled = () => atom.config.get('remote-ftp.context.enableCopyFilename');
const contextMenu = {
'.remote-ftp-view .entries.list-tree:not(.multi-select) .directory .header': {
enabled: copyEnabled(),
command: [{
label: 'Copy name',
command: 'remote-ftp:copy-name',
}, {
type: 'separator',
}],
},
'.remote-ftp-view .entries.list-tree:not(.multi-select) .file': {
enabled: copyEnabled(),
command: [{
label: 'Copy filename',
command: 'remote-ftp:copy-name',
}, {
type: 'separator',
}],
},
};
return contextMenu;
};
export default init;
## Instruction:
Fix directory "Copy name" function
## Code After:
'use babel';
const init = () => {
const contextMenu = {
'.remote-ftp-view .entries.list-tree:not(.multi-select) .directory': {
enabled: atom.config.get('remote-ftp.context.enableCopyFilename'),
command: [{
label: 'Copy name',
command: 'remote-ftp:copy-name',
}, {
type: 'separator',
}],
},
'.remote-ftp-view .entries.list-tree:not(.multi-select) .file': {
enabled: atom.config.get('remote-ftp.context.enableCopyFilename'),
command: [{
label: 'Copy filename',
command: 'remote-ftp:copy-name',
}, {
type: 'separator',
}],
},
};
return contextMenu;
};
export default init;
|
c942ddd009f51e6e115e7dc527dbdab27698a9b2 | Source/Shared/RawRepresentable+SwiftKit.swift | Source/Shared/RawRepresentable+SwiftKit.swift | import Foundation
/// Extension that enables enums with a Number raw value to be strideable
public extension RawRepresentable where RawValue: Number {
/// Go to the next member of the enum
public func next() -> Self? {
return Self(rawValue: RawValue(self.rawValue.toDouble() + 1))
}
/// Go to the member that corresponds to the current raw value advanced by n
public func advancedBy(n: RawValue) -> Self? {
return Self(rawValue: RawValue(self.rawValue + n))
}
}
| import Foundation
/// SwiftKit extensions to Number-based enums
public extension RawRepresentable where RawValue: Number, Self:Hashable {
/// Iterate through each member of this enum (see EnumIterator for more options)
public static func forEach(closure: Self -> Void) {
EnumIterator.iterate(closure)
}
/// Go to the next member of the enum
public func next() -> Self? {
return Self(rawValue: RawValue(self.rawValue.toDouble() + 1))
}
/// Go to the member that corresponds to the current raw value advanced by n
public func advancedBy(n: RawValue) -> Self? {
return Self(rawValue: RawValue(self.rawValue + n))
}
}
| Add convenience forEach iterator to RawRepresentable extension | Add convenience forEach iterator to RawRepresentable extension | Swift | mit | JohnSundell/SwiftKit | swift | ## Code Before:
import Foundation
/// Extension that enables enums with a Number raw value to be strideable
public extension RawRepresentable where RawValue: Number {
/// Go to the next member of the enum
public func next() -> Self? {
return Self(rawValue: RawValue(self.rawValue.toDouble() + 1))
}
/// Go to the member that corresponds to the current raw value advanced by n
public func advancedBy(n: RawValue) -> Self? {
return Self(rawValue: RawValue(self.rawValue + n))
}
}
## Instruction:
Add convenience forEach iterator to RawRepresentable extension
## Code After:
import Foundation
/// SwiftKit extensions to Number-based enums
public extension RawRepresentable where RawValue: Number, Self:Hashable {
/// Iterate through each member of this enum (see EnumIterator for more options)
public static func forEach(closure: Self -> Void) {
EnumIterator.iterate(closure)
}
/// Go to the next member of the enum
public func next() -> Self? {
return Self(rawValue: RawValue(self.rawValue.toDouble() + 1))
}
/// Go to the member that corresponds to the current raw value advanced by n
public func advancedBy(n: RawValue) -> Self? {
return Self(rawValue: RawValue(self.rawValue + n))
}
}
|
d668f65c3b7c8096d73452bb9b1ad764c17e7678 | circle.yml | circle.yml | machine:
environment:
GO15VENDOREXPERIMENT: 1
PROJECT_PATH: ${GOPATH%%:*}/src/github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME
pre:
- wget https://storage.googleapis.com/golang/go1.5.2.linux-amd64.tar.gz
- sudo rm -rf /usr/local/go
- sudo tar -C /usr/local -xzf go1.5.2.linux-amd64.tar.gz
post:
- ln -sf ~/${CIRCLE_PROJECT_REPONAME} $PROJECT_PATH
dependencies:
cache_directories:
- ~/go1.5.2.linux-amd64.tar.gz
override:
- go get github.com/jteeuwen/go-bindata/...
- cd $PROJECT_PATH/frontend && npm install
- cd $PROJECT_PATH/frontend && grunt build
- cd $PROJECT_PATH && go-bindata -o frontend.go -prefix "frontend/dist/" frontend/dist/...
- cd $PROJECT_PATH && go build -v
test:
override:
- go version
- cd $PROJECT_PATH/frontend && grunt test
- cd $PROJECT_PATH && go test -v $(go list ./... | grep -v /vendor/)
| machine:
environment:
GO15VENDOREXPERIMENT: 1
PROJECT_PATH: ${GOPATH%%:*}/src/github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME
pre:
- wget https://storage.googleapis.com/golang/go1.5.2.linux-amd64.tar.gz
- sudo rm -rf /usr/local/go
- sudo tar -C /usr/local -xzf go1.5.2.linux-amd64.tar.gz
post:
- ln -sf ~/${CIRCLE_PROJECT_REPONAME} $PROJECT_PATH
dependencies:
cache_directories:
- ~/go1.5.2.linux-amd64.tar.gz
override:
- go get github.com/jteeuwen/go-bindata/...
- cd $PROJECT_PATH/frontend && npm install
- cd $PROJECT_PATH/frontend && grunt build
- cd $PROJECT_PATH && go-bindata -o frontend.go -prefix "frontend/dist/" frontend/dist/...
- cd $PROJECT_PATH && go build -v
test:
override:
- go version
- cd $PROJECT_PATH/frontend && grunt test
- cd $PROJECT_PATH && go vet $(go list ./... | grep -v /vendor/)
- cd $PROJECT_PATH && go test -v $(go list ./... | grep -v /vendor/) -race
| Use race checking and go vet | Use race checking and go vet
To identify issues.
| YAML | mit | zefer/mothership,zefer/mothership,zefer/mothership,zefer/mothership | yaml | ## Code Before:
machine:
environment:
GO15VENDOREXPERIMENT: 1
PROJECT_PATH: ${GOPATH%%:*}/src/github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME
pre:
- wget https://storage.googleapis.com/golang/go1.5.2.linux-amd64.tar.gz
- sudo rm -rf /usr/local/go
- sudo tar -C /usr/local -xzf go1.5.2.linux-amd64.tar.gz
post:
- ln -sf ~/${CIRCLE_PROJECT_REPONAME} $PROJECT_PATH
dependencies:
cache_directories:
- ~/go1.5.2.linux-amd64.tar.gz
override:
- go get github.com/jteeuwen/go-bindata/...
- cd $PROJECT_PATH/frontend && npm install
- cd $PROJECT_PATH/frontend && grunt build
- cd $PROJECT_PATH && go-bindata -o frontend.go -prefix "frontend/dist/" frontend/dist/...
- cd $PROJECT_PATH && go build -v
test:
override:
- go version
- cd $PROJECT_PATH/frontend && grunt test
- cd $PROJECT_PATH && go test -v $(go list ./... | grep -v /vendor/)
## Instruction:
Use race checking and go vet
To identify issues.
## Code After:
machine:
environment:
GO15VENDOREXPERIMENT: 1
PROJECT_PATH: ${GOPATH%%:*}/src/github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME
pre:
- wget https://storage.googleapis.com/golang/go1.5.2.linux-amd64.tar.gz
- sudo rm -rf /usr/local/go
- sudo tar -C /usr/local -xzf go1.5.2.linux-amd64.tar.gz
post:
- ln -sf ~/${CIRCLE_PROJECT_REPONAME} $PROJECT_PATH
dependencies:
cache_directories:
- ~/go1.5.2.linux-amd64.tar.gz
override:
- go get github.com/jteeuwen/go-bindata/...
- cd $PROJECT_PATH/frontend && npm install
- cd $PROJECT_PATH/frontend && grunt build
- cd $PROJECT_PATH && go-bindata -o frontend.go -prefix "frontend/dist/" frontend/dist/...
- cd $PROJECT_PATH && go build -v
test:
override:
- go version
- cd $PROJECT_PATH/frontend && grunt test
- cd $PROJECT_PATH && go vet $(go list ./... | grep -v /vendor/)
- cd $PROJECT_PATH && go test -v $(go list ./... | grep -v /vendor/) -race
|
92bfaafe806b6f2fdd1fca3fdb6fbe591dc02305 | README.rst | README.rst | ==============================
Redis cache backend for Django
==============================
Full featured redis cache backend for Django.
.. image:: https://travis-ci.org/niwibe/django-redis.png?branch=master
:target: https://travis-ci.org/niwibe/django-redis
.. image:: https://pypip.in/v/django-redis/badge.png
:target: https://crate.io/packages/django-redis
.. image:: https://pypip.in/d/django-redis/badge.png
:target: https://crate.io/packages/django-redis
Documentation
-------------
Read the Docs: https://django-redis.readthedocs.org/en/latest/
How to install
--------------
Run ``python setup.py install`` to install,
or place ``redis_cache`` on your Python path.
You can also install it with: ``pip install django-redis``
.. image:: https://d2weczhvl823v0.cloudfront.net/niwibe/django-redis/trend.png
:alt: Bitdeli badge
:target: https://bitdeli.com/free
| ==============================
Redis cache backend for Django
==============================
Full featured redis cache backend for Django.
.. image:: https://travis-ci.org/niwibe/django-redis.png?branch=master
:target: https://travis-ci.org/niwibe/django-redis
.. image:: https://pypip.in/v/django-redis/badge.png
:target: https://crate.io/packages/django-redis
.. image:: https://pypip.in/d/django-redis/badge.png
:target: https://crate.io/packages/django-redis
Documentation
-------------
http://niwibe.github.io/django-redis/
How to install
--------------
Run ``python setup.py install`` to install,
or place ``redis_cache`` on your Python path.
You can also install it with: ``pip install django-redis``
.. image:: https://d2weczhvl823v0.cloudfront.net/niwibe/django-redis/trend.png
:alt: Bitdeli badge
:target: https://bitdeli.com/free
| Update documentation url on readme. | Update documentation url on readme.
| reStructuredText | bsd-3-clause | GetAmbassador/django-redis,lucius-feng/django-redis,yanheng/django-redis,zl352773277/django-redis,smahs/django-redis | restructuredtext | ## Code Before:
==============================
Redis cache backend for Django
==============================
Full featured redis cache backend for Django.
.. image:: https://travis-ci.org/niwibe/django-redis.png?branch=master
:target: https://travis-ci.org/niwibe/django-redis
.. image:: https://pypip.in/v/django-redis/badge.png
:target: https://crate.io/packages/django-redis
.. image:: https://pypip.in/d/django-redis/badge.png
:target: https://crate.io/packages/django-redis
Documentation
-------------
Read the Docs: https://django-redis.readthedocs.org/en/latest/
How to install
--------------
Run ``python setup.py install`` to install,
or place ``redis_cache`` on your Python path.
You can also install it with: ``pip install django-redis``
.. image:: https://d2weczhvl823v0.cloudfront.net/niwibe/django-redis/trend.png
:alt: Bitdeli badge
:target: https://bitdeli.com/free
## Instruction:
Update documentation url on readme.
## Code After:
==============================
Redis cache backend for Django
==============================
Full featured redis cache backend for Django.
.. image:: https://travis-ci.org/niwibe/django-redis.png?branch=master
:target: https://travis-ci.org/niwibe/django-redis
.. image:: https://pypip.in/v/django-redis/badge.png
:target: https://crate.io/packages/django-redis
.. image:: https://pypip.in/d/django-redis/badge.png
:target: https://crate.io/packages/django-redis
Documentation
-------------
http://niwibe.github.io/django-redis/
How to install
--------------
Run ``python setup.py install`` to install,
or place ``redis_cache`` on your Python path.
You can also install it with: ``pip install django-redis``
.. image:: https://d2weczhvl823v0.cloudfront.net/niwibe/django-redis/trend.png
:alt: Bitdeli badge
:target: https://bitdeli.com/free
|
2d7da7b416b460aaa646e6662a622990bda1a07b | src/components/services/ConfigService.js | src/components/services/ConfigService.js | (function() {
'use strict';
angular.module('civic.services')
.constant('ConfigService', {
serverUrl: 'http://localhost:3000/',
mainMenuItems: [
{
label: 'Collaborate',
state: 'collaborate'
},
{
label: 'Help',
state: 'help'
},
{
label: 'Contact',
state: 'contact'
}
]
}
);
})();
| (function() {
'use strict';
angular.module('civic.services')
.constant('ConfigService', {
serverUrl: 'http://localhost:3000/',
mainMenuItems: [
{
label: 'Collaborate',
state: 'collaborate'
},
{
label: 'Help',
state: 'help'
},
{
label: 'FAQ',
state: 'faq'
}
]
}
);
})();
| Replace the Contact page with the FAQ page | Replace the Contact page with the FAQ page
| JavaScript | mit | yanyangfeng/civic-client,yanyangfeng/civic-client,genome/civic-client,genome/civic-client | javascript | ## Code Before:
(function() {
'use strict';
angular.module('civic.services')
.constant('ConfigService', {
serverUrl: 'http://localhost:3000/',
mainMenuItems: [
{
label: 'Collaborate',
state: 'collaborate'
},
{
label: 'Help',
state: 'help'
},
{
label: 'Contact',
state: 'contact'
}
]
}
);
})();
## Instruction:
Replace the Contact page with the FAQ page
## Code After:
(function() {
'use strict';
angular.module('civic.services')
.constant('ConfigService', {
serverUrl: 'http://localhost:3000/',
mainMenuItems: [
{
label: 'Collaborate',
state: 'collaborate'
},
{
label: 'Help',
state: 'help'
},
{
label: 'FAQ',
state: 'faq'
}
]
}
);
})();
|
19d19ae0a8c783457f9a88266fecabdf8e9eac00 | demo.js | demo.js | var cluster = require('cluster');
/**
* The clustering stuff is courtesy of Rowan Manning
* http://rowanmanning.com/posts/node-cluster-and-express/
* 2014-2-28
*/
if (cluster.isMaster) {
require('strong-cluster-express-store').setup();
// Count the machine's CPUs
var cpuCount = require('os').cpus().length;
// Create a worker for each CPU
for (var i = 0; i < cpuCount; i += 1) {
cluster.fork();
}
// Listen for dying workers
cluster.on('exit', function (worker) {
// Replace the dead worker,
// we're not sentimental
console.log('Worker ' + worker.id + ' died :(');
cluster.fork();
});
}
else {
/**
* Run node demo.js
*/
var gebo = require('./index')();
gebo.start();
console.log('Worker ' + cluster.worker.id + ' running!');
}
| var cluster = require('cluster'),
nconf = require('nconf'),
winston = require('winston');
nconf.file({ file: './gebo.json' });
var logLevel = nconf.get('logLevel');
var logger = new (winston.Logger)({ transports: [ new (winston.transports.Console)({ colorize: true }) ] });
/**
* The clustering stuff is courtesy of Rowan Manning
* http://rowanmanning.com/posts/node-cluster-and-express/
* 2014-2-28
*/
if (cluster.isMaster) {
require('strong-cluster-express-store').setup();
// Count the machine's CPUs
var cpuCount = require('os').cpus().length;
// Create a worker for each CPU
for (var i = 0; i < cpuCount; i += 1) {
cluster.fork();
}
// Listen for dying workers
cluster.on('exit', function (worker) {
// Replace the dead worker,
// we're not sentimental
if (logLevel === 'trace') logger.warn('Worker ' + worker.id + ' died :(');
cluster.fork();
});
}
else {
/**
* Run node demo.js
*/
var gebo = require('./index')();
gebo.start();
if (logLevel === 'trace') logger.info('Worker ' + cluster.worker.id + ' running!');
}
| Deploy logger and log levels | Deploy logger and log levels
| JavaScript | mit | RaphaelDeLaGhetto/gebo-server,RaphaelDeLaGhetto/gebo-server | javascript | ## Code Before:
var cluster = require('cluster');
/**
* The clustering stuff is courtesy of Rowan Manning
* http://rowanmanning.com/posts/node-cluster-and-express/
* 2014-2-28
*/
if (cluster.isMaster) {
require('strong-cluster-express-store').setup();
// Count the machine's CPUs
var cpuCount = require('os').cpus().length;
// Create a worker for each CPU
for (var i = 0; i < cpuCount; i += 1) {
cluster.fork();
}
// Listen for dying workers
cluster.on('exit', function (worker) {
// Replace the dead worker,
// we're not sentimental
console.log('Worker ' + worker.id + ' died :(');
cluster.fork();
});
}
else {
/**
* Run node demo.js
*/
var gebo = require('./index')();
gebo.start();
console.log('Worker ' + cluster.worker.id + ' running!');
}
## Instruction:
Deploy logger and log levels
## Code After:
var cluster = require('cluster'),
nconf = require('nconf'),
winston = require('winston');
nconf.file({ file: './gebo.json' });
var logLevel = nconf.get('logLevel');
var logger = new (winston.Logger)({ transports: [ new (winston.transports.Console)({ colorize: true }) ] });
/**
* The clustering stuff is courtesy of Rowan Manning
* http://rowanmanning.com/posts/node-cluster-and-express/
* 2014-2-28
*/
if (cluster.isMaster) {
require('strong-cluster-express-store').setup();
// Count the machine's CPUs
var cpuCount = require('os').cpus().length;
// Create a worker for each CPU
for (var i = 0; i < cpuCount; i += 1) {
cluster.fork();
}
// Listen for dying workers
cluster.on('exit', function (worker) {
// Replace the dead worker,
// we're not sentimental
if (logLevel === 'trace') logger.warn('Worker ' + worker.id + ' died :(');
cluster.fork();
});
}
else {
/**
* Run node demo.js
*/
var gebo = require('./index')();
gebo.start();
if (logLevel === 'trace') logger.info('Worker ' + cluster.worker.id + ' running!');
}
|
26f02ee1d137d48aa51b17d9ab34a2cf569c471d | app/scripts/app.js | app/scripts/app.js | 'use strict';
var etcdApp = angular.module('etcdApp', ['ngRoute', 'etcdResource', 'timeRelative'])
.config(['$routeProvider', function ($routeProvider) {
//read localstorage
var previous_path = localStorage.getItem('etcd_path');
if(previous_path != null) {
var redirect_path = previous_path
} else {
var redirect_path = '/v1/keys/';
}
$routeProvider
.when('/', {
redirectTo: redirect_path
})
.otherwise({
templateUrl: 'views/main.html',
controller: 'MainCtrl'
});
}]);
| 'use strict';
var etcdApp = angular.module('etcdApp', ['ngRoute', 'etcdResource', 'timeRelative'])
.config(['$routeProvider', function ($routeProvider) {
//read localstorage
var previous_path = localStorage.getItem('etcd_path');
if(previous_path != null && previous_path.indexOf('/v1/keys/') !== -1) {
var redirect_path = previous_path
} else {
var redirect_path = '/v1/keys/';
}
$routeProvider
.when('/', {
redirectTo: redirect_path
})
.otherwise({
templateUrl: 'views/main.html',
controller: 'MainCtrl'
});
}]);
| Use localstorage location only if it is valid | Use localstorage location only if it is valid
| JavaScript | apache-2.0 | philips/nya | javascript | ## Code Before:
'use strict';
var etcdApp = angular.module('etcdApp', ['ngRoute', 'etcdResource', 'timeRelative'])
.config(['$routeProvider', function ($routeProvider) {
//read localstorage
var previous_path = localStorage.getItem('etcd_path');
if(previous_path != null) {
var redirect_path = previous_path
} else {
var redirect_path = '/v1/keys/';
}
$routeProvider
.when('/', {
redirectTo: redirect_path
})
.otherwise({
templateUrl: 'views/main.html',
controller: 'MainCtrl'
});
}]);
## Instruction:
Use localstorage location only if it is valid
## Code After:
'use strict';
var etcdApp = angular.module('etcdApp', ['ngRoute', 'etcdResource', 'timeRelative'])
.config(['$routeProvider', function ($routeProvider) {
//read localstorage
var previous_path = localStorage.getItem('etcd_path');
if(previous_path != null && previous_path.indexOf('/v1/keys/') !== -1) {
var redirect_path = previous_path
} else {
var redirect_path = '/v1/keys/';
}
$routeProvider
.when('/', {
redirectTo: redirect_path
})
.otherwise({
templateUrl: 'views/main.html',
controller: 'MainCtrl'
});
}]);
|
faa2a33db55002b687e219c5ddef395d16b56b52 | templates/contrail/contrail-dns.conf.erb | templates/contrail/contrail-dns.conf.erb | [DEFAULT]
rndc_config_file=rndc.conf
rndc_secret=xvysmOR8lnUQRBcunkC6vg==
log_file=/var/log/contrail/contrail-dns.log
log_level=SYS_NOTICE
log_local=1
[DISCOVERY]
server=<%= @discovery_server %>
[IFMAP]
user = <%= @ifmap_username %>
password = <%= @ifmap_password %>
| [DEFAULT]
named_config_file=named.conf
named_config_directory=/etc/contrail/dns
named_log_file=/var/log/named/bind.log
rndc_config_file=rndc.conf
rndc_secret=xvysmOR8lnUQRBcunkC6vg==
log_file=/var/log/contrail/contrail-dns.log
log_level=SYS_NOTICE
log_local=1
[DISCOVERY]
server=<%= @discovery_server %>
[IFMAP]
user = <%= @ifmap_username %>
password = <%= @ifmap_password %>
| Add additional parameters for 2.0 | Add additional parameters for 2.0
| HTML+ERB | apache-2.0 | syseleven/puppet-contrail,syseleven/puppet-contrail,syseleven/puppet-contrail,syseleven/puppet-contrail | html+erb | ## Code Before:
[DEFAULT]
rndc_config_file=rndc.conf
rndc_secret=xvysmOR8lnUQRBcunkC6vg==
log_file=/var/log/contrail/contrail-dns.log
log_level=SYS_NOTICE
log_local=1
[DISCOVERY]
server=<%= @discovery_server %>
[IFMAP]
user = <%= @ifmap_username %>
password = <%= @ifmap_password %>
## Instruction:
Add additional parameters for 2.0
## Code After:
[DEFAULT]
named_config_file=named.conf
named_config_directory=/etc/contrail/dns
named_log_file=/var/log/named/bind.log
rndc_config_file=rndc.conf
rndc_secret=xvysmOR8lnUQRBcunkC6vg==
log_file=/var/log/contrail/contrail-dns.log
log_level=SYS_NOTICE
log_local=1
[DISCOVERY]
server=<%= @discovery_server %>
[IFMAP]
user = <%= @ifmap_username %>
password = <%= @ifmap_password %>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.