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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7d3d792f345c634359ab6ab5ce53601b011c6b8d | .travis.yml | .travis.yml | language: go
go_import_path: aqwari.net/xml
go:
- 1.7
notifications:
email:
recipients: droyo@aqwari.net
on_success: change
on_failure: always
| language: go
go_import_path: aqwari.net/xml
go:
- "1.7"
- "1.8"
- "1.9"
- "1.10"
- "1.11"
notifications:
email:
recipients: droyo@aqwari.net
on_success: change
on_failure: always
| Extend build to more go versions | Extend build to more go versions
| YAML | mit | droyo/go-xml | yaml | ## Code Before:
language: go
go_import_path: aqwari.net/xml
go:
- 1.7
notifications:
email:
recipients: droyo@aqwari.net
on_success: change
on_failure: always
## Instruction:
Extend build to more go versions
## Code After:
language: go
go_import_path: aqwari.net/xml
go:
- "1.7"
- "1.8"
- "1.9"
- "1.10"
- "1.11"
notifications:
email:
recipients: droyo@aqwari.net
on_success: change
on_failure: always
| language: go
go_import_path: aqwari.net/xml
go:
- - 1.7
+ - "1.7"
? + +
+ - "1.8"
+ - "1.9"
+ - "1.10"
+ - "1.11"
notifications:
email:
recipients: droyo@aqwari.net
on_success: change
on_failure: always | 6 | 0.6 | 5 | 1 |
3ad203e8926ac1e1bfe6444932395ca8c02edf64 | tests/Blog/Model/Special/NoTypeCollection.php | tests/Blog/Model/Special/NoTypeCollection.php | <?php
declare(strict_types=1);
namespace GraphQLTests\Doctrine\Blog\Model\Special;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use GraphQLTests\Doctrine\Blog\Model\AbstractModel;
/**
* @ORM\Entity
*/
class NoTypeCollection extends AbstractModel
{
public function getFoos(): Collection
{
return __FUNCTION__;
}
}
| <?php
declare(strict_types=1);
namespace GraphQLTests\Doctrine\Blog\Model\Special;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use GraphQLTests\Doctrine\Blog\Model\AbstractModel;
/**
* @ORM\Entity
*/
class NoTypeCollection extends AbstractModel
{
public function getFoos(): Collection
{
return new ArrayCollection();
}
}
| Return correct type during tests | Return correct type during tests
| PHP | mit | Ecodev/graphql-doctrine,Ecodev/graphql-doctrine | php | ## Code Before:
<?php
declare(strict_types=1);
namespace GraphQLTests\Doctrine\Blog\Model\Special;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use GraphQLTests\Doctrine\Blog\Model\AbstractModel;
/**
* @ORM\Entity
*/
class NoTypeCollection extends AbstractModel
{
public function getFoos(): Collection
{
return __FUNCTION__;
}
}
## Instruction:
Return correct type during tests
## Code After:
<?php
declare(strict_types=1);
namespace GraphQLTests\Doctrine\Blog\Model\Special;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use GraphQLTests\Doctrine\Blog\Model\AbstractModel;
/**
* @ORM\Entity
*/
class NoTypeCollection extends AbstractModel
{
public function getFoos(): Collection
{
return new ArrayCollection();
}
}
| <?php
declare(strict_types=1);
namespace GraphQLTests\Doctrine\Blog\Model\Special;
+ use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use GraphQLTests\Doctrine\Blog\Model\AbstractModel;
/**
* @ORM\Entity
*/
class NoTypeCollection extends AbstractModel
{
public function getFoos(): Collection
{
- return __FUNCTION__;
+ return new ArrayCollection();
}
} | 3 | 0.15 | 2 | 1 |
ad50209dd215f6324ec49fc22036af57d8f1e15b | tools/tools.go | tools/tools.go | package tools
import (
"log"
"strings"
"fmt"
)
// UploadFile used to upload file by S3 pre-signed URL
func UploadFile(path, url string) int {
log.Println("Uploading file from path:", path)
file, info := prepareFile(path)
resp := sendRequest(url, &file, info)
return getStatusOfUpload(resp)
}
// GetFileName returns file name from path string
func GetFileName(path string) string {
if !strings.Contains(path, "/") {
return path
}
pos := strings.LastIndex(path, "/")
return string(path[pos+1:])
}
// GenerateReportURL generate URL to test report from ARN
func GenerateReportURL(arn string) string {
URL := "https://us-west-2.console.aws.amazon.com/devicefarm/home?region=us-west-2#/projects/%s/runs/%s"
index := strings.Index(arn, ":run:")
if index == -1 {
log.Println("Can't generate test report URL from ARN:", arn)
return ""
}
str := arn[index+5:]
index = strings.Index(str, "/")
project := str[:index]
run := str[index+1:]
return fmt.Sprintf(URL, project, run)
}
| package tools
import (
"fmt"
"log"
"strings"
)
// UploadFile used to upload file by S3 pre-signed URL
func UploadFile(path, url string) int {
log.Println("Uploading file from path:", path)
file, info := prepareFile(path)
resp := sendRequest(url, &file, info)
return getStatusOfUpload(resp)
}
// GetFileName returns file name from path string
func GetFileName(path string) string {
if !strings.Contains(path, "/") {
return path
}
pos := strings.LastIndex(path, "/")
return string(path[pos+1:])
}
// GenerateReportURL generate URL to test report from ARN
func GenerateReportURL(arn string) string {
URL := "https://us-west-2.console.aws.amazon.com/devicefarm/home?region=us-west-2#/projects/%s/runs/%s"
index := strings.Index(arn, ":run:")
if index == -1 {
log.Println("Can't generate test report URL from ARN:", arn)
return ""
}
str := arn[index+5:]
index = strings.Index(str, "/")
project := str[:index]
run := str[index+1:]
return fmt.Sprintf(URL, project, run)
}
| Fix gofmt formating for a file | Fix gofmt formating for a file
| Go | mit | artemnikitin/devicefarm-ci-tool | go | ## Code Before:
package tools
import (
"log"
"strings"
"fmt"
)
// UploadFile used to upload file by S3 pre-signed URL
func UploadFile(path, url string) int {
log.Println("Uploading file from path:", path)
file, info := prepareFile(path)
resp := sendRequest(url, &file, info)
return getStatusOfUpload(resp)
}
// GetFileName returns file name from path string
func GetFileName(path string) string {
if !strings.Contains(path, "/") {
return path
}
pos := strings.LastIndex(path, "/")
return string(path[pos+1:])
}
// GenerateReportURL generate URL to test report from ARN
func GenerateReportURL(arn string) string {
URL := "https://us-west-2.console.aws.amazon.com/devicefarm/home?region=us-west-2#/projects/%s/runs/%s"
index := strings.Index(arn, ":run:")
if index == -1 {
log.Println("Can't generate test report URL from ARN:", arn)
return ""
}
str := arn[index+5:]
index = strings.Index(str, "/")
project := str[:index]
run := str[index+1:]
return fmt.Sprintf(URL, project, run)
}
## Instruction:
Fix gofmt formating for a file
## Code After:
package tools
import (
"fmt"
"log"
"strings"
)
// UploadFile used to upload file by S3 pre-signed URL
func UploadFile(path, url string) int {
log.Println("Uploading file from path:", path)
file, info := prepareFile(path)
resp := sendRequest(url, &file, info)
return getStatusOfUpload(resp)
}
// GetFileName returns file name from path string
func GetFileName(path string) string {
if !strings.Contains(path, "/") {
return path
}
pos := strings.LastIndex(path, "/")
return string(path[pos+1:])
}
// GenerateReportURL generate URL to test report from ARN
func GenerateReportURL(arn string) string {
URL := "https://us-west-2.console.aws.amazon.com/devicefarm/home?region=us-west-2#/projects/%s/runs/%s"
index := strings.Index(arn, ":run:")
if index == -1 {
log.Println("Can't generate test report URL from ARN:", arn)
return ""
}
str := arn[index+5:]
index = strings.Index(str, "/")
project := str[:index]
run := str[index+1:]
return fmt.Sprintf(URL, project, run)
}
| package tools
import (
+ "fmt"
"log"
"strings"
- "fmt"
)
// UploadFile used to upload file by S3 pre-signed URL
func UploadFile(path, url string) int {
log.Println("Uploading file from path:", path)
file, info := prepareFile(path)
resp := sendRequest(url, &file, info)
return getStatusOfUpload(resp)
}
// GetFileName returns file name from path string
func GetFileName(path string) string {
if !strings.Contains(path, "/") {
return path
}
pos := strings.LastIndex(path, "/")
return string(path[pos+1:])
}
// GenerateReportURL generate URL to test report from ARN
func GenerateReportURL(arn string) string {
URL := "https://us-west-2.console.aws.amazon.com/devicefarm/home?region=us-west-2#/projects/%s/runs/%s"
index := strings.Index(arn, ":run:")
if index == -1 {
log.Println("Can't generate test report URL from ARN:", arn)
return ""
}
str := arn[index+5:]
index = strings.Index(str, "/")
project := str[:index]
run := str[index+1:]
return fmt.Sprintf(URL, project, run)
} | 2 | 0.051282 | 1 | 1 |
1bec4666f2fd1f99bff6a02b9aebb11ce9046f6f | test-code.sh | test-code.sh |
set -e
if ! command -v assay >/dev/null
then
cat >&2 <<'EOF'
Error: "assay" command not found
Create a virtual environment and run "pip install -r requirements.txt"
to install all of the tools and libraries for Skyfield development.
EOF
exit 2
fi
if python --version | grep -q 'Python 3.6'
then
d=$(python -c 'import skyfield as s; print(s.__file__.rsplit("/", 1)[0])')
pyflakes "$d"/*.py "$d"/data/*.py
fi
exec assay --batch skyfield.tests
|
set -e
if ! command -v assay >/dev/null
then
cat >&2 <<'EOF'
Error: "assay" command not found
Create a virtual environment and run "pip install -r requirements.txt"
to install all of the tools and libraries for Skyfield development.
EOF
exit 2
fi
if python --version | grep -q 'Python 3.6' && command -v pyflakes >/dev/null
then
d=$(python -c 'import skyfield as s; print(s.__file__.rsplit("/", 1)[0])')
pyflakes $(find "$d" -name '*.py')
fi
exec assay --batch skyfield.tests
| Fix CI: only run pyflakes if already installed | Fix CI: only run pyflakes if already installed
| Shell | mit | skyfielders/python-skyfield,skyfielders/python-skyfield | shell | ## Code Before:
set -e
if ! command -v assay >/dev/null
then
cat >&2 <<'EOF'
Error: "assay" command not found
Create a virtual environment and run "pip install -r requirements.txt"
to install all of the tools and libraries for Skyfield development.
EOF
exit 2
fi
if python --version | grep -q 'Python 3.6'
then
d=$(python -c 'import skyfield as s; print(s.__file__.rsplit("/", 1)[0])')
pyflakes "$d"/*.py "$d"/data/*.py
fi
exec assay --batch skyfield.tests
## Instruction:
Fix CI: only run pyflakes if already installed
## Code After:
set -e
if ! command -v assay >/dev/null
then
cat >&2 <<'EOF'
Error: "assay" command not found
Create a virtual environment and run "pip install -r requirements.txt"
to install all of the tools and libraries for Skyfield development.
EOF
exit 2
fi
if python --version | grep -q 'Python 3.6' && command -v pyflakes >/dev/null
then
d=$(python -c 'import skyfield as s; print(s.__file__.rsplit("/", 1)[0])')
pyflakes $(find "$d" -name '*.py')
fi
exec assay --batch skyfield.tests
|
set -e
if ! command -v assay >/dev/null
then
cat >&2 <<'EOF'
Error: "assay" command not found
Create a virtual environment and run "pip install -r requirements.txt"
to install all of the tools and libraries for Skyfield development.
EOF
exit 2
fi
- if python --version | grep -q 'Python 3.6'
+ if python --version | grep -q 'Python 3.6' && command -v pyflakes >/dev/null
then
d=$(python -c 'import skyfield as s; print(s.__file__.rsplit("/", 1)[0])')
- pyflakes "$d"/*.py "$d"/data/*.py
+ pyflakes $(find "$d" -name '*.py')
fi
exec assay --batch skyfield.tests | 4 | 0.210526 | 2 | 2 |
4f557713ead00608b453f2a1ecccaa388013c47f | blog/templates/news-section.html | blog/templates/news-section.html | {% extends "second-edition/base.html" %}
{% import "macros.html" as macros %}
{% block title %}{{ section.title }} | {{ config.title }}{% endblock title %}
{% block main %}
<h1>{{ section.title }}</h1>
{% block introduction %}{% endblock introduction %}
<div class="posts neutral">
{% for page in section.pages %}
<div>
<h2 class="post-title"><a href="/{{ page.path | safe }}">{{ page.title }}</a></h2>
<time datetime="{{ page.date | date(format="%Y-%m-%d") }}" class="post-date">
{{ page.date | date(format="%b %d, %Y") }}
</time>
<div class="post-summary">
{{ page.summary | safe}}
<a class="read-more" href="/{{ page.path | safe }}">read more…</a>
</div>
</div>
{% endfor %}
</div>
{% endblock main %}
| {% extends "second-edition/base.html" %}
{% import "macros.html" as macros %}
{% block title %}{{ section.title }} | {{ config.title }}{% endblock title %}
{% block main %}
<h1>{{ section.title }}</h1>
{% block introduction %}{% endblock introduction %}
<div class="posts neutral">
{% for page in section.pages %}
<div>
<h2 class="post-title"><a href="/{{ page.path | safe }}">{{ page.title }}</a></h2>
<time datetime="{{ page.date | date(format="%Y-%m-%d") }}" class="post-date" style="margin-bottom: 0.5rem;">
{{ page.date | date(format="%b %d, %Y") }}
</time>
<div class="post-summary" style="margin-bottom: 2rem;">
{{ page.summary | safe}}
<a class="read-more" href="/{{ page.path | safe }}">read more…</a>
</div>
</div>
{% endfor %}
</div>
{% endblock main %}
| Improve margins for news section | Improve margins for news section
| HTML | apache-2.0 | phil-opp/blog_os,phil-opp/blog_os,phil-opp/blogOS,phil-opp/blog_os,phil-opp/blog_os,phil-opp/blogOS | html | ## Code Before:
{% extends "second-edition/base.html" %}
{% import "macros.html" as macros %}
{% block title %}{{ section.title }} | {{ config.title }}{% endblock title %}
{% block main %}
<h1>{{ section.title }}</h1>
{% block introduction %}{% endblock introduction %}
<div class="posts neutral">
{% for page in section.pages %}
<div>
<h2 class="post-title"><a href="/{{ page.path | safe }}">{{ page.title }}</a></h2>
<time datetime="{{ page.date | date(format="%Y-%m-%d") }}" class="post-date">
{{ page.date | date(format="%b %d, %Y") }}
</time>
<div class="post-summary">
{{ page.summary | safe}}
<a class="read-more" href="/{{ page.path | safe }}">read more…</a>
</div>
</div>
{% endfor %}
</div>
{% endblock main %}
## Instruction:
Improve margins for news section
## Code After:
{% extends "second-edition/base.html" %}
{% import "macros.html" as macros %}
{% block title %}{{ section.title }} | {{ config.title }}{% endblock title %}
{% block main %}
<h1>{{ section.title }}</h1>
{% block introduction %}{% endblock introduction %}
<div class="posts neutral">
{% for page in section.pages %}
<div>
<h2 class="post-title"><a href="/{{ page.path | safe }}">{{ page.title }}</a></h2>
<time datetime="{{ page.date | date(format="%Y-%m-%d") }}" class="post-date" style="margin-bottom: 0.5rem;">
{{ page.date | date(format="%b %d, %Y") }}
</time>
<div class="post-summary" style="margin-bottom: 2rem;">
{{ page.summary | safe}}
<a class="read-more" href="/{{ page.path | safe }}">read more…</a>
</div>
</div>
{% endfor %}
</div>
{% endblock main %}
| {% extends "second-edition/base.html" %}
{% import "macros.html" as macros %}
{% block title %}{{ section.title }} | {{ config.title }}{% endblock title %}
{% block main %}
<h1>{{ section.title }}</h1>
{% block introduction %}{% endblock introduction %}
<div class="posts neutral">
{% for page in section.pages %}
<div>
<h2 class="post-title"><a href="/{{ page.path | safe }}">{{ page.title }}</a></h2>
- <time datetime="{{ page.date | date(format="%Y-%m-%d") }}" class="post-date">
+ <time datetime="{{ page.date | date(format="%Y-%m-%d") }}" class="post-date" style="margin-bottom: 0.5rem;">
? +++++++++++++++++++++++++++++++
{{ page.date | date(format="%b %d, %Y") }}
</time>
- <div class="post-summary">
+ <div class="post-summary" style="margin-bottom: 2rem;">
{{ page.summary | safe}}
<a class="read-more" href="/{{ page.path | safe }}">read more…</a>
</div>
</div>
{% endfor %}
</div>
{% endblock main %} | 4 | 0.142857 | 2 | 2 |
ea0ca6aa3d49dcbde30b0f04dc4f148c8e105d85 | src/middleware/static-file.lisp | src/middleware/static-file.lisp | (in-package #:eloquent.mvc.middleware)
(defun make-static-file (path-info prefix root)
(let ((path (remove-prefix prefix path-info)))
(merge-pathnames path
(merge-pathnames "static/" root))))
(defun get-prefix (config)
(eloquent.mvc.config:get config "static-file" "prefix"))
(defun remove-prefix (prefix s)
(subseq s (length prefix)))
(defun static-file (request next
&key config)
"When the path-info of REQUEST matches the prefix specified in CONFIG's [static-file] section, feed the client a static file."
(let ((path-info (eloquent.mvc.request:request-path-info request))
(prefix (get-prefix config))
(root (eloquent.mvc.config:get-application-root config)))
(if (alexandria:starts-with-subseq prefix path-info)
(let ((filespec (make-static-file path-info prefix root)))
(if (probe-file filespec)
(eloquent.mvc.response:respond filespec)
(eloquent.mvc.router:not-found request)))
(funcall next request))))
| (in-package #:eloquent.mvc.middleware)
(defun make-static-file (path-info prefix root)
(let ((path (remove-prefix prefix path-info)))
(merge-pathnames path
(merge-pathnames "static/" root))))
(defun get-prefix (config)
(eloquent.mvc.config:get config "static-file" "prefix"))
(defun remove-prefix (prefix s)
(subseq s (length prefix)))
(defun static-file (request next
&key config)
"When the path-info of REQUEST matches the prefix specified in CONFIG's [static-file] section, feed the client a static file."
(let ((path-info (eloquent.mvc.request:request-path-info request))
(prefix (get-prefix config))
(root (eloquent.mvc.config:get-application-root config)))
(if (alexandria:starts-with-subseq prefix path-info)
(let ((filespec (make-static-file path-info prefix root)))
(eloquent.mvc.response:respond filespec))
(funcall next request))))
| Remove the call of NOT-FOUND function from router | Remove the call of NOT-FOUND function from router
| Common Lisp | mit | Liutos/eloquent-mvc,Liutos/eloquent-mvc | common-lisp | ## Code Before:
(in-package #:eloquent.mvc.middleware)
(defun make-static-file (path-info prefix root)
(let ((path (remove-prefix prefix path-info)))
(merge-pathnames path
(merge-pathnames "static/" root))))
(defun get-prefix (config)
(eloquent.mvc.config:get config "static-file" "prefix"))
(defun remove-prefix (prefix s)
(subseq s (length prefix)))
(defun static-file (request next
&key config)
"When the path-info of REQUEST matches the prefix specified in CONFIG's [static-file] section, feed the client a static file."
(let ((path-info (eloquent.mvc.request:request-path-info request))
(prefix (get-prefix config))
(root (eloquent.mvc.config:get-application-root config)))
(if (alexandria:starts-with-subseq prefix path-info)
(let ((filespec (make-static-file path-info prefix root)))
(if (probe-file filespec)
(eloquent.mvc.response:respond filespec)
(eloquent.mvc.router:not-found request)))
(funcall next request))))
## Instruction:
Remove the call of NOT-FOUND function from router
## Code After:
(in-package #:eloquent.mvc.middleware)
(defun make-static-file (path-info prefix root)
(let ((path (remove-prefix prefix path-info)))
(merge-pathnames path
(merge-pathnames "static/" root))))
(defun get-prefix (config)
(eloquent.mvc.config:get config "static-file" "prefix"))
(defun remove-prefix (prefix s)
(subseq s (length prefix)))
(defun static-file (request next
&key config)
"When the path-info of REQUEST matches the prefix specified in CONFIG's [static-file] section, feed the client a static file."
(let ((path-info (eloquent.mvc.request:request-path-info request))
(prefix (get-prefix config))
(root (eloquent.mvc.config:get-application-root config)))
(if (alexandria:starts-with-subseq prefix path-info)
(let ((filespec (make-static-file path-info prefix root)))
(eloquent.mvc.response:respond filespec))
(funcall next request))))
| (in-package #:eloquent.mvc.middleware)
(defun make-static-file (path-info prefix root)
(let ((path (remove-prefix prefix path-info)))
(merge-pathnames path
(merge-pathnames "static/" root))))
(defun get-prefix (config)
(eloquent.mvc.config:get config "static-file" "prefix"))
(defun remove-prefix (prefix s)
(subseq s (length prefix)))
(defun static-file (request next
&key config)
"When the path-info of REQUEST matches the prefix specified in CONFIG's [static-file] section, feed the client a static file."
(let ((path-info (eloquent.mvc.request:request-path-info request))
(prefix (get-prefix config))
(root (eloquent.mvc.config:get-application-root config)))
(if (alexandria:starts-with-subseq prefix path-info)
(let ((filespec (make-static-file path-info prefix root)))
- (if (probe-file filespec)
- (eloquent.mvc.response:respond filespec)
? ----
+ (eloquent.mvc.response:respond filespec))
? +
- (eloquent.mvc.router:not-found request)))
(funcall next request)))) | 4 | 0.16 | 1 | 3 |
6f8472bdd605a6815d40ae90c05cbb0032907b6c | tests/parse_token.py | tests/parse_token.py | """parse_token test case"""
import unittest
from lighty.templates.tag import parse_token
class FormFieldsTestCase(unittest.TestCase):
''' Test form fields '''
def setUp(self):
# Test Field class
pass
def testCleanBrackets(self):
parsed = parse_token('"test.html"')
needed = ['test.html']
assert parsed == needed, 'Brackets cleaning failed: %s except %s' % (
parsed, needed)
def testCleanInnerBrackets(self):
parsed = parse_token('"test\'html"')
needed = ['test\'html']
assert parsed == needed, 'Brackets cleaning failed: %s except %s' % (
parsed, needed)
def testParseSimpleTokens(self):
parsed = parse_token('a in b')
needed = ['a', 'in', 'b']
assert parsed == needed, 'Token parsing failed: %s except %s' % (
parsed, needed)
def testParseTokensWithSentence(self):
parsed = parse_token('a as "Let me in"')
needed = ['a', 'as', 'Let me in']
assert parsed == needed, 'Token with sentence parsing failed: %s' % (
' '.join((parsed, 'except', needed)))
| """parse_token test case"""
import unittest
from lighty.templates.tag import parse_token
class ParseTokenTestCase(unittest.TestCase):
''' Test form fields '''
def setUp(self):
# Test Field class
pass
def testCleanBrackets(self):
parsed = parse_token('"test.html"')
needed = ['test.html']
assert parsed == needed, 'Brackets cleaning failed: %s except %s' % (
parsed, needed)
def testCleanInnerBrackets(self):
parsed = parse_token('"test\'html"')
needed = ['test\'html']
assert parsed == needed, 'Brackets cleaning failed: %s except %s' % (
parsed, needed)
def testParseSimpleTokens(self):
parsed = parse_token('a in b')
needed = ['a', 'in', 'b']
assert parsed == needed, 'Token parsing failed: %s except %s' % (
parsed, needed)
def testParseTokensWithSentence(self):
parsed = parse_token('a as "Let me in"')
needed = ['a', 'as', 'Let me in']
assert parsed == needed, 'Token with sentence parsing failed: %s' % (
' '.join((parsed, 'except', needed)))
def test():
suite = unittest.TestSuite()
suite.addTest(ParseTokenTestCase('testCleanBrackets'))
suite.addTest(ParseTokenTestCase("testCleanInnerBrackets"))
suite.addTest(ParseTokenTestCase("testParseSimpleTokens"))
suite.addTest(ParseTokenTestCase("testParseTokensWithSentence"))
return suite
| Add tests for parser tokens | Add tests for parser tokens
| Python | bsd-3-clause | GrAndSE/lighty-template,GrAndSE/lighty | python | ## Code Before:
"""parse_token test case"""
import unittest
from lighty.templates.tag import parse_token
class FormFieldsTestCase(unittest.TestCase):
''' Test form fields '''
def setUp(self):
# Test Field class
pass
def testCleanBrackets(self):
parsed = parse_token('"test.html"')
needed = ['test.html']
assert parsed == needed, 'Brackets cleaning failed: %s except %s' % (
parsed, needed)
def testCleanInnerBrackets(self):
parsed = parse_token('"test\'html"')
needed = ['test\'html']
assert parsed == needed, 'Brackets cleaning failed: %s except %s' % (
parsed, needed)
def testParseSimpleTokens(self):
parsed = parse_token('a in b')
needed = ['a', 'in', 'b']
assert parsed == needed, 'Token parsing failed: %s except %s' % (
parsed, needed)
def testParseTokensWithSentence(self):
parsed = parse_token('a as "Let me in"')
needed = ['a', 'as', 'Let me in']
assert parsed == needed, 'Token with sentence parsing failed: %s' % (
' '.join((parsed, 'except', needed)))
## Instruction:
Add tests for parser tokens
## Code After:
"""parse_token test case"""
import unittest
from lighty.templates.tag import parse_token
class ParseTokenTestCase(unittest.TestCase):
''' Test form fields '''
def setUp(self):
# Test Field class
pass
def testCleanBrackets(self):
parsed = parse_token('"test.html"')
needed = ['test.html']
assert parsed == needed, 'Brackets cleaning failed: %s except %s' % (
parsed, needed)
def testCleanInnerBrackets(self):
parsed = parse_token('"test\'html"')
needed = ['test\'html']
assert parsed == needed, 'Brackets cleaning failed: %s except %s' % (
parsed, needed)
def testParseSimpleTokens(self):
parsed = parse_token('a in b')
needed = ['a', 'in', 'b']
assert parsed == needed, 'Token parsing failed: %s except %s' % (
parsed, needed)
def testParseTokensWithSentence(self):
parsed = parse_token('a as "Let me in"')
needed = ['a', 'as', 'Let me in']
assert parsed == needed, 'Token with sentence parsing failed: %s' % (
' '.join((parsed, 'except', needed)))
def test():
suite = unittest.TestSuite()
suite.addTest(ParseTokenTestCase('testCleanBrackets'))
suite.addTest(ParseTokenTestCase("testCleanInnerBrackets"))
suite.addTest(ParseTokenTestCase("testParseSimpleTokens"))
suite.addTest(ParseTokenTestCase("testParseTokensWithSentence"))
return suite
| """parse_token test case"""
import unittest
from lighty.templates.tag import parse_token
- class FormFieldsTestCase(unittest.TestCase):
? ^ ^^^^ ^^^
+ class ParseTokenTestCase(unittest.TestCase):
? ^^^^^^ ^ ^
''' Test form fields '''
def setUp(self):
# Test Field class
pass
def testCleanBrackets(self):
parsed = parse_token('"test.html"')
needed = ['test.html']
assert parsed == needed, 'Brackets cleaning failed: %s except %s' % (
parsed, needed)
def testCleanInnerBrackets(self):
parsed = parse_token('"test\'html"')
needed = ['test\'html']
assert parsed == needed, 'Brackets cleaning failed: %s except %s' % (
parsed, needed)
def testParseSimpleTokens(self):
parsed = parse_token('a in b')
needed = ['a', 'in', 'b']
assert parsed == needed, 'Token parsing failed: %s except %s' % (
parsed, needed)
def testParseTokensWithSentence(self):
parsed = parse_token('a as "Let me in"')
needed = ['a', 'as', 'Let me in']
assert parsed == needed, 'Token with sentence parsing failed: %s' % (
' '.join((parsed, 'except', needed)))
+
+ def test():
+ suite = unittest.TestSuite()
+ suite.addTest(ParseTokenTestCase('testCleanBrackets'))
+ suite.addTest(ParseTokenTestCase("testCleanInnerBrackets"))
+ suite.addTest(ParseTokenTestCase("testParseSimpleTokens"))
+ suite.addTest(ParseTokenTestCase("testParseTokensWithSentence"))
+ return suite | 10 | 0.277778 | 9 | 1 |
54e492e7b6ac572ee352c0ea49a7e989be677c85 | crispy_forms_foundation/templates/foundation/layout/checkboxselectmultiple.html | crispy_forms_foundation/templates/foundation/layout/checkboxselectmultiple.html | {% load l10n %}
{% for choice in field.field.choices %}
<input type="checkbox"{% if choice.0 in field.value or choice.0|stringformat:"s" in field.value or choice.0|stringformat:"s" == field.value|stringformat:"s" %} checked="checked"{% endif %} name="{{ field.html_name }}" id="id_{{ field.html_name }}_{{ forloop.counter }}" value="{{ choice.0|unlocalize }}">
<label for="{{ field.html_name}}">{{ choice.1|unlocalize }}</label>
{% endfor %}
| {% load l10n %}
{% for choice in field.field.choices %}
<input type="checkbox"{% if choice.0 in field.value or choice.0|stringformat:"s" in field.value or choice.0|stringformat:"s" == field.value|stringformat:"s" %} checked="checked"{% endif %} name="{{ field.html_name }}" id="id_{{ field.html_name }}_{{ forloop.counter }}" value="{{ choice.0|unlocalize }}">
<label for="id_{{ field.html_name}}_{{ forloop.counter }}">{{ choice.1|unlocalize }}</label>
{% endfor %}
| Support CheckboxSelectMultiple widget for multiple checkboxes | Support CheckboxSelectMultiple widget for multiple checkboxes
| HTML | mit | bionikspoon/crispy-forms-foundation,sveetch/crispy-forms-foundation,sveetch/crispy-forms-foundation,bionikspoon/crispy-forms-foundation,sveetch/crispy-forms-foundation,bionikspoon/crispy-forms-foundation | html | ## Code Before:
{% load l10n %}
{% for choice in field.field.choices %}
<input type="checkbox"{% if choice.0 in field.value or choice.0|stringformat:"s" in field.value or choice.0|stringformat:"s" == field.value|stringformat:"s" %} checked="checked"{% endif %} name="{{ field.html_name }}" id="id_{{ field.html_name }}_{{ forloop.counter }}" value="{{ choice.0|unlocalize }}">
<label for="{{ field.html_name}}">{{ choice.1|unlocalize }}</label>
{% endfor %}
## Instruction:
Support CheckboxSelectMultiple widget for multiple checkboxes
## Code After:
{% load l10n %}
{% for choice in field.field.choices %}
<input type="checkbox"{% if choice.0 in field.value or choice.0|stringformat:"s" in field.value or choice.0|stringformat:"s" == field.value|stringformat:"s" %} checked="checked"{% endif %} name="{{ field.html_name }}" id="id_{{ field.html_name }}_{{ forloop.counter }}" value="{{ choice.0|unlocalize }}">
<label for="id_{{ field.html_name}}_{{ forloop.counter }}">{{ choice.1|unlocalize }}</label>
{% endfor %}
| {% load l10n %}
{% for choice in field.field.choices %}
<input type="checkbox"{% if choice.0 in field.value or choice.0|stringformat:"s" in field.value or choice.0|stringformat:"s" == field.value|stringformat:"s" %} checked="checked"{% endif %} name="{{ field.html_name }}" id="id_{{ field.html_name }}_{{ forloop.counter }}" value="{{ choice.0|unlocalize }}">
- <label for="{{ field.html_name}}">{{ choice.1|unlocalize }}</label>
+ <label for="id_{{ field.html_name}}_{{ forloop.counter }}">{{ choice.1|unlocalize }}</label>
? +++ ++++++++++++++++++++++
{% endfor %}
| 2 | 0.285714 | 1 | 1 |
6fb80d5183de8c3a30190673fd16ad534c802e6e | README.md | README.md | AlfredDomainSearcher
====================
Alfred workflow for domain search, check availability of domain.
##Install
Download the `.alfredworkflow` file, double click to import your alfred workflow.
##Usage
####1. Input `dm abc` to check whether `abc.com`, `abc.cn`, `abc.net`, `abc.me` these domains can be registed.
####2. Input `dmx abc` to check more extentions, include `abc.org`, `abc.tv`, `abc.cc`
####3. Input whole domain (eg. `dm abc.com`) what ever you use `dm` or `dmx`, will get only one result for the specific domain.
##Screenshot
##Notice
This script used unpublicized API from www.net.cn, please don't use it to batch search, otherwise your IP address will be block by the API provider.
| AlfredDomainSearcher
====================
Alfred workflow for domain search, check availability of domain.
##Install
Download the `Domain Searcher.alfredworkflow` file, double click to import your alfred workflow.
[Direct download](https://github.com/Lings/AlfredDomainSearcher/blob/master/Domain%20Searcher.alfredworkflow?raw=true)
##Usage
####1. Input `dm abc` to check whether `abc.com`, `abc.cn`, `abc.net`, `abc.me` these domains can be registed.

####2. Input `dmx abc` to check more extentions, include `abc.org`, `abc.tv`, `abc.cc`

####3. Input whole domain (eg. `dm abc.com`) what ever you use `dm` or `dmx`, will get only one result for the specific domain.

##Notice
This script used unpublicized API from www.net.cn, please don't use it to batch search, otherwise your IP address will be block by the API provider.
| Update download link and screenshot link | Update download link and screenshot link
| Markdown | mit | chenruixuan/AlfredDomainSearcher,Lings/AlfredDomainSearcher | markdown | ## Code Before:
AlfredDomainSearcher
====================
Alfred workflow for domain search, check availability of domain.
##Install
Download the `.alfredworkflow` file, double click to import your alfred workflow.
##Usage
####1. Input `dm abc` to check whether `abc.com`, `abc.cn`, `abc.net`, `abc.me` these domains can be registed.
####2. Input `dmx abc` to check more extentions, include `abc.org`, `abc.tv`, `abc.cc`
####3. Input whole domain (eg. `dm abc.com`) what ever you use `dm` or `dmx`, will get only one result for the specific domain.
##Screenshot
##Notice
This script used unpublicized API from www.net.cn, please don't use it to batch search, otherwise your IP address will be block by the API provider.
## Instruction:
Update download link and screenshot link
## Code After:
AlfredDomainSearcher
====================
Alfred workflow for domain search, check availability of domain.
##Install
Download the `Domain Searcher.alfredworkflow` file, double click to import your alfred workflow.
[Direct download](https://github.com/Lings/AlfredDomainSearcher/blob/master/Domain%20Searcher.alfredworkflow?raw=true)
##Usage
####1. Input `dm abc` to check whether `abc.com`, `abc.cn`, `abc.net`, `abc.me` these domains can be registed.

####2. Input `dmx abc` to check more extentions, include `abc.org`, `abc.tv`, `abc.cc`

####3. Input whole domain (eg. `dm abc.com`) what ever you use `dm` or `dmx`, will get only one result for the specific domain.

##Notice
This script used unpublicized API from www.net.cn, please don't use it to batch search, otherwise your IP address will be block by the API provider.
| AlfredDomainSearcher
====================
Alfred workflow for domain search, check availability of domain.
##Install
- Download the `.alfredworkflow` file, double click to import your alfred workflow.
+ Download the `Domain Searcher.alfredworkflow` file, double click to import your alfred workflow.
? +++++++++++++++
+
+ [Direct download](https://github.com/Lings/AlfredDomainSearcher/blob/master/Domain%20Searcher.alfredworkflow?raw=true)
##Usage
####1. Input `dm abc` to check whether `abc.com`, `abc.cn`, `abc.net`, `abc.me` these domains can be registed.
+ 
+
+
####2. Input `dmx abc` to check more extentions, include `abc.org`, `abc.tv`, `abc.cc`
+
+ 
+
####3. Input whole domain (eg. `dm abc.com`) what ever you use `dm` or `dmx`, will get only one result for the specific domain.
+ 
-
-
- ##Screenshot
##Notice
This script used unpublicized API from www.net.cn, please don't use it to batch search, otherwise your IP address will be block by the API provider. | 14 | 0.5 | 10 | 4 |
578f6f842cf784290bb098033c6d741cc93562d0 | src/vs/editor/contrib/inlineCompletions/ghostText.css | src/vs/editor/contrib/inlineCompletions/ghostText.css | /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
.monaco-editor .suggest-preview-additional-widget {
white-space: nowrap;
}
.monaco-editor .suggest-preview-additional-widget .content-spacer {
color: transparent;
white-space: pre;
}
.monaco-editor .suggest-preview-additional-widget .button {
display: inline-block;
cursor: pointer;
text-decoration: underline;
text-underline-position: under;
}
.monaco-editor .ghost-text-hidden {
opacity: 0;
}
| /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
.monaco-editor .suggest-preview-additional-widget {
white-space: nowrap;
}
.monaco-editor .suggest-preview-additional-widget .content-spacer {
color: transparent;
white-space: pre;
}
.monaco-editor .suggest-preview-additional-widget .button {
display: inline-block;
cursor: pointer;
text-decoration: underline;
text-underline-position: under;
}
.monaco-editor .ghost-text-hidden {
opacity: 0;
font-size: 0;
}
| Set font-size:0 to improve rendering of hidden text, caused by multi-line inline ghost text. | Set font-size:0 to improve rendering of hidden text, caused by multi-line inline ghost text.
| CSS | mit | eamodio/vscode,eamodio/vscode,Microsoft/vscode,microsoft/vscode,eamodio/vscode,microsoft/vscode,microsoft/vscode,Microsoft/vscode,Microsoft/vscode,Microsoft/vscode,microsoft/vscode,eamodio/vscode,Microsoft/vscode,eamodio/vscode,eamodio/vscode,eamodio/vscode,Microsoft/vscode,Microsoft/vscode,microsoft/vscode,Microsoft/vscode,eamodio/vscode,eamodio/vscode,microsoft/vscode,microsoft/vscode,Microsoft/vscode,eamodio/vscode,microsoft/vscode,eamodio/vscode,eamodio/vscode,eamodio/vscode,eamodio/vscode,Microsoft/vscode,eamodio/vscode,eamodio/vscode,Microsoft/vscode,microsoft/vscode,Microsoft/vscode,microsoft/vscode,microsoft/vscode,microsoft/vscode,Microsoft/vscode,microsoft/vscode,microsoft/vscode,Microsoft/vscode,eamodio/vscode,Microsoft/vscode,microsoft/vscode,Microsoft/vscode,Microsoft/vscode,microsoft/vscode,microsoft/vscode | css | ## Code Before:
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
.monaco-editor .suggest-preview-additional-widget {
white-space: nowrap;
}
.monaco-editor .suggest-preview-additional-widget .content-spacer {
color: transparent;
white-space: pre;
}
.monaco-editor .suggest-preview-additional-widget .button {
display: inline-block;
cursor: pointer;
text-decoration: underline;
text-underline-position: under;
}
.monaco-editor .ghost-text-hidden {
opacity: 0;
}
## Instruction:
Set font-size:0 to improve rendering of hidden text, caused by multi-line inline ghost text.
## Code After:
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
.monaco-editor .suggest-preview-additional-widget {
white-space: nowrap;
}
.monaco-editor .suggest-preview-additional-widget .content-spacer {
color: transparent;
white-space: pre;
}
.monaco-editor .suggest-preview-additional-widget .button {
display: inline-block;
cursor: pointer;
text-decoration: underline;
text-underline-position: under;
}
.monaco-editor .ghost-text-hidden {
opacity: 0;
font-size: 0;
}
| /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
.monaco-editor .suggest-preview-additional-widget {
white-space: nowrap;
}
.monaco-editor .suggest-preview-additional-widget .content-spacer {
color: transparent;
white-space: pre;
}
.monaco-editor .suggest-preview-additional-widget .button {
display: inline-block;
cursor: pointer;
text-decoration: underline;
text-underline-position: under;
}
.monaco-editor .ghost-text-hidden {
opacity: 0;
+ font-size: 0;
} | 1 | 0.041667 | 1 | 0 |
57786affe2a525e155197aa8d936121dbb4ef76e | features/support/expectations.rb | features/support/expectations.rb | module Expectations
def expect_code_with_result(string)
code, result = string.split('#=>').map(&:strip)
expect(eval_in_page(code)).to eq eval(result)
end
end
World Expectations
| module Expectations
def expect_code_with_result(string, evaluator = :eval_in_page)
code, result = string.split('#=>').map(&:strip)
expect(send(evaluator, code)).to eq eval(result)
end
end
World Expectations
| Allow passing a custom evaluator. | [tests] Allow passing a custom evaluator.
| Ruby | mit | mojotech/capybara-ui,mojotech/dill | ruby | ## Code Before:
module Expectations
def expect_code_with_result(string)
code, result = string.split('#=>').map(&:strip)
expect(eval_in_page(code)).to eq eval(result)
end
end
World Expectations
## Instruction:
[tests] Allow passing a custom evaluator.
## Code After:
module Expectations
def expect_code_with_result(string, evaluator = :eval_in_page)
code, result = string.split('#=>').map(&:strip)
expect(send(evaluator, code)).to eq eval(result)
end
end
World Expectations
| module Expectations
- def expect_code_with_result(string)
+ def expect_code_with_result(string, evaluator = :eval_in_page)
code, result = string.split('#=>').map(&:strip)
- expect(eval_in_page(code)).to eq eval(result)
? ^^^^^ ^^^
+ expect(send(evaluator, code)).to eq eval(result)
? +++++ ^ ^^^^^
end
end
World Expectations | 4 | 0.444444 | 2 | 2 |
b8793e5c819faf0a0d436f6197d735e11a498e5c | README.md | README.md | Tensorflow implementation of 3D Generative Adversarial Network.
| Tensorflow implementation of 3D Generative Adversarial Network.
[](https://travis-ci.org/meetshah1995/tf-3dgan)
[](https://arxiv.org/abs/1610.07584)
| Add arXiv and Travis Tags | Add arXiv and Travis Tags | Markdown | mit | meetshah1995/tf-3dgan | markdown | ## Code Before:
Tensorflow implementation of 3D Generative Adversarial Network.
## Instruction:
Add arXiv and Travis Tags
## Code After:
Tensorflow implementation of 3D Generative Adversarial Network.
[](https://travis-ci.org/meetshah1995/tf-3dgan)
[](https://arxiv.org/abs/1610.07584)
| Tensorflow implementation of 3D Generative Adversarial Network.
+
+ [](https://travis-ci.org/meetshah1995/tf-3dgan)
+ [](https://arxiv.org/abs/1610.07584) | 3 | 3 | 3 | 0 |
a3a105ec793959b6e6a61193132de19474fb5684 | server/config/database.js | server/config/database.js | module.exports = {
url: 'mongodb://localhost/gokibitz'
};
| module.exports = {
// Your MONGO_URI URL needs to be set in your `.env` file at project root.
url: process.env.MONGO_URI
};
| Enable auth on production DB | Enable auth on production DB
| JavaScript | mit | levelonedev/gokibitz,levelonedev/gokibitz,neagle/gokibitz,neagle/gokibitz | javascript | ## Code Before:
module.exports = {
url: 'mongodb://localhost/gokibitz'
};
## Instruction:
Enable auth on production DB
## Code After:
module.exports = {
// Your MONGO_URI URL needs to be set in your `.env` file at project root.
url: process.env.MONGO_URI
};
| module.exports = {
- url: 'mongodb://localhost/gokibitz'
+ // Your MONGO_URI URL needs to be set in your `.env` file at project root.
+ url: process.env.MONGO_URI
}; | 3 | 1 | 2 | 1 |
67e29350872d1e54bd58d833731532c4d5c464be | app/models/concerns/api_resource.rb | app/models/concerns/api_resource.rb | module ApiResource
extend ActiveSupport::Concern
included do
cattr_accessor(:panoptes_attributes) do
HashWithIndifferentAccess.new
end
end
module ClassMethods
def panoptes_attribute(name, updateable: false)
panoptes_attributes[name] = { updateable: updateable }
end
def updateable_panoptes_attributes
panoptes_attributes.select{ |k, v| v[:updateable] }.keys
end
def from_panoptes(api_response)
return unless api_response.success?
hash = api_response.body[table_name].first
find_or_create_from_panoptes(hash).tap do |record|
record.update_from_panoptes hash
end
end
def find_or_create_from_panoptes(hash)
record = find_by_id hash['id']
record ||= create hash.slice *panoptes_attributes.keys
end
end
def update_from_panoptes(hash)
attrs = hash.slice *self.class.updateable_panoptes_attributes
attrs.each_pair{ |k, v| self[k] = v }
save! if changed?
end
end
| module ApiResource
extend ActiveSupport::Concern
included do
class_attribute :panoptes_attributes
self.panoptes_attributes = HashWithIndifferentAccess.new
end
module ClassMethods
def panoptes_attribute(name, updateable: false)
panoptes_attributes[name] = { updateable: updateable }
end
def updateable_panoptes_attributes
panoptes_attributes.select{ |k, v| v[:updateable] }.keys
end
def from_panoptes(api_response)
return unless api_response.success?
hash = api_response.body[table_name].first
find_or_create_from_panoptes(hash).tap do |record|
record.update_from_panoptes hash
end
end
def find_or_create_from_panoptes(hash)
record = find_by_id hash['id']
record ||= create hash.slice *panoptes_attributes.keys
end
end
def update_from_panoptes(hash)
attrs = hash.slice *self.class.updateable_panoptes_attributes
attrs.each_pair{ |k, v| self[k] = v }
save! if changed?
end
end
| Use class_attribute instead of cattr_accessor | Use class_attribute instead of cattr_accessor | Ruby | apache-2.0 | zooniverse/Talk-Api,zooniverse/Talk-Api,zooniverse/Talk-Api | ruby | ## Code Before:
module ApiResource
extend ActiveSupport::Concern
included do
cattr_accessor(:panoptes_attributes) do
HashWithIndifferentAccess.new
end
end
module ClassMethods
def panoptes_attribute(name, updateable: false)
panoptes_attributes[name] = { updateable: updateable }
end
def updateable_panoptes_attributes
panoptes_attributes.select{ |k, v| v[:updateable] }.keys
end
def from_panoptes(api_response)
return unless api_response.success?
hash = api_response.body[table_name].first
find_or_create_from_panoptes(hash).tap do |record|
record.update_from_panoptes hash
end
end
def find_or_create_from_panoptes(hash)
record = find_by_id hash['id']
record ||= create hash.slice *panoptes_attributes.keys
end
end
def update_from_panoptes(hash)
attrs = hash.slice *self.class.updateable_panoptes_attributes
attrs.each_pair{ |k, v| self[k] = v }
save! if changed?
end
end
## Instruction:
Use class_attribute instead of cattr_accessor
## Code After:
module ApiResource
extend ActiveSupport::Concern
included do
class_attribute :panoptes_attributes
self.panoptes_attributes = HashWithIndifferentAccess.new
end
module ClassMethods
def panoptes_attribute(name, updateable: false)
panoptes_attributes[name] = { updateable: updateable }
end
def updateable_panoptes_attributes
panoptes_attributes.select{ |k, v| v[:updateable] }.keys
end
def from_panoptes(api_response)
return unless api_response.success?
hash = api_response.body[table_name].first
find_or_create_from_panoptes(hash).tap do |record|
record.update_from_panoptes hash
end
end
def find_or_create_from_panoptes(hash)
record = find_by_id hash['id']
record ||= create hash.slice *panoptes_attributes.keys
end
end
def update_from_panoptes(hash)
attrs = hash.slice *self.class.updateable_panoptes_attributes
attrs.each_pair{ |k, v| self[k] = v }
save! if changed?
end
end
| module ApiResource
extend ActiveSupport::Concern
included do
+ class_attribute :panoptes_attributes
+ self.panoptes_attributes = HashWithIndifferentAccess.new
- cattr_accessor(:panoptes_attributes) do
- HashWithIndifferentAccess.new
- end
end
module ClassMethods
def panoptes_attribute(name, updateable: false)
panoptes_attributes[name] = { updateable: updateable }
end
def updateable_panoptes_attributes
panoptes_attributes.select{ |k, v| v[:updateable] }.keys
end
def from_panoptes(api_response)
return unless api_response.success?
hash = api_response.body[table_name].first
find_or_create_from_panoptes(hash).tap do |record|
record.update_from_panoptes hash
end
end
def find_or_create_from_panoptes(hash)
record = find_by_id hash['id']
record ||= create hash.slice *panoptes_attributes.keys
end
end
def update_from_panoptes(hash)
attrs = hash.slice *self.class.updateable_panoptes_attributes
attrs.each_pair{ |k, v| self[k] = v }
save! if changed?
end
end | 5 | 0.131579 | 2 | 3 |
99809bdc78e6aa1e8b65cae6f6eb9cd88ba195be | app/components/ContestsTable/Button/index.js | app/components/ContestsTable/Button/index.js | import React from 'react';
import moment from 'moment';
import Button from 'material-ui/Button';
import { Link } from 'react-router';
import { FormattedMessage } from 'react-intl';
import messages from './messages';
function ContestButton(props) {
const { canJoinStarted, signupDuration, start, id } = props.contest;
const startTime = moment(start).add(signupDuration, 'seconds');
const started = props.time.isAfter(startTime);
const canEnter = started || props.isOwner;
const canJoin = (!started || canJoinStarted) && !props.contest.joined && !props.isOwner;
return canJoin ? joinButton(props.onClick) : enterButton(canEnter, id);
}
ContestButton.propTypes = {
contest: React.PropTypes.object.isRequired,
time: React.PropTypes.object.isRequired,
onClick: React.PropTypes.func,
isOwner: React.PropTypes.bool.isRequired,
};
export default ContestButton;
function enterButton(canEnter, contestId) {
const button = (
<Button raised color="primary" disabled={!canEnter}>
<FormattedMessage {...messages.enter} />
</Button>
);
return canEnter ? <Link to={`/contests/${contestId}`}>{button}</Link> : button;
}
function joinButton(join) {
return (
<Button onClick={join} raised color="primary">
<FormattedMessage {...messages.join} />
</Button>
);
}
| import React from 'react';
import moment from 'moment';
import Button from 'material-ui/Button';
import { Link } from 'react-router';
import { FormattedMessage } from 'react-intl';
import messages from './messages';
function ContestButton(props) {
const { canJoinStarted, signupDuration, start, id } = props.contest;
const enrolmentStart = moment(start);
const startTime = enrolmentStart.add(signupDuration, 'seconds');
const started = props.time.isAfter(startTime);
const canEnter = started || props.isOwner;
const canJoin = props.time.isAfter(enrolmentStart);
const showJoinButton = (!started || canJoinStarted) && !props.contest.joined && !props.isOwner;
return showJoinButton ? joinButton(canJoin, props.onClick) : enterButton(canEnter, id);
}
ContestButton.propTypes = {
contest: React.PropTypes.object.isRequired,
time: React.PropTypes.object.isRequired,
onClick: React.PropTypes.func,
isOwner: React.PropTypes.bool.isRequired,
};
export default ContestButton;
function enterButton(canEnter, contestId) {
const button = (
<Button raised color="primary" disabled={!canEnter}>
<FormattedMessage {...messages.enter} />
</Button>
);
return canEnter ? <Link to={`/contests/${contestId}`}>{button}</Link> : button;
}
function joinButton(canJoin, join) {
return (
<Button onClick={join} raised color="primary" disabled={!canJoin}>
<FormattedMessage {...messages.join} />
</Button>
);
}
| Disable join button before contest enrolment started | Disable join button before contest enrolment started
| JavaScript | bsd-3-clause | zmora-agh/zmora-ui,zmora-agh/zmora-ui | javascript | ## Code Before:
import React from 'react';
import moment from 'moment';
import Button from 'material-ui/Button';
import { Link } from 'react-router';
import { FormattedMessage } from 'react-intl';
import messages from './messages';
function ContestButton(props) {
const { canJoinStarted, signupDuration, start, id } = props.contest;
const startTime = moment(start).add(signupDuration, 'seconds');
const started = props.time.isAfter(startTime);
const canEnter = started || props.isOwner;
const canJoin = (!started || canJoinStarted) && !props.contest.joined && !props.isOwner;
return canJoin ? joinButton(props.onClick) : enterButton(canEnter, id);
}
ContestButton.propTypes = {
contest: React.PropTypes.object.isRequired,
time: React.PropTypes.object.isRequired,
onClick: React.PropTypes.func,
isOwner: React.PropTypes.bool.isRequired,
};
export default ContestButton;
function enterButton(canEnter, contestId) {
const button = (
<Button raised color="primary" disabled={!canEnter}>
<FormattedMessage {...messages.enter} />
</Button>
);
return canEnter ? <Link to={`/contests/${contestId}`}>{button}</Link> : button;
}
function joinButton(join) {
return (
<Button onClick={join} raised color="primary">
<FormattedMessage {...messages.join} />
</Button>
);
}
## Instruction:
Disable join button before contest enrolment started
## Code After:
import React from 'react';
import moment from 'moment';
import Button from 'material-ui/Button';
import { Link } from 'react-router';
import { FormattedMessage } from 'react-intl';
import messages from './messages';
function ContestButton(props) {
const { canJoinStarted, signupDuration, start, id } = props.contest;
const enrolmentStart = moment(start);
const startTime = enrolmentStart.add(signupDuration, 'seconds');
const started = props.time.isAfter(startTime);
const canEnter = started || props.isOwner;
const canJoin = props.time.isAfter(enrolmentStart);
const showJoinButton = (!started || canJoinStarted) && !props.contest.joined && !props.isOwner;
return showJoinButton ? joinButton(canJoin, props.onClick) : enterButton(canEnter, id);
}
ContestButton.propTypes = {
contest: React.PropTypes.object.isRequired,
time: React.PropTypes.object.isRequired,
onClick: React.PropTypes.func,
isOwner: React.PropTypes.bool.isRequired,
};
export default ContestButton;
function enterButton(canEnter, contestId) {
const button = (
<Button raised color="primary" disabled={!canEnter}>
<FormattedMessage {...messages.enter} />
</Button>
);
return canEnter ? <Link to={`/contests/${contestId}`}>{button}</Link> : button;
}
function joinButton(canJoin, join) {
return (
<Button onClick={join} raised color="primary" disabled={!canJoin}>
<FormattedMessage {...messages.join} />
</Button>
);
}
| import React from 'react';
import moment from 'moment';
import Button from 'material-ui/Button';
import { Link } from 'react-router';
import { FormattedMessage } from 'react-intl';
import messages from './messages';
function ContestButton(props) {
const { canJoinStarted, signupDuration, start, id } = props.contest;
+ const enrolmentStart = moment(start);
- const startTime = moment(start).add(signupDuration, 'seconds');
? ^ ^^ -
+ const startTime = enrolmentStart.add(signupDuration, 'seconds');
? ^^^ + ^
const started = props.time.isAfter(startTime);
const canEnter = started || props.isOwner;
+ const canJoin = props.time.isAfter(enrolmentStart);
- const canJoin = (!started || canJoinStarted) && !props.contest.joined && !props.isOwner;
? ^^^
+ const showJoinButton = (!started || canJoinStarted) && !props.contest.joined && !props.isOwner;
? ^^^^ ++++++
- return canJoin ? joinButton(props.onClick) : enterButton(canEnter, id);
? ^^^
+ return showJoinButton ? joinButton(canJoin, props.onClick) : enterButton(canEnter, id);
? ^^^^ ++++++ +++++++++
}
ContestButton.propTypes = {
contest: React.PropTypes.object.isRequired,
time: React.PropTypes.object.isRequired,
onClick: React.PropTypes.func,
isOwner: React.PropTypes.bool.isRequired,
};
export default ContestButton;
function enterButton(canEnter, contestId) {
const button = (
<Button raised color="primary" disabled={!canEnter}>
<FormattedMessage {...messages.enter} />
</Button>
);
return canEnter ? <Link to={`/contests/${contestId}`}>{button}</Link> : button;
}
- function joinButton(join) {
+ function joinButton(canJoin, join) {
? +++++++++
return (
- <Button onClick={join} raised color="primary">
+ <Button onClick={join} raised color="primary" disabled={!canJoin}>
? ++++++++++++++++++++
<FormattedMessage {...messages.join} />
</Button>
);
} | 12 | 0.272727 | 7 | 5 |
628a2d24893cba3019b86a97c311377ca9c11ff7 | README.md | README.md | uc_stripejs
===========
Ubercart StripeJS Plugin
| uc_stripejs
===========
Ubercart StripeJS Plugin
NOT PRODUCTION READY
====================
The module is currently being used by a few e-commerce websites online, that said, the module is not to be considered product ready and has been made available for the purpose of education and to be adapted / maintained.
Maintaining
===========
If you have the time to further enhance the module, please do so as a pull-request and I'll do my best to pull it back into the main repo.
| Update readme with information about module status | Update readme with information about module status | Markdown | cc0-1.0 | harryspink/uc_stripejs,harryspink/uc_stripejs | markdown | ## Code Before:
uc_stripejs
===========
Ubercart StripeJS Plugin
## Instruction:
Update readme with information about module status
## Code After:
uc_stripejs
===========
Ubercart StripeJS Plugin
NOT PRODUCTION READY
====================
The module is currently being used by a few e-commerce websites online, that said, the module is not to be considered product ready and has been made available for the purpose of education and to be adapted / maintained.
Maintaining
===========
If you have the time to further enhance the module, please do so as a pull-request and I'll do my best to pull it back into the main repo.
| uc_stripejs
===========
Ubercart StripeJS Plugin
+
+ NOT PRODUCTION READY
+ ====================
+
+ The module is currently being used by a few e-commerce websites online, that said, the module is not to be considered product ready and has been made available for the purpose of education and to be adapted / maintained.
+
+ Maintaining
+ ===========
+
+ If you have the time to further enhance the module, please do so as a pull-request and I'll do my best to pull it back into the main repo. | 10 | 2.5 | 10 | 0 |
ea910368b8c5d8f3af0fdbc025578a4757efd5c7 | scripts/say.coffee | scripts/say.coffee |
whitelist = require '../support/whitelist'
module.exports = (robot) ->
robot.respond /say to ([a-zA-Z-_\#]+) (.*)/, (msg) ->
if whitelist.canSay(robot, msg.message.user)
[room, message] = msg.match[1..2]
robot.messageRoom room, message
else
msg.reply "Denied because you #{msg.message.user.name} are not in the access list."
|
whitelist = require '../support/whitelist'
module.exports = (robot) ->
robot.respond /say to ([a-zA-Z-_\#]+) (.*)/, (msg) ->
if whitelist.canSay(robot, msg.message.user)
[room, message] = msg.match[1..2]
robot.messageRoom room, message
else
msg.reply "Denied because you #{msg.message.user.name} are not in the access list."
robot.respond /emote to ([a-zA-Z-_\#]+) (.*)/, (msg) ->
if whitelist.canSay(robot, msg.message.user)
[room, message] = msg.match[1..2]
# change the msg.message.user.room and msg.message.room to the room we want
# the emote to go to, as the emote command is made to emote to the place the
# message was received from
msg.message.user.room = msg.message.room = room
msg.emote message
else
msg.reply "Denied because you #{msg.message.user.name} are not in the access list."
| Add ability to make Liobot emote | Add ability to make Liobot emote
| CoffeeScript | mit | LaravelIO/LioBot,lagbox/LioBot,laravelio/liona | coffeescript | ## Code Before:
whitelist = require '../support/whitelist'
module.exports = (robot) ->
robot.respond /say to ([a-zA-Z-_\#]+) (.*)/, (msg) ->
if whitelist.canSay(robot, msg.message.user)
[room, message] = msg.match[1..2]
robot.messageRoom room, message
else
msg.reply "Denied because you #{msg.message.user.name} are not in the access list."
## Instruction:
Add ability to make Liobot emote
## Code After:
whitelist = require '../support/whitelist'
module.exports = (robot) ->
robot.respond /say to ([a-zA-Z-_\#]+) (.*)/, (msg) ->
if whitelist.canSay(robot, msg.message.user)
[room, message] = msg.match[1..2]
robot.messageRoom room, message
else
msg.reply "Denied because you #{msg.message.user.name} are not in the access list."
robot.respond /emote to ([a-zA-Z-_\#]+) (.*)/, (msg) ->
if whitelist.canSay(robot, msg.message.user)
[room, message] = msg.match[1..2]
# change the msg.message.user.room and msg.message.room to the room we want
# the emote to go to, as the emote command is made to emote to the place the
# message was received from
msg.message.user.room = msg.message.room = room
msg.emote message
else
msg.reply "Denied because you #{msg.message.user.name} are not in the access list."
|
whitelist = require '../support/whitelist'
module.exports = (robot) ->
robot.respond /say to ([a-zA-Z-_\#]+) (.*)/, (msg) ->
if whitelist.canSay(robot, msg.message.user)
[room, message] = msg.match[1..2]
robot.messageRoom room, message
else
msg.reply "Denied because you #{msg.message.user.name} are not in the access list."
+
+ robot.respond /emote to ([a-zA-Z-_\#]+) (.*)/, (msg) ->
+ if whitelist.canSay(robot, msg.message.user)
+ [room, message] = msg.match[1..2]
+ # change the msg.message.user.room and msg.message.room to the room we want
+ # the emote to go to, as the emote command is made to emote to the place the
+ # message was received from
+ msg.message.user.room = msg.message.room = room
+ msg.emote message
+ else
+ msg.reply "Denied because you #{msg.message.user.name} are not in the access list." | 11 | 1.1 | 11 | 0 |
2076c9400c7d2b327b87a4f47e9593832acf2236 | src/components/gifPicker/singleGif.tsx | src/components/gifPicker/singleGif.tsx | import React, {FC} from 'react';
import {Handler} from '../../helpers/typeHelpers';
export interface GifItemProps {
previewUrl: string;
onClick: Handler;
}
export const BTDGifItem: FC<GifItemProps> = (props) => {
return (
<div
className="btd-giphy-block-wrapper"
onClick={props.onClick}
style={{height: 100, width: 100, display: 'inline-block'}}>
<img
src={props.previewUrl}
className="btd-giphy-block"
style={{
objectFit: 'cover',
height: '100%',
width: '100%',
}}
/>
</div>
);
};
| import React, {FC} from 'react';
import {Handler} from '../../helpers/typeHelpers';
export interface GifItemProps {
previewUrl: string;
onClick: Handler;
}
export const BTDGifItem: FC<GifItemProps> = (props) => {
return (
<div
className="btd-giphy-block-wrapper"
onClick={props.onClick}
style={{height: 100, width: `calc(100% / 3)`, display: 'inline-block'}}>
<img
src={props.previewUrl}
className="btd-giphy-block"
style={{
objectFit: 'cover',
height: '100%',
width: '100%',
}}
/>
</div>
);
};
| Fix gif picker with scrollbar | Fix gif picker with scrollbar
| TypeScript | mit | eramdam/BetterTweetDeck,eramdam/BetterTweetDeck,eramdam/BetterTweetDeck,eramdam/BetterTweetDeck | typescript | ## Code Before:
import React, {FC} from 'react';
import {Handler} from '../../helpers/typeHelpers';
export interface GifItemProps {
previewUrl: string;
onClick: Handler;
}
export const BTDGifItem: FC<GifItemProps> = (props) => {
return (
<div
className="btd-giphy-block-wrapper"
onClick={props.onClick}
style={{height: 100, width: 100, display: 'inline-block'}}>
<img
src={props.previewUrl}
className="btd-giphy-block"
style={{
objectFit: 'cover',
height: '100%',
width: '100%',
}}
/>
</div>
);
};
## Instruction:
Fix gif picker with scrollbar
## Code After:
import React, {FC} from 'react';
import {Handler} from '../../helpers/typeHelpers';
export interface GifItemProps {
previewUrl: string;
onClick: Handler;
}
export const BTDGifItem: FC<GifItemProps> = (props) => {
return (
<div
className="btd-giphy-block-wrapper"
onClick={props.onClick}
style={{height: 100, width: `calc(100% / 3)`, display: 'inline-block'}}>
<img
src={props.previewUrl}
className="btd-giphy-block"
style={{
objectFit: 'cover',
height: '100%',
width: '100%',
}}
/>
</div>
);
};
| import React, {FC} from 'react';
import {Handler} from '../../helpers/typeHelpers';
export interface GifItemProps {
previewUrl: string;
onClick: Handler;
}
export const BTDGifItem: FC<GifItemProps> = (props) => {
return (
<div
className="btd-giphy-block-wrapper"
onClick={props.onClick}
- style={{height: 100, width: 100, display: 'inline-block'}}>
+ style={{height: 100, width: `calc(100% / 3)`, display: 'inline-block'}}>
? ++++++ +++++++
<img
src={props.previewUrl}
className="btd-giphy-block"
style={{
objectFit: 'cover',
height: '100%',
width: '100%',
}}
/>
</div>
);
}; | 2 | 0.076923 | 1 | 1 |
3ec98fd5ba6f8d3101e102004204af29fd123d39 | lib/syncer/listeners/fsevents.rb | lib/syncer/listeners/fsevents.rb | require "rb-fsevent"
module Vagrant
module Syncer
module Listeners
class FSEvents
def initialize(absolute_path, excludes, settings, callback)
@absolute_path = absolute_path
@settings = settings.merge!(no_defer: false)
@callback = callback
# rb-fsevent does not support excludes.
end
def run
changes = Queue.new
fsevent = FSEvent.new
fsevent.watch @absolute_path, @settings do |paths|
paths.each { |path| changes << path }
end
Thread.new { fsevent.run }
loop do
directories = Set.new
begin
loop do
change = Timeout::timeout(@settings[:latency]) { changes.pop }
directories << change unless change.nil?
end
rescue Timeout::Error, ThreadError
end
@callback.call(directories.to_a) unless directories.empty?
end
end
end
end
end
end
| require "rb-fsevent"
module Vagrant
module Syncer
module Listeners
class FSEvents
def initialize(absolute_path, excludes, settings, callback)
@absolute_path = absolute_path
@settings = settings.merge!(no_defer: false)
@callback = callback
# rb-fsevent does not support excludes.
end
def run
changes = Queue.new
fsevent = FSEvent.new
fsevent.watch @absolute_path, @settings do |paths|
paths.each { |path| changes << path }
end
Thread.new { fsevent.run }
loop do
directories = Set.new
change = changes.pop
directories << change unless change.nil?
@callback.call(directories.to_a) unless directories.empty?
end
end
end
end
end
end
| Remove timeout loop for FSEvents | Remove timeout loop for FSEvents
| Ruby | mit | asyrjasalo/vagrant-syncer,asyrjasalo/vagrant-syncer | ruby | ## Code Before:
require "rb-fsevent"
module Vagrant
module Syncer
module Listeners
class FSEvents
def initialize(absolute_path, excludes, settings, callback)
@absolute_path = absolute_path
@settings = settings.merge!(no_defer: false)
@callback = callback
# rb-fsevent does not support excludes.
end
def run
changes = Queue.new
fsevent = FSEvent.new
fsevent.watch @absolute_path, @settings do |paths|
paths.each { |path| changes << path }
end
Thread.new { fsevent.run }
loop do
directories = Set.new
begin
loop do
change = Timeout::timeout(@settings[:latency]) { changes.pop }
directories << change unless change.nil?
end
rescue Timeout::Error, ThreadError
end
@callback.call(directories.to_a) unless directories.empty?
end
end
end
end
end
end
## Instruction:
Remove timeout loop for FSEvents
## Code After:
require "rb-fsevent"
module Vagrant
module Syncer
module Listeners
class FSEvents
def initialize(absolute_path, excludes, settings, callback)
@absolute_path = absolute_path
@settings = settings.merge!(no_defer: false)
@callback = callback
# rb-fsevent does not support excludes.
end
def run
changes = Queue.new
fsevent = FSEvent.new
fsevent.watch @absolute_path, @settings do |paths|
paths.each { |path| changes << path }
end
Thread.new { fsevent.run }
loop do
directories = Set.new
change = changes.pop
directories << change unless change.nil?
@callback.call(directories.to_a) unless directories.empty?
end
end
end
end
end
end
| require "rb-fsevent"
module Vagrant
module Syncer
module Listeners
class FSEvents
def initialize(absolute_path, excludes, settings, callback)
@absolute_path = absolute_path
@settings = settings.merge!(no_defer: false)
@callback = callback
# rb-fsevent does not support excludes.
end
def run
changes = Queue.new
fsevent = FSEvent.new
fsevent.watch @absolute_path, @settings do |paths|
paths.each { |path| changes << path }
end
Thread.new { fsevent.run }
loop do
directories = Set.new
+ change = changes.pop
- begin
- loop do
- change = Timeout::timeout(@settings[:latency]) { changes.pop }
- directories << change unless change.nil?
? ----
+ directories << change unless change.nil?
- end
- rescue Timeout::Error, ThreadError
- end
-
@callback.call(directories.to_a) unless directories.empty?
end
end
end
end
end
end | 10 | 0.25 | 2 | 8 |
a780da9e87aa501d430e03bfde9e527d06ffd99b | spec/ajw2/cli_spec.rb | spec/ajw2/cli_spec.rb | require "spec_helper"
require "fileutils"
module Ajw2
class Cli
describe "#execute" do
context "with valid argument" do
before do
@source = fixture_path("chat.json")
@out_dir = "test_cli"
@args = [@source, @out_dir]
FileUtils.rm_r(@out_dir) if Dir.exists? @out_dir
end
subject { Ajw2::Cli.execute(@args) }
it "should create out_dir" do
subject
expect(Dir.exists?(@out_dir)).to be_true
end
after do
FileUtils.rm_r(@out_dir) if Dir.exists? @out_dir
end
end
context "with invalid argument" do
before do
@source = "hoge"
@out_dir = "fuga"
@args = [@source, @out_dir]
end
it "should raise Exception" do
expect { Ajw2::Cli.execute(@args) }.to raise_error
end
end
end
end
end
| require "spec_helper"
require "fileutils"
module Ajw2
describe Cli do
describe "#execute" do
context "with valid argument" do
before do
@source = fixture_path("chat.json")
@out_dir = "test_cli"
@args = [@source, @out_dir]
FileUtils.rm_r(@out_dir) if Dir.exists? @out_dir
end
subject { Ajw2::Cli.execute(@args) }
it "should create out_dir" do
subject
expect(Dir.exists?(@out_dir)).to be_true
end
after do
FileUtils.rm_r(@out_dir) if Dir.exists? @out_dir
end
end
context "with invalid argument" do
before do
@source = "hoge"
@out_dir = "fuga"
@args = [@source, @out_dir]
end
it "should raise Exception" do
expect { Ajw2::Cli.execute(@args) }.to raise_error
end
end
end
end
end
| Fix "class Cli" -> "describe Cli do" | Fix "class Cli" -> "describe Cli do"
| Ruby | mit | dtan4/ajw2,dtan4/ajw2 | ruby | ## Code Before:
require "spec_helper"
require "fileutils"
module Ajw2
class Cli
describe "#execute" do
context "with valid argument" do
before do
@source = fixture_path("chat.json")
@out_dir = "test_cli"
@args = [@source, @out_dir]
FileUtils.rm_r(@out_dir) if Dir.exists? @out_dir
end
subject { Ajw2::Cli.execute(@args) }
it "should create out_dir" do
subject
expect(Dir.exists?(@out_dir)).to be_true
end
after do
FileUtils.rm_r(@out_dir) if Dir.exists? @out_dir
end
end
context "with invalid argument" do
before do
@source = "hoge"
@out_dir = "fuga"
@args = [@source, @out_dir]
end
it "should raise Exception" do
expect { Ajw2::Cli.execute(@args) }.to raise_error
end
end
end
end
end
## Instruction:
Fix "class Cli" -> "describe Cli do"
## Code After:
require "spec_helper"
require "fileutils"
module Ajw2
describe Cli do
describe "#execute" do
context "with valid argument" do
before do
@source = fixture_path("chat.json")
@out_dir = "test_cli"
@args = [@source, @out_dir]
FileUtils.rm_r(@out_dir) if Dir.exists? @out_dir
end
subject { Ajw2::Cli.execute(@args) }
it "should create out_dir" do
subject
expect(Dir.exists?(@out_dir)).to be_true
end
after do
FileUtils.rm_r(@out_dir) if Dir.exists? @out_dir
end
end
context "with invalid argument" do
before do
@source = "hoge"
@out_dir = "fuga"
@args = [@source, @out_dir]
end
it "should raise Exception" do
expect { Ajw2::Cli.execute(@args) }.to raise_error
end
end
end
end
end
| require "spec_helper"
require "fileutils"
module Ajw2
- class Cli
+ describe Cli do
describe "#execute" do
context "with valid argument" do
before do
@source = fixture_path("chat.json")
@out_dir = "test_cli"
@args = [@source, @out_dir]
FileUtils.rm_r(@out_dir) if Dir.exists? @out_dir
end
subject { Ajw2::Cli.execute(@args) }
it "should create out_dir" do
subject
expect(Dir.exists?(@out_dir)).to be_true
end
after do
FileUtils.rm_r(@out_dir) if Dir.exists? @out_dir
end
end
context "with invalid argument" do
before do
@source = "hoge"
@out_dir = "fuga"
@args = [@source, @out_dir]
end
it "should raise Exception" do
expect { Ajw2::Cli.execute(@args) }.to raise_error
end
end
end
end
end | 2 | 0.05 | 1 | 1 |
8f02cf51d0271361f1406a93234ce3eef8cc185b | ut/mocha.js | ut/mocha.js | var assert = require('assert');
describe('Angularjs', function() {
describe('test', function() {
it('always true', function() {
assert(1)
});
});
});
| var assert = require('assert');
describe('Angularjs', function() {
describe('main', function() {
it('always true', function() {
assert(1)
});
});
});
describe('Angularjs', function() {
describe('fpga', function() {
it('always true', function() {
assert(1)
});
});
});
describe('Angularjs', function() {
describe('db', function() {
it('always true', function() {
assert(1)
});
});
});
| Add test for fpga main db | Add test for fpga main db
| JavaScript | agpl-3.0 | OpenFPGAduino/Arduinojs,OpenFPGAduino/Arduinojs,OpenFPGAduino/Arduinojs,OpenFPGAduino/Arduinojs,OpenFPGAduino/Arduinojs | javascript | ## Code Before:
var assert = require('assert');
describe('Angularjs', function() {
describe('test', function() {
it('always true', function() {
assert(1)
});
});
});
## Instruction:
Add test for fpga main db
## Code After:
var assert = require('assert');
describe('Angularjs', function() {
describe('main', function() {
it('always true', function() {
assert(1)
});
});
});
describe('Angularjs', function() {
describe('fpga', function() {
it('always true', function() {
assert(1)
});
});
});
describe('Angularjs', function() {
describe('db', function() {
it('always true', function() {
assert(1)
});
});
});
| var assert = require('assert');
describe('Angularjs', function() {
- describe('test', function() {
? ^^^^
+ describe('main', function() {
? ^^^^
it('always true', function() {
assert(1)
});
});
});
+
+ describe('Angularjs', function() {
+ describe('fpga', function() {
+ it('always true', function() {
+ assert(1)
+ });
+ });
+ });
+
+ describe('Angularjs', function() {
+ describe('db', function() {
+ it('always true', function() {
+ assert(1)
+ });
+ });
+ }); | 18 | 2.25 | 17 | 1 |
99cdf73f7cd354fb4c9fe0a7986bcd51fae1f6cc | lib/mollie/amount.rb | lib/mollie/amount.rb | module Mollie
class Amount < Base
attr_accessor :value, :currency
def value=(net)
@value = BigDecimal.new(net.to_s)
end
end
end
| module Mollie
class Amount < Base
attr_accessor :value, :currency
def initialize(attributes)
super unless attributes.nil?
end
def value=(net)
@value = BigDecimal.new(net.to_s)
end
end
end
| Return empty Amount object when API returns null | Return empty Amount object when API returns null
| Ruby | bsd-2-clause | mollie/mollie-api-ruby,mollie/mollie-api-ruby | ruby | ## Code Before:
module Mollie
class Amount < Base
attr_accessor :value, :currency
def value=(net)
@value = BigDecimal.new(net.to_s)
end
end
end
## Instruction:
Return empty Amount object when API returns null
## Code After:
module Mollie
class Amount < Base
attr_accessor :value, :currency
def initialize(attributes)
super unless attributes.nil?
end
def value=(net)
@value = BigDecimal.new(net.to_s)
end
end
end
| module Mollie
class Amount < Base
attr_accessor :value, :currency
+
+ def initialize(attributes)
+ super unless attributes.nil?
+ end
def value=(net)
@value = BigDecimal.new(net.to_s)
end
end
end | 4 | 0.444444 | 4 | 0 |
729d4a8f355d7bf9c25564efb221fb264a668b23 | Resources/Private/Templates/Preview/ExternalMedia.html | Resources/Private/Templates/Preview/ExternalMedia.html | {namespace bk2k = BK2K\BootstrapPackage\ViewHelpers}
<br>
<bk2k:externalMedia url="{external_media_source}" class="embed-responsive-item">
<f:if condition="{externalMedia}">
<f:then>
<div class="embed-responsive embed-responsive-{external_media_ratio}">
<f:format.raw>{externalMedia}</f:format.raw>
</div>
</f:then>
<f:else>
<div class="alert alert-warning">
<f:translate key="externalmediaunsupported" extensionName="bootstrap_package" arguments="{0: '<strong>{external_media_source}</strong>'}" />
</div>
</f:else>
</f:if>
</bk2k:externalMedia> | {namespace bk2k = BK2K\BootstrapPackage\ViewHelpers}
<br>
<bk2k:externalMedia url="{external_media_source}" class="embed-responsive-item">
<f:if condition="{externalMedia}">
<f:then>
<div style="max-width: 400px;">
<div class="embed-responsive embed-responsive-{external_media_ratio}">
<f:format.raw>{externalMedia}</f:format.raw>
</div>
</div>
</f:then>
<f:else>
<div class="alert alert-warning">
<f:translate key="externalmediaunsupported" extensionName="bootstrap_package" arguments="{0: '<strong>{external_media_source}</strong>'}" />
</div>
</f:else>
</f:if>
</bk2k:externalMedia> | Reduce size of external media preview | [TASK] Reduce size of external media preview
| HTML | mit | webian/bootstrap_package,pekue/bootstrap_package,benjaminkott/bootstrap_package,maddy2101/bootstrap_package,cedricziel/bootstrap_package-1,webian/bootstrap_package,cedricziel/bootstrap_package-1,webian/bootstrap_package,maddy2101/bootstrap_package,s-leger/bootstrap_package,stweil/bootstrap_package,s-leger/bootstrap_package,MediaCluster/bootstrap_package,s-leger/bootstrap_package,MediaCluster/bootstrap_package,benjaminkott/bootstrap_package,pekue/bootstrap_package,stweil/bootstrap_package,benjaminkott/bootstrap_package,stweil/bootstrap_package,benjaminkott/bootstrap_package,maddy2101/bootstrap_package,stweil/bootstrap_package,cedricziel/bootstrap_package-1,pekue/bootstrap_package,MediaCluster/bootstrap_package | html | ## Code Before:
{namespace bk2k = BK2K\BootstrapPackage\ViewHelpers}
<br>
<bk2k:externalMedia url="{external_media_source}" class="embed-responsive-item">
<f:if condition="{externalMedia}">
<f:then>
<div class="embed-responsive embed-responsive-{external_media_ratio}">
<f:format.raw>{externalMedia}</f:format.raw>
</div>
</f:then>
<f:else>
<div class="alert alert-warning">
<f:translate key="externalmediaunsupported" extensionName="bootstrap_package" arguments="{0: '<strong>{external_media_source}</strong>'}" />
</div>
</f:else>
</f:if>
</bk2k:externalMedia>
## Instruction:
[TASK] Reduce size of external media preview
## Code After:
{namespace bk2k = BK2K\BootstrapPackage\ViewHelpers}
<br>
<bk2k:externalMedia url="{external_media_source}" class="embed-responsive-item">
<f:if condition="{externalMedia}">
<f:then>
<div style="max-width: 400px;">
<div class="embed-responsive embed-responsive-{external_media_ratio}">
<f:format.raw>{externalMedia}</f:format.raw>
</div>
</div>
</f:then>
<f:else>
<div class="alert alert-warning">
<f:translate key="externalmediaunsupported" extensionName="bootstrap_package" arguments="{0: '<strong>{external_media_source}</strong>'}" />
</div>
</f:else>
</f:if>
</bk2k:externalMedia> | {namespace bk2k = BK2K\BootstrapPackage\ViewHelpers}
<br>
<bk2k:externalMedia url="{external_media_source}" class="embed-responsive-item">
<f:if condition="{externalMedia}">
<f:then>
+ <div style="max-width: 400px;">
- <div class="embed-responsive embed-responsive-{external_media_ratio}">
+ <div class="embed-responsive embed-responsive-{external_media_ratio}">
? ++++
- <f:format.raw>{externalMedia}</f:format.raw>
+ <f:format.raw>{externalMedia}</f:format.raw>
? ++++
+ </div>
</div>
</f:then>
<f:else>
<div class="alert alert-warning">
<f:translate key="externalmediaunsupported" extensionName="bootstrap_package" arguments="{0: '<strong>{external_media_source}</strong>'}" />
</div>
</f:else>
</f:if>
</bk2k:externalMedia> | 6 | 0.333333 | 4 | 2 |
68ce888781a163fdf52bd77e3707bcfbc9e49243 | need-hug/cpp/Main.cpp | need-hug/cpp/Main.cpp |
int main(int argc, char** argv)
{
using namespace NeedHug;
ReturnCode returnCode = ReturnCode::Continue;
while(returnCode == NeedHug::ReturnCode::Continue)
{
// When the code reaches here, nothing should be allocated any longer in order to avoid memoryleaks.
NeedHugGame needHugGame;
try
{
returnCode = needHugGame.Start();
}
catch(...)
{
std::cout << "Game crashed unexpectedly" << std::endl;
returnCode = ReturnCode::Unknown;
}
}
std::cout << "The game returned the following stopCode '" << ReturnCodeConverter().Convert(returnCode).info << "'." << std::endl;
int returnCodeValue = 1;
if(returnCode == ReturnCode::Stop)
{
returnCodeValue = 0;
}
return returnCodeValue;
}
|
int main(int argc, char** argv)
{
using namespace NeedHug;
ReturnCode returnCode = ReturnCode::Continue;
while (returnCode == NeedHug::ReturnCode::Continue)
{
// When the code reaches here, nothing should be allocated any longer in order to avoid memoryleaks.
NeedHugGame needHugGame;
try
{
returnCode = needHugGame.Start();
}
catch (...)
{
std::cout << "Game crashed unexpectedly" << std::endl;
returnCode = ReturnCode::Unknown;
}
}
std::cout << "The game returned the following stopCode '" << ReturnCodeConverter().Convert(returnCode).info << "'." << std::endl;
int returnCodeValue = 1;
if (returnCode == ReturnCode::Stop)
{
returnCodeValue = 0;
}
#ifdef _WIN32
std::getchar();
#endif
return returnCodeValue;
}
| Add pause before exit on windows systems | Add pause before exit on windows systems
| C++ | mit | Poelsa/need-hug,Poelsa/need-hug | c++ | ## Code Before:
int main(int argc, char** argv)
{
using namespace NeedHug;
ReturnCode returnCode = ReturnCode::Continue;
while(returnCode == NeedHug::ReturnCode::Continue)
{
// When the code reaches here, nothing should be allocated any longer in order to avoid memoryleaks.
NeedHugGame needHugGame;
try
{
returnCode = needHugGame.Start();
}
catch(...)
{
std::cout << "Game crashed unexpectedly" << std::endl;
returnCode = ReturnCode::Unknown;
}
}
std::cout << "The game returned the following stopCode '" << ReturnCodeConverter().Convert(returnCode).info << "'." << std::endl;
int returnCodeValue = 1;
if(returnCode == ReturnCode::Stop)
{
returnCodeValue = 0;
}
return returnCodeValue;
}
## Instruction:
Add pause before exit on windows systems
## Code After:
int main(int argc, char** argv)
{
using namespace NeedHug;
ReturnCode returnCode = ReturnCode::Continue;
while (returnCode == NeedHug::ReturnCode::Continue)
{
// When the code reaches here, nothing should be allocated any longer in order to avoid memoryleaks.
NeedHugGame needHugGame;
try
{
returnCode = needHugGame.Start();
}
catch (...)
{
std::cout << "Game crashed unexpectedly" << std::endl;
returnCode = ReturnCode::Unknown;
}
}
std::cout << "The game returned the following stopCode '" << ReturnCodeConverter().Convert(returnCode).info << "'." << std::endl;
int returnCodeValue = 1;
if (returnCode == ReturnCode::Stop)
{
returnCodeValue = 0;
}
#ifdef _WIN32
std::getchar();
#endif
return returnCodeValue;
}
|
int main(int argc, char** argv)
{
using namespace NeedHug;
ReturnCode returnCode = ReturnCode::Continue;
- while(returnCode == NeedHug::ReturnCode::Continue)
+ while (returnCode == NeedHug::ReturnCode::Continue)
? +
{
// When the code reaches here, nothing should be allocated any longer in order to avoid memoryleaks.
NeedHugGame needHugGame;
try
{
returnCode = needHugGame.Start();
}
- catch(...)
+ catch (...)
? +
{
std::cout << "Game crashed unexpectedly" << std::endl;
returnCode = ReturnCode::Unknown;
}
}
-
+
std::cout << "The game returned the following stopCode '" << ReturnCodeConverter().Convert(returnCode).info << "'." << std::endl;
int returnCodeValue = 1;
- if(returnCode == ReturnCode::Stop)
+ if (returnCode == ReturnCode::Stop)
? +
{
returnCodeValue = 0;
}
+
+ #ifdef _WIN32
+ std::getchar();
+ #endif
+
return returnCodeValue;
} | 13 | 0.448276 | 9 | 4 |
e657822b7d905af1951765211dae7d205f18acaf | components/camel-groovy/src/main/java/org/apache/camel/groovy/converter/GPathResultConverter.java | components/camel-groovy/src/main/java/org/apache/camel/groovy/converter/GPathResultConverter.java | package org.apache.camel.groovy.converter;
import groovy.util.XmlSlurper;
import groovy.util.slurpersupport.GPathResult;
import groovy.xml.StreamingMarkupBuilder;
import org.apache.camel.Converter;
import org.apache.camel.StringSource;
import org.w3c.dom.Node;
import org.xml.sax.SAXException;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import java.io.IOException;
import java.io.StringWriter;
@Converter
public class GPathResultConverter {
@Converter
public static GPathResult fromString(String input) throws ParserConfigurationException, SAXException, IOException {
return new XmlSlurper().parseText(input);
}
@Converter
public static GPathResult fromStringSource(StringSource input) throws IOException, SAXException, ParserConfigurationException {
return fromString(input.getText());
}
@Converter
public static GPathResult fromNode(Node input) throws IOException, SAXException, ParserConfigurationException, TransformerException {
StringWriter writer = new StringWriter();
Transformer t = TransformerFactory.newInstance().newTransformer();
t.transform(new DOMSource(input), new StreamResult(writer));
return fromString(writer.toString());
}
}
| package org.apache.camel.groovy.converter;
import groovy.util.XmlSlurper;
import groovy.util.slurpersupport.GPathResult;
import groovy.xml.StreamingMarkupBuilder;
import org.apache.camel.Converter;
import org.apache.camel.Exchange;
import org.apache.camel.StringSource;
import org.apache.camel.converter.jaxp.XmlConverter;
import org.w3c.dom.Node;
import org.xml.sax.SAXException;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import java.io.IOException;
import java.io.StringWriter;
@Converter
public class GPathResultConverter {
private final XmlConverter xmlConverter = new XmlConverter();
@Converter
public GPathResult fromString(String input) throws ParserConfigurationException, SAXException, IOException {
return new XmlSlurper().parseText(input);
}
@Converter
public GPathResult fromStringSource(StringSource input) throws IOException, SAXException, ParserConfigurationException {
return fromString(input.getText());
}
@Converter
public GPathResult fromNode(Node input, Exchange exchange) throws IOException, SAXException, ParserConfigurationException, TransformerException {
return fromString(xmlConverter.toString(input, exchange));
}
}
| Rewrite converting Node to GPathResult | Rewrite converting Node to GPathResult
| Java | apache-2.0 | ramonmaruko/camel,tlehoux/camel,joakibj/camel,acartapanis/camel,bdecoste/camel,driseley/camel,snurmine/camel,bgaudaen/camel,ekprayas/camel,gyc567/camel,maschmid/camel,bgaudaen/camel,satishgummadelli/camel,koscejev/camel,grgrzybek/camel,kevinearls/camel,curso007/camel,kevinearls/camel,neoramon/camel,bhaveshdt/camel,onders86/camel,NetNow/camel,anton-k11/camel,johnpoth/camel,logzio/camel,isavin/camel,hqstevenson/camel,curso007/camel,ssharma/camel,yury-vashchyla/camel,Fabryprog/camel,allancth/camel,prashant2402/camel,driseley/camel,logzio/camel,gautric/camel,tadayosi/camel,arnaud-deprez/camel,partis/camel,eformat/camel,jpav/camel,dvankleef/camel,nikhilvibhav/camel,MrCoder/camel,jarst/camel,kevinearls/camel,dvankleef/camel,skinzer/camel,stalet/camel,NetNow/camel,dpocock/camel,bdecoste/camel,logzio/camel,jlpedrosa/camel,haku/camel,dpocock/camel,bfitzpat/camel,christophd/camel,JYBESSON/camel,woj-i/camel,adessaigne/camel,yury-vashchyla/camel,jmandawg/camel,driseley/camel,oscerd/camel,lowwool/camel,arnaud-deprez/camel,mike-kukla/camel,veithen/camel,noelo/camel,adessaigne/camel,onders86/camel,manuelh9r/camel,grange74/camel,hqstevenson/camel,JYBESSON/camel,edigrid/camel,lasombra/camel,RohanHart/camel,brreitme/camel,tlehoux/camel,eformat/camel,anoordover/camel,satishgummadelli/camel,jamesnetherton/camel,royopa/camel,lburgazzoli/apache-camel,royopa/camel,jarst/camel,johnpoth/camel,pplatek/camel,nboukhed/camel,coderczp/camel,acartapanis/camel,coderczp/camel,arnaud-deprez/camel,jpav/camel,satishgummadelli/camel,YMartsynkevych/camel,erwelch/camel,lowwool/camel,noelo/camel,dkhanolkar/camel,zregvart/camel,mike-kukla/camel,ge0ffrey/camel,nboukhed/camel,CodeSmell/camel,tlehoux/camel,pmoerenhout/camel,gautric/camel,cunningt/camel,akhettar/camel,mike-kukla/camel,RohanHart/camel,ullgren/camel,erwelch/camel,jpav/camel,lburgazzoli/apache-camel,neoramon/camel,ge0ffrey/camel,pplatek/camel,scranton/camel,grange74/camel,mgyongyosi/camel,mgyongyosi/camel,adessaigne/camel,veithen/camel,Fabryprog/camel,brreitme/camel,lburgazzoli/camel,tlehoux/camel,allancth/camel,nboukhed/camel,tdiesler/camel,logzio/camel,CandleCandle/camel,jollygeorge/camel,trohovsky/camel,dkhanolkar/camel,chirino/camel,tadayosi/camel,nikvaessen/camel,grange74/camel,borcsokj/camel,nboukhed/camel,allancth/camel,coderczp/camel,jmandawg/camel,royopa/camel,hqstevenson/camel,askannon/camel,lasombra/camel,chanakaudaya/camel,joakibj/camel,royopa/camel,ssharma/camel,MohammedHammam/camel,apache/camel,tarilabs/camel,jkorab/camel,chirino/camel,apache/camel,haku/camel,haku/camel,trohovsky/camel,onders86/camel,Thopap/camel,chanakaudaya/camel,NickCis/camel,yuruki/camel,RohanHart/camel,mnki/camel,manuelh9r/camel,jlpedrosa/camel,JYBESSON/camel,MrCoder/camel,oscerd/camel,objectiser/camel,stravag/camel,CandleCandle/camel,snadakuduru/camel,borcsokj/camel,sabre1041/camel,jkorab/camel,erwelch/camel,tadayosi/camel,lburgazzoli/camel,gilfernandes/camel,jollygeorge/camel,jamesnetherton/camel,dmvolod/camel,tdiesler/camel,borcsokj/camel,lburgazzoli/camel,satishgummadelli/camel,onders86/camel,lburgazzoli/apache-camel,yogamaha/camel,pax95/camel,jlpedrosa/camel,stalet/camel,pmoerenhout/camel,pkletsko/camel,snadakuduru/camel,CodeSmell/camel,w4tson/camel,maschmid/camel,yogamaha/camel,onders86/camel,logzio/camel,chirino/camel,objectiser/camel,jollygeorge/camel,oalles/camel,yury-vashchyla/camel,stravag/camel,ge0ffrey/camel,hqstevenson/camel,logzio/camel,RohanHart/camel,FingolfinTEK/camel,mike-kukla/camel,coderczp/camel,CodeSmell/camel,MohammedHammam/camel,partis/camel,edigrid/camel,FingolfinTEK/camel,maschmid/camel,dsimansk/camel,mcollovati/camel,sabre1041/camel,jarst/camel,drsquidop/camel,jameszkw/camel,bgaudaen/camel,mike-kukla/camel,yogamaha/camel,mzapletal/camel,dkhanolkar/camel,mnki/camel,ramonmaruko/camel,davidwilliams1978/camel,atoulme/camel,skinzer/camel,CandleCandle/camel,dkhanolkar/camel,pkletsko/camel,anoordover/camel,rparree/camel,gyc567/camel,josefkarasek/camel,dvankleef/camel,FingolfinTEK/camel,askannon/camel,borcsokj/camel,satishgummadelli/camel,mike-kukla/camel,jonmcewen/camel,mohanaraosv/camel,DariusX/camel,gilfernandes/camel,christophd/camel,scranton/camel,cunningt/camel,oscerd/camel,neoramon/camel,yury-vashchyla/camel,stravag/camel,ullgren/camel,nikvaessen/camel,anton-k11/camel,arnaud-deprez/camel,noelo/camel,lasombra/camel,nikhilvibhav/camel,oalles/camel,woj-i/camel,snadakuduru/camel,pax95/camel,pax95/camel,jlpedrosa/camel,tkopczynski/camel,mzapletal/camel,bfitzpat/camel,lasombra/camel,rparree/camel,punkhorn/camel-upstream,neoramon/camel,anton-k11/camel,iweiss/camel,RohanHart/camel,sebi-hgdata/camel,YMartsynkevych/camel,coderczp/camel,christophd/camel,eformat/camel,dsimansk/camel,snurmine/camel,sabre1041/camel,yuruki/camel,scranton/camel,neoramon/camel,w4tson/camel,josefkarasek/camel,NickCis/camel,woj-i/camel,eformat/camel,MrCoder/camel,ramonmaruko/camel,dsimansk/camel,isururanawaka/camel,yogamaha/camel,bgaudaen/camel,dmvolod/camel,yuruki/camel,mnki/camel,MrCoder/camel,Thopap/camel,gnodet/camel,zregvart/camel,duro1/camel,YoshikiHigo/camel,royopa/camel,allancth/camel,stravag/camel,MrCoder/camel,oalles/camel,christophd/camel,tarilabs/camel,johnpoth/camel,curso007/camel,qst-jdc-labs/camel,nikhilvibhav/camel,pax95/camel,nikvaessen/camel,bdecoste/camel,dvankleef/camel,drsquidop/camel,cunningt/camel,bdecoste/camel,askannon/camel,ssharma/camel,haku/camel,adessaigne/camel,YMartsynkevych/camel,YoshikiHigo/camel,jollygeorge/camel,acartapanis/camel,koscejev/camel,jollygeorge/camel,prashant2402/camel,prashant2402/camel,w4tson/camel,anoordover/camel,grgrzybek/camel,edigrid/camel,chanakaudaya/camel,lburgazzoli/camel,mohanaraosv/camel,pmoerenhout/camel,pkletsko/camel,josefkarasek/camel,ge0ffrey/camel,josefkarasek/camel,jarst/camel,koscejev/camel,scranton/camel,gilfernandes/camel,alvinkwekel/camel,anton-k11/camel,ge0ffrey/camel,lowwool/camel,edigrid/camel,mohanaraosv/camel,yuruki/camel,veithen/camel,oscerd/camel,salikjan/camel,qst-jdc-labs/camel,sverkera/camel,edigrid/camel,Thopap/camel,Thopap/camel,NetNow/camel,tlehoux/camel,YoshikiHigo/camel,rparree/camel,gyc567/camel,noelo/camel,grgrzybek/camel,chirino/camel,gautric/camel,cunningt/camel,drsquidop/camel,nicolaferraro/camel,brreitme/camel,maschmid/camel,atoulme/camel,sebi-hgdata/camel,mohanaraosv/camel,mgyongyosi/camel,tkopczynski/camel,atoulme/camel,mzapletal/camel,veithen/camel,snurmine/camel,rmarting/camel,stalet/camel,gautric/camel,anoordover/camel,NickCis/camel,joakibj/camel,sirlatrom/camel,joakibj/camel,askannon/camel,cunningt/camel,zregvart/camel,josefkarasek/camel,maschmid/camel,dmvolod/camel,jpav/camel,gnodet/camel,YoshikiHigo/camel,ekprayas/camel,pkletsko/camel,nboukhed/camel,salikjan/camel,nikvaessen/camel,rmarting/camel,trohovsky/camel,satishgummadelli/camel,snurmine/camel,allancth/camel,dvankleef/camel,w4tson/camel,tdiesler/camel,nikhilvibhav/camel,jamesnetherton/camel,yury-vashchyla/camel,akhettar/camel,manuelh9r/camel,JYBESSON/camel,NetNow/camel,joakibj/camel,punkhorn/camel-upstream,anton-k11/camel,anton-k11/camel,jkorab/camel,gautric/camel,snadakuduru/camel,cunningt/camel,davidwilliams1978/camel,grgrzybek/camel,yuruki/camel,rparree/camel,tkopczynski/camel,lburgazzoli/camel,tadayosi/camel,christophd/camel,chanakaudaya/camel,curso007/camel,nicolaferraro/camel,bhaveshdt/camel,eformat/camel,sverkera/camel,zregvart/camel,sabre1041/camel,prashant2402/camel,bdecoste/camel,jlpedrosa/camel,isururanawaka/camel,woj-i/camel,hqstevenson/camel,bhaveshdt/camel,jameszkw/camel,gilfernandes/camel,punkhorn/camel-upstream,jamesnetherton/camel,NetNow/camel,dpocock/camel,josefkarasek/camel,skinzer/camel,yogamaha/camel,trohovsky/camel,apache/camel,jonmcewen/camel,stalet/camel,MohammedHammam/camel,pkletsko/camel,objectiser/camel,isururanawaka/camel,trohovsky/camel,jmandawg/camel,manuelh9r/camel,dvankleef/camel,iweiss/camel,sirlatrom/camel,edigrid/camel,skinzer/camel,drsquidop/camel,eformat/camel,YMartsynkevych/camel,tkopczynski/camel,ekprayas/camel,FingolfinTEK/camel,chanakaudaya/camel,mcollovati/camel,pmoerenhout/camel,CandleCandle/camel,DariusX/camel,ullgren/camel,Fabryprog/camel,RohanHart/camel,gnodet/camel,acartapanis/camel,sebi-hgdata/camel,alvinkwekel/camel,tarilabs/camel,sverkera/camel,manuelh9r/camel,sebi-hgdata/camel,rmarting/camel,ssharma/camel,dpocock/camel,punkhorn/camel-upstream,jmandawg/camel,gilfernandes/camel,grange74/camel,driseley/camel,MohammedHammam/camel,rparree/camel,mnki/camel,jarst/camel,JYBESSON/camel,iweiss/camel,sebi-hgdata/camel,woj-i/camel,dmvolod/camel,YoshikiHigo/camel,apache/camel,partis/camel,sirlatrom/camel,ssharma/camel,sirlatrom/camel,iweiss/camel,pplatek/camel,isururanawaka/camel,manuelh9r/camel,jameszkw/camel,NetNow/camel,davidkarlsen/camel,gyc567/camel,sverkera/camel,bfitzpat/camel,w4tson/camel,jameszkw/camel,bdecoste/camel,mgyongyosi/camel,grange74/camel,FingolfinTEK/camel,veithen/camel,christophd/camel,jmandawg/camel,maschmid/camel,drsquidop/camel,objectiser/camel,prashant2402/camel,arnaud-deprez/camel,iweiss/camel,sebi-hgdata/camel,mgyongyosi/camel,woj-i/camel,davidwilliams1978/camel,lowwool/camel,isavin/camel,stravag/camel,alvinkwekel/camel,duro1/camel,MohammedHammam/camel,gnodet/camel,brreitme/camel,gyc567/camel,dpocock/camel,bgaudaen/camel,lasombra/camel,sabre1041/camel,arnaud-deprez/camel,sverkera/camel,isavin/camel,tdiesler/camel,scranton/camel,tarilabs/camel,bfitzpat/camel,ramonmaruko/camel,alvinkwekel/camel,tdiesler/camel,jkorab/camel,pmoerenhout/camel,ekprayas/camel,qst-jdc-labs/camel,adessaigne/camel,duro1/camel,qst-jdc-labs/camel,YMartsynkevych/camel,tadayosi/camel,curso007/camel,jonmcewen/camel,yury-vashchyla/camel,oalles/camel,johnpoth/camel,jonmcewen/camel,JYBESSON/camel,akhettar/camel,qst-jdc-labs/camel,tarilabs/camel,driseley/camel,isavin/camel,pplatek/camel,anoordover/camel,NickCis/camel,skinzer/camel,haku/camel,johnpoth/camel,davidwilliams1978/camel,grgrzybek/camel,isururanawaka/camel,partis/camel,drsquidop/camel,kevinearls/camel,bhaveshdt/camel,brreitme/camel,rmarting/camel,royopa/camel,adessaigne/camel,grgrzybek/camel,hqstevenson/camel,nicolaferraro/camel,anoordover/camel,pax95/camel,akhettar/camel,atoulme/camel,curso007/camel,kevinearls/camel,ssharma/camel,YMartsynkevych/camel,rmarting/camel,yogamaha/camel,mnki/camel,johnpoth/camel,YoshikiHigo/camel,duro1/camel,logzio/camel,dpocock/camel,jarst/camel,jameszkw/camel,tkopczynski/camel,lburgazzoli/apache-camel,chanakaudaya/camel,lburgazzoli/camel,mgyongyosi/camel,nikvaessen/camel,mohanaraosv/camel,erwelch/camel,tlehoux/camel,dsimansk/camel,bgaudaen/camel,lburgazzoli/apache-camel,noelo/camel,pplatek/camel,CandleCandle/camel,chirino/camel,lburgazzoli/apache-camel,jkorab/camel,MohammedHammam/camel,isururanawaka/camel,grange74/camel,acartapanis/camel,isavin/camel,jollygeorge/camel,jonmcewen/camel,dkhanolkar/camel,borcsokj/camel,pkletsko/camel,davidwilliams1978/camel,qst-jdc-labs/camel,oalles/camel,driseley/camel,mcollovati/camel,jonmcewen/camel,ullgren/camel,snadakuduru/camel,stravag/camel,mohanaraosv/camel,bfitzpat/camel,koscejev/camel,pplatek/camel,atoulme/camel,ekprayas/camel,nicolaferraro/camel,prashant2402/camel,NickCis/camel,gnodet/camel,koscejev/camel,onders86/camel,snurmine/camel,koscejev/camel,iweiss/camel,dsimansk/camel,davidkarlsen/camel,jamesnetherton/camel,jamesnetherton/camel,bfitzpat/camel,jmandawg/camel,neoramon/camel,rparree/camel,tarilabs/camel,apache/camel,lasombra/camel,lowwool/camel,jkorab/camel,sverkera/camel,isavin/camel,haku/camel,lowwool/camel,DariusX/camel,Fabryprog/camel,mnki/camel,chirino/camel,trohovsky/camel,jlpedrosa/camel,mzapletal/camel,noelo/camel,duro1/camel,tdiesler/camel,joakibj/camel,pmoerenhout/camel,DariusX/camel,davidwilliams1978/camel,tadayosi/camel,erwelch/camel,davidkarlsen/camel,jpav/camel,veithen/camel,ramonmaruko/camel,snurmine/camel,ramonmaruko/camel,scranton/camel,CodeSmell/camel,dmvolod/camel,sirlatrom/camel,FingolfinTEK/camel,atoulme/camel,gilfernandes/camel,gyc567/camel,ge0ffrey/camel,acartapanis/camel,nikvaessen/camel,askannon/camel,rmarting/camel,mzapletal/camel,dsimansk/camel,stalet/camel,Thopap/camel,nboukhed/camel,bhaveshdt/camel,gautric/camel,snadakuduru/camel,mzapletal/camel,oscerd/camel,skinzer/camel,duro1/camel,yuruki/camel,w4tson/camel,akhettar/camel,oalles/camel,akhettar/camel,stalet/camel,NickCis/camel,CandleCandle/camel,sirlatrom/camel,brreitme/camel,MrCoder/camel,davidkarlsen/camel,bhaveshdt/camel,jameszkw/camel,allancth/camel,apache/camel,pax95/camel,dkhanolkar/camel,oscerd/camel,jpav/camel,Thopap/camel,sabre1041/camel,partis/camel,coderczp/camel,partis/camel,kevinearls/camel,askannon/camel,mcollovati/camel,pplatek/camel,erwelch/camel,borcsokj/camel,tkopczynski/camel,dmvolod/camel,ekprayas/camel | java | ## Code Before:
package org.apache.camel.groovy.converter;
import groovy.util.XmlSlurper;
import groovy.util.slurpersupport.GPathResult;
import groovy.xml.StreamingMarkupBuilder;
import org.apache.camel.Converter;
import org.apache.camel.StringSource;
import org.w3c.dom.Node;
import org.xml.sax.SAXException;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import java.io.IOException;
import java.io.StringWriter;
@Converter
public class GPathResultConverter {
@Converter
public static GPathResult fromString(String input) throws ParserConfigurationException, SAXException, IOException {
return new XmlSlurper().parseText(input);
}
@Converter
public static GPathResult fromStringSource(StringSource input) throws IOException, SAXException, ParserConfigurationException {
return fromString(input.getText());
}
@Converter
public static GPathResult fromNode(Node input) throws IOException, SAXException, ParserConfigurationException, TransformerException {
StringWriter writer = new StringWriter();
Transformer t = TransformerFactory.newInstance().newTransformer();
t.transform(new DOMSource(input), new StreamResult(writer));
return fromString(writer.toString());
}
}
## Instruction:
Rewrite converting Node to GPathResult
## Code After:
package org.apache.camel.groovy.converter;
import groovy.util.XmlSlurper;
import groovy.util.slurpersupport.GPathResult;
import groovy.xml.StreamingMarkupBuilder;
import org.apache.camel.Converter;
import org.apache.camel.Exchange;
import org.apache.camel.StringSource;
import org.apache.camel.converter.jaxp.XmlConverter;
import org.w3c.dom.Node;
import org.xml.sax.SAXException;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import java.io.IOException;
import java.io.StringWriter;
@Converter
public class GPathResultConverter {
private final XmlConverter xmlConverter = new XmlConverter();
@Converter
public GPathResult fromString(String input) throws ParserConfigurationException, SAXException, IOException {
return new XmlSlurper().parseText(input);
}
@Converter
public GPathResult fromStringSource(StringSource input) throws IOException, SAXException, ParserConfigurationException {
return fromString(input.getText());
}
@Converter
public GPathResult fromNode(Node input, Exchange exchange) throws IOException, SAXException, ParserConfigurationException, TransformerException {
return fromString(xmlConverter.toString(input, exchange));
}
}
| package org.apache.camel.groovy.converter;
import groovy.util.XmlSlurper;
import groovy.util.slurpersupport.GPathResult;
import groovy.xml.StreamingMarkupBuilder;
import org.apache.camel.Converter;
+ import org.apache.camel.Exchange;
import org.apache.camel.StringSource;
+ import org.apache.camel.converter.jaxp.XmlConverter;
import org.w3c.dom.Node;
import org.xml.sax.SAXException;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import java.io.IOException;
import java.io.StringWriter;
@Converter
public class GPathResultConverter {
+ private final XmlConverter xmlConverter = new XmlConverter();
+
@Converter
- public static GPathResult fromString(String input) throws ParserConfigurationException, SAXException, IOException {
? -------
+ public GPathResult fromString(String input) throws ParserConfigurationException, SAXException, IOException {
return new XmlSlurper().parseText(input);
}
@Converter
- public static GPathResult fromStringSource(StringSource input) throws IOException, SAXException, ParserConfigurationException {
? -------
+ public GPathResult fromStringSource(StringSource input) throws IOException, SAXException, ParserConfigurationException {
return fromString(input.getText());
}
@Converter
- public static GPathResult fromNode(Node input) throws IOException, SAXException, ParserConfigurationException, TransformerException {
? -------
+ public GPathResult fromNode(Node input, Exchange exchange) throws IOException, SAXException, ParserConfigurationException, TransformerException {
? +++++++++++++++++++
- StringWriter writer = new StringWriter();
- Transformer t = TransformerFactory.newInstance().newTransformer();
- t.transform(new DOMSource(input), new StreamResult(writer));
- return fromString(writer.toString());
? ^ -
+ return fromString(xmlConverter.toString(input, exchange));
? ^^^^^^^^ +++++++++++++++
}
} | 15 | 0.365854 | 8 | 7 |
8bb4fd8736c1a186bc0b29f9399b9b128daa5582 | server/src/main/resources/killbill-server.properties | server/src/main/resources/killbill-server.properties | com.ning.jetty.jdbi.url=jdbc:mysql://127.0.0.1:3306/killbill
com.ning.jetty.jdbi.user=root
com.ning.jetty.jdbi.password=root
killbill.catalog.uri=file:src/main/resources/catalog-demo.xml
killbill.entitlement.dao.claim.time=60000
killbill.entitlement.dao.ready.max=1
killbill.entitlement.engine.notifications.sleep=500
user.timezone=UTC
| com.ning.jetty.jdbi.url=jdbc:mysql://127.0.0.1:3306/killbill
com.ning.jetty.jdbi.user=root
com.ning.jetty.jdbi.password=root
killbill.catalog.uri=file:src/main/resources/catalog-demo.xml
killbill.entitlement.dao.claim.time=60000
killbill.entitlement.dao.ready.max=1
killbill.entitlement.engine.notifications.sleep=500
user.timezone=UTC
ANTLR_USE_DIRECT_CLASS_LOADING=true
| Add system property to make sure bundles using ANTLR start correctly | Add system property to make sure bundles using ANTLR start correctly
| INI | apache-2.0 | joansmith/killbill,andrenpaes/killbill,chengjunjian/killbill,gsanblas/Prueba,killbill/killbill,joansmith/killbill,sbrossie/killbill,maguero/killbill,Massiv-IO/killbill,dut3062796s/killbill,andrenpaes/killbill,Massiv-IO/killbill,dconcha/killbill,dconcha/killbill,marksimu/killbill,chengjunjian/killbill,maguero/killbill,dut3062796s/killbill,marksimu/killbill,aeq/killbill,kares/killbill,aglne/killbill,marksimu/killbill,gongpu/killbill,killbill/killbill,gsanblas/Prueba,sbrossie/killbill,24671335/killbill,andrenpaes/killbill,killbill/killbill,24671335/killbill,liqianggao/killbill,andrenpaes/killbill,marksimu/killbill,aeq/killbill,Massiv-IO/killbill,gsanblas/Prueba,dut3062796s/killbill,liqianggao/killbill,aglne/killbill,chengjunjian/killbill,kares/killbill,gongpu/killbill,joansmith/killbill,gsanblas/Prueba,sbrossie/killbill,kares/killbill,liqianggao/killbill,dconcha/killbill,24671335/killbill,aeq/killbill,sbrossie/killbill,gongpu/killbill,aglne/killbill,chengjunjian/killbill,maguero/killbill,maguero/killbill,dut3062796s/killbill,joansmith/killbill,maguero/killbill,chengjunjian/killbill,dut3062796s/killbill,gongpu/killbill,killbill/killbill,kares/killbill,24671335/killbill,aglne/killbill,dconcha/killbill,liqianggao/killbill,aeq/killbill,marksimu/killbill,aglne/killbill,Massiv-IO/killbill,andrenpaes/killbill,killbill/killbill,gongpu/killbill,liqianggao/killbill,dconcha/killbill,aeq/killbill,joansmith/killbill,24671335/killbill,sbrossie/killbill,Massiv-IO/killbill | ini | ## Code Before:
com.ning.jetty.jdbi.url=jdbc:mysql://127.0.0.1:3306/killbill
com.ning.jetty.jdbi.user=root
com.ning.jetty.jdbi.password=root
killbill.catalog.uri=file:src/main/resources/catalog-demo.xml
killbill.entitlement.dao.claim.time=60000
killbill.entitlement.dao.ready.max=1
killbill.entitlement.engine.notifications.sleep=500
user.timezone=UTC
## Instruction:
Add system property to make sure bundles using ANTLR start correctly
## Code After:
com.ning.jetty.jdbi.url=jdbc:mysql://127.0.0.1:3306/killbill
com.ning.jetty.jdbi.user=root
com.ning.jetty.jdbi.password=root
killbill.catalog.uri=file:src/main/resources/catalog-demo.xml
killbill.entitlement.dao.claim.time=60000
killbill.entitlement.dao.ready.max=1
killbill.entitlement.engine.notifications.sleep=500
user.timezone=UTC
ANTLR_USE_DIRECT_CLASS_LOADING=true
| com.ning.jetty.jdbi.url=jdbc:mysql://127.0.0.1:3306/killbill
com.ning.jetty.jdbi.user=root
com.ning.jetty.jdbi.password=root
killbill.catalog.uri=file:src/main/resources/catalog-demo.xml
killbill.entitlement.dao.claim.time=60000
killbill.entitlement.dao.ready.max=1
killbill.entitlement.engine.notifications.sleep=500
user.timezone=UTC
+ ANTLR_USE_DIRECT_CLASS_LOADING=true | 1 | 0.090909 | 1 | 0 |
cff1932d4026ec3c166051b94cf7e3e8ade5d5bc | ci/script.sh | ci/script.sh | set -ex
if [ "$RUSTFMT" = "yes" ]; then
cargo fmt --all -- --check
elif [ "$CLIPPY" = "yes" ]; then
cargo clippy --all -- -D warnings
else
cargo test
fi | set -ex
export CARGO_INCREMENTAL=0
if [ "$RUSTFMT" = "yes" ]; then
cargo fmt --all -- --check
elif [ "$CLIPPY" = "yes" ]; then
cargo clippy --all -- -D warnings
else
cargo test
fi | Disable incremental compilation in CI. | Disable incremental compilation in CI.
| Shell | apache-2.0 | bheisler/TinyTemplate | shell | ## Code Before:
set -ex
if [ "$RUSTFMT" = "yes" ]; then
cargo fmt --all -- --check
elif [ "$CLIPPY" = "yes" ]; then
cargo clippy --all -- -D warnings
else
cargo test
fi
## Instruction:
Disable incremental compilation in CI.
## Code After:
set -ex
export CARGO_INCREMENTAL=0
if [ "$RUSTFMT" = "yes" ]; then
cargo fmt --all -- --check
elif [ "$CLIPPY" = "yes" ]; then
cargo clippy --all -- -D warnings
else
cargo test
fi | set -ex
+
+ export CARGO_INCREMENTAL=0
if [ "$RUSTFMT" = "yes" ]; then
cargo fmt --all -- --check
elif [ "$CLIPPY" = "yes" ]; then
cargo clippy --all -- -D warnings
else
cargo test
fi | 2 | 0.222222 | 2 | 0 |
2c07a1c00d510580c9da5c0f03c66411dc777c5b | package.json | package.json | {
"name": "js-tokens",
"version": "0.2.0",
"author": "Simon Lydell",
"license": "MIT",
"description": "A regex that tokenizes JavaScript.",
"main": "index.js",
"keywords": [
"JavaScript",
"js",
"token",
"tokenize",
"regex"
],
"repository": "lydell/js-tokens",
"scripts": {
"test": "mocha",
"build": "node generate-index.js"
},
"devDependencies": {
"mocha": "^1.17.1",
"coffee-script": "~1.7.1"
}
}
| {
"name": "js-tokens",
"version": "0.2.0",
"author": "Simon Lydell",
"license": "MIT",
"description": "A regex that tokenizes JavaScript.",
"main": "index.js",
"keywords": [
"JavaScript",
"js",
"token",
"tokenize",
"regex"
],
"repository": "lydell/js-tokens",
"scripts": {
"test": "mocha",
"build": "node generate-index.js",
"dev": "npm run build && npm test"
},
"devDependencies": {
"mocha": "^1.17.1",
"coffee-script": "~1.7.1"
}
}
| Add `npm run dev` shortcut | Add `npm run dev` shortcut
| JSON | mit | lydell/js-tokens,lydell/js-tokens | json | ## Code Before:
{
"name": "js-tokens",
"version": "0.2.0",
"author": "Simon Lydell",
"license": "MIT",
"description": "A regex that tokenizes JavaScript.",
"main": "index.js",
"keywords": [
"JavaScript",
"js",
"token",
"tokenize",
"regex"
],
"repository": "lydell/js-tokens",
"scripts": {
"test": "mocha",
"build": "node generate-index.js"
},
"devDependencies": {
"mocha": "^1.17.1",
"coffee-script": "~1.7.1"
}
}
## Instruction:
Add `npm run dev` shortcut
## Code After:
{
"name": "js-tokens",
"version": "0.2.0",
"author": "Simon Lydell",
"license": "MIT",
"description": "A regex that tokenizes JavaScript.",
"main": "index.js",
"keywords": [
"JavaScript",
"js",
"token",
"tokenize",
"regex"
],
"repository": "lydell/js-tokens",
"scripts": {
"test": "mocha",
"build": "node generate-index.js",
"dev": "npm run build && npm test"
},
"devDependencies": {
"mocha": "^1.17.1",
"coffee-script": "~1.7.1"
}
}
| {
"name": "js-tokens",
"version": "0.2.0",
"author": "Simon Lydell",
"license": "MIT",
"description": "A regex that tokenizes JavaScript.",
"main": "index.js",
"keywords": [
"JavaScript",
"js",
"token",
"tokenize",
"regex"
],
"repository": "lydell/js-tokens",
"scripts": {
"test": "mocha",
- "build": "node generate-index.js"
+ "build": "node generate-index.js",
? +
+ "dev": "npm run build && npm test"
},
"devDependencies": {
"mocha": "^1.17.1",
"coffee-script": "~1.7.1"
}
} | 3 | 0.125 | 2 | 1 |
41a8dcb2bfab1954bb9719f4900fe515c12fffcf | LazyTransitions/UIScrollViewExtensions.swift | LazyTransitions/UIScrollViewExtensions.swift | //
// UIScrollViewExtensions.swift
// LazyTransitions
//
// Created by Serghei Catraniuc on 11/25/16.
// Copyright © 2016 BeardWare. All rights reserved.
//
import Foundation
extension UIScrollView: Scrollable {
public var isAtTop: Bool {
return (contentOffset.y + contentInset.top) == 0
}
public var isAtBottom: Bool {
let scrollOffset = Int(contentOffset.y)
let height = Int(frame.height)
let contentHeight = Int(contentSize.height)
return scrollOffset + height >= contentHeight
}
public var isSomewhereInVerticalMiddle: Bool {
return !isAtTop && !isAtBottom
}
public var isAtLeftEdge: Bool {
return (contentOffset.x + contentInset.left) == 0
}
public var isAtRightEdge: Bool {
let scrollOffset = Int(contentOffset.x)
let width = Int(frame.width)
let contentWidth = Int(contentSize.width)
return scrollOffset + width >= contentWidth
}
public var isSomewhereInHorizontalMiddle: Bool {
return !isAtLeftEdge && !isAtRightEdge
}
}
| //
// UIScrollViewExtensions.swift
// LazyTransitions
//
// Created by Serghei Catraniuc on 11/25/16.
// Copyright © 2016 BeardWare. All rights reserved.
//
import Foundation
extension UIScrollView: Scrollable {
public var isAtTop: Bool {
return (contentOffset.y + topInset) == 0
}
public var isAtBottom: Bool {
let scrollOffset = Int(contentOffset.y)
let height = Int(frame.height)
let contentHeight = Int(contentSize.height)
return scrollOffset + height >= contentHeight
}
public var isSomewhereInVerticalMiddle: Bool {
return !isAtTop && !isAtBottom
}
public var isAtLeftEdge: Bool {
return (contentOffset.x + leftInset) == 0
}
public var isAtRightEdge: Bool {
let scrollOffset = Int(contentOffset.x)
let width = Int(frame.width)
let contentWidth = Int(contentSize.width)
return scrollOffset + width >= contentWidth
}
public var isSomewhereInHorizontalMiddle: Bool {
return !isAtLeftEdge && !isAtRightEdge
}
fileprivate var topInset: CGFloat {
if #available(iOS 11, *) {
return adjustedContentInset.top
} else {
return contentInset.top
}
}
fileprivate var bottomInset: CGFloat {
if #available(iOS 11, *) {
return adjustedContentInset.bottom
} else {
return contentInset.bottom
}
}
fileprivate var leftInset: CGFloat {
if #available(iOS 11, *) {
return adjustedContentInset.left
} else {
return contentInset.left
}
}
fileprivate var rightInset: CGFloat {
if #available(iOS 11, *) {
return adjustedContentInset.right
} else {
return contentInset.right
}
}
}
| Fix interactive transition not working on iOS 11 with scroll views that have content inset | Fix interactive transition not working on iOS 11 with scroll views that have content inset
| Swift | bsd-2-clause | serp1412/LazyTransitions,serp1412/LazyTransitions | swift | ## Code Before:
//
// UIScrollViewExtensions.swift
// LazyTransitions
//
// Created by Serghei Catraniuc on 11/25/16.
// Copyright © 2016 BeardWare. All rights reserved.
//
import Foundation
extension UIScrollView: Scrollable {
public var isAtTop: Bool {
return (contentOffset.y + contentInset.top) == 0
}
public var isAtBottom: Bool {
let scrollOffset = Int(contentOffset.y)
let height = Int(frame.height)
let contentHeight = Int(contentSize.height)
return scrollOffset + height >= contentHeight
}
public var isSomewhereInVerticalMiddle: Bool {
return !isAtTop && !isAtBottom
}
public var isAtLeftEdge: Bool {
return (contentOffset.x + contentInset.left) == 0
}
public var isAtRightEdge: Bool {
let scrollOffset = Int(contentOffset.x)
let width = Int(frame.width)
let contentWidth = Int(contentSize.width)
return scrollOffset + width >= contentWidth
}
public var isSomewhereInHorizontalMiddle: Bool {
return !isAtLeftEdge && !isAtRightEdge
}
}
## Instruction:
Fix interactive transition not working on iOS 11 with scroll views that have content inset
## Code After:
//
// UIScrollViewExtensions.swift
// LazyTransitions
//
// Created by Serghei Catraniuc on 11/25/16.
// Copyright © 2016 BeardWare. All rights reserved.
//
import Foundation
extension UIScrollView: Scrollable {
public var isAtTop: Bool {
return (contentOffset.y + topInset) == 0
}
public var isAtBottom: Bool {
let scrollOffset = Int(contentOffset.y)
let height = Int(frame.height)
let contentHeight = Int(contentSize.height)
return scrollOffset + height >= contentHeight
}
public var isSomewhereInVerticalMiddle: Bool {
return !isAtTop && !isAtBottom
}
public var isAtLeftEdge: Bool {
return (contentOffset.x + leftInset) == 0
}
public var isAtRightEdge: Bool {
let scrollOffset = Int(contentOffset.x)
let width = Int(frame.width)
let contentWidth = Int(contentSize.width)
return scrollOffset + width >= contentWidth
}
public var isSomewhereInHorizontalMiddle: Bool {
return !isAtLeftEdge && !isAtRightEdge
}
fileprivate var topInset: CGFloat {
if #available(iOS 11, *) {
return adjustedContentInset.top
} else {
return contentInset.top
}
}
fileprivate var bottomInset: CGFloat {
if #available(iOS 11, *) {
return adjustedContentInset.bottom
} else {
return contentInset.bottom
}
}
fileprivate var leftInset: CGFloat {
if #available(iOS 11, *) {
return adjustedContentInset.left
} else {
return contentInset.left
}
}
fileprivate var rightInset: CGFloat {
if #available(iOS 11, *) {
return adjustedContentInset.right
} else {
return contentInset.right
}
}
}
| //
// UIScrollViewExtensions.swift
// LazyTransitions
//
// Created by Serghei Catraniuc on 11/25/16.
// Copyright © 2016 BeardWare. All rights reserved.
//
import Foundation
extension UIScrollView: Scrollable {
public var isAtTop: Bool {
- return (contentOffset.y + contentInset.top) == 0
? ^ ^^^^^ ----
+ return (contentOffset.y + topInset) == 0
? ^ ^
}
public var isAtBottom: Bool {
let scrollOffset = Int(contentOffset.y)
let height = Int(frame.height)
let contentHeight = Int(contentSize.height)
return scrollOffset + height >= contentHeight
}
public var isSomewhereInVerticalMiddle: Bool {
return !isAtTop && !isAtBottom
}
public var isAtLeftEdge: Bool {
- return (contentOffset.x + contentInset.left) == 0
? ^^^^ ^ -----
+ return (contentOffset.x + leftInset) == 0
? ^ ^
}
public var isAtRightEdge: Bool {
let scrollOffset = Int(contentOffset.x)
let width = Int(frame.width)
let contentWidth = Int(contentSize.width)
return scrollOffset + width >= contentWidth
}
public var isSomewhereInHorizontalMiddle: Bool {
return !isAtLeftEdge && !isAtRightEdge
}
+
+ fileprivate var topInset: CGFloat {
+ if #available(iOS 11, *) {
+ return adjustedContentInset.top
+ } else {
+ return contentInset.top
+ }
+ }
+
+ fileprivate var bottomInset: CGFloat {
+ if #available(iOS 11, *) {
+ return adjustedContentInset.bottom
+ } else {
+ return contentInset.bottom
+ }
+ }
+
+ fileprivate var leftInset: CGFloat {
+ if #available(iOS 11, *) {
+ return adjustedContentInset.left
+ } else {
+ return contentInset.left
+ }
+ }
+
+ fileprivate var rightInset: CGFloat {
+ if #available(iOS 11, *) {
+ return adjustedContentInset.right
+ } else {
+ return contentInset.right
+ }
+ }
} | 36 | 0.837209 | 34 | 2 |
4bd73b9c8c672816c9ea31eb2d4329b0cca34c22 | src/edu/usc/glidein/util/Base64.java | src/edu/usc/glidein/util/Base64.java | package edu.usc.glidein.util;
import java.io.IOException;
import sun.misc.BASE64Encoder;
import sun.misc.BASE64Decoder;
/**
* Convert to/from Base64-encoded data
*
* @author Gideon Juve <juve@usc.edu>
*/
public class Base64
{
/**
* Base64-encode a string
* @param string The string to encode
* @return The base64 encoding of the string
*/
public static String toBase64(String string)
{
if(string==null) return null;
byte[] buff = string.getBytes();
return new BASE64Encoder().encode(buff);
}
/**
* Decode a base64-encoded string
* @param base64 Base64-encoded string
* @return The decoded string
*/
public static String fromBase64(String base64)
{
if(base64==null) return null;
try {
byte[] output = new BASE64Decoder().decodeBuffer(base64);
return new String(output);
}
catch(IOException ioe) {
return null; /* I don't think this will actually happen */
}
}
public static void main(String[] args)
{
System.out.println(new String(Base64.toBase64("Hello, World!")));
System.out.println(Base64.fromBase64("SGVsbG8sIFdvcmxkIQ=="));
}
}
| package edu.usc.glidein.util;
import java.io.IOException;
import sun.misc.BASE64Encoder;
import sun.misc.BASE64Decoder;
/**
* Convert to/from Base64-encoded data
*
* @author Gideon Juve <juve@usc.edu>
*/
public class Base64
{
/**
* Base64-encode a string
* @param string The string to encode
* @return The base64 encoding of the string
*/
public static byte[] toBase64(String string)
{
if(string==null) return null;
byte[] buff = string.getBytes();
String s = new BASE64Encoder().encode(buff);
return s.getBytes();
}
/**
* Decode a base64-encoded string
* @param base64 Base64-encoded binary
* @return The decoded string
*/
public static String fromBase64(byte[] base64)
{
if(base64==null) return null;
try {
String s = new String(base64);
byte[] output = new BASE64Decoder().decodeBuffer(s);
return new String(output);
}
catch(IOException ioe) {
return null; /* I don't think this will actually happen */
}
}
}
| Use bytes for base-64 encoded data instead of strings | Use bytes for base-64 encoded data instead of strings
git-svn-id: bdb5f82b9b83a1400e05d69d262344b821646179@1345 e217846f-e12e-0410-a4e5-89ccaea66ff7
| Java | apache-2.0 | juve/corral,juve/corral,juve/corral | java | ## Code Before:
package edu.usc.glidein.util;
import java.io.IOException;
import sun.misc.BASE64Encoder;
import sun.misc.BASE64Decoder;
/**
* Convert to/from Base64-encoded data
*
* @author Gideon Juve <juve@usc.edu>
*/
public class Base64
{
/**
* Base64-encode a string
* @param string The string to encode
* @return The base64 encoding of the string
*/
public static String toBase64(String string)
{
if(string==null) return null;
byte[] buff = string.getBytes();
return new BASE64Encoder().encode(buff);
}
/**
* Decode a base64-encoded string
* @param base64 Base64-encoded string
* @return The decoded string
*/
public static String fromBase64(String base64)
{
if(base64==null) return null;
try {
byte[] output = new BASE64Decoder().decodeBuffer(base64);
return new String(output);
}
catch(IOException ioe) {
return null; /* I don't think this will actually happen */
}
}
public static void main(String[] args)
{
System.out.println(new String(Base64.toBase64("Hello, World!")));
System.out.println(Base64.fromBase64("SGVsbG8sIFdvcmxkIQ=="));
}
}
## Instruction:
Use bytes for base-64 encoded data instead of strings
git-svn-id: bdb5f82b9b83a1400e05d69d262344b821646179@1345 e217846f-e12e-0410-a4e5-89ccaea66ff7
## Code After:
package edu.usc.glidein.util;
import java.io.IOException;
import sun.misc.BASE64Encoder;
import sun.misc.BASE64Decoder;
/**
* Convert to/from Base64-encoded data
*
* @author Gideon Juve <juve@usc.edu>
*/
public class Base64
{
/**
* Base64-encode a string
* @param string The string to encode
* @return The base64 encoding of the string
*/
public static byte[] toBase64(String string)
{
if(string==null) return null;
byte[] buff = string.getBytes();
String s = new BASE64Encoder().encode(buff);
return s.getBytes();
}
/**
* Decode a base64-encoded string
* @param base64 Base64-encoded binary
* @return The decoded string
*/
public static String fromBase64(byte[] base64)
{
if(base64==null) return null;
try {
String s = new String(base64);
byte[] output = new BASE64Decoder().decodeBuffer(s);
return new String(output);
}
catch(IOException ioe) {
return null; /* I don't think this will actually happen */
}
}
}
| package edu.usc.glidein.util;
import java.io.IOException;
import sun.misc.BASE64Encoder;
import sun.misc.BASE64Decoder;
/**
* Convert to/from Base64-encoded data
*
* @author Gideon Juve <juve@usc.edu>
*/
public class Base64
{
/**
* Base64-encode a string
* @param string The string to encode
* @return The base64 encoding of the string
*/
- public static String toBase64(String string)
? ^ ^^^^
+ public static byte[] toBase64(String string)
? ^^ ^^^
{
if(string==null) return null;
byte[] buff = string.getBytes();
- return new BASE64Encoder().encode(buff);
? ^^^^
+ String s = new BASE64Encoder().encode(buff);
? ++ ^ +++++
+ return s.getBytes();
}
/**
* Decode a base64-encoded string
- * @param base64 Base64-encoded string
? ^^^ ^
+ * @param base64 Base64-encoded binary
? ^ ^^^
* @return The decoded string
*/
- public static String fromBase64(String base64)
? ^ ^^^^
+ public static String fromBase64(byte[] base64)
? ^^ ^^^
{
if(base64==null) return null;
try {
+ String s = new String(base64);
- byte[] output = new BASE64Decoder().decodeBuffer(base64);
? -- ---
+ byte[] output = new BASE64Decoder().decodeBuffer(s);
return new String(output);
}
catch(IOException ioe) {
return null; /* I don't think this will actually happen */
}
}
-
- public static void main(String[] args)
- {
- System.out.println(new String(Base64.toBase64("Hello, World!")));
- System.out.println(Base64.fromBase64("SGVsbG8sIFdvcmxkIQ=="));
- }
} | 18 | 0.352941 | 7 | 11 |
a75b62849d3b7df618cb552bc38e575ee85cad86 | requirements.txt | requirements.txt | appdirs==1.4.3
bcrypt==3.1.3
cffi==1.9.1
greenlet==0.4.12
motor==1.1
packaging==16.8
pycparser==2.17
pymongo==3.4.0
pyparsing==2.2.0
six==1.10.0
tornado==4.4.2
| appdirs==1.4.3
bcrypt==3.1.3
cffi==1.9.1
cryptography==1.7.2
greenlet==0.4.12
idna==2.4
motor==1.1
packaging==16.8
pyasn1==0.2.3
pycparser==2.17
pymongo==3.4.0
pyparsing==2.2.0
six==1.10.0
tornado==4.4.2
| Update requirments.txt to include Cryptography module | Update requirments.txt to include Cryptography module
| Text | mit | michardy/account-hijacking-prevention,michardy/account-hijacking-prevention,michardy/account-hijacking-prevention,michardy/account-hijacking-prevention | text | ## Code Before:
appdirs==1.4.3
bcrypt==3.1.3
cffi==1.9.1
greenlet==0.4.12
motor==1.1
packaging==16.8
pycparser==2.17
pymongo==3.4.0
pyparsing==2.2.0
six==1.10.0
tornado==4.4.2
## Instruction:
Update requirments.txt to include Cryptography module
## Code After:
appdirs==1.4.3
bcrypt==3.1.3
cffi==1.9.1
cryptography==1.7.2
greenlet==0.4.12
idna==2.4
motor==1.1
packaging==16.8
pyasn1==0.2.3
pycparser==2.17
pymongo==3.4.0
pyparsing==2.2.0
six==1.10.0
tornado==4.4.2
| appdirs==1.4.3
bcrypt==3.1.3
cffi==1.9.1
+ cryptography==1.7.2
greenlet==0.4.12
+ idna==2.4
motor==1.1
packaging==16.8
+ pyasn1==0.2.3
pycparser==2.17
pymongo==3.4.0
pyparsing==2.2.0
six==1.10.0
tornado==4.4.2 | 3 | 0.272727 | 3 | 0 |
6fef411a62306427ecf071797bdb94db2b2cf124 | plugins/services/src/js/constants/DefaultPod.js | plugins/services/src/js/constants/DefaultPod.js | const DEFAULT_POD_RESOURCES = {cpus: 0.001, mem: 32};
const DEFAULT_POD_CONTAINER =
{name: 'container-1', resources: DEFAULT_POD_RESOURCES};
const DEFAULT_POD_SPEC = {containers: [DEFAULT_POD_CONTAINER]};
module.exports = {
DEFAULT_POD_CONTAINER,
DEFAULT_POD_RESOURCES,
DEFAULT_POD_SPEC
};
| const DEFAULT_POD_RESOURCES = {cpus: 0.001, mem: 32};
const DEFAULT_POD_SCALING = {kind: 'fixed', instances: 1};
const DEFAULT_POD_CONTAINER =
{name: 'container-1', resources: DEFAULT_POD_RESOURCES};
const DEFAULT_POD_SPEC = {
containers: [DEFAULT_POD_CONTAINER],
scaling: DEFAULT_POD_SCALING
};
module.exports = {
DEFAULT_POD_CONTAINER,
DEFAULT_POD_RESOURCES,
DEFAULT_POD_SCALING,
DEFAULT_POD_SPEC
};
| Add Default scaling to pods | Add Default scaling to pods
| JavaScript | apache-2.0 | dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui,dcos/dcos-ui | javascript | ## Code Before:
const DEFAULT_POD_RESOURCES = {cpus: 0.001, mem: 32};
const DEFAULT_POD_CONTAINER =
{name: 'container-1', resources: DEFAULT_POD_RESOURCES};
const DEFAULT_POD_SPEC = {containers: [DEFAULT_POD_CONTAINER]};
module.exports = {
DEFAULT_POD_CONTAINER,
DEFAULT_POD_RESOURCES,
DEFAULT_POD_SPEC
};
## Instruction:
Add Default scaling to pods
## Code After:
const DEFAULT_POD_RESOURCES = {cpus: 0.001, mem: 32};
const DEFAULT_POD_SCALING = {kind: 'fixed', instances: 1};
const DEFAULT_POD_CONTAINER =
{name: 'container-1', resources: DEFAULT_POD_RESOURCES};
const DEFAULT_POD_SPEC = {
containers: [DEFAULT_POD_CONTAINER],
scaling: DEFAULT_POD_SCALING
};
module.exports = {
DEFAULT_POD_CONTAINER,
DEFAULT_POD_RESOURCES,
DEFAULT_POD_SCALING,
DEFAULT_POD_SPEC
};
| const DEFAULT_POD_RESOURCES = {cpus: 0.001, mem: 32};
+ const DEFAULT_POD_SCALING = {kind: 'fixed', instances: 1};
const DEFAULT_POD_CONTAINER =
- {name: 'container-1', resources: DEFAULT_POD_RESOURCES};
? --
+ {name: 'container-1', resources: DEFAULT_POD_RESOURCES};
- const DEFAULT_POD_SPEC = {containers: [DEFAULT_POD_CONTAINER]};
+ const DEFAULT_POD_SPEC = {
+ containers: [DEFAULT_POD_CONTAINER],
+ scaling: DEFAULT_POD_SCALING
+ };
module.exports = {
DEFAULT_POD_CONTAINER,
DEFAULT_POD_RESOURCES,
+ DEFAULT_POD_SCALING,
DEFAULT_POD_SPEC
}; | 9 | 0.9 | 7 | 2 |
80e03f8076b12264e9afa656fd98b61e71932633 | lib/manual_publication_log_filter.rb | lib/manual_publication_log_filter.rb | class ManualPublicationLogFilter
def delete_logs_and_rebuild_for_major_updates_only!(slug)
PublicationLog.with_slug_prefix(slug).destroy_all
document_editions_for_rebuild(slug).each do |edition|
PublicationLog.create!(
title: edition.title,
slug: edition.slug,
version_number: edition.version_number,
change_note: edition.change_note,
created_at: edition.exported_at,
updated_at: edition.exported_at
)
end
end
private
def document_editions_for_rebuild(slug)
SpecialistDocumentEdition.with_slug_prefix(slug).where(:minor_update.nin => [true]).any_of({state: "published"}, {state: "archived"})
end
end
| class ManualPublicationLogFilter
def delete_logs_and_rebuild_for_major_updates_only!(slug)
PublicationLog.with_slug_prefix(slug).destroy_all
document_editions_for_rebuild(slug).each do |edition|
PublicationLog.create!(
title: edition.title,
slug: edition.slug,
version_number: edition.version_number,
change_note: edition.change_note,
created_at: edition.exported_at || edition.updated_at,
updated_at: edition.exported_at || edition.updated_at
)
end
end
private
def document_editions_for_rebuild(slug)
SpecialistDocumentEdition.with_slug_prefix(slug).where(:minor_update.nin => [true]).any_of({state: "published"}, {state: "archived"})
end
end
| Set publication log timestamp to edition updated time | Set publication log timestamp to edition updated time
While running a task to rebuild publication logs for major updates it
was assumed that all non-draft editions had an exported_at time set. But
some were found to have exported_at as nil. By using the updated_at attribute as
a fallback we use the "best guess" for the time of exporting that edition.
| Ruby | mit | alphagov/manuals-publisher,alphagov/manuals-publisher,alphagov/manuals-publisher | ruby | ## Code Before:
class ManualPublicationLogFilter
def delete_logs_and_rebuild_for_major_updates_only!(slug)
PublicationLog.with_slug_prefix(slug).destroy_all
document_editions_for_rebuild(slug).each do |edition|
PublicationLog.create!(
title: edition.title,
slug: edition.slug,
version_number: edition.version_number,
change_note: edition.change_note,
created_at: edition.exported_at,
updated_at: edition.exported_at
)
end
end
private
def document_editions_for_rebuild(slug)
SpecialistDocumentEdition.with_slug_prefix(slug).where(:minor_update.nin => [true]).any_of({state: "published"}, {state: "archived"})
end
end
## Instruction:
Set publication log timestamp to edition updated time
While running a task to rebuild publication logs for major updates it
was assumed that all non-draft editions had an exported_at time set. But
some were found to have exported_at as nil. By using the updated_at attribute as
a fallback we use the "best guess" for the time of exporting that edition.
## Code After:
class ManualPublicationLogFilter
def delete_logs_and_rebuild_for_major_updates_only!(slug)
PublicationLog.with_slug_prefix(slug).destroy_all
document_editions_for_rebuild(slug).each do |edition|
PublicationLog.create!(
title: edition.title,
slug: edition.slug,
version_number: edition.version_number,
change_note: edition.change_note,
created_at: edition.exported_at || edition.updated_at,
updated_at: edition.exported_at || edition.updated_at
)
end
end
private
def document_editions_for_rebuild(slug)
SpecialistDocumentEdition.with_slug_prefix(slug).where(:minor_update.nin => [true]).any_of({state: "published"}, {state: "archived"})
end
end
| class ManualPublicationLogFilter
def delete_logs_and_rebuild_for_major_updates_only!(slug)
PublicationLog.with_slug_prefix(slug).destroy_all
document_editions_for_rebuild(slug).each do |edition|
PublicationLog.create!(
title: edition.title,
slug: edition.slug,
version_number: edition.version_number,
change_note: edition.change_note,
- created_at: edition.exported_at,
+ created_at: edition.exported_at || edition.updated_at,
? ++++++++++++++++++++++
- updated_at: edition.exported_at
+ updated_at: edition.exported_at || edition.updated_at
? ++++++++++++++++++++++
)
end
end
private
def document_editions_for_rebuild(slug)
SpecialistDocumentEdition.with_slug_prefix(slug).where(:minor_update.nin => [true]).any_of({state: "published"}, {state: "archived"})
end
end | 4 | 0.181818 | 2 | 2 |
561d5cd27f0cea84cdb11dd991c7ded07bee6980 | sonar-project.properties | sonar-project.properties | sonar.projectKey=org.codehaus.sonar-plugins.dotnet.tools:dependency-parser
sonar.projectName=.NET Dependency Parser
sonar.projectVersion=1.2-SNAPSHOT
sonar.projectDescription=.NET component that parses IL to compute dependencies between classes
sources=.
sonar.language=cs
sonar.donet.visualstudio.testProjectPattern=*.Test
| sonar.projectKey=org.codehaus.sonar-plugins.dotnet.tools:ndeps
sonar.projectName=NDeps
sonar.projectVersion=1.2-SNAPSHOT
sonar.projectDescription=.NET component that parses IL to compute dependencies between classes
sources=.
sonar.language=cs
sonar.donet.visualstudio.testProjectPattern=*.Test
| Update to new name NDeps | Update to new name NDeps | INI | apache-2.0 | grozeille/DependencyParser | ini | ## Code Before:
sonar.projectKey=org.codehaus.sonar-plugins.dotnet.tools:dependency-parser
sonar.projectName=.NET Dependency Parser
sonar.projectVersion=1.2-SNAPSHOT
sonar.projectDescription=.NET component that parses IL to compute dependencies between classes
sources=.
sonar.language=cs
sonar.donet.visualstudio.testProjectPattern=*.Test
## Instruction:
Update to new name NDeps
## Code After:
sonar.projectKey=org.codehaus.sonar-plugins.dotnet.tools:ndeps
sonar.projectName=NDeps
sonar.projectVersion=1.2-SNAPSHOT
sonar.projectDescription=.NET component that parses IL to compute dependencies between classes
sources=.
sonar.language=cs
sonar.donet.visualstudio.testProjectPattern=*.Test
| - sonar.projectKey=org.codehaus.sonar-plugins.dotnet.tools:dependency-parser
? ----------- --
+ sonar.projectKey=org.codehaus.sonar-plugins.dotnet.tools:ndeps
? +
- sonar.projectName=.NET Dependency Parser
+ sonar.projectName=NDeps
sonar.projectVersion=1.2-SNAPSHOT
sonar.projectDescription=.NET component that parses IL to compute dependencies between classes
sources=.
sonar.language=cs
sonar.donet.visualstudio.testProjectPattern=*.Test | 4 | 0.5 | 2 | 2 |
c1b97bbc6fc0603c0f2a809175edf88cd1e4a207 | setup.py | setup.py | from distutils.core import setup
packages = [
'upho',
'upho.phonon',
'upho.harmonic',
'upho.analysis',
'upho.structure',
'upho.irreps',
'upho.qpoints',
'group',
]
scripts = [
'scripts/upho_weights',
'scripts/upho_sf',
'scripts/qpoints',
]
setup(name='upho',
version='0.5.1',
author="Yuji Ikeda",
author_email="ikeda.yuji.6m@kyoto-u.ac.jp",
packages=packages,
scripts=scripts,
install_requires=['numpy'])
| from distutils.core import setup
packages = [
'upho',
'upho.phonon',
'upho.harmonic',
'upho.analysis',
'upho.structure',
'upho.irreps',
'upho.qpoints',
'group',
]
scripts = [
'scripts/upho_weights',
'scripts/upho_sf',
'scripts/qpoints',
]
setup(name='upho',
version='0.5.1',
author="Yuji Ikeda",
author_email="ikeda.yuji.6m@kyoto-u.ac.jp",
packages=packages,
scripts=scripts,
install_requires=['numpy', 'h5py', 'phonopy'])
| Add requirement of h5py and phonopy | Add requirement of h5py and phonopy
| Python | mit | yuzie007/ph_unfolder,yuzie007/upho | python | ## Code Before:
from distutils.core import setup
packages = [
'upho',
'upho.phonon',
'upho.harmonic',
'upho.analysis',
'upho.structure',
'upho.irreps',
'upho.qpoints',
'group',
]
scripts = [
'scripts/upho_weights',
'scripts/upho_sf',
'scripts/qpoints',
]
setup(name='upho',
version='0.5.1',
author="Yuji Ikeda",
author_email="ikeda.yuji.6m@kyoto-u.ac.jp",
packages=packages,
scripts=scripts,
install_requires=['numpy'])
## Instruction:
Add requirement of h5py and phonopy
## Code After:
from distutils.core import setup
packages = [
'upho',
'upho.phonon',
'upho.harmonic',
'upho.analysis',
'upho.structure',
'upho.irreps',
'upho.qpoints',
'group',
]
scripts = [
'scripts/upho_weights',
'scripts/upho_sf',
'scripts/qpoints',
]
setup(name='upho',
version='0.5.1',
author="Yuji Ikeda",
author_email="ikeda.yuji.6m@kyoto-u.ac.jp",
packages=packages,
scripts=scripts,
install_requires=['numpy', 'h5py', 'phonopy'])
| from distutils.core import setup
packages = [
'upho',
'upho.phonon',
'upho.harmonic',
'upho.analysis',
'upho.structure',
'upho.irreps',
'upho.qpoints',
'group',
]
scripts = [
'scripts/upho_weights',
'scripts/upho_sf',
'scripts/qpoints',
]
setup(name='upho',
version='0.5.1',
author="Yuji Ikeda",
author_email="ikeda.yuji.6m@kyoto-u.ac.jp",
packages=packages,
scripts=scripts,
- install_requires=['numpy'])
+ install_requires=['numpy', 'h5py', 'phonopy'])
? +++++++++++++++++++
| 2 | 0.083333 | 1 | 1 |
ceb9126e812f2212a0508b8ea8063301f46cc6a9 | packages/components/components/button/Copy.js | packages/components/components/button/Copy.js | import React, { useState } from 'react';
import PropTypes from 'prop-types';
import { c } from 'ttag';
import { Icon, Button, classnames, Tooltip } from 'react-components';
import { textToClipboard } from 'proton-shared/lib/helpers/browser';
const Copy = ({ value, className = '', onCopy }) => {
const [copied, setCopied] = useState(false);
const handleClick = () => {
textToClipboard(value);
onCopy && onCopy();
if (!copied) {
setCopied(true);
}
};
return (
<Button onClick={handleClick} className={classnames([className, copied && 'copied'])}>
<Tooltip title={copied ? c('Label').t`Copied` : c('Label').t`Copy`}>
<Icon name="clipboard" />
</Tooltip>
</Button>
);
};
Copy.propTypes = {
value: PropTypes.string.isRequired,
className: PropTypes.string,
onCopy: PropTypes.func
};
export default Copy;
| import React, { useState, useEffect, useRef } from 'react';
import PropTypes from 'prop-types';
import { c } from 'ttag';
import { Icon, Button, classnames, Tooltip } from 'react-components';
import { textToClipboard } from 'proton-shared/lib/helpers/browser';
const Copy = ({ value, className = '', onCopy }) => {
const [copied, setCopied] = useState(false);
const timeoutRef = useRef();
const handleClick = () => {
textToClipboard(value);
onCopy && onCopy();
if (!copied) {
setCopied(true);
timeoutRef.current = setTimeout(() => {
setCopied(false);
}, 2000);
}
};
useEffect(() => {
return () => {
if (timeoutRef.current) {
clearTimeout(timeoutRef.current);
}
};
}, []);
return (
<Button onClick={handleClick} className={classnames([className, copied && 'copied'])}>
<Tooltip title={copied ? c('Label').t`Copied` : c('Label').t`Copy`}>
<Icon name="clipboard" />
</Tooltip>
</Button>
);
};
Copy.propTypes = {
value: PropTypes.string.isRequired,
className: PropTypes.string,
onCopy: PropTypes.func
};
export default Copy;
| Fix CP-90 Review the popover for copy button | Fix CP-90 Review the popover for copy button
Since we are not able to read in the clipboard without autorization, we keep the copied state for 2 seconds.
| JavaScript | mit | ProtonMail/WebClient,ProtonMail/WebClient,ProtonMail/WebClient | javascript | ## Code Before:
import React, { useState } from 'react';
import PropTypes from 'prop-types';
import { c } from 'ttag';
import { Icon, Button, classnames, Tooltip } from 'react-components';
import { textToClipboard } from 'proton-shared/lib/helpers/browser';
const Copy = ({ value, className = '', onCopy }) => {
const [copied, setCopied] = useState(false);
const handleClick = () => {
textToClipboard(value);
onCopy && onCopy();
if (!copied) {
setCopied(true);
}
};
return (
<Button onClick={handleClick} className={classnames([className, copied && 'copied'])}>
<Tooltip title={copied ? c('Label').t`Copied` : c('Label').t`Copy`}>
<Icon name="clipboard" />
</Tooltip>
</Button>
);
};
Copy.propTypes = {
value: PropTypes.string.isRequired,
className: PropTypes.string,
onCopy: PropTypes.func
};
export default Copy;
## Instruction:
Fix CP-90 Review the popover for copy button
Since we are not able to read in the clipboard without autorization, we keep the copied state for 2 seconds.
## Code After:
import React, { useState, useEffect, useRef } from 'react';
import PropTypes from 'prop-types';
import { c } from 'ttag';
import { Icon, Button, classnames, Tooltip } from 'react-components';
import { textToClipboard } from 'proton-shared/lib/helpers/browser';
const Copy = ({ value, className = '', onCopy }) => {
const [copied, setCopied] = useState(false);
const timeoutRef = useRef();
const handleClick = () => {
textToClipboard(value);
onCopy && onCopy();
if (!copied) {
setCopied(true);
timeoutRef.current = setTimeout(() => {
setCopied(false);
}, 2000);
}
};
useEffect(() => {
return () => {
if (timeoutRef.current) {
clearTimeout(timeoutRef.current);
}
};
}, []);
return (
<Button onClick={handleClick} className={classnames([className, copied && 'copied'])}>
<Tooltip title={copied ? c('Label').t`Copied` : c('Label').t`Copy`}>
<Icon name="clipboard" />
</Tooltip>
</Button>
);
};
Copy.propTypes = {
value: PropTypes.string.isRequired,
className: PropTypes.string,
onCopy: PropTypes.func
};
export default Copy;
| - import React, { useState } from 'react';
+ import React, { useState, useEffect, useRef } from 'react';
? +++++++++++++++++++
import PropTypes from 'prop-types';
import { c } from 'ttag';
import { Icon, Button, classnames, Tooltip } from 'react-components';
import { textToClipboard } from 'proton-shared/lib/helpers/browser';
const Copy = ({ value, className = '', onCopy }) => {
const [copied, setCopied] = useState(false);
+ const timeoutRef = useRef();
const handleClick = () => {
textToClipboard(value);
onCopy && onCopy();
if (!copied) {
setCopied(true);
+ timeoutRef.current = setTimeout(() => {
+ setCopied(false);
+ }, 2000);
}
};
+
+ useEffect(() => {
+ return () => {
+ if (timeoutRef.current) {
+ clearTimeout(timeoutRef.current);
+ }
+ };
+ }, []);
return (
<Button onClick={handleClick} className={classnames([className, copied && 'copied'])}>
<Tooltip title={copied ? c('Label').t`Copied` : c('Label').t`Copy`}>
<Icon name="clipboard" />
</Tooltip>
</Button>
);
};
Copy.propTypes = {
value: PropTypes.string.isRequired,
className: PropTypes.string,
onCopy: PropTypes.func
};
export default Copy; | 14 | 0.411765 | 13 | 1 |
094d0add630f0dc08a8de2f205d2d14ca3cf51e0 | src/ggrc/assets/mustache/base_objects/generate_assessments_button.mustache | src/ggrc/assets/mustache/base_objects/generate_assessments_button.mustache | {{!
Copyright (C) 2016 Google Inc.
Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
}}
{{#if button}}
{{#is_allowed 'update' parent_instance context="for"}}
<a
href="javascript://"
class="generate-control-assessments btn btn-small btn-primary"
rel="tooltip"
data-placement="left"
title="Generate Assessments"
data-original-title="Generate Assessments">
<i
class="fa fa-magic"
rel="tooltip"
data-placement="left"
title="Generate Assessments"
data-original-title="Generate Assessments">
</i>
Autogenerate
</a>
{{/is_allowed}}
{{else}}
{{#if_instance_of parent_instance 'Audit'}}
{{#if_helpers '\
#if_equals' model.shortName 'Control' '\
or #if_equals' model.shortName 'Assessment'}}
{{#is_allowed 'update' parent_instance context="for"}}
<li class="generate-control-assessments">
<a href="javascript://">
<i
class="fa fa-magic"
rel="tooltip"
data-placement="left"
title=""
data-original-title="Generate Assessments"
></i>
</a>
</li>
{{/is_allowed}}
{{/if_helpers}}
{{/if_instance_of}}
{{/if}} | {{!
Copyright (C) 2016 Google Inc.
Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
}}
{{#if button}}
{{#is_allowed 'update' parent_instance context="for"}}
<a
href="javascript://"
class="generate-control-assessments btn btn-small btn-primary"
rel="tooltip"
data-placement="left"
title="Generate Assessments"
data-original-title="Generate Assessments">
<i
class="fa fa-magic"
rel="tooltip"
data-placement="left"
title="Generate Assessments"
data-original-title="Generate Assessments">
</i>
Autogenerate
</a>
{{/is_allowed}}
{{else}}
{{#if_instance_of parent_instance 'Audit'}}
{{#if_in model.shortName 'Assessment,Control'}}
{{#is_allowed 'update' parent_instance context="for"}}
<li class="generate-control-assessments">
<a href="javascript://">
<i
class="fa fa-magic"
rel="tooltip"
data-placement="left"
title=""
data-original-title="Generate Assessments"
></i>
</a>
</li>
{{/is_allowed}}
{{/if_in}}
{{/if_instance_of}}
{{/if}} | Use if_in helper instead of nested ifs | Use if_in helper instead of nested ifs
| HTML+Django | apache-2.0 | AleksNeStu/ggrc-core,j0gurt/ggrc-core,josthkko/ggrc-core,AleksNeStu/ggrc-core,kr41/ggrc-core,josthkko/ggrc-core,kr41/ggrc-core,kr41/ggrc-core,plamut/ggrc-core,selahssea/ggrc-core,VinnieJohns/ggrc-core,AleksNeStu/ggrc-core,selahssea/ggrc-core,andrei-karalionak/ggrc-core,josthkko/ggrc-core,j0gurt/ggrc-core,kr41/ggrc-core,josthkko/ggrc-core,selahssea/ggrc-core,plamut/ggrc-core,selahssea/ggrc-core,andrei-karalionak/ggrc-core,AleksNeStu/ggrc-core,VinnieJohns/ggrc-core,j0gurt/ggrc-core,VinnieJohns/ggrc-core,andrei-karalionak/ggrc-core,plamut/ggrc-core,andrei-karalionak/ggrc-core,VinnieJohns/ggrc-core,plamut/ggrc-core,j0gurt/ggrc-core | html+django | ## Code Before:
{{!
Copyright (C) 2016 Google Inc.
Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
}}
{{#if button}}
{{#is_allowed 'update' parent_instance context="for"}}
<a
href="javascript://"
class="generate-control-assessments btn btn-small btn-primary"
rel="tooltip"
data-placement="left"
title="Generate Assessments"
data-original-title="Generate Assessments">
<i
class="fa fa-magic"
rel="tooltip"
data-placement="left"
title="Generate Assessments"
data-original-title="Generate Assessments">
</i>
Autogenerate
</a>
{{/is_allowed}}
{{else}}
{{#if_instance_of parent_instance 'Audit'}}
{{#if_helpers '\
#if_equals' model.shortName 'Control' '\
or #if_equals' model.shortName 'Assessment'}}
{{#is_allowed 'update' parent_instance context="for"}}
<li class="generate-control-assessments">
<a href="javascript://">
<i
class="fa fa-magic"
rel="tooltip"
data-placement="left"
title=""
data-original-title="Generate Assessments"
></i>
</a>
</li>
{{/is_allowed}}
{{/if_helpers}}
{{/if_instance_of}}
{{/if}}
## Instruction:
Use if_in helper instead of nested ifs
## Code After:
{{!
Copyright (C) 2016 Google Inc.
Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
}}
{{#if button}}
{{#is_allowed 'update' parent_instance context="for"}}
<a
href="javascript://"
class="generate-control-assessments btn btn-small btn-primary"
rel="tooltip"
data-placement="left"
title="Generate Assessments"
data-original-title="Generate Assessments">
<i
class="fa fa-magic"
rel="tooltip"
data-placement="left"
title="Generate Assessments"
data-original-title="Generate Assessments">
</i>
Autogenerate
</a>
{{/is_allowed}}
{{else}}
{{#if_instance_of parent_instance 'Audit'}}
{{#if_in model.shortName 'Assessment,Control'}}
{{#is_allowed 'update' parent_instance context="for"}}
<li class="generate-control-assessments">
<a href="javascript://">
<i
class="fa fa-magic"
rel="tooltip"
data-placement="left"
title=""
data-original-title="Generate Assessments"
></i>
</a>
</li>
{{/is_allowed}}
{{/if_in}}
{{/if_instance_of}}
{{/if}} | {{!
Copyright (C) 2016 Google Inc.
Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
}}
{{#if button}}
{{#is_allowed 'update' parent_instance context="for"}}
<a
href="javascript://"
class="generate-control-assessments btn btn-small btn-primary"
rel="tooltip"
data-placement="left"
title="Generate Assessments"
data-original-title="Generate Assessments">
<i
class="fa fa-magic"
rel="tooltip"
data-placement="left"
title="Generate Assessments"
data-original-title="Generate Assessments">
</i>
Autogenerate
</a>
{{/is_allowed}}
{{else}}
{{#if_instance_of parent_instance 'Audit'}}
- {{#if_helpers '\
- #if_equals' model.shortName 'Control' '\
- or #if_equals' model.shortName 'Assessment'}}
? ^^^^^ ^^^^^^^
+ {{#if_in model.shortName 'Assessment,Control'}}
? ^^ ^^ ++++++++
{{#is_allowed 'update' parent_instance context="for"}}
<li class="generate-control-assessments">
<a href="javascript://">
<i
class="fa fa-magic"
rel="tooltip"
data-placement="left"
title=""
data-original-title="Generate Assessments"
></i>
</a>
</li>
{{/is_allowed}}
- {{/if_helpers}}
+ {{/if_in}}
{{/if_instance_of}}
{{/if}} | 6 | 0.133333 | 2 | 4 |
b134633b071be3a19b891cbfddd3a61363940edf | Config/bootstrap.php | Config/bootstrap.php | <?php
Configure::write('predictionIO', array(
'appkey' => 'your-key',
'userModel' => 'User',
'engine' => ''
));
$files = array(
App::pluginPath('PredictionIO') . 'vendor' . DS . 'autoload.php',
APP . 'Vendor' . DS . 'autoload.php',
APP . 'vendor' . DS . 'autoload.php',
);
foreach ($files as $file) {
if (file_exists($file)) {
require_once $file;
break;
}
}
| <?php
Configure::write('predictionIO', array(
'appkey' => 'your-key',
'host' => 'localhost:8000',
'userModel' => 'User',
'engine' => ''
));
$files = array(
App::pluginPath('PredictionIO') . 'vendor' . DS . 'autoload.php',
APP . 'Vendor' . DS . 'autoload.php',
APP . 'vendor' . DS . 'autoload.php',
);
foreach ($files as $file) {
if (file_exists($file)) {
require_once $file;
break;
}
}
| Add predictionIO api url to Config | Add predictionIO api url to Config
| PHP | mit | wa0x6e/cakephp-predictionio,kamisama/cakephp-predictionio | php | ## Code Before:
<?php
Configure::write('predictionIO', array(
'appkey' => 'your-key',
'userModel' => 'User',
'engine' => ''
));
$files = array(
App::pluginPath('PredictionIO') . 'vendor' . DS . 'autoload.php',
APP . 'Vendor' . DS . 'autoload.php',
APP . 'vendor' . DS . 'autoload.php',
);
foreach ($files as $file) {
if (file_exists($file)) {
require_once $file;
break;
}
}
## Instruction:
Add predictionIO api url to Config
## Code After:
<?php
Configure::write('predictionIO', array(
'appkey' => 'your-key',
'host' => 'localhost:8000',
'userModel' => 'User',
'engine' => ''
));
$files = array(
App::pluginPath('PredictionIO') . 'vendor' . DS . 'autoload.php',
APP . 'Vendor' . DS . 'autoload.php',
APP . 'vendor' . DS . 'autoload.php',
);
foreach ($files as $file) {
if (file_exists($file)) {
require_once $file;
break;
}
}
| <?php
Configure::write('predictionIO', array(
'appkey' => 'your-key',
+ 'host' => 'localhost:8000',
'userModel' => 'User',
'engine' => ''
));
$files = array(
App::pluginPath('PredictionIO') . 'vendor' . DS . 'autoload.php',
APP . 'Vendor' . DS . 'autoload.php',
APP . 'vendor' . DS . 'autoload.php',
);
foreach ($files as $file) {
if (file_exists($file)) {
require_once $file;
break;
}
} | 1 | 0.05 | 1 | 0 |
29dc6571943cbb6ac086252d004b7e088b7706da | plugin/src/main/groovy/jp/tomorrowkey/gradle/notifier/NotifiersFactory.groovy | plugin/src/main/groovy/jp/tomorrowkey/gradle/notifier/NotifiersFactory.groovy | package jp.tomorrowkey.gradle.notifier
import org.gradle.api.Project
public class NotifiersFactory {
private static final String CONFIG_FILE_PATH = "notifier.groovy";
public static Notifier[] create(Project project) {
return create(project, getConfig(CONFIG_FILE_PATH))
}
static ConfigObject getConfig(String configFilePath) {
return new ConfigSlurper().parse(new File(configFilePath).toURL())
}
static Notifier[] create(Project project, ConfigObject config) {
def notifiers = []
if(config.voice.enabled) {
notifiers.add(new VoiceNotifier(config.voice.name))
}
if(config.notificationCenter.enabled) {
notifiers.add(new NotificationCenterNotifier())
}
if(config.sound.enabled) {
notifiers.add(new SoundNotifier(project, config.sound.url))
}
return notifiers;
}
}
| package jp.tomorrowkey.gradle.notifier
import org.gradle.api.Project
public class NotifiersFactory {
private static final String CONFIG_FILE_PATH = "notifier.groovy";
public static Notifier[] create(Project project) {
return create(project, getConfig(CONFIG_FILE_PATH))
}
static ConfigObject getConfig(String configFilePath) {
def file = new File(configFilePath);
if (file.exists()) {
return new ConfigSlurper().parse(file.toURI().toURL());
} else {
return new ConfigObject();
}
}
static Notifier[] create(Project project, ConfigObject config) {
def notifiers = []
if (config.voice.enabled) {
notifiers.add(new VoiceNotifier(config.voice.name))
}
if (config.notificationCenter.enabled) {
notifiers.add(new NotificationCenterNotifier())
}
if (config.sound.enabled) {
notifiers.add(new SoundNotifier(project, config.sound.url))
}
return notifiers;
}
}
| Fix crash when notifier.groovy file is missing. | Fix crash when notifier.groovy file is missing.
| Groovy | apache-2.0 | tomorrowkey/notifier-plugin | groovy | ## Code Before:
package jp.tomorrowkey.gradle.notifier
import org.gradle.api.Project
public class NotifiersFactory {
private static final String CONFIG_FILE_PATH = "notifier.groovy";
public static Notifier[] create(Project project) {
return create(project, getConfig(CONFIG_FILE_PATH))
}
static ConfigObject getConfig(String configFilePath) {
return new ConfigSlurper().parse(new File(configFilePath).toURL())
}
static Notifier[] create(Project project, ConfigObject config) {
def notifiers = []
if(config.voice.enabled) {
notifiers.add(new VoiceNotifier(config.voice.name))
}
if(config.notificationCenter.enabled) {
notifiers.add(new NotificationCenterNotifier())
}
if(config.sound.enabled) {
notifiers.add(new SoundNotifier(project, config.sound.url))
}
return notifiers;
}
}
## Instruction:
Fix crash when notifier.groovy file is missing.
## Code After:
package jp.tomorrowkey.gradle.notifier
import org.gradle.api.Project
public class NotifiersFactory {
private static final String CONFIG_FILE_PATH = "notifier.groovy";
public static Notifier[] create(Project project) {
return create(project, getConfig(CONFIG_FILE_PATH))
}
static ConfigObject getConfig(String configFilePath) {
def file = new File(configFilePath);
if (file.exists()) {
return new ConfigSlurper().parse(file.toURI().toURL());
} else {
return new ConfigObject();
}
}
static Notifier[] create(Project project, ConfigObject config) {
def notifiers = []
if (config.voice.enabled) {
notifiers.add(new VoiceNotifier(config.voice.name))
}
if (config.notificationCenter.enabled) {
notifiers.add(new NotificationCenterNotifier())
}
if (config.sound.enabled) {
notifiers.add(new SoundNotifier(project, config.sound.url))
}
return notifiers;
}
}
| package jp.tomorrowkey.gradle.notifier
import org.gradle.api.Project
public class NotifiersFactory {
private static final String CONFIG_FILE_PATH = "notifier.groovy";
public static Notifier[] create(Project project) {
return create(project, getConfig(CONFIG_FILE_PATH))
}
static ConfigObject getConfig(String configFilePath) {
+ def file = new File(configFilePath);
+ if (file.exists()) {
- return new ConfigSlurper().parse(new File(configFilePath).toURL())
? ^^^^^ --------------
+ return new ConfigSlurper().parse(file.toURI().toURL());
? ++++ ^ ++++++ +
+ } else {
+ return new ConfigObject();
+ }
}
static Notifier[] create(Project project, ConfigObject config) {
def notifiers = []
- if(config.voice.enabled) {
+ if (config.voice.enabled) {
? +
notifiers.add(new VoiceNotifier(config.voice.name))
}
- if(config.notificationCenter.enabled) {
+ if (config.notificationCenter.enabled) {
? +
notifiers.add(new NotificationCenterNotifier())
}
- if(config.sound.enabled) {
+ if (config.sound.enabled) {
? +
notifiers.add(new SoundNotifier(project, config.sound.url))
}
return notifiers;
}
} | 13 | 0.382353 | 9 | 4 |
2b88d93a2ebc56a76384f63fc3724207b4d9a255 | test/CodeGen/AArch64/arm64-nvcast.ll | test/CodeGen/AArch64/arm64-nvcast.ll | ; RUN: llc < %s -mtriple=arm64-apple-ios
define void @test(float * %p1, i32 %v1) {
entry:
%v2 = extractelement <3 x float> <float 0.000000e+00, float 2.000000e+00, float 0.000000e+00>, i32 %v1
store float %v2, float* %p1, align 4
ret void
}
| ; RUN: llc < %s -mtriple=arm64-apple-ios | FileCheck %s
; CHECK-LABEL: _test:
; CHECK: fmov.2d v0, #2.00000000
; CHECK: str q0, [sp]
; CHECK: mov x8, sp
; CHECK: ldr s0, [x8, w1, sxtw #2]
; CHECK: str s0, [x0]
define void @test(float * %p1, i32 %v1) {
entry:
%v2 = extractelement <3 x float> <float 0.000000e+00, float 2.000000e+00, float 0.000000e+00>, i32 %v1
store float %v2, float* %p1, align 4
ret void
}
| Add CHECK lines to test case | Add CHECK lines to test case
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@241619 91177308-0d34-0410-b5e6-96231b3b80d8
| LLVM | apache-2.0 | apple/swift-llvm,dslab-epfl/asap,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,llvm-mirror/llvm,dslab-epfl/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm | llvm | ## Code Before:
; RUN: llc < %s -mtriple=arm64-apple-ios
define void @test(float * %p1, i32 %v1) {
entry:
%v2 = extractelement <3 x float> <float 0.000000e+00, float 2.000000e+00, float 0.000000e+00>, i32 %v1
store float %v2, float* %p1, align 4
ret void
}
## Instruction:
Add CHECK lines to test case
git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@241619 91177308-0d34-0410-b5e6-96231b3b80d8
## Code After:
; RUN: llc < %s -mtriple=arm64-apple-ios | FileCheck %s
; CHECK-LABEL: _test:
; CHECK: fmov.2d v0, #2.00000000
; CHECK: str q0, [sp]
; CHECK: mov x8, sp
; CHECK: ldr s0, [x8, w1, sxtw #2]
; CHECK: str s0, [x0]
define void @test(float * %p1, i32 %v1) {
entry:
%v2 = extractelement <3 x float> <float 0.000000e+00, float 2.000000e+00, float 0.000000e+00>, i32 %v1
store float %v2, float* %p1, align 4
ret void
}
| - ; RUN: llc < %s -mtriple=arm64-apple-ios
+ ; RUN: llc < %s -mtriple=arm64-apple-ios | FileCheck %s
? +++++++++++++++
+
+ ; CHECK-LABEL: _test:
+ ; CHECK: fmov.2d v0, #2.00000000
+ ; CHECK: str q0, [sp]
+ ; CHECK: mov x8, sp
+ ; CHECK: ldr s0, [x8, w1, sxtw #2]
+ ; CHECK: str s0, [x0]
define void @test(float * %p1, i32 %v1) {
entry:
%v2 = extractelement <3 x float> <float 0.000000e+00, float 2.000000e+00, float 0.000000e+00>, i32 %v1
store float %v2, float* %p1, align 4
ret void
} | 9 | 1.125 | 8 | 1 |
4cbdd86549560bd6c3425c3b3838c0ccc324ccbc | tests/basic.js | tests/basic.js | describe('Initialization', function () {
beforeEach(createImage);
it('should wrap image', function() {
var image = getImageElement();
var taggd = new Taggd(image);
expect(image.parentElement.classList.contains('taggd')).toEqual(true);
});
afterEach(destroyBody);
});
| describe('Initialization', function () {
beforeEach(createImage);
afterEach(destroyBody);
it('should wrap image', function() {
var image = getImageElement();
var taggd = new Taggd(image);
expect(image.parentElement.classList.contains('taggd')).toEqual(true);
});
});
| Move afterEach to top with beforeEach | Move afterEach to top with beforeEach
| JavaScript | mit | timseverien/taggd,timseverien/taggd | javascript | ## Code Before:
describe('Initialization', function () {
beforeEach(createImage);
it('should wrap image', function() {
var image = getImageElement();
var taggd = new Taggd(image);
expect(image.parentElement.classList.contains('taggd')).toEqual(true);
});
afterEach(destroyBody);
});
## Instruction:
Move afterEach to top with beforeEach
## Code After:
describe('Initialization', function () {
beforeEach(createImage);
afterEach(destroyBody);
it('should wrap image', function() {
var image = getImageElement();
var taggd = new Taggd(image);
expect(image.parentElement.classList.contains('taggd')).toEqual(true);
});
});
| describe('Initialization', function () {
beforeEach(createImage);
+ afterEach(destroyBody);
it('should wrap image', function() {
var image = getImageElement();
var taggd = new Taggd(image);
expect(image.parentElement.classList.contains('taggd')).toEqual(true);
});
-
- afterEach(destroyBody);
}); | 3 | 0.25 | 1 | 2 |
cf5186139dc777a7db95bd6f33dd016ee7d77d5b | static/script.js | static/script.js | $(function () {
$('a[href-post]').click(function (e) {
e.preventDefault();
var form = document.createElement('form');
form.style.display = 'none';
form.method = 'post';
form.action = $(this).attr('href-post');
form.target = '_self';
var input = document.createElement('input');
input.type = 'hidden';
input.name = '_csrf';
input.value = document.head.getAttribute('data-csrf-token');
form.appendChild(input);
document.body.appendChild(form);
form.submit();
});
$('form').each(function () {
var input = document.createElement('input');
input.type = 'hidden';
input.name = '_csrf';
input.value = document.head.getAttribute('data-csrf-token');
this.appendChild(input);
});
});
| var addUrlParam = function (url, key, val) {
var newParam = encodeURIComponent(key) + '=' + encodeURIComponent(val);
url = url.split('#')[0];
if (url.indexOf('?') === -1) url += '?' + newParam;
else url += '&' + newParam;
return url;
};
$(function () {
$('a[href-post]').click(function (e) {
e.preventDefault();
var form = document.createElement('form');
form.style.display = 'none';
form.method = 'post';
form.action = $(this).attr('href-post');
form.target = '_self';
var input = document.createElement('input');
input.type = 'hidden';
input.name = '_csrf';
input.value = document.head.getAttribute('data-csrf-token');
form.appendChild(input);
document.body.appendChild(form);
form.submit();
});
$('form').each(function () {
this.action = addUrlParam(this.action || location.href, '_csrf', document.head.getAttribute('data-csrf-token'));
});
});
| Fix file upload csrf error | Fix file upload csrf error
| JavaScript | mit | syzoj/syzoj,syzoj/syzoj | javascript | ## Code Before:
$(function () {
$('a[href-post]').click(function (e) {
e.preventDefault();
var form = document.createElement('form');
form.style.display = 'none';
form.method = 'post';
form.action = $(this).attr('href-post');
form.target = '_self';
var input = document.createElement('input');
input.type = 'hidden';
input.name = '_csrf';
input.value = document.head.getAttribute('data-csrf-token');
form.appendChild(input);
document.body.appendChild(form);
form.submit();
});
$('form').each(function () {
var input = document.createElement('input');
input.type = 'hidden';
input.name = '_csrf';
input.value = document.head.getAttribute('data-csrf-token');
this.appendChild(input);
});
});
## Instruction:
Fix file upload csrf error
## Code After:
var addUrlParam = function (url, key, val) {
var newParam = encodeURIComponent(key) + '=' + encodeURIComponent(val);
url = url.split('#')[0];
if (url.indexOf('?') === -1) url += '?' + newParam;
else url += '&' + newParam;
return url;
};
$(function () {
$('a[href-post]').click(function (e) {
e.preventDefault();
var form = document.createElement('form');
form.style.display = 'none';
form.method = 'post';
form.action = $(this).attr('href-post');
form.target = '_self';
var input = document.createElement('input');
input.type = 'hidden';
input.name = '_csrf';
input.value = document.head.getAttribute('data-csrf-token');
form.appendChild(input);
document.body.appendChild(form);
form.submit();
});
$('form').each(function () {
this.action = addUrlParam(this.action || location.href, '_csrf', document.head.getAttribute('data-csrf-token'));
});
});
| + var addUrlParam = function (url, key, val) {
+ var newParam = encodeURIComponent(key) + '=' + encodeURIComponent(val);
+
+ url = url.split('#')[0];
+ if (url.indexOf('?') === -1) url += '?' + newParam;
+ else url += '&' + newParam;
+
+ return url;
+ };
+
$(function () {
$('a[href-post]').click(function (e) {
e.preventDefault();
var form = document.createElement('form');
form.style.display = 'none';
form.method = 'post';
form.action = $(this).attr('href-post');
form.target = '_self';
var input = document.createElement('input');
input.type = 'hidden';
input.name = '_csrf';
input.value = document.head.getAttribute('data-csrf-token');
form.appendChild(input);
document.body.appendChild(form);
form.submit();
});
$('form').each(function () {
+ this.action = addUrlParam(this.action || location.href, '_csrf', document.head.getAttribute('data-csrf-token'));
- var input = document.createElement('input');
- input.type = 'hidden';
- input.name = '_csrf';
- input.value = document.head.getAttribute('data-csrf-token');
- this.appendChild(input);
});
}); | 16 | 0.571429 | 11 | 5 |
42b2e8cf63c303d6b96e5d75d90ac77dc0897419 | migrations/20170806154824_user_prefs.js | migrations/20170806154824_user_prefs.js | export async function up(knex) {
await knex.schema.table('users', (table) => {
table.jsonb('preferences').defaultTo('{}').notNullable();
});
// Migrate from the 'frontend_preferences'
await knex.raw(`
update users set preferences = jsonb_set(
preferences,
'{hideCommentsOfTypes}',
coalesce((frontend_preferences::jsonb) #> '{net.freefeed,comments,hiddenTypes}', '[]'),
true
)
`);
}
export async function down(knex) {
await knex.schema.table('users', (table) => {
table.dropColumn('preferences');
});
}
| export async function up(knex) {
await knex.schema.table('users', (table) => {
table.jsonb('preferences').defaultTo('{}').notNullable();
});
// Migrate from the 'frontend_preferences'
await knex.raw(`
update users set
preferences = jsonb_set(
preferences, '{hideCommentsOfTypes}',
coalesce(frontend_preferences::jsonb #> '{net.freefeed,comments,hiddenTypes}', '[]'),
true
),
frontend_preferences = (
frontend_preferences::jsonb #- '{net.freefeed,comments,hiddenTypes}'
)::text
`);
}
export async function down(knex) {
// Migrate back to the 'frontend_preferences'
await knex.raw(`
update users set
frontend_preferences = jsonb_set(
frontend_preferences::jsonb, '{net.freefeed,comments,hiddenTypes}',
coalesce(preferences #> '{hideCommentsOfTypes}', '[]'),
true
)::text
`);
await knex.schema.table('users', (table) => {
table.dropColumn('preferences');
});
}
| Move data from frontend_prefs to prefs and back during migration | Move data from frontend_prefs to prefs and back during migration
| JavaScript | mit | FreeFeed/freefeed-server,FreeFeed/freefeed-server | javascript | ## Code Before:
export async function up(knex) {
await knex.schema.table('users', (table) => {
table.jsonb('preferences').defaultTo('{}').notNullable();
});
// Migrate from the 'frontend_preferences'
await knex.raw(`
update users set preferences = jsonb_set(
preferences,
'{hideCommentsOfTypes}',
coalesce((frontend_preferences::jsonb) #> '{net.freefeed,comments,hiddenTypes}', '[]'),
true
)
`);
}
export async function down(knex) {
await knex.schema.table('users', (table) => {
table.dropColumn('preferences');
});
}
## Instruction:
Move data from frontend_prefs to prefs and back during migration
## Code After:
export async function up(knex) {
await knex.schema.table('users', (table) => {
table.jsonb('preferences').defaultTo('{}').notNullable();
});
// Migrate from the 'frontend_preferences'
await knex.raw(`
update users set
preferences = jsonb_set(
preferences, '{hideCommentsOfTypes}',
coalesce(frontend_preferences::jsonb #> '{net.freefeed,comments,hiddenTypes}', '[]'),
true
),
frontend_preferences = (
frontend_preferences::jsonb #- '{net.freefeed,comments,hiddenTypes}'
)::text
`);
}
export async function down(knex) {
// Migrate back to the 'frontend_preferences'
await knex.raw(`
update users set
frontend_preferences = jsonb_set(
frontend_preferences::jsonb, '{net.freefeed,comments,hiddenTypes}',
coalesce(preferences #> '{hideCommentsOfTypes}', '[]'),
true
)::text
`);
await knex.schema.table('users', (table) => {
table.dropColumn('preferences');
});
}
| export async function up(knex) {
await knex.schema.table('users', (table) => {
table.jsonb('preferences').defaultTo('{}').notNullable();
});
// Migrate from the 'frontend_preferences'
await knex.raw(`
+ update users set
- update users set preferences = jsonb_set(
? ------ ---------
+ preferences = jsonb_set(
- preferences,
- '{hideCommentsOfTypes}',
+ preferences, '{hideCommentsOfTypes}',
? +++++++++++++++++
- coalesce((frontend_preferences::jsonb) #> '{net.freefeed,comments,hiddenTypes}', '[]'),
? - -
+ coalesce(frontend_preferences::jsonb #> '{net.freefeed,comments,hiddenTypes}', '[]'),
? ++++
- true
+ true
? ++++
- )
+ ),
+ frontend_preferences = (
+ frontend_preferences::jsonb #- '{net.freefeed,comments,hiddenTypes}'
+ )::text
`);
}
export async function down(knex) {
+ // Migrate back to the 'frontend_preferences'
+ await knex.raw(`
+ update users set
+ frontend_preferences = jsonb_set(
+ frontend_preferences::jsonb, '{net.freefeed,comments,hiddenTypes}',
+ coalesce(preferences #> '{hideCommentsOfTypes}', '[]'),
+ true
+ )::text
+ `);
await knex.schema.table('users', (table) => {
table.dropColumn('preferences');
});
} | 24 | 1.2 | 18 | 6 |
c57ecf9fa3b45bd6945ca20c0c22bf676bc3203e | .github/workflows/wheels.yml | .github/workflows/wheels.yml |
name: Wheels
on: workflow_dispatch
jobs:
build_wheels:
name: Build wheels for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r dev-requirements.txt
python setup.py install
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==1.7.2
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_SKIP: "cp27-* cp35-* cp36-* cp310-* pp*" # skip Python 2.7 wheels
CIBW_BEFORE_BUILD: "rm -rf build/"
- name: Upload wheels
run: |
python -m pip install twine
python -m twine upload -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} ./wheelhouse/*.whl
|
name: Wheels
on: workflow_dispatch
jobs:
build_wheels:
name: Build wheels for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.8'
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2.1.1
with:
python-version: ${{ matrix.python-version }}
channels: conda-forge
- name: Install dependencies
run: |
python -m pip install --upgrade pip
conda install --file requirements.txt
pip install -r dev-requirements.txt
python setup.py install
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==1.7.2
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_SKIP: "cp27-* cp35-* cp36-* cp310-* pp*" # skip Python 2.7 wheels
CIBW_BEFORE_BUILD: "rm -rf build/"
- name: Upload wheels
run: |
python -m pip install twine
python -m twine upload -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} ./wheelhouse/*.whl
| FIX python wheel building using conda | FIX python wheel building using conda
| YAML | mit | jmschrei/pomegranate,jmschrei/pomegranate | yaml | ## Code Before:
name: Wheels
on: workflow_dispatch
jobs:
build_wheels:
name: Build wheels for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r dev-requirements.txt
python setup.py install
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==1.7.2
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_SKIP: "cp27-* cp35-* cp36-* cp310-* pp*" # skip Python 2.7 wheels
CIBW_BEFORE_BUILD: "rm -rf build/"
- name: Upload wheels
run: |
python -m pip install twine
python -m twine upload -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} ./wheelhouse/*.whl
## Instruction:
FIX python wheel building using conda
## Code After:
name: Wheels
on: workflow_dispatch
jobs:
build_wheels:
name: Build wheels for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.8'
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2.1.1
with:
python-version: ${{ matrix.python-version }}
channels: conda-forge
- name: Install dependencies
run: |
python -m pip install --upgrade pip
conda install --file requirements.txt
pip install -r dev-requirements.txt
python setup.py install
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==1.7.2
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_SKIP: "cp27-* cp35-* cp36-* cp310-* pp*" # skip Python 2.7 wheels
CIBW_BEFORE_BUILD: "rm -rf build/"
- name: Upload wheels
run: |
python -m pip install twine
python -m twine upload -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} ./wheelhouse/*.whl
|
name: Wheels
on: workflow_dispatch
jobs:
build_wheels:
name: Build wheels for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.8'
+
+ - name: Setup Miniconda
+ uses: conda-incubator/setup-miniconda@v2.1.1
+ with:
+ python-version: ${{ matrix.python-version }}
+ channels: conda-forge
- name: Install dependencies
run: |
python -m pip install --upgrade pip
+ conda install --file requirements.txt
pip install -r dev-requirements.txt
python setup.py install
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==1.7.2
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_SKIP: "cp27-* cp35-* cp36-* cp310-* pp*" # skip Python 2.7 wheels
CIBW_BEFORE_BUILD: "rm -rf build/"
- name: Upload wheels
run: |
python -m pip install twine
python -m twine upload -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} ./wheelhouse/*.whl
| 7 | 0.170732 | 7 | 0 |
f01a19cab57161665f147619251a1a7c671063ef | template/src/support/hooks.js | template/src/support/hooks.js | 'use strict';
const dateFormat = require('dateformat');
const { defineSupportCode } = require('cucumber');
defineSupportCode(function ({ Before, After }) {
Before(function () {
browser.deleteCookie();
faker.locale = browser.options.locale;
});
After(function (scenario) {
// Delete cached data files
const regexPathData = /src\/support\/data/;
for (const key in require.cache) {
if (require.cache[key] && key.match(regexPathData)) {
delete require.cache[key];
}
}
if (scenario.isFailed()) {
const errorDate = dateFormat(new Date(), 'yyyy-mm-dd-HHMMss');
return browser.saveScreenshot(`./output/errorShots/screenshot-error-${errorDate}.png`);
}
return Promise.resolve();
});
});
| 'use strict';
const dateFormat = require('dateformat');
const { defineSupportCode } = require('cucumber');
defineSupportCode(function ({ Before, After }) {
Before(function () {
browser.deleteCookie();
faker.locale = browser.options.locale;
});
After(function (scenario) {
if (scenario.isFailed()) {
const errorDate = dateFormat(new Date(), 'yyyy-mm-dd-HHMMss');
return browser.saveScreenshot(`./output/errorShots/screenshot-error-${errorDate}.png`);
}
return Promise.resolve();
});
});
| Remove now useless cache deletion | Remove now useless cache deletion
| JavaScript | mit | nespresso/ntaf,nespresso/ntaf,nespresso/ntaf | javascript | ## Code Before:
'use strict';
const dateFormat = require('dateformat');
const { defineSupportCode } = require('cucumber');
defineSupportCode(function ({ Before, After }) {
Before(function () {
browser.deleteCookie();
faker.locale = browser.options.locale;
});
After(function (scenario) {
// Delete cached data files
const regexPathData = /src\/support\/data/;
for (const key in require.cache) {
if (require.cache[key] && key.match(regexPathData)) {
delete require.cache[key];
}
}
if (scenario.isFailed()) {
const errorDate = dateFormat(new Date(), 'yyyy-mm-dd-HHMMss');
return browser.saveScreenshot(`./output/errorShots/screenshot-error-${errorDate}.png`);
}
return Promise.resolve();
});
});
## Instruction:
Remove now useless cache deletion
## Code After:
'use strict';
const dateFormat = require('dateformat');
const { defineSupportCode } = require('cucumber');
defineSupportCode(function ({ Before, After }) {
Before(function () {
browser.deleteCookie();
faker.locale = browser.options.locale;
});
After(function (scenario) {
if (scenario.isFailed()) {
const errorDate = dateFormat(new Date(), 'yyyy-mm-dd-HHMMss');
return browser.saveScreenshot(`./output/errorShots/screenshot-error-${errorDate}.png`);
}
return Promise.resolve();
});
});
| 'use strict';
const dateFormat = require('dateformat');
const { defineSupportCode } = require('cucumber');
defineSupportCode(function ({ Before, After }) {
Before(function () {
browser.deleteCookie();
faker.locale = browser.options.locale;
});
After(function (scenario) {
- // Delete cached data files
- const regexPathData = /src\/support\/data/;
- for (const key in require.cache) {
- if (require.cache[key] && key.match(regexPathData)) {
- delete require.cache[key];
- }
- }
-
if (scenario.isFailed()) {
const errorDate = dateFormat(new Date(), 'yyyy-mm-dd-HHMMss');
return browser.saveScreenshot(`./output/errorShots/screenshot-error-${errorDate}.png`);
}
return Promise.resolve();
});
}); | 8 | 0.266667 | 0 | 8 |
4cdbf1503fd56e6a16a535005560e67e45b12402 | README.md | README.md | Welcome to Bored, the world's premier termbox-based Reddit CLI. It has *numerous* features including keybinds, opening links in your browser, and even the ability to upvote and downvote links!
Speaking of keybinds:
h - help screen
q - quit
j - navigate/scroll down
k - navigate/scroll up
i - show submission info (only on list view)
r - refresh
f - front page
c - comments (currently just a self-text view)
l - open link url
y - copy link url
enter - open reddit permalink
Params:
-u username
-p password
-s subreddit (using this loads submissions from ONLY the given subreddit)
Environment variables to make your life easier:
BORED_USERNAME - same as specifying -u
BORED_PASSWORD - same as specifying -p
BORED_SUBREDDIT - same as specifying -s
To install, clone the repo and run `go install .`
| Welcome to Bored, the world's premier termbox-based Reddit CLI. It has *numerous* features including keybinds, opening links in your browser, and even the ability to upvote and downvote links!
Speaking of keybinds:
h - help screen
q - quit
j - navigate/scroll down
k - navigate/scroll up
i - show submission info (only on list view)
r - refresh
f - front page
c - comments (currently just a self-text view)
l - open link url
y - copy link url
enter - open reddit permalink
Params (these override the environment variables below):
-u username
-p password
-s subreddit (using this loads submissions from ONLY the given subreddit)
Environment variables to make your life easier:
BORED_USERNAME - same as specifying -u
BORED_PASSWORD - same as specifying -p
BORED_SUBREDDIT - same as specifying -s
To install, clone the repo and run `go install .`
| Clarify precedence of params vs env variables | Clarify precedence of params vs env variables | Markdown | mit | dambrisco/bored | markdown | ## Code Before:
Welcome to Bored, the world's premier termbox-based Reddit CLI. It has *numerous* features including keybinds, opening links in your browser, and even the ability to upvote and downvote links!
Speaking of keybinds:
h - help screen
q - quit
j - navigate/scroll down
k - navigate/scroll up
i - show submission info (only on list view)
r - refresh
f - front page
c - comments (currently just a self-text view)
l - open link url
y - copy link url
enter - open reddit permalink
Params:
-u username
-p password
-s subreddit (using this loads submissions from ONLY the given subreddit)
Environment variables to make your life easier:
BORED_USERNAME - same as specifying -u
BORED_PASSWORD - same as specifying -p
BORED_SUBREDDIT - same as specifying -s
To install, clone the repo and run `go install .`
## Instruction:
Clarify precedence of params vs env variables
## Code After:
Welcome to Bored, the world's premier termbox-based Reddit CLI. It has *numerous* features including keybinds, opening links in your browser, and even the ability to upvote and downvote links!
Speaking of keybinds:
h - help screen
q - quit
j - navigate/scroll down
k - navigate/scroll up
i - show submission info (only on list view)
r - refresh
f - front page
c - comments (currently just a self-text view)
l - open link url
y - copy link url
enter - open reddit permalink
Params (these override the environment variables below):
-u username
-p password
-s subreddit (using this loads submissions from ONLY the given subreddit)
Environment variables to make your life easier:
BORED_USERNAME - same as specifying -u
BORED_PASSWORD - same as specifying -p
BORED_SUBREDDIT - same as specifying -s
To install, clone the repo and run `go install .`
| Welcome to Bored, the world's premier termbox-based Reddit CLI. It has *numerous* features including keybinds, opening links in your browser, and even the ability to upvote and downvote links!
Speaking of keybinds:
h - help screen
q - quit
j - navigate/scroll down
k - navigate/scroll up
i - show submission info (only on list view)
r - refresh
f - front page
c - comments (currently just a self-text view)
l - open link url
y - copy link url
enter - open reddit permalink
- Params:
+ Params (these override the environment variables below):
-u username
-p password
-s subreddit (using this loads submissions from ONLY the given subreddit)
Environment variables to make your life easier:
BORED_USERNAME - same as specifying -u
BORED_PASSWORD - same as specifying -p
BORED_SUBREDDIT - same as specifying -s
To install, clone the repo and run `go install .` | 2 | 0.068966 | 1 | 1 |
94aa6fd2b867a2ebac13ef855650911ce9a953ca | lib/signed_form-activeadmin.rb | lib/signed_form-activeadmin.rb | module SignedForm
module ActiveAdmin
class Railtie < ::Rails::Railtie
initializer 'signed_form-activeadmin', after: :prepend_helpers_path do |_|
module ::ActiveAdmin
class BaseController
include SignedForm::ActionController::PermitSignedParams
end
if defined? Views::ActiveAdminForm
module Views
class ActiveAdminForm
alias_method :orig_build, :build
define_method :build do |resource, options = {}, &block|
options[:signed] = true
orig_build resource, options, &block
end
end
end
else
module ViewHelpers
module FormHelper
orig_active_admin_form_for = instance_method :active_admin_form_for
define_method :active_admin_form_for do |resource, options = {}, &block|
options[:signed] = true
orig_active_admin_form_for.bind(self).call resource, options, &block
end
end
end
end
end
module ::Formtastic
module Inputs
class BooleanInput
orig_check_box_html = instance_method :check_box_html
define_method :check_box_html do
builder.try :add_signed_fields, method
orig_check_box_html.bind(self).call
end
end
end
end
end
end
end
end
| module SignedForm
module ActiveAdmin
class Railtie < ::Rails::Railtie
initializer 'signed_form-activeadmin', after: :prepend_helpers_path do |_|
module ::ActiveAdmin
class BaseController
include SignedForm::ActionController::PermitSignedParams
end
if defined? Views::ActiveAdminForm
module Views
class ActiveAdminForm
alias_method :orig_build, :build
define_method :build do |resource, options = {}, &block|
options[:signed] = true
orig_build resource, options, &block
@opening_tag.gsub! /<input type="hidden" name="form_signature" value=".+" \/>\n/,
form_builder.form_signature_tag
end
end
end
else
module ViewHelpers
module FormHelper
orig_active_admin_form_for = instance_method :active_admin_form_for
define_method :active_admin_form_for do |resource, options = {}, &block|
options[:signed] = true
orig_active_admin_form_for.bind(self).call resource, options, &block
end
end
end
end
end
module ::Formtastic
module Inputs
class BooleanInput
orig_check_box_html = instance_method :check_box_html
define_method :check_box_html do
builder.try :add_signed_fields, method
orig_check_box_html.bind(self).call
end
end
end
end
end
end
end
end
| Fix integration with arbre-style active admin form tag | Fix integration with arbre-style active admin form tag
Fields are added after the form has been rendered, so the signature needs to be updated
| Ruby | mit | cschramm/signed_form-activeadmin | ruby | ## Code Before:
module SignedForm
module ActiveAdmin
class Railtie < ::Rails::Railtie
initializer 'signed_form-activeadmin', after: :prepend_helpers_path do |_|
module ::ActiveAdmin
class BaseController
include SignedForm::ActionController::PermitSignedParams
end
if defined? Views::ActiveAdminForm
module Views
class ActiveAdminForm
alias_method :orig_build, :build
define_method :build do |resource, options = {}, &block|
options[:signed] = true
orig_build resource, options, &block
end
end
end
else
module ViewHelpers
module FormHelper
orig_active_admin_form_for = instance_method :active_admin_form_for
define_method :active_admin_form_for do |resource, options = {}, &block|
options[:signed] = true
orig_active_admin_form_for.bind(self).call resource, options, &block
end
end
end
end
end
module ::Formtastic
module Inputs
class BooleanInput
orig_check_box_html = instance_method :check_box_html
define_method :check_box_html do
builder.try :add_signed_fields, method
orig_check_box_html.bind(self).call
end
end
end
end
end
end
end
end
## Instruction:
Fix integration with arbre-style active admin form tag
Fields are added after the form has been rendered, so the signature needs to be updated
## Code After:
module SignedForm
module ActiveAdmin
class Railtie < ::Rails::Railtie
initializer 'signed_form-activeadmin', after: :prepend_helpers_path do |_|
module ::ActiveAdmin
class BaseController
include SignedForm::ActionController::PermitSignedParams
end
if defined? Views::ActiveAdminForm
module Views
class ActiveAdminForm
alias_method :orig_build, :build
define_method :build do |resource, options = {}, &block|
options[:signed] = true
orig_build resource, options, &block
@opening_tag.gsub! /<input type="hidden" name="form_signature" value=".+" \/>\n/,
form_builder.form_signature_tag
end
end
end
else
module ViewHelpers
module FormHelper
orig_active_admin_form_for = instance_method :active_admin_form_for
define_method :active_admin_form_for do |resource, options = {}, &block|
options[:signed] = true
orig_active_admin_form_for.bind(self).call resource, options, &block
end
end
end
end
end
module ::Formtastic
module Inputs
class BooleanInput
orig_check_box_html = instance_method :check_box_html
define_method :check_box_html do
builder.try :add_signed_fields, method
orig_check_box_html.bind(self).call
end
end
end
end
end
end
end
end
| module SignedForm
module ActiveAdmin
class Railtie < ::Rails::Railtie
initializer 'signed_form-activeadmin', after: :prepend_helpers_path do |_|
module ::ActiveAdmin
class BaseController
include SignedForm::ActionController::PermitSignedParams
end
if defined? Views::ActiveAdminForm
module Views
class ActiveAdminForm
alias_method :orig_build, :build
define_method :build do |resource, options = {}, &block|
options[:signed] = true
orig_build resource, options, &block
+ @opening_tag.gsub! /<input type="hidden" name="form_signature" value=".+" \/>\n/,
+ form_builder.form_signature_tag
end
end
end
else
module ViewHelpers
module FormHelper
orig_active_admin_form_for = instance_method :active_admin_form_for
define_method :active_admin_form_for do |resource, options = {}, &block|
options[:signed] = true
orig_active_admin_form_for.bind(self).call resource, options, &block
end
end
end
end
end
module ::Formtastic
module Inputs
class BooleanInput
orig_check_box_html = instance_method :check_box_html
define_method :check_box_html do
builder.try :add_signed_fields, method
orig_check_box_html.bind(self).call
end
end
end
end
end
end
end
end | 2 | 0.04 | 2 | 0 |
321d8a012539dadc4169dd6305aeafdaa66b5424 | src/schema/MemberRef.ts | src/schema/MemberRef.ts | // This file is part of cxsd, copyright (c) 2016 BusFaster Ltd.
// Released under the MIT license, see LICENSE.
import {Namespace} from './Namespace';
import {Member} from './Member';
import {Type} from './Type';
export class MemberRef {
constructor(member: Member, min: number, max: number) {
this.member = member;
this.min = min;
this.max = max;
}
member: Member;
min: number;
max: number;
safeName: string;
prefix: string;
static optionalFlag = 1;
static arrayFlag = 2;
}
| // This file is part of cxsd, copyright (c) 2016 BusFaster Ltd.
// Released under the MIT license, see LICENSE.
import * as cxml from 'cxml';
import {Member} from './Member';
export class MemberRef extends cxml.MemberRefBase<Member> {
prefix: string;
}
| Use member reference base class from cxml. | Use member reference base class from cxml.
| TypeScript | mit | charto/cxsd,charto/fast-xml,charto/fast-xml,charto/cxsd | typescript | ## Code Before:
// This file is part of cxsd, copyright (c) 2016 BusFaster Ltd.
// Released under the MIT license, see LICENSE.
import {Namespace} from './Namespace';
import {Member} from './Member';
import {Type} from './Type';
export class MemberRef {
constructor(member: Member, min: number, max: number) {
this.member = member;
this.min = min;
this.max = max;
}
member: Member;
min: number;
max: number;
safeName: string;
prefix: string;
static optionalFlag = 1;
static arrayFlag = 2;
}
## Instruction:
Use member reference base class from cxml.
## Code After:
// This file is part of cxsd, copyright (c) 2016 BusFaster Ltd.
// Released under the MIT license, see LICENSE.
import * as cxml from 'cxml';
import {Member} from './Member';
export class MemberRef extends cxml.MemberRefBase<Member> {
prefix: string;
}
| // This file is part of cxsd, copyright (c) 2016 BusFaster Ltd.
// Released under the MIT license, see LICENSE.
- import {Namespace} from './Namespace';
+ import * as cxml from 'cxml';
+
import {Member} from './Member';
- import {Type} from './Type';
+ export class MemberRef extends cxml.MemberRefBase<Member> {
- export class MemberRef {
- constructor(member: Member, min: number, max: number) {
- this.member = member;
- this.min = min;
- this.max = max;
- }
-
- member: Member;
- min: number;
- max: number;
-
- safeName: string;
prefix: string;
-
- static optionalFlag = 1;
- static arrayFlag = 2;
} | 20 | 0.833333 | 3 | 17 |
02fb70be272769de3a781c47cfaa7e698f4c489c | app/assets/stylesheets/itsf/backend/application/ace.css.less | app/assets/stylesheets/itsf/backend/application/ace.css.less | pre[data-add-editor="true"], textarea[data-add-editor="true"] {}
.editor {
width: 100%;
min-height: 600px;
}
textarea[data-add-editor="false"] {
min-height: 50em;
}
| pre[data-add-editor="true"], textarea[data-add-editor="true"] {}
.editor {
width: 100%;
min-height: 600px;
}
textarea[data-add-editor="false"] {
min-height: 50em;
font-family: monospace;
}
| Set editor textbox font to monospace. | Set editor textbox font to monospace.
| Less | mit | robotex82/itsf_backend,robotex82/itsf_backend,robotex82/itsf_backend | less | ## Code Before:
pre[data-add-editor="true"], textarea[data-add-editor="true"] {}
.editor {
width: 100%;
min-height: 600px;
}
textarea[data-add-editor="false"] {
min-height: 50em;
}
## Instruction:
Set editor textbox font to monospace.
## Code After:
pre[data-add-editor="true"], textarea[data-add-editor="true"] {}
.editor {
width: 100%;
min-height: 600px;
}
textarea[data-add-editor="false"] {
min-height: 50em;
font-family: monospace;
}
| pre[data-add-editor="true"], textarea[data-add-editor="true"] {}
.editor {
width: 100%;
min-height: 600px;
}
textarea[data-add-editor="false"] {
min-height: 50em;
+ font-family: monospace;
} | 1 | 0.1 | 1 | 0 |
2b1ec8a5dbeeb8e978a577ecf91227aaf9a5c83a | install_sublime.sh | install_sublime.sh |
cd /tmp
mkdir sublime
cd sublime
wget http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.1%20x64.tar.bz2
tar xzf *
rm *
mv * sublime_text
sudo mv * /opt -r
cd ..
rm -rf sublime
sudo ln -s /usr/bin/subl /opt/sublime_text/sublime_text
subl &
sleep 2
killall subl
cd ~/.config/sublime-text-2/Packages/User/
rm *
git init
git remote add origin git@github.com:tylermenezes/Sublime-Text-Settings.git
git pull origin master
|
cd /tmp
mkdir sublime
cd sublime
wget http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.1%20x64.tar.bz2
tar xzf *
rm *
mv * sublime_text
sudo mv * /opt -r
cd ..
rm -rf sublime
sudo ln -s /usr/bin/subl /opt/sublime_text/sublime_text
subl &
sleep 2
killall subl
cd ~/.config/sublime-text-2/Packages/User/
rm *
git init
git remote add origin git@github.com:tylermenezes/Sublime-Text-Settings.git
git pull origin master
cat << 'EOF' > "~/.local/share/applications/Sublime Text 2.desktop"
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Name=Sublime Text 2
Comment=Edit text files using Sublime Text 2
Exec=subl %u
Terminal=false
Icon="/opt/sublime_text/Icon/48x48/sublime_text.png"
Type=Application
Categories=TextEditor;IDE;Development;Application;Utility
X-Ayatana-Desktop-Shortcuts=NewWindow
Icon[en_US]=/opt/sublime_text/Icon/128x128/sublime_text.png
Encoding=UTF-8
StartupNotify=true
MimeType=text/plain;
[NewWindow Shortcut Group]
Name=New Window
Exec=subl -n
TargetEnvironment=Unity
EOF;
| Add .desktop file for Sublime | Add .desktop file for Sublime
| Shell | artistic-2.0 | tylermenezes/Debian-Settings | shell | ## Code Before:
cd /tmp
mkdir sublime
cd sublime
wget http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.1%20x64.tar.bz2
tar xzf *
rm *
mv * sublime_text
sudo mv * /opt -r
cd ..
rm -rf sublime
sudo ln -s /usr/bin/subl /opt/sublime_text/sublime_text
subl &
sleep 2
killall subl
cd ~/.config/sublime-text-2/Packages/User/
rm *
git init
git remote add origin git@github.com:tylermenezes/Sublime-Text-Settings.git
git pull origin master
## Instruction:
Add .desktop file for Sublime
## Code After:
cd /tmp
mkdir sublime
cd sublime
wget http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.1%20x64.tar.bz2
tar xzf *
rm *
mv * sublime_text
sudo mv * /opt -r
cd ..
rm -rf sublime
sudo ln -s /usr/bin/subl /opt/sublime_text/sublime_text
subl &
sleep 2
killall subl
cd ~/.config/sublime-text-2/Packages/User/
rm *
git init
git remote add origin git@github.com:tylermenezes/Sublime-Text-Settings.git
git pull origin master
cat << 'EOF' > "~/.local/share/applications/Sublime Text 2.desktop"
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Name=Sublime Text 2
Comment=Edit text files using Sublime Text 2
Exec=subl %u
Terminal=false
Icon="/opt/sublime_text/Icon/48x48/sublime_text.png"
Type=Application
Categories=TextEditor;IDE;Development;Application;Utility
X-Ayatana-Desktop-Shortcuts=NewWindow
Icon[en_US]=/opt/sublime_text/Icon/128x128/sublime_text.png
Encoding=UTF-8
StartupNotify=true
MimeType=text/plain;
[NewWindow Shortcut Group]
Name=New Window
Exec=subl -n
TargetEnvironment=Unity
EOF;
|
cd /tmp
mkdir sublime
cd sublime
wget http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.1%20x64.tar.bz2
tar xzf *
rm *
mv * sublime_text
sudo mv * /opt -r
cd ..
rm -rf sublime
sudo ln -s /usr/bin/subl /opt/sublime_text/sublime_text
subl &
sleep 2
killall subl
cd ~/.config/sublime-text-2/Packages/User/
rm *
git init
git remote add origin git@github.com:tylermenezes/Sublime-Text-Settings.git
git pull origin master
+
+
+
+ cat << 'EOF' > "~/.local/share/applications/Sublime Text 2.desktop"
+ #!/usr/bin/env xdg-open
+
+ [Desktop Entry]
+ Version=1.0
+ Name=Sublime Text 2
+ Comment=Edit text files using Sublime Text 2
+ Exec=subl %u
+ Terminal=false
+ Icon="/opt/sublime_text/Icon/48x48/sublime_text.png"
+ Type=Application
+ Categories=TextEditor;IDE;Development;Application;Utility
+ X-Ayatana-Desktop-Shortcuts=NewWindow
+ Icon[en_US]=/opt/sublime_text/Icon/128x128/sublime_text.png
+ Encoding=UTF-8
+ StartupNotify=true
+ MimeType=text/plain;
+
+
+ [NewWindow Shortcut Group]
+ Name=New Window
+ Exec=subl -n
+ TargetEnvironment=Unity
+ EOF; | 27 | 1.227273 | 27 | 0 |
fef80d4bc8cb0a9c6c6487f2b0f023b38f051f08 | .travis.yml | .travis.yml | sudo: false
language: php
php:
- 5.6
- 7.0
- 7.1
env:
- LARAVEL_VERSION=5.5.* PHPUNIT_VERSION=~6.0
- LARAVEL_VERSION=5.4.* PHPUNIT_VERSION=~5.7
- LARAVEL_VERSION=5.3.* PHPUNIT_VERSION=~5.7
before_script:
- composer self-update
- composer require "laravel/framework:${LARAVEL_VERSION}" "phpunit/phpunit:${PHPUNIT_VERSION}"
- mysql -e 'create database laravel;'
script: vendor/bin/phpunit --coverage-clover coverage.xml
after_success:
- php vendor/bin/coveralls
matrix:
fast_finish: true
exclude:
- php: 5.6
env: LARAVEL_VERSION=5.5.* PHPUNIT_VERSION=~6.0 | sudo: false
language: php
php:
- 7.2
- 7.1
- 7.0
- 5.6
env:
- LARAVEL_VERSION=5.6.* PHPUNIT_VERSION=~7.0
- LARAVEL_VERSION=5.5.* PHPUNIT_VERSION=~6.0
- LARAVEL_VERSION=5.4.* PHPUNIT_VERSION=~5.7
- LARAVEL_VERSION=5.3.* PHPUNIT_VERSION=~5.7
before_script:
- composer self-update
- composer require "laravel/framework:${LARAVEL_VERSION}" "phpunit/phpunit:${PHPUNIT_VERSION}"
- mysql -e 'create database laravel;'
script: vendor/bin/phpunit --coverage-clover coverage.xml
after_success:
- php vendor/bin/coveralls
matrix:
fast_finish: true
exclude:
- php: 5.6
env: LARAVEL_VERSION=5.5.* PHPUNIT_VERSION=~6.0
- php: 5.6
env: LARAVEL_VERSION=5.6.* PHPUNIT_VERSION=~7.0
| Test PHP 7.2 and Laravel 5.6 | Test PHP 7.2 and Laravel 5.6
| YAML | mit | aimeos/aimeos-laravel | yaml | ## Code Before:
sudo: false
language: php
php:
- 5.6
- 7.0
- 7.1
env:
- LARAVEL_VERSION=5.5.* PHPUNIT_VERSION=~6.0
- LARAVEL_VERSION=5.4.* PHPUNIT_VERSION=~5.7
- LARAVEL_VERSION=5.3.* PHPUNIT_VERSION=~5.7
before_script:
- composer self-update
- composer require "laravel/framework:${LARAVEL_VERSION}" "phpunit/phpunit:${PHPUNIT_VERSION}"
- mysql -e 'create database laravel;'
script: vendor/bin/phpunit --coverage-clover coverage.xml
after_success:
- php vendor/bin/coveralls
matrix:
fast_finish: true
exclude:
- php: 5.6
env: LARAVEL_VERSION=5.5.* PHPUNIT_VERSION=~6.0
## Instruction:
Test PHP 7.2 and Laravel 5.6
## Code After:
sudo: false
language: php
php:
- 7.2
- 7.1
- 7.0
- 5.6
env:
- LARAVEL_VERSION=5.6.* PHPUNIT_VERSION=~7.0
- LARAVEL_VERSION=5.5.* PHPUNIT_VERSION=~6.0
- LARAVEL_VERSION=5.4.* PHPUNIT_VERSION=~5.7
- LARAVEL_VERSION=5.3.* PHPUNIT_VERSION=~5.7
before_script:
- composer self-update
- composer require "laravel/framework:${LARAVEL_VERSION}" "phpunit/phpunit:${PHPUNIT_VERSION}"
- mysql -e 'create database laravel;'
script: vendor/bin/phpunit --coverage-clover coverage.xml
after_success:
- php vendor/bin/coveralls
matrix:
fast_finish: true
exclude:
- php: 5.6
env: LARAVEL_VERSION=5.5.* PHPUNIT_VERSION=~6.0
- php: 5.6
env: LARAVEL_VERSION=5.6.* PHPUNIT_VERSION=~7.0
| sudo: false
language: php
php:
+ - 7.2
+ - 7.1
+ - 7.0
- 5.6
- - 7.0
- - 7.1
env:
+ - LARAVEL_VERSION=5.6.* PHPUNIT_VERSION=~7.0
- LARAVEL_VERSION=5.5.* PHPUNIT_VERSION=~6.0
- LARAVEL_VERSION=5.4.* PHPUNIT_VERSION=~5.7
- LARAVEL_VERSION=5.3.* PHPUNIT_VERSION=~5.7
before_script:
- composer self-update
- composer require "laravel/framework:${LARAVEL_VERSION}" "phpunit/phpunit:${PHPUNIT_VERSION}"
- mysql -e 'create database laravel;'
script: vendor/bin/phpunit --coverage-clover coverage.xml
after_success:
- php vendor/bin/coveralls
matrix:
fast_finish: true
exclude:
- php: 5.6
env: LARAVEL_VERSION=5.5.* PHPUNIT_VERSION=~6.0
+ - php: 5.6
+ env: LARAVEL_VERSION=5.6.* PHPUNIT_VERSION=~7.0 | 8 | 0.285714 | 6 | 2 |
72044069f8537191433b08d2a7df8584b046f73b | Kwf/Util/Hash.php | Kwf/Util/Hash.php | <?php
class Kwf_Util_Hash
{
public static function hash($str)
{
$salt = Kwf_Cache_SimpleStatic::fetch('hashpp-');
if (!$salt) {
if ($salt = Kwf_Config::getValue('hashPrivatePart')) {
//defined in config, required if multiple webservers should share the same salt
} else {
$hashFile = 'cache/hashprivatepart';
if (!file_exists($hashFile)) {
file_put_contents($hashFile, time().rand(100000, 1000000));
}
$salt = file_get_contents($hashFile);
Kwf_Cache_SimpleStatic::add('hashpp-', $salt);
}
}
return md5($salt.$str);
}
}
| <?php
class Kwf_Util_Hash
{
public static function getPrivatePart()
{
$salt = Kwf_Cache_SimpleStatic::fetch('hashpp-');
if (!$salt) {
if ($salt = Kwf_Config::getValue('hashPrivatePart')) {
//defined in config, required if multiple webservers should share the same salt
} else {
$hashFile = 'cache/hashprivatepart';
if (!file_exists($hashFile)) {
file_put_contents($hashFile, time().rand(100000, 1000000));
}
$salt = file_get_contents($hashFile);
Kwf_Cache_SimpleStatic::add('hashpp-', $salt);
}
}
return $salt;
}
public static function hash($str)
{
return md5(self::getPrivatePart().$str);
}
}
| Add public method for getting private hash part | Add public method for getting private hash part
| PHP | bsd-2-clause | koala-framework/koala-framework,koala-framework/koala-framework | php | ## Code Before:
<?php
class Kwf_Util_Hash
{
public static function hash($str)
{
$salt = Kwf_Cache_SimpleStatic::fetch('hashpp-');
if (!$salt) {
if ($salt = Kwf_Config::getValue('hashPrivatePart')) {
//defined in config, required if multiple webservers should share the same salt
} else {
$hashFile = 'cache/hashprivatepart';
if (!file_exists($hashFile)) {
file_put_contents($hashFile, time().rand(100000, 1000000));
}
$salt = file_get_contents($hashFile);
Kwf_Cache_SimpleStatic::add('hashpp-', $salt);
}
}
return md5($salt.$str);
}
}
## Instruction:
Add public method for getting private hash part
## Code After:
<?php
class Kwf_Util_Hash
{
public static function getPrivatePart()
{
$salt = Kwf_Cache_SimpleStatic::fetch('hashpp-');
if (!$salt) {
if ($salt = Kwf_Config::getValue('hashPrivatePart')) {
//defined in config, required if multiple webservers should share the same salt
} else {
$hashFile = 'cache/hashprivatepart';
if (!file_exists($hashFile)) {
file_put_contents($hashFile, time().rand(100000, 1000000));
}
$salt = file_get_contents($hashFile);
Kwf_Cache_SimpleStatic::add('hashpp-', $salt);
}
}
return $salt;
}
public static function hash($str)
{
return md5(self::getPrivatePart().$str);
}
}
| <?php
class Kwf_Util_Hash
{
- public static function hash($str)
? ^ ^^ ----
+ public static function getPrivatePart()
? ^^^^^^^ ^^^^^^
{
$salt = Kwf_Cache_SimpleStatic::fetch('hashpp-');
if (!$salt) {
if ($salt = Kwf_Config::getValue('hashPrivatePart')) {
//defined in config, required if multiple webservers should share the same salt
} else {
$hashFile = 'cache/hashprivatepart';
if (!file_exists($hashFile)) {
file_put_contents($hashFile, time().rand(100000, 1000000));
}
$salt = file_get_contents($hashFile);
Kwf_Cache_SimpleStatic::add('hashpp-', $salt);
}
}
- return md5($salt.$str);
? ---- ------
+ return $salt;
+ }
+
+ public static function hash($str)
+ {
+ return md5(self::getPrivatePart().$str);
}
} | 9 | 0.428571 | 7 | 2 |
1dd81a5583b7fef27bf3ad084be0c628a78b85a1 | sources/us/pa/perry.json | sources/us/pa/perry.json | {
"coverage": {
"US Census": {
"geoid": "42099",
"name": "Perry County",
"state": "Pennsylvania"
},
"country": "us",
"state": "pa",
"county": "Perry"
},
"data": "http://gis.perryco.org/ArcGIS/rest/services/PerryBaseMap/MapServer/0",
"protocol": "ESRI",
"conform": {
"format": "geojson",
"number": "SAN",
"street": [
"PRD",
"STN",
"STS",
"POD"
],
"city": "MCN"
}
}
| {
"coverage": {
"US Census": {
"geoid": "42099",
"name": "Perry County",
"state": "Pennsylvania"
},
"country": "us",
"state": "pa",
"county": "Perry"
},
"contact": {
"name": "David Unger",
"phone": "717-582-2131",
"email": "dunger@perryco.org",
"address": "2 East Main St., New Bloomfield, PA 17068"
},
"website": "http://www.perryco.org/Dept/GIS/Pages/GIS.aspx",
"data": "http://gis.perryco.org/ArcGIS/rest/services/PerryBaseMap/MapServer/0",
"protocol": "ESRI",
"conform": {
"format": "geojson",
"number": "SAN",
"street": [
"PRD",
"STN",
"STS",
"POD"
],
"addrtype": "BUILDTYP"
}
}
| Update information for Perry County, Pennsylvania. | Update information for Perry County, Pennsylvania.
- add contact information
- add website
- update data field information
| JSON | bsd-3-clause | openaddresses/openaddresses,openaddresses/openaddresses,openaddresses/openaddresses,orangejulius/openaddresses,orangejulius/openaddresses,orangejulius/openaddresses | json | ## Code Before:
{
"coverage": {
"US Census": {
"geoid": "42099",
"name": "Perry County",
"state": "Pennsylvania"
},
"country": "us",
"state": "pa",
"county": "Perry"
},
"data": "http://gis.perryco.org/ArcGIS/rest/services/PerryBaseMap/MapServer/0",
"protocol": "ESRI",
"conform": {
"format": "geojson",
"number": "SAN",
"street": [
"PRD",
"STN",
"STS",
"POD"
],
"city": "MCN"
}
}
## Instruction:
Update information for Perry County, Pennsylvania.
- add contact information
- add website
- update data field information
## Code After:
{
"coverage": {
"US Census": {
"geoid": "42099",
"name": "Perry County",
"state": "Pennsylvania"
},
"country": "us",
"state": "pa",
"county": "Perry"
},
"contact": {
"name": "David Unger",
"phone": "717-582-2131",
"email": "dunger@perryco.org",
"address": "2 East Main St., New Bloomfield, PA 17068"
},
"website": "http://www.perryco.org/Dept/GIS/Pages/GIS.aspx",
"data": "http://gis.perryco.org/ArcGIS/rest/services/PerryBaseMap/MapServer/0",
"protocol": "ESRI",
"conform": {
"format": "geojson",
"number": "SAN",
"street": [
"PRD",
"STN",
"STS",
"POD"
],
"addrtype": "BUILDTYP"
}
}
| {
"coverage": {
"US Census": {
"geoid": "42099",
"name": "Perry County",
"state": "Pennsylvania"
},
"country": "us",
"state": "pa",
"county": "Perry"
},
+ "contact": {
+ "name": "David Unger",
+ "phone": "717-582-2131",
+ "email": "dunger@perryco.org",
+ "address": "2 East Main St., New Bloomfield, PA 17068"
+ },
+ "website": "http://www.perryco.org/Dept/GIS/Pages/GIS.aspx",
"data": "http://gis.perryco.org/ArcGIS/rest/services/PerryBaseMap/MapServer/0",
"protocol": "ESRI",
"conform": {
"format": "geojson",
"number": "SAN",
"street": [
"PRD",
"STN",
"STS",
"POD"
- ],
- "city": "MCN"
+ ],
+ "addrtype": "BUILDTYP"
}
} | 11 | 0.44 | 9 | 2 |
f62b651f081de29cbb736f52c3258019cb042d02 | controls/UC/ApplicationWindow.qml | controls/UC/ApplicationWindow.qml | import QtQuick.Controls 1.0
ApplicationWindow {
id : appWindow
// for now, we are in landscape when using Controls
property bool inPortrait : appWindow.width < appWindow.height
//property bool inPortrait : false
//property alias initialPage : pageStack.initialItem
property alias pageStack : pageStack
StackView {
anchors.fill : parent
id : pageStack
}
function pushPage(pageInstance, pageProperties, animate) {
pageStack.push(pageInstance, pageProperties, animate)
return pageInstance
}
} | import QtQuick.Controls 1.0
ApplicationWindow {
id : appWindow
// for now, we are in landscape when using Controls
property bool inPortrait : appWindow.width < appWindow.height
//property bool inPortrait : false
//property alias initialPage : pageStack.initialItem
property alias pageStack : pageStack
StackView {
anchors.fill : parent
id : pageStack
}
function pushPage(pageInstance, pageProperties, animate) {
// the Controls page stack disables animations when
// false is passed as the third argument, but we want to
// have a more logical interface, so just invert the value
// before passing it to the page stack
pageStack.push(pageInstance, pageProperties, !animate)
return pageInstance
}
} | Fix the animate argument semantics | Fix the animate argument semantics
If animate is true - use animated page transition,
if animate is false - do an immediate page transition.
| QML | bsd-3-clause | M4rtinK/universal-components,M4rtinK/universal-components | qml | ## Code Before:
import QtQuick.Controls 1.0
ApplicationWindow {
id : appWindow
// for now, we are in landscape when using Controls
property bool inPortrait : appWindow.width < appWindow.height
//property bool inPortrait : false
//property alias initialPage : pageStack.initialItem
property alias pageStack : pageStack
StackView {
anchors.fill : parent
id : pageStack
}
function pushPage(pageInstance, pageProperties, animate) {
pageStack.push(pageInstance, pageProperties, animate)
return pageInstance
}
}
## Instruction:
Fix the animate argument semantics
If animate is true - use animated page transition,
if animate is false - do an immediate page transition.
## Code After:
import QtQuick.Controls 1.0
ApplicationWindow {
id : appWindow
// for now, we are in landscape when using Controls
property bool inPortrait : appWindow.width < appWindow.height
//property bool inPortrait : false
//property alias initialPage : pageStack.initialItem
property alias pageStack : pageStack
StackView {
anchors.fill : parent
id : pageStack
}
function pushPage(pageInstance, pageProperties, animate) {
// the Controls page stack disables animations when
// false is passed as the third argument, but we want to
// have a more logical interface, so just invert the value
// before passing it to the page stack
pageStack.push(pageInstance, pageProperties, !animate)
return pageInstance
}
} | import QtQuick.Controls 1.0
ApplicationWindow {
id : appWindow
// for now, we are in landscape when using Controls
property bool inPortrait : appWindow.width < appWindow.height
//property bool inPortrait : false
//property alias initialPage : pageStack.initialItem
property alias pageStack : pageStack
StackView {
anchors.fill : parent
id : pageStack
}
function pushPage(pageInstance, pageProperties, animate) {
+ // the Controls page stack disables animations when
+ // false is passed as the third argument, but we want to
+ // have a more logical interface, so just invert the value
+ // before passing it to the page stack
- pageStack.push(pageInstance, pageProperties, animate)
+ pageStack.push(pageInstance, pageProperties, !animate)
? +
return pageInstance
}
} | 6 | 0.285714 | 5 | 1 |
2ca2a8144d19b46da40a24932471f8ea5f6c9c72 | signature.js | signature.js | // source:
var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m;
var FN_ARG_SPLIT = /,/;
var FN_ARG = /^\s*(_?)(\S+?)\1\s*$/;
var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
var SIGNATURE = '__signature_' + require('hat')();
exports.parse = parse;
function parse (fn) {
if (typeof fn !== 'function') {
throw new TypeError("Not a function: " + fn);
}
if (!fn[SIGNATURE]) {
fn[SIGNATURE] = _parse(fn);
}
return fn[SIGNATURE];
}
exports.clobber = clobber;
function clobber (fn, names) {
fn[SIGNATURE] = names;
return fn;
}
exports.copy = copy;
function copy (fromFn, toFn) {
toFn[SIGNATURE] = fromFn[SIGNATURE] || _parse(fromFn);
return toFn;
}
/**
* This code is adapted from the AngularJS v1 dependency injector
*/
function _parse (fn) {
var fnText = fn.toString().replace(STRIP_COMMENTS, '');
var argDecl = fnText.match(FN_ARGS);
return argDecl[1].split(FN_ARG_SPLIT).map(function(arg){
return arg.replace(FN_ARG, function(all, underscore, name){
return name;
});
}).filter(Boolean);
}
| var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m;
var FN_ARG_SPLIT = /,/;
var FN_ARG = /^\s*(_?)(\S+?)\1\s*$/;
var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
var SIGNATURE = '__signature_' + require('hat')();
exports.parse = parse;
function parse (fn) {
if (typeof fn !== 'function') {
throw new TypeError("Not a function: " + fn);
}
if (!fn[SIGNATURE]) {
fn[SIGNATURE] = _parse(fn);
}
return fn[SIGNATURE];
}
exports.clobber = clobber;
function clobber (fn, names) {
fn[SIGNATURE] = names;
return fn;
}
exports.copy = copy;
function copy (fromFn, toFn) {
toFn[SIGNATURE] = fromFn[SIGNATURE] || _parse(fromFn);
return toFn;
}
/**
* This code is adapted from the AngularJS v1 dependency injector
*/
function _parse (fn) {
var fnText = fn.toString().replace(STRIP_COMMENTS, '');
var argDecl = fnText.match(FN_ARGS);
return argDecl[1].split(FN_ARG_SPLIT).map(function(arg){
return arg.replace(FN_ARG, function(all, underscore, name){
return name;
});
}).filter(Boolean);
}
| Remove noisy & pointless comment | Remove noisy & pointless comment
| JavaScript | mit | grncdr/js-pockets | javascript | ## Code Before:
// source:
var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m;
var FN_ARG_SPLIT = /,/;
var FN_ARG = /^\s*(_?)(\S+?)\1\s*$/;
var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
var SIGNATURE = '__signature_' + require('hat')();
exports.parse = parse;
function parse (fn) {
if (typeof fn !== 'function') {
throw new TypeError("Not a function: " + fn);
}
if (!fn[SIGNATURE]) {
fn[SIGNATURE] = _parse(fn);
}
return fn[SIGNATURE];
}
exports.clobber = clobber;
function clobber (fn, names) {
fn[SIGNATURE] = names;
return fn;
}
exports.copy = copy;
function copy (fromFn, toFn) {
toFn[SIGNATURE] = fromFn[SIGNATURE] || _parse(fromFn);
return toFn;
}
/**
* This code is adapted from the AngularJS v1 dependency injector
*/
function _parse (fn) {
var fnText = fn.toString().replace(STRIP_COMMENTS, '');
var argDecl = fnText.match(FN_ARGS);
return argDecl[1].split(FN_ARG_SPLIT).map(function(arg){
return arg.replace(FN_ARG, function(all, underscore, name){
return name;
});
}).filter(Boolean);
}
## Instruction:
Remove noisy & pointless comment
## Code After:
var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m;
var FN_ARG_SPLIT = /,/;
var FN_ARG = /^\s*(_?)(\S+?)\1\s*$/;
var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
var SIGNATURE = '__signature_' + require('hat')();
exports.parse = parse;
function parse (fn) {
if (typeof fn !== 'function') {
throw new TypeError("Not a function: " + fn);
}
if (!fn[SIGNATURE]) {
fn[SIGNATURE] = _parse(fn);
}
return fn[SIGNATURE];
}
exports.clobber = clobber;
function clobber (fn, names) {
fn[SIGNATURE] = names;
return fn;
}
exports.copy = copy;
function copy (fromFn, toFn) {
toFn[SIGNATURE] = fromFn[SIGNATURE] || _parse(fromFn);
return toFn;
}
/**
* This code is adapted from the AngularJS v1 dependency injector
*/
function _parse (fn) {
var fnText = fn.toString().replace(STRIP_COMMENTS, '');
var argDecl = fnText.match(FN_ARGS);
return argDecl[1].split(FN_ARG_SPLIT).map(function(arg){
return arg.replace(FN_ARG, function(all, underscore, name){
return name;
});
}).filter(Boolean);
}
| - // source:
var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m;
var FN_ARG_SPLIT = /,/;
var FN_ARG = /^\s*(_?)(\S+?)\1\s*$/;
var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
var SIGNATURE = '__signature_' + require('hat')();
exports.parse = parse;
function parse (fn) {
if (typeof fn !== 'function') {
throw new TypeError("Not a function: " + fn);
}
if (!fn[SIGNATURE]) {
fn[SIGNATURE] = _parse(fn);
}
return fn[SIGNATURE];
}
exports.clobber = clobber;
function clobber (fn, names) {
fn[SIGNATURE] = names;
return fn;
}
exports.copy = copy;
function copy (fromFn, toFn) {
toFn[SIGNATURE] = fromFn[SIGNATURE] || _parse(fromFn);
return toFn;
}
/**
* This code is adapted from the AngularJS v1 dependency injector
*/
function _parse (fn) {
var fnText = fn.toString().replace(STRIP_COMMENTS, '');
var argDecl = fnText.match(FN_ARGS);
return argDecl[1].split(FN_ARG_SPLIT).map(function(arg){
return arg.replace(FN_ARG, function(all, underscore, name){
return name;
});
}).filter(Boolean);
} | 1 | 0.02381 | 0 | 1 |
c6679bc02adb6065478dd8d734cf5fe9442efb86 | .travis.yml | .travis.yml | language: node_js
node_js:
- '0.10'
- '0.12'
- 'iojs'
after_script:
- npm install coveralls && cat ./coverage/lcov.info | coveralls
| language: node_js
sudo: false
node_js:
- '0.10'
- '0.12'
- 'iojs'
- '4'
after_script:
- npm install coveralls && cat ./coverage/lcov.info | coveralls
| Add NodeJS v4 to Travis | Add NodeJS v4 to Travis
| YAML | mit | ghaiklor/sails-service-location | yaml | ## Code Before:
language: node_js
node_js:
- '0.10'
- '0.12'
- 'iojs'
after_script:
- npm install coveralls && cat ./coverage/lcov.info | coveralls
## Instruction:
Add NodeJS v4 to Travis
## Code After:
language: node_js
sudo: false
node_js:
- '0.10'
- '0.12'
- 'iojs'
- '4'
after_script:
- npm install coveralls && cat ./coverage/lcov.info | coveralls
| language: node_js
+ sudo: false
node_js:
- '0.10'
- '0.12'
- 'iojs'
+ - '4'
after_script:
- npm install coveralls && cat ./coverage/lcov.info | coveralls | 2 | 0.285714 | 2 | 0 |
8b70132f0ffbd3e216db72597640274169be7fae | README.md | README.md |
[](https://github.com/arashmanteghi/webpack-react-css-modules/)
This repository is a boilerplate for writing [CSS Modules](https://github.com/css-modules/css-modules) in [React](https://facebook.github.io/react/) components.
## 🔥 How to use
First, you should clone the repo and install the dependencies.
```bash
$ git clone git@github.com:arashmanteghi/webpack-react-css-modules.git <projectName>
$ cd <projectName>
$ [sudo] npm install
```
After install dependencies, you can lunch demo.
For development:
```bash
$ npm run develop
```
You should see the demo on a new browser tap in `http://127.0.0.1:8090` or `http://localhost:8090`.
For distribution:
```bash
$ npm run build
```
## License
Copyright (c) 2016 @arashmanteghi. Licensed under [MIT](http://mit-license.org).
|
This repository is a boilerplate for writing [CSS Modules](https://github.com/css-modules/css-modules) in [React](https://facebook.github.io/react/) components.
## How to use
First, you should clone the repo and install the dependencies.
```bash
$ git clone https://github.com/arashmanteghi/webpack-react-css-modules.git <projectName>
$ cd <projectName>
$ [sudo] npm install
```
After install dependencies, you can lunch demo.
For development:
```bash
$ npm run develop
```
You should see the demo on a new browser tap in `http://127.0.0.1:8090` or `http://localhost:8090`.
For distribution:
```bash
$ npm run build
```
## License
Copyright (c) 2016 @arashmanteghi. Licensed under [MIT](http://mit-license.org).
| Remove react logo from readme file | Remove react logo from readme file
| Markdown | mit | arashmanteghi/webpack-react-css-modules,arashmanteghi/webpack-react-css-modules | markdown | ## Code Before:
[](https://github.com/arashmanteghi/webpack-react-css-modules/)
This repository is a boilerplate for writing [CSS Modules](https://github.com/css-modules/css-modules) in [React](https://facebook.github.io/react/) components.
## 🔥 How to use
First, you should clone the repo and install the dependencies.
```bash
$ git clone git@github.com:arashmanteghi/webpack-react-css-modules.git <projectName>
$ cd <projectName>
$ [sudo] npm install
```
After install dependencies, you can lunch demo.
For development:
```bash
$ npm run develop
```
You should see the demo on a new browser tap in `http://127.0.0.1:8090` or `http://localhost:8090`.
For distribution:
```bash
$ npm run build
```
## License
Copyright (c) 2016 @arashmanteghi. Licensed under [MIT](http://mit-license.org).
## Instruction:
Remove react logo from readme file
## Code After:
This repository is a boilerplate for writing [CSS Modules](https://github.com/css-modules/css-modules) in [React](https://facebook.github.io/react/) components.
## How to use
First, you should clone the repo and install the dependencies.
```bash
$ git clone https://github.com/arashmanteghi/webpack-react-css-modules.git <projectName>
$ cd <projectName>
$ [sudo] npm install
```
After install dependencies, you can lunch demo.
For development:
```bash
$ npm run develop
```
You should see the demo on a new browser tap in `http://127.0.0.1:8090` or `http://localhost:8090`.
For distribution:
```bash
$ npm run build
```
## License
Copyright (c) 2016 @arashmanteghi. Licensed under [MIT](http://mit-license.org).
| -
- [](https://github.com/arashmanteghi/webpack-react-css-modules/)
This repository is a boilerplate for writing [CSS Modules](https://github.com/css-modules/css-modules) in [React](https://facebook.github.io/react/) components.
- ## 🔥 How to use
? --
+ ## How to use
First, you should clone the repo and install the dependencies.
```bash
- $ git clone git@github.com:arashmanteghi/webpack-react-css-modules.git <projectName>
? ^^ ^ ^
+ $ git clone https://github.com/arashmanteghi/webpack-react-css-modules.git <projectName>
? ^ ^^^^^^ ^
$ cd <projectName>
$ [sudo] npm install
```
After install dependencies, you can lunch demo.
For development:
```bash
$ npm run develop
```
You should see the demo on a new browser tap in `http://127.0.0.1:8090` or `http://localhost:8090`.
For distribution:
```bash
$ npm run build
```
## License
Copyright (c) 2016 @arashmanteghi. Licensed under [MIT](http://mit-license.org). | 6 | 0.2 | 2 | 4 |
2093a3cf6f283c24fccb97b80edbdd27886e4f25 | resources/configuration.edn | resources/configuration.edn | {:nomad/environments {"dev" {:nomad/private-file #nomad/file "resources/configuration-local.edn"
:heads-dir "resources/self/heads"
:ip "0.0.0.0"
:port 8080}
"production" {:heads-dir "resources/self/heads"
:port 8080
:ip "0.0.0.0"}
"travis" {:heads-dir "resources/self/heads"
:permanent-fs-root "~/"
:ip 8080}}
}
| {:nomad/environments {"dev" {:nomad/private-file #nomad/file "resources/configuration-local.edn"
:heads-dir "resources/self/heads"
:ip "0.0.0.0"
:port 8080}
"production" {:heads-dir "resources/self/heads"
:port 8080
:ip "0.0.0.0"}
"travis" {:heads-dir "resources/self/heads"
:permanent-fs-root "~/"
:ip 8080
:database {:test {:user "postgres"
:password ""
:db "doctopus_test"}}}}
}
| Add a DB for travis | Add a DB for travis
| edn | epl-1.0 | Gastove/doctopus | edn | ## Code Before:
{:nomad/environments {"dev" {:nomad/private-file #nomad/file "resources/configuration-local.edn"
:heads-dir "resources/self/heads"
:ip "0.0.0.0"
:port 8080}
"production" {:heads-dir "resources/self/heads"
:port 8080
:ip "0.0.0.0"}
"travis" {:heads-dir "resources/self/heads"
:permanent-fs-root "~/"
:ip 8080}}
}
## Instruction:
Add a DB for travis
## Code After:
{:nomad/environments {"dev" {:nomad/private-file #nomad/file "resources/configuration-local.edn"
:heads-dir "resources/self/heads"
:ip "0.0.0.0"
:port 8080}
"production" {:heads-dir "resources/self/heads"
:port 8080
:ip "0.0.0.0"}
"travis" {:heads-dir "resources/self/heads"
:permanent-fs-root "~/"
:ip 8080
:database {:test {:user "postgres"
:password ""
:db "doctopus_test"}}}}
}
| {:nomad/environments {"dev" {:nomad/private-file #nomad/file "resources/configuration-local.edn"
:heads-dir "resources/self/heads"
:ip "0.0.0.0"
:port 8080}
"production" {:heads-dir "resources/self/heads"
:port 8080
:ip "0.0.0.0"}
"travis" {:heads-dir "resources/self/heads"
:permanent-fs-root "~/"
- :ip 8080}}
? --
+ :ip 8080
+ :database {:test {:user "postgres"
+ :password ""
+ :db "doctopus_test"}}}}
} | 5 | 0.454545 | 4 | 1 |
a633fd37a4d795e7b565254ef10aaa0f2ad77f31 | vcontrol/rest/machines/shutdown.py | vcontrol/rest/machines/shutdown.py | from ..helpers import get_allowed
import subprocess
import web
class ShutdownMachineR:
"""
This endpoint is for shutting down a running machine.
"""
allow_origin, rest_url = get_allowed.get_allowed()
def GET(self, machine):
web.header('Access-Control-Allow-Origin', self.allow_origin)
try:
out = subprocess.check_output("/usr/local/bin/docker-machine stop "+machine, shell=True)
except:
out = "unable to stop machine"
return str(out)
| from ..helpers import get_allowed
import subprocess
import web
class ShutdownMachineR:
"""
This endpoint is for shutting down a running machine.
"""
allow_origin, rest_url = get_allowed.get_allowed()
def GET(self, machine):
try:
web.header('Access-Control-Allow-Origin', self.allow_origin)
except Exception as e: # no pragma
print(e.message)
try:
out = subprocess.check_output("/usr/local/bin/docker-machine stop "+machine, shell=True)
except:
out = "unable to stop machine"
return str(out)
| Put the web.header function in a try/except block | Put the web.header function in a try/except block
| Python | apache-2.0 | cglewis/vcontrol,CyberReboot/vcontrol,CyberReboot/vcontrol,cglewis/vcontrol,CyberReboot/vcontrol,cglewis/vcontrol | python | ## Code Before:
from ..helpers import get_allowed
import subprocess
import web
class ShutdownMachineR:
"""
This endpoint is for shutting down a running machine.
"""
allow_origin, rest_url = get_allowed.get_allowed()
def GET(self, machine):
web.header('Access-Control-Allow-Origin', self.allow_origin)
try:
out = subprocess.check_output("/usr/local/bin/docker-machine stop "+machine, shell=True)
except:
out = "unable to stop machine"
return str(out)
## Instruction:
Put the web.header function in a try/except block
## Code After:
from ..helpers import get_allowed
import subprocess
import web
class ShutdownMachineR:
"""
This endpoint is for shutting down a running machine.
"""
allow_origin, rest_url = get_allowed.get_allowed()
def GET(self, machine):
try:
web.header('Access-Control-Allow-Origin', self.allow_origin)
except Exception as e: # no pragma
print(e.message)
try:
out = subprocess.check_output("/usr/local/bin/docker-machine stop "+machine, shell=True)
except:
out = "unable to stop machine"
return str(out)
| from ..helpers import get_allowed
import subprocess
import web
+
class ShutdownMachineR:
"""
This endpoint is for shutting down a running machine.
"""
allow_origin, rest_url = get_allowed.get_allowed()
+
def GET(self, machine):
+ try:
- web.header('Access-Control-Allow-Origin', self.allow_origin)
+ web.header('Access-Control-Allow-Origin', self.allow_origin)
? ++++
+ except Exception as e: # no pragma
+ print(e.message)
try:
out = subprocess.check_output("/usr/local/bin/docker-machine stop "+machine, shell=True)
except:
out = "unable to stop machine"
return str(out) | 7 | 0.411765 | 6 | 1 |
6f74d8f66212ad53083151dd8f7f6642e9352b0a | app/views/general/_localised_datepicker.rhtml | app/views/general/_localised_datepicker.rhtml | <script type="text/javascript">
$(function() {
$(".use-datepicker").datepicker(
{closeText: '<%= _("Done") %>',
prevText: '<%= _("Prev") %>',
nextText: '<%= _("Next") %>',
currentText: '<%= _("Today") %>',
monthNames: <%= I18n.translate('date.month_names')[1..-1].to_json %>,
monthNamesShort: <%= I18n.translate('date.abbr_month_names')[1..-1].to_json %>,
dayNames: <%= I18n.translate('date.day_names').to_json %>,
dayNamesShort: <%= I18n.translate('date.abbr_day_names').to_json %>,
dayNamesMin: <%= I18n.translate('date.abbr_day_names').collect{|x| x[0..0]}.to_json %>,
weekHeader: '<%= _("Wk") %>',
dateFormat: '<%= I18n.translate('date.formats.default').sub("%Y", "yy").sub("%m", "mm").sub("%d", "dd").gsub("-", "/") %>'}
);
});
</script>
| <script type="text/javascript">
$(function() {
$(".use-datepicker").datepicker(
{closeText: '<%= _("Done") %>',
prevText: '<%= _("Prev") %>',
nextText: '<%= _("Next") %>',
currentText: '<%= _("Today") %>',
monthNames: <%= raw I18n.translate('date.month_names')[1..-1].to_json %>,
monthNamesShort: <%= raw I18n.translate('date.abbr_month_names')[1..-1].to_json %>,
dayNames: <%= raw I18n.translate('date.day_names').to_json %>,
dayNamesShort: <%= raw I18n.translate('date.abbr_day_names').to_json %>,
dayNamesMin: <%= raw I18n.translate('date.abbr_day_names').collect{|x| x[0..0]}.to_json %>,
weekHeader: '<%= _("Wk") %>',
dateFormat: '<%= I18n.translate('date.formats.default').sub("%Y", "yy").sub("%m", "mm").sub("%d", "dd").gsub("-", "/") %>'}
);
});
</script>
| Fix calendar picker on request search page | Fix calendar picker on request search page
| RHTML | agpl-3.0 | andreicristianpetcu/alaveteli,obshtestvo/alaveteli-bulgaria,obshtestvo/alaveteli-bulgaria,4bic/alaveteli,nzherald/alaveteli,codeforcroatia/alaveteli,4bic/alaveteli,TEDICpy/QueremoSaber,Br3nda/alaveteli,TEDICpy/QueremoSaber,hasadna/alaveteli,petterreinholdtsen/alaveteli,nzherald/alaveteli,hasadna/alaveteli,hasadna/alaveteli,hasadna/alaveteli,datauy/alaveteli,hasadna/alaveteli,Br3nda/alaveteli,petterreinholdtsen/alaveteli,TEDICpy/QueremoSaber,codeforcroatia/alaveteli,petterreinholdtsen/alaveteli,andreicristianpetcu/alaveteli_old,andreicristianpetcu/alaveteli,andreicristianpetcu/alaveteli_old,datauy/alaveteli,obshtestvo/alaveteli-bulgaria,10layer/alaveteli,4bic/alaveteli,andreicristianpetcu/alaveteli_old,obshtestvo/alaveteli-bulgaria,andreicristianpetcu/alaveteli,codeforcroatia/alaveteli,hasadna/alaveteli,nzherald/alaveteli,datauy/alaveteli,10layer/alaveteli,Br3nda/alaveteli,Br3nda/alaveteli,4bic/alaveteli,andreicristianpetcu/alaveteli,codeforcroatia/alaveteli,TEDICpy/QueremoSaber,10layer/alaveteli,nzherald/alaveteli,andreicristianpetcu/alaveteli_old,nzherald/alaveteli,4bic/alaveteli,TEDICpy/QueremoSaber,andreicristianpetcu/alaveteli,petterreinholdtsen/alaveteli,Br3nda/alaveteli,petterreinholdtsen/alaveteli,obshtestvo/alaveteli-bulgaria,andreicristianpetcu/alaveteli_old | rhtml | ## Code Before:
<script type="text/javascript">
$(function() {
$(".use-datepicker").datepicker(
{closeText: '<%= _("Done") %>',
prevText: '<%= _("Prev") %>',
nextText: '<%= _("Next") %>',
currentText: '<%= _("Today") %>',
monthNames: <%= I18n.translate('date.month_names')[1..-1].to_json %>,
monthNamesShort: <%= I18n.translate('date.abbr_month_names')[1..-1].to_json %>,
dayNames: <%= I18n.translate('date.day_names').to_json %>,
dayNamesShort: <%= I18n.translate('date.abbr_day_names').to_json %>,
dayNamesMin: <%= I18n.translate('date.abbr_day_names').collect{|x| x[0..0]}.to_json %>,
weekHeader: '<%= _("Wk") %>',
dateFormat: '<%= I18n.translate('date.formats.default').sub("%Y", "yy").sub("%m", "mm").sub("%d", "dd").gsub("-", "/") %>'}
);
});
</script>
## Instruction:
Fix calendar picker on request search page
## Code After:
<script type="text/javascript">
$(function() {
$(".use-datepicker").datepicker(
{closeText: '<%= _("Done") %>',
prevText: '<%= _("Prev") %>',
nextText: '<%= _("Next") %>',
currentText: '<%= _("Today") %>',
monthNames: <%= raw I18n.translate('date.month_names')[1..-1].to_json %>,
monthNamesShort: <%= raw I18n.translate('date.abbr_month_names')[1..-1].to_json %>,
dayNames: <%= raw I18n.translate('date.day_names').to_json %>,
dayNamesShort: <%= raw I18n.translate('date.abbr_day_names').to_json %>,
dayNamesMin: <%= raw I18n.translate('date.abbr_day_names').collect{|x| x[0..0]}.to_json %>,
weekHeader: '<%= _("Wk") %>',
dateFormat: '<%= I18n.translate('date.formats.default').sub("%Y", "yy").sub("%m", "mm").sub("%d", "dd").gsub("-", "/") %>'}
);
});
</script>
| <script type="text/javascript">
$(function() {
$(".use-datepicker").datepicker(
{closeText: '<%= _("Done") %>',
prevText: '<%= _("Prev") %>',
nextText: '<%= _("Next") %>',
currentText: '<%= _("Today") %>',
- monthNames: <%= I18n.translate('date.month_names')[1..-1].to_json %>,
+ monthNames: <%= raw I18n.translate('date.month_names')[1..-1].to_json %>,
? ++++
- monthNamesShort: <%= I18n.translate('date.abbr_month_names')[1..-1].to_json %>,
+ monthNamesShort: <%= raw I18n.translate('date.abbr_month_names')[1..-1].to_json %>,
? ++++
- dayNames: <%= I18n.translate('date.day_names').to_json %>,
+ dayNames: <%= raw I18n.translate('date.day_names').to_json %>,
? ++++
- dayNamesShort: <%= I18n.translate('date.abbr_day_names').to_json %>,
+ dayNamesShort: <%= raw I18n.translate('date.abbr_day_names').to_json %>,
? ++++
- dayNamesMin: <%= I18n.translate('date.abbr_day_names').collect{|x| x[0..0]}.to_json %>,
+ dayNamesMin: <%= raw I18n.translate('date.abbr_day_names').collect{|x| x[0..0]}.to_json %>,
? ++++
weekHeader: '<%= _("Wk") %>',
dateFormat: '<%= I18n.translate('date.formats.default').sub("%Y", "yy").sub("%m", "mm").sub("%d", "dd").gsub("-", "/") %>'}
);
});
</script>
| 10 | 0.555556 | 5 | 5 |
7678bf223d53da2407a1b8bbe5632d6c5bd7b04c | app/components/component-page.jsx | app/components/component-page.jsx | "use strict";
import React, {Component} from 'react';
import AppStore from './../stores/AppStore';
// Components
import Main from '../main';
class ComponentPage extends Component {
constructor(props) {
super(props);
this.state = AppStore.getData(this.props.params.componentId) || {};
}
// Updating state
componentWillReceiveProps(nextProps) {
this.state = AppStore.getData(nextProps.params.componentId) || {};
}
// If id is not the same than previous should update the component
shouldComponentUpdate(nextProps, nextState) {
return nextProps.params.componentId !== this.props.params.componentId;
}
componentDidUpdate() {
this.state = AppStore.getData(this.props.params.componentId) || {};
}
render() {
return (
<Main>
<h2>{this.state.title}</h2>
{this.state.contents}
</Main>
);
}
}
export default ComponentPage;
| "use strict";
import React, {Component} from 'react';
import AppStore from './../stores/AppStore';
// Components
import Main from '../main';
class ComponentPage extends Component {
constructor(props) {
super(props);
this.state = AppStore.getData(this.props.params.componentId) || {};
}
// Updating state
componentWillReceiveProps(nextProps) {
this.state = AppStore.getData(nextProps.params.componentId) || {};
}
// Updating state
componentWillReceiveProps(nextProps) {
this.state = AppStore.getData(nextProps.params.componentId) || {};
}
// If id is not the same than previous should update the component
shouldComponentUpdate(nextProps, nextState) {
return nextProps.params.componentId !== this.props.params.componentId;
}
componentDidUpdate() {
this.state = AppStore.getData(this.props.params.componentId) || {};
}
render() {
return (
<Main>
<h2>{this.state.title}</h2>
<div className="content" dangerouslySetInnerHTML={{__html: this.state.contents}}></div>
</Main>
);
}
}
export default ComponentPage;
| Add parsed html on the react component | Add parsed html on the react component | JSX | mit | AzkabanCoders/markdown-docs,AzkabanCoders/markdown-docs | jsx | ## Code Before:
"use strict";
import React, {Component} from 'react';
import AppStore from './../stores/AppStore';
// Components
import Main from '../main';
class ComponentPage extends Component {
constructor(props) {
super(props);
this.state = AppStore.getData(this.props.params.componentId) || {};
}
// Updating state
componentWillReceiveProps(nextProps) {
this.state = AppStore.getData(nextProps.params.componentId) || {};
}
// If id is not the same than previous should update the component
shouldComponentUpdate(nextProps, nextState) {
return nextProps.params.componentId !== this.props.params.componentId;
}
componentDidUpdate() {
this.state = AppStore.getData(this.props.params.componentId) || {};
}
render() {
return (
<Main>
<h2>{this.state.title}</h2>
{this.state.contents}
</Main>
);
}
}
export default ComponentPage;
## Instruction:
Add parsed html on the react component
## Code After:
"use strict";
import React, {Component} from 'react';
import AppStore from './../stores/AppStore';
// Components
import Main from '../main';
class ComponentPage extends Component {
constructor(props) {
super(props);
this.state = AppStore.getData(this.props.params.componentId) || {};
}
// Updating state
componentWillReceiveProps(nextProps) {
this.state = AppStore.getData(nextProps.params.componentId) || {};
}
// Updating state
componentWillReceiveProps(nextProps) {
this.state = AppStore.getData(nextProps.params.componentId) || {};
}
// If id is not the same than previous should update the component
shouldComponentUpdate(nextProps, nextState) {
return nextProps.params.componentId !== this.props.params.componentId;
}
componentDidUpdate() {
this.state = AppStore.getData(this.props.params.componentId) || {};
}
render() {
return (
<Main>
<h2>{this.state.title}</h2>
<div className="content" dangerouslySetInnerHTML={{__html: this.state.contents}}></div>
</Main>
);
}
}
export default ComponentPage;
| "use strict";
import React, {Component} from 'react';
import AppStore from './../stores/AppStore';
// Components
import Main from '../main';
class ComponentPage extends Component {
constructor(props) {
super(props);
this.state = AppStore.getData(this.props.params.componentId) || {};
+ }
+
+ // Updating state
+ componentWillReceiveProps(nextProps) {
+ this.state = AppStore.getData(nextProps.params.componentId) || {};
}
// Updating state
componentWillReceiveProps(nextProps) {
this.state = AppStore.getData(nextProps.params.componentId) || {};
}
// If id is not the same than previous should update the component
shouldComponentUpdate(nextProps, nextState) {
return nextProps.params.componentId !== this.props.params.componentId;
}
componentDidUpdate() {
this.state = AppStore.getData(this.props.params.componentId) || {};
}
render() {
return (
<Main>
<h2>{this.state.title}</h2>
- {this.state.contents}
+ <div className="content" dangerouslySetInnerHTML={{__html: this.state.contents}}></div>
</Main>
);
}
}
export default ComponentPage; | 7 | 0.170732 | 6 | 1 |
e46e3d0049b753d68d8ee92aa992435013a12a58 | lib/everything/blog/site/index.rb | lib/everything/blog/site/index.rb | require 'kramdown'
require 'everything/blog/site/file'
require 'time'
module Everything
class Blog
class Site
class Index < File
def initialize(page_names)
@page_names = page_names
end
def relative_path
page_file_name
end
def full_page_html
@full_page_html ||= PostTemplate
.new(page_content_html)
.merge_content_and_template
end
private
def page_file_path
::File.join(Site.blog_html_path, page_file_name)
end
def page_content_html
Kramdown::Document
.new(page_links_markdown)
.to_html
end
def page_links_markdown
@page_names.map do |page_name|
<<MD
- [#{page_name}](/#{page_name}/)
MD
end.join("\n")
end
end
end
end
end
| require 'kramdown'
require 'everything/blog/site/file'
require 'time'
module Everything
class Blog
class Site
class Index < File
def initialize(page_names)
@page_names = page_names
end
def relative_path
page_file_name
end
def full_page_html
@full_page_html ||= PostTemplate
.new(page_content_html)
.merge_content_and_template
end
private
def page_file_path
::File.join(Site.blog_html_path, page_file_name)
end
def page_content_html
Kramdown::Document
.new(intro_text_markdown + page_links_markdown)
.to_html
end
def intro_text_markdown
<<MD
I've migrated my site from Wordpress to a static HTML site. The biggest
improvement you'll notice is speed. The site will load very quickly, so you can
get to reading immediately.
There are many features this new site does not have. All the content should be
here, however. This is a work in progress, so I'll be enhancing it as times goes
on. I'll improve the layout first, so the reading experience is pleasant. And
I'll move on from there.
I know the site is drastically different now, but this one will be easier for
both you and me in the long run. Thanks for your support!
MD
end
def page_links_markdown
@page_names.map do |page_name|
<<MD
- [#{page_name}](/#{page_name}/)
MD
end.join("\n")
end
end
end
end
end
| Add some intro text to the blog to describe the transition | Add some intro text to the blog to describe the transition
| Ruby | mit | kyletolle/everything-blog,kyletolle/everything-blog | ruby | ## Code Before:
require 'kramdown'
require 'everything/blog/site/file'
require 'time'
module Everything
class Blog
class Site
class Index < File
def initialize(page_names)
@page_names = page_names
end
def relative_path
page_file_name
end
def full_page_html
@full_page_html ||= PostTemplate
.new(page_content_html)
.merge_content_and_template
end
private
def page_file_path
::File.join(Site.blog_html_path, page_file_name)
end
def page_content_html
Kramdown::Document
.new(page_links_markdown)
.to_html
end
def page_links_markdown
@page_names.map do |page_name|
<<MD
- [#{page_name}](/#{page_name}/)
MD
end.join("\n")
end
end
end
end
end
## Instruction:
Add some intro text to the blog to describe the transition
## Code After:
require 'kramdown'
require 'everything/blog/site/file'
require 'time'
module Everything
class Blog
class Site
class Index < File
def initialize(page_names)
@page_names = page_names
end
def relative_path
page_file_name
end
def full_page_html
@full_page_html ||= PostTemplate
.new(page_content_html)
.merge_content_and_template
end
private
def page_file_path
::File.join(Site.blog_html_path, page_file_name)
end
def page_content_html
Kramdown::Document
.new(intro_text_markdown + page_links_markdown)
.to_html
end
def intro_text_markdown
<<MD
I've migrated my site from Wordpress to a static HTML site. The biggest
improvement you'll notice is speed. The site will load very quickly, so you can
get to reading immediately.
There are many features this new site does not have. All the content should be
here, however. This is a work in progress, so I'll be enhancing it as times goes
on. I'll improve the layout first, so the reading experience is pleasant. And
I'll move on from there.
I know the site is drastically different now, but this one will be easier for
both you and me in the long run. Thanks for your support!
MD
end
def page_links_markdown
@page_names.map do |page_name|
<<MD
- [#{page_name}](/#{page_name}/)
MD
end.join("\n")
end
end
end
end
end
| require 'kramdown'
require 'everything/blog/site/file'
require 'time'
module Everything
class Blog
class Site
class Index < File
def initialize(page_names)
@page_names = page_names
end
def relative_path
page_file_name
end
def full_page_html
@full_page_html ||= PostTemplate
.new(page_content_html)
.merge_content_and_template
end
private
def page_file_path
::File.join(Site.blog_html_path, page_file_name)
end
def page_content_html
Kramdown::Document
- .new(page_links_markdown)
+ .new(intro_text_markdown + page_links_markdown)
? ++++++++++++++++++++++
.to_html
+ end
+
+ def intro_text_markdown
+ <<MD
+ I've migrated my site from Wordpress to a static HTML site. The biggest
+ improvement you'll notice is speed. The site will load very quickly, so you can
+ get to reading immediately.
+
+ There are many features this new site does not have. All the content should be
+ here, however. This is a work in progress, so I'll be enhancing it as times goes
+ on. I'll improve the layout first, so the reading experience is pleasant. And
+ I'll move on from there.
+
+ I know the site is drastically different now, but this one will be easier for
+ both you and me in the long run. Thanks for your support!
+
+ MD
end
def page_links_markdown
@page_names.map do |page_name|
<<MD
- [#{page_name}](/#{page_name}/)
MD
end.join("\n")
end
end
end
end
end | 19 | 0.422222 | 18 | 1 |
b5843cceac1c52e16dc168bcc6c755eb8fd1fff1 | preregister/README.md | preregister/README.md |
The preregistration document is available [here](https://github.com/chartgerink/2015poldermans/raw/master/preregister/preregistration_doc.pdf). This was preregistered on the Open Science Framework on March 9, 2016. The preregistration itself is available at [placeholder](osf.io/XXXX).
|
The preregistration document is available [here](https://github.com/chartgerink/2015poldermans/raw/master/preregister/preregistration_doc.pdf). This was preregistered on the Open Science Framework on March 9, 2016. The preregistration itself is available at [osf.io/rvmxp](https://osf.io/rvmxp/?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY3Rpb24iOiJhcHByb3ZlX3JlZ2lzdHJhdGlvbl9hcHByb3ZhbCIsInNhbmN0aW9uX2lkIjoiNTZlMDM2ZTc1OTRkOTAwMWJhZDZhNzc1IiwidXNlcl9pZCI6IjVmdWttIn0.OcnRwX2irBf9cYPzP3wLP_dbZyCEYvGBxvxJrws6DrM).
| Add link to preregistration itself in preregister/readme.md | Add link to preregistration itself in preregister/readme.md
| Markdown | cc0-1.0 | chartgerink/2015poldermans,chartgerink/2015poldermans | markdown | ## Code Before:
The preregistration document is available [here](https://github.com/chartgerink/2015poldermans/raw/master/preregister/preregistration_doc.pdf). This was preregistered on the Open Science Framework on March 9, 2016. The preregistration itself is available at [placeholder](osf.io/XXXX).
## Instruction:
Add link to preregistration itself in preregister/readme.md
## Code After:
The preregistration document is available [here](https://github.com/chartgerink/2015poldermans/raw/master/preregister/preregistration_doc.pdf). This was preregistered on the Open Science Framework on March 9, 2016. The preregistration itself is available at [osf.io/rvmxp](https://osf.io/rvmxp/?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY3Rpb24iOiJhcHByb3ZlX3JlZ2lzdHJhdGlvbl9hcHByb3ZhbCIsInNhbmN0aW9uX2lkIjoiNTZlMDM2ZTc1OTRkOTAwMWJhZDZhNzc1IiwidXNlcl9pZCI6IjVmdWttIn0.OcnRwX2irBf9cYPzP3wLP_dbZyCEYvGBxvxJrws6DrM).
|
- The preregistration document is available [here](https://github.com/chartgerink/2015poldermans/raw/master/preregister/preregistration_doc.pdf). This was preregistered on the Open Science Framework on March 9, 2016. The preregistration itself is available at [placeholder](osf.io/XXXX).
+ The preregistration document is available [here](https://github.com/chartgerink/2015poldermans/raw/master/preregister/preregistration_doc.pdf). This was preregistered on the Open Science Framework on March 9, 2016. The preregistration itself is available at [osf.io/rvmxp](https://osf.io/rvmxp/?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY3Rpb24iOiJhcHByb3ZlX3JlZ2lzdHJhdGlvbl9hcHByb3ZhbCIsInNhbmN0aW9uX2lkIjoiNTZlMDM2ZTc1OTRkOTAwMWJhZDZhNzc1IiwidXNlcl9pZCI6IjVmdWttIn0.OcnRwX2irBf9cYPzP3wLP_dbZyCEYvGBxvxJrws6DrM). | 2 | 1 | 1 | 1 |
8118c79bfbd634ee0a526a706cdaf2aa8d09078d | config.json | config.json | {
"stats": {
"default": {
"threshold": [100, 1000],
"levels": [
"Babies first steps.",
"Keep up the good work!",
"We're gonna need MapReduce here..."
],
},
"accelerometer": {
"tables": ["accelerometer"],
"levels": [
"Shake",
"Shake-shake",
"Shake your booty!"
]
}
}
}
| {
"stats": {
"default": {
"thresholds": [10000, 100000],
"levels": [
"Babies first steps.",
"Keep up the good work!",
"We're gonna need MapReduce here..."
],
},
"accelerometer": {
"tables" = ["accelerometer"]
"levels": [
"Shake",
"Shake-shake",
"Shake your booty!"
]
}
"aplications" {
"tables": [
"applications_foreground",
"applications_history",
"applications_notifications",
"applications_crashes"
]
}
}
}
| Add 'applications' to 'stats' section and change default threshold values | Add 'applications' to 'stats' section and change default threshold values
| JSON | mit | sbobek/achievement-unlocked | json | ## Code Before:
{
"stats": {
"default": {
"threshold": [100, 1000],
"levels": [
"Babies first steps.",
"Keep up the good work!",
"We're gonna need MapReduce here..."
],
},
"accelerometer": {
"tables": ["accelerometer"],
"levels": [
"Shake",
"Shake-shake",
"Shake your booty!"
]
}
}
}
## Instruction:
Add 'applications' to 'stats' section and change default threshold values
## Code After:
{
"stats": {
"default": {
"thresholds": [10000, 100000],
"levels": [
"Babies first steps.",
"Keep up the good work!",
"We're gonna need MapReduce here..."
],
},
"accelerometer": {
"tables" = ["accelerometer"]
"levels": [
"Shake",
"Shake-shake",
"Shake your booty!"
]
}
"aplications" {
"tables": [
"applications_foreground",
"applications_history",
"applications_notifications",
"applications_crashes"
]
}
}
}
| {
"stats": {
"default": {
- "threshold": [100, 1000],
+ "thresholds": [10000, 100000],
? + ++ ++
"levels": [
"Babies first steps.",
"Keep up the good work!",
"We're gonna need MapReduce here..."
],
},
"accelerometer": {
- "tables": ["accelerometer"],
? ^ -
+ "tables" = ["accelerometer"]
? ^^
"levels": [
"Shake",
"Shake-shake",
"Shake your booty!"
]
}
+
+ "aplications" {
+ "tables": [
+ "applications_foreground",
+ "applications_history",
+ "applications_notifications",
+ "applications_crashes"
+ ]
+ }
}
} | 13 | 0.619048 | 11 | 2 |
7b2563c6d1a209ecaa518abcb83ec3535251f6a5 | README.md | README.md | [](https://travis-ci.org/madflow/jquery-slugify)
# jQuery Slugify
Just another another (another) url slug creation plugin for jQuery.
## Getting Started
You can install the plugin using Bower:
bower install jquery-slugify
You can download the [production version][min] or the [development version][max].
[min]: https://raw.github.com/madflow/jquery-slugify/master/dist/slugify.min.js
[max]: https://raw.github.com/madflow/jquery-slugify/master/dist/slugify.js
The plugin depends on [speakingurl][speakingurl].
[speakingurl]: https://github.com/pid/speakingurl
In your web page:
```html
<script src="jquery.js"></script>
<script src="speakingurl.min.js"></script>
<script src="slugify.min.js"></script>
<input type ="text" value="" id="slug-source" /> <!-- The text to be slugged -->
<input type ="text" value="" id="slug-target" /> <!-- The processed text as slug -->
<script>
jQuery(function($) {
$.slugify("Ätschi Bätschi"); // "aetschi-baetschi"
$('#slug-target').slugify('#slug-source'); // Type as you slug
});
</script>
```
| [](https://travis-ci.org/madflow/jquery-slugify)
# jQuery Slugify
Just another another (another) url slug creation plugin for jQuery.
## Getting Started
You can install the plugin using Bower:
bower install jquery-slugify
You can download the [production version][min] or the [development version][max].
[min]: https://raw.github.com/madflow/jquery-slugify/master/dist/slugify.min.js
[max]: https://raw.github.com/madflow/jquery-slugify/master/dist/slugify.js
The plugin depends on [speakingurl][speakingurl].
[speakingurl]: https://github.com/pid/speakingurl
In your web page:
```html
<script src="jquery.js"></script>
<script src="speakingurl.min.js"></script>
<script src="slugify.min.js"></script>
<input type ="text" value="" id="slug-source" /> <!-- The text to be slugged -->
<input type ="text" value="" id="slug-target" /> <!-- The processed text as slug -->
<script>
jQuery(function($) {
$.slugify("Ätschi Bätschi"); // "aetschi-baetschi"
$('#slug-target').slugify('#slug-source'); // Type as you slug
$("#slug-target").slugify("#slug-source", {
separator: '_' // If you want to change separator from hyphen (-) to underscore (_).
});
});
</script>
```
| Add separator for slugify string | Add separator for slugify string
| Markdown | mit | madflow/jquery-slugify,madflow/jquery-slugify | markdown | ## Code Before:
[](https://travis-ci.org/madflow/jquery-slugify)
# jQuery Slugify
Just another another (another) url slug creation plugin for jQuery.
## Getting Started
You can install the plugin using Bower:
bower install jquery-slugify
You can download the [production version][min] or the [development version][max].
[min]: https://raw.github.com/madflow/jquery-slugify/master/dist/slugify.min.js
[max]: https://raw.github.com/madflow/jquery-slugify/master/dist/slugify.js
The plugin depends on [speakingurl][speakingurl].
[speakingurl]: https://github.com/pid/speakingurl
In your web page:
```html
<script src="jquery.js"></script>
<script src="speakingurl.min.js"></script>
<script src="slugify.min.js"></script>
<input type ="text" value="" id="slug-source" /> <!-- The text to be slugged -->
<input type ="text" value="" id="slug-target" /> <!-- The processed text as slug -->
<script>
jQuery(function($) {
$.slugify("Ätschi Bätschi"); // "aetschi-baetschi"
$('#slug-target').slugify('#slug-source'); // Type as you slug
});
</script>
```
## Instruction:
Add separator for slugify string
## Code After:
[](https://travis-ci.org/madflow/jquery-slugify)
# jQuery Slugify
Just another another (another) url slug creation plugin for jQuery.
## Getting Started
You can install the plugin using Bower:
bower install jquery-slugify
You can download the [production version][min] or the [development version][max].
[min]: https://raw.github.com/madflow/jquery-slugify/master/dist/slugify.min.js
[max]: https://raw.github.com/madflow/jquery-slugify/master/dist/slugify.js
The plugin depends on [speakingurl][speakingurl].
[speakingurl]: https://github.com/pid/speakingurl
In your web page:
```html
<script src="jquery.js"></script>
<script src="speakingurl.min.js"></script>
<script src="slugify.min.js"></script>
<input type ="text" value="" id="slug-source" /> <!-- The text to be slugged -->
<input type ="text" value="" id="slug-target" /> <!-- The processed text as slug -->
<script>
jQuery(function($) {
$.slugify("Ätschi Bätschi"); // "aetschi-baetschi"
$('#slug-target').slugify('#slug-source'); // Type as you slug
$("#slug-target").slugify("#slug-source", {
separator: '_' // If you want to change separator from hyphen (-) to underscore (_).
});
});
</script>
```
| [](https://travis-ci.org/madflow/jquery-slugify)
# jQuery Slugify
Just another another (another) url slug creation plugin for jQuery.
## Getting Started
You can install the plugin using Bower:
bower install jquery-slugify
You can download the [production version][min] or the [development version][max].
[min]: https://raw.github.com/madflow/jquery-slugify/master/dist/slugify.min.js
[max]: https://raw.github.com/madflow/jquery-slugify/master/dist/slugify.js
The plugin depends on [speakingurl][speakingurl].
[speakingurl]: https://github.com/pid/speakingurl
In your web page:
```html
<script src="jquery.js"></script>
<script src="speakingurl.min.js"></script>
<script src="slugify.min.js"></script>
<input type ="text" value="" id="slug-source" /> <!-- The text to be slugged -->
<input type ="text" value="" id="slug-target" /> <!-- The processed text as slug -->
<script>
jQuery(function($) {
$.slugify("Ätschi Bätschi"); // "aetschi-baetschi"
$('#slug-target').slugify('#slug-source'); // Type as you slug
+
+ $("#slug-target").slugify("#slug-source", {
+ separator: '_' // If you want to change separator from hyphen (-) to underscore (_).
+ });
});
</script>
``` | 4 | 0.105263 | 4 | 0 |
6f235d1d5a0ad0725467e74ec2f35e211b4df1a8 | foursquare.js | foursquare.js | // var foursquare = (require('foursquarevenues'))('CLIENTIDKEY', 'CLIENTSECRETKEY');
var foursquare = (require('foursquarevenues'))('Y5D1QX0FS4R5ZTJ5TLU3RDL1U0PUE4ZU3NPTQDS2AGMW1KGP', 'XM2PZ15QKM0I5TQYTCTYXOVBGWKRHCCFZFNNKZYQA1JV1SNZ');
var params = {
"ll": "40.7,-74"
};
foursquare.getVenues(params, function(error, venues) {
if (!error) {
console.log(venues.toString());
}
});
foursquare.exploreVenues(params, function(error, venues) {
if (!error) {
console.log(venues.toString());
}
});
| const dotenv = require('dotenv');
dotenv.config();
var foursquare = (require('foursquarevenues'))(process.env.FOURSQUARE_CLIENT_ID, process.env.FOURSQUARE_CLIENT_SECRET);
var params = {
"ll": "40.7,-74"
};
foursquare.getVenues(params, function(error, venues) {
if (!error) {
console.log(venues);
}
});
foursquare.exploreVenues(params, function(error, venues) {
if (!error) {
console.log(venues);
}
});
| Use dotenv for Foursquare credentials. | Use dotenv for Foursquare credentials.
| JavaScript | apache-2.0 | qr8rs/qr8rs-app,qr8rs/qr8rs-app | javascript | ## Code Before:
// var foursquare = (require('foursquarevenues'))('CLIENTIDKEY', 'CLIENTSECRETKEY');
var foursquare = (require('foursquarevenues'))('Y5D1QX0FS4R5ZTJ5TLU3RDL1U0PUE4ZU3NPTQDS2AGMW1KGP', 'XM2PZ15QKM0I5TQYTCTYXOVBGWKRHCCFZFNNKZYQA1JV1SNZ');
var params = {
"ll": "40.7,-74"
};
foursquare.getVenues(params, function(error, venues) {
if (!error) {
console.log(venues.toString());
}
});
foursquare.exploreVenues(params, function(error, venues) {
if (!error) {
console.log(venues.toString());
}
});
## Instruction:
Use dotenv for Foursquare credentials.
## Code After:
const dotenv = require('dotenv');
dotenv.config();
var foursquare = (require('foursquarevenues'))(process.env.FOURSQUARE_CLIENT_ID, process.env.FOURSQUARE_CLIENT_SECRET);
var params = {
"ll": "40.7,-74"
};
foursquare.getVenues(params, function(error, venues) {
if (!error) {
console.log(venues);
}
});
foursquare.exploreVenues(params, function(error, venues) {
if (!error) {
console.log(venues);
}
});
| - // var foursquare = (require('foursquarevenues'))('CLIENTIDKEY', 'CLIENTSECRETKEY');
- var foursquare = (require('foursquarevenues'))('Y5D1QX0FS4R5ZTJ5TLU3RDL1U0PUE4ZU3NPTQDS2AGMW1KGP', 'XM2PZ15QKM0I5TQYTCTYXOVBGWKRHCCFZFNNKZYQA1JV1SNZ');
+ const dotenv = require('dotenv');
+
+ dotenv.config();
+
+ var foursquare = (require('foursquarevenues'))(process.env.FOURSQUARE_CLIENT_ID, process.env.FOURSQUARE_CLIENT_SECRET);
var params = {
"ll": "40.7,-74"
};
foursquare.getVenues(params, function(error, venues) {
if (!error) {
- console.log(venues.toString());
? -----------
+ console.log(venues);
}
});
foursquare.exploreVenues(params, function(error, venues) {
if (!error) {
- console.log(venues.toString());
? -----------
+ console.log(venues);
}
}); | 11 | 0.611111 | 7 | 4 |
3d1004ac3e326eb14f2d7fb4cca0d32c8a1cb04d | check.sh | check.sh |
set -Ceu
: ${PYTHON:=python}
: ${PY_TEST:=`which py.test`}
if [ ! -x "${PY_TEST}" ]; then
printf >&2 'unable to find pytest\n'
exit 1
fi
root=`cd -- "$(dirname -- "$0")" && pwd`
(
set -Ceu
cd -- "${root}"
rm -rf build
"$PYTHON" setup.py build
BAYESDB_WIZARD_MODE=1 ./pythenv.sh "$PYTHON" "$PY_TEST" "$@"
)
|
set -Ceu
: ${PYTHON:=python}
: ${PY_TEST:=`which py.test`}
if [ ! -x "${PY_TEST}" ]; then
printf >&2 'unable to find pytest\n'
exit 1
fi
root=`cd -- "$(dirname -- "$0")" && pwd`
(
set -Ceu
cd -- "${root}"
rm -rf build
"$PYTHON" setup.py build
export BAYESDB_DISABLE_VERSION_CHECK=1
export BAYESDB_WIZARD_MODE=1
./pythenv.sh "$PYTHON" "$PY_TEST" "$@"
)
| Set BAYESDB_DISABLE_VERSION_CHECK=1 too before running tests. | Set BAYESDB_DISABLE_VERSION_CHECK=1 too before running tests.
| Shell | apache-2.0 | probcomp/bdbcontrib,probcomp/bdbcontrib | shell | ## Code Before:
set -Ceu
: ${PYTHON:=python}
: ${PY_TEST:=`which py.test`}
if [ ! -x "${PY_TEST}" ]; then
printf >&2 'unable to find pytest\n'
exit 1
fi
root=`cd -- "$(dirname -- "$0")" && pwd`
(
set -Ceu
cd -- "${root}"
rm -rf build
"$PYTHON" setup.py build
BAYESDB_WIZARD_MODE=1 ./pythenv.sh "$PYTHON" "$PY_TEST" "$@"
)
## Instruction:
Set BAYESDB_DISABLE_VERSION_CHECK=1 too before running tests.
## Code After:
set -Ceu
: ${PYTHON:=python}
: ${PY_TEST:=`which py.test`}
if [ ! -x "${PY_TEST}" ]; then
printf >&2 'unable to find pytest\n'
exit 1
fi
root=`cd -- "$(dirname -- "$0")" && pwd`
(
set -Ceu
cd -- "${root}"
rm -rf build
"$PYTHON" setup.py build
export BAYESDB_DISABLE_VERSION_CHECK=1
export BAYESDB_WIZARD_MODE=1
./pythenv.sh "$PYTHON" "$PY_TEST" "$@"
)
|
set -Ceu
: ${PYTHON:=python}
: ${PY_TEST:=`which py.test`}
if [ ! -x "${PY_TEST}" ]; then
printf >&2 'unable to find pytest\n'
exit 1
fi
root=`cd -- "$(dirname -- "$0")" && pwd`
(
set -Ceu
cd -- "${root}"
rm -rf build
"$PYTHON" setup.py build
+ export BAYESDB_DISABLE_VERSION_CHECK=1
+ export BAYESDB_WIZARD_MODE=1
- BAYESDB_WIZARD_MODE=1 ./pythenv.sh "$PYTHON" "$PY_TEST" "$@"
? ----------------------
+ ./pythenv.sh "$PYTHON" "$PY_TEST" "$@"
) | 4 | 0.2 | 3 | 1 |
b1e485083fa0e3c10a624d4f25a8f9cb16bdfa31 | README.md | README.md | thor
====
Textual hierarchical ordered representation.
| thor
====
Thor is a textual hierarchical ordered representation for data.
I couldn't find a language that did what I wanted, so I made a new one. The
features of thor include:
* Humans and machines can read and write it
* Easy to parse
* Hierarchical
* Order is preserved
* Repeated keys
* Simple types
* Key/value and list style collections
Currently the thor command only parses input and dumps it back out.
| Put something in the readme. | Put something in the readme.
| Markdown | mit | ianremmler/shor | markdown | ## Code Before:
thor
====
Textual hierarchical ordered representation.
## Instruction:
Put something in the readme.
## Code After:
thor
====
Thor is a textual hierarchical ordered representation for data.
I couldn't find a language that did what I wanted, so I made a new one. The
features of thor include:
* Humans and machines can read and write it
* Easy to parse
* Hierarchical
* Order is preserved
* Repeated keys
* Simple types
* Key/value and list style collections
Currently the thor command only parses input and dumps it back out.
| thor
====
- Textual hierarchical ordered representation.
+ Thor is a textual hierarchical ordered representation for data.
? ++++++++++ +++++++++
+
+ I couldn't find a language that did what I wanted, so I made a new one. The
+ features of thor include:
+
+ * Humans and machines can read and write it
+ * Easy to parse
+ * Hierarchical
+ * Order is preserved
+ * Repeated keys
+ * Simple types
+ * Key/value and list style collections
+
+ Currently the thor command only parses input and dumps it back out. | 15 | 3.75 | 14 | 1 |
ba76c7928a50031fee913b058e276819515c111d | doc/cli.md | doc/cli.md |
Update each function so that it takes an object bag of arguments. Update the cli.js to parse the user's .npmrc first, and then the arguments, merge the two objects together, and pass the data over to the function.
If something relevant is missing, then each command should provide a "help" menu that lists out what's important for that command. Doing `npm help foo` should also output the "foo" command documentation.
There needs to be a consistent pattern by which flags and other data is defined and named.
|
Update each function so that it takes an object bag of arguments. Update the cli.js to parse the user's .npmrc first, and then the arguments, merge the two objects together, and pass the data over to the function.
If something relevant is missing, then each command should provide a "help" menu that lists out what's important for that command. Doing `npm help foo` should also output the "foo" command documentation.
There needs to be a consistent pattern by which flags and other data is defined and named.
Handle abbrevs. Cuz that's just the nice thing to do.
| Add a todo about abbrevs | Add a todo about abbrevs
| Markdown | artistic-2.0 | chadnickbok/npm,segrey/npm,midniteio/npm,misterbyrne/npm,yyx990803/npm,ekmartin/npm,Volune/npm,segment-boneyard/npm,rsp/npm,cchamberlain/npm,evocateur/npm,kimshinelove/naver-npm,cchamberlain/npm-msys2,midniteio/npm,segrey/npm,cchamberlain/npm,evanlucas/npm,yibn2008/npm,DIREKTSPEED-LTD/npm,haggholm/npm,TimeToogo/npm,segmentio/npm,yibn2008/npm,evocateur/npm,yibn2008/npm,Volune/npm,kimshinelove/naver-npm,cchamberlain/npm,rsp/npm,segment-boneyard/npm,DaveEmmerson/npm,xalopp/npm,kriskowal/npm,chadnickbok/npm,thomblake/npm,princeofdarkness76/npm,xalopp/npm,ekmartin/npm,DaveEmmerson/npm,DaveEmmerson/npm,rsp/npm,midniteio/npm,segmentio/npm,yodeyer/npm,Volune/npm,kemitchell/npm,TimeToogo/npm,segmentio/npm,kriskowal/npm,yodeyer/npm,yyx990803/npm,TimeToogo/npm,evanlucas/npm,thomblake/npm,lxe/npm,segrey/npm,evocateur/npm,evanlucas/npm,yyx990803/npm,thomblake/npm,misterbyrne/npm,cchamberlain/npm-msys2,ekmartin/npm,DIREKTSPEED-LTD/npm,princeofdarkness76/npm,chadnickbok/npm,princeofdarkness76/npm,segment-boneyard/npm,kemitchell/npm,lxe/npm,haggholm/npm,kimshinelove/naver-npm,cchamberlain/npm-msys2,kriskowal/npm,kemitchell/npm,yodeyer/npm,DIREKTSPEED-LTD/npm,xalopp/npm,misterbyrne/npm,lxe/npm,haggholm/npm | markdown | ## Code Before:
Update each function so that it takes an object bag of arguments. Update the cli.js to parse the user's .npmrc first, and then the arguments, merge the two objects together, and pass the data over to the function.
If something relevant is missing, then each command should provide a "help" menu that lists out what's important for that command. Doing `npm help foo` should also output the "foo" command documentation.
There needs to be a consistent pattern by which flags and other data is defined and named.
## Instruction:
Add a todo about abbrevs
## Code After:
Update each function so that it takes an object bag of arguments. Update the cli.js to parse the user's .npmrc first, and then the arguments, merge the two objects together, and pass the data over to the function.
If something relevant is missing, then each command should provide a "help" menu that lists out what's important for that command. Doing `npm help foo` should also output the "foo" command documentation.
There needs to be a consistent pattern by which flags and other data is defined and named.
Handle abbrevs. Cuz that's just the nice thing to do.
|
Update each function so that it takes an object bag of arguments. Update the cli.js to parse the user's .npmrc first, and then the arguments, merge the two objects together, and pass the data over to the function.
If something relevant is missing, then each command should provide a "help" menu that lists out what's important for that command. Doing `npm help foo` should also output the "foo" command documentation.
There needs to be a consistent pattern by which flags and other data is defined and named.
+
+ Handle abbrevs. Cuz that's just the nice thing to do. | 2 | 0.333333 | 2 | 0 |
d32489a5f46d36c7ae22fbde27f930c2fc07dc82 | editor.html | editor.html | <!DOCTYPE html>
<html>
<head>
<script src="http://cdn.mathjax.org/mathjax/2.0-latest/MathJax.js?config=TeX-MML-AM_HTMLorMML-full&delayStartupUntil=configured"></script>
<script type="text/javascript" src="./lib/require-2.1.2.js" data-main="gh-book.js"></script>
<script type="text/javascript" src="./config/bookish-config.js"></script>
<script type="text/javascript" src="./config/epub-config.js"></script>
<script type="text/javascript" src="./config/gh-book-config.js"></script>
<style type="text/css">
#accordion-metadata { display: none; }
</style>
</head>
<body>
<div id="main">
<h1>Loading book editor (hopefully)</h1>
<p>This should take up to 1 minute. If it takes longer there may be a problem.</p>
</div>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="./lib/require-2.1.2.js" data-main="gh-book.js"></script>
<script type="text/javascript" src="./config/bookish-config.js"></script>
<script type="text/javascript" src="./config/epub-config.js"></script>
<script type="text/javascript" src="./config/gh-book-config.js"></script>
<style type="text/css">
#accordion-metadata { display: none; }
</style>
</head>
<body>
<div id="main">
<h1>Loading book editor (hopefully)</h1>
<p>This should take up to 1 minute. If it takes longer there may be a problem.</p>
</div>
<script src="http://cdn.mathjax.org/mathjax/2.0-latest/MathJax.js?config=TeX-MML-AM_HTMLorMML-full&delayStartupUntil=configured"></script>
</body>
</html>
| Load MathJax after everything else loaded | Load MathJax after everything else loaded
| HTML | agpl-3.0 | oerpub/bookish,oerpub/bookish | html | ## Code Before:
<!DOCTYPE html>
<html>
<head>
<script src="http://cdn.mathjax.org/mathjax/2.0-latest/MathJax.js?config=TeX-MML-AM_HTMLorMML-full&delayStartupUntil=configured"></script>
<script type="text/javascript" src="./lib/require-2.1.2.js" data-main="gh-book.js"></script>
<script type="text/javascript" src="./config/bookish-config.js"></script>
<script type="text/javascript" src="./config/epub-config.js"></script>
<script type="text/javascript" src="./config/gh-book-config.js"></script>
<style type="text/css">
#accordion-metadata { display: none; }
</style>
</head>
<body>
<div id="main">
<h1>Loading book editor (hopefully)</h1>
<p>This should take up to 1 minute. If it takes longer there may be a problem.</p>
</div>
</body>
</html>
## Instruction:
Load MathJax after everything else loaded
## Code After:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="./lib/require-2.1.2.js" data-main="gh-book.js"></script>
<script type="text/javascript" src="./config/bookish-config.js"></script>
<script type="text/javascript" src="./config/epub-config.js"></script>
<script type="text/javascript" src="./config/gh-book-config.js"></script>
<style type="text/css">
#accordion-metadata { display: none; }
</style>
</head>
<body>
<div id="main">
<h1>Loading book editor (hopefully)</h1>
<p>This should take up to 1 minute. If it takes longer there may be a problem.</p>
</div>
<script src="http://cdn.mathjax.org/mathjax/2.0-latest/MathJax.js?config=TeX-MML-AM_HTMLorMML-full&delayStartupUntil=configured"></script>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
- <script src="http://cdn.mathjax.org/mathjax/2.0-latest/MathJax.js?config=TeX-MML-AM_HTMLorMML-full&delayStartupUntil=configured"></script>
<script type="text/javascript" src="./lib/require-2.1.2.js" data-main="gh-book.js"></script>
<script type="text/javascript" src="./config/bookish-config.js"></script>
<script type="text/javascript" src="./config/epub-config.js"></script>
<script type="text/javascript" src="./config/gh-book-config.js"></script>
<style type="text/css">
#accordion-metadata { display: none; }
</style>
</head>
<body>
<div id="main">
<h1>Loading book editor (hopefully)</h1>
<p>This should take up to 1 minute. If it takes longer there may be a problem.</p>
</div>
+
+ <script src="http://cdn.mathjax.org/mathjax/2.0-latest/MathJax.js?config=TeX-MML-AM_HTMLorMML-full&delayStartupUntil=configured"></script>
</body>
</html> | 3 | 0.15 | 2 | 1 |
cd687697c61764cdb4385b4c637f437b4e4c6cfc | lib/taglib/mp4.rb | lib/taglib/mp4.rb | require 'taglib_mp4'
module TagLib::MP4
class File
extend ::TagLib::FileOpenable
end
class ItemListMap
alias :clear :_clear
alias :insert :_insert
def [](key)
fetch(key)
end
end
end
| require 'taglib_mp4'
module TagLib::MP4
remove_const :Atom
remove_const :AtomData
remove_const :Atoms
remove_const :IOStream
class File
extend ::TagLib::FileOpenable
end
class Tag
remove_method :save
end
class ItemListMap
alias :clear :_clear
alias :insert :_insert
remove_method :_clear
remove_method :_insert
def [](key)
fetch(key)
end
end
end
| Remove private TagLib classes from Ruby wrapper | Remove private TagLib classes from Ruby wrapper
| Ruby | mit | robinst/taglib-ruby,robinst/taglib-ruby | ruby | ## Code Before:
require 'taglib_mp4'
module TagLib::MP4
class File
extend ::TagLib::FileOpenable
end
class ItemListMap
alias :clear :_clear
alias :insert :_insert
def [](key)
fetch(key)
end
end
end
## Instruction:
Remove private TagLib classes from Ruby wrapper
## Code After:
require 'taglib_mp4'
module TagLib::MP4
remove_const :Atom
remove_const :AtomData
remove_const :Atoms
remove_const :IOStream
class File
extend ::TagLib::FileOpenable
end
class Tag
remove_method :save
end
class ItemListMap
alias :clear :_clear
alias :insert :_insert
remove_method :_clear
remove_method :_insert
def [](key)
fetch(key)
end
end
end
| require 'taglib_mp4'
module TagLib::MP4
+ remove_const :Atom
+ remove_const :AtomData
+ remove_const :Atoms
+ remove_const :IOStream
+
class File
extend ::TagLib::FileOpenable
+ end
+
+ class Tag
+ remove_method :save
end
class ItemListMap
alias :clear :_clear
alias :insert :_insert
+ remove_method :_clear
+ remove_method :_insert
def [](key)
fetch(key)
end
end
end | 11 | 0.6875 | 11 | 0 |
c90199861e9ea29f870c66a6424f44ef264f9b6d | tasks/cla-exceptions.json | tasks/cla-exceptions.json | {
"busykai": true,
"mjherna1": true,
"shahabl": true,
"sebaslv": true,
"albertinad": true,
"walfgithub": true
}
| {
"busykai": true,
"mjherna1": true,
"shahabl": true,
"sebaslv": true,
"albertinad": true,
"walfgithub": true,
"mfatekho": true
}
| Add @mfatekho to CLA exceptions. | Add @mfatekho to CLA exceptions.
@mfatekho is Marat Fatekhov. He is covered by Adobe/Intel CCLA.
| JSON | mit | stowball/brackets,kolipka/brackets,MarcelGerber/brackets,michaeljayt/brackets,albertinad/brackets,lunode/brackets,Wikunia/brackets,ficristo/brackets,pratts/brackets,Wikunia/brackets,stowball/brackets,adobe/brackets,ralic/brackets,ficristo/brackets,uwsd/brackets,pomadgw/brackets,albertinad/brackets,pomadgw/brackets,revi/brackets,Rynaro/brackets,pomadgw/brackets,stowball/brackets,adobe/brackets,adobe/brackets,MarcelGerber/brackets,revi/brackets,Real-Currents/brackets,rlugojr/brackets,zaggino/brackets-electron,Wikunia/brackets,Rynaro/brackets,pratts/brackets,kolipka/brackets,rlugojr/brackets,zaggino/brackets-electron,thehogfather/brackets,MarcelGerber/brackets,adobe/brackets,michaeljayt/brackets,busykai/brackets,pomadgw/brackets,MarcelGerber/brackets,Real-Currents/brackets,stowball/brackets,michaeljayt/brackets,zaggino/brackets-electron,sprintr/brackets,pratts/brackets,kolipka/brackets,thehogfather/brackets,michaeljayt/brackets,busykai/brackets,uwsd/brackets,ralic/brackets,Real-Currents/brackets,MarcelGerber/brackets,sprintr/brackets,busykai/brackets,lunode/brackets,adobe/brackets,rlugojr/brackets,ralic/brackets,Real-Currents/brackets,thehogfather/brackets,kolipka/brackets,rlugojr/brackets,petetnt/brackets,petetnt/brackets,albertinad/brackets,petetnt/brackets,lunode/brackets,Real-Currents/brackets,Rynaro/brackets,pomadgw/brackets,uwsd/brackets,lunode/brackets,Rynaro/brackets,zaggino/brackets-electron,busykai/brackets,petetnt/brackets,lunode/brackets,uwsd/brackets,revi/brackets,ralic/brackets,zaggino/brackets-electron,sprintr/brackets,albertinad/brackets,sprintr/brackets,Rynaro/brackets,uwsd/brackets,petetnt/brackets,thehogfather/brackets,ficristo/brackets,pratts/brackets,rlugojr/brackets,albertinad/brackets,sprintr/brackets,pratts/brackets,Wikunia/brackets,ralic/brackets,kolipka/brackets,revi/brackets,busykai/brackets,michaeljayt/brackets,ficristo/brackets,Wikunia/brackets,Real-Currents/brackets,thehogfather/brackets,stowball/brackets,revi/brackets,ficristo/brackets,zaggino/brackets-electron | json | ## Code Before:
{
"busykai": true,
"mjherna1": true,
"shahabl": true,
"sebaslv": true,
"albertinad": true,
"walfgithub": true
}
## Instruction:
Add @mfatekho to CLA exceptions.
@mfatekho is Marat Fatekhov. He is covered by Adobe/Intel CCLA.
## Code After:
{
"busykai": true,
"mjherna1": true,
"shahabl": true,
"sebaslv": true,
"albertinad": true,
"walfgithub": true,
"mfatekho": true
}
| {
"busykai": true,
"mjherna1": true,
"shahabl": true,
"sebaslv": true,
"albertinad": true,
- "walfgithub": true
+ "walfgithub": true,
? +
+ "mfatekho": true
} | 3 | 0.375 | 2 | 1 |
c0281cbce50731dbc7e3255114ba036bf292e5f8 | tests/PointsTo.hs | tests/PointsTo.hs | import System.Environment ( getArgs )
import Data.LLVM.Analysis.PointsTo.Andersen
import Data.LLVM
main :: IO ()
main = do
[ fname ] <- getArgs
Right m <- parseLLVMBitcodeFile defaultParserOptions fname
let a = runPointsToAnalysis m
putStrLn $ show a
| import System.Environment ( getArgs )
import Data.LLVM.Analysis.PointsTo.Andersen
import Data.LLVM.ParseBitcode
main :: IO ()
main = do
[ fname ] <- getArgs
mm <- parseLLVMBitcodeFile defaultParserOptions fname
case mm of
Left err -> putStrLn err
Right m -> do
let a = runPointsToAnalysis m
viewPointsToGraph a
return ()
| Add a test driver for the Andersen analysis | Add a test driver for the Andersen analysis
| Haskell | bsd-3-clause | wangxiayang/llvm-analysis,travitch/llvm-analysis,wangxiayang/llvm-analysis,travitch/llvm-analysis | haskell | ## Code Before:
import System.Environment ( getArgs )
import Data.LLVM.Analysis.PointsTo.Andersen
import Data.LLVM
main :: IO ()
main = do
[ fname ] <- getArgs
Right m <- parseLLVMBitcodeFile defaultParserOptions fname
let a = runPointsToAnalysis m
putStrLn $ show a
## Instruction:
Add a test driver for the Andersen analysis
## Code After:
import System.Environment ( getArgs )
import Data.LLVM.Analysis.PointsTo.Andersen
import Data.LLVM.ParseBitcode
main :: IO ()
main = do
[ fname ] <- getArgs
mm <- parseLLVMBitcodeFile defaultParserOptions fname
case mm of
Left err -> putStrLn err
Right m -> do
let a = runPointsToAnalysis m
viewPointsToGraph a
return ()
| import System.Environment ( getArgs )
import Data.LLVM.Analysis.PointsTo.Andersen
- import Data.LLVM
+ import Data.LLVM.ParseBitcode
main :: IO ()
main = do
[ fname ] <- getArgs
- Right m <- parseLLVMBitcodeFile defaultParserOptions fname
? ^^^^^^
+ mm <- parseLLVMBitcodeFile defaultParserOptions fname
? ^
+ case mm of
+ Left err -> putStrLn err
+ Right m -> do
- let a = runPointsToAnalysis m
+ let a = runPointsToAnalysis m
? ++++
- putStrLn $ show a
+ viewPointsToGraph a
+ return () | 12 | 1.090909 | 8 | 4 |
be4a8d2b972bc865124be94333df22c725279ef9 | tests/unblock-prompt/.buildkite/results.sh | tests/unblock-prompt/.buildkite/results.sh | echo "--- Version"
buildkite-agent meta-data get version
echo "--- Food"
buildkite-agent meta-data get taco
echo "--- Deploy Target"
buildkite-agent meta-data get deploy-target
echo "--- Notify Team"
buildkite-agent meta-data get notify-team
| echo "--- Version"
echo `buildkite-agent meta-data get version`
echo "--- Food"
echo `buildkite-agent meta-data get taco`
echo "--- Deploy Target"
echo `buildkite-agent meta-data get deploy-target`
echo "--- Notify Team"
echo `buildkite-agent meta-data get notify-team`
| Use a different mechanism of grabbing the meta data | Use a different mechanism of grabbing the meta data
| Shell | mit | buildkite/agent-tests,buildkite/agent-tests | shell | ## Code Before:
echo "--- Version"
buildkite-agent meta-data get version
echo "--- Food"
buildkite-agent meta-data get taco
echo "--- Deploy Target"
buildkite-agent meta-data get deploy-target
echo "--- Notify Team"
buildkite-agent meta-data get notify-team
## Instruction:
Use a different mechanism of grabbing the meta data
## Code After:
echo "--- Version"
echo `buildkite-agent meta-data get version`
echo "--- Food"
echo `buildkite-agent meta-data get taco`
echo "--- Deploy Target"
echo `buildkite-agent meta-data get deploy-target`
echo "--- Notify Team"
echo `buildkite-agent meta-data get notify-team`
| echo "--- Version"
- buildkite-agent meta-data get version
+ echo `buildkite-agent meta-data get version`
? ++++++ +
echo "--- Food"
- buildkite-agent meta-data get taco
+ echo `buildkite-agent meta-data get taco`
? ++++++ +
echo "--- Deploy Target"
- buildkite-agent meta-data get deploy-target
+ echo `buildkite-agent meta-data get deploy-target`
? ++++++ +
echo "--- Notify Team"
- buildkite-agent meta-data get notify-team
+ echo `buildkite-agent meta-data get notify-team`
? ++++++ +
| 8 | 0.727273 | 4 | 4 |
3075ae87cf7fd2edcd81dcd51364ae8cfaf4ddca | code-sample-angular-java/hello-world/src/app/heroes/heroes.component.ts | code-sample-angular-java/hello-world/src/app/heroes/heroes.component.ts | import { Component, OnInit } from '@angular/core';
import { Hero } from '../hero';
import { HeroService } from '../hero.service';
@Component({
selector: 'app-heroes',
templateUrl: './heroes.component.html',
styleUrls: ['./heroes.component.css']
})
export class HeroesComponent implements OnInit {
constructor(private heroService: HeroService) { }
heroes: Hero[];
selectedHero: Hero;
ngOnInit() {
this.getHeroes();
}
getHeroes(): void {
this.heroService.getHeroes()
.subscribe(heroes => this.heroes = heroes);
}
onSelect(hero: Hero): void {
this.selectedHero = hero;
}
}
| import { Component, OnInit } from '@angular/core';
import { Hero } from '../hero';
import { HeroService } from '../hero.service';
import {MessageService} from "../message.service";
@Component({
selector: 'app-heroes',
templateUrl: './heroes.component.html',
styleUrls: ['./heroes.component.css']
})
export class HeroesComponent implements OnInit {
constructor(private heroService: HeroService, private messageService: MessageService) { }
heroes: Hero[];
selectedHero: Hero;
ngOnInit() {
this.getHeroes();
}
getHeroes(): void {
this.heroService.getHeroes()
.subscribe(heroes => this.heroes = heroes);
}
onSelect(hero: Hero): void {
this.messageService.add("Hero " + hero.name + " choosen");
this.selectedHero = hero;
}
}
| Add messaging when hero is selected | Add messaging when hero is selected
| TypeScript | mit | aquatir/remember_java_api,aquatir/remember_java_api,aquatir/remember_java_api,aquatir/remember_java_api | typescript | ## Code Before:
import { Component, OnInit } from '@angular/core';
import { Hero } from '../hero';
import { HeroService } from '../hero.service';
@Component({
selector: 'app-heroes',
templateUrl: './heroes.component.html',
styleUrls: ['./heroes.component.css']
})
export class HeroesComponent implements OnInit {
constructor(private heroService: HeroService) { }
heroes: Hero[];
selectedHero: Hero;
ngOnInit() {
this.getHeroes();
}
getHeroes(): void {
this.heroService.getHeroes()
.subscribe(heroes => this.heroes = heroes);
}
onSelect(hero: Hero): void {
this.selectedHero = hero;
}
}
## Instruction:
Add messaging when hero is selected
## Code After:
import { Component, OnInit } from '@angular/core';
import { Hero } from '../hero';
import { HeroService } from '../hero.service';
import {MessageService} from "../message.service";
@Component({
selector: 'app-heroes',
templateUrl: './heroes.component.html',
styleUrls: ['./heroes.component.css']
})
export class HeroesComponent implements OnInit {
constructor(private heroService: HeroService, private messageService: MessageService) { }
heroes: Hero[];
selectedHero: Hero;
ngOnInit() {
this.getHeroes();
}
getHeroes(): void {
this.heroService.getHeroes()
.subscribe(heroes => this.heroes = heroes);
}
onSelect(hero: Hero): void {
this.messageService.add("Hero " + hero.name + " choosen");
this.selectedHero = hero;
}
}
| import { Component, OnInit } from '@angular/core';
import { Hero } from '../hero';
import { HeroService } from '../hero.service';
+ import {MessageService} from "../message.service";
@Component({
selector: 'app-heroes',
templateUrl: './heroes.component.html',
styleUrls: ['./heroes.component.css']
})
export class HeroesComponent implements OnInit {
- constructor(private heroService: HeroService) { }
+ constructor(private heroService: HeroService, private messageService: MessageService) { }
heroes: Hero[];
selectedHero: Hero;
ngOnInit() {
this.getHeroes();
}
getHeroes(): void {
this.heroService.getHeroes()
.subscribe(heroes => this.heroes = heroes);
}
onSelect(hero: Hero): void {
+ this.messageService.add("Hero " + hero.name + " choosen");
this.selectedHero = hero;
}
} | 4 | 0.114286 | 3 | 1 |
e29544e7c9a67e083e8a807ebef8a8eca51f6430 | .travis.yml | .travis.yml | language: ruby
bundler_args: --without development
before_script: "./bin/ci/before_build"
script: "bundle exec rspec -cf documentation spec"
rvm:
- "2.2"
- "2.1"
- "2.0"
notifications:
email: michael@rabbitmq.com
services:
- rabbitmq
branches:
only:
- master
| language: ruby
bundler_args: --without development
before_script: "./bin/ci/before_build"
script: "bundle exec rspec -cf documentation spec"
rvm:
- "2.3.0"
- "2.2.2"
notifications:
email: michael@rabbitmq.com
services:
- rabbitmq
branches:
only:
- master
| Test against Ruby 2.3.0 and 2.2.2 | Test against Ruby 2.3.0 and 2.2.2 | YAML | mit | gferguson-gd/bunny,gferguson-gd/bunny | yaml | ## Code Before:
language: ruby
bundler_args: --without development
before_script: "./bin/ci/before_build"
script: "bundle exec rspec -cf documentation spec"
rvm:
- "2.2"
- "2.1"
- "2.0"
notifications:
email: michael@rabbitmq.com
services:
- rabbitmq
branches:
only:
- master
## Instruction:
Test against Ruby 2.3.0 and 2.2.2
## Code After:
language: ruby
bundler_args: --without development
before_script: "./bin/ci/before_build"
script: "bundle exec rspec -cf documentation spec"
rvm:
- "2.3.0"
- "2.2.2"
notifications:
email: michael@rabbitmq.com
services:
- rabbitmq
branches:
only:
- master
| language: ruby
bundler_args: --without development
before_script: "./bin/ci/before_build"
script: "bundle exec rspec -cf documentation spec"
rvm:
- - "2.2"
- - "2.1"
- - "2.0"
+ - "2.3.0"
? ++
+ - "2.2.2"
notifications:
email: michael@rabbitmq.com
services:
- rabbitmq
branches:
only:
- master | 5 | 0.333333 | 2 | 3 |
6a7fa369bde8d5a1033e147e0bd3a00b17e3c401 | wcfsetup/install/files/lib/acp/page/CronjobListPage.class.php | wcfsetup/install/files/lib/acp/page/CronjobListPage.class.php | <?php
namespace wcf\acp\page;
use wcf\data\cronjob\CronjobList;
use wcf\page\SortablePage;
/**
* Shows information about configured cron jobs.
*
* @author Alexander Ebert
* @copyright 2001-2019 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package WoltLabSuite\Core\Acp\Page
*
* @property CronjobList $objectList
*/
class CronjobListPage extends SortablePage {
/**
* @inheritDoc
*/
public $activeMenuItem = 'wcf.acp.menu.link.cronjob.list';
/**
* @inheritDoc
*/
public $neededPermissions = ['admin.management.canManageCronjob'];
/**
* @inheritDoc
*/
public $defaultSortField = 'cronjobID';
/**
* @inheritDoc
*/
public $validSortFields = ['cronjobID', 'nextExec', 'startMinute', 'startHour', 'startDom', 'startMonth', 'startDow'];
/**
* @inheritDoc
*/
public $objectListClassName = CronjobList::class;
/**
* @inheritDoc
*/
public function initObjectList() {
parent::initObjectList();
$this->sqlOrderBy = "cronjob.".$this->sortField." ".$this->sortOrder;
}
}
| <?php
namespace wcf\acp\page;
use wcf\data\cronjob\CronjobList;
use wcf\page\SortablePage;
/**
* Shows information about configured cron jobs.
*
* @author Alexander Ebert
* @copyright 2001-2019 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package WoltLabSuite\Core\Acp\Page
*
* @property CronjobList $objectList
*/
class CronjobListPage extends SortablePage {
/**
* @inheritDoc
*/
public $activeMenuItem = 'wcf.acp.menu.link.cronjob.list';
/**
* @inheritDoc
*/
public $neededPermissions = ['admin.management.canManageCronjob'];
/**
* @inheritDoc
*/
public $defaultSortField = 'cronjobID';
/**
* @inheritDoc
*/
public $itemsPerPage = 100;
/**
* @inheritDoc
*/
public $validSortFields = ['cronjobID', 'nextExec', 'startMinute', 'startHour', 'startDom', 'startMonth', 'startDow'];
/**
* @inheritDoc
*/
public $objectListClassName = CronjobList::class;
/**
* @inheritDoc
*/
public function initObjectList() {
parent::initObjectList();
$this->sqlOrderBy = "cronjob.".$this->sortField." ".$this->sortOrder;
}
}
| Increase number of cronjobs on cronjob list page to 100 | Increase number of cronjobs on cronjob list page to 100
Close #2953
| PHP | lgpl-2.1 | Cyperghost/WCF,Cyperghost/WCF,Cyperghost/WCF,Cyperghost/WCF,SoftCreatR/WCF,MenesesEvandro/WCF,WoltLab/WCF,MenesesEvandro/WCF,WoltLab/WCF,SoftCreatR/WCF,Cyperghost/WCF,SoftCreatR/WCF,SoftCreatR/WCF,WoltLab/WCF,WoltLab/WCF | php | ## Code Before:
<?php
namespace wcf\acp\page;
use wcf\data\cronjob\CronjobList;
use wcf\page\SortablePage;
/**
* Shows information about configured cron jobs.
*
* @author Alexander Ebert
* @copyright 2001-2019 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package WoltLabSuite\Core\Acp\Page
*
* @property CronjobList $objectList
*/
class CronjobListPage extends SortablePage {
/**
* @inheritDoc
*/
public $activeMenuItem = 'wcf.acp.menu.link.cronjob.list';
/**
* @inheritDoc
*/
public $neededPermissions = ['admin.management.canManageCronjob'];
/**
* @inheritDoc
*/
public $defaultSortField = 'cronjobID';
/**
* @inheritDoc
*/
public $validSortFields = ['cronjobID', 'nextExec', 'startMinute', 'startHour', 'startDom', 'startMonth', 'startDow'];
/**
* @inheritDoc
*/
public $objectListClassName = CronjobList::class;
/**
* @inheritDoc
*/
public function initObjectList() {
parent::initObjectList();
$this->sqlOrderBy = "cronjob.".$this->sortField." ".$this->sortOrder;
}
}
## Instruction:
Increase number of cronjobs on cronjob list page to 100
Close #2953
## Code After:
<?php
namespace wcf\acp\page;
use wcf\data\cronjob\CronjobList;
use wcf\page\SortablePage;
/**
* Shows information about configured cron jobs.
*
* @author Alexander Ebert
* @copyright 2001-2019 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package WoltLabSuite\Core\Acp\Page
*
* @property CronjobList $objectList
*/
class CronjobListPage extends SortablePage {
/**
* @inheritDoc
*/
public $activeMenuItem = 'wcf.acp.menu.link.cronjob.list';
/**
* @inheritDoc
*/
public $neededPermissions = ['admin.management.canManageCronjob'];
/**
* @inheritDoc
*/
public $defaultSortField = 'cronjobID';
/**
* @inheritDoc
*/
public $itemsPerPage = 100;
/**
* @inheritDoc
*/
public $validSortFields = ['cronjobID', 'nextExec', 'startMinute', 'startHour', 'startDom', 'startMonth', 'startDow'];
/**
* @inheritDoc
*/
public $objectListClassName = CronjobList::class;
/**
* @inheritDoc
*/
public function initObjectList() {
parent::initObjectList();
$this->sqlOrderBy = "cronjob.".$this->sortField." ".$this->sortOrder;
}
}
| <?php
namespace wcf\acp\page;
use wcf\data\cronjob\CronjobList;
use wcf\page\SortablePage;
/**
* Shows information about configured cron jobs.
*
* @author Alexander Ebert
* @copyright 2001-2019 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package WoltLabSuite\Core\Acp\Page
*
* @property CronjobList $objectList
*/
class CronjobListPage extends SortablePage {
/**
* @inheritDoc
*/
public $activeMenuItem = 'wcf.acp.menu.link.cronjob.list';
/**
* @inheritDoc
*/
public $neededPermissions = ['admin.management.canManageCronjob'];
/**
* @inheritDoc
*/
public $defaultSortField = 'cronjobID';
/**
* @inheritDoc
*/
+ public $itemsPerPage = 100;
+
+ /**
+ * @inheritDoc
+ */
public $validSortFields = ['cronjobID', 'nextExec', 'startMinute', 'startHour', 'startDom', 'startMonth', 'startDow'];
/**
* @inheritDoc
*/
public $objectListClassName = CronjobList::class;
/**
* @inheritDoc
*/
public function initObjectList() {
parent::initObjectList();
$this->sqlOrderBy = "cronjob.".$this->sortField." ".$this->sortOrder;
}
} | 5 | 0.1 | 5 | 0 |
fa0a5931aa246723adf8c96cbab2c4b78164dc2d | parse_and_run.php | parse_and_run.php | <?php
$grammar = isset($_GET['grammar']) ? "grammar=" . $_GET['grammar'] : '';
$code = isset($_GET['code']) ? "code=fun_code/" . $_GET['code'] : '';
$verbose = isset($_GET['verbose']) ? "verbose=true" : "verbose=false";
$output = array();
$exec = "/usr/local/bin/node parse_and_run.js $grammar $code $verbose";
exec($exec, $output);
echo implode($output, "\n");
?> | <?php
$grammar = isset($_GET['grammar']) ? "grammar=" . $_GET['grammar'] : '';
$code = isset($_GET['code']) ? "code=fun_code/" . $_GET['code'] : '';
$verbose = isset($_GET['verbose']) ? "verbose=" . $_GET['verbose'] : '';
$output = array();
$exec = "/usr/local/bin/node parse_and_run.js $grammar $code $verbose";
exec($exec, $output);
echo implode($output, "\n");
?> | Make the output verbose by default | Make the output verbose by default
| PHP | mit | marcuswestin/fun | php | ## Code Before:
<?php
$grammar = isset($_GET['grammar']) ? "grammar=" . $_GET['grammar'] : '';
$code = isset($_GET['code']) ? "code=fun_code/" . $_GET['code'] : '';
$verbose = isset($_GET['verbose']) ? "verbose=true" : "verbose=false";
$output = array();
$exec = "/usr/local/bin/node parse_and_run.js $grammar $code $verbose";
exec($exec, $output);
echo implode($output, "\n");
?>
## Instruction:
Make the output verbose by default
## Code After:
<?php
$grammar = isset($_GET['grammar']) ? "grammar=" . $_GET['grammar'] : '';
$code = isset($_GET['code']) ? "code=fun_code/" . $_GET['code'] : '';
$verbose = isset($_GET['verbose']) ? "verbose=" . $_GET['verbose'] : '';
$output = array();
$exec = "/usr/local/bin/node parse_and_run.js $grammar $code $verbose";
exec($exec, $output);
echo implode($output, "\n");
?> | <?php
$grammar = isset($_GET['grammar']) ? "grammar=" . $_GET['grammar'] : '';
$code = isset($_GET['code']) ? "code=fun_code/" . $_GET['code'] : '';
- $verbose = isset($_GET['verbose']) ? "verbose=true" : "verbose=false";
? ---- ^ ^ ^^^^^^^
+ $verbose = isset($_GET['verbose']) ? "verbose=" . $_GET['verbose'] : '';
? ^ ^^^^^^^ ^^^^^^^
$output = array();
$exec = "/usr/local/bin/node parse_and_run.js $grammar $code $verbose";
exec($exec, $output);
echo implode($output, "\n");
?> | 2 | 0.2 | 1 | 1 |
e30c9bc0debbe9ee66e0e7fe2043ddf083175548 | dev-docs/release-notes.md | dev-docs/release-notes.md | ---
layout: page
title: Release Notes
description: Release Notes
pid: 40
top_nav_section: dev_docs
nav_section: reference
---
<div class="bs-docs-section" markdown="1">
# Release Notes
{:.no_toc}
This page has links to release notes for each of the projects associated with Prebid.org.
* TOC
{:toc}
## Prebid.js
+ [Release notes on GitHub](https://github.com/prebid/Prebid.js/releases)
## Prebid Server
+ [Release notes on GitHub](https://github.com/prebid/prebid-server/releases)
## Prebid Mobile
Coming soon!
## Related Reading
+ [Getting Started]({{site.github.com}}/dev-docs/getting-started.html)
+ [Troubleshooting Guide]({{site.github.com}}/dev-docs/prebid-troubleshooting-guide.html)
</div>
| ---
layout: page
title: Release Notes
description: Release Notes
pid: 40
top_nav_section: dev_docs
nav_section: reference
---
<div class="bs-docs-section" markdown="1">
# Release Notes
{:.no_toc}
This page has links to release notes for each of the projects associated with Prebid.org.
* TOC
{:toc}
## Prebid.js
+ [Release notes on GitHub](https://github.com/prebid/Prebid.js/releases)
## Prebid Server
+ [Release notes on GitHub](https://github.com/prebid/prebid-server/releases)
## Prebid Mobile
+ [iOS release notes on GitHub](https://github.com/prebid/prebid-mobile-ios/releases)
+ [Android release notes on GitHub](https://github.com/prebid/prebid-mobile-android/releases)
## Related Reading
+ [Getting Started with Prebid.js]({{site.baseurl}}/dev-docs/getting-started.html)
+ [Prebid.js Troubleshooting Guide]({{site.baseurl}}/dev-docs/prebid-troubleshooting-guide.html)
+ [How Does Prebid Mobile Work?]({{site.baseurl}}/prebid-mobile/prebid-mobile.html)
</div>
| Add Prebid Mobile to 'Release Notes' page | Add Prebid Mobile to 'Release Notes' page
(And add some links and do a little cleanup while we're in there.)
| Markdown | apache-2.0 | sonobi/prebid.github.io,prebid/prebid.github.io,prebid/prebid.github.io,sonobi/prebid.github.io,sonobi/prebid.github.io,prebid/prebid.github.io | markdown | ## Code Before:
---
layout: page
title: Release Notes
description: Release Notes
pid: 40
top_nav_section: dev_docs
nav_section: reference
---
<div class="bs-docs-section" markdown="1">
# Release Notes
{:.no_toc}
This page has links to release notes for each of the projects associated with Prebid.org.
* TOC
{:toc}
## Prebid.js
+ [Release notes on GitHub](https://github.com/prebid/Prebid.js/releases)
## Prebid Server
+ [Release notes on GitHub](https://github.com/prebid/prebid-server/releases)
## Prebid Mobile
Coming soon!
## Related Reading
+ [Getting Started]({{site.github.com}}/dev-docs/getting-started.html)
+ [Troubleshooting Guide]({{site.github.com}}/dev-docs/prebid-troubleshooting-guide.html)
</div>
## Instruction:
Add Prebid Mobile to 'Release Notes' page
(And add some links and do a little cleanup while we're in there.)
## Code After:
---
layout: page
title: Release Notes
description: Release Notes
pid: 40
top_nav_section: dev_docs
nav_section: reference
---
<div class="bs-docs-section" markdown="1">
# Release Notes
{:.no_toc}
This page has links to release notes for each of the projects associated with Prebid.org.
* TOC
{:toc}
## Prebid.js
+ [Release notes on GitHub](https://github.com/prebid/Prebid.js/releases)
## Prebid Server
+ [Release notes on GitHub](https://github.com/prebid/prebid-server/releases)
## Prebid Mobile
+ [iOS release notes on GitHub](https://github.com/prebid/prebid-mobile-ios/releases)
+ [Android release notes on GitHub](https://github.com/prebid/prebid-mobile-android/releases)
## Related Reading
+ [Getting Started with Prebid.js]({{site.baseurl}}/dev-docs/getting-started.html)
+ [Prebid.js Troubleshooting Guide]({{site.baseurl}}/dev-docs/prebid-troubleshooting-guide.html)
+ [How Does Prebid Mobile Work?]({{site.baseurl}}/prebid-mobile/prebid-mobile.html)
</div>
| ---
layout: page
title: Release Notes
description: Release Notes
pid: 40
top_nav_section: dev_docs
nav_section: reference
---
<div class="bs-docs-section" markdown="1">
# Release Notes
{:.no_toc}
This page has links to release notes for each of the projects associated with Prebid.org.
* TOC
{:toc}
## Prebid.js
+ [Release notes on GitHub](https://github.com/prebid/Prebid.js/releases)
## Prebid Server
+ [Release notes on GitHub](https://github.com/prebid/prebid-server/releases)
## Prebid Mobile
- Coming soon!
+ + [iOS release notes on GitHub](https://github.com/prebid/prebid-mobile-ios/releases)
+ + [Android release notes on GitHub](https://github.com/prebid/prebid-mobile-android/releases)
## Related Reading
- + [Getting Started]({{site.github.com}}/dev-docs/getting-started.html)
? ^^^^ ^^^^^
+ + [Getting Started with Prebid.js]({{site.baseurl}}/dev-docs/getting-started.html)
? +++++++++++++++ ^^^^ ^^
- + [Troubleshooting Guide]({{site.github.com}}/dev-docs/prebid-troubleshooting-guide.html)
? ^^^^ ^^^^^
+ + [Prebid.js Troubleshooting Guide]({{site.baseurl}}/dev-docs/prebid-troubleshooting-guide.html)
? ++++++++++ ^^^^ ^^
+ + [How Does Prebid Mobile Work?]({{site.baseurl}}/prebid-mobile/prebid-mobile.html)
</div> | 8 | 0.216216 | 5 | 3 |
a1e9c31390e34c116eccd339728e4877b062a229 | tox.ini | tox.ini | [tox]
envlist = py26, py27, pypy
[testenv]
deps =
nose
mock
coverage>=4.0a5
unittest2
git+https://github.com/Metaswitch/python-etcd.git@3f14a002c9a75df3242de3d81a91a2e6bd32c5a8#egg=python-etcd
commands=nosetests --with-coverage
[testenv:pypy]
# Pypy doesn't test code coverage because it slows PyPy way down. Also, Neutron
# doesn't support PyPy so we don't care if those tests fail.
commands=nosetests calico/felix/test calico/acl_manager/test calico/test
deps =
nose
mock
coverage>=4.0a5
unittest2
git+https://github.com/Metaswitch/python-etcd.git@3f14a002c9a75df3242de3d81a91a2e6bd32c5a8#egg=python-etcd
git+https://github.com/surfly/gevent.git#egg=gevent
| [tox]
envlist = py26, py27, pypy
[testenv]
deps =
nose
mock
coverage>=4.0a5
unittest2
git+https://github.com/Metaswitch/python-etcd.git@3f14a002c9a75df3242de3d81a91a2e6bd32c5a8#egg=python-etcd
commands=nosetests --with-coverage
[testenv:pypy]
# Pypy doesn't test code coverage because it slows PyPy way down. Also, Neutron
# doesn't support PyPy so we don't care if those tests fail.
commands=nosetests calico/felix/test calico/test
deps =
nose
mock
coverage>=4.0a5
unittest2
git+https://github.com/Metaswitch/python-etcd.git@3f14a002c9a75df3242de3d81a91a2e6bd32c5a8#egg=python-etcd
git+https://github.com/surfly/gevent.git#egg=gevent
| Remove old reference to aclmanager tests | Remove old reference to aclmanager tests
| INI | apache-2.0 | Metaswitch/calico,anortef/calico,kasisnu/calico,alexhersh/calico,ocadotechnology/calico,beddari/calico,ocadotechnology/calico,anortef/calico,beddari/calico,TrimBiggs/calico,TrimBiggs/calico,kasisnu/calico,matthewdupre/felix,neiljerram/felix,Metaswitch/calico,matthewdupre/felix,neiljerram/felix,neiljerram/felix,neiljerram/felix,alexhersh/calico | ini | ## Code Before:
[tox]
envlist = py26, py27, pypy
[testenv]
deps =
nose
mock
coverage>=4.0a5
unittest2
git+https://github.com/Metaswitch/python-etcd.git@3f14a002c9a75df3242de3d81a91a2e6bd32c5a8#egg=python-etcd
commands=nosetests --with-coverage
[testenv:pypy]
# Pypy doesn't test code coverage because it slows PyPy way down. Also, Neutron
# doesn't support PyPy so we don't care if those tests fail.
commands=nosetests calico/felix/test calico/acl_manager/test calico/test
deps =
nose
mock
coverage>=4.0a5
unittest2
git+https://github.com/Metaswitch/python-etcd.git@3f14a002c9a75df3242de3d81a91a2e6bd32c5a8#egg=python-etcd
git+https://github.com/surfly/gevent.git#egg=gevent
## Instruction:
Remove old reference to aclmanager tests
## Code After:
[tox]
envlist = py26, py27, pypy
[testenv]
deps =
nose
mock
coverage>=4.0a5
unittest2
git+https://github.com/Metaswitch/python-etcd.git@3f14a002c9a75df3242de3d81a91a2e6bd32c5a8#egg=python-etcd
commands=nosetests --with-coverage
[testenv:pypy]
# Pypy doesn't test code coverage because it slows PyPy way down. Also, Neutron
# doesn't support PyPy so we don't care if those tests fail.
commands=nosetests calico/felix/test calico/test
deps =
nose
mock
coverage>=4.0a5
unittest2
git+https://github.com/Metaswitch/python-etcd.git@3f14a002c9a75df3242de3d81a91a2e6bd32c5a8#egg=python-etcd
git+https://github.com/surfly/gevent.git#egg=gevent
| [tox]
envlist = py26, py27, pypy
[testenv]
deps =
nose
mock
coverage>=4.0a5
unittest2
git+https://github.com/Metaswitch/python-etcd.git@3f14a002c9a75df3242de3d81a91a2e6bd32c5a8#egg=python-etcd
commands=nosetests --with-coverage
[testenv:pypy]
# Pypy doesn't test code coverage because it slows PyPy way down. Also, Neutron
# doesn't support PyPy so we don't care if those tests fail.
- commands=nosetests calico/felix/test calico/acl_manager/test calico/test
? ------------ ------------
+ commands=nosetests calico/felix/test calico/test
deps =
nose
mock
coverage>=4.0a5
unittest2
git+https://github.com/Metaswitch/python-etcd.git@3f14a002c9a75df3242de3d81a91a2e6bd32c5a8#egg=python-etcd
git+https://github.com/surfly/gevent.git#egg=gevent | 2 | 0.086957 | 1 | 1 |
18de95a09f682987e4d250f1e94ef6074890275f | docs/references/resources.rst | docs/references/resources.rst | Resources
=========
* `QPDF Manual`_
* `PDF 1.7`_ ISO Specification PDF 32000-1:2008
* `Adobe Supplement to ISO 32000 BaseVersion 1.7 ExtensionLevel 3`_, Adobe Acrobat 9.0, June 2008, for AESv3
* Other `Adobe extensions`_ to the PDF specification
.. _QPDF Manual: https://qpdf.readthedocs.io/
.. _PDF 1.7: https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf
.. _Adobe extensions: https://www.adobe.com/devnet/pdf/pdf_reference.html
.. _Adobe Supplement to ISO 32000 BaseVersion 1.7 ExtensionLevel 3: https://www.adobe.com/content/dam/acom/en/devnet/pdf/adobe_supplement_iso32000.pdf
For information about copyrights and licenses, including those associated with the
images in this documentation, see the file ``debian/copyright``.
| Resources
=========
* `QPDF Manual`_
* `PDF 1.7`_ ISO Specification PDF 32000-1:2008
* `Adobe Supplement to ISO 32000 BaseVersion 1.7 ExtensionLevel 3`_, Adobe Acrobat 9.0, June 2008, for AESv3
* Other `Adobe extensions`_ to the PDF specification
.. _QPDF Manual: https://qpdf.readthedocs.io/
.. _PDF 1.7: https://opensource.adobe.com/dc-acrobat-sdk-docs/standards/pdfstandards/pdf/PDF32000_2008.pdf
.. _Adobe extensions: https://www.adobe.com/devnet/pdf/pdf_reference.html
.. _Adobe Supplement to ISO 32000 BaseVersion 1.7 ExtensionLevel 3: https://www.adobe.com/content/dam/acom/en/devnet/pdf/adobe_supplement_iso32000.pdf
For information about copyrights and licenses, including those associated with the
images in this documentation, see the file ``debian/copyright``.
| Fix broken link to PDF 1.7 Specification | Manual: Fix broken link to PDF 1.7 Specification
| reStructuredText | mpl-2.0 | pikepdf/pikepdf,pikepdf/pikepdf,pikepdf/pikepdf | restructuredtext | ## Code Before:
Resources
=========
* `QPDF Manual`_
* `PDF 1.7`_ ISO Specification PDF 32000-1:2008
* `Adobe Supplement to ISO 32000 BaseVersion 1.7 ExtensionLevel 3`_, Adobe Acrobat 9.0, June 2008, for AESv3
* Other `Adobe extensions`_ to the PDF specification
.. _QPDF Manual: https://qpdf.readthedocs.io/
.. _PDF 1.7: https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf
.. _Adobe extensions: https://www.adobe.com/devnet/pdf/pdf_reference.html
.. _Adobe Supplement to ISO 32000 BaseVersion 1.7 ExtensionLevel 3: https://www.adobe.com/content/dam/acom/en/devnet/pdf/adobe_supplement_iso32000.pdf
For information about copyrights and licenses, including those associated with the
images in this documentation, see the file ``debian/copyright``.
## Instruction:
Manual: Fix broken link to PDF 1.7 Specification
## Code After:
Resources
=========
* `QPDF Manual`_
* `PDF 1.7`_ ISO Specification PDF 32000-1:2008
* `Adobe Supplement to ISO 32000 BaseVersion 1.7 ExtensionLevel 3`_, Adobe Acrobat 9.0, June 2008, for AESv3
* Other `Adobe extensions`_ to the PDF specification
.. _QPDF Manual: https://qpdf.readthedocs.io/
.. _PDF 1.7: https://opensource.adobe.com/dc-acrobat-sdk-docs/standards/pdfstandards/pdf/PDF32000_2008.pdf
.. _Adobe extensions: https://www.adobe.com/devnet/pdf/pdf_reference.html
.. _Adobe Supplement to ISO 32000 BaseVersion 1.7 ExtensionLevel 3: https://www.adobe.com/content/dam/acom/en/devnet/pdf/adobe_supplement_iso32000.pdf
For information about copyrights and licenses, including those associated with the
images in this documentation, see the file ``debian/copyright``.
| Resources
=========
* `QPDF Manual`_
* `PDF 1.7`_ ISO Specification PDF 32000-1:2008
* `Adobe Supplement to ISO 32000 BaseVersion 1.7 ExtensionLevel 3`_, Adobe Acrobat 9.0, June 2008, for AESv3
* Other `Adobe extensions`_ to the PDF specification
.. _QPDF Manual: https://qpdf.readthedocs.io/
- .. _PDF 1.7: https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf
+ .. _PDF 1.7: https://opensource.adobe.com/dc-acrobat-sdk-docs/standards/pdfstandards/pdf/PDF32000_2008.pdf
.. _Adobe extensions: https://www.adobe.com/devnet/pdf/pdf_reference.html
.. _Adobe Supplement to ISO 32000 BaseVersion 1.7 ExtensionLevel 3: https://www.adobe.com/content/dam/acom/en/devnet/pdf/adobe_supplement_iso32000.pdf
For information about copyrights and licenses, including those associated with the
images in this documentation, see the file ``debian/copyright``. | 2 | 0.095238 | 1 | 1 |
3987b7c957edc105fde0b4c022a50bd060be6afe | .travis.yml | .travis.yml | language: python
python:
- "2.6"
- "2.7"
- "3.3"
- "3.4"
- "3.5"
- "3.6"
install:
- pip install lxml -e .
- pip install -U codecov pytest-cov
script:
py.test --cov-report term --cov=cssselect
after_success:
codecov
| language: python
python:
- '2.6'
- '2.7'
- '3.3'
- '3.4'
- '3.5'
- '3.6'
install:
- pip install lxml -e .
- pip install -U codecov pytest-cov
script:
py.test --cov-report term --cov=cssselect
after_success:
codecov
deploy:
provider: pypi
distributions: sdist bdist_wheel
user: redapple
password:
secure: T1PBD+ocIGwHMbBHPqzu7UZxpkB0w98KtEIkNzLXNQcF7JpjugZNwz4xX2xVhi8yvUQ257VtLSKpIOT2FWxrfLrgTZKbTd6Q7V5Lf3HKzLomOKUKMAd54gsOuismE27CT/SHbexskACgwVwkyG9Y3dlG6m/ZBgqoPAGaJrScjEU=
on:
tags: true
repo: scrapy/cssselect
| Add automatic PyPI deploy to Travis CI config | Add automatic PyPI deploy to Travis CI config
| YAML | bsd-3-clause | SimonSapin/cssselect | yaml | ## Code Before:
language: python
python:
- "2.6"
- "2.7"
- "3.3"
- "3.4"
- "3.5"
- "3.6"
install:
- pip install lxml -e .
- pip install -U codecov pytest-cov
script:
py.test --cov-report term --cov=cssselect
after_success:
codecov
## Instruction:
Add automatic PyPI deploy to Travis CI config
## Code After:
language: python
python:
- '2.6'
- '2.7'
- '3.3'
- '3.4'
- '3.5'
- '3.6'
install:
- pip install lxml -e .
- pip install -U codecov pytest-cov
script:
py.test --cov-report term --cov=cssselect
after_success:
codecov
deploy:
provider: pypi
distributions: sdist bdist_wheel
user: redapple
password:
secure: T1PBD+ocIGwHMbBHPqzu7UZxpkB0w98KtEIkNzLXNQcF7JpjugZNwz4xX2xVhi8yvUQ257VtLSKpIOT2FWxrfLrgTZKbTd6Q7V5Lf3HKzLomOKUKMAd54gsOuismE27CT/SHbexskACgwVwkyG9Y3dlG6m/ZBgqoPAGaJrScjEU=
on:
tags: true
repo: scrapy/cssselect
| language: python
-
python:
- - "2.6"
? ^ ^
+ - '2.6'
? ^ ^
- - "2.7"
? ^ ^
+ - '2.7'
? ^ ^
- - "3.3"
? ^ ^
+ - '3.3'
? ^ ^
- - "3.4"
? ^ ^
+ - '3.4'
? ^ ^
- - "3.5"
? ^ ^
+ - '3.5'
? ^ ^
- - "3.6"
? ^ ^
+ - '3.6'
? ^ ^
install:
- pip install lxml -e .
- pip install -U codecov pytest-cov
script:
py.test --cov-report term --cov=cssselect
after_success:
codecov
+
+ deploy:
+ provider: pypi
+ distributions: sdist bdist_wheel
+ user: redapple
+ password:
+ secure: T1PBD+ocIGwHMbBHPqzu7UZxpkB0w98KtEIkNzLXNQcF7JpjugZNwz4xX2xVhi8yvUQ257VtLSKpIOT2FWxrfLrgTZKbTd6Q7V5Lf3HKzLomOKUKMAd54gsOuismE27CT/SHbexskACgwVwkyG9Y3dlG6m/ZBgqoPAGaJrScjEU=
+ on:
+ tags: true
+ repo: scrapy/cssselect | 23 | 1.210526 | 16 | 7 |
9c503fa577f2f2c079d675fb4d4e01fff1f05fc7 | lib/jquery-tmpl-rails/jquery_template.rb | lib/jquery-tmpl-rails/jquery_template.rb | require 'sprockets'
require 'action_view'
require 'action_view/helpers'
module JqueryTmplRails
class JqueryTemplate < Tilt::Template
include ActionView::Helpers::JavaScriptHelper
def self.default_mime_type
'application/javascript'
end
def prepare
@prefix = normalize_prefix(Rails.configuration.jquery_templates.prefix)
end
def evaluate(scope, locals, &block)
%{jQuery.template("#{template_name(scope)}", "#{escape_javascript(data)}");}
end
private
def normalize_prefix(prefix)
if prefix.length > 0
prefix = prefix[1, prefix.length - 1] if prefix.start_with?("/")
prefix += "/" unless prefix.end_with?("/")
end
prefix
end
def template_name(scope)
scope.logical_path.sub(@prefix, "")
end
end
end
| require 'sprockets'
require 'tilt'
require 'action_view'
require 'action_view/helpers'
module JqueryTmplRails
class JqueryTemplate < Tilt::Template
include ActionView::Helpers::JavaScriptHelper
def self.default_mime_type
'application/javascript'
end
def prepare
@prefix = normalize_prefix(Rails.configuration.jquery_templates.prefix)
end
def evaluate(scope, locals, &block)
%{jQuery.template("#{template_name(scope)}", "#{escape_javascript(data)}");}
end
private
def normalize_prefix(prefix)
if prefix.length > 0
prefix = prefix[1, prefix.length - 1] if prefix.start_with?("/")
prefix += "/" unless prefix.end_with?("/")
end
prefix
end
def template_name(scope)
scope.logical_path.sub(@prefix, "")
end
end
end
| Make sure Tilt is required before the preprocessor is defined. | Make sure Tilt is required before the preprocessor is defined.
| Ruby | mit | jimmycuadra/jquery-tmpl-rails,jimmycuadra/jquery-tmpl-rails | ruby | ## Code Before:
require 'sprockets'
require 'action_view'
require 'action_view/helpers'
module JqueryTmplRails
class JqueryTemplate < Tilt::Template
include ActionView::Helpers::JavaScriptHelper
def self.default_mime_type
'application/javascript'
end
def prepare
@prefix = normalize_prefix(Rails.configuration.jquery_templates.prefix)
end
def evaluate(scope, locals, &block)
%{jQuery.template("#{template_name(scope)}", "#{escape_javascript(data)}");}
end
private
def normalize_prefix(prefix)
if prefix.length > 0
prefix = prefix[1, prefix.length - 1] if prefix.start_with?("/")
prefix += "/" unless prefix.end_with?("/")
end
prefix
end
def template_name(scope)
scope.logical_path.sub(@prefix, "")
end
end
end
## Instruction:
Make sure Tilt is required before the preprocessor is defined.
## Code After:
require 'sprockets'
require 'tilt'
require 'action_view'
require 'action_view/helpers'
module JqueryTmplRails
class JqueryTemplate < Tilt::Template
include ActionView::Helpers::JavaScriptHelper
def self.default_mime_type
'application/javascript'
end
def prepare
@prefix = normalize_prefix(Rails.configuration.jquery_templates.prefix)
end
def evaluate(scope, locals, &block)
%{jQuery.template("#{template_name(scope)}", "#{escape_javascript(data)}");}
end
private
def normalize_prefix(prefix)
if prefix.length > 0
prefix = prefix[1, prefix.length - 1] if prefix.start_with?("/")
prefix += "/" unless prefix.end_with?("/")
end
prefix
end
def template_name(scope)
scope.logical_path.sub(@prefix, "")
end
end
end
| require 'sprockets'
+ require 'tilt'
require 'action_view'
require 'action_view/helpers'
module JqueryTmplRails
class JqueryTemplate < Tilt::Template
include ActionView::Helpers::JavaScriptHelper
def self.default_mime_type
'application/javascript'
end
def prepare
@prefix = normalize_prefix(Rails.configuration.jquery_templates.prefix)
end
def evaluate(scope, locals, &block)
%{jQuery.template("#{template_name(scope)}", "#{escape_javascript(data)}");}
end
private
def normalize_prefix(prefix)
if prefix.length > 0
prefix = prefix[1, prefix.length - 1] if prefix.start_with?("/")
prefix += "/" unless prefix.end_with?("/")
end
prefix
end
def template_name(scope)
scope.logical_path.sub(@prefix, "")
end
end
end | 1 | 0.027778 | 1 | 0 |
5bab4d3d8a9a53765a0587e150413a4a9014d418 | src/controller/CategorizedController.js | src/controller/CategorizedController.js | var _ = require('underscore'),
ControlBones = require('./ControlBones'),
AmountEntry = require('../model/AmountEntry'),
AmountEntryCollection = require('../model/AmountEntryCollection'),
ParticularsModel = require('../model/ParticularsModel'),
StatementCollection = require('../model/StatementCollection'),
StatementsByCategory = require('../model/operations/statements/StatementsByCategory'),
TotalByMonth = require('../model/operations/entries/TotalByMonth'),
MonthlyTable = require('../view/table/MonthlyTable');
var CategorizedController = ControlBones.extend({
title: 'Categorized Table',
source: 'fieldnamehere',
render: function(data) {
var collection = new AmountEntryCollection(_.map(data[this.source], function(note) {
return new AmountEntry(note);
}));
var categorized = (new StatementsByCategory()).run(collection);
var monthly = categorized.reduce(function(carry, statement) {
statement.set(
'entries',
(new TotalByMonth()).run(statement.get('entries'))
);
carry.add(statement);
return carry;
}, new StatementCollection());
return new ParticularsModel({
name: this.title,
dataset: monthly,
displayType: MonthlyTable,
editable: false
});
}
});
module.exports = CategorizedController;
| var _ = require('underscore'),
ControlBones = require('./ControlBones'),
AmountEntry = require('../model/AmountEntry'),
AmountEntryCollection = require('../model/AmountEntryCollection'),
ParticularsModel = require('../model/ParticularsModel'),
StatementCollection = require('../model/StatementCollection'),
StatementsByCategory = require('../model/operations/statements/StatementsByCategory'),
TotalByMonth = require('../model/operations/entries/TotalByMonth'),
MonthlyTable = require('../view/table/MonthlyTable');
var CategorizedController = ControlBones.extend({
title: 'Categorized Table',
source: 'fieldnamehere',
editable: false,
render: function(data) {
var collection = new AmountEntryCollection(_.map(data[this.source], function(note) {
return new AmountEntry(note);
}));
var categorized = (new StatementsByCategory()).run(collection);
var monthly = categorized.reduce(function(carry, statement) {
statement.set(
'entries',
(new TotalByMonth()).run(statement.get('entries'))
);
carry.add(statement);
return carry;
}, new StatementCollection());
return new ParticularsModel({
name: this.title,
dataset: monthly,
displayType: MonthlyTable,
editable: this.editable
});
}
});
module.exports = CategorizedController;
| Allow conroller to set editable state | Allow conroller to set editable state
| JavaScript | mit | onebytegone/banknote-client,onebytegone/banknote-client | javascript | ## Code Before:
var _ = require('underscore'),
ControlBones = require('./ControlBones'),
AmountEntry = require('../model/AmountEntry'),
AmountEntryCollection = require('../model/AmountEntryCollection'),
ParticularsModel = require('../model/ParticularsModel'),
StatementCollection = require('../model/StatementCollection'),
StatementsByCategory = require('../model/operations/statements/StatementsByCategory'),
TotalByMonth = require('../model/operations/entries/TotalByMonth'),
MonthlyTable = require('../view/table/MonthlyTable');
var CategorizedController = ControlBones.extend({
title: 'Categorized Table',
source: 'fieldnamehere',
render: function(data) {
var collection = new AmountEntryCollection(_.map(data[this.source], function(note) {
return new AmountEntry(note);
}));
var categorized = (new StatementsByCategory()).run(collection);
var monthly = categorized.reduce(function(carry, statement) {
statement.set(
'entries',
(new TotalByMonth()).run(statement.get('entries'))
);
carry.add(statement);
return carry;
}, new StatementCollection());
return new ParticularsModel({
name: this.title,
dataset: monthly,
displayType: MonthlyTable,
editable: false
});
}
});
module.exports = CategorizedController;
## Instruction:
Allow conroller to set editable state
## Code After:
var _ = require('underscore'),
ControlBones = require('./ControlBones'),
AmountEntry = require('../model/AmountEntry'),
AmountEntryCollection = require('../model/AmountEntryCollection'),
ParticularsModel = require('../model/ParticularsModel'),
StatementCollection = require('../model/StatementCollection'),
StatementsByCategory = require('../model/operations/statements/StatementsByCategory'),
TotalByMonth = require('../model/operations/entries/TotalByMonth'),
MonthlyTable = require('../view/table/MonthlyTable');
var CategorizedController = ControlBones.extend({
title: 'Categorized Table',
source: 'fieldnamehere',
editable: false,
render: function(data) {
var collection = new AmountEntryCollection(_.map(data[this.source], function(note) {
return new AmountEntry(note);
}));
var categorized = (new StatementsByCategory()).run(collection);
var monthly = categorized.reduce(function(carry, statement) {
statement.set(
'entries',
(new TotalByMonth()).run(statement.get('entries'))
);
carry.add(statement);
return carry;
}, new StatementCollection());
return new ParticularsModel({
name: this.title,
dataset: monthly,
displayType: MonthlyTable,
editable: this.editable
});
}
});
module.exports = CategorizedController;
| var _ = require('underscore'),
ControlBones = require('./ControlBones'),
AmountEntry = require('../model/AmountEntry'),
AmountEntryCollection = require('../model/AmountEntryCollection'),
ParticularsModel = require('../model/ParticularsModel'),
StatementCollection = require('../model/StatementCollection'),
StatementsByCategory = require('../model/operations/statements/StatementsByCategory'),
TotalByMonth = require('../model/operations/entries/TotalByMonth'),
MonthlyTable = require('../view/table/MonthlyTable');
var CategorizedController = ControlBones.extend({
title: 'Categorized Table',
source: 'fieldnamehere',
+ editable: false,
render: function(data) {
var collection = new AmountEntryCollection(_.map(data[this.source], function(note) {
return new AmountEntry(note);
}));
var categorized = (new StatementsByCategory()).run(collection);
var monthly = categorized.reduce(function(carry, statement) {
statement.set(
'entries',
(new TotalByMonth()).run(statement.get('entries'))
);
carry.add(statement);
return carry;
}, new StatementCollection());
return new ParticularsModel({
name: this.title,
dataset: monthly,
displayType: MonthlyTable,
- editable: false
? ^ -
+ editable: this.editable
? ^^^^^^^^^ +
});
}
});
module.exports = CategorizedController; | 3 | 0.075 | 2 | 1 |
5490beead901a938c5d846b1b0c48352adc4aa8b | tests/Unit.php | tests/Unit.php | <?php
class Unit extends PHPUnit_Framework_TestCase {
public function subject($params = array(), $options = array()) {
$options += array(
'mock' => false,
'methods' => array(),
);
$class = 'alfmarks\\' . str_replace('Test', '', get_called_class());
if ($options['mock']) {
return $this->getMock($class, $options['methods'], $params);
}
return new $class($params);
}
} | <?php
class Unit extends PHPUnit_Framework_TestCase {
public function subject($params = array(), $options = array()) {
$options += array(
'mock' => false,
'methods' => array(),
);
$class = 'alfmarks\\' . str_replace('Test', '', get_called_class());
if ($options['mock']) {
return $this->getMockBuilder($class)
->setMethods($options['methods'])
->getMock();
}
return new $class($params);
}
}
| Update for the newer version of phpunit. | Update for the newer version of phpunit.
| PHP | mit | blainesch/alfred-chrome-bookmarks | php | ## Code Before:
<?php
class Unit extends PHPUnit_Framework_TestCase {
public function subject($params = array(), $options = array()) {
$options += array(
'mock' => false,
'methods' => array(),
);
$class = 'alfmarks\\' . str_replace('Test', '', get_called_class());
if ($options['mock']) {
return $this->getMock($class, $options['methods'], $params);
}
return new $class($params);
}
}
## Instruction:
Update for the newer version of phpunit.
## Code After:
<?php
class Unit extends PHPUnit_Framework_TestCase {
public function subject($params = array(), $options = array()) {
$options += array(
'mock' => false,
'methods' => array(),
);
$class = 'alfmarks\\' . str_replace('Test', '', get_called_class());
if ($options['mock']) {
return $this->getMockBuilder($class)
->setMethods($options['methods'])
->getMock();
}
return new $class($params);
}
}
| <?php
class Unit extends PHPUnit_Framework_TestCase {
public function subject($params = array(), $options = array()) {
$options += array(
'mock' => false,
'methods' => array(),
);
$class = 'alfmarks\\' . str_replace('Test', '', get_called_class());
if ($options['mock']) {
- return $this->getMock($class, $options['methods'], $params);
+ return $this->getMockBuilder($class)
+ ->setMethods($options['methods'])
+ ->getMock();
}
return new $class($params);
}
} | 4 | 0.235294 | 3 | 1 |
301cecc9d91df5a254883d3c8231f1d9547b99b6 | README.md | README.md |
[](https://travis-ci.org/snowio/magento2-attribute-set-code)
|
[](https://travis-ci.org/snowio/magento2-attribute-set-code)
| Stop using shields.io for Travis badge | Stop using shields.io for Travis badge | Markdown | mit | snowio/magento2-attribute-set-code | markdown | ## Code Before:
[](https://travis-ci.org/snowio/magento2-attribute-set-code)
## Instruction:
Stop using shields.io for Travis badge
## Code After:
[](https://travis-ci.org/snowio/magento2-attribute-set-code)
|
- [](https://travis-ci.org/snowio/magento2-attribute-set-code)
? --------------- -- ---------- -
+ [](https://travis-ci.org/snowio/magento2-attribute-set-code)
? +++++++ +++++++++
| 2 | 1 | 1 | 1 |
87e5dbb1361aa950eb1848f349e80db18201c643 | zeusci/zeus/static/zeus/js/apps/projects/views.js | zeusci/zeus/static/zeus/js/apps/projects/views.js | zeus.simpleModule('apps.projects.views', function (views, Marionette, $) {
views.ProjectLayout = Marionette.Layout.extend({
template: "#project-layout-template",
regions: {
contentRegion: "#project-content-region"
}
});
views.ProjectDetails = zeus.views.View.extend({
template: "#project-details-template",
modelContextName: "project",
events: {
"click .show-buildset": "showBuildset"
},
showBuildset: function (event) {
event.preventDefault();
event.stopPropagation();
var number = this.getBuildsetNumber(event);
zeus.trigger('show:buildset', this.model.get('name'), number)
},
getBuildsetNumber: function (event) {
var el = $(event.target);
return el.attr('buildsetNumber');
}
});
views.BuildsetDetails = zeus.views.View.extend({
template: "#buildset-details-template",
modelContextName: "buildset"
});
}, Marionette, $);
| zeus.simpleModule('apps.projects.views', function (views, Marionette, $) {
views.ProjectLayout = Marionette.Layout.extend({
template: "#project-layout-template",
regions: {
contentRegion: "#project-content-region"
}
});
views.ProjectDetails = zeus.views.View.extend({
template: "#project-details-template",
modelContextName: "project",
events: {
"click .show-buildset": "showBuildset"
},
showBuildset: function (event) {
event.preventDefault();
event.stopPropagation();
var url = $(event.target).attr('href');
zeus.navigate(url, {trigger: true});
}
});
views.BuildsetDetails = zeus.views.View.extend({
template: "#buildset-details-template",
modelContextName: "buildset"
});
}, Marionette, $);
| Use router to navigate to buildset | Use router to navigate to buildset
| JavaScript | mit | lukaszb/zeusci,lukaszb/zeusci,lukaszb/zeusci,lukaszb/zeusci | javascript | ## Code Before:
zeus.simpleModule('apps.projects.views', function (views, Marionette, $) {
views.ProjectLayout = Marionette.Layout.extend({
template: "#project-layout-template",
regions: {
contentRegion: "#project-content-region"
}
});
views.ProjectDetails = zeus.views.View.extend({
template: "#project-details-template",
modelContextName: "project",
events: {
"click .show-buildset": "showBuildset"
},
showBuildset: function (event) {
event.preventDefault();
event.stopPropagation();
var number = this.getBuildsetNumber(event);
zeus.trigger('show:buildset', this.model.get('name'), number)
},
getBuildsetNumber: function (event) {
var el = $(event.target);
return el.attr('buildsetNumber');
}
});
views.BuildsetDetails = zeus.views.View.extend({
template: "#buildset-details-template",
modelContextName: "buildset"
});
}, Marionette, $);
## Instruction:
Use router to navigate to buildset
## Code After:
zeus.simpleModule('apps.projects.views', function (views, Marionette, $) {
views.ProjectLayout = Marionette.Layout.extend({
template: "#project-layout-template",
regions: {
contentRegion: "#project-content-region"
}
});
views.ProjectDetails = zeus.views.View.extend({
template: "#project-details-template",
modelContextName: "project",
events: {
"click .show-buildset": "showBuildset"
},
showBuildset: function (event) {
event.preventDefault();
event.stopPropagation();
var url = $(event.target).attr('href');
zeus.navigate(url, {trigger: true});
}
});
views.BuildsetDetails = zeus.views.View.extend({
template: "#buildset-details-template",
modelContextName: "buildset"
});
}, Marionette, $);
| zeus.simpleModule('apps.projects.views', function (views, Marionette, $) {
views.ProjectLayout = Marionette.Layout.extend({
template: "#project-layout-template",
regions: {
contentRegion: "#project-content-region"
}
});
views.ProjectDetails = zeus.views.View.extend({
template: "#project-details-template",
modelContextName: "project",
events: {
"click .show-buildset": "showBuildset"
},
showBuildset: function (event) {
event.preventDefault();
event.stopPropagation();
- var number = this.getBuildsetNumber(event);
- zeus.trigger('show:buildset', this.model.get('name'), number)
- },
-
- getBuildsetNumber: function (event) {
- var el = $(event.target);
? ^
+ var url = $(event.target).attr('href');
? ^^ +++++++++++++
- return el.attr('buildsetNumber');
+ zeus.navigate(url, {trigger: true});
}
});
views.BuildsetDetails = zeus.views.View.extend({
template: "#buildset-details-template",
modelContextName: "buildset"
});
}, Marionette, $); | 9 | 0.230769 | 2 | 7 |
0e4f01276b2befa9913dff619c1869faab067c0d | ProjectTrackervb/PTWin/ProjectSelect.vb | ProjectTrackervb/PTWin/ProjectSelect.vb | Imports System.Windows.Forms
Imports System.ComponentModel
Public Class ProjectSelect
Private mProjectId As Guid
Public ReadOnly Property ProjectId() As Guid
Get
Return mProjectId
End Get
End Property
Private Sub AcceptValue()
mProjectId = CType(Me.ProjectListListBox.SelectedValue, Guid)
Me.DialogResult = Windows.Forms.DialogResult.OK
Me.Close()
End Sub
Private Sub OK_Button_Click( _
ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles OK_Button.Click
AcceptValue()
End Sub
Private Sub ProjectListListBox_MouseDoubleClick( _
ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) _
Handles ProjectListListBox.MouseDoubleClick
AcceptValue()
End Sub
Private Sub Cancel_Button_Click( _
ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles Cancel_Button.Click
Me.Close()
End Sub
Private Sub ProjectSelect_Load( _
ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles MyBase.Load
DisplayList(ProjectList.GetProjectList)
End Sub
Private Sub DisplayList(ByVal list As ProjectList)
Dim sortedList As New Csla.SortedBindingList(Of ProjectInfo)(list)
sortedList.ApplySort("Name", ListSortDirection.Ascending)
Me.ProjectListBindingSource.DataSource = sortedList
End Sub
Private Sub GetListButton_Click( _
ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles GetListButton.Click
DisplayList(ProjectList.GetProjectList(NameTextBox.Text))
End Sub
End Class
| Imports System.Windows.Forms
Imports System.ComponentModel
Public Class ProjectSelect
Private mProjectId As Guid
Public ReadOnly Property ProjectId() As Guid
Get
Return mProjectId
End Get
End Property
Private Sub AcceptValue()
mProjectId = CType(Me.ProjectListListBox.SelectedValue, Guid)
Me.DialogResult = Windows.Forms.DialogResult.OK
Me.Close()
End Sub
Private Sub OK_Button_Click( _
ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles OK_Button.Click
AcceptValue()
End Sub
Private Sub ProjectListListBox_MouseDoubleClick( _
ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) _
Handles ProjectListListBox.MouseDoubleClick
AcceptValue()
End Sub
Private Sub Cancel_Button_Click( _
ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles Cancel_Button.Click
Me.Close()
End Sub
Private Sub ProjectSelect_Load( _
ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles MyBase.Load
DisplayList(ProjectList.GetProjectList)
End Sub
Private Sub DisplayList(ByVal list As ProjectList)
Dim sortedList = From p In list Order By p.Name
Me.ProjectListBindingSource.DataSource = sortedList
End Sub
Private Sub GetListButton_Click( _
ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles GetListButton.Click
DisplayList(ProjectList.GetProjectList(NameTextBox.Text))
End Sub
End Class
| Use LINQ to sort results. | Use LINQ to sort results.
| Visual Basic | mit | BrettJaner/csla,MarimerLLC/csla,BrettJaner/csla,jonnybee/csla,ronnymgm/csla-light,rockfordlhotka/csla,jonnybee/csla,ronnymgm/csla-light,JasonBock/csla,JasonBock/csla,MarimerLLC/csla,JasonBock/csla,BrettJaner/csla,rockfordlhotka/csla,jonnybee/csla,rockfordlhotka/csla,ronnymgm/csla-light,MarimerLLC/csla | visual-basic | ## Code Before:
Imports System.Windows.Forms
Imports System.ComponentModel
Public Class ProjectSelect
Private mProjectId As Guid
Public ReadOnly Property ProjectId() As Guid
Get
Return mProjectId
End Get
End Property
Private Sub AcceptValue()
mProjectId = CType(Me.ProjectListListBox.SelectedValue, Guid)
Me.DialogResult = Windows.Forms.DialogResult.OK
Me.Close()
End Sub
Private Sub OK_Button_Click( _
ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles OK_Button.Click
AcceptValue()
End Sub
Private Sub ProjectListListBox_MouseDoubleClick( _
ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) _
Handles ProjectListListBox.MouseDoubleClick
AcceptValue()
End Sub
Private Sub Cancel_Button_Click( _
ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles Cancel_Button.Click
Me.Close()
End Sub
Private Sub ProjectSelect_Load( _
ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles MyBase.Load
DisplayList(ProjectList.GetProjectList)
End Sub
Private Sub DisplayList(ByVal list As ProjectList)
Dim sortedList As New Csla.SortedBindingList(Of ProjectInfo)(list)
sortedList.ApplySort("Name", ListSortDirection.Ascending)
Me.ProjectListBindingSource.DataSource = sortedList
End Sub
Private Sub GetListButton_Click( _
ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles GetListButton.Click
DisplayList(ProjectList.GetProjectList(NameTextBox.Text))
End Sub
End Class
## Instruction:
Use LINQ to sort results.
## Code After:
Imports System.Windows.Forms
Imports System.ComponentModel
Public Class ProjectSelect
Private mProjectId As Guid
Public ReadOnly Property ProjectId() As Guid
Get
Return mProjectId
End Get
End Property
Private Sub AcceptValue()
mProjectId = CType(Me.ProjectListListBox.SelectedValue, Guid)
Me.DialogResult = Windows.Forms.DialogResult.OK
Me.Close()
End Sub
Private Sub OK_Button_Click( _
ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles OK_Button.Click
AcceptValue()
End Sub
Private Sub ProjectListListBox_MouseDoubleClick( _
ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) _
Handles ProjectListListBox.MouseDoubleClick
AcceptValue()
End Sub
Private Sub Cancel_Button_Click( _
ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles Cancel_Button.Click
Me.Close()
End Sub
Private Sub ProjectSelect_Load( _
ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles MyBase.Load
DisplayList(ProjectList.GetProjectList)
End Sub
Private Sub DisplayList(ByVal list As ProjectList)
Dim sortedList = From p In list Order By p.Name
Me.ProjectListBindingSource.DataSource = sortedList
End Sub
Private Sub GetListButton_Click( _
ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles GetListButton.Click
DisplayList(ProjectList.GetProjectList(NameTextBox.Text))
End Sub
End Class
| Imports System.Windows.Forms
Imports System.ComponentModel
Public Class ProjectSelect
Private mProjectId As Guid
Public ReadOnly Property ProjectId() As Guid
Get
Return mProjectId
End Get
End Property
Private Sub AcceptValue()
mProjectId = CType(Me.ProjectListListBox.SelectedValue, Guid)
Me.DialogResult = Windows.Forms.DialogResult.OK
Me.Close()
End Sub
Private Sub OK_Button_Click( _
ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles OK_Button.Click
AcceptValue()
End Sub
Private Sub ProjectListListBox_MouseDoubleClick( _
ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) _
Handles ProjectListListBox.MouseDoubleClick
AcceptValue()
End Sub
Private Sub Cancel_Button_Click( _
ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles Cancel_Button.Click
Me.Close()
End Sub
Private Sub ProjectSelect_Load( _
ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles MyBase.Load
DisplayList(ProjectList.GetProjectList)
End Sub
Private Sub DisplayList(ByVal list As ProjectList)
+ Dim sortedList = From p In list Order By p.Name
- Dim sortedList As New Csla.SortedBindingList(Of ProjectInfo)(list)
- sortedList.ApplySort("Name", ListSortDirection.Ascending)
Me.ProjectListBindingSource.DataSource = sortedList
End Sub
Private Sub GetListButton_Click( _
ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles GetListButton.Click
DisplayList(ProjectList.GetProjectList(NameTextBox.Text))
End Sub
End Class | 3 | 0.042857 | 1 | 2 |
1c76a7bad8b7ad73da4e9cb9b0c9e2bb621d6a26 | tools/run_tests/build_php.sh | tools/run_tests/build_php.sh |
set -ex
# change to grpc repo root
cd $(dirname $0)/../..
export GRPC_DIR=`pwd`
# make the libraries
make -j shared_c
# build php
cd src/php
cd ext/grpc
phpize
cd ../..
ext/grpc/configure
#cd ext/grpc
make
|
set -ex
# change to grpc repo root
cd $(dirname $0)/../..
export GRPC_DIR=`pwd`
# make the libraries
make -j shared_c
# build php
cd src/php
cd ext/grpc
phpize
./configure
#cd ext/grpc
make
| Build in the correct directory | Build in the correct directory
| Shell | bsd-3-clause | iMilind/grpc,meisterpeeps/grpc,soltanmm/grpc,zhimingxie/grpc,zhimingxie/grpc,perumaalgoog/grpc,msmania/grpc,jcanizales/grpc,ppietrasa/grpc,msmania/grpc,ncteisen/grpc,kskalski/grpc,tempbottle/grpc,Crevil/grpc,dklempner/grpc,JoeWoo/grpc,cgvarela/grpc,geffzhang/grpc,muxi/grpc,yinsu/grpc,pszemus/grpc,wangyikai/grpc,thunderboltsid/grpc,pszemus/grpc,mehrdada/grpc,Vizerai/grpc,meisterpeeps/grpc,tatsuhiro-t/grpc,chrisdunelm/grpc,nicolasnoble/grpc,kpayson64/grpc,miselin/grpc,vjpai/grpc,yugui/grpc,stanley-cheung/grpc,VcamX/grpc,royalharsh/grpc,wangyikai/grpc,sidrakesh93/grpc,miselin/grpc,malexzx/grpc,cgvarela/grpc,JoeWoo/grpc,xtopsoft/grpc,yangjae/grpc,malexzx/grpc,yinsu/grpc,deepaklukose/grpc,grpc/grpc,miselin/grpc,fichter/grpc,makdharma/grpc,ananthonline/grpc,yonglehou/grpc,murgatroid99/grpc,geffzhang/grpc,wangyikai/grpc,ofrobots/grpc,thunderboltsid/grpc,murgatroid99/grpc,maxwell-demon/grpc,rjshade/grpc,jtattermusch/grpc,Vizerai/grpc,ctiller/grpc,chrisdunelm/grpc,VcamX/grpc,nicolasnoble/grpc,simonkuang/grpc,ppietrasa/grpc,sidrakesh93/grpc,kriswuollett/grpc,deepaklukose/grpc,rjshade/grpc,kskalski/grpc,7anner/grpc,a-veitch/grpc,miselin/grpc,nathanielmanistaatgoogle/grpc,ncteisen/grpc,wangyikai/grpc,sreecha/grpc,daniel-j-born/grpc,yugui/grpc,xtopsoft/grpc,yang-g/grpc,sreecha/grpc,greasypizza/grpc,vsco/grpc,yugui/grpc,yangjae/grpc,bjori/grpc,soltanmm-google/grpc,madongfly/grpc,msiedlarek/grpc,Crevil/grpc,vsco/grpc,miselin/grpc,thinkerou/grpc,doubi-workshop/grpc,philcleveland/grpc,a-veitch/grpc,quizlet/grpc,mway08/grpc,dklempner/grpc,kriswuollett/grpc,perumaalgoog/grpc,kskalski/grpc,kpayson64/grpc,ncteisen/grpc,msmania/grpc,wcevans/grpc,msmania/grpc,tatsuhiro-t/grpc,ipylypiv/grpc,andrewpollock/grpc,ksophocleous/grpc,wkubiak/grpc,soltanmm-google/grpc,ksophocleous/grpc,wkubiak/grpc,MakMukhi/grpc,wcevans/grpc,ejona86/grpc,daniel-j-born/grpc,philcleveland/grpc,ananthonline/grpc,xtopsoft/grpc,dgquintas/grpc,arkmaxim/grpc,PeterFaiman/ruby-grpc-minimal,podsvirov/grpc,carl-mastrangelo/grpc,firebase/grpc,matt-kwong/grpc,yang-g/grpc,infinit/grpc,pszemus/grpc,muxi/grpc,hstefan/grpc,surround-io/grpc,maxwell-demon/grpc,apolcyn/grpc,geffzhang/grpc,ppietrasa/grpc,maxwell-demon/grpc,MakMukhi/grpc,meisterpeeps/grpc,nicolasnoble/grpc,larsonmpdx/grpc,nmittler/grpc,ipylypiv/grpc,bjori/grpc,baylabs/grpc,msiedlarek/grpc,muxi/grpc,fuchsia-mirror/third_party-grpc,zeliard/grpc,ipylypiv/grpc,kriswuollett/grpc,y-zeng/grpc,Juzley/grpc,yongni/grpc,vsco/grpc,LuminateWireless/grpc,vjpai/grpc,chrisdunelm/grpc,soltanmm/grpc,w4-sjcho/grpc,wangyikai/grpc,leifurhauks/grpc,firebase/grpc,vsco/grpc,carl-mastrangelo/grpc,thinkerou/grpc,deepaklukose/grpc,y-zeng/grpc,greasypizza/grpc,w4-sjcho/grpc,perumaalgoog/grpc,larsonmpdx/grpc,bjori/grpc,andrewpollock/grpc,podsvirov/grpc,kumaralokgithub/grpc,vjpai/grpc,royalharsh/grpc,yonglehou/grpc,rjshade/grpc,wcevans/grpc,greasypizza/grpc,baylabs/grpc,carl-mastrangelo/grpc,miselin/grpc,tempbottle/grpc,surround-io/grpc,malexzx/grpc,ofrobots/grpc,nicolasnoble/grpc,chrisdunelm/grpc,sidrakesh93/grpc,thinkerou/grpc,Vizerai/grpc,iMilind/grpc,jtattermusch/grpc,tengyifei/grpc,bjori/grpc,crast/grpc,yugui/grpc,dgquintas/grpc,xtopsoft/grpc,doubi-workshop/grpc,murgatroid99/grpc,JoeWoo/grpc,ncteisen/grpc,miselin/grpc,yang-g/grpc,fichter/grpc,chrisdunelm/grpc,bjori/grpc,gpndata/grpc,murgatroid99/grpc,quizlet/grpc,ofrobots/grpc,ofrobots/grpc,a-veitch/grpc,royalharsh/grpc,wangyikai/grpc,ipylypiv/grpc,tengyifei/grpc,iMilind/grpc,tatsuhiro-t/grpc,soltanmm-google/grpc,hstefan/grpc,jboeuf/grpc,ppietrasa/grpc,jcanizales/grpc,arkmaxim/grpc,LuminateWireless/grpc,soltanmm/grpc,msmania/grpc,jboeuf/grpc,matt-kwong/grpc,a11r/grpc,thunderboltsid/grpc,ncteisen/grpc,vjpai/grpc,zhimingxie/grpc,podsvirov/grpc,simonkuang/grpc,tatsuhiro-t/grpc,quizlet/grpc,stanley-cheung/grpc,meisterpeeps/grpc,sidrakesh93/grpc,xtopsoft/grpc,ipylypiv/grpc,hstefan/grpc,makdharma/grpc,nmittler/grpc,iMilind/grpc,y-zeng/grpc,soltanmm-google/grpc,leifurhauks/grpc,adelez/grpc,larsonmpdx/grpc,quizlet/grpc,malexzx/grpc,ofrobots/grpc,apolcyn/grpc,zeliard/grpc,xtopsoft/grpc,arkmaxim/grpc,thunderboltsid/grpc,cgvarela/grpc,nathanielmanistaatgoogle/grpc,maxwell-demon/grpc,leifurhauks/grpc,thinkerou/grpc,tempbottle/grpc,adelez/grpc,pszemus/grpc,stanley-cheung/grpc,chenbaihu/grpc,gpndata/grpc,mehrdada/grpc,philcleveland/grpc,yonglehou/grpc,chenbaihu/grpc,ejona86/grpc,tempbottle/grpc,murgatroid99/grpc,infinit/grpc,apolcyn/grpc,jtattermusch/grpc,kumaralokgithub/grpc,podsvirov/grpc,infinit/grpc,ipylypiv/grpc,jboeuf/grpc,grani/grpc,mzhaom/grpc,pmarks-net/grpc,tatsuhiro-t/grpc,tamihiro/grpc,infinit/grpc,chrisdunelm/grpc,rjshade/grpc,matt-kwong/grpc,doubi-workshop/grpc,jboeuf/grpc,chenbaihu/grpc,ananthonline/grpc,adelez/grpc,grpc/grpc,adelez/grpc,Juzley/grpc,kumaralokgithub/grpc,ncteisen/grpc,carl-mastrangelo/grpc,PeterFaiman/ruby-grpc-minimal,firebase/grpc,donnadionne/grpc,pszemus/grpc,thinkerou/grpc,VcamX/grpc,chenbaihu/grpc,infinit/grpc,a11r/grpc,yongni/grpc,grpc/grpc,thunderboltsid/grpc,doubi-workshop/grpc,ananthonline/grpc,tempbottle/grpc,Crevil/grpc,MakMukhi/grpc,mzhaom/grpc,carl-mastrangelo/grpc,ejona86/grpc,jboeuf/grpc,tengyifei/grpc,LuminateWireless/grpc,dklempner/grpc,nicolasnoble/grpc,firebase/grpc,muxi/grpc,fuchsia-mirror/third_party-grpc,nmittler/grpc,thunderboltsid/grpc,ofrobots/grpc,podsvirov/grpc,greasypizza/grpc,daniel-j-born/grpc,wcevans/grpc,nmittler/grpc,meisterpeeps/grpc,fichter/grpc,ksophocleous/grpc,deepaklukose/grpc,ksophocleous/grpc,adelez/grpc,dgquintas/grpc,muxi/grpc,thinkerou/grpc,grani/grpc,perumaalgoog/grpc,ejona86/grpc,crast/grpc,arkmaxim/grpc,MakMukhi/grpc,soltanmm-google/grpc,zhimingxie/grpc,VcamX/grpc,matt-kwong/grpc,nmittler/grpc,mzhaom/grpc,msiedlarek/grpc,cgvarela/grpc,ejona86/grpc,ananthonline/grpc,hstefan/grpc,msiedlarek/grpc,ananthonline/grpc,kumaralokgithub/grpc,ctiller/grpc,madongfly/grpc,mzhaom/grpc,grpc/grpc,fuchsia-mirror/third_party-grpc,yinsu/grpc,yinsu/grpc,mzhaom/grpc,bogdandrutu/grpc,jcanizales/grpc,murgatroid99/grpc,yangjae/grpc,dklempner/grpc,apolcyn/grpc,soltanmm-google/grpc,perumaalgoog/grpc,yinsu/grpc,adelez/grpc,mehrdada/grpc,baylabs/grpc,yongni/grpc,yonglehou/grpc,ncteisen/grpc,geffzhang/grpc,grpc/grpc,ananthonline/grpc,podsvirov/grpc,iMilind/grpc,baylabs/grpc,madongfly/grpc,dgquintas/grpc,grpc/grpc,firebase/grpc,surround-io/grpc,crast/grpc,xtopsoft/grpc,ksophocleous/grpc,iMilind/grpc,sreecha/grpc,JoeWoo/grpc,malexzx/grpc,xtopsoft/grpc,geffzhang/grpc,ppietrasa/grpc,nathanielmanistaatgoogle/grpc,ppietrasa/grpc,larsonmpdx/grpc,zhimingxie/grpc,PeterFaiman/ruby-grpc-minimal,w4-sjcho/grpc,mzhaom/grpc,jtattermusch/grpc,donnadionne/grpc,yang-g/grpc,tamihiro/grpc,larsonmpdx/grpc,7anner/grpc,kpayson64/grpc,royalharsh/grpc,LuminateWireless/grpc,soltanmm/grpc,chrisdunelm/grpc,bogdandrutu/grpc,jtattermusch/grpc,andrewpollock/grpc,larsonmpdx/grpc,rjshade/grpc,y-zeng/grpc,Vizerai/grpc,leifurhauks/grpc,grani/grpc,apolcyn/grpc,ksophocleous/grpc,stanley-cheung/grpc,yonglehou/grpc,ejona86/grpc,thinkerou/grpc,deepaklukose/grpc,carl-mastrangelo/grpc,vsco/grpc,zeliard/grpc,hstefan/grpc,sreecha/grpc,kriswuollett/grpc,baylabs/grpc,bogdandrutu/grpc,vjpai/grpc,leifurhauks/grpc,pmarks-net/grpc,madongfly/grpc,kumaralokgithub/grpc,arkmaxim/grpc,goldenbull/grpc,goldenbull/grpc,mway08/grpc,tempbottle/grpc,arkmaxim/grpc,nathanielmanistaatgoogle/grpc,chenbaihu/grpc,firebase/grpc,maxwell-demon/grpc,yang-g/grpc,wcevans/grpc,muxi/grpc,geffzhang/grpc,wkubiak/grpc,pszemus/grpc,goldenbull/grpc,ejona86/grpc,bjori/grpc,makdharma/grpc,bogdandrutu/grpc,ejona86/grpc,ejona86/grpc,nicolasnoble/grpc,grani/grpc,stanley-cheung/grpc,LuminateWireless/grpc,yongni/grpc,JoeWoo/grpc,makdharma/grpc,msiedlarek/grpc,kriswuollett/grpc,donnadionne/grpc,7anner/grpc,infinit/grpc,msmania/grpc,dklempner/grpc,zeliard/grpc,vjpai/grpc,baylabs/grpc,soltanmm-google/grpc,PeterFaiman/ruby-grpc-minimal,grpc/grpc,fuchsia-mirror/third_party-grpc,kskalski/grpc,madongfly/grpc,pszemus/grpc,wkubiak/grpc,jboeuf/grpc,malexzx/grpc,ctiller/grpc,w4-sjcho/grpc,VcamX/grpc,yugui/grpc,yonglehou/grpc,deepaklukose/grpc,a11r/grpc,ofrobots/grpc,ctiller/grpc,MakMukhi/grpc,goldenbull/grpc,w4-sjcho/grpc,y-zeng/grpc,thinkerou/grpc,tengyifei/grpc,goldenbull/grpc,sreecha/grpc,quizlet/grpc,hstefan/grpc,kriswuollett/grpc,PeterFaiman/ruby-grpc-minimal,infinit/grpc,zhimingxie/grpc,matt-kwong/grpc,mehrdada/grpc,a-veitch/grpc,zhimingxie/grpc,surround-io/grpc,ctiller/grpc,simonkuang/grpc,simonkuang/grpc,MakMukhi/grpc,surround-io/grpc,jtattermusch/grpc,andrewpollock/grpc,adelez/grpc,doubi-workshop/grpc,jtattermusch/grpc,muxi/grpc,Crevil/grpc,vjpai/grpc,donnadionne/grpc,wangyikai/grpc,apolcyn/grpc,tamihiro/grpc,philcleveland/grpc,kskalski/grpc,leifurhauks/grpc,yonglehou/grpc,MakMukhi/grpc,maxwell-demon/grpc,ctiller/grpc,firebase/grpc,fuchsia-mirror/third_party-grpc,gpndata/grpc,Juzley/grpc,larsonmpdx/grpc,greasypizza/grpc,perumaalgoog/grpc,a-veitch/grpc,quizlet/grpc,vsco/grpc,makdharma/grpc,Juzley/grpc,mzhaom/grpc,adelez/grpc,daniel-j-born/grpc,y-zeng/grpc,cgvarela/grpc,infinit/grpc,mway08/grpc,zhimingxie/grpc,wangyikai/grpc,zhimingxie/grpc,maxwell-demon/grpc,grani/grpc,Crevil/grpc,a-veitch/grpc,kskalski/grpc,Juzley/grpc,gpndata/grpc,nicolasnoble/grpc,carl-mastrangelo/grpc,firebase/grpc,jboeuf/grpc,simonkuang/grpc,dklempner/grpc,ctiller/grpc,thinkerou/grpc,Vizerai/grpc,dgquintas/grpc,ananthonline/grpc,dgquintas/grpc,quizlet/grpc,bjori/grpc,jboeuf/grpc,pmarks-net/grpc,philcleveland/grpc,tamihiro/grpc,chrisdunelm/grpc,PeterFaiman/ruby-grpc-minimal,ctiller/grpc,Vizerai/grpc,quizlet/grpc,goldenbull/grpc,stanley-cheung/grpc,firebase/grpc,pmarks-net/grpc,wkubiak/grpc,donnadionne/grpc,ppietrasa/grpc,donnadionne/grpc,greasypizza/grpc,soltanmm/grpc,nmittler/grpc,andrewpollock/grpc,fichter/grpc,ejona86/grpc,kpayson64/grpc,mehrdada/grpc,kpayson64/grpc,stanley-cheung/grpc,vsco/grpc,msmania/grpc,murgatroid99/grpc,sidrakesh93/grpc,msiedlarek/grpc,ejona86/grpc,kpayson64/grpc,quizlet/grpc,ejona86/grpc,yugui/grpc,mehrdada/grpc,sidrakesh93/grpc,stanley-cheung/grpc,a11r/grpc,kpayson64/grpc,firebase/grpc,sreecha/grpc,JoeWoo/grpc,yangjae/grpc,dgquintas/grpc,nicolasnoble/grpc,w4-sjcho/grpc,fuchsia-mirror/third_party-grpc,cgvarela/grpc,LuminateWireless/grpc,zeliard/grpc,msmania/grpc,daniel-j-born/grpc,soltanmm-google/grpc,deepaklukose/grpc,kskalski/grpc,ipylypiv/grpc,yang-g/grpc,kpayson64/grpc,a-veitch/grpc,fichter/grpc,mway08/grpc,jboeuf/grpc,madongfly/grpc,murgatroid99/grpc,LuminateWireless/grpc,jtattermusch/grpc,vjpai/grpc,perumaalgoog/grpc,jcanizales/grpc,wcevans/grpc,wcevans/grpc,leifurhauks/grpc,yongni/grpc,jcanizales/grpc,y-zeng/grpc,yugui/grpc,kpayson64/grpc,msiedlarek/grpc,LuminateWireless/grpc,meisterpeeps/grpc,bogdandrutu/grpc,zeliard/grpc,Vizerai/grpc,msiedlarek/grpc,ctiller/grpc,makdharma/grpc,nathanielmanistaatgoogle/grpc,goldenbull/grpc,kriswuollett/grpc,vjpai/grpc,madongfly/grpc,ncteisen/grpc,dgquintas/grpc,perumaalgoog/grpc,baylabs/grpc,crast/grpc,adelez/grpc,yugui/grpc,yinsu/grpc,yang-g/grpc,bogdandrutu/grpc,rjshade/grpc,ananthonline/grpc,Crevil/grpc,wangyikai/grpc,doubi-workshop/grpc,arkmaxim/grpc,firebase/grpc,crast/grpc,yugui/grpc,surround-io/grpc,yangjae/grpc,thinkerou/grpc,tengyifei/grpc,muxi/grpc,mehrdada/grpc,VcamX/grpc,andrewpollock/grpc,bogdandrutu/grpc,maxwell-demon/grpc,grpc/grpc,pszemus/grpc,zeliard/grpc,VcamX/grpc,yongni/grpc,msmania/grpc,kskalski/grpc,PeterFaiman/ruby-grpc-minimal,yonglehou/grpc,makdharma/grpc,a11r/grpc,nathanielmanistaatgoogle/grpc,ctiller/grpc,dgquintas/grpc,tamihiro/grpc,Juzley/grpc,jtattermusch/grpc,madongfly/grpc,ppietrasa/grpc,sidrakesh93/grpc,apolcyn/grpc,donnadionne/grpc,andrewpollock/grpc,donnadionne/grpc,nicolasnoble/grpc,7anner/grpc,7anner/grpc,chrisdunelm/grpc,chrisdunelm/grpc,rjshade/grpc,fuchsia-mirror/third_party-grpc,vjpai/grpc,kumaralokgithub/grpc,y-zeng/grpc,a-veitch/grpc,zeliard/grpc,pszemus/grpc,jtattermusch/grpc,leifurhauks/grpc,sreecha/grpc,grpc/grpc,pszemus/grpc,ncteisen/grpc,nicolasnoble/grpc,mway08/grpc,jcanizales/grpc,pmarks-net/grpc,tamihiro/grpc,hstefan/grpc,ksophocleous/grpc,VcamX/grpc,greasypizza/grpc,thunderboltsid/grpc,podsvirov/grpc,stanley-cheung/grpc,vjpai/grpc,yinsu/grpc,geffzhang/grpc,grpc/grpc,thinkerou/grpc,Juzley/grpc,thinkerou/grpc,vjpai/grpc,grani/grpc,wcevans/grpc,fuchsia-mirror/third_party-grpc,daniel-j-born/grpc,tengyifei/grpc,doubi-workshop/grpc,JoeWoo/grpc,ncteisen/grpc,cgvarela/grpc,kumaralokgithub/grpc,leifurhauks/grpc,sreecha/grpc,msiedlarek/grpc,carl-mastrangelo/grpc,grani/grpc,simonkuang/grpc,dgquintas/grpc,muxi/grpc,carl-mastrangelo/grpc,tempbottle/grpc,yinsu/grpc,miselin/grpc,chrisdunelm/grpc,baylabs/grpc,a-veitch/grpc,doubi-workshop/grpc,yinsu/grpc,royalharsh/grpc,iMilind/grpc,kskalski/grpc,deepaklukose/grpc,ipylypiv/grpc,chenbaihu/grpc,podsvirov/grpc,hstefan/grpc,Juzley/grpc,sreecha/grpc,greasypizza/grpc,gpndata/grpc,pmarks-net/grpc,yangjae/grpc,MakMukhi/grpc,Vizerai/grpc,nmittler/grpc,makdharma/grpc,soltanmm-google/grpc,sidrakesh93/grpc,vsco/grpc,podsvirov/grpc,carl-mastrangelo/grpc,grpc/grpc,mway08/grpc,larsonmpdx/grpc,arkmaxim/grpc,deepaklukose/grpc,fuchsia-mirror/third_party-grpc,LuminateWireless/grpc,mehrdada/grpc,vsco/grpc,goldenbull/grpc,7anner/grpc,chenbaihu/grpc,infinit/grpc,matt-kwong/grpc,surround-io/grpc,mway08/grpc,fichter/grpc,tengyifei/grpc,crast/grpc,ncteisen/grpc,Crevil/grpc,matt-kwong/grpc,dklempner/grpc,carl-mastrangelo/grpc,tengyifei/grpc,nmittler/grpc,yongni/grpc,cgvarela/grpc,philcleveland/grpc,soltanmm/grpc,ofrobots/grpc,philcleveland/grpc,greasypizza/grpc,7anner/grpc,doubi-workshop/grpc,sreecha/grpc,stanley-cheung/grpc,grani/grpc,kriswuollett/grpc,malexzx/grpc,apolcyn/grpc,larsonmpdx/grpc,tamihiro/grpc,bogdandrutu/grpc,kumaralokgithub/grpc,chenbaihu/grpc,fichter/grpc,PeterFaiman/ruby-grpc-minimal,perumaalgoog/grpc,yang-g/grpc,bogdandrutu/grpc,andrewpollock/grpc,jtattermusch/grpc,ipylypiv/grpc,sreecha/grpc,malexzx/grpc,tamihiro/grpc,rjshade/grpc,muxi/grpc,JoeWoo/grpc,dklempner/grpc,jcanizales/grpc,kpayson64/grpc,rjshade/grpc,pmarks-net/grpc,yangjae/grpc,jboeuf/grpc,soltanmm/grpc,philcleveland/grpc,jtattermusch/grpc,ofrobots/grpc,wkubiak/grpc,wkubiak/grpc,Vizerai/grpc,jcanizales/grpc,bjori/grpc,stanley-cheung/grpc,JoeWoo/grpc,nathanielmanistaatgoogle/grpc,hstefan/grpc,miselin/grpc,a11r/grpc,iMilind/grpc,royalharsh/grpc,mehrdada/grpc,mzhaom/grpc,Vizerai/grpc,mway08/grpc,madongfly/grpc,mehrdada/grpc,donnadionne/grpc,Vizerai/grpc,ncteisen/grpc,wcevans/grpc,yang-g/grpc,matt-kwong/grpc,stanley-cheung/grpc,geffzhang/grpc,tatsuhiro-t/grpc,dklempner/grpc,baylabs/grpc,grani/grpc,Crevil/grpc,ppietrasa/grpc,crast/grpc,surround-io/grpc,yongni/grpc,simonkuang/grpc,ctiller/grpc,gpndata/grpc,a11r/grpc,carl-mastrangelo/grpc,Crevil/grpc,soltanmm/grpc,makdharma/grpc,fichter/grpc,firebase/grpc,tempbottle/grpc,jcanizales/grpc,simonkuang/grpc,nathanielmanistaatgoogle/grpc,y-zeng/grpc,gpndata/grpc,yongni/grpc,nicolasnoble/grpc,jboeuf/grpc,matt-kwong/grpc,MakMukhi/grpc,royalharsh/grpc,maxwell-demon/grpc,PeterFaiman/ruby-grpc-minimal,pmarks-net/grpc,pszemus/grpc,ksophocleous/grpc,arkmaxim/grpc,grpc/grpc,gpndata/grpc,sreecha/grpc,soltanmm/grpc,wkubiak/grpc,meisterpeeps/grpc,iMilind/grpc,w4-sjcho/grpc,PeterFaiman/ruby-grpc-minimal,andrewpollock/grpc,daniel-j-born/grpc,mehrdada/grpc,donnadionne/grpc,kumaralokgithub/grpc,7anner/grpc,philcleveland/grpc,a11r/grpc,pszemus/grpc,jboeuf/grpc,fuchsia-mirror/third_party-grpc,meisterpeeps/grpc,thunderboltsid/grpc,simonkuang/grpc,geffzhang/grpc,donnadionne/grpc,mehrdada/grpc,royalharsh/grpc,royalharsh/grpc,tatsuhiro-t/grpc,VcamX/grpc,goldenbull/grpc,dgquintas/grpc,muxi/grpc,daniel-j-born/grpc,thunderboltsid/grpc,donnadionne/grpc,murgatroid99/grpc,bjori/grpc,tengyifei/grpc,kriswuollett/grpc,ctiller/grpc,pmarks-net/grpc,a11r/grpc,kpayson64/grpc,malexzx/grpc,nicolasnoble/grpc,muxi/grpc,tatsuhiro-t/grpc,yangjae/grpc,apolcyn/grpc,tamihiro/grpc,murgatroid99/grpc,w4-sjcho/grpc,crast/grpc,daniel-j-born/grpc,7anner/grpc,w4-sjcho/grpc | shell | ## Code Before:
set -ex
# change to grpc repo root
cd $(dirname $0)/../..
export GRPC_DIR=`pwd`
# make the libraries
make -j shared_c
# build php
cd src/php
cd ext/grpc
phpize
cd ../..
ext/grpc/configure
#cd ext/grpc
make
## Instruction:
Build in the correct directory
## Code After:
set -ex
# change to grpc repo root
cd $(dirname $0)/../..
export GRPC_DIR=`pwd`
# make the libraries
make -j shared_c
# build php
cd src/php
cd ext/grpc
phpize
./configure
#cd ext/grpc
make
|
set -ex
# change to grpc repo root
cd $(dirname $0)/../..
export GRPC_DIR=`pwd`
# make the libraries
make -j shared_c
# build php
cd src/php
cd ext/grpc
phpize
+ ./configure
- cd ../..
- ext/grpc/configure
#cd ext/grpc
make
| 3 | 0.142857 | 1 | 2 |
e4d1cfd43a1d44a9f656f4fe3945ab66ef15d8fa | _posts/2014-05-31-arstidir.markdown | _posts/2014-05-31-arstidir.markdown | ---
layout: post
title: "Árstíðir"
date: 2014-05-31 16:36:02 -0400
external-url: http://www.arstidir.com
---
Árstíðir is a 4-man Icelandic choral group. They sing magnificent music and
have offered me a new cultural experience (not much Icelandic music in
Upstate New York). They are world-class musicians and deserving of every
award they have received, and more. Listen to these:
- ["Heyr himna smiður" (Icelandic hymn) in train station](https://www.youtube.com/watch?v=e4dT8FJ2GE0)
- ["Svefns Og Vöku Skil", their latest album](https://arstidir.bandcamp.com/album/svefns-og-v-ku-skil)
- [Kickstarter for their third album](https://www.kickstarter.com/projects/arstidir/arstiir-music-from-the-heart-of-iceland-our-third)
If that doesn't impress you, I don't know what will.
| ---
layout: post
title: "Árstíðir"
date: 2014-05-31 16:36:02 -0400
external-url: http://www.arstidir.com
---
Árstíðir is a 4-man Icelandic choral group. They sing magnificent music and
have offered me a new cultural experience (not much Icelandic music in
Upstate New York). They are world-class musicians and deserving of every
award they have received, and more. Listen to these:
- ["Heyr himna smiður" (Icelandic hymn) in train station](https://www.youtube.com/watch?v=e4dT8FJ2GE0)
- ["Svefns Og Vöku Skil", their latest album](https://web.archive.org/web/20141224230329/https://arstidir.bandcamp.com/album/svefns-og-v-ku-skil)
- [Kickstarter for their third album](https://www.kickstarter.com/projects/arstidir/arstiir-music-from-the-heart-of-iceland-our-third)
If that doesn't impress you, I don't know what will.
| Use web archive link for Arstidir album link | Use web archive link for Arstidir album link
| Markdown | mit | parkr/stuff,parkr/stuff,parkr/stuff,parkr/stuff,parkr/stuff,parkr/stuff | markdown | ## Code Before:
---
layout: post
title: "Árstíðir"
date: 2014-05-31 16:36:02 -0400
external-url: http://www.arstidir.com
---
Árstíðir is a 4-man Icelandic choral group. They sing magnificent music and
have offered me a new cultural experience (not much Icelandic music in
Upstate New York). They are world-class musicians and deserving of every
award they have received, and more. Listen to these:
- ["Heyr himna smiður" (Icelandic hymn) in train station](https://www.youtube.com/watch?v=e4dT8FJ2GE0)
- ["Svefns Og Vöku Skil", their latest album](https://arstidir.bandcamp.com/album/svefns-og-v-ku-skil)
- [Kickstarter for their third album](https://www.kickstarter.com/projects/arstidir/arstiir-music-from-the-heart-of-iceland-our-third)
If that doesn't impress you, I don't know what will.
## Instruction:
Use web archive link for Arstidir album link
## Code After:
---
layout: post
title: "Árstíðir"
date: 2014-05-31 16:36:02 -0400
external-url: http://www.arstidir.com
---
Árstíðir is a 4-man Icelandic choral group. They sing magnificent music and
have offered me a new cultural experience (not much Icelandic music in
Upstate New York). They are world-class musicians and deserving of every
award they have received, and more. Listen to these:
- ["Heyr himna smiður" (Icelandic hymn) in train station](https://www.youtube.com/watch?v=e4dT8FJ2GE0)
- ["Svefns Og Vöku Skil", their latest album](https://web.archive.org/web/20141224230329/https://arstidir.bandcamp.com/album/svefns-og-v-ku-skil)
- [Kickstarter for their third album](https://www.kickstarter.com/projects/arstidir/arstiir-music-from-the-heart-of-iceland-our-third)
If that doesn't impress you, I don't know what will.
| ---
layout: post
title: "Árstíðir"
date: 2014-05-31 16:36:02 -0400
external-url: http://www.arstidir.com
---
Árstíðir is a 4-man Icelandic choral group. They sing magnificent music and
have offered me a new cultural experience (not much Icelandic music in
Upstate New York). They are world-class musicians and deserving of every
award they have received, and more. Listen to these:
- ["Heyr himna smiður" (Icelandic hymn) in train station](https://www.youtube.com/watch?v=e4dT8FJ2GE0)
- - ["Svefns Og Vöku Skil", their latest album](https://arstidir.bandcamp.com/album/svefns-og-v-ku-skil)
+ - ["Svefns Og Vöku Skil", their latest album](https://web.archive.org/web/20141224230329/https://arstidir.bandcamp.com/album/svefns-og-v-ku-skil)
? +++++++++++++++++++++++++++++++++++++++++++
- [Kickstarter for their third album](https://www.kickstarter.com/projects/arstidir/arstiir-music-from-the-heart-of-iceland-our-third)
If that doesn't impress you, I don't know what will. | 2 | 0.117647 | 1 | 1 |
a9d3ca1a7bb59e0fbb3767e9f660adee59784240 | templates/default/config.properties.erb | templates/default/config.properties.erb | imq.instanceconfig.version=300
<%
configs = {}
configs.merge!(@resource.config)
bridges = []
services = []
configs["imq.portmapper.port"] = @resource.port
if @resource.admin_port
services << "admin"
configs["imq.admin.tcp.port"] = @resource.admin_port
end
if @resource.jms_port
services << "jms"
configs["imq.jms.tcp.port"] = @resource.jms_port
end
if @resource.stomp_port
bridges << "stomp"
configs["imq.bridge.stomp.tcp.enabled"] = "true"
configs["imq.bridge.stomp.tcp.port"] = @resource.stomp_port
end
if services.size > 0
configs["imq.service.activelist"] = services.join(',')
end
configs["imq.bridge.admin.user"] = @resource.admin_user
user = @resource.users[@resource.admin_user]
raise "Missing user details for admin user '#{@resource.admin_user}'" unless user
configs["imq.bridge.admin.password"] = user[:password]
configs["imq.imqcmd.password"] = user[:password]
if bridges.size > 0
configs["imq.bridge.enabled"] = "true"
configs["imq.bridge.activelist"] = bridges.join(',')
end
%>
<%= configs.sort.collect { |k, v| "#{k}=#{v}\n" }.join("") %> | imq.instanceconfig.version=300
<%
configs = {}
configs["imq.log.timezone"] = node["tz"] || "GMT"
configs.merge!(@resource.config)
bridges = []
services = []
configs["imq.portmapper.port"] = @resource.port
if @resource.admin_port
services << "admin"
configs["imq.admin.tcp.port"] = @resource.admin_port
end
if @resource.jms_port
services << "jms"
configs["imq.jms.tcp.port"] = @resource.jms_port
end
if @resource.stomp_port
bridges << "stomp"
configs["imq.bridge.stomp.tcp.enabled"] = "true"
configs["imq.bridge.stomp.tcp.port"] = @resource.stomp_port
end
if services.size > 0
configs["imq.service.activelist"] = services.join(',')
end
configs["imq.bridge.admin.user"] = @resource.admin_user
user = @resource.users[@resource.admin_user]
raise "Missing user details for admin user '#{@resource.admin_user}'" unless user
configs["imq.bridge.admin.password"] = user[:password]
configs["imq.imqcmd.password"] = user[:password]
if bridges.size > 0
configs["imq.bridge.enabled"] = "true"
configs["imq.bridge.activelist"] = bridges.join(',')
end
%>
<%= configs.sort.collect { |k, v| "#{k}=#{v}\n" }.join("") %> | Make sure the imq log timzone is configured as per nodes timezone | Make sure the imq log timzone is configured as per nodes timezone
| HTML+ERB | apache-2.0 | realityforge/chef-glassfish,predictivelogic/chef-glassfish,predictivelogic/chef-glassfish,realityforge/chef-glassfish,predictivelogic/chef-glassfish,realityforge/chef-glassfish,hopshadoop/chef-glassfish,hopshadoop/chef-glassfish,hopshadoop/chef-glassfish | html+erb | ## Code Before:
imq.instanceconfig.version=300
<%
configs = {}
configs.merge!(@resource.config)
bridges = []
services = []
configs["imq.portmapper.port"] = @resource.port
if @resource.admin_port
services << "admin"
configs["imq.admin.tcp.port"] = @resource.admin_port
end
if @resource.jms_port
services << "jms"
configs["imq.jms.tcp.port"] = @resource.jms_port
end
if @resource.stomp_port
bridges << "stomp"
configs["imq.bridge.stomp.tcp.enabled"] = "true"
configs["imq.bridge.stomp.tcp.port"] = @resource.stomp_port
end
if services.size > 0
configs["imq.service.activelist"] = services.join(',')
end
configs["imq.bridge.admin.user"] = @resource.admin_user
user = @resource.users[@resource.admin_user]
raise "Missing user details for admin user '#{@resource.admin_user}'" unless user
configs["imq.bridge.admin.password"] = user[:password]
configs["imq.imqcmd.password"] = user[:password]
if bridges.size > 0
configs["imq.bridge.enabled"] = "true"
configs["imq.bridge.activelist"] = bridges.join(',')
end
%>
<%= configs.sort.collect { |k, v| "#{k}=#{v}\n" }.join("") %>
## Instruction:
Make sure the imq log timzone is configured as per nodes timezone
## Code After:
imq.instanceconfig.version=300
<%
configs = {}
configs["imq.log.timezone"] = node["tz"] || "GMT"
configs.merge!(@resource.config)
bridges = []
services = []
configs["imq.portmapper.port"] = @resource.port
if @resource.admin_port
services << "admin"
configs["imq.admin.tcp.port"] = @resource.admin_port
end
if @resource.jms_port
services << "jms"
configs["imq.jms.tcp.port"] = @resource.jms_port
end
if @resource.stomp_port
bridges << "stomp"
configs["imq.bridge.stomp.tcp.enabled"] = "true"
configs["imq.bridge.stomp.tcp.port"] = @resource.stomp_port
end
if services.size > 0
configs["imq.service.activelist"] = services.join(',')
end
configs["imq.bridge.admin.user"] = @resource.admin_user
user = @resource.users[@resource.admin_user]
raise "Missing user details for admin user '#{@resource.admin_user}'" unless user
configs["imq.bridge.admin.password"] = user[:password]
configs["imq.imqcmd.password"] = user[:password]
if bridges.size > 0
configs["imq.bridge.enabled"] = "true"
configs["imq.bridge.activelist"] = bridges.join(',')
end
%>
<%= configs.sort.collect { |k, v| "#{k}=#{v}\n" }.join("") %> | imq.instanceconfig.version=300
<%
configs = {}
+ configs["imq.log.timezone"] = node["tz"] || "GMT"
+
configs.merge!(@resource.config)
bridges = []
services = []
configs["imq.portmapper.port"] = @resource.port
if @resource.admin_port
services << "admin"
configs["imq.admin.tcp.port"] = @resource.admin_port
end
if @resource.jms_port
services << "jms"
configs["imq.jms.tcp.port"] = @resource.jms_port
end
if @resource.stomp_port
bridges << "stomp"
configs["imq.bridge.stomp.tcp.enabled"] = "true"
configs["imq.bridge.stomp.tcp.port"] = @resource.stomp_port
end
if services.size > 0
configs["imq.service.activelist"] = services.join(',')
end
configs["imq.bridge.admin.user"] = @resource.admin_user
user = @resource.users[@resource.admin_user]
raise "Missing user details for admin user '#{@resource.admin_user}'" unless user
configs["imq.bridge.admin.password"] = user[:password]
configs["imq.imqcmd.password"] = user[:password]
if bridges.size > 0
configs["imq.bridge.enabled"] = "true"
configs["imq.bridge.activelist"] = bridges.join(',')
end
%>
<%= configs.sort.collect { |k, v| "#{k}=#{v}\n" }.join("") %> | 2 | 0.047619 | 2 | 0 |
48903c3a7f7a0419f934b46e030cf3640b949193 | .github/workflows/main.yml | .github/workflows/main.yml | name: Publish DockerHub
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Publish Docker
uses: elgohr/Publish-Docker-Github-Action@2.13
with:
name: checkr/flagr
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tag_semver: true
| name: Publish DockerHub
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Publish Docker SemVer Tag
uses: elgohr/Publish-Docker-Github-Action@2.13
with:
name: checkr/flagr
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tag_semver: true
- name: Publish Docker Latest Tag
uses: elgohr/Publish-Docker-Github-Action@2.13
with:
name: checkr/flagr
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tag: latest
| Add publish to dockerhub with latest tag | Add publish to dockerhub with latest tag | YAML | apache-2.0 | checkr/flagr,checkr/flagr,checkr/flagr,checkr/flagr | yaml | ## Code Before:
name: Publish DockerHub
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Publish Docker
uses: elgohr/Publish-Docker-Github-Action@2.13
with:
name: checkr/flagr
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tag_semver: true
## Instruction:
Add publish to dockerhub with latest tag
## Code After:
name: Publish DockerHub
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Publish Docker SemVer Tag
uses: elgohr/Publish-Docker-Github-Action@2.13
with:
name: checkr/flagr
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tag_semver: true
- name: Publish Docker Latest Tag
uses: elgohr/Publish-Docker-Github-Action@2.13
with:
name: checkr/flagr
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tag: latest
| name: Publish DockerHub
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- - name: Publish Docker
+ - name: Publish Docker SemVer Tag
? +++++++++++
uses: elgohr/Publish-Docker-Github-Action@2.13
with:
name: checkr/flagr
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tag_semver: true
+ - name: Publish Docker Latest Tag
+ uses: elgohr/Publish-Docker-Github-Action@2.13
+ with:
+ name: checkr/flagr
+ username: ${{ secrets.DOCKER_USERNAME }}
+ password: ${{ secrets.DOCKER_PASSWORD }}
+ tag: latest | 9 | 0.5625 | 8 | 1 |
134ed2f925d0aadae33403b4eb993120f9c0d363 | .travis.yml | .travis.yml | language: node_js
node_js:
- "6"
- "7"
| language: node_js
node_js:
- "6"
- "7"
git:
submodules: false
| Remove need for git submodule loading | Remove need for git submodule loading
| YAML | mit | ajfisher/node-pixel,ajfisher/node-pixel,ajfisher/node-pixel,ajfisher/node-pixel | yaml | ## Code Before:
language: node_js
node_js:
- "6"
- "7"
## Instruction:
Remove need for git submodule loading
## Code After:
language: node_js
node_js:
- "6"
- "7"
git:
submodules: false
| language: node_js
node_js:
- "6"
- "7"
-
+ git:
+ submodules: false | 3 | 0.6 | 2 | 1 |
2a1031d417e4a670da284222d52e94f92e8d1889 | src/spec/controllers/wmata-spec.js | src/spec/controllers/wmata-spec.js | /* eslint-env mocha */
const redisMock = require('redis-mock');
const chai = require('chai');
chai.should();
const db = {
redis: redisMock.createClient(),
};
const fakeRedis = redisMock.createClient();
const wmata = require('../../controllers/wmata.js')(db);
describe('WMATA Controllers - ', () => {
it('Method get_metadata() should acquire rail metadata.', (done) => {
wmata.get_metadata(() => {
let value = fakeRedis.get('wmata_metadata');
done();
});
});
it('Method get_stations_list() should acquire rail metadata.', (done) => {
wmata.get_stations_list('RD', () => {
let value = fakeRedis.get('wmata_line_RD');
done();
});
});
it('Method get_stations_status() should acquire rail metadata.', (done) => {
wmata.get_stations_status(() => {
let value = fakeRedis.get('wmata_metadata');
done();
});
});
});
| /* eslint-env mocha */
const redisMock = require('redis-mock');
const chai = require('chai');
chai.should();
const db = {
redis: redisMock.createClient(),
};
const fakeRedis = redisMock.createClient();
const wmata = require('../../controllers/wmata.js')(db);
describe('WMATA Controllers - ', () => {
it('Method get_metadata() should acquire rail metadata.', (done) => {
wmata.get_metadata(() => {
let value = db.redis.get('wmata_metadata');
done();
});
});
it('Method get_stations_list() should acquire rail metadata.', (done) => {
wmata.get_stations_list('RD', () => {
let value = db.redis.get('wmata_line_RD');
done();
});
});
it('Method get_stations_status() should acquire rail metadata.', (done) => {
wmata.get_stations_status(() => {
let value = db.redis.get('wmata_realtime_status');
done();
});
});
});
| Fix up wmata controller tests | Fix up wmata controller tests
| JavaScript | unlicense | freestylebit/wmata-rails-tracker,freestylebit/wmata-rails-tracker | javascript | ## Code Before:
/* eslint-env mocha */
const redisMock = require('redis-mock');
const chai = require('chai');
chai.should();
const db = {
redis: redisMock.createClient(),
};
const fakeRedis = redisMock.createClient();
const wmata = require('../../controllers/wmata.js')(db);
describe('WMATA Controllers - ', () => {
it('Method get_metadata() should acquire rail metadata.', (done) => {
wmata.get_metadata(() => {
let value = fakeRedis.get('wmata_metadata');
done();
});
});
it('Method get_stations_list() should acquire rail metadata.', (done) => {
wmata.get_stations_list('RD', () => {
let value = fakeRedis.get('wmata_line_RD');
done();
});
});
it('Method get_stations_status() should acquire rail metadata.', (done) => {
wmata.get_stations_status(() => {
let value = fakeRedis.get('wmata_metadata');
done();
});
});
});
## Instruction:
Fix up wmata controller tests
## Code After:
/* eslint-env mocha */
const redisMock = require('redis-mock');
const chai = require('chai');
chai.should();
const db = {
redis: redisMock.createClient(),
};
const fakeRedis = redisMock.createClient();
const wmata = require('../../controllers/wmata.js')(db);
describe('WMATA Controllers - ', () => {
it('Method get_metadata() should acquire rail metadata.', (done) => {
wmata.get_metadata(() => {
let value = db.redis.get('wmata_metadata');
done();
});
});
it('Method get_stations_list() should acquire rail metadata.', (done) => {
wmata.get_stations_list('RD', () => {
let value = db.redis.get('wmata_line_RD');
done();
});
});
it('Method get_stations_status() should acquire rail metadata.', (done) => {
wmata.get_stations_status(() => {
let value = db.redis.get('wmata_realtime_status');
done();
});
});
});
| /* eslint-env mocha */
const redisMock = require('redis-mock');
const chai = require('chai');
chai.should();
const db = {
redis: redisMock.createClient(),
};
const fakeRedis = redisMock.createClient();
const wmata = require('../../controllers/wmata.js')(db);
describe('WMATA Controllers - ', () => {
it('Method get_metadata() should acquire rail metadata.', (done) => {
wmata.get_metadata(() => {
- let value = fakeRedis.get('wmata_metadata');
? ^^^^^
+ let value = db.redis.get('wmata_metadata');
? ^^^^
done();
});
});
it('Method get_stations_list() should acquire rail metadata.', (done) => {
wmata.get_stations_list('RD', () => {
- let value = fakeRedis.get('wmata_line_RD');
? ^^^^^
+ let value = db.redis.get('wmata_line_RD');
? ^^^^
done();
});
});
it('Method get_stations_status() should acquire rail metadata.', (done) => {
wmata.get_stations_status(() => {
- let value = fakeRedis.get('wmata_metadata');
? ^^^^^ -- ^
+ let value = db.redis.get('wmata_realtime_status');
? ^^^^ ++++++ ++ ^^
done();
});
});
}); | 6 | 0.193548 | 3 | 3 |
e2695a633c0fef9ef0402ba765f4e7322574f324 | language-command.js | language-command.js | var _ = require('lodash');
var os = require('os');
var path = require('path');
var crypto = require('crypto');
var commands = require('./commands.json');
/**
* Look up the command for executing a file in any language.
*
* @param {String} language
* @param {String} file
* @param {String} args
* @return {String}
*/
module.exports = function (language, file, args) {
// Unsupported language.
if (!commands[language]) {
return;
}
// Render the language using EJS to enable support for inline JavaScript.
return _.template(commands[language], {
file: file,
tmpdir: os.tmpdir(),
tmpfile: path.join(os.tmpdir(), crypto.randomBytes(32).toString('hex')),
dirname: path.dirname,
extname: path.extname,
basename: path.basename,
type: os.type(),
arch: os.arch(),
platform: os.platform(),
sep: path.sep,
join: path.join,
delimiter: path.delimiter,
args: args
});
};
| var _ = require('lodash');
var os = require('os');
var path = require('path');
var crypto = require('crypto');
var commands = require('./commands.json');
/**
* Look up the command for executing a file in any language.
*
* @param {String} language
* @param {String} file
* @param {Array} args
* @return {String}
*/
module.exports = function (language, file, args) {
// Unsupported language.
if (!commands[language]) {
return;
}
// Render the language using EJS to enable support for inline JavaScript.
return _.template(commands[language], {
file: file,
tmpdir: os.tmpdir(),
tmpfile: path.join(os.tmpdir(), crypto.randomBytes(32).toString('hex')),
dirname: path.dirname,
extname: path.extname,
basename: path.basename,
type: os.type(),
arch: os.arch(),
platform: os.platform(),
sep: path.sep,
join: path.join,
delimiter: path.delimiter,
args: Array.isArray(args) ? args.map(JSON.stringify).join(' ') : args
});
};
| Support an array of arguments. | Support an array of arguments.
| JavaScript | mit | blakeembrey/node-language-command | javascript | ## Code Before:
var _ = require('lodash');
var os = require('os');
var path = require('path');
var crypto = require('crypto');
var commands = require('./commands.json');
/**
* Look up the command for executing a file in any language.
*
* @param {String} language
* @param {String} file
* @param {String} args
* @return {String}
*/
module.exports = function (language, file, args) {
// Unsupported language.
if (!commands[language]) {
return;
}
// Render the language using EJS to enable support for inline JavaScript.
return _.template(commands[language], {
file: file,
tmpdir: os.tmpdir(),
tmpfile: path.join(os.tmpdir(), crypto.randomBytes(32).toString('hex')),
dirname: path.dirname,
extname: path.extname,
basename: path.basename,
type: os.type(),
arch: os.arch(),
platform: os.platform(),
sep: path.sep,
join: path.join,
delimiter: path.delimiter,
args: args
});
};
## Instruction:
Support an array of arguments.
## Code After:
var _ = require('lodash');
var os = require('os');
var path = require('path');
var crypto = require('crypto');
var commands = require('./commands.json');
/**
* Look up the command for executing a file in any language.
*
* @param {String} language
* @param {String} file
* @param {Array} args
* @return {String}
*/
module.exports = function (language, file, args) {
// Unsupported language.
if (!commands[language]) {
return;
}
// Render the language using EJS to enable support for inline JavaScript.
return _.template(commands[language], {
file: file,
tmpdir: os.tmpdir(),
tmpfile: path.join(os.tmpdir(), crypto.randomBytes(32).toString('hex')),
dirname: path.dirname,
extname: path.extname,
basename: path.basename,
type: os.type(),
arch: os.arch(),
platform: os.platform(),
sep: path.sep,
join: path.join,
delimiter: path.delimiter,
args: Array.isArray(args) ? args.map(JSON.stringify).join(' ') : args
});
};
| var _ = require('lodash');
var os = require('os');
var path = require('path');
var crypto = require('crypto');
var commands = require('./commands.json');
/**
* Look up the command for executing a file in any language.
*
* @param {String} language
* @param {String} file
- * @param {String} args
? ^^ ^^^
+ * @param {Array} args
? ^ ^^^ +
* @return {String}
*/
module.exports = function (language, file, args) {
// Unsupported language.
if (!commands[language]) {
return;
}
// Render the language using EJS to enable support for inline JavaScript.
return _.template(commands[language], {
file: file,
tmpdir: os.tmpdir(),
tmpfile: path.join(os.tmpdir(), crypto.randomBytes(32).toString('hex')),
dirname: path.dirname,
extname: path.extname,
basename: path.basename,
type: os.type(),
arch: os.arch(),
platform: os.platform(),
sep: path.sep,
join: path.join,
delimiter: path.delimiter,
- args: args
+ args: Array.isArray(args) ? args.map(JSON.stringify).join(' ') : args
});
}; | 4 | 0.108108 | 2 | 2 |
02f50c617baf0831cf2c73012baad694bb4fb676 | .travis.yml | .travis.yml | language: haskell
script:
- cabal install --enable-tests
- cabal install examples/liblastfm-examples.cabal
| language: haskell
script:
- cabal install --enable-tests liblastfm.cabal examples/liblastfm-examples.cabal
| Build the library together with its examples | Build the library together with its examples
| YAML | mit | supki/liblastfm | yaml | ## Code Before:
language: haskell
script:
- cabal install --enable-tests
- cabal install examples/liblastfm-examples.cabal
## Instruction:
Build the library together with its examples
## Code After:
language: haskell
script:
- cabal install --enable-tests liblastfm.cabal examples/liblastfm-examples.cabal
| language: haskell
script:
- - cabal install --enable-tests
- - cabal install examples/liblastfm-examples.cabal
+ - cabal install --enable-tests liblastfm.cabal examples/liblastfm-examples.cabal
? +++++++++++++++++++++++++++++++
| 3 | 0.6 | 1 | 2 |
40540495e28f89f44ce603fa62573656eefb2651 | tools/javadoc-style/src/main/resources/META-INF/gradle-plugins/io.spine.javadoc-style.properties | tools/javadoc-style/src/main/resources/META-INF/gradle-plugins/io.spine.javadoc-style.properties |
implementation-class=io.spine.tools.protodoc.JavadocStylePlugin
|
implementation-class=io.spine.tools.javadoc.style.JavadocStylePlugin
| Fix class ref. in manifest | Fix class ref. in manifest
| INI | apache-2.0 | SpineEventEngine/base,SpineEventEngine/base,SpineEventEngine/base | ini | ## Code Before:
implementation-class=io.spine.tools.protodoc.JavadocStylePlugin
## Instruction:
Fix class ref. in manifest
## Code After:
implementation-class=io.spine.tools.javadoc.style.JavadocStylePlugin
|
- implementation-class=io.spine.tools.protodoc.JavadocStylePlugin
? ^^^^^
+ implementation-class=io.spine.tools.javadoc.style.JavadocStylePlugin
? ^^^^ ++++++
| 2 | 1 | 1 | 1 |
92f3ad16c83ceaf4f23d43a3eb4475d762cfe230 | spec/lib/reveal-ck/builder_spec.rb | spec/lib/reveal-ck/builder_spec.rb | require 'spec_helper'
module RevealCK
describe Builder, 'when subclassed' do
it 'requires that subclasses implement #register_tasks' do
class BadBuilder < Builder; end
bad_builder = BadBuilder.new
expect { bad_builder.register_tasks }.to raise_error
end
it 'invokes each registered task when it receives #build' do
class TestBuilder < Builder
attr_reader :action_mock
def register_tasks
@tasks = []
add_task('Some Task Description',
lambda {
@action_mock.do_something
})
end
end
test_builder = TestBuilder.new
expect(test_builder.action_mock).to receive :do_something
test_builder.build!
end
end
end
| require 'spec_helper'
module RevealCK
describe Builder, 'when subclassed' do
it 'requires that subclasses implement #register_tasks' do
class BadBuilder < Builder; end
bad_builder = BadBuilder.new
expect { bad_builder.register_tasks }.to raise_error
end
it 'invokes each registered task when it receives #build' do
class TestBuilder < Builder
attr_reader :value
def initialize
@value = 0
end
def register_tasks
@tasks = []
@value = 0
add_task 'Set Value to 1', lambda { @value = 1 }
end
end
test_builder = TestBuilder.new
test_builder.build!
expect(test_builder.value).to eq 1
end
end
end
| Tweak specs. Don't need expectation. | [builder-spec] Tweak specs. Don't need expectation.
| Ruby | mit | jedcn/reveal-ck,jedcn/reveal-ck,jedcn/reveal-ck | ruby | ## Code Before:
require 'spec_helper'
module RevealCK
describe Builder, 'when subclassed' do
it 'requires that subclasses implement #register_tasks' do
class BadBuilder < Builder; end
bad_builder = BadBuilder.new
expect { bad_builder.register_tasks }.to raise_error
end
it 'invokes each registered task when it receives #build' do
class TestBuilder < Builder
attr_reader :action_mock
def register_tasks
@tasks = []
add_task('Some Task Description',
lambda {
@action_mock.do_something
})
end
end
test_builder = TestBuilder.new
expect(test_builder.action_mock).to receive :do_something
test_builder.build!
end
end
end
## Instruction:
[builder-spec] Tweak specs. Don't need expectation.
## Code After:
require 'spec_helper'
module RevealCK
describe Builder, 'when subclassed' do
it 'requires that subclasses implement #register_tasks' do
class BadBuilder < Builder; end
bad_builder = BadBuilder.new
expect { bad_builder.register_tasks }.to raise_error
end
it 'invokes each registered task when it receives #build' do
class TestBuilder < Builder
attr_reader :value
def initialize
@value = 0
end
def register_tasks
@tasks = []
@value = 0
add_task 'Set Value to 1', lambda { @value = 1 }
end
end
test_builder = TestBuilder.new
test_builder.build!
expect(test_builder.value).to eq 1
end
end
end
| require 'spec_helper'
module RevealCK
describe Builder, 'when subclassed' do
it 'requires that subclasses implement #register_tasks' do
class BadBuilder < Builder; end
bad_builder = BadBuilder.new
expect { bad_builder.register_tasks }.to raise_error
end
it 'invokes each registered task when it receives #build' do
class TestBuilder < Builder
+
- attr_reader :action_mock
? ^^^^^^^^^^
+ attr_reader :value
? + ^^^
+
+ def initialize
+ @value = 0
+ end
+
def register_tasks
@tasks = []
+ @value = 0
+ add_task 'Set Value to 1', lambda { @value = 1 }
- add_task('Some Task Description',
- lambda {
- @action_mock.do_something
- })
end
end
test_builder = TestBuilder.new
- expect(test_builder.action_mock).to receive :do_something
test_builder.build!
+ expect(test_builder.value).to eq 1
end
end
end | 16 | 0.516129 | 10 | 6 |
c9564a11e62fb37bdf7383bc62f131a949306dd0 | app/views/coronavirus_landing_page/components/shared/_announcements.html.erb | app/views/coronavirus_landing_page/components/shared/_announcements.html.erb | <div class="govuk-grid-row">
<% announcements.each do |announcement| %>
<div class="govuk-grid-column-one-third">
<% announcement_text = capture do %>
<% if announcement["href"].present? %>
<a
href="<%= announcement["href"] %>"
class="govuk-link covid__page-header-link"
data-module="track-click"
data-track-category="pageElementInteraction"
data-track-action="Announcements"
data-track-label="<%= announcement["href"] %>"
>
<%= announcement["text"] %>
</a>
<% else %>
<%= announcement["text"] %>
<% end %>
<% end %>
<%= render "govuk_publishing_components/components/heading", {
text: announcement_text,
heading_level: 3,
font_size: 19,
inverse: true,
margin_bottom: 4
} %>
</div>
<% end %>
</div>
| <div class="govuk-grid-row">
<% announcements.each do |announcement| %>
<div class="govuk-grid-column-one-third">
<p class="govuk-body covid__inverse">
<% if announcement["href"].present? %>
<a
href="<%= announcement["href"] %>"
class="govuk-link covid__page-header-link"
data-module="track-click"
data-track-category="pageElementInteraction"
data-track-action="Announcements"
data-track-label="<%= announcement["href"] %>"
>
<%= announcement["text"] %>
</a>
<% else %>
<%= announcement["text"] %>
<% end %>
</p>
</div>
<% end %>
</div>
| Remove heading level from announcements | Remove heading level from announcements
| HTML+ERB | mit | alphagov/collections,alphagov/collections,alphagov/collections,alphagov/collections | html+erb | ## Code Before:
<div class="govuk-grid-row">
<% announcements.each do |announcement| %>
<div class="govuk-grid-column-one-third">
<% announcement_text = capture do %>
<% if announcement["href"].present? %>
<a
href="<%= announcement["href"] %>"
class="govuk-link covid__page-header-link"
data-module="track-click"
data-track-category="pageElementInteraction"
data-track-action="Announcements"
data-track-label="<%= announcement["href"] %>"
>
<%= announcement["text"] %>
</a>
<% else %>
<%= announcement["text"] %>
<% end %>
<% end %>
<%= render "govuk_publishing_components/components/heading", {
text: announcement_text,
heading_level: 3,
font_size: 19,
inverse: true,
margin_bottom: 4
} %>
</div>
<% end %>
</div>
## Instruction:
Remove heading level from announcements
## Code After:
<div class="govuk-grid-row">
<% announcements.each do |announcement| %>
<div class="govuk-grid-column-one-third">
<p class="govuk-body covid__inverse">
<% if announcement["href"].present? %>
<a
href="<%= announcement["href"] %>"
class="govuk-link covid__page-header-link"
data-module="track-click"
data-track-category="pageElementInteraction"
data-track-action="Announcements"
data-track-label="<%= announcement["href"] %>"
>
<%= announcement["text"] %>
</a>
<% else %>
<%= announcement["text"] %>
<% end %>
</p>
</div>
<% end %>
</div>
| <div class="govuk-grid-row">
<% announcements.each do |announcement| %>
<div class="govuk-grid-column-one-third">
- <% announcement_text = capture do %>
+ <p class="govuk-body covid__inverse">
<% if announcement["href"].present? %>
<a
href="<%= announcement["href"] %>"
class="govuk-link covid__page-header-link"
data-module="track-click"
data-track-category="pageElementInteraction"
data-track-action="Announcements"
data-track-label="<%= announcement["href"] %>"
>
<%= announcement["text"] %>
</a>
<% else %>
<%= announcement["text"] %>
<% end %>
+ </p>
- <% end %>
- <%= render "govuk_publishing_components/components/heading", {
- text: announcement_text,
- heading_level: 3,
- font_size: 19,
- inverse: true,
- margin_bottom: 4
- } %>
</div>
<% end %>
</div> | 11 | 0.37931 | 2 | 9 |
1d42660ce6b091487ef570ffffe557f765d1580b | dev/git/README.md | dev/git/README.md | * [git reset --hard HEAD leaves untracked files behind](http://stackoverflow.com/questions/4327708/git-reset-hard-head-leaves-untracked-files-behind)
#### Tag
* [Download a specific tag with Git](http://stackoverflow.com/questions/791959/download-a-specific-tag-with-git)
#### Log
* [git log](http://www.cnblogs.com/gbyukg/archive/2011/12/12/2285419.html)
#### Remote
* [Git远程操作详解](http://www.ruanyifeng.com/blog/2014/06/git_remote.html)
#### Books
* [Git Book](https://git-scm.com/book/zh/v2)
| * [git reset --hard HEAD leaves untracked files behind](http://stackoverflow.com/questions/4327708/git-reset-hard-head-leaves-untracked-files-behind)
#### Tag
* [Download a specific tag with Git](http://stackoverflow.com/questions/791959/download-a-specific-tag-with-git)
#### Log
* [git log](http://www.cnblogs.com/gbyukg/archive/2011/12/12/2285419.html)
#### Remote
* [Git远程操作详解](http://www.ruanyifeng.com/blog/2014/06/git_remote.html)
* [2.5 Git 基础 - 远程仓库的使用](https://git-scm.com/book/zh/v2/Git-%E5%9F%BA%E7%A1%80-%E8%BF%9C%E7%A8%8B%E4%BB%93%E5%BA%93%E7%9A%84%E4%BD%BF%E7%94%A8)
#### Books
* [Git Book](https://git-scm.com/book/zh/v2)
| Add 2.5 Git 基础 - 远程仓库的使用 | Add 2.5 Git 基础 - 远程仓库的使用
| Markdown | mit | northbright/bookmarks,northbright/bookmarks,northbright/bookmarks | markdown | ## Code Before:
* [git reset --hard HEAD leaves untracked files behind](http://stackoverflow.com/questions/4327708/git-reset-hard-head-leaves-untracked-files-behind)
#### Tag
* [Download a specific tag with Git](http://stackoverflow.com/questions/791959/download-a-specific-tag-with-git)
#### Log
* [git log](http://www.cnblogs.com/gbyukg/archive/2011/12/12/2285419.html)
#### Remote
* [Git远程操作详解](http://www.ruanyifeng.com/blog/2014/06/git_remote.html)
#### Books
* [Git Book](https://git-scm.com/book/zh/v2)
## Instruction:
Add 2.5 Git 基础 - 远程仓库的使用
## Code After:
* [git reset --hard HEAD leaves untracked files behind](http://stackoverflow.com/questions/4327708/git-reset-hard-head-leaves-untracked-files-behind)
#### Tag
* [Download a specific tag with Git](http://stackoverflow.com/questions/791959/download-a-specific-tag-with-git)
#### Log
* [git log](http://www.cnblogs.com/gbyukg/archive/2011/12/12/2285419.html)
#### Remote
* [Git远程操作详解](http://www.ruanyifeng.com/blog/2014/06/git_remote.html)
* [2.5 Git 基础 - 远程仓库的使用](https://git-scm.com/book/zh/v2/Git-%E5%9F%BA%E7%A1%80-%E8%BF%9C%E7%A8%8B%E4%BB%93%E5%BA%93%E7%9A%84%E4%BD%BF%E7%94%A8)
#### Books
* [Git Book](https://git-scm.com/book/zh/v2)
| * [git reset --hard HEAD leaves untracked files behind](http://stackoverflow.com/questions/4327708/git-reset-hard-head-leaves-untracked-files-behind)
#### Tag
* [Download a specific tag with Git](http://stackoverflow.com/questions/791959/download-a-specific-tag-with-git)
#### Log
* [git log](http://www.cnblogs.com/gbyukg/archive/2011/12/12/2285419.html)
#### Remote
* [Git远程操作详解](http://www.ruanyifeng.com/blog/2014/06/git_remote.html)
+ * [2.5 Git 基础 - 远程仓库的使用](https://git-scm.com/book/zh/v2/Git-%E5%9F%BA%E7%A1%80-%E8%BF%9C%E7%A8%8B%E4%BB%93%E5%BA%93%E7%9A%84%E4%BD%BF%E7%94%A8)
#### Books
* [Git Book](https://git-scm.com/book/zh/v2) | 1 | 0.076923 | 1 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.