commit stringlengths 40 40 | old_file stringlengths 4 184 | new_file stringlengths 4 184 | old_contents stringlengths 1 3.6k | new_contents stringlengths 5 3.38k | subject stringlengths 15 778 | message stringlengths 16 6.74k | lang stringclasses 201 values | license stringclasses 13 values | repos stringlengths 6 116k | config stringclasses 201 values | content stringlengths 137 7.24k | diff stringlengths 26 5.55k | diff_length int64 1 123 | relative_diff_length float64 0.01 89 | n_lines_added int64 0 108 | n_lines_deleted int64 0 106 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e687bf346800891115b869dd1b9f17686960b453 | app/views/api/v1/accounts/show.rabl | app/views/api/v1/accounts/show.rabl | object @account
attributes :id, :username, :acct, :display_name, :locked, :created_at
node(:note) { |account| Formatter.instance.simplified_format(account) }
node(:url) { |account| TagManager.instance.url_for(account) }
node(:avatar) { |account| full_asset_url(account.avatar_original_url) }
node(:avatar_static) { |account| full_asset_url(account.avatar_static_url) }
node(:header) { |account| full_asset_url(account.header_original_url) }
node(:header_static) { |account| full_asset_url(account.header_static_url) }
attributes :followers_count, :following_count, :statuses_count
child :oauth_authentications, object_root: false do
attribute(:uid, :provider)
end
| object @account
attributes :id, :username, :acct, :display_name, :locked, :created_at
node(:note) { |account| Formatter.instance.simplified_format(account) }
node(:url) { |account| TagManager.instance.url_for(account) }
node(:avatar) { |account| full_asset_url(account.avatar_original_url) }
node(:avatar_static) { |account| full_asset_url(account.avatar_static_url) }
node(:header) { |account| full_asset_url(account.header_original_url) }
node(:header_static) { |account| full_asset_url(account.header_static_url) }
node(:media_statuses_count) { |account| account.statuses.select { |status| status.media_attachments.present? }.size }
attributes :followers_count, :following_count, :statuses_count
child :oauth_authentications, object_root: false do
attribute(:uid, :provider)
end
| Add media_statuses_count field in api/v1/accounts/:id | Add media_statuses_count field in api/v1/accounts/:id
| Ruby | agpl-3.0 | pixiv/mastodon,pixiv/mastodon,pixiv/mastodon,pixiv/mastodon | ruby | ## Code Before:
object @account
attributes :id, :username, :acct, :display_name, :locked, :created_at
node(:note) { |account| Formatter.instance.simplified_format(account) }
node(:url) { |account| TagManager.instance.url_for(account) }
node(:avatar) { |account| full_asset_url(account.avatar_original_url) }
node(:avatar_static) { |account| full_asset_url(account.avatar_static_url) }
node(:header) { |account| full_asset_url(account.header_original_url) }
node(:header_static) { |account| full_asset_url(account.header_static_url) }
attributes :followers_count, :following_count, :statuses_count
child :oauth_authentications, object_root: false do
attribute(:uid, :provider)
end
## Instruction:
Add media_statuses_count field in api/v1/accounts/:id
## Code After:
object @account
attributes :id, :username, :acct, :display_name, :locked, :created_at
node(:note) { |account| Formatter.instance.simplified_format(account) }
node(:url) { |account| TagManager.instance.url_for(account) }
node(:avatar) { |account| full_asset_url(account.avatar_original_url) }
node(:avatar_static) { |account| full_asset_url(account.avatar_static_url) }
node(:header) { |account| full_asset_url(account.header_original_url) }
node(:header_static) { |account| full_asset_url(account.header_static_url) }
node(:media_statuses_count) { |account| account.statuses.select { |status| status.media_attachments.present? }.size }
attributes :followers_count, :following_count, :statuses_count
child :oauth_authentications, object_root: false do
attribute(:uid, :provider)
end
| object @account
attributes :id, :username, :acct, :display_name, :locked, :created_at
- node(:note) { |account| Formatter.instance.simplified_format(account) }
+ node(:note) { |account| Formatter.instance.simplified_format(account) }
? +++++++++
- node(:url) { |account| TagManager.instance.url_for(account) }
+ node(:url) { |account| TagManager.instance.url_for(account) }
? +++++++++
- node(:avatar) { |account| full_asset_url(account.avatar_original_url) }
+ node(:avatar) { |account| full_asset_url(account.avatar_original_url) }
? +++++++++
- node(:avatar_static) { |account| full_asset_url(account.avatar_static_url) }
+ node(:avatar_static) { |account| full_asset_url(account.avatar_static_url) }
? +++++++++
- node(:header) { |account| full_asset_url(account.header_original_url) }
+ node(:header) { |account| full_asset_url(account.header_original_url) }
? +++++++++
- node(:header_static) { |account| full_asset_url(account.header_static_url) }
+ node(:header_static) { |account| full_asset_url(account.header_static_url) }
? +++++++++
+ node(:media_statuses_count) { |account| account.statuses.select { |status| status.media_attachments.present? }.size }
attributes :followers_count, :following_count, :statuses_count
child :oauth_authentications, object_root: false do
attribute(:uid, :provider)
end | 13 | 0.8125 | 7 | 6 |
38ba88d81028c006b7d61c2d94a02025824f15d3 | run-healthcheck-web.sh | run-healthcheck-web.sh |
dir=/nfs/acari/ensembl/ensj-healthcheck
cp=$dir
cp=$cp:$dir/lib/ensj-healthcheck.jar
cp=$cp:$dir/lib/mysql-connector-java-3.0.15-ga-bin.jar
cd $dir
$JAVA_HOME/bin/java -server -classpath $cp -Xmx512m org.ensembl.healthcheck.DatabaseTestRunner
|
JAVA_HOME=/usr/bin/java
dir=/nfs/acari/ensembl/ensj-healthcheck
cp=$dir
cp=$cp:$dir/lib/ensj-healthcheck.jar
cp=$cp:$dir/lib/mysql-connector-java-3.0.15-ga-bin.jar
cd $dir
$JAVA_HOME/bin/java -server -classpath $cp -Xmx512m org.ensembl.healthcheck.DatabaseTestRunner
| Set JAVA_HOME explicitly or the cron job will not work | Set JAVA_HOME explicitly or the cron job will not work
| Shell | apache-2.0 | thomasmaurel/ensj-healthcheck,Ensembl/ensj-healthcheck,Ensembl/ensj-healthcheck,Ensembl/ensj-healthcheck,thomasmaurel/ensj-healthcheck,thomasmaurel/ensj-healthcheck,Ensembl/ensj-healthcheck,thomasmaurel/ensj-healthcheck | shell | ## Code Before:
dir=/nfs/acari/ensembl/ensj-healthcheck
cp=$dir
cp=$cp:$dir/lib/ensj-healthcheck.jar
cp=$cp:$dir/lib/mysql-connector-java-3.0.15-ga-bin.jar
cd $dir
$JAVA_HOME/bin/java -server -classpath $cp -Xmx512m org.ensembl.healthcheck.DatabaseTestRunner
## Instruction:
Set JAVA_HOME explicitly or the cron job will not work
## Code After:
JAVA_HOME=/usr/bin/java
dir=/nfs/acari/ensembl/ensj-healthcheck
cp=$dir
cp=$cp:$dir/lib/ensj-healthcheck.jar
cp=$cp:$dir/lib/mysql-connector-java-3.0.15-ga-bin.jar
cd $dir
$JAVA_HOME/bin/java -server -classpath $cp -Xmx512m org.ensembl.healthcheck.DatabaseTestRunner
|
+ JAVA_HOME=/usr/bin/java
dir=/nfs/acari/ensembl/ensj-healthcheck
cp=$dir
cp=$cp:$dir/lib/ensj-healthcheck.jar
cp=$cp:$dir/lib/mysql-connector-java-3.0.15-ga-bin.jar
cd $dir
$JAVA_HOME/bin/java -server -classpath $cp -Xmx512m org.ensembl.healthcheck.DatabaseTestRunner
| 1 | 0.083333 | 1 | 0 |
04493df39184ee2c86120d18d5c573c736db4e05 | .travis.yml | .travis.yml | sudo: required
language: go
go:
- 1.6.2
notifications:
email:
on_success: never
on_failure: always
install:
- make get
- make get_dev
script :
- make
- make fmt
- make vet
- make test
| sudo: required
language: go
go:
- 1.6.2
branches:
only:
- master
- develop
notifications:
email:
on_success: never
on_failure: always
install:
- make get
- make get_dev
script :
- make
- make fmt
- make vet
- make test
| Build only develop and master branches | Build only develop and master branches
| YAML | agpl-3.0 | redBorder/k2http | yaml | ## Code Before:
sudo: required
language: go
go:
- 1.6.2
notifications:
email:
on_success: never
on_failure: always
install:
- make get
- make get_dev
script :
- make
- make fmt
- make vet
- make test
## Instruction:
Build only develop and master branches
## Code After:
sudo: required
language: go
go:
- 1.6.2
branches:
only:
- master
- develop
notifications:
email:
on_success: never
on_failure: always
install:
- make get
- make get_dev
script :
- make
- make fmt
- make vet
- make test
| sudo: required
language: go
go:
- 1.6.2
+
+ branches:
+ only:
+ - master
+ - develop
notifications:
email:
on_success: never
on_failure: always
install:
- make get
- make get_dev
script :
- make
- make fmt
- make vet
- make test | 5 | 0.238095 | 5 | 0 |
12a8f5c7c51b61b757375ed1cb47a28fc6c09552 | opensource.sh | opensource.sh |
YEAR=`date +%Y`
source ./config/*
# Conditionalize this later to load only the license we need
source ./licenses/*
# Displays the given input
log() {
echo -e "$@" >&2
}
# Create license file
create_license() {
echo "$@" > LICENSE
}
# Called in case of error
error_exit() {
echo "Error: $1"
exit 1
}
require() {
which $1 > /dev/null || error_exit "$0 requires $1"
}
help() {
log "Help:
Usage
opensource.sh [options] [/path/to/project/]
DESCRIPTION
OpenSource is a tiny shell script that allows you to add the type of license
you wish to add to your project.
OPTIONS
-h, --help
Show this help information.
-l, --license
Mention the type of license you want to add to your project.
Ex: opensource.sh -l mit
"
}
# Flags
if test "$1" = "-h" -o "$1" = "--help"; then
help
exit 0
elif test "$#" -eq 2 -a "$1" = "-l" -a "$2" = "mit"; then
log "$MIT"
create_license "$MIT"
exit 0
else
echo "Sorry, I have no idea what you are talking about!"
exit 0
fi |
YEAR=`date +%Y`
source ./config/*
# Displays the given input
log() {
echo -e "$@" >&2
}
# Create license file
create_license() {
echo "$@" > LICENSE
}
# Called in case of error
error_exit() {
echo "Error: $1"
exit 1
}
require() {
which $1 > /dev/null || error_exit "$0 requires $1"
}
help() {
log "Help:
Usage
opensource.sh [options] [/path/to/project/]
DESCRIPTION
OpenSource is a tiny shell script that allows you to add the type of license
you wish to add to your project.
OPTIONS
-h, --help
Show this help information.
-l, --license
Mention the type of license you want to add to your project.
Ex: opensource.sh -l mit
"
}
# Flags
if test "$1" = "-h" -o "$1" = "--help"; then
help
exit 0
elif test "$#" -eq 2 -a "$1" = "-l" -a "$2" = "mit"; then
source ./licenses/mit.sh
log "$MIT"
create_license "$MIT"
exit 0
else
echo "Sorry, I have no idea what you are talking about!"
exit 0
fi | Optimize script to not load unnecessary license files | Optimize script to not load unnecessary license files
| Shell | mit | mohnish/opensource.sh | shell | ## Code Before:
YEAR=`date +%Y`
source ./config/*
# Conditionalize this later to load only the license we need
source ./licenses/*
# Displays the given input
log() {
echo -e "$@" >&2
}
# Create license file
create_license() {
echo "$@" > LICENSE
}
# Called in case of error
error_exit() {
echo "Error: $1"
exit 1
}
require() {
which $1 > /dev/null || error_exit "$0 requires $1"
}
help() {
log "Help:
Usage
opensource.sh [options] [/path/to/project/]
DESCRIPTION
OpenSource is a tiny shell script that allows you to add the type of license
you wish to add to your project.
OPTIONS
-h, --help
Show this help information.
-l, --license
Mention the type of license you want to add to your project.
Ex: opensource.sh -l mit
"
}
# Flags
if test "$1" = "-h" -o "$1" = "--help"; then
help
exit 0
elif test "$#" -eq 2 -a "$1" = "-l" -a "$2" = "mit"; then
log "$MIT"
create_license "$MIT"
exit 0
else
echo "Sorry, I have no idea what you are talking about!"
exit 0
fi
## Instruction:
Optimize script to not load unnecessary license files
## Code After:
YEAR=`date +%Y`
source ./config/*
# Displays the given input
log() {
echo -e "$@" >&2
}
# Create license file
create_license() {
echo "$@" > LICENSE
}
# Called in case of error
error_exit() {
echo "Error: $1"
exit 1
}
require() {
which $1 > /dev/null || error_exit "$0 requires $1"
}
help() {
log "Help:
Usage
opensource.sh [options] [/path/to/project/]
DESCRIPTION
OpenSource is a tiny shell script that allows you to add the type of license
you wish to add to your project.
OPTIONS
-h, --help
Show this help information.
-l, --license
Mention the type of license you want to add to your project.
Ex: opensource.sh -l mit
"
}
# Flags
if test "$1" = "-h" -o "$1" = "--help"; then
help
exit 0
elif test "$#" -eq 2 -a "$1" = "-l" -a "$2" = "mit"; then
source ./licenses/mit.sh
log "$MIT"
create_license "$MIT"
exit 0
else
echo "Sorry, I have no idea what you are talking about!"
exit 0
fi |
YEAR=`date +%Y`
source ./config/*
- # Conditionalize this later to load only the license we need
- source ./licenses/*
-
# Displays the given input
log() {
echo -e "$@" >&2
}
# Create license file
create_license() {
echo "$@" > LICENSE
}
# Called in case of error
error_exit() {
echo "Error: $1"
exit 1
}
require() {
which $1 > /dev/null || error_exit "$0 requires $1"
}
help() {
log "Help:
Usage
opensource.sh [options] [/path/to/project/]
DESCRIPTION
OpenSource is a tiny shell script that allows you to add the type of license
you wish to add to your project.
OPTIONS
-h, --help
Show this help information.
-l, --license
Mention the type of license you want to add to your project.
Ex: opensource.sh -l mit
"
}
# Flags
if test "$1" = "-h" -o "$1" = "--help"; then
help
exit 0
elif test "$#" -eq 2 -a "$1" = "-l" -a "$2" = "mit"; then
+ source ./licenses/mit.sh
log "$MIT"
create_license "$MIT"
exit 0
else
echo "Sorry, I have no idea what you are talking about!"
exit 0
fi | 4 | 0.063492 | 1 | 3 |
b1b2a876812af3705c180677b7309bbe66b65bf7 | main.go | main.go | package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
utils "github.com/shurcooL/github_flavored_markdown"
)
func main() {
http.HandleFunc("/", Handler)
log.Printf("Listening on port %d\n", 8080)
log.Fatal(http.ListenAndServe(":8080", nil))
}
func Handler(res http.ResponseWriter, req *http.Request) {
readme, err := GetReadme()
if err != nil {
fmt.Fprintf(res, "Something went wrong:\n%s", err)
return
}
fmt.Fprintf(res, string(readme))
}
func GetReadme() ([]byte, error) {
b, err := ioutil.ReadFile("./README.md")
if err != nil {
return nil, err
}
return utils.Markdown(b), nil
}
| package main
import (
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"
utils "github.com/shurcooL/github_flavored_markdown"
)
var (
file string
bind string
)
func init() {
flag.StringVar(&bind, "bind", ":8080", "interface to bind to, eg. 0.0.0.0:8080")
flag.StringVar(&file, "file", "README.md", "file to render on web interface")
}
func main() {
flag.Parse()
http.HandleFunc("/", Handler)
log.Printf("Listening on port %s\n", bind)
log.Fatal(http.ListenAndServe(bind, nil))
}
func Handler(res http.ResponseWriter, req *http.Request) {
readme, err := GetReadme()
if err != nil {
fmt.Fprintf(res, "Something went wrong:\n%s", err)
return
}
fmt.Fprintf(res, string(readme))
}
func GetReadme() ([]byte, error) {
b, err := ioutil.ReadFile(file)
if err != nil {
return nil, err
}
return utils.Markdown(b), nil
}
| Read binding interface and MD file via flags. | Read binding interface and MD file via flags.
| Go | mit | mongrelion/mdp | go | ## Code Before:
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
utils "github.com/shurcooL/github_flavored_markdown"
)
func main() {
http.HandleFunc("/", Handler)
log.Printf("Listening on port %d\n", 8080)
log.Fatal(http.ListenAndServe(":8080", nil))
}
func Handler(res http.ResponseWriter, req *http.Request) {
readme, err := GetReadme()
if err != nil {
fmt.Fprintf(res, "Something went wrong:\n%s", err)
return
}
fmt.Fprintf(res, string(readme))
}
func GetReadme() ([]byte, error) {
b, err := ioutil.ReadFile("./README.md")
if err != nil {
return nil, err
}
return utils.Markdown(b), nil
}
## Instruction:
Read binding interface and MD file via flags.
## Code After:
package main
import (
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"
utils "github.com/shurcooL/github_flavored_markdown"
)
var (
file string
bind string
)
func init() {
flag.StringVar(&bind, "bind", ":8080", "interface to bind to, eg. 0.0.0.0:8080")
flag.StringVar(&file, "file", "README.md", "file to render on web interface")
}
func main() {
flag.Parse()
http.HandleFunc("/", Handler)
log.Printf("Listening on port %s\n", bind)
log.Fatal(http.ListenAndServe(bind, nil))
}
func Handler(res http.ResponseWriter, req *http.Request) {
readme, err := GetReadme()
if err != nil {
fmt.Fprintf(res, "Something went wrong:\n%s", err)
return
}
fmt.Fprintf(res, string(readme))
}
func GetReadme() ([]byte, error) {
b, err := ioutil.ReadFile(file)
if err != nil {
return nil, err
}
return utils.Markdown(b), nil
}
| package main
import (
+ "flag"
"fmt"
"io/ioutil"
"log"
"net/http"
utils "github.com/shurcooL/github_flavored_markdown"
)
+ var (
+ file string
+ bind string
+ )
+
+ func init() {
+ flag.StringVar(&bind, "bind", ":8080", "interface to bind to, eg. 0.0.0.0:8080")
+ flag.StringVar(&file, "file", "README.md", "file to render on web interface")
+ }
+
func main() {
+ flag.Parse()
http.HandleFunc("/", Handler)
- log.Printf("Listening on port %d\n", 8080)
? ^ ^^^^
+ log.Printf("Listening on port %s\n", bind)
? ^ ^^^^
- log.Fatal(http.ListenAndServe(":8080", nil))
? ^^^^^^^
+ log.Fatal(http.ListenAndServe(bind, nil))
? ^^^^
}
func Handler(res http.ResponseWriter, req *http.Request) {
readme, err := GetReadme()
if err != nil {
fmt.Fprintf(res, "Something went wrong:\n%s", err)
return
}
fmt.Fprintf(res, string(readme))
}
func GetReadme() ([]byte, error) {
- b, err := ioutil.ReadFile("./README.md")
? ^^^^^^^^^^^^^
+ b, err := ioutil.ReadFile(file)
? ^^^^
if err != nil {
return nil, err
}
return utils.Markdown(b), nil
} | 18 | 0.514286 | 15 | 3 |
8bb56979f549bcbef814cd7878d3f0799042452b | .travis.yml | .travis.yml | dist: trusty
sudo: required
language: java
jdk:
- oraclejdk8
- openjdk8
- oraclejdk9
- openjdk9
branches:
only:
- master
notifications:
email:
- eemeli.miettinen@methics.fi, matti.aarnio@methics.fi
| dist: trusty
sudo: required
language: java
jdk:
- oraclejdk8
- openjdk8
branches:
only:
- master
notifications:
email:
- eemeli.miettinen@methics.fi, matti.aarnio@methics.fi
| Disable JDK9 for now as it does not have XJCFacade... | Disable JDK9 for now as it does not have XJCFacade...
| YAML | apache-2.0 | laverca/laverca | yaml | ## Code Before:
dist: trusty
sudo: required
language: java
jdk:
- oraclejdk8
- openjdk8
- oraclejdk9
- openjdk9
branches:
only:
- master
notifications:
email:
- eemeli.miettinen@methics.fi, matti.aarnio@methics.fi
## Instruction:
Disable JDK9 for now as it does not have XJCFacade...
## Code After:
dist: trusty
sudo: required
language: java
jdk:
- oraclejdk8
- openjdk8
branches:
only:
- master
notifications:
email:
- eemeli.miettinen@methics.fi, matti.aarnio@methics.fi
| dist: trusty
sudo: required
language: java
jdk:
- oraclejdk8
- openjdk8
- - oraclejdk9
- - openjdk9
branches:
only:
- master
notifications:
email:
- eemeli.miettinen@methics.fi, matti.aarnio@methics.fi | 2 | 0.142857 | 0 | 2 |
d4a36f2ba528618ce0caebd524247dd6feabd48a | tests/runtests.sh | tests/runtests.sh |
let "suc = 0"
let "fail = 0"
NUMTEST=79
for (( tno = 1 ; $tno <= $NUMTEST ; tno = $tno + 1 )); do
./testCheck.sh $tno
if [ "$?" -eq "0" ]; then
echo "OK"
let "suc = $(($suc + 1))"
else
echo "FAIL"
let "fail = $(($fail + 1))"
fi
done
let "total = $(($suc + $fail))"
echo "======================"
echo "| TESTS DONE |"
echo "======================"
echo " TOTAL: $total"
echo " OK: $suc"
echo "FAILED: $fail"
if [ $fail -ne 0 ]; then
exit 1
fi
| DIR=`dirname $0`
cd $DIR
make check
| Use make check to run tests (instead of custom logic). | Use make check to run tests (instead of custom logic).
This way the list/number of tests only has to be updated in one place.
Conflicts:
tests/runtests.sh
| Shell | mit | mirror/tclap,xguerin/tclap,xguerin/tclap,mc-server/TCLAP,mirror/tclap,mirror/tclap,mc-server/TCLAP,mc-server/TCLAP,mirror/tclap,xguerin/tclap,xguerin/tclap | shell | ## Code Before:
let "suc = 0"
let "fail = 0"
NUMTEST=79
for (( tno = 1 ; $tno <= $NUMTEST ; tno = $tno + 1 )); do
./testCheck.sh $tno
if [ "$?" -eq "0" ]; then
echo "OK"
let "suc = $(($suc + 1))"
else
echo "FAIL"
let "fail = $(($fail + 1))"
fi
done
let "total = $(($suc + $fail))"
echo "======================"
echo "| TESTS DONE |"
echo "======================"
echo " TOTAL: $total"
echo " OK: $suc"
echo "FAILED: $fail"
if [ $fail -ne 0 ]; then
exit 1
fi
## Instruction:
Use make check to run tests (instead of custom logic).
This way the list/number of tests only has to be updated in one place.
Conflicts:
tests/runtests.sh
## Code After:
DIR=`dirname $0`
cd $DIR
make check
| + DIR=`dirname $0`
+ cd $DIR
+ make check
- let "suc = 0"
- let "fail = 0"
- NUMTEST=79
-
- for (( tno = 1 ; $tno <= $NUMTEST ; tno = $tno + 1 )); do
- ./testCheck.sh $tno
- if [ "$?" -eq "0" ]; then
- echo "OK"
- let "suc = $(($suc + 1))"
- else
- echo "FAIL"
- let "fail = $(($fail + 1))"
- fi
- done
-
- let "total = $(($suc + $fail))"
- echo "======================"
- echo "| TESTS DONE |"
- echo "======================"
- echo " TOTAL: $total"
- echo " OK: $suc"
- echo "FAILED: $fail"
-
- if [ $fail -ne 0 ]; then
- exit 1
- fi
- | 30 | 1.071429 | 3 | 27 |
3eb591ff76c9edb8a9ed6466712be425269f8739 | misc/vim/ftplugin/go.vim | misc/vim/ftplugin/go.vim | " Copyright 2013 The Go Authors. All rights reserved.
" Use of this source code is governed by a BSD-style
" license that can be found in the LICENSE file.
"
" go.vim: Vim filetype plugin for Go.
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
setlocal comments=s1:/*,mb:*,ex:*/,://
setlocal commentstring=//\ %s
let b:undo_ftplugin = "setl com< cms<"
" vim:ts=4:sw=4:et
| " Copyright 2013 The Go Authors. All rights reserved.
" Use of this source code is governed by a BSD-style
" license that can be found in the LICENSE file.
"
" go.vim: Vim filetype plugin for Go.
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
setlocal formatoptions-=t
setlocal comments=s1:/*,mb:*,ex:*/,://
setlocal commentstring=//\ %s
let b:undo_ftplugin = "setl fo< com< cms<"
" vim:ts=4:sw=4:et
| Disable automatic line wrapping by textwidth. | misc/vim: Disable automatic line wrapping by textwidth.
If someone configures a 'textwidth' in go files, vim will by default insert
newlines into long lines as you type, which breaks syntax and doesn't really
make sense for go code. This fixes the default.
LGTM=dsymonds
R=golang-codereviews, gobot, dsymonds
CC=golang-codereviews
https://golang.org/cl/76890046
| VimL | mit | gavinzhs/go,christopher-henderson/Go,CarterTsai/go,constantine001/go,cookerzhu/go,devpadawan/go,jmptrader/go,jmptrader/go,jacobxk/go,golang/go,cnbin/go,minux/goios,kakuhiroshi/go,ganboing/go-esx,josharian/go.ssa,royels/go,minux/go-windows,gdey/go,vsdutka/go,derekmarcotte/go,jacobhaven/go,NunoEdgarGub1/go,kim-racktop/go,shawnl/go,beealone/go,nawawi/go,kakuhiroshi/go,likesea/go,g522342435/go,theif519/go,Ghands/go,polyverse-security/go,dterei/go,cloudrain21/go,roth1002/go,alex-zhang/go,codestation/go,magastzheng/go-1,baiyunping333/go,cyberroadie/go,josharian/go,4ad/go,odeke-em/go,constantine001/go,Samurais/go,Jordanzuo/go,qskycolor/go,WIZARD-CXY/go,jonathanmarvens/go,zhangg/go,Endika/go,jacobhaven/go,honsiorovskyi/go,famorted/go,yasarkunduz/go,josharian/go,RBEGamer/go,kevinc0825/go,tcnksm/go,likesea/go,pgmreddy/go,andrewchambers/go,monetate/go,9618211/go,royels/go,cookerzhu/go,danycoro/go,weisd/go,GeorgiCodes/go,cnbin/go,JioCloud/go,undergrowthlinear/go,skatsuta/go,suncycheng/go,theass/go,miolini/go,binarycrusader/go,nawawi/go,b54898533/go,XuYunnan/go,arschles/go-1,slavau/go,arschles/golang-go,arschles/golang-go,parkdy/go,Stan-Lin-/go,jameskumar/go,b54898533/go,gaurav36/go,g522342435/go,klueska/go-akaros,gomini/go-mips32,likesea/go,shazow/go,GeorgiCodes/go,springning/go,lihuanghai/go,ErikDubbelboer/go,cookerzhu/go,xujianhai/go,dterei/go,jasonxiong/go,jonasi/go,willjunspecial/go,ErikDubbelboer/go,jonathanmarvens/go,minux/goios,ganboing/go-esx,jasonxiong/go,arschles/golang-go,mdp/go,WIZARD-CXY/go,devpadawan/go,jonasi/go,gohin/go,nakedgc/go,lihuanghai/go,WIZARD-CXY/go,ganboing/go-esx,NunoEdgarGub1/go,shazow/go,danielsoro/go,Pulgafree/go,theass/go,zhangg/go-1,nakedgc/go,sagivo/go,roth1002/go,willjunspecial/go,pgmreddy/go,yangzhongj/go,momchil-velikov/go,myPublicGit/go,nawawi/go,jdhenke/go,Davidzhu001/go-1,odeke-em/go,famorted/go,jacobsa/go,lihuanghai/go,Cofyc/go,nawawi/go,qskycolor/go,gohin/go,danielsoro/go,alash3al/go,jdeng/go,Pulgafree/go,jmptrader/go,baiyunping333/go,vanloswang/go,shawnl/go,mk0x9/go,beealone/go,minux/goios,yuhengye/go,PoohSunny/go,dpatel06/go,Davidzhu001/go-1,vanloswang/go,vectaport/go,mk0x9/go,4ad/go,frobware/go,miolini/go,cyberroadie/go,shazow/go,leeric92/go,joshsammut/go,Charlesdong/go-1,binarycrusader/go,samanalysis/go,dterei/go,arschles/go-1,gavinzhs/go,beealone/go,minux/go-windows,linux-on-ibm-z/go,suncycheng/go,AnuchitPrasertsang/go,dafyddcrosby/go,XuYunnan/go,springning/go,alex-zhang/go,alex-zhang/go,donnel6809/go,zcwfeng/go,jacobsa/go,nakedgc/go,Cofyc/go,ObjectiveJoe/go,stormltf/go,shines77/go,skunkwerks/clive,shawnl/go,andrewchambers/go,vanloswang/go,vsdutka/go,theif519/go,constantine001/go,mgyenik/go,gdey/go,WIZARD-CXY/go,albertjin/golang-go,codestation/go,waterlink/go,vsekhar/elastic-go,ObjectiveJoe/go,polyverse-security/go,ObjectiveJoe/go,yeyuguo/go,constantine001/go,codestation/go,rentongzhang/go,tcnksm/go,xujianhai/go,gomini/go-mips32,ichu501/go,cyberroadie/go,undergrowthlinear/go,linux-on-ibm-z/go,Stan-Lin-/go,gaurav36/go,parkdy/go,shawnl/go,golang/go,goodlang/good,xiuzhifu/go,klueska/go-akaros,weisd/go,skotti/go,donnel6809/go,JioCloud/go,codestation/go,uileyar/go,jacobsa/go,jonasi/go,tcnksm/go,josharian/go,cainiaocome/go,CodyGuo/go,baiyunping333/go,wangfakang/go-1,zcwfeng/go,gaurav36/go,zhangg/go-1,Cofyc/go,youprofit/go,kim-racktop/go,dafyddcrosby/go,mbrukman/go,arschles/go-1,rentongzhang/go,b54898533/go,ImJasonH/go,josharian/go,baiyunping333/go,ericsnowcurrently/go,slavau/go,Pulgafree/go,gavinzhs/go,skatsuta/go,mdp/go,mikekap/go,cyberroadie/go,9618211/go,Young55555/go,cainiaocome/go,xiuzhifu/go,snowsnail/go,malvira/go,mdp/go,vsdutka/go,wangfakang/go-1,GeorgiCodes/go,skunkwerks/clive,Samurais/go,vsekhar/elastic-go,miolini/go,WIZARD-CXY/go,jefby/go,vsdutka/go,rachtsingh/gogojuice,Ghands/go,baiyunping333/go,Davidzhu001/go-1,CodyGuo/go,zhangg/go,gomini/go-mips32,zhangg/go,yuhengye/go,yuhengye/go,minux/go-windows,cloudrain21/go,dgnorton/go,mk0x9/go,undergrowthlinear/go,josharian/go.ssa,albertjin/golang-go,golang/go,slavau/go,ichu501/go,myPublicGit/go,dgnorton/go,kakuhiroshi/go,momchil-velikov/go,snowsnail/go,cloudflare/go,monetate/go,parkdy/go,jonathanmarvens/go,binarycrusader/go,Samurais/go,yeyuguo/go,mbrukman/go,Endika/go,akutz/go,rentongzhang/go,jefby/go,weisd/go,ichu501/go,odeke-em/go,pgmreddy/go,willjunspecial/go,jdeng/go,dgnorton/go,derekmarcotte/go,chinanjjohn2012/go,kim-racktop/go,CiscoCloud/go,dgnorton/go,stormltf/go,CarterTsai/go,GeorgiCodes/go,jonahglover/go,rachtsingh/gogojuice,suncycheng/go,gavinzhs/go,RBEGamer/go,AnuchitPrasertsang/go,likesea/go,g522342435/go,methane/go,suncycheng/go,pgmreddy/go,9618211/go,skotti/go,xiaobodu/go,skatsuta/go,cnbin/go,linux-on-ibm-z/go,cainiaocome/go,GeorgiCodes/go,PoohSunny/go,roth1002/go,jdhenke/go,skotti/go,xujianhai/go,vishsingh/go,ericsnowcurrently/go,mk0x9/go,sndnvaps/go,jefby/go,cyberroadie/go,arschles/go-1,sndnvaps/go,likesea/go,gomini/go-mips32,myPublicGit/go,zouchao2010/go,greyhwndz/go,gdey/go,b-deng/go,gavinzhs/go,b-deng/go,4ad/go,greyhwndz/go,cloudflare/go,leeric92/go,arschles/go-1,gaurav36/go,vectaport/go,josharian/go.ssa,derekmarcotte/go,Jordanzuo/go,dkolbly/go,Endika/go,mbrukman/go,jonahglover/go,AnuchitPrasertsang/go,sagivo/go,NichoZhang/go,youprofit/go,ganboing/go-esx,Davidzhu001/go-1,AALEKH/go,Pulgafree/go,chinanjjohn2012/go,kakuhiroshi/go,mapix/go,cloudflare/go,gorcz/go,albertjin/golang-go,jonathanmarvens/go,skotti/go,ichu501/go,alex-zhang/go,malvira/go,vectaport/go,cnbin/go,polyverse-security/go,ErikDubbelboer/go,vectaport/go,samanalysis/go,magastzheng/go-1,slavau/go,theif519/go,joshuaprunier/go,mbrukman/go,willjunspecial/go,CiscoCloud/go,sinuos/go,b-deng/go,richo/go,vsekhar/elastic-go,methane/go,Pulgafree/go,sinuos/go,xinhuang327/go,mgyenik/go,mwhudson/go,shishkander/go,jmptrader/go,linux-on-ibm-z/go,mbrukman/go,mk0x9/go,gomini/go-mips32,beealone/go,mikekap/go,theass/go,akutz/go,deft-code/go,fjballest/golang,XuYunnan/go,xinhuang327/go,b54898533/go,beealone/go,kevinc0825/go,ImJasonH/go,NunoEdgarGub1/go,theass/go,Stan-Lin-/go,yangzhongj/go,waterlink/go,kevinc0825/go,Stan-Lin-/go,famorted/go,qskycolor/go,ifagnosticism/go,klueska/go-akaros,theif519/go,Ghands/go,qskycolor/go,jacobsa/go,jdhenke/go,snowsnail/go,Cofyc/go,jacobhaven/go,mwhudson/go,CiscoCloud/go,joshsammut/go,weisd/go,CAFxX/go,albertjin/golang-go,shawnl/go,gorcz/go,jonahglover/go,odeke-em/go,myPublicGit/go,greyhwndz/go,cloudrain21/go,yangzhongj/go,richo/go,Charlesdong/go-1,golang/go,zhangg/go,jonathanmarvens/go,samanalysis/go,vanloswang/go,roth1002/go,minux/go-windows,sosop/go,polyverse-security/go,royels/go,devpadawan/go,goodlang/good,arschles/golang-go,ifagnosticism/go,xinhuang327/go,jasonxiong/go,suncycheng/go,dpatel06/go,nawawi/go,linux-on-ibm-z/go,mapix/go,jasonxiong/go,lihuanghai/go,shazow/go,constantine001/go,NichoZhang/go,wangfakang/go-1,skotti/go,b-deng/go,zouchao2010/go,Young55555/go,deft-code/go,dgnorton/go,akutz/go,baiyunping333/go,dafyddcrosby/go,jdhenke/go,dpatel06/go,vishsingh/go,codestation/go,NunoEdgarGub1/go,dpatel06/go,stormltf/go,mgyenik/go,roth1002/go,XuYunnan/go,zhangg/go-1,klueska/go-akaros,stormltf/go,cookerzhu/go,deft-code/go,mapix/go,jameskumar/go,PoohSunny/go,minux/goios,dafyddcrosby/go,CarterTsai/go,xiaobodu/go,fjballest/golang,danielsoro/go,deft-code/go,ErikDubbelboer/go,waterlink/go,Badredapple/go,minux/go-windows,zcwfeng/go,yangzhongj/go,richo/go,CiscoCloud/go,constantine001/go,jefby/go,leeric92/go,b-deng/go,slavau/go,skatsuta/go,vsekhar/elastic-go,gohin/go,qskycolor/go,danycoro/go,WIZARD-CXY/go,momchil-velikov/go,CodyGuo/go,yasarkunduz/go,shines77/go,mapix/go,rachtsingh/gogojuice,Stan-Lin-/go,cloudrain21/go,cainiaocome/go,b54898533/go,mgyenik/go,klueska/go-akaros,jacobsa/go,dterei/go,ichu501/go,yuhengye/go,9618211/go,vanloswang/go,NichoZhang/go,cainiaocome/go,skatsuta/go,jameskumar/go,greyhwndz/go,cookerzhu/go,XuYunnan/go,leeric92/go,skunkwerks/clive,Davidzhu001/go-1,JioCloud/go,mgyenik/go,NichoZhang/go,alash3al/go,jdeng/go,shishkander/go,famorted/go,g522342435/go,CAFxX/go,andrewchambers/go,xujianhai/go,shishkander/go,gdey/go,ericsnowcurrently/go,wangfakang/go-1,jmptrader/go,zouchao2010/go,stormltf/go,CAFxX/go,fjballest/golang,CarterTsai/go,skunkwerks/clive,Badredapple/go,ImJasonH/go,Endika/go,honsiorovskyi/go,jacobxk/go,suncycheng/go,jacobxk/go,jacobhaven/go,jacobxk/go,AALEKH/go,Charlesdong/go-1,sndnvaps/go,wangfakang/go-1,AnuchitPrasertsang/go,joshsammut/go,sinuos/go,CodyGuo/go,yeyuguo/go,jameskumar/go,alex-zhang/go,gavinzhs/go,josharian/go,gdey/go,Charlesdong/go-1,donnel6809/go,cainiaocome/go,andrewchambers/go,ErikDubbelboer/go,shines77/go,minux/go-windows,golang/go,danielsoro/go,ImJasonH/go,b-deng/go,klueska/go-akaros,skunkwerks/clive,shazow/go,gomini/go-mips32,goodlang/good,zhangg/go,mwhudson/go,xujianhai/go,jefby/go,dkolbly/go,skatsuta/go,kakuhiroshi/go,dterei/go,akutz/go,josharian/go.ssa,kim-racktop/go,undergrowthlinear/go,golang/go,cloudflare/go,jonasi/go,AnuchitPrasertsang/go,vectaport/go,yasarkunduz/go,malvira/go,monetate/go,sosop/go,4ad/go,likesea/go,linux-on-ibm-z/go,danycoro/go,momchil-velikov/go,ifagnosticism/go,dgnorton/go,slavau/go,mdp/go,arschles/golang-go,likesea/go,joshuaprunier/go,yasarkunduz/go,CiscoCloud/go,odeke-em/go,Davidzhu001/go-1,xiaobodu/go,malvira/go,danycoro/go,g522342435/go,mbrukman/go,mapix/go,RBEGamer/go,xujianhai/go,andrewchambers/go,PoohSunny/go,miolini/go,skotti/go,jonathanmarvens/go,ericsnowcurrently/go,derekmarcotte/go,yeyuguo/go,cainiaocome/go,Jordanzuo/go,ifagnosticism/go,vsdutka/go,gomini/go-mips32,CarterTsai/go,WIZARD-CXY/go,vsdutka/go,vsekhar/elastic-go,CAFxX/go,alex-zhang/go,sndnvaps/go,Charlesdong/go-1,ObjectiveJoe/go,joshsammut/go,cloudflare/go,waterlink/go,snowsnail/go,akutz/go,sosop/go,skotti/go,xujianhai/go,vanloswang/go,magastzheng/go-1,yuhengye/go,agaurav/go,cyberroadie/go,gorcz/go,xiaobodu/go,jacobxk/go,mwhudson/go,gorcz/go,jameskumar/go,cookerzhu/go,dkolbly/go,vishsingh/go,rachtsingh/gogojuice,jonahglover/go,willjunspecial/go,jameskumar/go,richo/go,nakedgc/go,minux/go-windows,mbrukman/go,Stan-Lin-/go,Badredapple/go,joshsammut/go,royels/go,Stan-Lin-/go,Endika/go,waterlink/go,AnuchitPrasertsang/go,dterei/go,CodyGuo/go,gaurav36/go,mk0x9/go,ObjectiveJoe/go,uileyar/go,famorted/go,magastzheng/go-1,klueska/go-akaros,kim-racktop/go,xujianhai/go,yunkai/go,springning/go,shines77/go,josharian/go.ssa,zouchao2010/go,zhangg/go,momchil-velikov/go,Samurais/go,josharian/go,donnel6809/go,yunkai/go,pgmreddy/go,snowsnail/go,richo/go,Ghands/go,deft-code/go,gaurav36/go,malvira/go,ericsnowcurrently/go,derekmarcotte/go,agaurav/go,cookerzhu/go,Jordanzuo/go,gohin/go,9618211/go,zhangg/go,zhangg/go,AnuchitPrasertsang/go,kim-racktop/go,chinanjjohn2012/go,sagivo/go,Pulgafree/go,arschles/golang-go,theif519/go,albertjin/golang-go,binarycrusader/go,frobware/go,Cofyc/go,frobware/go,stormltf/go,Ghands/go,jacobsa/go,JioCloud/go,uileyar/go,deft-code/go,g522342435/go,shawnl/go,jefby/go,arschles/golang-go,mgyenik/go,theass/go,youprofit/go,leeric92/go,ifagnosticism/go,qskycolor/go,devpadawan/go,cloudflare/go,tcnksm/go,cloudrain21/go,joshsammut/go,rentongzhang/go,Ghands/go,rentongzhang/go,shines77/go,momchil-velikov/go,gohin/go,ichu501/go,dpatel06/go,dpatel06/go,kevinc0825/go,vectaport/go,Davidzhu001/go-1,greyhwndz/go,danycoro/go,ImJasonH/go,goodlang/good,yangzhongj/go,ganboing/go-esx,polyverse-security/go,yuhengye/go,AALEKH/go,zhangg/go-1,myPublicGit/go,stormltf/go,devpadawan/go,jacobxk/go,donnel6809/go,zouchao2010/go,vanloswang/go,danycoro/go,josharian/go.ssa,agaurav/go,constantine001/go,methane/go,josharian/go.ssa,undergrowthlinear/go,9618211/go,dpatel06/go,beealone/go,sinuos/go,arschles/golang-go,alash3al/go,parkdy/go,AALEKH/go,derekmarcotte/go,ImJasonH/go,xiaobodu/go,dkolbly/go,weisd/go,dafyddcrosby/go,rentongzhang/go,parkdy/go,zcwfeng/go,nakedgc/go,theass/go,polyverse-security/go,Cofyc/go,Samurais/go,Badredapple/go,kim-racktop/go,springning/go,jdhenke/go,4ad/go,monetate/go,skunkwerks/clive,AALEKH/go,cyberroadie/go,gaurav36/go,jacobsa/go,malvira/go,Badredapple/go,Young55555/go,albertjin/golang-go,zouchao2010/go,honsiorovskyi/go,shazow/go,shishkander/go,mikekap/go,ImJasonH/go,vishsingh/go,gorcz/go,theass/go,jonasi/go,dpatel06/go,shishkander/go,cnbin/go,klueska/go-akaros,polyverse-security/go,devpadawan/go,springning/go,gohin/go,codestation/go,ericsnowcurrently/go,CiscoCloud/go,WIZARD-CXY/go,xiaobodu/go,jacobxk/go,PoohSunny/go,weisd/go,linux-on-ibm-z/go,odeke-em/go,kevinc0825/go,shazow/go,ifagnosticism/go,chinanjjohn2012/go,baiyunping333/go,xinhuang327/go,rachtsingh/gogojuice,skunkwerks/clive,famorted/go,Charlesdong/go-1,shawnl/go,CodyGuo/go,frobware/go,CiscoCloud/go,nawawi/go,Endika/go,roth1002/go,royels/go,samanalysis/go,zhangg/go-1,yuhengye/go,minux/goios,zouchao2010/go,mk0x9/go,cloudflare/go,uileyar/go,constantine001/go,jameskumar/go,dkolbly/go,mikekap/go,waterlink/go,NunoEdgarGub1/go,jacobhaven/go,mwhudson/go,Jordanzuo/go,magastzheng/go-1,undergrowthlinear/go,CAFxX/go,b-deng/go,rentongzhang/go,uileyar/go,fjballest/golang,deft-code/go,suncycheng/go,malvira/go,lihuanghai/go,yangzhongj/go,derekmarcotte/go,xinhuang327/go,akutz/go,theif519/go,cloudrain21/go,jonasi/go,greyhwndz/go,Ghands/go,Young55555/go,ObjectiveJoe/go,binarycrusader/go,jacobhaven/go,binarycrusader/go,fjballest/golang,binarycrusader/go,4ad/go,gdey/go,XuYunnan/go,jmptrader/go,danycoro/go,AALEKH/go,andrewchambers/go,jefby/go,rentongzhang/go,josharian/go.ssa,mikekap/go,monetate/go,lihuanghai/go,akutz/go,wangfakang/go-1,danielsoro/go,mikekap/go,deft-code/go,sosop/go,ganboing/go-esx,NunoEdgarGub1/go,Badredapple/go,joshuaprunier/go,leeric92/go,Stan-Lin-/go,zcwfeng/go,Young55555/go,ericsnowcurrently/go,gorcz/go,PoohSunny/go,josharian/go,NichoZhang/go,sagivo/go,youprofit/go,vishsingh/go,AnuchitPrasertsang/go,momchil-velikov/go,CarterTsai/go,yunkai/go,monetate/go,golang/go,nawawi/go,dkolbly/go,lihuanghai/go,chinanjjohn2012/go,gdey/go,cloudflare/go,slavau/go,GeorgiCodes/go,dafyddcrosby/go,youprofit/go,rachtsingh/gogojuice,Ghands/go,CAFxX/go,kevinc0825/go,roth1002/go,royels/go,Charlesdong/go-1,sagivo/go,gdey/go,springning/go,frobware/go,likesea/go,richo/go,xinhuang327/go,methane/go,vishsingh/go,yangzhongj/go,yangzhongj/go,donnel6809/go,tcnksm/go,myPublicGit/go,jacobhaven/go,PoohSunny/go,leeric92/go,kevinc0825/go,springning/go,frobware/go,xiuzhifu/go,joshsammut/go,theass/go,AALEKH/go,shazow/go,waterlink/go,g522342435/go,RBEGamer/go,yuhengye/go,agaurav/go,Endika/go,famorted/go,sinuos/go,JioCloud/go,derekmarcotte/go,joshuaprunier/go,RBEGamer/go,albertjin/golang-go,arschles/go-1,zhangg/go-1,pgmreddy/go,JioCloud/go,dkolbly/go,PoohSunny/go,JioCloud/go,snowsnail/go,b54898533/go,vishsingh/go,joshuaprunier/go,yunkai/go,vsdutka/go,miolini/go,xinhuang327/go,zcwfeng/go,honsiorovskyi/go,royels/go,NunoEdgarGub1/go,Young55555/go,jdhenke/go,linux-on-ibm-z/go,ErikDubbelboer/go,dafyddcrosby/go,parkdy/go,CarterTsai/go,joshsammut/go,shines77/go,Cofyc/go,monetate/go,richo/go,kevinc0825/go,sinuos/go,cyberroadie/go,Jordanzuo/go,b54898533/go,codestation/go,goodlang/good,Samurais/go,XuYunnan/go,jdeng/go,jacobhaven/go,nakedgc/go,sndnvaps/go,ifagnosticism/go,parkdy/go,jonasi/go,mdp/go,NichoZhang/go,CAFxX/go,mgyenik/go,leeric92/go,b-deng/go,suncycheng/go,royels/go,cnbin/go,dafyddcrosby/go,weisd/go,skunkwerks/clive,beealone/go,chinanjjohn2012/go,CAFxX/go,danielsoro/go,willjunspecial/go,pgmreddy/go,vsekhar/elastic-go,undergrowthlinear/go,mgyenik/go,uileyar/go,GeorgiCodes/go,Charlesdong/go-1,cnbin/go,uileyar/go,ObjectiveJoe/go,honsiorovskyi/go,greyhwndz/go,Pulgafree/go,Young55555/go,agaurav/go,greyhwndz/go,jasonxiong/go,jdeng/go,alex-zhang/go,CiscoCloud/go,Badredapple/go,odeke-em/go,mdp/go,methane/go,shishkander/go,cloudrain21/go,skotti/go,honsiorovskyi/go,minux/go-windows,shishkander/go,jameskumar/go,sosop/go,yasarkunduz/go,jdhenke/go,danycoro/go,vectaport/go,gohin/go,ifagnosticism/go,snowsnail/go,xiuzhifu/go,sagivo/go,jdeng/go,springning/go,myPublicGit/go,ichu501/go,XuYunnan/go,odeke-em/go,jasonxiong/go,andrewchambers/go,magastzheng/go-1,gohin/go,wangfakang/go-1,waterlink/go,fjballest/golang,zhangg/go-1,sosop/go,baiyunping333/go,vectaport/go,gaurav36/go,xiuzhifu/go,theif519/go,jdhenke/go,jonahglover/go,yasarkunduz/go,mapix/go,RBEGamer/go,xiuzhifu/go,CodyGuo/go,CodyGuo/go,Endika/go,donnel6809/go,rachtsingh/gogojuice,sinuos/go,Jordanzuo/go,g522342435/go,youprofit/go,jonahglover/go,miolini/go,donnel6809/go,famorted/go,cainiaocome/go,AALEKH/go,alash3al/go,mdp/go,jonathanmarvens/go,dgnorton/go,joshuaprunier/go,jacobsa/go,goodlang/good,mdp/go,ericsnowcurrently/go,golang/go,tcnksm/go,mikekap/go,CarterTsai/go,jdeng/go,albertjin/golang-go,xiaobodu/go,Jordanzuo/go,minux/goios,rachtsingh/gogojuice,kakuhiroshi/go,zhangg/go-1,arschles/go-1,roth1002/go,cnbin/go,NichoZhang/go,xinhuang327/go,youprofit/go,honsiorovskyi/go,vishsingh/go,vsekhar/elastic-go,yeyuguo/go,shines77/go,slavau/go,jonahglover/go,sndnvaps/go,mwhudson/go,nawawi/go,malvira/go,vsdutka/go,josharian/go,jmptrader/go,kim-racktop/go,tcnksm/go,dkolbly/go,mbrukman/go,myPublicGit/go,parkdy/go,methane/go,weisd/go,jdeng/go,devpadawan/go,alex-zhang/go,jmptrader/go,sinuos/go,Davidzhu001/go-1,chinanjjohn2012/go,devpadawan/go,samanalysis/go,snowsnail/go,gomini/go-mips32,methane/go,Young55555/go,joshuaprunier/go,cookerzhu/go,xiuzhifu/go,yeyuguo/go,monetate/go,sagivo/go,honsiorovskyi/go,yeyuguo/go,mikekap/go,richo/go,nakedgc/go,ErikDubbelboer/go,akutz/go,ErikDubbelboer/go,ObjectiveJoe/go,miolini/go,methane/go,zcwfeng/go,vsekhar/elastic-go,shishkander/go,yasarkunduz/go,arschles/go-1,samanalysis/go,magastzheng/go-1,danielsoro/go,yunkai/go,minux/goios,mapix/go,chinanjjohn2012/go,jonahglover/go,zcwfeng/go,agaurav/go,kakuhiroshi/go,yunkai/go,RBEGamer/go,zouchao2010/go,undergrowthlinear/go,jasonxiong/go,jefby/go,pgmreddy/go,samanalysis/go,dgnorton/go,uileyar/go,jacobxk/go,skatsuta/go,mwhudson/go,shawnl/go,yeyuguo/go,cloudrain21/go,polyverse-security/go,binarycrusader/go,mk0x9/go,nakedgc/go,momchil-velikov/go,stormltf/go,samanalysis/go,wangfakang/go-1,codestation/go,xiaobodu/go,9618211/go,sosop/go,willjunspecial/go,miolini/go,mapix/go,b54898533/go,theif519/go,qskycolor/go,youprofit/go,skatsuta/go,dterei/go,alash3al/go,ichu501/go,sosop/go,4ad/go,beealone/go,willjunspecial/go,4ad/go,gavinzhs/go,ganboing/go-esx,NichoZhang/go,goodlang/good,GeorgiCodes/go,magastzheng/go-1,agaurav/go,frobware/go,fjballest/golang,Badredapple/go,Cofyc/go,gavinzhs/go,yasarkunduz/go,alash3al/go,goodlang/good,xiuzhifu/go,sndnvaps/go,JioCloud/go,danielsoro/go,alash3al/go,fjballest/golang,ImJasonH/go,RBEGamer/go,Pulgafree/go,ganboing/go-esx,yunkai/go,gorcz/go,gorcz/go,lihuanghai/go,kakuhiroshi/go,9618211/go,jonasi/go,mwhudson/go,shines77/go,jonathanmarvens/go,alash3al/go,andrewchambers/go,Samurais/go,qskycolor/go,Samurais/go,joshuaprunier/go,dterei/go,sndnvaps/go,jasonxiong/go,agaurav/go,NunoEdgarGub1/go,vanloswang/go | viml | ## Code Before:
" Copyright 2013 The Go Authors. All rights reserved.
" Use of this source code is governed by a BSD-style
" license that can be found in the LICENSE file.
"
" go.vim: Vim filetype plugin for Go.
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
setlocal comments=s1:/*,mb:*,ex:*/,://
setlocal commentstring=//\ %s
let b:undo_ftplugin = "setl com< cms<"
" vim:ts=4:sw=4:et
## Instruction:
misc/vim: Disable automatic line wrapping by textwidth.
If someone configures a 'textwidth' in go files, vim will by default insert
newlines into long lines as you type, which breaks syntax and doesn't really
make sense for go code. This fixes the default.
LGTM=dsymonds
R=golang-codereviews, gobot, dsymonds
CC=golang-codereviews
https://golang.org/cl/76890046
## Code After:
" Copyright 2013 The Go Authors. All rights reserved.
" Use of this source code is governed by a BSD-style
" license that can be found in the LICENSE file.
"
" go.vim: Vim filetype plugin for Go.
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
setlocal formatoptions-=t
setlocal comments=s1:/*,mb:*,ex:*/,://
setlocal commentstring=//\ %s
let b:undo_ftplugin = "setl fo< com< cms<"
" vim:ts=4:sw=4:et
| " Copyright 2013 The Go Authors. All rights reserved.
" Use of this source code is governed by a BSD-style
" license that can be found in the LICENSE file.
"
" go.vim: Vim filetype plugin for Go.
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
+ setlocal formatoptions-=t
+
setlocal comments=s1:/*,mb:*,ex:*/,://
setlocal commentstring=//\ %s
- let b:undo_ftplugin = "setl com< cms<"
+ let b:undo_ftplugin = "setl fo< com< cms<"
? ++++
" vim:ts=4:sw=4:et | 4 | 0.235294 | 3 | 1 |
6aad5e09361382982f56a9a4507197bad7e5647e | tsconfig.json | tsconfig.json | {
"compilerOptions": {
"module": "commonjs",
"target": "es2016",
"sourceMap": true,
"experimentalDecorators": true
},
"files": [
"gulpfile",
"main",
"Lyricfier",
"render/plugins/SearchLyrics",
"render/plugins/SearchWikia",
"render/Searcher.ts",
"render/NormalizeTitles.ts",
"render/LyricfierRender.ts",
"render/SettingsRender.ts",
"render/SongRender.ts"
],
"exclude": [
"node_modules"
]
}
| {
"compilerOptions": {
"module": "commonjs",
"target": "es2016",
"sourceMap": true,
"experimentalDecorators": true
},
"files": [
"gulpfile.ts",
"main.ts",
"Lyricfier.ts",
"render/plugins/SearchLyrics.ts",
"render/plugins/SearchWikia.ts",
"render/Searcher.ts",
"render/NormalizeTitles.ts",
"render/LyricfierRender.ts",
"render/SettingsRender.ts",
"render/SongRender.ts"
],
"exclude": [
"node_modules"
]
}
| Fix typescript compiler throwing errors on missing files (though still builds successfully). | Fix typescript compiler throwing errors on missing files (though still builds successfully).
| JSON | cc0-1.0 | emilioastarita/lyricfier,emilioastarita/lyricfier | json | ## Code Before:
{
"compilerOptions": {
"module": "commonjs",
"target": "es2016",
"sourceMap": true,
"experimentalDecorators": true
},
"files": [
"gulpfile",
"main",
"Lyricfier",
"render/plugins/SearchLyrics",
"render/plugins/SearchWikia",
"render/Searcher.ts",
"render/NormalizeTitles.ts",
"render/LyricfierRender.ts",
"render/SettingsRender.ts",
"render/SongRender.ts"
],
"exclude": [
"node_modules"
]
}
## Instruction:
Fix typescript compiler throwing errors on missing files (though still builds successfully).
## Code After:
{
"compilerOptions": {
"module": "commonjs",
"target": "es2016",
"sourceMap": true,
"experimentalDecorators": true
},
"files": [
"gulpfile.ts",
"main.ts",
"Lyricfier.ts",
"render/plugins/SearchLyrics.ts",
"render/plugins/SearchWikia.ts",
"render/Searcher.ts",
"render/NormalizeTitles.ts",
"render/LyricfierRender.ts",
"render/SettingsRender.ts",
"render/SongRender.ts"
],
"exclude": [
"node_modules"
]
}
| {
"compilerOptions": {
"module": "commonjs",
"target": "es2016",
"sourceMap": true,
"experimentalDecorators": true
},
"files": [
- "gulpfile",
+ "gulpfile.ts",
? +++
- "main",
+ "main.ts",
? +++
- "Lyricfier",
+ "Lyricfier.ts",
? +++
- "render/plugins/SearchLyrics",
+ "render/plugins/SearchLyrics.ts",
? +++
- "render/plugins/SearchWikia",
+ "render/plugins/SearchWikia.ts",
? +++
"render/Searcher.ts",
"render/NormalizeTitles.ts",
"render/LyricfierRender.ts",
"render/SettingsRender.ts",
"render/SongRender.ts"
],
"exclude": [
"node_modules"
]
} | 10 | 0.434783 | 5 | 5 |
755ac5bf0eeb3372465aefe847d0d12237cded91 | lib/upsert-items.js | lib/upsert-items.js | import lodashFind from 'lodash/find';
import lodashMap from 'lodash/map';
import lodashExtend from 'lodash/extend';
import lodashEach from 'lodash/each';
export default (source, itemArg, opts) => {
const items = (itemArg instanceof Array) ? itemArg : [itemArg];
const insertedItems = [];
const updatedItemsIds = [];
let record;
lodashEach(items, item => {
record = lodashFind(source, record => record[opts.primaryKey] == item[opts.primaryKey]);
if (record) {
// update existing items
lodashExtend(record, item);
updatedItemsIds.push(record.id)
} else {
// collect new items
insertedItems.push(item);
}
});
const newInstances = opts.mapper ? lodashMap(insertedItems, opts.mapper) : insertedItems;
// insert new items
[].push.apply(source, newInstances);
return {
inserted: lodashMap(insertedItems, item => item.id),
updated: updatedItemsIds,
};
}; | import lodashFind from 'lodash/find';
import lodashMap from 'lodash/map';
import lodashExtend from 'lodash/extend';
import lodashEach from 'lodash/each';
export default (source, itemArg, opts) => {
const items = (itemArg instanceof Array) ? itemArg : [itemArg];
const insertedItems = [];
const updatedItemsIds = [];
let record;
lodashEach(items, item => {
record = lodashFind(source, record => record[opts.primaryKey] == item[opts.primaryKey]);
if (record) {
// update existing items
lodashExtend(record, item);
updatedItemsIds.push(record[opts.primaryKey])
} else {
// collect new items
insertedItems.push(item);
}
});
const newInstances = opts.mapper ? lodashMap(insertedItems, opts.mapper) : insertedItems;
// insert new items
[].push.apply(source, newInstances);
return {
inserted: lodashMap(insertedItems, item => item[opts.primaryKey]),
updated: updatedItemsIds,
};
}; | Fix result value ID key access | Fix result value ID key access
| JavaScript | mit | lukaszgrolik/merge-items | javascript | ## Code Before:
import lodashFind from 'lodash/find';
import lodashMap from 'lodash/map';
import lodashExtend from 'lodash/extend';
import lodashEach from 'lodash/each';
export default (source, itemArg, opts) => {
const items = (itemArg instanceof Array) ? itemArg : [itemArg];
const insertedItems = [];
const updatedItemsIds = [];
let record;
lodashEach(items, item => {
record = lodashFind(source, record => record[opts.primaryKey] == item[opts.primaryKey]);
if (record) {
// update existing items
lodashExtend(record, item);
updatedItemsIds.push(record.id)
} else {
// collect new items
insertedItems.push(item);
}
});
const newInstances = opts.mapper ? lodashMap(insertedItems, opts.mapper) : insertedItems;
// insert new items
[].push.apply(source, newInstances);
return {
inserted: lodashMap(insertedItems, item => item.id),
updated: updatedItemsIds,
};
};
## Instruction:
Fix result value ID key access
## Code After:
import lodashFind from 'lodash/find';
import lodashMap from 'lodash/map';
import lodashExtend from 'lodash/extend';
import lodashEach from 'lodash/each';
export default (source, itemArg, opts) => {
const items = (itemArg instanceof Array) ? itemArg : [itemArg];
const insertedItems = [];
const updatedItemsIds = [];
let record;
lodashEach(items, item => {
record = lodashFind(source, record => record[opts.primaryKey] == item[opts.primaryKey]);
if (record) {
// update existing items
lodashExtend(record, item);
updatedItemsIds.push(record[opts.primaryKey])
} else {
// collect new items
insertedItems.push(item);
}
});
const newInstances = opts.mapper ? lodashMap(insertedItems, opts.mapper) : insertedItems;
// insert new items
[].push.apply(source, newInstances);
return {
inserted: lodashMap(insertedItems, item => item[opts.primaryKey]),
updated: updatedItemsIds,
};
}; | import lodashFind from 'lodash/find';
import lodashMap from 'lodash/map';
import lodashExtend from 'lodash/extend';
import lodashEach from 'lodash/each';
export default (source, itemArg, opts) => {
const items = (itemArg instanceof Array) ? itemArg : [itemArg];
const insertedItems = [];
const updatedItemsIds = [];
let record;
lodashEach(items, item => {
record = lodashFind(source, record => record[opts.primaryKey] == item[opts.primaryKey]);
if (record) {
// update existing items
lodashExtend(record, item);
- updatedItemsIds.push(record.id)
? ^
+ updatedItemsIds.push(record[opts.primaryKey])
? +++++ ++ ^^^^^^^^
} else {
// collect new items
insertedItems.push(item);
}
});
const newInstances = opts.mapper ? lodashMap(insertedItems, opts.mapper) : insertedItems;
// insert new items
[].push.apply(source, newInstances);
return {
- inserted: lodashMap(insertedItems, item => item.id),
? ^
+ inserted: lodashMap(insertedItems, item => item[opts.primaryKey]),
? +++++ ++ ^^^^^^^^
updated: updatedItemsIds,
};
}; | 4 | 0.114286 | 2 | 2 |
b6c39617aa4c1e28f5254808d785a7c687148dc9 | app/models/concerns/course_user/achievements_concern.rb | app/models/concerns/course_user/achievements_concern.rb | module CourseUser::AchievementsConcern
# Order achievements based on when each course_user obtained the achievement.
def ordered_by_date_obtained
order('course_user_achievements.obtained_at DESC')
end
def recently_obtained(num = 3)
ordered_by_date_obtained.last(num)
end
end
| module CourseUser::AchievementsConcern
# Order achievements based on when each course_user obtained the achievement.
def ordered_by_date_obtained
unscope(:order).
order('course_user_achievements.obtained_at DESC')
end
def recently_obtained(num = 3)
ordered_by_date_obtained.last(num)
end
end
| Order achievement by date obtained only | Order achievement by date obtained only
| Ruby | mit | Coursemology/coursemology2,Coursemology/coursemology2,Coursemology/coursemology2,Coursemology/coursemology2,cysjonathan/coursemology2,Coursemology/coursemology2,cysjonathan/coursemology2,Coursemology/coursemology2,Coursemology/coursemology2,cysjonathan/coursemology2 | ruby | ## Code Before:
module CourseUser::AchievementsConcern
# Order achievements based on when each course_user obtained the achievement.
def ordered_by_date_obtained
order('course_user_achievements.obtained_at DESC')
end
def recently_obtained(num = 3)
ordered_by_date_obtained.last(num)
end
end
## Instruction:
Order achievement by date obtained only
## Code After:
module CourseUser::AchievementsConcern
# Order achievements based on when each course_user obtained the achievement.
def ordered_by_date_obtained
unscope(:order).
order('course_user_achievements.obtained_at DESC')
end
def recently_obtained(num = 3)
ordered_by_date_obtained.last(num)
end
end
| module CourseUser::AchievementsConcern
# Order achievements based on when each course_user obtained the achievement.
def ordered_by_date_obtained
+ unscope(:order).
order('course_user_achievements.obtained_at DESC')
end
def recently_obtained(num = 3)
ordered_by_date_obtained.last(num)
end
end | 1 | 0.1 | 1 | 0 |
83a8e16bd85bc9f398b013419fc1d976c39acea2 | app/styles/components/map-header.scss | app/styles/components/map-header.scss | .map-header {
width: 100%;
height: 195px;
background-color: $bd-light-gray;
background:transparent url('../images/map-placeholder.png') center no-repeat;
} | .map-header {
width: 100%;
// based on the golden ratio
height: 30.52vh;
// size of the action banner that overlays the map
min-height: 60px;
// 30.52% of the web view on iPhone 6
max-height: 195px;
background-color: $bd-light-gray;
background:transparent url('../images/map-placeholder.png') center no-repeat;
} | Add size constraints to the map section of the detail view | Add size constraints to the map section of the detail view
| SCSS | mit | bus-detective/web-client,bus-detective/web-client | scss | ## Code Before:
.map-header {
width: 100%;
height: 195px;
background-color: $bd-light-gray;
background:transparent url('../images/map-placeholder.png') center no-repeat;
}
## Instruction:
Add size constraints to the map section of the detail view
## Code After:
.map-header {
width: 100%;
// based on the golden ratio
height: 30.52vh;
// size of the action banner that overlays the map
min-height: 60px;
// 30.52% of the web view on iPhone 6
max-height: 195px;
background-color: $bd-light-gray;
background:transparent url('../images/map-placeholder.png') center no-repeat;
} | .map-header {
width: 100%;
+ // based on the golden ratio
+ height: 30.52vh;
+ // size of the action banner that overlays the map
+ min-height: 60px;
+ // 30.52% of the web view on iPhone 6
- height: 195px;
+ max-height: 195px;
? ++++
background-color: $bd-light-gray;
background:transparent url('../images/map-placeholder.png') center no-repeat;
} | 7 | 1.166667 | 6 | 1 |
fa1e92fdf2d74d083eb4242de5051b0274799a17 | BACKERS.md | BACKERS.md |
PostgREST ongoing development is only possible thanks to our Sponsors and Backers, listed below. If you'd like to join them, you can do so by supporting the PostgREST organization on [Patreon](https://www.patreon.com/postgrest).
## Lead Backers
- [Christiaan Westerbeek](https://devotis.nl)
- [Daniel Babiak](https://github.com/d-babiak)
## Backers
- Tsingson Qin
- Michel Pelletier
- Jay Hannah
|
PostgREST ongoing development is only possible thanks to our Sponsors and Backers, listed below. If you'd like to join them, you can do so by supporting the PostgREST organization on [Patreon](https://www.patreon.com/postgrest).
## Lead Backers
- [Christiaan Westerbeek](https://devotis.nl)
- [Daniel Babiak](https://github.com/d-babiak)
- [Michel Pelletier](https://github.com/michelp/)
## Backers
- Tsingson Qin
- Jay Hannah
| Add Lead Backer. Thank you Michel. | Add Lead Backer. Thank you Michel.
| Markdown | mit | steve-chavez/postgrest,diogob/postgrest,steve-chavez/postgrest,begriffs/postgrest | markdown | ## Code Before:
PostgREST ongoing development is only possible thanks to our Sponsors and Backers, listed below. If you'd like to join them, you can do so by supporting the PostgREST organization on [Patreon](https://www.patreon.com/postgrest).
## Lead Backers
- [Christiaan Westerbeek](https://devotis.nl)
- [Daniel Babiak](https://github.com/d-babiak)
## Backers
- Tsingson Qin
- Michel Pelletier
- Jay Hannah
## Instruction:
Add Lead Backer. Thank you Michel.
## Code After:
PostgREST ongoing development is only possible thanks to our Sponsors and Backers, listed below. If you'd like to join them, you can do so by supporting the PostgREST organization on [Patreon](https://www.patreon.com/postgrest).
## Lead Backers
- [Christiaan Westerbeek](https://devotis.nl)
- [Daniel Babiak](https://github.com/d-babiak)
- [Michel Pelletier](https://github.com/michelp/)
## Backers
- Tsingson Qin
- Jay Hannah
|
PostgREST ongoing development is only possible thanks to our Sponsors and Backers, listed below. If you'd like to join them, you can do so by supporting the PostgREST organization on [Patreon](https://www.patreon.com/postgrest).
## Lead Backers
- [Christiaan Westerbeek](https://devotis.nl)
- [Daniel Babiak](https://github.com/d-babiak)
+ - [Michel Pelletier](https://github.com/michelp/)
## Backers
- Tsingson Qin
- - Michel Pelletier
- Jay Hannah | 2 | 0.153846 | 1 | 1 |
fcb0497052a4a66b8524ead9e5b455de9cbe47bf | gulp/tasks/icon-font.coffee | gulp/tasks/icon-font.coffee |
gulp = require 'gulp'
plugins = require('gulp-load-plugins')()
config = require "../config.coffee"
#--------------------------------------------------------
# Icon Font
#--------------------------------------------------------
gulp.task "icon-font", ->
cssTemplateFilename = "icon-font-template.css"
cssOutputFilename = "_icons.styl"
fontName = "icons"
fontPath = "../fonts/"
className = "icon"
# Grab SVGs from 'svg' directory
fileSvgStream = gulp.src "#{config.sourcePath}/#{config.svgDirectory}/*.svg"
# Generate Font and CSS from all SVGs
fileSvgStream
.pipe(plugins.iconfont
fontName: "icons"
normalize: true
).on("codepoints", (codepoints, options) ->
gulp.src "#{config.sourcePath}/#{config.svgDirectory}/#{cssTemplateFilename}"
.pipe(plugins.consolidate "lodash",
glyphs: codepoints
fontName: fontName
fontPath: fontPath
className: className
).pipe plugins.rename cssOutputFilename
.pipe gulp.dest "#{config.sourcePath}/#{config.cssDirectory}"
).pipe gulp.dest "#{config.outputPath}/#{config.fontsDirectory}" |
gulp = require 'gulp'
plugins = require('gulp-load-plugins')()
config = require "../config.coffee"
#--------------------------------------------------------
# Icon Font
#--------------------------------------------------------
gulp.task "icon-font", ->
cssTemplateFilename = "icon-font-template.css"
cssOutputFilename = "_icons.styl"
fontName = "icons"
fontPath = "../fonts/"
className = "icon"
# Grab SVGs from 'svg' directory
fileSvgStream = gulp.src "#{config.sourcePath}/#{config.svgDirectory}/*.svg"
# Generate Font and CSS from all SVGs
fileSvgStream
.pipe(plugins.iconfont
fontName: fontName
normalize: true
).on("glyphs", (glyphs) ->
glyphs = glyphs.map((glyph) ->
name: glyph.name,
codepoint: glyph.unicode[0].charCodeAt(0)
)
gulp.src "#{config.sourcePath}/#{config.svgDirectory}/#{cssTemplateFilename}"
.pipe(plugins.consolidate "lodash",
glyphs: glyphs
fontName: fontName
fontPath: fontPath
className: className
)
.pipe plugins.rename cssOutputFilename
.pipe gulp.dest "#{config.sourcePath}/#{config.cssDirectory}"
).pipe gulp.dest "#{config.outputPath}/#{config.fontsDirectory}"
| Use new API for gulp-iconfont | Use new API for gulp-iconfont
| CoffeeScript | mit | adamwight/WikiEduDashboard,sejalkhatri/WikiEduDashboard,sejalkhatri/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,Wowu/WikiEduDashboard,majakomel/WikiEduDashboard,KarmaHater/WikiEduDashboard,adamwight/WikiEduDashboard,ragesoss/WikiEduDashboard,KarmaHater/WikiEduDashboard,majakomel/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,feelfreelinux/WikiEduDashboard,Wowu/WikiEduDashboard,KarmaHater/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,alpha721/WikiEduDashboard,MusikAnimal/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,WinnySilva/WikiEduDashboard,sejalkhatri/WikiEduDashboard,majakomel/WikiEduDashboard,alpha721/WikiEduDashboard,adamwight/WikiEduDashboard,MusikAnimal/WikiEduDashboard,alpha721/WikiEduDashboard,MusikAnimal/WikiEduDashboard,WinnySilva/WikiEduDashboard,feelfreelinux/WikiEduDashboard,ragesoss/WikiEduDashboard,ragesoss/WikiEduDashboard,MusikAnimal/WikiEduDashboard,sejalkhatri/WikiEduDashboard,KarmaHater/WikiEduDashboard,WinnySilva/WikiEduDashboard,Wowu/WikiEduDashboard,sejalkhatri/WikiEduDashboard,alpha721/WikiEduDashboard,Wowu/WikiEduDashboard,feelfreelinux/WikiEduDashboard,feelfreelinux/WikiEduDashboard,majakomel/WikiEduDashboard | coffeescript | ## Code Before:
gulp = require 'gulp'
plugins = require('gulp-load-plugins')()
config = require "../config.coffee"
#--------------------------------------------------------
# Icon Font
#--------------------------------------------------------
gulp.task "icon-font", ->
cssTemplateFilename = "icon-font-template.css"
cssOutputFilename = "_icons.styl"
fontName = "icons"
fontPath = "../fonts/"
className = "icon"
# Grab SVGs from 'svg' directory
fileSvgStream = gulp.src "#{config.sourcePath}/#{config.svgDirectory}/*.svg"
# Generate Font and CSS from all SVGs
fileSvgStream
.pipe(plugins.iconfont
fontName: "icons"
normalize: true
).on("codepoints", (codepoints, options) ->
gulp.src "#{config.sourcePath}/#{config.svgDirectory}/#{cssTemplateFilename}"
.pipe(plugins.consolidate "lodash",
glyphs: codepoints
fontName: fontName
fontPath: fontPath
className: className
).pipe plugins.rename cssOutputFilename
.pipe gulp.dest "#{config.sourcePath}/#{config.cssDirectory}"
).pipe gulp.dest "#{config.outputPath}/#{config.fontsDirectory}"
## Instruction:
Use new API for gulp-iconfont
## Code After:
gulp = require 'gulp'
plugins = require('gulp-load-plugins')()
config = require "../config.coffee"
#--------------------------------------------------------
# Icon Font
#--------------------------------------------------------
gulp.task "icon-font", ->
cssTemplateFilename = "icon-font-template.css"
cssOutputFilename = "_icons.styl"
fontName = "icons"
fontPath = "../fonts/"
className = "icon"
# Grab SVGs from 'svg' directory
fileSvgStream = gulp.src "#{config.sourcePath}/#{config.svgDirectory}/*.svg"
# Generate Font and CSS from all SVGs
fileSvgStream
.pipe(plugins.iconfont
fontName: fontName
normalize: true
).on("glyphs", (glyphs) ->
glyphs = glyphs.map((glyph) ->
name: glyph.name,
codepoint: glyph.unicode[0].charCodeAt(0)
)
gulp.src "#{config.sourcePath}/#{config.svgDirectory}/#{cssTemplateFilename}"
.pipe(plugins.consolidate "lodash",
glyphs: glyphs
fontName: fontName
fontPath: fontPath
className: className
)
.pipe plugins.rename cssOutputFilename
.pipe gulp.dest "#{config.sourcePath}/#{config.cssDirectory}"
).pipe gulp.dest "#{config.outputPath}/#{config.fontsDirectory}"
|
gulp = require 'gulp'
plugins = require('gulp-load-plugins')()
config = require "../config.coffee"
#--------------------------------------------------------
# Icon Font
#--------------------------------------------------------
gulp.task "icon-font", ->
cssTemplateFilename = "icon-font-template.css"
cssOutputFilename = "_icons.styl"
fontName = "icons"
fontPath = "../fonts/"
className = "icon"
# Grab SVGs from 'svg' directory
fileSvgStream = gulp.src "#{config.sourcePath}/#{config.svgDirectory}/*.svg"
# Generate Font and CSS from all SVGs
fileSvgStream
.pipe(plugins.iconfont
- fontName: "icons"
? ^^^ ^^
+ fontName: fontName
? ^ ^^^^^
normalize: true
- ).on("codepoints", (codepoints, options) ->
+ ).on("glyphs", (glyphs) ->
+ glyphs = glyphs.map((glyph) ->
+ name: glyph.name,
+ codepoint: glyph.unicode[0].charCodeAt(0)
+ )
gulp.src "#{config.sourcePath}/#{config.svgDirectory}/#{cssTemplateFilename}"
.pipe(plugins.consolidate "lodash",
- glyphs: codepoints
? ^^^^ ^^^^
+ glyphs: glyphs
? ^^^ ^
fontName: fontName
fontPath: fontPath
className: className
+ )
- ).pipe plugins.rename cssOutputFilename
? -
+ .pipe plugins.rename cssOutputFilename
.pipe gulp.dest "#{config.sourcePath}/#{config.cssDirectory}"
).pipe gulp.dest "#{config.outputPath}/#{config.fontsDirectory}" | 13 | 0.361111 | 9 | 4 |
705ccf213641f5a9daac20fb58f753140f2c81df | kustomize/overlays/uat/service.yaml | kustomize/overlays/uat/service.yaml | apiVersion: v1
kind: Service
metadata:
name: ibms
spec:
type: ClusterIP
clusterIP: None
ports:
- name: default
port: 42
protocol: TCP
targetPort: 42
selector:
app: ibms
---
apiVersion: v1
kind: Service
metadata:
name: ingress-ibms
spec:
type: ClusterIP
ports:
- name: wsgi
port: 8080
protocol: TCP
targetPort: 8080
selector:
app: ibms
| apiVersion: v1
kind: Service
metadata:
name: ibms
spec:
type: ClusterIP
clusterIP: None
ports:
- name: default
port: 42
protocol: TCP
targetPort: 42
selector:
app: ibms
---
apiVersion: v1
kind: Service
metadata:
name: ingress-ibms
spec:
type: ClusterIP
ports:
- name: wsgi
port: 8080
protocol: TCP
targetPort: 8080
selector:
app: ibms
---
apiVersion: v1
kind: Service
metadata:
name: ibms-db
spec:
type: ClusterIP
clusterIP: None
ports:
- name: default
port: 42
protocol: TCP
targetPort: 42
selector:
workloadselector: ibms-db
| Add Service for ibms-db workload. | Add Service for ibms-db workload.
| YAML | apache-2.0 | parksandwildlife/ibms,parksandwildlife/ibms,parksandwildlife/ibms | yaml | ## Code Before:
apiVersion: v1
kind: Service
metadata:
name: ibms
spec:
type: ClusterIP
clusterIP: None
ports:
- name: default
port: 42
protocol: TCP
targetPort: 42
selector:
app: ibms
---
apiVersion: v1
kind: Service
metadata:
name: ingress-ibms
spec:
type: ClusterIP
ports:
- name: wsgi
port: 8080
protocol: TCP
targetPort: 8080
selector:
app: ibms
## Instruction:
Add Service for ibms-db workload.
## Code After:
apiVersion: v1
kind: Service
metadata:
name: ibms
spec:
type: ClusterIP
clusterIP: None
ports:
- name: default
port: 42
protocol: TCP
targetPort: 42
selector:
app: ibms
---
apiVersion: v1
kind: Service
metadata:
name: ingress-ibms
spec:
type: ClusterIP
ports:
- name: wsgi
port: 8080
protocol: TCP
targetPort: 8080
selector:
app: ibms
---
apiVersion: v1
kind: Service
metadata:
name: ibms-db
spec:
type: ClusterIP
clusterIP: None
ports:
- name: default
port: 42
protocol: TCP
targetPort: 42
selector:
workloadselector: ibms-db
| apiVersion: v1
kind: Service
metadata:
name: ibms
spec:
type: ClusterIP
clusterIP: None
ports:
- name: default
port: 42
protocol: TCP
targetPort: 42
selector:
app: ibms
---
apiVersion: v1
kind: Service
metadata:
name: ingress-ibms
spec:
type: ClusterIP
ports:
- name: wsgi
port: 8080
protocol: TCP
targetPort: 8080
selector:
app: ibms
+ ---
+ apiVersion: v1
+ kind: Service
+ metadata:
+ name: ibms-db
+ spec:
+ type: ClusterIP
+ clusterIP: None
+ ports:
+ - name: default
+ port: 42
+ protocol: TCP
+ targetPort: 42
+ selector:
+ workloadselector: ibms-db | 15 | 0.535714 | 15 | 0 |
f479e236f5ac9a1a035d83dfa6d3bcec148a3871 | app/styles/day.styl | app/styles/day.styl | .day
border 1px solid #eee
display flex
ul
padding .5em
.day-date
border-right 1px solid #ddd
font-size .8em
min-width 2.5em
padding .5em
text-align right
.day-weekend
background #eee !important
.event-list
flex-grow 1
list-style none
margin 0
padding 0
.event
display flex
position relative
&:hover
background #ddd
cursor pointer
.event-snippet
flex-grow 1
.event-location, .event-tags
font-size .8em
.event-gravatar
display inline-block
img
display block
vertical-align middle
.event-bars
width 20px
margin -1px 0
display flex
.event-bar
flex-basis 12%
flex-grow 1
// pop over
.event-pop-over
background #eee
border 1px solid #ccc
box-shadow 0px 5px 5px rgba(0, 0, 0, .1)
display none
left 100%
min-width 15em
padding 1em
position absolute
z-index 1
.event-title
font-size 1.2em
font-weight bold
margin-bottom 1em
.event-dates, .event-location, .event-tags
font-size 1em
margin .5em 0
.event:hover
.event-pop-over
display block
| .day
border 1px solid #eee
display flex
ul
padding .5em
.day-date
border-right 1px solid #ddd
font-size .8em
min-width 2.5em
padding .5em
text-align right
.day-weekend
background #eee !important
.event-list
flex-grow 1
list-style none
margin 0
padding 0
.event
display flex
position relative
&:hover
background #ddd
cursor pointer
.event-snippet
flex-grow 1
.event-location, .event-tags
font-size .8em
.event-gravatar
display inline-block
img
display block
vertical-align middle
.event-bars
width 20px
margin -1px 0
display flex
.event-bar
flex-basis 12%
flex-grow 1
// pop over
.event-pop-over
background #eee
border 1px solid #ccc
box-shadow 0px 5px 5px rgba(0, 0, 0, .1)
display none
left calc(100% + 1em)
min-width 15em
padding 1em
position absolute
z-index 1
.event-title
font-size 1.2em
font-weight bold
margin-bottom 1em
.event-dates, .event-location, .event-tags
font-size 1em
margin .5em 0
.event:hover
.event-pop-over
display block
| Add more space for popup | Add more space for popup
| Stylus | mit | byteclubfr/bc-planner,lmtm/bc-planner,lmtm/bc-planner,byteclubfr/bc-planner | stylus | ## Code Before:
.day
border 1px solid #eee
display flex
ul
padding .5em
.day-date
border-right 1px solid #ddd
font-size .8em
min-width 2.5em
padding .5em
text-align right
.day-weekend
background #eee !important
.event-list
flex-grow 1
list-style none
margin 0
padding 0
.event
display flex
position relative
&:hover
background #ddd
cursor pointer
.event-snippet
flex-grow 1
.event-location, .event-tags
font-size .8em
.event-gravatar
display inline-block
img
display block
vertical-align middle
.event-bars
width 20px
margin -1px 0
display flex
.event-bar
flex-basis 12%
flex-grow 1
// pop over
.event-pop-over
background #eee
border 1px solid #ccc
box-shadow 0px 5px 5px rgba(0, 0, 0, .1)
display none
left 100%
min-width 15em
padding 1em
position absolute
z-index 1
.event-title
font-size 1.2em
font-weight bold
margin-bottom 1em
.event-dates, .event-location, .event-tags
font-size 1em
margin .5em 0
.event:hover
.event-pop-over
display block
## Instruction:
Add more space for popup
## Code After:
.day
border 1px solid #eee
display flex
ul
padding .5em
.day-date
border-right 1px solid #ddd
font-size .8em
min-width 2.5em
padding .5em
text-align right
.day-weekend
background #eee !important
.event-list
flex-grow 1
list-style none
margin 0
padding 0
.event
display flex
position relative
&:hover
background #ddd
cursor pointer
.event-snippet
flex-grow 1
.event-location, .event-tags
font-size .8em
.event-gravatar
display inline-block
img
display block
vertical-align middle
.event-bars
width 20px
margin -1px 0
display flex
.event-bar
flex-basis 12%
flex-grow 1
// pop over
.event-pop-over
background #eee
border 1px solid #ccc
box-shadow 0px 5px 5px rgba(0, 0, 0, .1)
display none
left calc(100% + 1em)
min-width 15em
padding 1em
position absolute
z-index 1
.event-title
font-size 1.2em
font-weight bold
margin-bottom 1em
.event-dates, .event-location, .event-tags
font-size 1em
margin .5em 0
.event:hover
.event-pop-over
display block
| .day
border 1px solid #eee
display flex
ul
padding .5em
.day-date
border-right 1px solid #ddd
font-size .8em
min-width 2.5em
padding .5em
text-align right
.day-weekend
background #eee !important
.event-list
flex-grow 1
list-style none
margin 0
padding 0
.event
display flex
position relative
&:hover
background #ddd
cursor pointer
.event-snippet
flex-grow 1
.event-location, .event-tags
font-size .8em
.event-gravatar
display inline-block
img
display block
vertical-align middle
.event-bars
width 20px
margin -1px 0
display flex
.event-bar
flex-basis 12%
flex-grow 1
// pop over
.event-pop-over
background #eee
border 1px solid #ccc
box-shadow 0px 5px 5px rgba(0, 0, 0, .1)
display none
- left 100%
+ left calc(100% + 1em)
min-width 15em
padding 1em
position absolute
z-index 1
.event-title
font-size 1.2em
font-weight bold
margin-bottom 1em
.event-dates, .event-location, .event-tags
font-size 1em
margin .5em 0
.event:hover
.event-pop-over
display block | 2 | 0.026667 | 1 | 1 |
e4d2e040f8436ddc8cb5bfa13e9358712fecec04 | main.go | main.go | package main
import (
"github.com/codegangsta/negroni"
"github.com/digital-ocean-service/interfaces"
"github.com/digital-ocean-service/usecases"
"github.com/gorilla/mux"
)
func main() {
doInteractor := usecases.DOInteractor{}
handler := interfaces.WebServiceHandler{
Interactor: doInteractor,
ID: "",
Secret: "",
RedirectURI: "http://localhost:7000/do_callback",
}
r := mux.NewRouter()
r.HandleFunc("/", handler.Login)
r.HandleFunc("/do_callback", handler.DOCallback).Methods("GET")
r.HandleFunc("/keys", handler.ShowKeys).Methods("GET")
r.HandleFunc("/keys", handler.CreateKey).Methods("POST")
r.HandleFunc("/droplets", handler.CreateDroplet).Methods("POST")
r.HandleFunc("/droplets", handler.ListDroplets).Methods("GET")
n := negroni.Classic()
n.UseHandler(r)
n.Run(":7000")
}
| package main
import (
"bytes"
"flag"
"fmt"
"github.com/codegangsta/negroni"
"github.com/digital-ocean-service/infraestructure"
"github.com/digital-ocean-service/interfaces"
"github.com/digital-ocean-service/usecases"
"github.com/gorilla/mux"
)
const defaultPath = "/etc/digital-ocean-service.conf"
var confFilePath = flag.String("conf", defaultPath, "Custom path for configuration file")
func main() {
flag.Parse()
config, err := infraestructure.GetConfiguration(*confFilePath)
if err != nil {
fmt.Println(err.Error())
panic("Cannot parse configuration")
}
doInteractor := usecases.DOInteractor{}
handler := interfaces.WebServiceHandler{
Interactor: doInteractor,
ID: config.ClientID,
Secret: config.ClientSecret,
Scopes: config.Scopes,
RedirectURI: config.RedirectURI,
}
r := mux.NewRouter()
r.HandleFunc("/", handler.Login)
r.HandleFunc("/do_callback", handler.DOCallback).Methods("GET")
r.HandleFunc("/keys", handler.ShowKeys).Methods("GET")
r.HandleFunc("/keys", handler.CreateKey).Methods("POST")
r.HandleFunc("/droplets", handler.CreateDroplet).Methods("POST")
r.HandleFunc("/droplets", handler.ListDroplets).Methods("GET")
n := negroni.Classic()
n.UseHandler(r)
port := bytes.Buffer{}
port.WriteString(":")
port.WriteString(config.Port)
n.Run(port.String())
}
| Read Dependencies and inject them | Read Dependencies and inject them
- Create a default route
- Create a flag to customize the route of conf file
- Build the port string
| Go | mit | Tinker-Ware/digital-ocean-service,Infrastructure-Solutions/digital-ocean-service | go | ## Code Before:
package main
import (
"github.com/codegangsta/negroni"
"github.com/digital-ocean-service/interfaces"
"github.com/digital-ocean-service/usecases"
"github.com/gorilla/mux"
)
func main() {
doInteractor := usecases.DOInteractor{}
handler := interfaces.WebServiceHandler{
Interactor: doInteractor,
ID: "",
Secret: "",
RedirectURI: "http://localhost:7000/do_callback",
}
r := mux.NewRouter()
r.HandleFunc("/", handler.Login)
r.HandleFunc("/do_callback", handler.DOCallback).Methods("GET")
r.HandleFunc("/keys", handler.ShowKeys).Methods("GET")
r.HandleFunc("/keys", handler.CreateKey).Methods("POST")
r.HandleFunc("/droplets", handler.CreateDroplet).Methods("POST")
r.HandleFunc("/droplets", handler.ListDroplets).Methods("GET")
n := negroni.Classic()
n.UseHandler(r)
n.Run(":7000")
}
## Instruction:
Read Dependencies and inject them
- Create a default route
- Create a flag to customize the route of conf file
- Build the port string
## Code After:
package main
import (
"bytes"
"flag"
"fmt"
"github.com/codegangsta/negroni"
"github.com/digital-ocean-service/infraestructure"
"github.com/digital-ocean-service/interfaces"
"github.com/digital-ocean-service/usecases"
"github.com/gorilla/mux"
)
const defaultPath = "/etc/digital-ocean-service.conf"
var confFilePath = flag.String("conf", defaultPath, "Custom path for configuration file")
func main() {
flag.Parse()
config, err := infraestructure.GetConfiguration(*confFilePath)
if err != nil {
fmt.Println(err.Error())
panic("Cannot parse configuration")
}
doInteractor := usecases.DOInteractor{}
handler := interfaces.WebServiceHandler{
Interactor: doInteractor,
ID: config.ClientID,
Secret: config.ClientSecret,
Scopes: config.Scopes,
RedirectURI: config.RedirectURI,
}
r := mux.NewRouter()
r.HandleFunc("/", handler.Login)
r.HandleFunc("/do_callback", handler.DOCallback).Methods("GET")
r.HandleFunc("/keys", handler.ShowKeys).Methods("GET")
r.HandleFunc("/keys", handler.CreateKey).Methods("POST")
r.HandleFunc("/droplets", handler.CreateDroplet).Methods("POST")
r.HandleFunc("/droplets", handler.ListDroplets).Methods("GET")
n := negroni.Classic()
n.UseHandler(r)
port := bytes.Buffer{}
port.WriteString(":")
port.WriteString(config.Port)
n.Run(port.String())
}
| package main
import (
+ "bytes"
+ "flag"
+ "fmt"
+
"github.com/codegangsta/negroni"
+ "github.com/digital-ocean-service/infraestructure"
"github.com/digital-ocean-service/interfaces"
"github.com/digital-ocean-service/usecases"
"github.com/gorilla/mux"
)
+ const defaultPath = "/etc/digital-ocean-service.conf"
+
+ var confFilePath = flag.String("conf", defaultPath, "Custom path for configuration file")
+
func main() {
+
+ flag.Parse()
+
+ config, err := infraestructure.GetConfiguration(*confFilePath)
+ if err != nil {
+ fmt.Println(err.Error())
+ panic("Cannot parse configuration")
+ }
+
doInteractor := usecases.DOInteractor{}
handler := interfaces.WebServiceHandler{
Interactor: doInteractor,
- ID: "",
- Secret: "",
- RedirectURI: "http://localhost:7000/do_callback",
+ ID: config.ClientID,
+ Secret: config.ClientSecret,
+ Scopes: config.Scopes,
+ RedirectURI: config.RedirectURI,
}
r := mux.NewRouter()
r.HandleFunc("/", handler.Login)
r.HandleFunc("/do_callback", handler.DOCallback).Methods("GET")
r.HandleFunc("/keys", handler.ShowKeys).Methods("GET")
r.HandleFunc("/keys", handler.CreateKey).Methods("POST")
r.HandleFunc("/droplets", handler.CreateDroplet).Methods("POST")
r.HandleFunc("/droplets", handler.ListDroplets).Methods("GET")
n := negroni.Classic()
n.UseHandler(r)
- n.Run(":7000")
+
+ port := bytes.Buffer{}
+
+ port.WriteString(":")
+ port.WriteString(config.Port)
+
+ n.Run(port.String())
} | 33 | 1.03125 | 29 | 4 |
e7c6280b26e21743fa22ae10c9ee98b665f75464 | Gruntfile.js | Gruntfile.js | /* jshint: node:true */
module.exports = function (grunt) {
'use strict';
grunt.initConfig({
phplint: {
application: ["lib/*.php", "tests/**/*.php"]
},
phpcs: {
application: {
src: 'lib/*.php'
},
options: {
standard: 'PSR1',
showSniffCodes: true,
verbose: true
}
},
phpunit: {
application: {
dir: 'tests/'
},
options: {
colors: true,
coverage: true
}
},
phpcpd: {
application: {
dir: 'lib/'
},
options: {
quiet: true
}
},
phpmd: {
application: {
dir: 'lib/'
},
options: {
rulesets: 'codesize,unusedcode,naming,design'
}
}
});
grunt.loadNpmTasks('grunt-phpcs');
grunt.loadNpmTasks('grunt-phplint');
grunt.loadNpmTasks('grunt-phpunit');
grunt.loadNpmTasks('grunt-phpcpd');
grunt.loadNpmTasks('grunt-phpmd');
grunt.registerTask("default", [
"phplint",
"phpunit",
"phpcpd"
]);
}; | /* jshint: node:true */
module.exports = function (grunt) {
'use strict';
grunt.initConfig({
phplint: {
application: ["lib/*.php", "tests/**/*.php"]
},
phpcs: {
application: {
src: 'lib/*.php'
},
options: {
standard: 'PSR1',
showSniffCodes: true,
verbose: true
}
},
phpunit: {
application: {
dir: 'tests/'
},
options: {
colors: true,
coverage: true
}
},
phpcpd: {
application: {
dir: 'lib/'
},
options: {
quiet: true
}
},
phpmd: {
application: {
dir: 'lib/'
},
options: {
rulesets: 'codesize,unusedcode,naming,design'
}
}
});
grunt.loadNpmTasks('grunt-phpcs');
grunt.loadNpmTasks('grunt-phplint');
grunt.loadNpmTasks('grunt-phpunit');
grunt.loadNpmTasks('grunt-phpcpd');
grunt.loadNpmTasks('grunt-phpmd');
grunt.registerTask("default", [
"phplint",
"phpunit",
"phpcpd"
]);
grunt.registerTask('travis', [
"phplint",
"phpunit",
"phpcpd"
]);
}; | Add task for Travis CI | Add task for Travis CI
| JavaScript | mpl-2.0 | RinkAttendant6/JsonI18n | javascript | ## Code Before:
/* jshint: node:true */
module.exports = function (grunt) {
'use strict';
grunt.initConfig({
phplint: {
application: ["lib/*.php", "tests/**/*.php"]
},
phpcs: {
application: {
src: 'lib/*.php'
},
options: {
standard: 'PSR1',
showSniffCodes: true,
verbose: true
}
},
phpunit: {
application: {
dir: 'tests/'
},
options: {
colors: true,
coverage: true
}
},
phpcpd: {
application: {
dir: 'lib/'
},
options: {
quiet: true
}
},
phpmd: {
application: {
dir: 'lib/'
},
options: {
rulesets: 'codesize,unusedcode,naming,design'
}
}
});
grunt.loadNpmTasks('grunt-phpcs');
grunt.loadNpmTasks('grunt-phplint');
grunt.loadNpmTasks('grunt-phpunit');
grunt.loadNpmTasks('grunt-phpcpd');
grunt.loadNpmTasks('grunt-phpmd');
grunt.registerTask("default", [
"phplint",
"phpunit",
"phpcpd"
]);
};
## Instruction:
Add task for Travis CI
## Code After:
/* jshint: node:true */
module.exports = function (grunt) {
'use strict';
grunt.initConfig({
phplint: {
application: ["lib/*.php", "tests/**/*.php"]
},
phpcs: {
application: {
src: 'lib/*.php'
},
options: {
standard: 'PSR1',
showSniffCodes: true,
verbose: true
}
},
phpunit: {
application: {
dir: 'tests/'
},
options: {
colors: true,
coverage: true
}
},
phpcpd: {
application: {
dir: 'lib/'
},
options: {
quiet: true
}
},
phpmd: {
application: {
dir: 'lib/'
},
options: {
rulesets: 'codesize,unusedcode,naming,design'
}
}
});
grunt.loadNpmTasks('grunt-phpcs');
grunt.loadNpmTasks('grunt-phplint');
grunt.loadNpmTasks('grunt-phpunit');
grunt.loadNpmTasks('grunt-phpcpd');
grunt.loadNpmTasks('grunt-phpmd');
grunt.registerTask("default", [
"phplint",
"phpunit",
"phpcpd"
]);
grunt.registerTask('travis', [
"phplint",
"phpunit",
"phpcpd"
]);
}; | /* jshint: node:true */
module.exports = function (grunt) {
'use strict';
grunt.initConfig({
phplint: {
application: ["lib/*.php", "tests/**/*.php"]
},
phpcs: {
application: {
src: 'lib/*.php'
},
options: {
standard: 'PSR1',
showSniffCodes: true,
verbose: true
}
},
phpunit: {
application: {
dir: 'tests/'
},
options: {
colors: true,
coverage: true
}
},
phpcpd: {
application: {
dir: 'lib/'
},
options: {
quiet: true
}
},
phpmd: {
application: {
dir: 'lib/'
},
options: {
rulesets: 'codesize,unusedcode,naming,design'
}
}
});
grunt.loadNpmTasks('grunt-phpcs');
grunt.loadNpmTasks('grunt-phplint');
grunt.loadNpmTasks('grunt-phpunit');
grunt.loadNpmTasks('grunt-phpcpd');
grunt.loadNpmTasks('grunt-phpmd');
grunt.registerTask("default", [
"phplint",
"phpunit",
"phpcpd"
]);
+
+ grunt.registerTask('travis', [
+ "phplint",
+ "phpunit",
+ "phpcpd"
+ ]);
}; | 6 | 0.105263 | 6 | 0 |
d5c296197c7f5b422f44e58f8e58ead5fdc5c2ad | reports/models.py | reports/models.py | from datetime import datetime
from django.db import models
from django.utils.translation import ugettext_lazy as _
class Report(models.Model):
addressed_to = models.TextField()
reported_from = models.ForeignKey('members.User')
content = models.TextField()
created_at = models.DateField(_("Date"), default=datetime.now())
copies = models.ManyToManyField('protocols.Topic')
signed_from = models.CharField(max_length=64)
def __unicode__(self):
return self.addressed_to
def get_copies(self):
return "\n".join([c.name for c in self.copies.all()])
| from datetime import datetime
from django.db import models
class Report(models.Model):
addressed_to = models.TextField()
reported_from = models.ForeignKey('members.User')
content = models.TextField()
created_at = models.DateField(default=datetime.now)
copies = models.ManyToManyField('protocols.Topic')
signed_from = models.CharField(max_length=64)
def __unicode__(self):
return self.addressed_to
def get_copies(self):
return "\n".join([c.name for c in self.copies.all()])
| Add new initial migration for reports | Add new initial migration for reports
| Python | mit | Hackfmi/Diaphanum,Hackfmi/Diaphanum | python | ## Code Before:
from datetime import datetime
from django.db import models
from django.utils.translation import ugettext_lazy as _
class Report(models.Model):
addressed_to = models.TextField()
reported_from = models.ForeignKey('members.User')
content = models.TextField()
created_at = models.DateField(_("Date"), default=datetime.now())
copies = models.ManyToManyField('protocols.Topic')
signed_from = models.CharField(max_length=64)
def __unicode__(self):
return self.addressed_to
def get_copies(self):
return "\n".join([c.name for c in self.copies.all()])
## Instruction:
Add new initial migration for reports
## Code After:
from datetime import datetime
from django.db import models
class Report(models.Model):
addressed_to = models.TextField()
reported_from = models.ForeignKey('members.User')
content = models.TextField()
created_at = models.DateField(default=datetime.now)
copies = models.ManyToManyField('protocols.Topic')
signed_from = models.CharField(max_length=64)
def __unicode__(self):
return self.addressed_to
def get_copies(self):
return "\n".join([c.name for c in self.copies.all()])
| from datetime import datetime
-
from django.db import models
- from django.utils.translation import ugettext_lazy as _
class Report(models.Model):
addressed_to = models.TextField()
reported_from = models.ForeignKey('members.User')
content = models.TextField()
- created_at = models.DateField(_("Date"), default=datetime.now())
? ----------- - -
+ created_at = models.DateField(default=datetime.now)
copies = models.ManyToManyField('protocols.Topic')
signed_from = models.CharField(max_length=64)
def __unicode__(self):
return self.addressed_to
def get_copies(self):
return "\n".join([c.name for c in self.copies.all()]) | 4 | 0.210526 | 1 | 3 |
c2dd7454a12a5cc1b6374205a32fd4f23432ae1f | Build/scripts/pgo/post_pgo.cmd | Build/scripts/pgo/post_pgo.cmd | ::-------------------------------------------------------------------------------------------------------
:: Copyright (C) Microsoft. All rights reserved.
:: Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
::-------------------------------------------------------------------------------------------------------
:: PGO Build Workflow:
:: - pre_pgi.cmd
:: - build (with PGI instrumentation enabled)
:: - post_pgi.cmd
:: - pogo_training.ps1
:: - pre_pgo.cmd
:: - build (using PGO profile)
:: * post_pgo.cmd
@echo off
if "%PogoConfig%"=="False" (
echo ---- Not a Pogo Config. Skipping step.
exit /b 0
)
set binpath_pgo=%1
if "%binpath_pgo%"=="" (
goto:usage
)
set POGO_TYPE=
REM Clean binaries we no longer need
if exist %binpath_pgo%\*.pgc ( del %binpath_pgo%\*.pgc )
if exist %binpath_pgo%\*.pgd ( del %binpath_pgo%\*.pgd )
if exist %binpath_pgo%\pgort* ( del %binpath_pgo%\pgort* )
goto:eof
:usage
echo Invalid/missing arguments
echo.
echo Usage: post_pgo.cmd ^<binary_path^>
echo - binary_path: output path of your binaries
exit /b 1
| ::-------------------------------------------------------------------------------------------------------
:: Copyright (C) Microsoft. All rights reserved.
:: Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
::-------------------------------------------------------------------------------------------------------
:: PGO Build Workflow:
:: - pre_pgi.cmd
:: - build (with PGI instrumentation enabled)
:: - post_pgi.cmd
:: - pogo_training.ps1
:: - pre_pgo.cmd
:: - build (using PGO profile)
:: * post_pgo.cmd
@echo off
if "%PogoConfig%"=="False" (
echo ---- Not a Pogo Config. Skipping step.
exit /b 0
)
set binpath_pgo=%1
if "%binpath_pgo%"=="" (
goto:usage
)
set POGO_TYPE=
REM Clean binaries we no longer need
if exist %binpath_pgo%\*.lib ( del %binpath_pgo%\*.lib )
if exist %binpath_pgo%\*.pgc ( del %binpath_pgo%\*.pgc )
if exist %binpath_pgo%\*.pgd ( del %binpath_pgo%\*.pgd )
if exist %binpath_pgo%\pgort* ( del %binpath_pgo%\pgort* )
goto:eof
:usage
echo Invalid/missing arguments
echo.
echo Usage: post_pgo.cmd ^<binary_path^>
echo - binary_path: output path of your binaries
exit /b 1
| Remove .lib artifact from pogo build | Remove .lib artifact from pogo build
| Batchfile | mit | mrkmarron/ChakraCore,Microsoft/ChakraCore,mrkmarron/ChakraCore,mrkmarron/ChakraCore,Microsoft/ChakraCore,mrkmarron/ChakraCore,Microsoft/ChakraCore,Microsoft/ChakraCore,Microsoft/ChakraCore,mrkmarron/ChakraCore,mrkmarron/ChakraCore,Microsoft/ChakraCore,mrkmarron/ChakraCore | batchfile | ## Code Before:
::-------------------------------------------------------------------------------------------------------
:: Copyright (C) Microsoft. All rights reserved.
:: Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
::-------------------------------------------------------------------------------------------------------
:: PGO Build Workflow:
:: - pre_pgi.cmd
:: - build (with PGI instrumentation enabled)
:: - post_pgi.cmd
:: - pogo_training.ps1
:: - pre_pgo.cmd
:: - build (using PGO profile)
:: * post_pgo.cmd
@echo off
if "%PogoConfig%"=="False" (
echo ---- Not a Pogo Config. Skipping step.
exit /b 0
)
set binpath_pgo=%1
if "%binpath_pgo%"=="" (
goto:usage
)
set POGO_TYPE=
REM Clean binaries we no longer need
if exist %binpath_pgo%\*.pgc ( del %binpath_pgo%\*.pgc )
if exist %binpath_pgo%\*.pgd ( del %binpath_pgo%\*.pgd )
if exist %binpath_pgo%\pgort* ( del %binpath_pgo%\pgort* )
goto:eof
:usage
echo Invalid/missing arguments
echo.
echo Usage: post_pgo.cmd ^<binary_path^>
echo - binary_path: output path of your binaries
exit /b 1
## Instruction:
Remove .lib artifact from pogo build
## Code After:
::-------------------------------------------------------------------------------------------------------
:: Copyright (C) Microsoft. All rights reserved.
:: Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
::-------------------------------------------------------------------------------------------------------
:: PGO Build Workflow:
:: - pre_pgi.cmd
:: - build (with PGI instrumentation enabled)
:: - post_pgi.cmd
:: - pogo_training.ps1
:: - pre_pgo.cmd
:: - build (using PGO profile)
:: * post_pgo.cmd
@echo off
if "%PogoConfig%"=="False" (
echo ---- Not a Pogo Config. Skipping step.
exit /b 0
)
set binpath_pgo=%1
if "%binpath_pgo%"=="" (
goto:usage
)
set POGO_TYPE=
REM Clean binaries we no longer need
if exist %binpath_pgo%\*.lib ( del %binpath_pgo%\*.lib )
if exist %binpath_pgo%\*.pgc ( del %binpath_pgo%\*.pgc )
if exist %binpath_pgo%\*.pgd ( del %binpath_pgo%\*.pgd )
if exist %binpath_pgo%\pgort* ( del %binpath_pgo%\pgort* )
goto:eof
:usage
echo Invalid/missing arguments
echo.
echo Usage: post_pgo.cmd ^<binary_path^>
echo - binary_path: output path of your binaries
exit /b 1
| ::-------------------------------------------------------------------------------------------------------
:: Copyright (C) Microsoft. All rights reserved.
:: Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
::-------------------------------------------------------------------------------------------------------
:: PGO Build Workflow:
:: - pre_pgi.cmd
:: - build (with PGI instrumentation enabled)
:: - post_pgi.cmd
:: - pogo_training.ps1
:: - pre_pgo.cmd
:: - build (using PGO profile)
:: * post_pgo.cmd
@echo off
if "%PogoConfig%"=="False" (
echo ---- Not a Pogo Config. Skipping step.
exit /b 0
)
set binpath_pgo=%1
if "%binpath_pgo%"=="" (
goto:usage
)
set POGO_TYPE=
REM Clean binaries we no longer need
+ if exist %binpath_pgo%\*.lib ( del %binpath_pgo%\*.lib )
if exist %binpath_pgo%\*.pgc ( del %binpath_pgo%\*.pgc )
if exist %binpath_pgo%\*.pgd ( del %binpath_pgo%\*.pgd )
if exist %binpath_pgo%\pgort* ( del %binpath_pgo%\pgort* )
goto:eof
:usage
echo Invalid/missing arguments
echo.
echo Usage: post_pgo.cmd ^<binary_path^>
echo - binary_path: output path of your binaries
exit /b 1 | 1 | 0.023256 | 1 | 0 |
10be5787d80620438294e22758c45a4d37207393 | website/_config.yml | website/_config.yml | title: Project Chrono
email: info@projectchrono.org
description: Website for Project Chrono
baseurl: "" # the subpath of your site, e.g. /blog/
url: "https://projectchrono.org" # the base hostname & protocol for your site
twitter_username: projectchrono
github_username: projectchrono
permalink: /blog/:year/:month/:title/
# Build settings
markdown: kramdown
highlighter: rouge | title: Project Chrono - An Open Source Physics Engine
email: info@projectchrono.org
description: Project Chrono is a physics-based modelling and simulation infrastructure based on a platform-independent, open-source design.
baseurl: "" # the subpath of your site, e.g. /blog/
url: "https://projectchrono.org" # the base hostname & protocol for your site
twitter_username: projectchrono
github_username: projectchrono
permalink: /blog/:year/:month/:title/
# Build settings
markdown: kramdown
highlighter: rouge
gems: [jekyll-sitemap] | Update page title and description Add jekyll sitemap gem to generate sitemap | Update page title and description
Add jekyll sitemap gem to generate sitemap
| YAML | bsd-3-clause | rserban/chrono,tjolsen/chrono,tjolsen/chrono,jcmadsen/chrono,Milad-Rakhsha/chrono,Milad-Rakhsha/chrono,amelmquist/chrono,amelmquist/chrono,projectchrono/chrono,amelmquist/chrono,jcmadsen/chrono,Milad-Rakhsha/chrono,projectchrono/chrono,dariomangoni/chrono,andrewseidl/chrono,dariomangoni/chrono,armanpazouki/chrono,armanpazouki/chrono,rserban/chrono,rserban/chrono,armanpazouki/chrono,rserban/chrono,tjolsen/chrono,andrewseidl/chrono,tjolsen/chrono,armanpazouki/chrono,armanpazouki/chrono,Milad-Rakhsha/chrono,rserban/chrono,dariomangoni/chrono,jcmadsen/chrono,projectchrono/chrono,amelmquist/chrono,andrewseidl/chrono,rserban/chrono,amelmquist/chrono,dariomangoni/chrono,jcmadsen/chrono,armanpazouki/chrono,projectchrono/chrono,dariomangoni/chrono,amelmquist/chrono,tjolsen/chrono,projectchrono/chrono,jcmadsen/chrono,andrewseidl/chrono,andrewseidl/chrono,jcmadsen/chrono,Milad-Rakhsha/chrono,jcmadsen/chrono,projectchrono/chrono,rserban/chrono,Milad-Rakhsha/chrono,dariomangoni/chrono | yaml | ## Code Before:
title: Project Chrono
email: info@projectchrono.org
description: Website for Project Chrono
baseurl: "" # the subpath of your site, e.g. /blog/
url: "https://projectchrono.org" # the base hostname & protocol for your site
twitter_username: projectchrono
github_username: projectchrono
permalink: /blog/:year/:month/:title/
# Build settings
markdown: kramdown
highlighter: rouge
## Instruction:
Update page title and description
Add jekyll sitemap gem to generate sitemap
## Code After:
title: Project Chrono - An Open Source Physics Engine
email: info@projectchrono.org
description: Project Chrono is a physics-based modelling and simulation infrastructure based on a platform-independent, open-source design.
baseurl: "" # the subpath of your site, e.g. /blog/
url: "https://projectchrono.org" # the base hostname & protocol for your site
twitter_username: projectchrono
github_username: projectchrono
permalink: /blog/:year/:month/:title/
# Build settings
markdown: kramdown
highlighter: rouge
gems: [jekyll-sitemap] | - title: Project Chrono
+ title: Project Chrono - An Open Source Physics Engine
email: info@projectchrono.org
- description: Website for Project Chrono
+ description: Project Chrono is a physics-based modelling and simulation infrastructure based on a platform-independent, open-source design.
baseurl: "" # the subpath of your site, e.g. /blog/
url: "https://projectchrono.org" # the base hostname & protocol for your site
twitter_username: projectchrono
github_username: projectchrono
permalink: /blog/:year/:month/:title/
# Build settings
markdown: kramdown
highlighter: rouge
+ gems: [jekyll-sitemap] | 5 | 0.416667 | 3 | 2 |
6b179dc4fb95f4db380b9156381b6210adeef2e5 | conftest.py | conftest.py |
import os
import mock
import pytest
PROJECT = os.environ['GCLOUD_PROJECT']
@pytest.fixture
def api_client_inject_project_id():
"""Patches all googleapiclient requests to replace 'YOUR_PROJECT_ID' with
the project ID."""
import googleapiclient.http
old_execute = googleapiclient.http.HttpRequest.execute
def new_execute(self, http=None, num_retries=0):
self.uri = self.uri.replace('YOUR_PROJECT_ID', PROJECT)
return old_execute(self, http=http, num_retries=num_retries)
with mock.patch(
'googleapiclient.http.HttpRequest.execute',
new=new_execute):
yield
|
import os
import mock
import pytest
PROJECT = 'python-docs-samples'
@pytest.fixture
def api_client_inject_project_id():
"""Patches all googleapiclient requests to replace 'YOUR_PROJECT_ID' with
the project ID."""
import googleapiclient.http
old_execute = googleapiclient.http.HttpRequest.execute
def new_execute(self, http=None, num_retries=0):
self.uri = self.uri.replace('YOUR_PROJECT_ID', PROJECT)
return old_execute(self, http=http, num_retries=num_retries)
with mock.patch(
'googleapiclient.http.HttpRequest.execute',
new=new_execute):
yield
| Set the Project in code | Set the Project in code
| Python | apache-2.0 | GoogleCloudPlatform/getting-started-python,GoogleCloudPlatform/getting-started-python,GoogleCloudPlatform/getting-started-python | python | ## Code Before:
import os
import mock
import pytest
PROJECT = os.environ['GCLOUD_PROJECT']
@pytest.fixture
def api_client_inject_project_id():
"""Patches all googleapiclient requests to replace 'YOUR_PROJECT_ID' with
the project ID."""
import googleapiclient.http
old_execute = googleapiclient.http.HttpRequest.execute
def new_execute(self, http=None, num_retries=0):
self.uri = self.uri.replace('YOUR_PROJECT_ID', PROJECT)
return old_execute(self, http=http, num_retries=num_retries)
with mock.patch(
'googleapiclient.http.HttpRequest.execute',
new=new_execute):
yield
## Instruction:
Set the Project in code
## Code After:
import os
import mock
import pytest
PROJECT = 'python-docs-samples'
@pytest.fixture
def api_client_inject_project_id():
"""Patches all googleapiclient requests to replace 'YOUR_PROJECT_ID' with
the project ID."""
import googleapiclient.http
old_execute = googleapiclient.http.HttpRequest.execute
def new_execute(self, http=None, num_retries=0):
self.uri = self.uri.replace('YOUR_PROJECT_ID', PROJECT)
return old_execute(self, http=http, num_retries=num_retries)
with mock.patch(
'googleapiclient.http.HttpRequest.execute',
new=new_execute):
yield
|
import os
import mock
import pytest
- PROJECT = os.environ['GCLOUD_PROJECT']
+ PROJECT = 'python-docs-samples'
@pytest.fixture
def api_client_inject_project_id():
"""Patches all googleapiclient requests to replace 'YOUR_PROJECT_ID' with
the project ID."""
import googleapiclient.http
old_execute = googleapiclient.http.HttpRequest.execute
def new_execute(self, http=None, num_retries=0):
self.uri = self.uri.replace('YOUR_PROJECT_ID', PROJECT)
return old_execute(self, http=http, num_retries=num_retries)
with mock.patch(
'googleapiclient.http.HttpRequest.execute',
new=new_execute):
yield | 2 | 0.08 | 1 | 1 |
df8ca134c099d75231b7ab2af169b2296761f383 | setup/setupSeguir.js | setup/setupSeguir.js | /**
* Sets up the core
*/
var async = require('async');
function setup(client, keyspace, next) {
var tables =['CREATE TABLE ' + keyspace + '.applications (name text, apptoken uuid, PRIMARY KEY (name))'];
var helpers = require('./helpers')(client, {
KEYSPACE: keyspace,
tables: tables
});
async.series([
helpers.dropKeyspace,
helpers.createKeyspace,
helpers.createTables
], function(err, data) {
/* istanbul ignore if */
if(err) console.dir(err);
next();
});
}
module.exports = setup;
| /**
* Sets up the core
*/
var async = require('async');
function setup(client, keyspace, next) {
var tables =['CREATE TABLE ' + keyspace + '.applications (name text, apptoken uuid, PRIMARY KEY (name))'];
var indexes = ['CREATE INDEX ON ' + keyspace + '.applications(apptoken)'];
var helpers = require('./helpers')(client, {
KEYSPACE: keyspace,
tables: tables,
indexes: indexes
});
async.series([
helpers.dropKeyspace,
helpers.createKeyspace,
helpers.createTables,
helpers.createSecondaryIndexes
], function(err, data) {
/* istanbul ignore if */
if(err) console.dir(err);
next();
});
}
module.exports = setup;
| Add index on application token | Add index on application token
| JavaScript | mit | gajjargaurav/seguir,tes/seguir,cliftonc/seguir | javascript | ## Code Before:
/**
* Sets up the core
*/
var async = require('async');
function setup(client, keyspace, next) {
var tables =['CREATE TABLE ' + keyspace + '.applications (name text, apptoken uuid, PRIMARY KEY (name))'];
var helpers = require('./helpers')(client, {
KEYSPACE: keyspace,
tables: tables
});
async.series([
helpers.dropKeyspace,
helpers.createKeyspace,
helpers.createTables
], function(err, data) {
/* istanbul ignore if */
if(err) console.dir(err);
next();
});
}
module.exports = setup;
## Instruction:
Add index on application token
## Code After:
/**
* Sets up the core
*/
var async = require('async');
function setup(client, keyspace, next) {
var tables =['CREATE TABLE ' + keyspace + '.applications (name text, apptoken uuid, PRIMARY KEY (name))'];
var indexes = ['CREATE INDEX ON ' + keyspace + '.applications(apptoken)'];
var helpers = require('./helpers')(client, {
KEYSPACE: keyspace,
tables: tables,
indexes: indexes
});
async.series([
helpers.dropKeyspace,
helpers.createKeyspace,
helpers.createTables,
helpers.createSecondaryIndexes
], function(err, data) {
/* istanbul ignore if */
if(err) console.dir(err);
next();
});
}
module.exports = setup;
| /**
* Sets up the core
*/
var async = require('async');
function setup(client, keyspace, next) {
var tables =['CREATE TABLE ' + keyspace + '.applications (name text, apptoken uuid, PRIMARY KEY (name))'];
+ var indexes = ['CREATE INDEX ON ' + keyspace + '.applications(apptoken)'];
var helpers = require('./helpers')(client, {
KEYSPACE: keyspace,
- tables: tables
+ tables: tables,
? +
+ indexes: indexes
});
async.series([
helpers.dropKeyspace,
helpers.createKeyspace,
- helpers.createTables
+ helpers.createTables,
? +
+ helpers.createSecondaryIndexes
], function(err, data) {
/* istanbul ignore if */
if(err) console.dir(err);
next();
});
}
module.exports = setup; | 7 | 0.269231 | 5 | 2 |
05b6a30137272841f659e3cfb6c373b80f6b7ce1 | app/controllers/flags_controller.rb | app/controllers/flags_controller.rb | class FlagsController < ApplicationController
def create
if params[:flaggable_type]
item = params[:flaggable_type]
else
item = ''
end
p item
if item.downcase == 'post'
flaggable = Post.find(params[:flaggable])
else
flaggable = Comment.find(params[:flaggable])
end
@flag = Flag.new(user_id: params[:user_id].to_i, flaggable: flaggable, flaggable_type: params[:flaggable_type].capitalize)
if @flag.save
render json: {response: 'good'}
else
render json: {response: 'bad'}
end
end
def destroy
@flag = Flag.find(params[:id])
if @flag.destroy
render json: {response: '200'}
else
render json: {response: '500'}
end
end
# private
# # def flag_params
# # params.require(:flag).permit(:user, :flaggable, :flaggable_type)
# # end
end
| class FlagsController < ApplicationController
def create
if params[:flaggable_type]
item = params[:flaggable_type]
else
item = ''
end
p item
if item.downcase == 'post'
flaggable = Post.find(params[:flaggable])
else
flaggable = Comment.find(params[:flaggable])
end
@flag = Flag.new(user_id: params[:user_id].to_i, flaggable: flaggable, flaggable_type: params[:flaggable_type].capitalize)
if @flag.save
render json: @flag.id
else
render json: {response: '404, flag not saved'}
end
end
def destroy
@flag = Flag.find(params[:id])
if @flag.destroy
render json: {response: '200'}
else
render json: {response: '500'}
end
end
# private
# # def flag_params
# # params.require(:flag).permit(:user, :flaggable, :flaggable_type)
# # end
end
| Change flags contoller to return flag ID | Change flags contoller to return flag ID
| Ruby | mit | sp33drac3r/chelsie_backend,sp33drac3r/chelsie_backend,sp33drac3r/chelsie_backend | ruby | ## Code Before:
class FlagsController < ApplicationController
def create
if params[:flaggable_type]
item = params[:flaggable_type]
else
item = ''
end
p item
if item.downcase == 'post'
flaggable = Post.find(params[:flaggable])
else
flaggable = Comment.find(params[:flaggable])
end
@flag = Flag.new(user_id: params[:user_id].to_i, flaggable: flaggable, flaggable_type: params[:flaggable_type].capitalize)
if @flag.save
render json: {response: 'good'}
else
render json: {response: 'bad'}
end
end
def destroy
@flag = Flag.find(params[:id])
if @flag.destroy
render json: {response: '200'}
else
render json: {response: '500'}
end
end
# private
# # def flag_params
# # params.require(:flag).permit(:user, :flaggable, :flaggable_type)
# # end
end
## Instruction:
Change flags contoller to return flag ID
## Code After:
class FlagsController < ApplicationController
def create
if params[:flaggable_type]
item = params[:flaggable_type]
else
item = ''
end
p item
if item.downcase == 'post'
flaggable = Post.find(params[:flaggable])
else
flaggable = Comment.find(params[:flaggable])
end
@flag = Flag.new(user_id: params[:user_id].to_i, flaggable: flaggable, flaggable_type: params[:flaggable_type].capitalize)
if @flag.save
render json: @flag.id
else
render json: {response: '404, flag not saved'}
end
end
def destroy
@flag = Flag.find(params[:id])
if @flag.destroy
render json: {response: '200'}
else
render json: {response: '500'}
end
end
# private
# # def flag_params
# # params.require(:flag).permit(:user, :flaggable, :flaggable_type)
# # end
end
| class FlagsController < ApplicationController
def create
if params[:flaggable_type]
item = params[:flaggable_type]
else
item = ''
end
p item
if item.downcase == 'post'
flaggable = Post.find(params[:flaggable])
else
flaggable = Comment.find(params[:flaggable])
end
@flag = Flag.new(user_id: params[:user_id].to_i, flaggable: flaggable, flaggable_type: params[:flaggable_type].capitalize)
if @flag.save
- render json: {response: 'good'}
+ render json: @flag.id
else
- render json: {response: 'bad'}
? ^
+ render json: {response: '404, flag not saved'}
? ^^^^^^^ ++++++++++
end
end
def destroy
@flag = Flag.find(params[:id])
if @flag.destroy
render json: {response: '200'}
else
render json: {response: '500'}
end
end
# private
# # def flag_params
# # params.require(:flag).permit(:user, :flaggable, :flaggable_type)
# # end
end | 4 | 0.105263 | 2 | 2 |
d43c510bad2c4098a726e1045cf2454f4c931a55 | spec/tic_tac_toe_spec.rb | spec/tic_tac_toe_spec.rb | require 'spec_helper'
describe TicTacToe do
it 'has a version number' do
expect(TicTacToe::VERSION).not_to be nil
end
it 'has a board' do
game = TicTacToe::Board.new
expect(game).to be_an_instance_of TicTacToe::Board
end
describe TicTacToe::Board do
before :each do
@game = TicTacToe::Board.new
end
it 'initially has 9 empty positions' do
(1..3).each do |x|
(1..3).each do |y|
expect(@game.pos [x,y]).to eq(" ")
end
end
end
it 'can make moves' do
@game.move [1,1], "X"
end
end
end
| require 'spec_helper'
describe TicTacToe do
it 'has a version number' do
expect(TicTacToe::VERSION).not_to be nil
end
it 'has a board' do
game = TicTacToe::Board.new
expect(game).to be_an_instance_of TicTacToe::Board
end
describe TicTacToe::Board do
before :each do
@game = TicTacToe::Board.new
end
it 'initially has 9 empty positions' do
(0..8).each do |i|
expect(@game.pos i).to eq(" ")
end
end
it 'can make moves' do
@game.move 0, "X"
end
end
end
| Change expected interface for move and pos | Change expected interface for move and pos
| Ruby | mit | RadicalZephyr/tic_tac_toe,RadicalZephyr/tic_tac_toe | ruby | ## Code Before:
require 'spec_helper'
describe TicTacToe do
it 'has a version number' do
expect(TicTacToe::VERSION).not_to be nil
end
it 'has a board' do
game = TicTacToe::Board.new
expect(game).to be_an_instance_of TicTacToe::Board
end
describe TicTacToe::Board do
before :each do
@game = TicTacToe::Board.new
end
it 'initially has 9 empty positions' do
(1..3).each do |x|
(1..3).each do |y|
expect(@game.pos [x,y]).to eq(" ")
end
end
end
it 'can make moves' do
@game.move [1,1], "X"
end
end
end
## Instruction:
Change expected interface for move and pos
## Code After:
require 'spec_helper'
describe TicTacToe do
it 'has a version number' do
expect(TicTacToe::VERSION).not_to be nil
end
it 'has a board' do
game = TicTacToe::Board.new
expect(game).to be_an_instance_of TicTacToe::Board
end
describe TicTacToe::Board do
before :each do
@game = TicTacToe::Board.new
end
it 'initially has 9 empty positions' do
(0..8).each do |i|
expect(@game.pos i).to eq(" ")
end
end
it 'can make moves' do
@game.move 0, "X"
end
end
end
| require 'spec_helper'
describe TicTacToe do
it 'has a version number' do
expect(TicTacToe::VERSION).not_to be nil
end
it 'has a board' do
game = TicTacToe::Board.new
expect(game).to be_an_instance_of TicTacToe::Board
end
describe TicTacToe::Board do
before :each do
@game = TicTacToe::Board.new
end
it 'initially has 9 empty positions' do
- (1..3).each do |x|
? ^ ^ ^
+ (0..8).each do |i|
? ^ ^ ^
- (1..3).each do |y|
- expect(@game.pos [x,y]).to eq(" ")
? ^^^^^
+ expect(@game.pos i).to eq(" ")
? ^
- end
end
end
it 'can make moves' do
- @game.move [1,1], "X"
? ^^^^^
+ @game.move 0, "X"
? ^
end
end
end | 8 | 0.25 | 3 | 5 |
ca762ad12d505647a8a872b4993ff76b92ea643a | bench/harness.oz | bench/harness.oz | functor
import
OS
Boot_Time at 'x-oz://boot/Time'
System(showInfo:ShowInfo)
export
measure: Measure
bench: Bench
define
GetTime
Diff
if {HasFeature Boot_Time getMonotonicTime} then % Mozart 2, Mozart-Graal
GetTime = Boot_Time.getMonotonicTime
fun {Diff X Y}
Y - X
end
else
% For Mozart 1, precise to around ~1ms.
% Better than {GetProperty 'time.total'}, which is only precise to 10ms.
fun {GetTime}
Stdout
in
{OS.pipe date ["+%s%N"] _ Stdout#_}
Stdout
end
fun {Diff StdoutX StdoutY}
OutX OutY
in
{OS.wait _ _}
{OS.wait _ _}
{OS.read StdoutX 30 OutX nil _}
{OS.read StdoutY 30 OutY nil _}
{OS.close StdoutX}
{OS.close StdoutY}
{StringToInt OutY} - {StringToInt OutX}
end
end
fun {Measure F}
T0 = {GetTime}
R={F}
T1 = {GetTime}
in
{ShowInfo ({Diff T0 T1} div 1000000)}
R
end
Iterations=50
proc {Bench F}
R
in
for I in 1..Iterations do
R={Measure F}
end
end
end
| functor
import
OS
Boot_Time at 'x-oz://boot/Time'
System(showInfo:ShowInfo)
export
measure: Measure
bench: Bench
define
GetTime
Diff
if {HasFeature Boot_Time getMonotonicTime} then % Mozart 2, Mozart-Graal
GetTime = Boot_Time.getMonotonicTime
fun {Diff X Y}
Y - X
end
else
% For Mozart 1, precise to around ~1ms.
% Better than {GetProperty 'time.total'}, which is only precise to 10ms.
fun {GetTime}
Stdout
in
{OS.pipe date ["+%s%N"] _ Stdout#_}
Stdout
end
fun {Diff StdoutX StdoutY}
OutX OutY
in
{OS.wait _ _}
{OS.wait _ _}
{OS.read StdoutX 30 OutX nil _}
{OS.read StdoutY 30 OutY nil _}
{OS.close StdoutX}
{OS.close StdoutY}
{StringToInt OutY} - {StringToInt OutX}
end
end
fun {Measure F}
T0 = {GetTime}
R={F}
T1 = {GetTime}
in
{ShowInfo ({Diff T0 T1} div 1000000)}
R
end
Iterations=50
proc {Bench F}
R={NewCell nil}
in
for I in 1..Iterations do
R := nil % Let last result GC
R := {Measure F}
end
end
end
| Use a Cell rather than unifying the results of the benchmark | Use a Cell rather than unifying the results of the benchmark
* Unification is expensive for very long lists.
* Avoid holding 2 results in memory at the same time.
| Oz | bsd-2-clause | eregon/mozart-graal,eregon/mozart-graal,eregon/mozart-graal,eregon/mozart-graal,eregon/mozart-graal,eregon/mozart-graal | oz | ## Code Before:
functor
import
OS
Boot_Time at 'x-oz://boot/Time'
System(showInfo:ShowInfo)
export
measure: Measure
bench: Bench
define
GetTime
Diff
if {HasFeature Boot_Time getMonotonicTime} then % Mozart 2, Mozart-Graal
GetTime = Boot_Time.getMonotonicTime
fun {Diff X Y}
Y - X
end
else
% For Mozart 1, precise to around ~1ms.
% Better than {GetProperty 'time.total'}, which is only precise to 10ms.
fun {GetTime}
Stdout
in
{OS.pipe date ["+%s%N"] _ Stdout#_}
Stdout
end
fun {Diff StdoutX StdoutY}
OutX OutY
in
{OS.wait _ _}
{OS.wait _ _}
{OS.read StdoutX 30 OutX nil _}
{OS.read StdoutY 30 OutY nil _}
{OS.close StdoutX}
{OS.close StdoutY}
{StringToInt OutY} - {StringToInt OutX}
end
end
fun {Measure F}
T0 = {GetTime}
R={F}
T1 = {GetTime}
in
{ShowInfo ({Diff T0 T1} div 1000000)}
R
end
Iterations=50
proc {Bench F}
R
in
for I in 1..Iterations do
R={Measure F}
end
end
end
## Instruction:
Use a Cell rather than unifying the results of the benchmark
* Unification is expensive for very long lists.
* Avoid holding 2 results in memory at the same time.
## Code After:
functor
import
OS
Boot_Time at 'x-oz://boot/Time'
System(showInfo:ShowInfo)
export
measure: Measure
bench: Bench
define
GetTime
Diff
if {HasFeature Boot_Time getMonotonicTime} then % Mozart 2, Mozart-Graal
GetTime = Boot_Time.getMonotonicTime
fun {Diff X Y}
Y - X
end
else
% For Mozart 1, precise to around ~1ms.
% Better than {GetProperty 'time.total'}, which is only precise to 10ms.
fun {GetTime}
Stdout
in
{OS.pipe date ["+%s%N"] _ Stdout#_}
Stdout
end
fun {Diff StdoutX StdoutY}
OutX OutY
in
{OS.wait _ _}
{OS.wait _ _}
{OS.read StdoutX 30 OutX nil _}
{OS.read StdoutY 30 OutY nil _}
{OS.close StdoutX}
{OS.close StdoutY}
{StringToInt OutY} - {StringToInt OutX}
end
end
fun {Measure F}
T0 = {GetTime}
R={F}
T1 = {GetTime}
in
{ShowInfo ({Diff T0 T1} div 1000000)}
R
end
Iterations=50
proc {Bench F}
R={NewCell nil}
in
for I in 1..Iterations do
R := nil % Let last result GC
R := {Measure F}
end
end
end
| functor
import
OS
Boot_Time at 'x-oz://boot/Time'
System(showInfo:ShowInfo)
export
measure: Measure
bench: Bench
define
GetTime
Diff
if {HasFeature Boot_Time getMonotonicTime} then % Mozart 2, Mozart-Graal
GetTime = Boot_Time.getMonotonicTime
fun {Diff X Y}
Y - X
end
else
% For Mozart 1, precise to around ~1ms.
% Better than {GetProperty 'time.total'}, which is only precise to 10ms.
fun {GetTime}
Stdout
in
{OS.pipe date ["+%s%N"] _ Stdout#_}
Stdout
end
fun {Diff StdoutX StdoutY}
OutX OutY
in
{OS.wait _ _}
{OS.wait _ _}
{OS.read StdoutX 30 OutX nil _}
{OS.read StdoutY 30 OutY nil _}
{OS.close StdoutX}
{OS.close StdoutY}
{StringToInt OutY} - {StringToInt OutX}
end
end
fun {Measure F}
T0 = {GetTime}
R={F}
T1 = {GetTime}
in
{ShowInfo ({Diff T0 T1} div 1000000)}
R
end
Iterations=50
proc {Bench F}
- R
+ R={NewCell nil}
in
for I in 1..Iterations do
+ R := nil % Let last result GC
- R={Measure F}
+ R := {Measure F}
? ++ +
end
end
end | 5 | 0.089286 | 3 | 2 |
2800e2cf0a7a998a5081929e6750265f30b09130 | tests/test_bql.py | tests/test_bql.py |
import StringIO
import bayeslite.bql as bql
import bayeslite.parse as parse
import test_smoke
def bql2sql(string):
with test_smoke.t1() as bdb:
phrases = parse.parse_bql_string(string)
out = StringIO.StringIO()
bql.compile_bql(bdb, phrases, out)
return out.getvalue()
def test_select_trivial():
assert bql2sql('select 0;') == 'select 0;'
|
import StringIO
import bayeslite.bql as bql
import bayeslite.parse as parse
import test_smoke
def bql2sql(string):
with test_smoke.t1() as bdb:
phrases = parse.parse_bql_string(string)
out = StringIO.StringIO()
bql.compile_bql(bdb, phrases, out)
return out.getvalue()
def test_select_trivial():
assert bql2sql('select 0;') == 'select 0;'
assert bql2sql('select 0 as z;') == 'select 0 as "z";'
assert bql2sql('select * from t;') == 'select * from "t";'
assert bql2sql('select t.* from t;') == 'select "t".* from "t";'
assert bql2sql('select c from t;') == 'select "c" from "t";'
assert bql2sql('select c as d from t;') == 'select "c" as "d" from "t";'
| Add some more trivial bql2sql tests. | Add some more trivial bql2sql tests.
| Python | apache-2.0 | probcomp/bayeslite,probcomp/bayeslite | python | ## Code Before:
import StringIO
import bayeslite.bql as bql
import bayeslite.parse as parse
import test_smoke
def bql2sql(string):
with test_smoke.t1() as bdb:
phrases = parse.parse_bql_string(string)
out = StringIO.StringIO()
bql.compile_bql(bdb, phrases, out)
return out.getvalue()
def test_select_trivial():
assert bql2sql('select 0;') == 'select 0;'
## Instruction:
Add some more trivial bql2sql tests.
## Code After:
import StringIO
import bayeslite.bql as bql
import bayeslite.parse as parse
import test_smoke
def bql2sql(string):
with test_smoke.t1() as bdb:
phrases = parse.parse_bql_string(string)
out = StringIO.StringIO()
bql.compile_bql(bdb, phrases, out)
return out.getvalue()
def test_select_trivial():
assert bql2sql('select 0;') == 'select 0;'
assert bql2sql('select 0 as z;') == 'select 0 as "z";'
assert bql2sql('select * from t;') == 'select * from "t";'
assert bql2sql('select t.* from t;') == 'select "t".* from "t";'
assert bql2sql('select c from t;') == 'select "c" from "t";'
assert bql2sql('select c as d from t;') == 'select "c" as "d" from "t";'
|
import StringIO
import bayeslite.bql as bql
import bayeslite.parse as parse
import test_smoke
def bql2sql(string):
with test_smoke.t1() as bdb:
phrases = parse.parse_bql_string(string)
out = StringIO.StringIO()
bql.compile_bql(bdb, phrases, out)
return out.getvalue()
def test_select_trivial():
assert bql2sql('select 0;') == 'select 0;'
+ assert bql2sql('select 0 as z;') == 'select 0 as "z";'
+ assert bql2sql('select * from t;') == 'select * from "t";'
+ assert bql2sql('select t.* from t;') == 'select "t".* from "t";'
+ assert bql2sql('select c from t;') == 'select "c" from "t";'
+ assert bql2sql('select c as d from t;') == 'select "c" as "d" from "t";' | 5 | 0.294118 | 5 | 0 |
cc9441e1facd6ff4b1fd7847504b6640e1ecdfe3 | app/utils/status-bar-util.ts | app/utils/status-bar-util.ts | import * as application from "application";
// Make TypeScript happy
declare var UIResponder: any;
declare var UIStatusBarStyle: any;
declare var UIApplication: any;
declare var UIApplicationDelegate: any;
export function setStatusBarColors() {
if (application.ios) {
var AppDelegate = UIResponder.extend({
applicationDidFinishLaunchingWithOptions: function() {
UIApplication.sharedApplication().statusBarStyle = UIStatusBarStyle.LightContent;
return true;
}
}, {
name: "AppDelegate",
protocols: [UIApplicationDelegate]
});
application.ios.delegate = AppDelegate;
}
}
| import * as application from "application";
import * as platform from "platform";
// Make TypeScript happy
declare var android: any;
declare var UIResponder: any;
declare var UIStatusBarStyle: any;
declare var UIApplication: any;
declare var UIApplicationDelegate: any;
export function setStatusBarColors() {
// Make the iOS status bar transparent with white text.
// See https://github.com/burkeholland/nativescript-statusbar/issues/2
// for details on the technique used.
if (application.ios) {
var AppDelegate = UIResponder.extend({
applicationDidFinishLaunchingWithOptions: function() {
UIApplication.sharedApplication().statusBarStyle = UIStatusBarStyle.LightContent;
return true;
}
}, {
name: "AppDelegate",
protocols: [UIApplicationDelegate]
});
application.ios.delegate = AppDelegate;
}
// Make the Android status bar transparent.
// See http://bradmartin.net/2016/03/10/fullscreen-and-navigation-bar-color-in-a-nativescript-android-app/
// for details on the technique used.
application.android.onActivityStarted = function() {
if (application.android && platform.device.sdkVersion >= "21") {
var View = android.view.View;
var window = application.android.startActivity.getWindow();
window.setStatusBarColor(0x000000);
var decorView = window.getDecorView();
decorView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
}
}
}
| Add Android into the status bar utility | Add Android into the status bar utility
| TypeScript | mit | poly-mer/community,anhoev/cms-mobile,anhoev/cms-mobile,Icenium/nativescript-sample-groceries,NativeScript/sample-Groceries,dzfweb/sample-groceries,qtagtech/nativescript_tutorial,qtagtech/nativescript_tutorial,tjvantoll/sample-Groceries,qtagtech/nativescript_tutorial,anhoev/cms-mobile,tjvantoll/sample-Groceries,NativeScript/sample-Groceries,poly-mer/community,dzfweb/sample-groceries,poly-mer/community,NativeScript/sample-Groceries,dzfweb/sample-groceries,tjvantoll/sample-Groceries | typescript | ## Code Before:
import * as application from "application";
// Make TypeScript happy
declare var UIResponder: any;
declare var UIStatusBarStyle: any;
declare var UIApplication: any;
declare var UIApplicationDelegate: any;
export function setStatusBarColors() {
if (application.ios) {
var AppDelegate = UIResponder.extend({
applicationDidFinishLaunchingWithOptions: function() {
UIApplication.sharedApplication().statusBarStyle = UIStatusBarStyle.LightContent;
return true;
}
}, {
name: "AppDelegate",
protocols: [UIApplicationDelegate]
});
application.ios.delegate = AppDelegate;
}
}
## Instruction:
Add Android into the status bar utility
## Code After:
import * as application from "application";
import * as platform from "platform";
// Make TypeScript happy
declare var android: any;
declare var UIResponder: any;
declare var UIStatusBarStyle: any;
declare var UIApplication: any;
declare var UIApplicationDelegate: any;
export function setStatusBarColors() {
// Make the iOS status bar transparent with white text.
// See https://github.com/burkeholland/nativescript-statusbar/issues/2
// for details on the technique used.
if (application.ios) {
var AppDelegate = UIResponder.extend({
applicationDidFinishLaunchingWithOptions: function() {
UIApplication.sharedApplication().statusBarStyle = UIStatusBarStyle.LightContent;
return true;
}
}, {
name: "AppDelegate",
protocols: [UIApplicationDelegate]
});
application.ios.delegate = AppDelegate;
}
// Make the Android status bar transparent.
// See http://bradmartin.net/2016/03/10/fullscreen-and-navigation-bar-color-in-a-nativescript-android-app/
// for details on the technique used.
application.android.onActivityStarted = function() {
if (application.android && platform.device.sdkVersion >= "21") {
var View = android.view.View;
var window = application.android.startActivity.getWindow();
window.setStatusBarColor(0x000000);
var decorView = window.getDecorView();
decorView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
}
}
}
| import * as application from "application";
+ import * as platform from "platform";
// Make TypeScript happy
+ declare var android: any;
declare var UIResponder: any;
declare var UIStatusBarStyle: any;
declare var UIApplication: any;
declare var UIApplicationDelegate: any;
export function setStatusBarColors() {
+ // Make the iOS status bar transparent with white text.
+ // See https://github.com/burkeholland/nativescript-statusbar/issues/2
+ // for details on the technique used.
if (application.ios) {
var AppDelegate = UIResponder.extend({
applicationDidFinishLaunchingWithOptions: function() {
UIApplication.sharedApplication().statusBarStyle = UIStatusBarStyle.LightContent;
return true;
}
}, {
name: "AppDelegate",
protocols: [UIApplicationDelegate]
});
application.ios.delegate = AppDelegate;
}
+
+ // Make the Android status bar transparent.
+ // See http://bradmartin.net/2016/03/10/fullscreen-and-navigation-bar-color-in-a-nativescript-android-app/
+ // for details on the technique used.
+ application.android.onActivityStarted = function() {
+ if (application.android && platform.device.sdkVersion >= "21") {
+ var View = android.view.View;
+ var window = application.android.startActivity.getWindow();
+ window.setStatusBarColor(0x000000);
+
+ var decorView = window.getDecorView();
+ decorView.setSystemUiVisibility(
+ View.SYSTEM_UI_FLAG_LAYOUT_STABLE
+ | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
+ | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+ | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
+ }
+ }
} | 23 | 1.045455 | 23 | 0 |
ffa15ca750f2ac5513db9984169ececde1cf363a | _includes/colophon.html | _includes/colophon.html | <footer id="colophon" class="colophon">
<nav class="container">
<ul class="colophon__menu">
<li class="colophon__menu-item"><a href="#0" class="overlay__menu-trigger">Open Menu</a></li>
<li class="colophon__menu-sep">→</li>
{% for link in site.data.navigation.colophon-menu %}
<li class="colophon__menu-item"><a href="{{ site.url }}{{ link.url }}">{{ link.title }}</a></li>
{% endfor %}
</ul>
<p class="colophon__copyright">© {{ site.time | date: '%Y' }} {{ site.owner.name }}, <a href="{{ site.url }}/humans.txt">a real human being</a>. <a href="{{ site.owner.github-repo }}" title="view source on GitHub" rel="nofollow">Hand-crafted</a> with <a href="http://jekyllrb.com/" rel="nofollow">Jekyll</a>.</p>
</nav>
</footer>
| <footer id="colophon" class="colophon">
<nav class="container">
<ul class="colophon__menu">
{% for link in site.data.navigation.colophon-menu %}
<li class="colophon__menu-item"><a href="{{ site.url }}{{ link.url }}">{{ link.title }}</a></li>
{% endfor %}
</ul>
<p class="colophon__copyright">© {{ site.time | date: '%Y' }} {{ site.owner.name }}, <a href="{{ site.url }}/humans.txt">a real human being</a>. <a href="{{ site.owner.github-repo }}" title="view source on GitHub" rel="nofollow">Hand-crafted</a> with <a href="http://jekyllrb.com/" rel="nofollow">Jekyll</a>.</p>
</nav>
</footer>
| Remove "Open Menu" link since the top menu is fixed at the top now and always visible | Remove "Open Menu" link since the top menu is fixed at the top now and always visible
| HTML | mit | blogtips/blogtips.github.io,mmistakes/made-mistakes-jekyll,mmistakes/made-mistakes-jekyll,blogtips/blogtips.github.io,blogtips/blogtips.github.io,mmistakes/made-mistakes-jekyll | html | ## Code Before:
<footer id="colophon" class="colophon">
<nav class="container">
<ul class="colophon__menu">
<li class="colophon__menu-item"><a href="#0" class="overlay__menu-trigger">Open Menu</a></li>
<li class="colophon__menu-sep">→</li>
{% for link in site.data.navigation.colophon-menu %}
<li class="colophon__menu-item"><a href="{{ site.url }}{{ link.url }}">{{ link.title }}</a></li>
{% endfor %}
</ul>
<p class="colophon__copyright">© {{ site.time | date: '%Y' }} {{ site.owner.name }}, <a href="{{ site.url }}/humans.txt">a real human being</a>. <a href="{{ site.owner.github-repo }}" title="view source on GitHub" rel="nofollow">Hand-crafted</a> with <a href="http://jekyllrb.com/" rel="nofollow">Jekyll</a>.</p>
</nav>
</footer>
## Instruction:
Remove "Open Menu" link since the top menu is fixed at the top now and always visible
## Code After:
<footer id="colophon" class="colophon">
<nav class="container">
<ul class="colophon__menu">
{% for link in site.data.navigation.colophon-menu %}
<li class="colophon__menu-item"><a href="{{ site.url }}{{ link.url }}">{{ link.title }}</a></li>
{% endfor %}
</ul>
<p class="colophon__copyright">© {{ site.time | date: '%Y' }} {{ site.owner.name }}, <a href="{{ site.url }}/humans.txt">a real human being</a>. <a href="{{ site.owner.github-repo }}" title="view source on GitHub" rel="nofollow">Hand-crafted</a> with <a href="http://jekyllrb.com/" rel="nofollow">Jekyll</a>.</p>
</nav>
</footer>
| <footer id="colophon" class="colophon">
<nav class="container">
<ul class="colophon__menu">
- <li class="colophon__menu-item"><a href="#0" class="overlay__menu-trigger">Open Menu</a></li>
- <li class="colophon__menu-sep">→</li>
{% for link in site.data.navigation.colophon-menu %}
<li class="colophon__menu-item"><a href="{{ site.url }}{{ link.url }}">{{ link.title }}</a></li>
{% endfor %}
</ul>
<p class="colophon__copyright">© {{ site.time | date: '%Y' }} {{ site.owner.name }}, <a href="{{ site.url }}/humans.txt">a real human being</a>. <a href="{{ site.owner.github-repo }}" title="view source on GitHub" rel="nofollow">Hand-crafted</a> with <a href="http://jekyllrb.com/" rel="nofollow">Jekyll</a>.</p>
</nav>
</footer> | 2 | 0.166667 | 0 | 2 |
212ce8f67495be81d5ecdc97b6765d2759e56d8d | streamparse/storm/component.py | streamparse/storm/component.py | import pystorm
from pystorm.component import StormHandler # This is used by other code
from ..dsl.component import ComponentSpec
class Component(pystorm.component.Component):
"""pystorm Component with streamparse-specific additions
:ivar outputs: The outputs
:ivar config: Component-specific config settings to pass to Storm.
"""
outputs = None
par = 1
config = None
@classmethod
def spec(cls, name=None, inputs=None, par=None, config=None):
"""Create a :class:`~streamparse.dsl.component.ComponentSpec`.
This spec represents this Component in a :class:`~streamparse.Topology`.
:param name: Name of this component. Defaults to name of class.
:type name: `str`
:param inputs: Streams that feed into this Component. Only makes sense
for :class:`~streamparse.Bolt`, as
:class:`~streamparse.Spout` instances do not receive
tuples.
Two forms of this are acceptable:
1. A `dict` mapping from `ComponentSpec`s to tuple
groupings.
2. A `list` of :class:`streamparse.Stream`s or
`ComponentSpec`s .
:param par: Parallelism hint for this Component. For Python
Components, this works out to be the number of Python
processes running it in the the topology (across all
machines). See :ref:`parallelism`.
:type par: `int`
:param config: Component-specific config settings to pass to Storm.
:type config: `dict`
"""
return ComponentSpec(cls, name=name, inputs=inputs, par=par,
config=config, outputs=cls.outputs)
| import pystorm
from pystorm.component import StormHandler # This is used by other code
class Component(pystorm.component.Component):
"""pystorm Component with streamparse-specific additions
:ivar outputs: The outputs
:ivar config: Component-specific config settings to pass to Storm.
"""
outputs = None
par = 1
config = None
@classmethod
def spec(cls, *args, **kwargs):
"""This method exists only to give a more informative error message."""
raise TypeError('Specifications should either be bolts or spouts. '
'Given: {!r}'.format(cls))
| Make Component.spec calls raise TypeError directly | Make Component.spec calls raise TypeError directly
| Python | apache-2.0 | codywilbourn/streamparse,Parsely/streamparse,codywilbourn/streamparse,Parsely/streamparse | python | ## Code Before:
import pystorm
from pystorm.component import StormHandler # This is used by other code
from ..dsl.component import ComponentSpec
class Component(pystorm.component.Component):
"""pystorm Component with streamparse-specific additions
:ivar outputs: The outputs
:ivar config: Component-specific config settings to pass to Storm.
"""
outputs = None
par = 1
config = None
@classmethod
def spec(cls, name=None, inputs=None, par=None, config=None):
"""Create a :class:`~streamparse.dsl.component.ComponentSpec`.
This spec represents this Component in a :class:`~streamparse.Topology`.
:param name: Name of this component. Defaults to name of class.
:type name: `str`
:param inputs: Streams that feed into this Component. Only makes sense
for :class:`~streamparse.Bolt`, as
:class:`~streamparse.Spout` instances do not receive
tuples.
Two forms of this are acceptable:
1. A `dict` mapping from `ComponentSpec`s to tuple
groupings.
2. A `list` of :class:`streamparse.Stream`s or
`ComponentSpec`s .
:param par: Parallelism hint for this Component. For Python
Components, this works out to be the number of Python
processes running it in the the topology (across all
machines). See :ref:`parallelism`.
:type par: `int`
:param config: Component-specific config settings to pass to Storm.
:type config: `dict`
"""
return ComponentSpec(cls, name=name, inputs=inputs, par=par,
config=config, outputs=cls.outputs)
## Instruction:
Make Component.spec calls raise TypeError directly
## Code After:
import pystorm
from pystorm.component import StormHandler # This is used by other code
class Component(pystorm.component.Component):
"""pystorm Component with streamparse-specific additions
:ivar outputs: The outputs
:ivar config: Component-specific config settings to pass to Storm.
"""
outputs = None
par = 1
config = None
@classmethod
def spec(cls, *args, **kwargs):
"""This method exists only to give a more informative error message."""
raise TypeError('Specifications should either be bolts or spouts. '
'Given: {!r}'.format(cls))
| import pystorm
from pystorm.component import StormHandler # This is used by other code
-
- from ..dsl.component import ComponentSpec
class Component(pystorm.component.Component):
"""pystorm Component with streamparse-specific additions
:ivar outputs: The outputs
:ivar config: Component-specific config settings to pass to Storm.
"""
outputs = None
par = 1
config = None
@classmethod
+ def spec(cls, *args, **kwargs):
+ """This method exists only to give a more informative error message."""
+ raise TypeError('Specifications should either be bolts or spouts. '
+ 'Given: {!r}'.format(cls))
- def spec(cls, name=None, inputs=None, par=None, config=None):
- """Create a :class:`~streamparse.dsl.component.ComponentSpec`.
-
- This spec represents this Component in a :class:`~streamparse.Topology`.
-
- :param name: Name of this component. Defaults to name of class.
- :type name: `str`
- :param inputs: Streams that feed into this Component. Only makes sense
- for :class:`~streamparse.Bolt`, as
- :class:`~streamparse.Spout` instances do not receive
- tuples.
-
- Two forms of this are acceptable:
-
- 1. A `dict` mapping from `ComponentSpec`s to tuple
- groupings.
- 2. A `list` of :class:`streamparse.Stream`s or
- `ComponentSpec`s .
- :param par: Parallelism hint for this Component. For Python
- Components, this works out to be the number of Python
- processes running it in the the topology (across all
- machines). See :ref:`parallelism`.
- :type par: `int`
- :param config: Component-specific config settings to pass to Storm.
- :type config: `dict`
- """
- return ComponentSpec(cls, name=name, inputs=inputs, par=par,
- config=config, outputs=cls.outputs) | 34 | 0.755556 | 4 | 30 |
8a6144fc3918856cb2259f65f9ee5cc9cfaf1fdc | locustfile.py | locustfile.py | from locust import HttpLocust, TaskSet, task
class UserBehavior(TaskSet):
tasks = []
def on_start(self):
pass
@task
def index(self):
self.client.get("/")
@task
def move_map(self):
self.client.get("")
@task
def select_scene(self):
# Get url
self.client.get()
@task
def render_preview(self):
self.client.get()
@task
def render_full(self):
self.client.get()
class WebsiteUser(HttpLocust):
task_set = UserBehavior
min_wait = 1000
max_wait = 5000
| from locust import HttpLocust, TaskSet, task
from bs4 import BeautifulSoup
from requests import Session
import random
class UserBehavior(TaskSet):
def on_start(self):
pass
@task
def index(self):
self.client.get("/")
@task
def move_map(self):
lat = random.uniform(-1, 1)
lon = random.uniform(-1, 1)
response = self.client.post(
url="/ajax",
data={'lat': lat, 'lng': lng,}
)
self.client.get("")
@task
def select_scene(self):
# Get url
soup = BeautifulSoup(self.client.get(""))
self.client.get()
@task
def render_preview(self):
self.client.get()
@task
def render_full(self):
self.client.get()
class WebsiteUser(HttpLocust):
task_set = UserBehavior
min_wait = 1000
max_wait = 5000
| Add random functionality to map move. | Add random functionality to map move.
| Python | mit | recombinators/snapsat,recombinators/snapsat,recombinators/snapsat | python | ## Code Before:
from locust import HttpLocust, TaskSet, task
class UserBehavior(TaskSet):
tasks = []
def on_start(self):
pass
@task
def index(self):
self.client.get("/")
@task
def move_map(self):
self.client.get("")
@task
def select_scene(self):
# Get url
self.client.get()
@task
def render_preview(self):
self.client.get()
@task
def render_full(self):
self.client.get()
class WebsiteUser(HttpLocust):
task_set = UserBehavior
min_wait = 1000
max_wait = 5000
## Instruction:
Add random functionality to map move.
## Code After:
from locust import HttpLocust, TaskSet, task
from bs4 import BeautifulSoup
from requests import Session
import random
class UserBehavior(TaskSet):
def on_start(self):
pass
@task
def index(self):
self.client.get("/")
@task
def move_map(self):
lat = random.uniform(-1, 1)
lon = random.uniform(-1, 1)
response = self.client.post(
url="/ajax",
data={'lat': lat, 'lng': lng,}
)
self.client.get("")
@task
def select_scene(self):
# Get url
soup = BeautifulSoup(self.client.get(""))
self.client.get()
@task
def render_preview(self):
self.client.get()
@task
def render_full(self):
self.client.get()
class WebsiteUser(HttpLocust):
task_set = UserBehavior
min_wait = 1000
max_wait = 5000
| from locust import HttpLocust, TaskSet, task
+ from bs4 import BeautifulSoup
+ from requests import Session
+ import random
class UserBehavior(TaskSet):
- tasks = []
-
def on_start(self):
pass
@task
def index(self):
self.client.get("/")
@task
def move_map(self):
+ lat = random.uniform(-1, 1)
+ lon = random.uniform(-1, 1)
+ response = self.client.post(
+ url="/ajax",
+ data={'lat': lat, 'lng': lng,}
+ )
+
self.client.get("")
- @task
+ @task
? ++++
- def select_scene(self):
+ def select_scene(self):
? ++++
- # Get url
+ # Get url
? ++++
+ soup = BeautifulSoup(self.client.get(""))
- self.client.get()
-
- @task
- def render_preview(self):
self.client.get()
- @task
+ @task
? ++++
+ def render_preview(self):
+ self.client.get()
+
+ @task
- def render_full(self):
+ def render_full(self):
? ++++
- self.client.get()
+ self.client.get()
? ++++
class WebsiteUser(HttpLocust):
task_set = UserBehavior
min_wait = 1000
max_wait = 5000 | 33 | 0.891892 | 21 | 12 |
7e677d3f2d0e993f1e15a7b34dcb7d047973cb4d | README.md | README.md |
Short module allowing the user to control a fork'd MPlayer process in
slave-mode.
You can read all about the MPlayer slave protocol at this address:
http://www.mplayerhq.hu/DOCS/tech/slave.txt
## Requirements
MPlayer should be installed and available in the current PATH
## Example
This example launches MPlayer in the background, requests it to play a file,
wait for 5 seconds then stop playback:
```
import (
"time"
"github.com/tamentis/go-mplayer"
)
mplayer.StartSlave()
mplayer.SendCommand("loadfile /tmp/myfile.mp3")
time.Sleep(5 * time.Seconds)
mplayer.SendCommand("stop")
```
This example uses the blocking command PlayAndWait(), it allows you to use the
module in a similar fashion to `os/exec` except that you can pre-load the
process to get a better response time (e.g. on slow hardware):
```
import (
"github.com/tamentis/go-mplayer"
)
mplayer.StartSlave()
mplayer.PlayAndWait("/tmp/myfile.mp3")
```
|
Short module allowing the user to control a fork'd MPlayer process in
slave-mode.
You can read all about the MPlayer slave protocol at [mplayerhq.hu](http://www.mplayerhq.hu/DOCS/tech/slave.txt)
## Requirements
MPlayer should be installed and available in the current PATH
## Example
This example launches MPlayer in the background, requests it to play a file,
wait for 5 seconds then stop playback:
```go
import (
"time"
"github.com/tamentis/go-mplayer"
)
mplayer.StartSlave()
mplayer.SendCommand("loadfile /tmp/myfile.mp3")
time.Sleep(5 * time.Seconds)
mplayer.SendCommand("stop")
```
This example uses the blocking command PlayAndWait(), it allows you to use the
module in a similar fashion to `os/exec` except that you can pre-load the
process to get a better response time (e.g. on slow hardware):
```go
import (
"github.com/tamentis/go-mplayer"
)
mplayer.StartSlave()
mplayer.PlayAndWait("/tmp/myfile.mp3")
```
| Fix some formatting isssues with the readme | Fix some formatting isssues with the readme
| Markdown | isc | tamentis/go-mplayer | markdown | ## Code Before:
Short module allowing the user to control a fork'd MPlayer process in
slave-mode.
You can read all about the MPlayer slave protocol at this address:
http://www.mplayerhq.hu/DOCS/tech/slave.txt
## Requirements
MPlayer should be installed and available in the current PATH
## Example
This example launches MPlayer in the background, requests it to play a file,
wait for 5 seconds then stop playback:
```
import (
"time"
"github.com/tamentis/go-mplayer"
)
mplayer.StartSlave()
mplayer.SendCommand("loadfile /tmp/myfile.mp3")
time.Sleep(5 * time.Seconds)
mplayer.SendCommand("stop")
```
This example uses the blocking command PlayAndWait(), it allows you to use the
module in a similar fashion to `os/exec` except that you can pre-load the
process to get a better response time (e.g. on slow hardware):
```
import (
"github.com/tamentis/go-mplayer"
)
mplayer.StartSlave()
mplayer.PlayAndWait("/tmp/myfile.mp3")
```
## Instruction:
Fix some formatting isssues with the readme
## Code After:
Short module allowing the user to control a fork'd MPlayer process in
slave-mode.
You can read all about the MPlayer slave protocol at [mplayerhq.hu](http://www.mplayerhq.hu/DOCS/tech/slave.txt)
## Requirements
MPlayer should be installed and available in the current PATH
## Example
This example launches MPlayer in the background, requests it to play a file,
wait for 5 seconds then stop playback:
```go
import (
"time"
"github.com/tamentis/go-mplayer"
)
mplayer.StartSlave()
mplayer.SendCommand("loadfile /tmp/myfile.mp3")
time.Sleep(5 * time.Seconds)
mplayer.SendCommand("stop")
```
This example uses the blocking command PlayAndWait(), it allows you to use the
module in a similar fashion to `os/exec` except that you can pre-load the
process to get a better response time (e.g. on slow hardware):
```go
import (
"github.com/tamentis/go-mplayer"
)
mplayer.StartSlave()
mplayer.PlayAndWait("/tmp/myfile.mp3")
```
|
Short module allowing the user to control a fork'd MPlayer process in
slave-mode.
+ You can read all about the MPlayer slave protocol at [mplayerhq.hu](http://www.mplayerhq.hu/DOCS/tech/slave.txt)
- You can read all about the MPlayer slave protocol at this address:
-
- http://www.mplayerhq.hu/DOCS/tech/slave.txt
## Requirements
MPlayer should be installed and available in the current PATH
## Example
This example launches MPlayer in the background, requests it to play a file,
wait for 5 seconds then stop playback:
- ```
+ ```go
? ++
import (
"time"
"github.com/tamentis/go-mplayer"
)
mplayer.StartSlave()
mplayer.SendCommand("loadfile /tmp/myfile.mp3")
time.Sleep(5 * time.Seconds)
mplayer.SendCommand("stop")
```
This example uses the blocking command PlayAndWait(), it allows you to use the
module in a similar fashion to `os/exec` except that you can pre-load the
process to get a better response time (e.g. on slow hardware):
- ```
+ ```go
? ++
import (
"github.com/tamentis/go-mplayer"
)
mplayer.StartSlave()
mplayer.PlayAndWait("/tmp/myfile.mp3")
``` | 8 | 0.186047 | 3 | 5 |
e6aaeb19cfa1cb67ac073fe0279a420b1d8d81c3 | scripts/copycat_mode_quit.sh | scripts/copycat_mode_quit.sh |
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$CURRENT_DIR/helpers.sh"
unbind_cancel_bindings() {
local cancel_mode_bindings=$(copycat_quit_copy_mode_keys)
local key
for key in $cancel_mode_bindings; do
tmux unbind-key -n "$key"
done
}
unbind_prev_next_bindings() {
tmux unbind-key -n "$(copycat_next_key)"
tmux unbind-key -n "$(copycat_prev_key)"
}
unbind_all_bindings() {
unbind_cancel_bindings
unbind_prev_next_bindings
}
main() {
reset_copycat_position
unset_copycat_mode
copycat_decrease_counter
# removing all bindings only if no panes are in copycat mode
if copycat_counter_zero; then
unbind_all_bindings;
fi
}
main
|
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$CURRENT_DIR/helpers.sh"
unbind_cancel_bindings() {
local cancel_mode_bindings=$(copycat_quit_copy_mode_keys)
local key
for key in $cancel_mode_bindings; do
tmux unbind-key -n "$key"
done
}
unbind_prev_next_bindings() {
tmux unbind-key -n "$(copycat_next_key)"
tmux unbind-key -n "$(copycat_prev_key)"
}
unbind_all_bindings() {
unbind_cancel_bindings
unbind_prev_next_bindings
}
main() {
if in_copycat_mode; then
reset_copycat_position
unset_copycat_mode
copycat_decrease_counter
# removing all bindings only if no panes are in copycat mode
if copycat_counter_zero; then
unbind_all_bindings;
fi
fi
}
main
| Quit copycat mode only when inside a copycat mode pane | Quit copycat mode only when inside a copycat mode pane
| Shell | mit | tmux-plugins/tmux-copycat,bruno-/tmux-copycat | shell | ## Code Before:
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$CURRENT_DIR/helpers.sh"
unbind_cancel_bindings() {
local cancel_mode_bindings=$(copycat_quit_copy_mode_keys)
local key
for key in $cancel_mode_bindings; do
tmux unbind-key -n "$key"
done
}
unbind_prev_next_bindings() {
tmux unbind-key -n "$(copycat_next_key)"
tmux unbind-key -n "$(copycat_prev_key)"
}
unbind_all_bindings() {
unbind_cancel_bindings
unbind_prev_next_bindings
}
main() {
reset_copycat_position
unset_copycat_mode
copycat_decrease_counter
# removing all bindings only if no panes are in copycat mode
if copycat_counter_zero; then
unbind_all_bindings;
fi
}
main
## Instruction:
Quit copycat mode only when inside a copycat mode pane
## Code After:
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$CURRENT_DIR/helpers.sh"
unbind_cancel_bindings() {
local cancel_mode_bindings=$(copycat_quit_copy_mode_keys)
local key
for key in $cancel_mode_bindings; do
tmux unbind-key -n "$key"
done
}
unbind_prev_next_bindings() {
tmux unbind-key -n "$(copycat_next_key)"
tmux unbind-key -n "$(copycat_prev_key)"
}
unbind_all_bindings() {
unbind_cancel_bindings
unbind_prev_next_bindings
}
main() {
if in_copycat_mode; then
reset_copycat_position
unset_copycat_mode
copycat_decrease_counter
# removing all bindings only if no panes are in copycat mode
if copycat_counter_zero; then
unbind_all_bindings;
fi
fi
}
main
|
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$CURRENT_DIR/helpers.sh"
unbind_cancel_bindings() {
local cancel_mode_bindings=$(copycat_quit_copy_mode_keys)
local key
for key in $cancel_mode_bindings; do
tmux unbind-key -n "$key"
done
}
unbind_prev_next_bindings() {
tmux unbind-key -n "$(copycat_next_key)"
tmux unbind-key -n "$(copycat_prev_key)"
}
unbind_all_bindings() {
unbind_cancel_bindings
unbind_prev_next_bindings
}
main() {
+ if in_copycat_mode; then
- reset_copycat_position
+ reset_copycat_position
? +
- unset_copycat_mode
+ unset_copycat_mode
? +
- copycat_decrease_counter
+ copycat_decrease_counter
? +
- # removing all bindings only if no panes are in copycat mode
+ # removing all bindings only if no panes are in copycat mode
? +
- if copycat_counter_zero; then
+ if copycat_counter_zero; then
? +
- unbind_all_bindings;
+ unbind_all_bindings;
? +
+ fi
fi
}
main | 14 | 0.424242 | 8 | 6 |
bfe9524ffed6d64e85d361589564fc3f0e7054af | lib/grammars.coffee | lib/grammars.coffee | module.exports =
CoffeeScript:
interpreter: "coffee"
makeargs: (code) -> ['-e', code]
JavaScript:
interpreter: "node"
makeargs: (code) -> ['-e', code]
Ruby:
interpreter: "ruby"
makeargs: (code) -> ['-e', code]
Perl:
interpreter: "perl"
makeargs: (code) -> ['-e', code]
PHP:
interpreter: "php"
makeargs: (code) -> ['-r', code]
Python:
interpreter: "python"
makeargs: (code) -> ['-c', code]
'Shell Script (Bash)':
interpreter: "bash"
makeargs: (code) -> ['-c', code]
|
defaultFileArgs = (filename) -> [filename]
module.exports =
CoffeeScript:
command: "coffee"
bySelectionArgs: (code) -> ['-e', code]
byFileArgs: defaultFileArgs
JavaScript:
command: "node"
selectionArgs: (code) -> ['-e', code]
byFileArgs: defaultFileArgs
Ruby:
command: "ruby"
selectionArgs: (code) -> ['-e', code]
byFileArgs: defaultFileArgs
Perl:
command: "perl"
selectionArgs: (code) -> ['-e', code]
byFileArgs: defaultFileArgs
PHP:
command: "php"
selectionArgs: (code) -> ['-r', code]
byFileArgs: defaultFileArgs
Python:
command: "python"
selectionArgs: (code) -> ['-c', code]
byFileArgs: defaultFileArgs
'Shell Script (Bash)':
command: "bash"
selectionArgs: (code) -> ['-c', code]
byFileArgs: defaultFileArgs
| Set up selection vs. file args. | Set up selection vs. file args.
| CoffeeScript | mit | efatsi/atom-script,rodionovd/atom-script,idleberg/atom-script,rgbkrk/atom-script,Calyhre/atom-script,jchannon/atom-script,rodionovd/atom-script,anfedorov/atom-script,efatsi/atom-script,efatsi/atom-script,anfedorov/atom-script,rodionovd/atom-script,jchannon/atom-script,rodionovd/atom-script,anfedorov/atom-script,jchannon/atom-script,rodionovd/atom-script,Calyhre/atom-script,efatsi/atom-script,anfedorov/atom-script,Calyhre/atom-script,jchannon/atom-script,jchannon/atom-script,Calyhre/atom-script,jchannon/atom-script,efatsi/atom-script,jchannon/atom-script,chenruixuan/atom-script,MichaelSp/atom-script,rodionovd/atom-script,Calyhre/atom-script,efatsi/atom-script,Calyhre/atom-script,anfedorov/atom-script,rodionovd/atom-script,jchannon/atom-script,efatsi/atom-script,efatsi/atom-script,rodionovd/atom-script,anfedorov/atom-script,jchannon/atom-script,rodionovd/atom-script,anfedorov/atom-script,rodionovd/atom-script,rodionovd/atom-script,efatsi/atom-script,efatsi/atom-script,jchannon/atom-script,jchannon/atom-script,anfedorov/atom-script,Calyhre/atom-script,Calyhre/atom-script,Calyhre/atom-script,anfedorov/atom-script,anfedorov/atom-script,Calyhre/atom-script,rodionovd/atom-script,Calyhre/atom-script,efatsi/atom-script,efatsi/atom-script,Calyhre/atom-script,fscherwi/atom-script,anfedorov/atom-script,TomosBlack/atom-script,efatsi/atom-script,anfedorov/atom-script,rodionovd/atom-script,anfedorov/atom-script | coffeescript | ## Code Before:
module.exports =
CoffeeScript:
interpreter: "coffee"
makeargs: (code) -> ['-e', code]
JavaScript:
interpreter: "node"
makeargs: (code) -> ['-e', code]
Ruby:
interpreter: "ruby"
makeargs: (code) -> ['-e', code]
Perl:
interpreter: "perl"
makeargs: (code) -> ['-e', code]
PHP:
interpreter: "php"
makeargs: (code) -> ['-r', code]
Python:
interpreter: "python"
makeargs: (code) -> ['-c', code]
'Shell Script (Bash)':
interpreter: "bash"
makeargs: (code) -> ['-c', code]
## Instruction:
Set up selection vs. file args.
## Code After:
defaultFileArgs = (filename) -> [filename]
module.exports =
CoffeeScript:
command: "coffee"
bySelectionArgs: (code) -> ['-e', code]
byFileArgs: defaultFileArgs
JavaScript:
command: "node"
selectionArgs: (code) -> ['-e', code]
byFileArgs: defaultFileArgs
Ruby:
command: "ruby"
selectionArgs: (code) -> ['-e', code]
byFileArgs: defaultFileArgs
Perl:
command: "perl"
selectionArgs: (code) -> ['-e', code]
byFileArgs: defaultFileArgs
PHP:
command: "php"
selectionArgs: (code) -> ['-r', code]
byFileArgs: defaultFileArgs
Python:
command: "python"
selectionArgs: (code) -> ['-c', code]
byFileArgs: defaultFileArgs
'Shell Script (Bash)':
command: "bash"
selectionArgs: (code) -> ['-c', code]
byFileArgs: defaultFileArgs
| +
+ defaultFileArgs = (filename) -> [filename]
+
module.exports =
CoffeeScript:
- interpreter: "coffee"
+ command: "coffee"
- makeargs: (code) -> ['-e', code]
? ^^^ ^
+ bySelectionArgs: (code) -> ['-e', code]
? ^^^ ^^^^^^^^
+ byFileArgs: defaultFileArgs
JavaScript:
- interpreter: "node"
+ command: "node"
- makeargs: (code) -> ['-e', code]
? ^^^ ^
+ selectionArgs: (code) -> ['-e', code]
? ^ ^^^^^^^^
+ byFileArgs: defaultFileArgs
Ruby:
- interpreter: "ruby"
+ command: "ruby"
- makeargs: (code) -> ['-e', code]
? ^^^ ^
+ selectionArgs: (code) -> ['-e', code]
? ^ ^^^^^^^^
+ byFileArgs: defaultFileArgs
Perl:
- interpreter: "perl"
+ command: "perl"
- makeargs: (code) -> ['-e', code]
? ^^^ ^
+ selectionArgs: (code) -> ['-e', code]
? ^ ^^^^^^^^
+ byFileArgs: defaultFileArgs
PHP:
- interpreter: "php"
+ command: "php"
- makeargs: (code) -> ['-r', code]
? ^^^ ^
+ selectionArgs: (code) -> ['-r', code]
? ^ ^^^^^^^^
+ byFileArgs: defaultFileArgs
Python:
- interpreter: "python"
+ command: "python"
- makeargs: (code) -> ['-c', code]
? ^^^ ^
+ selectionArgs: (code) -> ['-c', code]
? ^ ^^^^^^^^
+ byFileArgs: defaultFileArgs
'Shell Script (Bash)':
- interpreter: "bash"
+ command: "bash"
- makeargs: (code) -> ['-c', code]
? ^^^ ^
+ selectionArgs: (code) -> ['-c', code]
? ^ ^^^^^^^^
+ byFileArgs: defaultFileArgs | 38 | 1.727273 | 24 | 14 |
b45df3945a923a83fcba87492b2a047808ca972e | src/main/java/io/mere/mortal/BackendServlet.java | src/main/java/io/mere/mortal/BackendServlet.java | package io.mere.mortal;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet(urlPatterns = {"/*"}, loadOnStartup = 1)
public class BackendServlet extends HttpServlet
{
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException
{
if ("/oops".equals(request.getRequestURI())) {
response.sendError(500);
} else {
response.getOutputStream().print("This sometimes serves stuff: "+request.getRequestURI());
}
}
}
| package io.mere.mortal;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet(urlPatterns = {"/*"}, loadOnStartup = 1)
public class BackendServlet extends HttpServlet {
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
response.sendError(500);
}
}
| Throw 500's, because it's in vogue | Throw 500's, because it's in vogue
- Also set up a bad version for talk.
| Java | apache-2.0 | SwampUpMereMortals/crispy-barnacle | java | ## Code Before:
package io.mere.mortal;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet(urlPatterns = {"/*"}, loadOnStartup = 1)
public class BackendServlet extends HttpServlet
{
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException
{
if ("/oops".equals(request.getRequestURI())) {
response.sendError(500);
} else {
response.getOutputStream().print("This sometimes serves stuff: "+request.getRequestURI());
}
}
}
## Instruction:
Throw 500's, because it's in vogue
- Also set up a bad version for talk.
## Code After:
package io.mere.mortal;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet(urlPatterns = {"/*"}, loadOnStartup = 1)
public class BackendServlet extends HttpServlet {
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
response.sendError(500);
}
}
| package io.mere.mortal;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet(urlPatterns = {"/*"}, loadOnStartup = 1)
- public class BackendServlet extends HttpServlet
+ public class BackendServlet extends HttpServlet {
? +
- {
- @Override
? -
+ @Override
- public void doGet(HttpServletRequest request, HttpServletResponse response)
+ public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
? ++++++++++++++++++++
- throws IOException
- {
- if ("/oops".equals(request.getRequestURI())) {
- response.sendError(500);
? - ^
+ response.sendError(500);
? ^^
- } else {
- response.getOutputStream().print("This sometimes serves stuff: "+request.getRequestURI());
- }
}
} | 15 | 0.681818 | 4 | 11 |
fe3648f47f50b95724c197363f3c3eb15420564f | assets/javascripts/templates/_profile_stats.js.mustache.slim | assets/javascripts/templates/_profile_stats.js.mustache.slim | .span8
.stat
.value {{postsCount}}
.title Posts
.stat
.title Following
.value {{followingsCount}}
.stat
.title Followed by
.value {{followersCount}}
| .span2
.span6.no-offset
.stat
.value {{postsCount}}
.title Posts
.stat
.title Following
.value {{followingsCount}}
.stat
.title Followed by
.value {{followersCount}}
| Align stats with bio text on profile | Align stats with bio text on profile
| Slim | bsd-3-clause | tent/tent-status,tent/tent-status | slim | ## Code Before:
.span8
.stat
.value {{postsCount}}
.title Posts
.stat
.title Following
.value {{followingsCount}}
.stat
.title Followed by
.value {{followersCount}}
## Instruction:
Align stats with bio text on profile
## Code After:
.span2
.span6.no-offset
.stat
.value {{postsCount}}
.title Posts
.stat
.title Following
.value {{followingsCount}}
.stat
.title Followed by
.value {{followersCount}}
| - .span8
+ .span2
+ .span6.no-offset
.stat
.value {{postsCount}}
.title Posts
.stat
.title Following
.value {{followingsCount}}
.stat
.title Followed by
.value {{followersCount}} | 3 | 0.3 | 2 | 1 |
94cc33b2b5ad19dcfd5198f5b26a2206c23a696f | doc/developing-without-vm.md | doc/developing-without-vm.md |
The simplest way to get Smart Answers running locally is to run:
```bash
$ PLEK_SERVICE_CONTENTAPI_URI=https://www.gov.uk/api \
PLEK_SERVICE_STATIC_URI=https://assets-origin.preview.alphagov.co.uk \
rails s
```
This tells Smart Answers to use the production Content API and the asset server from the preview environment.
If you don't set either environment variable then the app will attempt to connect to the content API and asset server at http://contentapi.dev.gov.uk and http://static.dev.gov.uk respectively. NOTE. These are available automatically if you're [developing using the VM](developing-using-vm.md). If the app can't connect to these hosts then you'll see [errors](common-errors.md).
|
The simplest way to get Smart Answers running locally is to run:
```bash
$ PLEK_SERVICE_CONTENTAPI_URI=https://www.gov.uk/api \
PLEK_SERVICE_STATIC_URI=assets-origin.integration.publishing.service.gov.uk \
rails s
```
This tells Smart Answers to use the production Content API and the asset server from the integration environment.
If you don't set either environment variable then the app will attempt to connect to the content API and asset server at http://contentapi.dev.gov.uk and http://static.dev.gov.uk respectively. NOTE. These are available automatically if you're [developing using the VM](developing-using-vm.md). If the app can't connect to these hosts then you'll see [errors](common-errors.md).
| Update environment in developer documentation | Update environment in developer documentation
| Markdown | mit | stwalsh/smart-answers,alphagov/smart-answers,stwalsh/smart-answers,alphagov/smart-answers,alphagov/smart-answers,aledelcueto/smart-answers,alphagov/smart-answers,aledelcueto/smart-answers,aledelcueto/smart-answers,aledelcueto/smart-answers,stwalsh/smart-answers,stwalsh/smart-answers | markdown | ## Code Before:
The simplest way to get Smart Answers running locally is to run:
```bash
$ PLEK_SERVICE_CONTENTAPI_URI=https://www.gov.uk/api \
PLEK_SERVICE_STATIC_URI=https://assets-origin.preview.alphagov.co.uk \
rails s
```
This tells Smart Answers to use the production Content API and the asset server from the preview environment.
If you don't set either environment variable then the app will attempt to connect to the content API and asset server at http://contentapi.dev.gov.uk and http://static.dev.gov.uk respectively. NOTE. These are available automatically if you're [developing using the VM](developing-using-vm.md). If the app can't connect to these hosts then you'll see [errors](common-errors.md).
## Instruction:
Update environment in developer documentation
## Code After:
The simplest way to get Smart Answers running locally is to run:
```bash
$ PLEK_SERVICE_CONTENTAPI_URI=https://www.gov.uk/api \
PLEK_SERVICE_STATIC_URI=assets-origin.integration.publishing.service.gov.uk \
rails s
```
This tells Smart Answers to use the production Content API and the asset server from the integration environment.
If you don't set either environment variable then the app will attempt to connect to the content API and asset server at http://contentapi.dev.gov.uk and http://static.dev.gov.uk respectively. NOTE. These are available automatically if you're [developing using the VM](developing-using-vm.md). If the app can't connect to these hosts then you'll see [errors](common-errors.md).
|
The simplest way to get Smart Answers running locally is to run:
```bash
$ PLEK_SERVICE_CONTENTAPI_URI=https://www.gov.uk/api \
- PLEK_SERVICE_STATIC_URI=https://assets-origin.preview.alphagov.co.uk \
+ PLEK_SERVICE_STATIC_URI=assets-origin.integration.publishing.service.gov.uk \
rails s
```
- This tells Smart Answers to use the production Content API and the asset server from the preview environment.
? ^ ^^ ^^
+ This tells Smart Answers to use the production Content API and the asset server from the integration environment.
? ^^^^^ ^^ ^^
If you don't set either environment variable then the app will attempt to connect to the content API and asset server at http://contentapi.dev.gov.uk and http://static.dev.gov.uk respectively. NOTE. These are available automatically if you're [developing using the VM](developing-using-vm.md). If the app can't connect to these hosts then you'll see [errors](common-errors.md). | 4 | 0.333333 | 2 | 2 |
ff0cb39735958b8c2318c0f78aad28519e6b5b3b | .travis.yml | .travis.yml | language: java
before_script:
- psql -c "create database example_app;" -U postgres
- psql -c "create user example_user with password 's3cr3t';" -U postgres
- psql -d example_app -U postgres -f droptools-example/src/main/resources/db/migration/20141010__init.sql
- psql -c "grant all on database example_app to example_user;" -U postgres
- psql -c "grant all on all tables in schema ex to example_user" -d example_app -U postgres
install: echo 'mvn test will install dependencies for us'
script: mvn test
after_success: mvn -DperformRelease=true cobertura:cobertura coveralls:cobertura
jdk:
- oraclejdk8
- oraclejdk7
addons:
postgresql: "9.3"
| language: java
before_script:
- psql -c "create database example_app;" -U postgres
- psql -c "create user example_user with password 's3cr3t';" -U postgres
- psql -d example_app -U postgres -f droptools-example/src/main/resources/db/migration/20141010__init.sql
- psql -c "grant all on database example_app to example_user;" -U postgres
- psql -c "grant all on all tables in schema ex to example_user" -d example_app -U postgres
install: echo 'mvn test will install dependencies for us'
script: mvn test
after_success: mvn -DperformRelease=true cobertura:cobertura coveralls:cobertura
jdk:
- oraclejdk8
sudo: false
addons:
postgresql: "9.3"
| Kill JDK7 tests and use their containers. | Travis: Kill JDK7 tests and use their containers. | YAML | apache-2.0 | benjamin-bader/droptools,benjamin-bader/droptools,haydentherapper/droptools | yaml | ## Code Before:
language: java
before_script:
- psql -c "create database example_app;" -U postgres
- psql -c "create user example_user with password 's3cr3t';" -U postgres
- psql -d example_app -U postgres -f droptools-example/src/main/resources/db/migration/20141010__init.sql
- psql -c "grant all on database example_app to example_user;" -U postgres
- psql -c "grant all on all tables in schema ex to example_user" -d example_app -U postgres
install: echo 'mvn test will install dependencies for us'
script: mvn test
after_success: mvn -DperformRelease=true cobertura:cobertura coveralls:cobertura
jdk:
- oraclejdk8
- oraclejdk7
addons:
postgresql: "9.3"
## Instruction:
Travis: Kill JDK7 tests and use their containers.
## Code After:
language: java
before_script:
- psql -c "create database example_app;" -U postgres
- psql -c "create user example_user with password 's3cr3t';" -U postgres
- psql -d example_app -U postgres -f droptools-example/src/main/resources/db/migration/20141010__init.sql
- psql -c "grant all on database example_app to example_user;" -U postgres
- psql -c "grant all on all tables in schema ex to example_user" -d example_app -U postgres
install: echo 'mvn test will install dependencies for us'
script: mvn test
after_success: mvn -DperformRelease=true cobertura:cobertura coveralls:cobertura
jdk:
- oraclejdk8
sudo: false
addons:
postgresql: "9.3"
| language: java
before_script:
- psql -c "create database example_app;" -U postgres
- psql -c "create user example_user with password 's3cr3t';" -U postgres
- psql -d example_app -U postgres -f droptools-example/src/main/resources/db/migration/20141010__init.sql
- psql -c "grant all on database example_app to example_user;" -U postgres
- psql -c "grant all on all tables in schema ex to example_user" -d example_app -U postgres
install: echo 'mvn test will install dependencies for us'
script: mvn test
after_success: mvn -DperformRelease=true cobertura:cobertura coveralls:cobertura
jdk:
- oraclejdk8
- - oraclejdk7
+ sudo: false
addons:
postgresql: "9.3" | 2 | 0.133333 | 1 | 1 |
21666920ac912a222d61e4bbdb20f5b520c0b0d0 | css/blocks/_list-group.scss | css/blocks/_list-group.scss | .list-group-element {
color: $color-text-dark-primary;
display: block;
font-size: 0.9rem;
line-height: 1.7;
padding-bottom: 16px;
padding-top: 16px;
position: relative;
&-heading {
font-size: 1.5rem;
}
&-images {
margin-top: 8px;
&-link {
margin-left: -10px;
}
&-element {
border-radius: 50%;
border: 2px solid #fff;
box-sizing: content-box;
background-origin: content-box;
& + & {
margin-left: 4px;
}
}
}
}
| .list-group-element {
color: $color-text-dark-primary;
display: block;
font-size: 0.9rem;
line-height: 1.7;
padding-bottom: 16px;
padding-top: 16px;
position: relative;
&-heading {
font-size: 1.5rem;
}
&-images {
margin-top: 8px;
margin-left: 10px;
&-link {
margin-left: -12px;
}
&-element {
border-radius: 50%;
border: 2px solid #fff;
box-sizing: content-box;
background-origin: content-box;
& + & {
margin-left: 4px;
}
}
}
}
| Set margin-left: 10px for images | Set margin-left: 10px for images
| SCSS | mit | soussune/soussune.github.io,soussune/soussune.github.io,soussune/soussune.github.io,soussune/soussune.github.io,soussune/soussune.github.io | scss | ## Code Before:
.list-group-element {
color: $color-text-dark-primary;
display: block;
font-size: 0.9rem;
line-height: 1.7;
padding-bottom: 16px;
padding-top: 16px;
position: relative;
&-heading {
font-size: 1.5rem;
}
&-images {
margin-top: 8px;
&-link {
margin-left: -10px;
}
&-element {
border-radius: 50%;
border: 2px solid #fff;
box-sizing: content-box;
background-origin: content-box;
& + & {
margin-left: 4px;
}
}
}
}
## Instruction:
Set margin-left: 10px for images
## Code After:
.list-group-element {
color: $color-text-dark-primary;
display: block;
font-size: 0.9rem;
line-height: 1.7;
padding-bottom: 16px;
padding-top: 16px;
position: relative;
&-heading {
font-size: 1.5rem;
}
&-images {
margin-top: 8px;
margin-left: 10px;
&-link {
margin-left: -12px;
}
&-element {
border-radius: 50%;
border: 2px solid #fff;
box-sizing: content-box;
background-origin: content-box;
& + & {
margin-left: 4px;
}
}
}
}
| .list-group-element {
color: $color-text-dark-primary;
display: block;
font-size: 0.9rem;
line-height: 1.7;
padding-bottom: 16px;
padding-top: 16px;
position: relative;
&-heading {
font-size: 1.5rem;
}
&-images {
margin-top: 8px;
+ margin-left: 10px;
&-link {
- margin-left: -10px;
? ^
+ margin-left: -12px;
? ^
}
&-element {
border-radius: 50%;
border: 2px solid #fff;
box-sizing: content-box;
background-origin: content-box;
& + & {
margin-left: 4px;
}
}
}
} | 3 | 0.09375 | 2 | 1 |
8d5fa1a862e0afbc9e101447e9ff29864203a252 | .travis.yml | .travis.yml | language: node_js
node_js:
- '4'
- '4.3.2' # AWS Lambda
- '5'
- '6'
- '6.10.3' # AWS Lambda
- '7'
- '8'
- 'node'
- 'iojs'
script:
- npm run ci
matrix:
allow_failures:
- node_js: 'iojs'
- node_js: '4.3.2'
- node_js: '4'
- node_js: '5'
| language: node_js
node_js:
- '4'
- '4.3.2' # AWS Lambda
- '5'
- '6'
- '6.10.3' # AWS Lambda
- '7'
- '8'
- '8.10' # AWS Lambda
- '9'
- '10'
- 'node'
- 'iojs'
script:
- npm run ci
matrix:
allow_failures:
- node_js: 'iojs'
- node_js: '4.3.2'
- node_js: '4'
- node_js: '5'
| Add additional nodejs version builds | Add additional nodejs version builds
| YAML | mit | tamino-martinius/node-next-model | yaml | ## Code Before:
language: node_js
node_js:
- '4'
- '4.3.2' # AWS Lambda
- '5'
- '6'
- '6.10.3' # AWS Lambda
- '7'
- '8'
- 'node'
- 'iojs'
script:
- npm run ci
matrix:
allow_failures:
- node_js: 'iojs'
- node_js: '4.3.2'
- node_js: '4'
- node_js: '5'
## Instruction:
Add additional nodejs version builds
## Code After:
language: node_js
node_js:
- '4'
- '4.3.2' # AWS Lambda
- '5'
- '6'
- '6.10.3' # AWS Lambda
- '7'
- '8'
- '8.10' # AWS Lambda
- '9'
- '10'
- 'node'
- 'iojs'
script:
- npm run ci
matrix:
allow_failures:
- node_js: 'iojs'
- node_js: '4.3.2'
- node_js: '4'
- node_js: '5'
| language: node_js
node_js:
- '4'
- '4.3.2' # AWS Lambda
- '5'
- '6'
- '6.10.3' # AWS Lambda
- '7'
- '8'
+ - '8.10' # AWS Lambda
+ - '9'
+ - '10'
- 'node'
- 'iojs'
script:
- npm run ci
matrix:
allow_failures:
- node_js: 'iojs'
- node_js: '4.3.2'
- node_js: '4'
- node_js: '5' | 3 | 0.15 | 3 | 0 |
5dd93b5cc57fcbff668d553fe8803172a3370a27 | test/CMakeLists.txt | test/CMakeLists.txt |
include(${PROJECT_SOURCE_DIR}/CMakeIncludes.txt)
include(${PROJECT_SOURCE_DIR}/CMakeTestIncludes.txt)
add_subdirectory(libtester)
add_executable(test_hash
test_hash.c
)
target_link_libraries(test_hash
insomniac_gc
insomniac_hash
tester
)
add_test(TestHash ${CMAKE_CURRENT_BIN_DIR}/test_hash)
add_test(TestSCMBools ${PROJECT_SOURCE_DIR}/run.sh
${PROJECT_SOURCE_DIR}/test/test_bools.scm)
add_test(TestSCMeq? ${PROJECT_SOURCE_DIR}/run.sh
${PROJECT_SOURCE_DIR}/test/test_eq.scm)
add_test(TestSCMequal? ${PROJECT_SOURCE_DIR}/run.sh
${PROJECT_SOURCE_DIR}/test/test_equal.scm)
add_test(TestSCMLists ${PROJECT_SOURCE_DIR}/run.sh
${PROJECT_SOURCE_DIR}/test/test_lists.scm)
add_test(TestSCMVectors ${PROJECT_SOURCE_DIR}/run.sh
${PROJECT_SOURCE_DIR}/test/test_vectors.scm)
add_test(TestSCMRecords ${PROJECT_SOURCE_DIR}/run.sh
${PROJECT_SOURCE_DIR}/test/test_define_record_type.scm)
|
include(${PROJECT_SOURCE_DIR}/CMakeIncludes.txt)
include(${PROJECT_SOURCE_DIR}/CMakeTestIncludes.txt)
add_subdirectory(libtester)
add_executable(test_hash
test_hash.c
)
target_link_libraries(test_hash
insomniac_gc
insomniac_hash
tester
)
add_test(TestHash ${CMAKE_CURRENT_BIN_DIR}/test_hash)
add_test(TestSCMBools ${PROJECT_SOURCE_DIR}/run.sh
${PROJECT_SOURCE_DIR}/test/test_bools.scm)
add_test(TestSCMeq? ${PROJECT_SOURCE_DIR}/run.sh
${PROJECT_SOURCE_DIR}/test/test_eq.scm)
add_test(TestSCMequal? ${PROJECT_SOURCE_DIR}/run.sh
${PROJECT_SOURCE_DIR}/test/test_equal.scm)
add_test(TestSCMLists ${PROJECT_SOURCE_DIR}/run.sh
${PROJECT_SOURCE_DIR}/test/test_lists.scm)
add_test(TestSCMVectors ${PROJECT_SOURCE_DIR}/run.sh
${PROJECT_SOURCE_DIR}/test/test_vectors.scm)
add_test(TestSCMBytevectors ${PROJECT_SOURCE_DIR}/run.sh
${PROJECT_SOURCE_DIR}/test/test_byte_vector.scm)
add_test(TestSCMRecords ${PROJECT_SOURCE_DIR}/run.sh
${PROJECT_SOURCE_DIR}/test/test_define_record_type.scm)
| Add bytevector test to suite. | Add bytevector test to suite.
| Text | agpl-3.0 | arlaneenalra/insomniac,arlaneenalra/insomniac,arlaneenalra/insomniac | text | ## Code Before:
include(${PROJECT_SOURCE_DIR}/CMakeIncludes.txt)
include(${PROJECT_SOURCE_DIR}/CMakeTestIncludes.txt)
add_subdirectory(libtester)
add_executable(test_hash
test_hash.c
)
target_link_libraries(test_hash
insomniac_gc
insomniac_hash
tester
)
add_test(TestHash ${CMAKE_CURRENT_BIN_DIR}/test_hash)
add_test(TestSCMBools ${PROJECT_SOURCE_DIR}/run.sh
${PROJECT_SOURCE_DIR}/test/test_bools.scm)
add_test(TestSCMeq? ${PROJECT_SOURCE_DIR}/run.sh
${PROJECT_SOURCE_DIR}/test/test_eq.scm)
add_test(TestSCMequal? ${PROJECT_SOURCE_DIR}/run.sh
${PROJECT_SOURCE_DIR}/test/test_equal.scm)
add_test(TestSCMLists ${PROJECT_SOURCE_DIR}/run.sh
${PROJECT_SOURCE_DIR}/test/test_lists.scm)
add_test(TestSCMVectors ${PROJECT_SOURCE_DIR}/run.sh
${PROJECT_SOURCE_DIR}/test/test_vectors.scm)
add_test(TestSCMRecords ${PROJECT_SOURCE_DIR}/run.sh
${PROJECT_SOURCE_DIR}/test/test_define_record_type.scm)
## Instruction:
Add bytevector test to suite.
## Code After:
include(${PROJECT_SOURCE_DIR}/CMakeIncludes.txt)
include(${PROJECT_SOURCE_DIR}/CMakeTestIncludes.txt)
add_subdirectory(libtester)
add_executable(test_hash
test_hash.c
)
target_link_libraries(test_hash
insomniac_gc
insomniac_hash
tester
)
add_test(TestHash ${CMAKE_CURRENT_BIN_DIR}/test_hash)
add_test(TestSCMBools ${PROJECT_SOURCE_DIR}/run.sh
${PROJECT_SOURCE_DIR}/test/test_bools.scm)
add_test(TestSCMeq? ${PROJECT_SOURCE_DIR}/run.sh
${PROJECT_SOURCE_DIR}/test/test_eq.scm)
add_test(TestSCMequal? ${PROJECT_SOURCE_DIR}/run.sh
${PROJECT_SOURCE_DIR}/test/test_equal.scm)
add_test(TestSCMLists ${PROJECT_SOURCE_DIR}/run.sh
${PROJECT_SOURCE_DIR}/test/test_lists.scm)
add_test(TestSCMVectors ${PROJECT_SOURCE_DIR}/run.sh
${PROJECT_SOURCE_DIR}/test/test_vectors.scm)
add_test(TestSCMBytevectors ${PROJECT_SOURCE_DIR}/run.sh
${PROJECT_SOURCE_DIR}/test/test_byte_vector.scm)
add_test(TestSCMRecords ${PROJECT_SOURCE_DIR}/run.sh
${PROJECT_SOURCE_DIR}/test/test_define_record_type.scm)
|
include(${PROJECT_SOURCE_DIR}/CMakeIncludes.txt)
include(${PROJECT_SOURCE_DIR}/CMakeTestIncludes.txt)
add_subdirectory(libtester)
add_executable(test_hash
test_hash.c
)
target_link_libraries(test_hash
insomniac_gc
insomniac_hash
tester
)
add_test(TestHash ${CMAKE_CURRENT_BIN_DIR}/test_hash)
add_test(TestSCMBools ${PROJECT_SOURCE_DIR}/run.sh
${PROJECT_SOURCE_DIR}/test/test_bools.scm)
add_test(TestSCMeq? ${PROJECT_SOURCE_DIR}/run.sh
${PROJECT_SOURCE_DIR}/test/test_eq.scm)
add_test(TestSCMequal? ${PROJECT_SOURCE_DIR}/run.sh
${PROJECT_SOURCE_DIR}/test/test_equal.scm)
add_test(TestSCMLists ${PROJECT_SOURCE_DIR}/run.sh
${PROJECT_SOURCE_DIR}/test/test_lists.scm)
add_test(TestSCMVectors ${PROJECT_SOURCE_DIR}/run.sh
${PROJECT_SOURCE_DIR}/test/test_vectors.scm)
+ add_test(TestSCMBytevectors ${PROJECT_SOURCE_DIR}/run.sh
+ ${PROJECT_SOURCE_DIR}/test/test_byte_vector.scm)
+
add_test(TestSCMRecords ${PROJECT_SOURCE_DIR}/run.sh
${PROJECT_SOURCE_DIR}/test/test_define_record_type.scm)
+ | 4 | 0.102564 | 4 | 0 |
b07e32630829681da8229ed8184885470f58b30e | .travis.yml | .travis.yml | language: go
go:
- 1.5.3
- release
before_script:
- go tool vet mat/*.go
- go tool vet -shadow=true mat/*.go
script:
- go test -v ./...
| language: go
go:
- 1.5.3
- release
before_script:
- go tool vet -test mat/*.go
script:
- go test -v ./...
| Fix the vetting tool to do -all and -shadow | Fix the vetting tool to do -all and -shadow
| YAML | mit | NDari/gocrunch,NDari/numgo | yaml | ## Code Before:
language: go
go:
- 1.5.3
- release
before_script:
- go tool vet mat/*.go
- go tool vet -shadow=true mat/*.go
script:
- go test -v ./...
## Instruction:
Fix the vetting tool to do -all and -shadow
## Code After:
language: go
go:
- 1.5.3
- release
before_script:
- go tool vet -test mat/*.go
script:
- go test -v ./...
| language: go
go:
- 1.5.3
- release
before_script:
- - go tool vet mat/*.go
+ - go tool vet -test mat/*.go
? ++++++
- - go tool vet -shadow=true mat/*.go
script:
- go test -v ./...
| 3 | 0.25 | 1 | 2 |
8e6f333a69f660a6ec4147b0c5ecc4474e81f69f | python/src/main/resources/interpreter-setting.json | python/src/main/resources/interpreter-setting.json | [
{
"group": "python",
"name": "python",
"className": "org.apache.zeppelin.python.PythonInterpreter",
"properties": {
"zeppelin.python": {
"envName": null,
"propertyName": "zeppelin.python",
"defaultValue": "python",
"description": "Python directory. It is set to python by default.(assume python is in your $PATH)"
},
"zeppelin.python.maxResult": {
"envName": null,
"propertyName": "zeppelin.python.maxResult",
"defaultValue": "1000",
"description": "Max number of dataframe rows to display."
}
},
"editor": {
"language": "python",
"editOnDblClick": false
}
},
{
"group": "python",
"name": "sql",
"className": "org.apache.zeppelin.python.PythonInterpreterPandasSql",
"properties": {
},
"editor":{
"language": "sql",
"editOnDblClick": false
}
},
{
"group": "python",
"name": "conda",
"className": "org.apache.zeppelin.python.PythonCondaInterpreter",
"properties": {
},
"editor":{
"language": "sh",
"editOnDblClick": false
}
}
]
| [
{
"group": "python",
"name": "python",
"className": "org.apache.zeppelin.python.PythonInterpreter",
"properties": {
"zeppelin.python": {
"envName": null,
"propertyName": "zeppelin.python",
"defaultValue": "python",
"description": "Python directory. It is set to python by default.(assume python is in your $PATH)"
},
"zeppelin.python.maxResult": {
"envName": null,
"propertyName": "zeppelin.python.maxResult",
"defaultValue": "1000",
"description": "Max number of dataframe rows to display."
}
},
"editor": {
"language": "python",
"editOnDblClick": false
}
},
{
"group": "python",
"name": "sql",
"className": "org.apache.zeppelin.python.PythonInterpreterPandasSql",
"properties": {
},
"editor":{
"language": "sql",
"editOnDblClick": false
}
},
{
"group": "python",
"name": "conda",
"className": "org.apache.zeppelin.python.PythonCondaInterpreter",
"properties": {
},
"editor":{
"language": "sh",
"editOnDblClick": false
}
},
{
"group": "python",
"name": "docker",
"className": "org.apache.zeppelin.python.PythonDockerInterpreter",
"properties": {
},
"editor":{
"language": "sh",
"editOnDblClick": false
}
}
]
| Add PythonDockerInterpreter to interpreter group | Add PythonDockerInterpreter to interpreter group
### What is this PR for?
Recently PythonDockerInterpreter added to PythonInterpreter in https://github.com/apache/zeppelin/pull/1654.
### What type of PR is it?
Bug Fix | Improvement
### Screenshots (if appropriate)
- before

- after

### Questions:
* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no
Author: astroshim <hsshim@nflabs.com>
Closes #1707 from astroshim/add/python-docker-interpreter and squashes the following commits:
55bf442 [astroshim] fix Bracket
8732f87 [astroshim] add PythonDockerInterpreter to group
| JSON | apache-2.0 | sohaibiftikhar/zeppelin,anthonycorbacho/incubator-zeppelin,sctincman/zeppelin,herval/zeppelin,pellmont/zeppelin,datalayer/zeppelin-datalayer,jongyoul/incubator-zeppelin,hkropp/incubator-zeppelin,zjffdu/zeppelin,prabhjyotsingh/zeppelin,datalayer/zeppelin-datalayer,tzolov/incubator-zeppelin,sravan-s/zeppelin,SachinJanani/zeppelin,yorek/zeppelin,prabhjyotsingh/incubator-zeppelin,hkropp/incubator-zeppelin,Altiscale/incubator-zeppelin,yu74n/zeppelin,vrlo/zeppelin,sergeymazin/zeppelin,astroshim/zeppelin,Leemoonsoo/zeppelin,lresende/incubator-zeppelin,doanduyhai/incubator-zeppelin,namanmishra91/zeppelin,apache/incubator-zeppelin,fogbeam/zeppelin_mirror,apache/zeppelin,volumeint/zeppelin,zetaris/zeppelin,lresende/incubator-zeppelin,cfries/zeppelin,cfries/zeppelin,AlexanderShoshin/zeppelin,prabhjyotsingh/zeppelin,yorek/zeppelin,wary/zeppelin,soralee/zeppelin,tinkoff-dwh/zeppelin,radicalbit/incubator-zeppelin,r-kamath/incubator-zeppelin,IceKhan13/zeppelin,lresende/incubator-zeppelin,r-kamath/incubator-zeppelin,Altiscale/incubator-zeppelin,mwkang/zeppelin,namanmishra91/zeppelin,wary/zeppelin,yu74n/zeppelin,benoyantony/zeppelin,r-kamath/incubator-zeppelin,SarunasG/zeppelin-oidc,jongyoul/incubator-zeppelin,astroshim/incubator-zeppelin,zetaris/zeppelin,SachinJanani/zeppelin,vrlo/zeppelin,lresende/incubator-zeppelin,namanmishra91/zeppelin,Altiscale/incubator-zeppelin,cquptEthan/incubator-zeppelin,rconline/zeppelin,pravin-dsilva/zeppelin,rconline/zeppelin,hammertank/zeppelin,r-kamath/incubator-zeppelin,Leemoonsoo/zeppelin,VipinRathor/zeppelin,YuanGunGun/zeppelin,r-kamath/zeppelin,doanduyhai/incubator-zeppelin,datalayer/zeppelin-datalayer,benoyantony/zeppelin,r-kamath/zeppelin,herval/zeppelin,sergeymazin/zeppelin,herval/zeppelin,soralee/zeppelin,Nova-Boy/zeppelin,minahlee/zeppelin,radicalbit/incubator-zeppelin,fogbeam/zeppelin_mirror,radicalbit/incubator-zeppelin,volumeint/zeppelin,Leemoonsoo/zeppelin,AlexanderShoshin/zeppelin,SarunasG/zeppelin-oidc,SarunasG/zeppelin-oidc,sohaibiftikhar/zeppelin,soralee/zeppelin,jongyoul/zeppelin,joroKr21/incubator-zeppelin,prabhjyotsingh/zeppelin,hkropp/incubator-zeppelin,vipul1409/zeppelin,vipul1409/zeppelin,prabhjyotsingh/incubator-zeppelin,tzolov/incubator-zeppelin,yorek/zeppelin,minahlee/zeppelin,VipinRathor/zeppelin,pravin-dsilva/zeppelin,karuppayya/zeppelin,YuanGunGun/zeppelin,minahlee/incubator-zeppelin,prabhjyotsingh/incubator-zeppelin,zjffdu/zeppelin,r-kamath/incubator-zeppelin,1ambda/zeppelin,jongyoul/zeppelin,zetaris/zeppelin,VipinRathor/zeppelin,sergeymazin/zeppelin,apache/zeppelin,AlexanderShoshin/zeppelin,r-kamath/zeppelin,karuppayya/zeppelin,Nova-Boy/zeppelin,karuppayya/zeppelin,namanmishra91/zeppelin,VipinRathor/zeppelin,Leemoonsoo/zeppelin,zetaris/zeppelin,openthings/zeppelin,chilang/zeppelin,joroKr21/incubator-zeppelin,joroKr21/incubator-zeppelin,minahlee/zeppelin,volumeint/zeppelin,fogbeam/zeppelin_mirror,apache/zeppelin,anthonycorbacho/incubator-zeppelin,Nova-Boy/zeppelin,Altiscale/incubator-zeppelin,astroshim/incubator-zeppelin,astroshim/zeppelin,rconline/zeppelin,prabhjyotsingh/incubator-zeppelin,datalayer/zeppelin,YuanGunGun/zeppelin,chilang/zeppelin,jongyoul/zeppelin,vipul1409/zeppelin,raysteam/zeppelin,sohaibiftikhar/zeppelin,radicalbit/incubator-zeppelin,cquptEthan/incubator-zeppelin,fogbeam/zeppelin_mirror,sctincman/zeppelin,rconline/zeppelin,sergeymazin/zeppelin,namanmishra91/zeppelin,r-kamath/zeppelin,rconline/zeppelin,datalayer/zeppelin,raysteam/zeppelin,mwkang/zeppelin,minahlee/incubator-zeppelin,hkropp/incubator-zeppelin,pellmont/zeppelin,rconline/zeppelin,radicalbit/incubator-zeppelin,yu74n/zeppelin,astroshim/zeppelin,sctincman/zeppelin,vipul1409/zeppelin,jongyoul/zeppelin,anthonycorbacho/incubator-zeppelin,vrlo/zeppelin,apache/incubator-zeppelin,soralee/zeppelin,benoyantony/zeppelin,cquptEthan/incubator-zeppelin,apache/zeppelin,sergeymazin/zeppelin,cquptEthan/incubator-zeppelin,hkropp/incubator-zeppelin,vipul1409/zeppelin,doanduyhai/incubator-zeppelin,minahlee/zeppelin,jongyoul/zeppelin,doanduyhai/incubator-zeppelin,hammertank/zeppelin,openthings/zeppelin,YuanGunGun/zeppelin,raysteam/zeppelin,astroshim/zeppelin,openthings/zeppelin,hammertank/zeppelin,Altiscale/incubator-zeppelin,pravin-dsilva/zeppelin,1ambda/zeppelin,joroKr21/incubator-zeppelin,cquptEthan/incubator-zeppelin,zjffdu/zeppelin,sravan-s/zeppelin,anthonycorbacho/incubator-zeppelin,radicalbit/incubator-zeppelin,sctincman/zeppelin,minahlee/zeppelin,pravin-dsilva/zeppelin,tzolov/incubator-zeppelin,wary/zeppelin,pellmont/zeppelin,karuppayya/zeppelin,sohaibiftikhar/zeppelin,IceKhan13/zeppelin,raysteam/zeppelin,sravan-s/zeppelin,karuppayya/zeppelin,Nova-Boy/zeppelin,sravan-s/zeppelin,AlexanderShoshin/zeppelin,cquptEthan/incubator-zeppelin,pellmont/zeppelin,prabhjyotsingh/zeppelin,tinkoff-dwh/zeppelin,Leemoonsoo/zeppelin,prabhjyotsingh/incubator-zeppelin,minahlee/zeppelin,r-kamath/incubator-zeppelin,benoyantony/zeppelin,cfries/zeppelin,wary/zeppelin,apache/zeppelin,SachinJanani/zeppelin,tinkoff-dwh/zeppelin,IceKhan13/zeppelin,doanduyhai/incubator-zeppelin,joroKr21/incubator-zeppelin,sctincman/zeppelin,Nova-Boy/zeppelin,astroshim/incubator-zeppelin,volumeint/zeppelin,mwkang/zeppelin,Leemoonsoo/incubator-zeppelin,sctincman/zeppelin,jongyoul/incubator-zeppelin,hkropp/incubator-zeppelin,IceKhan13/zeppelin,astroshim/incubator-zeppelin,chilang/zeppelin,jongyoul/zeppelin,tinkoff-dwh/zeppelin,tinkoff-dwh/zeppelin,apache/incubator-zeppelin,openthings/zeppelin,karuppayya/zeppelin,chilang/zeppelin,apache/zeppelin,herval/zeppelin,YuanGunGun/zeppelin,zetaris/zeppelin,vrlo/zeppelin,hammertank/zeppelin,1ambda/zeppelin,benoyantony/zeppelin,herval/zeppelin,namanmishra91/zeppelin,benoyantony/zeppelin,lresende/incubator-zeppelin,minahlee/incubator-zeppelin,joroKr21/incubator-zeppelin,openthings/zeppelin,herval/zeppelin,Nova-Boy/zeppelin,openthings/zeppelin,prabhjyotsingh/zeppelin,karuppayya/zeppelin,vrlo/zeppelin,joroKr21/incubator-zeppelin,benoyantony/zeppelin,Leemoonsoo/zeppelin,r-kamath/zeppelin,mwkang/zeppelin,jongyoul/incubator-zeppelin,anthonycorbacho/incubator-zeppelin,mwkang/zeppelin,yorek/zeppelin,VipinRathor/zeppelin,r-kamath/zeppelin,1ambda/zeppelin,cfries/zeppelin,volumeint/zeppelin,soralee/zeppelin,zjffdu/zeppelin,astroshim/zeppelin,sravan-s/zeppelin,fogbeam/zeppelin_mirror,chilang/zeppelin,astroshim/zeppelin,anthonycorbacho/incubator-zeppelin,minahlee/zeppelin,wary/zeppelin,chilang/zeppelin,sravan-s/zeppelin,datalayer/zeppelin,1ambda/zeppelin,apache/incubator-zeppelin,SachinJanani/zeppelin,SarunasG/zeppelin-oidc,IceKhan13/zeppelin,datalayer/zeppelin,VipinRathor/zeppelin,yu74n/zeppelin,soralee/zeppelin,apache/incubator-zeppelin,SarunasG/zeppelin-oidc,1ambda/zeppelin,tzolov/incubator-zeppelin,Leemoonsoo/incubator-zeppelin,datalayer/zeppelin,vrlo/zeppelin,pellmont/zeppelin,sergeymazin/zeppelin,datalayer/zeppelin,sohaibiftikhar/zeppelin,radicalbit/incubator-zeppelin,r-kamath/zeppelin,VipinRathor/zeppelin,doanduyhai/incubator-zeppelin,minahlee/incubator-zeppelin,astroshim/zeppelin,astroshim/incubator-zeppelin,joroKr21/incubator-zeppelin,tinkoff-dwh/zeppelin,fogbeam/zeppelin_mirror,Leemoonsoo/zeppelin,yu74n/zeppelin,volumeint/zeppelin,lresende/incubator-zeppelin,sohaibiftikhar/zeppelin,fogbeam/zeppelin_mirror,doanduyhai/incubator-zeppelin,wary/zeppelin,soralee/zeppelin,raysteam/zeppelin,Leemoonsoo/incubator-zeppelin,pravin-dsilva/zeppelin,sravan-s/zeppelin,volumeint/zeppelin,lresende/incubator-zeppelin,AlexanderShoshin/zeppelin,raysteam/zeppelin,apache/zeppelin,namanmishra91/zeppelin,cfries/zeppelin,datalayer/zeppelin,AlexanderShoshin/zeppelin,pravin-dsilva/zeppelin,yu74n/zeppelin,mwkang/zeppelin,chilang/zeppelin,apache/incubator-zeppelin,1ambda/zeppelin,Nova-Boy/zeppelin,yorek/zeppelin,pellmont/zeppelin,hammertank/zeppelin,pellmont/zeppelin,hammertank/zeppelin,herval/zeppelin,pravin-dsilva/zeppelin,YuanGunGun/zeppelin,minahlee/incubator-zeppelin,Altiscale/incubator-zeppelin,AlexanderShoshin/zeppelin,zetaris/zeppelin,Leemoonsoo/incubator-zeppelin,tzolov/incubator-zeppelin,sohaibiftikhar/zeppelin,cquptEthan/incubator-zeppelin,SachinJanani/zeppelin,Leemoonsoo/incubator-zeppelin,SachinJanani/zeppelin,zetaris/zeppelin,YuanGunGun/zeppelin,tzolov/incubator-zeppelin,sctincman/zeppelin,zjffdu/zeppelin,cfries/zeppelin,astroshim/incubator-zeppelin,yorek/zeppelin,IceKhan13/zeppelin,prabhjyotsingh/zeppelin,r-kamath/incubator-zeppelin,Leemoonsoo/incubator-zeppelin,SarunasG/zeppelin-oidc,datalayer/zeppelin-datalayer,hammertank/zeppelin,mwkang/zeppelin,raysteam/zeppelin,anthonycorbacho/incubator-zeppelin,zjffdu/zeppelin,cfries/zeppelin,yu74n/zeppelin,SachinJanani/zeppelin,IceKhan13/zeppelin,wary/zeppelin,vrlo/zeppelin,jongyoul/incubator-zeppelin,jongyoul/zeppelin,vipul1409/zeppelin,openthings/zeppelin,yorek/zeppelin,prabhjyotsingh/zeppelin,sergeymazin/zeppelin,jongyoul/incubator-zeppelin,zjffdu/zeppelin,Leemoonsoo/zeppelin,rconline/zeppelin,vipul1409/zeppelin,prabhjyotsingh/incubator-zeppelin,SarunasG/zeppelin-oidc,tinkoff-dwh/zeppelin | json | ## Code Before:
[
{
"group": "python",
"name": "python",
"className": "org.apache.zeppelin.python.PythonInterpreter",
"properties": {
"zeppelin.python": {
"envName": null,
"propertyName": "zeppelin.python",
"defaultValue": "python",
"description": "Python directory. It is set to python by default.(assume python is in your $PATH)"
},
"zeppelin.python.maxResult": {
"envName": null,
"propertyName": "zeppelin.python.maxResult",
"defaultValue": "1000",
"description": "Max number of dataframe rows to display."
}
},
"editor": {
"language": "python",
"editOnDblClick": false
}
},
{
"group": "python",
"name": "sql",
"className": "org.apache.zeppelin.python.PythonInterpreterPandasSql",
"properties": {
},
"editor":{
"language": "sql",
"editOnDblClick": false
}
},
{
"group": "python",
"name": "conda",
"className": "org.apache.zeppelin.python.PythonCondaInterpreter",
"properties": {
},
"editor":{
"language": "sh",
"editOnDblClick": false
}
}
]
## Instruction:
Add PythonDockerInterpreter to interpreter group
### What is this PR for?
Recently PythonDockerInterpreter added to PythonInterpreter in https://github.com/apache/zeppelin/pull/1654.
### What type of PR is it?
Bug Fix | Improvement
### Screenshots (if appropriate)
- before

- after

### Questions:
* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no
Author: astroshim <hsshim@nflabs.com>
Closes #1707 from astroshim/add/python-docker-interpreter and squashes the following commits:
55bf442 [astroshim] fix Bracket
8732f87 [astroshim] add PythonDockerInterpreter to group
## Code After:
[
{
"group": "python",
"name": "python",
"className": "org.apache.zeppelin.python.PythonInterpreter",
"properties": {
"zeppelin.python": {
"envName": null,
"propertyName": "zeppelin.python",
"defaultValue": "python",
"description": "Python directory. It is set to python by default.(assume python is in your $PATH)"
},
"zeppelin.python.maxResult": {
"envName": null,
"propertyName": "zeppelin.python.maxResult",
"defaultValue": "1000",
"description": "Max number of dataframe rows to display."
}
},
"editor": {
"language": "python",
"editOnDblClick": false
}
},
{
"group": "python",
"name": "sql",
"className": "org.apache.zeppelin.python.PythonInterpreterPandasSql",
"properties": {
},
"editor":{
"language": "sql",
"editOnDblClick": false
}
},
{
"group": "python",
"name": "conda",
"className": "org.apache.zeppelin.python.PythonCondaInterpreter",
"properties": {
},
"editor":{
"language": "sh",
"editOnDblClick": false
}
},
{
"group": "python",
"name": "docker",
"className": "org.apache.zeppelin.python.PythonDockerInterpreter",
"properties": {
},
"editor":{
"language": "sh",
"editOnDblClick": false
}
}
]
| [
{
"group": "python",
"name": "python",
"className": "org.apache.zeppelin.python.PythonInterpreter",
"properties": {
"zeppelin.python": {
"envName": null,
"propertyName": "zeppelin.python",
"defaultValue": "python",
"description": "Python directory. It is set to python by default.(assume python is in your $PATH)"
},
"zeppelin.python.maxResult": {
"envName": null,
"propertyName": "zeppelin.python.maxResult",
"defaultValue": "1000",
"description": "Max number of dataframe rows to display."
}
},
"editor": {
"language": "python",
"editOnDblClick": false
}
},
{
"group": "python",
"name": "sql",
"className": "org.apache.zeppelin.python.PythonInterpreterPandasSql",
"properties": {
},
"editor":{
"language": "sql",
"editOnDblClick": false
}
},
{
"group": "python",
"name": "conda",
"className": "org.apache.zeppelin.python.PythonCondaInterpreter",
"properties": {
},
"editor":{
"language": "sh",
"editOnDblClick": false
}
+ },
+ {
+ "group": "python",
+ "name": "docker",
+ "className": "org.apache.zeppelin.python.PythonDockerInterpreter",
+ "properties": {
+ },
+ "editor":{
+ "language": "sh",
+ "editOnDblClick": false
+ }
}
] | 11 | 0.234043 | 11 | 0 |
6cc24400837fa667196e6a3a9772ab113b51711e | templates/data/deployment/listener/index.php | templates/data/deployment/listener/index.php | <pre><?php
// {% if autodeploy_dynamic_deploy_repo_names %}
function ansibleExec(repo) {
echo shell_exec('/usr/local/bin/ansible-playbook /data/deployment/'.repo.'.yml -i /data/deployment/hosts');
}
// {% endif %}
if($_SERVER['REQUEST_METHOD'] === 'POST') {
// {% if autodeploy_dynamic_deploy_repo_names %}
$data = file_get_contents('php://input');
$post = json_decode($data, TRUE);
$repo = $post['repository']['slug'];
switch($repo) {
// {% for repo in autodeploy_dynamic_deploy_repo_names %}
case '{{ repo }}':
ansibleExec('{{ repo }}');
break;
// {% endfor%}
}
// {% else %}
echo shell_exec('/usr/local/bin/ansible-playbook /data/deployment/deploy.yml -i /data/deployment/hosts');
// {% endif %}
}
?></pre>
| <pre><?php
// {% if autodeploy_dynamic_deploy_repo_names %}
function ansibleExec(repo) {
echo shell_exec('/usr/local/bin/ansible-playbook /data/deployment/'.repo.'.yml -i /data/deployment/hosts');
}
// {% endif %}
if($_SERVER['REQUEST_METHOD'] === 'POST') {
// {% if autodeploy_dynamic_deploy_repo_names %}
$data = file_get_contents('php://input');
$post = json_decode($data, TRUE);
$repo = $post['repository']['slug'];
switch($repo) {
// {% for repo in autodeploy_dynamic_deploy_repo_names %}
case '{{ repo }}':
ansibleExec('{{ repo }}');
break;
// {% endfor%}
}
// {% else %}
# Set PYTHONUNBUFFERED environment variable, so that the output from ansible isn't buffered
putenv("PYTHONUNBUFFERED=1");
echo shell_exec('/usr/local/bin/ansible-playbook /data/deployment/deploy.yml -i /data/deployment/hosts');
// {% endif %}
}
?></pre>
| Make the output from ansible unbuffered | Make the output from ansible unbuffered
via the PYTHONUNBUFFERED environment variable | PHP | mit | telusdigital/ansible-autodeploy,stevenharradine/ansible-autodeploy,stevenharradine/ansible-autodeploy,stevenharradine/ansible-autodeploy,aaronpederson/ansible-autodeploy,stevenharradine/ansible-autodeploy,aaronpederson/ansible-autodeploy,telusdigital/ansible-autodeploy,telusdigital/ansible-autodeploy,aaronpederson/ansible-autodeploy,aaronpederson/ansible-autodeploy,telusdigital/ansible-autodeploy | php | ## Code Before:
<pre><?php
// {% if autodeploy_dynamic_deploy_repo_names %}
function ansibleExec(repo) {
echo shell_exec('/usr/local/bin/ansible-playbook /data/deployment/'.repo.'.yml -i /data/deployment/hosts');
}
// {% endif %}
if($_SERVER['REQUEST_METHOD'] === 'POST') {
// {% if autodeploy_dynamic_deploy_repo_names %}
$data = file_get_contents('php://input');
$post = json_decode($data, TRUE);
$repo = $post['repository']['slug'];
switch($repo) {
// {% for repo in autodeploy_dynamic_deploy_repo_names %}
case '{{ repo }}':
ansibleExec('{{ repo }}');
break;
// {% endfor%}
}
// {% else %}
echo shell_exec('/usr/local/bin/ansible-playbook /data/deployment/deploy.yml -i /data/deployment/hosts');
// {% endif %}
}
?></pre>
## Instruction:
Make the output from ansible unbuffered
via the PYTHONUNBUFFERED environment variable
## Code After:
<pre><?php
// {% if autodeploy_dynamic_deploy_repo_names %}
function ansibleExec(repo) {
echo shell_exec('/usr/local/bin/ansible-playbook /data/deployment/'.repo.'.yml -i /data/deployment/hosts');
}
// {% endif %}
if($_SERVER['REQUEST_METHOD'] === 'POST') {
// {% if autodeploy_dynamic_deploy_repo_names %}
$data = file_get_contents('php://input');
$post = json_decode($data, TRUE);
$repo = $post['repository']['slug'];
switch($repo) {
// {% for repo in autodeploy_dynamic_deploy_repo_names %}
case '{{ repo }}':
ansibleExec('{{ repo }}');
break;
// {% endfor%}
}
// {% else %}
# Set PYTHONUNBUFFERED environment variable, so that the output from ansible isn't buffered
putenv("PYTHONUNBUFFERED=1");
echo shell_exec('/usr/local/bin/ansible-playbook /data/deployment/deploy.yml -i /data/deployment/hosts');
// {% endif %}
}
?></pre>
| <pre><?php
// {% if autodeploy_dynamic_deploy_repo_names %}
function ansibleExec(repo) {
echo shell_exec('/usr/local/bin/ansible-playbook /data/deployment/'.repo.'.yml -i /data/deployment/hosts');
}
// {% endif %}
if($_SERVER['REQUEST_METHOD'] === 'POST') {
// {% if autodeploy_dynamic_deploy_repo_names %}
$data = file_get_contents('php://input');
$post = json_decode($data, TRUE);
$repo = $post['repository']['slug'];
switch($repo) {
// {% for repo in autodeploy_dynamic_deploy_repo_names %}
case '{{ repo }}':
ansibleExec('{{ repo }}');
break;
// {% endfor%}
}
// {% else %}
-
+ # Set PYTHONUNBUFFERED environment variable, so that the output from ansible isn't buffered
+ putenv("PYTHONUNBUFFERED=1");
echo shell_exec('/usr/local/bin/ansible-playbook /data/deployment/deploy.yml -i /data/deployment/hosts');
// {% endif %}
}
?></pre> | 3 | 0.076923 | 2 | 1 |
2561471eea20a9d1ca762d402ba538661cfd2f64 | module/Connector.js | module/Connector.js | const mysql = require('mysql')
const qBuilder = require('./QueryBuilder')
let query = ''
let params = []
module.exports = (dbSetting) => {
let connection = mysql.createConnection({
host: dbSetting.hostname,
user: dbSetting.username,
password: dbSetting.password,
database: dbSetting.database
})
connection.connect()
return {
makeQuery: () => {
return qBuilder
},
prepare: () => {
query = qBuilder.prepare()
},
setParameters: (params) => {
qBuilder.setParameters(params)
},
getParameters: () => {
params = qBuilder.getParameters()
},
execute: () => {
// connection.query(query)
},
get: () => {
}
}
}
| const mysql = require('mysql')
const qBuilder = require('./QueryBuilder')
let _query = ''
let _params = []
module.exports = (dbSetting) => {
let connection = mysql.createConnection({
host: dbSetting.hostname,
user: dbSetting.username,
password: dbSetting.password,
database: dbSetting.database
})
return {
makeQuery: () => {
return qBuilder
},
prepare: () => {
_query = qBuilder.prepare()
},
setParameters: (params) => {
_params = params
qBuilder.setParameters(params)
},
getParameters: () => {
_params = qBuilder.getParameters()
},
execute: () => {
// connection.query(_query)
},
get: () => {
},
connectToDatabase: () => {
connection.connect()
},
endConnection: () => {
connection.end()
}
}
}
| Add few functions and connect to query builder | Add few functions and connect to query builder
| JavaScript | mit | evelikov92/mysql-qbuilder | javascript | ## Code Before:
const mysql = require('mysql')
const qBuilder = require('./QueryBuilder')
let query = ''
let params = []
module.exports = (dbSetting) => {
let connection = mysql.createConnection({
host: dbSetting.hostname,
user: dbSetting.username,
password: dbSetting.password,
database: dbSetting.database
})
connection.connect()
return {
makeQuery: () => {
return qBuilder
},
prepare: () => {
query = qBuilder.prepare()
},
setParameters: (params) => {
qBuilder.setParameters(params)
},
getParameters: () => {
params = qBuilder.getParameters()
},
execute: () => {
// connection.query(query)
},
get: () => {
}
}
}
## Instruction:
Add few functions and connect to query builder
## Code After:
const mysql = require('mysql')
const qBuilder = require('./QueryBuilder')
let _query = ''
let _params = []
module.exports = (dbSetting) => {
let connection = mysql.createConnection({
host: dbSetting.hostname,
user: dbSetting.username,
password: dbSetting.password,
database: dbSetting.database
})
return {
makeQuery: () => {
return qBuilder
},
prepare: () => {
_query = qBuilder.prepare()
},
setParameters: (params) => {
_params = params
qBuilder.setParameters(params)
},
getParameters: () => {
_params = qBuilder.getParameters()
},
execute: () => {
// connection.query(_query)
},
get: () => {
},
connectToDatabase: () => {
connection.connect()
},
endConnection: () => {
connection.end()
}
}
}
| const mysql = require('mysql')
const qBuilder = require('./QueryBuilder')
- let query = ''
+ let _query = ''
? +
- let params = []
+ let _params = []
? +
module.exports = (dbSetting) => {
let connection = mysql.createConnection({
host: dbSetting.hostname,
user: dbSetting.username,
password: dbSetting.password,
database: dbSetting.database
})
- connection.connect()
-
return {
makeQuery: () => {
return qBuilder
},
prepare: () => {
- query = qBuilder.prepare()
+ _query = qBuilder.prepare()
? +
},
setParameters: (params) => {
+ _params = params
qBuilder.setParameters(params)
},
getParameters: () => {
- params = qBuilder.getParameters()
+ _params = qBuilder.getParameters()
? +
},
execute: () => {
- // connection.query(query)
+ // connection.query(_query)
? +
},
get: () => {
+ },
+ connectToDatabase: () => {
+ connection.connect()
+ },
+ endConnection: () => {
+ connection.end()
}
}
} | 19 | 0.513514 | 12 | 7 |
35793f330181dae066b999c56ef117763c1df13c | test/Headers/altivec-header.c | test/Headers/altivec-header.c | // REQUIRES: powerpc-registered-target
// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -S -o - %s | FileCheck %s
// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -fno-lax-vector-conversions -S -o - %s | FileCheck %s
// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -x c++ -S -o - %s | FileCheck %s
#include <altivec.h>
// Verify that simply including <altivec.h> does not generate any code
// (i.e. all inline routines in the header are marked "static")
// CHECK: .text
// CHECK-NEXT: .file
// CHECK-NEXT: {{^$}}
// CHECK-NEXT: .ident{{.*$}}
// CHECK-NEXT: .section ".note.GNU-stack","",@progbits
// CHECK-NOT: .
| // RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -emit-llvm -fno-lax-vector-conversions -o - %s | FileCheck %s
// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -emit-llvm -x c++ -o - %s | FileCheck %s
#include <altivec.h>
// Verify that simply including <altivec.h> does not generate any code
// (i.e. all inline routines in the header are marked "static")
// CHECK: target triple = "powerpc64-
// CHECK-NEXT: {{^$}}
// CHECK-NEXT: llvm.ident
| Make this test not rely on a backend being registered. | Make this test not rely on a backend being registered.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@233993 91177308-0d34-0410-b5e6-96231b3b80d8
| C | apache-2.0 | llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang | c | ## Code Before:
// REQUIRES: powerpc-registered-target
// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -S -o - %s | FileCheck %s
// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -fno-lax-vector-conversions -S -o - %s | FileCheck %s
// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -x c++ -S -o - %s | FileCheck %s
#include <altivec.h>
// Verify that simply including <altivec.h> does not generate any code
// (i.e. all inline routines in the header are marked "static")
// CHECK: .text
// CHECK-NEXT: .file
// CHECK-NEXT: {{^$}}
// CHECK-NEXT: .ident{{.*$}}
// CHECK-NEXT: .section ".note.GNU-stack","",@progbits
// CHECK-NOT: .
## Instruction:
Make this test not rely on a backend being registered.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@233993 91177308-0d34-0410-b5e6-96231b3b80d8
## Code After:
// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -emit-llvm -fno-lax-vector-conversions -o - %s | FileCheck %s
// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -emit-llvm -x c++ -o - %s | FileCheck %s
#include <altivec.h>
// Verify that simply including <altivec.h> does not generate any code
// (i.e. all inline routines in the header are marked "static")
// CHECK: target triple = "powerpc64-
// CHECK-NEXT: {{^$}}
// CHECK-NEXT: llvm.ident
| - // REQUIRES: powerpc-registered-target
- // RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -S -o - %s | FileCheck %s
? ^
+ // RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -emit-llvm -o - %s | FileCheck %s
? ^^^^^^^^^
- // RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -fno-lax-vector-conversions -S -o - %s | FileCheck %s
? ---
+ // RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -emit-llvm -fno-lax-vector-conversions -o - %s | FileCheck %s
? +++++++++++
- // RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -x c++ -S -o - %s | FileCheck %s
? ---
+ // RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -emit-llvm -x c++ -o - %s | FileCheck %s
? +++++++++++
#include <altivec.h>
// Verify that simply including <altivec.h> does not generate any code
// (i.e. all inline routines in the header are marked "static")
+ // CHECK: target triple = "powerpc64-
- // CHECK: .text
- // CHECK-NEXT: .file
// CHECK-NEXT: {{^$}}
- // CHECK-NEXT: .ident{{.*$}}
? -------
+ // CHECK-NEXT: llvm.ident
? ++++
- // CHECK-NEXT: .section ".note.GNU-stack","",@progbits
- // CHECK-NOT: . | 14 | 0.875 | 5 | 9 |
892b77d405760c2af5c46338b44cf92ac8ce371f | app/views/tolk/locales/index.html.erb | app/views/tolk/locales/index.html.erb | <% content_for :locale do %><span class="locale empty"></span>
<% end %>
<h2>Locales <span>Primary locale is <%= Tolk::Locale.primary_locale.language_name %></span></h2>
<% if @locales.any? %>
<ul class="locales clearfix">
<% @locales.each do |locale| %>
<li>
<%= link_to locale.language_name, locale %>
<span class="missing_translations">33</span>
</li>
<% end %>
</ul>
<% else %>
<p>No locales yet.</p>
<% end %>
<% form_for(Tolk::Locale.new) do |f| %>
<div class="submit">
<%= f.error_messages %>
<p>
<%= f.label "Add a new Locale" %>
<%= f.text_field :name, :class => "locale_new" %>
<%= f.submit 'Add' %>
</p>
</div>
<% end %>
| <% content_for :locale do %><span class="locale empty"></span>
<% end %>
<h2>Locales <span>Primary locale is <%= Tolk::Locale.primary_locale.language_name %></span></h2>
<% if @locales.any? %>
<ul class="locales clearfix">
<% @locales.each do |locale| %>
<li>
<%= link_to locale.language_name, locale %>
<span class="missing_translations"><%= locale.count_phrases_without_translation %></span>
</li>
<% end %>
</ul>
<% else %>
<p>No locales yet.</p>
<% end %>
<% form_for(Tolk::Locale.new) do |f| %>
<div class="submit">
<%= f.error_messages %>
<p>
<%= f.label "Add a new Locale" %>
<%= f.text_field :name, :class => "locale_new" %>
<%= f.submit 'Add' %>
</p>
</div>
<% end %>
| Fix the dummy counter on the index page | Fix the dummy counter on the index page
| HTML+ERB | mit | tmp8/tolk,MyMedsAndMe/tolk,rdunlop/tolk,tolk/tolk,rdunlop/tolk,tolk/tolk,MyMedsAndMe/tolk,joe-bader/tolk,10to1/tolk,MyMedsAndMe/tolk,tolk/tolk,joe-bader/tolk,beni55/tolk,10to1/tolk,tmp8/tolk,rdunlop/tolk,beni55/tolk,dhh/tolk,munirent/tolk,beni55/tolk,dhh/tolk,munirent/tolk | html+erb | ## Code Before:
<% content_for :locale do %><span class="locale empty"></span>
<% end %>
<h2>Locales <span>Primary locale is <%= Tolk::Locale.primary_locale.language_name %></span></h2>
<% if @locales.any? %>
<ul class="locales clearfix">
<% @locales.each do |locale| %>
<li>
<%= link_to locale.language_name, locale %>
<span class="missing_translations">33</span>
</li>
<% end %>
</ul>
<% else %>
<p>No locales yet.</p>
<% end %>
<% form_for(Tolk::Locale.new) do |f| %>
<div class="submit">
<%= f.error_messages %>
<p>
<%= f.label "Add a new Locale" %>
<%= f.text_field :name, :class => "locale_new" %>
<%= f.submit 'Add' %>
</p>
</div>
<% end %>
## Instruction:
Fix the dummy counter on the index page
## Code After:
<% content_for :locale do %><span class="locale empty"></span>
<% end %>
<h2>Locales <span>Primary locale is <%= Tolk::Locale.primary_locale.language_name %></span></h2>
<% if @locales.any? %>
<ul class="locales clearfix">
<% @locales.each do |locale| %>
<li>
<%= link_to locale.language_name, locale %>
<span class="missing_translations"><%= locale.count_phrases_without_translation %></span>
</li>
<% end %>
</ul>
<% else %>
<p>No locales yet.</p>
<% end %>
<% form_for(Tolk::Locale.new) do |f| %>
<div class="submit">
<%= f.error_messages %>
<p>
<%= f.label "Add a new Locale" %>
<%= f.text_field :name, :class => "locale_new" %>
<%= f.submit 'Add' %>
</p>
</div>
<% end %>
| <% content_for :locale do %><span class="locale empty"></span>
<% end %>
<h2>Locales <span>Primary locale is <%= Tolk::Locale.primary_locale.language_name %></span></h2>
<% if @locales.any? %>
<ul class="locales clearfix">
<% @locales.each do |locale| %>
<li>
<%= link_to locale.language_name, locale %>
- <span class="missing_translations">33</span>
+ <span class="missing_translations"><%= locale.count_phrases_without_translation %></span>
</li>
<% end %>
</ul>
<% else %>
<p>No locales yet.</p>
<% end %>
<% form_for(Tolk::Locale.new) do |f| %>
<div class="submit">
<%= f.error_messages %>
<p>
<%= f.label "Add a new Locale" %>
<%= f.text_field :name, :class => "locale_new" %>
<%= f.submit 'Add' %>
</p>
</div>
<% end %>
| 2 | 0.066667 | 1 | 1 |
b61fab6e2bbde11fdf2d2ab2f9ee53cc3d016bc8 | .travis.yml | .travis.yml | language: go
go:
- 1.2
install:
- go get launchpad.net/goamz/aws
- go get -v -t ./...
- mkdir -p $HOME/gopath/bin
- go install
- ./generate-pkgs
script:
- export PATH=$HOME/gopath/bin:$PATH
- go test ./...
| language: go
go:
- 1.2
install:
- go get launchpad.net/goamz/aws
- go get -v -t ./...
- mkdir -p $HOME/gopath/bin
- go install
script:
- export PATH=$HOME/gopath/bin:$PATH
- go test ./...
| Remove pkg step from Travis since it's broken atm | Remove pkg step from Travis since it's broken atm | YAML | mit | mbailey/credulous,mefellows/credulous,realestate-com-au/credulous,realestate-com-au/credulous,mefellows/credulous,mbailey/credulous,realestate-com-au/credulous,mefellows/credulous,realestate-com-au/credulous,mbailey/credulous,mefellows/credulous,mbailey/credulous | yaml | ## Code Before:
language: go
go:
- 1.2
install:
- go get launchpad.net/goamz/aws
- go get -v -t ./...
- mkdir -p $HOME/gopath/bin
- go install
- ./generate-pkgs
script:
- export PATH=$HOME/gopath/bin:$PATH
- go test ./...
## Instruction:
Remove pkg step from Travis since it's broken atm
## Code After:
language: go
go:
- 1.2
install:
- go get launchpad.net/goamz/aws
- go get -v -t ./...
- mkdir -p $HOME/gopath/bin
- go install
script:
- export PATH=$HOME/gopath/bin:$PATH
- go test ./...
| language: go
go:
- 1.2
install:
- go get launchpad.net/goamz/aws
- go get -v -t ./...
- mkdir -p $HOME/gopath/bin
- go install
- - ./generate-pkgs
script:
- export PATH=$HOME/gopath/bin:$PATH
- go test ./... | 1 | 0.066667 | 0 | 1 |
06150a06c33e24b6f8af30348be7c8a1e6da16e5 | .github/workflows/build-docs.yml | .github/workflows/build-docs.yml | name: Build Docs
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.101
- name: Build docs
run: dotnet build ./Docs/Cosmos.Docs.csproj
- name: Publish to GitHub Pages
uses: maxheld83/ghpages@master
env:
BUILD_DIR: ./Docs/_site
GH_PAT: ${{ secrets.GH_PAGES }}
GITHUB_REPOSITORY: CosmosOS/cosmosos.github.io
| name: Build Docs
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
# - name: Setup dotnet
# uses: actions/setup-dotnet@v1
# with:
# dotnet-version: 3.1.101
# - name: Build docs
# run: dotnet build ./Docs/Cosmos.Docs.csproj
- name: Build docs
uses: nikeee/docfx-action@v1.0.0
with:
args: ./Docs/docfx.json
- name: Publish to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.GH_PAGES }}
external_repository: CosmosOS/cosmosos.github.io
publish_branch: master
publish_dir: ./Docs/_site
| Use docfx instead of csproj | Use docfx instead of csproj
| YAML | bsd-3-clause | CosmosOS/Cosmos,zarlo/Cosmos,CosmosOS/Cosmos,CosmosOS/Cosmos,zarlo/Cosmos,zarlo/Cosmos,zarlo/Cosmos,CosmosOS/Cosmos | yaml | ## Code Before:
name: Build Docs
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.101
- name: Build docs
run: dotnet build ./Docs/Cosmos.Docs.csproj
- name: Publish to GitHub Pages
uses: maxheld83/ghpages@master
env:
BUILD_DIR: ./Docs/_site
GH_PAT: ${{ secrets.GH_PAGES }}
GITHUB_REPOSITORY: CosmosOS/cosmosos.github.io
## Instruction:
Use docfx instead of csproj
## Code After:
name: Build Docs
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
# - name: Setup dotnet
# uses: actions/setup-dotnet@v1
# with:
# dotnet-version: 3.1.101
# - name: Build docs
# run: dotnet build ./Docs/Cosmos.Docs.csproj
- name: Build docs
uses: nikeee/docfx-action@v1.0.0
with:
args: ./Docs/docfx.json
- name: Publish to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.GH_PAGES }}
external_repository: CosmosOS/cosmosos.github.io
publish_branch: master
publish_dir: ./Docs/_site
| name: Build Docs
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- - name: Setup dotnet
+ # - name: Setup dotnet
? ++
- uses: actions/setup-dotnet@v1
+ # uses: actions/setup-dotnet@v1
? ++
+ # with:
+ # dotnet-version: 3.1.101
+ # - name: Build docs
+ # run: dotnet build ./Docs/Cosmos.Docs.csproj
+ - name: Build docs
+ uses: nikeee/docfx-action@v1.0.0
with:
+ args: ./Docs/docfx.json
- dotnet-version: 3.1.101
- - name: Build docs
- run: dotnet build ./Docs/Cosmos.Docs.csproj
- name: Publish to GitHub Pages
+ uses: peaceiris/actions-gh-pages@v3
+ with:
- uses: maxheld83/ghpages@master
- env:
- BUILD_DIR: ./Docs/_site
- GH_PAT: ${{ secrets.GH_PAGES }}
? ^^ ^^^
+ personal_token: ${{ secrets.GH_PAGES }}
? ^^^^^^^^ ^^^^^
- GITHUB_REPOSITORY: CosmosOS/cosmosos.github.io
+ external_repository: CosmosOS/cosmosos.github.io
+ publish_branch: master
+ publish_dir: ./Docs/_site | 25 | 1.041667 | 15 | 10 |
8a4e2fdb1b864a20d07d3e9a15095d807a97f8bf | file-utility-code/build-self-contained-targets.cmd | file-utility-code/build-self-contained-targets.cmd | @ECHO OFF
REM ---------------------------------------------------------------------------
REM Builds the file utility nuget packages.
REM ---------------------------------------------------------------------------
SETLOCAL
SET BUILD_NUMBER=%1
IF "%BUILD_NUMBER%" == "" SET BUILD_NUMBER=5555
ECHO BUILD_NUMBER=%BUILD_NUMBER%
SET /p VERSION=<ver.file-utility-code.txt
ECHO Building targets for %VERSION%.%BUILD_NUMBER%
SET PUBLISHCMD=dotnet publish -c Release /p:Version=%VERSION%
ECHO PUBLISHCMD=%PUBLISHCMD%
%PUBLISHCMD% .\CheckArisFile\ -o .\self-contained\CheckArisFile-win-x86\ --runtime win-x86
%PUBLISHCMD% .\CheckArisFile\ -o .\self-contained\CheckArisFile-linux-x64\ --runtime linux-x64
ENDLOCAL
| @ECHO OFF
REM ---------------------------------------------------------------------------
REM Builds the file utility nuget packages.
REM ---------------------------------------------------------------------------
SETLOCAL
SET BUILD_NUMBER=%1
IF "%BUILD_NUMBER%" == "" SET BUILD_NUMBER=5555
ECHO BUILD_NUMBER=%BUILD_NUMBER%
ECHO Building self-contained dotnet targets
SET PUBLISHCMD=dotnet publish -c Release
ECHO PUBLISHCMD=%PUBLISHCMD%
%PUBLISHCMD% .\CheckArisFile\ -o .\self-contained\CheckArisFile-win-x86\ --runtime win-x86
%PUBLISHCMD% .\CheckArisFile\ -o .\self-contained\CheckArisFile-linux-x64\ --runtime linux-x64
ENDLOCAL
| Remove manual versioning from self-contained targets | Remove manual versioning from self-contained targets
| Batchfile | mit | SoundMetrics/aris-file-sdk,SoundMetrics/aris-file-sdk,SoundMetrics/aris-file-sdk | batchfile | ## Code Before:
@ECHO OFF
REM ---------------------------------------------------------------------------
REM Builds the file utility nuget packages.
REM ---------------------------------------------------------------------------
SETLOCAL
SET BUILD_NUMBER=%1
IF "%BUILD_NUMBER%" == "" SET BUILD_NUMBER=5555
ECHO BUILD_NUMBER=%BUILD_NUMBER%
SET /p VERSION=<ver.file-utility-code.txt
ECHO Building targets for %VERSION%.%BUILD_NUMBER%
SET PUBLISHCMD=dotnet publish -c Release /p:Version=%VERSION%
ECHO PUBLISHCMD=%PUBLISHCMD%
%PUBLISHCMD% .\CheckArisFile\ -o .\self-contained\CheckArisFile-win-x86\ --runtime win-x86
%PUBLISHCMD% .\CheckArisFile\ -o .\self-contained\CheckArisFile-linux-x64\ --runtime linux-x64
ENDLOCAL
## Instruction:
Remove manual versioning from self-contained targets
## Code After:
@ECHO OFF
REM ---------------------------------------------------------------------------
REM Builds the file utility nuget packages.
REM ---------------------------------------------------------------------------
SETLOCAL
SET BUILD_NUMBER=%1
IF "%BUILD_NUMBER%" == "" SET BUILD_NUMBER=5555
ECHO BUILD_NUMBER=%BUILD_NUMBER%
ECHO Building self-contained dotnet targets
SET PUBLISHCMD=dotnet publish -c Release
ECHO PUBLISHCMD=%PUBLISHCMD%
%PUBLISHCMD% .\CheckArisFile\ -o .\self-contained\CheckArisFile-win-x86\ --runtime win-x86
%PUBLISHCMD% .\CheckArisFile\ -o .\self-contained\CheckArisFile-linux-x64\ --runtime linux-x64
ENDLOCAL
| @ECHO OFF
REM ---------------------------------------------------------------------------
REM Builds the file utility nuget packages.
REM ---------------------------------------------------------------------------
SETLOCAL
SET BUILD_NUMBER=%1
IF "%BUILD_NUMBER%" == "" SET BUILD_NUMBER=5555
ECHO BUILD_NUMBER=%BUILD_NUMBER%
- SET /p VERSION=<ver.file-utility-code.txt
+ ECHO Building self-contained dotnet targets
- ECHO Building targets for %VERSION%.%BUILD_NUMBER%
-
- SET PUBLISHCMD=dotnet publish -c Release /p:Version=%VERSION%
? ---------------------
+ SET PUBLISHCMD=dotnet publish -c Release
ECHO PUBLISHCMD=%PUBLISHCMD%
%PUBLISHCMD% .\CheckArisFile\ -o .\self-contained\CheckArisFile-win-x86\ --runtime win-x86
%PUBLISHCMD% .\CheckArisFile\ -o .\self-contained\CheckArisFile-linux-x64\ --runtime linux-x64
ENDLOCAL | 6 | 0.272727 | 2 | 4 |
fce63e693215740348218a311770ded02eade181 | lib/yml_reader.rb | lib/yml_reader.rb | require "yml_reader/version"
module YmlReader
#
# Set the directory to use when reading yml files
#
def yml_directory=(directory)
@yml_directory = directory
end
#
# Returns the directory to be used when reading yml files
#
def yml_directory
return @yml_directory if @yml_directory
return default_directory if self.respond_to? :default_directory
nil
end
#
# Loads the requested file. It will look for the file in the
# directory specified by a call to the yml_directory= method.
#
def load(filename)
@yml = YAML.load_file "#{yml_directory}/#{filename}"
end
end
| require "yml_reader/version"
module YmlReader
#
# Set the directory to use when reading yml files
#
def yml_directory=(directory)
@yml_directory = directory
end
#
# Returns the directory to be used when reading yml files
#
def yml_directory
return @yml_directory if @yml_directory
return default_directory if self.respond_to? :default_directory
nil
end
#
# Loads the requested file. It will look for the file in the
# directory specified by a call to the yml_directory= method.
#
def load(filename)
@yml = YAML.load(ERB.new(File.read("#{yml_directory}/#{filename}")).result)
end
end
| Add ERB into yml reader | Add ERB into yml reader
| Ruby | mit | cheezy/yml_reader | ruby | ## Code Before:
require "yml_reader/version"
module YmlReader
#
# Set the directory to use when reading yml files
#
def yml_directory=(directory)
@yml_directory = directory
end
#
# Returns the directory to be used when reading yml files
#
def yml_directory
return @yml_directory if @yml_directory
return default_directory if self.respond_to? :default_directory
nil
end
#
# Loads the requested file. It will look for the file in the
# directory specified by a call to the yml_directory= method.
#
def load(filename)
@yml = YAML.load_file "#{yml_directory}/#{filename}"
end
end
## Instruction:
Add ERB into yml reader
## Code After:
require "yml_reader/version"
module YmlReader
#
# Set the directory to use when reading yml files
#
def yml_directory=(directory)
@yml_directory = directory
end
#
# Returns the directory to be used when reading yml files
#
def yml_directory
return @yml_directory if @yml_directory
return default_directory if self.respond_to? :default_directory
nil
end
#
# Loads the requested file. It will look for the file in the
# directory specified by a call to the yml_directory= method.
#
def load(filename)
@yml = YAML.load(ERB.new(File.read("#{yml_directory}/#{filename}")).result)
end
end
| require "yml_reader/version"
module YmlReader
#
# Set the directory to use when reading yml files
#
def yml_directory=(directory)
@yml_directory = directory
end
#
# Returns the directory to be used when reading yml files
#
def yml_directory
return @yml_directory if @yml_directory
return default_directory if self.respond_to? :default_directory
nil
end
#
# Loads the requested file. It will look for the file in the
# directory specified by a call to the yml_directory= method.
#
def load(filename)
- @yml = YAML.load_file "#{yml_directory}/#{filename}"
? ^^ ^
+ @yml = YAML.load(ERB.new(File.read("#{yml_directory}/#{filename}")).result)
? ^^^^^^^^^^ ^^^^^^ ++++++++++
end
end | 2 | 0.068966 | 1 | 1 |
5ca3a17307dbb05cc3344a2ef7ce5a1be7b12425 | SimpleRedditClient/Common/Views/ImageLoadableView/ImageLoadableView.swift | SimpleRedditClient/Common/Views/ImageLoadableView/ImageLoadableView.swift | //
// Created by Alexander Tkachenko on 9/9/17.
//
import UIKit
final class ImageLoadableView: UIView, ImageLoadable {
@IBOutlet var imageView: UIImageView!
@IBOutlet var placeholderView: UIView!
@IBInspectable var animated: Bool = true
private var image: UIImage?
private var dirty: Bool { return image != imageView.image }
func load(imageURL: URL?) {
guard let url = imageURL else {
image = nil
return
}
imageLoader.load(with: url, into: self) {
[weak self] result in
self?.image = result.image
self?.updateSubviews()
}
}
func prepareForReuse() {
image = nil
imageView.image = nil
imageView.alpha = 0
}
private func updateSubviews() {
guard dirty else { return }
let newAlpha: CGFloat = image == nil ? 0 : 1
if animated {
imageView.image = image
UIView.animate(withDuration: 0.3,
delay: 0,
options: [.allowUserInteraction, .beginFromCurrentState],
animations: {
self.imageView.alpha = newAlpha
},
completion: nil)
}
else {
imageView.alpha = newAlpha
imageView.image = image
}
}
}
| //
// Created by Alexander Tkachenko on 9/9/17.
//
import UIKit
final class ImageLoadableView: UIView, ImageLoadable {
@IBOutlet var imageView: UIImageView!
@IBOutlet var placeholderView: UIView!
@IBInspectable var animated: Bool = true
private var image: UIImage?
private var urlInProgress: URL?
private var dirty: Bool { return image != imageView.image }
func load(imageURL: URL?) {
guard let url = imageURL else {
image = nil
return
}
urlInProgress = url
imageLoader.load(with: url, into: self) {
[weak self] result in
if (url == self?.urlInProgress) {
self?.image = result.image
self?.updateSubviews()
}
}
}
func prepareForReuse() {
image = nil
imageView.image = nil
imageView.alpha = 0
}
private func updateSubviews() {
guard dirty else { return }
let newAlpha: CGFloat = image == nil ? 0 : 1
if animated {
imageView.image = image
UIView.animate(withDuration: 0.3,
delay: 0,
options: [.allowUserInteraction, .beginFromCurrentState],
animations: {
self.imageView.alpha = newAlpha
},
completion: nil)
}
else {
imageView.alpha = newAlpha
imageView.image = image
}
}
}
| Fix cell reusing/image loading bug | Fix cell reusing/image loading bug
| Swift | mit | tkach/SimpleRedditClient | swift | ## Code Before:
//
// Created by Alexander Tkachenko on 9/9/17.
//
import UIKit
final class ImageLoadableView: UIView, ImageLoadable {
@IBOutlet var imageView: UIImageView!
@IBOutlet var placeholderView: UIView!
@IBInspectable var animated: Bool = true
private var image: UIImage?
private var dirty: Bool { return image != imageView.image }
func load(imageURL: URL?) {
guard let url = imageURL else {
image = nil
return
}
imageLoader.load(with: url, into: self) {
[weak self] result in
self?.image = result.image
self?.updateSubviews()
}
}
func prepareForReuse() {
image = nil
imageView.image = nil
imageView.alpha = 0
}
private func updateSubviews() {
guard dirty else { return }
let newAlpha: CGFloat = image == nil ? 0 : 1
if animated {
imageView.image = image
UIView.animate(withDuration: 0.3,
delay: 0,
options: [.allowUserInteraction, .beginFromCurrentState],
animations: {
self.imageView.alpha = newAlpha
},
completion: nil)
}
else {
imageView.alpha = newAlpha
imageView.image = image
}
}
}
## Instruction:
Fix cell reusing/image loading bug
## Code After:
//
// Created by Alexander Tkachenko on 9/9/17.
//
import UIKit
final class ImageLoadableView: UIView, ImageLoadable {
@IBOutlet var imageView: UIImageView!
@IBOutlet var placeholderView: UIView!
@IBInspectable var animated: Bool = true
private var image: UIImage?
private var urlInProgress: URL?
private var dirty: Bool { return image != imageView.image }
func load(imageURL: URL?) {
guard let url = imageURL else {
image = nil
return
}
urlInProgress = url
imageLoader.load(with: url, into: self) {
[weak self] result in
if (url == self?.urlInProgress) {
self?.image = result.image
self?.updateSubviews()
}
}
}
func prepareForReuse() {
image = nil
imageView.image = nil
imageView.alpha = 0
}
private func updateSubviews() {
guard dirty else { return }
let newAlpha: CGFloat = image == nil ? 0 : 1
if animated {
imageView.image = image
UIView.animate(withDuration: 0.3,
delay: 0,
options: [.allowUserInteraction, .beginFromCurrentState],
animations: {
self.imageView.alpha = newAlpha
},
completion: nil)
}
else {
imageView.alpha = newAlpha
imageView.image = image
}
}
}
| //
// Created by Alexander Tkachenko on 9/9/17.
//
import UIKit
final class ImageLoadableView: UIView, ImageLoadable {
@IBOutlet var imageView: UIImageView!
@IBOutlet var placeholderView: UIView!
@IBInspectable var animated: Bool = true
private var image: UIImage?
+ private var urlInProgress: URL?
private var dirty: Bool { return image != imageView.image }
func load(imageURL: URL?) {
guard let url = imageURL else {
image = nil
return
}
-
+ urlInProgress = url
imageLoader.load(with: url, into: self) {
[weak self] result in
+ if (url == self?.urlInProgress) {
- self?.image = result.image
+ self?.image = result.image
? ++++
- self?.updateSubviews()
+ self?.updateSubviews()
? ++++
+ }
}
}
func prepareForReuse() {
image = nil
imageView.image = nil
imageView.alpha = 0
}
private func updateSubviews() {
guard dirty else { return }
let newAlpha: CGFloat = image == nil ? 0 : 1
if animated {
imageView.image = image
UIView.animate(withDuration: 0.3,
delay: 0,
options: [.allowUserInteraction, .beginFromCurrentState],
animations: {
self.imageView.alpha = newAlpha
},
completion: nil)
}
else {
imageView.alpha = newAlpha
imageView.image = image
}
}
} | 9 | 0.173077 | 6 | 3 |
cc655cb0251826b29b451d8cc8bb6393838ef097 | client/components/article.js | client/components/article.js | import React from 'react'
function getColorFromId(id) {
const hue = (id * 97) % 360
return `hsl(${hue}, 32%, 68%)`
}
const Article = ({ link, title, id }) => (
<div className='card'>
<div className='card-img-top'
style={{height: '5em', background: getColorFromId(id)}}
alt='Card image cap' />
<div className='card-block'>
<h4 className='card-title'>
<a href={link}>
{title}
</a>
</h4>
<p className='card-text'>
<small className='text-muted'>06 de noviembre de 2016</small>
</p>
</div>
</div>
)
export default Article
| import React from 'react'
function getColorFromId(id) {
const hue = (id * 97) % 360
return `hsl(${hue}, 32%, 68%)`
}
const Article = ({ link, title, id }) => (
<div className='card'>
<div className='card-img-top'
style={{height: '5em', background: getColorFromId(id)}}
alt='Card image cap' />
<div className='card-block'>
<h4 className='card-title'>
<a href={link}>
{title}
</a>
</h4>
<p className='card-text'>
<small className='text-muted'></small>
</p>
</div>
</div>
)
export default Article
| Remove Article date (until it became true) | Remove Article date (until it became true)
| JavaScript | mit | CommonActionForum/liqen-face,CommonActionForum/liqen-face,exacs/liqen-face,exacs/liqen-face | javascript | ## Code Before:
import React from 'react'
function getColorFromId(id) {
const hue = (id * 97) % 360
return `hsl(${hue}, 32%, 68%)`
}
const Article = ({ link, title, id }) => (
<div className='card'>
<div className='card-img-top'
style={{height: '5em', background: getColorFromId(id)}}
alt='Card image cap' />
<div className='card-block'>
<h4 className='card-title'>
<a href={link}>
{title}
</a>
</h4>
<p className='card-text'>
<small className='text-muted'>06 de noviembre de 2016</small>
</p>
</div>
</div>
)
export default Article
## Instruction:
Remove Article date (until it became true)
## Code After:
import React from 'react'
function getColorFromId(id) {
const hue = (id * 97) % 360
return `hsl(${hue}, 32%, 68%)`
}
const Article = ({ link, title, id }) => (
<div className='card'>
<div className='card-img-top'
style={{height: '5em', background: getColorFromId(id)}}
alt='Card image cap' />
<div className='card-block'>
<h4 className='card-title'>
<a href={link}>
{title}
</a>
</h4>
<p className='card-text'>
<small className='text-muted'></small>
</p>
</div>
</div>
)
export default Article
| import React from 'react'
function getColorFromId(id) {
const hue = (id * 97) % 360
return `hsl(${hue}, 32%, 68%)`
}
const Article = ({ link, title, id }) => (
<div className='card'>
<div className='card-img-top'
style={{height: '5em', background: getColorFromId(id)}}
alt='Card image cap' />
<div className='card-block'>
<h4 className='card-title'>
<a href={link}>
{title}
</a>
</h4>
<p className='card-text'>
- <small className='text-muted'>06 de noviembre de 2016</small>
? -----------------------
+ <small className='text-muted'></small>
</p>
</div>
</div>
)
export default Article | 2 | 0.076923 | 1 | 1 |
f09b300307ec33019324ccfac241c89900f57639 | conf_site/templates/symposion/schedule/_grid.html | conf_site/templates/symposion/schedule/_grid.html | <table class="calendar table table-bordered">
<thead>
<tr>
<th class="time"> </th>
{% for room in timetable.rooms %}
<th>{{ room.name }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for row in timetable %}
<tr>
<td class="time">{{ row.time|date:"h:iA" }}</td>
{% for slot in row.slots %}
<td class="slot slot-{{ slot.content.proposal.kind.slug }}" colspan="{{ slot.colspan }}" rowspan="{{ slot.rowspan }}">
{# this is a kludge until the slot.kind model has a property #}
{# to distinguish a presentation from a non-presentation slot #}
{% if slot.kind.label in "Track 5 Track 4 Track 3 Track 2 Track 1 Tutorial Track 5 Tutorial Track 4 Tutorial Track 3 Tutorial Track 2 Tutorial Track 1 Tutorials Track 1 Tutorials Track 2" %}
{% if slot.content %}
<span class="title">
<a href="{% url "schedule_presentation_detail" slot.content.pk %}">{{ slot.content.title }}</a>
</span>
<span class="speaker">
{{ slot.content.speakers|join:", " }}
</span>
{% endif %}
{% else %}
{% if slot.content_override.raw %}
{{ slot.content_override.rendered|safe }}
{% else %}
{{ slot.kind.label }}
{% endif %}
{% endif %}
</td>
{% endfor %}
{% if forloop.last %}
<td colspan="{{ timetable.rooms|length }}"></td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
| <table class="calendar table table-bordered">
<thead>
<tr>
<th class="time"> </th>
{% for room in timetable.rooms %}
<th>{{ room.name }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for row in timetable %}
<tr>
<td class="time">{{ row.time|date:"h:iA" }}</td>
{% for slot in row.slots %}
<td class="slot slot-{{ slot.content.proposal.kind.slug }}" colspan="{{ slot.colspan }}" rowspan="{{ slot.rowspan }}">
{% if slot.content %}
<span class="title">
<a href="{% url "schedule_presentation_detail" slot.content.pk %}">{{ slot.content.title }}</a>
</span>
<span class="speaker">
{{ slot.content.speakers|join:", " }}
</span>
{% else %}
{% if slot.content_override_html %}
{{ slot.content_override_html|safe }}
{% else %}
{{ slot.kind.label }}
{% endif %}
{% endif %}
</td>
{% endfor %}
{% if forloop.last %}
<td colspan="{{ timetable.rooms|length }}"></td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
| Simplify schedule cell display logic. | Simplify schedule cell display logic.
If slot has an attached presentation (slot.content will return True),
display presentation and speaker information. Otherwise, if slot has a
content override, display that. Otherwise, display the label of the slot
kind.
This eliminates the need to have hardcode slot kind labels (see #69) and
ensure that content overrides will display properly.
| HTML | mit | pydata/conf_site,pydata/conf_site,pydata/conf_site | html | ## Code Before:
<table class="calendar table table-bordered">
<thead>
<tr>
<th class="time"> </th>
{% for room in timetable.rooms %}
<th>{{ room.name }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for row in timetable %}
<tr>
<td class="time">{{ row.time|date:"h:iA" }}</td>
{% for slot in row.slots %}
<td class="slot slot-{{ slot.content.proposal.kind.slug }}" colspan="{{ slot.colspan }}" rowspan="{{ slot.rowspan }}">
{# this is a kludge until the slot.kind model has a property #}
{# to distinguish a presentation from a non-presentation slot #}
{% if slot.kind.label in "Track 5 Track 4 Track 3 Track 2 Track 1 Tutorial Track 5 Tutorial Track 4 Tutorial Track 3 Tutorial Track 2 Tutorial Track 1 Tutorials Track 1 Tutorials Track 2" %}
{% if slot.content %}
<span class="title">
<a href="{% url "schedule_presentation_detail" slot.content.pk %}">{{ slot.content.title }}</a>
</span>
<span class="speaker">
{{ slot.content.speakers|join:", " }}
</span>
{% endif %}
{% else %}
{% if slot.content_override.raw %}
{{ slot.content_override.rendered|safe }}
{% else %}
{{ slot.kind.label }}
{% endif %}
{% endif %}
</td>
{% endfor %}
{% if forloop.last %}
<td colspan="{{ timetable.rooms|length }}"></td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
## Instruction:
Simplify schedule cell display logic.
If slot has an attached presentation (slot.content will return True),
display presentation and speaker information. Otherwise, if slot has a
content override, display that. Otherwise, display the label of the slot
kind.
This eliminates the need to have hardcode slot kind labels (see #69) and
ensure that content overrides will display properly.
## Code After:
<table class="calendar table table-bordered">
<thead>
<tr>
<th class="time"> </th>
{% for room in timetable.rooms %}
<th>{{ room.name }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for row in timetable %}
<tr>
<td class="time">{{ row.time|date:"h:iA" }}</td>
{% for slot in row.slots %}
<td class="slot slot-{{ slot.content.proposal.kind.slug }}" colspan="{{ slot.colspan }}" rowspan="{{ slot.rowspan }}">
{% if slot.content %}
<span class="title">
<a href="{% url "schedule_presentation_detail" slot.content.pk %}">{{ slot.content.title }}</a>
</span>
<span class="speaker">
{{ slot.content.speakers|join:", " }}
</span>
{% else %}
{% if slot.content_override_html %}
{{ slot.content_override_html|safe }}
{% else %}
{{ slot.kind.label }}
{% endif %}
{% endif %}
</td>
{% endfor %}
{% if forloop.last %}
<td colspan="{{ timetable.rooms|length }}"></td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
| <table class="calendar table table-bordered">
<thead>
<tr>
<th class="time"> </th>
{% for room in timetable.rooms %}
<th>{{ room.name }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for row in timetable %}
<tr>
<td class="time">{{ row.time|date:"h:iA" }}</td>
{% for slot in row.slots %}
<td class="slot slot-{{ slot.content.proposal.kind.slug }}" colspan="{{ slot.colspan }}" rowspan="{{ slot.rowspan }}">
- {# this is a kludge until the slot.kind model has a property #}
- {# to distinguish a presentation from a non-presentation slot #}
- {% if slot.kind.label in "Track 5 Track 4 Track 3 Track 2 Track 1 Tutorial Track 5 Tutorial Track 4 Tutorial Track 3 Tutorial Track 2 Tutorial Track 1 Tutorials Track 1 Tutorials Track 2" %}
- {% if slot.content %}
? ------
+ {% if slot.content %}
- <span class="title">
? ------
+ <span class="title">
- <a href="{% url "schedule_presentation_detail" slot.content.pk %}">{{ slot.content.title }}</a>
? ------
+ <a href="{% url "schedule_presentation_detail" slot.content.pk %}">{{ slot.content.title }}</a>
- </span>
? ------
+ </span>
- <span class="speaker">
? ------
+ <span class="speaker">
- {{ slot.content.speakers|join:", " }}
? ------
+ {{ slot.content.speakers|join:", " }}
- </span>
? ------
+ </span>
- {% endif %}
? ------ ^^^^
+ {% else %}
? ^^^
+ {% if slot.content_override_html %}
+ {{ slot.content_override_html|safe }}
{% else %}
- {% if slot.content_override.raw %}
- {{ slot.content_override.rendered|safe }}
- {% else %}
- {{ slot.kind.label }}
? ----
+ {{ slot.kind.label }}
- {% endif %}
{% endif %}
+ {% endif %}
</td>
{% endfor %}
{% if forloop.last %}
<td colspan="{{ timetable.rooms|length }}"></td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table> | 28 | 0.666667 | 12 | 16 |
c3771e98db0cedca36aa0abbee6bdd27ac6d62c1 | src/li/seiji/minichess/Game.java | src/li/seiji/minichess/Game.java | package li.seiji.minichess;
import li.seiji.minichess.move.Move;
import li.seiji.minichess.player.IPlayer;
public class Game {
private Board state = new Board();
private IPlayer white;
private IPlayer black;
public Game(IPlayer white, IPlayer black) {
state.initialize();
this.white = white;
this.black = black;
}
public void run() throws InvalidMoveException {
white.start();
black.start();
while(state.turn != Player.NONE) {
IPlayer turnPlayer;
IPlayer otherPlayer;
if(state.turn == Player.WHITE) {
turnPlayer = white; otherPlayer = black;
} else {
turnPlayer = black; otherPlayer = white;
}
Move move = turnPlayer.getMove(state);
state = state.move(move);
otherPlayer.setMove(state, move);
}
}
}
| package li.seiji.minichess;
import li.seiji.minichess.move.Move;
import li.seiji.minichess.player.IPlayer;
public class Game {
private Board state = new Board();
private IPlayer white;
private IPlayer black;
public Game(IPlayer white, IPlayer black) {
state.initialize();
this.white = white;
this.black = black;
}
public void run() throws InvalidMoveException {
white.start();
black.start();
while(state.turn != Player.NONE) {
IPlayer turnPlayer;
IPlayer otherPlayer;
if(state.turn == Player.WHITE) {
turnPlayer = white; otherPlayer = black;
} else {
turnPlayer = black; otherPlayer = white;
}
Move move = turnPlayer.getMove(state);
state = state.move(move);
otherPlayer.setMove(state, move);
state.prettyPrint();
}
}
}
| Add a nice log to the game | Add a nice log to the game
| Java | mit | seijikun/MiniChess,seijikun/MiniChess | java | ## Code Before:
package li.seiji.minichess;
import li.seiji.minichess.move.Move;
import li.seiji.minichess.player.IPlayer;
public class Game {
private Board state = new Board();
private IPlayer white;
private IPlayer black;
public Game(IPlayer white, IPlayer black) {
state.initialize();
this.white = white;
this.black = black;
}
public void run() throws InvalidMoveException {
white.start();
black.start();
while(state.turn != Player.NONE) {
IPlayer turnPlayer;
IPlayer otherPlayer;
if(state.turn == Player.WHITE) {
turnPlayer = white; otherPlayer = black;
} else {
turnPlayer = black; otherPlayer = white;
}
Move move = turnPlayer.getMove(state);
state = state.move(move);
otherPlayer.setMove(state, move);
}
}
}
## Instruction:
Add a nice log to the game
## Code After:
package li.seiji.minichess;
import li.seiji.minichess.move.Move;
import li.seiji.minichess.player.IPlayer;
public class Game {
private Board state = new Board();
private IPlayer white;
private IPlayer black;
public Game(IPlayer white, IPlayer black) {
state.initialize();
this.white = white;
this.black = black;
}
public void run() throws InvalidMoveException {
white.start();
black.start();
while(state.turn != Player.NONE) {
IPlayer turnPlayer;
IPlayer otherPlayer;
if(state.turn == Player.WHITE) {
turnPlayer = white; otherPlayer = black;
} else {
turnPlayer = black; otherPlayer = white;
}
Move move = turnPlayer.getMove(state);
state = state.move(move);
otherPlayer.setMove(state, move);
state.prettyPrint();
}
}
}
| package li.seiji.minichess;
import li.seiji.minichess.move.Move;
import li.seiji.minichess.player.IPlayer;
public class Game {
private Board state = new Board();
private IPlayer white;
private IPlayer black;
public Game(IPlayer white, IPlayer black) {
state.initialize();
this.white = white;
this.black = black;
}
public void run() throws InvalidMoveException {
white.start();
black.start();
while(state.turn != Player.NONE) {
IPlayer turnPlayer;
IPlayer otherPlayer;
if(state.turn == Player.WHITE) {
turnPlayer = white; otherPlayer = black;
} else {
turnPlayer = black; otherPlayer = white;
}
Move move = turnPlayer.getMove(state);
state = state.move(move);
otherPlayer.setMove(state, move);
+
+ state.prettyPrint();
}
}
} | 2 | 0.054054 | 2 | 0 |
adff3ce98eca9fbcfae880805073d012f91715ca | requirements/prod.txt | requirements/prod.txt | flask==1.0.3
requests==2.22.0
beautifulsoup4==4.7.1
eventlet==0.25.0
gunicorn==19.9.0
# Python 2/3 Compatibility
six==1.12.0
# CSS/JS Assets
flask_assets==0.12
yuicompressor==2.4.8
# Sockets
flask_socketio==4.0.0
python_socketio==4.0.2
python_engineio==3.5.2
# Celery
celery==4.3.0
redis==3.2.1
# Octave interaction
scipy==1.3.0
numpy==1.16.3
octave-kernel==0.30.3
ipython==5.4.1 # pyup: ignore
# Octave packages
sympy==1.4
# Database
SQLAlchemy==1.3.3
Flask-SQLAlchemy==2.4.0
# App management
Flask-Migrate==2.5.1
Flask-Script==2.0.6
honcho==1.0.1
-e git://github.com/benwilber/honcho-export-systemd.git@27c5ec16#egg=honcho-export-systemd
# Forms
flask_wtf==0.14.2
| flask==1.0.3
requests==2.22.0
beautifulsoup4==4.7.1
eventlet==0.25.0
gunicorn==19.9.0
# CSS/JS Assets
flask_assets==0.12
yuicompressor==2.4.8
# Sockets
flask_socketio==4.0.0
python_socketio==4.0.2
python_engineio==3.5.2
# Celery
celery==4.3.0
redis==3.2.1
# Octave interaction
scipy==1.3.0
numpy==1.16.3
octave-kernel==0.30.3
ipython==5.4.1 # pyup: ignore
# Octave packages
sympy==1.4
# Database
SQLAlchemy==1.3.3
Flask-SQLAlchemy==2.4.0
# App management
Flask-Migrate==2.5.1
Flask-Script==2.0.6
honcho==1.0.1
-e git://github.com/benwilber/honcho-export-systemd.git@27c5ec16#egg=honcho-export-systemd
# Forms
flask_wtf==0.14.2
| Remove six from the requirements file | Remove six from the requirements file
| Text | mit | suever/MATL-Online,suever/MATL-Online,suever/MATL-Online,suever/MATL-Online,suever/MATL-Online | text | ## Code Before:
flask==1.0.3
requests==2.22.0
beautifulsoup4==4.7.1
eventlet==0.25.0
gunicorn==19.9.0
# Python 2/3 Compatibility
six==1.12.0
# CSS/JS Assets
flask_assets==0.12
yuicompressor==2.4.8
# Sockets
flask_socketio==4.0.0
python_socketio==4.0.2
python_engineio==3.5.2
# Celery
celery==4.3.0
redis==3.2.1
# Octave interaction
scipy==1.3.0
numpy==1.16.3
octave-kernel==0.30.3
ipython==5.4.1 # pyup: ignore
# Octave packages
sympy==1.4
# Database
SQLAlchemy==1.3.3
Flask-SQLAlchemy==2.4.0
# App management
Flask-Migrate==2.5.1
Flask-Script==2.0.6
honcho==1.0.1
-e git://github.com/benwilber/honcho-export-systemd.git@27c5ec16#egg=honcho-export-systemd
# Forms
flask_wtf==0.14.2
## Instruction:
Remove six from the requirements file
## Code After:
flask==1.0.3
requests==2.22.0
beautifulsoup4==4.7.1
eventlet==0.25.0
gunicorn==19.9.0
# CSS/JS Assets
flask_assets==0.12
yuicompressor==2.4.8
# Sockets
flask_socketio==4.0.0
python_socketio==4.0.2
python_engineio==3.5.2
# Celery
celery==4.3.0
redis==3.2.1
# Octave interaction
scipy==1.3.0
numpy==1.16.3
octave-kernel==0.30.3
ipython==5.4.1 # pyup: ignore
# Octave packages
sympy==1.4
# Database
SQLAlchemy==1.3.3
Flask-SQLAlchemy==2.4.0
# App management
Flask-Migrate==2.5.1
Flask-Script==2.0.6
honcho==1.0.1
-e git://github.com/benwilber/honcho-export-systemd.git@27c5ec16#egg=honcho-export-systemd
# Forms
flask_wtf==0.14.2
| flask==1.0.3
requests==2.22.0
beautifulsoup4==4.7.1
eventlet==0.25.0
gunicorn==19.9.0
-
- # Python 2/3 Compatibility
- six==1.12.0
# CSS/JS Assets
flask_assets==0.12
yuicompressor==2.4.8
# Sockets
flask_socketio==4.0.0
python_socketio==4.0.2
python_engineio==3.5.2
# Celery
celery==4.3.0
redis==3.2.1
# Octave interaction
scipy==1.3.0
numpy==1.16.3
octave-kernel==0.30.3
ipython==5.4.1 # pyup: ignore
# Octave packages
sympy==1.4
# Database
SQLAlchemy==1.3.3
Flask-SQLAlchemy==2.4.0
# App management
Flask-Migrate==2.5.1
Flask-Script==2.0.6
honcho==1.0.1
-e git://github.com/benwilber/honcho-export-systemd.git@27c5ec16#egg=honcho-export-systemd
# Forms
flask_wtf==0.14.2 | 3 | 0.069767 | 0 | 3 |
761789b490deb29e0cdbf46ec15d2cdaf97959e0 | README.md | README.md | vim_setup
=========
Scripts to set up my vim environment on any machine. Right now it installs the following scripts and plugins:
* [Most Recently Used](https://github.com/yegappan/mru)
* [taglist.vim](https://github.com/vim-scripts/taglist.vim)
* [pathogen.vim](https://github.com/tpope/vim-pathogen)
* [SnipMate](https://github.com/garbas/vim-snipmate) along with some custom snippets
The vimrc will change the leader key to `<Space>`. The following custom mappings are defined:
* `<Space>s` Save session (to ~/.vim/session)
* `<Space>l` Restore session
* `<Space>mf` Add `:Mru ` in command line which allows you to specify a filter before hitting enter
* `<Space>mr` Directly open most recently used files list
* `<Space>t` Open new tab
* `<Space>g` Toggle taglist
* `<Space><NUM>` Go to tab <NUM> (works with numbers from 1 to 7)
* `<Space>q` Quit
* `<Space>e` Explore Directory
Installation
------------
**Attention: This will overwrite your .vimrc without asking! You have been warned.**
`git clone https://github.com/moee/vim_setup.git ~/vim_setup && cd ~/vim_setup && ./setup.sh && cd .. && rm vim_setup -rf`
| vim_setup
=========
Scripts to set up my vim environment on any machine. Right now it installs the following scripts and plugins:
* [Most Recently Used](https://github.com/yegappan/mru)
* [taglist.vim](https://github.com/vim-scripts/taglist.vim)
* [pathogen.vim](https://github.com/tpope/vim-pathogen)
* [SnipMate](https://github.com/garbas/vim-snipmate) along with some custom snippets
The vimrc will change the leader key to `<Space>`. The following custom mappings are defined:
* `<Space>s` Save session (to ~/.vim/session)
* `<Space>l` Restore session
* `<Space>mf` Add `:Mru ` in command line which allows you to specify a filter before hitting enter
* `<Space>mr` Directly open most recently used files list
* `<Space>t` Open new tab and explore the current file's directory
* `<Space>g` Toggle taglist
* `<Space><NUM>` Go to tab <NUM> (works with numbers from 1 to 7)
* `<Space>q` Quit
* `<Space>e` Explore Directory
Installation
------------
**Attention: This will overwrite your .vimrc without asking! You have been warned.**
`git clone https://github.com/moee/vim_setup.git ~/vim_setup && cd ~/vim_setup && ./setup.sh && cd .. && rm vim_setup -rf`
| Document changed behavior of <Space>t | Document changed behavior of <Space>t | Markdown | mit | moee/vim_setup | markdown | ## Code Before:
vim_setup
=========
Scripts to set up my vim environment on any machine. Right now it installs the following scripts and plugins:
* [Most Recently Used](https://github.com/yegappan/mru)
* [taglist.vim](https://github.com/vim-scripts/taglist.vim)
* [pathogen.vim](https://github.com/tpope/vim-pathogen)
* [SnipMate](https://github.com/garbas/vim-snipmate) along with some custom snippets
The vimrc will change the leader key to `<Space>`. The following custom mappings are defined:
* `<Space>s` Save session (to ~/.vim/session)
* `<Space>l` Restore session
* `<Space>mf` Add `:Mru ` in command line which allows you to specify a filter before hitting enter
* `<Space>mr` Directly open most recently used files list
* `<Space>t` Open new tab
* `<Space>g` Toggle taglist
* `<Space><NUM>` Go to tab <NUM> (works with numbers from 1 to 7)
* `<Space>q` Quit
* `<Space>e` Explore Directory
Installation
------------
**Attention: This will overwrite your .vimrc without asking! You have been warned.**
`git clone https://github.com/moee/vim_setup.git ~/vim_setup && cd ~/vim_setup && ./setup.sh && cd .. && rm vim_setup -rf`
## Instruction:
Document changed behavior of <Space>t
## Code After:
vim_setup
=========
Scripts to set up my vim environment on any machine. Right now it installs the following scripts and plugins:
* [Most Recently Used](https://github.com/yegappan/mru)
* [taglist.vim](https://github.com/vim-scripts/taglist.vim)
* [pathogen.vim](https://github.com/tpope/vim-pathogen)
* [SnipMate](https://github.com/garbas/vim-snipmate) along with some custom snippets
The vimrc will change the leader key to `<Space>`. The following custom mappings are defined:
* `<Space>s` Save session (to ~/.vim/session)
* `<Space>l` Restore session
* `<Space>mf` Add `:Mru ` in command line which allows you to specify a filter before hitting enter
* `<Space>mr` Directly open most recently used files list
* `<Space>t` Open new tab and explore the current file's directory
* `<Space>g` Toggle taglist
* `<Space><NUM>` Go to tab <NUM> (works with numbers from 1 to 7)
* `<Space>q` Quit
* `<Space>e` Explore Directory
Installation
------------
**Attention: This will overwrite your .vimrc without asking! You have been warned.**
`git clone https://github.com/moee/vim_setup.git ~/vim_setup && cd ~/vim_setup && ./setup.sh && cd .. && rm vim_setup -rf`
| vim_setup
=========
Scripts to set up my vim environment on any machine. Right now it installs the following scripts and plugins:
* [Most Recently Used](https://github.com/yegappan/mru)
* [taglist.vim](https://github.com/vim-scripts/taglist.vim)
* [pathogen.vim](https://github.com/tpope/vim-pathogen)
* [SnipMate](https://github.com/garbas/vim-snipmate) along with some custom snippets
The vimrc will change the leader key to `<Space>`. The following custom mappings are defined:
* `<Space>s` Save session (to ~/.vim/session)
* `<Space>l` Restore session
* `<Space>mf` Add `:Mru ` in command line which allows you to specify a filter before hitting enter
* `<Space>mr` Directly open most recently used files list
- * `<Space>t` Open new tab
+ * `<Space>t` Open new tab and explore the current file's directory
* `<Space>g` Toggle taglist
* `<Space><NUM>` Go to tab <NUM> (works with numbers from 1 to 7)
* `<Space>q` Quit
* `<Space>e` Explore Directory
Installation
------------
**Attention: This will overwrite your .vimrc without asking! You have been warned.**
`git clone https://github.com/moee/vim_setup.git ~/vim_setup && cd ~/vim_setup && ./setup.sh && cd .. && rm vim_setup -rf` | 2 | 0.071429 | 1 | 1 |
ae2b57044c5459a8900d69c8ef0f6e44dd87ed8a | resources/11/info.txt | resources/11/info.txt | name: LibriSpeech language models, vocabulary and G2P models
summary: Language modelling resources, for use with the LibriSpeech ASR corpus
category: text
license: Public domain
file: librispeech-lm-corpus.tgz 14500 public domain books, used as training material for the LibriSpeech's LM
file: vocab.txt 200K word vocabulary for the LM
file: 3-gram.arpa.gz 3-gram ARPA LM, not pruned
file: 3-gram.pruned.1e-7.arpa.gz 3-gram ARPA LM, pruned with theshold 1e-7
file: 3-gram.pruned.3e-7.arpa.gz 3-gram ARPA LM, pruned with theshold 3e-7
file: 4-gram.arpa.gz 4-gram ARPA LM, usually used for rescoring
file: 4-gram.pruned.1e-7.arpa.gz 4-gram ARPA LM, pruned with theshold 1e-7
file: 4-gram.pruned.3e-7.arpa.gz 4-gram ARPA LM, pruned with theshold 3e-7
file: g2p-model-5 Fifth order Sequitur G2P model
| name: LibriSpeech language models, vocabulary and G2P models
summary: Language modelling resources, for use with the LibriSpeech ASR corpus
category: text
license: Public domain
file: librispeech-lm-corpus.tgz 14500 public domain books, used as training material for the LibriSpeech's LM
file: librispeech-lm-norm.txt.gz Normalized LM training text
file: vocab.txt 200K word vocabulary for the LM
file: 3-gram.arpa.gz 3-gram ARPA LM, not pruned
file: 3-gram.pruned.1e-7.arpa.gz 3-gram ARPA LM, pruned with theshold 1e-7
file: 3-gram.pruned.3e-7.arpa.gz 3-gram ARPA LM, pruned with theshold 3e-7
file: 4-gram.arpa.gz 4-gram ARPA LM, usually used for rescoring
file: 4-gram.pruned.1e-7.arpa.gz 4-gram ARPA LM, pruned with theshold 1e-7
file: 4-gram.pruned.3e-7.arpa.gz 4-gram ARPA LM, pruned with theshold 3e-7
file: g2p-model-5 Fifth order Sequitur G2P model
| Add an archive with normalized LM training text for LibriSpeech | Add an archive with normalized LM training text for LibriSpeech
| Text | apache-2.0 | danpovey/openslr,danpovey/openslr | text | ## Code Before:
name: LibriSpeech language models, vocabulary and G2P models
summary: Language modelling resources, for use with the LibriSpeech ASR corpus
category: text
license: Public domain
file: librispeech-lm-corpus.tgz 14500 public domain books, used as training material for the LibriSpeech's LM
file: vocab.txt 200K word vocabulary for the LM
file: 3-gram.arpa.gz 3-gram ARPA LM, not pruned
file: 3-gram.pruned.1e-7.arpa.gz 3-gram ARPA LM, pruned with theshold 1e-7
file: 3-gram.pruned.3e-7.arpa.gz 3-gram ARPA LM, pruned with theshold 3e-7
file: 4-gram.arpa.gz 4-gram ARPA LM, usually used for rescoring
file: 4-gram.pruned.1e-7.arpa.gz 4-gram ARPA LM, pruned with theshold 1e-7
file: 4-gram.pruned.3e-7.arpa.gz 4-gram ARPA LM, pruned with theshold 3e-7
file: g2p-model-5 Fifth order Sequitur G2P model
## Instruction:
Add an archive with normalized LM training text for LibriSpeech
## Code After:
name: LibriSpeech language models, vocabulary and G2P models
summary: Language modelling resources, for use with the LibriSpeech ASR corpus
category: text
license: Public domain
file: librispeech-lm-corpus.tgz 14500 public domain books, used as training material for the LibriSpeech's LM
file: librispeech-lm-norm.txt.gz Normalized LM training text
file: vocab.txt 200K word vocabulary for the LM
file: 3-gram.arpa.gz 3-gram ARPA LM, not pruned
file: 3-gram.pruned.1e-7.arpa.gz 3-gram ARPA LM, pruned with theshold 1e-7
file: 3-gram.pruned.3e-7.arpa.gz 3-gram ARPA LM, pruned with theshold 3e-7
file: 4-gram.arpa.gz 4-gram ARPA LM, usually used for rescoring
file: 4-gram.pruned.1e-7.arpa.gz 4-gram ARPA LM, pruned with theshold 1e-7
file: 4-gram.pruned.3e-7.arpa.gz 4-gram ARPA LM, pruned with theshold 3e-7
file: g2p-model-5 Fifth order Sequitur G2P model
| name: LibriSpeech language models, vocabulary and G2P models
summary: Language modelling resources, for use with the LibriSpeech ASR corpus
category: text
license: Public domain
file: librispeech-lm-corpus.tgz 14500 public domain books, used as training material for the LibriSpeech's LM
+ file: librispeech-lm-norm.txt.gz Normalized LM training text
file: vocab.txt 200K word vocabulary for the LM
file: 3-gram.arpa.gz 3-gram ARPA LM, not pruned
file: 3-gram.pruned.1e-7.arpa.gz 3-gram ARPA LM, pruned with theshold 1e-7
file: 3-gram.pruned.3e-7.arpa.gz 3-gram ARPA LM, pruned with theshold 3e-7
file: 4-gram.arpa.gz 4-gram ARPA LM, usually used for rescoring
file: 4-gram.pruned.1e-7.arpa.gz 4-gram ARPA LM, pruned with theshold 1e-7
file: 4-gram.pruned.3e-7.arpa.gz 4-gram ARPA LM, pruned with theshold 3e-7
file: g2p-model-5 Fifth order Sequitur G2P model | 1 | 0.076923 | 1 | 0 |
2b37f2640810e534197d6a2c2174700bff2662d8 | files/gitlab-cookbooks/gitlab/templates/default/mount_point_check.erb | files/gitlab-cookbooks/gitlab/templates/default/mount_point_check.erb | <% if node['gitlab']['high-availability']['mountpoint'] %>
if ! mountpoint -q '<%= node['gitlab']['high-availability']['mountpoint'] %>' ; then
echo 'Refusing to start because <%= node['gitlab']['high-availability']['mountpoint'] %> is not a mountpoint.'
exit 1
fi
<% end %>
| <% [node['gitlab']['high-availability']['mountpoint']].flatten.compact.each do |mountpoint| %>
if ! mountpoint -q '<%= mountpoint %>' ; then
echo 'Refusing to start because <%= mountpoint %> is not a mountpoint.'
exit 1
fi
<% end %>
| Allow to specify multiple mountpoints as an array to high-availability:mountpoint | Allow to specify multiple mountpoints as an array to high-availability:mountpoint
| HTML+ERB | apache-2.0 | gitlabhq/omnibus-gitlab,gitlabhq/omnibus-gitlab,gitlabhq/omnibus-gitlab,gitlabhq/omnibus-gitlab | html+erb | ## Code Before:
<% if node['gitlab']['high-availability']['mountpoint'] %>
if ! mountpoint -q '<%= node['gitlab']['high-availability']['mountpoint'] %>' ; then
echo 'Refusing to start because <%= node['gitlab']['high-availability']['mountpoint'] %> is not a mountpoint.'
exit 1
fi
<% end %>
## Instruction:
Allow to specify multiple mountpoints as an array to high-availability:mountpoint
## Code After:
<% [node['gitlab']['high-availability']['mountpoint']].flatten.compact.each do |mountpoint| %>
if ! mountpoint -q '<%= mountpoint %>' ; then
echo 'Refusing to start because <%= mountpoint %> is not a mountpoint.'
exit 1
fi
<% end %>
| - <% if node['gitlab']['high-availability']['mountpoint'] %>
- if ! mountpoint -q '<%= node['gitlab']['high-availability']['mountpoint'] %>' ; then
+ <% [node['gitlab']['high-availability']['mountpoint']].flatten.compact.each do |mountpoint| %>
+ if ! mountpoint -q '<%= mountpoint %>' ; then
- echo 'Refusing to start because <%= node['gitlab']['high-availability']['mountpoint'] %> is not a mountpoint.'
? ------------------------------------- --
+ echo 'Refusing to start because <%= mountpoint %> is not a mountpoint.'
exit 1
fi
<% end %> | 6 | 1 | 3 | 3 |
594b06728422ae0a80397cab49ac54ac193eab6b | install.work.conf.yaml | install.work.conf.yaml | - clean: ['~']
- link:
~/.vim: vim
~/.vimrc: vimrc
~/.tmux.conf: tmux.conf
- link:
~/bin/astyle: work/bin/astyle
~/bin/boxes: work/bin/boxes
~/.vim/settings/work.vim: work/work.vim
~/.vim/cpp.vimrc: work/cpp.vimrc
| - clean: ['~']
- link:
~/.vim: vim
~/.vimrc: vimrc
~/.tmux.conf: tmux.conf
- link:
~/bin/astyle:
path: work/bin/astyle
create: true
~/bin/boxes:
path: work/bin/boxes
create: true
~/.vim/settings/work.vim: work/work.vim
~/.vim/cpp.vimrc: work/cpp.vimrc
| Make sure the directory is created for ext links | Make sure the directory is created for ext links
| YAML | mit | mseabold/dotfiles | yaml | ## Code Before:
- clean: ['~']
- link:
~/.vim: vim
~/.vimrc: vimrc
~/.tmux.conf: tmux.conf
- link:
~/bin/astyle: work/bin/astyle
~/bin/boxes: work/bin/boxes
~/.vim/settings/work.vim: work/work.vim
~/.vim/cpp.vimrc: work/cpp.vimrc
## Instruction:
Make sure the directory is created for ext links
## Code After:
- clean: ['~']
- link:
~/.vim: vim
~/.vimrc: vimrc
~/.tmux.conf: tmux.conf
- link:
~/bin/astyle:
path: work/bin/astyle
create: true
~/bin/boxes:
path: work/bin/boxes
create: true
~/.vim/settings/work.vim: work/work.vim
~/.vim/cpp.vimrc: work/cpp.vimrc
| - clean: ['~']
- link:
~/.vim: vim
~/.vimrc: vimrc
~/.tmux.conf: tmux.conf
- link:
- ~/bin/astyle: work/bin/astyle
- ~/bin/boxes: work/bin/boxes
+ ~/bin/astyle:
+ path: work/bin/astyle
+ create: true
+ ~/bin/boxes:
+ path: work/bin/boxes
+ create: true
~/.vim/settings/work.vim: work/work.vim
~/.vim/cpp.vimrc: work/cpp.vimrc | 8 | 0.727273 | 6 | 2 |
30986a923da8002a6948f90a6cb4afe31da22638 | src/cljs/bartleby/db.cljs | src/cljs/bartleby/db.cljs | (ns bartleby.db)
(def default-db
"Default state"
{:tasks []})
| (ns bartleby.db)
(def default-db
"Default state"
{:rest ""
:tasks []})
| Add a flag to show the query status | Add a flag to show the query status
| Clojure | epl-1.0 | capside-functional-nomads/bartleby | clojure | ## Code Before:
(ns bartleby.db)
(def default-db
"Default state"
{:tasks []})
## Instruction:
Add a flag to show the query status
## Code After:
(ns bartleby.db)
(def default-db
"Default state"
{:rest ""
:tasks []})
| (ns bartleby.db)
(def default-db
"Default state"
+ {:rest ""
- {:tasks []})
? ^
+ :tasks []})
? ^
| 3 | 0.6 | 2 | 1 |
b97b669544c54ca878f2f7eb1656b8b5b3e135e2 | README.md | README.md | JSON based dependency injection for Android.
The core SCFFLD package provides the following:
* JSON configuration loading;
* Dependency injection (DI) / inversion of control (IoC) containers;
* Internal URI system;
* App container and basic UI components;
See the wiki for more information.
# Status
SCFFLD is currently beta software. Much of the core code is well tested and has been used in a variety of production products, but some details - particularly configuration APIs of core UI components - may still be changed.
The current latest release is 0.9.0.
# Installation
There are a number of ways to use SCFFLD, see [the installation page](wiki/Installation) for details.
# Sample app
The project workspace includes a sample app that demonstrates core functionality and includes sample configurations and code.
| JSON based dependency injection for Android.
The core SCFFLD package provides the following:
* JSON configuration loading;
* Dependency injection (DI) / inversion of control (IoC) containers;
* Internal URI system;
* App container and basic UI components;
See the wiki for more information.
# Status
SCFFLD is currently beta software. Much of the core code is well tested and has been used in a variety of production products, but some details - particularly configuration APIs of core UI components - may still be changed.
The current latest release is 0.9.0.
# Installation
There are a number of ways to use SCFFLD, see _Installation_ page in the repo wiki for details.
# Sample app
The project workspace includes a sample app that demonstrates core functionality and includes sample configurations and code.
| Edit link to wiki installation page. | Edit link to wiki installation page. | Markdown | apache-2.0 | innerfunction/SCFFLD-and,innerfunction/SCFFLD-and | markdown | ## Code Before:
JSON based dependency injection for Android.
The core SCFFLD package provides the following:
* JSON configuration loading;
* Dependency injection (DI) / inversion of control (IoC) containers;
* Internal URI system;
* App container and basic UI components;
See the wiki for more information.
# Status
SCFFLD is currently beta software. Much of the core code is well tested and has been used in a variety of production products, but some details - particularly configuration APIs of core UI components - may still be changed.
The current latest release is 0.9.0.
# Installation
There are a number of ways to use SCFFLD, see [the installation page](wiki/Installation) for details.
# Sample app
The project workspace includes a sample app that demonstrates core functionality and includes sample configurations and code.
## Instruction:
Edit link to wiki installation page.
## Code After:
JSON based dependency injection for Android.
The core SCFFLD package provides the following:
* JSON configuration loading;
* Dependency injection (DI) / inversion of control (IoC) containers;
* Internal URI system;
* App container and basic UI components;
See the wiki for more information.
# Status
SCFFLD is currently beta software. Much of the core code is well tested and has been used in a variety of production products, but some details - particularly configuration APIs of core UI components - may still be changed.
The current latest release is 0.9.0.
# Installation
There are a number of ways to use SCFFLD, see _Installation_ page in the repo wiki for details.
# Sample app
The project workspace includes a sample app that demonstrates core functionality and includes sample configurations and code.
| JSON based dependency injection for Android.
The core SCFFLD package provides the following:
* JSON configuration loading;
* Dependency injection (DI) / inversion of control (IoC) containers;
* Internal URI system;
* App container and basic UI components;
See the wiki for more information.
# Status
SCFFLD is currently beta software. Much of the core code is well tested and has been used in a variety of production products, but some details - particularly configuration APIs of core UI components - may still be changed.
The current latest release is 0.9.0.
# Installation
- There are a number of ways to use SCFFLD, see [the installation page](wiki/Installation) for details.
+ There are a number of ways to use SCFFLD, see _Installation_ page in the repo wiki for details.
# Sample app
The project workspace includes a sample app that demonstrates core functionality and includes sample configurations and code.
| 2 | 0.090909 | 1 | 1 |
2b9ed7016865f29f54bd3b3d40c1a2812f4a5992 | js/app/templates/index.hbs | js/app/templates/index.hbs | <div id="index">
<nav>
<h3>Link-sf</h3>
</nav>
<h3 class="title">What are you looking for?</h3>
<span>Service</span>
<ul class="categories">
<li><button class="btn" data-category="housing"><i class="icon-briefcase"></i>Housing</button></li>
<li><button class="btn" data-category="food"><i class="icon-shopping-cart"></i>Food</button></li>
<li><button class="btn" data-category="medical"><i class="icon-heart"></i>Medical</button></li>
<li><button class="btn" data-category="hygiene"><i class="icon-tint"></i>Hygiene</button></li>
<li><button class="btn" data-category="technology"><i class="icon-hdd"></i>Technology</button></li>
</ul>
<p class="search"><button class="btn btn-info">Search</button></p>
</div>
| <div id="index">
<nav>
<h3>Link-sf</h3>
</nav>
<h3 class="title">What are you looking for?</h3>
<span>Service</span>
<ul class="categories">
<li><button class="btn" data-category="housing"><i class="icon-briefcase"></i>Housing</button></li>
<li><button class="btn" data-category="food"><i class="icon-shopping-cart"></i>Food</button></li>
<li><button class="btn" data-category="medical"><i class="icon-heart"></i>Medical</button></li>
<li><button class="btn" data-category="hygiene"><i class="icon-tint"></i>Hygiene</button></li>
<li><button class="btn" data-category="technology"><i class="icon-hdd"></i>Technology</button></li>
</ul>
<p class="search" style="display: none"><button class="btn btn-info">Search</button></p>
</div>
| Hide search button for now | Hide search button for now
| Handlebars | apache-2.0 | ISMAELMARTINEZ/linkuk,zendesk/copenhelp,sfbrigade/linksf,zendesk/linksf,lcomito/linksf,sfbrigade/linksf,lcomito/linksf,ISMAELMARTINEZ/linkuk,sfbrigade/linksf,lcomito/linksf,zendesk/linksf,zendesk/copenhelp,zendesk/copenhelp | handlebars | ## Code Before:
<div id="index">
<nav>
<h3>Link-sf</h3>
</nav>
<h3 class="title">What are you looking for?</h3>
<span>Service</span>
<ul class="categories">
<li><button class="btn" data-category="housing"><i class="icon-briefcase"></i>Housing</button></li>
<li><button class="btn" data-category="food"><i class="icon-shopping-cart"></i>Food</button></li>
<li><button class="btn" data-category="medical"><i class="icon-heart"></i>Medical</button></li>
<li><button class="btn" data-category="hygiene"><i class="icon-tint"></i>Hygiene</button></li>
<li><button class="btn" data-category="technology"><i class="icon-hdd"></i>Technology</button></li>
</ul>
<p class="search"><button class="btn btn-info">Search</button></p>
</div>
## Instruction:
Hide search button for now
## Code After:
<div id="index">
<nav>
<h3>Link-sf</h3>
</nav>
<h3 class="title">What are you looking for?</h3>
<span>Service</span>
<ul class="categories">
<li><button class="btn" data-category="housing"><i class="icon-briefcase"></i>Housing</button></li>
<li><button class="btn" data-category="food"><i class="icon-shopping-cart"></i>Food</button></li>
<li><button class="btn" data-category="medical"><i class="icon-heart"></i>Medical</button></li>
<li><button class="btn" data-category="hygiene"><i class="icon-tint"></i>Hygiene</button></li>
<li><button class="btn" data-category="technology"><i class="icon-hdd"></i>Technology</button></li>
</ul>
<p class="search" style="display: none"><button class="btn btn-info">Search</button></p>
</div>
| <div id="index">
<nav>
<h3>Link-sf</h3>
</nav>
<h3 class="title">What are you looking for?</h3>
<span>Service</span>
<ul class="categories">
<li><button class="btn" data-category="housing"><i class="icon-briefcase"></i>Housing</button></li>
<li><button class="btn" data-category="food"><i class="icon-shopping-cart"></i>Food</button></li>
<li><button class="btn" data-category="medical"><i class="icon-heart"></i>Medical</button></li>
<li><button class="btn" data-category="hygiene"><i class="icon-tint"></i>Hygiene</button></li>
<li><button class="btn" data-category="technology"><i class="icon-hdd"></i>Technology</button></li>
</ul>
- <p class="search"><button class="btn btn-info">Search</button></p>
+ <p class="search" style="display: none"><button class="btn btn-info">Search</button></p>
? ++++++++++++++++++++++
</div> | 2 | 0.111111 | 1 | 1 |
38964f0f840a7b60f5ce65ca2857789d92b133b5 | django_base64field/tests.py | django_base64field/tests.py | from django.db import models
from django.test import TestCase
from django.utils.baseconv import base64
from django_base64field.fields import Base64Field
class Planet(models.Model):
ek = Base64Field()
name = models.CharField(max_length=13)
class Continent(models.Model):
ek = Base64Field()
name = models.CharField(max_length=13)
planet = models.ForeignKey(Planet, to_field='ek')
class TestBase64Field(TestCase):
def test_field_is_none_after_creation(self):
planet = Planet.objects.create(name='Fucking Earth')
self.assertIn(planet.ek, ['', None])
self.assertIsNotNone(planet.pk)
def test_field_not_none_after_saved(self):
planet = Planet.objects.create(name='Little Planet')
base64_key = base64.encode(planet.pk)
saved_planet = Planet.objects.get(pk=planet.pk)
self.assertEqual(saved_planet.ek, base64_key)
| from django.db import models
from django.test import TestCase
from django.utils.baseconv import base64
from django_base64field.fields import Base64Field
class Planet(models.Model):
ek = Base64Field()
name = models.CharField(
default='Fucker',
max_length=103
)
class Continent(models.Model):
ek = Base64Field()
name = models.CharField(
default='Suckers!',
max_length=13
)
planet = models.ForeignKey(Planet, to_field='ek')
class TestBase64Field(TestCase):
def test_field_is_none_after_creation(self):
planet = Planet.objects.create(name='Fucking Earth')
self.assertIn(planet.ek, ['', None])
self.assertIsNotNone(planet.pk)
def test_field_not_none_after_saved(self):
planet = Planet.objects.create(name='Little Planet')
base64_key = base64.encode(planet.pk)
saved_planet = Planet.objects.get(pk=planet.pk)
self.assertEqual(saved_planet.ek, base64_key)
| Make fields on model have defaults value | Make fields on model have defaults value
Like who cares for their default value
| Python | bsd-3-clause | Alir3z4/django-base64field | python | ## Code Before:
from django.db import models
from django.test import TestCase
from django.utils.baseconv import base64
from django_base64field.fields import Base64Field
class Planet(models.Model):
ek = Base64Field()
name = models.CharField(max_length=13)
class Continent(models.Model):
ek = Base64Field()
name = models.CharField(max_length=13)
planet = models.ForeignKey(Planet, to_field='ek')
class TestBase64Field(TestCase):
def test_field_is_none_after_creation(self):
planet = Planet.objects.create(name='Fucking Earth')
self.assertIn(planet.ek, ['', None])
self.assertIsNotNone(planet.pk)
def test_field_not_none_after_saved(self):
planet = Planet.objects.create(name='Little Planet')
base64_key = base64.encode(planet.pk)
saved_planet = Planet.objects.get(pk=planet.pk)
self.assertEqual(saved_planet.ek, base64_key)
## Instruction:
Make fields on model have defaults value
Like who cares for their default value
## Code After:
from django.db import models
from django.test import TestCase
from django.utils.baseconv import base64
from django_base64field.fields import Base64Field
class Planet(models.Model):
ek = Base64Field()
name = models.CharField(
default='Fucker',
max_length=103
)
class Continent(models.Model):
ek = Base64Field()
name = models.CharField(
default='Suckers!',
max_length=13
)
planet = models.ForeignKey(Planet, to_field='ek')
class TestBase64Field(TestCase):
def test_field_is_none_after_creation(self):
planet = Planet.objects.create(name='Fucking Earth')
self.assertIn(planet.ek, ['', None])
self.assertIsNotNone(planet.pk)
def test_field_not_none_after_saved(self):
planet = Planet.objects.create(name='Little Planet')
base64_key = base64.encode(planet.pk)
saved_planet = Planet.objects.get(pk=planet.pk)
self.assertEqual(saved_planet.ek, base64_key)
| from django.db import models
from django.test import TestCase
from django.utils.baseconv import base64
from django_base64field.fields import Base64Field
class Planet(models.Model):
ek = Base64Field()
- name = models.CharField(max_length=13)
? --------------
+ name = models.CharField(
+ default='Fucker',
+ max_length=103
+ )
class Continent(models.Model):
ek = Base64Field()
- name = models.CharField(max_length=13)
? --------------
+ name = models.CharField(
+ default='Suckers!',
+ max_length=13
+ )
planet = models.ForeignKey(Planet, to_field='ek')
class TestBase64Field(TestCase):
def test_field_is_none_after_creation(self):
planet = Planet.objects.create(name='Fucking Earth')
self.assertIn(planet.ek, ['', None])
self.assertIsNotNone(planet.pk)
def test_field_not_none_after_saved(self):
planet = Planet.objects.create(name='Little Planet')
base64_key = base64.encode(planet.pk)
saved_planet = Planet.objects.get(pk=planet.pk)
self.assertEqual(saved_planet.ek, base64_key)
| 10 | 0.285714 | 8 | 2 |
abbe5e3617b6f128bbdacaf287a85c833f9946d8 | tasks/rspec.rake | tasks/rspec.rake | require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new('spec')
| require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
namespace :spec do
desc "Open coverage report in browser"
task :open_coverage => :browser do
sh "#{ENV["DEVELOPMENT_WEBBROWSER"]} coverage/index.html"
end
end
| Add a task to open the coverage report | Add a task to open the coverage report
| Ruby | mit | bxt/wptemplates | ruby | ## Code Before:
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new('spec')
## Instruction:
Add a task to open the coverage report
## Code After:
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
namespace :spec do
desc "Open coverage report in browser"
task :open_coverage => :browser do
sh "#{ENV["DEVELOPMENT_WEBBROWSER"]} coverage/index.html"
end
end
| require 'rspec/core/rake_task'
- RSpec::Core::RakeTask.new('spec')
? ^ -
+ RSpec::Core::RakeTask.new(:spec)
? ^
+
+ namespace :spec do
+ desc "Open coverage report in browser"
+ task :open_coverage => :browser do
+ sh "#{ENV["DEVELOPMENT_WEBBROWSER"]} coverage/index.html"
+ end
+ end | 9 | 3 | 8 | 1 |
0048752ec3d9f9e39dca505c8f88394f58e02fd1 | README.md | README.md | kiigame
=======
KiiGame Adventure Engine is a HTML5/JavaScript based simple adventure game engine for web browsers. KGAE uses [Konva](https://konvajs.org), and Mocha, Chai and Sinon for unit tests.
The engine comes with an example game, Lätkäzombit: Pako hallista. The example game is in the Finnish language.
Take a look at the adventure creation guide: https://github.com/evktalo/kiigame/wiki/Adventure-creation-guide
How to test locally on Linux
----------------------------
The game is implemented as a web page. Therefore you need to run a web server on your machine to test it locally. Here are the steps:
* Install and run Apache (for example see https://help.ubuntu.com/community/ApacheMySQLPHP)
* Install npm (for example see https://www.sitepoint.com/beginners-guide-node-package-manager/)
* Clone the repository (or just get the files)
* Run `npm install` to get dependencies
* Run `npm run dev` to build a development bundle. The bundle is built to the `public/` directory.
* Put the files (including folders) to your webserver directory (for example /var/www/)
* Open the kiigame.html in your browser (for example http://localhost/public/kiigame.html)
Running unit tests
------------------
After installing with npm install, you should be able to run
* npm test
in the project root to run the unit tests.
| kiigame
=======
KiiGame Adventure Engine is a HTML5/JavaScript based simple adventure game engine for web browsers. KGAE uses [Konva](https://konvajs.org), and Mocha, Chai and Sinon for unit tests.
The engine comes with an example game, Lätkäzombit: Pako hallista. The example game is in the Finnish language.
Take a look at the adventure creation guide: https://github.com/evktalo/kiigame/wiki/Adventure-creation-guide
How to test locally on Linux
----------------------------
The game is implemented as a web page. Therefore you need to run a web server on your machine to test it locally. Here are the steps:
* Install and run Apache (for example see https://help.ubuntu.com/community/ApacheMySQLPHP)
* Install npm (for example see https://www.sitepoint.com/beginners-guide-node-package-manager/)
* Clone the repository (or just get the files)
* Run `npm install` to get dependencies
* Run `npm run dev` to build a development bundle. The bundle is built to the `public/` directory.
* Put the files (including folders) to your webserver directory (for example `/var/www/`)
* Open `kiigame.html` in your browser (for example `http://localhost/public/kiigame.html`)
Running unit tests
------------------
After installing with `npm install`, you should be able to run
* `npm test`
in the project root to run the unit tests.
Building the library bundle
---------------------------
`npm run build` builds the library bundle to `dist/`.
| Add a bit about building the bundle to readme. | Add a bit about building the bundle to readme.
Plus some other style changes. | Markdown | bsd-3-clause | evktalo/kiigame,evktalo/kiigame | markdown | ## Code Before:
kiigame
=======
KiiGame Adventure Engine is a HTML5/JavaScript based simple adventure game engine for web browsers. KGAE uses [Konva](https://konvajs.org), and Mocha, Chai and Sinon for unit tests.
The engine comes with an example game, Lätkäzombit: Pako hallista. The example game is in the Finnish language.
Take a look at the adventure creation guide: https://github.com/evktalo/kiigame/wiki/Adventure-creation-guide
How to test locally on Linux
----------------------------
The game is implemented as a web page. Therefore you need to run a web server on your machine to test it locally. Here are the steps:
* Install and run Apache (for example see https://help.ubuntu.com/community/ApacheMySQLPHP)
* Install npm (for example see https://www.sitepoint.com/beginners-guide-node-package-manager/)
* Clone the repository (or just get the files)
* Run `npm install` to get dependencies
* Run `npm run dev` to build a development bundle. The bundle is built to the `public/` directory.
* Put the files (including folders) to your webserver directory (for example /var/www/)
* Open the kiigame.html in your browser (for example http://localhost/public/kiigame.html)
Running unit tests
------------------
After installing with npm install, you should be able to run
* npm test
in the project root to run the unit tests.
## Instruction:
Add a bit about building the bundle to readme.
Plus some other style changes.
## Code After:
kiigame
=======
KiiGame Adventure Engine is a HTML5/JavaScript based simple adventure game engine for web browsers. KGAE uses [Konva](https://konvajs.org), and Mocha, Chai and Sinon for unit tests.
The engine comes with an example game, Lätkäzombit: Pako hallista. The example game is in the Finnish language.
Take a look at the adventure creation guide: https://github.com/evktalo/kiigame/wiki/Adventure-creation-guide
How to test locally on Linux
----------------------------
The game is implemented as a web page. Therefore you need to run a web server on your machine to test it locally. Here are the steps:
* Install and run Apache (for example see https://help.ubuntu.com/community/ApacheMySQLPHP)
* Install npm (for example see https://www.sitepoint.com/beginners-guide-node-package-manager/)
* Clone the repository (or just get the files)
* Run `npm install` to get dependencies
* Run `npm run dev` to build a development bundle. The bundle is built to the `public/` directory.
* Put the files (including folders) to your webserver directory (for example `/var/www/`)
* Open `kiigame.html` in your browser (for example `http://localhost/public/kiigame.html`)
Running unit tests
------------------
After installing with `npm install`, you should be able to run
* `npm test`
in the project root to run the unit tests.
Building the library bundle
---------------------------
`npm run build` builds the library bundle to `dist/`.
| kiigame
=======
KiiGame Adventure Engine is a HTML5/JavaScript based simple adventure game engine for web browsers. KGAE uses [Konva](https://konvajs.org), and Mocha, Chai and Sinon for unit tests.
The engine comes with an example game, Lätkäzombit: Pako hallista. The example game is in the Finnish language.
Take a look at the adventure creation guide: https://github.com/evktalo/kiigame/wiki/Adventure-creation-guide
How to test locally on Linux
----------------------------
The game is implemented as a web page. Therefore you need to run a web server on your machine to test it locally. Here are the steps:
* Install and run Apache (for example see https://help.ubuntu.com/community/ApacheMySQLPHP)
* Install npm (for example see https://www.sitepoint.com/beginners-guide-node-package-manager/)
* Clone the repository (or just get the files)
* Run `npm install` to get dependencies
* Run `npm run dev` to build a development bundle. The bundle is built to the `public/` directory.
- * Put the files (including folders) to your webserver directory (for example /var/www/)
+ * Put the files (including folders) to your webserver directory (for example `/var/www/`)
? + +
- * Open the kiigame.html in your browser (for example http://localhost/public/kiigame.html)
? ^^^^
+ * Open `kiigame.html` in your browser (for example `http://localhost/public/kiigame.html`)
? ^ + + +
Running unit tests
------------------
- After installing with npm install, you should be able to run
+ After installing with `npm install`, you should be able to run
? + +
- * npm test
+ * `npm test`
? + +
in the project root to run the unit tests.
+
+ Building the library bundle
+ ---------------------------
+
+ `npm run build` builds the library bundle to `dist/`. | 13 | 0.433333 | 9 | 4 |
6f128279e8f4126c2d0f1a4076b93768678cdc0a | zerver/migrations/0130_text_choice_in_emojiset.py | zerver/migrations/0130_text_choice_in_emojiset.py | from django.db import migrations, models
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
# change emojiset to text if emoji_alt_code is true.
def change_emojiset(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
UserProfile = apps.get_model("zerver", "UserProfile")
for user in UserProfile.objects.filter(emoji_alt_code=True):
user.emojiset = "text"
user.save(update_fields=["emojiset"])
class Migration(migrations.Migration):
dependencies = [
('zerver', '0129_remove_userprofile_autoscroll_forever'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
name='emojiset',
field=models.CharField(choices=[('google', 'Google'), ('apple', 'Apple'), ('twitter', 'Twitter'), ('emojione', 'EmojiOne'), ('text', 'Plain text')], default='google', max_length=20),
),
migrations.RunPython(change_emojiset),
migrations.RemoveField(
model_name='userprofile',
name='emoji_alt_code',
),
]
| from django.db import migrations, models
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
# change emojiset to text if emoji_alt_code is true.
def change_emojiset(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
UserProfile = apps.get_model("zerver", "UserProfile")
for user in UserProfile.objects.filter(emoji_alt_code=True):
user.emojiset = "text"
user.save(update_fields=["emojiset"])
def reverse_change_emojiset(apps: StateApps,
schema_editor: DatabaseSchemaEditor) -> None:
UserProfile = apps.get_model("zerver", "UserProfile")
for user in UserProfile.objects.filter(emojiset="text"):
# Resetting `emojiset` to "google" (the default) doesn't make an
# exact round trip, but it's nearly indistinguishable -- the setting
# shouldn't really matter while `emoji_alt_code` is true.
user.emoji_alt_code = True
user.emojiset = "google"
user.save(update_fields=["emoji_alt_code", "emojiset"])
class Migration(migrations.Migration):
dependencies = [
('zerver', '0129_remove_userprofile_autoscroll_forever'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
name='emojiset',
field=models.CharField(choices=[('google', 'Google'), ('apple', 'Apple'), ('twitter', 'Twitter'), ('emojione', 'EmojiOne'), ('text', 'Plain text')], default='google', max_length=20),
),
migrations.RunPython(change_emojiset, reverse_change_emojiset),
migrations.RemoveField(
model_name='userprofile',
name='emoji_alt_code',
),
]
| Add reverser for emoji_alt_code migration. | migrations: Add reverser for emoji_alt_code migration.
This is easy to do, and prevents this feature from getting a server
admin stuck in potentially a pretty uncomfortable way -- unable to
roll back a deploy.
| Python | apache-2.0 | tommyip/zulip,eeshangarg/zulip,rht/zulip,jackrzhang/zulip,brainwane/zulip,andersk/zulip,shubhamdhama/zulip,shubhamdhama/zulip,punchagan/zulip,kou/zulip,hackerkid/zulip,timabbott/zulip,showell/zulip,hackerkid/zulip,eeshangarg/zulip,dhcrzf/zulip,andersk/zulip,shubhamdhama/zulip,punchagan/zulip,kou/zulip,synicalsyntax/zulip,hackerkid/zulip,dhcrzf/zulip,showell/zulip,rishig/zulip,shubhamdhama/zulip,hackerkid/zulip,hackerkid/zulip,rishig/zulip,eeshangarg/zulip,synicalsyntax/zulip,timabbott/zulip,synicalsyntax/zulip,shubhamdhama/zulip,rht/zulip,synicalsyntax/zulip,jackrzhang/zulip,dhcrzf/zulip,kou/zulip,andersk/zulip,andersk/zulip,synicalsyntax/zulip,jackrzhang/zulip,dhcrzf/zulip,brainwane/zulip,jackrzhang/zulip,kou/zulip,punchagan/zulip,zulip/zulip,timabbott/zulip,brainwane/zulip,zulip/zulip,rht/zulip,rht/zulip,tommyip/zulip,tommyip/zulip,tommyip/zulip,jackrzhang/zulip,andersk/zulip,rishig/zulip,synicalsyntax/zulip,tommyip/zulip,zulip/zulip,punchagan/zulip,brainwane/zulip,showell/zulip,eeshangarg/zulip,showell/zulip,rishig/zulip,dhcrzf/zulip,punchagan/zulip,punchagan/zulip,eeshangarg/zulip,showell/zulip,timabbott/zulip,shubhamdhama/zulip,zulip/zulip,showell/zulip,zulip/zulip,brainwane/zulip,eeshangarg/zulip,timabbott/zulip,showell/zulip,jackrzhang/zulip,hackerkid/zulip,rishig/zulip,eeshangarg/zulip,tommyip/zulip,kou/zulip,dhcrzf/zulip,shubhamdhama/zulip,rht/zulip,synicalsyntax/zulip,timabbott/zulip,zulip/zulip,tommyip/zulip,zulip/zulip,kou/zulip,andersk/zulip,hackerkid/zulip,rishig/zulip,timabbott/zulip,punchagan/zulip,rht/zulip,andersk/zulip,rishig/zulip,brainwane/zulip,jackrzhang/zulip,kou/zulip,brainwane/zulip,dhcrzf/zulip,rht/zulip | python | ## Code Before:
from django.db import migrations, models
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
# change emojiset to text if emoji_alt_code is true.
def change_emojiset(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
UserProfile = apps.get_model("zerver", "UserProfile")
for user in UserProfile.objects.filter(emoji_alt_code=True):
user.emojiset = "text"
user.save(update_fields=["emojiset"])
class Migration(migrations.Migration):
dependencies = [
('zerver', '0129_remove_userprofile_autoscroll_forever'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
name='emojiset',
field=models.CharField(choices=[('google', 'Google'), ('apple', 'Apple'), ('twitter', 'Twitter'), ('emojione', 'EmojiOne'), ('text', 'Plain text')], default='google', max_length=20),
),
migrations.RunPython(change_emojiset),
migrations.RemoveField(
model_name='userprofile',
name='emoji_alt_code',
),
]
## Instruction:
migrations: Add reverser for emoji_alt_code migration.
This is easy to do, and prevents this feature from getting a server
admin stuck in potentially a pretty uncomfortable way -- unable to
roll back a deploy.
## Code After:
from django.db import migrations, models
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
# change emojiset to text if emoji_alt_code is true.
def change_emojiset(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
UserProfile = apps.get_model("zerver", "UserProfile")
for user in UserProfile.objects.filter(emoji_alt_code=True):
user.emojiset = "text"
user.save(update_fields=["emojiset"])
def reverse_change_emojiset(apps: StateApps,
schema_editor: DatabaseSchemaEditor) -> None:
UserProfile = apps.get_model("zerver", "UserProfile")
for user in UserProfile.objects.filter(emojiset="text"):
# Resetting `emojiset` to "google" (the default) doesn't make an
# exact round trip, but it's nearly indistinguishable -- the setting
# shouldn't really matter while `emoji_alt_code` is true.
user.emoji_alt_code = True
user.emojiset = "google"
user.save(update_fields=["emoji_alt_code", "emojiset"])
class Migration(migrations.Migration):
dependencies = [
('zerver', '0129_remove_userprofile_autoscroll_forever'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
name='emojiset',
field=models.CharField(choices=[('google', 'Google'), ('apple', 'Apple'), ('twitter', 'Twitter'), ('emojione', 'EmojiOne'), ('text', 'Plain text')], default='google', max_length=20),
),
migrations.RunPython(change_emojiset, reverse_change_emojiset),
migrations.RemoveField(
model_name='userprofile',
name='emoji_alt_code',
),
]
| from django.db import migrations, models
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
# change emojiset to text if emoji_alt_code is true.
def change_emojiset(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
UserProfile = apps.get_model("zerver", "UserProfile")
for user in UserProfile.objects.filter(emoji_alt_code=True):
user.emojiset = "text"
user.save(update_fields=["emojiset"])
+
+ def reverse_change_emojiset(apps: StateApps,
+ schema_editor: DatabaseSchemaEditor) -> None:
+ UserProfile = apps.get_model("zerver", "UserProfile")
+ for user in UserProfile.objects.filter(emojiset="text"):
+ # Resetting `emojiset` to "google" (the default) doesn't make an
+ # exact round trip, but it's nearly indistinguishable -- the setting
+ # shouldn't really matter while `emoji_alt_code` is true.
+ user.emoji_alt_code = True
+ user.emojiset = "google"
+ user.save(update_fields=["emoji_alt_code", "emojiset"])
class Migration(migrations.Migration):
dependencies = [
('zerver', '0129_remove_userprofile_autoscroll_forever'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
name='emojiset',
field=models.CharField(choices=[('google', 'Google'), ('apple', 'Apple'), ('twitter', 'Twitter'), ('emojione', 'EmojiOne'), ('text', 'Plain text')], default='google', max_length=20),
),
- migrations.RunPython(change_emojiset),
+ migrations.RunPython(change_emojiset, reverse_change_emojiset),
? +++++++++++++++++++++++++
migrations.RemoveField(
model_name='userprofile',
name='emoji_alt_code',
),
] | 13 | 0.448276 | 12 | 1 |
0e3649b65ef7d3554aafe5e2ea8e973a3881ef93 | Egmont-plugin.sketchplugin/Contents/Sketch/manifest.json | Egmont-plugin.sketchplugin/Contents/Sketch/manifest.json | {
"author" : "Interface.Market",
"authorEmail" : "h@interface.market",
"name" : "Egmont Plugin",
"description" : "Plugin for create curvature continuity corners.",
"version" : "1",
"commands" : [
{
"name" : "Egmont plugin",
"shortcut" : "cmd ctrl g",
"identifier" : "Egmont plugin",
"script" : "EgmontPlugin.js",
"handler" : "onRun"
}
],
"menu": {
"isRoot": true,
"items": [
"Egmont plugin"
]
},
"developer" : "Gleb Husky",
"developerEmail" : "nameisgleb@gmail.com",
"identifier" : "com.glebhusky.EgmontPlugin",
}
| {
"author" : "Interface.Market",
"authorEmail" : "h@interface.market",
"name" : "Egmont Plugin",
"description" : "Plugin for create curvature continuity corners.",
"version" : "1",
"commands" : [
{
"name" : "Egmont plugin",
"shortcut" : "cmd ctrl g",
"identifier" : "Egmont plugin",
"script" : "EgmontPlugin.js",
"handler" : "onRun"
}
],
"menu": {
"isRoot": true,
"items": [
"Egmont plugin"
]
},
"developer" : "Gleb Husky",
"developerEmail" : "nameisgleb@gmail.com",
"identifier" : "com.glebhusky.EgmontPlugin",
"appcast": "https://api.sketchpacks.com/v1/plugins/com.glebhusky.EgmontPlugin/appcast"
}
| Add support for native Sketch plugin updates | Add support for native Sketch plugin updates
Resolves #3
Further reading: https://docs.sketchpacks.com/developers/publishing/providing-plugin-updates.html | JSON | mit | interfacemarket/Egmont-plugin | json | ## Code Before:
{
"author" : "Interface.Market",
"authorEmail" : "h@interface.market",
"name" : "Egmont Plugin",
"description" : "Plugin for create curvature continuity corners.",
"version" : "1",
"commands" : [
{
"name" : "Egmont plugin",
"shortcut" : "cmd ctrl g",
"identifier" : "Egmont plugin",
"script" : "EgmontPlugin.js",
"handler" : "onRun"
}
],
"menu": {
"isRoot": true,
"items": [
"Egmont plugin"
]
},
"developer" : "Gleb Husky",
"developerEmail" : "nameisgleb@gmail.com",
"identifier" : "com.glebhusky.EgmontPlugin",
}
## Instruction:
Add support for native Sketch plugin updates
Resolves #3
Further reading: https://docs.sketchpacks.com/developers/publishing/providing-plugin-updates.html
## Code After:
{
"author" : "Interface.Market",
"authorEmail" : "h@interface.market",
"name" : "Egmont Plugin",
"description" : "Plugin for create curvature continuity corners.",
"version" : "1",
"commands" : [
{
"name" : "Egmont plugin",
"shortcut" : "cmd ctrl g",
"identifier" : "Egmont plugin",
"script" : "EgmontPlugin.js",
"handler" : "onRun"
}
],
"menu": {
"isRoot": true,
"items": [
"Egmont plugin"
]
},
"developer" : "Gleb Husky",
"developerEmail" : "nameisgleb@gmail.com",
"identifier" : "com.glebhusky.EgmontPlugin",
"appcast": "https://api.sketchpacks.com/v1/plugins/com.glebhusky.EgmontPlugin/appcast"
}
| {
"author" : "Interface.Market",
"authorEmail" : "h@interface.market",
"name" : "Egmont Plugin",
"description" : "Plugin for create curvature continuity corners.",
"version" : "1",
"commands" : [
{
"name" : "Egmont plugin",
"shortcut" : "cmd ctrl g",
"identifier" : "Egmont plugin",
"script" : "EgmontPlugin.js",
"handler" : "onRun"
}
],
"menu": {
"isRoot": true,
"items": [
"Egmont plugin"
]
},
"developer" : "Gleb Husky",
"developerEmail" : "nameisgleb@gmail.com",
"identifier" : "com.glebhusky.EgmontPlugin",
+ "appcast": "https://api.sketchpacks.com/v1/plugins/com.glebhusky.EgmontPlugin/appcast"
} | 1 | 0.034483 | 1 | 0 |
1abcc57d80de71aff75abfbbeab25db9908ef208 | src/app/select/select.scss | src/app/select/select.scss | .btn-mode {
max-width: 100%;
}
.modebg {
background-color: $color-yellowgray;
}
.mode-title {
color: $color-brown;
}
.mode-box {
color:$color-brown;
background-color: $color-gold;
border: 4px solid $color-brown;
padding: 20px;
border-radius: 12px;
margin-bottom: 15px;
}
.mode-box:hover {
color: $color-white;
background-color: $color-brown;
}
.mode-box-image {
max-width: 300px;
width: 100%;
border: solid 2px $color-brown;
}
.mode-label {
font-weight:400;
font-style: italic;
}
.mode-description {
max-width: 300px;
}
.modefloatRight {
float: right;
}
.modefloatLeft {
float: left;
}
.mode-pad {
padding-left: 5px;
padding-right: 5px;
}
@media screen and (max-width: 992px) {
.modefloatRight,
.modefloatLeft {
float: none;
}
.mode-pad {
padding: inherit;
}
}
| .btn-mode {
max-width: 100%;
}
.modebg {
background-color: $color-yellowgray;
}
.mode-title {
color: $color-brown;
}
.mode-box {
color:$color-brown;
background-color: $color-gold;
border: 4px solid $color-brown;
padding: 20px;
border-radius: 12px;
margin-bottom: 15px;
}
.mode-box:hover {
color: $color-white;
background-color: $color-brown;
}
.mode-box-image {
max-width: 300px;
width: 100%;
border: solid 2px $color-brown;
}
.mode-box:active, {
color: $color-white;
background-color: $color-red;
}
.mode-label {
font-weight:400;
font-style: italic;
}
.mode-description {
max-width: 300px;
}
.modefloatRight {
float: right;
}
.modefloatLeft {
float: left;
}
.mode-pad {
padding-left: 5px;
padding-right: 5px;
}
@media screen and (max-width: 992px) {
.modefloatRight,
.modefloatLeft {
float: none;
}
.mode-pad {
padding: inherit;
}
}
| Change style when button is clicked | Change style when button is clicked
| SCSS | mit | hendryl/Famous-Places-Web,hendryl/Famous-Places-Web | scss | ## Code Before:
.btn-mode {
max-width: 100%;
}
.modebg {
background-color: $color-yellowgray;
}
.mode-title {
color: $color-brown;
}
.mode-box {
color:$color-brown;
background-color: $color-gold;
border: 4px solid $color-brown;
padding: 20px;
border-radius: 12px;
margin-bottom: 15px;
}
.mode-box:hover {
color: $color-white;
background-color: $color-brown;
}
.mode-box-image {
max-width: 300px;
width: 100%;
border: solid 2px $color-brown;
}
.mode-label {
font-weight:400;
font-style: italic;
}
.mode-description {
max-width: 300px;
}
.modefloatRight {
float: right;
}
.modefloatLeft {
float: left;
}
.mode-pad {
padding-left: 5px;
padding-right: 5px;
}
@media screen and (max-width: 992px) {
.modefloatRight,
.modefloatLeft {
float: none;
}
.mode-pad {
padding: inherit;
}
}
## Instruction:
Change style when button is clicked
## Code After:
.btn-mode {
max-width: 100%;
}
.modebg {
background-color: $color-yellowgray;
}
.mode-title {
color: $color-brown;
}
.mode-box {
color:$color-brown;
background-color: $color-gold;
border: 4px solid $color-brown;
padding: 20px;
border-radius: 12px;
margin-bottom: 15px;
}
.mode-box:hover {
color: $color-white;
background-color: $color-brown;
}
.mode-box-image {
max-width: 300px;
width: 100%;
border: solid 2px $color-brown;
}
.mode-box:active, {
color: $color-white;
background-color: $color-red;
}
.mode-label {
font-weight:400;
font-style: italic;
}
.mode-description {
max-width: 300px;
}
.modefloatRight {
float: right;
}
.modefloatLeft {
float: left;
}
.mode-pad {
padding-left: 5px;
padding-right: 5px;
}
@media screen and (max-width: 992px) {
.modefloatRight,
.modefloatLeft {
float: none;
}
.mode-pad {
padding: inherit;
}
}
| .btn-mode {
max-width: 100%;
}
.modebg {
background-color: $color-yellowgray;
}
.mode-title {
color: $color-brown;
}
.mode-box {
color:$color-brown;
background-color: $color-gold;
border: 4px solid $color-brown;
padding: 20px;
border-radius: 12px;
margin-bottom: 15px;
}
.mode-box:hover {
color: $color-white;
background-color: $color-brown;
}
.mode-box-image {
max-width: 300px;
width: 100%;
border: solid 2px $color-brown;
+ }
+
+ .mode-box:active, {
+ color: $color-white;
+ background-color: $color-red;
}
.mode-label {
font-weight:400;
font-style: italic;
}
.mode-description {
max-width: 300px;
}
.modefloatRight {
float: right;
}
.modefloatLeft {
float: left;
}
.mode-pad {
padding-left: 5px;
padding-right: 5px;
}
@media screen and (max-width: 992px) {
.modefloatRight,
.modefloatLeft {
float: none;
}
.mode-pad {
padding: inherit;
}
} | 5 | 0.078125 | 5 | 0 |
6c1566c2016ec8cea4a8c328934576536ccc3f21 | concrete/controllers/single_page/members/profile.php | concrete/controllers/single_page/members/profile.php | <?php
namespace Concrete\Controller\SinglePage\Members;
use Concrete\Core\Page\Controller\PublicProfilePageController;
use Loader;
use User;
use UserInfo;
use Exception;
class Profile extends PublicProfilePageController
{
public function view($userID = 0)
{
$html = Loader::helper('html');
$canEdit = false;
$u = new User();
if ($userID > 0) {
$profile = UserInfo::getByID($userID);
if (!is_object($profile)) {
throw new Exception('Invalid User ID.');
}
} elseif ($u->isRegistered()) {
$profile = UserInfo::getByID($u->getUserID());
} else {
$this->set('intro_msg', t('You must sign in order to access this page!'));
return $this->replace('/login');
}
if (is_object($profile) && $profile->getUserID() == $u->getUserID()) {
$canEdit = true;
}
$this->set('profile', $profile);
$this->set('badges', $profile->getUserBadges());
$this->set('av', Loader::helper('concrete/avatar'));
$this->set('t', Loader::helper('text'));
$this->set('canEdit', $canEdit);
}
}
| <?php
namespace Concrete\Controller\SinglePage\Members;
use Concrete\Core\Page\Controller\PublicProfilePageController;
use Loader;
use User;
use UserInfo;
use Exception;
class Profile extends PublicProfilePageController
{
public function view($userID = 0)
{
$html = Loader::helper('html');
$canEdit = false;
$u = new User();
if ($userID > 0) {
$profile = UserInfo::getByID($userID);
if (!is_object($profile)) {
return $this->replace('/page_not_found');
}
} elseif ($u->isRegistered()) {
$profile = UserInfo::getByID($u->getUserID());
} else {
$this->set('intro_msg', t('You must sign in order to access this page!'));
return $this->replace('/login');
}
if (is_object($profile) && $profile->getUserID() == $u->getUserID()) {
$canEdit = true;
}
$this->set('profile', $profile);
$this->set('badges', $profile->getUserBadges());
$this->set('av', Loader::helper('concrete/avatar'));
$this->set('t', Loader::helper('text'));
$this->set('canEdit', $canEdit);
}
}
| Fix to show 404 for deleted user | Fix to show 404 for deleted user
| PHP | mit | mainio/concrete5,concrete5/concrete5,triplei/concrete5-8,MrKarlDilkington/concrete5,rikzuiderlicht/concrete5,concrete5/concrete5,olsgreen/concrete5,jaromirdalecky/concrete5,haeflimi/concrete5,biplobice/concrete5,mlocati/concrete5,mainio/concrete5,mainio/concrete5,olsgreen/concrete5,biplobice/concrete5,mlocati/concrete5,hissy/concrete5,olsgreen/concrete5,jaromirdalecky/concrete5,biplobice/concrete5,rikzuiderlicht/concrete5,haeflimi/concrete5,concrete5/concrete5,deek87/concrete5,deek87/concrete5,concrete5/concrete5,triplei/concrete5-8,a3020/concrete5,jaromirdalecky/concrete5,triplei/concrete5-8,hissy/concrete5,hissy/concrete5,haeflimi/concrete5,rikzuiderlicht/concrete5,haeflimi/concrete5,hissy/concrete5,mlocati/concrete5,MrKarlDilkington/concrete5,mlocati/concrete5,deek87/concrete5,a3020/concrete5,deek87/concrete5,biplobice/concrete5,MrKarlDilkington/concrete5,jaromirdalecky/concrete5 | php | ## Code Before:
<?php
namespace Concrete\Controller\SinglePage\Members;
use Concrete\Core\Page\Controller\PublicProfilePageController;
use Loader;
use User;
use UserInfo;
use Exception;
class Profile extends PublicProfilePageController
{
public function view($userID = 0)
{
$html = Loader::helper('html');
$canEdit = false;
$u = new User();
if ($userID > 0) {
$profile = UserInfo::getByID($userID);
if (!is_object($profile)) {
throw new Exception('Invalid User ID.');
}
} elseif ($u->isRegistered()) {
$profile = UserInfo::getByID($u->getUserID());
} else {
$this->set('intro_msg', t('You must sign in order to access this page!'));
return $this->replace('/login');
}
if (is_object($profile) && $profile->getUserID() == $u->getUserID()) {
$canEdit = true;
}
$this->set('profile', $profile);
$this->set('badges', $profile->getUserBadges());
$this->set('av', Loader::helper('concrete/avatar'));
$this->set('t', Loader::helper('text'));
$this->set('canEdit', $canEdit);
}
}
## Instruction:
Fix to show 404 for deleted user
## Code After:
<?php
namespace Concrete\Controller\SinglePage\Members;
use Concrete\Core\Page\Controller\PublicProfilePageController;
use Loader;
use User;
use UserInfo;
use Exception;
class Profile extends PublicProfilePageController
{
public function view($userID = 0)
{
$html = Loader::helper('html');
$canEdit = false;
$u = new User();
if ($userID > 0) {
$profile = UserInfo::getByID($userID);
if (!is_object($profile)) {
return $this->replace('/page_not_found');
}
} elseif ($u->isRegistered()) {
$profile = UserInfo::getByID($u->getUserID());
} else {
$this->set('intro_msg', t('You must sign in order to access this page!'));
return $this->replace('/login');
}
if (is_object($profile) && $profile->getUserID() == $u->getUserID()) {
$canEdit = true;
}
$this->set('profile', $profile);
$this->set('badges', $profile->getUserBadges());
$this->set('av', Loader::helper('concrete/avatar'));
$this->set('t', Loader::helper('text'));
$this->set('canEdit', $canEdit);
}
}
| <?php
namespace Concrete\Controller\SinglePage\Members;
use Concrete\Core\Page\Controller\PublicProfilePageController;
use Loader;
use User;
use UserInfo;
use Exception;
class Profile extends PublicProfilePageController
{
public function view($userID = 0)
{
$html = Loader::helper('html');
$canEdit = false;
$u = new User();
if ($userID > 0) {
$profile = UserInfo::getByID($userID);
if (!is_object($profile)) {
- throw new Exception('Invalid User ID.');
+ return $this->replace('/page_not_found');
}
} elseif ($u->isRegistered()) {
$profile = UserInfo::getByID($u->getUserID());
} else {
$this->set('intro_msg', t('You must sign in order to access this page!'));
return $this->replace('/login');
}
if (is_object($profile) && $profile->getUserID() == $u->getUserID()) {
$canEdit = true;
}
$this->set('profile', $profile);
$this->set('badges', $profile->getUserBadges());
$this->set('av', Loader::helper('concrete/avatar'));
$this->set('t', Loader::helper('text'));
$this->set('canEdit', $canEdit);
}
} | 2 | 0.051282 | 1 | 1 |
6b4f426dc1c181611d4728e9567b37c7802f15f1 | lib/cpp/dxjson/make_standard_lib.sh | lib/cpp/dxjson/make_standard_lib.sh |
root=`dirname "$0"`
cd $root
make clean
cmake .
make
(ls /usr/local/lib >/dev/null 2>/dev/null) || sudo mkdir /usr/local/lib
sudo cp libdxjson.a /usr/local/lib/
(ls /usr/local/include/dxjson >/dev/null 2>/dev/null) || sudo mkdir /usr/local/include/dxjson
sudo cp dxjson.h /usr/local/include/dxjson
sudo cp -R utf8 /usr/local/include/dxjson
|
root=`dirname "$0"`
cd $root
mkdir build
cd build
make clean
cmake ..
make
(ls /usr/local/lib >/dev/null 2>/dev/null) || sudo mkdir /usr/local/lib
sudo cp libdxjson.a /usr/local/lib/
(ls /usr/local/include/dxjson >/dev/null 2>/dev/null) || sudo mkdir /usr/local/include/dxjson
sudo cp dxjson.h /usr/local/include/dxjson
sudo cp -R utf8 /usr/local/include/dxjson
| Build dxjson library in a subdirectory. | Build dxjson library in a subdirectory.
| Shell | apache-2.0 | andyshinn/dx-toolkit,johnwallace123/dx-toolkit,olegnev/dx-toolkit,jhuttner/dx-toolkit,olegnev/dx-toolkit,andyshinn/dx-toolkit,olegnev/dx-toolkit,andyshinn/dx-toolkit,johnwallace123/dx-toolkit,jhuttner/dx-toolkit,jhuttner/dx-toolkit,olegnev/dx-toolkit,jhuttner/dx-toolkit,jhuttner/dx-toolkit,dnanexus/dx-toolkit,johnwallace123/dx-toolkit,olegnev/dx-toolkit,olegnev/dx-toolkit,andyshinn/dx-toolkit,jhuttner/dx-toolkit,johnwallace123/dx-toolkit,andyshinn/dx-toolkit,jhuttner/dx-toolkit,dnanexus/dx-toolkit,dnanexus/dx-toolkit,andyshinn/dx-toolkit,olegnev/dx-toolkit,johnwallace123/dx-toolkit,dnanexus/dx-toolkit,johnwallace123/dx-toolkit,dnanexus/dx-toolkit,olegnev/dx-toolkit,andyshinn/dx-toolkit,johnwallace123/dx-toolkit,dnanexus/dx-toolkit,dnanexus/dx-toolkit,dnanexus/dx-toolkit,jhuttner/dx-toolkit,andyshinn/dx-toolkit,johnwallace123/dx-toolkit | shell | ## Code Before:
root=`dirname "$0"`
cd $root
make clean
cmake .
make
(ls /usr/local/lib >/dev/null 2>/dev/null) || sudo mkdir /usr/local/lib
sudo cp libdxjson.a /usr/local/lib/
(ls /usr/local/include/dxjson >/dev/null 2>/dev/null) || sudo mkdir /usr/local/include/dxjson
sudo cp dxjson.h /usr/local/include/dxjson
sudo cp -R utf8 /usr/local/include/dxjson
## Instruction:
Build dxjson library in a subdirectory.
## Code After:
root=`dirname "$0"`
cd $root
mkdir build
cd build
make clean
cmake ..
make
(ls /usr/local/lib >/dev/null 2>/dev/null) || sudo mkdir /usr/local/lib
sudo cp libdxjson.a /usr/local/lib/
(ls /usr/local/include/dxjson >/dev/null 2>/dev/null) || sudo mkdir /usr/local/include/dxjson
sudo cp dxjson.h /usr/local/include/dxjson
sudo cp -R utf8 /usr/local/include/dxjson
|
root=`dirname "$0"`
cd $root
+ mkdir build
+ cd build
make clean
- cmake .
+ cmake ..
? +
make
(ls /usr/local/lib >/dev/null 2>/dev/null) || sudo mkdir /usr/local/lib
sudo cp libdxjson.a /usr/local/lib/
(ls /usr/local/include/dxjson >/dev/null 2>/dev/null) || sudo mkdir /usr/local/include/dxjson
sudo cp dxjson.h /usr/local/include/dxjson
sudo cp -R utf8 /usr/local/include/dxjson | 4 | 0.307692 | 3 | 1 |
db4ccce9e418a1227532bde8834ca682bc873609 | system/t04_mirror/show.py | system/t04_mirror/show.py | from lib import BaseTest
class ShowMirror1Test(BaseTest):
"""
show mirror: regular mirror
"""
fixtureCmds = ["aptly mirror create mirror1 http://mirror.yandex.ru/debian/ wheezy"]
runCmd = "aptly mirror show mirror1"
class ShowMirror2Test(BaseTest):
"""
show mirror: missing mirror
"""
runCmd = "aptly mirror show mirror-xx"
expectedCode = 1
class ShowMirror3Test(BaseTest):
"""
show mirror: regular mirror with packages
"""
fixtureDB = True
runCmd = "aptly mirror show --with-packages wheezy-contrib"
| from lib import BaseTest
import re
class ShowMirror1Test(BaseTest):
"""
show mirror: regular mirror
"""
fixtureCmds = ["aptly mirror create mirror1 http://mirror.yandex.ru/debian/ wheezy"]
runCmd = "aptly mirror show mirror1"
class ShowMirror2Test(BaseTest):
"""
show mirror: missing mirror
"""
runCmd = "aptly mirror show mirror-xx"
expectedCode = 1
class ShowMirror3Test(BaseTest):
"""
show mirror: regular mirror with packages
"""
fixtureDB = True
runCmd = "aptly mirror show --with-packages wheezy-contrib"
outputMatchPrepare = lambda _, s: re.sub(r"Last update: [0-9:A-Za-z -]+\n", "", s)
| Remove updated at while comparing. | Remove updated at while comparing.
| Python | mit | gearmover/aptly,bsundsrud/aptly,adfinis-forks/aptly,vincentbernat/aptly,gdbdzgd/aptly,ceocoder/aptly,adfinis-forks/aptly,seaninspace/aptly,neolynx/aptly,scalp42/aptly,gdbdzgd/aptly,sobczyk/aptly,neolynx/aptly,scalp42/aptly,aptly-dev/aptly,seaninspace/aptly,aptly-dev/aptly,bsundsrud/aptly,gdbdzgd/aptly,bankonme/aptly,adfinis-forks/aptly,sobczyk/aptly,seaninspace/aptly,vincentbernat/aptly,smira/aptly,jola5/aptly,scalp42/aptly,smira/aptly,ceocoder/aptly,gearmover/aptly,bankonme/aptly,bsundsrud/aptly,vincentbernat/aptly,ceocoder/aptly,jola5/aptly,jola5/aptly,aptly-dev/aptly,gearmover/aptly,sobczyk/aptly,neolynx/aptly,smira/aptly,bankonme/aptly | python | ## Code Before:
from lib import BaseTest
class ShowMirror1Test(BaseTest):
"""
show mirror: regular mirror
"""
fixtureCmds = ["aptly mirror create mirror1 http://mirror.yandex.ru/debian/ wheezy"]
runCmd = "aptly mirror show mirror1"
class ShowMirror2Test(BaseTest):
"""
show mirror: missing mirror
"""
runCmd = "aptly mirror show mirror-xx"
expectedCode = 1
class ShowMirror3Test(BaseTest):
"""
show mirror: regular mirror with packages
"""
fixtureDB = True
runCmd = "aptly mirror show --with-packages wheezy-contrib"
## Instruction:
Remove updated at while comparing.
## Code After:
from lib import BaseTest
import re
class ShowMirror1Test(BaseTest):
"""
show mirror: regular mirror
"""
fixtureCmds = ["aptly mirror create mirror1 http://mirror.yandex.ru/debian/ wheezy"]
runCmd = "aptly mirror show mirror1"
class ShowMirror2Test(BaseTest):
"""
show mirror: missing mirror
"""
runCmd = "aptly mirror show mirror-xx"
expectedCode = 1
class ShowMirror3Test(BaseTest):
"""
show mirror: regular mirror with packages
"""
fixtureDB = True
runCmd = "aptly mirror show --with-packages wheezy-contrib"
outputMatchPrepare = lambda _, s: re.sub(r"Last update: [0-9:A-Za-z -]+\n", "", s)
| from lib import BaseTest
+ import re
class ShowMirror1Test(BaseTest):
"""
show mirror: regular mirror
"""
fixtureCmds = ["aptly mirror create mirror1 http://mirror.yandex.ru/debian/ wheezy"]
runCmd = "aptly mirror show mirror1"
class ShowMirror2Test(BaseTest):
"""
show mirror: missing mirror
"""
runCmd = "aptly mirror show mirror-xx"
expectedCode = 1
class ShowMirror3Test(BaseTest):
"""
show mirror: regular mirror with packages
"""
fixtureDB = True
runCmd = "aptly mirror show --with-packages wheezy-contrib"
+ outputMatchPrepare = lambda _, s: re.sub(r"Last update: [0-9:A-Za-z -]+\n", "", s) | 2 | 0.08 | 2 | 0 |
d765eaa608ff1b12423d65c447a27d65eec38988 | setup.py | setup.py |
from setuptools import setup
from distutils.extension import Extension
from Pyrex.Distutils import build_ext
setup(
name="PyMoira",
version="4.3.1",
description="PyMoira - Python bindings for the Athena Moira library",
author="Evan Broder",
author_email="broder@mit.edu",
license="MIT",
py_modules=['moira'],
ext_modules=[
Extension("_moira",
["_moira.pyx"],
libraries=["moira", "krb5"]),
Extension("mrclient",
["mrclient.pyx"],
libraries=["mrclient", "moira"]),
],
scripts=['qy'],
cmdclass= {"build_ext": build_ext}
)
|
from setuptools import setup
from distutils.extension import Extension
from Pyrex.Distutils import build_ext
setup(
name="PyMoira",
version="4.3.2",
description="PyMoira - Python bindings for the Athena Moira library",
author="Evan Broder",
author_email="broder@mit.edu",
license="MIT",
py_modules=['moira'],
ext_modules=[
Extension("_moira",
["_moira.pyx"],
libraries=["moira", "krb5"]),
Extension("mrclient",
["mrclient.pyx"],
libraries=["mrclient", "moira"]),
],
cmdclass= {"build_ext": build_ext}
)
| Stop shipping qy with python-moira | Stop shipping qy with python-moira
Moira now provides with its own native qy.
| Python | mit | mit-athena/python-moira | python | ## Code Before:
from setuptools import setup
from distutils.extension import Extension
from Pyrex.Distutils import build_ext
setup(
name="PyMoira",
version="4.3.1",
description="PyMoira - Python bindings for the Athena Moira library",
author="Evan Broder",
author_email="broder@mit.edu",
license="MIT",
py_modules=['moira'],
ext_modules=[
Extension("_moira",
["_moira.pyx"],
libraries=["moira", "krb5"]),
Extension("mrclient",
["mrclient.pyx"],
libraries=["mrclient", "moira"]),
],
scripts=['qy'],
cmdclass= {"build_ext": build_ext}
)
## Instruction:
Stop shipping qy with python-moira
Moira now provides with its own native qy.
## Code After:
from setuptools import setup
from distutils.extension import Extension
from Pyrex.Distutils import build_ext
setup(
name="PyMoira",
version="4.3.2",
description="PyMoira - Python bindings for the Athena Moira library",
author="Evan Broder",
author_email="broder@mit.edu",
license="MIT",
py_modules=['moira'],
ext_modules=[
Extension("_moira",
["_moira.pyx"],
libraries=["moira", "krb5"]),
Extension("mrclient",
["mrclient.pyx"],
libraries=["mrclient", "moira"]),
],
cmdclass= {"build_ext": build_ext}
)
|
from setuptools import setup
from distutils.extension import Extension
from Pyrex.Distutils import build_ext
setup(
name="PyMoira",
- version="4.3.1",
? ^
+ version="4.3.2",
? ^
description="PyMoira - Python bindings for the Athena Moira library",
author="Evan Broder",
author_email="broder@mit.edu",
license="MIT",
py_modules=['moira'],
ext_modules=[
Extension("_moira",
["_moira.pyx"],
libraries=["moira", "krb5"]),
Extension("mrclient",
["mrclient.pyx"],
libraries=["mrclient", "moira"]),
],
- scripts=['qy'],
cmdclass= {"build_ext": build_ext}
) | 3 | 0.125 | 1 | 2 |
9246ab1ba7fec9f9d5a7a363888f07122625d870 | src/Turanct/Shack.php | src/Turanct/Shack.php | <?php
namespace Turanct;
use Turanct\Shack\Sha;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
final class Shack implements HttpKernelInterface
{
private $app;
private $sha;
public function __construct(HttpKernelInterface $app, Sha $sha)
{
$this->app = $app;
$this->sha = $sha;
}
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
$response = $this->app->handle($request, $type, $catch);
$sha = $this->sha->get();
if (!empty($sha)) {
$response->headers->set('X-Shack-Sha', $sha);
}
return $response;
}
}
| <?php
namespace Turanct;
use Turanct\Shack\Sha;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
final class Shack implements HttpKernelInterface
{
private $app;
private $sha;
private $addStamp;
public function __construct(HttpKernelInterface $app, Sha $sha, $addStamp = true)
{
$this->app = $app;
$this->sha = $sha;
$this->addStamp = (bool) $addStamp;
}
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
$response = $this->app->handle($request, $type, $catch);
$sha = $this->sha->get();
if (!empty($sha)) {
$response->headers->set('X-Shack-Sha', $sha);
if (
$this->addStamp === true
&& stristr($response->headers->get('Content-Type'), 'text/html')
) {
$body = $response->getContent();
$body = str_replace('</body>', $this->getStamp($sha) . '</body>', $body);
$response->setContent($body);
}
}
return $response;
}
private function getStamp($sha = '')
{
return '<div id="sha-stamp" style="position: fixed; bottom: 0; right: 0; height: 16px; background: rgb(0, 0, 0) transparent; background-color: rgba(0, 0, 0, 0.2); padding: 0 5px; border-top-left-radius: 5px;">
<span style="text-align: center;">
<small style="color: white; font-weight: normal;font-size: 12px;">' . $sha . '</small>
</span>
</div>';
}
}
| Add the html stamp showing the sha on html pages | Add the html stamp showing the sha on html pages
| PHP | mit | turanct/shack | php | ## Code Before:
<?php
namespace Turanct;
use Turanct\Shack\Sha;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
final class Shack implements HttpKernelInterface
{
private $app;
private $sha;
public function __construct(HttpKernelInterface $app, Sha $sha)
{
$this->app = $app;
$this->sha = $sha;
}
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
$response = $this->app->handle($request, $type, $catch);
$sha = $this->sha->get();
if (!empty($sha)) {
$response->headers->set('X-Shack-Sha', $sha);
}
return $response;
}
}
## Instruction:
Add the html stamp showing the sha on html pages
## Code After:
<?php
namespace Turanct;
use Turanct\Shack\Sha;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
final class Shack implements HttpKernelInterface
{
private $app;
private $sha;
private $addStamp;
public function __construct(HttpKernelInterface $app, Sha $sha, $addStamp = true)
{
$this->app = $app;
$this->sha = $sha;
$this->addStamp = (bool) $addStamp;
}
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
$response = $this->app->handle($request, $type, $catch);
$sha = $this->sha->get();
if (!empty($sha)) {
$response->headers->set('X-Shack-Sha', $sha);
if (
$this->addStamp === true
&& stristr($response->headers->get('Content-Type'), 'text/html')
) {
$body = $response->getContent();
$body = str_replace('</body>', $this->getStamp($sha) . '</body>', $body);
$response->setContent($body);
}
}
return $response;
}
private function getStamp($sha = '')
{
return '<div id="sha-stamp" style="position: fixed; bottom: 0; right: 0; height: 16px; background: rgb(0, 0, 0) transparent; background-color: rgba(0, 0, 0, 0.2); padding: 0 5px; border-top-left-radius: 5px;">
<span style="text-align: center;">
<small style="color: white; font-weight: normal;font-size: 12px;">' . $sha . '</small>
</span>
</div>';
}
}
| <?php
namespace Turanct;
use Turanct\Shack\Sha;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
final class Shack implements HttpKernelInterface
{
private $app;
private $sha;
+ private $addStamp;
- public function __construct(HttpKernelInterface $app, Sha $sha)
+ public function __construct(HttpKernelInterface $app, Sha $sha, $addStamp = true)
? ++++++++++++++++++
{
$this->app = $app;
$this->sha = $sha;
+ $this->addStamp = (bool) $addStamp;
}
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
$response = $this->app->handle($request, $type, $catch);
$sha = $this->sha->get();
if (!empty($sha)) {
$response->headers->set('X-Shack-Sha', $sha);
+
+ if (
+ $this->addStamp === true
+ && stristr($response->headers->get('Content-Type'), 'text/html')
+ ) {
+ $body = $response->getContent();
+ $body = str_replace('</body>', $this->getStamp($sha) . '</body>', $body);
+ $response->setContent($body);
+ }
}
return $response;
}
+
+ private function getStamp($sha = '')
+ {
+ return '<div id="sha-stamp" style="position: fixed; bottom: 0; right: 0; height: 16px; background: rgb(0, 0, 0) transparent; background-color: rgba(0, 0, 0, 0.2); padding: 0 5px; border-top-left-radius: 5px;">
+ <span style="text-align: center;">
+ <small style="color: white; font-weight: normal;font-size: 12px;">' . $sha . '</small>
+ </span>
+ </div>';
+ }
} | 22 | 0.666667 | 21 | 1 |
ab1bfba776a034c3a1072d5be73f7f677376b30a | .travis.yml | .travis.yml | sudo: false
dist: trusty
language: node_js
node_js:
- 6
stages:
- test
- deploy
env:
- TEST_SUITE=main
- TEST_SUITE=tz TZ_LENGTH=2 TZ_INDEX=0
- TEST_SUITE=tz TZ_LENGTH=2 TZ_INDEX=1
before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
branches:
only:
- master
- "/v\\d+\\.\\d+\\.\\d+(-\\w+)?/"
script:
- ./scripts/test/travis.sh
jobs:
include:
- stage: deploy
if: branch = master AND tag IS present
script: ./scripts/release/release.sh
cache: yarn
addons:
sauce_connect: true
| sudo: false
dist: trusty
language: node_js
node_js:
- 6
stages:
- test
- deploy
env:
- TEST_SUITE=main
- TEST_SUITE=tz TZ_LENGTH=2 TZ_INDEX=0
- TEST_SUITE=tz TZ_LENGTH=2 TZ_INDEX=1
before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
branches:
only:
- master
- "/v\\d+\\.\\d+\\.\\d+(-\\w+)?/"
script:
- ./scripts/test/travis.sh
jobs:
include:
- stage: deploy
if: tag IS present
script: ./scripts/release/release.sh
cache: yarn
addons:
sauce_connect: true
| Simplify Travis CI deploy stage condition | Simplify Travis CI deploy stage condition
| YAML | mit | date-fns/date-fns,date-fns/date-fns,js-fns/date-fns,js-fns/date-fns,date-fns/date-fns | yaml | ## Code Before:
sudo: false
dist: trusty
language: node_js
node_js:
- 6
stages:
- test
- deploy
env:
- TEST_SUITE=main
- TEST_SUITE=tz TZ_LENGTH=2 TZ_INDEX=0
- TEST_SUITE=tz TZ_LENGTH=2 TZ_INDEX=1
before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
branches:
only:
- master
- "/v\\d+\\.\\d+\\.\\d+(-\\w+)?/"
script:
- ./scripts/test/travis.sh
jobs:
include:
- stage: deploy
if: branch = master AND tag IS present
script: ./scripts/release/release.sh
cache: yarn
addons:
sauce_connect: true
## Instruction:
Simplify Travis CI deploy stage condition
## Code After:
sudo: false
dist: trusty
language: node_js
node_js:
- 6
stages:
- test
- deploy
env:
- TEST_SUITE=main
- TEST_SUITE=tz TZ_LENGTH=2 TZ_INDEX=0
- TEST_SUITE=tz TZ_LENGTH=2 TZ_INDEX=1
before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
branches:
only:
- master
- "/v\\d+\\.\\d+\\.\\d+(-\\w+)?/"
script:
- ./scripts/test/travis.sh
jobs:
include:
- stage: deploy
if: tag IS present
script: ./scripts/release/release.sh
cache: yarn
addons:
sauce_connect: true
| sudo: false
dist: trusty
language: node_js
node_js:
- 6
stages:
- test
- deploy
env:
- TEST_SUITE=main
- TEST_SUITE=tz TZ_LENGTH=2 TZ_INDEX=0
- TEST_SUITE=tz TZ_LENGTH=2 TZ_INDEX=1
before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
branches:
only:
- master
- "/v\\d+\\.\\d+\\.\\d+(-\\w+)?/"
script:
- ./scripts/test/travis.sh
jobs:
include:
- stage: deploy
- if: branch = master AND tag IS present
+ if: tag IS present
script: ./scripts/release/release.sh
cache: yarn
addons:
sauce_connect: true | 2 | 0.052632 | 1 | 1 |
0b751949ae0eec80e3af0c9bd00744b7cd6107e0 | homeassistant/components/frontend/www_static/polymer/components/ha-notifications.html | homeassistant/components/frontend/www_static/polymer/components/ha-notifications.html | <link rel="import" href="../bower_components/polymer/polymer.html">
<link rel="import" href="../bower_components/paper-toast/paper-toast.html">
<polymer-element name="ha-notifications">
<template>
<paper-toast id="toast" role="alert" text=""></paper-toast>
</template>
<script>
var storeListenerMixIn = window.hass.storeListenerMixIn;
Polymer(Polymer.mixin({
lastId: null,
attached: function() {
this.listenToStores(true);
},
detached: function() {
this.stopListeningToStores();
},
notificationStoreChanged: function(notificationStore) {
if (notificationStore.hasNewNotifications(this.lastId)) {
var toast = this.$.toast;
var notification = notificationStore.lastNotification;
this.lastId = notification.id;
toast.text = notification.message;
toast.show();
}
},
}, storeListenerMixIn));
</script>
</polymer-element>
| <link rel="import" href="../bower_components/polymer/polymer.html">
<link rel="import" href="../bower_components/paper-toast/paper-toast.html">
<polymer-element name="ha-notifications">
<template>
<paper-toast id="toast" role="alert" text=""></paper-toast>
</template>
<script>
var storeListenerMixIn = window.hass.storeListenerMixIn;
Polymer(Polymer.mixin({
lastId: null,
attached: function() {
this.listenToStores(true);
},
detached: function() {
this.stopListeningToStores();
},
notificationStoreChanged: function(notificationStore) {
if (notificationStore.hasNewNotifications(this.lastId)) {
var toast = this.$.toast;
var notification = notificationStore.lastNotification;
if (notification) {
this.lastId = notification.id;
toast.text = notification.message;
toast.show();
}
}
},
}, storeListenerMixIn));
</script>
</polymer-element>
| Fix JS notification error on initialization. | Fix JS notification error on initialization.
The last notification is initially null resulting in an exception being
thrown on startup.
| HTML | apache-2.0 | FreekingDean/home-assistant,robbiet480/home-assistant,joopert/home-assistant,bdfoster/blumate,sanmiguel/home-assistant,deisi/home-assistant,dmeulen/home-assistant,shaftoe/home-assistant,teodoc/home-assistant,partofthething/home-assistant,LinuxChristian/home-assistant,happyleavesaoc/home-assistant,keerts/home-assistant,Theb-1/home-assistant,varunr047/homefile,kyvinh/home-assistant,alexmogavero/home-assistant,nnic/home-assistant,tchellomello/home-assistant,Smart-Torvy/torvy-home-assistant,turbokongen/home-assistant,GenericStudent/home-assistant,sffjunkie/home-assistant,aronsky/home-assistant,MungoRae/home-assistant,leppa/home-assistant,instantchow/home-assistant,maddox/home-assistant,sanmiguel/home-assistant,Cinntax/home-assistant,bdfoster/blumate,morphis/home-assistant,nnic/home-assistant,rohitranjan1991/home-assistant,jawilson/home-assistant,alexmogavero/home-assistant,aequitas/home-assistant,vitorespindola/home-assistant,PetePriority/home-assistant,adrienbrault/home-assistant,aoakeson/home-assistant,florianholzapfel/home-assistant,miniconfig/home-assistant,emilhetty/home-assistant,robjohnson189/home-assistant,toddeye/home-assistant,FreekingDean/home-assistant,justyns/home-assistant,toddeye/home-assistant,robbiet480/home-assistant,mezz64/home-assistant,Nzaga/home-assistant,jnewland/home-assistant,betrisey/home-assistant,xifle/home-assistant,hmronline/home-assistant,alexkolar/home-assistant,auduny/home-assistant,vitorespindola/home-assistant,jabesq/home-assistant,badele/home-assistant,happyleavesaoc/home-assistant,tinloaf/home-assistant,molobrakos/home-assistant,open-homeautomation/home-assistant,leoc/home-assistant,nevercast/home-assistant,SEJeff/home-assistant,home-assistant/home-assistant,pottzer/home-assistant,auduny/home-assistant,g12mcgov/home-assistant,Duoxilian/home-assistant,deisi/home-assistant,EricRho/home-assistant,tboyce1/home-assistant,LinuxChristian/home-assistant,emilhetty/home-assistant,coteyr/home-assistant,varunr047/homefile,CCOSTAN/home-assistant,hmronline/home-assistant,alexmogavero/home-assistant,mikaelboman/home-assistant,balloob/home-assistant,jamespcole/home-assistant,tmm1/home-assistant,sfam/home-assistant,varunr047/homefile,pschmitt/home-assistant,mKeRix/home-assistant,Zac-HD/home-assistant,srcLurker/home-assistant,leoc/home-assistant,sander76/home-assistant,ct-23/home-assistant,fbradyirl/home-assistant,Teagan42/home-assistant,Nzaga/home-assistant,fbradyirl/home-assistant,justyns/home-assistant,theolind/home-assistant,varunr047/homefile,tboyce1/home-assistant,stefan-jonasson/home-assistant,LinuxChristian/home-assistant,hmronline/home-assistant,betrisey/home-assistant,eagleamon/home-assistant,eagleamon/home-assistant,kyvinh/home-assistant,shaftoe/home-assistant,fbradyirl/home-assistant,Zac-HD/home-assistant,philipbl/home-assistant,leoc/home-assistant,devdelay/home-assistant,auduny/home-assistant,ma314smith/home-assistant,sfam/home-assistant,Smart-Torvy/torvy-home-assistant,Zyell/home-assistant,Zyell/home-assistant,badele/home-assistant,GenericStudent/home-assistant,postlund/home-assistant,mahendra-r/home-assistant,qedi-r/home-assistant,coteyr/home-assistant,ewandor/home-assistant,sffjunkie/home-assistant,tmm1/home-assistant,nkgilley/home-assistant,postlund/home-assistant,sfam/home-assistant,theolind/home-assistant,devdelay/home-assistant,ewandor/home-assistant,devdelay/home-assistant,mezz64/home-assistant,titilambert/home-assistant,ma314smith/home-assistant,dorant/home-assistant,tomduijf/home-assistant,jnewland/home-assistant,Danielhiversen/home-assistant,xifle/home-assistant,srcLurker/home-assistant,robjohnson189/home-assistant,persandstrom/home-assistant,balloob/home-assistant,sffjunkie/home-assistant,persandstrom/home-assistant,SEJeff/home-assistant,bencmbrook/home-assistant,jaharkes/home-assistant,stefan-jonasson/home-assistant,tchellomello/home-assistant,MartinHjelmare/home-assistant,aequitas/home-assistant,dmeulen/home-assistant,sander76/home-assistant,keerts/home-assistant,srcLurker/home-assistant,g12mcgov/home-assistant,bencmbrook/home-assistant,xifle/home-assistant,happyleavesaoc/home-assistant,keerts/home-assistant,nevercast/home-assistant,Theb-1/home-assistant,SEJeff/home-assistant,kennedyshead/home-assistant,instantchow/home-assistant,sdague/home-assistant,jnewland/home-assistant,badele/home-assistant,mikaelboman/home-assistant,robjohnson189/home-assistant,tinloaf/home-assistant,jabesq/home-assistant,rohitranjan1991/home-assistant,maddox/home-assistant,mahendra-r/home-assistant,HydrelioxGitHub/home-assistant,LinuxChristian/home-assistant,Zac-HD/home-assistant,leoc/home-assistant,oandrew/home-assistant,MungoRae/home-assistant,w1ll1am23/home-assistant,bdfoster/blumate,aronsky/home-assistant,soldag/home-assistant,rohitranjan1991/home-assistant,Duoxilian/home-assistant,stefan-jonasson/home-assistant,michaelarnauts/home-assistant,aoakeson/home-assistant,PetePriority/home-assistant,florianholzapfel/home-assistant,sanmiguel/home-assistant,hmronline/home-assistant,tinloaf/home-assistant,teodoc/home-assistant,ct-23/home-assistant,florianholzapfel/home-assistant,balloob/home-assistant,tomduijf/home-assistant,leppa/home-assistant,eagleamon/home-assistant,tboyce1/home-assistant,maddox/home-assistant,mKeRix/home-assistant,DavidLP/home-assistant,molobrakos/home-assistant,tboyce021/home-assistant,jaharkes/home-assistant,hexxter/home-assistant,tomduijf/home-assistant,nkgilley/home-assistant,MartinHjelmare/home-assistant,Julian/home-assistant,DavidLP/home-assistant,emilhetty/home-assistant,sdague/home-assistant,JshWright/home-assistant,vitorespindola/home-assistant,nnic/home-assistant,PetePriority/home-assistant,partofthething/home-assistant,emilhetty/home-assistant,HydrelioxGitHub/home-assistant,aequitas/home-assistant,luxus/home-assistant,kyvinh/home-assistant,titilambert/home-assistant,Smart-Torvy/torvy-home-assistant,alexkolar/home-assistant,ct-23/home-assistant,EricRho/home-assistant,morphis/home-assistant,Duoxilian/home-assistant,alexmogavero/home-assistant,luxus/home-assistant,alanbowman/home-assistant,morphis/home-assistant,Zac-HD/home-assistant,sffjunkie/home-assistant,MartinHjelmare/home-assistant,philipbl/home-assistant,instantchow/home-assistant,Danielhiversen/home-assistant,philipbl/home-assistant,tboyce1/home-assistant,miniconfig/home-assistant,open-homeautomation/home-assistant,open-homeautomation/home-assistant,deisi/home-assistant,robjohnson189/home-assistant,coteyr/home-assistant,bdfoster/blumate,sffjunkie/home-assistant,turbokongen/home-assistant,EricRho/home-assistant,srcLurker/home-assistant,stefan-jonasson/home-assistant,miniconfig/home-assistant,aoakeson/home-assistant,varunr047/homefile,hexxter/home-assistant,nugget/home-assistant,luxus/home-assistant,Duoxilian/home-assistant,nugget/home-assistant,philipbl/home-assistant,oandrew/home-assistant,dorant/home-assistant,HydrelioxGitHub/home-assistant,LinuxChristian/home-assistant,kennedyshead/home-assistant,justyns/home-assistant,dmeulen/home-assistant,oandrew/home-assistant,Julian/home-assistant,deisi/home-assistant,g12mcgov/home-assistant,DavidLP/home-assistant,MungoRae/home-assistant,ct-23/home-assistant,mikaelboman/home-assistant,mKeRix/home-assistant,hexxter/home-assistant,shaftoe/home-assistant,tboyce021/home-assistant,theolind/home-assistant,teodoc/home-assistant,eagleamon/home-assistant,persandstrom/home-assistant,bencmbrook/home-assistant,morphis/home-assistant,tmm1/home-assistant,alanbowman/home-assistant,betrisey/home-assistant,xifle/home-assistant,dmeulen/home-assistant,michaelarnauts/home-assistant,hmronline/home-assistant,Nzaga/home-assistant,JshWright/home-assistant,Cinntax/home-assistant,mikaelboman/home-assistant,MungoRae/home-assistant,shaftoe/home-assistant,ErykB2000/home-assistant,mKeRix/home-assistant,Teagan42/home-assistant,Theb-1/home-assistant,deisi/home-assistant,alexkolar/home-assistant,Smart-Torvy/torvy-home-assistant,pottzer/home-assistant,CCOSTAN/home-assistant,molobrakos/home-assistant,Julian/home-assistant,miniconfig/home-assistant,ma314smith/home-assistant,lukas-hetzenecker/home-assistant,betrisey/home-assistant,dorant/home-assistant,bdfoster/blumate,CCOSTAN/home-assistant,michaelarnauts/home-assistant,lukas-hetzenecker/home-assistant,keerts/home-assistant,joopert/home-assistant,jawilson/home-assistant,pottzer/home-assistant,happyleavesaoc/home-assistant,florianholzapfel/home-assistant,nugget/home-assistant,caiuspb/home-assistant,ErykB2000/home-assistant,ct-23/home-assistant,pschmitt/home-assistant,jaharkes/home-assistant,Zyell/home-assistant,mahendra-r/home-assistant,nevercast/home-assistant,ma314smith/home-assistant,adrienbrault/home-assistant,w1ll1am23/home-assistant,soldag/home-assistant,emilhetty/home-assistant,jamespcole/home-assistant,jaharkes/home-assistant,devdelay/home-assistant,kyvinh/home-assistant,MungoRae/home-assistant,caiuspb/home-assistant,Julian/home-assistant,caiuspb/home-assistant,qedi-r/home-assistant,open-homeautomation/home-assistant,JshWright/home-assistant,hexxter/home-assistant,ErykB2000/home-assistant,mikaelboman/home-assistant,JshWright/home-assistant,jabesq/home-assistant,ewandor/home-assistant,alanbowman/home-assistant,home-assistant/home-assistant,oandrew/home-assistant,jamespcole/home-assistant | html | ## Code Before:
<link rel="import" href="../bower_components/polymer/polymer.html">
<link rel="import" href="../bower_components/paper-toast/paper-toast.html">
<polymer-element name="ha-notifications">
<template>
<paper-toast id="toast" role="alert" text=""></paper-toast>
</template>
<script>
var storeListenerMixIn = window.hass.storeListenerMixIn;
Polymer(Polymer.mixin({
lastId: null,
attached: function() {
this.listenToStores(true);
},
detached: function() {
this.stopListeningToStores();
},
notificationStoreChanged: function(notificationStore) {
if (notificationStore.hasNewNotifications(this.lastId)) {
var toast = this.$.toast;
var notification = notificationStore.lastNotification;
this.lastId = notification.id;
toast.text = notification.message;
toast.show();
}
},
}, storeListenerMixIn));
</script>
</polymer-element>
## Instruction:
Fix JS notification error on initialization.
The last notification is initially null resulting in an exception being
thrown on startup.
## Code After:
<link rel="import" href="../bower_components/polymer/polymer.html">
<link rel="import" href="../bower_components/paper-toast/paper-toast.html">
<polymer-element name="ha-notifications">
<template>
<paper-toast id="toast" role="alert" text=""></paper-toast>
</template>
<script>
var storeListenerMixIn = window.hass.storeListenerMixIn;
Polymer(Polymer.mixin({
lastId: null,
attached: function() {
this.listenToStores(true);
},
detached: function() {
this.stopListeningToStores();
},
notificationStoreChanged: function(notificationStore) {
if (notificationStore.hasNewNotifications(this.lastId)) {
var toast = this.$.toast;
var notification = notificationStore.lastNotification;
if (notification) {
this.lastId = notification.id;
toast.text = notification.message;
toast.show();
}
}
},
}, storeListenerMixIn));
</script>
</polymer-element>
| <link rel="import" href="../bower_components/polymer/polymer.html">
<link rel="import" href="../bower_components/paper-toast/paper-toast.html">
<polymer-element name="ha-notifications">
<template>
<paper-toast id="toast" role="alert" text=""></paper-toast>
</template>
<script>
var storeListenerMixIn = window.hass.storeListenerMixIn;
Polymer(Polymer.mixin({
lastId: null,
attached: function() {
this.listenToStores(true);
},
detached: function() {
this.stopListeningToStores();
},
notificationStoreChanged: function(notificationStore) {
if (notificationStore.hasNewNotifications(this.lastId)) {
var toast = this.$.toast;
var notification = notificationStore.lastNotification;
+ if (notification) {
- this.lastId = notification.id;
+ this.lastId = notification.id;
? ++
- toast.text = notification.message;
+ toast.text = notification.message;
? ++
- toast.show();
+ toast.show();
? ++
+ }
}
},
}, storeListenerMixIn));
</script>
</polymer-element> | 8 | 0.228571 | 5 | 3 |
4d9905e6a28cb051c589de925a7d6e9ded2fdc70 | bootstrap_corenlp.sh | bootstrap_corenlp.sh |
if [ ! -f corenlp-python ]
then
echo "Cloning Valentin's modified corenlp-python library…"
git clone https://bitbucket.org/ProgVal/corenlp-python.git
fi
echo "Installing it…"
cd corenlp-python
python3 setup.py install --user
cd ..
if [ ! -f stanford-corenlp-full-2014-08-27.zip ]
then
echo "Downloading CoreNLP (long: 221MB)…"
wget http://nlp.stanford.edu/software/stanford-corenlp-full-2014-08-27.zip
fi
echo "Extracting CoreNLP…"
rm -rf stanford-corenlp-full-2014-08-27
unzip stanford-corenlp-full-2014-08-27.zip
echo "All seemed to work. Hold tight while we test it on a simple example (might take some time)."
CORENLP=stanford-corenlp-full-* python3 -c "print(repr(__import__('corenlp').StanfordCoreNLP().raw_parse('This is a sentence.')))"
|
python3 -m pip install pexpect unidecode xmltodict --user
if [ ! -f corenlp-python ]
then
echo "Cloning Valentin's modified corenlp-python library…"
git clone https://bitbucket.org/ProgVal/corenlp-python.git
fi
echo "Installing it…"
cd corenlp-python
python3 setup.py install --user
cd ..
if [ ! -f stanford-corenlp-full-2014-08-27.zip ]
then
echo "Downloading CoreNLP (long: 221MB)…"
wget http://nlp.stanford.edu/software/stanford-corenlp-full-2014-08-27.zip
fi
echo "Extracting CoreNLP…"
rm -rf stanford-corenlp-full-2014-08-27
unzip stanford-corenlp-full-2014-08-27.zip
echo "All seemed to work. Hold tight while we test it on a simple example (might take some time)."
CORENLP=stanford-corenlp-full-* python3 -c "print(repr(__import__('corenlp').StanfordCoreNLP().raw_parse('This is a sentence.')))"
| Install corenlp-python dependencies. Closes GH-1. | Install corenlp-python dependencies. Closes GH-1.
| Shell | cc0-1.0 | ProjetPP/Scripts,ProjetPP/Scripts | shell | ## Code Before:
if [ ! -f corenlp-python ]
then
echo "Cloning Valentin's modified corenlp-python library…"
git clone https://bitbucket.org/ProgVal/corenlp-python.git
fi
echo "Installing it…"
cd corenlp-python
python3 setup.py install --user
cd ..
if [ ! -f stanford-corenlp-full-2014-08-27.zip ]
then
echo "Downloading CoreNLP (long: 221MB)…"
wget http://nlp.stanford.edu/software/stanford-corenlp-full-2014-08-27.zip
fi
echo "Extracting CoreNLP…"
rm -rf stanford-corenlp-full-2014-08-27
unzip stanford-corenlp-full-2014-08-27.zip
echo "All seemed to work. Hold tight while we test it on a simple example (might take some time)."
CORENLP=stanford-corenlp-full-* python3 -c "print(repr(__import__('corenlp').StanfordCoreNLP().raw_parse('This is a sentence.')))"
## Instruction:
Install corenlp-python dependencies. Closes GH-1.
## Code After:
python3 -m pip install pexpect unidecode xmltodict --user
if [ ! -f corenlp-python ]
then
echo "Cloning Valentin's modified corenlp-python library…"
git clone https://bitbucket.org/ProgVal/corenlp-python.git
fi
echo "Installing it…"
cd corenlp-python
python3 setup.py install --user
cd ..
if [ ! -f stanford-corenlp-full-2014-08-27.zip ]
then
echo "Downloading CoreNLP (long: 221MB)…"
wget http://nlp.stanford.edu/software/stanford-corenlp-full-2014-08-27.zip
fi
echo "Extracting CoreNLP…"
rm -rf stanford-corenlp-full-2014-08-27
unzip stanford-corenlp-full-2014-08-27.zip
echo "All seemed to work. Hold tight while we test it on a simple example (might take some time)."
CORENLP=stanford-corenlp-full-* python3 -c "print(repr(__import__('corenlp').StanfordCoreNLP().raw_parse('This is a sentence.')))"
| +
+ python3 -m pip install pexpect unidecode xmltodict --user
if [ ! -f corenlp-python ]
then
echo "Cloning Valentin's modified corenlp-python library…"
git clone https://bitbucket.org/ProgVal/corenlp-python.git
fi
echo "Installing it…"
cd corenlp-python
python3 setup.py install --user
cd ..
if [ ! -f stanford-corenlp-full-2014-08-27.zip ]
then
echo "Downloading CoreNLP (long: 221MB)…"
wget http://nlp.stanford.edu/software/stanford-corenlp-full-2014-08-27.zip
fi
echo "Extracting CoreNLP…"
rm -rf stanford-corenlp-full-2014-08-27
unzip stanford-corenlp-full-2014-08-27.zip
echo "All seemed to work. Hold tight while we test it on a simple example (might take some time)."
CORENLP=stanford-corenlp-full-* python3 -c "print(repr(__import__('corenlp').StanfordCoreNLP().raw_parse('This is a sentence.')))" | 2 | 0.1 | 2 | 0 |
bf31816cf95f527cddcbcf9b457de6923a445440 | lib/pliny/middleware/cors.rb | lib/pliny/middleware/cors.rb | module Pliny::Middleware
class CORS
ALLOW_METHODS =
%w( GET POST PUT PATCH DELETE OPTIONS ).freeze
ALLOW_HEADERS =
%w( Content-Type Accept AUTHORIZATION Cache-Control ).freeze
EXPOSE_HEADERS =
%w( Cache-Control Content-Language Content-Type Expires Last-Modified Pragma ).freeze
def initialize(app)
@app = app
end
def call(env)
# preflight request: render a stub 200 with the CORS headers
if cors_request?(env) && env["REQUEST_METHOD"] == "OPTIONS"
[200, cors_headers(env), [""]]
else
status, headers, response = @app.call(env)
# regualar CORS request: append CORS headers to response
if cors_request?(env)
headers.merge!(cors_headers(env))
end
[status, headers, response]
end
end
def cors_request?(env)
env.has_key?("HTTP_ORIGIN")
end
def cors_headers(env)
{
'Access-Control-Allow-Origin' => env["HTTP_ORIGIN"],
'Access-Control-Allow-Methods' => ALLOW_METHODS.join(', '),
'Access-Control-Allow-Headers' => ALLOW_HEADERS.join(', '),
'Access-Control-Allow-Credentials' => "true",
'Access-Control-Max-Age' => "1728000",
'Access-Control-Expose-Headers' => EXPOSE_HEADERS.join(', ')
}
end
end
end
| module Pliny::Middleware
class CORS
ALLOW_METHODS =
%w( GET POST PUT PATCH DELETE OPTIONS ).freeze
ALLOW_HEADERS =
%w( Content-Type Accept Authorization Cache-Control If-None-Match If-Modified-Since ).freeze
EXPOSE_HEADERS =
%w( Cache-Control Content-Language Content-Type Expires Last-Modified Pragma ).freeze
def initialize(app)
@app = app
end
def call(env)
# preflight request: render a stub 200 with the CORS headers
if cors_request?(env) && env["REQUEST_METHOD"] == "OPTIONS"
[200, cors_headers(env), [""]]
else
status, headers, response = @app.call(env)
# regualar CORS request: append CORS headers to response
if cors_request?(env)
headers.merge!(cors_headers(env))
end
[status, headers, response]
end
end
def cors_request?(env)
env.has_key?("HTTP_ORIGIN")
end
def cors_headers(env)
{
'Access-Control-Allow-Origin' => env["HTTP_ORIGIN"],
'Access-Control-Allow-Methods' => ALLOW_METHODS.join(', '),
'Access-Control-Allow-Headers' => ALLOW_HEADERS.join(', '),
'Access-Control-Allow-Credentials' => "true",
'Access-Control-Max-Age' => "1728000",
'Access-Control-Expose-Headers' => EXPOSE_HEADERS.join(', ')
}
end
end
end
| Whitelist If-None-Match and If-Modified-Since headers | Whitelist If-None-Match and If-Modified-Since headers
| Ruby | mit | hayduke19us/pliny,fdr/pliny,interagent/pliny,interagent/pliny,hayduke19us/pliny,fdr/pliny,hayduke19us/pliny,interagent/pliny,fdr/pliny | ruby | ## Code Before:
module Pliny::Middleware
class CORS
ALLOW_METHODS =
%w( GET POST PUT PATCH DELETE OPTIONS ).freeze
ALLOW_HEADERS =
%w( Content-Type Accept AUTHORIZATION Cache-Control ).freeze
EXPOSE_HEADERS =
%w( Cache-Control Content-Language Content-Type Expires Last-Modified Pragma ).freeze
def initialize(app)
@app = app
end
def call(env)
# preflight request: render a stub 200 with the CORS headers
if cors_request?(env) && env["REQUEST_METHOD"] == "OPTIONS"
[200, cors_headers(env), [""]]
else
status, headers, response = @app.call(env)
# regualar CORS request: append CORS headers to response
if cors_request?(env)
headers.merge!(cors_headers(env))
end
[status, headers, response]
end
end
def cors_request?(env)
env.has_key?("HTTP_ORIGIN")
end
def cors_headers(env)
{
'Access-Control-Allow-Origin' => env["HTTP_ORIGIN"],
'Access-Control-Allow-Methods' => ALLOW_METHODS.join(', '),
'Access-Control-Allow-Headers' => ALLOW_HEADERS.join(', '),
'Access-Control-Allow-Credentials' => "true",
'Access-Control-Max-Age' => "1728000",
'Access-Control-Expose-Headers' => EXPOSE_HEADERS.join(', ')
}
end
end
end
## Instruction:
Whitelist If-None-Match and If-Modified-Since headers
## Code After:
module Pliny::Middleware
class CORS
ALLOW_METHODS =
%w( GET POST PUT PATCH DELETE OPTIONS ).freeze
ALLOW_HEADERS =
%w( Content-Type Accept Authorization Cache-Control If-None-Match If-Modified-Since ).freeze
EXPOSE_HEADERS =
%w( Cache-Control Content-Language Content-Type Expires Last-Modified Pragma ).freeze
def initialize(app)
@app = app
end
def call(env)
# preflight request: render a stub 200 with the CORS headers
if cors_request?(env) && env["REQUEST_METHOD"] == "OPTIONS"
[200, cors_headers(env), [""]]
else
status, headers, response = @app.call(env)
# regualar CORS request: append CORS headers to response
if cors_request?(env)
headers.merge!(cors_headers(env))
end
[status, headers, response]
end
end
def cors_request?(env)
env.has_key?("HTTP_ORIGIN")
end
def cors_headers(env)
{
'Access-Control-Allow-Origin' => env["HTTP_ORIGIN"],
'Access-Control-Allow-Methods' => ALLOW_METHODS.join(', '),
'Access-Control-Allow-Headers' => ALLOW_HEADERS.join(', '),
'Access-Control-Allow-Credentials' => "true",
'Access-Control-Max-Age' => "1728000",
'Access-Control-Expose-Headers' => EXPOSE_HEADERS.join(', ')
}
end
end
end
| module Pliny::Middleware
class CORS
ALLOW_METHODS =
%w( GET POST PUT PATCH DELETE OPTIONS ).freeze
ALLOW_HEADERS =
- %w( Content-Type Accept AUTHORIZATION Cache-Control ).freeze
+ %w( Content-Type Accept Authorization Cache-Control If-None-Match If-Modified-Since ).freeze
EXPOSE_HEADERS =
%w( Cache-Control Content-Language Content-Type Expires Last-Modified Pragma ).freeze
def initialize(app)
@app = app
end
def call(env)
# preflight request: render a stub 200 with the CORS headers
if cors_request?(env) && env["REQUEST_METHOD"] == "OPTIONS"
[200, cors_headers(env), [""]]
else
status, headers, response = @app.call(env)
# regualar CORS request: append CORS headers to response
if cors_request?(env)
headers.merge!(cors_headers(env))
end
[status, headers, response]
end
end
def cors_request?(env)
env.has_key?("HTTP_ORIGIN")
end
def cors_headers(env)
{
'Access-Control-Allow-Origin' => env["HTTP_ORIGIN"],
'Access-Control-Allow-Methods' => ALLOW_METHODS.join(', '),
'Access-Control-Allow-Headers' => ALLOW_HEADERS.join(', '),
'Access-Control-Allow-Credentials' => "true",
'Access-Control-Max-Age' => "1728000",
'Access-Control-Expose-Headers' => EXPOSE_HEADERS.join(', ')
}
end
end
end | 2 | 0.043478 | 1 | 1 |
a28eaf9968fe57da4ed3eef11bc05cdfd00e9af4 | app/views/documents/_embed_code.html.erb | app/views/documents/_embed_code.html.erb | <% if options[:use_default_container] %>
<div id="<%= options[:default_container_id] %>" class="DV-container"></div>
<% end %>
<script type="text/javascript">
DV.load("<%= options[:resource_js_url] %>", JSON.parse('<%= data.to_json %>'));
</script>
<% if data[:pdf] %>
<noscript>
<a href="<%#= options[:pdf_url] %>"><%#= options[:title] %> (PDF)</a>
<br>
<a href="<%#= options[:full_text_url] %>"><%#= options[:title] %> (Text)</a>
</noscript>
<% end %>
| <% if options[:use_default_container] %>
<div id="<%= options[:default_container_id] %>" class="DV-container"></div>
<% end %>
<script type="text/javascript">
DV.load("<%= options[:resource_js_url] %>", <%= data.to_json %>);
</script>
<% if data[:pdf] %>
<noscript>
<a href="<%#= options[:pdf_url] %>"><%#= options[:title] %> (PDF)</a>
<br>
<a href="<%#= options[:full_text_url] %>"><%#= options[:title] %> (Text)</a>
</noscript>
<% end %>
| Stop trying to tame JSON | Stop trying to tame JSON
Revert 43a2f99624491193be9b220da11c5ba58979e7ee and actually fix things. (We were dumping the Ruby-generated JSON between curly braces, when Ruby was already returning it that way.)
| HTML+ERB | mit | ivarvong/documentcloud,moodpo/documentcloud,dannguyen/documentcloud,Teino1978-Corp/Teino1978-Corp-documentcloud,Teino1978-Corp/Teino1978-Corp-documentcloud,documentcloud/documentcloud,dannguyen/documentcloud,monofox/documentcloud,gunjanmodi/documentcloud,moodpo/documentcloud,ivarvong/documentcloud,monofox/documentcloud,documentcloud/documentcloud,ivarvong/documentcloud,dannguyen/documentcloud,Teino1978-Corp/Teino1978-Corp-documentcloud,Teino1978-Corp/Teino1978-Corp-documentcloud,gunjanmodi/documentcloud,monofox/documentcloud,dannguyen/documentcloud,moodpo/documentcloud,documentcloud/documentcloud,gunjanmodi/documentcloud,gunjanmodi/documentcloud,moodpo/documentcloud,monofox/documentcloud,ivarvong/documentcloud,documentcloud/documentcloud | html+erb | ## Code Before:
<% if options[:use_default_container] %>
<div id="<%= options[:default_container_id] %>" class="DV-container"></div>
<% end %>
<script type="text/javascript">
DV.load("<%= options[:resource_js_url] %>", JSON.parse('<%= data.to_json %>'));
</script>
<% if data[:pdf] %>
<noscript>
<a href="<%#= options[:pdf_url] %>"><%#= options[:title] %> (PDF)</a>
<br>
<a href="<%#= options[:full_text_url] %>"><%#= options[:title] %> (Text)</a>
</noscript>
<% end %>
## Instruction:
Stop trying to tame JSON
Revert 43a2f99624491193be9b220da11c5ba58979e7ee and actually fix things. (We were dumping the Ruby-generated JSON between curly braces, when Ruby was already returning it that way.)
## Code After:
<% if options[:use_default_container] %>
<div id="<%= options[:default_container_id] %>" class="DV-container"></div>
<% end %>
<script type="text/javascript">
DV.load("<%= options[:resource_js_url] %>", <%= data.to_json %>);
</script>
<% if data[:pdf] %>
<noscript>
<a href="<%#= options[:pdf_url] %>"><%#= options[:title] %> (PDF)</a>
<br>
<a href="<%#= options[:full_text_url] %>"><%#= options[:title] %> (Text)</a>
</noscript>
<% end %>
| <% if options[:use_default_container] %>
<div id="<%= options[:default_container_id] %>" class="DV-container"></div>
<% end %>
<script type="text/javascript">
- DV.load("<%= options[:resource_js_url] %>", JSON.parse('<%= data.to_json %>'));
? ------------ --
+ DV.load("<%= options[:resource_js_url] %>", <%= data.to_json %>);
</script>
<% if data[:pdf] %>
<noscript>
<a href="<%#= options[:pdf_url] %>"><%#= options[:title] %> (PDF)</a>
<br>
<a href="<%#= options[:full_text_url] %>"><%#= options[:title] %> (Text)</a>
</noscript>
<% end %> | 2 | 0.153846 | 1 | 1 |
d7e2f05d60aaba3d13337fd53add9fd50aafd6ee | tests/test_python_solutions.py | tests/test_python_solutions.py | import glob
import json
import os
import time
import pytest
from helpers import solutions_dir
# NOTE: If we make solution files a fixture instead of a normal attr/function,
# then we can't use it in pytest's parametrize
solution_files = glob.glob(os.path.join(solutions_dir("python"), "*.py"))
@pytest.mark.python
def test_solutions_exist():
assert solution_files
# TODO ids. id function to turn file name into cleaner label
@pytest.mark.python
@pytest.mark.parametrize("solution_file", solution_files)
def test_submit_file(solution_file, submit_solution):
result = submit_solution(solution_file)
assert result.get("success") is True, "Failed. Engine output:\n{:}".format(
json.dumps(result, indent=4)
)
| import glob
import json
import os
import time
import pytest
from helpers import solutions_dir
# NOTE: If we make solution_files a fixture instead of a normal attr/function,
# then we can't use it in pytest's parametrize
solution_files = glob.glob(os.path.join(solutions_dir("python"), "*.py"))
@pytest.mark.python
def test_solutions_exist():
assert solution_files
def id_func(param):
problem_name, ext = os.path.splitext(os.path.basename(param))
return problem_name
@pytest.mark.python
@pytest.mark.parametrize("solution_file", solution_files, ids=id_func)
def test_submit_file(solution_file, submit_solution):
result = submit_solution(solution_file)
assert result.get("success") is True, "Failed. Engine output:\n{:}".format(
json.dumps(result, indent=4)
)
| Add ids to parametrized tests | Add ids to parametrized tests
| Python | mit | project-lovelace/lovelace-engine,project-lovelace/lovelace-engine,project-lovelace/lovelace-engine | python | ## Code Before:
import glob
import json
import os
import time
import pytest
from helpers import solutions_dir
# NOTE: If we make solution files a fixture instead of a normal attr/function,
# then we can't use it in pytest's parametrize
solution_files = glob.glob(os.path.join(solutions_dir("python"), "*.py"))
@pytest.mark.python
def test_solutions_exist():
assert solution_files
# TODO ids. id function to turn file name into cleaner label
@pytest.mark.python
@pytest.mark.parametrize("solution_file", solution_files)
def test_submit_file(solution_file, submit_solution):
result = submit_solution(solution_file)
assert result.get("success") is True, "Failed. Engine output:\n{:}".format(
json.dumps(result, indent=4)
)
## Instruction:
Add ids to parametrized tests
## Code After:
import glob
import json
import os
import time
import pytest
from helpers import solutions_dir
# NOTE: If we make solution_files a fixture instead of a normal attr/function,
# then we can't use it in pytest's parametrize
solution_files = glob.glob(os.path.join(solutions_dir("python"), "*.py"))
@pytest.mark.python
def test_solutions_exist():
assert solution_files
def id_func(param):
problem_name, ext = os.path.splitext(os.path.basename(param))
return problem_name
@pytest.mark.python
@pytest.mark.parametrize("solution_file", solution_files, ids=id_func)
def test_submit_file(solution_file, submit_solution):
result = submit_solution(solution_file)
assert result.get("success") is True, "Failed. Engine output:\n{:}".format(
json.dumps(result, indent=4)
)
| import glob
import json
import os
import time
import pytest
from helpers import solutions_dir
- # NOTE: If we make solution files a fixture instead of a normal attr/function,
? ^
+ # NOTE: If we make solution_files a fixture instead of a normal attr/function,
? ^
# then we can't use it in pytest's parametrize
solution_files = glob.glob(os.path.join(solutions_dir("python"), "*.py"))
@pytest.mark.python
def test_solutions_exist():
assert solution_files
- # TODO ids. id function to turn file name into cleaner label
+ def id_func(param):
+ problem_name, ext = os.path.splitext(os.path.basename(param))
+ return problem_name
+
+
@pytest.mark.python
- @pytest.mark.parametrize("solution_file", solution_files)
+ @pytest.mark.parametrize("solution_file", solution_files, ids=id_func)
? +++++++++++++
def test_submit_file(solution_file, submit_solution):
result = submit_solution(solution_file)
assert result.get("success") is True, "Failed. Engine output:\n{:}".format(
json.dumps(result, indent=4)
) | 10 | 0.333333 | 7 | 3 |
81eb3b255adcf157d4fa418f54e811b9e138ccf1 | server/core/utilities.js | server/core/utilities.js | var moment = require('moment');
var geolib = require('geolib');
// Use moment.js to calculate how much time has elapsed since some prior time
exports.getTimeElapsedSince = function(time) {
return moment(time).fromNow();
};
// Use geolib.js to calculate distance from the mark to the user
exports.getDistanceFrom = function(mark, user) {
var dist = geolib.getDistance(
{latitude: user.x, longitude: user.y},
{latitude: mark.x, longitude: mark.y}
);
return dist + 'm';
};
// The object we pull from the database has specific data (time/location)
// Here we create a new object that has data that is relevant to the user
exports.createResponseObjects = function(marks, user) {
var responseObjects = [];
var responseObject;
marks.forEach(function(mark) {
responseObject = {
messageId: mark.messageId,
timestamp: exports.getTimeElapsedSince(mark.timestamp),
distance: exports.getDistanceFrom(mark, user),
messageString: mark.messageString
};
responseObjects.push(responseObject);
});
return responseObjects;
};
| var moment = require('moment');
var geolib = require('geolib');
// Use moment.js to calculate how much time has elapsed since some prior time
exports.getTimeElapsedSince = function(time) {
return moment(time).fromNow();
};
// Use geolib.js to calculate distance from the mark to the user
exports.getDistanceFrom = function(mark, user) {
var dist = geolib.getDistance(
{latitude: user.x, longitude: user.y},
{latitude: mark.x, longitude: mark.y}
);
return dist + 'm';
};
// The object we pull from the database has specific data (time/location)
// Here we create a new object that has data that is relevant to the user
exports.createResponseObjects = function(marks, user) {
var responseObjects = [];
var responseObject;
marks.forEach(function(mark) {
responseObject = {
messageId: mark.messageId,
timestamp: exports.getTimeElapsedSince(mark.timestamp),
distance: exports.getDistanceFrom(mark, user),
messageString: mark.messageString
};
responseObjects.push(responseObject);
});
return responseObjects;
};
exports.log = function(message, content) {
console.log('\n--------------------------------------------------------');
console.log(moment().format("dddd, MMMM Do YYYY, h:mm:ss a") + message);
console.log(content);
console.log('--------------------------------------------------------');
};
| Add server-side logging utility function | Add server-side logging utility function
| JavaScript | mit | team-oath/uncovery,team-oath/uncovery,team-oath/uncovery,scottdixon/uncovery,scottdixon/uncovery,scottdixon/uncovery,team-oath/uncovery,scottdixon/uncovery | javascript | ## Code Before:
var moment = require('moment');
var geolib = require('geolib');
// Use moment.js to calculate how much time has elapsed since some prior time
exports.getTimeElapsedSince = function(time) {
return moment(time).fromNow();
};
// Use geolib.js to calculate distance from the mark to the user
exports.getDistanceFrom = function(mark, user) {
var dist = geolib.getDistance(
{latitude: user.x, longitude: user.y},
{latitude: mark.x, longitude: mark.y}
);
return dist + 'm';
};
// The object we pull from the database has specific data (time/location)
// Here we create a new object that has data that is relevant to the user
exports.createResponseObjects = function(marks, user) {
var responseObjects = [];
var responseObject;
marks.forEach(function(mark) {
responseObject = {
messageId: mark.messageId,
timestamp: exports.getTimeElapsedSince(mark.timestamp),
distance: exports.getDistanceFrom(mark, user),
messageString: mark.messageString
};
responseObjects.push(responseObject);
});
return responseObjects;
};
## Instruction:
Add server-side logging utility function
## Code After:
var moment = require('moment');
var geolib = require('geolib');
// Use moment.js to calculate how much time has elapsed since some prior time
exports.getTimeElapsedSince = function(time) {
return moment(time).fromNow();
};
// Use geolib.js to calculate distance from the mark to the user
exports.getDistanceFrom = function(mark, user) {
var dist = geolib.getDistance(
{latitude: user.x, longitude: user.y},
{latitude: mark.x, longitude: mark.y}
);
return dist + 'm';
};
// The object we pull from the database has specific data (time/location)
// Here we create a new object that has data that is relevant to the user
exports.createResponseObjects = function(marks, user) {
var responseObjects = [];
var responseObject;
marks.forEach(function(mark) {
responseObject = {
messageId: mark.messageId,
timestamp: exports.getTimeElapsedSince(mark.timestamp),
distance: exports.getDistanceFrom(mark, user),
messageString: mark.messageString
};
responseObjects.push(responseObject);
});
return responseObjects;
};
exports.log = function(message, content) {
console.log('\n--------------------------------------------------------');
console.log(moment().format("dddd, MMMM Do YYYY, h:mm:ss a") + message);
console.log(content);
console.log('--------------------------------------------------------');
};
| var moment = require('moment');
var geolib = require('geolib');
// Use moment.js to calculate how much time has elapsed since some prior time
exports.getTimeElapsedSince = function(time) {
return moment(time).fromNow();
};
// Use geolib.js to calculate distance from the mark to the user
exports.getDistanceFrom = function(mark, user) {
var dist = geolib.getDistance(
{latitude: user.x, longitude: user.y},
{latitude: mark.x, longitude: mark.y}
);
return dist + 'm';
};
// The object we pull from the database has specific data (time/location)
// Here we create a new object that has data that is relevant to the user
exports.createResponseObjects = function(marks, user) {
var responseObjects = [];
var responseObject;
marks.forEach(function(mark) {
responseObject = {
messageId: mark.messageId,
timestamp: exports.getTimeElapsedSince(mark.timestamp),
distance: exports.getDistanceFrom(mark, user),
messageString: mark.messageString
};
responseObjects.push(responseObject);
});
return responseObjects;
};
+
+ exports.log = function(message, content) {
+ console.log('\n--------------------------------------------------------');
+ console.log(moment().format("dddd, MMMM Do YYYY, h:mm:ss a") + message);
+ console.log(content);
+ console.log('--------------------------------------------------------');
+ }; | 7 | 0.2 | 7 | 0 |
7e9fb1ba35a7de485748c4dac05151739f482041 | Cargo.toml | Cargo.toml | [package]
name = "rustful"
version = "0.1.0-pre"
authors = ["hello@erikhedvall.nu"]
[lib]
name = "rustful"
path = "src/lib.rs"
[dependencies]
hyper = "*"
time = "*"
url = "*"
anymap = "*"
[dev-dependencies]
tempdir = "*"
| [package]
name = "rustful"
version = "0.1.0-pre"
authors = ["hello@erikhedvall.nu"]
[lib]
name = "rustful"
path = "src/lib.rs"
[features]
#this will be default as long as it's the only alternative
default = ["nightly"]
nightly = ["hyper/nightly"]
[dependencies]
hyper = "*"
time = "*"
url = "*"
anymap = "*"
[dev-dependencies]
tempdir = "*"
| Use nightly feature from hyper | Use nightly feature from hyper | TOML | mit | tempbottle/rustful,armed/rustful,armed/rustful,beni55/rustful,tempbottle/rustful,armed/rustful,kvikas/rustful,kvikas/rustful,tempbottle/rustful,beni55/rustful | toml | ## Code Before:
[package]
name = "rustful"
version = "0.1.0-pre"
authors = ["hello@erikhedvall.nu"]
[lib]
name = "rustful"
path = "src/lib.rs"
[dependencies]
hyper = "*"
time = "*"
url = "*"
anymap = "*"
[dev-dependencies]
tempdir = "*"
## Instruction:
Use nightly feature from hyper
## Code After:
[package]
name = "rustful"
version = "0.1.0-pre"
authors = ["hello@erikhedvall.nu"]
[lib]
name = "rustful"
path = "src/lib.rs"
[features]
#this will be default as long as it's the only alternative
default = ["nightly"]
nightly = ["hyper/nightly"]
[dependencies]
hyper = "*"
time = "*"
url = "*"
anymap = "*"
[dev-dependencies]
tempdir = "*"
| [package]
name = "rustful"
version = "0.1.0-pre"
authors = ["hello@erikhedvall.nu"]
[lib]
name = "rustful"
path = "src/lib.rs"
+ [features]
+ #this will be default as long as it's the only alternative
+ default = ["nightly"]
+ nightly = ["hyper/nightly"]
+
[dependencies]
hyper = "*"
time = "*"
url = "*"
anymap = "*"
[dev-dependencies]
tempdir = "*" | 5 | 0.263158 | 5 | 0 |
ef48a4d6a2176920c4ffbd640e8807490bbc37d9 | app/controllers/any_login/application_controller.rb | app/controllers/any_login/application_controller.rb | module AnyLogin
class ApplicationController < ActionController::Base
if AnyLogin.enabled
if AnyLogin.http_basic_authentication_enabled
http_basic_authenticate_with :name => AnyLogin.http_basic_authentication_user_name,
:password => AnyLogin.http_basic_authentication_password
end
def any_login
head 403 && return unless AnyLogin.verify_access_proc.call(self)
AnyLogin.provider::Controller.instance_method(:any_login_sign_in).bind(self).call
end
end
end
end
| module AnyLogin
class ApplicationController < ActionController::Base
if AnyLogin.enabled
if AnyLogin.http_basic_authentication_enabled
http_basic_authenticate_with :name => AnyLogin.http_basic_authentication_user_name,
:password => AnyLogin.http_basic_authentication_password
end
end
def any_login
try_not_to_leak_any_login_is_installed
head 403 && return unless AnyLogin.verify_access_proc.call(self)
AnyLogin.provider::Controller.instance_method(:any_login_sign_in).bind(self).call
end
private
def try_not_to_leak_any_login_is_installed
try_to_render_404_not_found unless AnyLogin.enabled
end
def try_to_render_404_not_found
raise ActiveRecord::RecordNotFound
end
end
end
| Reduce production footprint of gem | Reduce production footprint of gem
| Ruby | mit | igorkasyanchuk/any_login,igorkasyanchuk/any_login,igorkasyanchuk/any_login,igorkasyanchuk/any_login | ruby | ## Code Before:
module AnyLogin
class ApplicationController < ActionController::Base
if AnyLogin.enabled
if AnyLogin.http_basic_authentication_enabled
http_basic_authenticate_with :name => AnyLogin.http_basic_authentication_user_name,
:password => AnyLogin.http_basic_authentication_password
end
def any_login
head 403 && return unless AnyLogin.verify_access_proc.call(self)
AnyLogin.provider::Controller.instance_method(:any_login_sign_in).bind(self).call
end
end
end
end
## Instruction:
Reduce production footprint of gem
## Code After:
module AnyLogin
class ApplicationController < ActionController::Base
if AnyLogin.enabled
if AnyLogin.http_basic_authentication_enabled
http_basic_authenticate_with :name => AnyLogin.http_basic_authentication_user_name,
:password => AnyLogin.http_basic_authentication_password
end
end
def any_login
try_not_to_leak_any_login_is_installed
head 403 && return unless AnyLogin.verify_access_proc.call(self)
AnyLogin.provider::Controller.instance_method(:any_login_sign_in).bind(self).call
end
private
def try_not_to_leak_any_login_is_installed
try_to_render_404_not_found unless AnyLogin.enabled
end
def try_to_render_404_not_found
raise ActiveRecord::RecordNotFound
end
end
end
| module AnyLogin
class ApplicationController < ActionController::Base
if AnyLogin.enabled
-
if AnyLogin.http_basic_authentication_enabled
http_basic_authenticate_with :name => AnyLogin.http_basic_authentication_user_name,
:password => AnyLogin.http_basic_authentication_password
end
+ end
+ def any_login
+ try_not_to_leak_any_login_is_installed
+ head 403 && return unless AnyLogin.verify_access_proc.call(self)
+ AnyLogin.provider::Controller.instance_method(:any_login_sign_in).bind(self).call
+ end
- def any_login
- head 403 && return unless AnyLogin.verify_access_proc.call(self)
- AnyLogin.provider::Controller.instance_method(:any_login_sign_in).bind(self).call
+ private
+
+ def try_not_to_leak_any_login_is_installed
+ try_to_render_404_not_found unless AnyLogin.enabled
- end
? --
+ end
+
+ def try_to_render_404_not_found
+ raise ActiveRecord::RecordNotFound
end
end
end | 19 | 1 | 14 | 5 |
e60ff2644188b7f44b45a9b38c7a5dd6b67453c2 | codeship-services.yml | codeship-services.yml | db:
image: mariadb:10
environment:
MYSQL_ROOT_PASSWORD: r00tp@ss!
MYSQL_DATABASE: test
MYSQL_USER: silauth
MYSQL_PASSWORD: silauth
web:
image: silintl/ssp-base:latest
env_file:
- ./common.env
depends_on:
- db
volumes:
- ./:/data/vendor/simplesamlphp/simplesamlphp/modules/silauth
- ./development/run-tests.sh:/data/run-tests.sh
environment:
MYSQL_HOST: db
MYSQL_DATABASE: test
MYSQL_USER: silauth
MYSQL_PASSWORD: silauth
APPLICATION_ENV: testing
IDP_DOMAIN_NAME: fake.example.com
working_dir: /data
encrypted_env_file: codeship.env.encrypted
| db:
image: mariadb:10
environment:
MYSQL_ROOT_PASSWORD: r00tp@ss!
MYSQL_DATABASE: test
MYSQL_USER: silauth
MYSQL_PASSWORD: silauth
web:
image: silintl/ssp-base:latest
env_file:
- ./common.env
depends_on:
- db
- testweb
volumes:
- ./:/data/vendor/simplesamlphp/simplesamlphp/modules/silauth
- ./development/run-tests.sh:/data/run-tests.sh
environment:
MYSQL_HOST: db
MYSQL_DATABASE: test
MYSQL_USER: silauth
MYSQL_PASSWORD: silauth
APPLICATION_ENV: testing
IDP_DOMAIN_NAME: fake.example.com
working_dir: /data
encrypted_env_file: codeship.env.encrypted
testweb:
image: silintl/ssp-base:latest
env_file:
- ./common.env
depends_on:
- db
volumes:
- ./:/data/vendor/simplesamlphp/simplesamlphp/modules/silauth
- ./development/run-tests.sh:/data/run-tests.sh
environment:
MYSQL_HOST: db
MYSQL_DATABASE: test
MYSQL_USER: silauth
MYSQL_PASSWORD: silauth
APPLICATION_ENV: testing
IDP_DOMAIN_NAME: fake.example.com
IDP_NAME: dummy
working_dir: /data
encrypted_env_file: codeship.env.encrypted
| Add testweb container for use in Codeship (CI/CD) tests | Add testweb container for use in Codeship (CI/CD) tests
| YAML | mit | silinternational/simplesamlphp-module-silauth,silinternational/simplesamlphp-module-silauth | yaml | ## Code Before:
db:
image: mariadb:10
environment:
MYSQL_ROOT_PASSWORD: r00tp@ss!
MYSQL_DATABASE: test
MYSQL_USER: silauth
MYSQL_PASSWORD: silauth
web:
image: silintl/ssp-base:latest
env_file:
- ./common.env
depends_on:
- db
volumes:
- ./:/data/vendor/simplesamlphp/simplesamlphp/modules/silauth
- ./development/run-tests.sh:/data/run-tests.sh
environment:
MYSQL_HOST: db
MYSQL_DATABASE: test
MYSQL_USER: silauth
MYSQL_PASSWORD: silauth
APPLICATION_ENV: testing
IDP_DOMAIN_NAME: fake.example.com
working_dir: /data
encrypted_env_file: codeship.env.encrypted
## Instruction:
Add testweb container for use in Codeship (CI/CD) tests
## Code After:
db:
image: mariadb:10
environment:
MYSQL_ROOT_PASSWORD: r00tp@ss!
MYSQL_DATABASE: test
MYSQL_USER: silauth
MYSQL_PASSWORD: silauth
web:
image: silintl/ssp-base:latest
env_file:
- ./common.env
depends_on:
- db
- testweb
volumes:
- ./:/data/vendor/simplesamlphp/simplesamlphp/modules/silauth
- ./development/run-tests.sh:/data/run-tests.sh
environment:
MYSQL_HOST: db
MYSQL_DATABASE: test
MYSQL_USER: silauth
MYSQL_PASSWORD: silauth
APPLICATION_ENV: testing
IDP_DOMAIN_NAME: fake.example.com
working_dir: /data
encrypted_env_file: codeship.env.encrypted
testweb:
image: silintl/ssp-base:latest
env_file:
- ./common.env
depends_on:
- db
volumes:
- ./:/data/vendor/simplesamlphp/simplesamlphp/modules/silauth
- ./development/run-tests.sh:/data/run-tests.sh
environment:
MYSQL_HOST: db
MYSQL_DATABASE: test
MYSQL_USER: silauth
MYSQL_PASSWORD: silauth
APPLICATION_ENV: testing
IDP_DOMAIN_NAME: fake.example.com
IDP_NAME: dummy
working_dir: /data
encrypted_env_file: codeship.env.encrypted
| db:
image: mariadb:10
environment:
MYSQL_ROOT_PASSWORD: r00tp@ss!
MYSQL_DATABASE: test
MYSQL_USER: silauth
MYSQL_PASSWORD: silauth
web:
+ image: silintl/ssp-base:latest
+ env_file:
+ - ./common.env
+ depends_on:
+ - db
+ - testweb
+ volumes:
+ - ./:/data/vendor/simplesamlphp/simplesamlphp/modules/silauth
+ - ./development/run-tests.sh:/data/run-tests.sh
+ environment:
+ MYSQL_HOST: db
+ MYSQL_DATABASE: test
+ MYSQL_USER: silauth
+ MYSQL_PASSWORD: silauth
+ APPLICATION_ENV: testing
+ IDP_DOMAIN_NAME: fake.example.com
+ working_dir: /data
+ encrypted_env_file: codeship.env.encrypted
+
+ testweb:
image: silintl/ssp-base:latest
env_file:
- ./common.env
depends_on:
- db
volumes:
- ./:/data/vendor/simplesamlphp/simplesamlphp/modules/silauth
- ./development/run-tests.sh:/data/run-tests.sh
environment:
MYSQL_HOST: db
MYSQL_DATABASE: test
MYSQL_USER: silauth
MYSQL_PASSWORD: silauth
APPLICATION_ENV: testing
IDP_DOMAIN_NAME: fake.example.com
+ IDP_NAME: dummy
working_dir: /data
encrypted_env_file: codeship.env.encrypted | 21 | 0.807692 | 21 | 0 |
345aaa31aaefa3abd7bcd7ea038821da298ac6b4 | .travis.yml | .travis.yml | language: java
jdk:
- oraclejdk8
sudo: required
env:
- HUDI_QUIETER_LOGGING=1
services:
- docker
| language: java
jdk:
- oraclejdk8
sudo: required
env:
- HUDI_QUIETER_LOGGING=1
services:
- docker
cache:
directories:
- $HOME/.m2
| Add m2 directory to Travis cache | Add m2 directory to Travis cache
| YAML | apache-2.0 | vinothchandar/hoodie,vinothchandar/hoodie | yaml | ## Code Before:
language: java
jdk:
- oraclejdk8
sudo: required
env:
- HUDI_QUIETER_LOGGING=1
services:
- docker
## Instruction:
Add m2 directory to Travis cache
## Code After:
language: java
jdk:
- oraclejdk8
sudo: required
env:
- HUDI_QUIETER_LOGGING=1
services:
- docker
cache:
directories:
- $HOME/.m2
| language: java
jdk:
- oraclejdk8
sudo: required
env:
- HUDI_QUIETER_LOGGING=1
services:
- docker
+ cache:
+ directories:
+ - $HOME/.m2 | 3 | 0.375 | 3 | 0 |
95daf3209c924e22f7cea76f920eea0db34341e9 | package.json | package.json | {
"title": "AO3rdr",
"name": "ao3rdr",
"id": "jid1-ayTtY9e4Iz49HA@jetpack",
"version": "1.2.3",
"description": "Rating system and block by tag system for Archive of Our Own.",
"main": "index-jpm-firefox.js",
"author": "darthkrallt",
"engines": {
"firefox": ">=38.0a1",
"fennec": ">=38.0a1"
},
"permissions": {
"cross-domain-content": [
"https://boiling-caverns-2782.herokuapp.com/*",
"https://ao3rdr.com/*",
"https://www.ao3rdr.com/*"
]
},
"license": "LGPL-2.1"
}
| {
"title": "AO3rdr",
"name": "ao3rdr",
"id": "jid1-ayTtY9e4Iz49HA@jetpack",
"version": "1.2.3",
"description": "Rating system and block by tag system for Archive of Our Own.",
"main": "index-jpm-firefox.js",
"author": "darthkrallt",
"engines": {
"firefox": ">=38.0a1",
"fennec": ">=38.0a1"
},
"permissions": {
"cross-domain-content": [
"https://boiling-caverns-2782.herokuapp.com/*",
"https://ao3rdr.com/*",
"https://www.ao3rdr.com/*"
]
},
"permissions": {
"multiprocess": true
},
"license": "LGPL-2.1"
}
| Support FF multiprocess for new jpm builds. This is important. | Support FF multiprocess for new jpm builds. This is important.
| JSON | lgpl-2.1 | darthkrallt/AO3rdr,darthkrallt/AO3rdr,darthkrallt/AO3rdr | json | ## Code Before:
{
"title": "AO3rdr",
"name": "ao3rdr",
"id": "jid1-ayTtY9e4Iz49HA@jetpack",
"version": "1.2.3",
"description": "Rating system and block by tag system for Archive of Our Own.",
"main": "index-jpm-firefox.js",
"author": "darthkrallt",
"engines": {
"firefox": ">=38.0a1",
"fennec": ">=38.0a1"
},
"permissions": {
"cross-domain-content": [
"https://boiling-caverns-2782.herokuapp.com/*",
"https://ao3rdr.com/*",
"https://www.ao3rdr.com/*"
]
},
"license": "LGPL-2.1"
}
## Instruction:
Support FF multiprocess for new jpm builds. This is important.
## Code After:
{
"title": "AO3rdr",
"name": "ao3rdr",
"id": "jid1-ayTtY9e4Iz49HA@jetpack",
"version": "1.2.3",
"description": "Rating system and block by tag system for Archive of Our Own.",
"main": "index-jpm-firefox.js",
"author": "darthkrallt",
"engines": {
"firefox": ">=38.0a1",
"fennec": ">=38.0a1"
},
"permissions": {
"cross-domain-content": [
"https://boiling-caverns-2782.herokuapp.com/*",
"https://ao3rdr.com/*",
"https://www.ao3rdr.com/*"
]
},
"permissions": {
"multiprocess": true
},
"license": "LGPL-2.1"
}
| {
"title": "AO3rdr",
"name": "ao3rdr",
"id": "jid1-ayTtY9e4Iz49HA@jetpack",
"version": "1.2.3",
"description": "Rating system and block by tag system for Archive of Our Own.",
"main": "index-jpm-firefox.js",
"author": "darthkrallt",
"engines": {
"firefox": ">=38.0a1",
"fennec": ">=38.0a1"
},
"permissions": {
"cross-domain-content": [
"https://boiling-caverns-2782.herokuapp.com/*",
"https://ao3rdr.com/*",
"https://www.ao3rdr.com/*"
]
},
+ "permissions": {
+ "multiprocess": true
+ },
"license": "LGPL-2.1"
} | 3 | 0.142857 | 3 | 0 |
ca1850141654c0cc0f56c4ea3ba49e0005c31762 | README.md | README.md | aether
======
A simple Haskell API for finding and accessing data from Wikipedia.
| Aether
======
**Aether** is simple Haskell API for finding and accessing data from Wikipedia.
Search Wikipedia, fetch search suggestions, get article summaries, and more!
Aether puts the power of the [MediaWiki API](http://www.mediawiki.org/wiki/API) at your fingertips.
Overview
--------
```Haskell
ghci> import Aether
ghci> search "Git"
["Nashim","Git","GITS","Git (software)","GitHub","Guitar","Georgia Institute of
Technology","Digestion","Git (slang)","Human gastrointestinal tract"]
ghci> suggest "Pysics"
["Physics"]
ghci> summary "Hydrogen"
"Hydrogen is a chemical element with chemical symbol H and atomic number 1. With
an atomic weight of 1.00794 u, hydrogen is the lightest element and its monatom
ic form (H) is the most abundant chemical substance, constituting roughly 75% of
the Universe's baryonic mass. "
ghci> pg <- page "Haskell (programming language)"
ghci> :type pg
pg :: Maybe WikipediaPage
```
Aether is designed to be simple and easy to use.
Developers in need of a complete Haskell binding to MediaWiki API
should consult the [mediawiki](http://hackage.haskell.org/package/mediawiki) package.
Installation
------------
After downloading/cloning the source repository,
install Aether from the main directory using [cabal-install](http://www.haskell.org/haskellwiki/Cabal-Install):
$ cabal install aether.cabal
Contributing
------------
Aether is a work-in-progress. Pull requests are most certainly welcome!
License and credits
-------------------
* Aether is licensed under the MIT License. See the `LICENSE` file for details.
* Aether is substantially based on the [goldsmith/Wikipedia](http://github.com/goldsmith/Wikipedia) Python library.
| Add basic overview and project information | Add basic overview and project information | Markdown | mit | guoguo12/aether | markdown | ## Code Before:
aether
======
A simple Haskell API for finding and accessing data from Wikipedia.
## Instruction:
Add basic overview and project information
## Code After:
Aether
======
**Aether** is simple Haskell API for finding and accessing data from Wikipedia.
Search Wikipedia, fetch search suggestions, get article summaries, and more!
Aether puts the power of the [MediaWiki API](http://www.mediawiki.org/wiki/API) at your fingertips.
Overview
--------
```Haskell
ghci> import Aether
ghci> search "Git"
["Nashim","Git","GITS","Git (software)","GitHub","Guitar","Georgia Institute of
Technology","Digestion","Git (slang)","Human gastrointestinal tract"]
ghci> suggest "Pysics"
["Physics"]
ghci> summary "Hydrogen"
"Hydrogen is a chemical element with chemical symbol H and atomic number 1. With
an atomic weight of 1.00794 u, hydrogen is the lightest element and its monatom
ic form (H) is the most abundant chemical substance, constituting roughly 75% of
the Universe's baryonic mass. "
ghci> pg <- page "Haskell (programming language)"
ghci> :type pg
pg :: Maybe WikipediaPage
```
Aether is designed to be simple and easy to use.
Developers in need of a complete Haskell binding to MediaWiki API
should consult the [mediawiki](http://hackage.haskell.org/package/mediawiki) package.
Installation
------------
After downloading/cloning the source repository,
install Aether from the main directory using [cabal-install](http://www.haskell.org/haskellwiki/Cabal-Install):
$ cabal install aether.cabal
Contributing
------------
Aether is a work-in-progress. Pull requests are most certainly welcome!
License and credits
-------------------
* Aether is licensed under the MIT License. See the `LICENSE` file for details.
* Aether is substantially based on the [goldsmith/Wikipedia](http://github.com/goldsmith/Wikipedia) Python library.
| - aether
? ^
+ Aether
? ^
======
- A simple Haskell API for finding and accessing data from Wikipedia.
+ **Aether** is simple Haskell API for finding and accessing data from Wikipedia.
? ++ ++++++++++
+
+ Search Wikipedia, fetch search suggestions, get article summaries, and more!
+ Aether puts the power of the [MediaWiki API](http://www.mediawiki.org/wiki/API) at your fingertips.
+
+ Overview
+ --------
+
+ ```Haskell
+ ghci> import Aether
+
+ ghci> search "Git"
+ ["Nashim","Git","GITS","Git (software)","GitHub","Guitar","Georgia Institute of
+ Technology","Digestion","Git (slang)","Human gastrointestinal tract"]
+
+ ghci> suggest "Pysics"
+ ["Physics"]
+
+ ghci> summary "Hydrogen"
+ "Hydrogen is a chemical element with chemical symbol H and atomic number 1. With
+ an atomic weight of 1.00794 u, hydrogen is the lightest element and its monatom
+ ic form (H) is the most abundant chemical substance, constituting roughly 75% of
+ the Universe's baryonic mass. "
+
+ ghci> pg <- page "Haskell (programming language)"
+ ghci> :type pg
+ pg :: Maybe WikipediaPage
+ ```
+
+ Aether is designed to be simple and easy to use.
+ Developers in need of a complete Haskell binding to MediaWiki API
+ should consult the [mediawiki](http://hackage.haskell.org/package/mediawiki) package.
+
+ Installation
+ ------------
+
+ After downloading/cloning the source repository,
+ install Aether from the main directory using [cabal-install](http://www.haskell.org/haskellwiki/Cabal-Install):
+
+ $ cabal install aether.cabal
+
+ Contributing
+ ------------
+
+ Aether is a work-in-progress. Pull requests are most certainly welcome!
+
+ License and credits
+ -------------------
+
+ * Aether is licensed under the MIT License. See the `LICENSE` file for details.
+ * Aether is substantially based on the [goldsmith/Wikipedia](http://github.com/goldsmith/Wikipedia) Python library. | 54 | 13.5 | 52 | 2 |
7ded700d8c344388bf9496ab779f06a797ea47d9 | src/main/java/org/cyclops/cyclopscore/inventory/container/InventoryContainer.java | src/main/java/org/cyclops/cyclopscore/inventory/container/InventoryContainer.java | package org.cyclops.cyclopscore.inventory.container;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.container.ContainerType;
import javax.annotation.Nullable;
/**
* A container for an inventory.
* @author rubensworks
*/
public abstract class InventoryContainer extends ContainerExtended {
protected final IInventory inventory;
public InventoryContainer(@Nullable ContainerType<?> type, int id, PlayerInventory playerInventory, IInventory inventory) {
super(type, id, playerInventory);
this.inventory = inventory;
assertInventorySize(inventory, getSizeInventory());
this.inventory.openInventory(playerInventory.player);
}
public IInventory getContainerInventory() {
return inventory;
}
@Override
protected int getSizeInventory() {
return inventory.getSizeInventory();
}
@Override
public boolean canInteractWith(PlayerEntity player) {
return this.inventory.isUsableByPlayer(player);
}
@Override
public void onContainerClosed(PlayerEntity player) {
super.onContainerClosed(player);
this.inventory.closeInventory(player);
}
}
| package org.cyclops.cyclopscore.inventory.container;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.container.ContainerType;
import javax.annotation.Nullable;
/**
* A container for an inventory.
* @author rubensworks
*/
public abstract class InventoryContainer extends ContainerExtended {
protected final IInventory inventory;
public InventoryContainer(@Nullable ContainerType<?> type, int id, PlayerInventory playerInventory, IInventory inventory) {
super(type, id, playerInventory);
this.inventory = inventory;
if (isAssertInventorySize()) {
assertInventorySize(inventory, getSizeInventory());
}
this.inventory.openInventory(playerInventory.player);
}
protected boolean isAssertInventorySize() {
return true;
}
public IInventory getContainerInventory() {
return inventory;
}
@Override
protected int getSizeInventory() {
return inventory.getSizeInventory();
}
@Override
public boolean canInteractWith(PlayerEntity player) {
return this.inventory.isUsableByPlayer(player);
}
@Override
public void onContainerClosed(PlayerEntity player) {
super.onContainerClosed(player);
this.inventory.closeInventory(player);
}
}
| Allow inventory size assertion to be skipped | Allow inventory size assertion to be skipped
| Java | mit | CyclopsMC/CyclopsCore | java | ## Code Before:
package org.cyclops.cyclopscore.inventory.container;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.container.ContainerType;
import javax.annotation.Nullable;
/**
* A container for an inventory.
* @author rubensworks
*/
public abstract class InventoryContainer extends ContainerExtended {
protected final IInventory inventory;
public InventoryContainer(@Nullable ContainerType<?> type, int id, PlayerInventory playerInventory, IInventory inventory) {
super(type, id, playerInventory);
this.inventory = inventory;
assertInventorySize(inventory, getSizeInventory());
this.inventory.openInventory(playerInventory.player);
}
public IInventory getContainerInventory() {
return inventory;
}
@Override
protected int getSizeInventory() {
return inventory.getSizeInventory();
}
@Override
public boolean canInteractWith(PlayerEntity player) {
return this.inventory.isUsableByPlayer(player);
}
@Override
public void onContainerClosed(PlayerEntity player) {
super.onContainerClosed(player);
this.inventory.closeInventory(player);
}
}
## Instruction:
Allow inventory size assertion to be skipped
## Code After:
package org.cyclops.cyclopscore.inventory.container;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.container.ContainerType;
import javax.annotation.Nullable;
/**
* A container for an inventory.
* @author rubensworks
*/
public abstract class InventoryContainer extends ContainerExtended {
protected final IInventory inventory;
public InventoryContainer(@Nullable ContainerType<?> type, int id, PlayerInventory playerInventory, IInventory inventory) {
super(type, id, playerInventory);
this.inventory = inventory;
if (isAssertInventorySize()) {
assertInventorySize(inventory, getSizeInventory());
}
this.inventory.openInventory(playerInventory.player);
}
protected boolean isAssertInventorySize() {
return true;
}
public IInventory getContainerInventory() {
return inventory;
}
@Override
protected int getSizeInventory() {
return inventory.getSizeInventory();
}
@Override
public boolean canInteractWith(PlayerEntity player) {
return this.inventory.isUsableByPlayer(player);
}
@Override
public void onContainerClosed(PlayerEntity player) {
super.onContainerClosed(player);
this.inventory.closeInventory(player);
}
}
| package org.cyclops.cyclopscore.inventory.container;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.container.ContainerType;
import javax.annotation.Nullable;
/**
* A container for an inventory.
* @author rubensworks
*/
public abstract class InventoryContainer extends ContainerExtended {
protected final IInventory inventory;
public InventoryContainer(@Nullable ContainerType<?> type, int id, PlayerInventory playerInventory, IInventory inventory) {
super(type, id, playerInventory);
this.inventory = inventory;
+ if (isAssertInventorySize()) {
- assertInventorySize(inventory, getSizeInventory());
+ assertInventorySize(inventory, getSizeInventory());
? +
+ }
this.inventory.openInventory(playerInventory.player);
+ }
+
+ protected boolean isAssertInventorySize() {
+ return true;
}
public IInventory getContainerInventory() {
return inventory;
}
@Override
protected int getSizeInventory() {
return inventory.getSizeInventory();
}
@Override
public boolean canInteractWith(PlayerEntity player) {
return this.inventory.isUsableByPlayer(player);
}
@Override
public void onContainerClosed(PlayerEntity player) {
super.onContainerClosed(player);
this.inventory.closeInventory(player);
}
} | 8 | 0.181818 | 7 | 1 |
3f00cc7577fdcce49b04463646dd1db5a66bd331 | README.md | README.md | node-releases-experiments
=========================
https://github.com/rsp/node-releases-experiments
Some experiments performed on the releases of [Node.js](https://nodejs.org/).
Prerequisites
-------------
* [Bash](https://www.gnu.org/software/bash/)
* [cURL](http://curl.haxx.se/)
* [grep](https://en.wikipedia.org/wiki/Grep) with Perl regular expression support (like [GNU Grep](http://www.gnu.org/software/grep/))
It should work on any standard Linux/Unix distribution. If it doesn't,
please [sumbit an issue](https://github.com/rsp/node-releases-experiments/issues).
Commands
--------
### `dist-versions`
Usage: `./dist-versions`
Prints the versions of Node that have their own directory (not just single tarballs).
Author
------
Rafał Pocztarski - https://github.com/rsp
License
-------
MIT License (Expat). See [LICENSE.md](LICENSE.md) for details.
| node-releases-experiments
=========================
https://github.com/rsp/node-releases-experiments
Some experiments performed on the releases of [Node.js](https://nodejs.org/).
Prerequisites
-------------
* [Bash](https://www.gnu.org/software/bash/)
* [cURL](http://curl.haxx.se/)
* [grep](https://en.wikipedia.org/wiki/Grep) with Perl regular expression support (like [GNU Grep](http://www.gnu.org/software/grep/))
It should work on any standard Linux/Unix distribution. If it doesn't,
please [sumbit an issue](https://github.com/rsp/node-releases-experiments/issues).
It was written and tested on Ubuntu 14.04.
Commands
--------
### `dist-versions`
Usage: `./dist-versions`
Prints the versions of Node that have their own directory (not just single tarballs).
Author
------
Rafał Pocztarski - https://github.com/rsp
License
-------
MIT License (Expat). See [LICENSE.md](LICENSE.md) for details.
| Add the OS it's tested on to readme | Add the OS it's tested on to readme
| Markdown | mit | rsp/node-experiments,rsp/node-experiments | markdown | ## Code Before:
node-releases-experiments
=========================
https://github.com/rsp/node-releases-experiments
Some experiments performed on the releases of [Node.js](https://nodejs.org/).
Prerequisites
-------------
* [Bash](https://www.gnu.org/software/bash/)
* [cURL](http://curl.haxx.se/)
* [grep](https://en.wikipedia.org/wiki/Grep) with Perl regular expression support (like [GNU Grep](http://www.gnu.org/software/grep/))
It should work on any standard Linux/Unix distribution. If it doesn't,
please [sumbit an issue](https://github.com/rsp/node-releases-experiments/issues).
Commands
--------
### `dist-versions`
Usage: `./dist-versions`
Prints the versions of Node that have their own directory (not just single tarballs).
Author
------
Rafał Pocztarski - https://github.com/rsp
License
-------
MIT License (Expat). See [LICENSE.md](LICENSE.md) for details.
## Instruction:
Add the OS it's tested on to readme
## Code After:
node-releases-experiments
=========================
https://github.com/rsp/node-releases-experiments
Some experiments performed on the releases of [Node.js](https://nodejs.org/).
Prerequisites
-------------
* [Bash](https://www.gnu.org/software/bash/)
* [cURL](http://curl.haxx.se/)
* [grep](https://en.wikipedia.org/wiki/Grep) with Perl regular expression support (like [GNU Grep](http://www.gnu.org/software/grep/))
It should work on any standard Linux/Unix distribution. If it doesn't,
please [sumbit an issue](https://github.com/rsp/node-releases-experiments/issues).
It was written and tested on Ubuntu 14.04.
Commands
--------
### `dist-versions`
Usage: `./dist-versions`
Prints the versions of Node that have their own directory (not just single tarballs).
Author
------
Rafał Pocztarski - https://github.com/rsp
License
-------
MIT License (Expat). See [LICENSE.md](LICENSE.md) for details.
| node-releases-experiments
=========================
https://github.com/rsp/node-releases-experiments
Some experiments performed on the releases of [Node.js](https://nodejs.org/).
Prerequisites
-------------
* [Bash](https://www.gnu.org/software/bash/)
* [cURL](http://curl.haxx.se/)
* [grep](https://en.wikipedia.org/wiki/Grep) with Perl regular expression support (like [GNU Grep](http://www.gnu.org/software/grep/))
It should work on any standard Linux/Unix distribution. If it doesn't,
please [sumbit an issue](https://github.com/rsp/node-releases-experiments/issues).
+
+ It was written and tested on Ubuntu 14.04.
Commands
--------
### `dist-versions`
Usage: `./dist-versions`
Prints the versions of Node that have their own directory (not just single tarballs).
Author
------
Rafał Pocztarski - https://github.com/rsp
License
-------
MIT License (Expat). See [LICENSE.md](LICENSE.md) for details. | 2 | 0.0625 | 2 | 0 |
a01cdca9d1e8864bba1bc026a3f2b819591a0338 | pkgs/development/libraries/nss_wrapper/default.nix | pkgs/development/libraries/nss_wrapper/default.nix | { stdenv, fetchurl, cmake, pkgconfig }:
stdenv.mkDerivation rec {
name = "nss_wrapper-1.0.3";
src = fetchurl {
url = "mirror://samba/cwrap/${name}.tar.gz";
sha256 = "0bysdijvi9n0jk74iklbfhbp0kvv81a727lcfd5q03q2hkzjfm18";
};
buildInputs = [ cmake pkgconfig (stdenv.cc.libc.out or null) ];
# outputs TODO: missing glibc.out might become a general problem
meta = with stdenv.lib; {
description = "A wrapper for the user, group and hosts NSS API";
homepage = "https://git.samba.org/?p=nss_wrapper.git;a=summary";
license = licenses.bsd3;
maintainers = with maintainers; [ wkennington ];
platforms = platforms.all;
};
}
| { stdenv, fetchurl, cmake, pkgconfig }:
stdenv.mkDerivation rec {
name = "nss_wrapper-1.0.3";
src = fetchurl {
url = "mirror://samba/cwrap/${name}.tar.gz";
sha256 = "0bysdijvi9n0jk74iklbfhbp0kvv81a727lcfd5q03q2hkzjfm18";
};
buildInputs = [ cmake pkgconfig ];
meta = with stdenv.lib; {
description = "A wrapper for the user, group and hosts NSS API";
homepage = "https://git.samba.org/?p=nss_wrapper.git;a=summary";
license = licenses.bsd3;
maintainers = with maintainers; [ wkennington ];
platforms = platforms.all;
};
}
| Remove glibc from build inputs hack | nss_wrapper: Remove glibc from build inputs hack
Not needed anymore after #14668
| Nix | mit | NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs | nix | ## Code Before:
{ stdenv, fetchurl, cmake, pkgconfig }:
stdenv.mkDerivation rec {
name = "nss_wrapper-1.0.3";
src = fetchurl {
url = "mirror://samba/cwrap/${name}.tar.gz";
sha256 = "0bysdijvi9n0jk74iklbfhbp0kvv81a727lcfd5q03q2hkzjfm18";
};
buildInputs = [ cmake pkgconfig (stdenv.cc.libc.out or null) ];
# outputs TODO: missing glibc.out might become a general problem
meta = with stdenv.lib; {
description = "A wrapper for the user, group and hosts NSS API";
homepage = "https://git.samba.org/?p=nss_wrapper.git;a=summary";
license = licenses.bsd3;
maintainers = with maintainers; [ wkennington ];
platforms = platforms.all;
};
}
## Instruction:
nss_wrapper: Remove glibc from build inputs hack
Not needed anymore after #14668
## Code After:
{ stdenv, fetchurl, cmake, pkgconfig }:
stdenv.mkDerivation rec {
name = "nss_wrapper-1.0.3";
src = fetchurl {
url = "mirror://samba/cwrap/${name}.tar.gz";
sha256 = "0bysdijvi9n0jk74iklbfhbp0kvv81a727lcfd5q03q2hkzjfm18";
};
buildInputs = [ cmake pkgconfig ];
meta = with stdenv.lib; {
description = "A wrapper for the user, group and hosts NSS API";
homepage = "https://git.samba.org/?p=nss_wrapper.git;a=summary";
license = licenses.bsd3;
maintainers = with maintainers; [ wkennington ];
platforms = platforms.all;
};
}
| { stdenv, fetchurl, cmake, pkgconfig }:
stdenv.mkDerivation rec {
name = "nss_wrapper-1.0.3";
src = fetchurl {
url = "mirror://samba/cwrap/${name}.tar.gz";
sha256 = "0bysdijvi9n0jk74iklbfhbp0kvv81a727lcfd5q03q2hkzjfm18";
};
+ buildInputs = [ cmake pkgconfig ];
- buildInputs = [ cmake pkgconfig (stdenv.cc.libc.out or null) ];
- # outputs TODO: missing glibc.out might become a general problem
meta = with stdenv.lib; {
description = "A wrapper for the user, group and hosts NSS API";
homepage = "https://git.samba.org/?p=nss_wrapper.git;a=summary";
license = licenses.bsd3;
maintainers = with maintainers; [ wkennington ];
platforms = platforms.all;
};
} | 3 | 0.142857 | 1 | 2 |
a4443b203db029fe5ee7df682ca372259b3e4f1c | models/index.js | models/index.js | 'use strict';
var mongoose = require('mongoose');
mongoose.model('User', require('./User'));
mongoose.connect("mongodb://localhost/passport-lesson");
module.exports = mongoose;
| 'use strict';
var mongoose = require('mongoose');
mongoose.Promise = Promise;
mongoose.model('User', require('./User'));
mongoose.connect("mongodb://localhost/passport-lesson");
module.exports = mongoose;
| Set mongoose to use native promises | Set mongoose to use native promises
| JavaScript | mit | dhuddell/teachers-lounge-back-end | javascript | ## Code Before:
'use strict';
var mongoose = require('mongoose');
mongoose.model('User', require('./User'));
mongoose.connect("mongodb://localhost/passport-lesson");
module.exports = mongoose;
## Instruction:
Set mongoose to use native promises
## Code After:
'use strict';
var mongoose = require('mongoose');
mongoose.Promise = Promise;
mongoose.model('User', require('./User'));
mongoose.connect("mongodb://localhost/passport-lesson");
module.exports = mongoose;
| 'use strict';
var mongoose = require('mongoose');
+ mongoose.Promise = Promise;
mongoose.model('User', require('./User'));
mongoose.connect("mongodb://localhost/passport-lesson");
module.exports = mongoose; | 1 | 0.111111 | 1 | 0 |
670bb89a1a2f007b669e16040078a4fc4faf393f | README.rst | README.rst | IATI NonEmbedded Codelists
==========================
These are codelists used by the IATI Standard, but not "Embedded" within it, so not subject to the same change control progress. For more information see https://github.com/IATI/IATI-Codelists#embedded-vs-nonembedded-codelists
| IATI NonEmbedded Codelists
==========================
.. image:: https://travis-ci.org/IATI/IATI-Codelists-NonEmbedded.svg?branch=master
:target: https://travis-ci.org/IATI/IATI-Codelists-NonEmbedded
.. image:: https://requires.io/github/IATI/IATI-Codelists-NonEmbedded/requirements.svg?branch=master
:target: https://requires.io/github/IATI/IATI-Codelists-NonEmbedded/requirements/?branch=master
:alt: Requirements Status
.. image:: https://img.shields.io/badge/license-MIT-blue.svg
:target: https://github.com/IATI/IATI-Codelists-NonEmbedded/blob/master/LICENSE
Introduction
------------
These are codelists used by the IATI Standard, but not "Embedded" within it, so not subject to the same change control progress. For more information see https://github.com/IATI/IATI-Codelists#embedded-vs-nonembedded-codelists
| Add badges for travis, requires.io and license | Add badges for travis, requires.io and license | reStructuredText | mit | yshalenyk/IATI-Codelists-NonEmbedded,yshalenyk/IATI-Codelists-NonEmbedded | restructuredtext | ## Code Before:
IATI NonEmbedded Codelists
==========================
These are codelists used by the IATI Standard, but not "Embedded" within it, so not subject to the same change control progress. For more information see https://github.com/IATI/IATI-Codelists#embedded-vs-nonembedded-codelists
## Instruction:
Add badges for travis, requires.io and license
## Code After:
IATI NonEmbedded Codelists
==========================
.. image:: https://travis-ci.org/IATI/IATI-Codelists-NonEmbedded.svg?branch=master
:target: https://travis-ci.org/IATI/IATI-Codelists-NonEmbedded
.. image:: https://requires.io/github/IATI/IATI-Codelists-NonEmbedded/requirements.svg?branch=master
:target: https://requires.io/github/IATI/IATI-Codelists-NonEmbedded/requirements/?branch=master
:alt: Requirements Status
.. image:: https://img.shields.io/badge/license-MIT-blue.svg
:target: https://github.com/IATI/IATI-Codelists-NonEmbedded/blob/master/LICENSE
Introduction
------------
These are codelists used by the IATI Standard, but not "Embedded" within it, so not subject to the same change control progress. For more information see https://github.com/IATI/IATI-Codelists#embedded-vs-nonembedded-codelists
| IATI NonEmbedded Codelists
==========================
+ .. image:: https://travis-ci.org/IATI/IATI-Codelists-NonEmbedded.svg?branch=master
+ :target: https://travis-ci.org/IATI/IATI-Codelists-NonEmbedded
+ .. image:: https://requires.io/github/IATI/IATI-Codelists-NonEmbedded/requirements.svg?branch=master
+ :target: https://requires.io/github/IATI/IATI-Codelists-NonEmbedded/requirements/?branch=master
+ :alt: Requirements Status
+ .. image:: https://img.shields.io/badge/license-MIT-blue.svg
+ :target: https://github.com/IATI/IATI-Codelists-NonEmbedded/blob/master/LICENSE
+
+ Introduction
+ ------------
+
These are codelists used by the IATI Standard, but not "Embedded" within it, so not subject to the same change control progress. For more information see https://github.com/IATI/IATI-Codelists#embedded-vs-nonembedded-codelists | 11 | 2.75 | 11 | 0 |
6ab3f670e462cf4828874e6556e5719d6de6ae55 | README.md | README.md | StudyPack
=========
A simple project to study packaging with CMake/CPack.
Topics to be looked at:
* Customized STGZ template to allow pre/post install operations.
* Checking required packages (STGZ and PackageMaker).
* Download of components (e.g. large data files).
* Use of BundleUtilities.
* Uninstallers.
The StudyPack application is just a simple C++ "Hello World" for now.
We'll add more complexity (use of system/third-party libraries, GUI) later.
| StudyPack
=========
A simple project to study packaging with CMake/CPack.
Topics to be looked at:
* Customized STGZ template to allow pre/post install operations.
* Checking required packages (STGZ and PackageMaker).
* Download of components (e.g. large data files).
* Use of BundleUtilities.
* Update of hardcoded paths in installed files to new location.
* Uninstallers.
The StudyPack application is just a simple C++ "Hello World" for now.
We'll add more complexity (use of system/third-party libraries, GUI) later.
| Add topic on fixing up hardcoded paths. | Add topic on fixing up hardcoded paths.
| Markdown | bsd-3-clause | drbenmorgan/StudyPack | markdown | ## Code Before:
StudyPack
=========
A simple project to study packaging with CMake/CPack.
Topics to be looked at:
* Customized STGZ template to allow pre/post install operations.
* Checking required packages (STGZ and PackageMaker).
* Download of components (e.g. large data files).
* Use of BundleUtilities.
* Uninstallers.
The StudyPack application is just a simple C++ "Hello World" for now.
We'll add more complexity (use of system/third-party libraries, GUI) later.
## Instruction:
Add topic on fixing up hardcoded paths.
## Code After:
StudyPack
=========
A simple project to study packaging with CMake/CPack.
Topics to be looked at:
* Customized STGZ template to allow pre/post install operations.
* Checking required packages (STGZ and PackageMaker).
* Download of components (e.g. large data files).
* Use of BundleUtilities.
* Update of hardcoded paths in installed files to new location.
* Uninstallers.
The StudyPack application is just a simple C++ "Hello World" for now.
We'll add more complexity (use of system/third-party libraries, GUI) later.
| StudyPack
=========
A simple project to study packaging with CMake/CPack.
Topics to be looked at:
* Customized STGZ template to allow pre/post install operations.
* Checking required packages (STGZ and PackageMaker).
* Download of components (e.g. large data files).
* Use of BundleUtilities.
+ * Update of hardcoded paths in installed files to new location.
* Uninstallers.
The StudyPack application is just a simple C++ "Hello World" for now.
We'll add more complexity (use of system/third-party libraries, GUI) later.
| 1 | 0.058824 | 1 | 0 |
21ffb3e4479c049597ce48a49a789c69e0c72caf | Examples/Misc/test.sh | Examples/Misc/test.sh | if [ $# -ne 2 ]
then
echo "test.sh: Error: Argument must be the Specware installation to test and ISABELLE_2013_2_ROOT."
exit 1
fi
SPECWARE4=$1
ISABELLE_2013_2_ROOT=$2
run-proc.sh ${SPECWARE4} TwoMorphisms#A
run-proc.sh ${SPECWARE4} TwoMorphisms#B
run-proc.sh ${SPECWARE4} TwoMorphisms#CheckRqmtsB
run-proc.sh ${SPECWARE4} TwoMorphisms#C
run-proc.sh ${SPECWARE4} TwoMorphisms#CheckRqmtsC
run-gen-obligs.sh ${SPECWARE4} TwoMorphisms#A
run-gen-obligs.sh ${SPECWARE4} TwoMorphisms#B
run-gen-obligs.sh ${SPECWARE4} TwoMorphisms#CheckRqmtsB
run-gen-obligs.sh ${SPECWARE4} TwoMorphisms#C
run-gen-obligs.sh ${SPECWARE4} TwoMorphisms#CheckRqmtsC
run-isabelle2013-2.sh Isa/TwoMorphisms_CheckRqmtsC.thy ${ISABELLE_2013_2_ROOT}
| if [ $# -ne 2 ]
then
echo "test.sh: Error: Argument must be the Specware installation to test and ISABELLE_2013_2_ROOT."
exit 1
fi
SPECWARE4=$1
ISABELLE_2013_2_ROOT=$2
run-proc.sh ${SPECWARE4} ${SPECWARE4}/Examples/Misc/TwoMorphisms#A
run-proc.sh ${SPECWARE4} ${SPECWARE4}/Examples/Misc/TwoMorphisms#B
run-proc.sh ${SPECWARE4} ${SPECWARE4}/Examples/Misc/TwoMorphisms#CheckRqmtsB
run-proc.sh ${SPECWARE4} ${SPECWARE4}/Examples/Misc/TwoMorphisms#C
run-proc.sh ${SPECWARE4} ${SPECWARE4}/Examples/Misc/TwoMorphisms#CheckRqmtsC
run-gen-obligs.sh ${SPECWARE4} ${SPECWARE4}/Examples/Misc/TwoMorphisms#A
run-gen-obligs.sh ${SPECWARE4} ${SPECWARE4}/Examples/Misc/TwoMorphisms#B
run-gen-obligs.sh ${SPECWARE4} ${SPECWARE4}/Examples/Misc/TwoMorphisms#CheckRqmtsB
run-gen-obligs.sh ${SPECWARE4} ${SPECWARE4}/Examples/Misc/TwoMorphisms#C
run-gen-obligs.sh ${SPECWARE4} ${SPECWARE4}/Examples/Misc/TwoMorphisms#CheckRqmtsC
run-isabelle2013-2.sh ${SPECWARE4}/Examples/Misc/Isa/TwoMorphisms_CheckRqmtsC.thy ${ISABELLE_2013_2_ROOT}
| Fix script to not require CDing into directory first. | Fix script to not require CDing into directory first.
git-svn-id: 9ecf60ce9baff443e30a0472d3fd222fcb8117cf@9299 7b97033b-253e-4a5c-9b07-e25f9089a9fd
| Shell | bsd-2-clause | KestrelInstitute/Specware,KestrelInstitute/Specware,KestrelInstitute/Specware,KestrelInstitute/Specware,KestrelInstitute/Specware | shell | ## Code Before:
if [ $# -ne 2 ]
then
echo "test.sh: Error: Argument must be the Specware installation to test and ISABELLE_2013_2_ROOT."
exit 1
fi
SPECWARE4=$1
ISABELLE_2013_2_ROOT=$2
run-proc.sh ${SPECWARE4} TwoMorphisms#A
run-proc.sh ${SPECWARE4} TwoMorphisms#B
run-proc.sh ${SPECWARE4} TwoMorphisms#CheckRqmtsB
run-proc.sh ${SPECWARE4} TwoMorphisms#C
run-proc.sh ${SPECWARE4} TwoMorphisms#CheckRqmtsC
run-gen-obligs.sh ${SPECWARE4} TwoMorphisms#A
run-gen-obligs.sh ${SPECWARE4} TwoMorphisms#B
run-gen-obligs.sh ${SPECWARE4} TwoMorphisms#CheckRqmtsB
run-gen-obligs.sh ${SPECWARE4} TwoMorphisms#C
run-gen-obligs.sh ${SPECWARE4} TwoMorphisms#CheckRqmtsC
run-isabelle2013-2.sh Isa/TwoMorphisms_CheckRqmtsC.thy ${ISABELLE_2013_2_ROOT}
## Instruction:
Fix script to not require CDing into directory first.
git-svn-id: 9ecf60ce9baff443e30a0472d3fd222fcb8117cf@9299 7b97033b-253e-4a5c-9b07-e25f9089a9fd
## Code After:
if [ $# -ne 2 ]
then
echo "test.sh: Error: Argument must be the Specware installation to test and ISABELLE_2013_2_ROOT."
exit 1
fi
SPECWARE4=$1
ISABELLE_2013_2_ROOT=$2
run-proc.sh ${SPECWARE4} ${SPECWARE4}/Examples/Misc/TwoMorphisms#A
run-proc.sh ${SPECWARE4} ${SPECWARE4}/Examples/Misc/TwoMorphisms#B
run-proc.sh ${SPECWARE4} ${SPECWARE4}/Examples/Misc/TwoMorphisms#CheckRqmtsB
run-proc.sh ${SPECWARE4} ${SPECWARE4}/Examples/Misc/TwoMorphisms#C
run-proc.sh ${SPECWARE4} ${SPECWARE4}/Examples/Misc/TwoMorphisms#CheckRqmtsC
run-gen-obligs.sh ${SPECWARE4} ${SPECWARE4}/Examples/Misc/TwoMorphisms#A
run-gen-obligs.sh ${SPECWARE4} ${SPECWARE4}/Examples/Misc/TwoMorphisms#B
run-gen-obligs.sh ${SPECWARE4} ${SPECWARE4}/Examples/Misc/TwoMorphisms#CheckRqmtsB
run-gen-obligs.sh ${SPECWARE4} ${SPECWARE4}/Examples/Misc/TwoMorphisms#C
run-gen-obligs.sh ${SPECWARE4} ${SPECWARE4}/Examples/Misc/TwoMorphisms#CheckRqmtsC
run-isabelle2013-2.sh ${SPECWARE4}/Examples/Misc/Isa/TwoMorphisms_CheckRqmtsC.thy ${ISABELLE_2013_2_ROOT}
| if [ $# -ne 2 ]
then
echo "test.sh: Error: Argument must be the Specware installation to test and ISABELLE_2013_2_ROOT."
exit 1
fi
SPECWARE4=$1
ISABELLE_2013_2_ROOT=$2
- run-proc.sh ${SPECWARE4} TwoMorphisms#A
- run-proc.sh ${SPECWARE4} TwoMorphisms#B
+ run-proc.sh ${SPECWARE4} ${SPECWARE4}/Examples/Misc/TwoMorphisms#A
+ run-proc.sh ${SPECWARE4} ${SPECWARE4}/Examples/Misc/TwoMorphisms#B
- run-proc.sh ${SPECWARE4} TwoMorphisms#CheckRqmtsB
+ run-proc.sh ${SPECWARE4} ${SPECWARE4}/Examples/Misc/TwoMorphisms#CheckRqmtsB
? +++++++++++++++++++++++++++
- run-proc.sh ${SPECWARE4} TwoMorphisms#C
+ run-proc.sh ${SPECWARE4} ${SPECWARE4}/Examples/Misc/TwoMorphisms#C
- run-proc.sh ${SPECWARE4} TwoMorphisms#CheckRqmtsC
+ run-proc.sh ${SPECWARE4} ${SPECWARE4}/Examples/Misc/TwoMorphisms#CheckRqmtsC
? +++++++++++++++++++++++++++
- run-gen-obligs.sh ${SPECWARE4} TwoMorphisms#A
+ run-gen-obligs.sh ${SPECWARE4} ${SPECWARE4}/Examples/Misc/TwoMorphisms#A
? +++++++++++++++++++++++++++
- run-gen-obligs.sh ${SPECWARE4} TwoMorphisms#B
+ run-gen-obligs.sh ${SPECWARE4} ${SPECWARE4}/Examples/Misc/TwoMorphisms#B
? +++++++++++++++++++++++++++
- run-gen-obligs.sh ${SPECWARE4} TwoMorphisms#CheckRqmtsB
+ run-gen-obligs.sh ${SPECWARE4} ${SPECWARE4}/Examples/Misc/TwoMorphisms#CheckRqmtsB
? +++++++++++++++++++++++++++
- run-gen-obligs.sh ${SPECWARE4} TwoMorphisms#C
+ run-gen-obligs.sh ${SPECWARE4} ${SPECWARE4}/Examples/Misc/TwoMorphisms#C
? +++++++++++++++++++++++++++
- run-gen-obligs.sh ${SPECWARE4} TwoMorphisms#CheckRqmtsC
+ run-gen-obligs.sh ${SPECWARE4} ${SPECWARE4}/Examples/Misc/TwoMorphisms#CheckRqmtsC
? +++++++++++++++++++++++++++
- run-isabelle2013-2.sh Isa/TwoMorphisms_CheckRqmtsC.thy ${ISABELLE_2013_2_ROOT}
+ run-isabelle2013-2.sh ${SPECWARE4}/Examples/Misc/Isa/TwoMorphisms_CheckRqmtsC.thy ${ISABELLE_2013_2_ROOT}
? +++++++++++++++++++++++++++
| 22 | 1.1 | 11 | 11 |
9b20915ab02e908eb9758829d2307c92973a46bc | build.sbt | build.sbt |
sbtPlugin := true
organization := "com.typesafe.sbt"
name := "sbt-aspectj"
version := "0.8.2-SNAPSHOT"
libraryDependencies += "org.aspectj" % "aspectjtools" % "1.7.2"
publishMavenStyle := false
publishTo <<= (version) { v =>
def scalasbt(repo: String) = ("scalasbt " + repo, "http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-" + repo)
val (name, repo) = if (v.endsWith("-SNAPSHOT")) scalasbt("snapshots") else scalasbt("releases")
Some(Resolver.url(name, url(repo))(Resolver.ivyStylePatterns))
}
ScriptedPlugin.scriptedSettings
|
sbtPlugin := true
organization := "com.typesafe.sbt"
name := "sbt-aspectj"
version := "0.8.2-SNAPSHOT"
libraryDependencies += "org.aspectj" % "aspectjtools" % "1.7.2"
publishMavenStyle := false
publishTo <<= (version) { v =>
def scalasbt(repo: String) = ("scalasbt " + repo, "http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-" + repo)
val (name, repo) = if (v.endsWith("-SNAPSHOT")) scalasbt("snapshots") else scalasbt("releases")
Some(Resolver.url(name, url(repo))(Resolver.ivyStylePatterns))
}
ScriptedPlugin.scriptedSettings
scriptedLaunchOpts := Seq("-Xms512m", "-Xmx512m", "-XX:MaxPermSize=256m")
| Increase memory options for scripted tests | Increase memory options for scripted tests
| Scala | apache-2.0 | digimead-specific/sbt-aop | scala | ## Code Before:
sbtPlugin := true
organization := "com.typesafe.sbt"
name := "sbt-aspectj"
version := "0.8.2-SNAPSHOT"
libraryDependencies += "org.aspectj" % "aspectjtools" % "1.7.2"
publishMavenStyle := false
publishTo <<= (version) { v =>
def scalasbt(repo: String) = ("scalasbt " + repo, "http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-" + repo)
val (name, repo) = if (v.endsWith("-SNAPSHOT")) scalasbt("snapshots") else scalasbt("releases")
Some(Resolver.url(name, url(repo))(Resolver.ivyStylePatterns))
}
ScriptedPlugin.scriptedSettings
## Instruction:
Increase memory options for scripted tests
## Code After:
sbtPlugin := true
organization := "com.typesafe.sbt"
name := "sbt-aspectj"
version := "0.8.2-SNAPSHOT"
libraryDependencies += "org.aspectj" % "aspectjtools" % "1.7.2"
publishMavenStyle := false
publishTo <<= (version) { v =>
def scalasbt(repo: String) = ("scalasbt " + repo, "http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-" + repo)
val (name, repo) = if (v.endsWith("-SNAPSHOT")) scalasbt("snapshots") else scalasbt("releases")
Some(Resolver.url(name, url(repo))(Resolver.ivyStylePatterns))
}
ScriptedPlugin.scriptedSettings
scriptedLaunchOpts := Seq("-Xms512m", "-Xmx512m", "-XX:MaxPermSize=256m")
|
sbtPlugin := true
organization := "com.typesafe.sbt"
name := "sbt-aspectj"
version := "0.8.2-SNAPSHOT"
libraryDependencies += "org.aspectj" % "aspectjtools" % "1.7.2"
publishMavenStyle := false
publishTo <<= (version) { v =>
def scalasbt(repo: String) = ("scalasbt " + repo, "http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-" + repo)
val (name, repo) = if (v.endsWith("-SNAPSHOT")) scalasbt("snapshots") else scalasbt("releases")
Some(Resolver.url(name, url(repo))(Resolver.ivyStylePatterns))
}
ScriptedPlugin.scriptedSettings
+
+ scriptedLaunchOpts := Seq("-Xms512m", "-Xmx512m", "-XX:MaxPermSize=256m") | 2 | 0.1 | 2 | 0 |
0631a824e493d9987e063625e1a31926c02cb181 | README.md | README.md | Environment Preferences
==========
This is a place where I keep bash aliases, custom functions, and other preferences so that I can easily use keep them up-to-date across different environments.
---
To add the aliases and custom functions, add the following to your shell startup file (`~/.bashrc`, `~/.profile`, etc.):
`source ~/env-prefs/.bash_alias`
Then source the shell startup file:
`source ~/.bashrc`
---
To add custom Sublime settings, first navigate to the directory where `Preferences.sublime-settings` is stored. On a Mac, it might be:
`cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/`
Then remove and symlink the settings file:
`rm ./Preferences.sublime-settings`
`ln -s ~/env-prefs/Sublime\ Text/Preferences.sublime-settings ./Preferences.sublime-settings`
---
Feel free to contribute by adding your own helpful aliases and custom functions that others may find useful. Please note that I use this repo in conjunction with other private repos so that aliases or configurations that are strictly used in specific environments are not included here.
| Environment Preferences
==========
This is a place where I keep bash aliases, custom functions, and other preferences so that I can easily use keep them up-to-date across different environments.
To get started, begin by cloning this repo:
`cd ~/; git clone https://github.com/RevolutionTech/env-prefs.git`
---
To add the aliases and custom functions, add the following to your shell startup file (`~/.bashrc`, `~/.profile`, etc.):
`source ~/env-prefs/.bash_alias`
Then source the shell startup file:
`source ~/.bashrc`
---
To add custom Sublime settings, first navigate to the directory where `Preferences.sublime-settings` is stored. On a Mac, it might be:
`cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/`
Then remove and symlink the settings file:
`rm ./Preferences.sublime-settings`
`ln -s ~/env-prefs/Sublime\ Text/Preferences.sublime-settings ./Preferences.sublime-settings`
---
Feel free to contribute by adding your own helpful aliases and custom functions that others may find useful. Please note that I use this repo in conjunction with other private repos so that aliases or configurations that are strictly used in specific environments are not included here.
| Include instructions on how to clone | Include instructions on how to clone
| Markdown | isc | RevolutionTech/env-prefs | markdown | ## Code Before:
Environment Preferences
==========
This is a place where I keep bash aliases, custom functions, and other preferences so that I can easily use keep them up-to-date across different environments.
---
To add the aliases and custom functions, add the following to your shell startup file (`~/.bashrc`, `~/.profile`, etc.):
`source ~/env-prefs/.bash_alias`
Then source the shell startup file:
`source ~/.bashrc`
---
To add custom Sublime settings, first navigate to the directory where `Preferences.sublime-settings` is stored. On a Mac, it might be:
`cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/`
Then remove and symlink the settings file:
`rm ./Preferences.sublime-settings`
`ln -s ~/env-prefs/Sublime\ Text/Preferences.sublime-settings ./Preferences.sublime-settings`
---
Feel free to contribute by adding your own helpful aliases and custom functions that others may find useful. Please note that I use this repo in conjunction with other private repos so that aliases or configurations that are strictly used in specific environments are not included here.
## Instruction:
Include instructions on how to clone
## Code After:
Environment Preferences
==========
This is a place where I keep bash aliases, custom functions, and other preferences so that I can easily use keep them up-to-date across different environments.
To get started, begin by cloning this repo:
`cd ~/; git clone https://github.com/RevolutionTech/env-prefs.git`
---
To add the aliases and custom functions, add the following to your shell startup file (`~/.bashrc`, `~/.profile`, etc.):
`source ~/env-prefs/.bash_alias`
Then source the shell startup file:
`source ~/.bashrc`
---
To add custom Sublime settings, first navigate to the directory where `Preferences.sublime-settings` is stored. On a Mac, it might be:
`cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/`
Then remove and symlink the settings file:
`rm ./Preferences.sublime-settings`
`ln -s ~/env-prefs/Sublime\ Text/Preferences.sublime-settings ./Preferences.sublime-settings`
---
Feel free to contribute by adding your own helpful aliases and custom functions that others may find useful. Please note that I use this repo in conjunction with other private repos so that aliases or configurations that are strictly used in specific environments are not included here.
| Environment Preferences
==========
+
This is a place where I keep bash aliases, custom functions, and other preferences so that I can easily use keep them up-to-date across different environments.
+
+ To get started, begin by cloning this repo:
+
+ `cd ~/; git clone https://github.com/RevolutionTech/env-prefs.git`
---
To add the aliases and custom functions, add the following to your shell startup file (`~/.bashrc`, `~/.profile`, etc.):
`source ~/env-prefs/.bash_alias`
Then source the shell startup file:
`source ~/.bashrc`
---
To add custom Sublime settings, first navigate to the directory where `Preferences.sublime-settings` is stored. On a Mac, it might be:
`cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/`
Then remove and symlink the settings file:
`rm ./Preferences.sublime-settings`
`ln -s ~/env-prefs/Sublime\ Text/Preferences.sublime-settings ./Preferences.sublime-settings`
---
Feel free to contribute by adding your own helpful aliases and custom functions that others may find useful. Please note that I use this repo in conjunction with other private repos so that aliases or configurations that are strictly used in specific environments are not included here. | 5 | 0.172414 | 5 | 0 |
ed847eedaa66c2053d746e2826df65eb93be7cb8 | application/templates/user/register.mustache | application/templates/user/register.mustache | {{#i18n}}Register{{/i18n}}<br /><br />
{{#errors}}
- {{#i18n}}{{.}}{{/i18n}}<br />
{{/errors}}
<form action="" method="post">
Username: <input type="text" name="username">
Password: <input type="text" name="password">
Email: <input type="text" name="email">
<input type="submit" value="Register">
</form>
| {{#i18n}}Register{{/i18n}}<br /><br />
{{#errors}}
Errors occured:
- {{#i18n}}{{.}}{{/i18n}}<br />
{{/errors}}
<form action="" method="post">
Username: <input type="text" name="username">
Password: <input type="text" name="password">
Email: <input type="text" name="email">
<input type="submit" value="Register">
</form>
| Fix for Scenario: Registration error with invalid credentials | Fix for Scenario: Registration error with invalid credentials
| HTML+Django | mit | Moult/eadrax-old | html+django | ## Code Before:
{{#i18n}}Register{{/i18n}}<br /><br />
{{#errors}}
- {{#i18n}}{{.}}{{/i18n}}<br />
{{/errors}}
<form action="" method="post">
Username: <input type="text" name="username">
Password: <input type="text" name="password">
Email: <input type="text" name="email">
<input type="submit" value="Register">
</form>
## Instruction:
Fix for Scenario: Registration error with invalid credentials
## Code After:
{{#i18n}}Register{{/i18n}}<br /><br />
{{#errors}}
Errors occured:
- {{#i18n}}{{.}}{{/i18n}}<br />
{{/errors}}
<form action="" method="post">
Username: <input type="text" name="username">
Password: <input type="text" name="password">
Email: <input type="text" name="email">
<input type="submit" value="Register">
</form>
| {{#i18n}}Register{{/i18n}}<br /><br />
{{#errors}}
+ Errors occured:
- {{#i18n}}{{.}}{{/i18n}}<br />
{{/errors}}
<form action="" method="post">
Username: <input type="text" name="username">
Password: <input type="text" name="password">
Email: <input type="text" name="email">
<input type="submit" value="Register">
</form> | 1 | 0.083333 | 1 | 0 |
dd13c095542f0d3c4071124c4858521bba494341 | spec/docx/paragraph/tables/table_with_merge_spec.rb | spec/docx/paragraph/tables/table_with_merge_spec.rb | require 'spec_helper'
describe 'Add table with merge' do
it 'Table with merge: 2:3 x 2x3' do
docx = DocBuilderWrapper.new.build_doc_and_parse('asserts/js/docx/paragraph/tables/table_with_merge.js')
expect(docx.elements[1].rows.length).to eq(5)
expect(docx.elements[1].rows[1].cells[1].elements.first.character_style_array[1].text).to eq('Merged cell')
expect(docx.elements[1].rows[1].cells[1].properties.merge.count_of_merged_cells).to eq(2)
expect(docx.elements[1].rows[1].cells[1].properties.merge.type).to eq('horizontal')
expect(docx.elements[1].rows[1].cells[1].properties.merge.value).to eq(2)
end
end
| require 'spec_helper'
describe 'Add table with merge' do
it 'Table with merge: 2:3 x 2x3' do
docx = DocBuilderWrapper.new.build_doc_and_parse('asserts/js/docx/paragraph/tables/table_with_merge.js')
expect(docx.elements[1].rows.length).to eq(5)
expect(docx.elements[1].rows[1].cells[1].elements.first.character_style_array[1].text).to eq('Merged cell')
expect(docx.elements[1].rows[1].cells[1].properties.grid_span.count_of_merged_cells).to eq(2)
expect(docx.elements[1].rows[1].cells[1].properties.grid_span.type).to eq('horizontal')
expect(docx.elements[1].rows[1].cells[1].properties.grid_span.value).to eq(2)
end
end
| Remove merge alias from ooxml_parser | Remove merge alias from ooxml_parser
Since https://github.com/ONLYOFFICE/ooxml_parser/pull/194
| Ruby | agpl-3.0 | ONLYOFFICE/doc-builder-testing,ONLYOFFICE/doc-builder-testing,ONLYOFFICE/doc-builder-testing | ruby | ## Code Before:
require 'spec_helper'
describe 'Add table with merge' do
it 'Table with merge: 2:3 x 2x3' do
docx = DocBuilderWrapper.new.build_doc_and_parse('asserts/js/docx/paragraph/tables/table_with_merge.js')
expect(docx.elements[1].rows.length).to eq(5)
expect(docx.elements[1].rows[1].cells[1].elements.first.character_style_array[1].text).to eq('Merged cell')
expect(docx.elements[1].rows[1].cells[1].properties.merge.count_of_merged_cells).to eq(2)
expect(docx.elements[1].rows[1].cells[1].properties.merge.type).to eq('horizontal')
expect(docx.elements[1].rows[1].cells[1].properties.merge.value).to eq(2)
end
end
## Instruction:
Remove merge alias from ooxml_parser
Since https://github.com/ONLYOFFICE/ooxml_parser/pull/194
## Code After:
require 'spec_helper'
describe 'Add table with merge' do
it 'Table with merge: 2:3 x 2x3' do
docx = DocBuilderWrapper.new.build_doc_and_parse('asserts/js/docx/paragraph/tables/table_with_merge.js')
expect(docx.elements[1].rows.length).to eq(5)
expect(docx.elements[1].rows[1].cells[1].elements.first.character_style_array[1].text).to eq('Merged cell')
expect(docx.elements[1].rows[1].cells[1].properties.grid_span.count_of_merged_cells).to eq(2)
expect(docx.elements[1].rows[1].cells[1].properties.grid_span.type).to eq('horizontal')
expect(docx.elements[1].rows[1].cells[1].properties.grid_span.value).to eq(2)
end
end
| require 'spec_helper'
describe 'Add table with merge' do
it 'Table with merge: 2:3 x 2x3' do
docx = DocBuilderWrapper.new.build_doc_and_parse('asserts/js/docx/paragraph/tables/table_with_merge.js')
expect(docx.elements[1].rows.length).to eq(5)
expect(docx.elements[1].rows[1].cells[1].elements.first.character_style_array[1].text).to eq('Merged cell')
- expect(docx.elements[1].rows[1].cells[1].properties.merge.count_of_merged_cells).to eq(2)
? ^^ ^^
+ expect(docx.elements[1].rows[1].cells[1].properties.grid_span.count_of_merged_cells).to eq(2)
? ^ ^^^^^^^
- expect(docx.elements[1].rows[1].cells[1].properties.merge.type).to eq('horizontal')
? ^^ ^^
+ expect(docx.elements[1].rows[1].cells[1].properties.grid_span.type).to eq('horizontal')
? ^ ^^^^^^^
- expect(docx.elements[1].rows[1].cells[1].properties.merge.value).to eq(2)
? ^^ ^^
+ expect(docx.elements[1].rows[1].cells[1].properties.grid_span.value).to eq(2)
? ^ ^^^^^^^
end
end | 6 | 0.5 | 3 | 3 |
2ab871459e668496e6a187a961d38d2810c13f51 | packages/components/containers/addresses/helper.js | packages/components/containers/addresses/helper.js | import { ADDRESS_STATUS, ADDRESS_TYPE, MEMBER_PRIVATE, RECEIVE_ADDRESS } from 'proton-shared/lib/constants';
const { TYPE_ORIGINAL, TYPE_CUSTOM_DOMAIN, TYPE_PREMIUM } = ADDRESS_TYPE;
const { READABLE, UNREADABLE } = MEMBER_PRIVATE;
export const getStatus = ({ address: { Status, Receive, DomainID, HasKeys }, i }) => {
const isActive = ADDRESS_STATUS.STATUS_ENABLED && Receive === RECEIVE_ADDRESS.RECEIVE_YES;
const isDisabled = Status === ADDRESS_STATUS.STATUS_DISABLED;
const isOrphan = DomainID === null;
const isMissingKeys = !HasKeys;
return {
isDefault: i === 0,
isActive,
isDisabled,
isOrphan,
isMissingKeys
};
};
export const getPermissions = ({
member: { Private, Self },
address: { Status, HasKeys, Type },
user: { isAdmin },
organizationKey
}) => {
const isSpecialAddress = Type === TYPE_ORIGINAL && Type === TYPE_PREMIUM;
return {
canGenerate:
!HasKeys && organizationKey && ((isAdmin && Private === READABLE) || (Private === UNREADABLE && Self)),
canDisable: Status === ADDRESS_STATUS.STATUS_ENABLED && isAdmin && !isSpecialAddress,
canEnable: Status === ADDRESS_STATUS.STATUS_DISABLED && isAdmin && !isSpecialAddress,
canDelete: Type === TYPE_CUSTOM_DOMAIN,
canEdit: !!Self
};
};
| import { ADDRESS_STATUS, ADDRESS_TYPE, MEMBER_PRIVATE, RECEIVE_ADDRESS } from 'proton-shared/lib/constants';
const { TYPE_ORIGINAL, TYPE_CUSTOM_DOMAIN, TYPE_PREMIUM } = ADDRESS_TYPE;
const { READABLE } = MEMBER_PRIVATE;
export const getStatus = ({ address: { Status, Receive, DomainID, HasKeys }, i }) => {
const isActive = ADDRESS_STATUS.STATUS_ENABLED && Receive === RECEIVE_ADDRESS.RECEIVE_YES;
const isDisabled = Status === ADDRESS_STATUS.STATUS_DISABLED;
const isOrphan = DomainID === null;
const isMissingKeys = !HasKeys;
return {
isDefault: i === 0,
isActive,
isDisabled,
isOrphan,
isMissingKeys
};
};
export const getPermissions = ({
member: { Private, Self },
address: { Status, HasKeys, Type },
user: { isAdmin },
organizationKey
}) => {
const isSpecialAddress = Type === TYPE_ORIGINAL && Type === TYPE_PREMIUM;
const canGenerateMember = organizationKey && isAdmin && Private === READABLE;
return {
canGenerate: !HasKeys && (canGenerateMember || Self),
canDisable: Status === ADDRESS_STATUS.STATUS_ENABLED && isAdmin && !isSpecialAddress,
canEnable: Status === ADDRESS_STATUS.STATUS_DISABLED && isAdmin && !isSpecialAddress,
canDelete: Type === TYPE_CUSTOM_DOMAIN,
canEdit: !!Self
};
};
| Fix condition for when keys for self can be generated | Fix condition for when keys for self can be generated
| JavaScript | mit | ProtonMail/WebClient,ProtonMail/WebClient,ProtonMail/WebClient | javascript | ## Code Before:
import { ADDRESS_STATUS, ADDRESS_TYPE, MEMBER_PRIVATE, RECEIVE_ADDRESS } from 'proton-shared/lib/constants';
const { TYPE_ORIGINAL, TYPE_CUSTOM_DOMAIN, TYPE_PREMIUM } = ADDRESS_TYPE;
const { READABLE, UNREADABLE } = MEMBER_PRIVATE;
export const getStatus = ({ address: { Status, Receive, DomainID, HasKeys }, i }) => {
const isActive = ADDRESS_STATUS.STATUS_ENABLED && Receive === RECEIVE_ADDRESS.RECEIVE_YES;
const isDisabled = Status === ADDRESS_STATUS.STATUS_DISABLED;
const isOrphan = DomainID === null;
const isMissingKeys = !HasKeys;
return {
isDefault: i === 0,
isActive,
isDisabled,
isOrphan,
isMissingKeys
};
};
export const getPermissions = ({
member: { Private, Self },
address: { Status, HasKeys, Type },
user: { isAdmin },
organizationKey
}) => {
const isSpecialAddress = Type === TYPE_ORIGINAL && Type === TYPE_PREMIUM;
return {
canGenerate:
!HasKeys && organizationKey && ((isAdmin && Private === READABLE) || (Private === UNREADABLE && Self)),
canDisable: Status === ADDRESS_STATUS.STATUS_ENABLED && isAdmin && !isSpecialAddress,
canEnable: Status === ADDRESS_STATUS.STATUS_DISABLED && isAdmin && !isSpecialAddress,
canDelete: Type === TYPE_CUSTOM_DOMAIN,
canEdit: !!Self
};
};
## Instruction:
Fix condition for when keys for self can be generated
## Code After:
import { ADDRESS_STATUS, ADDRESS_TYPE, MEMBER_PRIVATE, RECEIVE_ADDRESS } from 'proton-shared/lib/constants';
const { TYPE_ORIGINAL, TYPE_CUSTOM_DOMAIN, TYPE_PREMIUM } = ADDRESS_TYPE;
const { READABLE } = MEMBER_PRIVATE;
export const getStatus = ({ address: { Status, Receive, DomainID, HasKeys }, i }) => {
const isActive = ADDRESS_STATUS.STATUS_ENABLED && Receive === RECEIVE_ADDRESS.RECEIVE_YES;
const isDisabled = Status === ADDRESS_STATUS.STATUS_DISABLED;
const isOrphan = DomainID === null;
const isMissingKeys = !HasKeys;
return {
isDefault: i === 0,
isActive,
isDisabled,
isOrphan,
isMissingKeys
};
};
export const getPermissions = ({
member: { Private, Self },
address: { Status, HasKeys, Type },
user: { isAdmin },
organizationKey
}) => {
const isSpecialAddress = Type === TYPE_ORIGINAL && Type === TYPE_PREMIUM;
const canGenerateMember = organizationKey && isAdmin && Private === READABLE;
return {
canGenerate: !HasKeys && (canGenerateMember || Self),
canDisable: Status === ADDRESS_STATUS.STATUS_ENABLED && isAdmin && !isSpecialAddress,
canEnable: Status === ADDRESS_STATUS.STATUS_DISABLED && isAdmin && !isSpecialAddress,
canDelete: Type === TYPE_CUSTOM_DOMAIN,
canEdit: !!Self
};
};
| import { ADDRESS_STATUS, ADDRESS_TYPE, MEMBER_PRIVATE, RECEIVE_ADDRESS } from 'proton-shared/lib/constants';
const { TYPE_ORIGINAL, TYPE_CUSTOM_DOMAIN, TYPE_PREMIUM } = ADDRESS_TYPE;
- const { READABLE, UNREADABLE } = MEMBER_PRIVATE;
? ------------
+ const { READABLE } = MEMBER_PRIVATE;
export const getStatus = ({ address: { Status, Receive, DomainID, HasKeys }, i }) => {
const isActive = ADDRESS_STATUS.STATUS_ENABLED && Receive === RECEIVE_ADDRESS.RECEIVE_YES;
const isDisabled = Status === ADDRESS_STATUS.STATUS_DISABLED;
const isOrphan = DomainID === null;
const isMissingKeys = !HasKeys;
return {
isDefault: i === 0,
isActive,
isDisabled,
isOrphan,
isMissingKeys
};
};
export const getPermissions = ({
member: { Private, Self },
address: { Status, HasKeys, Type },
user: { isAdmin },
organizationKey
}) => {
const isSpecialAddress = Type === TYPE_ORIGINAL && Type === TYPE_PREMIUM;
+ const canGenerateMember = organizationKey && isAdmin && Private === READABLE;
return {
+ canGenerate: !HasKeys && (canGenerateMember || Self),
- canGenerate:
- !HasKeys && organizationKey && ((isAdmin && Private === READABLE) || (Private === UNREADABLE && Self)),
canDisable: Status === ADDRESS_STATUS.STATUS_ENABLED && isAdmin && !isSpecialAddress,
canEnable: Status === ADDRESS_STATUS.STATUS_DISABLED && isAdmin && !isSpecialAddress,
canDelete: Type === TYPE_CUSTOM_DOMAIN,
canEdit: !!Self
};
}; | 6 | 0.162162 | 3 | 3 |
a5104c8abf9de10f7606e67265ec418d204f23d9 | _config.yml | _config.yml | title: Ben Ilegbodu
description: "{priorities:['Christ','Family','Work'], work:'@Eventbrite', title:'Sr UI Engineer', tech:['#ES6,'#CSS3','#HTML5'], passions:['#Jesus','@NBA']}"
url: "https://benmvp.github.io"
paginate: 4
paginate_path: "/page/:num/"
# Build settings
permalink: pretty
permalink: pretty
gems: [jekyll-paginate, jekyll-redirect-from, jekyll-feed, jekyll-sitemap]
highlighter: pygments
redcarpet:
extensions: ['smart', 'tables', 'with_toc_data']
# Site owner
owner:
name: Ben Ilegbodu
email: ben@benmvp.com
disqus-shortname: benmvp
twitter: benmvp
github: benmvp
linkedin: benmvp
google:
analytics: UA-65375615-1
| title: Ben Ilegbodu
description: "{priorities:['Christ','Family','Work'], work:'@Eventbrite', title:'Sr UI Engineer', tech:['#ES6,'#CSS3','#HTML5'], passions:['#Jesus','@NBA']}"
url: "https://benmvp.github.io"
paginate: 4
paginate_path: "/page/:num/"
# Build settings
permalink: pretty
gems: [jekyll-paginate, jekyll-redirect-from, jekyll-feed, jekyll-sitemap]
highlighter: rouge
markdown: kramdown
kramdown:
input: GFM
# Site owner
owner:
name: Ben Ilegbodu
email: ben@benmvp.com
disqus-shortname: benmvp
twitter: benmvp
github: benmvp
linkedin: benmvp
google:
analytics: UA-65375615-1
| Update config to confirm to Github pages defaults | Update config to confirm to Github pages defaults
| YAML | mit | benmvp/benmvp.github.io | yaml | ## Code Before:
title: Ben Ilegbodu
description: "{priorities:['Christ','Family','Work'], work:'@Eventbrite', title:'Sr UI Engineer', tech:['#ES6,'#CSS3','#HTML5'], passions:['#Jesus','@NBA']}"
url: "https://benmvp.github.io"
paginate: 4
paginate_path: "/page/:num/"
# Build settings
permalink: pretty
permalink: pretty
gems: [jekyll-paginate, jekyll-redirect-from, jekyll-feed, jekyll-sitemap]
highlighter: pygments
redcarpet:
extensions: ['smart', 'tables', 'with_toc_data']
# Site owner
owner:
name: Ben Ilegbodu
email: ben@benmvp.com
disqus-shortname: benmvp
twitter: benmvp
github: benmvp
linkedin: benmvp
google:
analytics: UA-65375615-1
## Instruction:
Update config to confirm to Github pages defaults
## Code After:
title: Ben Ilegbodu
description: "{priorities:['Christ','Family','Work'], work:'@Eventbrite', title:'Sr UI Engineer', tech:['#ES6,'#CSS3','#HTML5'], passions:['#Jesus','@NBA']}"
url: "https://benmvp.github.io"
paginate: 4
paginate_path: "/page/:num/"
# Build settings
permalink: pretty
gems: [jekyll-paginate, jekyll-redirect-from, jekyll-feed, jekyll-sitemap]
highlighter: rouge
markdown: kramdown
kramdown:
input: GFM
# Site owner
owner:
name: Ben Ilegbodu
email: ben@benmvp.com
disqus-shortname: benmvp
twitter: benmvp
github: benmvp
linkedin: benmvp
google:
analytics: UA-65375615-1
| title: Ben Ilegbodu
description: "{priorities:['Christ','Family','Work'], work:'@Eventbrite', title:'Sr UI Engineer', tech:['#ES6,'#CSS3','#HTML5'], passions:['#Jesus','@NBA']}"
url: "https://benmvp.github.io"
paginate: 4
paginate_path: "/page/:num/"
# Build settings
- permalink: pretty
permalink: pretty
gems: [jekyll-paginate, jekyll-redirect-from, jekyll-feed, jekyll-sitemap]
- highlighter: pygments
? ^^ - ---
+ highlighter: rouge
? ^^^
- redcarpet:
- extensions: ['smart', 'tables', 'with_toc_data']
+ markdown: kramdown
+ kramdown:
+ input: GFM
# Site owner
owner:
name: Ben Ilegbodu
email: ben@benmvp.com
disqus-shortname: benmvp
twitter: benmvp
github: benmvp
linkedin: benmvp
google:
analytics: UA-65375615-1 | 8 | 0.32 | 4 | 4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.