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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a570260357155454465815c292a14a1c43d9213a | test/SemaCXX/virtual-base-used.cpp | test/SemaCXX/virtual-base-used.cpp | // RUN: %clang_cc1 -fsyntax-only -verify %s
// PR7800
class NoDestroy { ~NoDestroy(); }; // expected-note {{declared private here}}
struct A {
virtual ~A();
};
struct B : public virtual A {
NoDestroy x; // expected-error {{field of type 'NoDestroy' has private destructor}}
};
struct D : public virtual B {
virtual void foo();
~D();
};
void D::foo() { // expected-note {{implicit default destructor for 'B' first required here}}
}
| // RUN: %clang_cc1 -fsyntax-only -verify %s
// PR7800
class NoDestroy { ~NoDestroy(); }; // expected-note 3 {{declared private here}}
struct A {
virtual ~A();
};
struct B : public virtual A {
NoDestroy x; // expected-error {{field of type 'NoDestroy' has private destructor}}
};
struct D : public virtual B {
virtual void foo();
~D();
};
void D::foo() { // expected-note {{implicit default destructor for 'B' first required here}}
}
struct E : public virtual A {
NoDestroy x; // expected-error {{field of type 'NoDestroy' has private destructor}}
};
struct F : public E { // expected-note {{implicit default destructor for 'E' first required here}}
};
struct G : public virtual F {
virtual void foo();
~G();
};
void G::foo() { // expected-note {{implicit default destructor for 'F' first required here}}
}
struct H : public virtual A {
NoDestroy x; // expected-error {{field of type 'NoDestroy' has private destructor}}
};
struct I : public virtual H {
~I();
};
struct J : public I {
virtual void foo();
~J();
};
void J::foo() { // expected-note {{implicit default destructor for 'H' first required here}}
}
| Make this test check a few more cases which didn't work correctly before r110526. | Make this test check a few more cases which didn't work correctly before
r110526.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@110540 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang | c++ | ## Code Before:
// RUN: %clang_cc1 -fsyntax-only -verify %s
// PR7800
class NoDestroy { ~NoDestroy(); }; // expected-note {{declared private here}}
struct A {
virtual ~A();
};
struct B : public virtual A {
NoDestroy x; // expected-error {{field of type 'NoDestroy' has private destructor}}
};
struct D : public virtual B {
virtual void foo();
~D();
};
void D::foo() { // expected-note {{implicit default destructor for 'B' first required here}}
}
## Instruction:
Make this test check a few more cases which didn't work correctly before
r110526.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@110540 91177308-0d34-0410-b5e6-96231b3b80d8
## Code After:
// RUN: %clang_cc1 -fsyntax-only -verify %s
// PR7800
class NoDestroy { ~NoDestroy(); }; // expected-note 3 {{declared private here}}
struct A {
virtual ~A();
};
struct B : public virtual A {
NoDestroy x; // expected-error {{field of type 'NoDestroy' has private destructor}}
};
struct D : public virtual B {
virtual void foo();
~D();
};
void D::foo() { // expected-note {{implicit default destructor for 'B' first required here}}
}
struct E : public virtual A {
NoDestroy x; // expected-error {{field of type 'NoDestroy' has private destructor}}
};
struct F : public E { // expected-note {{implicit default destructor for 'E' first required here}}
};
struct G : public virtual F {
virtual void foo();
~G();
};
void G::foo() { // expected-note {{implicit default destructor for 'F' first required here}}
}
struct H : public virtual A {
NoDestroy x; // expected-error {{field of type 'NoDestroy' has private destructor}}
};
struct I : public virtual H {
~I();
};
struct J : public I {
virtual void foo();
~J();
};
void J::foo() { // expected-note {{implicit default destructor for 'H' first required here}}
}
| // RUN: %clang_cc1 -fsyntax-only -verify %s
// PR7800
- class NoDestroy { ~NoDestroy(); }; // expected-note {{declared private here}}
+ class NoDestroy { ~NoDestroy(); }; // expected-note 3 {{declared private here}}
? ++
struct A {
virtual ~A();
};
+
struct B : public virtual A {
NoDestroy x; // expected-error {{field of type 'NoDestroy' has private destructor}}
};
struct D : public virtual B {
virtual void foo();
~D();
};
void D::foo() { // expected-note {{implicit default destructor for 'B' first required here}}
}
+
+ struct E : public virtual A {
+ NoDestroy x; // expected-error {{field of type 'NoDestroy' has private destructor}}
+ };
+ struct F : public E { // expected-note {{implicit default destructor for 'E' first required here}}
+ };
+ struct G : public virtual F {
+ virtual void foo();
+ ~G();
+ };
+ void G::foo() { // expected-note {{implicit default destructor for 'F' first required here}}
+ }
+
+ struct H : public virtual A {
+ NoDestroy x; // expected-error {{field of type 'NoDestroy' has private destructor}}
+ };
+ struct I : public virtual H {
+ ~I();
+ };
+ struct J : public I {
+ virtual void foo();
+ ~J();
+ };
+ void J::foo() { // expected-note {{implicit default destructor for 'H' first required here}}
+ } | 28 | 1.75 | 27 | 1 |
5b629d0adf91eeedbdb7e123694d3af5e994c64d | packages/ch/checked.yaml | packages/ch/checked.yaml | homepage: ''
changelog-type: ''
hash: 0db6a8f5bea864c7aeee03e12d575a0ca10c22212f04655fa2d3a3ed4e251264
test-bench-deps: {}
maintainer: Antoine Latter <aslatter@gmail.com>
synopsis: Bounds-checking integer types.
changelog: ''
basic-deps:
base: ! '>=3.0.1.0 && <5'
all-versions:
- '0.1.0.0'
- '0.1.0.1'
author: Antoine Latter
latest: '0.1.0.1'
description-type: haddock
description: ! 'Includes replacements for all of the ''Data.Int'' and ''Data.Word''
types.
No effort has been made towards performance.'
license-name: BSD3
| homepage: ''
changelog-type: ''
hash: 2d72789e3c47fd8fcb318585050ad436c6af952066efc5886b9215bb9f180f84
test-bench-deps: {}
maintainer: Antoine Latter <aslatter@gmail.com>
synopsis: Bounds-checking integer types.
changelog: ''
basic-deps:
base: ! '>=3.0.1.0 && <4.7'
all-versions:
- '0.1.0.0'
- '0.1.0.1'
author: Antoine Latter
latest: '0.1.0.1'
description-type: haddock
description: ! 'Includes replacements for all of the ''Data.Int'' and ''Data.Word''
types.
No effort has been made towards performance.'
license-name: BSD3
| Update from Hackage at 2017-05-17T16:48:35Z | Update from Hackage at 2017-05-17T16:48:35Z
| YAML | mit | commercialhaskell/all-cabal-metadata | yaml | ## Code Before:
homepage: ''
changelog-type: ''
hash: 0db6a8f5bea864c7aeee03e12d575a0ca10c22212f04655fa2d3a3ed4e251264
test-bench-deps: {}
maintainer: Antoine Latter <aslatter@gmail.com>
synopsis: Bounds-checking integer types.
changelog: ''
basic-deps:
base: ! '>=3.0.1.0 && <5'
all-versions:
- '0.1.0.0'
- '0.1.0.1'
author: Antoine Latter
latest: '0.1.0.1'
description-type: haddock
description: ! 'Includes replacements for all of the ''Data.Int'' and ''Data.Word''
types.
No effort has been made towards performance.'
license-name: BSD3
## Instruction:
Update from Hackage at 2017-05-17T16:48:35Z
## Code After:
homepage: ''
changelog-type: ''
hash: 2d72789e3c47fd8fcb318585050ad436c6af952066efc5886b9215bb9f180f84
test-bench-deps: {}
maintainer: Antoine Latter <aslatter@gmail.com>
synopsis: Bounds-checking integer types.
changelog: ''
basic-deps:
base: ! '>=3.0.1.0 && <4.7'
all-versions:
- '0.1.0.0'
- '0.1.0.1'
author: Antoine Latter
latest: '0.1.0.1'
description-type: haddock
description: ! 'Includes replacements for all of the ''Data.Int'' and ''Data.Word''
types.
No effort has been made towards performance.'
license-name: BSD3
| homepage: ''
changelog-type: ''
- hash: 0db6a8f5bea864c7aeee03e12d575a0ca10c22212f04655fa2d3a3ed4e251264
+ hash: 2d72789e3c47fd8fcb318585050ad436c6af952066efc5886b9215bb9f180f84
test-bench-deps: {}
maintainer: Antoine Latter <aslatter@gmail.com>
synopsis: Bounds-checking integer types.
changelog: ''
basic-deps:
- base: ! '>=3.0.1.0 && <5'
? ^
+ base: ! '>=3.0.1.0 && <4.7'
? ^^^
all-versions:
- '0.1.0.0'
- '0.1.0.1'
author: Antoine Latter
latest: '0.1.0.1'
description-type: haddock
description: ! 'Includes replacements for all of the ''Data.Int'' and ''Data.Word''
types.
No effort has been made towards performance.'
license-name: BSD3 | 4 | 0.2 | 2 | 2 |
f9c6df86c3998f1d7625ad472b57f8c0a34df0ec | src/components/Avatar/index.js | src/components/Avatar/index.js | import cx from 'classnames';
import React from 'react';
import PropTypes from 'prop-types';
const Avatar = ({ className, user }) => (
<div className={cx('Avatar', className)}>
<img
className="Avatar-image"
src={user.avatar || `/a/${encodeURIComponent(user._id)}`}
alt={user.username}
/>
</div>
);
Avatar.propTypes = {
className: PropTypes.string,
user: PropTypes.object.isRequired
};
export default Avatar;
| import cx from 'classnames';
import React from 'react';
import PropTypes from 'prop-types';
const Avatar = ({ className, user }) => (
<div className={cx('Avatar', className)}>
<img
className="Avatar-image"
src={user.avatar || `https://sigil.cupcake.io/uwave-${encodeURIComponent(user._id)}`}
alt={user.username}
/>
</div>
);
Avatar.propTypes = {
className: PropTypes.string,
user: PropTypes.object.isRequired
};
export default Avatar;
| Revert "[WLK-INSTANCE] use locally generated avatars as default instead of cupcake.io" | Revert "[WLK-INSTANCE] use locally generated avatars as default instead of cupcake.io"
This reverts commit 92c531beca630b1aff75712360a3bae3e158420e.
| JavaScript | mit | welovekpop/uwave-web-welovekpop.club,welovekpop/uwave-web-welovekpop.club | javascript | ## Code Before:
import cx from 'classnames';
import React from 'react';
import PropTypes from 'prop-types';
const Avatar = ({ className, user }) => (
<div className={cx('Avatar', className)}>
<img
className="Avatar-image"
src={user.avatar || `/a/${encodeURIComponent(user._id)}`}
alt={user.username}
/>
</div>
);
Avatar.propTypes = {
className: PropTypes.string,
user: PropTypes.object.isRequired
};
export default Avatar;
## Instruction:
Revert "[WLK-INSTANCE] use locally generated avatars as default instead of cupcake.io"
This reverts commit 92c531beca630b1aff75712360a3bae3e158420e.
## Code After:
import cx from 'classnames';
import React from 'react';
import PropTypes from 'prop-types';
const Avatar = ({ className, user }) => (
<div className={cx('Avatar', className)}>
<img
className="Avatar-image"
src={user.avatar || `https://sigil.cupcake.io/uwave-${encodeURIComponent(user._id)}`}
alt={user.username}
/>
</div>
);
Avatar.propTypes = {
className: PropTypes.string,
user: PropTypes.object.isRequired
};
export default Avatar;
| import cx from 'classnames';
import React from 'react';
import PropTypes from 'prop-types';
const Avatar = ({ className, user }) => (
<div className={cx('Avatar', className)}>
<img
className="Avatar-image"
- src={user.avatar || `/a/${encodeURIComponent(user._id)}`}
+ src={user.avatar || `https://sigil.cupcake.io/uwave-${encodeURIComponent(user._id)}`}
? ++++++ +++++++++++ +++++ ++++++
alt={user.username}
/>
</div>
);
Avatar.propTypes = {
className: PropTypes.string,
user: PropTypes.object.isRequired
};
export default Avatar; | 2 | 0.1 | 1 | 1 |
30f12ca81a9742af423c9b7da24d290db4517baf | README.md | README.md |
This is a server written in [Go](http://golang.org) for the [ImpactJS](http://impactjs.com/) game engine.
So far, the only thing it does is replace the PHP server that comes with ImpactJS.
## Installation and Usage
###. You do not have Go installed
You can just download the [binary version](https://raw.github.com/geetarista/impact/master/impact).
Then make it executable for your user:
```bash
chmod +x impact
```
Then copy it to the root of your game's path and run it:
```bash
./impact
```
### You have Go installed
Run the following to install the server:
```bash
go get github.com/geetarista/impact
```
Then just start the server:
```bash
impact
```
## License
MIT. See `LICENSE`.
|
This is a server written in [Go](http://golang.org) for the [ImpactJS](http://impactjs.com/) game engine.
So far, the only thing it does is replace the PHP server that comes with ImpactJS.
## Installation and Usage
###. You do not have Go installed
You can just download the [binary version](https://raw.github.com/geetarista/impact/master/impact).
Then make it executable for your user:
```bash
chmod +x impact
```
Then copy it to the root of your game's path and run it:
```bash
./impact
```
### You have Go installed
Run the following to install the server:
```bash
go get github.com/geetarista/impact
```
Then just start the server:
```bash
impact
```
## Tests
To run the tests, you just need Go installed on your system and just run:
```bash
go test
```
## Disclaimer
This server has only been tested on Mac OS X for now, so if you discover issues on other platforms, please [create an issue](https://github.com/geetarista/impact/issues) so I can address them.
## License
MIT. See `LICENSE`.
| Add a couple more notes to the Readme | Add a couple more notes to the Readme
| Markdown | mit | geetarista/impact,geetarista/impact | markdown | ## Code Before:
This is a server written in [Go](http://golang.org) for the [ImpactJS](http://impactjs.com/) game engine.
So far, the only thing it does is replace the PHP server that comes with ImpactJS.
## Installation and Usage
###. You do not have Go installed
You can just download the [binary version](https://raw.github.com/geetarista/impact/master/impact).
Then make it executable for your user:
```bash
chmod +x impact
```
Then copy it to the root of your game's path and run it:
```bash
./impact
```
### You have Go installed
Run the following to install the server:
```bash
go get github.com/geetarista/impact
```
Then just start the server:
```bash
impact
```
## License
MIT. See `LICENSE`.
## Instruction:
Add a couple more notes to the Readme
## Code After:
This is a server written in [Go](http://golang.org) for the [ImpactJS](http://impactjs.com/) game engine.
So far, the only thing it does is replace the PHP server that comes with ImpactJS.
## Installation and Usage
###. You do not have Go installed
You can just download the [binary version](https://raw.github.com/geetarista/impact/master/impact).
Then make it executable for your user:
```bash
chmod +x impact
```
Then copy it to the root of your game's path and run it:
```bash
./impact
```
### You have Go installed
Run the following to install the server:
```bash
go get github.com/geetarista/impact
```
Then just start the server:
```bash
impact
```
## Tests
To run the tests, you just need Go installed on your system and just run:
```bash
go test
```
## Disclaimer
This server has only been tested on Mac OS X for now, so if you discover issues on other platforms, please [create an issue](https://github.com/geetarista/impact/issues) so I can address them.
## License
MIT. See `LICENSE`.
|
This is a server written in [Go](http://golang.org) for the [ImpactJS](http://impactjs.com/) game engine.
So far, the only thing it does is replace the PHP server that comes with ImpactJS.
## Installation and Usage
###. You do not have Go installed
You can just download the [binary version](https://raw.github.com/geetarista/impact/master/impact).
Then make it executable for your user:
```bash
chmod +x impact
```
Then copy it to the root of your game's path and run it:
```bash
./impact
```
### You have Go installed
Run the following to install the server:
```bash
go get github.com/geetarista/impact
```
Then just start the server:
```bash
impact
```
+ ## Tests
+
+ To run the tests, you just need Go installed on your system and just run:
+
+ ```bash
+ go test
+ ```
+
+ ## Disclaimer
+
+ This server has only been tested on Mac OS X for now, so if you discover issues on other platforms, please [create an issue](https://github.com/geetarista/impact/issues) so I can address them.
+
## License
MIT. See `LICENSE`. | 12 | 0.3 | 12 | 0 |
b713e57dca2fb1c645b2ff20f2bf174227e6d2ea | opg-docker-monitoring/templates/compose-monitoring-client.yml | opg-docker-monitoring/templates/compose-monitoring-client.yml | sensuclient:
image: registry.service.dsd.io/opguk/sensu-client:latest
env_file: ./sensuclient.env
| sensuclient:
image: registry.service.dsd.io/opguk/sensu-client:latest
env_file:
- ./sensuclient.env
- ./checksbase.env
- ./checksrole.env
| Split sensu client config, base checks, role checks into separate environment files | Split sensu client config, base checks, role checks into separate environment files
| YAML | apache-2.0 | ministryofjustice/opg-docker-monitoring-formula | yaml | ## Code Before:
sensuclient:
image: registry.service.dsd.io/opguk/sensu-client:latest
env_file: ./sensuclient.env
## Instruction:
Split sensu client config, base checks, role checks into separate environment files
## Code After:
sensuclient:
image: registry.service.dsd.io/opguk/sensu-client:latest
env_file:
- ./sensuclient.env
- ./checksbase.env
- ./checksrole.env
| sensuclient:
image: registry.service.dsd.io/opguk/sensu-client:latest
+ env_file:
- env_file: ./sensuclient.env
? ^^^^^^^^^
+ - ./sensuclient.env
? ^^^
+ - ./checksbase.env
+ - ./checksrole.env
| 5 | 1.25 | 4 | 1 |
3b6ddce7c0db0f0b1fbd9febd9bf68ceeda51f44 | della/user_manager/forms.py | della/user_manager/forms.py | from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
from django.core.validators import RegexValidator
alphanumericu = RegexValidator(
regex=r'^[0-9a-zA-Z_]*$',
message='Only alphanumeric characters and underscore are allowed.')
class SignupForm(UserCreationForm):
username = forms.CharField(max_length=20, validators=[alphanumericu])
email = forms.EmailField(max_length=254, required=True)
class Meta:
model = User
fields = ['email', 'username', ]
def clean_email(self):
error_message = 'An user with that email already exists'
email = self.cleaned_data.get('email')
if email and User.objects.filter(email=email).exists():
raise forms.ValidationError(
self.error_messages[error_message],
code='existing_email',
)
return email
| from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
from django.core.validators import RegexValidator
alphanumericu = RegexValidator(
regex=r'^[0-9a-zA-Z_]*$',
message='Only alphanumeric characters and underscore are allowed.')
class SignupForm(UserCreationForm):
username = forms.CharField(max_length=20, validators=[alphanumericu])
email = forms.EmailField(max_length=254, required=True)
class Meta:
model = User
fields = ['email', 'username', ]
def clean_email(self):
error_message = 'An user with that email already exists'
email = self.cleaned_data.get('email')
if email and User.objects.filter(email=email).exists():
raise forms.ValidationError(error_message)
return email
| Raise ValidationError properly in SignupForm | Raise ValidationError properly in SignupForm
| Python | mit | avinassh/della,avinassh/della,avinassh/della | python | ## Code Before:
from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
from django.core.validators import RegexValidator
alphanumericu = RegexValidator(
regex=r'^[0-9a-zA-Z_]*$',
message='Only alphanumeric characters and underscore are allowed.')
class SignupForm(UserCreationForm):
username = forms.CharField(max_length=20, validators=[alphanumericu])
email = forms.EmailField(max_length=254, required=True)
class Meta:
model = User
fields = ['email', 'username', ]
def clean_email(self):
error_message = 'An user with that email already exists'
email = self.cleaned_data.get('email')
if email and User.objects.filter(email=email).exists():
raise forms.ValidationError(
self.error_messages[error_message],
code='existing_email',
)
return email
## Instruction:
Raise ValidationError properly in SignupForm
## Code After:
from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
from django.core.validators import RegexValidator
alphanumericu = RegexValidator(
regex=r'^[0-9a-zA-Z_]*$',
message='Only alphanumeric characters and underscore are allowed.')
class SignupForm(UserCreationForm):
username = forms.CharField(max_length=20, validators=[alphanumericu])
email = forms.EmailField(max_length=254, required=True)
class Meta:
model = User
fields = ['email', 'username', ]
def clean_email(self):
error_message = 'An user with that email already exists'
email = self.cleaned_data.get('email')
if email and User.objects.filter(email=email).exists():
raise forms.ValidationError(error_message)
return email
| from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
from django.core.validators import RegexValidator
alphanumericu = RegexValidator(
regex=r'^[0-9a-zA-Z_]*$',
message='Only alphanumeric characters and underscore are allowed.')
class SignupForm(UserCreationForm):
username = forms.CharField(max_length=20, validators=[alphanumericu])
email = forms.EmailField(max_length=254, required=True)
class Meta:
model = User
fields = ['email', 'username', ]
def clean_email(self):
error_message = 'An user with that email already exists'
email = self.cleaned_data.get('email')
if email and User.objects.filter(email=email).exists():
- raise forms.ValidationError(
+ raise forms.ValidationError(error_message)
? ++++++++++++++
- self.error_messages[error_message],
- code='existing_email',
- )
return email | 5 | 0.185185 | 1 | 4 |
f4077cadc87603c87622483c5391605bc6a266d0 | .travis.yml | .travis.yml | language: java
jdk:
- openjdk7
- oraclejdk7
after_success:
- 'mvn jacoco:report coveralls:jacoco'
| language: java
jdk:
- openjdk7
- oraclejdk7
after_success:
- 'mvn -pl spring-modular-core,spring-modular-web jacoco:report coveralls:jacoco'
| Fix Travis config to run Coveralls only on modules | Fix Travis config to run Coveralls only on modules
| YAML | apache-2.0 | jirutka/spring-modular | yaml | ## Code Before:
language: java
jdk:
- openjdk7
- oraclejdk7
after_success:
- 'mvn jacoco:report coveralls:jacoco'
## Instruction:
Fix Travis config to run Coveralls only on modules
## Code After:
language: java
jdk:
- openjdk7
- oraclejdk7
after_success:
- 'mvn -pl spring-modular-core,spring-modular-web jacoco:report coveralls:jacoco'
| language: java
jdk:
- openjdk7
- oraclejdk7
after_success:
- - 'mvn jacoco:report coveralls:jacoco'
+ - 'mvn -pl spring-modular-core,spring-modular-web jacoco:report coveralls:jacoco' | 2 | 0.333333 | 1 | 1 |
4a078ace2774cd69c1dc93fc8096eb7952a23a00 | lib/tasks/replace_textile.rake | lib/tasks/replace_textile.rake |
namespace :publify do
desc "Convert content in Textile format to Markdown"
task textile_to_markdown: :environment do
Content.find_each do |content|
content.text_filter_name == "textile" or next
body_html = content.html(:body)
content.body = ReverseMarkdown.convert body_html
extended_html = content.html(:extended)
content.extended = ReverseMarkdown.convert extended_html
content.text_filter_name = "markdown"
content.save!
end
end
end
|
namespace :publify do
desc "Convert content in Textile format to Markdown"
task textile_to_markdown: :environment do
Content.find_each do |content|
content.text_filter_name == "textile" or next
body_html = content.html(:body)
content.body = ReverseMarkdown.convert body_html
extended_html = content.html(:extended)
content.extended = ReverseMarkdown.convert extended_html
content.text_filter_name = "markdown"
content.save!
end
Feedback.find_each do |feedback|
feedback.text_filter_name == "textile" or next
body_html = feedback.html(:body)
feedback.body = ReverseMarkdown.convert body_html
extended_html = feedback.html(:extended)
feedback.extended = ReverseMarkdown.convert extended_html
feedback.text_filter_name = "markdown"
feedback.save!
end
end
end
| Make textile_to_markdown task convert feedback | Make textile_to_markdown task convert feedback
| Ruby | mit | publify/publify,publify/publify,publify/publify | ruby | ## Code Before:
namespace :publify do
desc "Convert content in Textile format to Markdown"
task textile_to_markdown: :environment do
Content.find_each do |content|
content.text_filter_name == "textile" or next
body_html = content.html(:body)
content.body = ReverseMarkdown.convert body_html
extended_html = content.html(:extended)
content.extended = ReverseMarkdown.convert extended_html
content.text_filter_name = "markdown"
content.save!
end
end
end
## Instruction:
Make textile_to_markdown task convert feedback
## Code After:
namespace :publify do
desc "Convert content in Textile format to Markdown"
task textile_to_markdown: :environment do
Content.find_each do |content|
content.text_filter_name == "textile" or next
body_html = content.html(:body)
content.body = ReverseMarkdown.convert body_html
extended_html = content.html(:extended)
content.extended = ReverseMarkdown.convert extended_html
content.text_filter_name = "markdown"
content.save!
end
Feedback.find_each do |feedback|
feedback.text_filter_name == "textile" or next
body_html = feedback.html(:body)
feedback.body = ReverseMarkdown.convert body_html
extended_html = feedback.html(:extended)
feedback.extended = ReverseMarkdown.convert extended_html
feedback.text_filter_name = "markdown"
feedback.save!
end
end
end
|
namespace :publify do
desc "Convert content in Textile format to Markdown"
task textile_to_markdown: :environment do
Content.find_each do |content|
content.text_filter_name == "textile" or next
body_html = content.html(:body)
content.body = ReverseMarkdown.convert body_html
extended_html = content.html(:extended)
content.extended = ReverseMarkdown.convert extended_html
content.text_filter_name = "markdown"
content.save!
end
+
+ Feedback.find_each do |feedback|
+ feedback.text_filter_name == "textile" or next
+
+ body_html = feedback.html(:body)
+ feedback.body = ReverseMarkdown.convert body_html
+ extended_html = feedback.html(:extended)
+ feedback.extended = ReverseMarkdown.convert extended_html
+ feedback.text_filter_name = "markdown"
+ feedback.save!
+ end
end
end | 11 | 0.6875 | 11 | 0 |
1ea7e072ae7fba5b989f226dd8371cd22d0916ed | .github/workflows/publish-mkdocs-website.yml | .github/workflows/publish-mkdocs-website.yml | name: Publish MkDocs website to GitHub pages
on:
push:
branches:
- release
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: sudo snap install --classic kotlin
- run: ./docs/DocsCopier.main.kts
- uses: actions/setup-python@v2
with:
python-version: 3.x
- run: pip install -r docs/requirements.txt
- run: mkdocs gh-deploy --force
| name: Publish MkDocs website to GitHub pages
on:
push:
branches:
- release
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: ./docs/DocsCopier.main.kts
- uses: actions/setup-python@v2
with:
python-version: 3.x
- run: pip install -r docs/requirements.txt
- run: mkdocs gh-deploy --force
| Remove no longer needed Kotlin installation | Remove no longer needed Kotlin installation
GitHub Actions runners now have Kotlin built-in! | YAML | apache-2.0 | LouisCAD/Splitties,LouisCAD/Splitties,LouisCAD/Splitties | yaml | ## Code Before:
name: Publish MkDocs website to GitHub pages
on:
push:
branches:
- release
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: sudo snap install --classic kotlin
- run: ./docs/DocsCopier.main.kts
- uses: actions/setup-python@v2
with:
python-version: 3.x
- run: pip install -r docs/requirements.txt
- run: mkdocs gh-deploy --force
## Instruction:
Remove no longer needed Kotlin installation
GitHub Actions runners now have Kotlin built-in!
## Code After:
name: Publish MkDocs website to GitHub pages
on:
push:
branches:
- release
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: ./docs/DocsCopier.main.kts
- uses: actions/setup-python@v2
with:
python-version: 3.x
- run: pip install -r docs/requirements.txt
- run: mkdocs gh-deploy --force
| name: Publish MkDocs website to GitHub pages
on:
push:
branches:
- release
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- - run: sudo snap install --classic kotlin
- run: ./docs/DocsCopier.main.kts
- uses: actions/setup-python@v2
with:
python-version: 3.x
- run: pip install -r docs/requirements.txt
- run: mkdocs gh-deploy --force | 1 | 0.055556 | 0 | 1 |
303a7238af3f1be595fe4e50c7d911e6b8556172 | README.md | README.md |
[](https://david-dm.org/ubenzer/metaltext)
[](https://codeclimate.com/github/ubenzer/metaltext)
IN PROGRESS, NOTHING INTERESTING HERE.
|
[](http://unmaintained.tech/)
[](https://david-dm.org/ubenzer/metaltext)
[](https://codeclimate.com/github/ubenzer/metaltext)
| Add notice that this will not be maintained. | Add notice that this will not be maintained. | Markdown | mit | ubenzer/metaltext | markdown | ## Code Before:
[](https://david-dm.org/ubenzer/metaltext)
[](https://codeclimate.com/github/ubenzer/metaltext)
IN PROGRESS, NOTHING INTERESTING HERE.
## Instruction:
Add notice that this will not be maintained.
## Code After:
[](http://unmaintained.tech/)
[](https://david-dm.org/ubenzer/metaltext)
[](https://codeclimate.com/github/ubenzer/metaltext)
| +
+ [](http://unmaintained.tech/)
[](https://david-dm.org/ubenzer/metaltext)
[](https://codeclimate.com/github/ubenzer/metaltext)
-
- IN PROGRESS, NOTHING INTERESTING HERE. | 4 | 0.666667 | 2 | 2 |
95ad2783b70abc8c4b69c10046b34b49ba2b957e | lib/active_interaction/filters/model_filter.rb | lib/active_interaction/filters/model_filter.rb |
module ActiveInteraction
class Base
# @!method self.model(*attributes, options = {})
# Creates accessors for the attributes and ensures that values passed to
# the attributes are the correct class.
#
# @!macro filter_method_params
# @option options [Class, String, Symbol] :class (use the attribute name)
# Class name used to ensure the value.
#
# @example
# model :account
# @example
# model :account, class: User
end
# @private
class ModelFilter < Filter
def cast(value, reconstantize = true)
@klass ||= klass
# rubocop:disable CaseEquality
if @klass === value || value.is_a?(@klass) || value.instance_of?(@klass)
value
else
return super(value) unless reconstantize
@klass = klass
cast(value, false)
end
end
private
# @return [Class]
#
# @raise [InvalidClassError]
def klass
klass_name = options.fetch(:class, name).to_s.classify
klass_name.constantize
rescue NameError
raise InvalidClassError, klass_name.inspect
end
end
end
|
module ActiveInteraction
class Base
# @!method self.model(*attributes, options = {})
# Creates accessors for the attributes and ensures that values passed to
# the attributes are the correct class.
#
# @!macro filter_method_params
# @option options [Class, String, Symbol] :class (use the attribute name)
# Class name used to ensure the value.
#
# @example
# model :account
# @example
# model :account, class: User
end
# @private
class ModelFilter < Filter
def cast(value, reconstantize = true)
@klass ||= klass
if matches?(value)
value
else
return super(value) unless reconstantize
@klass = klass
cast(value, false)
end
end
private
# @return [Class]
#
# @raise [InvalidClassError]
def klass
klass_name = options.fetch(:class, name).to_s.classify
klass_name.constantize
rescue NameError
raise InvalidClassError, klass_name.inspect
end
# @param value [Object]
#
# @return [Boolean]
def matches?(value)
@klass === value || # rubocop:disable CaseEquality
value.is_a?(@klass) ||
value.instance_of?(@klass)
end
end
end
| Move class matching logic into helper function | Move class matching logic into helper function
| Ruby | mit | JasOXIII/active_interaction,orgsync/active_interaction,AaronLasseigne/active_interaction,JasOXIII/active_interaction,orgsync/active_interaction,AaronLasseigne/active_interaction,antoinefinkelstein/active_interaction,antoinefinkelstein/active_interaction,frbl/active_interaction,frbl/active_interaction | ruby | ## Code Before:
module ActiveInteraction
class Base
# @!method self.model(*attributes, options = {})
# Creates accessors for the attributes and ensures that values passed to
# the attributes are the correct class.
#
# @!macro filter_method_params
# @option options [Class, String, Symbol] :class (use the attribute name)
# Class name used to ensure the value.
#
# @example
# model :account
# @example
# model :account, class: User
end
# @private
class ModelFilter < Filter
def cast(value, reconstantize = true)
@klass ||= klass
# rubocop:disable CaseEquality
if @klass === value || value.is_a?(@klass) || value.instance_of?(@klass)
value
else
return super(value) unless reconstantize
@klass = klass
cast(value, false)
end
end
private
# @return [Class]
#
# @raise [InvalidClassError]
def klass
klass_name = options.fetch(:class, name).to_s.classify
klass_name.constantize
rescue NameError
raise InvalidClassError, klass_name.inspect
end
end
end
## Instruction:
Move class matching logic into helper function
## Code After:
module ActiveInteraction
class Base
# @!method self.model(*attributes, options = {})
# Creates accessors for the attributes and ensures that values passed to
# the attributes are the correct class.
#
# @!macro filter_method_params
# @option options [Class, String, Symbol] :class (use the attribute name)
# Class name used to ensure the value.
#
# @example
# model :account
# @example
# model :account, class: User
end
# @private
class ModelFilter < Filter
def cast(value, reconstantize = true)
@klass ||= klass
if matches?(value)
value
else
return super(value) unless reconstantize
@klass = klass
cast(value, false)
end
end
private
# @return [Class]
#
# @raise [InvalidClassError]
def klass
klass_name = options.fetch(:class, name).to_s.classify
klass_name.constantize
rescue NameError
raise InvalidClassError, klass_name.inspect
end
# @param value [Object]
#
# @return [Boolean]
def matches?(value)
@klass === value || # rubocop:disable CaseEquality
value.is_a?(@klass) ||
value.instance_of?(@klass)
end
end
end
|
module ActiveInteraction
class Base
# @!method self.model(*attributes, options = {})
# Creates accessors for the attributes and ensures that values passed to
# the attributes are the correct class.
#
# @!macro filter_method_params
# @option options [Class, String, Symbol] :class (use the attribute name)
# Class name used to ensure the value.
#
# @example
# model :account
# @example
# model :account, class: User
end
# @private
class ModelFilter < Filter
def cast(value, reconstantize = true)
@klass ||= klass
+ if matches?(value)
- # rubocop:disable CaseEquality
- if @klass === value || value.is_a?(@klass) || value.instance_of?(@klass)
value
else
return super(value) unless reconstantize
@klass = klass
cast(value, false)
end
end
private
# @return [Class]
#
# @raise [InvalidClassError]
def klass
klass_name = options.fetch(:class, name).to_s.classify
klass_name.constantize
rescue NameError
raise InvalidClassError, klass_name.inspect
end
+
+ # @param value [Object]
+ #
+ # @return [Boolean]
+ def matches?(value)
+ @klass === value || # rubocop:disable CaseEquality
+ value.is_a?(@klass) ||
+ value.instance_of?(@klass)
+ end
end
end | 12 | 0.26087 | 10 | 2 |
66fe6f98c079490d2d5de4c161da1d8b3801cda4 | monasca_persister/conf/influxdb.py | monasca_persister/conf/influxdb.py |
from oslo_config import cfg
influxdb_opts = [
cfg.StrOpt('database_name',
help='database name where metrics are stored',
default='mon'),
cfg.IPOpt('ip_address',
help='ip address to influxdb'),
cfg.PortOpt('port',
help='port to influxdb',
default=8086),
cfg.StrOpt('user',
help='influxdb user ',
default='mon_persister'),
cfg.StrOpt('password',
secret=True,
help='influxdb password')]
influxdb_group = cfg.OptGroup(name='influxdb',
title='influxdb')
def register_opts(conf):
conf.register_group(influxdb_group)
conf.register_opts(influxdb_opts, influxdb_group)
def list_opts():
return influxdb_group, influxdb_opts
|
from oslo_config import cfg
influxdb_opts = [
cfg.StrOpt('database_name',
help='database name where metrics are stored',
default='mon'),
cfg.HostAddressOpt('ip_address',
help='Valid IP address or hostname '
'to InfluxDB instance'),
cfg.PortOpt('port',
help='port to influxdb',
default=8086),
cfg.StrOpt('user',
help='influxdb user ',
default='mon_persister'),
cfg.StrOpt('password',
secret=True,
help='influxdb password')]
influxdb_group = cfg.OptGroup(name='influxdb',
title='influxdb')
def register_opts(conf):
conf.register_group(influxdb_group)
conf.register_opts(influxdb_opts, influxdb_group)
def list_opts():
return influxdb_group, influxdb_opts
| Allow hostnames to be used as ip_address | Allow hostnames to be used as ip_address
Previously introduced change for monasca-persister
had enforced the IPAddress as the only type one can
configure influxdb.ip_address property with.
Following change makes it possible to use also hostname.
Using IPAdress is still possible.
Change-Id: Ib0d7f19b3ac2dcb7c84923872d94f180cda58b2b
| Python | apache-2.0 | stackforge/monasca-persister,openstack/monasca-persister,stackforge/monasca-persister,stackforge/monasca-persister,openstack/monasca-persister,openstack/monasca-persister | python | ## Code Before:
from oslo_config import cfg
influxdb_opts = [
cfg.StrOpt('database_name',
help='database name where metrics are stored',
default='mon'),
cfg.IPOpt('ip_address',
help='ip address to influxdb'),
cfg.PortOpt('port',
help='port to influxdb',
default=8086),
cfg.StrOpt('user',
help='influxdb user ',
default='mon_persister'),
cfg.StrOpt('password',
secret=True,
help='influxdb password')]
influxdb_group = cfg.OptGroup(name='influxdb',
title='influxdb')
def register_opts(conf):
conf.register_group(influxdb_group)
conf.register_opts(influxdb_opts, influxdb_group)
def list_opts():
return influxdb_group, influxdb_opts
## Instruction:
Allow hostnames to be used as ip_address
Previously introduced change for monasca-persister
had enforced the IPAddress as the only type one can
configure influxdb.ip_address property with.
Following change makes it possible to use also hostname.
Using IPAdress is still possible.
Change-Id: Ib0d7f19b3ac2dcb7c84923872d94f180cda58b2b
## Code After:
from oslo_config import cfg
influxdb_opts = [
cfg.StrOpt('database_name',
help='database name where metrics are stored',
default='mon'),
cfg.HostAddressOpt('ip_address',
help='Valid IP address or hostname '
'to InfluxDB instance'),
cfg.PortOpt('port',
help='port to influxdb',
default=8086),
cfg.StrOpt('user',
help='influxdb user ',
default='mon_persister'),
cfg.StrOpt('password',
secret=True,
help='influxdb password')]
influxdb_group = cfg.OptGroup(name='influxdb',
title='influxdb')
def register_opts(conf):
conf.register_group(influxdb_group)
conf.register_opts(influxdb_opts, influxdb_group)
def list_opts():
return influxdb_group, influxdb_opts
|
from oslo_config import cfg
influxdb_opts = [
cfg.StrOpt('database_name',
help='database name where metrics are stored',
default='mon'),
- cfg.IPOpt('ip_address',
? ^^
+ cfg.HostAddressOpt('ip_address',
? ^^^^^^^^^^^
- help='ip address to influxdb'),
+ help='Valid IP address or hostname '
+ 'to InfluxDB instance'),
cfg.PortOpt('port',
help='port to influxdb',
default=8086),
cfg.StrOpt('user',
help='influxdb user ',
default='mon_persister'),
cfg.StrOpt('password',
secret=True,
help='influxdb password')]
influxdb_group = cfg.OptGroup(name='influxdb',
title='influxdb')
def register_opts(conf):
conf.register_group(influxdb_group)
conf.register_opts(influxdb_opts, influxdb_group)
def list_opts():
return influxdb_group, influxdb_opts | 5 | 0.166667 | 3 | 2 |
63eedaaa290c4aa2fe243eab7b673a05253af344 | lib/tasks/data_marshal.rake | lib/tasks/data_marshal.rake | namespace :data do
task :prepare => [:environment] do
require 'lib/data_marshal'
require 'lib/downloader'
end
desc "Dumps state to FILE, defaults to DBNAME.TIMESTAMP.data"
task :dump => :prepare do
filename = DataMarshal.dump(ENV["FILE"])
puts "* Dumped data to #{filename}"
end
desc "Restores state from FILE"
task :restore => [:prepare, "tmp:cache:clear"] do
filename = ENV["FILE"] or raise ArgumentError, "The data:restore task requires a FILE argument to define which file to restore from, e.g. 'rake FILE=current.data data:restore'"
DataMarshal.restore(filename)
puts "* Restored state from #{filename}"
Rake::Task['solr:restart'].invoke
puts "* Done"
end
desc "Fetch state from production server and install it locally"
task :fetch => :prepare do
source = SETTINGS.url + "export.data"
#IK# source = "http://localhost:3000/export.data" # Only for testing
target = "export.data"
puts "* Downloading #{source}..."
Downloader.download(source, target)
puts "* Replacing data..."
DataMarshal.restore(target)
Rake::Task['solr:restart'].invoke
Rake::Task['db:migrate'].invoke
puts "* Done"
end
end
| namespace :data do
def restart_search_service
case SearchEngine.kind
when :acts_as_solr
puts "* Restarting acts_as_solr's solr..."
Rake::Task['solr:restart'].invoke
when :sunspot
puts "* Restarting sunspot's solr..."
begin
Rake::Task['sunspot:solr:stop'].invoke
rescue Sunspot::Server::NotRunningError:
# Ignore
end
Rake::Task['sunspot:solr:start'].invoke
end
end
task :prepare => [:environment] do
require 'lib/data_marshal'
require 'lib/downloader'
end
desc "Dumps state to FILE, defaults to DBNAME.TIMESTAMP.data"
task :dump => :prepare do
filename = DataMarshal.dump(ENV["FILE"])
puts "* Dumped data to #{filename}"
end
desc "Restores state from FILE"
task :restore => [:prepare, "tmp:cache:clear"] do
filename = ENV["FILE"] or raise ArgumentError, "The data:restore task requires a FILE argument to define which file to restore from, e.g. 'rake FILE=current.data data:restore'"
DataMarshal.restore(filename)
puts "* Restored state from #{filename}"
restart_search_service
puts "* Done"
end
desc "Fetch state from production server and install it locally"
task :fetch => :prepare do
source = SETTINGS.url + "export.data"
#IK# source = "http://localhost:3000/export.data" # Only for testing
target = "export.data"
puts "* Downloading #{source}..."
Downloader.download(source, target)
puts "* Replacing data..."
DataMarshal.restore(target)
restart_search_service
puts "* Migrating database..."
Rake::Task['db:migrate'].invoke
puts "* Done"
end
end
| Fix restarting of search service in rake data::restore and data::fetch. | Fix restarting of search service in rake data::restore and data::fetch.
Previously these assumed you were using acts_as_solr. Now it restarts
appropriately based on the current SearchEngine.
| Ruby | mit | jmcduffie32/calagator,alexbeeken/calagator.org,Villag/dentonator,kerrizor/calagator,bencornelis/calagator,matthewkmayer/calagator,eeeeeean/windchimes,dudleysr/calagator-workspace,CorainChicago/ActivateHub,jmcduffie32/calagator,CorainChicago/ActivateHub,matthewkmayer/calagator,cp/calagator-1,bencornelis/calagator,Villag/dentonator,nblackburn87/calagator,nblackburn87/calagator,shawnacscott/calagator,bencornelis/calagator,iamBalaji/Calagator,matthewkmayer/calagator,cp/calagator-1,kerrizor/calagator,VolunteerOdyssey/calagator,reidab/calagator,dudleysr/calagator-workspace,cp/calagator-1,Eugator-Wranglers/calagator,reidab/calagator,shawnacscott/calagator,kerrizor/calagator,eeeeeean/windchimes,L2-D2/calagator,L2-D2/calagator,matthewkmayer/calagator,cp/calagator-1,jmcduffie32/calagator,iamBalaji/Calagator,shawnacscott/calagator,iamBalaji/Calagator,Villag/dentonator,oktober/calagator,CorainChicago/ActivateHub,L2-D2/calagator,oktober/calagator,Eugator-Wranglers/calagator,iamBalaji/Calagator,shawnacscott/calagator,oktober/calagator,VolunteerOdyssey/calagator,L2-D2/calagator,reidab/calagator,jmcduffie32/calagator,bencornelis/calagator,alexbeeken/calagator.org,CorainChicago/ActivateHub,reidab/calagator,nblackburn87/calagator,oktober/calagator,VolunteerOdyssey/calagator,kerrizor/calagator | ruby | ## Code Before:
namespace :data do
task :prepare => [:environment] do
require 'lib/data_marshal'
require 'lib/downloader'
end
desc "Dumps state to FILE, defaults to DBNAME.TIMESTAMP.data"
task :dump => :prepare do
filename = DataMarshal.dump(ENV["FILE"])
puts "* Dumped data to #{filename}"
end
desc "Restores state from FILE"
task :restore => [:prepare, "tmp:cache:clear"] do
filename = ENV["FILE"] or raise ArgumentError, "The data:restore task requires a FILE argument to define which file to restore from, e.g. 'rake FILE=current.data data:restore'"
DataMarshal.restore(filename)
puts "* Restored state from #{filename}"
Rake::Task['solr:restart'].invoke
puts "* Done"
end
desc "Fetch state from production server and install it locally"
task :fetch => :prepare do
source = SETTINGS.url + "export.data"
#IK# source = "http://localhost:3000/export.data" # Only for testing
target = "export.data"
puts "* Downloading #{source}..."
Downloader.download(source, target)
puts "* Replacing data..."
DataMarshal.restore(target)
Rake::Task['solr:restart'].invoke
Rake::Task['db:migrate'].invoke
puts "* Done"
end
end
## Instruction:
Fix restarting of search service in rake data::restore and data::fetch.
Previously these assumed you were using acts_as_solr. Now it restarts
appropriately based on the current SearchEngine.
## Code After:
namespace :data do
def restart_search_service
case SearchEngine.kind
when :acts_as_solr
puts "* Restarting acts_as_solr's solr..."
Rake::Task['solr:restart'].invoke
when :sunspot
puts "* Restarting sunspot's solr..."
begin
Rake::Task['sunspot:solr:stop'].invoke
rescue Sunspot::Server::NotRunningError:
# Ignore
end
Rake::Task['sunspot:solr:start'].invoke
end
end
task :prepare => [:environment] do
require 'lib/data_marshal'
require 'lib/downloader'
end
desc "Dumps state to FILE, defaults to DBNAME.TIMESTAMP.data"
task :dump => :prepare do
filename = DataMarshal.dump(ENV["FILE"])
puts "* Dumped data to #{filename}"
end
desc "Restores state from FILE"
task :restore => [:prepare, "tmp:cache:clear"] do
filename = ENV["FILE"] or raise ArgumentError, "The data:restore task requires a FILE argument to define which file to restore from, e.g. 'rake FILE=current.data data:restore'"
DataMarshal.restore(filename)
puts "* Restored state from #{filename}"
restart_search_service
puts "* Done"
end
desc "Fetch state from production server and install it locally"
task :fetch => :prepare do
source = SETTINGS.url + "export.data"
#IK# source = "http://localhost:3000/export.data" # Only for testing
target = "export.data"
puts "* Downloading #{source}..."
Downloader.download(source, target)
puts "* Replacing data..."
DataMarshal.restore(target)
restart_search_service
puts "* Migrating database..."
Rake::Task['db:migrate'].invoke
puts "* Done"
end
end
| namespace :data do
+ def restart_search_service
+ case SearchEngine.kind
+ when :acts_as_solr
+ puts "* Restarting acts_as_solr's solr..."
+ Rake::Task['solr:restart'].invoke
+ when :sunspot
+ puts "* Restarting sunspot's solr..."
+ begin
+ Rake::Task['sunspot:solr:stop'].invoke
+ rescue Sunspot::Server::NotRunningError:
+ # Ignore
+ end
+ Rake::Task['sunspot:solr:start'].invoke
+ end
+ end
+
task :prepare => [:environment] do
require 'lib/data_marshal'
require 'lib/downloader'
end
desc "Dumps state to FILE, defaults to DBNAME.TIMESTAMP.data"
task :dump => :prepare do
filename = DataMarshal.dump(ENV["FILE"])
puts "* Dumped data to #{filename}"
end
desc "Restores state from FILE"
task :restore => [:prepare, "tmp:cache:clear"] do
filename = ENV["FILE"] or raise ArgumentError, "The data:restore task requires a FILE argument to define which file to restore from, e.g. 'rake FILE=current.data data:restore'"
DataMarshal.restore(filename)
puts "* Restored state from #{filename}"
- Rake::Task['solr:restart'].invoke
-
+ restart_search_service
+
puts "* Done"
end
desc "Fetch state from production server and install it locally"
task :fetch => :prepare do
source = SETTINGS.url + "export.data"
#IK# source = "http://localhost:3000/export.data" # Only for testing
target = "export.data"
puts "* Downloading #{source}..."
Downloader.download(source, target)
puts "* Replacing data..."
DataMarshal.restore(target)
- Rake::Task['solr:restart'].invoke
+ restart_search_service
+ puts "* Migrating database..."
Rake::Task['db:migrate'].invoke
puts "* Done"
end
end | 23 | 0.547619 | 20 | 3 |
631868fb04b79adf03f31ae6f0844fe8f59774d0 | api/src/main/java/ch/liip/timeforcoffee/api/mappers/ConnectionMapper.java | api/src/main/java/ch/liip/timeforcoffee/api/mappers/ConnectionMapper.java | package ch.liip.timeforcoffee.api.mappers;
import android.location.Location;
import java.util.Date;
import ch.liip.timeforcoffee.api.models.Connection;
public class ConnectionMapper {
public static Connection fromZvv(ch.liip.timeforcoffee.zvv.CheckPoint checkPoint) {
int checkPointId = Integer.parseInt(checkPoint.getId());
Location checkPointLocation = new Location("reverseGeocoded");
checkPointLocation.setLongitude(checkPoint.getLocation().getLng());
checkPointLocation.setLatitude(checkPoint.getLocation().getLat());
Date departureScheduled = checkPoint.getDeparture().getScheduled();
Date departureRealtime = checkPoint.getDeparture().getRealtime();
Date arrivalScheduled = checkPoint.getArrival().getScheduled();
// If there is no specified departure and arrival, it is not a valid connection
if(arrivalScheduled == null && departureScheduled == null) {
return null;
}
return new Connection(checkPointId, checkPoint.getName(), checkPointLocation, departureScheduled, departureRealtime, arrivalScheduled);
}
}
| package ch.liip.timeforcoffee.api.mappers;
import android.location.Location;
import android.support.annotation.Nullable;
import java.util.Date;
import ch.liip.timeforcoffee.api.models.Connection;
public class ConnectionMapper {
public static @Nullable Connection fromZvv(ch.liip.timeforcoffee.zvv.CheckPoint checkPoint) {
int checkPointId = Integer.parseInt(checkPoint.getId());
Location checkPointLocation = new Location("reverseGeocoded");
checkPointLocation.setLongitude(checkPoint.getLocation().getLng());
checkPointLocation.setLatitude(checkPoint.getLocation().getLat());
Date departureScheduled = checkPoint.getDeparture().getScheduled();
Date departureRealtime = checkPoint.getDeparture().getRealtime();
Date arrivalScheduled = checkPoint.getArrival().getScheduled();
// If there is no specified departure and arrival, it is not a valid connection
if(arrivalScheduled == null && departureScheduled == null) {
return null;
}
return new Connection(checkPointId, checkPoint.getName(), checkPointLocation, departureScheduled, departureRealtime, arrivalScheduled);
}
}
| Add Nullable annotation to connectionMapper | Add Nullable annotation to connectionMapper
| Java | mit | timeforcoffee/timeforcoffee-android,timeforcoffee/timeforcoffee-android | java | ## Code Before:
package ch.liip.timeforcoffee.api.mappers;
import android.location.Location;
import java.util.Date;
import ch.liip.timeforcoffee.api.models.Connection;
public class ConnectionMapper {
public static Connection fromZvv(ch.liip.timeforcoffee.zvv.CheckPoint checkPoint) {
int checkPointId = Integer.parseInt(checkPoint.getId());
Location checkPointLocation = new Location("reverseGeocoded");
checkPointLocation.setLongitude(checkPoint.getLocation().getLng());
checkPointLocation.setLatitude(checkPoint.getLocation().getLat());
Date departureScheduled = checkPoint.getDeparture().getScheduled();
Date departureRealtime = checkPoint.getDeparture().getRealtime();
Date arrivalScheduled = checkPoint.getArrival().getScheduled();
// If there is no specified departure and arrival, it is not a valid connection
if(arrivalScheduled == null && departureScheduled == null) {
return null;
}
return new Connection(checkPointId, checkPoint.getName(), checkPointLocation, departureScheduled, departureRealtime, arrivalScheduled);
}
}
## Instruction:
Add Nullable annotation to connectionMapper
## Code After:
package ch.liip.timeforcoffee.api.mappers;
import android.location.Location;
import android.support.annotation.Nullable;
import java.util.Date;
import ch.liip.timeforcoffee.api.models.Connection;
public class ConnectionMapper {
public static @Nullable Connection fromZvv(ch.liip.timeforcoffee.zvv.CheckPoint checkPoint) {
int checkPointId = Integer.parseInt(checkPoint.getId());
Location checkPointLocation = new Location("reverseGeocoded");
checkPointLocation.setLongitude(checkPoint.getLocation().getLng());
checkPointLocation.setLatitude(checkPoint.getLocation().getLat());
Date departureScheduled = checkPoint.getDeparture().getScheduled();
Date departureRealtime = checkPoint.getDeparture().getRealtime();
Date arrivalScheduled = checkPoint.getArrival().getScheduled();
// If there is no specified departure and arrival, it is not a valid connection
if(arrivalScheduled == null && departureScheduled == null) {
return null;
}
return new Connection(checkPointId, checkPoint.getName(), checkPointLocation, departureScheduled, departureRealtime, arrivalScheduled);
}
}
| package ch.liip.timeforcoffee.api.mappers;
import android.location.Location;
+ import android.support.annotation.Nullable;
import java.util.Date;
import ch.liip.timeforcoffee.api.models.Connection;
public class ConnectionMapper {
- public static Connection fromZvv(ch.liip.timeforcoffee.zvv.CheckPoint checkPoint) {
+ public static @Nullable Connection fromZvv(ch.liip.timeforcoffee.zvv.CheckPoint checkPoint) {
? ++++++++++
int checkPointId = Integer.parseInt(checkPoint.getId());
Location checkPointLocation = new Location("reverseGeocoded");
checkPointLocation.setLongitude(checkPoint.getLocation().getLng());
checkPointLocation.setLatitude(checkPoint.getLocation().getLat());
Date departureScheduled = checkPoint.getDeparture().getScheduled();
Date departureRealtime = checkPoint.getDeparture().getRealtime();
Date arrivalScheduled = checkPoint.getArrival().getScheduled();
// If there is no specified departure and arrival, it is not a valid connection
if(arrivalScheduled == null && departureScheduled == null) {
return null;
}
return new Connection(checkPointId, checkPoint.getName(), checkPointLocation, departureScheduled, departureRealtime, arrivalScheduled);
}
} | 3 | 0.107143 | 2 | 1 |
8fea62d712e73b4f8d853fd6f6b360941c5d13b5 | print/print_string.asm | print/print_string.asm | ; =============================================================================
; Copyright (C) 2015 Manolis Fragkiskos Ragkousis -- see LICENSE.TXT
; =============================================================================
;;; Print routine
;;; I push all the register to the stack.
;;; Set the bios routine for printing in the screen
;;; Move to al the data that bx points
;;; Generate the interrupt.
;;; Pop all registers from the stack
;;; Return to where the pc pointed to before getting in here.
;;; bx contains routine argument
%ifndef PRINT_STRING_16BIT
%define PRINT_STRING_16BIT
print_string:
pusha
mov ah, 0x0e
compare:
cmp byte [bx], 0
je exit
jmp print
print:
mov al, [bx]
int 0x10
add bx, 1
jmp compare
exit:
popa
ret
%endif
| ; =============================================================================
; Copyright (C) 2015 Manolis Fragkiskos Ragkousis -- see LICENSE.TXT
; =============================================================================
;;; Print routine
;;; I push all the register to the stack.
;;; Set the bios routine for printing in the screen
;;; Move to al the data that bx points
;;; Generate the interrupt.
;;; Pop all registers from the stack
;;; Return to where the pc pointed to before getting in here.
;;; bx contains routine argument
%ifndef PRINT_STRING_16BIT
%define PRINT_STRING_16BIT
[bits 16]
print_string:
pusha
mov ah, 0x0e
print_loop:
mov al, [bx]
cmp al, 0
je print_exit
int 0x10
inc bx
jmp print_loop
print_exit:
popa
ret
%endif
| Rewrite the 16bit print routine. | Rewrite the 16bit print routine.
* print/print_string.asm: Rewrite.
| Assembly | mit | Phant0mas/MaRagOS | assembly | ## Code Before:
; =============================================================================
; Copyright (C) 2015 Manolis Fragkiskos Ragkousis -- see LICENSE.TXT
; =============================================================================
;;; Print routine
;;; I push all the register to the stack.
;;; Set the bios routine for printing in the screen
;;; Move to al the data that bx points
;;; Generate the interrupt.
;;; Pop all registers from the stack
;;; Return to where the pc pointed to before getting in here.
;;; bx contains routine argument
%ifndef PRINT_STRING_16BIT
%define PRINT_STRING_16BIT
print_string:
pusha
mov ah, 0x0e
compare:
cmp byte [bx], 0
je exit
jmp print
print:
mov al, [bx]
int 0x10
add bx, 1
jmp compare
exit:
popa
ret
%endif
## Instruction:
Rewrite the 16bit print routine.
* print/print_string.asm: Rewrite.
## Code After:
; =============================================================================
; Copyright (C) 2015 Manolis Fragkiskos Ragkousis -- see LICENSE.TXT
; =============================================================================
;;; Print routine
;;; I push all the register to the stack.
;;; Set the bios routine for printing in the screen
;;; Move to al the data that bx points
;;; Generate the interrupt.
;;; Pop all registers from the stack
;;; Return to where the pc pointed to before getting in here.
;;; bx contains routine argument
%ifndef PRINT_STRING_16BIT
%define PRINT_STRING_16BIT
[bits 16]
print_string:
pusha
mov ah, 0x0e
print_loop:
mov al, [bx]
cmp al, 0
je print_exit
int 0x10
inc bx
jmp print_loop
print_exit:
popa
ret
%endif
| ; =============================================================================
; Copyright (C) 2015 Manolis Fragkiskos Ragkousis -- see LICENSE.TXT
; =============================================================================
;;; Print routine
;;; I push all the register to the stack.
;;; Set the bios routine for printing in the screen
;;; Move to al the data that bx points
;;; Generate the interrupt.
;;; Pop all registers from the stack
;;; Return to where the pc pointed to before getting in here.
;;; bx contains routine argument
%ifndef PRINT_STRING_16BIT
%define PRINT_STRING_16BIT
+ [bits 16]
print_string:
pusha
mov ah, 0x0e
+ print_loop:
- compare:
- cmp byte [bx], 0
- je exit
- jmp print
-
- print:
mov al, [bx]
+ cmp al, 0
+ je print_exit
+
int 0x10
- add bx, 1
- jmp compare
+ inc bx
+ jmp print_loop
- exit:
+ print_exit:
popa
ret
%endif | 17 | 0.485714 | 8 | 9 |
62a5d83511cc5291eeec3a8507d9027bf3e6fd61 | README.md | README.md | __Please start at the [Top-Level Lens Repo][1].__
# Lens Import
Lens Import is a command line tool for importing [ODM][2] data into
[Lens Warehouse][3].
## License
Copyright © 2015 Alexander Kiel
Distributed under the Eclipse Public License, the same as Clojure.
[1]: <https://github.com/alexanderkiel/lens>
[2]: <http://cdisc.org/odm>
[3]: <https://github.com/alexanderkiel/lens-warehouse>
| __Please start at the [Top-Level Lens Repo][1].__
# Lens Import
[](https://travis-ci.org/alexanderkiel/lens-import)
Lens Import is a command line tool for importing [ODM][2] data into
[Lens Warehouse][3].
## License
Copyright © 2015 Alexander Kiel
Distributed under the Eclipse Public License, the same as Clojure.
[1]: <https://github.com/alexanderkiel/lens>
[2]: <http://cdisc.org/odm>
[3]: <https://github.com/alexanderkiel/lens-warehouse>
| Add Travis Build Status Badge | Add Travis Build Status Badge
| Markdown | epl-1.0 | alexanderkiel/lens-import | markdown | ## Code Before:
__Please start at the [Top-Level Lens Repo][1].__
# Lens Import
Lens Import is a command line tool for importing [ODM][2] data into
[Lens Warehouse][3].
## License
Copyright © 2015 Alexander Kiel
Distributed under the Eclipse Public License, the same as Clojure.
[1]: <https://github.com/alexanderkiel/lens>
[2]: <http://cdisc.org/odm>
[3]: <https://github.com/alexanderkiel/lens-warehouse>
## Instruction:
Add Travis Build Status Badge
## Code After:
__Please start at the [Top-Level Lens Repo][1].__
# Lens Import
[](https://travis-ci.org/alexanderkiel/lens-import)
Lens Import is a command line tool for importing [ODM][2] data into
[Lens Warehouse][3].
## License
Copyright © 2015 Alexander Kiel
Distributed under the Eclipse Public License, the same as Clojure.
[1]: <https://github.com/alexanderkiel/lens>
[2]: <http://cdisc.org/odm>
[3]: <https://github.com/alexanderkiel/lens-warehouse>
| __Please start at the [Top-Level Lens Repo][1].__
# Lens Import
+
+ [](https://travis-ci.org/alexanderkiel/lens-import)
Lens Import is a command line tool for importing [ODM][2] data into
[Lens Warehouse][3].
## License
Copyright © 2015 Alexander Kiel
Distributed under the Eclipse Public License, the same as Clojure.
[1]: <https://github.com/alexanderkiel/lens>
[2]: <http://cdisc.org/odm>
[3]: <https://github.com/alexanderkiel/lens-warehouse> | 2 | 0.125 | 2 | 0 |
a6f75c7778860f7a9deb226b21a6c676dc8b1b51 | src/test/kotlin/com/emberjs/EmberTestFixtures.kt | src/test/kotlin/com/emberjs/EmberTestFixtures.kt | package com.emberjs
import com.intellij.mock.MockVirtualFile
import java.io.File
import java.nio.file.Path
import java.nio.file.Paths
object EmberTestFixtures {
val RESOURCE_PATH = Paths.get("src/test/resources/com/emberjs").toAbsolutePath()
val EXAMPLE = from(RESOURCE_PATH.resolve("fixtures/example"))
val CRATES_IO = from(RESOURCE_PATH.resolve("fixtures/crates.io"))
val APTIBLE = from(RESOURCE_PATH.resolve("fixtures/dashboard.aptible.com"))
private class MockVirtualDir(name: String) : MockVirtualFile(true, name)
fun from(path: Path) = from(path.toFile())
fun from(file: File): MockVirtualFile {
return when {
file.isDirectory -> MockVirtualDir(file.name).apply {
file.listFiles().forEach { child ->
addChild(from(child))
}
}
else -> MockVirtualFile(file.name)
}
}
}
| package com.emberjs
import com.intellij.mock.MockVirtualFile
import java.io.File
import java.nio.file.Path
import java.nio.file.Paths
object EmberTestFixtures {
val FIXTURES_RESOURCE = ClassLoader.getSystemResource("com/emberjs/fixtures")
val FIXTURES_PATH = Paths.get(FIXTURES_RESOURCE.toURI()).toAbsolutePath()
val EXAMPLE = from(FIXTURES_PATH.resolve("example"))
val CRATES_IO = from(FIXTURES_PATH.resolve("crates.io"))
val APTIBLE = from(FIXTURES_PATH.resolve("dashboard.aptible.com"))
private class MockVirtualDir(name: String) : MockVirtualFile(true, name)
fun from(path: Path) = from(path.toFile())
fun from(file: File): MockVirtualFile {
return when {
file.isDirectory -> MockVirtualDir(file.name).apply {
file.listFiles().forEach { child ->
addChild(from(child))
}
}
else -> MockVirtualFile(file.name)
}
}
}
| Load fixtures path from class loader | TestFixtures: Load fixtures path from class loader
| Kotlin | apache-2.0 | Turbo87/intellij-emberjs,Turbo87/intellij-emberjs,Turbo87/intellij-emberjs,Turbo87/intellij-emberjs | kotlin | ## Code Before:
package com.emberjs
import com.intellij.mock.MockVirtualFile
import java.io.File
import java.nio.file.Path
import java.nio.file.Paths
object EmberTestFixtures {
val RESOURCE_PATH = Paths.get("src/test/resources/com/emberjs").toAbsolutePath()
val EXAMPLE = from(RESOURCE_PATH.resolve("fixtures/example"))
val CRATES_IO = from(RESOURCE_PATH.resolve("fixtures/crates.io"))
val APTIBLE = from(RESOURCE_PATH.resolve("fixtures/dashboard.aptible.com"))
private class MockVirtualDir(name: String) : MockVirtualFile(true, name)
fun from(path: Path) = from(path.toFile())
fun from(file: File): MockVirtualFile {
return when {
file.isDirectory -> MockVirtualDir(file.name).apply {
file.listFiles().forEach { child ->
addChild(from(child))
}
}
else -> MockVirtualFile(file.name)
}
}
}
## Instruction:
TestFixtures: Load fixtures path from class loader
## Code After:
package com.emberjs
import com.intellij.mock.MockVirtualFile
import java.io.File
import java.nio.file.Path
import java.nio.file.Paths
object EmberTestFixtures {
val FIXTURES_RESOURCE = ClassLoader.getSystemResource("com/emberjs/fixtures")
val FIXTURES_PATH = Paths.get(FIXTURES_RESOURCE.toURI()).toAbsolutePath()
val EXAMPLE = from(FIXTURES_PATH.resolve("example"))
val CRATES_IO = from(FIXTURES_PATH.resolve("crates.io"))
val APTIBLE = from(FIXTURES_PATH.resolve("dashboard.aptible.com"))
private class MockVirtualDir(name: String) : MockVirtualFile(true, name)
fun from(path: Path) = from(path.toFile())
fun from(file: File): MockVirtualFile {
return when {
file.isDirectory -> MockVirtualDir(file.name).apply {
file.listFiles().forEach { child ->
addChild(from(child))
}
}
else -> MockVirtualFile(file.name)
}
}
}
| package com.emberjs
import com.intellij.mock.MockVirtualFile
import java.io.File
import java.nio.file.Path
import java.nio.file.Paths
object EmberTestFixtures {
- val RESOURCE_PATH = Paths.get("src/test/resources/com/emberjs").toAbsolutePath()
+ val FIXTURES_RESOURCE = ClassLoader.getSystemResource("com/emberjs/fixtures")
+ val FIXTURES_PATH = Paths.get(FIXTURES_RESOURCE.toURI()).toAbsolutePath()
- val EXAMPLE = from(RESOURCE_PATH.resolve("fixtures/example"))
? ----- ---------
+ val EXAMPLE = from(FIXTURES_PATH.resolve("example"))
? +++++
- val CRATES_IO = from(RESOURCE_PATH.resolve("fixtures/crates.io"))
? ----- ---------
+ val CRATES_IO = from(FIXTURES_PATH.resolve("crates.io"))
? +++++
- val APTIBLE = from(RESOURCE_PATH.resolve("fixtures/dashboard.aptible.com"))
? ----- ---------
+ val APTIBLE = from(FIXTURES_PATH.resolve("dashboard.aptible.com"))
? +++++
private class MockVirtualDir(name: String) : MockVirtualFile(true, name)
fun from(path: Path) = from(path.toFile())
fun from(file: File): MockVirtualFile {
return when {
file.isDirectory -> MockVirtualDir(file.name).apply {
file.listFiles().forEach { child ->
addChild(from(child))
}
}
else -> MockVirtualFile(file.name)
}
}
} | 9 | 0.290323 | 5 | 4 |
5b5e156f3581cce8ecca166198e4a2d758eb576e | websites/submit.vefverdlaun.is/src/App.js | websites/submit.vefverdlaun.is/src/App.js | import React, { Component } from 'react'
import logo from './logo.svg'
import './App.css'
class App extends Component {
render() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<h1 className="App-title">Welcome to React</h1>
</header>
<p className="App-intro">
To get started, edit <code>src/App.js</code> and save to reload.
</p>
</div>
)
}
}
export default App
| import React, { Component } from 'react'
import logo from './logo.svg'
import './App.css'
class App extends Component {
render() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<h1 className="App-title">Welcome to React</h1>
</header>
<p className="App-intro">
To get started, edit <code>src/App.js</code> and save to reload.
</p>
<p className="App-intro">
This project will be the form to submit projects to the Icelandic Web
Awards.
</p>
</div>
)
}
}
export default App
| Add some text to try out ci setup | Add some text to try out ci setup
| JavaScript | mit | svef/www,svef/www | javascript | ## Code Before:
import React, { Component } from 'react'
import logo from './logo.svg'
import './App.css'
class App extends Component {
render() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<h1 className="App-title">Welcome to React</h1>
</header>
<p className="App-intro">
To get started, edit <code>src/App.js</code> and save to reload.
</p>
</div>
)
}
}
export default App
## Instruction:
Add some text to try out ci setup
## Code After:
import React, { Component } from 'react'
import logo from './logo.svg'
import './App.css'
class App extends Component {
render() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<h1 className="App-title">Welcome to React</h1>
</header>
<p className="App-intro">
To get started, edit <code>src/App.js</code> and save to reload.
</p>
<p className="App-intro">
This project will be the form to submit projects to the Icelandic Web
Awards.
</p>
</div>
)
}
}
export default App
| import React, { Component } from 'react'
import logo from './logo.svg'
import './App.css'
class App extends Component {
render() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<h1 className="App-title">Welcome to React</h1>
</header>
<p className="App-intro">
To get started, edit <code>src/App.js</code> and save to reload.
</p>
+ <p className="App-intro">
+ This project will be the form to submit projects to the Icelandic Web
+ Awards.
+ </p>
</div>
)
}
}
export default App | 4 | 0.190476 | 4 | 0 |
06213075afea964a75eda9957ab74382461cbaf8 | src/app/services/audio.service.js | src/app/services/audio.service.js | class AudioService {
constructor(Howl, Howler, $localStorage, audioOn) {
'ngInject';
this.Howl = Howl;
this.Howler = Howler;
this.local = $localStorage;
this.audioOn = audioOn;
}
prepareMusic(url, loop = true) {
return new this.Howl({
src: [url],
loop: loop,
preload: true,
html5: true
});
}
playMusic(music, loop = true, autoplay = true) {
if (this.music) {
this.stopMusic();
}
this.music = music;
this.music.play();
}
tooglePauseMusic() {
if (this.music != null) {
if(this.music.playing(this.music)) {
this.music.pause();
} else {
this.music.play();
}
} else {
this.playMusic();
}
}
stopMusic() {
if (this.music != null) {
this.music.stop();
}
}
shouldPlayMusic(music) {
if (this.local.audioStatus === this.audioOn) {
if (this.music == null) {
return true;
} else if (this.music._src !== music) {
return true;
}
}
return false;
}
}
export default AudioService;
| const soundFiles = [];
class AudioService {
constructor($q, Howl, Howler, $localStorage, audioOn) {
'ngInject';
this.$q = $q;
this.Howl = Howl;
this.Howler = Howler;
this.local = $localStorage;
this.audioOn = audioOn;
this.sounds = [];
this.prepareSound();
}
prepareSound() {
this.sounds = _.each(soundFiles, (soundFile) => {
var sound = new this.Howl({
src: [url],
loop: false,
preload: true,
html5: true
});
sound.name = soundFile.name;
return sound;
});
}
prepareMusic(url, loop = true) {
return new this.Howl({
src: [url],
loop: loop,
preload: true,
html5: true
});
}
playMusic(music, loop = true, autoplay = true) {
if (this.music) {
this.stopMusic();
}
this.music = music;
this.music.play();
}
tooglePauseMusic() {
if (this.music != null) {
if (this.music.playing(this.music)) {
this.music.pause();
} else {
this.music.play();
}
} else {
this.playMusic();
}
}
stopMusic() {
if (this.music != null) {
this.music.stop();
}
}
shouldPlayMusic(music) {
if (this.local.audioStatus === this.audioOn) {
if (this.music == null) {
return true;
} else if (this.music._src !== music) {
return true;
}
}
return false;
}
}
export default AudioService;
| Add prepare sounds method to prepare sound effects | Add prepare sounds method to prepare sound effects
| JavaScript | mit | hendryl/Famous-Places-Web,hendryl/Famous-Places-Web | javascript | ## Code Before:
class AudioService {
constructor(Howl, Howler, $localStorage, audioOn) {
'ngInject';
this.Howl = Howl;
this.Howler = Howler;
this.local = $localStorage;
this.audioOn = audioOn;
}
prepareMusic(url, loop = true) {
return new this.Howl({
src: [url],
loop: loop,
preload: true,
html5: true
});
}
playMusic(music, loop = true, autoplay = true) {
if (this.music) {
this.stopMusic();
}
this.music = music;
this.music.play();
}
tooglePauseMusic() {
if (this.music != null) {
if(this.music.playing(this.music)) {
this.music.pause();
} else {
this.music.play();
}
} else {
this.playMusic();
}
}
stopMusic() {
if (this.music != null) {
this.music.stop();
}
}
shouldPlayMusic(music) {
if (this.local.audioStatus === this.audioOn) {
if (this.music == null) {
return true;
} else if (this.music._src !== music) {
return true;
}
}
return false;
}
}
export default AudioService;
## Instruction:
Add prepare sounds method to prepare sound effects
## Code After:
const soundFiles = [];
class AudioService {
constructor($q, Howl, Howler, $localStorage, audioOn) {
'ngInject';
this.$q = $q;
this.Howl = Howl;
this.Howler = Howler;
this.local = $localStorage;
this.audioOn = audioOn;
this.sounds = [];
this.prepareSound();
}
prepareSound() {
this.sounds = _.each(soundFiles, (soundFile) => {
var sound = new this.Howl({
src: [url],
loop: false,
preload: true,
html5: true
});
sound.name = soundFile.name;
return sound;
});
}
prepareMusic(url, loop = true) {
return new this.Howl({
src: [url],
loop: loop,
preload: true,
html5: true
});
}
playMusic(music, loop = true, autoplay = true) {
if (this.music) {
this.stopMusic();
}
this.music = music;
this.music.play();
}
tooglePauseMusic() {
if (this.music != null) {
if (this.music.playing(this.music)) {
this.music.pause();
} else {
this.music.play();
}
} else {
this.playMusic();
}
}
stopMusic() {
if (this.music != null) {
this.music.stop();
}
}
shouldPlayMusic(music) {
if (this.local.audioStatus === this.audioOn) {
if (this.music == null) {
return true;
} else if (this.music._src !== music) {
return true;
}
}
return false;
}
}
export default AudioService;
| + const soundFiles = [];
+
class AudioService {
- constructor(Howl, Howler, $localStorage, audioOn) {
+ constructor($q, Howl, Howler, $localStorage, audioOn) {
? ++++
'ngInject';
+ this.$q = $q;
this.Howl = Howl;
this.Howler = Howler;
this.local = $localStorage;
this.audioOn = audioOn;
+
+ this.sounds = [];
+
+ this.prepareSound();
+ }
+
+ prepareSound() {
+ this.sounds = _.each(soundFiles, (soundFile) => {
+ var sound = new this.Howl({
+ src: [url],
+ loop: false,
+ preload: true,
+ html5: true
+ });
+
+ sound.name = soundFile.name;
+ return sound;
+ });
}
prepareMusic(url, loop = true) {
return new this.Howl({
src: [url],
loop: loop,
preload: true,
html5: true
});
}
playMusic(music, loop = true, autoplay = true) {
if (this.music) {
this.stopMusic();
}
this.music = music;
this.music.play();
}
tooglePauseMusic() {
if (this.music != null) {
- if(this.music.playing(this.music)) {
+ if (this.music.playing(this.music)) {
? +
this.music.pause();
} else {
this.music.play();
}
} else {
this.playMusic();
}
}
stopMusic() {
if (this.music != null) {
this.music.stop();
}
}
shouldPlayMusic(music) {
if (this.local.audioStatus === this.audioOn) {
if (this.music == null) {
return true;
} else if (this.music._src !== music) {
return true;
}
}
return false;
}
}
export default AudioService; | 25 | 0.416667 | 23 | 2 |
2ad362462dd7883ebeab524b1a168e38f8bbb50e | metadata/dev.jtsalva.cloudmare.yml | metadata/dev.jtsalva.cloudmare.yml | Categories:
- Development
- Internet
- Security
License: MIT
SourceCode: https://github.com/jtsalva/cloudmare
IssueTracker: https://github.com/jtsalva/cloudmare/issues
AutoName: CloudMare
Summary: Small & Simple Cloudflare tool
Description: |-
The only Android app supporting API Tokens, the safer alternative to a Global API Key.
* Dark and Light theme
* Toggle 'Under Attack Mode' and 'Development Mode'
* Search & Manage DNS records
* View Analytics
* Toggle Page Rules
* Manage SSL Settings
* Manage Caching Controls
* Manage Network Settings
* Supports both API Tokens and Email + API Key
Unofficial and not endorsed by Cloudflare. Data travels only from your device to Cloudflare's official API; no data is recorded or sent elsewhere by CloudMare.
RepoType: git
Repo: https://github.com/jtsalva/cloudmare
Builds:
- versionName: Cumulus
versionCode: 58
commit: v1.0.0
subdir: app
gradle:
- yes
AutoUpdateMode: None
UpdateCheckMode: Tags
| Categories:
- Development
- Internet
- Security
License: MIT
SourceCode: https://github.com/jtsalva/cloudmare
IssueTracker: https://github.com/jtsalva/cloudmare/issues
AutoName: CloudMare // Activity titles
Summary: Small & Simple Cloudflare tool
Description: |-
The only Android app supporting API Tokens, the safer alternative to a Global API Key.
* Dark and Light theme
* Toggle 'Under Attack Mode' and 'Development Mode'
* Search & Manage DNS records
* View Analytics
* Toggle Page Rules
* Manage SSL Settings
* Manage Caching Controls
* Manage Network Settings
* Supports both API Tokens and Email + API Key
Unofficial and not endorsed by Cloudflare. Data travels only from your device to Cloudflare's official API; no data is recorded or sent elsewhere by CloudMare.
RepoType: git
Repo: https://github.com/jtsalva/cloudmare
Builds:
- versionName: Cumulus
versionCode: 58
commit: v1.0.0
subdir: app
gradle:
- yes
AutoUpdateMode: None
UpdateCheckMode: Tags
CurrentVersion: Cumulus
CurrentVersionCode: 58
| Update CV of CloudMare // Activity titles to Cumulus (58) | Update CV of CloudMare // Activity titles to Cumulus (58)
| YAML | agpl-3.0 | f-droid/fdroiddata,f-droid/fdroiddata | yaml | ## Code Before:
Categories:
- Development
- Internet
- Security
License: MIT
SourceCode: https://github.com/jtsalva/cloudmare
IssueTracker: https://github.com/jtsalva/cloudmare/issues
AutoName: CloudMare
Summary: Small & Simple Cloudflare tool
Description: |-
The only Android app supporting API Tokens, the safer alternative to a Global API Key.
* Dark and Light theme
* Toggle 'Under Attack Mode' and 'Development Mode'
* Search & Manage DNS records
* View Analytics
* Toggle Page Rules
* Manage SSL Settings
* Manage Caching Controls
* Manage Network Settings
* Supports both API Tokens and Email + API Key
Unofficial and not endorsed by Cloudflare. Data travels only from your device to Cloudflare's official API; no data is recorded or sent elsewhere by CloudMare.
RepoType: git
Repo: https://github.com/jtsalva/cloudmare
Builds:
- versionName: Cumulus
versionCode: 58
commit: v1.0.0
subdir: app
gradle:
- yes
AutoUpdateMode: None
UpdateCheckMode: Tags
## Instruction:
Update CV of CloudMare // Activity titles to Cumulus (58)
## Code After:
Categories:
- Development
- Internet
- Security
License: MIT
SourceCode: https://github.com/jtsalva/cloudmare
IssueTracker: https://github.com/jtsalva/cloudmare/issues
AutoName: CloudMare // Activity titles
Summary: Small & Simple Cloudflare tool
Description: |-
The only Android app supporting API Tokens, the safer alternative to a Global API Key.
* Dark and Light theme
* Toggle 'Under Attack Mode' and 'Development Mode'
* Search & Manage DNS records
* View Analytics
* Toggle Page Rules
* Manage SSL Settings
* Manage Caching Controls
* Manage Network Settings
* Supports both API Tokens and Email + API Key
Unofficial and not endorsed by Cloudflare. Data travels only from your device to Cloudflare's official API; no data is recorded or sent elsewhere by CloudMare.
RepoType: git
Repo: https://github.com/jtsalva/cloudmare
Builds:
- versionName: Cumulus
versionCode: 58
commit: v1.0.0
subdir: app
gradle:
- yes
AutoUpdateMode: None
UpdateCheckMode: Tags
CurrentVersion: Cumulus
CurrentVersionCode: 58
| Categories:
- Development
- Internet
- Security
License: MIT
SourceCode: https://github.com/jtsalva/cloudmare
IssueTracker: https://github.com/jtsalva/cloudmare/issues
- AutoName: CloudMare
+ AutoName: CloudMare // Activity titles
Summary: Small & Simple Cloudflare tool
Description: |-
The only Android app supporting API Tokens, the safer alternative to a Global API Key.
* Dark and Light theme
* Toggle 'Under Attack Mode' and 'Development Mode'
* Search & Manage DNS records
* View Analytics
* Toggle Page Rules
* Manage SSL Settings
* Manage Caching Controls
* Manage Network Settings
* Supports both API Tokens and Email + API Key
Unofficial and not endorsed by Cloudflare. Data travels only from your device to Cloudflare's official API; no data is recorded or sent elsewhere by CloudMare.
RepoType: git
Repo: https://github.com/jtsalva/cloudmare
Builds:
- versionName: Cumulus
versionCode: 58
commit: v1.0.0
subdir: app
gradle:
- yes
AutoUpdateMode: None
UpdateCheckMode: Tags
+ CurrentVersion: Cumulus
+ CurrentVersionCode: 58 | 4 | 0.105263 | 3 | 1 |
84c459d95637ca901565be03dc203a4dd60c30fa | doc/CMakeLists.txt | doc/CMakeLists.txt | include(UseDoxygen OPTIONAL)
| find_package(Doxygen REQUIRED dot)
if (DOXYGEN_FOUND)
doxygen_add_docs(docs
${CMAKE_CURRENT_SOURCE_DIR})
endif(DOXYGEN_FOUND)
| Use doxygen provided by cmake itself | cmake: Use doxygen provided by cmake itself
| Text | apache-2.0 | clibs/cmocka,clibs/cmocka | text | ## Code Before:
include(UseDoxygen OPTIONAL)
## Instruction:
cmake: Use doxygen provided by cmake itself
## Code After:
find_package(Doxygen REQUIRED dot)
if (DOXYGEN_FOUND)
doxygen_add_docs(docs
${CMAKE_CURRENT_SOURCE_DIR})
endif(DOXYGEN_FOUND)
| - include(UseDoxygen OPTIONAL)
+ find_package(Doxygen REQUIRED dot)
+ if (DOXYGEN_FOUND)
+ doxygen_add_docs(docs
+ ${CMAKE_CURRENT_SOURCE_DIR})
+ endif(DOXYGEN_FOUND) | 6 | 3 | 5 | 1 |
9d34a9c6e1a7c75fe7d8e4ba527044cbf4b9d203 | src/frontend/app/templates/components/cash-flow-chart.hbs | src/frontend/app/templates/components/cash-flow-chart.hbs |
Start date: {{moment-format startDate 'MM-DD-YYYY'}}
Duration: {{days}}
End date: {{moment-format endDate 'MM-DD-YYYY'}}
Starting balance: {{format-money startingBalance}}
{{ember-chart
type="DualFillLine"
data=chartjsData
options=chartjsOptions
}}
|
{{ember-chart
type="DualFillLine"
data=chartjsData
options=chartjsOptions
}}
| Remove debugging info from cash flow chart | Remove debugging info from cash flow chart
| Handlebars | bsd-3-clause | dchaley/dough-flow,dchaley/dough-flow,dchaley/dough-flow | handlebars | ## Code Before:
Start date: {{moment-format startDate 'MM-DD-YYYY'}}
Duration: {{days}}
End date: {{moment-format endDate 'MM-DD-YYYY'}}
Starting balance: {{format-money startingBalance}}
{{ember-chart
type="DualFillLine"
data=chartjsData
options=chartjsOptions
}}
## Instruction:
Remove debugging info from cash flow chart
## Code After:
{{ember-chart
type="DualFillLine"
data=chartjsData
options=chartjsOptions
}}
| -
- Start date: {{moment-format startDate 'MM-DD-YYYY'}}
- Duration: {{days}}
- End date: {{moment-format endDate 'MM-DD-YYYY'}}
- Starting balance: {{format-money startingBalance}}
{{ember-chart
type="DualFillLine"
data=chartjsData
options=chartjsOptions
}}
+ | 6 | 0.545455 | 1 | 5 |
54a7cf235017c6cd5a5e632a55dd8181c8a3ae8e | public/pages/exportlatex.html | public/pages/exportlatex.html | <div class="row">
<div class="col-md-4" >
<div style="margin-left:2em;">
</div>
</div>
<div class="col-md-8">
<div style="margin-left:1em;">
<br/>
<br/>
<h3>LaTeX Export: {{title}} </h3>
<p ng-cloak>Download tar file from <a ng-href="{{exportLatexUrl}}" target="_blank">this link</a></p>
<!-- <p>Download TAR file from <a href="www.nytimes.com" target="_blank">this link</a></p> -->
<!-- <p>Download tar file from <a href="http://psurl.s3.amazonaws.com/latex/" + {{basicEportLatexUrl}} target="_blank">this link</a></p> -->
</div>
</div>
</div>
| <div class="row">
<div class="col-md-4" >
<div style="margin-left:2em;">
</div>
</div>
<div class="col-md-8">
<div style="margin-left:1em;">
<br/>
<br/>
<h3>LaTeX Export: {{title}} </h3>
<p ng-cloak>Download tar file from <a ng-href="{{exportLatexUrl}}" target="_blank">this link</a></p>
<p> Be shure to typeset with XeLaTeX.</p>
<!-- <p>Download TAR file from <a href="www.nytimes.com" target="_blank">this link</a></p> -->
<!-- <p>Download tar file from <a href="http://psurl.s3.amazonaws.com/latex/" + {{basicEportLatexUrl}} target="_blank">this link</a></p> -->
</div>
</div>
</div>
| Add message on typesetting wit XeLaTeX | Add message on typesetting wit XeLaTeX
| HTML | mit | jxxcarlson/ns_angular,jxxcarlson/ns_angular | html | ## Code Before:
<div class="row">
<div class="col-md-4" >
<div style="margin-left:2em;">
</div>
</div>
<div class="col-md-8">
<div style="margin-left:1em;">
<br/>
<br/>
<h3>LaTeX Export: {{title}} </h3>
<p ng-cloak>Download tar file from <a ng-href="{{exportLatexUrl}}" target="_blank">this link</a></p>
<!-- <p>Download TAR file from <a href="www.nytimes.com" target="_blank">this link</a></p> -->
<!-- <p>Download tar file from <a href="http://psurl.s3.amazonaws.com/latex/" + {{basicEportLatexUrl}} target="_blank">this link</a></p> -->
</div>
</div>
</div>
## Instruction:
Add message on typesetting wit XeLaTeX
## Code After:
<div class="row">
<div class="col-md-4" >
<div style="margin-left:2em;">
</div>
</div>
<div class="col-md-8">
<div style="margin-left:1em;">
<br/>
<br/>
<h3>LaTeX Export: {{title}} </h3>
<p ng-cloak>Download tar file from <a ng-href="{{exportLatexUrl}}" target="_blank">this link</a></p>
<p> Be shure to typeset with XeLaTeX.</p>
<!-- <p>Download TAR file from <a href="www.nytimes.com" target="_blank">this link</a></p> -->
<!-- <p>Download tar file from <a href="http://psurl.s3.amazonaws.com/latex/" + {{basicEportLatexUrl}} target="_blank">this link</a></p> -->
</div>
</div>
</div>
| <div class="row">
<div class="col-md-4" >
<div style="margin-left:2em;">
</div>
</div>
<div class="col-md-8">
<div style="margin-left:1em;">
<br/>
<br/>
<h3>LaTeX Export: {{title}} </h3>
<p ng-cloak>Download tar file from <a ng-href="{{exportLatexUrl}}" target="_blank">this link</a></p>
+ <p> Be shure to typeset with XeLaTeX.</p>
<!-- <p>Download TAR file from <a href="www.nytimes.com" target="_blank">this link</a></p> -->
<!-- <p>Download tar file from <a href="http://psurl.s3.amazonaws.com/latex/" + {{basicEportLatexUrl}} target="_blank">this link</a></p> -->
</div>
</div>
</div> | 1 | 0.045455 | 1 | 0 |
d08b79e178d61939b7d73ef3024e9145c828b14f | vim/.config/nvim/init.vim | vim/.config/nvim/init.vim | set mouse=a
syntax on
filetype plugin indent on
" Set cache folder
set directory=$XDG_DATA_HOME/nvim/swap
" Set persistent history in cache folder
set undofile
set undodir=$XDG_CACHE_HOME/nvim/undo
" Some nice colors for right margin and current line
set colorcolumn=81 cursorline
highlight ColorColumn ctermbg=0
highlight CursorLine cterm=NONE ctermbg=0
" Better identation and search options
set autoindent smartindent
set incsearch hlsearch ignorecase smartcase
set ruler showcmd title showmode modeline
" More natural split opening
set splitbelow splitright
" Map the Q letter to hard-wrapping specific sections
map Q gq
" Show special characters and trailing whitespace
set list
set listchars=tab:▓▒
set listchars+=trail:░
" Special overrides for specific filetypes
autocmd FileType yaml setlocal tabstop=2 softtabstop=2 shiftwidth=2 expandtab
autocmd FileType python setlocal tabstop=4 softtabstop=4 shiftwidth=4 expandtab
| set mouse=a
syntax on
filetype plugin indent on
" Set cache folder
set directory=$XDG_DATA_HOME/nvim/swap
" Set persistent history in cache folder
set undofile
set undodir=$XDG_CACHE_HOME/nvim/undo
" Some nice colors for right margin and current line
set colorcolumn=81 cursorline
highlight ColorColumn ctermbg=0
highlight CursorLine cterm=NONE ctermbg=0
" Better identation and search options
set autoindent smartindent
set incsearch hlsearch ignorecase smartcase
set ruler showcmd title showmode modeline
" More natural split opening
set splitbelow splitright
" Map the Q letter to hard-wrapping specific sections
map Q gq
" Show special characters and trailing whitespace
set list
set listchars=tab:▓▒
set listchars+=trail:░
" Special overrides for specific filetypes
autocmd FileType yaml setlocal tabstop=2 softtabstop=2 shiftwidth=2 expandtab " based on http://yaml.org/spec/1.2/2009-07-21/spec.html#id2576668
autocmd FileType php setlocal tabstop=4 softtabstop=4 shiftwidth=4 expandtab " based on http://www.php-fig.org/psr/psr-2/#indenting
autocmd FileType python setlocal tabstop=4 softtabstop=4 shiftwidth=4 expandtab " based on https://www.python.org/dev/peps/pep-0008/#indentation
| Add indentation controls based on style guides | Add indentation controls based on style guides
| VimL | mit | PedroArvela/dotfiles,jparvela/dotfiles | viml | ## Code Before:
set mouse=a
syntax on
filetype plugin indent on
" Set cache folder
set directory=$XDG_DATA_HOME/nvim/swap
" Set persistent history in cache folder
set undofile
set undodir=$XDG_CACHE_HOME/nvim/undo
" Some nice colors for right margin and current line
set colorcolumn=81 cursorline
highlight ColorColumn ctermbg=0
highlight CursorLine cterm=NONE ctermbg=0
" Better identation and search options
set autoindent smartindent
set incsearch hlsearch ignorecase smartcase
set ruler showcmd title showmode modeline
" More natural split opening
set splitbelow splitright
" Map the Q letter to hard-wrapping specific sections
map Q gq
" Show special characters and trailing whitespace
set list
set listchars=tab:▓▒
set listchars+=trail:░
" Special overrides for specific filetypes
autocmd FileType yaml setlocal tabstop=2 softtabstop=2 shiftwidth=2 expandtab
autocmd FileType python setlocal tabstop=4 softtabstop=4 shiftwidth=4 expandtab
## Instruction:
Add indentation controls based on style guides
## Code After:
set mouse=a
syntax on
filetype plugin indent on
" Set cache folder
set directory=$XDG_DATA_HOME/nvim/swap
" Set persistent history in cache folder
set undofile
set undodir=$XDG_CACHE_HOME/nvim/undo
" Some nice colors for right margin and current line
set colorcolumn=81 cursorline
highlight ColorColumn ctermbg=0
highlight CursorLine cterm=NONE ctermbg=0
" Better identation and search options
set autoindent smartindent
set incsearch hlsearch ignorecase smartcase
set ruler showcmd title showmode modeline
" More natural split opening
set splitbelow splitright
" Map the Q letter to hard-wrapping specific sections
map Q gq
" Show special characters and trailing whitespace
set list
set listchars=tab:▓▒
set listchars+=trail:░
" Special overrides for specific filetypes
autocmd FileType yaml setlocal tabstop=2 softtabstop=2 shiftwidth=2 expandtab " based on http://yaml.org/spec/1.2/2009-07-21/spec.html#id2576668
autocmd FileType php setlocal tabstop=4 softtabstop=4 shiftwidth=4 expandtab " based on http://www.php-fig.org/psr/psr-2/#indenting
autocmd FileType python setlocal tabstop=4 softtabstop=4 shiftwidth=4 expandtab " based on https://www.python.org/dev/peps/pep-0008/#indentation
| set mouse=a
syntax on
filetype plugin indent on
" Set cache folder
set directory=$XDG_DATA_HOME/nvim/swap
" Set persistent history in cache folder
set undofile
set undodir=$XDG_CACHE_HOME/nvim/undo
" Some nice colors for right margin and current line
set colorcolumn=81 cursorline
highlight ColorColumn ctermbg=0
highlight CursorLine cterm=NONE ctermbg=0
" Better identation and search options
set autoindent smartindent
set incsearch hlsearch ignorecase smartcase
set ruler showcmd title showmode modeline
" More natural split opening
set splitbelow splitright
" Map the Q letter to hard-wrapping specific sections
map Q gq
" Show special characters and trailing whitespace
set list
set listchars=tab:▓▒
set listchars+=trail:░
" Special overrides for specific filetypes
- autocmd FileType yaml setlocal tabstop=2 softtabstop=2 shiftwidth=2 expandtab
- autocmd FileType python setlocal tabstop=4 softtabstop=4 shiftwidth=4 expandtab
+ autocmd FileType yaml setlocal tabstop=2 softtabstop=2 shiftwidth=2 expandtab " based on http://yaml.org/spec/1.2/2009-07-21/spec.html#id2576668
+ autocmd FileType php setlocal tabstop=4 softtabstop=4 shiftwidth=4 expandtab " based on http://www.php-fig.org/psr/psr-2/#indenting
+ autocmd FileType python setlocal tabstop=4 softtabstop=4 shiftwidth=4 expandtab " based on https://www.python.org/dev/peps/pep-0008/#indentation | 5 | 0.142857 | 3 | 2 |
ef1403c6561e82e74d118a3edf555746caf18c7a | spec/client_spec.rb | spec/client_spec.rb |
require 'spec_helper'
require 'ephemeral/client'
describe 'Ephemeral::Client' do
it 'expects 3 arguments' do
test_client = Ephemeral::Client.new
expect{
test_client.build
}.to raise_error ArgumentError
end
it 'returns a string' do
test_client = Ephemeral::Client.new
response = test_client.build("ruby:2.1", "https://github.com/skierkowski/hello-middleman", "middleman")
expect(response).to be_an_instance_of Hash
end
end |
require 'spec_helper'
require 'ephemeral/client'
describe 'Ephemeral::Client' do
it 'expects 3 arguments' do
test_client = Ephemeral::Client.new
expect{
test_client.build
}.to raise_error ArgumentError
end
it 'returns a hash' do
test_client = Ephemeral::Client.new
response = test_client.build("ruby:2.1", "https://github.com/skierkowski/hello-middleman", "middleman")
expect(response).to be_an_instance_of Hash
end
it 'returns a hash which contains an id' do
test_client = Ephemeral::Client.new
response = test_client.build("ruby:2.1", "https://github.com/skierkowski/hello-middleman", "middleman")
expect(response['id'].nil?).to equal false
end
end | Add test to check for id | Add test to check for id
| Ruby | mit | factor-io/ephemeral-client | ruby | ## Code Before:
require 'spec_helper'
require 'ephemeral/client'
describe 'Ephemeral::Client' do
it 'expects 3 arguments' do
test_client = Ephemeral::Client.new
expect{
test_client.build
}.to raise_error ArgumentError
end
it 'returns a string' do
test_client = Ephemeral::Client.new
response = test_client.build("ruby:2.1", "https://github.com/skierkowski/hello-middleman", "middleman")
expect(response).to be_an_instance_of Hash
end
end
## Instruction:
Add test to check for id
## Code After:
require 'spec_helper'
require 'ephemeral/client'
describe 'Ephemeral::Client' do
it 'expects 3 arguments' do
test_client = Ephemeral::Client.new
expect{
test_client.build
}.to raise_error ArgumentError
end
it 'returns a hash' do
test_client = Ephemeral::Client.new
response = test_client.build("ruby:2.1", "https://github.com/skierkowski/hello-middleman", "middleman")
expect(response).to be_an_instance_of Hash
end
it 'returns a hash which contains an id' do
test_client = Ephemeral::Client.new
response = test_client.build("ruby:2.1", "https://github.com/skierkowski/hello-middleman", "middleman")
expect(response['id'].nil?).to equal false
end
end |
require 'spec_helper'
require 'ephemeral/client'
describe 'Ephemeral::Client' do
it 'expects 3 arguments' do
test_client = Ephemeral::Client.new
expect{
test_client.build
}.to raise_error ArgumentError
end
- it 'returns a string' do
? ^^^^^
+ it 'returns a hash' do
? ++ ^
test_client = Ephemeral::Client.new
response = test_client.build("ruby:2.1", "https://github.com/skierkowski/hello-middleman", "middleman")
expect(response).to be_an_instance_of Hash
end
+
+ it 'returns a hash which contains an id' do
+ test_client = Ephemeral::Client.new
+ response = test_client.build("ruby:2.1", "https://github.com/skierkowski/hello-middleman", "middleman")
+ expect(response['id'].nil?).to equal false
+ end
end | 8 | 0.421053 | 7 | 1 |
b1e1910a974865a362546d7d4bee35becb69b5e2 | src/condor_syscall_lib/scanner.h | src/condor_syscall_lib/scanner.h |
struct token {
int tok_type;
char *val;
};
struct node {
int node_type;
char *type_name;
char *id;
int is_ptr;
int is_const;
int is_mapped;
int is_array;
int extract;
struct node *next;
struct node *prev;
};
union yystype {
struct token tok;
struct node *node;
};
#define YYSTYPE union yystype
|
struct token {
int tok_type;
char *val;
};
struct node {
int node_type;
char *type_name;
char *id;
int is_ptr;
int is_const;
int is_const_ptr;
int is_mapped;
int is_array;
int in_param;
int out_param;
int extract;
struct node *next;
struct node *prev;
};
struct p_mode {
int in;
int out;
};
union yystype {
struct token tok;
struct node *node;
struct p_mode param_mode;
int bool;
};
#define YYSTYPE union yystype
| Add boolean type so yacc productions can return a boolean value. Add parameter mode type so we can tag parameters as IN, OUT, or BOTH. | Add boolean type so yacc productions can return a boolean value.
Add parameter mode type so we can tag parameters as IN, OUT, or BOTH.
| C | apache-2.0 | htcondor/htcondor,djw8605/condor,htcondor/htcondor,htcondor/htcondor,djw8605/condor,bbockelm/condor-network-accounting,neurodebian/htcondor,bbockelm/condor-network-accounting,mambelli/osg-bosco-marco,djw8605/condor,neurodebian/htcondor,zhangzhehust/htcondor,bbockelm/condor-network-accounting,htcondor/htcondor,bbockelm/condor-network-accounting,clalancette/condor-dcloud,clalancette/condor-dcloud,djw8605/condor,djw8605/condor,bbockelm/condor-network-accounting,djw8605/htcondor,djw8605/htcondor,bbockelm/condor-network-accounting,htcondor/htcondor,zhangzhehust/htcondor,djw8605/condor,djw8605/htcondor,neurodebian/htcondor,neurodebian/htcondor,zhangzhehust/htcondor,djw8605/htcondor,djw8605/htcondor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,zhangzhehust/htcondor,clalancette/condor-dcloud,neurodebian/htcondor,mambelli/osg-bosco-marco,zhangzhehust/htcondor,mambelli/osg-bosco-marco,djw8605/htcondor,mambelli/osg-bosco-marco,htcondor/htcondor,bbockelm/condor-network-accounting,clalancette/condor-dcloud,djw8605/htcondor,djw8605/htcondor,htcondor/htcondor,neurodebian/htcondor,djw8605/htcondor,clalancette/condor-dcloud,zhangzhehust/htcondor,djw8605/condor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,zhangzhehust/htcondor,htcondor/htcondor,clalancette/condor-dcloud,mambelli/osg-bosco-marco,neurodebian/htcondor,djw8605/condor,neurodebian/htcondor,neurodebian/htcondor,clalancette/condor-dcloud | c | ## Code Before:
struct token {
int tok_type;
char *val;
};
struct node {
int node_type;
char *type_name;
char *id;
int is_ptr;
int is_const;
int is_mapped;
int is_array;
int extract;
struct node *next;
struct node *prev;
};
union yystype {
struct token tok;
struct node *node;
};
#define YYSTYPE union yystype
## Instruction:
Add boolean type so yacc productions can return a boolean value.
Add parameter mode type so we can tag parameters as IN, OUT, or BOTH.
## Code After:
struct token {
int tok_type;
char *val;
};
struct node {
int node_type;
char *type_name;
char *id;
int is_ptr;
int is_const;
int is_const_ptr;
int is_mapped;
int is_array;
int in_param;
int out_param;
int extract;
struct node *next;
struct node *prev;
};
struct p_mode {
int in;
int out;
};
union yystype {
struct token tok;
struct node *node;
struct p_mode param_mode;
int bool;
};
#define YYSTYPE union yystype
|
struct token {
int tok_type;
char *val;
};
struct node {
int node_type;
char *type_name;
char *id;
int is_ptr;
int is_const;
+ int is_const_ptr;
int is_mapped;
int is_array;
+ int in_param;
+ int out_param;
int extract;
struct node *next;
struct node *prev;
};
-
+
+ struct p_mode {
+ int in;
+ int out;
+ };
+
+
union yystype {
- struct token tok;
? ^
+ struct token tok;
? ^
- struct node *node;
? ^
+ struct node *node;
? ^
+ struct p_mode param_mode;
+ int bool;
};
#define YYSTYPE union yystype | 17 | 0.708333 | 14 | 3 |
64bcdb9ebacc016bfe6e6dc50fc388df227a5938 | app/helpers/appearances_helper.rb | app/helpers/appearances_helper.rb |
module AppearancesHelper
def brand_title
current_appearance&.title.presence || 'GitLab Community Edition'
end
def brand_image
image_tag(current_appearance.logo) if current_appearance&.logo?
end
def brand_text
markdown_field(current_appearance, :description)
end
def brand_new_project_guidelines
markdown_field(current_appearance, :new_project_guidelines)
end
def current_appearance
@appearance ||= Appearance.current
end
def brand_header_logo
if current_appearance&.header_logo?
image_tag current_appearance.header_logo
else
render 'shared/logo.svg'
end
end
# Skip the 'GitLab' type logo when custom brand logo is set
def brand_header_logo_type
unless current_appearance&.header_logo?
render 'shared/logo_type.svg'
end
end
end
|
module AppearancesHelper
def brand_title
current_appearance&.title.presence || default_brand_title
end
def default_brand_title
# This resides in a separate method so that EE can easily redefine it.
'GitLab Community Edition'
end
def brand_image
image_tag(current_appearance.logo) if current_appearance&.logo?
end
def brand_text
markdown_field(current_appearance, :description)
end
def brand_new_project_guidelines
markdown_field(current_appearance, :new_project_guidelines)
end
def current_appearance
@appearance ||= Appearance.current
end
def brand_header_logo
if current_appearance&.header_logo?
image_tag current_appearance.header_logo
else
render 'shared/logo.svg'
end
end
# Skip the 'GitLab' type logo when custom brand logo is set
def brand_header_logo_type
unless current_appearance&.header_logo?
render 'shared/logo_type.svg'
end
end
end
| Move default brand title to a method | Move default brand title to a method
This moves the default brand title in AppearancesHelper#brand_title to a
separate method, allowing EE to redefine it without having to redefine
the entire #brand_title method.
| Ruby | mit | axilleas/gitlabhq,axilleas/gitlabhq,stoplightio/gitlabhq,dreampet/gitlab,stoplightio/gitlabhq,mmkassem/gitlabhq,mmkassem/gitlabhq,axilleas/gitlabhq,stoplightio/gitlabhq,mmkassem/gitlabhq,iiet/iiet-git,mmkassem/gitlabhq,stoplightio/gitlabhq,dreampet/gitlab,iiet/iiet-git,axilleas/gitlabhq,iiet/iiet-git,iiet/iiet-git,dreampet/gitlab,dreampet/gitlab | ruby | ## Code Before:
module AppearancesHelper
def brand_title
current_appearance&.title.presence || 'GitLab Community Edition'
end
def brand_image
image_tag(current_appearance.logo) if current_appearance&.logo?
end
def brand_text
markdown_field(current_appearance, :description)
end
def brand_new_project_guidelines
markdown_field(current_appearance, :new_project_guidelines)
end
def current_appearance
@appearance ||= Appearance.current
end
def brand_header_logo
if current_appearance&.header_logo?
image_tag current_appearance.header_logo
else
render 'shared/logo.svg'
end
end
# Skip the 'GitLab' type logo when custom brand logo is set
def brand_header_logo_type
unless current_appearance&.header_logo?
render 'shared/logo_type.svg'
end
end
end
## Instruction:
Move default brand title to a method
This moves the default brand title in AppearancesHelper#brand_title to a
separate method, allowing EE to redefine it without having to redefine
the entire #brand_title method.
## Code After:
module AppearancesHelper
def brand_title
current_appearance&.title.presence || default_brand_title
end
def default_brand_title
# This resides in a separate method so that EE can easily redefine it.
'GitLab Community Edition'
end
def brand_image
image_tag(current_appearance.logo) if current_appearance&.logo?
end
def brand_text
markdown_field(current_appearance, :description)
end
def brand_new_project_guidelines
markdown_field(current_appearance, :new_project_guidelines)
end
def current_appearance
@appearance ||= Appearance.current
end
def brand_header_logo
if current_appearance&.header_logo?
image_tag current_appearance.header_logo
else
render 'shared/logo.svg'
end
end
# Skip the 'GitLab' type logo when custom brand logo is set
def brand_header_logo_type
unless current_appearance&.header_logo?
render 'shared/logo_type.svg'
end
end
end
|
module AppearancesHelper
def brand_title
- current_appearance&.title.presence || 'GitLab Community Edition'
+ current_appearance&.title.presence || default_brand_title
+ end
+
+ def default_brand_title
+ # This resides in a separate method so that EE can easily redefine it.
+ 'GitLab Community Edition'
end
def brand_image
image_tag(current_appearance.logo) if current_appearance&.logo?
end
def brand_text
markdown_field(current_appearance, :description)
end
def brand_new_project_guidelines
markdown_field(current_appearance, :new_project_guidelines)
end
def current_appearance
@appearance ||= Appearance.current
end
def brand_header_logo
if current_appearance&.header_logo?
image_tag current_appearance.header_logo
else
render 'shared/logo.svg'
end
end
# Skip the 'GitLab' type logo when custom brand logo is set
def brand_header_logo_type
unless current_appearance&.header_logo?
render 'shared/logo_type.svg'
end
end
end | 7 | 0.189189 | 6 | 1 |
52b59b389aa9e08428a372f4d5221cc6e32e71a1 | doc/http-api.rst | doc/http-api.rst | HTTP API
========
gravity
| HTTP API
========
For most use, the only HTTP endpoint that needs to be queried is `/users/<id>`.
It should be hit with `GET` and returns a JSON-encoded representation of the
given user's settings map.
| Add skeletal docs for the HTTP API | Add skeletal docs for the HTTP API
| reStructuredText | mit | prophile/jacquard,prophile/jacquard | restructuredtext | ## Code Before:
HTTP API
========
gravity
## Instruction:
Add skeletal docs for the HTTP API
## Code After:
HTTP API
========
For most use, the only HTTP endpoint that needs to be queried is `/users/<id>`.
It should be hit with `GET` and returns a JSON-encoded representation of the
given user's settings map.
| HTTP API
========
- gravity
-
+ For most use, the only HTTP endpoint that needs to be queried is `/users/<id>`.
+ It should be hit with `GET` and returns a JSON-encoded representation of the
+ given user's settings map. | 5 | 1 | 3 | 2 |
6bdee3155cc7d02874e7c8bc60f679452fe1040c | deploy.sh | deploy.sh |
set -e
ENVIRONMENT=$1
SIZES=$2
DESTINATION_BUCKET=""
if ($ENVIRONMENT === "master"); then
DESTINATION_BUCKET=$PRODUCTION_BUCKET
else
DESTINATION_BUCKET=$STAGING_BUCKET
fi
echo ""
echo "Installing awscli"
sudo pip install --upgrade awscli
echo ""
echo "Installing node-lambda"
npm install -g node-lambda
echo ""
echo "Preparing config.json"
cp _config.json config.json
sed -i "s/DESTINATION_BUCKET/$DESTINATION_BUCKET/g" config.json
sed -i "s/SIZES/$SIZES/g" config.json
echo ""
echo "Deploying to {$ENVIRONMENT}"
node-lambda deploy \
--description "Resize uploaded images to $SIZES on $DESTINATION_BUCKET" \
--environment "$ENVIRONMENT" \
--timeout 10 \
--accessKey "$AWS_KEY" \
--secretKey "$AWS_SECRET" \
--region us-east4 \
--functionName "${ENVIRONMENT}-resize-on-upload" \
--handler index.handler \
--role "$AWS_LAMBDA_ARN" \
--description "Creates resized copies of images on $DESTINATION_BUCKET when uploads occur"
|
set -e
ENVIRONMENT=$1
SIZES=$2
DESTINATION_BUCKET=""
if ($ENVIRONMENT === "master"); then
DESTINATION_BUCKET=$PRODUCTION_BUCKET
else
DESTINATION_BUCKET=$STAGING_BUCKET
fi
echo ""
echo "Preparing config.json"
cp _config.json config.json
sed -i "s/DESTINATION_BUCKET/$DESTINATION_BUCKET/g" config.json
sed -i "s/SIZES/$SIZES/g" config.json
echo ""
echo "Deploying to {$ENVIRONMENT}"
./node_modules/./bin/node-lambda deploy \
--description "Resize uploaded images to $SIZES on $DESTINATION_BUCKET" \
--environment "$ENVIRONMENT" \
--timeout 10 \
--accessKey "$AWS_KEY" \
--secretKey "$AWS_SECRET" \
--region "$AWS_REGION" \
--functionName "${ENVIRONMENT}-resize-on-upload" \
--handler index.handler \
--role "$AWS_LAMBDA_ARN" \
--description "Creates resized copies of images on $DESTINATION_BUCKET when uploads occur"
| Use local node-lambda. Use env region | Use local node-lambda. Use env region
| Shell | isc | 66pix/lambda-resize,66pix/lambda-resize | shell | ## Code Before:
set -e
ENVIRONMENT=$1
SIZES=$2
DESTINATION_BUCKET=""
if ($ENVIRONMENT === "master"); then
DESTINATION_BUCKET=$PRODUCTION_BUCKET
else
DESTINATION_BUCKET=$STAGING_BUCKET
fi
echo ""
echo "Installing awscli"
sudo pip install --upgrade awscli
echo ""
echo "Installing node-lambda"
npm install -g node-lambda
echo ""
echo "Preparing config.json"
cp _config.json config.json
sed -i "s/DESTINATION_BUCKET/$DESTINATION_BUCKET/g" config.json
sed -i "s/SIZES/$SIZES/g" config.json
echo ""
echo "Deploying to {$ENVIRONMENT}"
node-lambda deploy \
--description "Resize uploaded images to $SIZES on $DESTINATION_BUCKET" \
--environment "$ENVIRONMENT" \
--timeout 10 \
--accessKey "$AWS_KEY" \
--secretKey "$AWS_SECRET" \
--region us-east4 \
--functionName "${ENVIRONMENT}-resize-on-upload" \
--handler index.handler \
--role "$AWS_LAMBDA_ARN" \
--description "Creates resized copies of images on $DESTINATION_BUCKET when uploads occur"
## Instruction:
Use local node-lambda. Use env region
## Code After:
set -e
ENVIRONMENT=$1
SIZES=$2
DESTINATION_BUCKET=""
if ($ENVIRONMENT === "master"); then
DESTINATION_BUCKET=$PRODUCTION_BUCKET
else
DESTINATION_BUCKET=$STAGING_BUCKET
fi
echo ""
echo "Preparing config.json"
cp _config.json config.json
sed -i "s/DESTINATION_BUCKET/$DESTINATION_BUCKET/g" config.json
sed -i "s/SIZES/$SIZES/g" config.json
echo ""
echo "Deploying to {$ENVIRONMENT}"
./node_modules/./bin/node-lambda deploy \
--description "Resize uploaded images to $SIZES on $DESTINATION_BUCKET" \
--environment "$ENVIRONMENT" \
--timeout 10 \
--accessKey "$AWS_KEY" \
--secretKey "$AWS_SECRET" \
--region "$AWS_REGION" \
--functionName "${ENVIRONMENT}-resize-on-upload" \
--handler index.handler \
--role "$AWS_LAMBDA_ARN" \
--description "Creates resized copies of images on $DESTINATION_BUCKET when uploads occur"
|
set -e
ENVIRONMENT=$1
SIZES=$2
DESTINATION_BUCKET=""
if ($ENVIRONMENT === "master"); then
DESTINATION_BUCKET=$PRODUCTION_BUCKET
else
DESTINATION_BUCKET=$STAGING_BUCKET
fi
echo ""
- echo "Installing awscli"
- sudo pip install --upgrade awscli
-
- echo ""
- echo "Installing node-lambda"
- npm install -g node-lambda
-
- echo ""
echo "Preparing config.json"
cp _config.json config.json
sed -i "s/DESTINATION_BUCKET/$DESTINATION_BUCKET/g" config.json
sed -i "s/SIZES/$SIZES/g" config.json
echo ""
echo "Deploying to {$ENVIRONMENT}"
- node-lambda deploy \
+ ./node_modules/./bin/node-lambda deploy \
--description "Resize uploaded images to $SIZES on $DESTINATION_BUCKET" \
--environment "$ENVIRONMENT" \
--timeout 10 \
--accessKey "$AWS_KEY" \
--secretKey "$AWS_SECRET" \
- --region us-east4 \
+ --region "$AWS_REGION" \
--functionName "${ENVIRONMENT}-resize-on-upload" \
--handler index.handler \
--role "$AWS_LAMBDA_ARN" \
--description "Creates resized copies of images on $DESTINATION_BUCKET when uploads occur" | 12 | 0.3 | 2 | 10 |
2ba7ec1680f6462122a11f1748f04e1747d8d2e0 | tensorflow/core/platform/variant_coding.h | tensorflow/core/platform/variant_coding.h | /* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_PLATFORM_VARIANT_CODING_H_
#define TENSORFLOW_PLATFORM_VARIANT_CODING_H_
#include "tensorflow/core/framework/variant.h"
#ifdef PLATFORM_GOOGLE
#include "tensorflow/core/platform/google/variant_cord_coding.h"
#endif
namespace tensorflow {
namespace port {
// Encodes an array of Variant objects in to the given string.
// `variant_array` is assumed to point to an array of `n` Variant objects.
void EncodeVariantList(const Variant* variant_array, int64 n, string* out);
// Decodes an array of Variant objects from the given string.
// `variant_array` is assumed to point to an array of `n` Variant objects.
bool DecodeVariantList(const string& in, Variant* variant_array, int64 n);
} // end namespace port
} // end namespace tensorflow
#endif // TENSORFLOW_PLATFORM_VARIANT_CODING_H_
| /* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_PLATFORM_VARIANT_CODING_H_
#define TENSORFLOW_PLATFORM_VARIANT_CODING_H_
#include "tensorflow/core/framework/variant.h"
#include "tensorflow/core/framework/variant_encode_decode.h"
#ifdef PLATFORM_GOOGLE
#include "tensorflow/core/platform/google/variant_cord_coding.h"
#endif
namespace tensorflow {
namespace port {
// Encodes an array of Variant objects in to the given string.
// `variant_array` is assumed to point to an array of `n` Variant objects.
void EncodeVariantList(const Variant* variant_array, int64 n, string* out);
// Decodes an array of Variant objects from the given string.
// `variant_array` is assumed to point to an array of `n` Variant objects.
bool DecodeVariantList(const string& in, Variant* variant_array, int64 n);
} // end namespace port
} // end namespace tensorflow
#endif // TENSORFLOW_PLATFORM_VARIANT_CODING_H_
| Fix link time bug caused by missing header include. | Fix link time bug caused by missing header include.
PiperOrigin-RevId: 165952248
| C | apache-2.0 | aselle/tensorflow,manipopopo/tensorflow,ArtsiomCh/tensorflow,lukeiwanski/tensorflow,dongjoon-hyun/tensorflow,arborh/tensorflow,seanli9jan/tensorflow,Intel-Corporation/tensorflow,paolodedios/tensorflow,alsrgv/tensorflow,adamtiger/tensorflow,frreiss/tensorflow-fred,gunan/tensorflow,av8ramit/tensorflow,tensorflow/tensorflow-pywrap_saved_model,frreiss/tensorflow-fred,jhseu/tensorflow,gunan/tensorflow,Xeralux/tensorflow,aam-at/tensorflow,ppwwyyxx/tensorflow,freedomtan/tensorflow,Bismarrck/tensorflow,caisq/tensorflow,hfp/tensorflow-xsmm,benoitsteiner/tensorflow-opencl,theflofly/tensorflow,renyi533/tensorflow,aam-at/tensorflow,jostep/tensorflow,gunan/tensorflow,snnn/tensorflow,DavidNorman/tensorflow,JingJunYin/tensorflow,aldian/tensorflow,ZhangXinNan/tensorflow,alistairlow/tensorflow,jwlawson/tensorflow,dancingdan/tensorflow,codrut3/tensorflow,jalexvig/tensorflow,renyi533/tensorflow,eadgarchen/tensorflow,arborh/tensorflow,hsaputra/tensorflow,JingJunYin/tensorflow,nburn42/tensorflow,aam-at/tensorflow,gunan/tensorflow,Kongsea/tensorflow,ppwwyyxx/tensorflow,lukeiwanski/tensorflow,davidzchen/tensorflow,mdrumond/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,ArtsiomCh/tensorflow,manipopopo/tensorflow,paolodedios/tensorflow,arborh/tensorflow,hehongliang/tensorflow,xzturn/tensorflow,yanchen036/tensorflow,ppwwyyxx/tensorflow,codrut3/tensorflow,lakshayg/tensorflow,kobejean/tensorflow,cxxgtxy/tensorflow,Xeralux/tensorflow,ghchinoy/tensorflow,tensorflow/tensorflow,annarev/tensorflow,lukeiwanski/tensorflow,kobejean/tensorflow,adit-chandra/tensorflow,davidzchen/tensorflow,alsrgv/tensorflow,kobejean/tensorflow,jostep/tensorflow,horance-liu/tensorflow,aldian/tensorflow,aselle/tensorflow,guschmue/tensorflow,Kongsea/tensorflow,ppwwyyxx/tensorflow,gunan/tensorflow,jbedorf/tensorflow,davidzchen/tensorflow,laszlocsomor/tensorflow,apark263/tensorflow,xzturn/tensorflow,hehongliang/tensorflow,nburn42/tensorflow,Bismarrck/tensorflow,eaplatanios/tensorflow,jwlawson/tensorflow,frreiss/tensorflow-fred,av8ramit/tensorflow,petewarden/tensorflow,asimshankar/tensorflow,laszlocsomor/tensorflow,pavelchristof/gomoku-ai,DavidNorman/tensorflow,karllessard/tensorflow,gojira/tensorflow,tornadozou/tensorflow,pavelchristof/gomoku-ai,Intel-Corporation/tensorflow,jhseu/tensorflow,dancingdan/tensorflow,chemelnucfin/tensorflow,cxxgtxy/tensorflow,jwlawson/tensorflow,tensorflow/tensorflow,paolodedios/tensorflow,Mistobaan/tensorflow,theflofly/tensorflow,jostep/tensorflow,xzturn/tensorflow,yongtang/tensorflow,xodus7/tensorflow,DavidNorman/tensorflow,chemelnucfin/tensorflow,yongtang/tensorflow,drpngx/tensorflow,davidzchen/tensorflow,Intel-tensorflow/tensorflow,jalexvig/tensorflow,karllessard/tensorflow,petewarden/tensorflow,hsaputra/tensorflow,eaplatanios/tensorflow,with-git/tensorflow,theflofly/tensorflow,aselle/tensorflow,jhseu/tensorflow,chemelnucfin/tensorflow,jart/tensorflow,dongjoon-hyun/tensorflow,tillahoffmann/tensorflow,eaplatanios/tensorflow,gojira/tensorflow,ZhangXinNan/tensorflow,snnn/tensorflow,DavidNorman/tensorflow,asimshankar/tensorflow,ychfan/tensorflow,freedomtan/tensorflow,alsrgv/tensorflow,drpngx/tensorflow,dyoung418/tensorflow,sarvex/tensorflow,eadgarchen/tensorflow,ppwwyyxx/tensorflow,Mistobaan/tensorflow,girving/tensorflow,AnishShah/tensorflow,jendap/tensorflow,Bismarrck/tensorflow,apark263/tensorflow,xodus7/tensorflow,jendap/tensorflow,alivecor/tensorflow,eaplatanios/tensorflow,adamtiger/tensorflow,jbedorf/tensorflow,paolodedios/tensorflow,yongtang/tensorflow,kobejean/tensorflow,gunan/tensorflow,benoitsteiner/tensorflow-opencl,laszlocsomor/tensorflow,hehongliang/tensorflow,kevin-coder/tensorflow-fork,hfp/tensorflow-xsmm,dongjoon-hyun/tensorflow,girving/tensorflow,dongjoon-hyun/tensorflow,AnishShah/tensorflow,rabipanda/tensorflow,jalexvig/tensorflow,pavelchristof/gomoku-ai,pavelchristof/gomoku-ai,nburn42/tensorflow,pavelchristof/gomoku-ai,alistairlow/tensorflow,horance-liu/tensorflow,jart/tensorflow,annarev/tensorflow,gautam1858/tensorflow,renyi533/tensorflow,gojira/tensorflow,codrut3/tensorflow,xzturn/tensorflow,pavelchristof/gomoku-ai,renyi533/tensorflow,dancingdan/tensorflow,sarvex/tensorflow,dendisuhubdy/tensorflow,meteorcloudy/tensorflow,theflofly/tensorflow,Intel-Corporation/tensorflow,girving/tensorflow,allenlavoie/tensorflow,tornadozou/tensorflow,aselle/tensorflow,jbedorf/tensorflow,brchiu/tensorflow,dendisuhubdy/tensorflow,tensorflow/tensorflow-pywrap_saved_model,ghchinoy/tensorflow,karllessard/tensorflow,aam-at/tensorflow,dendisuhubdy/tensorflow,arborh/tensorflow,theflofly/tensorflow,tornadozou/tensorflow,aselle/tensorflow,davidzchen/tensorflow,bowang/tensorflow,tensorflow/tensorflow,allenlavoie/tensorflow,gojira/tensorflow,a-doumoulakis/tensorflow,dendisuhubdy/tensorflow,chemelnucfin/tensorflow,gojira/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,freedomtan/tensorflow,manipopopo/tensorflow,guschmue/tensorflow,tillahoffmann/tensorflow,nolanliou/tensorflow,jart/tensorflow,manipopopo/tensorflow,annarev/tensorflow,Mistobaan/tensorflow,gautam1858/tensorflow,freedomtan/tensorflow,ageron/tensorflow,snnn/tensorflow,ychfan/tensorflow,with-git/tensorflow,alshedivat/tensorflow,ghchinoy/tensorflow,xzturn/tensorflow,av8ramit/tensorflow,girving/tensorflow,dyoung418/tensorflow,a-doumoulakis/tensorflow,drpngx/tensorflow,annarev/tensorflow,tillahoffmann/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,xodus7/tensorflow,mdrumond/tensorflow,Bismarrck/tensorflow,meteorcloudy/tensorflow,freedomtan/tensorflow,yanchen036/tensorflow,Bismarrck/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,JingJunYin/tensorflow,arborh/tensorflow,tensorflow/tensorflow,nolanliou/tensorflow,ArtsiomCh/tensorflow,aam-at/tensorflow,ppwwyyxx/tensorflow,benoitsteiner/tensorflow-xsmm,Xeralux/tensorflow,jwlawson/tensorflow,JingJunYin/tensorflow,ArtsiomCh/tensorflow,benoitsteiner/tensorflow-xsmm,apark263/tensorflow,xzturn/tensorflow,benoitsteiner/tensorflow-opencl,ychfan/tensorflow,guschmue/tensorflow,nolanliou/tensorflow,jalexvig/tensorflow,manipopopo/tensorflow,petewarden/tensorflow,alshedivat/tensorflow,eaplatanios/tensorflow,davidzchen/tensorflow,dyoung418/tensorflow,karllessard/tensorflow,annarev/tensorflow,xodus7/tensorflow,tensorflow/tensorflow-pywrap_saved_model,davidzchen/tensorflow,horance-liu/tensorflow,arborh/tensorflow,AnishShah/tensorflow,gautam1858/tensorflow,cxxgtxy/tensorflow,aam-at/tensorflow,arborh/tensorflow,annarev/tensorflow,karllessard/tensorflow,alivecor/tensorflow,eadgarchen/tensorflow,tensorflow/tensorflow,with-git/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,freedomtan/tensorflow,jostep/tensorflow,ychfan/tensorflow,brchiu/tensorflow,karllessard/tensorflow,ravindrapanda/tensorflow,gautam1858/tensorflow,xodus7/tensorflow,yanchen036/tensorflow,adamtiger/tensorflow,freedomtan/tensorflow,ravindrapanda/tensorflow,eaplatanios/tensorflow,jendap/tensorflow,davidzchen/tensorflow,meteorcloudy/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,benoitsteiner/tensorflow-xsmm,tensorflow/tensorflow,meteorcloudy/tensorflow,Mistobaan/tensorflow,ZhangXinNan/tensorflow,xzturn/tensorflow,annarev/tensorflow,dongjoon-hyun/tensorflow,xzturn/tensorflow,renyi533/tensorflow,bowang/tensorflow,benoitsteiner/tensorflow-xsmm,Xeralux/tensorflow,rabipanda/tensorflow,lukeiwanski/tensorflow,kevin-coder/tensorflow-fork,benoitsteiner/tensorflow-opencl,alshedivat/tensorflow,seanli9jan/tensorflow,karllessard/tensorflow,jwlawson/tensorflow,ZhangXinNan/tensorflow,bowang/tensorflow,eaplatanios/tensorflow,benoitsteiner/tensorflow-xsmm,codrut3/tensorflow,nburn42/tensorflow,Kongsea/tensorflow,DavidNorman/tensorflow,zasdfgbnm/tensorflow,theflofly/tensorflow,jalexvig/tensorflow,rabipanda/tensorflow,kobejean/tensorflow,rabipanda/tensorflow,arborh/tensorflow,Bismarrck/tensorflow,jhseu/tensorflow,seanli9jan/tensorflow,av8ramit/tensorflow,dancingdan/tensorflow,adit-chandra/tensorflow,Mazecreator/tensorflow,kobejean/tensorflow,nburn42/tensorflow,dendisuhubdy/tensorflow,ppwwyyxx/tensorflow,meteorcloudy/tensorflow,ArtsiomCh/tensorflow,aam-at/tensorflow,jwlawson/tensorflow,freedomtan/tensorflow,aam-at/tensorflow,ageron/tensorflow,petewarden/tensorflow,girving/tensorflow,rabipanda/tensorflow,a-doumoulakis/tensorflow,yongtang/tensorflow,horance-liu/tensorflow,kevin-coder/tensorflow-fork,adit-chandra/tensorflow,chemelnucfin/tensorflow,alshedivat/tensorflow,drpngx/tensorflow,xzturn/tensorflow,gautam1858/tensorflow,Mazecreator/tensorflow,theflofly/tensorflow,nburn42/tensorflow,Mazecreator/tensorflow,Xeralux/tensorflow,benoitsteiner/tensorflow-opencl,nburn42/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,with-git/tensorflow,brchiu/tensorflow,allenlavoie/tensorflow,Xeralux/tensorflow,alsrgv/tensorflow,bowang/tensorflow,nolanliou/tensorflow,jostep/tensorflow,jendap/tensorflow,nburn42/tensorflow,jwlawson/tensorflow,gunan/tensorflow,apark263/tensorflow,ZhangXinNan/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow-pywrap_saved_model,hfp/tensorflow-xsmm,dendisuhubdy/tensorflow,alshedivat/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,ravindrapanda/tensorflow,adit-chandra/tensorflow,gunan/tensorflow,nolanliou/tensorflow,alistairlow/tensorflow,jbedorf/tensorflow,DavidNorman/tensorflow,lukeiwanski/tensorflow,zasdfgbnm/tensorflow,tensorflow/tensorflow,paolodedios/tensorflow,renyi533/tensorflow,dancingdan/tensorflow,av8ramit/tensorflow,zasdfgbnm/tensorflow,hsaputra/tensorflow,DavidNorman/tensorflow,ychfan/tensorflow,chemelnucfin/tensorflow,zasdfgbnm/tensorflow,ppwwyyxx/tensorflow,drpngx/tensorflow,yanchen036/tensorflow,jendap/tensorflow,tillahoffmann/tensorflow,yanchen036/tensorflow,JingJunYin/tensorflow,Mazecreator/tensorflow,rabipanda/tensorflow,frreiss/tensorflow-fred,gojira/tensorflow,yongtang/tensorflow,jalexvig/tensorflow,freedomtan/tensorflow,zasdfgbnm/tensorflow,alshedivat/tensorflow,manipopopo/tensorflow,caisq/tensorflow,cxxgtxy/tensorflow,Kongsea/tensorflow,ZhangXinNan/tensorflow,yongtang/tensorflow,brchiu/tensorflow,meteorcloudy/tensorflow,Bismarrck/tensorflow,av8ramit/tensorflow,ageron/tensorflow,eaplatanios/tensorflow,alsrgv/tensorflow,DavidNorman/tensorflow,jalexvig/tensorflow,zasdfgbnm/tensorflow,nolanliou/tensorflow,renyi533/tensorflow,gautam1858/tensorflow,xodus7/tensorflow,Kongsea/tensorflow,zasdfgbnm/tensorflow,Mistobaan/tensorflow,hehongliang/tensorflow,horance-liu/tensorflow,snnn/tensorflow,mdrumond/tensorflow,dyoung418/tensorflow,karllessard/tensorflow,ArtsiomCh/tensorflow,alistairlow/tensorflow,guschmue/tensorflow,theflofly/tensorflow,alshedivat/tensorflow,caisq/tensorflow,Intel-Corporation/tensorflow,Bismarrck/tensorflow,jendap/tensorflow,mdrumond/tensorflow,jhseu/tensorflow,aselle/tensorflow,davidzchen/tensorflow,hsaputra/tensorflow,meteorcloudy/tensorflow,frreiss/tensorflow-fred,davidzchen/tensorflow,paolodedios/tensorflow,paolodedios/tensorflow,alistairlow/tensorflow,meteorcloudy/tensorflow,seanli9jan/tensorflow,AnishShah/tensorflow,dancingdan/tensorflow,gojira/tensorflow,eadgarchen/tensorflow,Intel-tensorflow/tensorflow,petewarden/tensorflow,ageron/tensorflow,seanli9jan/tensorflow,asimshankar/tensorflow,ageron/tensorflow,mdrumond/tensorflow,nolanliou/tensorflow,alistairlow/tensorflow,renyi533/tensorflow,zasdfgbnm/tensorflow,horance-liu/tensorflow,ageron/tensorflow,alsrgv/tensorflow,allenlavoie/tensorflow,sarvex/tensorflow,jart/tensorflow,Intel-Corporation/tensorflow,jendap/tensorflow,lakshayg/tensorflow,hsaputra/tensorflow,dancingdan/tensorflow,tornadozou/tensorflow,lukeiwanski/tensorflow,tillahoffmann/tensorflow,alivecor/tensorflow,dancingdan/tensorflow,jart/tensorflow,brchiu/tensorflow,lukeiwanski/tensorflow,arborh/tensorflow,Intel-tensorflow/tensorflow,dongjoon-hyun/tensorflow,benoitsteiner/tensorflow-xsmm,ageron/tensorflow,drpngx/tensorflow,frreiss/tensorflow-fred,benoitsteiner/tensorflow-opencl,annarev/tensorflow,kevin-coder/tensorflow-fork,eadgarchen/tensorflow,horance-liu/tensorflow,adit-chandra/tensorflow,paolodedios/tensorflow,tornadozou/tensorflow,drpngx/tensorflow,tensorflow/tensorflow,petewarden/tensorflow,tillahoffmann/tensorflow,gunan/tensorflow,ghchinoy/tensorflow,Mazecreator/tensorflow,alshedivat/tensorflow,rabipanda/tensorflow,ZhangXinNan/tensorflow,aldian/tensorflow,eadgarchen/tensorflow,asimshankar/tensorflow,alivecor/tensorflow,Intel-Corporation/tensorflow,alivecor/tensorflow,jendap/tensorflow,guschmue/tensorflow,ghchinoy/tensorflow,adit-chandra/tensorflow,gojira/tensorflow,allenlavoie/tensorflow,renyi533/tensorflow,benoitsteiner/tensorflow-xsmm,ghchinoy/tensorflow,Mazecreator/tensorflow,eadgarchen/tensorflow,jalexvig/tensorflow,gunan/tensorflow,snnn/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Mistobaan/tensorflow,codrut3/tensorflow,dendisuhubdy/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,jhseu/tensorflow,gautam1858/tensorflow,eaplatanios/tensorflow,seanli9jan/tensorflow,eadgarchen/tensorflow,jwlawson/tensorflow,tensorflow/tensorflow,ravindrapanda/tensorflow,sarvex/tensorflow,tensorflow/tensorflow,bowang/tensorflow,Bismarrck/tensorflow,gojira/tensorflow,yongtang/tensorflow,mdrumond/tensorflow,Xeralux/tensorflow,ravindrapanda/tensorflow,alivecor/tensorflow,aldian/tensorflow,zasdfgbnm/tensorflow,kobejean/tensorflow,gautam1858/tensorflow,alshedivat/tensorflow,frreiss/tensorflow-fred,petewarden/tensorflow,with-git/tensorflow,laszlocsomor/tensorflow,benoitsteiner/tensorflow-opencl,jendap/tensorflow,jart/tensorflow,tensorflow/tensorflow-pywrap_saved_model,alshedivat/tensorflow,dongjoon-hyun/tensorflow,kevin-coder/tensorflow-fork,apark263/tensorflow,ghchinoy/tensorflow,JingJunYin/tensorflow,drpngx/tensorflow,adit-chandra/tensorflow,nolanliou/tensorflow,adamtiger/tensorflow,freedomtan/tensorflow,alsrgv/tensorflow,laszlocsomor/tensorflow,kobejean/tensorflow,theflofly/tensorflow,Kongsea/tensorflow,gautam1858/tensorflow,eadgarchen/tensorflow,lakshayg/tensorflow,petewarden/tensorflow,benoitsteiner/tensorflow-xsmm,alsrgv/tensorflow,AnishShah/tensorflow,dancingdan/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,caisq/tensorflow,gautam1858/tensorflow,ageron/tensorflow,Xeralux/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Mistobaan/tensorflow,brchiu/tensorflow,caisq/tensorflow,jwlawson/tensorflow,jwlawson/tensorflow,benoitsteiner/tensorflow-opencl,nburn42/tensorflow,lukeiwanski/tensorflow,hehongliang/tensorflow,Xeralux/tensorflow,karllessard/tensorflow,aldian/tensorflow,alsrgv/tensorflow,brchiu/tensorflow,chemelnucfin/tensorflow,allenlavoie/tensorflow,aselle/tensorflow,seanli9jan/tensorflow,karllessard/tensorflow,hfp/tensorflow-xsmm,ppwwyyxx/tensorflow,snnn/tensorflow,drpngx/tensorflow,av8ramit/tensorflow,frreiss/tensorflow-fred,cxxgtxy/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-pywrap_saved_model,asimshankar/tensorflow,girving/tensorflow,benoitsteiner/tensorflow-opencl,paolodedios/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,AnishShah/tensorflow,meteorcloudy/tensorflow,kevin-coder/tensorflow-fork,Kongsea/tensorflow,zasdfgbnm/tensorflow,allenlavoie/tensorflow,lukeiwanski/tensorflow,av8ramit/tensorflow,Mistobaan/tensorflow,ageron/tensorflow,hehongliang/tensorflow,caisq/tensorflow,meteorcloudy/tensorflow,girving/tensorflow,jostep/tensorflow,hfp/tensorflow-xsmm,dongjoon-hyun/tensorflow,kevin-coder/tensorflow-fork,DavidNorman/tensorflow,bowang/tensorflow,gunan/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Mazecreator/tensorflow,manipopopo/tensorflow,gautam1858/tensorflow,theflofly/tensorflow,jart/tensorflow,AnishShah/tensorflow,jhseu/tensorflow,jhseu/tensorflow,aselle/tensorflow,brchiu/tensorflow,adit-chandra/tensorflow,xodus7/tensorflow,caisq/tensorflow,dongjoon-hyun/tensorflow,sarvex/tensorflow,tensorflow/tensorflow-pywrap_saved_model,alistairlow/tensorflow,apark263/tensorflow,laszlocsomor/tensorflow,adamtiger/tensorflow,a-doumoulakis/tensorflow,jbedorf/tensorflow,sarvex/tensorflow,alistairlow/tensorflow,asimshankar/tensorflow,Intel-tensorflow/tensorflow,kevin-coder/tensorflow-fork,jostep/tensorflow,lukeiwanski/tensorflow,av8ramit/tensorflow,aselle/tensorflow,ZhangXinNan/tensorflow,DavidNorman/tensorflow,adit-chandra/tensorflow,seanli9jan/tensorflow,girving/tensorflow,petewarden/tensorflow,jbedorf/tensorflow,lakshayg/tensorflow,adit-chandra/tensorflow,apark263/tensorflow,cxxgtxy/tensorflow,Intel-tensorflow/tensorflow,Intel-tensorflow/tensorflow,ppwwyyxx/tensorflow,Xeralux/tensorflow,guschmue/tensorflow,gautam1858/tensorflow,ravindrapanda/tensorflow,zasdfgbnm/tensorflow,jbedorf/tensorflow,alivecor/tensorflow,kobejean/tensorflow,rabipanda/tensorflow,cxxgtxy/tensorflow,alsrgv/tensorflow,ravindrapanda/tensorflow,dyoung418/tensorflow,caisq/tensorflow,theflofly/tensorflow,dendisuhubdy/tensorflow,a-doumoulakis/tensorflow,hfp/tensorflow-xsmm,gojira/tensorflow,xodus7/tensorflow,davidzchen/tensorflow,hfp/tensorflow-xsmm,seanli9jan/tensorflow,seanli9jan/tensorflow,lakshayg/tensorflow,jalexvig/tensorflow,ghchinoy/tensorflow,frreiss/tensorflow-fred,DavidNorman/tensorflow,av8ramit/tensorflow,asimshankar/tensorflow,annarev/tensorflow,aselle/tensorflow,apark263/tensorflow,laszlocsomor/tensorflow,AnishShah/tensorflow,Mazecreator/tensorflow,pavelchristof/gomoku-ai,JingJunYin/tensorflow,hsaputra/tensorflow,alivecor/tensorflow,nburn42/tensorflow,chemelnucfin/tensorflow,chemelnucfin/tensorflow,benoitsteiner/tensorflow-xsmm,JingJunYin/tensorflow,ZhangXinNan/tensorflow,nolanliou/tensorflow,xodus7/tensorflow,mdrumond/tensorflow,xzturn/tensorflow,hsaputra/tensorflow,ArtsiomCh/tensorflow,frreiss/tensorflow-fred,alistairlow/tensorflow,seanli9jan/tensorflow,ppwwyyxx/tensorflow,jbedorf/tensorflow,horance-liu/tensorflow,annarev/tensorflow,jbedorf/tensorflow,dongjoon-hyun/tensorflow,manipopopo/tensorflow,jostep/tensorflow,paolodedios/tensorflow,ghchinoy/tensorflow,alistairlow/tensorflow,nburn42/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,benoitsteiner/tensorflow-xsmm,aldian/tensorflow,rabipanda/tensorflow,cxxgtxy/tensorflow,kevin-coder/tensorflow-fork,tensorflow/tensorflow-experimental_link_static_libraries_once,dancingdan/tensorflow,paolodedios/tensorflow,mdrumond/tensorflow,tornadozou/tensorflow,lakshayg/tensorflow,girving/tensorflow,jalexvig/tensorflow,chemelnucfin/tensorflow,hsaputra/tensorflow,gunan/tensorflow,ravindrapanda/tensorflow,jhseu/tensorflow,annarev/tensorflow,arborh/tensorflow,guschmue/tensorflow,JingJunYin/tensorflow,lakshayg/tensorflow,asimshankar/tensorflow,aam-at/tensorflow,Intel-tensorflow/tensorflow,snnn/tensorflow,dongjoon-hyun/tensorflow,codrut3/tensorflow,aldian/tensorflow,manipopopo/tensorflow,adit-chandra/tensorflow,dendisuhubdy/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,DavidNorman/tensorflow,laszlocsomor/tensorflow,gojira/tensorflow,hsaputra/tensorflow,ychfan/tensorflow,petewarden/tensorflow,girving/tensorflow,jhseu/tensorflow,yanchen036/tensorflow,allenlavoie/tensorflow,davidzchen/tensorflow,asimshankar/tensorflow,apark263/tensorflow,xzturn/tensorflow,brchiu/tensorflow,yongtang/tensorflow,jbedorf/tensorflow,dyoung418/tensorflow,codrut3/tensorflow,aldian/tensorflow,tensorflow/tensorflow,alsrgv/tensorflow,JingJunYin/tensorflow,codrut3/tensorflow,Bismarrck/tensorflow,tensorflow/tensorflow-pywrap_saved_model,eaplatanios/tensorflow,ravindrapanda/tensorflow,kevin-coder/tensorflow-fork,hfp/tensorflow-xsmm,tillahoffmann/tensorflow,ghchinoy/tensorflow,AnishShah/tensorflow,petewarden/tensorflow,ychfan/tensorflow,a-doumoulakis/tensorflow,jbedorf/tensorflow,Intel-tensorflow/tensorflow,Mistobaan/tensorflow,chemelnucfin/tensorflow,Xeralux/tensorflow,aselle/tensorflow,Bismarrck/tensorflow,asimshankar/tensorflow,bowang/tensorflow,yanchen036/tensorflow,manipopopo/tensorflow,karllessard/tensorflow,jbedorf/tensorflow,ychfan/tensorflow,Mistobaan/tensorflow,drpngx/tensorflow,allenlavoie/tensorflow,a-doumoulakis/tensorflow,allenlavoie/tensorflow,Mazecreator/tensorflow,aam-at/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,kobejean/tensorflow,jendap/tensorflow,renyi533/tensorflow,jendap/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_saved_model,kevin-coder/tensorflow-fork,with-git/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,jart/tensorflow,eaplatanios/tensorflow,AnishShah/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,alshedivat/tensorflow,caisq/tensorflow,bowang/tensorflow,allenlavoie/tensorflow,snnn/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,jart/tensorflow,sarvex/tensorflow,adamtiger/tensorflow,aam-at/tensorflow,ageron/tensorflow,tensorflow/tensorflow-pywrap_saved_model,ghchinoy/tensorflow,Mistobaan/tensorflow,xodus7/tensorflow,caisq/tensorflow,Kongsea/tensorflow,ArtsiomCh/tensorflow,benoitsteiner/tensorflow-xsmm,tornadozou/tensorflow,rabipanda/tensorflow,hsaputra/tensorflow,horance-liu/tensorflow,apark263/tensorflow,snnn/tensorflow,ghchinoy/tensorflow,tornadozou/tensorflow,horance-liu/tensorflow,ZhangXinNan/tensorflow,aam-at/tensorflow,guschmue/tensorflow,rabipanda/tensorflow,xzturn/tensorflow,hehongliang/tensorflow,dyoung418/tensorflow,jalexvig/tensorflow,renyi533/tensorflow,laszlocsomor/tensorflow,with-git/tensorflow,brchiu/tensorflow,Intel-tensorflow/tensorflow,kobejean/tensorflow,ageron/tensorflow,laszlocsomor/tensorflow,dyoung418/tensorflow,AnishShah/tensorflow,petewarden/tensorflow,manipopopo/tensorflow,hfp/tensorflow-xsmm,chemelnucfin/tensorflow,xodus7/tensorflow,av8ramit/tensorflow,a-doumoulakis/tensorflow,tillahoffmann/tensorflow,mdrumond/tensorflow,frreiss/tensorflow-fred,jart/tensorflow,nolanliou/tensorflow,ZhangXinNan/tensorflow,snnn/tensorflow,Intel-tensorflow/tensorflow,codrut3/tensorflow,yongtang/tensorflow,hfp/tensorflow-xsmm,Intel-Corporation/tensorflow,ychfan/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,dendisuhubdy/tensorflow,lakshayg/tensorflow,jhseu/tensorflow,guschmue/tensorflow,pavelchristof/gomoku-ai,arborh/tensorflow,theflofly/tensorflow,freedomtan/tensorflow,adamtiger/tensorflow,eadgarchen/tensorflow,jwlawson/tensorflow,Intel-tensorflow/tensorflow,freedomtan/tensorflow,asimshankar/tensorflow,yongtang/tensorflow,Intel-Corporation/tensorflow,girving/tensorflow,yanchen036/tensorflow,alsrgv/tensorflow,apark263/tensorflow,adit-chandra/tensorflow,with-git/tensorflow,arborh/tensorflow,brchiu/tensorflow,jhseu/tensorflow,renyi533/tensorflow,hfp/tensorflow-xsmm,guschmue/tensorflow,ageron/tensorflow,sarvex/tensorflow,snnn/tensorflow,codrut3/tensorflow,dancingdan/tensorflow,ppwwyyxx/tensorflow | c | ## Code Before:
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_PLATFORM_VARIANT_CODING_H_
#define TENSORFLOW_PLATFORM_VARIANT_CODING_H_
#include "tensorflow/core/framework/variant.h"
#ifdef PLATFORM_GOOGLE
#include "tensorflow/core/platform/google/variant_cord_coding.h"
#endif
namespace tensorflow {
namespace port {
// Encodes an array of Variant objects in to the given string.
// `variant_array` is assumed to point to an array of `n` Variant objects.
void EncodeVariantList(const Variant* variant_array, int64 n, string* out);
// Decodes an array of Variant objects from the given string.
// `variant_array` is assumed to point to an array of `n` Variant objects.
bool DecodeVariantList(const string& in, Variant* variant_array, int64 n);
} // end namespace port
} // end namespace tensorflow
#endif // TENSORFLOW_PLATFORM_VARIANT_CODING_H_
## Instruction:
Fix link time bug caused by missing header include.
PiperOrigin-RevId: 165952248
## Code After:
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_PLATFORM_VARIANT_CODING_H_
#define TENSORFLOW_PLATFORM_VARIANT_CODING_H_
#include "tensorflow/core/framework/variant.h"
#include "tensorflow/core/framework/variant_encode_decode.h"
#ifdef PLATFORM_GOOGLE
#include "tensorflow/core/platform/google/variant_cord_coding.h"
#endif
namespace tensorflow {
namespace port {
// Encodes an array of Variant objects in to the given string.
// `variant_array` is assumed to point to an array of `n` Variant objects.
void EncodeVariantList(const Variant* variant_array, int64 n, string* out);
// Decodes an array of Variant objects from the given string.
// `variant_array` is assumed to point to an array of `n` Variant objects.
bool DecodeVariantList(const string& in, Variant* variant_array, int64 n);
} // end namespace port
} // end namespace tensorflow
#endif // TENSORFLOW_PLATFORM_VARIANT_CODING_H_
| /* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_PLATFORM_VARIANT_CODING_H_
#define TENSORFLOW_PLATFORM_VARIANT_CODING_H_
#include "tensorflow/core/framework/variant.h"
+ #include "tensorflow/core/framework/variant_encode_decode.h"
#ifdef PLATFORM_GOOGLE
#include "tensorflow/core/platform/google/variant_cord_coding.h"
#endif
namespace tensorflow {
namespace port {
// Encodes an array of Variant objects in to the given string.
// `variant_array` is assumed to point to an array of `n` Variant objects.
void EncodeVariantList(const Variant* variant_array, int64 n, string* out);
// Decodes an array of Variant objects from the given string.
// `variant_array` is assumed to point to an array of `n` Variant objects.
bool DecodeVariantList(const string& in, Variant* variant_array, int64 n);
} // end namespace port
} // end namespace tensorflow
#endif // TENSORFLOW_PLATFORM_VARIANT_CODING_H_ | 1 | 0.025641 | 1 | 0 |
2ac1b35a944c6fd6ce3b1d2da3f47c76445aba8b | app/src/views/pages/Project.js | app/src/views/pages/Project.js | import React, { PropTypes } from 'react';
import { push } from 'react-router-redux';
import { connect } from 'react-redux';
import Project from './../components/Project'
import Button from './../components/Button';
const ProjectPage = ({project, editProjectLink}) => {
return (
<div>
<Project project={project} />
<Button onClick={editProjectLink} label="Add locale" />
</div>
);
};
ProjectPage.propTypes = {
project: PropTypes.object.isRequired,
editProjectLink: PropTypes.func.isRequired
};
const mockProject = {
id: 1,
locales: [
{ident: "en_US", language: "English", country: "USA"},
{ident: "de_DE", language: "German", country: "Germany"}
]
};
const mapStateToProps = (state) => {
return {
project: mockProject
};
};
const mapDispatchToProps = (dispatch, ownProps) => {
return {
editProjectLink: () => {
dispatch(push(`/projects/${ownProps.params.projectId}/locales/new`))
}
};
};
export default connect(mapStateToProps, mapDispatchToProps)(ProjectPage); | import React, { PropTypes } from 'react';
import { push } from 'react-router-redux';
import { connect } from 'react-redux';
import { projectActions } from './../../core/projects'
import Project from './../components/Project'
import Button from './../components/Button';
class ProjectPage extends React.Component {
componentDidMount() {
this.props.fetchProject();
}
static propTypes = {
project: PropTypes.object.isRequired,
editProjectLink: PropTypes.func.isRequired
};
render () {
if (!this.props.project) {
return (<h1>Empty</h1>);
}
return (
<div>
<Project project={this.props.project} />
<Button onClick={this.props.editProjectLink} label="Add locale" />
</div>
);
}
}
const mapStateToProps = (state, ownProps) => {
return {
project: state.projects.projects.find((element) => {
return element.id === ownProps.params.projectId;
})
};
};
const mapDispatchToProps = (dispatch, ownProps) => {
return {
editProjectLink: () => {
dispatch(push(`/projects/${ownProps.params.projectId}/locales/new`))
},
fetchProject: () => {
dispatch(projectActions.fetchProject(ownProps.params.projectId));
}
};
};
export default connect(mapStateToProps, mapDispatchToProps)(ProjectPage); | Add fetch project on mount | Add fetch project on mount
| JavaScript | mit | anthonynsimon/parrot,anthonynsimon/parrot,todes1/parrot,anthonynsimon/parrot,todes1/parrot,todes1/parrot,todes1/parrot,todes1/parrot,todes1/parrot,anthonynsimon/parrot,anthonynsimon/parrot,anthonynsimon/parrot | javascript | ## Code Before:
import React, { PropTypes } from 'react';
import { push } from 'react-router-redux';
import { connect } from 'react-redux';
import Project from './../components/Project'
import Button from './../components/Button';
const ProjectPage = ({project, editProjectLink}) => {
return (
<div>
<Project project={project} />
<Button onClick={editProjectLink} label="Add locale" />
</div>
);
};
ProjectPage.propTypes = {
project: PropTypes.object.isRequired,
editProjectLink: PropTypes.func.isRequired
};
const mockProject = {
id: 1,
locales: [
{ident: "en_US", language: "English", country: "USA"},
{ident: "de_DE", language: "German", country: "Germany"}
]
};
const mapStateToProps = (state) => {
return {
project: mockProject
};
};
const mapDispatchToProps = (dispatch, ownProps) => {
return {
editProjectLink: () => {
dispatch(push(`/projects/${ownProps.params.projectId}/locales/new`))
}
};
};
export default connect(mapStateToProps, mapDispatchToProps)(ProjectPage);
## Instruction:
Add fetch project on mount
## Code After:
import React, { PropTypes } from 'react';
import { push } from 'react-router-redux';
import { connect } from 'react-redux';
import { projectActions } from './../../core/projects'
import Project from './../components/Project'
import Button from './../components/Button';
class ProjectPage extends React.Component {
componentDidMount() {
this.props.fetchProject();
}
static propTypes = {
project: PropTypes.object.isRequired,
editProjectLink: PropTypes.func.isRequired
};
render () {
if (!this.props.project) {
return (<h1>Empty</h1>);
}
return (
<div>
<Project project={this.props.project} />
<Button onClick={this.props.editProjectLink} label="Add locale" />
</div>
);
}
}
const mapStateToProps = (state, ownProps) => {
return {
project: state.projects.projects.find((element) => {
return element.id === ownProps.params.projectId;
})
};
};
const mapDispatchToProps = (dispatch, ownProps) => {
return {
editProjectLink: () => {
dispatch(push(`/projects/${ownProps.params.projectId}/locales/new`))
},
fetchProject: () => {
dispatch(projectActions.fetchProject(ownProps.params.projectId));
}
};
};
export default connect(mapStateToProps, mapDispatchToProps)(ProjectPage); | import React, { PropTypes } from 'react';
import { push } from 'react-router-redux';
import { connect } from 'react-redux';
+ import { projectActions } from './../../core/projects'
import Project from './../components/Project'
import Button from './../components/Button';
+ class ProjectPage extends React.Component {
+ componentDidMount() {
+ this.props.fetchProject();
+ }
- const ProjectPage = ({project, editProjectLink}) => {
- return (
- <div>
- <Project project={project} />
- <Button onClick={editProjectLink} label="Add locale" />
- </div>
- );
- };
- ProjectPage.propTypes = {
+ static propTypes = {
- project: PropTypes.object.isRequired,
+ project: PropTypes.object.isRequired,
? ++++
- editProjectLink: PropTypes.func.isRequired
+ editProjectLink: PropTypes.func.isRequired
? ++++
- };
+ };
- const mockProject = {
- id: 1,
- locales: [
- {ident: "en_US", language: "English", country: "USA"},
- {ident: "de_DE", language: "German", country: "Germany"}
+ render () {
+ if (!this.props.project) {
+ return (<h1>Empty</h1>);
+ }
+ return (
+ <div>
+ <Project project={this.props.project} />
+ <Button onClick={this.props.editProjectLink} label="Add locale" />
+ </div>
+ );
- ]
? ^
+ }
? ^
- };
+ }
- const mapStateToProps = (state) => {
+ const mapStateToProps = (state, ownProps) => {
? ++++++++++
return {
- project: mockProject
+ project: state.projects.projects.find((element) => {
+ return element.id === ownProps.params.projectId;
+ })
};
};
const mapDispatchToProps = (dispatch, ownProps) => {
return {
editProjectLink: () => {
dispatch(push(`/projects/${ownProps.params.projectId}/locales/new`))
+ },
+ fetchProject: () => {
+ dispatch(projectActions.fetchProject(ownProps.params.projectId));
}
};
};
export default connect(mapStateToProps, mapDispatchToProps)(ProjectPage); | 49 | 1.139535 | 28 | 21 |
97f122541f97234236ae6d5758647186886e3b15 | README.md | README.md | voltage-divider-compute
=======================
Python script to display all possible voltage divider combinations that can be
used within the constraints fixed through specified parameters.
Usage
-----
In a terminal, on Linux, type the following commands to run the script:
```sh
git clone https://github.com/SyrianSpock/voltage-divider-compute.git
cd voltage-divider-compute
python2 vdiv.py
```
Parameters
----------
You will be asked to enter some parameter values:
* __Input voltage__ is the voltage at the input of the voltage divider in volts
* __Output voltage__ is the voltage wanted at the output in volts
* __Tolerated error__ is the error voltage tolerated on the output in volts
* __E serie__ specifies the E serie (e12, e24, e48, e96, e192) to choose, which defines the possible resistor values as well as their tolerance
* __Maximum current__ is the maximal current allowed through the divider in mA
Dependencies
------------
This script uses the `texttable` package.
License
-------
This script is released under the MIT License.
| voltage-divider-compute
=======================
Python script to display all possible voltage divider combinations that can be
used within the constraints fixed through specified parameters.
Usage
-----
In a terminal, on Linux, type the following commands to run the script for
example:
```sh
git clone https://github.com/SyrianSpock/voltage-divider-compute.git
cd voltage-divider-compute
python2 vdiv.py 3.3 1.8 -s e192 -e 0.01 -c 10 -l 10
```
In this example, the __input voltage__ is 3.3V, __output voltage__ is 1.8V.
Then we specify optional arguments: we want to use the e192 series, we tolerate
0.1V error on the __output voltage__, we want 10mA as __maximum current__ and
we only want the script to display 10 possible combinations.
For more details refer to the help menu:
```sh
python2 vdiv.py -h
```
Parameters
----------
You will be asked to enter some parameter values:
* __Input voltage__ is the voltage at the input of the voltage divider in volts
* __Output voltage__ is the voltage wanted at the output in volts
* __Tolerated error__ is the error voltage tolerated on the output in volts
* __E serie__ specifies the E serie (e12, e24, e48, e96, e192) to choose, which defines the possible resistor values as well as their tolerance
* __Maximum current__ is the maximal current allowed through the divider in mA
Dependencies
------------
This script uses the `texttable` package.
License
-------
This script is released under the MIT License.
| Update documentation to integrat arguments support | Update documentation to integrat arguments support
| Markdown | mit | SyrianSpock/voltage-divider-compute | markdown | ## Code Before:
voltage-divider-compute
=======================
Python script to display all possible voltage divider combinations that can be
used within the constraints fixed through specified parameters.
Usage
-----
In a terminal, on Linux, type the following commands to run the script:
```sh
git clone https://github.com/SyrianSpock/voltage-divider-compute.git
cd voltage-divider-compute
python2 vdiv.py
```
Parameters
----------
You will be asked to enter some parameter values:
* __Input voltage__ is the voltage at the input of the voltage divider in volts
* __Output voltage__ is the voltage wanted at the output in volts
* __Tolerated error__ is the error voltage tolerated on the output in volts
* __E serie__ specifies the E serie (e12, e24, e48, e96, e192) to choose, which defines the possible resistor values as well as their tolerance
* __Maximum current__ is the maximal current allowed through the divider in mA
Dependencies
------------
This script uses the `texttable` package.
License
-------
This script is released under the MIT License.
## Instruction:
Update documentation to integrat arguments support
## Code After:
voltage-divider-compute
=======================
Python script to display all possible voltage divider combinations that can be
used within the constraints fixed through specified parameters.
Usage
-----
In a terminal, on Linux, type the following commands to run the script for
example:
```sh
git clone https://github.com/SyrianSpock/voltage-divider-compute.git
cd voltage-divider-compute
python2 vdiv.py 3.3 1.8 -s e192 -e 0.01 -c 10 -l 10
```
In this example, the __input voltage__ is 3.3V, __output voltage__ is 1.8V.
Then we specify optional arguments: we want to use the e192 series, we tolerate
0.1V error on the __output voltage__, we want 10mA as __maximum current__ and
we only want the script to display 10 possible combinations.
For more details refer to the help menu:
```sh
python2 vdiv.py -h
```
Parameters
----------
You will be asked to enter some parameter values:
* __Input voltage__ is the voltage at the input of the voltage divider in volts
* __Output voltage__ is the voltage wanted at the output in volts
* __Tolerated error__ is the error voltage tolerated on the output in volts
* __E serie__ specifies the E serie (e12, e24, e48, e96, e192) to choose, which defines the possible resistor values as well as their tolerance
* __Maximum current__ is the maximal current allowed through the divider in mA
Dependencies
------------
This script uses the `texttable` package.
License
-------
This script is released under the MIT License.
| voltage-divider-compute
=======================
Python script to display all possible voltage divider combinations that can be
used within the constraints fixed through specified parameters.
Usage
-----
- In a terminal, on Linux, type the following commands to run the script:
? ^
+ In a terminal, on Linux, type the following commands to run the script for
? ^^^^
-
+ example:
```sh
git clone https://github.com/SyrianSpock/voltage-divider-compute.git
cd voltage-divider-compute
- python2 vdiv.py
+ python2 vdiv.py 3.3 1.8 -s e192 -e 0.01 -c 10 -l 10
```
+
+ In this example, the __input voltage__ is 3.3V, __output voltage__ is 1.8V.
+ Then we specify optional arguments: we want to use the e192 series, we tolerate
+ 0.1V error on the __output voltage__, we want 10mA as __maximum current__ and
+ we only want the script to display 10 possible combinations.
+
+ For more details refer to the help menu:
+ ```sh
+ python2 vdiv.py -h
+ ```
+
Parameters
----------
You will be asked to enter some parameter values:
* __Input voltage__ is the voltage at the input of the voltage divider in volts
* __Output voltage__ is the voltage wanted at the output in volts
* __Tolerated error__ is the error voltage tolerated on the output in volts
* __E serie__ specifies the E serie (e12, e24, e48, e96, e192) to choose, which defines the possible resistor values as well as their tolerance
* __Maximum current__ is the maximal current allowed through the divider in mA
Dependencies
------------
This script uses the `texttable` package.
License
-------
This script is released under the MIT License. | 17 | 0.472222 | 14 | 3 |
a39ad7a9481e7bc59ad1425536458479118fd1cd | src/server.js | src/server.js | import express from 'express';
import LEX from 'letsencrypt-express';
import configureHelmet from './security/configure-helmet';
import database from './database';
import log from './log';
import requestLogger from './log/request-logger';
import userRoutes from './routes/users';
import postRoutes from './routes/posts';
import notFoundRoute from './routes/not-found';
database.sync()
.then(() => {
const app = express();
configureHelmet(app);
app.use(requestLogger);
app.use('/v2.0/users', userRoutes);
app.use('/v2.0/posts', postRoutes);
app.use(notFoundRoute);
const port = process.env.PORT;
const lex = LEX.create({
approveRegistration: (hostname, callback) => {
callback(null, {
domains: [hostname],
email: process.env.CSBLOGS_LETS_ENCRYPT_EMAIL_ADDRESS,
agreeTos: true
});
}
});
lex.onRequest = app;
lex.listen([], [port], function onListen() {
const protocol = ('requestCert' in this) ? 'https' : 'http';
const address = this.address();
log.info({
address: `${protocol}://${address.address === '::' ? 'localhost' : address.address}:${address.port}`
}, 'CSBlogs API Server now running');
});
});
| import express from 'express';
import LEX from 'letsencrypt-express';
import configureHelmet from './security/configure-helmet';
import database from './database';
import log from './log';
import requestLogger from './log/request-logger';
import userRoutes from './routes/users';
import postRoutes from './routes/posts';
import notFoundRoute from './routes/not-found';
database.sync()
.then(() => {
const app = express();
configureHelmet(app);
app.use(requestLogger);
app.use('/v2.0/users', userRoutes);
app.use('/v2.0/posts', postRoutes);
app.use(notFoundRoute);
const lex = LEX.create({
approveRegistration: (hostname, callback) => {
callback(null, {
domains: [hostname],
email: process.env.CSBLOGS_LETS_ENCRYPT_EMAIL_ADDRESS,
agreeTos: true
});
}
});
const port = process.env.PORT;
lex.onRequest = app;
lex.listen([], [port], function onListen() {
const protocol = ('requestCert' in this) ? 'https' : 'http';
const address = this.address();
log.info({
address: `${protocol}://${address.address === '::' ? 'localhost' : address.address}:${address.port}`
}, 'CSBlogs API Server now running');
});
});
| Reduce variable lifespan of port | Reduce variable lifespan of port
| JavaScript | mit | csblogs/api-server,csblogs/api-server | javascript | ## Code Before:
import express from 'express';
import LEX from 'letsencrypt-express';
import configureHelmet from './security/configure-helmet';
import database from './database';
import log from './log';
import requestLogger from './log/request-logger';
import userRoutes from './routes/users';
import postRoutes from './routes/posts';
import notFoundRoute from './routes/not-found';
database.sync()
.then(() => {
const app = express();
configureHelmet(app);
app.use(requestLogger);
app.use('/v2.0/users', userRoutes);
app.use('/v2.0/posts', postRoutes);
app.use(notFoundRoute);
const port = process.env.PORT;
const lex = LEX.create({
approveRegistration: (hostname, callback) => {
callback(null, {
domains: [hostname],
email: process.env.CSBLOGS_LETS_ENCRYPT_EMAIL_ADDRESS,
agreeTos: true
});
}
});
lex.onRequest = app;
lex.listen([], [port], function onListen() {
const protocol = ('requestCert' in this) ? 'https' : 'http';
const address = this.address();
log.info({
address: `${protocol}://${address.address === '::' ? 'localhost' : address.address}:${address.port}`
}, 'CSBlogs API Server now running');
});
});
## Instruction:
Reduce variable lifespan of port
## Code After:
import express from 'express';
import LEX from 'letsencrypt-express';
import configureHelmet from './security/configure-helmet';
import database from './database';
import log from './log';
import requestLogger from './log/request-logger';
import userRoutes from './routes/users';
import postRoutes from './routes/posts';
import notFoundRoute from './routes/not-found';
database.sync()
.then(() => {
const app = express();
configureHelmet(app);
app.use(requestLogger);
app.use('/v2.0/users', userRoutes);
app.use('/v2.0/posts', postRoutes);
app.use(notFoundRoute);
const lex = LEX.create({
approveRegistration: (hostname, callback) => {
callback(null, {
domains: [hostname],
email: process.env.CSBLOGS_LETS_ENCRYPT_EMAIL_ADDRESS,
agreeTos: true
});
}
});
const port = process.env.PORT;
lex.onRequest = app;
lex.listen([], [port], function onListen() {
const protocol = ('requestCert' in this) ? 'https' : 'http';
const address = this.address();
log.info({
address: `${protocol}://${address.address === '::' ? 'localhost' : address.address}:${address.port}`
}, 'CSBlogs API Server now running');
});
});
| import express from 'express';
import LEX from 'letsencrypt-express';
import configureHelmet from './security/configure-helmet';
import database from './database';
import log from './log';
import requestLogger from './log/request-logger';
import userRoutes from './routes/users';
import postRoutes from './routes/posts';
import notFoundRoute from './routes/not-found';
database.sync()
.then(() => {
const app = express();
configureHelmet(app);
app.use(requestLogger);
app.use('/v2.0/users', userRoutes);
app.use('/v2.0/posts', postRoutes);
app.use(notFoundRoute);
- const port = process.env.PORT;
-
const lex = LEX.create({
approveRegistration: (hostname, callback) => {
callback(null, {
domains: [hostname],
email: process.env.CSBLOGS_LETS_ENCRYPT_EMAIL_ADDRESS,
agreeTos: true
});
}
});
+ const port = process.env.PORT;
+
lex.onRequest = app;
lex.listen([], [port], function onListen() {
const protocol = ('requestCert' in this) ? 'https' : 'http';
const address = this.address();
log.info({
address: `${protocol}://${address.address === '::' ? 'localhost' : address.address}:${address.port}`
}, 'CSBlogs API Server now running');
});
}); | 4 | 0.095238 | 2 | 2 |
94da1848ceddbb94f5854b7b0d1f5c4da72bf5ff | app/scripts/_modules/error-tracking.js | app/scripts/_modules/error-tracking.js | /* global ga */
var errorTracking = (function() {
'use strict';
// http://blog.gospodarets.com/track_javascript_angularjs_and_jquery_errors_with_google_analytics/
var _sendErrorsToGoogleAnalytics = function () {
window.addEventListener('error', function (err) {
var ie = window.event || {};
var errorMessage = err.message || ie.errorMessage;
var errorFilename = err.filename || ie.errorUrl;
var errorLineNumber = ', Line: ' + (err.lineno || ie.errorLine);
var errorColumnNumber = ', Column: ' + (err.colno || 'undefined'); // print undefined as a string if it doesn’t exist
var userAgent = ', User Agent: ' + navigator.userAgent;
var platform = ', Platform: ' + navigator.platform;
ga('send', 'event', 'JavaScript Errors', errorMessage, errorFilename + errorLineNumber + errorColumnNumber + userAgent + platform, 0, true);
});
};
var init = function () {
_sendErrorsToGoogleAnalytics();
};
return {
init: init
};
}()); | /* global ga */
var errorTracking = (function() {
'use strict';
// http://blog.gospodarets.com/track_javascript_angularjs_and_jquery_errors_with_google_analytics/
var _sendErrorsToGoogleAnalytics = function () {
window.addEventListener('error', function (err) {
var ie = window.event || {};
var errorMessage = err.message || ie.errorMessage;
var errorFilename = err.filename || ie.errorUrl;
var errorLineNumber = ', Line: ' + (err.lineno || ie.errorLine);
var errorColumnNumber = ', Column: ' + (err.colno || 'undefined'); // print undefined as a string if it doesn’t exist
var userAgent = ', User Agent: ' + navigator.userAgent;
ga('send', 'event', 'JavaScript Errors', errorMessage, errorFilename + errorLineNumber + errorColumnNumber + userAgent, 0, true);
});
};
var init = function () {
_sendErrorsToGoogleAnalytics();
};
return {
init: init
};
}()); | Remove the navigator.platform info from my poor man’s error tracking script. | Remove the navigator.platform info from my poor man’s error tracking script.
| JavaScript | mit | davidensinger/webworke.rs,davidensinger/webworke.rs,davidensinger/webworke.rs | javascript | ## Code Before:
/* global ga */
var errorTracking = (function() {
'use strict';
// http://blog.gospodarets.com/track_javascript_angularjs_and_jquery_errors_with_google_analytics/
var _sendErrorsToGoogleAnalytics = function () {
window.addEventListener('error', function (err) {
var ie = window.event || {};
var errorMessage = err.message || ie.errorMessage;
var errorFilename = err.filename || ie.errorUrl;
var errorLineNumber = ', Line: ' + (err.lineno || ie.errorLine);
var errorColumnNumber = ', Column: ' + (err.colno || 'undefined'); // print undefined as a string if it doesn’t exist
var userAgent = ', User Agent: ' + navigator.userAgent;
var platform = ', Platform: ' + navigator.platform;
ga('send', 'event', 'JavaScript Errors', errorMessage, errorFilename + errorLineNumber + errorColumnNumber + userAgent + platform, 0, true);
});
};
var init = function () {
_sendErrorsToGoogleAnalytics();
};
return {
init: init
};
}());
## Instruction:
Remove the navigator.platform info from my poor man’s error tracking script.
## Code After:
/* global ga */
var errorTracking = (function() {
'use strict';
// http://blog.gospodarets.com/track_javascript_angularjs_and_jquery_errors_with_google_analytics/
var _sendErrorsToGoogleAnalytics = function () {
window.addEventListener('error', function (err) {
var ie = window.event || {};
var errorMessage = err.message || ie.errorMessage;
var errorFilename = err.filename || ie.errorUrl;
var errorLineNumber = ', Line: ' + (err.lineno || ie.errorLine);
var errorColumnNumber = ', Column: ' + (err.colno || 'undefined'); // print undefined as a string if it doesn’t exist
var userAgent = ', User Agent: ' + navigator.userAgent;
ga('send', 'event', 'JavaScript Errors', errorMessage, errorFilename + errorLineNumber + errorColumnNumber + userAgent, 0, true);
});
};
var init = function () {
_sendErrorsToGoogleAnalytics();
};
return {
init: init
};
}()); | /* global ga */
var errorTracking = (function() {
'use strict';
// http://blog.gospodarets.com/track_javascript_angularjs_and_jquery_errors_with_google_analytics/
var _sendErrorsToGoogleAnalytics = function () {
window.addEventListener('error', function (err) {
var ie = window.event || {};
var errorMessage = err.message || ie.errorMessage;
var errorFilename = err.filename || ie.errorUrl;
var errorLineNumber = ', Line: ' + (err.lineno || ie.errorLine);
var errorColumnNumber = ', Column: ' + (err.colno || 'undefined'); // print undefined as a string if it doesn’t exist
var userAgent = ', User Agent: ' + navigator.userAgent;
- var platform = ', Platform: ' + navigator.platform;
- ga('send', 'event', 'JavaScript Errors', errorMessage, errorFilename + errorLineNumber + errorColumnNumber + userAgent + platform, 0, true);
? -----------
+ ga('send', 'event', 'JavaScript Errors', errorMessage, errorFilename + errorLineNumber + errorColumnNumber + userAgent, 0, true);
});
};
var init = function () {
_sendErrorsToGoogleAnalytics();
};
return {
init: init
};
}()); | 3 | 0.096774 | 1 | 2 |
69479071c4eb9da5b88aea5704ae994db31a50d1 | t/pod/why.t | t/pod/why.t | use Test;
plan 6;
#= simple case
class Simple {
}
is Simple.WHY, 'simple case';
#= giraffe
class Outer {
#= zebra
class Inner {
}
}
is Outer.WHY, 'giraffe';
is Outer::Inner.WHY, 'zebra';
#= a module
module foo {
#= a package
package bar {
#= and a class
class baz {
}
}
}
# XXX Those should be proper .WHY's, once it's implemented
is foo.HOW.docs, 'a module';
is foo::bar.HOW.docs, 'a package';
is foo::bar::baz.WHY, 'and a class';
| use Test;
plan 6;
#= simple case
class Simple {
}
is Simple.WHY, 'simple case';
#= giraffe
class Outer {
#= zebra
class Inner {
}
}
is Outer.WHY, 'giraffe';
is Outer::Inner.WHY, 'zebra';
#= a module
module foo {
#= a package
package bar {
#= and a class
class baz {
}
}
}
is foo.WHY, 'a module';
is foo::bar.WHY, 'a package';
is foo::bar::baz.WHY, 'and a class';
| Use .WHY on packages and modules properly, jnthn++ | Use .WHY on packages and modules properly, jnthn++
| Perl | artistic-2.0 | paultcochrane/rakudo,ugexe/rakudo,retupmoca/rakudo,b2gills/rakudo,raydiak/rakudo,cygx/rakudo,Gnouc/rakudo,teodozjan/rakudo,sergot/rakudo,zhuomingliang/rakudo,dankogai/rakudo,lucasbuchala/rakudo,tony-o/deb-rakudodaily,paultcochrane/rakudo,cognominal/rakudo,sergot/rakudo,lucasbuchala/rakudo,teodozjan/rakudo,azawawi/rakudo,sjn/rakudo,ungrim97/rakudo,b2gills/rakudo,rjbs/rakudo,b2gills/rakudo,raydiak/rakudo,softmoth/rakudo,Leont/rakudo,zhuomingliang/rakudo,tony-o/rakudo,MasterDuke17/rakudo,salortiz/rakudo,lucasbuchala/rakudo,sergot/rakudo,tbrowder/rakudo,MasterDuke17/rakudo,labster/rakudo,zhuomingliang/rakudo,samcv/rakudo,samcv/rakudo,jonathanstowe/rakudo,paultcochrane/rakudo,MasterDuke17/rakudo,tony-o/deb-rakudodaily,paultcochrane/rakudo,labster/rakudo,zostay/rakudo,rakudo/rakudo,awwaiid/rakudo,lucasbuchala/rakudo,MasterDuke17/rakudo,nbrown/rakudo,salortiz/rakudo,cognominal/rakudo,Leont/rakudo,azawawi/rakudo,cygx/rakudo,jonathanstowe/rakudo,awwaiid/rakudo,sjn/rakudo,MasterDuke17/rakudo,tony-o/rakudo,ungrim97/rakudo,pmurias/rakudo,Leont/rakudo,tbrowder/rakudo,ab5tract/rakudo,ab5tract/rakudo,salortiz/rakudo,teodozjan/rakudo,ungrim97/rakudo,nbrown/rakudo,sergot/rakudo,laben/rakudo,rakudo/rakudo,azawawi/rakudo,azawawi/rakudo,tbrowder/rakudo,zostay/rakudo,samcv/rakudo,tony-o/rakudo,tbrowder/rakudo,raydiak/rakudo,softmoth/rakudo,azawawi/rakudo,salortiz/rakudo,ungrim97/rakudo,rakudo/rakudo,LLFourn/rakudo,dwarring/rakudo,tony-o/rakudo,dankogai/rakudo,tony-o/rakudo,Gnouc/rakudo,softmoth/rakudo,dwarring/rakudo,jonathanstowe/rakudo,usev6/rakudo,zhuomingliang/rakudo,tony-o/rakudo,rjbs/rakudo,cygx/rakudo,ugexe/rakudo,ugexe/rakudo,softmoth/rakudo,dwarring/rakudo,cognominal/rakudo,cognominal/rakudo,tbrowder/rakudo,cognominal/rakudo,ugexe/rakudo,skids/rakudo,laben/rakudo,salortiz/rakudo,cygx/rakudo,niner/rakudo,nunorc/rakudo,dankogai/rakudo,skids/rakudo,MasterDuke17/rakudo,samcv/rakudo,tony-o/deb-rakudodaily,laben/rakudo,Gnouc/rakudo,jonathanstowe/rakudo,sjn/rakudo,nbrown/rakudo,labster/rakudo,nbrown/rakudo,nbrown/rakudo,rjbs/rakudo,niner/rakudo,ab5tract/rakudo,labster/rakudo,softmoth/rakudo,retupmoca/rakudo,samcv/rakudo,Gnouc/rakudo,skids/rakudo,pmurias/rakudo,LLFourn/rakudo,tbrowder/rakudo,tony-o/deb-rakudodaily,Gnouc/rakudo,jonathanstowe/rakudo,retupmoca/rakudo,lucasbuchala/rakudo,sjn/rakudo,nbrown/rakudo,cygx/rakudo,skids/rakudo,ugexe/rakudo,niner/rakudo,LLFourn/rakudo,rakudo/rakudo,nunorc/rakudo,teodozjan/rakudo,awwaiid/rakudo,tony-o/deb-rakudodaily,retupmoca/rakudo,tony-o/deb-rakudodaily,usev6/rakudo,b2gills/rakudo,ungrim97/rakudo,sjn/rakudo,LLFourn/rakudo,usev6/rakudo,rakudo/rakudo,raydiak/rakudo,pmurias/rakudo,skids/rakudo,awwaiid/rakudo,laben/rakudo,labster/rakudo,ab5tract/rakudo,salortiz/rakudo,niner/rakudo,ab5tract/rakudo,rakudo/rakudo,b2gills/rakudo,nunorc/rakudo,paultcochrane/rakudo,awwaiid/rakudo,nunorc/rakudo,dwarring/rakudo,usev6/rakudo,dankogai/rakudo,tony-o/deb-rakudodaily,zostay/rakudo,LLFourn/rakudo,usev6/rakudo,Leont/rakudo,zostay/rakudo,Gnouc/rakudo,dankogai/rakudo,labster/rakudo,pmurias/rakudo | perl | ## Code Before:
use Test;
plan 6;
#= simple case
class Simple {
}
is Simple.WHY, 'simple case';
#= giraffe
class Outer {
#= zebra
class Inner {
}
}
is Outer.WHY, 'giraffe';
is Outer::Inner.WHY, 'zebra';
#= a module
module foo {
#= a package
package bar {
#= and a class
class baz {
}
}
}
# XXX Those should be proper .WHY's, once it's implemented
is foo.HOW.docs, 'a module';
is foo::bar.HOW.docs, 'a package';
is foo::bar::baz.WHY, 'and a class';
## Instruction:
Use .WHY on packages and modules properly, jnthn++
## Code After:
use Test;
plan 6;
#= simple case
class Simple {
}
is Simple.WHY, 'simple case';
#= giraffe
class Outer {
#= zebra
class Inner {
}
}
is Outer.WHY, 'giraffe';
is Outer::Inner.WHY, 'zebra';
#= a module
module foo {
#= a package
package bar {
#= and a class
class baz {
}
}
}
is foo.WHY, 'a module';
is foo::bar.WHY, 'a package';
is foo::bar::baz.WHY, 'and a class';
| use Test;
plan 6;
#= simple case
class Simple {
}
is Simple.WHY, 'simple case';
#= giraffe
class Outer {
#= zebra
class Inner {
}
}
is Outer.WHY, 'giraffe';
is Outer::Inner.WHY, 'zebra';
#= a module
module foo {
#= a package
package bar {
#= and a class
class baz {
}
}
}
- # XXX Those should be proper .WHY's, once it's implemented
- is foo.HOW.docs, 'a module';
? ^^^^^^^
+ is foo.WHY, 'a module';
? + ^ +++++
- is foo::bar.HOW.docs, 'a package';
? ^^^^^^^
+ is foo::bar.WHY, 'a package';
? + ^ +++++
is foo::bar::baz.WHY, 'and a class'; | 5 | 0.151515 | 2 | 3 |
e0190a5695c94e4bb77a31e9783058d6dd6b5ff6 | test/unit/be/cytomine/security/UserTests.groovy | test/unit/be/cytomine/security/UserTests.groovy | package be.cytomine.security
import grails.test.*
class UserTests extends GrailsUnitTestCase {
protected void setUp() {
super.setUp()
}
protected void tearDown() {
super.tearDown()
}
void testSomething() {
}
}
| package be.cytomine.security
import grails.test.*
class UserTests extends GrailsUnitTestCase {
protected void setUp() {
super.setUp()
}
protected void tearDown() {
super.tearDown()
}
void testSomething() {
}
void testValidEmail() {
mockDomain(User)
def today = new Date()
def user = new User(firstname:"John",lastname:"Doe",email:"johndoe@site.com", dateCreated:today,authority:"toto",password:"toto",username:"toto")
println user.errors.firstname
println user.errors.lastname
println user.errors.email
println user.errors.dateCreated
println user.errors.authority
if(user.validate()) {
println "ok"
}
else {
println "nok"
user.errors.allErrors.each {
println it
}
}
assertFalse 'validation should be OK', user.validate()
}
}
| Test with Bamboo and a failed test | Test with Bamboo and a failed test
| Groovy | apache-2.0 | cytomine/Cytomine-core,cytomine/Cytomine-core,charybdeBE/Cytomine-core,charybdeBE/Cytomine-core,charybdeBE/Cytomine-core,cytomine/Cytomine-core,cytomine/Cytomine-core,charybdeBE/Cytomine-core,charybdeBE/Cytomine-core,charybdeBE/Cytomine-core,charybdeBE/Cytomine-core,cytomine/Cytomine-core,charybdeBE/Cytomine-core,charybdeBE/Cytomine-core,charybdeBE/Cytomine-core,cytomine/Cytomine-core | groovy | ## Code Before:
package be.cytomine.security
import grails.test.*
class UserTests extends GrailsUnitTestCase {
protected void setUp() {
super.setUp()
}
protected void tearDown() {
super.tearDown()
}
void testSomething() {
}
}
## Instruction:
Test with Bamboo and a failed test
## Code After:
package be.cytomine.security
import grails.test.*
class UserTests extends GrailsUnitTestCase {
protected void setUp() {
super.setUp()
}
protected void tearDown() {
super.tearDown()
}
void testSomething() {
}
void testValidEmail() {
mockDomain(User)
def today = new Date()
def user = new User(firstname:"John",lastname:"Doe",email:"johndoe@site.com", dateCreated:today,authority:"toto",password:"toto",username:"toto")
println user.errors.firstname
println user.errors.lastname
println user.errors.email
println user.errors.dateCreated
println user.errors.authority
if(user.validate()) {
println "ok"
}
else {
println "nok"
user.errors.allErrors.each {
println it
}
}
assertFalse 'validation should be OK', user.validate()
}
}
| package be.cytomine.security
import grails.test.*
class UserTests extends GrailsUnitTestCase {
protected void setUp() {
super.setUp()
}
protected void tearDown() {
super.tearDown()
}
void testSomething() {
}
+
+ void testValidEmail() {
+ mockDomain(User)
+ def today = new Date()
+ def user = new User(firstname:"John",lastname:"Doe",email:"johndoe@site.com", dateCreated:today,authority:"toto",password:"toto",username:"toto")
+ println user.errors.firstname
+ println user.errors.lastname
+ println user.errors.email
+ println user.errors.dateCreated
+ println user.errors.authority
+
+ if(user.validate()) {
+ println "ok"
+ }
+ else {
+ println "nok"
+ user.errors.allErrors.each {
+ println it
+ }
+ }
+
+ assertFalse 'validation should be OK', user.validate()
+ }
+
} | 24 | 1.411765 | 24 | 0 |
4bb58ec4cde6c903da862e1c3c68007594a7d462 | .travis.yml | .travis.yml | language: java
dist: trusty
addons:
sonarcloud:
organization: "apache"
jobs:
include:
- name: "Java 8"
jdk: openjdk8
script: mvn clean verify install sonar:sonar -Dsonar.organization=apache -Dsonar.projectKey=apache_incubator-tamaya -Dsonar.host.url="https://sonarcloud.io" -Dsonar.login="$SONAR_TOKEN"
- name: "Java 9"
jdk: openjdk9
script: mvn clean verify install
- name: "Java 10"
jdk: openjdk10
script: mvn clean verify install
- name: "Java 11"
jdk: openjdk11
script: mvn clean verify install
| language: java
dist: trusty
addons:
sonarcloud:
organization: "apache"
jobs:
include:
- name: "Java 8"
jdk: openjdk8
script: mvn clean install sonar:sonar -Dsonar.organization=apache -Dsonar.projectKey=apache_incubator-tamaya -Dsonar.host.url="https://sonarcloud.io" -Dsonar.login="$SONAR_TOKEN"
- name: "Java 9"
jdk: openjdk9
script: mvn clean install
- name: "Java 10"
jdk: openjdk10
script: mvn clean install
- name: "Java 11"
jdk: openjdk11
script: mvn clean install
| Remove verify and do an install only | TAMAYA-277: Remove verify and do an install only
| YAML | apache-2.0 | apache/incubator-tamaya,apache/incubator-tamaya,apache/incubator-tamaya | yaml | ## Code Before:
language: java
dist: trusty
addons:
sonarcloud:
organization: "apache"
jobs:
include:
- name: "Java 8"
jdk: openjdk8
script: mvn clean verify install sonar:sonar -Dsonar.organization=apache -Dsonar.projectKey=apache_incubator-tamaya -Dsonar.host.url="https://sonarcloud.io" -Dsonar.login="$SONAR_TOKEN"
- name: "Java 9"
jdk: openjdk9
script: mvn clean verify install
- name: "Java 10"
jdk: openjdk10
script: mvn clean verify install
- name: "Java 11"
jdk: openjdk11
script: mvn clean verify install
## Instruction:
TAMAYA-277: Remove verify and do an install only
## Code After:
language: java
dist: trusty
addons:
sonarcloud:
organization: "apache"
jobs:
include:
- name: "Java 8"
jdk: openjdk8
script: mvn clean install sonar:sonar -Dsonar.organization=apache -Dsonar.projectKey=apache_incubator-tamaya -Dsonar.host.url="https://sonarcloud.io" -Dsonar.login="$SONAR_TOKEN"
- name: "Java 9"
jdk: openjdk9
script: mvn clean install
- name: "Java 10"
jdk: openjdk10
script: mvn clean install
- name: "Java 11"
jdk: openjdk11
script: mvn clean install
| language: java
dist: trusty
addons:
sonarcloud:
organization: "apache"
jobs:
include:
- name: "Java 8"
jdk: openjdk8
- script: mvn clean verify install sonar:sonar -Dsonar.organization=apache -Dsonar.projectKey=apache_incubator-tamaya -Dsonar.host.url="https://sonarcloud.io" -Dsonar.login="$SONAR_TOKEN"
? -------
+ script: mvn clean install sonar:sonar -Dsonar.organization=apache -Dsonar.projectKey=apache_incubator-tamaya -Dsonar.host.url="https://sonarcloud.io" -Dsonar.login="$SONAR_TOKEN"
- name: "Java 9"
jdk: openjdk9
- script: mvn clean verify install
? -------
+ script: mvn clean install
- name: "Java 10"
jdk: openjdk10
- script: mvn clean verify install
? -------
+ script: mvn clean install
- name: "Java 11"
jdk: openjdk11
- script: mvn clean verify install
? -------
+ script: mvn clean install
| 8 | 0.307692 | 4 | 4 |
84fbfdcac7ff35265c7593f223c35c88452824ec | run.rb | run.rb | require "formula"
class Run < Formula
homepage "http://runscripts.org"
url "https://github.com/runscripts/run/archive/0.3.6.tar.gz"
sha1 "0f181b6a3bb56769cdbc46e6d0431a00d2cf3b9c"
head "https://github.com/runscripts/run.git"
depends_on "go" => :build
def install
ENV["GOPATH"] = buildpath
system "go", "get", "github.com/runscripts/run"
system "go", "build", "-o", "run"
bin.install "run"
etc.install "run.conf"
(HOMEBREW_PREFIX+"run").mkpath
end
test do
system "#{bin}/run", "--help"
end
end
| class Run < Formula
homepage "http://runscripts.org"
url "https://github.com/runscripts/run/archive/0.3.6.tar.gz"
sha1 "0f181b6a3bb56769cdbc46e6d0431a00d2cf3b9c"
head "https://github.com/runscripts/run.git"
depends_on "go" => :build
def install
ENV["GOPATH"] = buildpath
system "go", "get", "github.com/runscripts/run"
system "go", "build", "-o", "run"
bin.install "run"
etc.install "run.conf"
(HOMEBREW_PREFIX+"run").mkpath
end
test do
system "#{bin}/run", "pt-summary"
end
end
| Remove require and add better test | Remove require and add better test
| Ruby | mit | runscripts/homebrew-run | ruby | ## Code Before:
require "formula"
class Run < Formula
homepage "http://runscripts.org"
url "https://github.com/runscripts/run/archive/0.3.6.tar.gz"
sha1 "0f181b6a3bb56769cdbc46e6d0431a00d2cf3b9c"
head "https://github.com/runscripts/run.git"
depends_on "go" => :build
def install
ENV["GOPATH"] = buildpath
system "go", "get", "github.com/runscripts/run"
system "go", "build", "-o", "run"
bin.install "run"
etc.install "run.conf"
(HOMEBREW_PREFIX+"run").mkpath
end
test do
system "#{bin}/run", "--help"
end
end
## Instruction:
Remove require and add better test
## Code After:
class Run < Formula
homepage "http://runscripts.org"
url "https://github.com/runscripts/run/archive/0.3.6.tar.gz"
sha1 "0f181b6a3bb56769cdbc46e6d0431a00d2cf3b9c"
head "https://github.com/runscripts/run.git"
depends_on "go" => :build
def install
ENV["GOPATH"] = buildpath
system "go", "get", "github.com/runscripts/run"
system "go", "build", "-o", "run"
bin.install "run"
etc.install "run.conf"
(HOMEBREW_PREFIX+"run").mkpath
end
test do
system "#{bin}/run", "pt-summary"
end
end
| - require "formula"
-
class Run < Formula
homepage "http://runscripts.org"
url "https://github.com/runscripts/run/archive/0.3.6.tar.gz"
sha1 "0f181b6a3bb56769cdbc46e6d0431a00d2cf3b9c"
head "https://github.com/runscripts/run.git"
depends_on "go" => :build
def install
ENV["GOPATH"] = buildpath
system "go", "get", "github.com/runscripts/run"
system "go", "build", "-o", "run"
bin.install "run"
etc.install "run.conf"
(HOMEBREW_PREFIX+"run").mkpath
end
test do
- system "#{bin}/run", "--help"
? ^^^^^
+ system "#{bin}/run", "pt-summary"
? ++ ^^^^^^^
end
end | 4 | 0.173913 | 1 | 3 |
5acd0e40d4bd3022380f963150d00d9ee00d5e68 | templates/Layout/StaffPage.ss | templates/Layout/StaffPage.ss | <% if Content %>$Content<% end_if %>
<% if StaffCategories %>
<% loop StaffCategories %>
<div class="staff-category">
<% if Title %><h2 class="staff-category-title">$Title</h2><% end_if %>
<% if Description %><p>$Description</p><% end_if %>
<ul class="staff-members">
<% loop Staff %>
<% include StaffMembers %>
<% end_loop %>
</ul><!-- staff-members -->
</div><!-- staff-category -->
<% end_loop %>
<% end_if %>
<% if UncategorizedStaff %>
<% if MoreThanOneStaffCategory %><h2 class="staff-category-title">Other</h2><% end_if %>
<ul class="staff-members">
<% loop UncategorizedStaff %>
<% include StaffMembers %>
<% end_loop %>
</ul><!-- staff-members -->
<% end_if %>
| <% if Content %>$Content<% end_if %>
<% if StaffCategories %>
<div class="staff-categories">
<% loop StaffCategories %>
<div class="staff-category">
<% if Title %><h2 class="staff-category-title">$Title</h2><% end_if %>
<% if Description %><p>$Description</p><% end_if %>
<ul class="staff-members">
<% loop Staff %>
<% include StaffMembers %>
<% end_loop %>
</ul><!-- staff-members -->
</div><!-- staff-category -->
<% end_loop %>
</div><!-- .staff-categories -->
<% end_if %>
<% if UncategorizedStaff %>
<% if MoreThanOneStaffCategory %><h2 class="staff-category-title">Other</h2><% end_if %>
<ul class="staff-members">
<% loop UncategorizedStaff %>
<% include StaffMembers %>
<% end_loop %>
</ul><!-- staff-members -->
<% end_if %>
| Add some markup for staff categories | Add some markup for staff categories
| Scheme | bsd-3-clause | andrewhoule/silverstripe-staffpage,andrewhoule/silverstripe-staffpage | scheme | ## Code Before:
<% if Content %>$Content<% end_if %>
<% if StaffCategories %>
<% loop StaffCategories %>
<div class="staff-category">
<% if Title %><h2 class="staff-category-title">$Title</h2><% end_if %>
<% if Description %><p>$Description</p><% end_if %>
<ul class="staff-members">
<% loop Staff %>
<% include StaffMembers %>
<% end_loop %>
</ul><!-- staff-members -->
</div><!-- staff-category -->
<% end_loop %>
<% end_if %>
<% if UncategorizedStaff %>
<% if MoreThanOneStaffCategory %><h2 class="staff-category-title">Other</h2><% end_if %>
<ul class="staff-members">
<% loop UncategorizedStaff %>
<% include StaffMembers %>
<% end_loop %>
</ul><!-- staff-members -->
<% end_if %>
## Instruction:
Add some markup for staff categories
## Code After:
<% if Content %>$Content<% end_if %>
<% if StaffCategories %>
<div class="staff-categories">
<% loop StaffCategories %>
<div class="staff-category">
<% if Title %><h2 class="staff-category-title">$Title</h2><% end_if %>
<% if Description %><p>$Description</p><% end_if %>
<ul class="staff-members">
<% loop Staff %>
<% include StaffMembers %>
<% end_loop %>
</ul><!-- staff-members -->
</div><!-- staff-category -->
<% end_loop %>
</div><!-- .staff-categories -->
<% end_if %>
<% if UncategorizedStaff %>
<% if MoreThanOneStaffCategory %><h2 class="staff-category-title">Other</h2><% end_if %>
<ul class="staff-members">
<% loop UncategorizedStaff %>
<% include StaffMembers %>
<% end_loop %>
</ul><!-- staff-members -->
<% end_if %>
| <% if Content %>$Content<% end_if %>
<% if StaffCategories %>
+ <div class="staff-categories">
- <% loop StaffCategories %>
+ <% loop StaffCategories %>
? +
- <div class="staff-category">
+ <div class="staff-category">
? +
- <% if Title %><h2 class="staff-category-title">$Title</h2><% end_if %>
+ <% if Title %><h2 class="staff-category-title">$Title</h2><% end_if %>
? +
- <% if Description %><p>$Description</p><% end_if %>
+ <% if Description %><p>$Description</p><% end_if %>
? +
- <ul class="staff-members">
+ <ul class="staff-members">
? +
- <% loop Staff %>
+ <% loop Staff %>
? +
- <% include StaffMembers %>
+ <% include StaffMembers %>
? +
- <% end_loop %>
+ <% end_loop %>
? +
- </ul><!-- staff-members -->
+ </ul><!-- staff-members -->
? +
- </div><!-- staff-category -->
+ </div><!-- staff-category -->
? +
- <% end_loop %>
+ <% end_loop %>
? +
+ </div><!-- .staff-categories -->
<% end_if %>
<% if UncategorizedStaff %>
<% if MoreThanOneStaffCategory %><h2 class="staff-category-title">Other</h2><% end_if %>
<ul class="staff-members">
<% loop UncategorizedStaff %>
<% include StaffMembers %>
<% end_loop %>
</ul><!-- staff-members -->
<% end_if %>
| 24 | 0.96 | 13 | 11 |
5f147450d89c0cbbe31a60ca61cc75ae145884a3 | models/user.js | models/user.js | var database = require("../config/database");
var pivotal = require("../libs/pivotal");
var bcrypt = require('bcrypt');
var inspect = require('eyes').inspector({ stream: null });
module.exports = {
getByUsername: function(username, callback){
database.open(function(err, db){
db.collection('users', function(error , userCollection){
userCollection.findOne({email: username}, function(err, user){
database.close();
return callback(error, user);
});
});
});
},
getById: function(id, callback){
database.open(function(err, db){
db.collection('users', function(error , userCollection){
userCollection.findOne({id: id}, function(err, user){
database.close();
return callback(err, user);
});
});
});
},
create: function(data, callback){
bcrypt.hash(data.password, 10, function(err, hash) {
data.password = hash;
});
pivotal.access({username: data.email, password: data.password}, function(err, result){
if(result.message){ return callback(err, result); }
data.id = result.token.id[0]._;
data.token = result.token.guid[0];
database.open(function(err, db){
db.collection('users', function(error , userCollection){
userCollection.save(data, {safe: true}, function(err, user){
database.close();
return callback(err, user);
});
});
});
});
}
};
| var database = require("../config/database");
var pivotal = require("../libs/pivotal");
var bcrypt = require('bcrypt');
var inspect = require('eyes').inspector({ stream: null });
module.exports = {
getByUsername: function(username, callback){
this.collection.findOne({email: username}, function(err, user){
return callback(err, user);
});
},
getById: function(id, callback){
this.collection.findOne({id: id}, function(err, user){
return callback(err, user);
});
},
create: function(data, callback){
var self = this;
bcrypt.hash(data.password, 10, function(err, hash) {
data.password = hash;
});
pivotal.access({username: data.email, password: data.password}, function(error, result){
if(result.message){ return callback(error, result); }
data.id = result.token.id[0]._;
data.token = result.token.guid[0];
self.collection.save(data, {safe: true}, function(err, user){
return callback(err, user);
});
});
}
};
| Use only one instance of mongo to create querys | Use only one instance of mongo to create querys
| JavaScript | mit | tangosource/pokerestimate,tangosource/pokerestimate | javascript | ## Code Before:
var database = require("../config/database");
var pivotal = require("../libs/pivotal");
var bcrypt = require('bcrypt');
var inspect = require('eyes').inspector({ stream: null });
module.exports = {
getByUsername: function(username, callback){
database.open(function(err, db){
db.collection('users', function(error , userCollection){
userCollection.findOne({email: username}, function(err, user){
database.close();
return callback(error, user);
});
});
});
},
getById: function(id, callback){
database.open(function(err, db){
db.collection('users', function(error , userCollection){
userCollection.findOne({id: id}, function(err, user){
database.close();
return callback(err, user);
});
});
});
},
create: function(data, callback){
bcrypt.hash(data.password, 10, function(err, hash) {
data.password = hash;
});
pivotal.access({username: data.email, password: data.password}, function(err, result){
if(result.message){ return callback(err, result); }
data.id = result.token.id[0]._;
data.token = result.token.guid[0];
database.open(function(err, db){
db.collection('users', function(error , userCollection){
userCollection.save(data, {safe: true}, function(err, user){
database.close();
return callback(err, user);
});
});
});
});
}
};
## Instruction:
Use only one instance of mongo to create querys
## Code After:
var database = require("../config/database");
var pivotal = require("../libs/pivotal");
var bcrypt = require('bcrypt');
var inspect = require('eyes').inspector({ stream: null });
module.exports = {
getByUsername: function(username, callback){
this.collection.findOne({email: username}, function(err, user){
return callback(err, user);
});
},
getById: function(id, callback){
this.collection.findOne({id: id}, function(err, user){
return callback(err, user);
});
},
create: function(data, callback){
var self = this;
bcrypt.hash(data.password, 10, function(err, hash) {
data.password = hash;
});
pivotal.access({username: data.email, password: data.password}, function(error, result){
if(result.message){ return callback(error, result); }
data.id = result.token.id[0]._;
data.token = result.token.guid[0];
self.collection.save(data, {safe: true}, function(err, user){
return callback(err, user);
});
});
}
};
| var database = require("../config/database");
var pivotal = require("../libs/pivotal");
var bcrypt = require('bcrypt');
var inspect = require('eyes').inspector({ stream: null });
module.exports = {
getByUsername: function(username, callback){
- database.open(function(err, db){
- db.collection('users', function(error , userCollection){
- userCollection.findOne({email: username}, function(err, user){
? ^^^^^ ^^^
+ this.collection.findOne({email: username}, function(err, user){
? ^^^ ^^
- database.close();
- return callback(error, user);
? ---- --
+ return callback(err, user);
- });
- });
});
},
getById: function(id, callback){
- database.open(function(err, db){
- db.collection('users', function(error , userCollection){
- userCollection.findOne({id: id}, function(err, user){
? ^^^^^ ^^^
+ this.collection.findOne({id: id}, function(err, user){
? ^^^ ^^
- database.close();
- return callback(err, user);
? ----
+ return callback(err, user);
- });
- });
});
},
create: function(data, callback){
+ var self = this;
bcrypt.hash(data.password, 10, function(err, hash) {
data.password = hash;
});
- pivotal.access({username: data.email, password: data.password}, function(err, result){
+ pivotal.access({username: data.email, password: data.password}, function(error, result){
? ++
- if(result.message){ return callback(err, result); }
+ if(result.message){ return callback(error, result); }
? ++
data.id = result.token.id[0]._;
data.token = result.token.guid[0];
- database.open(function(err, db){
- db.collection('users', function(error , userCollection){
- userCollection.save(data, {safe: true}, function(err, user){
? ----- ^^
+ self.collection.save(data, {safe: true}, function(err, user){
? ^^^^
- database.close();
- return callback(err, user);
? ----
+ return callback(err, user);
- });
- });
});
});
}
}; | 32 | 0.581818 | 9 | 23 |
04af9e7e754a9878f886e721d4ed63f1f0b767ec | src/Flow/Adapter/FileAdapter.php | src/Flow/Adapter/FileAdapter.php | <?php
namespace Flow\Adapter;
use Flow\Adapter;
final class FileAdapter implements Adapter
{
private $source;
public function __construct($source)
{
if (!($this->source = realpath($source)) || !is_dir($this->source)) {
throw new \RuntimeException(sprintf(
'source directory %s not found',
$source
));
}
}
public function isReadable(string $path) : bool
{
return is_readable($this->source. '/' . $path);
}
public function lastModified(string $path) : int
{
return filemtime($this->source. '/' . $path);
}
public function getContents(string $path) : string
{
return file_get_contents($this->source . '/' . $path);
}
}
| <?php
namespace Flow\Adapter;
use Flow\Adapter;
final class FileAdapter implements Adapter
{
private $directory;
public function __construct($directory)
{
if (!($this->directory = realpath($directory)) || !is_dir($this->directory)) {
throw new \RuntimeException(sprintf(
'directory %s not found',
$directory
));
}
}
public function isReadable(string $path) : bool
{
return is_readable($this->directory . '/' . $path);
}
public function lastModified(string $path) : int
{
return filemtime($this->directory . '/' . $path);
}
public function getContents(string $path) : string
{
return file_get_contents($this->directory . '/' . $path);
}
}
| Rename member variable to better reflect its usage and abstraction | Rename member variable to better reflect its usage and abstraction | PHP | mit | nramenta/flow,nramenta/flow | php | ## Code Before:
<?php
namespace Flow\Adapter;
use Flow\Adapter;
final class FileAdapter implements Adapter
{
private $source;
public function __construct($source)
{
if (!($this->source = realpath($source)) || !is_dir($this->source)) {
throw new \RuntimeException(sprintf(
'source directory %s not found',
$source
));
}
}
public function isReadable(string $path) : bool
{
return is_readable($this->source. '/' . $path);
}
public function lastModified(string $path) : int
{
return filemtime($this->source. '/' . $path);
}
public function getContents(string $path) : string
{
return file_get_contents($this->source . '/' . $path);
}
}
## Instruction:
Rename member variable to better reflect its usage and abstraction
## Code After:
<?php
namespace Flow\Adapter;
use Flow\Adapter;
final class FileAdapter implements Adapter
{
private $directory;
public function __construct($directory)
{
if (!($this->directory = realpath($directory)) || !is_dir($this->directory)) {
throw new \RuntimeException(sprintf(
'directory %s not found',
$directory
));
}
}
public function isReadable(string $path) : bool
{
return is_readable($this->directory . '/' . $path);
}
public function lastModified(string $path) : int
{
return filemtime($this->directory . '/' . $path);
}
public function getContents(string $path) : string
{
return file_get_contents($this->directory . '/' . $path);
}
}
| <?php
namespace Flow\Adapter;
use Flow\Adapter;
final class FileAdapter implements Adapter
{
- private $source;
+ private $directory;
- public function __construct($source)
? ^ - ^^
+ public function __construct($directory)
? ^^^^^^ ^
{
- if (!($this->source = realpath($source)) || !is_dir($this->source)) {
? ^ - ^^ ^ - ^^ ^ - ^^
+ if (!($this->directory = realpath($directory)) || !is_dir($this->directory)) {
? ^^^^^^ ^ ^^^^^^ ^ ^^^^^^ ^
throw new \RuntimeException(sprintf(
- 'source directory %s not found',
? -------
+ 'directory %s not found',
- $source
? ^ - ^^
+ $directory
? ^^^^^^ ^
));
}
}
public function isReadable(string $path) : bool
{
- return is_readable($this->source. '/' . $path);
? ^ - ^^
+ return is_readable($this->directory . '/' . $path);
? ^^^^^^ ^^
}
public function lastModified(string $path) : int
{
- return filemtime($this->source. '/' . $path);
? ^ - ^^
+ return filemtime($this->directory . '/' . $path);
? ^^^^^^ ^^
}
public function getContents(string $path) : string
{
- return file_get_contents($this->source . '/' . $path);
? ^ - ^^
+ return file_get_contents($this->directory . '/' . $path);
? ^^^^^^ ^
}
}
| 16 | 0.444444 | 8 | 8 |
db3b9b0e010a953fe8107fd80d6cbf2deaced5de | ReadForbidden.java | ReadForbidden.java | import java.util.*;
import java.lang.*;
import java.lang.reflect.*;
import java.lang.annotation.*;
public class ReadForbidden {
public static void main(String args[]) throws Exception {
if(args.length != 1) {
System.err.println("missing class argument");
System.exit(-1);
}
String tcln = args[0];
ClassLoader cl = ClassLoader.getSystemClassLoader();
Class newClass = cl.loadClass(tcln);
Forbidden forbidden = (Forbidden) newClass.getAnnotation(Forbidden.class);
String grep = "egrep '(java/lang/ClassLoader|java\\.lang\\.ClassLoader|java/lang/reflect|java\\.lang\\.reflect";
for (String s : forbidden.value()) {
String escape = s.replaceAll("\\.", "\\\\.");
grep += "|" + escape;
escape = s.replaceAll("\\.", "/");
grep += "|" + escape;
}
grep += ")'";
System.out.println(grep);
}
}
| import java.util.*;
import java.lang.*;
import java.lang.reflect.*;
import java.lang.annotation.*;
public class ReadForbidden {
public static void main(String args[]) throws Exception {
if(args.length != 1) {
System.err.println("missing class argument");
System.exit(-1);
}
String grep = "egrep '(java/lang/ClassLoader|java\\.lang\\.ClassLoader|java/lang/reflect|java\\.lang\\.reflect";
ClassLoader cl = ClassLoader.getSystemClassLoader();
for (String tcln : args) {
Class newClass = cl.loadClass(tcln);
Forbidden forbidden = (Forbidden) newClass.getAnnotation(Forbidden.class);
for (String s : forbidden.value()) {
String escape = s.replaceAll("\\.", "\\\\.");
grep += "|" + escape;
escape = s.replaceAll("\\.", "/");
grep += "|" + escape;
}
}
grep += ")'";
System.out.println(grep);
}
}
| Allow more than one test class (at least for annotation reading). | Allow more than one test class (at least for annotation reading).
| Java | apache-2.0 | FAU-Inf2/AuDoscore,FAU-Inf2/AuDoscore | java | ## Code Before:
import java.util.*;
import java.lang.*;
import java.lang.reflect.*;
import java.lang.annotation.*;
public class ReadForbidden {
public static void main(String args[]) throws Exception {
if(args.length != 1) {
System.err.println("missing class argument");
System.exit(-1);
}
String tcln = args[0];
ClassLoader cl = ClassLoader.getSystemClassLoader();
Class newClass = cl.loadClass(tcln);
Forbidden forbidden = (Forbidden) newClass.getAnnotation(Forbidden.class);
String grep = "egrep '(java/lang/ClassLoader|java\\.lang\\.ClassLoader|java/lang/reflect|java\\.lang\\.reflect";
for (String s : forbidden.value()) {
String escape = s.replaceAll("\\.", "\\\\.");
grep += "|" + escape;
escape = s.replaceAll("\\.", "/");
grep += "|" + escape;
}
grep += ")'";
System.out.println(grep);
}
}
## Instruction:
Allow more than one test class (at least for annotation reading).
## Code After:
import java.util.*;
import java.lang.*;
import java.lang.reflect.*;
import java.lang.annotation.*;
public class ReadForbidden {
public static void main(String args[]) throws Exception {
if(args.length != 1) {
System.err.println("missing class argument");
System.exit(-1);
}
String grep = "egrep '(java/lang/ClassLoader|java\\.lang\\.ClassLoader|java/lang/reflect|java\\.lang\\.reflect";
ClassLoader cl = ClassLoader.getSystemClassLoader();
for (String tcln : args) {
Class newClass = cl.loadClass(tcln);
Forbidden forbidden = (Forbidden) newClass.getAnnotation(Forbidden.class);
for (String s : forbidden.value()) {
String escape = s.replaceAll("\\.", "\\\\.");
grep += "|" + escape;
escape = s.replaceAll("\\.", "/");
grep += "|" + escape;
}
}
grep += ")'";
System.out.println(grep);
}
}
| import java.util.*;
import java.lang.*;
import java.lang.reflect.*;
import java.lang.annotation.*;
public class ReadForbidden {
public static void main(String args[]) throws Exception {
if(args.length != 1) {
System.err.println("missing class argument");
System.exit(-1);
}
- String tcln = args[0];
- ClassLoader cl = ClassLoader.getSystemClassLoader();
- Class newClass = cl.loadClass(tcln);
- Forbidden forbidden = (Forbidden) newClass.getAnnotation(Forbidden.class);
String grep = "egrep '(java/lang/ClassLoader|java\\.lang\\.ClassLoader|java/lang/reflect|java\\.lang\\.reflect";
+
+ ClassLoader cl = ClassLoader.getSystemClassLoader();
+ for (String tcln : args) {
+ Class newClass = cl.loadClass(tcln);
+ Forbidden forbidden = (Forbidden) newClass.getAnnotation(Forbidden.class);
- for (String s : forbidden.value()) {
+ for (String s : forbidden.value()) {
? +
- String escape = s.replaceAll("\\.", "\\\\.");
+ String escape = s.replaceAll("\\.", "\\\\.");
? +
- grep += "|" + escape;
+ grep += "|" + escape;
? +
- escape = s.replaceAll("\\.", "/");
+ escape = s.replaceAll("\\.", "/");
? +
- grep += "|" + escape;
+ grep += "|" + escape;
? +
+ }
}
+
grep += ")'";
System.out.println(grep);
}
} | 21 | 0.777778 | 12 | 9 |
697e848fbe0a2cab8a56ea8641f82f17d9b86c99 | plugins/backbone.js | plugins/backbone.js | /**
* Backbone.js plugin
*
* Patches Backbone.Events callbacks.
*/
;(function(window, Raven, Backbone) {
'use strict';
// quit if Backbone isn't on the page
if (!Backbone) {
return;
}
function makeBackboneEventsOn(oldOn) {
return function BackboneEventsOn(name, callback, context) {
var _callback = callback._callback || callback;
callback = Raven.wrap(callback);
callback._callback = _callback;
return oldOn.call(this, name, callback, context);
};
}
// We're too late to catch all of these by simply patching Backbone.Events.on
var affectedObjects = [
Backbone.Events,
Backbone,
Backbone.Model.prototype,
Backbone.Collection.prototype,
Backbone.View.prototype,
Backbone.Router.prototype,
Backbone.History.prototype
], i = 0, l = affectedObjects.length;
for (; i < l; i++) {
var affected = affectedObjects[i];
affected.on = makeBackboneEventsOn(affected.on);
affected.bind = affected.on;
}
}(window, window.Raven, window.Backbone));
| /**
* Backbone.js plugin
*
* Patches Backbone.Events callbacks.
*/
;(function(window, Raven, Backbone) {
'use strict';
// quit if Backbone isn't on the page
if (!Backbone) {
return;
}
function makeBackboneEventsOn(oldOn) {
return function BackboneEventsOn(name, callback, context) {
var wrapCallback = function (cb) {
if (Object.prototype.toString.call(cb) === '[object Function]') {
var _callback = cb._callback || cb;
cb = Raven.wrap(cb);
cb._callback = _callback;
}
return cb;
};
if (Object.prototype.toString.call(name) === '[object Object]') {
// Handle event maps.
for (var key in name) {
if (name.hasOwnProperty(key)) {
name[key] = wrapCallback(name[key]);
}
}
} else {
callback = wrapCallback(callback);
}
return oldOn.call(this, name, callback, context);
};
}
// We're too late to catch all of these by simply patching Backbone.Events.on
var affectedObjects = [
Backbone.Events,
Backbone,
Backbone.Model.prototype,
Backbone.Collection.prototype,
Backbone.View.prototype,
Backbone.Router.prototype,
Backbone.History.prototype
], i = 0, l = affectedObjects.length;
for (; i < l; i++) {
var affected = affectedObjects[i];
affected.on = makeBackboneEventsOn(affected.on);
affected.bind = affected.on;
}
}(window, window.Raven, window.Backbone));
| Update Backbone.js plugin to handle event map syntax. | Update Backbone.js plugin to handle event map syntax.
| JavaScript | bsd-2-clause | housinghq/main-raven-js,janmisek/raven-js,vladikoff/raven-js,danse/raven-js,benoitg/raven-js,janmisek/raven-js,clara-labs/raven-js,vladikoff/raven-js,hussfelt/raven-js,getsentry/raven-js,getsentry/raven-js,grelas/raven-js,Mappy/raven-js,getsentry/raven-js,housinghq/main-raven-js,eaglesjava/raven-js,danse/raven-js,PureBilling/raven-js,grelas/raven-js,samgiles/raven-js,housinghq/main-raven-js,iodine/raven-js,chrisirhc/raven-js,malandrew/raven-js,eaglesjava/raven-js,chrisirhc/raven-js,malandrew/raven-js,benoitg/raven-js,iodine/raven-js,hussfelt/raven-js,clara-labs/raven-js,Mappy/raven-js,PureBilling/raven-js,Mappy/raven-js,samgiles/raven-js,getsentry/raven-js | javascript | ## Code Before:
/**
* Backbone.js plugin
*
* Patches Backbone.Events callbacks.
*/
;(function(window, Raven, Backbone) {
'use strict';
// quit if Backbone isn't on the page
if (!Backbone) {
return;
}
function makeBackboneEventsOn(oldOn) {
return function BackboneEventsOn(name, callback, context) {
var _callback = callback._callback || callback;
callback = Raven.wrap(callback);
callback._callback = _callback;
return oldOn.call(this, name, callback, context);
};
}
// We're too late to catch all of these by simply patching Backbone.Events.on
var affectedObjects = [
Backbone.Events,
Backbone,
Backbone.Model.prototype,
Backbone.Collection.prototype,
Backbone.View.prototype,
Backbone.Router.prototype,
Backbone.History.prototype
], i = 0, l = affectedObjects.length;
for (; i < l; i++) {
var affected = affectedObjects[i];
affected.on = makeBackboneEventsOn(affected.on);
affected.bind = affected.on;
}
}(window, window.Raven, window.Backbone));
## Instruction:
Update Backbone.js plugin to handle event map syntax.
## Code After:
/**
* Backbone.js plugin
*
* Patches Backbone.Events callbacks.
*/
;(function(window, Raven, Backbone) {
'use strict';
// quit if Backbone isn't on the page
if (!Backbone) {
return;
}
function makeBackboneEventsOn(oldOn) {
return function BackboneEventsOn(name, callback, context) {
var wrapCallback = function (cb) {
if (Object.prototype.toString.call(cb) === '[object Function]') {
var _callback = cb._callback || cb;
cb = Raven.wrap(cb);
cb._callback = _callback;
}
return cb;
};
if (Object.prototype.toString.call(name) === '[object Object]') {
// Handle event maps.
for (var key in name) {
if (name.hasOwnProperty(key)) {
name[key] = wrapCallback(name[key]);
}
}
} else {
callback = wrapCallback(callback);
}
return oldOn.call(this, name, callback, context);
};
}
// We're too late to catch all of these by simply patching Backbone.Events.on
var affectedObjects = [
Backbone.Events,
Backbone,
Backbone.Model.prototype,
Backbone.Collection.prototype,
Backbone.View.prototype,
Backbone.Router.prototype,
Backbone.History.prototype
], i = 0, l = affectedObjects.length;
for (; i < l; i++) {
var affected = affectedObjects[i];
affected.on = makeBackboneEventsOn(affected.on);
affected.bind = affected.on;
}
}(window, window.Raven, window.Backbone));
| /**
* Backbone.js plugin
*
* Patches Backbone.Events callbacks.
*/
;(function(window, Raven, Backbone) {
'use strict';
// quit if Backbone isn't on the page
if (!Backbone) {
return;
}
function makeBackboneEventsOn(oldOn) {
return function BackboneEventsOn(name, callback, context) {
+ var wrapCallback = function (cb) {
+ if (Object.prototype.toString.call(cb) === '[object Function]') {
- var _callback = callback._callback || callback;
? --- --- --- ---
+ var _callback = cb._callback || cb;
? ++++
- callback = Raven.wrap(callback);
? --- --- --- ---
+ cb = Raven.wrap(cb);
? ++++
- callback._callback = _callback;
? --- ---
+ cb._callback = _callback;
? ++++
+ }
+ return cb;
+ };
+ if (Object.prototype.toString.call(name) === '[object Object]') {
+ // Handle event maps.
+ for (var key in name) {
+ if (name.hasOwnProperty(key)) {
+ name[key] = wrapCallback(name[key]);
+ }
+ }
+ } else {
+ callback = wrapCallback(callback);
+ }
return oldOn.call(this, name, callback, context);
};
}
// We're too late to catch all of these by simply patching Backbone.Events.on
var affectedObjects = [
Backbone.Events,
Backbone,
Backbone.Model.prototype,
Backbone.Collection.prototype,
Backbone.View.prototype,
Backbone.Router.prototype,
Backbone.History.prototype
], i = 0, l = affectedObjects.length;
for (; i < l; i++) {
var affected = affectedObjects[i];
affected.on = makeBackboneEventsOn(affected.on);
affected.bind = affected.on;
}
}(window, window.Raven, window.Backbone)); | 21 | 0.525 | 18 | 3 |
06e5c46c8df784ab8f6e7713ada68bbb011dbb68 | packages/babel-preset-typescript/src/index.js | packages/babel-preset-typescript/src/index.js | import { declare } from "@babel/helper-plugin-utils";
import transformTypeScript from "@babel/plugin-transform-typescript";
export default declare(
(api, { jsxPragma, allExtensions = false, isTSX = false }) => {
api.assertVersion(7);
if (typeof allExtensions !== "boolean") {
throw new Error(".allExtensions must be a boolean, or undefined");
}
if (typeof isTSX !== "boolean") {
throw new Error(".allExtensions must be a boolean, or undefined");
}
if (isTSX && !allExtensions) {
throw new Error("isTSX:true requires allExtensions:true");
}
return {
overrides: allExtensions
? [
{
plugins: [[transformTypeScript, { jsxPragma, isTSX }]],
},
]
: [
{
// Only set 'test' if explicitly requested, since it requires that
// Babel is being called`
test: /\.ts$/,
plugins: [[transformTypeScript, { jsxPragma }]],
},
{
// Only set 'test' if explicitly requested, since it requires that
// Babel is being called`
test: /\.tsx$/,
plugins: [[transformTypeScript, { jsxPragma, isTSX: true }]],
},
],
};
},
);
| import { declare } from "@babel/helper-plugin-utils";
import transformTypeScript from "@babel/plugin-transform-typescript";
export default declare(
(api, { jsxPragma, allExtensions = false, isTSX = false }) => {
api.assertVersion(7);
if (typeof allExtensions !== "boolean") {
throw new Error(".allExtensions must be a boolean, or undefined");
}
if (typeof isTSX !== "boolean") {
throw new Error(".isTSX must be a boolean, or undefined");
}
if (isTSX && !allExtensions) {
throw new Error("isTSX:true requires allExtensions:true");
}
return {
overrides: allExtensions
? [
{
plugins: [[transformTypeScript, { jsxPragma, isTSX }]],
},
]
: [
{
// Only set 'test' if explicitly requested, since it requires that
// Babel is being called`
test: /\.ts$/,
plugins: [[transformTypeScript, { jsxPragma }]],
},
{
// Only set 'test' if explicitly requested, since it requires that
// Babel is being called`
test: /\.tsx$/,
plugins: [[transformTypeScript, { jsxPragma, isTSX: true }]],
},
],
};
},
);
| Fix typo in option validation. | Fix typo in option validation.
| JavaScript | mit | jridgewell/babel,babel/babel,kaicataldo/babel,chicoxyzzy/babel,hulkish/babel,kaicataldo/babel,hulkish/babel,existentialism/babel,existentialism/babel,hulkish/babel,existentialism/babel,hzoo/babel,chicoxyzzy/babel,babel/babel,kaicataldo/babel,vadzim/babel,jridgewell/babel,babel/babel,hzoo/babel,jridgewell/babel,chicoxyzzy/babel,Skillupco/babel,kellyselden/babel,vadzim/babel,Skillupco/babel,Skillupco/babel,hulkish/babel,hzoo/babel,Skillupco/babel,kellyselden/babel,babel/babel,chicoxyzzy/babel,kellyselden/babel,kaicataldo/babel,jridgewell/babel,hzoo/babel,kellyselden/babel | javascript | ## Code Before:
import { declare } from "@babel/helper-plugin-utils";
import transformTypeScript from "@babel/plugin-transform-typescript";
export default declare(
(api, { jsxPragma, allExtensions = false, isTSX = false }) => {
api.assertVersion(7);
if (typeof allExtensions !== "boolean") {
throw new Error(".allExtensions must be a boolean, or undefined");
}
if (typeof isTSX !== "boolean") {
throw new Error(".allExtensions must be a boolean, or undefined");
}
if (isTSX && !allExtensions) {
throw new Error("isTSX:true requires allExtensions:true");
}
return {
overrides: allExtensions
? [
{
plugins: [[transformTypeScript, { jsxPragma, isTSX }]],
},
]
: [
{
// Only set 'test' if explicitly requested, since it requires that
// Babel is being called`
test: /\.ts$/,
plugins: [[transformTypeScript, { jsxPragma }]],
},
{
// Only set 'test' if explicitly requested, since it requires that
// Babel is being called`
test: /\.tsx$/,
plugins: [[transformTypeScript, { jsxPragma, isTSX: true }]],
},
],
};
},
);
## Instruction:
Fix typo in option validation.
## Code After:
import { declare } from "@babel/helper-plugin-utils";
import transformTypeScript from "@babel/plugin-transform-typescript";
export default declare(
(api, { jsxPragma, allExtensions = false, isTSX = false }) => {
api.assertVersion(7);
if (typeof allExtensions !== "boolean") {
throw new Error(".allExtensions must be a boolean, or undefined");
}
if (typeof isTSX !== "boolean") {
throw new Error(".isTSX must be a boolean, or undefined");
}
if (isTSX && !allExtensions) {
throw new Error("isTSX:true requires allExtensions:true");
}
return {
overrides: allExtensions
? [
{
plugins: [[transformTypeScript, { jsxPragma, isTSX }]],
},
]
: [
{
// Only set 'test' if explicitly requested, since it requires that
// Babel is being called`
test: /\.ts$/,
plugins: [[transformTypeScript, { jsxPragma }]],
},
{
// Only set 'test' if explicitly requested, since it requires that
// Babel is being called`
test: /\.tsx$/,
plugins: [[transformTypeScript, { jsxPragma, isTSX: true }]],
},
],
};
},
);
| import { declare } from "@babel/helper-plugin-utils";
import transformTypeScript from "@babel/plugin-transform-typescript";
export default declare(
(api, { jsxPragma, allExtensions = false, isTSX = false }) => {
api.assertVersion(7);
if (typeof allExtensions !== "boolean") {
throw new Error(".allExtensions must be a boolean, or undefined");
}
if (typeof isTSX !== "boolean") {
- throw new Error(".allExtensions must be a boolean, or undefined");
? ^^^^^^^^ ^^^^
+ throw new Error(".isTSX must be a boolean, or undefined");
? ^ ^^^
}
if (isTSX && !allExtensions) {
throw new Error("isTSX:true requires allExtensions:true");
}
return {
overrides: allExtensions
? [
{
plugins: [[transformTypeScript, { jsxPragma, isTSX }]],
},
]
: [
{
// Only set 'test' if explicitly requested, since it requires that
// Babel is being called`
test: /\.ts$/,
plugins: [[transformTypeScript, { jsxPragma }]],
},
{
// Only set 'test' if explicitly requested, since it requires that
// Babel is being called`
test: /\.tsx$/,
plugins: [[transformTypeScript, { jsxPragma, isTSX: true }]],
},
],
};
},
); | 2 | 0.047619 | 1 | 1 |
c4aaff7a9544673cecadc5f701b087582a1f7584 | package.json | package.json | {
"name": "es-components",
"version": "10.7.1",
"description": "React components built for Exchange Solutions products",
"repository": "https://github.com/wtw-im/es-components",
"scripts": {
"ci": "sh build.sh",
"version_only": "lerna publish --skip-npm",
"publish_only": "lerna publish --skip-git",
"publish": "lerna publish",
"link": "lerna link",
"precommit": "lint-staged && sh rebuild-docs.sh"
},
"lint-staged": {
"packages/es-components/src/**/*.js": [
"prettier --single-quote --write",
"eslint --fix",
"git add"
]
},
"author": "Willis Towers Watson - Individual Marketplace",
"license": "MIT",
"devDependencies": {
"babel-eslint": "^6.1.2",
"eslint": "^2.13.1",
"eslint-config-exchange-solutions": "^6.0.0",
"eslint-plugin-babel": "^3.3.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^4.3.0",
"husky": "^0.14.3",
"lerna": "^2.10.1",
"lint-staged": "^7.0.4",
"prettier": "^1.12.0"
}
}
| {
"name": "es-components",
"version": "10.7.1",
"description": "React components built for Exchange Solutions products",
"repository": "https://github.com/wtw-im/es-components",
"scripts": {
"ci": "sh build.sh",
"version_only": "lerna publish --skip-npm",
"publish_only": "lerna publish --skip-git",
"publish": "lerna publish",
"link": "lerna link --force-local",
"precommit": "lint-staged && sh rebuild-docs.sh"
},
"lint-staged": {
"packages/es-components/src/**/*.js": [
"prettier --single-quote --write",
"eslint --fix",
"git add"
]
},
"author": "Willis Towers Watson - Individual Marketplace",
"license": "MIT",
"devDependencies": {
"babel-eslint": "^6.1.2",
"eslint": "^2.13.1",
"eslint-config-exchange-solutions": "^6.0.0",
"eslint-plugin-babel": "^3.3.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^4.3.0",
"husky": "^0.14.3",
"lerna": "^2.10.1",
"lint-staged": "^7.0.4",
"prettier": "^1.12.0"
}
}
| Fix linking during local development | Fix linking during local development
Running `lerna link` wasn't giving the result of linking local packages. Executing this with the --force-local option forces the symlink to take precedence over any installed packages.
| JSON | mit | jrios/es-components,TWExchangeSolutions/es-components,jrios/es-components,TWExchangeSolutions/es-components,jrios/es-components | json | ## Code Before:
{
"name": "es-components",
"version": "10.7.1",
"description": "React components built for Exchange Solutions products",
"repository": "https://github.com/wtw-im/es-components",
"scripts": {
"ci": "sh build.sh",
"version_only": "lerna publish --skip-npm",
"publish_only": "lerna publish --skip-git",
"publish": "lerna publish",
"link": "lerna link",
"precommit": "lint-staged && sh rebuild-docs.sh"
},
"lint-staged": {
"packages/es-components/src/**/*.js": [
"prettier --single-quote --write",
"eslint --fix",
"git add"
]
},
"author": "Willis Towers Watson - Individual Marketplace",
"license": "MIT",
"devDependencies": {
"babel-eslint": "^6.1.2",
"eslint": "^2.13.1",
"eslint-config-exchange-solutions": "^6.0.0",
"eslint-plugin-babel": "^3.3.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^4.3.0",
"husky": "^0.14.3",
"lerna": "^2.10.1",
"lint-staged": "^7.0.4",
"prettier": "^1.12.0"
}
}
## Instruction:
Fix linking during local development
Running `lerna link` wasn't giving the result of linking local packages. Executing this with the --force-local option forces the symlink to take precedence over any installed packages.
## Code After:
{
"name": "es-components",
"version": "10.7.1",
"description": "React components built for Exchange Solutions products",
"repository": "https://github.com/wtw-im/es-components",
"scripts": {
"ci": "sh build.sh",
"version_only": "lerna publish --skip-npm",
"publish_only": "lerna publish --skip-git",
"publish": "lerna publish",
"link": "lerna link --force-local",
"precommit": "lint-staged && sh rebuild-docs.sh"
},
"lint-staged": {
"packages/es-components/src/**/*.js": [
"prettier --single-quote --write",
"eslint --fix",
"git add"
]
},
"author": "Willis Towers Watson - Individual Marketplace",
"license": "MIT",
"devDependencies": {
"babel-eslint": "^6.1.2",
"eslint": "^2.13.1",
"eslint-config-exchange-solutions": "^6.0.0",
"eslint-plugin-babel": "^3.3.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^4.3.0",
"husky": "^0.14.3",
"lerna": "^2.10.1",
"lint-staged": "^7.0.4",
"prettier": "^1.12.0"
}
}
| {
"name": "es-components",
"version": "10.7.1",
"description": "React components built for Exchange Solutions products",
"repository": "https://github.com/wtw-im/es-components",
"scripts": {
"ci": "sh build.sh",
"version_only": "lerna publish --skip-npm",
"publish_only": "lerna publish --skip-git",
"publish": "lerna publish",
- "link": "lerna link",
+ "link": "lerna link --force-local",
? ++++++++++++++
"precommit": "lint-staged && sh rebuild-docs.sh"
},
"lint-staged": {
"packages/es-components/src/**/*.js": [
"prettier --single-quote --write",
"eslint --fix",
"git add"
]
},
"author": "Willis Towers Watson - Individual Marketplace",
"license": "MIT",
"devDependencies": {
"babel-eslint": "^6.1.2",
"eslint": "^2.13.1",
"eslint-config-exchange-solutions": "^6.0.0",
"eslint-plugin-babel": "^3.3.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^4.3.0",
"husky": "^0.14.3",
"lerna": "^2.10.1",
"lint-staged": "^7.0.4",
"prettier": "^1.12.0"
}
} | 2 | 0.055556 | 1 | 1 |
83a0e8c63ee4d15e82f96fe7983d4ac96e0c664d | CHANGELOG.md | CHANGELOG.md | Changelog
=========
## x.y.z - UNRELEASED
--------
## 0.2.0 - 2017-04-30
### Added
* [Laravel] Compatibility with version 1.1 of laravel/dusk.
* [Element] Allow an element itself to be clicked on using Element::click() with no selector.
--------
## 0.1.1 - 2017-03-04
### Fixed
* [Element] Ensure Element::element() and Element::elements() return wrapper instance, and not RemoteWebElement instances.
--------
## 0.1.0 - 2017-02-26
### Added
* [Laravel] Compatibility with version 1.0 of laravel/dusk.
* [Drivers] A driver for Chrome.
* [Dusk] Add a screenshot() method.
--------
| Changelog
=========
## x.y.z - UNRELEASED
--------
## 0.3.0 - 2017-06-25
### Added
* [Dusk] Add support for a base url.
* [Dusk] Allow the executeScript() method of the driver to be called.
--------
## 0.2.0 - 2017-04-30
### Added
* [Laravel] Compatibility with version 1.1 of laravel/dusk.
* [Element] Allow an element itself to be clicked on using Element::click() with no selector.
--------
## 0.1.1 - 2017-03-04
### Fixed
* [Element] Ensure Element::element() and Element::elements() return wrapper instance, and not RemoteWebElement instances.
--------
## 0.1.0 - 2017-02-26
### Added
* [Laravel] Compatibility with version 1.0 of laravel/dusk.
* [Drivers] A driver for Chrome.
* [Dusk] Add a screenshot() method.
--------
| Update the changelog for 0.3.0 | Update the changelog for 0.3.0
| Markdown | apache-2.0 | duncan3dc/dusk | markdown | ## Code Before:
Changelog
=========
## x.y.z - UNRELEASED
--------
## 0.2.0 - 2017-04-30
### Added
* [Laravel] Compatibility with version 1.1 of laravel/dusk.
* [Element] Allow an element itself to be clicked on using Element::click() with no selector.
--------
## 0.1.1 - 2017-03-04
### Fixed
* [Element] Ensure Element::element() and Element::elements() return wrapper instance, and not RemoteWebElement instances.
--------
## 0.1.0 - 2017-02-26
### Added
* [Laravel] Compatibility with version 1.0 of laravel/dusk.
* [Drivers] A driver for Chrome.
* [Dusk] Add a screenshot() method.
--------
## Instruction:
Update the changelog for 0.3.0
## Code After:
Changelog
=========
## x.y.z - UNRELEASED
--------
## 0.3.0 - 2017-06-25
### Added
* [Dusk] Add support for a base url.
* [Dusk] Allow the executeScript() method of the driver to be called.
--------
## 0.2.0 - 2017-04-30
### Added
* [Laravel] Compatibility with version 1.1 of laravel/dusk.
* [Element] Allow an element itself to be clicked on using Element::click() with no selector.
--------
## 0.1.1 - 2017-03-04
### Fixed
* [Element] Ensure Element::element() and Element::elements() return wrapper instance, and not RemoteWebElement instances.
--------
## 0.1.0 - 2017-02-26
### Added
* [Laravel] Compatibility with version 1.0 of laravel/dusk.
* [Drivers] A driver for Chrome.
* [Dusk] Add a screenshot() method.
--------
| Changelog
=========
## x.y.z - UNRELEASED
+
+ --------
+
+ ## 0.3.0 - 2017-06-25
+
+ ### Added
+
+ * [Dusk] Add support for a base url.
+ * [Dusk] Allow the executeScript() method of the driver to be called.
--------
## 0.2.0 - 2017-04-30
### Added
* [Laravel] Compatibility with version 1.1 of laravel/dusk.
* [Element] Allow an element itself to be clicked on using Element::click() with no selector.
--------
## 0.1.1 - 2017-03-04
### Fixed
* [Element] Ensure Element::element() and Element::elements() return wrapper instance, and not RemoteWebElement instances.
--------
## 0.1.0 - 2017-02-26
### Added
* [Laravel] Compatibility with version 1.0 of laravel/dusk.
* [Drivers] A driver for Chrome.
* [Dusk] Add a screenshot() method.
-------- | 9 | 0.272727 | 9 | 0 |
3921b5a74f5c87fdd950b1892c5d83f2b08d4987 | build_release_uvision.bat | build_release_uvision.bat | mkdir uvision_release
git rev-parse --verify HEAD > uvision_release\git_info.txt
git diff --no-ext-diff --quiet --exit-code >> uvision_release\git_info.txt
echo Uncommitted Changes: %errorlevel% >> uvision_release\git_info.txt
virtualenv env
call env\Scripts\activate
pip install -r requirements.txt
pip freeze > uvision_release\build_requirements.txt
pgen export -t uvision -b
python tools/copy_release_files.py
| mkdir uvision_release
git rev-parse --verify HEAD > uvision_release\git_info.txt
git diff --no-ext-diff --quiet --exit-code >> uvision_release\git_info.txt
echo Uncommitted Changes: %errorlevel% >> uvision_release\git_info.txt
virtualenv env
call env\Scripts\activate
REM use project requirements if not specified
if [%1]==[] pip install -r requirements.txt
REM use custom requirements if specified
if not [%1]==[] pip install -r %1
pip freeze > uvision_release\build_requirements.txt
pgen export -t uvision -b
python tools/copy_release_files.py
| Allow requirements file to be specified for build | Allow requirements file to be specified for build
If a requirements file is specified as an argument to
build_release_uvision.bat use it to create the build. This allows
builds using older tools to be easily reproduced.
| Batchfile | apache-2.0 | sg-/DAPLink,google/DAPLink-port,google/DAPLink-port,sg-/DAPLink,sg-/DAPLink,google/DAPLink-port,google/DAPLink-port | batchfile | ## Code Before:
mkdir uvision_release
git rev-parse --verify HEAD > uvision_release\git_info.txt
git diff --no-ext-diff --quiet --exit-code >> uvision_release\git_info.txt
echo Uncommitted Changes: %errorlevel% >> uvision_release\git_info.txt
virtualenv env
call env\Scripts\activate
pip install -r requirements.txt
pip freeze > uvision_release\build_requirements.txt
pgen export -t uvision -b
python tools/copy_release_files.py
## Instruction:
Allow requirements file to be specified for build
If a requirements file is specified as an argument to
build_release_uvision.bat use it to create the build. This allows
builds using older tools to be easily reproduced.
## Code After:
mkdir uvision_release
git rev-parse --verify HEAD > uvision_release\git_info.txt
git diff --no-ext-diff --quiet --exit-code >> uvision_release\git_info.txt
echo Uncommitted Changes: %errorlevel% >> uvision_release\git_info.txt
virtualenv env
call env\Scripts\activate
REM use project requirements if not specified
if [%1]==[] pip install -r requirements.txt
REM use custom requirements if specified
if not [%1]==[] pip install -r %1
pip freeze > uvision_release\build_requirements.txt
pgen export -t uvision -b
python tools/copy_release_files.py
| mkdir uvision_release
git rev-parse --verify HEAD > uvision_release\git_info.txt
git diff --no-ext-diff --quiet --exit-code >> uvision_release\git_info.txt
echo Uncommitted Changes: %errorlevel% >> uvision_release\git_info.txt
virtualenv env
call env\Scripts\activate
+ REM use project requirements if not specified
- pip install -r requirements.txt
+ if [%1]==[] pip install -r requirements.txt
? ++++++++++++
+ REM use custom requirements if specified
+ if not [%1]==[] pip install -r %1
pip freeze > uvision_release\build_requirements.txt
pgen export -t uvision -b
python tools/copy_release_files.py | 5 | 0.5 | 4 | 1 |
b369652ed5114e432953b485b9c8f24ba5a2afc7 | test/s3-test.js | test/s3-test.js | describe('getFolders()', function() {
it('should return the correct list of folders', function() {
var objects = [
{ Key: '/' },
{ Key: 'test/' },
{ Key: 'test/test/' },
{ Key: 'test/a/b' },
{ Key: 'test' },
];
chai.expect(dodgercms.utils.getFolders(objects)).to.have.members(['/', 'test/', 'test/test/', 'test/a/']);
});
it('should return the root folder if the array is empty', function() {
var objects = [];
chai.expect(dodgercms.utils.getFolders(objects)).to.have.members(['/']);
});
});
describe('newFolder()', function(){
before(function(done) {
sinon
.stub(dodgercms.s3, 'putObject')
.yields(null, 'index');
done();
});
after(function(done) {
dodgercms.s3.putObject.restore();
done();
});
it('should match the given key', function(done){
dodgercms.utils.newFolder('index', 'dataBucket','siteBucket', function(err, key) {
if (err) {
return done(err);
}
chai.assert(key === 'index');
done();
});
});
}); | describe('init()', function() {
it('should throw exception on missing arguments', function() {
var fn = dodgercms.s3.init;
chai.expect(fn).to.throw(Error)
}); | Add some tests from the s3 lib | Add some tests from the s3 lib
| JavaScript | mit | etopian/dodgercms,ChrisZieba/dodgercms,ChrisZieba/dodgercms,etopian/dodgercms | javascript | ## Code Before:
describe('getFolders()', function() {
it('should return the correct list of folders', function() {
var objects = [
{ Key: '/' },
{ Key: 'test/' },
{ Key: 'test/test/' },
{ Key: 'test/a/b' },
{ Key: 'test' },
];
chai.expect(dodgercms.utils.getFolders(objects)).to.have.members(['/', 'test/', 'test/test/', 'test/a/']);
});
it('should return the root folder if the array is empty', function() {
var objects = [];
chai.expect(dodgercms.utils.getFolders(objects)).to.have.members(['/']);
});
});
describe('newFolder()', function(){
before(function(done) {
sinon
.stub(dodgercms.s3, 'putObject')
.yields(null, 'index');
done();
});
after(function(done) {
dodgercms.s3.putObject.restore();
done();
});
it('should match the given key', function(done){
dodgercms.utils.newFolder('index', 'dataBucket','siteBucket', function(err, key) {
if (err) {
return done(err);
}
chai.assert(key === 'index');
done();
});
});
});
## Instruction:
Add some tests from the s3 lib
## Code After:
describe('init()', function() {
it('should throw exception on missing arguments', function() {
var fn = dodgercms.s3.init;
chai.expect(fn).to.throw(Error)
}); | - describe('getFolders()', function() {
? ^^ -------
+ describe('init()', function() {
? ^^^
+ it('should throw exception on missing arguments', function() {
+ var fn = dodgercms.s3.init;
+ chai.expect(fn).to.throw(Error)
- it('should return the correct list of folders', function() {
- var objects = [
- { Key: '/' },
- { Key: 'test/' },
- { Key: 'test/test/' },
- { Key: 'test/a/b' },
- { Key: 'test' },
- ];
- chai.expect(dodgercms.utils.getFolders(objects)).to.have.members(['/', 'test/', 'test/test/', 'test/a/']);
- });
-
- it('should return the root folder if the array is empty', function() {
- var objects = [];
- chai.expect(dodgercms.utils.getFolders(objects)).to.have.members(['/']);
- });
});
-
- describe('newFolder()', function(){
- before(function(done) {
- sinon
- .stub(dodgercms.s3, 'putObject')
- .yields(null, 'index');
- done();
- });
-
- after(function(done) {
- dodgercms.s3.putObject.restore();
- done();
- });
-
- it('should match the given key', function(done){
- dodgercms.utils.newFolder('index', 'dataBucket','siteBucket', function(err, key) {
- if (err) {
- return done(err);
- }
- chai.assert(key === 'index');
- done();
- });
- });
- }); | 44 | 1.073171 | 4 | 40 |
7c923ad6d8f4ffa9c75a20223f632199fb7900a3 | .travis.yml | .travis.yml | language: scala
sudo: false
scala:
- 2.10.4
before_install:
- pip install --user codecov
after_success:
- codecov | language: scala
sudo: false
scala:
- 2.10.4
script:
- sbt clean coverage test
before_install:
- pip install --user codecov
after_success:
- codecov | Add coverage to the list | Add coverage to the list
| YAML | apache-2.0 | holdenk/spark-validator | yaml | ## Code Before:
language: scala
sudo: false
scala:
- 2.10.4
before_install:
- pip install --user codecov
after_success:
- codecov
## Instruction:
Add coverage to the list
## Code After:
language: scala
sudo: false
scala:
- 2.10.4
script:
- sbt clean coverage test
before_install:
- pip install --user codecov
after_success:
- codecov | language: scala
sudo: false
scala:
- 2.10.4
+ script:
+ - sbt clean coverage test
before_install:
- pip install --user codecov
after_success:
- codecov | 2 | 0.25 | 2 | 0 |
0f9db6601aecc7b01061ec94ba7b8819d38c4473 | src/config.js | src/config.js | import _ from 'lodash'
import mergeDefaults from 'merge-defaults'
_.mergeDefaults = mergeDefaults
class ConfigManager {
constructor() {
this.Riak = {
nodes: ["localhost:8098"]
}
this.GremlinServer = {
port: 8182,
host: "localhost",
options: {}
}
}
setRiakCluster(nodes) {
if(arguments.length === 1 && nodes instanceof Array)
this.Riak.nodes = nodes
else
this.Riak.nodes = [].slice.call(arguments)
}
setGremlinClientConfig(port, host, options) {
this.GremlinServer = _.mergeDefaults({
port: port,
host: host,
options: options
} || {}, this.GremlinServer)
}
}
export default new ConfigManager() | import _ from 'lodash'
import mergeDefaults from 'merge-defaults'
import is from 'is_js'
_.mergeDefaults = mergeDefaults
class ConfigManager {
constructor() {
this.Riak = {
nodes: ["localhost:8098"]
}
this.GremlinServer = {
port: 8182,
host: "localhost",
options: {}
}
}
setRiakCluster(nodes) {
if(arguments.length === 1 && is.array(nodes))
this.Riak.nodes = nodes
else
this.Riak.nodes = [].slice.call(arguments)
}
setGremlinClientConfig(port, host, options) {
this.GremlinServer = _.mergeDefaults({
port: port,
host: host,
options: options
} || {}, this.GremlinServer)
}
}
export default new ConfigManager() | Use is instead of instanceof to determine if it is an array | Use is instead of instanceof to determine if it is an array
| JavaScript | mit | celrenheit/topmodel,celrenheit/topmodel | javascript | ## Code Before:
import _ from 'lodash'
import mergeDefaults from 'merge-defaults'
_.mergeDefaults = mergeDefaults
class ConfigManager {
constructor() {
this.Riak = {
nodes: ["localhost:8098"]
}
this.GremlinServer = {
port: 8182,
host: "localhost",
options: {}
}
}
setRiakCluster(nodes) {
if(arguments.length === 1 && nodes instanceof Array)
this.Riak.nodes = nodes
else
this.Riak.nodes = [].slice.call(arguments)
}
setGremlinClientConfig(port, host, options) {
this.GremlinServer = _.mergeDefaults({
port: port,
host: host,
options: options
} || {}, this.GremlinServer)
}
}
export default new ConfigManager()
## Instruction:
Use is instead of instanceof to determine if it is an array
## Code After:
import _ from 'lodash'
import mergeDefaults from 'merge-defaults'
import is from 'is_js'
_.mergeDefaults = mergeDefaults
class ConfigManager {
constructor() {
this.Riak = {
nodes: ["localhost:8098"]
}
this.GremlinServer = {
port: 8182,
host: "localhost",
options: {}
}
}
setRiakCluster(nodes) {
if(arguments.length === 1 && is.array(nodes))
this.Riak.nodes = nodes
else
this.Riak.nodes = [].slice.call(arguments)
}
setGremlinClientConfig(port, host, options) {
this.GremlinServer = _.mergeDefaults({
port: port,
host: host,
options: options
} || {}, this.GremlinServer)
}
}
export default new ConfigManager() | import _ from 'lodash'
import mergeDefaults from 'merge-defaults'
+ import is from 'is_js'
_.mergeDefaults = mergeDefaults
class ConfigManager {
constructor() {
this.Riak = {
nodes: ["localhost:8098"]
}
this.GremlinServer = {
port: 8182,
host: "localhost",
options: {}
}
}
setRiakCluster(nodes) {
- if(arguments.length === 1 && nodes instanceof Array)
+ if(arguments.length === 1 && is.array(nodes))
this.Riak.nodes = nodes
else
this.Riak.nodes = [].slice.call(arguments)
}
setGremlinClientConfig(port, host, options) {
this.GremlinServer = _.mergeDefaults({
port: port,
host: host,
options: options
} || {}, this.GremlinServer)
}
}
export default new ConfigManager() | 3 | 0.09375 | 2 | 1 |
f8cbb96f2d5040d060799f62b642e8bb80060d07 | setup.py | setup.py | from distribute_setup import use_setuptools
use_setuptools()
from aero.__version__ import __version__, __title__, __authors__, __email__, __license__, __url__, __download_url__
from setuptools import setup
setup(
name = __title__,
author = __authors__,
author_email = __email__,
version = __version__,
license = __license__,
url = __url__,
download_url = __download_url__,
packages = ['aero', 'aero.adapters'],
package_data ={'aero': ['assets/*.ascii']},
description = [descr for descr in open('README.txt').read().splitlines() if descr.strip() and '===' not in descr][1],
long_description=open('README.txt').read(),
scripts = ["aero/aero"],
)
| from distribute_setup import use_setuptools
use_setuptools()
from aero.__version__ import __version__, __title__, __authors__, __email__, __license__, __url__, __download_url__
from setuptools import setup
setup(
name = __title__,
author = __authors__,
author_email = __email__,
version = __version__,
license = __license__,
url = __url__,
download_url = __download_url__,
packages = ['aero', 'aero.adapters'],
package_data ={'aero': ['assets/*.ascii']},
description = [descr for descr in open('README.txt').read().splitlines() if descr.strip() and '===' not in descr][1],
long_description=open('README.txt').read(),
install_requires = ["argparse","Beaker","PyYAML"],
scripts = ["aero/aero"],
)
| Add project dependencies to install | Add project dependencies to install
| Python | bsd-3-clause | Aeronautics/aero | python | ## Code Before:
from distribute_setup import use_setuptools
use_setuptools()
from aero.__version__ import __version__, __title__, __authors__, __email__, __license__, __url__, __download_url__
from setuptools import setup
setup(
name = __title__,
author = __authors__,
author_email = __email__,
version = __version__,
license = __license__,
url = __url__,
download_url = __download_url__,
packages = ['aero', 'aero.adapters'],
package_data ={'aero': ['assets/*.ascii']},
description = [descr for descr in open('README.txt').read().splitlines() if descr.strip() and '===' not in descr][1],
long_description=open('README.txt').read(),
scripts = ["aero/aero"],
)
## Instruction:
Add project dependencies to install
## Code After:
from distribute_setup import use_setuptools
use_setuptools()
from aero.__version__ import __version__, __title__, __authors__, __email__, __license__, __url__, __download_url__
from setuptools import setup
setup(
name = __title__,
author = __authors__,
author_email = __email__,
version = __version__,
license = __license__,
url = __url__,
download_url = __download_url__,
packages = ['aero', 'aero.adapters'],
package_data ={'aero': ['assets/*.ascii']},
description = [descr for descr in open('README.txt').read().splitlines() if descr.strip() and '===' not in descr][1],
long_description=open('README.txt').read(),
install_requires = ["argparse","Beaker","PyYAML"],
scripts = ["aero/aero"],
)
| from distribute_setup import use_setuptools
use_setuptools()
from aero.__version__ import __version__, __title__, __authors__, __email__, __license__, __url__, __download_url__
from setuptools import setup
setup(
name = __title__,
author = __authors__,
author_email = __email__,
version = __version__,
license = __license__,
url = __url__,
download_url = __download_url__,
packages = ['aero', 'aero.adapters'],
package_data ={'aero': ['assets/*.ascii']},
description = [descr for descr in open('README.txt').read().splitlines() if descr.strip() and '===' not in descr][1],
long_description=open('README.txt').read(),
+ install_requires = ["argparse","Beaker","PyYAML"],
scripts = ["aero/aero"],
) | 1 | 0.047619 | 1 | 0 |
bdfc949f40eef5f43febb7e1fb2e53874fad399f | source/assets/javascripts/syntax-highlight.js | source/assets/javascripts/syntax-highlight.js | import hljs from 'highlight.js/lib/highlight';
import javascript from 'highlight.js/lib/languages/javascript';
import ruby from 'highlight.js/lib/languages/ruby';
import elixir from 'highlight.js/lib/languages/elixir';
import shell from 'highlight.js/lib/languages/shell';
import bash from 'highlight.js/lib/languages/bash';
import css from 'highlight.js/lib/languages/css';
import nginx from 'highlight.js/lib/languages/nginx';
import json from 'highlight.js/lib/languages/json';
const languages = {
javascript,
ruby,
elixir,
shell,
bash,
css,
nginx,
json,
};
Object.entries(languages).forEach(([name, language]) => {
hljs.registerLanguage(name, language);
});
hljs.initHighlightingOnLoad();
| import highlight from 'highlight.js/lib/highlight';
import bash from 'highlight.js/lib/languages/bash';
import css from 'highlight.js/lib/languages/css';
import elixir from 'highlight.js/lib/languages/elixir';
import html from 'highlight.js/lib/languages/html';
import javascript from 'highlight.js/lib/languages/javascript';
import json from 'highlight.js/lib/languages/json';
import nginx from 'highlight.js/lib/languages/nginx';
import ruby from 'highlight.js/lib/languages/ruby';
import shell from 'highlight.js/lib/languages/shell';
import yaml from 'highlight.js/lib/languages/yaml';
const languages = {
bash,
css,
elixir,
html,
javascript,
json,
nginx,
ruby,
shell,
yaml,
};
Object.entries(languages).forEach(([name, language]) => {
highlight.registerLanguage(name, language);
});
highlight.initHighlightingOnLoad();
| Add more languages to highlight | Add more languages to highlight
| JavaScript | mit | rossta/rossta.github.com,rossta/rossta.github.com,rossta/rossta.github.com | javascript | ## Code Before:
import hljs from 'highlight.js/lib/highlight';
import javascript from 'highlight.js/lib/languages/javascript';
import ruby from 'highlight.js/lib/languages/ruby';
import elixir from 'highlight.js/lib/languages/elixir';
import shell from 'highlight.js/lib/languages/shell';
import bash from 'highlight.js/lib/languages/bash';
import css from 'highlight.js/lib/languages/css';
import nginx from 'highlight.js/lib/languages/nginx';
import json from 'highlight.js/lib/languages/json';
const languages = {
javascript,
ruby,
elixir,
shell,
bash,
css,
nginx,
json,
};
Object.entries(languages).forEach(([name, language]) => {
hljs.registerLanguage(name, language);
});
hljs.initHighlightingOnLoad();
## Instruction:
Add more languages to highlight
## Code After:
import highlight from 'highlight.js/lib/highlight';
import bash from 'highlight.js/lib/languages/bash';
import css from 'highlight.js/lib/languages/css';
import elixir from 'highlight.js/lib/languages/elixir';
import html from 'highlight.js/lib/languages/html';
import javascript from 'highlight.js/lib/languages/javascript';
import json from 'highlight.js/lib/languages/json';
import nginx from 'highlight.js/lib/languages/nginx';
import ruby from 'highlight.js/lib/languages/ruby';
import shell from 'highlight.js/lib/languages/shell';
import yaml from 'highlight.js/lib/languages/yaml';
const languages = {
bash,
css,
elixir,
html,
javascript,
json,
nginx,
ruby,
shell,
yaml,
};
Object.entries(languages).forEach(([name, language]) => {
highlight.registerLanguage(name, language);
});
highlight.initHighlightingOnLoad();
| - import hljs from 'highlight.js/lib/highlight';
? ^^
+ import highlight from 'highlight.js/lib/highlight';
? +++ ^^^^
+
- import javascript from 'highlight.js/lib/languages/javascript';
- import ruby from 'highlight.js/lib/languages/ruby';
- import elixir from 'highlight.js/lib/languages/elixir';
- import shell from 'highlight.js/lib/languages/shell';
import bash from 'highlight.js/lib/languages/bash';
import css from 'highlight.js/lib/languages/css';
+ import elixir from 'highlight.js/lib/languages/elixir';
+ import html from 'highlight.js/lib/languages/html';
+ import javascript from 'highlight.js/lib/languages/javascript';
+ import json from 'highlight.js/lib/languages/json';
import nginx from 'highlight.js/lib/languages/nginx';
+ import ruby from 'highlight.js/lib/languages/ruby';
- import json from 'highlight.js/lib/languages/json';
? - ^^ - ^^
+ import shell from 'highlight.js/lib/languages/shell';
? ^^^^ ^^^^
+ import yaml from 'highlight.js/lib/languages/yaml';
const languages = {
- javascript,
- ruby,
- elixir,
- shell,
bash,
css,
+ elixir,
+ html,
+ javascript,
+ json,
nginx,
- json,
+ ruby,
+ shell,
+ yaml,
};
Object.entries(languages).forEach(([name, language]) => {
- hljs.registerLanguage(name, language);
? ^^
+ highlight.registerLanguage(name, language);
? +++ ^^^^
});
- hljs.initHighlightingOnLoad();
? ^^
+ highlight.initHighlightingOnLoad();
? +++ ^^^^
| 31 | 1.192308 | 18 | 13 |
28f808e26b2a298e9fcb029dda79421defae6fdb | src/react-chayns-upload/README.md | src/react-chayns-upload/README.md |
The FileUpload-Component is part of the *chayns-components* package. It can be installed via npm:
npm install -S chayns-components@latest
## Usage ##
At first the component needs to be imported:
```jsx
import { FileUpload } from 'chayns-components';
import 'chayns-components/lib/react-chayns-upload/index.css';
```
The component can be used in JSX like in the following example:
```jsx
<FileUpload onChange={(files) => console.log(files)} />
```
## Props ##
| Property | Description | Type | Default Value |
|------------|----------------------------------------------------------------------------|----------|---------------|
| onChange | Callback-function (parameter: files, validFiles, invalidFiles) | function | |
| type | Allowed types (currently supported: all, images) | String | all |
| multiple | Enables/Disables upload of multiple files | Bool | true |
| className | CSS-classes that should be set on root-element | String | |
## Example ##
### single image upload ###
```jsx
<FileUpload
multiple={false}
type="images"
onChange={(files, validFiles) => {
console.log(`You have selected ${files.length} files of which ${validFiles.length} are valid`);
}}
/>
``` |
The FileUpload-Component is part of the *chayns-components* package. It can be installed via npm:
npm install -S chayns-components@latest
## Usage ##
At first the component needs to be imported:
```jsx
import { FileUpload } from 'chayns-components';
import 'chayns-components/lib/react-chayns-upload/index.css';
```
The component can be used in JSX like in the following example:
```jsx
<FileUpload onChange={(files) => console.log(files)} />
```
## Props ##
| Property | Description | Type | Default Value |
|------------|----------------------------------------------------------------------------|----------|---------------|
| onChange | Callback-function (parameter: files, validFiles, invalidFiles) | function | |
| type | Allowed types (currently supported: all, image, audio, video) | String | all |
| multiple | Enables/Disables upload of multiple files | Bool | true |
| className | CSS-classes that should be set on root-element | String | |
## Example ##
### single image upload ###
```jsx
<FileUpload
multiple={false}
type="images"
onChange={(files, validFiles) => {
console.log(`You have selected ${files.length} files of which ${validFiles.length} are valid`);
}}
/>
``` | Update readme with new types | Update readme with new types
| Markdown | mit | TobitSoftware/chayns-components,TobitSoftware/chayns-components,TobitSoftware/chayns-components | markdown | ## Code Before:
The FileUpload-Component is part of the *chayns-components* package. It can be installed via npm:
npm install -S chayns-components@latest
## Usage ##
At first the component needs to be imported:
```jsx
import { FileUpload } from 'chayns-components';
import 'chayns-components/lib/react-chayns-upload/index.css';
```
The component can be used in JSX like in the following example:
```jsx
<FileUpload onChange={(files) => console.log(files)} />
```
## Props ##
| Property | Description | Type | Default Value |
|------------|----------------------------------------------------------------------------|----------|---------------|
| onChange | Callback-function (parameter: files, validFiles, invalidFiles) | function | |
| type | Allowed types (currently supported: all, images) | String | all |
| multiple | Enables/Disables upload of multiple files | Bool | true |
| className | CSS-classes that should be set on root-element | String | |
## Example ##
### single image upload ###
```jsx
<FileUpload
multiple={false}
type="images"
onChange={(files, validFiles) => {
console.log(`You have selected ${files.length} files of which ${validFiles.length} are valid`);
}}
/>
```
## Instruction:
Update readme with new types
## Code After:
The FileUpload-Component is part of the *chayns-components* package. It can be installed via npm:
npm install -S chayns-components@latest
## Usage ##
At first the component needs to be imported:
```jsx
import { FileUpload } from 'chayns-components';
import 'chayns-components/lib/react-chayns-upload/index.css';
```
The component can be used in JSX like in the following example:
```jsx
<FileUpload onChange={(files) => console.log(files)} />
```
## Props ##
| Property | Description | Type | Default Value |
|------------|----------------------------------------------------------------------------|----------|---------------|
| onChange | Callback-function (parameter: files, validFiles, invalidFiles) | function | |
| type | Allowed types (currently supported: all, image, audio, video) | String | all |
| multiple | Enables/Disables upload of multiple files | Bool | true |
| className | CSS-classes that should be set on root-element | String | |
## Example ##
### single image upload ###
```jsx
<FileUpload
multiple={false}
type="images"
onChange={(files, validFiles) => {
console.log(`You have selected ${files.length} files of which ${validFiles.length} are valid`);
}}
/>
``` |
The FileUpload-Component is part of the *chayns-components* package. It can be installed via npm:
npm install -S chayns-components@latest
## Usage ##
At first the component needs to be imported:
```jsx
import { FileUpload } from 'chayns-components';
import 'chayns-components/lib/react-chayns-upload/index.css';
```
The component can be used in JSX like in the following example:
```jsx
<FileUpload onChange={(files) => console.log(files)} />
```
## Props ##
| Property | Description | Type | Default Value |
|------------|----------------------------------------------------------------------------|----------|---------------|
| onChange | Callback-function (parameter: files, validFiles, invalidFiles) | function | |
- | type | Allowed types (currently supported: all, images) | String | all |
? ^ -------------
+ | type | Allowed types (currently supported: all, image, audio, video) | String | all |
? ^^^^^^^^^^^^^^
| multiple | Enables/Disables upload of multiple files | Bool | true |
| className | CSS-classes that should be set on root-element | String | |
## Example ##
### single image upload ###
```jsx
<FileUpload
multiple={false}
type="images"
onChange={(files, validFiles) => {
console.log(`You have selected ${files.length} files of which ${validFiles.length} are valid`);
}}
/>
``` | 2 | 0.05 | 1 | 1 |
1ac408cb97c3407cae0aa9cd25d24371bd90b4f6 | cf-cli.rb | cf-cli.rb | require 'formula'
class CfCli < Formula
homepage 'https://github.com/cloudfoundry/cli'
head 'https://cli.run.pivotal.io/edge?arch=macosx64&source=homebrew'
url 'https://cli.run.pivotal.io/stable?release=macosx64-binary&version=6.18.0&source=homebrew'
version '6.18.0'
sha256 '9a60d7542a7cbc46b31aa82fea91b7fc06fbdbecd09e39a31ce01c44cd7065c5'
depends_on :arch => :x86_64
conflicts_with "pivotal/tap/cloudfoundry-cli", :because => "the Pivotal tap ships an older cli distribution"
conflicts_with "caskroom/cask/cloudfoundry-cli", :because => "the caskroom tap is not the official distribution"
def install
bin.install 'cf'
end
test do
system "#{bin}/cf"
end
end
| require 'formula'
class CfCli < Formula
homepage 'https://github.com/cloudfoundry/cli'
head 'https://cli.run.pivotal.io/edge?arch=macosx64&source=homebrew'
url 'https://cli.run.pivotal.io/stable?release=macosx64-binary&version=6.18.0&source=homebrew'
version '6.18.0'
sha256 '0fc455d33b990e8c463e77f6a3218e7d8df1d54a851276985318254dcfb3576f'
depends_on :arch => :x86_64
conflicts_with "pivotal/tap/cloudfoundry-cli", :because => "the Pivotal tap ships an older cli distribution"
conflicts_with "caskroom/cask/cloudfoundry-cli", :because => "the caskroom tap is not the official distribution"
def install
bin.install 'cf'
end
test do
system "#{bin}/cf"
end
end
| Update the sha256 of 6.18.0 | Update the sha256 of 6.18.0
[fixes #119335073]
| Ruby | apache-2.0 | ishustava/homebrew-tap | ruby | ## Code Before:
require 'formula'
class CfCli < Formula
homepage 'https://github.com/cloudfoundry/cli'
head 'https://cli.run.pivotal.io/edge?arch=macosx64&source=homebrew'
url 'https://cli.run.pivotal.io/stable?release=macosx64-binary&version=6.18.0&source=homebrew'
version '6.18.0'
sha256 '9a60d7542a7cbc46b31aa82fea91b7fc06fbdbecd09e39a31ce01c44cd7065c5'
depends_on :arch => :x86_64
conflicts_with "pivotal/tap/cloudfoundry-cli", :because => "the Pivotal tap ships an older cli distribution"
conflicts_with "caskroom/cask/cloudfoundry-cli", :because => "the caskroom tap is not the official distribution"
def install
bin.install 'cf'
end
test do
system "#{bin}/cf"
end
end
## Instruction:
Update the sha256 of 6.18.0
[fixes #119335073]
## Code After:
require 'formula'
class CfCli < Formula
homepage 'https://github.com/cloudfoundry/cli'
head 'https://cli.run.pivotal.io/edge?arch=macosx64&source=homebrew'
url 'https://cli.run.pivotal.io/stable?release=macosx64-binary&version=6.18.0&source=homebrew'
version '6.18.0'
sha256 '0fc455d33b990e8c463e77f6a3218e7d8df1d54a851276985318254dcfb3576f'
depends_on :arch => :x86_64
conflicts_with "pivotal/tap/cloudfoundry-cli", :because => "the Pivotal tap ships an older cli distribution"
conflicts_with "caskroom/cask/cloudfoundry-cli", :because => "the caskroom tap is not the official distribution"
def install
bin.install 'cf'
end
test do
system "#{bin}/cf"
end
end
| require 'formula'
class CfCli < Formula
homepage 'https://github.com/cloudfoundry/cli'
head 'https://cli.run.pivotal.io/edge?arch=macosx64&source=homebrew'
url 'https://cli.run.pivotal.io/stable?release=macosx64-binary&version=6.18.0&source=homebrew'
version '6.18.0'
- sha256 '9a60d7542a7cbc46b31aa82fea91b7fc06fbdbecd09e39a31ce01c44cd7065c5'
+ sha256 '0fc455d33b990e8c463e77f6a3218e7d8df1d54a851276985318254dcfb3576f'
depends_on :arch => :x86_64
conflicts_with "pivotal/tap/cloudfoundry-cli", :because => "the Pivotal tap ships an older cli distribution"
conflicts_with "caskroom/cask/cloudfoundry-cli", :because => "the caskroom tap is not the official distribution"
def install
bin.install 'cf'
end
test do
system "#{bin}/cf"
end
end | 2 | 0.090909 | 1 | 1 |
3d1fd4cff97d29c78dac43d60890fa02f0b2ca70 | test/fixtures/iczn_groups.yml | test/fixtures/iczn_groups.yml | kingdom:
name: 'kingdom'
level: 100
htg:
name: 'htg'
level: 200
genus:
name: 'genus'
level: 400
species:
name: 'species'
level: 500
subspecies:
name: 'subspecies'
level: 600
| kingdom:
name: 'kingdom'
level: 100
projects: project2, project3
htg:
name: 'htg'
level: 200
projects: project3
genus:
name: 'genus'
level: 400
projects: project1
species:
name: 'species'
level: 500
projects: project2
subspecies:
name: 'subspecies'
level: 600
projects: project1
| Fix project/iczn_group linkage in test fixtures | Fix project/iczn_group linkage in test fixtures
| YAML | mit | NESCent/TraitDB,NESCent/TraitDB,NESCent/TraitDB | yaml | ## Code Before:
kingdom:
name: 'kingdom'
level: 100
htg:
name: 'htg'
level: 200
genus:
name: 'genus'
level: 400
species:
name: 'species'
level: 500
subspecies:
name: 'subspecies'
level: 600
## Instruction:
Fix project/iczn_group linkage in test fixtures
## Code After:
kingdom:
name: 'kingdom'
level: 100
projects: project2, project3
htg:
name: 'htg'
level: 200
projects: project3
genus:
name: 'genus'
level: 400
projects: project1
species:
name: 'species'
level: 500
projects: project2
subspecies:
name: 'subspecies'
level: 600
projects: project1
| kingdom:
name: 'kingdom'
level: 100
+ projects: project2, project3
htg:
name: 'htg'
level: 200
+ projects: project3
+
genus:
name: 'genus'
level: 400
+ projects: project1
species:
name: 'species'
level: 500
+ projects: project2
+
subspecies:
name: 'subspecies'
level: 600
+ projects: project1 | 7 | 0.368421 | 7 | 0 |
318c98ab5a9710dfdeedc0ee893e87993ac49727 | robosync/test/test_robosync.py | robosync/test/test_robosync.py | import unittest
import os
import shutil
class testMirror(unittest.TestCase):
def setUp(self):
os.mkdir('test_source')
os.mkdir('test_dest')
source_dirs = ['dir1', 'dir2', 'dir3']
filenames = ['file1.txt', 'file2.txt', 'file3.txt']
contents = ['foobar1', 'foobar2', 'foobar3']
for d_name, f_name, content, in zip(source_dirs, filenames, contents):
new_dir = os.path.join('test_source', d_name)
os.mkdir(new_dir)
with open(os.path.join('test_source', d_name, f_name), 'w') as f:
f.write(content)
def tearDown(self):
shutil.rmtree('test_source')
shutil.rmtree('test_dest')
def test_mirror(self):
pass
if __name__ == '__main__':
unittest.main()
| import unittest
import os
import shutil
class testMirror(unittest.TestCase):
def setUp(self):
os.mkdir('test_source')
os.mkdir('test_dest')
source_dirs = ['dir1', 'dir2', 'dir3']
dest_dirs = ['dir1_c', 'dir2_c', 'dir3_c']
filenames = ['file1.txt', 'file2.txt', 'file3.txt']
contents = ['foobar1', 'foobar2', 'foobar3']
with open('source_file.txt', 'w') as f:
f.write('\n'.join(source_dirs))
with open('dest_file.txt', 'w') as f:
f.write('\n'.join(dest_dirs))
for d_name, f_name, content, in zip(source_dirs, filenames, contents):
new_dir = os.path.join('test_source', d_name)
os.mkdir(new_dir)
with open(os.path.join('test_source', d_name, f_name), 'w') as f:
f.write(content)
def tearDown(self):
shutil.rmtree('test_source')
shutil.rmtree('test_dest')
os.remove('source_file.txt')
os.remove('dest_file.txt')
def test_mirror(self):
pass
if __name__ == '__main__':
unittest.main()
| Add source and destination list to setup and teardown | Add source and destination list to setup and teardown
| Python | mit | rbn920/robosync | python | ## Code Before:
import unittest
import os
import shutil
class testMirror(unittest.TestCase):
def setUp(self):
os.mkdir('test_source')
os.mkdir('test_dest')
source_dirs = ['dir1', 'dir2', 'dir3']
filenames = ['file1.txt', 'file2.txt', 'file3.txt']
contents = ['foobar1', 'foobar2', 'foobar3']
for d_name, f_name, content, in zip(source_dirs, filenames, contents):
new_dir = os.path.join('test_source', d_name)
os.mkdir(new_dir)
with open(os.path.join('test_source', d_name, f_name), 'w') as f:
f.write(content)
def tearDown(self):
shutil.rmtree('test_source')
shutil.rmtree('test_dest')
def test_mirror(self):
pass
if __name__ == '__main__':
unittest.main()
## Instruction:
Add source and destination list to setup and teardown
## Code After:
import unittest
import os
import shutil
class testMirror(unittest.TestCase):
def setUp(self):
os.mkdir('test_source')
os.mkdir('test_dest')
source_dirs = ['dir1', 'dir2', 'dir3']
dest_dirs = ['dir1_c', 'dir2_c', 'dir3_c']
filenames = ['file1.txt', 'file2.txt', 'file3.txt']
contents = ['foobar1', 'foobar2', 'foobar3']
with open('source_file.txt', 'w') as f:
f.write('\n'.join(source_dirs))
with open('dest_file.txt', 'w') as f:
f.write('\n'.join(dest_dirs))
for d_name, f_name, content, in zip(source_dirs, filenames, contents):
new_dir = os.path.join('test_source', d_name)
os.mkdir(new_dir)
with open(os.path.join('test_source', d_name, f_name), 'w') as f:
f.write(content)
def tearDown(self):
shutil.rmtree('test_source')
shutil.rmtree('test_dest')
os.remove('source_file.txt')
os.remove('dest_file.txt')
def test_mirror(self):
pass
if __name__ == '__main__':
unittest.main()
| import unittest
import os
import shutil
class testMirror(unittest.TestCase):
def setUp(self):
os.mkdir('test_source')
os.mkdir('test_dest')
source_dirs = ['dir1', 'dir2', 'dir3']
+ dest_dirs = ['dir1_c', 'dir2_c', 'dir3_c']
filenames = ['file1.txt', 'file2.txt', 'file3.txt']
contents = ['foobar1', 'foobar2', 'foobar3']
+ with open('source_file.txt', 'w') as f:
+ f.write('\n'.join(source_dirs))
+
+ with open('dest_file.txt', 'w') as f:
+ f.write('\n'.join(dest_dirs))
+
for d_name, f_name, content, in zip(source_dirs, filenames, contents):
new_dir = os.path.join('test_source', d_name)
os.mkdir(new_dir)
with open(os.path.join('test_source', d_name, f_name), 'w') as f:
f.write(content)
def tearDown(self):
shutil.rmtree('test_source')
shutil.rmtree('test_dest')
+ os.remove('source_file.txt')
+ os.remove('dest_file.txt')
def test_mirror(self):
pass
if __name__ == '__main__':
unittest.main() | 9 | 0.310345 | 9 | 0 |
4d987019e67439f3d1c30d617da6f2a040a18914 | src/filter-statement/FilterStatementInterface.php | src/filter-statement/FilterStatementInterface.php | <?php
namespace UWDOEM\Framework\FilterStatement;
use Propel\Runtime\ActiveQuery\ModelCriteria;
interface FilterStatementInterface {
const COND_SORT_ASC = 1;
const COND_SORT_DESC = 2;
const COND_LESS_THAN = 3;
const COND_GREATER_THAN = 4;
const COND_EQUAL_TO = 5;
const COND_NOT_EQUAL_TO = 6;
const COND_CONTAINS = 7;
const COND_PAGINATE_BY = 8;
/**
* @return string
*/
public function getFieldName();
/**
* @return string
*/
public function getCondition();
/**
* @return mixed
*/
public function getCriterion();
/**
* @return mixed
*/
public function getControl();
/**
* @param ModelCriteria $query
* @return ModelCriteria
*/
public function applyToQuery(ModelCriteria $query);
/**
* @param \UWDOEM\Framework\Row\Row[] $rows
* @return \UWDOEM\Framework\Row\Row[]
*/
public function applyToRows(array $rows);
} | <?php
namespace UWDOEM\Framework\FilterStatement;
use Propel\Runtime\ActiveQuery\ModelCriteria;
interface FilterStatementInterface {
const COND_SORT_ASC = "ascending";
const COND_SORT_DESC = "descending";
const COND_LESS_THAN = 3;
const COND_GREATER_THAN = 4;
const COND_EQUAL_TO = 5;
const COND_NOT_EQUAL_TO = 6;
const COND_CONTAINS = 7;
const COND_PAGINATE_BY = 8;
/**
* @return string
*/
public function getFieldName();
/**
* @return string
*/
public function getCondition();
/**
* @return mixed
*/
public function getCriterion();
/**
* @return mixed
*/
public function getControl();
/**
* @param ModelCriteria $query
* @return ModelCriteria
*/
public function applyToQuery(ModelCriteria $query);
/**
* @param \UWDOEM\Framework\Row\Row[] $rows
* @return \UWDOEM\Framework\Row\Row[]
*/
public function applyToRows(array $rows);
} | Make more use-friendly constants for sort ascending, descending. | Make more use-friendly constants for sort ascending, descending.
| PHP | mit | AthensFramework/core,AthensFramework/core,AthensFramework/core,AthensFramework/core | php | ## Code Before:
<?php
namespace UWDOEM\Framework\FilterStatement;
use Propel\Runtime\ActiveQuery\ModelCriteria;
interface FilterStatementInterface {
const COND_SORT_ASC = 1;
const COND_SORT_DESC = 2;
const COND_LESS_THAN = 3;
const COND_GREATER_THAN = 4;
const COND_EQUAL_TO = 5;
const COND_NOT_EQUAL_TO = 6;
const COND_CONTAINS = 7;
const COND_PAGINATE_BY = 8;
/**
* @return string
*/
public function getFieldName();
/**
* @return string
*/
public function getCondition();
/**
* @return mixed
*/
public function getCriterion();
/**
* @return mixed
*/
public function getControl();
/**
* @param ModelCriteria $query
* @return ModelCriteria
*/
public function applyToQuery(ModelCriteria $query);
/**
* @param \UWDOEM\Framework\Row\Row[] $rows
* @return \UWDOEM\Framework\Row\Row[]
*/
public function applyToRows(array $rows);
}
## Instruction:
Make more use-friendly constants for sort ascending, descending.
## Code After:
<?php
namespace UWDOEM\Framework\FilterStatement;
use Propel\Runtime\ActiveQuery\ModelCriteria;
interface FilterStatementInterface {
const COND_SORT_ASC = "ascending";
const COND_SORT_DESC = "descending";
const COND_LESS_THAN = 3;
const COND_GREATER_THAN = 4;
const COND_EQUAL_TO = 5;
const COND_NOT_EQUAL_TO = 6;
const COND_CONTAINS = 7;
const COND_PAGINATE_BY = 8;
/**
* @return string
*/
public function getFieldName();
/**
* @return string
*/
public function getCondition();
/**
* @return mixed
*/
public function getCriterion();
/**
* @return mixed
*/
public function getControl();
/**
* @param ModelCriteria $query
* @return ModelCriteria
*/
public function applyToQuery(ModelCriteria $query);
/**
* @param \UWDOEM\Framework\Row\Row[] $rows
* @return \UWDOEM\Framework\Row\Row[]
*/
public function applyToRows(array $rows);
} | <?php
namespace UWDOEM\Framework\FilterStatement;
use Propel\Runtime\ActiveQuery\ModelCriteria;
interface FilterStatementInterface {
- const COND_SORT_ASC = 1;
? ^
+ const COND_SORT_ASC = "ascending";
? ^^^^^^^^^^^
- const COND_SORT_DESC = 2;
? ^
+ const COND_SORT_DESC = "descending";
? ^^^^^^^^^^^^
const COND_LESS_THAN = 3;
const COND_GREATER_THAN = 4;
const COND_EQUAL_TO = 5;
const COND_NOT_EQUAL_TO = 6;
const COND_CONTAINS = 7;
const COND_PAGINATE_BY = 8;
/**
* @return string
*/
public function getFieldName();
/**
* @return string
*/
public function getCondition();
/**
* @return mixed
*/
public function getCriterion();
/**
* @return mixed
*/
public function getControl();
/**
* @param ModelCriteria $query
* @return ModelCriteria
*/
public function applyToQuery(ModelCriteria $query);
/**
* @param \UWDOEM\Framework\Row\Row[] $rows
* @return \UWDOEM\Framework\Row\Row[]
*/
public function applyToRows(array $rows);
} | 4 | 0.078431 | 2 | 2 |
33a4779930c35d0576387f72d237e9834a741cb2 | .travis.yml | .travis.yml | language: node_js
node_js:
- "4"
- "5"
- "6"
- "7"
- "8"
- "9"
sudo: false
install:
- npm install -g codecov
- npm install
script:
- npm run lint
- npm run flow check
- npm test
after_success:
- codecov
| language: node_js
node_js:
- "6"
- "7"
- "8"
- "9"
sudo: false
install:
- npm install -g codecov
- npm install
script:
- npm run lint
- npm run flow check
- npm test
after_success:
- codecov
| Stop testing on EOL Node.js versions | Stop testing on EOL Node.js versions
| YAML | mit | DvdGiessen/virtual-clock | yaml | ## Code Before:
language: node_js
node_js:
- "4"
- "5"
- "6"
- "7"
- "8"
- "9"
sudo: false
install:
- npm install -g codecov
- npm install
script:
- npm run lint
- npm run flow check
- npm test
after_success:
- codecov
## Instruction:
Stop testing on EOL Node.js versions
## Code After:
language: node_js
node_js:
- "6"
- "7"
- "8"
- "9"
sudo: false
install:
- npm install -g codecov
- npm install
script:
- npm run lint
- npm run flow check
- npm test
after_success:
- codecov
| language: node_js
node_js:
- - "4"
- - "5"
- "6"
- "7"
- "8"
- "9"
sudo: false
install:
- npm install -g codecov
- npm install
script:
- npm run lint
- npm run flow check
- npm test
after_success:
- codecov | 2 | 0.111111 | 0 | 2 |
88cfe216c518e1e742f127140e2ea2a81c9508be | package.json | package.json | {
"name": "jQuery.serializeObject",
"version": "2.0.2",
"description": "A jQuery plugin to turn form data into JSON",
"main": "jquery.serializeObject.js",
"directories": {
"test": "test"
},
"scripts": {
"pretest": "git submodule update --init",
"test": "grunt"
},
"repository": {
"type": "git",
"url": "git://github.com/hongymagic/jQuery.serializeObject.git"
},
"keywords": [
"jquery",
"serialize",
"object",
"json",
"serializeJSON",
"serializeObject"
],
"author": "David G. Hong",
"license": "MIT",
"gitHead": "7789084425b353624fc95487024459f364d11df6",
"readmeFilename": "README.markdown",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-uglify": "~0.2.0",
"grunt-contrib-jshint": "~0.4.3",
"grunt-contrib-qunit": "~0.2.1"
}
}
| {
"name": "jQuery.serializeObject",
"version": "2.0.2",
"description": "A jQuery plugin to turn form data into JSON",
"main": "jquery.serializeObject.js",
"directories": {
"test": "test"
},
"scripts": {
"pretest": "git submodule update --init --recursive && git submodule foreach --recursive git pull origin master && cd tools/jquery && npm install && grunt",
"test": "grunt"
},
"repository": {
"type": "git",
"url": "git://github.com/hongymagic/jQuery.serializeObject.git"
},
"keywords": [
"jquery",
"serialize",
"object",
"json",
"serializeJSON",
"serializeObject"
],
"author": "David G. Hong",
"license": "MIT",
"gitHead": "7789084425b353624fc95487024459f364d11df6",
"readmeFilename": "README.markdown",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-uglify": "~0.2.0",
"grunt-contrib-jshint": "~0.4.3",
"grunt-contrib-qunit": "~0.2.1"
}
}
| Add pretask to build jquery | Add pretask to build jquery
| JSON | mit | hongymagic/jQuery.serializeObject,hongymagic/jQuery.serializeObject | json | ## Code Before:
{
"name": "jQuery.serializeObject",
"version": "2.0.2",
"description": "A jQuery plugin to turn form data into JSON",
"main": "jquery.serializeObject.js",
"directories": {
"test": "test"
},
"scripts": {
"pretest": "git submodule update --init",
"test": "grunt"
},
"repository": {
"type": "git",
"url": "git://github.com/hongymagic/jQuery.serializeObject.git"
},
"keywords": [
"jquery",
"serialize",
"object",
"json",
"serializeJSON",
"serializeObject"
],
"author": "David G. Hong",
"license": "MIT",
"gitHead": "7789084425b353624fc95487024459f364d11df6",
"readmeFilename": "README.markdown",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-uglify": "~0.2.0",
"grunt-contrib-jshint": "~0.4.3",
"grunt-contrib-qunit": "~0.2.1"
}
}
## Instruction:
Add pretask to build jquery
## Code After:
{
"name": "jQuery.serializeObject",
"version": "2.0.2",
"description": "A jQuery plugin to turn form data into JSON",
"main": "jquery.serializeObject.js",
"directories": {
"test": "test"
},
"scripts": {
"pretest": "git submodule update --init --recursive && git submodule foreach --recursive git pull origin master && cd tools/jquery && npm install && grunt",
"test": "grunt"
},
"repository": {
"type": "git",
"url": "git://github.com/hongymagic/jQuery.serializeObject.git"
},
"keywords": [
"jquery",
"serialize",
"object",
"json",
"serializeJSON",
"serializeObject"
],
"author": "David G. Hong",
"license": "MIT",
"gitHead": "7789084425b353624fc95487024459f364d11df6",
"readmeFilename": "README.markdown",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-uglify": "~0.2.0",
"grunt-contrib-jshint": "~0.4.3",
"grunt-contrib-qunit": "~0.2.1"
}
}
| {
"name": "jQuery.serializeObject",
"version": "2.0.2",
"description": "A jQuery plugin to turn form data into JSON",
"main": "jquery.serializeObject.js",
"directories": {
"test": "test"
},
"scripts": {
- "pretest": "git submodule update --init",
+ "pretest": "git submodule update --init --recursive && git submodule foreach --recursive git pull origin master && cd tools/jquery && npm install && grunt",
"test": "grunt"
},
"repository": {
"type": "git",
"url": "git://github.com/hongymagic/jQuery.serializeObject.git"
},
"keywords": [
"jquery",
"serialize",
"object",
"json",
"serializeJSON",
"serializeObject"
],
"author": "David G. Hong",
"license": "MIT",
"gitHead": "7789084425b353624fc95487024459f364d11df6",
"readmeFilename": "README.markdown",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-uglify": "~0.2.0",
"grunt-contrib-jshint": "~0.4.3",
"grunt-contrib-qunit": "~0.2.1"
}
} | 2 | 0.057143 | 1 | 1 |
29a33d6698d0dffdbd03e47f0ad5cb61f42fa48e | roles/sensu/files/mig_check.json | roles/sensu/files/mig_check.json | {
"checks": {
"mig_check": {
"handle": false,
"command": "check-http.rb -u http://127.0.0.1/pid -P 51664",
"subscribers": [
"common"
],
"interval": 60
}
}
}
| {
"checks": {
"mig_check": {
"handle": false,
"command": "check-http.rb -u http://127.0.0.1:51664/pid",
"subscribers": [
"common"
],
"interval": 60
}
}
}
| Fix port on mig check. | Fix port on mig check.
| JSON | mpl-2.0 | flamingspaz/partinfra-playbooks,TannerFilip/partinfra-playbooks,mozilla/partinfra-playbooks | json | ## Code Before:
{
"checks": {
"mig_check": {
"handle": false,
"command": "check-http.rb -u http://127.0.0.1/pid -P 51664",
"subscribers": [
"common"
],
"interval": 60
}
}
}
## Instruction:
Fix port on mig check.
## Code After:
{
"checks": {
"mig_check": {
"handle": false,
"command": "check-http.rb -u http://127.0.0.1:51664/pid",
"subscribers": [
"common"
],
"interval": 60
}
}
}
| {
"checks": {
"mig_check": {
"handle": false,
- "command": "check-http.rb -u http://127.0.0.1/pid -P 51664",
? ^^^^^^^^
+ "command": "check-http.rb -u http://127.0.0.1:51664/pid",
? ^ ++++
"subscribers": [
"common"
],
"interval": 60
}
}
} | 2 | 0.166667 | 1 | 1 |
bcc10a07ff6fd4f6dec63264118ef41960914d10 | app/bundles/EmailBundle/Assets/css/email.css | app/bundles/EmailBundle/Assets/css/email.css | /* EmailBundle */
.col-email-id, .col-email-abtest-sentcount, .col-email-abtest-readcount {
width: 75px;
}
.col-email-actions {
width: 25px;
}
.email-builder .builder-panel .panel-body {
padding: 5px 0;
} | /* EmailBundle */
.col-email-id, .col-email-abtest-sentcount, .col-email-abtest-readcount {
width: 75px;
}
.col-email-actions {
width: 25px;
}
.email-builder .builder-panel .panel-body {
padding: 5px 0;
}
.table-bordered {
border-left: 0;
}
.table-bordered.email-list > thead > tr > th:first-child, .table-bordered.email-list > thead > tr > th:first-child, .table-bordered.email-list > tbody > tr > td:first-child {
border-left: 0px;
} | Fix of CSS border inspired by David's yestrerday tweet | Fix of CSS border inspired by David's yestrerday tweet
| CSS | mit | rcdelfin/mautic,rcdelfin/mautic,rcdelfin/mautic | css | ## Code Before:
/* EmailBundle */
.col-email-id, .col-email-abtest-sentcount, .col-email-abtest-readcount {
width: 75px;
}
.col-email-actions {
width: 25px;
}
.email-builder .builder-panel .panel-body {
padding: 5px 0;
}
## Instruction:
Fix of CSS border inspired by David's yestrerday tweet
## Code After:
/* EmailBundle */
.col-email-id, .col-email-abtest-sentcount, .col-email-abtest-readcount {
width: 75px;
}
.col-email-actions {
width: 25px;
}
.email-builder .builder-panel .panel-body {
padding: 5px 0;
}
.table-bordered {
border-left: 0;
}
.table-bordered.email-list > thead > tr > th:first-child, .table-bordered.email-list > thead > tr > th:first-child, .table-bordered.email-list > tbody > tr > td:first-child {
border-left: 0px;
} | /* EmailBundle */
.col-email-id, .col-email-abtest-sentcount, .col-email-abtest-readcount {
width: 75px;
}
.col-email-actions {
width: 25px;
}
.email-builder .builder-panel .panel-body {
padding: 5px 0;
}
+
+ .table-bordered {
+ border-left: 0;
+ }
+
+ .table-bordered.email-list > thead > tr > th:first-child, .table-bordered.email-list > thead > tr > th:first-child, .table-bordered.email-list > tbody > tr > td:first-child {
+ border-left: 0px;
+ } | 8 | 0.615385 | 8 | 0 |
efc9013bff8251fc910ecb70d546a8508ed0f7ec | tests/race_deleting_keys_test.py | tests/race_deleting_keys_test.py | import time as _time
import subprocess
import sys
import redisdl
import unittest
import json
import os.path
from . import util
from . import big_data
class RaceDeletingKeysTest(unittest.TestCase):
def setUp(self):
import redis
self.r = redis.Redis()
for key in self.r.keys('*'):
self.r.delete(key)
# slow
def test_delete_race(self):
bd = big_data.BigData(self.r)
count = bd.determine_key_count()
# data is already inserted
big_data_path = os.path.join(os.path.dirname(__file__), 'big_data.py')
p = subprocess.Popen(
[sys.executable, big_data_path, 'delete', str(count)],
stdout=subprocess.PIPE,
)
_time.sleep(1)
start = _time.time()
dump = redisdl.dumps()
finish = _time.time()
out, err = p.communicate()
delete_start, delete_finish = [int(time) for time in out.split(' ')]
assert delete_start < start
assert delete_finish > finish
| import nose.plugins.attrib
import time as _time
import subprocess
import sys
import redisdl
import unittest
import json
import os.path
from . import util
from . import big_data
@nose.plugins.attrib.attr('slow')
class RaceDeletingKeysTest(unittest.TestCase):
def setUp(self):
import redis
self.r = redis.Redis()
for key in self.r.keys('*'):
self.r.delete(key)
def test_delete_race(self):
bd = big_data.BigData(self.r)
count = bd.determine_key_count()
# data is already inserted
big_data_path = os.path.join(os.path.dirname(__file__), 'big_data.py')
p = subprocess.Popen(
[sys.executable, big_data_path, 'delete', str(count)],
stdout=subprocess.PIPE,
)
_time.sleep(1)
start = _time.time()
dump = redisdl.dumps()
finish = _time.time()
out, err = p.communicate()
delete_start, delete_finish = [int(time) for time in out.split(' ')]
assert delete_start < start
assert delete_finish > finish
| Mark test slow via nose attrib plugin | Mark test slow via nose attrib plugin
| Python | bsd-2-clause | p/redis-dump-load,hyunchel/redis-dump-load,hyunchel/redis-dump-load,p/redis-dump-load | python | ## Code Before:
import time as _time
import subprocess
import sys
import redisdl
import unittest
import json
import os.path
from . import util
from . import big_data
class RaceDeletingKeysTest(unittest.TestCase):
def setUp(self):
import redis
self.r = redis.Redis()
for key in self.r.keys('*'):
self.r.delete(key)
# slow
def test_delete_race(self):
bd = big_data.BigData(self.r)
count = bd.determine_key_count()
# data is already inserted
big_data_path = os.path.join(os.path.dirname(__file__), 'big_data.py')
p = subprocess.Popen(
[sys.executable, big_data_path, 'delete', str(count)],
stdout=subprocess.PIPE,
)
_time.sleep(1)
start = _time.time()
dump = redisdl.dumps()
finish = _time.time()
out, err = p.communicate()
delete_start, delete_finish = [int(time) for time in out.split(' ')]
assert delete_start < start
assert delete_finish > finish
## Instruction:
Mark test slow via nose attrib plugin
## Code After:
import nose.plugins.attrib
import time as _time
import subprocess
import sys
import redisdl
import unittest
import json
import os.path
from . import util
from . import big_data
@nose.plugins.attrib.attr('slow')
class RaceDeletingKeysTest(unittest.TestCase):
def setUp(self):
import redis
self.r = redis.Redis()
for key in self.r.keys('*'):
self.r.delete(key)
def test_delete_race(self):
bd = big_data.BigData(self.r)
count = bd.determine_key_count()
# data is already inserted
big_data_path = os.path.join(os.path.dirname(__file__), 'big_data.py')
p = subprocess.Popen(
[sys.executable, big_data_path, 'delete', str(count)],
stdout=subprocess.PIPE,
)
_time.sleep(1)
start = _time.time()
dump = redisdl.dumps()
finish = _time.time()
out, err = p.communicate()
delete_start, delete_finish = [int(time) for time in out.split(' ')]
assert delete_start < start
assert delete_finish > finish
| + import nose.plugins.attrib
import time as _time
import subprocess
import sys
import redisdl
import unittest
import json
import os.path
from . import util
from . import big_data
+ @nose.plugins.attrib.attr('slow')
class RaceDeletingKeysTest(unittest.TestCase):
def setUp(self):
import redis
self.r = redis.Redis()
for key in self.r.keys('*'):
self.r.delete(key)
- # slow
def test_delete_race(self):
bd = big_data.BigData(self.r)
count = bd.determine_key_count()
# data is already inserted
big_data_path = os.path.join(os.path.dirname(__file__), 'big_data.py')
p = subprocess.Popen(
[sys.executable, big_data_path, 'delete', str(count)],
stdout=subprocess.PIPE,
)
_time.sleep(1)
start = _time.time()
dump = redisdl.dumps()
finish = _time.time()
out, err = p.communicate()
delete_start, delete_finish = [int(time) for time in out.split(' ')]
assert delete_start < start
assert delete_finish > finish | 3 | 0.076923 | 2 | 1 |
153ff09a2c29b2036ab6228757ded695c5aa4d87 | pending/pwg5100.13.txt | pending/pwg5100.13.txt | http://ftp.pwg.org/pub/pwg/candidates/cs-ippjobprinterext3v10-20120727-5100.13.pdf
Printer Status attributes: Reference
------------------------------ ---------
printer-config-change-date-time (dateTime) [PWG5100.13]
printer-config-change-time (integer(1:MAX)) [PWG5100.13]
Printer Description attributes: Reference
------------------------------ ---------
printer-input-tray (1setOf octetString) [PWG5100.13]
printer-output-tray (1setOf octetString) [PWG5100.13]
printer-strings-languages-supported (1setOf naturalLanguage) [PWG5100.13]
printer-strings-uri (uri | no-value) [PWG5100.13]
| http://ftp.pwg.org/pub/pwg/candidates/cs-ippjobprinterext3v10-20120727-5100.13.pdf
Printer Status attributes: Reference
------------------------------ ---------
printer-config-change-date-time (dateTime) [PWG5100.13]
printer-config-change-time (integer(1:MAX)) [PWG5100.13]
Printer Description attributes: Reference
------------------------------ ---------
printer-input-tray (1setOf octetString(MAX)) [PWG5100.13]
printer-output-tray (1setOf octetString(MAX)) [PWG5100.13]
printer-strings-languages-supported (1setOf naturalLanguage) [PWG5100.13]
printer-strings-uri (uri | no-value) [PWG5100.13]
| Fix printer-input-tray and printer-output-tray registration template (need (MAX) on end) | Fix printer-input-tray and printer-output-tray registration template (need (MAX) on end)
| Text | apache-2.0 | istopwg/ippregistry,istopwg/ippregistry,istopwg/ippregistry | text | ## Code Before:
http://ftp.pwg.org/pub/pwg/candidates/cs-ippjobprinterext3v10-20120727-5100.13.pdf
Printer Status attributes: Reference
------------------------------ ---------
printer-config-change-date-time (dateTime) [PWG5100.13]
printer-config-change-time (integer(1:MAX)) [PWG5100.13]
Printer Description attributes: Reference
------------------------------ ---------
printer-input-tray (1setOf octetString) [PWG5100.13]
printer-output-tray (1setOf octetString) [PWG5100.13]
printer-strings-languages-supported (1setOf naturalLanguage) [PWG5100.13]
printer-strings-uri (uri | no-value) [PWG5100.13]
## Instruction:
Fix printer-input-tray and printer-output-tray registration template (need (MAX) on end)
## Code After:
http://ftp.pwg.org/pub/pwg/candidates/cs-ippjobprinterext3v10-20120727-5100.13.pdf
Printer Status attributes: Reference
------------------------------ ---------
printer-config-change-date-time (dateTime) [PWG5100.13]
printer-config-change-time (integer(1:MAX)) [PWG5100.13]
Printer Description attributes: Reference
------------------------------ ---------
printer-input-tray (1setOf octetString(MAX)) [PWG5100.13]
printer-output-tray (1setOf octetString(MAX)) [PWG5100.13]
printer-strings-languages-supported (1setOf naturalLanguage) [PWG5100.13]
printer-strings-uri (uri | no-value) [PWG5100.13]
| http://ftp.pwg.org/pub/pwg/candidates/cs-ippjobprinterext3v10-20120727-5100.13.pdf
Printer Status attributes: Reference
------------------------------ ---------
printer-config-change-date-time (dateTime) [PWG5100.13]
printer-config-change-time (integer(1:MAX)) [PWG5100.13]
Printer Description attributes: Reference
------------------------------ ---------
- printer-input-tray (1setOf octetString) [PWG5100.13]
+ printer-input-tray (1setOf octetString(MAX)) [PWG5100.13]
? +++++
- printer-output-tray (1setOf octetString) [PWG5100.13]
+ printer-output-tray (1setOf octetString(MAX)) [PWG5100.13]
? +++++
printer-strings-languages-supported (1setOf naturalLanguage) [PWG5100.13]
printer-strings-uri (uri | no-value) [PWG5100.13] | 4 | 0.307692 | 2 | 2 |
216334950e8fea85c6491a11933d4f4e89eaf46d | DTO/KalturaEntryContextDataResult.json | DTO/KalturaEntryContextDataResult.json | {
"pointers":{
"root": "",
"iterator": "",
"wrap": ""
},
"resolver":{
"isSiteRestricted": "",
"isCountryRestricted": "",
"isSessionRestricted": "",
"isIpAddressRestricted": "",
"isUserAgentRestricted": "",
"previewLength": "",
"isScheduledNow": "",
"isAdmin": "",
"streamerType": "",
"mediaProtocol": "",
"flavorCustomData": "",
"storageProfilesXML": "",
"accessControlMessages": {},
"accessControlActions": {},
"flavorAssets": {},
"messages": {},
"actions": {}
}
}
| {
"pointers":{
"root": "",
"iterator": "",
"wrap": ""
},
"resolver":{
"isSiteRestricted": "",
"isCountryRestricted": "",
"isSessionRestricted": "",
"isIpAddressRestricted": "",
"isUserAgentRestricted": "",
"previewLength": "",
"isScheduledNow": "",
"isAdmin": "",
"streamerType": "",
"mediaProtocol": "",
"flavorCustomData": "",
"storageProfilesXML": "",
"accessControlMessages": {},
"accessControlActions": {},
"flavorAssets": {},
"messages": {},
"actions": {},
"pluginData": {
"KalturaDrmEntryContextPluginData" : "{CUST_FUNC:flavorCustomData}}"
}
}
}
| Align flavour response to new OVP DRM scheme | Align flavour response to new OVP DRM scheme
| JSON | agpl-3.0 | kaltura/embed-services | json | ## Code Before:
{
"pointers":{
"root": "",
"iterator": "",
"wrap": ""
},
"resolver":{
"isSiteRestricted": "",
"isCountryRestricted": "",
"isSessionRestricted": "",
"isIpAddressRestricted": "",
"isUserAgentRestricted": "",
"previewLength": "",
"isScheduledNow": "",
"isAdmin": "",
"streamerType": "",
"mediaProtocol": "",
"flavorCustomData": "",
"storageProfilesXML": "",
"accessControlMessages": {},
"accessControlActions": {},
"flavorAssets": {},
"messages": {},
"actions": {}
}
}
## Instruction:
Align flavour response to new OVP DRM scheme
## Code After:
{
"pointers":{
"root": "",
"iterator": "",
"wrap": ""
},
"resolver":{
"isSiteRestricted": "",
"isCountryRestricted": "",
"isSessionRestricted": "",
"isIpAddressRestricted": "",
"isUserAgentRestricted": "",
"previewLength": "",
"isScheduledNow": "",
"isAdmin": "",
"streamerType": "",
"mediaProtocol": "",
"flavorCustomData": "",
"storageProfilesXML": "",
"accessControlMessages": {},
"accessControlActions": {},
"flavorAssets": {},
"messages": {},
"actions": {},
"pluginData": {
"KalturaDrmEntryContextPluginData" : "{CUST_FUNC:flavorCustomData}}"
}
}
}
| {
"pointers":{
"root": "",
"iterator": "",
"wrap": ""
},
"resolver":{
"isSiteRestricted": "",
"isCountryRestricted": "",
"isSessionRestricted": "",
"isIpAddressRestricted": "",
"isUserAgentRestricted": "",
"previewLength": "",
"isScheduledNow": "",
"isAdmin": "",
"streamerType": "",
"mediaProtocol": "",
"flavorCustomData": "",
"storageProfilesXML": "",
"accessControlMessages": {},
"accessControlActions": {},
"flavorAssets": {},
"messages": {},
- "actions": {}
+ "actions": {},
? +
+ "pluginData": {
+ "KalturaDrmEntryContextPluginData" : "{CUST_FUNC:flavorCustomData}}"
+ }
}
} | 5 | 0.192308 | 4 | 1 |
185e8db639f7f74702f9d741f7c01eeebce73d50 | comics/aggregator/feedparser.py | comics/aggregator/feedparser.py | from __future__ import absolute_import
import datetime as dt
import feedparser
from types import StringTypes
from comics.aggregator.lxmlparser import LxmlParser
class FeedParser(object):
def __init__(self, url):
self.raw_feed = feedparser.parse(url)
def for_date(self, date):
return [Entry(e) for e in self.raw_feed.entries
if e.updated_parsed and dt.date(*e.updated_parsed[:3]) == date]
def all(self):
return [Entry(e) for e in self.raw_feed.entries]
class Entry(object):
def __init__(self, entry):
self.raw_entry = entry
if 'summary' in entry:
self.summary = self.html(entry.summary)
if 'content' in entry:
self.content0 = self.html(entry.content[0].value)
def __getattr__(self, name):
return getattr(self.raw_entry, name)
def html(self, string):
return LxmlParser(string=string)
def has_tag(self, tag):
def matches_tag(item):
return item.term == tag
if ('tags' in self.raw_entry and
len(filter(matches_tag, self.raw_entry['tags']))):
return True
return False
| from __future__ import absolute_import
import datetime as dt
import feedparser
from types import StringTypes
from comics.aggregator.lxmlparser import LxmlParser
class FeedParser(object):
def __init__(self, url):
self.raw_feed = feedparser.parse(url)
def for_date(self, date):
return [Entry(e) for e in self.raw_feed.entries
if e.updated_parsed and dt.date(*e.updated_parsed[:3]) == date]
def all(self):
return [Entry(e) for e in self.raw_feed.entries]
class Entry(object):
def __init__(self, entry):
self.raw_entry = entry
if 'summary' in entry:
self.summary = self.html(entry.summary)
if 'content' in entry:
self.content0 = self.html(entry.content[0].value)
def __getattr__(self, name):
return getattr(self.raw_entry, name)
def html(self, string):
return LxmlParser(string=string)
def has_tag(self, tag):
if ('tags' in self.raw_entry and
len(filter(lambda t: t.term == tag, self.raw_entry.tags))):
return True
return False
| Replace inner function with lambda in FeedParser.has_tag() | Replace inner function with lambda in FeedParser.has_tag()
| Python | agpl-3.0 | datagutten/comics,klette/comics,jodal/comics,datagutten/comics,datagutten/comics,jodal/comics,klette/comics,klette/comics,jodal/comics,datagutten/comics,jodal/comics | python | ## Code Before:
from __future__ import absolute_import
import datetime as dt
import feedparser
from types import StringTypes
from comics.aggregator.lxmlparser import LxmlParser
class FeedParser(object):
def __init__(self, url):
self.raw_feed = feedparser.parse(url)
def for_date(self, date):
return [Entry(e) for e in self.raw_feed.entries
if e.updated_parsed and dt.date(*e.updated_parsed[:3]) == date]
def all(self):
return [Entry(e) for e in self.raw_feed.entries]
class Entry(object):
def __init__(self, entry):
self.raw_entry = entry
if 'summary' in entry:
self.summary = self.html(entry.summary)
if 'content' in entry:
self.content0 = self.html(entry.content[0].value)
def __getattr__(self, name):
return getattr(self.raw_entry, name)
def html(self, string):
return LxmlParser(string=string)
def has_tag(self, tag):
def matches_tag(item):
return item.term == tag
if ('tags' in self.raw_entry and
len(filter(matches_tag, self.raw_entry['tags']))):
return True
return False
## Instruction:
Replace inner function with lambda in FeedParser.has_tag()
## Code After:
from __future__ import absolute_import
import datetime as dt
import feedparser
from types import StringTypes
from comics.aggregator.lxmlparser import LxmlParser
class FeedParser(object):
def __init__(self, url):
self.raw_feed = feedparser.parse(url)
def for_date(self, date):
return [Entry(e) for e in self.raw_feed.entries
if e.updated_parsed and dt.date(*e.updated_parsed[:3]) == date]
def all(self):
return [Entry(e) for e in self.raw_feed.entries]
class Entry(object):
def __init__(self, entry):
self.raw_entry = entry
if 'summary' in entry:
self.summary = self.html(entry.summary)
if 'content' in entry:
self.content0 = self.html(entry.content[0].value)
def __getattr__(self, name):
return getattr(self.raw_entry, name)
def html(self, string):
return LxmlParser(string=string)
def has_tag(self, tag):
if ('tags' in self.raw_entry and
len(filter(lambda t: t.term == tag, self.raw_entry.tags))):
return True
return False
| from __future__ import absolute_import
import datetime as dt
import feedparser
from types import StringTypes
from comics.aggregator.lxmlparser import LxmlParser
class FeedParser(object):
def __init__(self, url):
self.raw_feed = feedparser.parse(url)
def for_date(self, date):
return [Entry(e) for e in self.raw_feed.entries
if e.updated_parsed and dt.date(*e.updated_parsed[:3]) == date]
def all(self):
return [Entry(e) for e in self.raw_feed.entries]
class Entry(object):
def __init__(self, entry):
self.raw_entry = entry
if 'summary' in entry:
self.summary = self.html(entry.summary)
if 'content' in entry:
self.content0 = self.html(entry.content[0].value)
def __getattr__(self, name):
return getattr(self.raw_entry, name)
def html(self, string):
return LxmlParser(string=string)
def has_tag(self, tag):
- def matches_tag(item):
- return item.term == tag
if ('tags' in self.raw_entry and
- len(filter(matches_tag, self.raw_entry['tags']))):
? ^^ ^^ ^^ --
+ len(filter(lambda t: t.term == tag, self.raw_entry.tags))):
? ++ ++ + ^^^^^ ^^^^^^ ^
return True
return False | 4 | 0.1 | 1 | 3 |
65fb79ee2327a3c05b6bf77828ae4c8aa1ee7890 | examples/translate/README.md | examples/translate/README.md |
This widget translates text from the default locale to other locales in a space using the Yandex translation API.
### Bootstrap example for local development
Move into this example directory and install dependencies
```bash
cd examples/translate
npm install
```
Set the access token on your environment:
```bash
export CONTENTFUL_MANAGEMENT_ACCESS_TOKEN=<contentfulManagementApiToken>
```
Create the widget:
```bash
contentful-widget create --space-id <yourSpaceId>
```
Serve on http://:::3000
```bash
npm start
```
You can also provide a value for `PORT` environment variable to start the server on a custom port.
If you do this, remember to update the `src` property in `widget.json`.
```bash
PORT=<custom port here> npm start
```
Your widget will now be accessible via the Contentful web app.
In order to to use this widget, create a Content Type with a field of type `Symbol` or `Text`. You will need to enable localization on the field to use the translation feature.
### Upload widget
If you want to inline all dependencies and upload the widget entirely to Contentful:
```bash
contentful-widget create --srcdoc ./dist/index.all.html --space-id <yourSpaceId> --force
```
|

This widget translates text from the default locale to other locales in a space using the Yandex translation API.
### Bootstrap example for local development
Move into this example directory and install dependencies
```bash
cd examples/translate
npm install
```
Set the access token on your environment:
```bash
export CONTENTFUL_MANAGEMENT_ACCESS_TOKEN=<contentfulManagementApiToken>
```
Create the widget:
```bash
contentful-widget create --space-id <yourSpaceId>
```
Serve on http://:::3000
```bash
npm start
```
You can also provide a value for `PORT` environment variable to start the server on a custom port.
If you do this, remember to update the `src` property in `widget.json`.
```bash
PORT=<custom port here> npm start
```
Your widget will now be accessible via the Contentful web app.
In order to to use this widget, create a Content Type with a field of type `Symbol` or `Text`. You will need to enable localization on the field to use the translation feature.
### Upload widget
If you want to inline all dependencies and upload the widget entirely to Contentful:
```bash
contentful-widget create --srcdoc ./dist/index.all.html --space-id <yourSpaceId> --force
```
| Add screenshot for translate widget | Docs: Add screenshot for translate widget
| Markdown | mit | contentful/widget-sdk | markdown | ## Code Before:
This widget translates text from the default locale to other locales in a space using the Yandex translation API.
### Bootstrap example for local development
Move into this example directory and install dependencies
```bash
cd examples/translate
npm install
```
Set the access token on your environment:
```bash
export CONTENTFUL_MANAGEMENT_ACCESS_TOKEN=<contentfulManagementApiToken>
```
Create the widget:
```bash
contentful-widget create --space-id <yourSpaceId>
```
Serve on http://:::3000
```bash
npm start
```
You can also provide a value for `PORT` environment variable to start the server on a custom port.
If you do this, remember to update the `src` property in `widget.json`.
```bash
PORT=<custom port here> npm start
```
Your widget will now be accessible via the Contentful web app.
In order to to use this widget, create a Content Type with a field of type `Symbol` or `Text`. You will need to enable localization on the field to use the translation feature.
### Upload widget
If you want to inline all dependencies and upload the widget entirely to Contentful:
```bash
contentful-widget create --srcdoc ./dist/index.all.html --space-id <yourSpaceId> --force
```
## Instruction:
Docs: Add screenshot for translate widget
## Code After:

This widget translates text from the default locale to other locales in a space using the Yandex translation API.
### Bootstrap example for local development
Move into this example directory and install dependencies
```bash
cd examples/translate
npm install
```
Set the access token on your environment:
```bash
export CONTENTFUL_MANAGEMENT_ACCESS_TOKEN=<contentfulManagementApiToken>
```
Create the widget:
```bash
contentful-widget create --space-id <yourSpaceId>
```
Serve on http://:::3000
```bash
npm start
```
You can also provide a value for `PORT` environment variable to start the server on a custom port.
If you do this, remember to update the `src` property in `widget.json`.
```bash
PORT=<custom port here> npm start
```
Your widget will now be accessible via the Contentful web app.
In order to to use this widget, create a Content Type with a field of type `Symbol` or `Text`. You will need to enable localization on the field to use the translation feature.
### Upload widget
If you want to inline all dependencies and upload the widget entirely to Contentful:
```bash
contentful-widget create --srcdoc ./dist/index.all.html --space-id <yourSpaceId> --force
```
| +
+ 
This widget translates text from the default locale to other locales in a space using the Yandex translation API.
### Bootstrap example for local development
Move into this example directory and install dependencies
```bash
cd examples/translate
npm install
```
Set the access token on your environment:
```bash
export CONTENTFUL_MANAGEMENT_ACCESS_TOKEN=<contentfulManagementApiToken>
```
Create the widget:
```bash
contentful-widget create --space-id <yourSpaceId>
```
Serve on http://:::3000
```bash
npm start
```
You can also provide a value for `PORT` environment variable to start the server on a custom port.
If you do this, remember to update the `src` property in `widget.json`.
```bash
PORT=<custom port here> npm start
```
Your widget will now be accessible via the Contentful web app.
In order to to use this widget, create a Content Type with a field of type `Symbol` or `Text`. You will need to enable localization on the field to use the translation feature.
### Upload widget
If you want to inline all dependencies and upload the widget entirely to Contentful:
```bash
contentful-widget create --srcdoc ./dist/index.all.html --space-id <yourSpaceId> --force
``` | 2 | 0.04878 | 2 | 0 |
78c0581ba52e5ddfd4e6f5ff13df29cd75cf0b21 | imports/ui/components/giveaways/nearby-giveaways.js | imports/ui/components/giveaways/nearby-giveaways.js | import React from 'react';
import { List, ListItem } from 'material-ui/List';
import Divider from 'material-ui/Divider';
import Subheader from 'material-ui/Subheader';
import Avatar from 'material-ui/Avatar';
import * as Helper from '../../../util/helper';
import * as Colors from 'material-ui/styles/colors';
const giveawayRow = (touchTapHandler) => (ga) => (
<ListItem
key={ ga._id }
primaryText={
<span style={{ color: Colors.grey700 }}>{ ga.title }</span>
}
secondaryText={
<p>
<span className="location">{ ga.location }</span>
</p>
}
secondaryTextLines={2}
onTouchTap={ touchTapHandler(ga) }
/>
);
export const NearbyGiveaways = (props) => (
<List>
<Subheader>
<h3 style={{ margin:"20px 0px 10px" }}>Nearby Giveaways</h3>
</Subheader>
{ Helper.insertDividers(props.giveaways.map(giveawayRow(props.nearbyOnClick))) }
</List>
);
| import React from 'react';
import { List, ListItem } from 'material-ui/List';
import Divider from 'material-ui/Divider';
import Subheader from 'material-ui/Subheader';
import Avatar from 'material-ui/Avatar';
import * as Helper from '../../../util/helper';
import * as AvatarHelper from '../../../util/avatar';
import * as GiveawaysHelper from '../../../util/giveaways';
import * as Colors from 'material-ui/styles/colors';
const giveawayRow = (touchTapHandler) => (ga) => (
<ListItem
key={ ga._id }
primaryText={
<span className="single-line" style={{ color: Colors.grey700 }}>{ ga.title }</span>
}
secondaryText={
<p>
<span className="location">{ ga.location }</span>
</p>
}
leftAvatar={
ga.avatarId ? <Avatar src={ AvatarHelper.getAvatar(ga.avatarId, 64) } />
: <Avatar icon={ GiveawaysHelper.getCategoryIcon(ga) } backgroundColor={ GiveawaysHelper.getStatusColor(ga) } />
}
secondaryTextLines={2}
onTouchTap={ touchTapHandler(ga) }
/>
);
export const NearbyGiveaways = (props) => (
<List>
<Subheader>
<h3 style={{ margin:"20px 0px 10px" }}>Nearby Giveaways</h3>
</Subheader>
{ Helper.insertDividers(props.giveaways.map(giveawayRow(props.nearbyOnClick))) }
</List>
);
| Add avatars for in nearby giveaway sidebar | Add avatars for in nearby giveaway sidebar
| JavaScript | mit | irvinlim/free4all,irvinlim/free4all | javascript | ## Code Before:
import React from 'react';
import { List, ListItem } from 'material-ui/List';
import Divider from 'material-ui/Divider';
import Subheader from 'material-ui/Subheader';
import Avatar from 'material-ui/Avatar';
import * as Helper from '../../../util/helper';
import * as Colors from 'material-ui/styles/colors';
const giveawayRow = (touchTapHandler) => (ga) => (
<ListItem
key={ ga._id }
primaryText={
<span style={{ color: Colors.grey700 }}>{ ga.title }</span>
}
secondaryText={
<p>
<span className="location">{ ga.location }</span>
</p>
}
secondaryTextLines={2}
onTouchTap={ touchTapHandler(ga) }
/>
);
export const NearbyGiveaways = (props) => (
<List>
<Subheader>
<h3 style={{ margin:"20px 0px 10px" }}>Nearby Giveaways</h3>
</Subheader>
{ Helper.insertDividers(props.giveaways.map(giveawayRow(props.nearbyOnClick))) }
</List>
);
## Instruction:
Add avatars for in nearby giveaway sidebar
## Code After:
import React from 'react';
import { List, ListItem } from 'material-ui/List';
import Divider from 'material-ui/Divider';
import Subheader from 'material-ui/Subheader';
import Avatar from 'material-ui/Avatar';
import * as Helper from '../../../util/helper';
import * as AvatarHelper from '../../../util/avatar';
import * as GiveawaysHelper from '../../../util/giveaways';
import * as Colors from 'material-ui/styles/colors';
const giveawayRow = (touchTapHandler) => (ga) => (
<ListItem
key={ ga._id }
primaryText={
<span className="single-line" style={{ color: Colors.grey700 }}>{ ga.title }</span>
}
secondaryText={
<p>
<span className="location">{ ga.location }</span>
</p>
}
leftAvatar={
ga.avatarId ? <Avatar src={ AvatarHelper.getAvatar(ga.avatarId, 64) } />
: <Avatar icon={ GiveawaysHelper.getCategoryIcon(ga) } backgroundColor={ GiveawaysHelper.getStatusColor(ga) } />
}
secondaryTextLines={2}
onTouchTap={ touchTapHandler(ga) }
/>
);
export const NearbyGiveaways = (props) => (
<List>
<Subheader>
<h3 style={{ margin:"20px 0px 10px" }}>Nearby Giveaways</h3>
</Subheader>
{ Helper.insertDividers(props.giveaways.map(giveawayRow(props.nearbyOnClick))) }
</List>
);
| import React from 'react';
import { List, ListItem } from 'material-ui/List';
import Divider from 'material-ui/Divider';
import Subheader from 'material-ui/Subheader';
import Avatar from 'material-ui/Avatar';
import * as Helper from '../../../util/helper';
+ import * as AvatarHelper from '../../../util/avatar';
+ import * as GiveawaysHelper from '../../../util/giveaways';
import * as Colors from 'material-ui/styles/colors';
const giveawayRow = (touchTapHandler) => (ga) => (
<ListItem
key={ ga._id }
primaryText={
- <span style={{ color: Colors.grey700 }}>{ ga.title }</span>
+ <span className="single-line" style={{ color: Colors.grey700 }}>{ ga.title }</span>
? ++++++++++++++++++++++++
}
secondaryText={
<p>
<span className="location">{ ga.location }</span>
</p>
+ }
+ leftAvatar={
+ ga.avatarId ? <Avatar src={ AvatarHelper.getAvatar(ga.avatarId, 64) } />
+ : <Avatar icon={ GiveawaysHelper.getCategoryIcon(ga) } backgroundColor={ GiveawaysHelper.getStatusColor(ga) } />
}
secondaryTextLines={2}
onTouchTap={ touchTapHandler(ga) }
/>
);
export const NearbyGiveaways = (props) => (
<List>
<Subheader>
<h3 style={{ margin:"20px 0px 10px" }}>Nearby Giveaways</h3>
</Subheader>
{ Helper.insertDividers(props.giveaways.map(giveawayRow(props.nearbyOnClick))) }
</List>
); | 8 | 0.242424 | 7 | 1 |
28f8e18e24252675cf187773e81321b6fb6b2d3d | .travis.yml | .travis.yml | language: objective-c
script: xctool -project RMStore.xcodeproj -scheme 'RMStore'
| language: objective-c
script: xctool -project RMStore.xcodeproj -scheme 'RMStore' -sdk iphonesimulator -arch i386
| Add sdk and arch flags | Add sdk and arch flags
| YAML | apache-2.0 | adamwulf/RMStore,Pocket-Prep/RMStore,cjhanson/RMStore,fmestrone/RMStore,adamwulf/RMStore,s-alexander/RMStore,cjhanson/RMStore,xxkkk/RMStore,dxd214/RMStore,cjhanson/RMStore,fmestrone/RMStore,spicypixel-forks/RMStore,rodericj/RMStore,Serjip/RMStore,Serjip/RMStore,dxd214/RMStore,rodericj/RMStore,dxd214/RMStore,catlan/RMStore,robotmedia/RMStore,ReutersTV/RMStore,vovanl10n/RMStore,mluisbrown/RMStore,spicypixel-forks/RMStore,xxkkk/RMStore,robotmedia/RMStore,fmestrone/RMStore,Serjip/RMStore,vovanl10n/RMStore,h4rrison-james/RMStore,s-alexander/RMStore,vovanl10n/RMStore,adamwulf/RMStore,ReutersTV/RMStore,s-alexander/RMStore,mluisbrown/RMStore,Pocket-Prep/RMStore,Pocket-Prep/RMStore,mluisbrown/RMStore,ebothmann/RMStore,catlan/RMStore,h4rrison-james/RMStore,h4rrison-james/RMStore,spicypixel-forks/RMStore,robotmedia/RMStore,catlan/RMStore,xxkkk/RMStore,ebothmann/RMStore,rodericj/RMStore,ebothmann/RMStore,ReutersTV/RMStore | yaml | ## Code Before:
language: objective-c
script: xctool -project RMStore.xcodeproj -scheme 'RMStore'
## Instruction:
Add sdk and arch flags
## Code After:
language: objective-c
script: xctool -project RMStore.xcodeproj -scheme 'RMStore' -sdk iphonesimulator -arch i386
| language: objective-c
- script: xctool -project RMStore.xcodeproj -scheme 'RMStore'
+ script: xctool -project RMStore.xcodeproj -scheme 'RMStore' -sdk iphonesimulator -arch i386
? ++++++++++++++++++++++++++++++++
| 2 | 1 | 1 | 1 |
cb9094a671d738607f9af4185c3b8bd722c69b93 | api/routes.go | api/routes.go | package api
import (
api "github.com/diyan/assimilator/api/endpoints"
"github.com/labstack/echo"
)
// RegisterAPIRoutes adds API routes to the Echo's route group
func RegisterAPIRoutes(g *echo.Group) {
// Organizations
g.GET("/organizations/", api.OrganizationIndexGetEndpoint)
g.GET("/organizations/:organization_slug/", api.OrganizationDetailsGetEndpoint)
// Projects
g.GET("/projects/:organization_slug/:project_slug/environments/", api.ProjectEnvironmentsGetEndpoint)
g.GET("/projects/:organization_slug/:project_slug/issues/", api.ProjectGroupIndexGetEndpoint)
g.GET("/projects/:organization_slug/:project_slug/groups/", api.ProjectGroupIndexGetEndpoint)
g.GET("/projects/:organization_slug/:project_slug/searches/", api.ProjectSearchesGetEndpoint)
g.GET("/projects/:organization_slug/:project_slug/members/", api.ProjectMemberIndexGetEndpoint)
g.GET("/projects/:organization_slug/:project_slug/tags/", api.ProjectTagsGetEndpoint)
// Internal
g.GET("/internal/health/", api.SystemHealthGetEndpoint)
}
| package api
import (
api "github.com/diyan/assimilator/api/endpoints"
mw "github.com/diyan/assimilator/api/middleware"
"github.com/labstack/echo"
)
// RegisterAPIRoutes adds API routes to the Echo's route group
func RegisterAPIRoutes(g *echo.Group) {
// Organizations
g.GET("/organizations/", api.OrganizationIndexGetEndpoint)
g.GET("/organizations/:organization_slug/", api.OrganizationDetailsGetEndpoint)
// Projects
p := g.Group("/projects/:organization_slug/:project_slug")
//p.Use(mw.RequireUser)
p.Use(mw.RequireOrganization)
p.Use(mw.RequireProject)
p.GET("/environments/", api.ProjectEnvironmentsGetEndpoint)
p.GET("/issues/", api.ProjectGroupIndexGetEndpoint)
p.GET("/groups/", api.ProjectGroupIndexGetEndpoint)
p.GET("/searches/", api.ProjectSearchesGetEndpoint)
p.GET("/members/", api.ProjectMemberIndexGetEndpoint)
p.GET("/tags/", api.ProjectTagsGetEndpoint)
// Internal
g.GET("/internal/health/", api.SystemHealthGetEndpoint)
}
| Remove duplicated code from RegisterAPIRoutes | Remove duplicated code from RegisterAPIRoutes
| Go | mit | diyan/assimilator,diyan/assimilator,diyan/assimilator | go | ## Code Before:
package api
import (
api "github.com/diyan/assimilator/api/endpoints"
"github.com/labstack/echo"
)
// RegisterAPIRoutes adds API routes to the Echo's route group
func RegisterAPIRoutes(g *echo.Group) {
// Organizations
g.GET("/organizations/", api.OrganizationIndexGetEndpoint)
g.GET("/organizations/:organization_slug/", api.OrganizationDetailsGetEndpoint)
// Projects
g.GET("/projects/:organization_slug/:project_slug/environments/", api.ProjectEnvironmentsGetEndpoint)
g.GET("/projects/:organization_slug/:project_slug/issues/", api.ProjectGroupIndexGetEndpoint)
g.GET("/projects/:organization_slug/:project_slug/groups/", api.ProjectGroupIndexGetEndpoint)
g.GET("/projects/:organization_slug/:project_slug/searches/", api.ProjectSearchesGetEndpoint)
g.GET("/projects/:organization_slug/:project_slug/members/", api.ProjectMemberIndexGetEndpoint)
g.GET("/projects/:organization_slug/:project_slug/tags/", api.ProjectTagsGetEndpoint)
// Internal
g.GET("/internal/health/", api.SystemHealthGetEndpoint)
}
## Instruction:
Remove duplicated code from RegisterAPIRoutes
## Code After:
package api
import (
api "github.com/diyan/assimilator/api/endpoints"
mw "github.com/diyan/assimilator/api/middleware"
"github.com/labstack/echo"
)
// RegisterAPIRoutes adds API routes to the Echo's route group
func RegisterAPIRoutes(g *echo.Group) {
// Organizations
g.GET("/organizations/", api.OrganizationIndexGetEndpoint)
g.GET("/organizations/:organization_slug/", api.OrganizationDetailsGetEndpoint)
// Projects
p := g.Group("/projects/:organization_slug/:project_slug")
//p.Use(mw.RequireUser)
p.Use(mw.RequireOrganization)
p.Use(mw.RequireProject)
p.GET("/environments/", api.ProjectEnvironmentsGetEndpoint)
p.GET("/issues/", api.ProjectGroupIndexGetEndpoint)
p.GET("/groups/", api.ProjectGroupIndexGetEndpoint)
p.GET("/searches/", api.ProjectSearchesGetEndpoint)
p.GET("/members/", api.ProjectMemberIndexGetEndpoint)
p.GET("/tags/", api.ProjectTagsGetEndpoint)
// Internal
g.GET("/internal/health/", api.SystemHealthGetEndpoint)
}
| package api
import (
api "github.com/diyan/assimilator/api/endpoints"
-
+ mw "github.com/diyan/assimilator/api/middleware"
"github.com/labstack/echo"
)
// RegisterAPIRoutes adds API routes to the Echo's route group
func RegisterAPIRoutes(g *echo.Group) {
// Organizations
g.GET("/organizations/", api.OrganizationIndexGetEndpoint)
g.GET("/organizations/:organization_slug/", api.OrganizationDetailsGetEndpoint)
// Projects
- g.GET("/projects/:organization_slug/:project_slug/environments/", api.ProjectEnvironmentsGetEndpoint)
- g.GET("/projects/:organization_slug/:project_slug/issues/", api.ProjectGroupIndexGetEndpoint)
- g.GET("/projects/:organization_slug/:project_slug/groups/", api.ProjectGroupIndexGetEndpoint)
- g.GET("/projects/:organization_slug/:project_slug/searches/", api.ProjectSearchesGetEndpoint)
+ p := g.Group("/projects/:organization_slug/:project_slug")
+ //p.Use(mw.RequireUser)
+ p.Use(mw.RequireOrganization)
+ p.Use(mw.RequireProject)
+ p.GET("/environments/", api.ProjectEnvironmentsGetEndpoint)
+ p.GET("/issues/", api.ProjectGroupIndexGetEndpoint)
+ p.GET("/groups/", api.ProjectGroupIndexGetEndpoint)
+ p.GET("/searches/", api.ProjectSearchesGetEndpoint)
+ p.GET("/members/", api.ProjectMemberIndexGetEndpoint)
+ p.GET("/tags/", api.ProjectTagsGetEndpoint)
- g.GET("/projects/:organization_slug/:project_slug/members/", api.ProjectMemberIndexGetEndpoint)
- g.GET("/projects/:organization_slug/:project_slug/tags/", api.ProjectTagsGetEndpoint)
// Internal
g.GET("/internal/health/", api.SystemHealthGetEndpoint)
} | 18 | 0.72 | 11 | 7 |
b085f536a556d647ef21fd6af2304b82c39131bd | routes/index.js | routes/index.js | var _ = require("lodash")
var publicRoutes = require("./public");
var authenticated = require("./authenticated");
var routes = [];
publicRoutes.concat(authenticated).forEach(function(route) {
// If route defines an array of paths,
// register each as an individual route
if (route.paths) {
route.paths.forEach(function(path) {
var r = _.cloneDeep(route)
delete r.paths
r.path = path
routes.push(r)
})
} else {
routes.push(route);
}
});
// Convenience method for tests
routes.at = function(name) {
return _.find(this, function(route) {
return name === route.method + " " + route.path
})
}
module.exports = routes;
| var _ = require("lodash");
var publicRoutes = require("./public");
var authenticated = require("./authenticated");
var feature = require('../lib/feature-flags');
var routes = publicRoutes.concat(authenticated).filter(function(route) {
if (route.feature) {
return [].concat(route.feature).some(function(feat) {
if (feat[0] == '!') {
return !feature(feat.slice(1));
} else {
return feature(feat);
}
});
} else {
return true;
}
}).reduce(function(routes, route) {
delete route.feature;
// If route defines an array of paths,
// register each as an individual route
if (route.paths) {
route.paths.forEach(function(path) {
var r = _.cloneDeep(route);
delete r.paths;
r.path = path;
routes.push(r);
});
} else {
routes.push(route);
}
return routes;
}, []);
// Convenience method for tests
routes.at = function(name) {
return _.find(this, function(route) {
return name === route.method + " " + route.path;
});
};
module.exports = routes;
| Add feature filter to routes | Add feature filter to routes
| JavaScript | isc | amilaonbitlab/newww,aredridel/newww,nexdrew/newww,rutaihwa/newww,aredridel/newww,jonathanmarvens/npm-newww,amilaonbitlab/newww,nexdrew/newww,jonathanmarvens/npm-newww,aredridel/newww,kemitchell/newww,watilde/newww,amilaonbitlab/newww,nexdrew/newww,kemitchell/newww,rutaihwa/newww,kemitchell/newww,jonathanmarvens/npm-newww,watilde/newww,rutaihwa/newww,watilde/newww | javascript | ## Code Before:
var _ = require("lodash")
var publicRoutes = require("./public");
var authenticated = require("./authenticated");
var routes = [];
publicRoutes.concat(authenticated).forEach(function(route) {
// If route defines an array of paths,
// register each as an individual route
if (route.paths) {
route.paths.forEach(function(path) {
var r = _.cloneDeep(route)
delete r.paths
r.path = path
routes.push(r)
})
} else {
routes.push(route);
}
});
// Convenience method for tests
routes.at = function(name) {
return _.find(this, function(route) {
return name === route.method + " " + route.path
})
}
module.exports = routes;
## Instruction:
Add feature filter to routes
## Code After:
var _ = require("lodash");
var publicRoutes = require("./public");
var authenticated = require("./authenticated");
var feature = require('../lib/feature-flags');
var routes = publicRoutes.concat(authenticated).filter(function(route) {
if (route.feature) {
return [].concat(route.feature).some(function(feat) {
if (feat[0] == '!') {
return !feature(feat.slice(1));
} else {
return feature(feat);
}
});
} else {
return true;
}
}).reduce(function(routes, route) {
delete route.feature;
// If route defines an array of paths,
// register each as an individual route
if (route.paths) {
route.paths.forEach(function(path) {
var r = _.cloneDeep(route);
delete r.paths;
r.path = path;
routes.push(r);
});
} else {
routes.push(route);
}
return routes;
}, []);
// Convenience method for tests
routes.at = function(name) {
return _.find(this, function(route) {
return name === route.method + " " + route.path;
});
};
module.exports = routes;
| - var _ = require("lodash")
+ var _ = require("lodash");
? +
var publicRoutes = require("./public");
var authenticated = require("./authenticated");
- var routes = [];
+ var feature = require('../lib/feature-flags');
- publicRoutes.concat(authenticated).forEach(function(route) {
? ^ ----
+ var routes = publicRoutes.concat(authenticated).filter(function(route) {
? +++++++++++++ ^^^^
+ if (route.feature) {
+ return [].concat(route.feature).some(function(feat) {
+ if (feat[0] == '!') {
+ return !feature(feat.slice(1));
+ } else {
+ return feature(feat);
+ }
+ });
+ } else {
+ return true;
+ }
+ }).reduce(function(routes, route) {
+
+ delete route.feature;
// If route defines an array of paths,
// register each as an individual route
if (route.paths) {
route.paths.forEach(function(path) {
- var r = _.cloneDeep(route)
+ var r = _.cloneDeep(route);
? +
- delete r.paths
+ delete r.paths;
? +
- r.path = path
+ r.path = path;
? +
- routes.push(r)
+ routes.push(r);
? +
- })
+ });
? +
} else {
routes.push(route);
}
- });
+
+ return routes;
+ }, []);
// Convenience method for tests
routes.at = function(name) {
return _.find(this, function(route) {
- return name === route.method + " " + route.path
+ return name === route.method + " " + route.path;
? +
- })
+ });
? +
- }
+ };
module.exports = routes; | 40 | 1.37931 | 28 | 12 |
866b55d9160d274772aa796946492549eea6ca17 | tests/asttools/test_compiler.py | tests/asttools/test_compiler.py | """Test suite for asttools.compiler."""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import pytest
from pycc.asttools import parse
from pycc.asttools import compiler
source = """
x = True
for y in range(10):
pass
"""
@pytest.fixture
def node():
"""Get as AST node from the source."""
return parse.parse(source)
def test_bytecode_compiler(node):
"""Ensure that bytecode can be generated without errors."""
compiler.ByteCodeCompiler()(node)
def test_source_code_compilter(node):
"""Ensure that source code can be generated without errors."""
compiler.SourceCodeCompiler()(node)
| """Test suite for asttools.compiler."""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import pytest
from pycc import pycompat
from pycc.asttools import parse
from pycc.asttools import compiler
source = """
x = True
for y in range(10):
pass
"""
@pytest.fixture
def node():
"""Get as AST node from the source."""
return parse.parse(source)
def test_bytecode_compiler(node):
"""Ensure that bytecode can be generated without errors."""
compiler.ByteCodeCompiler()(node)
@pytest.mark.skipif(
pycompat.PY3 and pycompat.VERSION.minor > 3,
reason="astkit does not yet support >=PY34",
)
def test_source_code_compilter(node):
"""Ensure that source code can be generated without errors."""
compiler.SourceCodeCompiler()(node)
| Add a skiptest to support PY34 testing | Add a skiptest to support PY34 testing
The third party astkit library does not yet support the latest
PY34 changes to the ast module. Until this is resolved the PY34
tests will skip any use of that library.
Signed-off-by: Kevin Conway <3473c1f185ca03eadc40ad288d84425b54fd7d57@gmail.com>
| Python | apache-2.0 | kevinconway/pycc,kevinconway/pycc | python | ## Code Before:
"""Test suite for asttools.compiler."""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import pytest
from pycc.asttools import parse
from pycc.asttools import compiler
source = """
x = True
for y in range(10):
pass
"""
@pytest.fixture
def node():
"""Get as AST node from the source."""
return parse.parse(source)
def test_bytecode_compiler(node):
"""Ensure that bytecode can be generated without errors."""
compiler.ByteCodeCompiler()(node)
def test_source_code_compilter(node):
"""Ensure that source code can be generated without errors."""
compiler.SourceCodeCompiler()(node)
## Instruction:
Add a skiptest to support PY34 testing
The third party astkit library does not yet support the latest
PY34 changes to the ast module. Until this is resolved the PY34
tests will skip any use of that library.
Signed-off-by: Kevin Conway <3473c1f185ca03eadc40ad288d84425b54fd7d57@gmail.com>
## Code After:
"""Test suite for asttools.compiler."""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import pytest
from pycc import pycompat
from pycc.asttools import parse
from pycc.asttools import compiler
source = """
x = True
for y in range(10):
pass
"""
@pytest.fixture
def node():
"""Get as AST node from the source."""
return parse.parse(source)
def test_bytecode_compiler(node):
"""Ensure that bytecode can be generated without errors."""
compiler.ByteCodeCompiler()(node)
@pytest.mark.skipif(
pycompat.PY3 and pycompat.VERSION.minor > 3,
reason="astkit does not yet support >=PY34",
)
def test_source_code_compilter(node):
"""Ensure that source code can be generated without errors."""
compiler.SourceCodeCompiler()(node)
| """Test suite for asttools.compiler."""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import pytest
+ from pycc import pycompat
from pycc.asttools import parse
from pycc.asttools import compiler
source = """
x = True
for y in range(10):
pass
"""
@pytest.fixture
def node():
"""Get as AST node from the source."""
return parse.parse(source)
def test_bytecode_compiler(node):
"""Ensure that bytecode can be generated without errors."""
compiler.ByteCodeCompiler()(node)
+ @pytest.mark.skipif(
+ pycompat.PY3 and pycompat.VERSION.minor > 3,
+ reason="astkit does not yet support >=PY34",
+ )
def test_source_code_compilter(node):
"""Ensure that source code can be generated without errors."""
compiler.SourceCodeCompiler()(node) | 5 | 0.151515 | 5 | 0 |
d5f8fd6c6d50bfe2424a7a07495c9e5ac5484b09 | git-review.gemspec | git-review.gemspec | $LOAD_PATH.unshift 'lib'
Gem::Specification.new do |s|
s.name = 'git-review'
s.version = '2.0.0'
s.date = Time.now.strftime('%F')
s.summary = 'Facilitates GitHub code reviews'
s.homepage = 'http://github.com/b4mboo/git-review'
s.email = 'bamberger.dominik@gmail.com'
s.authors = ['Dominik Bamberger']
s.files = %w( LICENSE )
s.files += Dir.glob('lib/**/*')
s.files += Dir.glob('bin/**/*')
s.executables = %w( git-review )
s.description = 'Manage review workflow for projects hosted on GitHub (using pull requests).'
s.add_runtime_dependency 'launchy'
s.add_runtime_dependency 'yajl-ruby'
s.add_runtime_dependency 'hashie'
s.add_runtime_dependency 'gli', '~> 2.8.0'
s.add_runtime_dependency 'octokit', '~> 2.0.0'
s.add_development_dependency 'rspec', '>= 2.13.0'
s.add_development_dependency 'guard', '>= 2.0.3'
s.add_development_dependency 'guard-rspec', '>= 3.1.0'
end
| $LOAD_PATH.unshift 'lib'
Gem::Specification.new do |s|
s.name = 'git-review'
s.version = '2.0.1'
s.date = Time.now.strftime('%F')
s.summary = 'Facilitates GitHub code reviews'
s.homepage = 'http://github.com/b4mboo/git-review'
s.email = 'bamberger.dominik@gmail.com'
s.authors = ['Dominik Bamberger']
s.license = 'MIT'
s.files = %w( LICENSE )
s.files += Dir.glob('lib/**/*')
s.files += Dir.glob('bin/**/*')
s.executables = %w( git-review )
s.description = 'Manage review workflow for projects hosted on GitHub (using pull requests).'
s.add_runtime_dependency 'launchy', '~> 0'
s.add_runtime_dependency 'yajl-ruby', '~> 0'
s.add_runtime_dependency 'hashie', '~> 0'
s.add_runtime_dependency 'gli', '~> 2.8'
s.add_runtime_dependency 'octokit', '~> 4.3'
s.add_development_dependency 'rspec', '~> 2.13'
s.add_development_dependency 'guard', '~> 2.0'
s.add_development_dependency 'guard-rspec', '~> 3.1'
end
| Update octokit to the most recent version, cleanup gemspec | Update octokit to the most recent version, cleanup gemspec
| Ruby | mit | b4mboo/git-review | ruby | ## Code Before:
$LOAD_PATH.unshift 'lib'
Gem::Specification.new do |s|
s.name = 'git-review'
s.version = '2.0.0'
s.date = Time.now.strftime('%F')
s.summary = 'Facilitates GitHub code reviews'
s.homepage = 'http://github.com/b4mboo/git-review'
s.email = 'bamberger.dominik@gmail.com'
s.authors = ['Dominik Bamberger']
s.files = %w( LICENSE )
s.files += Dir.glob('lib/**/*')
s.files += Dir.glob('bin/**/*')
s.executables = %w( git-review )
s.description = 'Manage review workflow for projects hosted on GitHub (using pull requests).'
s.add_runtime_dependency 'launchy'
s.add_runtime_dependency 'yajl-ruby'
s.add_runtime_dependency 'hashie'
s.add_runtime_dependency 'gli', '~> 2.8.0'
s.add_runtime_dependency 'octokit', '~> 2.0.0'
s.add_development_dependency 'rspec', '>= 2.13.0'
s.add_development_dependency 'guard', '>= 2.0.3'
s.add_development_dependency 'guard-rspec', '>= 3.1.0'
end
## Instruction:
Update octokit to the most recent version, cleanup gemspec
## Code After:
$LOAD_PATH.unshift 'lib'
Gem::Specification.new do |s|
s.name = 'git-review'
s.version = '2.0.1'
s.date = Time.now.strftime('%F')
s.summary = 'Facilitates GitHub code reviews'
s.homepage = 'http://github.com/b4mboo/git-review'
s.email = 'bamberger.dominik@gmail.com'
s.authors = ['Dominik Bamberger']
s.license = 'MIT'
s.files = %w( LICENSE )
s.files += Dir.glob('lib/**/*')
s.files += Dir.glob('bin/**/*')
s.executables = %w( git-review )
s.description = 'Manage review workflow for projects hosted on GitHub (using pull requests).'
s.add_runtime_dependency 'launchy', '~> 0'
s.add_runtime_dependency 'yajl-ruby', '~> 0'
s.add_runtime_dependency 'hashie', '~> 0'
s.add_runtime_dependency 'gli', '~> 2.8'
s.add_runtime_dependency 'octokit', '~> 4.3'
s.add_development_dependency 'rspec', '~> 2.13'
s.add_development_dependency 'guard', '~> 2.0'
s.add_development_dependency 'guard-rspec', '~> 3.1'
end
| $LOAD_PATH.unshift 'lib'
Gem::Specification.new do |s|
s.name = 'git-review'
- s.version = '2.0.0'
? ^
+ s.version = '2.0.1'
? ^
s.date = Time.now.strftime('%F')
s.summary = 'Facilitates GitHub code reviews'
s.homepage = 'http://github.com/b4mboo/git-review'
s.email = 'bamberger.dominik@gmail.com'
s.authors = ['Dominik Bamberger']
+ s.license = 'MIT'
s.files = %w( LICENSE )
s.files += Dir.glob('lib/**/*')
s.files += Dir.glob('bin/**/*')
s.executables = %w( git-review )
s.description = 'Manage review workflow for projects hosted on GitHub (using pull requests).'
- s.add_runtime_dependency 'launchy'
+ s.add_runtime_dependency 'launchy', '~> 0'
? ++++++++
- s.add_runtime_dependency 'yajl-ruby'
+ s.add_runtime_dependency 'yajl-ruby', '~> 0'
? ++++++++
- s.add_runtime_dependency 'hashie'
+ s.add_runtime_dependency 'hashie', '~> 0'
? ++++++++
- s.add_runtime_dependency 'gli', '~> 2.8.0'
? --
+ s.add_runtime_dependency 'gli', '~> 2.8'
- s.add_runtime_dependency 'octokit', '~> 2.0.0'
? ^ ^^^
+ s.add_runtime_dependency 'octokit', '~> 4.3'
? ^ ^
- s.add_development_dependency 'rspec', '>= 2.13.0'
? - --
+ s.add_development_dependency 'rspec', '~> 2.13'
? +
- s.add_development_dependency 'guard', '>= 2.0.3'
? - --
+ s.add_development_dependency 'guard', '~> 2.0'
? +
- s.add_development_dependency 'guard-rspec', '>= 3.1.0'
? - --
+ s.add_development_dependency 'guard-rspec', '~> 3.1'
? +
end | 19 | 0.703704 | 10 | 9 |
52e193279c62259bd777c9ca0dbaff06adf2769c | index.html | index.html | <html>
<head>
<meta charset="UTF-8">
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.4.6/p5.min.js"></script>
<script language="javascript" type="text/javascript" src="https://github.com/adjl/GameOfLife/raw/master/game-of-life.js"></script>
<style> body { margin: 0; } </style>
</head>
<body></body>
</html>
| <html>
<head>
<meta charset="UTF-8">
<link rel="apple-touch-icon-precomposed" href="https://raw.githubusercontent.com/adjl/adjl.github.io/master/favicon.png">
<link rel="icon" href="https://raw.githubusercontent.com/adjl/adjl.github.io/master/favicon.png">
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.4.6/p5.min.js"></script>
<script language="javascript" type="text/javascript" src="https://raw.githubusercontent.com/adjl/GameOfLife/master/game-of-life.js"></script>
<style> body { margin: 0; } </style>
</head>
<body></body>
</html>
| Use direct raw content link, and include favicon | Use direct raw content link, and include favicon
| HTML | mit | adjl/GameOfLife,adjl/GameOfLife | html | ## Code Before:
<html>
<head>
<meta charset="UTF-8">
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.4.6/p5.min.js"></script>
<script language="javascript" type="text/javascript" src="https://github.com/adjl/GameOfLife/raw/master/game-of-life.js"></script>
<style> body { margin: 0; } </style>
</head>
<body></body>
</html>
## Instruction:
Use direct raw content link, and include favicon
## Code After:
<html>
<head>
<meta charset="UTF-8">
<link rel="apple-touch-icon-precomposed" href="https://raw.githubusercontent.com/adjl/adjl.github.io/master/favicon.png">
<link rel="icon" href="https://raw.githubusercontent.com/adjl/adjl.github.io/master/favicon.png">
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.4.6/p5.min.js"></script>
<script language="javascript" type="text/javascript" src="https://raw.githubusercontent.com/adjl/GameOfLife/master/game-of-life.js"></script>
<style> body { margin: 0; } </style>
</head>
<body></body>
</html>
| <html>
<head>
<meta charset="UTF-8">
+ <link rel="apple-touch-icon-precomposed" href="https://raw.githubusercontent.com/adjl/adjl.github.io/master/favicon.png">
+ <link rel="icon" href="https://raw.githubusercontent.com/adjl/adjl.github.io/master/favicon.png">
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.4.6/p5.min.js"></script>
- <script language="javascript" type="text/javascript" src="https://github.com/adjl/GameOfLife/raw/master/game-of-life.js"></script>
? ----
+ <script language="javascript" type="text/javascript" src="https://raw.githubusercontent.com/adjl/GameOfLife/master/game-of-life.js"></script>
? ++++ +++++++++++
<style> body { margin: 0; } </style>
</head>
<body></body>
</html> | 4 | 0.444444 | 3 | 1 |
764f0bb00141042c2f0e6c61c08909f4864078fb | build/webpack.dev.conf.js | build/webpack.dev.conf.js | var
config = require('../config'),
webpack = require('webpack'),
merge = require('webpack-merge'),
cssUtils = require('./css-utils'),
baseWebpackConfig = require('./webpack.base.conf'),
HtmlWebpackPlugin = require('html-webpack-plugin')
// add hot-reload related code to entry chunks
Object.keys(baseWebpackConfig.entry).forEach(function (name) {
baseWebpackConfig.entry[name] = ['./build/hot-reload'].concat(baseWebpackConfig.entry[name])
})
module.exports = merge(baseWebpackConfig, {
// eval-source-map is faster for development
devtool: '#eval-source-map',
devServer: {
historyApiFallback: true,
noInfo: true
},
module: {
rules: cssUtils.styleRules({
sourceMap: config.dev.cssSourceMap,
postcss: true
})
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'src/index.html',
inject: true
})
]
})
| var
config = require('../config'),
webpack = require('webpack'),
merge = require('webpack-merge'),
cssUtils = require('./css-utils'),
baseWebpackConfig = require('./webpack.base.conf'),
HtmlWebpackPlugin = require('html-webpack-plugin')
// add hot-reload related code to entry chunks
Object.keys(baseWebpackConfig.entry).forEach(function (name) {
baseWebpackConfig.entry[name] = ['./build/hot-reload'].concat(baseWebpackConfig.entry[name])
})
module.exports = merge(baseWebpackConfig, {
// eval-source-map is faster for development
devtool: '#eval-source-map',
devServer: {
historyApiFallback: true,
noInfo: true
},
module: {
rules: cssUtils.styleRules({
sourceMap: config.dev.cssSourceMap,
postcss: true
})
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'src/index.html',
inject: true
})
],
performance: {
hints: false
}
})
| Disable webpack perf hints for dev mode | chore: Disable webpack perf hints for dev mode
| JavaScript | mit | quasarframework/quasar-play,rstoenescu/quasar-play,quasarframework/quasar-play,rstoenescu/quasar-play | javascript | ## Code Before:
var
config = require('../config'),
webpack = require('webpack'),
merge = require('webpack-merge'),
cssUtils = require('./css-utils'),
baseWebpackConfig = require('./webpack.base.conf'),
HtmlWebpackPlugin = require('html-webpack-plugin')
// add hot-reload related code to entry chunks
Object.keys(baseWebpackConfig.entry).forEach(function (name) {
baseWebpackConfig.entry[name] = ['./build/hot-reload'].concat(baseWebpackConfig.entry[name])
})
module.exports = merge(baseWebpackConfig, {
// eval-source-map is faster for development
devtool: '#eval-source-map',
devServer: {
historyApiFallback: true,
noInfo: true
},
module: {
rules: cssUtils.styleRules({
sourceMap: config.dev.cssSourceMap,
postcss: true
})
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'src/index.html',
inject: true
})
]
})
## Instruction:
chore: Disable webpack perf hints for dev mode
## Code After:
var
config = require('../config'),
webpack = require('webpack'),
merge = require('webpack-merge'),
cssUtils = require('./css-utils'),
baseWebpackConfig = require('./webpack.base.conf'),
HtmlWebpackPlugin = require('html-webpack-plugin')
// add hot-reload related code to entry chunks
Object.keys(baseWebpackConfig.entry).forEach(function (name) {
baseWebpackConfig.entry[name] = ['./build/hot-reload'].concat(baseWebpackConfig.entry[name])
})
module.exports = merge(baseWebpackConfig, {
// eval-source-map is faster for development
devtool: '#eval-source-map',
devServer: {
historyApiFallback: true,
noInfo: true
},
module: {
rules: cssUtils.styleRules({
sourceMap: config.dev.cssSourceMap,
postcss: true
})
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'src/index.html',
inject: true
})
],
performance: {
hints: false
}
})
| var
config = require('../config'),
webpack = require('webpack'),
merge = require('webpack-merge'),
cssUtils = require('./css-utils'),
baseWebpackConfig = require('./webpack.base.conf'),
HtmlWebpackPlugin = require('html-webpack-plugin')
// add hot-reload related code to entry chunks
Object.keys(baseWebpackConfig.entry).forEach(function (name) {
baseWebpackConfig.entry[name] = ['./build/hot-reload'].concat(baseWebpackConfig.entry[name])
})
module.exports = merge(baseWebpackConfig, {
// eval-source-map is faster for development
devtool: '#eval-source-map',
devServer: {
historyApiFallback: true,
noInfo: true
},
module: {
rules: cssUtils.styleRules({
sourceMap: config.dev.cssSourceMap,
postcss: true
})
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'src/index.html',
inject: true
})
- ]
+ ],
? +
+ performance: {
+ hints: false
+ }
}) | 5 | 0.138889 | 4 | 1 |
ea6cc5ac8afc56f95b73856130f23e09a1cc7630 | recipes-core/packagegroups/packagegroup-ni-xfce.bb | recipes-core/packagegroups/packagegroup-ni-xfce.bb |
SUMMARY = "Xfce desktop environment packages for NI Linux Realtime distribution"
LICENSE = "MIT"
PR = "r1"
inherit packagegroup
PACKAGE_ARCH = "${MACHINE_ARCH}"
RDEPENDS_${PN} = "\
packagegroup-xfce-base \
xf86-video-vesa \
xfce4-xkb-plugin \
xserver-xfce-init \
xrdb \
xfce-nilrt-settings \
xorg-fonts-misc \
xorg-fonts-100dpi \
xfontsel \
fontconfig-overrides \
pt-sans \
gnome-icon-theme-minimal \
"
|
SUMMARY = "Xfce desktop environment packages for NI Linux Realtime distribution"
LICENSE = "MIT"
PR = "r1"
inherit packagegroup
PACKAGE_ARCH = "${MACHINE_ARCH}"
RDEPENDS_${PN} = "\
packagegroup-xfce-base \
xf86-video-vesa \
xfce4-xkb-plugin \
xserver-xfce-init \
xrdb \
xfce-nilrt-settings \
xorg-fonts-misc \
xorg-fonts-100dpi \
xfontsel \
fontconfig-overrides \
pt-sans \
gnome-icon-theme-minimal \
mousepad \
"
| Add the Mousepad text editor to the NI XFCE package group | xfce: Add the Mousepad text editor to the NI XFCE package group
Signed-off-by: Ben Shelton <873d2944fc7a954ed322314738197137e10de387@ni.com>
| BitBake | mit | ni/meta-nilrt,ni/meta-nilrt,ni/meta-nilrt,ni/meta-nilrt,ni/meta-nilrt | bitbake | ## Code Before:
SUMMARY = "Xfce desktop environment packages for NI Linux Realtime distribution"
LICENSE = "MIT"
PR = "r1"
inherit packagegroup
PACKAGE_ARCH = "${MACHINE_ARCH}"
RDEPENDS_${PN} = "\
packagegroup-xfce-base \
xf86-video-vesa \
xfce4-xkb-plugin \
xserver-xfce-init \
xrdb \
xfce-nilrt-settings \
xorg-fonts-misc \
xorg-fonts-100dpi \
xfontsel \
fontconfig-overrides \
pt-sans \
gnome-icon-theme-minimal \
"
## Instruction:
xfce: Add the Mousepad text editor to the NI XFCE package group
Signed-off-by: Ben Shelton <873d2944fc7a954ed322314738197137e10de387@ni.com>
## Code After:
SUMMARY = "Xfce desktop environment packages for NI Linux Realtime distribution"
LICENSE = "MIT"
PR = "r1"
inherit packagegroup
PACKAGE_ARCH = "${MACHINE_ARCH}"
RDEPENDS_${PN} = "\
packagegroup-xfce-base \
xf86-video-vesa \
xfce4-xkb-plugin \
xserver-xfce-init \
xrdb \
xfce-nilrt-settings \
xorg-fonts-misc \
xorg-fonts-100dpi \
xfontsel \
fontconfig-overrides \
pt-sans \
gnome-icon-theme-minimal \
mousepad \
"
|
SUMMARY = "Xfce desktop environment packages for NI Linux Realtime distribution"
LICENSE = "MIT"
PR = "r1"
inherit packagegroup
PACKAGE_ARCH = "${MACHINE_ARCH}"
RDEPENDS_${PN} = "\
packagegroup-xfce-base \
xf86-video-vesa \
xfce4-xkb-plugin \
xserver-xfce-init \
xrdb \
xfce-nilrt-settings \
xorg-fonts-misc \
xorg-fonts-100dpi \
xfontsel \
fontconfig-overrides \
pt-sans \
gnome-icon-theme-minimal \
+ mousepad \
" | 1 | 0.043478 | 1 | 0 |
e7577d7a0f6c1c91fdccc89745cf4ef484349fa3 | src/app/overview-page/store/studies/studies.reducer.ts | src/app/overview-page/store/studies/studies.reducer.ts | import { EntityAdapter, EntityState, createEntityAdapter } from '@ngrx/entity'
import { Study } from '../../../shared/models/study.model'
import * as actions from './studies.actions'
export interface State extends EntityState<Study> {
isLoaded: boolean
}
export const adapter: EntityAdapter<Study> = createEntityAdapter<Study>()
export const initialState: State = adapter.getInitialState({
isLoaded: false
})
export function reducer(state = initialState, action: actions.Actions): State {
switch (action.type) {
case actions.LOAD: {
return { ...state, isLoaded: false }
}
case actions.LOAD_SUCCESS: {
return { ...adapter.addAll(action.payload, state), isLoaded: true }
}
case actions.LOAD_FAIL: {
return { ...initialState }
}
default:
return state
}
}
export const getIsLoaded = (state: State) => state.isLoaded
| import { EntityAdapter, EntityState, createEntityAdapter } from '@ngrx/entity'
import { Study } from '../../../shared/models/study.model'
import * as actions from './studies.actions'
export interface State extends EntityState<Study> {
isLoaded: boolean
}
export const adapter: EntityAdapter<Study> = createEntityAdapter<Study>({
selectId: (study: Study) => study.projectName
})
export const initialState: State = adapter.getInitialState({
isLoaded: false
})
export function reducer(state = initialState, action: actions.Actions): State {
switch (action.type) {
case actions.LOAD: {
return { ...state, isLoaded: false }
}
case actions.LOAD_SUCCESS: {
return { ...adapter.addAll(action.payload, state), isLoaded: true }
}
case actions.LOAD_FAIL: {
return { ...initialState }
}
default:
return state
}
}
export const getIsLoaded = (state: State) => state.isLoaded
| Change entity id to projectName | Change entity id to projectName
| TypeScript | apache-2.0 | RADAR-CNS/RADAR-Dashboard,RADAR-CNS/RADAR-Dashboard,RADAR-CNS/RADAR-Dashboard,RADAR-CNS/RADAR-Dashboard | typescript | ## Code Before:
import { EntityAdapter, EntityState, createEntityAdapter } from '@ngrx/entity'
import { Study } from '../../../shared/models/study.model'
import * as actions from './studies.actions'
export interface State extends EntityState<Study> {
isLoaded: boolean
}
export const adapter: EntityAdapter<Study> = createEntityAdapter<Study>()
export const initialState: State = adapter.getInitialState({
isLoaded: false
})
export function reducer(state = initialState, action: actions.Actions): State {
switch (action.type) {
case actions.LOAD: {
return { ...state, isLoaded: false }
}
case actions.LOAD_SUCCESS: {
return { ...adapter.addAll(action.payload, state), isLoaded: true }
}
case actions.LOAD_FAIL: {
return { ...initialState }
}
default:
return state
}
}
export const getIsLoaded = (state: State) => state.isLoaded
## Instruction:
Change entity id to projectName
## Code After:
import { EntityAdapter, EntityState, createEntityAdapter } from '@ngrx/entity'
import { Study } from '../../../shared/models/study.model'
import * as actions from './studies.actions'
export interface State extends EntityState<Study> {
isLoaded: boolean
}
export const adapter: EntityAdapter<Study> = createEntityAdapter<Study>({
selectId: (study: Study) => study.projectName
})
export const initialState: State = adapter.getInitialState({
isLoaded: false
})
export function reducer(state = initialState, action: actions.Actions): State {
switch (action.type) {
case actions.LOAD: {
return { ...state, isLoaded: false }
}
case actions.LOAD_SUCCESS: {
return { ...adapter.addAll(action.payload, state), isLoaded: true }
}
case actions.LOAD_FAIL: {
return { ...initialState }
}
default:
return state
}
}
export const getIsLoaded = (state: State) => state.isLoaded
| import { EntityAdapter, EntityState, createEntityAdapter } from '@ngrx/entity'
import { Study } from '../../../shared/models/study.model'
import * as actions from './studies.actions'
export interface State extends EntityState<Study> {
isLoaded: boolean
}
- export const adapter: EntityAdapter<Study> = createEntityAdapter<Study>()
? ^
+ export const adapter: EntityAdapter<Study> = createEntityAdapter<Study>({
? ^
+ selectId: (study: Study) => study.projectName
+ })
export const initialState: State = adapter.getInitialState({
isLoaded: false
})
export function reducer(state = initialState, action: actions.Actions): State {
switch (action.type) {
case actions.LOAD: {
return { ...state, isLoaded: false }
}
case actions.LOAD_SUCCESS: {
return { ...adapter.addAll(action.payload, state), isLoaded: true }
}
case actions.LOAD_FAIL: {
return { ...initialState }
}
default:
return state
}
}
export const getIsLoaded = (state: State) => state.isLoaded | 4 | 0.114286 | 3 | 1 |
e3556b9b3ead20cd8385ac374af3a0f721ab2235 | test/content_type_detector_test.rb | test/content_type_detector_test.rb | require './test/helper'
class ContentTypeDetectorTest < Test::Unit::TestCase
context 'given a name' do
should 'return a content type based on that name' do
@filename = "/path/to/something.jpg"
assert_equal "image/jpeg", Paperclip::ContentTypeDetector.new(@filename).detect
end
should 'return a content type based on the content of the file' do
tempfile = Tempfile.new("something")
tempfile.write("This is a file.")
tempfile.rewind
assert_equal "text/plain", Paperclip::ContentTypeDetector.new(tempfile.path).detect
end
should 'return an empty content type if the file is empty' do
tempfile = Tempfile.new("something")
tempfile.rewind
assert_equal "inode/x-empty", Paperclip::ContentTypeDetector.new(tempfile.path).detect
end
should 'return a sensible default if no filename is supplied' do
assert_equal "application/octet-stream", Paperclip::ContentTypeDetector.new('').detect
end
should 'return a sensible default if something goes wrong' do
@filename = "/path/to/something"
assert_equal "application/octet-stream", Paperclip::ContentTypeDetector.new(@filename).detect
end
should 'return a sensible default when the file command is missing' do
Paperclip.stubs(:run).raises(Cocaine::CommandLineError.new)
@filename = "/path/to/something"
assert_equal "application/octet-stream", Paperclip::ContentTypeDetector.new(@filename).detect
end
end
end
| require './test/helper'
class ContentTypeDetectorTest < Test::Unit::TestCase
context 'given a name' do
should 'return a content type based on that name' do
@filename = "/path/to/something.jpg"
assert_equal "image/jpeg", Paperclip::ContentTypeDetector.new(@filename).detect
end
should 'return a content type based on the content of the file' do
tempfile = Tempfile.new("something")
tempfile.write("This is a file.")
tempfile.rewind
assert_equal "text/plain", Paperclip::ContentTypeDetector.new(tempfile.path).detect
end
should 'return an empty content type if the file is empty' do
tempfile = Tempfile.new("something")
tempfile.rewind
assert_equal "inode/x-empty", Paperclip::ContentTypeDetector.new(tempfile.path).detect
end
should 'return a sensible default if no filename is supplied' do
assert_equal "application/octet-stream", Paperclip::ContentTypeDetector.new('').detect
end
should 'return a sensible default if something goes wrong' do
@filename = "/path/to/something"
assert_equal "application/octet-stream", Paperclip::ContentTypeDetector.new(@filename).detect
end
should 'return a sensible default when the file command is missing' do
Paperclip.stubs(:run).raises(Cocaine::CommandLineError.new)
@filename = "/path/to/something"
assert_equal "application/octet-stream", Paperclip::ContentTypeDetector.new(@filename).detect
end
end
should 'return a sensible default on the odd change that run returns nil' do
Paperclip.stubs(:run).returns(nil)
assert_equal "application/octet-stream",
Paperclip::ContentTypeDetector.new("windows").detect
end
end
| Test the odd chance that returns nil | Test the odd chance that returns nil
| Ruby | mit | cmaion/paperclip,keathley/paperclip,frankpinto/paperclip,keathley/paperclip,freeslugs/paperclip,mehulkar/paperclip,joshisa/paperclip,aditya01933/paperclip,danielwanja/paperclip,rpbaptist/paperclip,felipemathies/paperclip,carnivalmobile/paperclip,soramugi/paperclip,dgynn/paperclip,sopheak-se/paperclip,Cohealo/paperclip,victorngkp/paperclip,mrb/paperclip,agcantarelli/paperclip,justanshulsharma/paperclip,mdkalish/paperclip,mrgilman/paperclip,manorie/paperclip,raow/paperclip,agcantarelli/paperclip,gfvcastro/paperclip,cmaion/paperclip,InesCARodrigues/paperclip,Leadformance/paperclip,medcat/paperclip,tiegz/paperclip,freeslugs/paperclip,sideci-sample/sideci-sample-paperclip,dgynn/paperclip,frankpinto/paperclip,rpbaptist/paperclip,crowdtap/paperclip,carnivalmobile/paperclip,raow/paperclip,pcorliss/paperclip,howaboutwe/paperclip,victorngkp/paperclip,joshisa/paperclip,mdkalish/paperclip,mrb/paperclip,mrgilman/paperclip,soramugi/paperclip,crowdtap/paperclip,maintux/paperclip,InesCARodrigues/paperclip,Sporky023/paperclip,Sporky023/paperclip,mehulkar/paperclip,gfvcastro/paperclip,Cohealo/paperclip,zurb/paperclip,bdewater/paperclip,zurb/paperclip,pandamako/paperclip,aditya01933/paperclip,felipemathies/paperclip,bdewater/paperclip,greatbody/paperclip,alexandrz/paperclip,onursarikaya/paperclip,betesh/paperclip,onursarikaya/paperclip,medcat/paperclip,tylerwillingham/paperclip,tiegz/paperclip,greatbody/paperclip,ScotterC/paperclip,maintux/paperclip,degica/paperclip,tylerwillingham/paperclip,ScotterC/paperclip,justanshulsharma/paperclip,sopheak-se/paperclip,degica/paperclip,alexandrz/paperclip,Leadformance/paperclip,pandamako/paperclip,betesh/paperclip,manorie/paperclip | ruby | ## Code Before:
require './test/helper'
class ContentTypeDetectorTest < Test::Unit::TestCase
context 'given a name' do
should 'return a content type based on that name' do
@filename = "/path/to/something.jpg"
assert_equal "image/jpeg", Paperclip::ContentTypeDetector.new(@filename).detect
end
should 'return a content type based on the content of the file' do
tempfile = Tempfile.new("something")
tempfile.write("This is a file.")
tempfile.rewind
assert_equal "text/plain", Paperclip::ContentTypeDetector.new(tempfile.path).detect
end
should 'return an empty content type if the file is empty' do
tempfile = Tempfile.new("something")
tempfile.rewind
assert_equal "inode/x-empty", Paperclip::ContentTypeDetector.new(tempfile.path).detect
end
should 'return a sensible default if no filename is supplied' do
assert_equal "application/octet-stream", Paperclip::ContentTypeDetector.new('').detect
end
should 'return a sensible default if something goes wrong' do
@filename = "/path/to/something"
assert_equal "application/octet-stream", Paperclip::ContentTypeDetector.new(@filename).detect
end
should 'return a sensible default when the file command is missing' do
Paperclip.stubs(:run).raises(Cocaine::CommandLineError.new)
@filename = "/path/to/something"
assert_equal "application/octet-stream", Paperclip::ContentTypeDetector.new(@filename).detect
end
end
end
## Instruction:
Test the odd chance that returns nil
## Code After:
require './test/helper'
class ContentTypeDetectorTest < Test::Unit::TestCase
context 'given a name' do
should 'return a content type based on that name' do
@filename = "/path/to/something.jpg"
assert_equal "image/jpeg", Paperclip::ContentTypeDetector.new(@filename).detect
end
should 'return a content type based on the content of the file' do
tempfile = Tempfile.new("something")
tempfile.write("This is a file.")
tempfile.rewind
assert_equal "text/plain", Paperclip::ContentTypeDetector.new(tempfile.path).detect
end
should 'return an empty content type if the file is empty' do
tempfile = Tempfile.new("something")
tempfile.rewind
assert_equal "inode/x-empty", Paperclip::ContentTypeDetector.new(tempfile.path).detect
end
should 'return a sensible default if no filename is supplied' do
assert_equal "application/octet-stream", Paperclip::ContentTypeDetector.new('').detect
end
should 'return a sensible default if something goes wrong' do
@filename = "/path/to/something"
assert_equal "application/octet-stream", Paperclip::ContentTypeDetector.new(@filename).detect
end
should 'return a sensible default when the file command is missing' do
Paperclip.stubs(:run).raises(Cocaine::CommandLineError.new)
@filename = "/path/to/something"
assert_equal "application/octet-stream", Paperclip::ContentTypeDetector.new(@filename).detect
end
end
should 'return a sensible default on the odd change that run returns nil' do
Paperclip.stubs(:run).returns(nil)
assert_equal "application/octet-stream",
Paperclip::ContentTypeDetector.new("windows").detect
end
end
| require './test/helper'
class ContentTypeDetectorTest < Test::Unit::TestCase
context 'given a name' do
should 'return a content type based on that name' do
@filename = "/path/to/something.jpg"
assert_equal "image/jpeg", Paperclip::ContentTypeDetector.new(@filename).detect
end
should 'return a content type based on the content of the file' do
tempfile = Tempfile.new("something")
tempfile.write("This is a file.")
tempfile.rewind
assert_equal "text/plain", Paperclip::ContentTypeDetector.new(tempfile.path).detect
end
should 'return an empty content type if the file is empty' do
tempfile = Tempfile.new("something")
tempfile.rewind
assert_equal "inode/x-empty", Paperclip::ContentTypeDetector.new(tempfile.path).detect
end
should 'return a sensible default if no filename is supplied' do
assert_equal "application/octet-stream", Paperclip::ContentTypeDetector.new('').detect
end
should 'return a sensible default if something goes wrong' do
@filename = "/path/to/something"
assert_equal "application/octet-stream", Paperclip::ContentTypeDetector.new(@filename).detect
end
should 'return a sensible default when the file command is missing' do
Paperclip.stubs(:run).raises(Cocaine::CommandLineError.new)
@filename = "/path/to/something"
assert_equal "application/octet-stream", Paperclip::ContentTypeDetector.new(@filename).detect
end
end
+
+ should 'return a sensible default on the odd change that run returns nil' do
+ Paperclip.stubs(:run).returns(nil)
+ assert_equal "application/octet-stream",
+ Paperclip::ContentTypeDetector.new("windows").detect
+ end
end | 6 | 0.15 | 6 | 0 |
316c3de6dfed16b902ae2cc27566e98f7bf2677e | spec/spec_helper.rb | spec/spec_helper.rb | $:.unshift File.expand_path("../..", __FILE__)
RSpec.configure do |conf|
conf.include Rack::Test::Methods
end
def fixture_path(filename=nil)
path = File.expand_path("../fixtures", __FILE__)
filename.nil? ? path : File.join(path, filename)
end
def fixture(file)
File.read(File.join(fixture_path, file))
end | $:.unshift File.expand_path("../..", __FILE__)
def fixture_path(filename=nil)
path = File.expand_path("../fixtures", __FILE__)
filename.nil? ? path : File.join(path, filename)
end
def fixture(file)
File.read(File.join(fixture_path, file))
end | Remove rack test method from spec helper | Remove rack test method from spec helper
| Ruby | mit | sosedoff/net-ssh-session | ruby | ## Code Before:
$:.unshift File.expand_path("../..", __FILE__)
RSpec.configure do |conf|
conf.include Rack::Test::Methods
end
def fixture_path(filename=nil)
path = File.expand_path("../fixtures", __FILE__)
filename.nil? ? path : File.join(path, filename)
end
def fixture(file)
File.read(File.join(fixture_path, file))
end
## Instruction:
Remove rack test method from spec helper
## Code After:
$:.unshift File.expand_path("../..", __FILE__)
def fixture_path(filename=nil)
path = File.expand_path("../fixtures", __FILE__)
filename.nil? ? path : File.join(path, filename)
end
def fixture(file)
File.read(File.join(fixture_path, file))
end | $:.unshift File.expand_path("../..", __FILE__)
-
- RSpec.configure do |conf|
- conf.include Rack::Test::Methods
- end
def fixture_path(filename=nil)
path = File.expand_path("../fixtures", __FILE__)
filename.nil? ? path : File.join(path, filename)
end
def fixture(file)
File.read(File.join(fixture_path, file))
end | 4 | 0.285714 | 0 | 4 |
e9c4580a2d7e7a27ca81484548e2d0d828d771c5 | .travis.sh | .travis.sh | set -ev
echo "Running sinatra tests..."
bundle exec rake
echo "Running sinatra-contrib tests..."
cd sinatra-contrib
bundle install --jobs=3 --retry=3
bundle exec rake
| set -ev
echo "Running sinatra tests..."
bundle exec rake
echo "Running sinatra-contrib tests..."
cd $TRAVIS_BUILD_DIR/sinatra-contrib
bundle install --jobs=3 --retry=3
bundle exec rake
| Use full path to sinatra-contrib build dir | Use full path to sinatra-contrib build dir
| Shell | mit | ryanshaw/sinatra,JonMidhir/sinatra,mwpastore/sinatra,JonMidhir/sinatra,burningTyger/sinatra,sinatra/sinatra,burningTyger/sinatra,jkowens/sinatra,jkowens/sinatra,burningTyger/sinatra,jkowens/sinatra,mwpastore/sinatra,ryanshaw/sinatra,sinatra/sinatra,JonMidhir/sinatra,mwpastore/sinatra | shell | ## Code Before:
set -ev
echo "Running sinatra tests..."
bundle exec rake
echo "Running sinatra-contrib tests..."
cd sinatra-contrib
bundle install --jobs=3 --retry=3
bundle exec rake
## Instruction:
Use full path to sinatra-contrib build dir
## Code After:
set -ev
echo "Running sinatra tests..."
bundle exec rake
echo "Running sinatra-contrib tests..."
cd $TRAVIS_BUILD_DIR/sinatra-contrib
bundle install --jobs=3 --retry=3
bundle exec rake
| set -ev
echo "Running sinatra tests..."
bundle exec rake
echo "Running sinatra-contrib tests..."
- cd sinatra-contrib
+ cd $TRAVIS_BUILD_DIR/sinatra-contrib
bundle install --jobs=3 --retry=3
bundle exec rake | 2 | 0.222222 | 1 | 1 |
6cf6d8b990771a529c203f58f0880d28b7c99d80 | lib/liquid/drop.rb | lib/liquid/drop.rb | module Liquid
# A drop in liquid is a class which allows you to to export DOM like things to liquid
# Methods of drops are callable.
# The main use for liquid drops is the implement lazy loaded objects.
# If you would like to make data available to the web designers which you don't want loaded unless needed then
# a drop is a great way to do that
#
# Example:
#
# class ProductDrop < Liquid::Drop
# def top_sales
# Shop.current.products.find(:all, :order => 'sales', :limit => 10 )
# end
# end
#
# tmpl = Liquid::Template.parse( ' {% for product in product.top_sales %} {{ product.name }} {%endfor%} ' )
# tmpl.render('product' => ProductDrop.new ) # will invoke top_sales query.
#
# Your drop can either implement the methods sans any parameters or implement the before_method(name) method which is a
# catch all
class Drop
attr_writer :context
# Catch all for the method
def before_method(method)
nil
end
# called by liquid to invoke a drop
def invoke_drop(method_or_key)
if self.class.public_method_defined?(method_or_key.to_s.to_sym)
send(method_or_key.to_s.to_sym)
else
before_method(method_or_key)
end
end
def has_key?(name)
true
end
def to_liquid
self
end
alias :[] :invoke_drop
end
end
| module Liquid
# A drop in liquid is a class which allows you to to export DOM like things to liquid.
# Methods of drops are callable.
# The main use for liquid drops is the implement lazy loaded objects.
# If you would like to make data available to the web designers which you don't want loaded unless needed then
# a drop is a great way to do that
#
# Example:
#
# class ProductDrop < Liquid::Drop
# def top_sales
# Shop.current.products.find(:all, :order => 'sales', :limit => 10 )
# end
# end
#
# tmpl = Liquid::Template.parse( ' {% for product in product.top_sales %} {{ product.name }} {%endfor%} ' )
# tmpl.render('product' => ProductDrop.new ) # will invoke top_sales query.
#
# Your drop can either implement the methods sans any parameters or implement the before_method(name) method which is a
# catch all
class Drop
attr_writer :context
# Catch all for the method
def before_method(method)
nil
end
# called by liquid to invoke a drop
def invoke_drop(method_or_key)
if self.class.public_method_defined?(method_or_key.to_s.to_sym)
send(method_or_key.to_s.to_sym)
else
before_method(method_or_key)
end
end
def has_key?(name)
true
end
def to_liquid
self
end
alias :[] :invoke_drop
end
end
| Correct formatting for doc comments | Correct formatting for doc comments
Portions of the code examples were not being rendered as code because they lacked a leading tab. Also, a missing period on the first sentence made the first paragraph confusing. | Ruby | mit | ipmobiletech/Shopify-liquid,Shopify/liquid,livingsocial/liquid,Tiger66639/liquid,lastobelus/liquid,insales/liquid,knu/liquid,evulse/liquid,nickpearson/liquid,xiaoliw7/liquid,tdg5/liquid,howkj1/liquid,bluerail/liquid,tim-vandecasteele/liquid,djreimer/liquid,siteleaf/liquid,ilovezy/liquid,mrmanc/liquid,Wirachmat/liquid,boobooninja/liquid,zhangkuaiji/liquid,Richardphp/liquid,sideci-sample/sideci-sample-liquid,SOFTPOWER1991/liquid,bibio/liquid,illMadeKnight/liquid-1,locomotivecms/liquid,mcary/liquid,PMArtz92/liquid,vietlq/liquid,beni55/liquid,bettyblocks/liquid,pheen/liquid | ruby | ## Code Before:
module Liquid
# A drop in liquid is a class which allows you to to export DOM like things to liquid
# Methods of drops are callable.
# The main use for liquid drops is the implement lazy loaded objects.
# If you would like to make data available to the web designers which you don't want loaded unless needed then
# a drop is a great way to do that
#
# Example:
#
# class ProductDrop < Liquid::Drop
# def top_sales
# Shop.current.products.find(:all, :order => 'sales', :limit => 10 )
# end
# end
#
# tmpl = Liquid::Template.parse( ' {% for product in product.top_sales %} {{ product.name }} {%endfor%} ' )
# tmpl.render('product' => ProductDrop.new ) # will invoke top_sales query.
#
# Your drop can either implement the methods sans any parameters or implement the before_method(name) method which is a
# catch all
class Drop
attr_writer :context
# Catch all for the method
def before_method(method)
nil
end
# called by liquid to invoke a drop
def invoke_drop(method_or_key)
if self.class.public_method_defined?(method_or_key.to_s.to_sym)
send(method_or_key.to_s.to_sym)
else
before_method(method_or_key)
end
end
def has_key?(name)
true
end
def to_liquid
self
end
alias :[] :invoke_drop
end
end
## Instruction:
Correct formatting for doc comments
Portions of the code examples were not being rendered as code because they lacked a leading tab. Also, a missing period on the first sentence made the first paragraph confusing.
## Code After:
module Liquid
# A drop in liquid is a class which allows you to to export DOM like things to liquid.
# Methods of drops are callable.
# The main use for liquid drops is the implement lazy loaded objects.
# If you would like to make data available to the web designers which you don't want loaded unless needed then
# a drop is a great way to do that
#
# Example:
#
# class ProductDrop < Liquid::Drop
# def top_sales
# Shop.current.products.find(:all, :order => 'sales', :limit => 10 )
# end
# end
#
# tmpl = Liquid::Template.parse( ' {% for product in product.top_sales %} {{ product.name }} {%endfor%} ' )
# tmpl.render('product' => ProductDrop.new ) # will invoke top_sales query.
#
# Your drop can either implement the methods sans any parameters or implement the before_method(name) method which is a
# catch all
class Drop
attr_writer :context
# Catch all for the method
def before_method(method)
nil
end
# called by liquid to invoke a drop
def invoke_drop(method_or_key)
if self.class.public_method_defined?(method_or_key.to_s.to_sym)
send(method_or_key.to_s.to_sym)
else
before_method(method_or_key)
end
end
def has_key?(name)
true
end
def to_liquid
self
end
alias :[] :invoke_drop
end
end
| module Liquid
- # A drop in liquid is a class which allows you to to export DOM like things to liquid
+ # A drop in liquid is a class which allows you to to export DOM like things to liquid.
? +
# Methods of drops are callable.
# The main use for liquid drops is the implement lazy loaded objects.
# If you would like to make data available to the web designers which you don't want loaded unless needed then
# a drop is a great way to do that
#
# Example:
#
- # class ProductDrop < Liquid::Drop
+ # class ProductDrop < Liquid::Drop
? ++
- # def top_sales
+ # def top_sales
? ++
- # Shop.current.products.find(:all, :order => 'sales', :limit => 10 )
+ # Shop.current.products.find(:all, :order => 'sales', :limit => 10 )
? +
+ # end
# end
- # end
#
- # tmpl = Liquid::Template.parse( ' {% for product in product.top_sales %} {{ product.name }} {%endfor%} ' )
+ # tmpl = Liquid::Template.parse( ' {% for product in product.top_sales %} {{ product.name }} {%endfor%} ' )
? ++
- # tmpl.render('product' => ProductDrop.new ) # will invoke top_sales query.
+ # tmpl.render('product' => ProductDrop.new ) # will invoke top_sales query.
? ++
#
# Your drop can either implement the methods sans any parameters or implement the before_method(name) method which is a
# catch all
class Drop
attr_writer :context
# Catch all for the method
def before_method(method)
nil
end
# called by liquid to invoke a drop
def invoke_drop(method_or_key)
if self.class.public_method_defined?(method_or_key.to_s.to_sym)
send(method_or_key.to_s.to_sym)
else
before_method(method_or_key)
end
end
def has_key?(name)
true
end
def to_liquid
self
end
alias :[] :invoke_drop
end
end | 14 | 0.285714 | 7 | 7 |
287d16543624bdb5394c56bfa7a9ab06e64259ad | test/Interpreter/SDK/class_as_object.swift | test/Interpreter/SDK/class_as_object.swift | // RUN: rm -rf %t && mkdir %t
// RUN: %target-build-swift %s -o %t/a.out
// RUN: %target-run %t/a.out | FileCheck %s
import Foundation
let classes = NSMutableArray()
classes.addObject(NSObject.self)
classes.addObject(NSString.self)
classes.addObject(NSNumber.self)
for obj: AnyObject in classes {
println(obj.description)
}
// CHECK: NSObject
// CHECK-NEXT: NSString
// CHECK-NEXT: NSNumber
println(NSObject.conformsToProtocol(NSCopying.self))
// CHECK-NEXT: false
println(NSString.conformsToProtocol(NSCopying.self))
// CHECK-NEXT: true
| // RUN: rm -rf %t && mkdir %t
// RUN: %target-build-swift %s -o %t/a.out
// RUN: %target-run %t/a.out | FileCheck %s
import Foundation
let classes = NSMutableArray()
classes.addObject(NSObject.self)
classes.addObject(NSString.self)
classes.addObject(NSNumber.self)
for obj: AnyObject in classes {
println(obj.description)
}
// CHECK: NSObject
// CHECK-NEXT: NSString
// CHECK-NEXT: NSNumber
// <rdar://problem/17303759> The Protocol class object is hidden on 64-bit iOS,
// so we cannot form its metadata.
#if os(iOS) && (arch(x86_64) || arch(arm64))
println("false\ntrue")
#else
println(NSObject.conformsToProtocol(NSCopying.self))
// CHECK-NEXT: false
println(NSString.conformsToProtocol(NSCopying.self))
// CHECK-NEXT: true
#endif
| Disable execution test for Protocol objects on 64-bit iOS. | Disable execution test for Protocol objects on 64-bit iOS.
<rdar://problem/17303759> -- we need to do something special for the Protocol type's metadata, because its ObjC class object is hidden.
Swift SVN r18871
| Swift | apache-2.0 | tjw/swift,kusl/swift,ben-ng/swift,amraboelela/swift,roambotics/swift,russbishop/swift,danielmartin/swift,tinysun212/swift-windows,devincoughlin/swift,OscarSwanros/swift,danielmartin/swift,brentdax/swift,practicalswift/swift,kusl/swift,OscarSwanros/swift,allevato/swift,lorentey/swift,aschwaighofer/swift,jmgc/swift,jopamer/swift,tjw/swift,gottesmm/swift,kperryua/swift,codestergit/swift,zisko/swift,brentdax/swift,jckarter/swift,zisko/swift,bitjammer/swift,allevato/swift,dduan/swift,adrfer/swift,OscarSwanros/swift,airspeedswift/swift,hooman/swift,djwbrown/swift,uasys/swift,shajrawi/swift,adrfer/swift,stephentyrone/swift,ben-ng/swift,nathawes/swift,ben-ng/swift,kperryua/swift,emilstahl/swift,aschwaighofer/swift,modocache/swift,huonw/swift,cbrentharris/swift,swiftix/swift.old,brentdax/swift,ahoppen/swift,shahmishal/swift,karwa/swift,devincoughlin/swift,sschiau/swift,xwu/swift,alblue/swift,calebd/swift,roambotics/swift,sschiau/swift,calebd/swift,kstaring/swift,OscarSwanros/swift,milseman/swift,shajrawi/swift,uasys/swift,rudkx/swift,djwbrown/swift,khizkhiz/swift,roambotics/swift,LeoShimonaka/swift,SwiftAndroid/swift,lorentey/swift,manavgabhawala/swift,allevato/swift,swiftix/swift.old,benlangmuir/swift,adrfer/swift,frootloops/swift,MukeshKumarS/Swift,gregomni/swift,russbishop/swift,jtbandes/swift,tkremenek/swift,khizkhiz/swift,brentdax/swift,apple/swift,sschiau/swift,CodaFi/swift,practicalswift/swift,atrick/swift,jckarter/swift,huonw/swift,sschiau/swift,ahoppen/swift,hughbe/swift,stephentyrone/swift,hughbe/swift,apple/swift,johnno1962d/swift,frootloops/swift,rudkx/swift,amraboelela/swift,emilstahl/swift,glessard/swift,tinysun212/swift-windows,lorentey/swift,felix91gr/swift,hooman/swift,karwa/swift,codestergit/swift,xedin/swift,JaSpa/swift,xedin/swift,JGiola/swift,Ivacker/swift,aschwaighofer/swift,ahoppen/swift,codestergit/swift,sdulal/swift,natecook1000/swift,harlanhaskins/swift,MukeshKumarS/Swift,return/swift,gmilos/swift,kstaring/swift,natecook1000/swift,gottesmm/swift,JaSpa/swift,hooman/swift,jmgc/swift,alblue/swift,CodaFi/swift,gribozavr/swift,JGiola/swift,atrick/swift,LeoShimonaka/swift,JaSpa/swift,stephentyrone/swift,Ivacker/swift,slavapestov/swift,ken0nek/swift,milseman/swift,russbishop/swift,uasys/swift,johnno1962d/swift,emilstahl/swift,LeoShimonaka/swift,amraboelela/swift,swiftix/swift,swiftix/swift.old,stephentyrone/swift,swiftix/swift.old,practicalswift/swift,therealbnut/swift,JGiola/swift,natecook1000/swift,huonw/swift,uasys/swift,harlanhaskins/swift,tardieu/swift,therealbnut/swift,austinzheng/swift,glessard/swift,ahoppen/swift,benlangmuir/swift,milseman/swift,aschwaighofer/swift,manavgabhawala/swift,sdulal/swift,glessard/swift,kusl/swift,practicalswift/swift,gribozavr/swift,gribozavr/swift,slavapestov/swift,sschiau/swift,gmilos/swift,zisko/swift,huonw/swift,zisko/swift,therealbnut/swift,CodaFi/swift,deyton/swift,xwu/swift,frootloops/swift,kperryua/swift,austinzheng/swift,xwu/swift,danielmartin/swift,djwbrown/swift,jopamer/swift,dduan/swift,xwu/swift,slavapestov/swift,JGiola/swift,brentdax/swift,shajrawi/swift,tkremenek/swift,jopamer/swift,Jnosh/swift,Ivacker/swift,danielmartin/swift,parkera/swift,frootloops/swift,amraboelela/swift,calebd/swift,kperryua/swift,felix91gr/swift,arvedviehweger/swift,KrishMunot/swift,jckarter/swift,swiftix/swift,gribozavr/swift,tinysun212/swift-windows,jtbandes/swift,gottesmm/swift,khizkhiz/swift,atrick/swift,ken0nek/swift,huonw/swift,jtbandes/swift,calebd/swift,emilstahl/swift,bitjammer/swift,Jnosh/swift,codestergit/swift,sdulal/swift,manavgabhawala/swift,OscarSwanros/swift,IngmarStein/swift,tjw/swift,adrfer/swift,practicalswift/swift,Ivacker/swift,atrick/swift,practicalswift/swift,bitjammer/swift,swiftix/swift.old,hughbe/swift,russbishop/swift,arvedviehweger/swift,rudkx/swift,djwbrown/swift,IngmarStein/swift,rudkx/swift,swiftix/swift,xwu/swift,cbrentharris/swift,SwiftAndroid/swift,atrick/swift,kentya6/swift,frootloops/swift,dduan/swift,ben-ng/swift,uasys/swift,natecook1000/swift,practicalswift/swift,ken0nek/swift,return/swift,therealbnut/swift,gottesmm/swift,jtbandes/swift,shahmishal/swift,kperryua/swift,devincoughlin/swift,kperryua/swift,tardieu/swift,parkera/swift,airspeedswift/swift,huonw/swift,return/swift,OscarSwanros/swift,felix91gr/swift,CodaFi/swift,tinysun212/swift-windows,sschiau/swift,airspeedswift/swift,hooman/swift,tjw/swift,manavgabhawala/swift,KrishMunot/swift,shajrawi/swift,mightydeveloper/swift,jmgc/swift,benlangmuir/swift,tjw/swift,codestergit/swift,Ivacker/swift,bitjammer/swift,amraboelela/swift,djwbrown/swift,uasys/swift,tkremenek/swift,xedin/swift,kstaring/swift,rudkx/swift,MukeshKumarS/Swift,milseman/swift,zisko/swift,felix91gr/swift,frootloops/swift,gottesmm/swift,deyton/swift,CodaFi/swift,calebd/swift,bitjammer/swift,tardieu/swift,ahoppen/swift,JaSpa/swift,roambotics/swift,jckarter/swift,codestergit/swift,shahmishal/swift,natecook1000/swift,khizkhiz/swift,hughbe/swift,JGiola/swift,danielmartin/swift,Jnosh/swift,gregomni/swift,apple/swift,parkera/swift,return/swift,kperryua/swift,gmilos/swift,gregomni/swift,gmilos/swift,milseman/swift,hughbe/swift,arvedviehweger/swift,lorentey/swift,cbrentharris/swift,modocache/swift,kentya6/swift,nathawes/swift,sdulal/swift,parkera/swift,jopamer/swift,mightydeveloper/swift,KrishMunot/swift,danielmartin/swift,JGiola/swift,parkera/swift,mightydeveloper/swift,parkera/swift,xwu/swift,tardieu/swift,kusl/swift,lorentey/swift,milseman/swift,slavapestov/swift,devincoughlin/swift,KrishMunot/swift,mightydeveloper/swift,aschwaighofer/swift,alblue/swift,modocache/swift,bitjammer/swift,therealbnut/swift,gribozavr/swift,amraboelela/swift,gottesmm/swift,harlanhaskins/swift,nathawes/swift,shajrawi/swift,mightydeveloper/swift,tardieu/swift,karwa/swift,slavapestov/swift,austinzheng/swift,IngmarStein/swift,alblue/swift,LeoShimonaka/swift,harlanhaskins/swift,austinzheng/swift,nathawes/swift,bitjammer/swift,cbrentharris/swift,johnno1962d/swift,milseman/swift,KrishMunot/swift,shajrawi/swift,calebd/swift,jmgc/swift,parkera/swift,stephentyrone/swift,LeoShimonaka/swift,deyton/swift,karwa/swift,felix91gr/swift,nathawes/swift,tkremenek/swift,glessard/swift,dreamsxin/swift,dduan/swift,OscarSwanros/swift,Jnosh/swift,manavgabhawala/swift,IngmarStein/swift,dduan/swift,swiftix/swift,kentya6/swift,SwiftAndroid/swift,jtbandes/swift,deyton/swift,atrick/swift,ken0nek/swift,modocache/swift,MukeshKumarS/Swift,karwa/swift,modocache/swift,lorentey/swift,tkremenek/swift,harlanhaskins/swift,johnno1962d/swift,xedin/swift,swiftix/swift,swiftix/swift.old,deyton/swift,ken0nek/swift,benlangmuir/swift,return/swift,allevato/swift,emilstahl/swift,zisko/swift,benlangmuir/swift,austinzheng/swift,amraboelela/swift,kentya6/swift,deyton/swift,dreamsxin/swift,IngmarStein/swift,arvedviehweger/swift,lorentey/swift,shahmishal/swift,aschwaighofer/swift,ben-ng/swift,codestergit/swift,alblue/swift,airspeedswift/swift,airspeedswift/swift,emilstahl/swift,sdulal/swift,brentdax/swift,huonw/swift,johnno1962d/swift,IngmarStein/swift,jmgc/swift,devincoughlin/swift,tardieu/swift,kusl/swift,glessard/swift,tardieu/swift,swiftix/swift,austinzheng/swift,tinysun212/swift-windows,return/swift,LeoShimonaka/swift,hooman/swift,roambotics/swift,mightydeveloper/swift,sschiau/swift,stephentyrone/swift,shahmishal/swift,harlanhaskins/swift,tjw/swift,gregomni/swift,ben-ng/swift,gribozavr/swift,karwa/swift,xedin/swift,russbishop/swift,ken0nek/swift,JaSpa/swift,jopamer/swift,apple/swift,devincoughlin/swift,gmilos/swift,JaSpa/swift,hughbe/swift,devincoughlin/swift,modocache/swift,adrfer/swift,glessard/swift,sschiau/swift,Jnosh/swift,djwbrown/swift,alblue/swift,felix91gr/swift,sdulal/swift,airspeedswift/swift,karwa/swift,LeoShimonaka/swift,shahmishal/swift,lorentey/swift,tinysun212/swift-windows,Ivacker/swift,xwu/swift,LeoShimonaka/swift,swiftix/swift.old,CodaFi/swift,kstaring/swift,SwiftAndroid/swift,khizkhiz/swift,gribozavr/swift,arvedviehweger/swift,apple/swift,russbishop/swift,tinysun212/swift-windows,austinzheng/swift,kentya6/swift,allevato/swift,tjw/swift,modocache/swift,sdulal/swift,KrishMunot/swift,kentya6/swift,rudkx/swift,Jnosh/swift,therealbnut/swift,arvedviehweger/swift,tkremenek/swift,cbrentharris/swift,arvedviehweger/swift,CodaFi/swift,allevato/swift,xedin/swift,djwbrown/swift,xedin/swift,nathawes/swift,mightydeveloper/swift,parkera/swift,jckarter/swift,kusl/swift,khizkhiz/swift,gmilos/swift,therealbnut/swift,shahmishal/swift,benlangmuir/swift,allevato/swift,aschwaighofer/swift,nathawes/swift,jtbandes/swift,jopamer/swift,johnno1962d/swift,khizkhiz/swift,xedin/swift,karwa/swift,tkremenek/swift,adrfer/swift,ben-ng/swift,deyton/swift,gmilos/swift,kentya6/swift,manavgabhawala/swift,calebd/swift,kstaring/swift,KrishMunot/swift,swiftix/swift,sdulal/swift,felix91gr/swift,slavapestov/swift,frootloops/swift,kstaring/swift,MukeshKumarS/Swift,alblue/swift,kstaring/swift,stephentyrone/swift,shajrawi/swift,Jnosh/swift,devincoughlin/swift,gottesmm/swift,uasys/swift,gribozavr/swift,jtbandes/swift,zisko/swift,natecook1000/swift,gregomni/swift,adrfer/swift,slavapestov/swift,Ivacker/swift,JaSpa/swift,mightydeveloper/swift,cbrentharris/swift,ahoppen/swift,kusl/swift,kusl/swift,emilstahl/swift,hooman/swift,SwiftAndroid/swift,ken0nek/swift,danielmartin/swift,dduan/swift,natecook1000/swift,cbrentharris/swift,dduan/swift,russbishop/swift,harlanhaskins/swift,roambotics/swift,IngmarStein/swift,jckarter/swift,johnno1962d/swift,jmgc/swift,Ivacker/swift,shajrawi/swift,jckarter/swift,manavgabhawala/swift,shahmishal/swift,kentya6/swift,MukeshKumarS/Swift,return/swift,cbrentharris/swift,emilstahl/swift,jmgc/swift,hooman/swift,brentdax/swift,MukeshKumarS/Swift,hughbe/swift,swiftix/swift.old,SwiftAndroid/swift,jopamer/swift,SwiftAndroid/swift,airspeedswift/swift,apple/swift,gregomni/swift,practicalswift/swift | swift | ## Code Before:
// RUN: rm -rf %t && mkdir %t
// RUN: %target-build-swift %s -o %t/a.out
// RUN: %target-run %t/a.out | FileCheck %s
import Foundation
let classes = NSMutableArray()
classes.addObject(NSObject.self)
classes.addObject(NSString.self)
classes.addObject(NSNumber.self)
for obj: AnyObject in classes {
println(obj.description)
}
// CHECK: NSObject
// CHECK-NEXT: NSString
// CHECK-NEXT: NSNumber
println(NSObject.conformsToProtocol(NSCopying.self))
// CHECK-NEXT: false
println(NSString.conformsToProtocol(NSCopying.self))
// CHECK-NEXT: true
## Instruction:
Disable execution test for Protocol objects on 64-bit iOS.
<rdar://problem/17303759> -- we need to do something special for the Protocol type's metadata, because its ObjC class object is hidden.
Swift SVN r18871
## Code After:
// RUN: rm -rf %t && mkdir %t
// RUN: %target-build-swift %s -o %t/a.out
// RUN: %target-run %t/a.out | FileCheck %s
import Foundation
let classes = NSMutableArray()
classes.addObject(NSObject.self)
classes.addObject(NSString.self)
classes.addObject(NSNumber.self)
for obj: AnyObject in classes {
println(obj.description)
}
// CHECK: NSObject
// CHECK-NEXT: NSString
// CHECK-NEXT: NSNumber
// <rdar://problem/17303759> The Protocol class object is hidden on 64-bit iOS,
// so we cannot form its metadata.
#if os(iOS) && (arch(x86_64) || arch(arm64))
println("false\ntrue")
#else
println(NSObject.conformsToProtocol(NSCopying.self))
// CHECK-NEXT: false
println(NSString.conformsToProtocol(NSCopying.self))
// CHECK-NEXT: true
#endif
| // RUN: rm -rf %t && mkdir %t
// RUN: %target-build-swift %s -o %t/a.out
// RUN: %target-run %t/a.out | FileCheck %s
import Foundation
let classes = NSMutableArray()
classes.addObject(NSObject.self)
classes.addObject(NSString.self)
classes.addObject(NSNumber.self)
for obj: AnyObject in classes {
println(obj.description)
}
// CHECK: NSObject
// CHECK-NEXT: NSString
// CHECK-NEXT: NSNumber
+ // <rdar://problem/17303759> The Protocol class object is hidden on 64-bit iOS,
+ // so we cannot form its metadata.
+ #if os(iOS) && (arch(x86_64) || arch(arm64))
+ println("false\ntrue")
+ #else
println(NSObject.conformsToProtocol(NSCopying.self))
// CHECK-NEXT: false
println(NSString.conformsToProtocol(NSCopying.self))
// CHECK-NEXT: true
-
+ #endif | 7 | 0.304348 | 6 | 1 |
893d24cc16c49b504638b6f38b57429073bd645f | app/views/organizations/requests_to_join.html.erb | app/views/organizations/requests_to_join.html.erb | <%= provide(:title, "Requests to Join #{@organization.name}") %>
<div class="page withspace contribute">
<h1><%= @organization.name %> Organization Management</h1>
<%= render "ccla_signatures/organization_tabs", ccla_signature: @organization.latest_ccla_signature %>
<div class="tabs-content">
<div class="content active">
<p>Users who have requested to join and contribute on behalf of this organization.</p>
<ul class="pending-requests">
<% @pending_requests.each do |request| %>
<li class="pending-request"><%= link_to request.user.name, request.user %> requested to join on <%= request.created_at.to_s(:longish) %></li>
<% end %>
</ul>
</div>
</div>
</div>
| <%= provide(:title, "Requests to Join #{@organization.name}") %>
<div class="page withspace contribute">
<h1><%= @organization.name %> Organization Management</h1>
<%= render "ccla_signatures/organization_tabs", ccla_signature: @organization.latest_ccla_signature %>
<div class="tabs-content">
<div class="content active">
<p>Users who have requested to join and contribute on behalf of this organization.</p>
<table class="pending-requests">
<% @pending_requests.each do |request| %>
<tr class="pending-request">
<td><%= link_to request.user.name, request.user %> requested to join on <%= request.created_at.to_s(:longish) %></td>
<td class="right">
<ul class="button-group radius right">
<li><%= link_to 'Accept Request', accept_ccla_signature_contributor_request_path(request.ccla_signature, request), class: 'button secondary tiny' %></li>
<li><%= link_to 'Decline Request', decline_ccla_signature_contributor_request_path(request.ccla_signature, request), class: 'button alert tiny' %></li>
</ul>
</td>
</tr>
<% end %>
</table>
</div>
</div>
</div>
| Allow contributor requests to be accepted/declined from web UI | Allow contributor requests to be accepted/declined from web UI
CCLA admins can accept or decline contributor requests from the
organization admin interface.
| HTML+ERB | apache-2.0 | jzohrab/supermarket,robbkidd/supermarket,leftathome/supermarket,juliandunn/supermarket,juliandunn/supermarket,chef/supermarket,jzohrab/supermarket,leftathome/supermarket,nellshamrell/supermarket,rafaelmagu/supermarket,chef/supermarket,tas50/supermarket,dpnl87/supermarket,nellshamrell/supermarket,rafaelmagu/supermarket,leftathome/supermarket,jzohrab/supermarket,robbkidd/supermarket,dpnl87/supermarket,dpnl87/supermarket,nellshamrell/supermarket,rafaelmagu/supermarket,juliandunn/supermarket,tas50/supermarket,juliandunn/supermarket,tas50/supermarket,robbkidd/supermarket,chef/supermarket,leftathome/supermarket,tas50/supermarket,robbkidd/supermarket,dpnl87/supermarket,rafaelmagu/supermarket,chef/supermarket,jzohrab/supermarket,nellshamrell/supermarket,chef/supermarket | html+erb | ## Code Before:
<%= provide(:title, "Requests to Join #{@organization.name}") %>
<div class="page withspace contribute">
<h1><%= @organization.name %> Organization Management</h1>
<%= render "ccla_signatures/organization_tabs", ccla_signature: @organization.latest_ccla_signature %>
<div class="tabs-content">
<div class="content active">
<p>Users who have requested to join and contribute on behalf of this organization.</p>
<ul class="pending-requests">
<% @pending_requests.each do |request| %>
<li class="pending-request"><%= link_to request.user.name, request.user %> requested to join on <%= request.created_at.to_s(:longish) %></li>
<% end %>
</ul>
</div>
</div>
</div>
## Instruction:
Allow contributor requests to be accepted/declined from web UI
CCLA admins can accept or decline contributor requests from the
organization admin interface.
## Code After:
<%= provide(:title, "Requests to Join #{@organization.name}") %>
<div class="page withspace contribute">
<h1><%= @organization.name %> Organization Management</h1>
<%= render "ccla_signatures/organization_tabs", ccla_signature: @organization.latest_ccla_signature %>
<div class="tabs-content">
<div class="content active">
<p>Users who have requested to join and contribute on behalf of this organization.</p>
<table class="pending-requests">
<% @pending_requests.each do |request| %>
<tr class="pending-request">
<td><%= link_to request.user.name, request.user %> requested to join on <%= request.created_at.to_s(:longish) %></td>
<td class="right">
<ul class="button-group radius right">
<li><%= link_to 'Accept Request', accept_ccla_signature_contributor_request_path(request.ccla_signature, request), class: 'button secondary tiny' %></li>
<li><%= link_to 'Decline Request', decline_ccla_signature_contributor_request_path(request.ccla_signature, request), class: 'button alert tiny' %></li>
</ul>
</td>
</tr>
<% end %>
</table>
</div>
</div>
</div>
| <%= provide(:title, "Requests to Join #{@organization.name}") %>
<div class="page withspace contribute">
<h1><%= @organization.name %> Organization Management</h1>
<%= render "ccla_signatures/organization_tabs", ccla_signature: @organization.latest_ccla_signature %>
<div class="tabs-content">
<div class="content active">
<p>Users who have requested to join and contribute on behalf of this organization.</p>
- <ul class="pending-requests">
? ^
+ <table class="pending-requests">
? ^^^ +
<% @pending_requests.each do |request| %>
+ <tr class="pending-request">
- <li class="pending-request"><%= link_to request.user.name, request.user %> requested to join on <%= request.created_at.to_s(:longish) %></li>
? ^^^^^^^^^^^^^ ------------ ^^
+ <td><%= link_to request.user.name, request.user %> requested to join on <%= request.created_at.to_s(:longish) %></td>
? ++ ^ ^^
+ <td class="right">
+ <ul class="button-group radius right">
+ <li><%= link_to 'Accept Request', accept_ccla_signature_contributor_request_path(request.ccla_signature, request), class: 'button secondary tiny' %></li>
+ <li><%= link_to 'Decline Request', decline_ccla_signature_contributor_request_path(request.ccla_signature, request), class: 'button alert tiny' %></li>
+ </ul>
+ </td>
+ </tr>
- <% end %>
+ <% end %>
? ++
- </ul>
? ^
+ </table>
? ^^^ +
</div>
</div>
</div> | 16 | 0.842105 | 12 | 4 |
bac520535114ff2cc5666eaa6f6eef5533e45b22 | src/scripts/modules/media/footer/footer.less | src/scripts/modules/media/footer/footer.less | @import "../../../../styles/variables.less";
@import "../../../../styles/mixins.less";
.media-footer {
margin: 0 60px 60px 60px;
> ul {
margin: 0 0 40px 0;
padding: 0 0 0 30px;
font-size: 0;
list-style-type: none;
color: @link-color;
border-bottom: 1px solid @gray-light;
> li {
display: inline-block;
padding: 7px 10px;
margin-right: 3px;
font-size: 1.4rem;
background-color: @gray-lightest;
cursor: pointer;
.user-select(none);
> .tab-title {
margin-left: 2px;
vertical-align: middle;
&::after {
font-weight: bold;
margin-left: 5px;
vertical-align: top;
content: "+";
}
}
&.active {
color: @gray-lightest;
background-color: @link-color;
> .tab-title::after {
content: "\2212"; // − (−)
}
}
}
}
> div {
display: none;
background-color: white;
}
> .license, > .last-edit {
display: block;
font-size: 1.2rem;
color: @gray-medium;
}
}
| @import "../../../../styles/variables.less";
@import "../../../../styles/mixins.less";
.media-footer {
margin: 0 60px 60px 60px;
> ul {
margin: 0 0 40px 0;
padding: 0 0 0 30px;
font-size: 0;
list-style-type: none;
color: @link-color;
border-bottom: 1px solid @gray-light;
> li {
display: inline-block;
padding: 7px 10px;
margin-right: 3px;
font-size: 1.4rem;
background-color: @gray-lightest;
cursor: pointer;
.user-select(none);
> .tab-title {
margin-left: 2px;
vertical-align: middle;
&::after {
font-weight: bold;
margin-left: 5px;
vertical-align: top;
content: "+";
}
}
&.active {
color: @gray-lightest;
background-color: @link-color;
> .tab-title::after {
content: "\2212"; // − (−)
}
}
}
}
> div {
display: none;
padding-bottom: 40px;
margin-bottom: 40px;
background-color: white;
border-bottom: 1px solid @gray-light;
}
> .license, > .last-edit {
display: block;
font-size: 1.2rem;
color: @gray-medium;
}
}
| Add border and spacing at bottom | Add border and spacing at bottom
| Less | agpl-3.0 | Connexions/webview,Connexions/webview,Connexions/webview,katalysteducation/webview,dak/webview,dak/webview,carolinelane10/webview,katalysteducation/webview,dak/webview,Connexions/webview,katalysteducation/webview,katalysteducation/webview | less | ## Code Before:
@import "../../../../styles/variables.less";
@import "../../../../styles/mixins.less";
.media-footer {
margin: 0 60px 60px 60px;
> ul {
margin: 0 0 40px 0;
padding: 0 0 0 30px;
font-size: 0;
list-style-type: none;
color: @link-color;
border-bottom: 1px solid @gray-light;
> li {
display: inline-block;
padding: 7px 10px;
margin-right: 3px;
font-size: 1.4rem;
background-color: @gray-lightest;
cursor: pointer;
.user-select(none);
> .tab-title {
margin-left: 2px;
vertical-align: middle;
&::after {
font-weight: bold;
margin-left: 5px;
vertical-align: top;
content: "+";
}
}
&.active {
color: @gray-lightest;
background-color: @link-color;
> .tab-title::after {
content: "\2212"; // − (−)
}
}
}
}
> div {
display: none;
background-color: white;
}
> .license, > .last-edit {
display: block;
font-size: 1.2rem;
color: @gray-medium;
}
}
## Instruction:
Add border and spacing at bottom
## Code After:
@import "../../../../styles/variables.less";
@import "../../../../styles/mixins.less";
.media-footer {
margin: 0 60px 60px 60px;
> ul {
margin: 0 0 40px 0;
padding: 0 0 0 30px;
font-size: 0;
list-style-type: none;
color: @link-color;
border-bottom: 1px solid @gray-light;
> li {
display: inline-block;
padding: 7px 10px;
margin-right: 3px;
font-size: 1.4rem;
background-color: @gray-lightest;
cursor: pointer;
.user-select(none);
> .tab-title {
margin-left: 2px;
vertical-align: middle;
&::after {
font-weight: bold;
margin-left: 5px;
vertical-align: top;
content: "+";
}
}
&.active {
color: @gray-lightest;
background-color: @link-color;
> .tab-title::after {
content: "\2212"; // − (−)
}
}
}
}
> div {
display: none;
padding-bottom: 40px;
margin-bottom: 40px;
background-color: white;
border-bottom: 1px solid @gray-light;
}
> .license, > .last-edit {
display: block;
font-size: 1.2rem;
color: @gray-medium;
}
}
| @import "../../../../styles/variables.less";
@import "../../../../styles/mixins.less";
.media-footer {
margin: 0 60px 60px 60px;
> ul {
margin: 0 0 40px 0;
padding: 0 0 0 30px;
font-size: 0;
list-style-type: none;
color: @link-color;
border-bottom: 1px solid @gray-light;
> li {
display: inline-block;
padding: 7px 10px;
margin-right: 3px;
font-size: 1.4rem;
background-color: @gray-lightest;
cursor: pointer;
.user-select(none);
> .tab-title {
margin-left: 2px;
vertical-align: middle;
&::after {
font-weight: bold;
margin-left: 5px;
vertical-align: top;
content: "+";
}
}
&.active {
color: @gray-lightest;
background-color: @link-color;
> .tab-title::after {
content: "\2212"; // − (−)
}
}
}
}
> div {
display: none;
+ padding-bottom: 40px;
+ margin-bottom: 40px;
background-color: white;
+ border-bottom: 1px solid @gray-light;
}
> .license, > .last-edit {
display: block;
font-size: 1.2rem;
color: @gray-medium;
}
} | 3 | 0.052632 | 3 | 0 |
8361330c64cbed87f556d4bb3c09bd65a04f1cf9 | _data/navigation.yml | _data/navigation.yml | main:
- title: "Location"
url: /_pages/location/
- title: "Schedule"
url: /_pages/schedule/
- title: "Registration"
url: /_pages/registration
- title: "Code of Conduct"
url: /_pages/code_of_conduct/
- title: "What is Mapping?"
url: /_pages/what_is_mapping/
#- title: "Sponsors"
# url: _pages/sponsors.html
# - title: "About"
# url: https://mmistakes.github.io/minimal-mistakes/about/
# - title: "Sitemap"
# url: /sitemap/
| main:
# - title: "Location"
# url: /_pages/location/
# - title: "Schedule"
# url: /_pages/schedule/
# - title: "Registration"
# url: /_pages/registration
- title: "What is Mapping?"
url: /_pages/what_is_mapping/
- title: "Code of Conduct"
url: /_pages/code_of_conduct/
- title: "Slack"
url: https://map-camp-slack-invite.herokuapp.com/
#- title: "Sponsors"
# url: _pages/sponsors.html
# - title: "About"
# url: https://mmistakes.github.io/minimal-mistakes/about/
# - title: "Sitemap"
# url: /sitemap/
| Comment out most nav items. | Comment out most nav items.
| YAML | mit | mapcampcommittee/mapcampcommittee.github.io,mapcampcommittee/mapcampcommittee.github.io,mapcampcommittee/mapcampcommittee.github.io | yaml | ## Code Before:
main:
- title: "Location"
url: /_pages/location/
- title: "Schedule"
url: /_pages/schedule/
- title: "Registration"
url: /_pages/registration
- title: "Code of Conduct"
url: /_pages/code_of_conduct/
- title: "What is Mapping?"
url: /_pages/what_is_mapping/
#- title: "Sponsors"
# url: _pages/sponsors.html
# - title: "About"
# url: https://mmistakes.github.io/minimal-mistakes/about/
# - title: "Sitemap"
# url: /sitemap/
## Instruction:
Comment out most nav items.
## Code After:
main:
# - title: "Location"
# url: /_pages/location/
# - title: "Schedule"
# url: /_pages/schedule/
# - title: "Registration"
# url: /_pages/registration
- title: "What is Mapping?"
url: /_pages/what_is_mapping/
- title: "Code of Conduct"
url: /_pages/code_of_conduct/
- title: "Slack"
url: https://map-camp-slack-invite.herokuapp.com/
#- title: "Sponsors"
# url: _pages/sponsors.html
# - title: "About"
# url: https://mmistakes.github.io/minimal-mistakes/about/
# - title: "Sitemap"
# url: /sitemap/
| main:
- - title: "Location"
+ # - title: "Location"
? ++
- url: /_pages/location/
+ # url: /_pages/location/
? ++
- - title: "Schedule"
+ # - title: "Schedule"
? ++
- url: /_pages/schedule/
+ # url: /_pages/schedule/
? ++
- - title: "Registration"
+ # - title: "Registration"
? ++
- url: /_pages/registration
+ # url: /_pages/registration
? ++
+ - title: "What is Mapping?"
+ url: /_pages/what_is_mapping/
- title: "Code of Conduct"
url: /_pages/code_of_conduct/
- - title: "What is Mapping?"
- url: /_pages/what_is_mapping/
+ - title: "Slack"
+ url: https://map-camp-slack-invite.herokuapp.com/
#- title: "Sponsors"
# url: _pages/sponsors.html
# - title: "About"
# url: https://mmistakes.github.io/minimal-mistakes/about/
# - title: "Sitemap"
# url: /sitemap/ | 18 | 1.058824 | 10 | 8 |
9b32ddc213e8625de4957c9e08ca8456ebfb96d0 | assets/js/navbar.js | assets/js/navbar.js | $(document).ready(function()
{
$('#navbar_replacement').replaceWith('\
<div class="navbar navbar-inverse navbar-static-top">\
<div class="container">\
<div class="navbar-header">\
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">\
<span class="icon-bar"></span>\
<span class="icon-bar"></span>\
<span class="icon-bar"></span>\
</button>\
<a class="navbar-brand" href="index.html"><img class="img-responsive" style="width:280px;max-width:100%" src="assets/img/Horizontal_header_generic.svg" alt="NoCaSS 2020"></a>\
</div>\
<div class="navbar-collapse collapse">\
<ul class="nav navbar-nav navbar-right">\
<li><a href="https://twitter.com/intent/follow?screen_name=nocass_official">Follow @nocass_official</a></li>\
<li><a href="index.html">Home</a></li>\
<li><a href="about.html">About</a></li>\
<li><a href="programme.html">Programme</a></li>\
<li><a href="venue.html">Venue</a></li>\
<li><a href="#">Registration</a></li>\
<li><a href="sponsors.html">Sponsorship</a></li>\
</ul>\
</div><!--/.nav-collapse -->\
</div>\
</div>\
');
})
| $(document).ready(function()
{
$('#navbar_replacement').replaceWith('\
<div class="navbar navbar-inverse navbar-static-top">\
<div class="container">\
<div class="navbar-header">\
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">\
<span class="icon-bar"></span>\
<span class="icon-bar"></span>\
<span class="icon-bar"></span>\
</button>\
<a class="navbar-brand" href="index.html"><img class="img-responsive" style="width:280px;max-width:100%" src="assets/img/NoCaSS2020_transparent.png" alt="NoCaSS 2020"></a>\
</div>\
<div class="navbar-collapse collapse">\
<ul class="nav navbar-nav navbar-right">\
<li><a href="https://twitter.com/intent/follow?screen_name=nocass_official">Follow @nocass_official</a></li>\
<li><a href="index.html">Home</a></li>\
<li><a href="about.html">About</a></li>\
<li><a href="programme.html">Programme</a></li>\
<li><a href="venue.html">Venue</a></li>\
<li><a href="registration2.html">Registration</a></li>\
<li><a href="sponsors.html">Sponsorship</a></li>\
</ul>\
</div><!--/.nav-collapse -->\
</div>\
</div>\
');
})
| Add registration link and 2020 logo | Add registration link and 2020 logo | JavaScript | cc0-1.0 | NoCaSS14/NoCaSS14.github.io,NoCaSS14/NoCaSS14.github.io | javascript | ## Code Before:
$(document).ready(function()
{
$('#navbar_replacement').replaceWith('\
<div class="navbar navbar-inverse navbar-static-top">\
<div class="container">\
<div class="navbar-header">\
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">\
<span class="icon-bar"></span>\
<span class="icon-bar"></span>\
<span class="icon-bar"></span>\
</button>\
<a class="navbar-brand" href="index.html"><img class="img-responsive" style="width:280px;max-width:100%" src="assets/img/Horizontal_header_generic.svg" alt="NoCaSS 2020"></a>\
</div>\
<div class="navbar-collapse collapse">\
<ul class="nav navbar-nav navbar-right">\
<li><a href="https://twitter.com/intent/follow?screen_name=nocass_official">Follow @nocass_official</a></li>\
<li><a href="index.html">Home</a></li>\
<li><a href="about.html">About</a></li>\
<li><a href="programme.html">Programme</a></li>\
<li><a href="venue.html">Venue</a></li>\
<li><a href="#">Registration</a></li>\
<li><a href="sponsors.html">Sponsorship</a></li>\
</ul>\
</div><!--/.nav-collapse -->\
</div>\
</div>\
');
})
## Instruction:
Add registration link and 2020 logo
## Code After:
$(document).ready(function()
{
$('#navbar_replacement').replaceWith('\
<div class="navbar navbar-inverse navbar-static-top">\
<div class="container">\
<div class="navbar-header">\
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">\
<span class="icon-bar"></span>\
<span class="icon-bar"></span>\
<span class="icon-bar"></span>\
</button>\
<a class="navbar-brand" href="index.html"><img class="img-responsive" style="width:280px;max-width:100%" src="assets/img/NoCaSS2020_transparent.png" alt="NoCaSS 2020"></a>\
</div>\
<div class="navbar-collapse collapse">\
<ul class="nav navbar-nav navbar-right">\
<li><a href="https://twitter.com/intent/follow?screen_name=nocass_official">Follow @nocass_official</a></li>\
<li><a href="index.html">Home</a></li>\
<li><a href="about.html">About</a></li>\
<li><a href="programme.html">Programme</a></li>\
<li><a href="venue.html">Venue</a></li>\
<li><a href="registration2.html">Registration</a></li>\
<li><a href="sponsors.html">Sponsorship</a></li>\
</ul>\
</div><!--/.nav-collapse -->\
</div>\
</div>\
');
})
| $(document).ready(function()
{
$('#navbar_replacement').replaceWith('\
<div class="navbar navbar-inverse navbar-static-top">\
<div class="container">\
<div class="navbar-header">\
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">\
<span class="icon-bar"></span>\
<span class="icon-bar"></span>\
<span class="icon-bar"></span>\
</button>\
- <a class="navbar-brand" href="index.html"><img class="img-responsive" style="width:280px;max-width:100%" src="assets/img/Horizontal_header_generic.svg" alt="NoCaSS 2020"></a>\
? ^ ^^^ ^^^^^^^^^^^^ -------
+ <a class="navbar-brand" href="index.html"><img class="img-responsive" style="width:280px;max-width:100%" src="assets/img/NoCaSS2020_transparent.png" alt="NoCaSS 2020"></a>\
? ^ ++++++++++ ^^^^^^^ ^^
</div>\
<div class="navbar-collapse collapse">\
<ul class="nav navbar-nav navbar-right">\
<li><a href="https://twitter.com/intent/follow?screen_name=nocass_official">Follow @nocass_official</a></li>\
<li><a href="index.html">Home</a></li>\
<li><a href="about.html">About</a></li>\
<li><a href="programme.html">Programme</a></li>\
<li><a href="venue.html">Venue</a></li>\
- <li><a href="#">Registration</a></li>\
? ^
+ <li><a href="registration2.html">Registration</a></li>\
? ^^^^^^^^^^^^^^^^^^
<li><a href="sponsors.html">Sponsorship</a></li>\
</ul>\
</div><!--/.nav-collapse -->\
</div>\
</div>\
');
}) | 4 | 0.142857 | 2 | 2 |
c8f67217fd26aa030caa312d797c67dbc326e5d1 | tests/GraphComposerTest.php | tests/GraphComposerTest.php | <?php
require __DIR__ . '/../vendor/autoload.php';
class GraphTest extends PHPUnit_Framework_TestCase
{
public function testCreateGraph()
{
$dir = __DIR__ . '/../';
$graphComposer = new Clue\GraphComposer($dir);
$graph = $graphComposer->createGraph();
$this->assertInstanceOf('Fhaculty\Graph\Graph', $graph);
$this->assertTrue($graph->getNumberOfVertices() > 0);
}
}
| <?php
require __DIR__ . '/../vendor/autoload.php';
class GraphTest extends PHPUnit_Framework_TestCase
{
public function testCreateGraph()
{
$dir = __DIR__ . '/../';
$graphComposer = new Clue\GraphComposer($dir);
$graph = $graphComposer->createGraph();
$this->assertInstanceOf('Fhaculty\Graph\Graph', $graph);
$this->assertTrue(count($graph->getVertices()) > 0);
}
}
| Update expectations for new graph API | Update expectations for new graph API | PHP | mit | clue/graph-composer | php | ## Code Before:
<?php
require __DIR__ . '/../vendor/autoload.php';
class GraphTest extends PHPUnit_Framework_TestCase
{
public function testCreateGraph()
{
$dir = __DIR__ . '/../';
$graphComposer = new Clue\GraphComposer($dir);
$graph = $graphComposer->createGraph();
$this->assertInstanceOf('Fhaculty\Graph\Graph', $graph);
$this->assertTrue($graph->getNumberOfVertices() > 0);
}
}
## Instruction:
Update expectations for new graph API
## Code After:
<?php
require __DIR__ . '/../vendor/autoload.php';
class GraphTest extends PHPUnit_Framework_TestCase
{
public function testCreateGraph()
{
$dir = __DIR__ . '/../';
$graphComposer = new Clue\GraphComposer($dir);
$graph = $graphComposer->createGraph();
$this->assertInstanceOf('Fhaculty\Graph\Graph', $graph);
$this->assertTrue(count($graph->getVertices()) > 0);
}
}
| <?php
require __DIR__ . '/../vendor/autoload.php';
class GraphTest extends PHPUnit_Framework_TestCase
{
public function testCreateGraph()
{
$dir = __DIR__ . '/../';
-
+
$graphComposer = new Clue\GraphComposer($dir);
$graph = $graphComposer->createGraph();
-
+
$this->assertInstanceOf('Fhaculty\Graph\Graph', $graph);
- $this->assertTrue($graph->getNumberOfVertices() > 0);
? --------
+ $this->assertTrue(count($graph->getVertices()) > 0);
? ++++++ +
}
} | 6 | 0.352941 | 3 | 3 |
519a9e6b98846750c2ced4557f61a5a93b597645 | client/ng-lodash/ng-lodash.js | client/ng-lodash/ng-lodash.js | angular.module('ng.lodash', []).
factory('_', function($window){
$window._.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
return $window._;
}); | angular.module('ng.lodash', []).
factory('_', function($window){
$window._.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
/**
* Fast UUID generator, RFC4122 version 4 compliant.
* @author Jeff Ward (jcward.com).
* @license MIT license
* @link http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/21963136#21963136
**/
var lut = []; for (var i=0; i<256; i++) { lut[i] = (i<16?'0':'')+(i).toString(16); }
_.uniqueId = function() {
var d0 = Math.random()*0xffffffff|0;
var d1 = Math.random()*0xffffffff|0;
var d2 = Math.random()*0xffffffff|0;
var d3 = Math.random()*0xffffffff|0;
return lut[d0&0xff]+lut[d0>>8&0xff]+lut[d0>>16&0xff]+lut[d0>>24&0xff]+'-'+
lut[d1&0xff]+lut[d1>>8&0xff]+'-'+lut[d1>>16&0x0f|0x40]+lut[d1>>24&0xff]+'-'+
lut[d2&0x3f|0x80]+lut[d2>>8&0xff]+'-'+lut[d2>>16&0xff]+lut[d2>>24&0xff]+
lut[d3&0xff]+lut[d3>>8&0xff]+lut[d3>>16&0xff]+lut[d3>>24&0xff];
};
return $window._;
}); | Change lodash to use guid generator (MIT licensed, Jeff Ward @ stackoverflow) | Change lodash to use guid generator (MIT licensed, Jeff Ward @ stackoverflow)
| JavaScript | mit | dustyrockpyle/ipyng,dustyrockpyle/ipyng,dustyrockpyle/ipyng | javascript | ## Code Before:
angular.module('ng.lodash', []).
factory('_', function($window){
$window._.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
return $window._;
});
## Instruction:
Change lodash to use guid generator (MIT licensed, Jeff Ward @ stackoverflow)
## Code After:
angular.module('ng.lodash', []).
factory('_', function($window){
$window._.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
/**
* Fast UUID generator, RFC4122 version 4 compliant.
* @author Jeff Ward (jcward.com).
* @license MIT license
* @link http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/21963136#21963136
**/
var lut = []; for (var i=0; i<256; i++) { lut[i] = (i<16?'0':'')+(i).toString(16); }
_.uniqueId = function() {
var d0 = Math.random()*0xffffffff|0;
var d1 = Math.random()*0xffffffff|0;
var d2 = Math.random()*0xffffffff|0;
var d3 = Math.random()*0xffffffff|0;
return lut[d0&0xff]+lut[d0>>8&0xff]+lut[d0>>16&0xff]+lut[d0>>24&0xff]+'-'+
lut[d1&0xff]+lut[d1>>8&0xff]+'-'+lut[d1>>16&0x0f|0x40]+lut[d1>>24&0xff]+'-'+
lut[d2&0x3f|0x80]+lut[d2>>8&0xff]+'-'+lut[d2>>16&0xff]+lut[d2>>24&0xff]+
lut[d3&0xff]+lut[d3>>8&0xff]+lut[d3>>16&0xff]+lut[d3>>24&0xff];
};
return $window._;
}); | angular.module('ng.lodash', []).
- factory('_', function($window){
? --
+ factory('_', function($window){
- $window._.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
? ----
+ $window._.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
- return $window._;
+ /**
+ * Fast UUID generator, RFC4122 version 4 compliant.
+ * @author Jeff Ward (jcward.com).
+ * @license MIT license
+ * @link http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/21963136#21963136
+ **/
+
+ var lut = []; for (var i=0; i<256; i++) { lut[i] = (i<16?'0':'')+(i).toString(16); }
+ _.uniqueId = function() {
+ var d0 = Math.random()*0xffffffff|0;
+ var d1 = Math.random()*0xffffffff|0;
+ var d2 = Math.random()*0xffffffff|0;
+ var d3 = Math.random()*0xffffffff|0;
+ return lut[d0&0xff]+lut[d0>>8&0xff]+lut[d0>>16&0xff]+lut[d0>>24&0xff]+'-'+
+ lut[d1&0xff]+lut[d1>>8&0xff]+'-'+lut[d1>>16&0x0f|0x40]+lut[d1>>24&0xff]+'-'+
+ lut[d2&0x3f|0x80]+lut[d2>>8&0xff]+'-'+lut[d2>>16&0xff]+lut[d2>>24&0xff]+
+ lut[d3&0xff]+lut[d3>>8&0xff]+lut[d3>>16&0xff]+lut[d3>>24&0xff];
- });
? -
+ };
+ return $window._;
+ }); | 26 | 5.2 | 22 | 4 |
6e43c06ff24cf652f06e6edfd502f9d44c54f610 | README.md | README.md | A Dark Room
===========
A Minimalist Text Adventure Game
[Click to play](http://adarkroom.doublespeakgames.com/)
Available | Languages
--------- | ---------
[Chinese](http://adarkroom.doublespeakgames.com/?lang=zh_cn) | [French](http://adarkroom.doublespeakgames.com/?lang=fr)
[German](http://adarkroom.doublespeakgames.com/?lang=de) | [Italian](http://adarkroom.doublespeakgames.com/?lang=it)
[Japanese](http://adarkroom.doublespeakgames.com/?lang=ja) | [Korean](http://adarkroom.doublespeakgames.com/?lang=ko)
[Polish](http://adarkroom.doublespeakgames.com/?lang=pl) | [Portuguese](http://adarkroom.doublespeakgames.com/?lang=pt)
[Russian](http://adarkroom.doublespeakgames.com/?lang=ru) | [Spanish](http://adarkroom.doublespeakgames.com/?lang=es)
[Swedish](http://adarkroom.doublespeakgames.com/?lang=sv) | [Turkish](http://adarkroom.doublespeakgames.com/?lang=tr)
[Ukrainian](http://adarkroom.doublespeakgames.com/?lang=uk) |
[Play on GitHub](http://continuities.github.io/adarkroom)
| A Dark Room
===========
A Minimalist Text Adventure Game
[Click to play](http://adarkroom.doublespeakgames.com/)
Available | Languages
--------- | ---------
[Chinese](http://adarkroom.doublespeakgames.com/?lang=zh_cn) | [English](http://adarkroom.doublespeakgames.com/?lang=en)
[French](http://adarkroom.doublespeakgames.com/?lang=fr) | [German](http://adarkroom.doublespeakgames.com/?lang=de)
[Italian](http://adarkroom.doublespeakgames.com/?lang=it) | [Japanese](http://adarkroom.doublespeakgames.com/?lang=ja)
[Korean](http://adarkroom.doublespeakgames.com/?lang=ko) | [Polish](http://adarkroom.doublespeakgames.com/?lang=pl)
[Portuguese](http://adarkroom.doublespeakgames.com/?lang=pt) | [Russian](http://adarkroom.doublespeakgames.com/?lang=ru)
[Spanish](http://adarkroom.doublespeakgames.com/?lang=es) | [Swedish](http://adarkroom.doublespeakgames.com/?lang=sv)
[Turkish](http://adarkroom.doublespeakgames.com/?lang=tr) | [Ukrainian](http://adarkroom.doublespeakgames.com/?lang=uk)
[Play on GitHub](http://continuities.github.io/adarkroom)
| Add English as an "Available Language" | Add English as an "Available Language"
Added English in the available languages chart, since technically English is a playable language.
| Markdown | mpl-2.0 | JamesKent/adarkroom,ngosang/adarkroom,asteri0n/adarkroom,doublespeakgames/adarkroom,Pioneer11X/adarkroom,Razynoir/adarkroom,Pioneer11X/adarkroom,bdorer/adarkroom,Bleyddyn/adarkroom,asteri0n/adarkroom,doublespeakgames/adarkroom,ikoan/adarkroom,purplemilk/adarkroom,crafteverywhere/adarkroom,DDReaper/adarkroom,tehp/adarkroom,gerred/adarkroom,pablo-new17/adarkroom,as02700/adarkroom,fsladkey/adarkroom,tehp/adarkroom,purplemilk/adarkroom,sbakht/adarkroom,snazzysanoj/snazzysanoj.github.io,gerred/adarkroom,snazzysano/snazzysano.github.io,bdorer/adarkroom,snazzysano/adarkroom,Continuities/adarkroom,as02700/adarkroom,JamesKent/adarkroom,snazzysano/adarkroom,marty13612/darkroom,sbakht/adarkroom,Continuities/adarkroom,Bleyddyn/adarkroom,snazzysanoj/snazzysanoj.github.io,marty13612/darkroom,fsladkey/adarkroom,snazzysanoj/snazzysanoj.github.io,snazzysano/snazzysano.github.io,Tedko/adarkroom,DDReaper/adarkroom,doublespeakgames/adarkroom,acutesoftware/adarkroom,kaisyu/adarkroom,Razynoir/adarkroom,kaisyu/adarkroom,ikoan/adarkroom,pablo-new17/adarkroom,crafteverywhere/adarkroom,kaisyu/adarkroom,Tedko/adarkroom,ngosang/adarkroom,acutesoftware/adarkroom | markdown | ## Code Before:
A Dark Room
===========
A Minimalist Text Adventure Game
[Click to play](http://adarkroom.doublespeakgames.com/)
Available | Languages
--------- | ---------
[Chinese](http://adarkroom.doublespeakgames.com/?lang=zh_cn) | [French](http://adarkroom.doublespeakgames.com/?lang=fr)
[German](http://adarkroom.doublespeakgames.com/?lang=de) | [Italian](http://adarkroom.doublespeakgames.com/?lang=it)
[Japanese](http://adarkroom.doublespeakgames.com/?lang=ja) | [Korean](http://adarkroom.doublespeakgames.com/?lang=ko)
[Polish](http://adarkroom.doublespeakgames.com/?lang=pl) | [Portuguese](http://adarkroom.doublespeakgames.com/?lang=pt)
[Russian](http://adarkroom.doublespeakgames.com/?lang=ru) | [Spanish](http://adarkroom.doublespeakgames.com/?lang=es)
[Swedish](http://adarkroom.doublespeakgames.com/?lang=sv) | [Turkish](http://adarkroom.doublespeakgames.com/?lang=tr)
[Ukrainian](http://adarkroom.doublespeakgames.com/?lang=uk) |
[Play on GitHub](http://continuities.github.io/adarkroom)
## Instruction:
Add English as an "Available Language"
Added English in the available languages chart, since technically English is a playable language.
## Code After:
A Dark Room
===========
A Minimalist Text Adventure Game
[Click to play](http://adarkroom.doublespeakgames.com/)
Available | Languages
--------- | ---------
[Chinese](http://adarkroom.doublespeakgames.com/?lang=zh_cn) | [English](http://adarkroom.doublespeakgames.com/?lang=en)
[French](http://adarkroom.doublespeakgames.com/?lang=fr) | [German](http://adarkroom.doublespeakgames.com/?lang=de)
[Italian](http://adarkroom.doublespeakgames.com/?lang=it) | [Japanese](http://adarkroom.doublespeakgames.com/?lang=ja)
[Korean](http://adarkroom.doublespeakgames.com/?lang=ko) | [Polish](http://adarkroom.doublespeakgames.com/?lang=pl)
[Portuguese](http://adarkroom.doublespeakgames.com/?lang=pt) | [Russian](http://adarkroom.doublespeakgames.com/?lang=ru)
[Spanish](http://adarkroom.doublespeakgames.com/?lang=es) | [Swedish](http://adarkroom.doublespeakgames.com/?lang=sv)
[Turkish](http://adarkroom.doublespeakgames.com/?lang=tr) | [Ukrainian](http://adarkroom.doublespeakgames.com/?lang=uk)
[Play on GitHub](http://continuities.github.io/adarkroom)
| A Dark Room
===========
A Minimalist Text Adventure Game
[Click to play](http://adarkroom.doublespeakgames.com/)
Available | Languages
--------- | ---------
- [Chinese](http://adarkroom.doublespeakgames.com/?lang=zh_cn) | [French](http://adarkroom.doublespeakgames.com/?lang=fr)
? ^^^ ^ ^^
+ [Chinese](http://adarkroom.doublespeakgames.com/?lang=zh_cn) | [English](http://adarkroom.doublespeakgames.com/?lang=en)
? ^ ^^^^ ^^
- [German](http://adarkroom.doublespeakgames.com/?lang=de) | [Italian](http://adarkroom.doublespeakgames.com/?lang=it)
- [Japanese](http://adarkroom.doublespeakgames.com/?lang=ja) | [Korean](http://adarkroom.doublespeakgames.com/?lang=ko)
? ^^^^ ^^^ ^^ ^^ ^ ^^
+ [French](http://adarkroom.doublespeakgames.com/?lang=fr) | [German](http://adarkroom.doublespeakgames.com/?lang=de)
? ^^^ ^^ ^^ ^^ ^ ^^
- [Polish](http://adarkroom.doublespeakgames.com/?lang=pl) | [Portuguese](http://adarkroom.doublespeakgames.com/?lang=pt)
- [Russian](http://adarkroom.doublespeakgames.com/?lang=ru) | [Spanish](http://adarkroom.doublespeakgames.com/?lang=es)
? ^^^^ ^^ ^ ^ ^ ^^
+ [Italian](http://adarkroom.doublespeakgames.com/?lang=it) | [Japanese](http://adarkroom.doublespeakgames.com/?lang=ja)
? ^^^^ ^^ ^^ ^ ^ ^^
+ [Korean](http://adarkroom.doublespeakgames.com/?lang=ko) | [Polish](http://adarkroom.doublespeakgames.com/?lang=pl)
- [Swedish](http://adarkroom.doublespeakgames.com/?lang=sv) | [Turkish](http://adarkroom.doublespeakgames.com/?lang=tr)
? ^^ -- ^ ^^ ^ ^^ ^^ -
+ [Portuguese](http://adarkroom.doublespeakgames.com/?lang=pt) | [Russian](http://adarkroom.doublespeakgames.com/?lang=ru)
? ^^^^^^^ ^ ^^ ^ ^^ ^^ +
- [Ukrainian](http://adarkroom.doublespeakgames.com/?lang=uk) |
+ [Spanish](http://adarkroom.doublespeakgames.com/?lang=es) | [Swedish](http://adarkroom.doublespeakgames.com/?lang=sv)
+ [Turkish](http://adarkroom.doublespeakgames.com/?lang=tr) | [Ukrainian](http://adarkroom.doublespeakgames.com/?lang=uk)
+
[Play on GitHub](http://continuities.github.io/adarkroom) | 15 | 0.833333 | 8 | 7 |
85aebf684bf958a3bbe50b5d994210f53fe318ac | spec/unit/endpoint/builds_spec.rb | spec/unit/endpoint/builds_spec.rb | require 'spec_helper'
describe Travis::Api::App::Endpoint::Builds do
it 'has to be tested'
end
| require 'spec_helper'
describe Travis::Api::App::Endpoint::Builds do
include Travis::Testing::Stubs
it 'works with default options' do
get('/repos.json', {}).should be_ok
end
context '/repos.json is requested' do
before :each do
@plain_response_body = get('/repos.json').body
end
context 'when `pretty=true` is given' do
it 'prints pretty formatted data' do
response = get('/repos.json?pretty=true')
response.should be_ok
response.body.should_not eq(@plain_response_body)
response.body.should match(/\n/)
end
end
context 'when `pretty=1` is given' do
it 'prints pretty formatted data' do
response = get('/repos.json?pretty=1')
response.should be_ok
response.body.should_not eq(@plain_response_body)
response.body.should match(/\n/)
end
end
context 'when `pretty=bogus` is given' do
it 'prints plain-formatted data' do
response = get('/repos.json?pretty=bogus')
response.should be_ok
response.body.should eq(@plain_response_body)
end
end
end
end
| Add specs for pretty print JSON | Add specs for pretty print JSON
They only check that the response includes `\n`, which should not happen
otherwise.
| Ruby | mit | travis-ci/travis-api,Tiger66639/travis-api,travis-ci/travis-api,Tiger66639/travis-api,travis-ci/travis-api | ruby | ## Code Before:
require 'spec_helper'
describe Travis::Api::App::Endpoint::Builds do
it 'has to be tested'
end
## Instruction:
Add specs for pretty print JSON
They only check that the response includes `\n`, which should not happen
otherwise.
## Code After:
require 'spec_helper'
describe Travis::Api::App::Endpoint::Builds do
include Travis::Testing::Stubs
it 'works with default options' do
get('/repos.json', {}).should be_ok
end
context '/repos.json is requested' do
before :each do
@plain_response_body = get('/repos.json').body
end
context 'when `pretty=true` is given' do
it 'prints pretty formatted data' do
response = get('/repos.json?pretty=true')
response.should be_ok
response.body.should_not eq(@plain_response_body)
response.body.should match(/\n/)
end
end
context 'when `pretty=1` is given' do
it 'prints pretty formatted data' do
response = get('/repos.json?pretty=1')
response.should be_ok
response.body.should_not eq(@plain_response_body)
response.body.should match(/\n/)
end
end
context 'when `pretty=bogus` is given' do
it 'prints plain-formatted data' do
response = get('/repos.json?pretty=bogus')
response.should be_ok
response.body.should eq(@plain_response_body)
end
end
end
end
| require 'spec_helper'
describe Travis::Api::App::Endpoint::Builds do
- it 'has to be tested'
+ include Travis::Testing::Stubs
+
+ it 'works with default options' do
+ get('/repos.json', {}).should be_ok
+ end
+
+ context '/repos.json is requested' do
+ before :each do
+ @plain_response_body = get('/repos.json').body
+ end
+
+ context 'when `pretty=true` is given' do
+ it 'prints pretty formatted data' do
+ response = get('/repos.json?pretty=true')
+ response.should be_ok
+ response.body.should_not eq(@plain_response_body)
+ response.body.should match(/\n/)
+ end
+ end
+
+ context 'when `pretty=1` is given' do
+ it 'prints pretty formatted data' do
+ response = get('/repos.json?pretty=1')
+ response.should be_ok
+ response.body.should_not eq(@plain_response_body)
+ response.body.should match(/\n/)
+ end
+ end
+
+ context 'when `pretty=bogus` is given' do
+ it 'prints plain-formatted data' do
+ response = get('/repos.json?pretty=bogus')
+ response.should be_ok
+ response.body.should eq(@plain_response_body)
+ end
+ end
+ end
+
end | 39 | 7.8 | 38 | 1 |
feb11db1e2391c931a6c9b6ece5fde3347c67dab | .travis.yml | .travis.yml | language: csharp
dist: trusty
sudo: required
mono: none
dotnet:
- 1.0.0-preview2-003121
- 1.0.0-preview2-003131
script:
- dotnet restore
- dotnet build -c Release **/project.json
- dotnet publish -c Release | language: csharp
dist: trusty
sudo: required
mono: none
dotnet: 1.0.0-preview2-003121
script:
- dotnet restore
- dotnet build -c Release **/project.json
- dotnet publish -c Release | Remove the second dotnet version | Remove the second dotnet version
Signed-off-by: Dominik Bittner <e81ef3d9e1a2cb43153edcf9da95470a6643633e@gmx.net>
| YAML | bsd-3-clause | DoBi/kraken.net | yaml | ## Code Before:
language: csharp
dist: trusty
sudo: required
mono: none
dotnet:
- 1.0.0-preview2-003121
- 1.0.0-preview2-003131
script:
- dotnet restore
- dotnet build -c Release **/project.json
- dotnet publish -c Release
## Instruction:
Remove the second dotnet version
Signed-off-by: Dominik Bittner <e81ef3d9e1a2cb43153edcf9da95470a6643633e@gmx.net>
## Code After:
language: csharp
dist: trusty
sudo: required
mono: none
dotnet: 1.0.0-preview2-003121
script:
- dotnet restore
- dotnet build -c Release **/project.json
- dotnet publish -c Release | language: csharp
dist: trusty
sudo: required
mono: none
- dotnet:
- - 1.0.0-preview2-003121
? ^^^
+ dotnet: 1.0.0-preview2-003121
? ^^^^^^^
- - 1.0.0-preview2-003131
script:
- dotnet restore
- dotnet build -c Release **/project.json
- dotnet publish -c Release | 4 | 0.333333 | 1 | 3 |
c51ac6a639c8e2579d0b104c1cc48bf652947965 | src_ts/components/support-btn.ts | src_ts/components/support-btn.ts | import {PolymerElement, html} from '@polymer/polymer/polymer-element';
import '@polymer/iron-icons/communication-icons';
/* eslint-disable max-len */
/**
* @polymer
* @customElement
*/
export class SupportBtn extends PolymerElement {
public static get template(): HTMLTemplateElement {
return html`
<style>
:host(:hover) {
cursor: pointer;
}
a {
color: inherit;
text-decoration: none;
font-size: 16px;
}
iron-icon {
margin-right: 4px;
}
</style>
<a href="https://unicef.service-now.com/cc/?id=sc_cat_item&sys_id=35b00b1bdb255f00085184735b9619e6&sysparm_category=c6ab1444db5b5700085184735b961920"
target="_blank">
<iron-icon icon="communication:textsms"></iron-icon>
Support
</a>
`;
}
}
| import {PolymerElement, html} from '@polymer/polymer/polymer-element';
import '@polymer/iron-icons/communication-icons';
/* eslint-disable max-len */
/**
* @polymer
* @customElement
*/
export class SupportBtn extends PolymerElement {
public static get template(): HTMLTemplateElement {
return html`
<style>
:host(:hover) {
cursor: pointer;
}
a {
color: inherit;
text-decoration: none;
font-size: 16px;
}
iron-icon {
margin-right: 4px;
}
</style>
<a href="https://unicef.service-now.com/cc?id=sc_cat_item&sys_id=c8e43760db622450f65a2aea4b9619ad&sysparm_category=99c51053db0a6f40f65a2aea4b9619af"
target="_blank">
<iron-icon icon="communication:textsms"></iron-icon>
Support
</a>
`;
}
}
| Update support link in header | [ch26816] Update support link in header
| TypeScript | apache-2.0 | unicef/etools-dashboard,unicef/etools-dashboard,unicef/etools-dashboard,unicef/etools-dashboard | typescript | ## Code Before:
import {PolymerElement, html} from '@polymer/polymer/polymer-element';
import '@polymer/iron-icons/communication-icons';
/* eslint-disable max-len */
/**
* @polymer
* @customElement
*/
export class SupportBtn extends PolymerElement {
public static get template(): HTMLTemplateElement {
return html`
<style>
:host(:hover) {
cursor: pointer;
}
a {
color: inherit;
text-decoration: none;
font-size: 16px;
}
iron-icon {
margin-right: 4px;
}
</style>
<a href="https://unicef.service-now.com/cc/?id=sc_cat_item&sys_id=35b00b1bdb255f00085184735b9619e6&sysparm_category=c6ab1444db5b5700085184735b961920"
target="_blank">
<iron-icon icon="communication:textsms"></iron-icon>
Support
</a>
`;
}
}
## Instruction:
[ch26816] Update support link in header
## Code After:
import {PolymerElement, html} from '@polymer/polymer/polymer-element';
import '@polymer/iron-icons/communication-icons';
/* eslint-disable max-len */
/**
* @polymer
* @customElement
*/
export class SupportBtn extends PolymerElement {
public static get template(): HTMLTemplateElement {
return html`
<style>
:host(:hover) {
cursor: pointer;
}
a {
color: inherit;
text-decoration: none;
font-size: 16px;
}
iron-icon {
margin-right: 4px;
}
</style>
<a href="https://unicef.service-now.com/cc?id=sc_cat_item&sys_id=c8e43760db622450f65a2aea4b9619ad&sysparm_category=99c51053db0a6f40f65a2aea4b9619af"
target="_blank">
<iron-icon icon="communication:textsms"></iron-icon>
Support
</a>
`;
}
}
| import {PolymerElement, html} from '@polymer/polymer/polymer-element';
import '@polymer/iron-icons/communication-icons';
/* eslint-disable max-len */
/**
* @polymer
* @customElement
*/
export class SupportBtn extends PolymerElement {
public static get template(): HTMLTemplateElement {
return html`
<style>
:host(:hover) {
cursor: pointer;
}
a {
color: inherit;
text-decoration: none;
font-size: 16px;
}
iron-icon {
margin-right: 4px;
}
</style>
- <a href="https://unicef.service-now.com/cc/?id=sc_cat_item&sys_id=35b00b1bdb255f00085184735b9619e6&sysparm_category=c6ab1444db5b5700085184735b961920"
+ <a href="https://unicef.service-now.com/cc?id=sc_cat_item&sys_id=c8e43760db622450f65a2aea4b9619ad&sysparm_category=99c51053db0a6f40f65a2aea4b9619af"
target="_blank">
<iron-icon icon="communication:textsms"></iron-icon>
Support
</a>
`;
}
} | 2 | 0.060606 | 1 | 1 |
b73d0eea63f864a8abd40601a6d4aa34f7075908 | app/models/notifier.rb | app/models/notifier.rb | class Notifier < ActionMailer::Base
def invitation(invitation, sent_at = Time.now)
subject 'You received a Failtale invitation!'
recipients invitation.email
from 'donotreply@failtale.be'
sent_on sent_at
body :invitation => invitation
end
def occurence_report(user, occurence, sent_at = Time.now)
subject "[#{occurence.error.project.name}] An error occured"
recipients user.email
from 'donotreply@failtale.be'
sent_on sent_at
body :user => user, :occurence => occurence
end
end
| class Notifier < ActionMailer::Base
def invitation(invitation, sent_at = Time.now)
subject 'You received a Failtale invitation!'
recipients invitation.email
from 'donotreply@failtale.be'
sent_on sent_at
body :invitation => invitation
end
def occurence_report(user, occurence, sent_at = Time.now)
subject "[#{occurence.error.project.name}] An error occured (@#{@occurence.error_id})"
recipients user.email
from 'donotreply@failtale.be'
sent_on sent_at
body :user => user, :occurence => occurence
end
end
| Include the error id in the mail title | Include the error id in the mail title
| Ruby | mit | mrhenry/failtale,eladmeidar/failtail,eladmeidar/failtail,mrhenry/failtale | ruby | ## Code Before:
class Notifier < ActionMailer::Base
def invitation(invitation, sent_at = Time.now)
subject 'You received a Failtale invitation!'
recipients invitation.email
from 'donotreply@failtale.be'
sent_on sent_at
body :invitation => invitation
end
def occurence_report(user, occurence, sent_at = Time.now)
subject "[#{occurence.error.project.name}] An error occured"
recipients user.email
from 'donotreply@failtale.be'
sent_on sent_at
body :user => user, :occurence => occurence
end
end
## Instruction:
Include the error id in the mail title
## Code After:
class Notifier < ActionMailer::Base
def invitation(invitation, sent_at = Time.now)
subject 'You received a Failtale invitation!'
recipients invitation.email
from 'donotreply@failtale.be'
sent_on sent_at
body :invitation => invitation
end
def occurence_report(user, occurence, sent_at = Time.now)
subject "[#{occurence.error.project.name}] An error occured (@#{@occurence.error_id})"
recipients user.email
from 'donotreply@failtale.be'
sent_on sent_at
body :user => user, :occurence => occurence
end
end
| class Notifier < ActionMailer::Base
def invitation(invitation, sent_at = Time.now)
subject 'You received a Failtale invitation!'
recipients invitation.email
from 'donotreply@failtale.be'
sent_on sent_at
body :invitation => invitation
end
def occurence_report(user, occurence, sent_at = Time.now)
- subject "[#{occurence.error.project.name}] An error occured"
+ subject "[#{occurence.error.project.name}] An error occured (@#{@occurence.error_id})"
? ++++++++++++++++++++++++++
recipients user.email
from 'donotreply@failtale.be'
sent_on sent_at
body :user => user, :occurence => occurence
end
end | 2 | 0.095238 | 1 | 1 |
b2018674d2915bc4d0f71d62198eeea5a7b0e4ce | lib/vcloud/config_loader.rb | lib/vcloud/config_loader.rb | require 'vcloud'
module Vcloud
class ConfigLoader
def load_config(config_file, schema = nil)
input_config = YAML::load(File.open(config_file))
# There is no way in YAML or Ruby to symbolize keys in a hash
json_string = JSON.generate(input_config)
config = JSON.parse(json_string, :symbolize_names => true)
if schema
validation = ConfigValidator.validate(:base, config, schema)
unless validation.valid?
validation.errors.each do |error|
Vcloud.logger.fatal(error)
end
raise("Supplied configuration does not match supplied schema")
end
end
config
end
end
end
| require 'vcloud'
module Vcloud
class ConfigLoader
def load_config(config_file, schema = nil)
input_config = YAML::load(File.open(config_file))
# There is no way in YAML or Ruby to symbolize keys in a hash
json_string = JSON.generate(input_config)
config = JSON.parse(json_string, :symbolize_names => true)
if schema
validation = Vcloud::Core::ConfigValidator.validate(:base, config, schema)
unless validation.valid?
validation.errors.each do |error|
Vcloud.logger.fatal(error)
end
raise("Supplied configuration does not match supplied schema")
end
end
config
end
end
end
| Use core's config validator instead of local | Use core's config validator instead of local
| Ruby | mit | gds-operations/vcloud-launcher,UKHomeOffice/vcloud-launcher,UKHomeOffice/vcloud-launcher,UKHomeOffice/vcloud-launcher,gds-operations/vcloud-launcher,gds-operations/vcloud-launcher | ruby | ## Code Before:
require 'vcloud'
module Vcloud
class ConfigLoader
def load_config(config_file, schema = nil)
input_config = YAML::load(File.open(config_file))
# There is no way in YAML or Ruby to symbolize keys in a hash
json_string = JSON.generate(input_config)
config = JSON.parse(json_string, :symbolize_names => true)
if schema
validation = ConfigValidator.validate(:base, config, schema)
unless validation.valid?
validation.errors.each do |error|
Vcloud.logger.fatal(error)
end
raise("Supplied configuration does not match supplied schema")
end
end
config
end
end
end
## Instruction:
Use core's config validator instead of local
## Code After:
require 'vcloud'
module Vcloud
class ConfigLoader
def load_config(config_file, schema = nil)
input_config = YAML::load(File.open(config_file))
# There is no way in YAML or Ruby to symbolize keys in a hash
json_string = JSON.generate(input_config)
config = JSON.parse(json_string, :symbolize_names => true)
if schema
validation = Vcloud::Core::ConfigValidator.validate(:base, config, schema)
unless validation.valid?
validation.errors.each do |error|
Vcloud.logger.fatal(error)
end
raise("Supplied configuration does not match supplied schema")
end
end
config
end
end
end
| require 'vcloud'
module Vcloud
class ConfigLoader
def load_config(config_file, schema = nil)
input_config = YAML::load(File.open(config_file))
# There is no way in YAML or Ruby to symbolize keys in a hash
json_string = JSON.generate(input_config)
config = JSON.parse(json_string, :symbolize_names => true)
if schema
- validation = ConfigValidator.validate(:base, config, schema)
+ validation = Vcloud::Core::ConfigValidator.validate(:base, config, schema)
? ++++++++++++++
unless validation.valid?
validation.errors.each do |error|
Vcloud.logger.fatal(error)
end
raise("Supplied configuration does not match supplied schema")
end
end
config
end
end
end | 2 | 0.076923 | 1 | 1 |
bfbb6af4300359656b28277dd913c6004eb05376 | src/accounts.js | src/accounts.js | const crypto = require('crypto');
const Accounts = function() {
this.accounts = [];
};
const Account = function() {
this.username = '';
this.characters = [];
this.password = null;
this.karma = 0;
this.uid = null;
this.score = {
totalKarma: 0,
};
/* Mutators */
this.getUsername = () => this.username;
this.setUsername = name => this.username = name;
this.setUuid = uid => this.uid = uid;
this.getUuid = () => this.uid;
this.addCharacter = char => this.characters.push(char);
this.getCharacters = () => this.characters;
this.getCharacter = uid => this.characters.find(
char => uid === char.getUuid());
this.getPassword = () => this.password; // Returns hash.
this.setPassword = pass =>
this.password = crypto
.createHash('md5')
.update(pass)
.digest('hex');
this.getKarma = () => this.karma;
this.deductKarma = karma => this.karma -= karma;
this.addKarma = karma => {
this.karma += karma;
this.score.totalKarma += karma;
};
this.getScore = key => key ? this.score[key] : this.score;
return this;
};
module.exports = { Accounts, Account };
| const crypto = require('crypto');
const Accounts = function() {
this.accounts = [];
};
const Account = function() {
this.username = '';
this.characters = [];
this.password = null;
this.karma = 0;
this.uid = null;
this.score = {
totalKarma: 0,
};
/* Mutators */
this.getUsername = () => this.username;
this.setUsername = name => this.username = name;
this.setUuid = uid => this.uid = uid;
this.getUuid = () => this.uid;
this.addCharacter = char => this.characters.push(char);
this.getCharacters = () => this.characters;
this.getCharacter = uid => this.characters.find(
char => uid === char.getUuid());
this.getLivingCharacters = () =>
this.characters.filter(char => char.isAlive);
this.getDeadCharacters = () =>
this.characters.filter(char => !char.isAlive);
this.getPassword = () => this.password; // Returns hash.
this.setPassword = pass =>
this.password = crypto
.createHash('md5')
.update(pass)
.digest('hex');
this.getKarma = () => this.karma;
this.deductKarma = karma => this.karma -= karma;
this.addKarma = karma => {
this.karma += karma;
this.score.totalKarma += karma;
};
this.getScore = key => key ? this.score[key] : this.score;
return this;
};
module.exports = { Accounts, Account };
| Add helper funcs to get dead or living chars. | Add helper funcs to get dead or living chars.
| JavaScript | mit | shawncplus/ranviermud,seanohue/ranviermud,seanohue/ranviermud | javascript | ## Code Before:
const crypto = require('crypto');
const Accounts = function() {
this.accounts = [];
};
const Account = function() {
this.username = '';
this.characters = [];
this.password = null;
this.karma = 0;
this.uid = null;
this.score = {
totalKarma: 0,
};
/* Mutators */
this.getUsername = () => this.username;
this.setUsername = name => this.username = name;
this.setUuid = uid => this.uid = uid;
this.getUuid = () => this.uid;
this.addCharacter = char => this.characters.push(char);
this.getCharacters = () => this.characters;
this.getCharacter = uid => this.characters.find(
char => uid === char.getUuid());
this.getPassword = () => this.password; // Returns hash.
this.setPassword = pass =>
this.password = crypto
.createHash('md5')
.update(pass)
.digest('hex');
this.getKarma = () => this.karma;
this.deductKarma = karma => this.karma -= karma;
this.addKarma = karma => {
this.karma += karma;
this.score.totalKarma += karma;
};
this.getScore = key => key ? this.score[key] : this.score;
return this;
};
module.exports = { Accounts, Account };
## Instruction:
Add helper funcs to get dead or living chars.
## Code After:
const crypto = require('crypto');
const Accounts = function() {
this.accounts = [];
};
const Account = function() {
this.username = '';
this.characters = [];
this.password = null;
this.karma = 0;
this.uid = null;
this.score = {
totalKarma: 0,
};
/* Mutators */
this.getUsername = () => this.username;
this.setUsername = name => this.username = name;
this.setUuid = uid => this.uid = uid;
this.getUuid = () => this.uid;
this.addCharacter = char => this.characters.push(char);
this.getCharacters = () => this.characters;
this.getCharacter = uid => this.characters.find(
char => uid === char.getUuid());
this.getLivingCharacters = () =>
this.characters.filter(char => char.isAlive);
this.getDeadCharacters = () =>
this.characters.filter(char => !char.isAlive);
this.getPassword = () => this.password; // Returns hash.
this.setPassword = pass =>
this.password = crypto
.createHash('md5')
.update(pass)
.digest('hex');
this.getKarma = () => this.karma;
this.deductKarma = karma => this.karma -= karma;
this.addKarma = karma => {
this.karma += karma;
this.score.totalKarma += karma;
};
this.getScore = key => key ? this.score[key] : this.score;
return this;
};
module.exports = { Accounts, Account };
| const crypto = require('crypto');
const Accounts = function() {
this.accounts = [];
};
const Account = function() {
this.username = '';
this.characters = [];
this.password = null;
this.karma = 0;
this.uid = null;
this.score = {
totalKarma: 0,
};
/* Mutators */
this.getUsername = () => this.username;
this.setUsername = name => this.username = name;
this.setUuid = uid => this.uid = uid;
this.getUuid = () => this.uid;
this.addCharacter = char => this.characters.push(char);
this.getCharacters = () => this.characters;
this.getCharacter = uid => this.characters.find(
char => uid === char.getUuid());
+ this.getLivingCharacters = () =>
+ this.characters.filter(char => char.isAlive);
+ this.getDeadCharacters = () =>
+ this.characters.filter(char => !char.isAlive);
+
this.getPassword = () => this.password; // Returns hash.
this.setPassword = pass =>
this.password = crypto
.createHash('md5')
.update(pass)
.digest('hex');
this.getKarma = () => this.karma;
this.deductKarma = karma => this.karma -= karma;
this.addKarma = karma => {
this.karma += karma;
this.score.totalKarma += karma;
};
this.getScore = key => key ? this.score[key] : this.score;
return this;
};
module.exports = { Accounts, Account }; | 5 | 0.098039 | 5 | 0 |
c72d9060142fe1de1e2201fc355f2ee95f5354c7 | src/waldur_mastermind/invoices/migrations/0023_invoice_current_cost.py | src/waldur_mastermind/invoices/migrations/0023_invoice_current_cost.py | from __future__ import unicode_literals
from django.db import migrations, models
def migrate_data(apps, schema_editor):
Invoice = apps.get_model('invoices', 'Invoice')
for invoice in Invoice.objects.all():
invoice.update_current_cost()
class Migration(migrations.Migration):
dependencies = [
('invoices', '0022_remove_payment_details'),
]
operations = [
migrations.AddField(
model_name='invoice',
name='current_cost',
field=models.DecimalField(decimal_places=2, default=0, editable=False, help_text='Cached value for current cost.', max_digits=10),
),
migrations.RunPython(migrate_data, reverse_code=migrations.RunPython.noop),
]
| from __future__ import unicode_literals
from django.db import migrations, models
def migrate_data(apps, schema_editor):
from waldur_mastermind.invoices.models import Invoice
for invoice in Invoice.objects.all():
invoice.update_current_cost()
class Migration(migrations.Migration):
dependencies = [
('invoices', '0022_remove_payment_details'),
]
operations = [
migrations.AddField(
model_name='invoice',
name='current_cost',
field=models.DecimalField(decimal_places=2, default=0, editable=False, help_text='Cached value for current cost.', max_digits=10),
),
migrations.RunPython(migrate_data, reverse_code=migrations.RunPython.noop),
]
| Fix database migration for invoices application. | Fix database migration for invoices application.
| Python | mit | opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/nodeconductor-assembly-waldur | python | ## Code Before:
from __future__ import unicode_literals
from django.db import migrations, models
def migrate_data(apps, schema_editor):
Invoice = apps.get_model('invoices', 'Invoice')
for invoice in Invoice.objects.all():
invoice.update_current_cost()
class Migration(migrations.Migration):
dependencies = [
('invoices', '0022_remove_payment_details'),
]
operations = [
migrations.AddField(
model_name='invoice',
name='current_cost',
field=models.DecimalField(decimal_places=2, default=0, editable=False, help_text='Cached value for current cost.', max_digits=10),
),
migrations.RunPython(migrate_data, reverse_code=migrations.RunPython.noop),
]
## Instruction:
Fix database migration for invoices application.
## Code After:
from __future__ import unicode_literals
from django.db import migrations, models
def migrate_data(apps, schema_editor):
from waldur_mastermind.invoices.models import Invoice
for invoice in Invoice.objects.all():
invoice.update_current_cost()
class Migration(migrations.Migration):
dependencies = [
('invoices', '0022_remove_payment_details'),
]
operations = [
migrations.AddField(
model_name='invoice',
name='current_cost',
field=models.DecimalField(decimal_places=2, default=0, editable=False, help_text='Cached value for current cost.', max_digits=10),
),
migrations.RunPython(migrate_data, reverse_code=migrations.RunPython.noop),
]
| from __future__ import unicode_literals
from django.db import migrations, models
def migrate_data(apps, schema_editor):
- Invoice = apps.get_model('invoices', 'Invoice')
+ from waldur_mastermind.invoices.models import Invoice
for invoice in Invoice.objects.all():
invoice.update_current_cost()
class Migration(migrations.Migration):
dependencies = [
('invoices', '0022_remove_payment_details'),
]
operations = [
migrations.AddField(
model_name='invoice',
name='current_cost',
field=models.DecimalField(decimal_places=2, default=0, editable=False, help_text='Cached value for current cost.', max_digits=10),
),
migrations.RunPython(migrate_data, reverse_code=migrations.RunPython.noop),
] | 2 | 0.076923 | 1 | 1 |
36213a31a1870cf38ec0ce3d208c6a2072e2b133 | acapi/tests/test_client.py | acapi/tests/test_client.py | import os
import requests
import requests_mock
import unittest
from .. import Client
@requests_mock.Mocker()
class TestClient(unittest.TestCase):
"""Tests the Acquia Cloud API client class."""
req = None
"""
def setup(self, ):
" ""
Set up the tests with the mock requests handler.
" ""
session = requests.Session()
adapter = requests_mock.Adapter()
session.mount('mock', adapter)
"""
def test_find_credentials(self, m):
"""
Tests finding the credentials in environment variables
"""
os.environ['ACQUIA_CLOUD_API_USER'] = 'user'
os.environ['ACQUIA_CLOUD_API_TOKEN'] = 'token'
client = Client(cache=None)
(user, token) = client._Client__find_credentials()
self.assertEqual(user, 'user')
self.assertEqual(token, 'token')
def test_user(self, m):
email = 'user@example.com'
m.register_uri('GET',
'https://cloudapi.acquia.com/v1/me.json',
json={"authenticated_as": email}
)
client = Client(email, 'token')
user = client.user().get()
self.assertEqual(user['authenticated_as'], email)
if __name__ == '__main__':
unittest.main()
| import os
import requests
import requests_mock
import unittest
from .. import Client
from ..exceptions import AcquiaCloudException
@requests_mock.Mocker()
class TestClient(unittest.TestCase):
"""Tests the Acquia Cloud API client class."""
req = None
"""
def setup(self, ):
" ""
Set up the tests with the mock requests handler.
" ""
session = requests.Session()
adapter = requests_mock.Adapter()
session.mount('mock', adapter)
"""
def test_find_credentials(self, m):
"""
Tests finding the credentials in environment variables
"""
os.environ['ACQUIA_CLOUD_API_USER'] = 'user'
os.environ['ACQUIA_CLOUD_API_TOKEN'] = 'token'
client = Client(cache=None)
(user, token) = client._Client__find_credentials()
self.assertEqual(user, 'user')
self.assertEqual(token, 'token')
def test_find_credentials_none_set(self, m):
"""
Tests finding the credentials in environment variables with empty credentials
"""
os.environ['ACQUIA_CLOUD_API_USER'] = ''
os.environ['ACQUIA_CLOUD_API_TOKEN'] = ''
with self.assertRaises(AcquiaCloudException) as cm:
client = Client(cache=None)
self.assertEqual(str(cm.exception), 'Credentials not provided')
def test_user(self, m):
email = 'user@example.com'
m.register_uri('GET',
'https://cloudapi.acquia.com/v1/me.json',
json={"authenticated_as": email}
)
client = Client(email, 'token')
user = client.user().get()
self.assertEqual(user['authenticated_as'], email)
if __name__ == '__main__':
unittest.main()
| Add test for failing to find credentials | Add test for failing to find credentials
| Python | mit | skwashd/python-acquia-cloud | python | ## Code Before:
import os
import requests
import requests_mock
import unittest
from .. import Client
@requests_mock.Mocker()
class TestClient(unittest.TestCase):
"""Tests the Acquia Cloud API client class."""
req = None
"""
def setup(self, ):
" ""
Set up the tests with the mock requests handler.
" ""
session = requests.Session()
adapter = requests_mock.Adapter()
session.mount('mock', adapter)
"""
def test_find_credentials(self, m):
"""
Tests finding the credentials in environment variables
"""
os.environ['ACQUIA_CLOUD_API_USER'] = 'user'
os.environ['ACQUIA_CLOUD_API_TOKEN'] = 'token'
client = Client(cache=None)
(user, token) = client._Client__find_credentials()
self.assertEqual(user, 'user')
self.assertEqual(token, 'token')
def test_user(self, m):
email = 'user@example.com'
m.register_uri('GET',
'https://cloudapi.acquia.com/v1/me.json',
json={"authenticated_as": email}
)
client = Client(email, 'token')
user = client.user().get()
self.assertEqual(user['authenticated_as'], email)
if __name__ == '__main__':
unittest.main()
## Instruction:
Add test for failing to find credentials
## Code After:
import os
import requests
import requests_mock
import unittest
from .. import Client
from ..exceptions import AcquiaCloudException
@requests_mock.Mocker()
class TestClient(unittest.TestCase):
"""Tests the Acquia Cloud API client class."""
req = None
"""
def setup(self, ):
" ""
Set up the tests with the mock requests handler.
" ""
session = requests.Session()
adapter = requests_mock.Adapter()
session.mount('mock', adapter)
"""
def test_find_credentials(self, m):
"""
Tests finding the credentials in environment variables
"""
os.environ['ACQUIA_CLOUD_API_USER'] = 'user'
os.environ['ACQUIA_CLOUD_API_TOKEN'] = 'token'
client = Client(cache=None)
(user, token) = client._Client__find_credentials()
self.assertEqual(user, 'user')
self.assertEqual(token, 'token')
def test_find_credentials_none_set(self, m):
"""
Tests finding the credentials in environment variables with empty credentials
"""
os.environ['ACQUIA_CLOUD_API_USER'] = ''
os.environ['ACQUIA_CLOUD_API_TOKEN'] = ''
with self.assertRaises(AcquiaCloudException) as cm:
client = Client(cache=None)
self.assertEqual(str(cm.exception), 'Credentials not provided')
def test_user(self, m):
email = 'user@example.com'
m.register_uri('GET',
'https://cloudapi.acquia.com/v1/me.json',
json={"authenticated_as": email}
)
client = Client(email, 'token')
user = client.user().get()
self.assertEqual(user['authenticated_as'], email)
if __name__ == '__main__':
unittest.main()
| import os
import requests
import requests_mock
import unittest
from .. import Client
+ from ..exceptions import AcquiaCloudException
@requests_mock.Mocker()
class TestClient(unittest.TestCase):
"""Tests the Acquia Cloud API client class."""
req = None
"""
def setup(self, ):
" ""
Set up the tests with the mock requests handler.
" ""
session = requests.Session()
adapter = requests_mock.Adapter()
session.mount('mock', adapter)
"""
def test_find_credentials(self, m):
"""
Tests finding the credentials in environment variables
"""
os.environ['ACQUIA_CLOUD_API_USER'] = 'user'
os.environ['ACQUIA_CLOUD_API_TOKEN'] = 'token'
client = Client(cache=None)
(user, token) = client._Client__find_credentials()
self.assertEqual(user, 'user')
self.assertEqual(token, 'token')
+ def test_find_credentials_none_set(self, m):
+ """
+ Tests finding the credentials in environment variables with empty credentials
+ """
+ os.environ['ACQUIA_CLOUD_API_USER'] = ''
+ os.environ['ACQUIA_CLOUD_API_TOKEN'] = ''
+ with self.assertRaises(AcquiaCloudException) as cm:
+ client = Client(cache=None)
+
+ self.assertEqual(str(cm.exception), 'Credentials not provided')
+
def test_user(self, m):
email = 'user@example.com'
m.register_uri('GET',
'https://cloudapi.acquia.com/v1/me.json',
json={"authenticated_as": email}
)
client = Client(email, 'token')
user = client.user().get()
self.assertEqual(user['authenticated_as'], email)
if __name__ == '__main__':
unittest.main() | 12 | 0.26087 | 12 | 0 |
e23ee25163bf7b3f7f2ecab3a89f5a48ff87e171 | Android.mk | Android.mk |
ifneq ($(BOARD_ANT_WIRELESS_DEVICE),)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
#
# ANT java system service
#
LOCAL_SRC_FILES := \
$(call all-java-files-under, src) \
src/com/dsi/ant/server/IAntHal.aidl \
src/com/dsi/ant/server/IAntHalCallback.aidl
LOCAL_REQUIRED_MODULES := libantradio
LOCAL_PROGUARD_FLAG_FILES := proguard.flags
LOCAL_CERTIFICATE := platform
LOCAL_MODULE_TAGS := optional
LOCAL_PACKAGE_NAME := AntHalService
include $(BUILD_PACKAGE)
endif # BOARD_ANT_WIRELESS_DEVICE defined
|
ifneq ($(BOARD_ANT_WIRELESS_DEVICE),)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
#
# ANT java system service
#
LOCAL_SRC_FILES := \
$(call all-java-files-under, src) \
src/com/dsi/ant/server/IAntHal.aidl \
src/com/dsi/ant/server/IAntHalCallback.aidl
LOCAL_REQUIRED_MODULES := libantradio
LOCAL_PROGUARD_FLAG_FILES := proguard.flags
LOCAL_CERTIFICATE := platform
LOCAL_MODULE_TAGS := optional
LOCAL_PACKAGE_NAME := AntHalService
ifeq ($(filter 8% O% o%,$(TARGET_PLATFORM_VERSION)),)
LOCAL_SDK_VERSION := system_current
endif
include $(BUILD_PACKAGE)
endif # BOARD_ANT_WIRELESS_DEVICE defined
| Define LOCAL_SDK_VERSION for ant_service module | Define LOCAL_SDK_VERSION for ant_service module
For System SDK compliance either of two flags should be defined
for all Android APK's
LOCAL_SDK_VERSION Or LOCAL_PRIVATE_PLATFORM_APIS
LOCAL_SDK_VERSION supports two values current and system_current.
"current" will compile APK code with SDK API's and system_current
will compile code with SDK + System API's
LOCAL_PRIVATE_PLATFORM_APIS will compile APK code with platform
API's, this option enables to use hidden platform API's in APK.
This flag cannot be defined for vendor APK's.
Change-Id: I0b43c2e79d22a02dfad089790214090ce2f53d99
| Makefile | apache-2.0 | Evervolv/android_external_ant-wireless_ant_service | makefile | ## Code Before:
ifneq ($(BOARD_ANT_WIRELESS_DEVICE),)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
#
# ANT java system service
#
LOCAL_SRC_FILES := \
$(call all-java-files-under, src) \
src/com/dsi/ant/server/IAntHal.aidl \
src/com/dsi/ant/server/IAntHalCallback.aidl
LOCAL_REQUIRED_MODULES := libantradio
LOCAL_PROGUARD_FLAG_FILES := proguard.flags
LOCAL_CERTIFICATE := platform
LOCAL_MODULE_TAGS := optional
LOCAL_PACKAGE_NAME := AntHalService
include $(BUILD_PACKAGE)
endif # BOARD_ANT_WIRELESS_DEVICE defined
## Instruction:
Define LOCAL_SDK_VERSION for ant_service module
For System SDK compliance either of two flags should be defined
for all Android APK's
LOCAL_SDK_VERSION Or LOCAL_PRIVATE_PLATFORM_APIS
LOCAL_SDK_VERSION supports two values current and system_current.
"current" will compile APK code with SDK API's and system_current
will compile code with SDK + System API's
LOCAL_PRIVATE_PLATFORM_APIS will compile APK code with platform
API's, this option enables to use hidden platform API's in APK.
This flag cannot be defined for vendor APK's.
Change-Id: I0b43c2e79d22a02dfad089790214090ce2f53d99
## Code After:
ifneq ($(BOARD_ANT_WIRELESS_DEVICE),)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
#
# ANT java system service
#
LOCAL_SRC_FILES := \
$(call all-java-files-under, src) \
src/com/dsi/ant/server/IAntHal.aidl \
src/com/dsi/ant/server/IAntHalCallback.aidl
LOCAL_REQUIRED_MODULES := libantradio
LOCAL_PROGUARD_FLAG_FILES := proguard.flags
LOCAL_CERTIFICATE := platform
LOCAL_MODULE_TAGS := optional
LOCAL_PACKAGE_NAME := AntHalService
ifeq ($(filter 8% O% o%,$(TARGET_PLATFORM_VERSION)),)
LOCAL_SDK_VERSION := system_current
endif
include $(BUILD_PACKAGE)
endif # BOARD_ANT_WIRELESS_DEVICE defined
|
ifneq ($(BOARD_ANT_WIRELESS_DEVICE),)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
#
# ANT java system service
#
LOCAL_SRC_FILES := \
$(call all-java-files-under, src) \
src/com/dsi/ant/server/IAntHal.aidl \
src/com/dsi/ant/server/IAntHalCallback.aidl
LOCAL_REQUIRED_MODULES := libantradio
LOCAL_PROGUARD_FLAG_FILES := proguard.flags
LOCAL_CERTIFICATE := platform
LOCAL_MODULE_TAGS := optional
LOCAL_PACKAGE_NAME := AntHalService
-
+ ifeq ($(filter 8% O% o%,$(TARGET_PLATFORM_VERSION)),)
+ LOCAL_SDK_VERSION := system_current
+ endif
include $(BUILD_PACKAGE)
endif # BOARD_ANT_WIRELESS_DEVICE defined | 4 | 0.173913 | 3 | 1 |
63e5c8dd0d385c3cc534ed4db49b62af31e67303 | app/assets/stylesheets/website/article_section.scss | app/assets/stylesheets/website/article_section.scss | @import "../shared/utils";
#content {
section.article_section {
padding-top: 1.5em;
h1 {
margin-left: 0;
margin-bottom: 0.5715em;
padding: 0 3%;
}
.row {
border-bottom: 1px solid #ddd;
margin-bottom: 1.5em;
padding: 0 1%;
&.last {
border-bottom: none;
margin-bottom: 0;
}
}
article {
margin-bottom: 1.5em;
h2.article_title {
@include type-16;
margin-bottom: 0.75em;
}
p.summary {
@include type-14;
margin-bottom: 0.75em;
}
span.metadata {
display: block;
@include type-12;
margin-bottom: 0;
color: #777;
}
}
article.last {
border-right: none;
}
}
p.readmore {
@include type-14;
margin-bottom: 0;
background: #fdfdfd;
border-bottom: 1px solid #d5d5d5;
border-top: 1px solid #ddd;
padding: 0.5em 1.5em 0.5em 1.5em;
}
.no_content {
p {
text-align: center;
}
}
} | @import "../shared/utils";
#content {
section.article_section {
padding-top: 1.5em;
h1 {
margin-left: 0;
padding: 0 3%;
}
.row {
border-bottom: 1px solid #ddd;
margin-bottom: 0.75em;
padding: 0 1%;
&.last {
border-bottom: none;
margin-bottom: 0;
}
}
article {
margin-bottom: 1.5em;
h2.article_title {
@include type-16;
margin-bottom: 0.75em;
}
p.summary {
@include type-14;
margin-bottom: 0.75em;
}
span.metadata {
display: block;
@include type-12;
margin-bottom: 0;
color: #777;
}
}
article.last {
border-right: none;
}
}
p.readmore {
@include type-14;
margin-bottom: 0;
background: #fdfdfd;
border-bottom: 1px solid #d5d5d5;
border-top: 1px solid #ddd;
padding: 0.5em 1.5em 0.5em 1.5em;
}
.no_content {
p {
text-align: center;
}
}
} | Increase margin below sub org section headers and reduce article bottom margin. | Increase margin below sub org section headers and reduce article bottom margin.
| SCSS | mit | askl56/whitehall,askl56/whitehall,robinwhittleton/whitehall,hotvulcan/whitehall,askl56/whitehall,hotvulcan/whitehall,robinwhittleton/whitehall,robinwhittleton/whitehall,robinwhittleton/whitehall,alphagov/whitehall,alphagov/whitehall,hotvulcan/whitehall,YOTOV-LIMITED/whitehall,alphagov/whitehall,YOTOV-LIMITED/whitehall,alphagov/whitehall,ggoral/whitehall,YOTOV-LIMITED/whitehall,ggoral/whitehall,ggoral/whitehall,YOTOV-LIMITED/whitehall,hotvulcan/whitehall,ggoral/whitehall,askl56/whitehall | scss | ## Code Before:
@import "../shared/utils";
#content {
section.article_section {
padding-top: 1.5em;
h1 {
margin-left: 0;
margin-bottom: 0.5715em;
padding: 0 3%;
}
.row {
border-bottom: 1px solid #ddd;
margin-bottom: 1.5em;
padding: 0 1%;
&.last {
border-bottom: none;
margin-bottom: 0;
}
}
article {
margin-bottom: 1.5em;
h2.article_title {
@include type-16;
margin-bottom: 0.75em;
}
p.summary {
@include type-14;
margin-bottom: 0.75em;
}
span.metadata {
display: block;
@include type-12;
margin-bottom: 0;
color: #777;
}
}
article.last {
border-right: none;
}
}
p.readmore {
@include type-14;
margin-bottom: 0;
background: #fdfdfd;
border-bottom: 1px solid #d5d5d5;
border-top: 1px solid #ddd;
padding: 0.5em 1.5em 0.5em 1.5em;
}
.no_content {
p {
text-align: center;
}
}
}
## Instruction:
Increase margin below sub org section headers and reduce article bottom margin.
## Code After:
@import "../shared/utils";
#content {
section.article_section {
padding-top: 1.5em;
h1 {
margin-left: 0;
padding: 0 3%;
}
.row {
border-bottom: 1px solid #ddd;
margin-bottom: 0.75em;
padding: 0 1%;
&.last {
border-bottom: none;
margin-bottom: 0;
}
}
article {
margin-bottom: 1.5em;
h2.article_title {
@include type-16;
margin-bottom: 0.75em;
}
p.summary {
@include type-14;
margin-bottom: 0.75em;
}
span.metadata {
display: block;
@include type-12;
margin-bottom: 0;
color: #777;
}
}
article.last {
border-right: none;
}
}
p.readmore {
@include type-14;
margin-bottom: 0;
background: #fdfdfd;
border-bottom: 1px solid #d5d5d5;
border-top: 1px solid #ddd;
padding: 0.5em 1.5em 0.5em 1.5em;
}
.no_content {
p {
text-align: center;
}
}
} | @import "../shared/utils";
#content {
section.article_section {
padding-top: 1.5em;
h1 {
margin-left: 0;
- margin-bottom: 0.5715em;
padding: 0 3%;
}
.row {
border-bottom: 1px solid #ddd;
- margin-bottom: 1.5em;
? ^
+ margin-bottom: 0.75em;
? ^ +
padding: 0 1%;
&.last {
border-bottom: none;
margin-bottom: 0;
}
}
article {
margin-bottom: 1.5em;
h2.article_title {
@include type-16;
margin-bottom: 0.75em;
}
p.summary {
@include type-14;
margin-bottom: 0.75em;
}
span.metadata {
display: block;
@include type-12;
margin-bottom: 0;
color: #777;
}
}
article.last {
border-right: none;
}
}
p.readmore {
@include type-14;
margin-bottom: 0;
background: #fdfdfd;
border-bottom: 1px solid #d5d5d5;
border-top: 1px solid #ddd;
padding: 0.5em 1.5em 0.5em 1.5em;
}
.no_content {
p {
text-align: center;
}
}
} | 3 | 0.046875 | 1 | 2 |
3a390833856fabbe4e4cc33ddb6ced31e214a72f | lib/jobim/settings.rb | lib/jobim/settings.rb | require 'yaml'
class Jobim::Settings
attr_reader :options
def initialize
load
end
def options
@options ||= {
:Daemonize => false,
:Dir => Dir.pwd,
:Host => '0.0.0.0',
:Port => 5634,
:Prefix => '/',
:Quiet => false
}
end
def load_file(file)
opts = YAML.load_file(file)
opts.keys.each do |key|
opts[(key.to_s.capitalize.to_sym rescue key) || key] = opts.delete(key)
end
if opts[:Dir]
unless Pathname.new(opts[:Dir]).absolute?
opts[:Dir] = File.expand_path("../#{opts[:Dir]}", file)
end
end
options.merge!(opts)
end
def load
dir = Pathname('.').realpath
files = []
loop do
file = File.expand_path('.jobim.yaml', dir)
files.unshift(file) if File.exists? file
break if dir.root?
dir = dir.parent
end
files.each {|file| self.load_file(file)}
options
end
end
| require 'yaml'
class Jobim::Settings
attr_reader :options
def initialize
load
end
def options
@options ||= {
:Daemonize => false,
:Dir => Dir.pwd,
:Host => '0.0.0.0',
:Port => 5634,
:Prefix => '/',
:Quiet => false
}
end
def load_file(file)
opts = YAML.load_file(file)
opts.keys.each do |key|
opts[(key.to_s.capitalize.to_sym rescue key) || key] = opts.delete(key)
end
if opts[:Dir]
unless Pathname.new(opts[:Dir]).absolute?
opts[:Dir] = File.expand_path("../#{opts[:Dir]}", file)
end
end
options.merge!(opts)
end
def load
dir = Pathname('.').realpath
files = []
loop do
file = File.expand_path('.jobim.yml', dir)
files.unshift(file) if File.exists? file
file = File.expand_path('.jobim.yaml', dir)
files.unshift(file) if File.exists? file
break if dir.root?
dir = dir.parent
end
files.each {|file| self.load_file(file)}
options
end
end
| Add support for config files with the "yml" extension ("yaml" still works) | Add support for config files with the "yml" extension ("yaml" still works)
| Ruby | mit | zellio/jobim | ruby | ## Code Before:
require 'yaml'
class Jobim::Settings
attr_reader :options
def initialize
load
end
def options
@options ||= {
:Daemonize => false,
:Dir => Dir.pwd,
:Host => '0.0.0.0',
:Port => 5634,
:Prefix => '/',
:Quiet => false
}
end
def load_file(file)
opts = YAML.load_file(file)
opts.keys.each do |key|
opts[(key.to_s.capitalize.to_sym rescue key) || key] = opts.delete(key)
end
if opts[:Dir]
unless Pathname.new(opts[:Dir]).absolute?
opts[:Dir] = File.expand_path("../#{opts[:Dir]}", file)
end
end
options.merge!(opts)
end
def load
dir = Pathname('.').realpath
files = []
loop do
file = File.expand_path('.jobim.yaml', dir)
files.unshift(file) if File.exists? file
break if dir.root?
dir = dir.parent
end
files.each {|file| self.load_file(file)}
options
end
end
## Instruction:
Add support for config files with the "yml" extension ("yaml" still works)
## Code After:
require 'yaml'
class Jobim::Settings
attr_reader :options
def initialize
load
end
def options
@options ||= {
:Daemonize => false,
:Dir => Dir.pwd,
:Host => '0.0.0.0',
:Port => 5634,
:Prefix => '/',
:Quiet => false
}
end
def load_file(file)
opts = YAML.load_file(file)
opts.keys.each do |key|
opts[(key.to_s.capitalize.to_sym rescue key) || key] = opts.delete(key)
end
if opts[:Dir]
unless Pathname.new(opts[:Dir]).absolute?
opts[:Dir] = File.expand_path("../#{opts[:Dir]}", file)
end
end
options.merge!(opts)
end
def load
dir = Pathname('.').realpath
files = []
loop do
file = File.expand_path('.jobim.yml', dir)
files.unshift(file) if File.exists? file
file = File.expand_path('.jobim.yaml', dir)
files.unshift(file) if File.exists? file
break if dir.root?
dir = dir.parent
end
files.each {|file| self.load_file(file)}
options
end
end
| require 'yaml'
class Jobim::Settings
attr_reader :options
def initialize
load
end
def options
@options ||= {
:Daemonize => false,
:Dir => Dir.pwd,
:Host => '0.0.0.0',
:Port => 5634,
:Prefix => '/',
:Quiet => false
}
end
def load_file(file)
opts = YAML.load_file(file)
opts.keys.each do |key|
opts[(key.to_s.capitalize.to_sym rescue key) || key] = opts.delete(key)
end
if opts[:Dir]
unless Pathname.new(opts[:Dir]).absolute?
opts[:Dir] = File.expand_path("../#{opts[:Dir]}", file)
end
end
options.merge!(opts)
end
def load
dir = Pathname('.').realpath
files = []
loop do
+ file = File.expand_path('.jobim.yml', dir)
+ files.unshift(file) if File.exists? file
+
file = File.expand_path('.jobim.yaml', dir)
-
files.unshift(file) if File.exists? file
break if dir.root?
dir = dir.parent
end
files.each {|file| self.load_file(file)}
options
end
end | 4 | 0.071429 | 3 | 1 |
026348035cb2a9cc885794f759f962d828c79c0b | barbench_test.go | barbench_test.go | package mpb
import (
"io/ioutil"
"testing"
)
func BenchmarkIncrSingleBar(b *testing.B) {
p := New(WithOutput(ioutil.Discard))
bar := p.AddBar(int64(b.N))
for i := 0; i < b.N; i++ {
bar.Increment()
}
}
func BenchmarkIncrSingleBarWhileIsNotCompleted(b *testing.B) {
p := New(WithOutput(ioutil.Discard))
bar := p.AddBar(int64(b.N))
for !bar.Completed() {
bar.Increment()
}
}
| package mpb
import (
"io/ioutil"
"testing"
"github.com/vbauerster/mpb/decor"
)
func BenchmarkIncrSingleBar(b *testing.B) {
p := New(WithOutput(ioutil.Discard))
bar := p.AddBar(int64(b.N))
for i := 0; i < b.N; i++ {
bar.Increment()
}
}
func BenchmarkIncrSingleBarWhileIsNotCompleted(b *testing.B) {
p := New(WithOutput(ioutil.Discard))
bar := p.AddBar(int64(b.N))
for !bar.Completed() {
bar.Increment()
}
}
func BenchmarkIncrSingleBarWithNameDecorator(b *testing.B) {
p := New(WithOutput(ioutil.Discard))
bar := p.AddBar(int64(b.N), PrependDecorators(decor.Name("test")))
for i := 0; i < b.N; i++ {
bar.Increment()
}
}
| Add bench with name decorator | Add bench with name decorator
| Go | unlicense | vbauerster/mpb,vbauerster/mpb | go | ## Code Before:
package mpb
import (
"io/ioutil"
"testing"
)
func BenchmarkIncrSingleBar(b *testing.B) {
p := New(WithOutput(ioutil.Discard))
bar := p.AddBar(int64(b.N))
for i := 0; i < b.N; i++ {
bar.Increment()
}
}
func BenchmarkIncrSingleBarWhileIsNotCompleted(b *testing.B) {
p := New(WithOutput(ioutil.Discard))
bar := p.AddBar(int64(b.N))
for !bar.Completed() {
bar.Increment()
}
}
## Instruction:
Add bench with name decorator
## Code After:
package mpb
import (
"io/ioutil"
"testing"
"github.com/vbauerster/mpb/decor"
)
func BenchmarkIncrSingleBar(b *testing.B) {
p := New(WithOutput(ioutil.Discard))
bar := p.AddBar(int64(b.N))
for i := 0; i < b.N; i++ {
bar.Increment()
}
}
func BenchmarkIncrSingleBarWhileIsNotCompleted(b *testing.B) {
p := New(WithOutput(ioutil.Discard))
bar := p.AddBar(int64(b.N))
for !bar.Completed() {
bar.Increment()
}
}
func BenchmarkIncrSingleBarWithNameDecorator(b *testing.B) {
p := New(WithOutput(ioutil.Discard))
bar := p.AddBar(int64(b.N), PrependDecorators(decor.Name("test")))
for i := 0; i < b.N; i++ {
bar.Increment()
}
}
| package mpb
import (
"io/ioutil"
"testing"
+
+ "github.com/vbauerster/mpb/decor"
)
func BenchmarkIncrSingleBar(b *testing.B) {
p := New(WithOutput(ioutil.Discard))
bar := p.AddBar(int64(b.N))
for i := 0; i < b.N; i++ {
bar.Increment()
}
}
func BenchmarkIncrSingleBarWhileIsNotCompleted(b *testing.B) {
p := New(WithOutput(ioutil.Discard))
bar := p.AddBar(int64(b.N))
for !bar.Completed() {
bar.Increment()
}
}
+
+ func BenchmarkIncrSingleBarWithNameDecorator(b *testing.B) {
+ p := New(WithOutput(ioutil.Discard))
+ bar := p.AddBar(int64(b.N), PrependDecorators(decor.Name("test")))
+ for i := 0; i < b.N; i++ {
+ bar.Increment()
+ }
+ } | 10 | 0.454545 | 10 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.