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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
10d00b9e734714bc2a906842c42ebdf49a7c6293 | .travis.yml | .travis.yml | language: node_js
node_js:
- "4.2"
- "4.1"
- "4.0"
- "0.12"
install: npm install
before_script:
- rvm implode --force
- sudo rm ~/.rvmrc
- sudo apt-get -y purge ruby
- gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
- \curl -sSL https://get.rvm.io | bash -s stable --ruby
- source /home/travis/.rvm/scripts/rvm
- rvm reload
- rvm rubygems current
- gem update
- ruby --version
- gem install pygments.rb --no-rdoc --no-ri
- gem install jekyll --no-rdoc --no-ri --pre
- jekyll --version
- node_modules/.bin/grunt --version
- node_modules/.bin/bower --version
- node_modules/.bin/bower install --config.interactive=false
- node_modules/.bin/grunt build
- node_modules/.bin/grunt docs-build
- node_modules/.bin/grunt dist
- node_modules/.bin/grunt docs-dist
script: echo "Done!"
| language: node_js
node_js:
- "4.2"
- "4.1"
- "4.0"
install: npm install
before_script:
- rvm implode --force
- sudo rm ~/.rvmrc
- sudo apt-get -y purge ruby
- gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
- \curl -sSL https://get.rvm.io | bash -s stable --ruby
- source /home/travis/.rvm/scripts/rvm
- rvm reload
- rvm rubygems current
- gem update
- ruby --version
- gem install pygments.rb --no-rdoc --no-ri
- gem install jekyll --no-rdoc --no-ri --pre
- jekyll --version
- node_modules/.bin/grunt --version
- node_modules/.bin/bower --version
- node_modules/.bin/bower install --config.interactive=false
- node_modules/.bin/grunt build
- node_modules/.bin/grunt docs-build
- node_modules/.bin/grunt dist
- node_modules/.bin/grunt docs-dist
script: echo "Done!"
| Remove NodeJS `v0.12` from build envs | Remove NodeJS `v0.12` from build envs
NodeJS `v0.12`, despite being an LTS version, lags behind the newer releases, and its userbase is thinning in favour of newer Node versions.
Since most of the dependencies in this project rely on Node `v4.x.` to work reliably, `v0.12` is now considereded obsolete.
| YAML | apache-2.0 | wfp/ui,wfp/ui,wfp/ui | yaml | ## Code Before:
language: node_js
node_js:
- "4.2"
- "4.1"
- "4.0"
- "0.12"
install: npm install
before_script:
- rvm implode --force
- sudo rm ~/.rvmrc
- sudo apt-get -y purge ruby
- gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
- \curl -sSL https://get.rvm.io | bash -s stable --ruby
- source /home/travis/.rvm/scripts/rvm
- rvm reload
- rvm rubygems current
- gem update
- ruby --version
- gem install pygments.rb --no-rdoc --no-ri
- gem install jekyll --no-rdoc --no-ri --pre
- jekyll --version
- node_modules/.bin/grunt --version
- node_modules/.bin/bower --version
- node_modules/.bin/bower install --config.interactive=false
- node_modules/.bin/grunt build
- node_modules/.bin/grunt docs-build
- node_modules/.bin/grunt dist
- node_modules/.bin/grunt docs-dist
script: echo "Done!"
## Instruction:
Remove NodeJS `v0.12` from build envs
NodeJS `v0.12`, despite being an LTS version, lags behind the newer releases, and its userbase is thinning in favour of newer Node versions.
Since most of the dependencies in this project rely on Node `v4.x.` to work reliably, `v0.12` is now considereded obsolete.
## Code After:
language: node_js
node_js:
- "4.2"
- "4.1"
- "4.0"
install: npm install
before_script:
- rvm implode --force
- sudo rm ~/.rvmrc
- sudo apt-get -y purge ruby
- gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
- \curl -sSL https://get.rvm.io | bash -s stable --ruby
- source /home/travis/.rvm/scripts/rvm
- rvm reload
- rvm rubygems current
- gem update
- ruby --version
- gem install pygments.rb --no-rdoc --no-ri
- gem install jekyll --no-rdoc --no-ri --pre
- jekyll --version
- node_modules/.bin/grunt --version
- node_modules/.bin/bower --version
- node_modules/.bin/bower install --config.interactive=false
- node_modules/.bin/grunt build
- node_modules/.bin/grunt docs-build
- node_modules/.bin/grunt dist
- node_modules/.bin/grunt docs-dist
script: echo "Done!"
| language: node_js
node_js:
- "4.2"
- "4.1"
- "4.0"
- - "0.12"
install: npm install
before_script:
- rvm implode --force
- sudo rm ~/.rvmrc
- sudo apt-get -y purge ruby
- gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
- \curl -sSL https://get.rvm.io | bash -s stable --ruby
- source /home/travis/.rvm/scripts/rvm
- rvm reload
- rvm rubygems current
- gem update
- ruby --version
- gem install pygments.rb --no-rdoc --no-ri
- gem install jekyll --no-rdoc --no-ri --pre
- jekyll --version
- node_modules/.bin/grunt --version
- node_modules/.bin/bower --version
- node_modules/.bin/bower install --config.interactive=false
- node_modules/.bin/grunt build
- node_modules/.bin/grunt docs-build
- node_modules/.bin/grunt dist
- node_modules/.bin/grunt docs-dist
script: echo "Done!" | 1 | 0.034483 | 0 | 1 |
07dd5eff0b7e24be0a55a2a3df2e8db1f60e361b | zkfacade/src/main/java/com/yahoo/vespa/curator/package-info.java | zkfacade/src/main/java/com/yahoo/vespa/curator/package-info.java | // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
@ExportPackage
@PublicApi // TODO: Revoke this on Vespa 8.
package com.yahoo.vespa.curator;
import com.yahoo.api.annotations.PublicApi;
import com.yahoo.osgi.annotation.ExportPackage;
| // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
@ExportPackage
package com.yahoo.vespa.curator;
import com.yahoo.osgi.annotation.ExportPackage;
| Revoke package c.y.vespa.curator from PublicApi | Revoke package c.y.vespa.curator from PublicApi
- Probably just used internally.
| Java | apache-2.0 | vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa | java | ## Code Before:
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
@ExportPackage
@PublicApi // TODO: Revoke this on Vespa 8.
package com.yahoo.vespa.curator;
import com.yahoo.api.annotations.PublicApi;
import com.yahoo.osgi.annotation.ExportPackage;
## Instruction:
Revoke package c.y.vespa.curator from PublicApi
- Probably just used internally.
## Code After:
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
@ExportPackage
package com.yahoo.vespa.curator;
import com.yahoo.osgi.annotation.ExportPackage;
| // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
@ExportPackage
- @PublicApi // TODO: Revoke this on Vespa 8.
package com.yahoo.vespa.curator;
- import com.yahoo.api.annotations.PublicApi;
import com.yahoo.osgi.annotation.ExportPackage; | 2 | 0.333333 | 0 | 2 |
0bf58503750773c3c39d46fe7405f1103c7c5e37 | setup.py | setup.py | import os
import re
from setuptools import (
find_packages,
setup,
)
version_re = re.compile(r"__version__\s*=\s*['\"](.*?)['\"]")
def get_version():
base = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(base, 'curator/__init__.py')) as initf:
for line in initf:
m = version_re.match(line.strip())
if not m:
continue
return m.groups()[0]
setup(
name='redis-lua-curator',
version=get_version(),
description='Helper for working with lua scripts.',
packages=find_packages(),
author='Michael Hahn',
author_email='mwhahn@gmail.com',
url='https://github.com/mhahn/curator/',
download_url='https://github.com/mhahn/curator/tarball/%s' % (
get_version(),
),
setup_requires=[
'nose>=1.0',
'coverage>=1.0',
'mock==1.0.1',
'unittest2==0.5.1',
],
install_requires=[
'redis==2.10.1',
'jinja2==2.7.2',
],
keywords=['redis', 'lua'],
)
| import os
import re
from setuptools import (
find_packages,
setup,
)
version_re = re.compile(r"__version__\s*=\s*['\"](.*?)['\"]")
def get_version():
base = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(base, 'curator/__init__.py')) as initf:
for line in initf:
m = version_re.match(line.strip())
if not m:
continue
return m.groups()[0]
setup(
name='redis-lua-curator',
version=get_version(),
description='Helper for working with lua scripts.',
packages=find_packages(exclude=['tests']),
author='Michael Hahn',
author_email='mwhahn@gmail.com',
url='https://github.com/mhahn/curator/',
download_url='https://github.com/mhahn/curator/tarball/%s' % (
get_version(),
),
setup_requires=[
'nose>=1.0',
'coverage>=1.0',
'mock==1.0.1',
'unittest2==0.5.1',
],
install_requires=[
'redis==2.10.1',
'jinja2==2.7.2',
],
keywords=['redis', 'lua'],
)
| Exclude tests from getting installed | Exclude tests from getting installed
| Python | mit | eventbrite/curator | python | ## Code Before:
import os
import re
from setuptools import (
find_packages,
setup,
)
version_re = re.compile(r"__version__\s*=\s*['\"](.*?)['\"]")
def get_version():
base = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(base, 'curator/__init__.py')) as initf:
for line in initf:
m = version_re.match(line.strip())
if not m:
continue
return m.groups()[0]
setup(
name='redis-lua-curator',
version=get_version(),
description='Helper for working with lua scripts.',
packages=find_packages(),
author='Michael Hahn',
author_email='mwhahn@gmail.com',
url='https://github.com/mhahn/curator/',
download_url='https://github.com/mhahn/curator/tarball/%s' % (
get_version(),
),
setup_requires=[
'nose>=1.0',
'coverage>=1.0',
'mock==1.0.1',
'unittest2==0.5.1',
],
install_requires=[
'redis==2.10.1',
'jinja2==2.7.2',
],
keywords=['redis', 'lua'],
)
## Instruction:
Exclude tests from getting installed
## Code After:
import os
import re
from setuptools import (
find_packages,
setup,
)
version_re = re.compile(r"__version__\s*=\s*['\"](.*?)['\"]")
def get_version():
base = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(base, 'curator/__init__.py')) as initf:
for line in initf:
m = version_re.match(line.strip())
if not m:
continue
return m.groups()[0]
setup(
name='redis-lua-curator',
version=get_version(),
description='Helper for working with lua scripts.',
packages=find_packages(exclude=['tests']),
author='Michael Hahn',
author_email='mwhahn@gmail.com',
url='https://github.com/mhahn/curator/',
download_url='https://github.com/mhahn/curator/tarball/%s' % (
get_version(),
),
setup_requires=[
'nose>=1.0',
'coverage>=1.0',
'mock==1.0.1',
'unittest2==0.5.1',
],
install_requires=[
'redis==2.10.1',
'jinja2==2.7.2',
],
keywords=['redis', 'lua'],
)
| import os
import re
from setuptools import (
find_packages,
setup,
)
version_re = re.compile(r"__version__\s*=\s*['\"](.*?)['\"]")
def get_version():
base = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(base, 'curator/__init__.py')) as initf:
for line in initf:
m = version_re.match(line.strip())
if not m:
continue
return m.groups()[0]
setup(
name='redis-lua-curator',
version=get_version(),
description='Helper for working with lua scripts.',
- packages=find_packages(),
+ packages=find_packages(exclude=['tests']),
? +++++++++++++++++
author='Michael Hahn',
author_email='mwhahn@gmail.com',
url='https://github.com/mhahn/curator/',
download_url='https://github.com/mhahn/curator/tarball/%s' % (
get_version(),
),
setup_requires=[
'nose>=1.0',
'coverage>=1.0',
'mock==1.0.1',
'unittest2==0.5.1',
],
install_requires=[
'redis==2.10.1',
'jinja2==2.7.2',
],
keywords=['redis', 'lua'],
) | 2 | 0.046512 | 1 | 1 |
b38f6995f1d51144bd08c98ee75aee090a3e9ab3 | src/react/src/routes/SprkDividerDocs/SprkDividerDocs.js | src/react/src/routes/SprkDividerDocs/SprkDividerDocs.js | import React from 'react';
import CentralColumnLayout from '../../containers/CentralColumnLayout/CentralColumnLayout';
import { SprkDivider } from '@sparkdesignsystem/spark-core-react';
const SprkDividerDocs = () => {
return (
<CentralColumnLayout>
<div className="sprk-u-mbm">
<h2 className="drizzle-b-h2">Divider as span</h2>
<SprkDivider idString="divider-1" element="span"></SprkDivider>
</div>
<div className="sprk-u-mbm">
<h2 className="drizzle-b-h2">Divider as hr</h2>
<SprkDivider idString="divider-1" element="hr"></SprkDivider>
</div>
</CentralColumnLayout>
)
}
export default SprkDividerDocs; | import React from 'react';
import CentralColumnLayout from '../../containers/CentralColumnLayout/CentralColumnLayout';
import { SprkDivider } from '@sparkdesignsystem/spark-core-react';
import ExampleContainer from '../../containers/ExampleContainer/ExampleContainer';
const SprkDividerDocs = () => {
return (
<CentralColumnLayout>
<ExampleContainer>
<h2 className="drizzle-b-h2">Divider as span</h2>
<SprkDivider idString="divider-1" element="span"></SprkDivider>
</ExampleContainer>
<ExampleContainer>
<h2 className="drizzle-b-h2">Divider as hr</h2>
<SprkDivider idString="divider-1" element="hr"></SprkDivider>
</ExampleContainer>
</CentralColumnLayout>
)
}
export default SprkDividerDocs; | Update divs to ExampleContainer component | Update divs to ExampleContainer component
| JavaScript | mit | sparkdesignsystem/spark-design-system,sparkdesignsystem/spark-design-system,sparkdesignsystem/spark-design-system,sparkdesignsystem/spark-design-system | javascript | ## Code Before:
import React from 'react';
import CentralColumnLayout from '../../containers/CentralColumnLayout/CentralColumnLayout';
import { SprkDivider } from '@sparkdesignsystem/spark-core-react';
const SprkDividerDocs = () => {
return (
<CentralColumnLayout>
<div className="sprk-u-mbm">
<h2 className="drizzle-b-h2">Divider as span</h2>
<SprkDivider idString="divider-1" element="span"></SprkDivider>
</div>
<div className="sprk-u-mbm">
<h2 className="drizzle-b-h2">Divider as hr</h2>
<SprkDivider idString="divider-1" element="hr"></SprkDivider>
</div>
</CentralColumnLayout>
)
}
export default SprkDividerDocs;
## Instruction:
Update divs to ExampleContainer component
## Code After:
import React from 'react';
import CentralColumnLayout from '../../containers/CentralColumnLayout/CentralColumnLayout';
import { SprkDivider } from '@sparkdesignsystem/spark-core-react';
import ExampleContainer from '../../containers/ExampleContainer/ExampleContainer';
const SprkDividerDocs = () => {
return (
<CentralColumnLayout>
<ExampleContainer>
<h2 className="drizzle-b-h2">Divider as span</h2>
<SprkDivider idString="divider-1" element="span"></SprkDivider>
</ExampleContainer>
<ExampleContainer>
<h2 className="drizzle-b-h2">Divider as hr</h2>
<SprkDivider idString="divider-1" element="hr"></SprkDivider>
</ExampleContainer>
</CentralColumnLayout>
)
}
export default SprkDividerDocs; | import React from 'react';
import CentralColumnLayout from '../../containers/CentralColumnLayout/CentralColumnLayout';
import { SprkDivider } from '@sparkdesignsystem/spark-core-react';
+ import ExampleContainer from '../../containers/ExampleContainer/ExampleContainer';
const SprkDividerDocs = () => {
return (
<CentralColumnLayout>
- <div className="sprk-u-mbm">
+ <ExampleContainer>
<h2 className="drizzle-b-h2">Divider as span</h2>
<SprkDivider idString="divider-1" element="span"></SprkDivider>
- </div>
+ </ExampleContainer>
- <div className="sprk-u-mbm">
+ <ExampleContainer>
<h2 className="drizzle-b-h2">Divider as hr</h2>
<SprkDivider idString="divider-1" element="hr"></SprkDivider>
- </div>
+ </ExampleContainer>
</CentralColumnLayout>
)
}
export default SprkDividerDocs; | 9 | 0.409091 | 5 | 4 |
2c3f63b6cc372fac32cc0a917100d381f82743be | ui/js/dashboard/nco.js | ui/js/dashboard/nco.js | 'use strict';
module.exports = {
template: require('./nco.html'),
data: function () {
return {
region : 12907,
campaign: true, // Trick with-indicator into loading without a campaign
overview: [{
title : 'Influencer',
indicators: [164,165,166,167],
chart : 'chart-bar'
}, {
title : 'Information Source',
indicators: [164,165,166,167],
chart : 'chart-bar'
}, {
title : 'Reasons for Missed',
indicators: [164,165,166,167],
chart : 'chart-bar'
}, {
title : 'Reasons for Absence',
indicators: [164,165,166,167],
chart : 'chart-bar'
}, {
title : 'Reasons for NC',
indicators: [164,165,166,167],
chart : 'chart-bar'
}, {
title : 'NC Resolved by',
indicators: [164,165,166,167],
chart : 'chart-bar'
}]
};
},
components: {
}
};
| 'use strict';
module.exports = {
template: require('./nco.html'),
data: function () {
return {
region : null,
campaign: null,
overview: [{
title : 'Influencer',
indicators: [164,165,166,167],
chart : 'chart-bar'
}, {
title : 'Information Source',
indicators: [164,165,166,167],
chart : 'chart-bar'
}, {
title : 'Reasons for Missed',
indicators: [164,165,166,167],
chart : 'chart-bar'
}, {
title : 'Reasons for Absence',
indicators: [164,165,166,167],
chart : 'chart-bar'
}, {
title : 'Reasons for NC',
indicators: [164,165,166,167],
chart : 'chart-bar'
}, {
title : 'NC Resolved by',
indicators: [164,165,166,167],
chart : 'chart-bar'
}]
};
},
components: {
}
};
| Set campaign and region to null by default | Set campaign and region to null by default
Campaign and region are getting passed down by the dashboard view
from the dropdowns, so there is no need to provide defaults in the
NCO dashboard component.
| JavaScript | agpl-3.0 | unicef/polio,unicef/polio,unicef/polio,unicef/polio,unicef/rhizome,SeedScientific/polio,unicef/rhizome,unicef/rhizome,SeedScientific/polio,SeedScientific/polio,SeedScientific/polio,SeedScientific/polio,unicef/rhizome | javascript | ## Code Before:
'use strict';
module.exports = {
template: require('./nco.html'),
data: function () {
return {
region : 12907,
campaign: true, // Trick with-indicator into loading without a campaign
overview: [{
title : 'Influencer',
indicators: [164,165,166,167],
chart : 'chart-bar'
}, {
title : 'Information Source',
indicators: [164,165,166,167],
chart : 'chart-bar'
}, {
title : 'Reasons for Missed',
indicators: [164,165,166,167],
chart : 'chart-bar'
}, {
title : 'Reasons for Absence',
indicators: [164,165,166,167],
chart : 'chart-bar'
}, {
title : 'Reasons for NC',
indicators: [164,165,166,167],
chart : 'chart-bar'
}, {
title : 'NC Resolved by',
indicators: [164,165,166,167],
chart : 'chart-bar'
}]
};
},
components: {
}
};
## Instruction:
Set campaign and region to null by default
Campaign and region are getting passed down by the dashboard view
from the dropdowns, so there is no need to provide defaults in the
NCO dashboard component.
## Code After:
'use strict';
module.exports = {
template: require('./nco.html'),
data: function () {
return {
region : null,
campaign: null,
overview: [{
title : 'Influencer',
indicators: [164,165,166,167],
chart : 'chart-bar'
}, {
title : 'Information Source',
indicators: [164,165,166,167],
chart : 'chart-bar'
}, {
title : 'Reasons for Missed',
indicators: [164,165,166,167],
chart : 'chart-bar'
}, {
title : 'Reasons for Absence',
indicators: [164,165,166,167],
chart : 'chart-bar'
}, {
title : 'Reasons for NC',
indicators: [164,165,166,167],
chart : 'chart-bar'
}, {
title : 'NC Resolved by',
indicators: [164,165,166,167],
chart : 'chart-bar'
}]
};
},
components: {
}
};
| 'use strict';
module.exports = {
template: require('./nco.html'),
data: function () {
return {
- region : 12907,
? ^^^^^
+ region : null,
? ^^^^
- campaign: true, // Trick with-indicator into loading without a campaign
+ campaign: null,
overview: [{
title : 'Influencer',
indicators: [164,165,166,167],
chart : 'chart-bar'
}, {
title : 'Information Source',
indicators: [164,165,166,167],
chart : 'chart-bar'
}, {
title : 'Reasons for Missed',
indicators: [164,165,166,167],
chart : 'chart-bar'
}, {
title : 'Reasons for Absence',
indicators: [164,165,166,167],
chart : 'chart-bar'
}, {
title : 'Reasons for NC',
indicators: [164,165,166,167],
chart : 'chart-bar'
}, {
title : 'NC Resolved by',
indicators: [164,165,166,167],
chart : 'chart-bar'
}]
};
},
components: {
}
}; | 4 | 0.095238 | 2 | 2 |
3fe65512aad9a257b391c9acdd7b09cf6df73053 | tests/Event/AbstractEventTest.php | tests/Event/AbstractEventTest.php | <?php
namespace WyriHaximus\Ratchet\Tests\Event;
abstract class AbstractEventTest extends \PHPUnit_Framework_TestCase
{
public function testEventConst()
{
$fqcn = static::FQCN;
$this->assertInternalType('string', $fqcn::EVENT);
$this->assertTrue(strlen($fqcn::EVENT) > 0);
}
}
| <?php
namespace WyriHaximus\Ratchet\Tests\Event;
abstract class AbstractEventTest extends \PHPUnit_Framework_TestCase
{
public function testEventConst()
{
$fqcn = static::FQCN;
$this->assertInternalType('string', $fqcn::EVENT);
$this->assertTrue(strlen($fqcn::EVENT) > 0);
}
public function testExtendsEvent()
{
$this->assertSame('Cake\Event\Event', (new \ReflectionClass(static::FQCN))->getParentClass()->getName());
}
}
| Make sure all events extend Event | Make sure all events extend Event
| PHP | mit | WyriHaximus/Ratchet,WyriHaximus/Ratchet,WyriHaximus/Ratchet | php | ## Code Before:
<?php
namespace WyriHaximus\Ratchet\Tests\Event;
abstract class AbstractEventTest extends \PHPUnit_Framework_TestCase
{
public function testEventConst()
{
$fqcn = static::FQCN;
$this->assertInternalType('string', $fqcn::EVENT);
$this->assertTrue(strlen($fqcn::EVENT) > 0);
}
}
## Instruction:
Make sure all events extend Event
## Code After:
<?php
namespace WyriHaximus\Ratchet\Tests\Event;
abstract class AbstractEventTest extends \PHPUnit_Framework_TestCase
{
public function testEventConst()
{
$fqcn = static::FQCN;
$this->assertInternalType('string', $fqcn::EVENT);
$this->assertTrue(strlen($fqcn::EVENT) > 0);
}
public function testExtendsEvent()
{
$this->assertSame('Cake\Event\Event', (new \ReflectionClass(static::FQCN))->getParentClass()->getName());
}
}
| <?php
namespace WyriHaximus\Ratchet\Tests\Event;
abstract class AbstractEventTest extends \PHPUnit_Framework_TestCase
{
public function testEventConst()
{
$fqcn = static::FQCN;
$this->assertInternalType('string', $fqcn::EVENT);
$this->assertTrue(strlen($fqcn::EVENT) > 0);
}
+
+ public function testExtendsEvent()
+ {
+ $this->assertSame('Cake\Event\Event', (new \ReflectionClass(static::FQCN))->getParentClass()->getName());
+ }
} | 5 | 0.384615 | 5 | 0 |
5654ae73dd4b49402ce15ac4002ed2d18c1f2650 | metadata/com.majeur.applicationsinfo.txt | metadata/com.majeur.applicationsinfo.txt | Categories:Office,System
License:Apache2
Web Site:https://github.com/MajeurAndroid/Applications-Info/blob/HEAD/README.md
Source Code:https://github.com/MajeurAndroid/Applications-Info
Issue Tracker:https://github.com/MajeurAndroid/Applications-Info/issues
Auto Name:Applications Info
Summary:Show metadata of installed applications
Description:
Monitor all available informations about all installed applications
or packages on a device. You can view the entire AndroidManifest.xml
file and get details about:
* Activities
* Services
* Providers
* Receivers
* Uses permissions
* Permissions
* Uses features
* Configurations
* Signatures
.
Repo Type:git
Repo:https://github.com/MajeurAndroid/Applications-Info
Build:1.2,3
commit=d3733bae0f23ac758b5ef1dcfd8c8c3ab1aca7ca
subdir=app
gradle=yes
Auto Update Mode:None
Update Check Mode:RepoManifest
Current Version:1.3
Current Version Code:4
| Categories:Office,System
License:Apache2
Web Site:https://github.com/MajeurAndroid/Applications-Info/blob/HEAD/README.md
Source Code:https://github.com/MajeurAndroid/Applications-Info
Issue Tracker:https://github.com/MajeurAndroid/Applications-Info/issues
Auto Name:Applications Info
Summary:Show metadata of installed applications
Description:
Monitor all available informations about all installed applications
or packages on a device. You can view the entire AndroidManifest.xml
file and get details about:
* Activities
* Services
* Providers
* Receivers
* Uses permissions
* Permissions
* Uses features
* Configurations
* Signatures
.
Repo Type:git
Repo:https://github.com/MajeurAndroid/Applications-Info
Build:1.2,3
commit=d3733bae0f23ac758b5ef1dcfd8c8c3ab1aca7ca
subdir=app
gradle=yes
Build:1.3,4
commit=0e0f44389a197d780828ac6123685b1708e3eb9c
subdir=app
gradle=yes
Auto Update Mode:None
Update Check Mode:RepoManifest
Current Version:1.3
Current Version Code:4
| Update Applications Info to 1.3 (4) | Update Applications Info to 1.3 (4)
| Text | agpl-3.0 | f-droid/fdroiddata,f-droid/fdroid-data,f-droid/fdroiddata | text | ## Code Before:
Categories:Office,System
License:Apache2
Web Site:https://github.com/MajeurAndroid/Applications-Info/blob/HEAD/README.md
Source Code:https://github.com/MajeurAndroid/Applications-Info
Issue Tracker:https://github.com/MajeurAndroid/Applications-Info/issues
Auto Name:Applications Info
Summary:Show metadata of installed applications
Description:
Monitor all available informations about all installed applications
or packages on a device. You can view the entire AndroidManifest.xml
file and get details about:
* Activities
* Services
* Providers
* Receivers
* Uses permissions
* Permissions
* Uses features
* Configurations
* Signatures
.
Repo Type:git
Repo:https://github.com/MajeurAndroid/Applications-Info
Build:1.2,3
commit=d3733bae0f23ac758b5ef1dcfd8c8c3ab1aca7ca
subdir=app
gradle=yes
Auto Update Mode:None
Update Check Mode:RepoManifest
Current Version:1.3
Current Version Code:4
## Instruction:
Update Applications Info to 1.3 (4)
## Code After:
Categories:Office,System
License:Apache2
Web Site:https://github.com/MajeurAndroid/Applications-Info/blob/HEAD/README.md
Source Code:https://github.com/MajeurAndroid/Applications-Info
Issue Tracker:https://github.com/MajeurAndroid/Applications-Info/issues
Auto Name:Applications Info
Summary:Show metadata of installed applications
Description:
Monitor all available informations about all installed applications
or packages on a device. You can view the entire AndroidManifest.xml
file and get details about:
* Activities
* Services
* Providers
* Receivers
* Uses permissions
* Permissions
* Uses features
* Configurations
* Signatures
.
Repo Type:git
Repo:https://github.com/MajeurAndroid/Applications-Info
Build:1.2,3
commit=d3733bae0f23ac758b5ef1dcfd8c8c3ab1aca7ca
subdir=app
gradle=yes
Build:1.3,4
commit=0e0f44389a197d780828ac6123685b1708e3eb9c
subdir=app
gradle=yes
Auto Update Mode:None
Update Check Mode:RepoManifest
Current Version:1.3
Current Version Code:4
| Categories:Office,System
License:Apache2
Web Site:https://github.com/MajeurAndroid/Applications-Info/blob/HEAD/README.md
Source Code:https://github.com/MajeurAndroid/Applications-Info
Issue Tracker:https://github.com/MajeurAndroid/Applications-Info/issues
Auto Name:Applications Info
Summary:Show metadata of installed applications
Description:
Monitor all available informations about all installed applications
or packages on a device. You can view the entire AndroidManifest.xml
file and get details about:
* Activities
* Services
* Providers
* Receivers
* Uses permissions
* Permissions
* Uses features
* Configurations
* Signatures
.
Repo Type:git
Repo:https://github.com/MajeurAndroid/Applications-Info
Build:1.2,3
commit=d3733bae0f23ac758b5ef1dcfd8c8c3ab1aca7ca
subdir=app
gradle=yes
+ Build:1.3,4
+ commit=0e0f44389a197d780828ac6123685b1708e3eb9c
+ subdir=app
+ gradle=yes
+
Auto Update Mode:None
Update Check Mode:RepoManifest
Current Version:1.3
Current Version Code:4
| 5 | 0.135135 | 5 | 0 |
135dd57106dd2f3be2e7bef0e721296613e7b5c8 | layouts/blog-index.hbs | layouts/blog-index.hbs | <!DOCTYPE html>
<html lang="{{site.locale}}">
{{> html-head }}
<body>
{{> header active="blog" }}
<main>
<div class="container">
<ul>
{{#each collections.blog}}
{{#if title}}
<li>
<a href="../{{ path }}">{{ title }}</a>
</li>
{{/if}}
{{/each}}
</ul>
</div>
</main>
{{> footer }}
</body>
</html>
| <!DOCTYPE html>
<html lang="{{site.locale}}">
{{> html-head }}
<body>
{{> header active="blog" }}
<main>
<div class="container">
<ul>
{{#each collections.blog}}
{{#if title}}
<li>
<a href="/{{../../site.locale}}/{{ path }}">{{ title }}</a>
</li>
{{/if}}
{{/each}}
</ul>
</div>
</main>
{{> footer }}
</body>
</html>
| Use absolute paths for blog posts | Use absolute paths for blog posts
| Handlebars | mit | targos/new.nodejs.org,a0viedo/new.nodejs.org,cgvarela/new.nodejs.org,windhamdavid/new.nodejs.org,tjconcept/new.nodejs.org,matthewloring/new.nodejs.org,Delapouite/new.nodejs.org,stojanovic/new.nodejs.org,vaniaul/new.nodejs.org,yosuke-furukawa/new.nodejs.org,evanlucas/new.nodejs.org,iancrowther/new.nodejs.org,nodejs/new.nodejs.org,MassimilianoMura/new.nodejs.org,bogas04/new.nodejs.org,MassimilianoMura/new.nodejs.org,SomeoneWeird/new.nodejs.org,narqo/new.nodejs.org,fabiosantoscode/new.nodejs.org,yous/new.nodejs.org,andygout/new.nodejs.org,phillipj/new.nodejs.org,ChALkeR/new.nodejs.org,nodecode/new.nodejs.org,Delapouite/new.nodejs.org,sonewman/new.nodejs.org,elinnet/new.nodejs.org,JungMinu/new.nodejs.org,xicombd/new.nodejs.org,SomeoneWeird/new.nodejs.org,wonderdogone/new.nodejs.org,marocchino/new.nodejs.org,targos/new.nodejs.org,a0viedo/new.nodejs.org,fabiosantoscode/new.nodejs.org,sonewman/new.nodejs.org,iancrowther/new.nodejs.org,windhamdavid/new.nodejs.org,yous/new.nodejs.org,andygout/new.nodejs.org,simonmcmanus/new.nodejs.org,narqo/new.nodejs.org,ChALkeR/new.nodejs.org,vaniaul/new.nodejs.org,xicombd/new.nodejs.org,phillipj/new.nodejs.org,tjconcept/new.nodejs.org,JungMinu/new.nodejs.org,stevemao/new.nodejs.org,thefourtheye/new.nodejs.org,strawbrary/nodejs.org,stevemao/new.nodejs.org,rnsloan/new.nodejs.org,elinnet/new.nodejs.org,bogas04/new.nodejs.org,boneskull/new.nodejs.org,rnsloan/new.nodejs.org,simonmcmanus/new.nodejs.org,abdelrahmansaeedhassan/yuri,nodejs/new.nodejs.org,cgvarela/new.nodejs.org,brycebaril/new.nodejs.org,thefourtheye/new.nodejs.org,nodecode/new.nodejs.org,Gornstats/new.nodejs.org,strawbrary/nodejs.org,matthewloring/new.nodejs.org,evanlucas/new.nodejs.org,marocchino/new.nodejs.org,boneskull/new.nodejs.org,yosuke-furukawa/new.nodejs.org,Gornstats/new.nodejs.org,wonderdogone/new.nodejs.org,abdelrahmansaeedhassan/yuri,stojanovic/new.nodejs.org | handlebars | ## Code Before:
<!DOCTYPE html>
<html lang="{{site.locale}}">
{{> html-head }}
<body>
{{> header active="blog" }}
<main>
<div class="container">
<ul>
{{#each collections.blog}}
{{#if title}}
<li>
<a href="../{{ path }}">{{ title }}</a>
</li>
{{/if}}
{{/each}}
</ul>
</div>
</main>
{{> footer }}
</body>
</html>
## Instruction:
Use absolute paths for blog posts
## Code After:
<!DOCTYPE html>
<html lang="{{site.locale}}">
{{> html-head }}
<body>
{{> header active="blog" }}
<main>
<div class="container">
<ul>
{{#each collections.blog}}
{{#if title}}
<li>
<a href="/{{../../site.locale}}/{{ path }}">{{ title }}</a>
</li>
{{/if}}
{{/each}}
</ul>
</div>
</main>
{{> footer }}
</body>
</html>
| <!DOCTYPE html>
<html lang="{{site.locale}}">
{{> html-head }}
<body>
{{> header active="blog" }}
<main>
<div class="container">
<ul>
{{#each collections.blog}}
{{#if title}}
<li>
- <a href="../{{ path }}">{{ title }}</a>
+ <a href="/{{../../site.locale}}/{{ path }}">{{ title }}</a>
? +++ +++++++++++++++++
</li>
{{/if}}
{{/each}}
</ul>
</div>
</main>
{{> footer }}
</body>
</html> | 2 | 0.076923 | 1 | 1 |
5e2009a6dbd473e840fccb3ff61840c700bec195 | src/Storage/Database/Schema/Timer.php | src/Storage/Database/Schema/Timer.php | <?php
namespace Bolt\Storage\Database\Schema;
use Bolt\Exception\StorageException;
use Carbon\Carbon;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\Filesystem\Exception\IOException;
use Symfony\Component\Filesystem\Filesystem;
/**
* Schema validation check functionality.
*
* @author Gawain Lynch <gawain.lynch@gmail.com>
*/
class Timer
{
/** @var \Symfony\Component\Filesystem\Filesystem */
protected $filesystem;
/** @var string */
protected $timestampFile;
/** @var boolean */
protected $expired;
const CHECK_INTERVAL = 1800;
public function __construct($cachePath)
{
$this->timestampFile = $cachePath . '/dbcheck.ts';
$this->filesystem = new Filesystem();
}
}
| <?php
namespace Bolt\Storage\Database\Schema;
use Bolt\Exception\StorageException;
use Carbon\Carbon;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\Filesystem\Exception\IOException;
use Symfony\Component\Filesystem\Filesystem;
/**
* Schema validation check functionality.
*
* @author Gawain Lynch <gawain.lynch@gmail.com>
*/
class Timer
{
/** @var \Symfony\Component\Filesystem\Filesystem */
protected $filesystem;
/** @var string */
protected $timestampFile;
/** @var boolean */
protected $expired;
const CHECK_INTERVAL = 1800;
public function __construct($cachePath)
{
$this->timestampFile = $cachePath . '/dbcheck.ts';
$this->filesystem = new Filesystem();
}
/**
* Check if we have determined that we need to do a database check.
*
* @return boolean
*/
public function isCheckRequired()
{
if ($this->expired !== null) {
return $this->expired;
}
if ($this->filesystem->exists($this->timestampFile)) {
$expiryTimestamp = (integer) file_get_contents($this->timestampFile);
} else {
$expiryTimestamp = 0;
}
$ts = Carbon::createFromTimeStamp($expiryTimestamp + self::CHECK_INTERVAL);
return $this->expired = $ts->isPast();
}
}
| Check to see if validation check is due | Check to see if validation check is due | PHP | mit | one988/cm,electrolinux/bolt,lenvanessen/bolt,cdowdy/bolt,bolt/bolt,lenvanessen/bolt,Raistlfiren/bolt,Raistlfiren/bolt,Intendit/bolt,rossriley/bolt,rarila/bolt,GawainLynch/bolt,electrolinux/bolt,cdowdy/bolt,nikgo/bolt,romulo1984/bolt,Intendit/bolt,CarsonF/bolt,rossriley/bolt,one988/cm,nikgo/bolt,CarsonF/bolt,bolt/bolt,rossriley/bolt,rarila/bolt,CarsonF/bolt,GawainLynch/bolt,electrolinux/bolt,joshuan/bolt,Intendit/bolt,one988/cm,electrolinux/bolt,romulo1984/bolt,Raistlfiren/bolt,rarila/bolt,GawainLynch/bolt,HonzaMikula/masivnipostele,lenvanessen/bolt,nantunes/bolt,HonzaMikula/masivnipostele,bolt/bolt,HonzaMikula/masivnipostele,nikgo/bolt,bolt/bolt,romulo1984/bolt,one988/cm,cdowdy/bolt,Raistlfiren/bolt,rarila/bolt,nantunes/bolt,rossriley/bolt,cdowdy/bolt,lenvanessen/bolt,joshuan/bolt,GawainLynch/bolt,joshuan/bolt,CarsonF/bolt,Intendit/bolt,HonzaMikula/masivnipostele,romulo1984/bolt,nantunes/bolt,nantunes/bolt,nikgo/bolt,joshuan/bolt | php | ## Code Before:
<?php
namespace Bolt\Storage\Database\Schema;
use Bolt\Exception\StorageException;
use Carbon\Carbon;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\Filesystem\Exception\IOException;
use Symfony\Component\Filesystem\Filesystem;
/**
* Schema validation check functionality.
*
* @author Gawain Lynch <gawain.lynch@gmail.com>
*/
class Timer
{
/** @var \Symfony\Component\Filesystem\Filesystem */
protected $filesystem;
/** @var string */
protected $timestampFile;
/** @var boolean */
protected $expired;
const CHECK_INTERVAL = 1800;
public function __construct($cachePath)
{
$this->timestampFile = $cachePath . '/dbcheck.ts';
$this->filesystem = new Filesystem();
}
}
## Instruction:
Check to see if validation check is due
## Code After:
<?php
namespace Bolt\Storage\Database\Schema;
use Bolt\Exception\StorageException;
use Carbon\Carbon;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\Filesystem\Exception\IOException;
use Symfony\Component\Filesystem\Filesystem;
/**
* Schema validation check functionality.
*
* @author Gawain Lynch <gawain.lynch@gmail.com>
*/
class Timer
{
/** @var \Symfony\Component\Filesystem\Filesystem */
protected $filesystem;
/** @var string */
protected $timestampFile;
/** @var boolean */
protected $expired;
const CHECK_INTERVAL = 1800;
public function __construct($cachePath)
{
$this->timestampFile = $cachePath . '/dbcheck.ts';
$this->filesystem = new Filesystem();
}
/**
* Check if we have determined that we need to do a database check.
*
* @return boolean
*/
public function isCheckRequired()
{
if ($this->expired !== null) {
return $this->expired;
}
if ($this->filesystem->exists($this->timestampFile)) {
$expiryTimestamp = (integer) file_get_contents($this->timestampFile);
} else {
$expiryTimestamp = 0;
}
$ts = Carbon::createFromTimeStamp($expiryTimestamp + self::CHECK_INTERVAL);
return $this->expired = $ts->isPast();
}
}
| <?php
namespace Bolt\Storage\Database\Schema;
use Bolt\Exception\StorageException;
use Carbon\Carbon;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\Filesystem\Exception\IOException;
use Symfony\Component\Filesystem\Filesystem;
/**
* Schema validation check functionality.
*
* @author Gawain Lynch <gawain.lynch@gmail.com>
*/
class Timer
{
/** @var \Symfony\Component\Filesystem\Filesystem */
protected $filesystem;
/** @var string */
protected $timestampFile;
/** @var boolean */
protected $expired;
const CHECK_INTERVAL = 1800;
public function __construct($cachePath)
{
$this->timestampFile = $cachePath . '/dbcheck.ts';
$this->filesystem = new Filesystem();
}
+
+ /**
+ * Check if we have determined that we need to do a database check.
+ *
+ * @return boolean
+ */
+ public function isCheckRequired()
+ {
+ if ($this->expired !== null) {
+ return $this->expired;
+ }
+
+ if ($this->filesystem->exists($this->timestampFile)) {
+ $expiryTimestamp = (integer) file_get_contents($this->timestampFile);
+ } else {
+ $expiryTimestamp = 0;
+ }
+ $ts = Carbon::createFromTimeStamp($expiryTimestamp + self::CHECK_INTERVAL);
+
+ return $this->expired = $ts->isPast();
+ }
} | 21 | 0.65625 | 21 | 0 |
8d27e050596fcf78f9cc7eab7fca20aa053ad504 | lib/beans.rb | lib/beans.rb | require 'beans/version'
require 'beans/registry'
Dir[File.dirname(__FILE__) + '/beans/entities/**/*.rb'].each { |f| require f }
Dir[File.dirname(__FILE__) + '/beans/use_cases/**/*.rb'].each { |f| require f }
module Beans
extend UseCases::Bean
extend UseCases::Brand
class << self
attr_accessor :repo, :use_cases
def configure
yield self
end
def register_repository(type, repository)
repo.register type, repository
end
def default_store(store)
repo.default = store
end
def repo
@repo ||= Registry.new
end
end
end
| require 'beans/version'
require 'beans/registry'
Dir[File.dirname(__FILE__) + '/beans/entities/**/*.rb'].sort.each { |f| require f }
Dir[File.dirname(__FILE__) + '/beans/use_cases/**/*.rb'].sort.each { |f| require f }
module Beans
extend UseCases::Bean
extend UseCases::Brand
class << self
attr_accessor :repo, :use_cases
def configure
yield self
end
def register_repository(type, repository)
repo.register type, repository
end
def default_store(store)
repo.default = store
end
def repo
@repo ||= Registry.new
end
end
end
| Sort required files to 'fix' dependency issues | Sort required files to 'fix' dependency issues
| Ruby | mit | dubdromic/beans | ruby | ## Code Before:
require 'beans/version'
require 'beans/registry'
Dir[File.dirname(__FILE__) + '/beans/entities/**/*.rb'].each { |f| require f }
Dir[File.dirname(__FILE__) + '/beans/use_cases/**/*.rb'].each { |f| require f }
module Beans
extend UseCases::Bean
extend UseCases::Brand
class << self
attr_accessor :repo, :use_cases
def configure
yield self
end
def register_repository(type, repository)
repo.register type, repository
end
def default_store(store)
repo.default = store
end
def repo
@repo ||= Registry.new
end
end
end
## Instruction:
Sort required files to 'fix' dependency issues
## Code After:
require 'beans/version'
require 'beans/registry'
Dir[File.dirname(__FILE__) + '/beans/entities/**/*.rb'].sort.each { |f| require f }
Dir[File.dirname(__FILE__) + '/beans/use_cases/**/*.rb'].sort.each { |f| require f }
module Beans
extend UseCases::Bean
extend UseCases::Brand
class << self
attr_accessor :repo, :use_cases
def configure
yield self
end
def register_repository(type, repository)
repo.register type, repository
end
def default_store(store)
repo.default = store
end
def repo
@repo ||= Registry.new
end
end
end
| require 'beans/version'
require 'beans/registry'
- Dir[File.dirname(__FILE__) + '/beans/entities/**/*.rb'].each { |f| require f }
+ Dir[File.dirname(__FILE__) + '/beans/entities/**/*.rb'].sort.each { |f| require f }
? +++++
- Dir[File.dirname(__FILE__) + '/beans/use_cases/**/*.rb'].each { |f| require f }
+ Dir[File.dirname(__FILE__) + '/beans/use_cases/**/*.rb'].sort.each { |f| require f }
? +++++
module Beans
extend UseCases::Bean
extend UseCases::Brand
class << self
attr_accessor :repo, :use_cases
def configure
yield self
end
def register_repository(type, repository)
repo.register type, repository
end
def default_store(store)
repo.default = store
end
def repo
@repo ||= Registry.new
end
end
end | 4 | 0.133333 | 2 | 2 |
52b6e1bf3759d0a58f478f9616ad822eb4cd3bd5 | compiler/javatests/com/google/dart/compiler/parser/ParserTests.java | compiler/javatests/com/google/dart/compiler/parser/ParserTests.java | // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
package com.google.dart.compiler.parser;
import junit.extensions.TestSetup;
import junit.framework.Test;
import junit.framework.TestSuite;
public class ParserTests extends TestSetup {
public ParserTests(TestSuite test) {
super(test);
}
public static Test suite() {
TestSuite suite = new TestSuite("Dart parser test suite.");
suite.addTestSuite(SyntaxTest.class);
suite.addTestSuite(DietParserTest.class);
suite.addTestSuite(CPParserTest.class);
suite.addTestSuite(ParserRoundTripTest.class);
suite.addTestSuite(LibraryParserTest.class);
suite.addTestSuite(NegativeParserTest.class);
suite.addTestSuite(ValidatingSyntaxTest.class);
suite.addTestSuite(CommentTest.class);
suite.addTestSuite(ErrorMessageLocationTest.class);
suite.addTestSuite(ParserEventsTest.class);
suite.addTestSuite(TruncatedSourceParserTest.class);
suite.addTestSuite(ParserRecoveryTest.class);
return new ParserTests(suite);
}
}
| // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
package com.google.dart.compiler.parser;
import junit.extensions.TestSetup;
import junit.framework.Test;
import junit.framework.TestSuite;
public class ParserTests extends TestSetup {
public ParserTests(TestSuite test) {
super(test);
}
public static Test suite() {
TestSuite suite = new TestSuite("Dart parser test suite.");
suite.addTestSuite(SyntaxTest.class);
//diet-parsing is used only for incremental compilation which is turned off
//(and this test causes intermittent timeouts)
//suite.addTestSuite(DietParserTest.class);
suite.addTestSuite(CPParserTest.class);
suite.addTestSuite(ParserRoundTripTest.class);
suite.addTestSuite(LibraryParserTest.class);
suite.addTestSuite(NegativeParserTest.class);
suite.addTestSuite(ValidatingSyntaxTest.class);
suite.addTestSuite(CommentTest.class);
suite.addTestSuite(ErrorMessageLocationTest.class);
suite.addTestSuite(ParserEventsTest.class);
suite.addTestSuite(TruncatedSourceParserTest.class);
suite.addTestSuite(ParserRecoveryTest.class);
return new ParserTests(suite);
}
}
| Disable dartc diet parser test | Disable dartc diet parser test
Reviewed here: http://codereview.chromium.org/10696100/
Review URL: https://chromiumcodereview.appspot.com//10692081
git-svn-id: c93d8a2297af3b929165606efe145742a534bc71@9380 260f80e4-7a28-3924-810f-c04153c831b5
| Java | bsd-3-clause | dart-lang/sdk,dart-lang/sdk,dart-archive/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-lang/sdk,dartino/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk | java | ## Code Before:
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
package com.google.dart.compiler.parser;
import junit.extensions.TestSetup;
import junit.framework.Test;
import junit.framework.TestSuite;
public class ParserTests extends TestSetup {
public ParserTests(TestSuite test) {
super(test);
}
public static Test suite() {
TestSuite suite = new TestSuite("Dart parser test suite.");
suite.addTestSuite(SyntaxTest.class);
suite.addTestSuite(DietParserTest.class);
suite.addTestSuite(CPParserTest.class);
suite.addTestSuite(ParserRoundTripTest.class);
suite.addTestSuite(LibraryParserTest.class);
suite.addTestSuite(NegativeParserTest.class);
suite.addTestSuite(ValidatingSyntaxTest.class);
suite.addTestSuite(CommentTest.class);
suite.addTestSuite(ErrorMessageLocationTest.class);
suite.addTestSuite(ParserEventsTest.class);
suite.addTestSuite(TruncatedSourceParserTest.class);
suite.addTestSuite(ParserRecoveryTest.class);
return new ParserTests(suite);
}
}
## Instruction:
Disable dartc diet parser test
Reviewed here: http://codereview.chromium.org/10696100/
Review URL: https://chromiumcodereview.appspot.com//10692081
git-svn-id: c93d8a2297af3b929165606efe145742a534bc71@9380 260f80e4-7a28-3924-810f-c04153c831b5
## Code After:
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
package com.google.dart.compiler.parser;
import junit.extensions.TestSetup;
import junit.framework.Test;
import junit.framework.TestSuite;
public class ParserTests extends TestSetup {
public ParserTests(TestSuite test) {
super(test);
}
public static Test suite() {
TestSuite suite = new TestSuite("Dart parser test suite.");
suite.addTestSuite(SyntaxTest.class);
//diet-parsing is used only for incremental compilation which is turned off
//(and this test causes intermittent timeouts)
//suite.addTestSuite(DietParserTest.class);
suite.addTestSuite(CPParserTest.class);
suite.addTestSuite(ParserRoundTripTest.class);
suite.addTestSuite(LibraryParserTest.class);
suite.addTestSuite(NegativeParserTest.class);
suite.addTestSuite(ValidatingSyntaxTest.class);
suite.addTestSuite(CommentTest.class);
suite.addTestSuite(ErrorMessageLocationTest.class);
suite.addTestSuite(ParserEventsTest.class);
suite.addTestSuite(TruncatedSourceParserTest.class);
suite.addTestSuite(ParserRecoveryTest.class);
return new ParserTests(suite);
}
}
| // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
package com.google.dart.compiler.parser;
import junit.extensions.TestSetup;
import junit.framework.Test;
import junit.framework.TestSuite;
public class ParserTests extends TestSetup {
public ParserTests(TestSuite test) {
super(test);
}
public static Test suite() {
TestSuite suite = new TestSuite("Dart parser test suite.");
suite.addTestSuite(SyntaxTest.class);
+ //diet-parsing is used only for incremental compilation which is turned off
+ //(and this test causes intermittent timeouts)
- suite.addTestSuite(DietParserTest.class);
+ //suite.addTestSuite(DietParserTest.class);
? ++
suite.addTestSuite(CPParserTest.class);
suite.addTestSuite(ParserRoundTripTest.class);
suite.addTestSuite(LibraryParserTest.class);
suite.addTestSuite(NegativeParserTest.class);
suite.addTestSuite(ValidatingSyntaxTest.class);
suite.addTestSuite(CommentTest.class);
suite.addTestSuite(ErrorMessageLocationTest.class);
suite.addTestSuite(ParserEventsTest.class);
suite.addTestSuite(TruncatedSourceParserTest.class);
suite.addTestSuite(ParserRecoveryTest.class);
return new ParserTests(suite);
}
} | 4 | 0.117647 | 3 | 1 |
9220ba19802e617654483cd696d38d10e904506c | README.md | README.md |
Generates lightcurve JSON files and Ouroboros manifest for Planet Hunters.
Example usage:
```
docker run -it --rm -v /data/:/data/ -w /data zooniverse/planet-hunters-importer /usr/src/app/wgetkdwarfs.sh
docker run -it --rm -v /data/:/data/ zooniverse/planet-hunters-importer ./generate.py /data/metadata.csv
docker run -it --rm -v /data/:/data/ zooniverse/planet-hunters-importer ./generate-manifest.py
```
|
Generates lightcurve JSON files and Ouroboros manifest for Planet Hunters.
Example usage:
```
docker run -it --rm -v /data/:/data/ -w /data zooniverse/planet-hunters-importer /usr/src/app/wgetkdwarfs.sh
docker run -it --rm -v /data/:/data/ zooniverse/planet-hunters-importer ./generate.py /data/metadata.csv
docker run -it --rm -v /data/:/data/ zooniverse/planet-hunters-importer ./generate-manifest.py
find /data/out/ -name "kdwarf-*.json" -exec aws s3 cp {} s3://zooniverse-static/www.planethunters.org/subjects/ \;
```
Then update and run `ingest.rb` in an Ouroboros shell with `/data/out/manifest.json`.
| Add upload and ingestion instructions | Add upload and ingestion instructions
| Markdown | apache-2.0 | zooniverse/planet-hunters-importer,zooniverse/planet-hunters-importer,zooniverse/planet-hunters-importer | markdown | ## Code Before:
Generates lightcurve JSON files and Ouroboros manifest for Planet Hunters.
Example usage:
```
docker run -it --rm -v /data/:/data/ -w /data zooniverse/planet-hunters-importer /usr/src/app/wgetkdwarfs.sh
docker run -it --rm -v /data/:/data/ zooniverse/planet-hunters-importer ./generate.py /data/metadata.csv
docker run -it --rm -v /data/:/data/ zooniverse/planet-hunters-importer ./generate-manifest.py
```
## Instruction:
Add upload and ingestion instructions
## Code After:
Generates lightcurve JSON files and Ouroboros manifest for Planet Hunters.
Example usage:
```
docker run -it --rm -v /data/:/data/ -w /data zooniverse/planet-hunters-importer /usr/src/app/wgetkdwarfs.sh
docker run -it --rm -v /data/:/data/ zooniverse/planet-hunters-importer ./generate.py /data/metadata.csv
docker run -it --rm -v /data/:/data/ zooniverse/planet-hunters-importer ./generate-manifest.py
find /data/out/ -name "kdwarf-*.json" -exec aws s3 cp {} s3://zooniverse-static/www.planethunters.org/subjects/ \;
```
Then update and run `ingest.rb` in an Ouroboros shell with `/data/out/manifest.json`.
|
Generates lightcurve JSON files and Ouroboros manifest for Planet Hunters.
Example usage:
```
docker run -it --rm -v /data/:/data/ -w /data zooniverse/planet-hunters-importer /usr/src/app/wgetkdwarfs.sh
docker run -it --rm -v /data/:/data/ zooniverse/planet-hunters-importer ./generate.py /data/metadata.csv
docker run -it --rm -v /data/:/data/ zooniverse/planet-hunters-importer ./generate-manifest.py
+ find /data/out/ -name "kdwarf-*.json" -exec aws s3 cp {} s3://zooniverse-static/www.planethunters.org/subjects/ \;
```
+
+ Then update and run `ingest.rb` in an Ouroboros shell with `/data/out/manifest.json`. | 3 | 0.3 | 3 | 0 |
075ca002c2987372f3ff6fac43db54a02803da58 | source/assets/stylesheets/styles/_footer_address.scss | source/assets/stylesheets/styles/_footer_address.scss | .footer-address__city {
display: block;
color: inherit;
font-weight: 400;
padding: 15px 0 10px;
text-decoration: none;
&:after {
content: "›";
padding-left: 8px;
}
@include breakpoint($tablet-breakpoint) {
padding-bottom: 15px;
padding-top: 0;
&:after {
content: ""
}
}
}
.footer-address__postal-address {
display: none;
@include breakpoint($tablet-breakpoint) {
display: block;
padding-bottom: 10px;
}
}
.footer-address__phone-number {
color: inherit;
font-weight: 400;
text-decoration: none;
@include breakpoint($tablet-breakpoint) {
cursor: text;
font-weight: 200;
pointer-events: none;
}
}
.footer-address__company-registration {
display: none;
@include breakpoint($tablet-breakpoint) {
display: block;
font-size: 0.8em;
line-height: 1.4em;
padding-top: 10px;
}
}
i.footer-address__map-icon {
padding-right: 10px;
@include breakpoint($tablet-breakpoint) {
padding-right: 3px;
}
}
i.footer-address__phone-icon {
padding-right: 8px;
@include breakpoint($tablet-breakpoint) {
display: none;
}
}
| .footer-address__city {
display: block;
color: inherit;
font-weight: 400;
padding: 15px 0 10px;
text-decoration: none;
&:after {
content: "›";
padding-left: 8px;
}
@include breakpoint($tablet-breakpoint) {
padding-bottom: 15px;
padding-top: 0;
&:after {
content: ""
}
}
}
.footer-address__postal-address {
display: none;
@include breakpoint($tablet-breakpoint) {
display: block;
padding-bottom: 10px;
}
}
.footer-address__phone-number {
color: inherit;
text-decoration: none;
@include breakpoint($tablet-breakpoint) {
cursor: text;
font-weight: 200;
pointer-events: none;
}
}
.footer-address__company-registration {
display: none;
@include breakpoint($tablet-breakpoint) {
display: block;
font-size: 0.8em;
line-height: 1.4;
padding-top: 10px;
}
}
i.footer-address__map-icon {
padding-right: 10px;
@include breakpoint($tablet-breakpoint) {
padding-right: 3px;
}
}
i.footer-address__phone-icon {
padding-right: 8px;
@include breakpoint($tablet-breakpoint) {
display: none;
}
}
| Remove inherited font-weight. Prefer number value for line-height | Remove inherited font-weight. Prefer number value for line-height
| SCSS | mit | unboxed/ubxd_web_refresh,unboxed/unboxed.co,unboxed/unboxed.co,unboxed/ubxd_web_refresh,unboxed/ubxd_web_refresh,unboxed/unboxed.co | scss | ## Code Before:
.footer-address__city {
display: block;
color: inherit;
font-weight: 400;
padding: 15px 0 10px;
text-decoration: none;
&:after {
content: "›";
padding-left: 8px;
}
@include breakpoint($tablet-breakpoint) {
padding-bottom: 15px;
padding-top: 0;
&:after {
content: ""
}
}
}
.footer-address__postal-address {
display: none;
@include breakpoint($tablet-breakpoint) {
display: block;
padding-bottom: 10px;
}
}
.footer-address__phone-number {
color: inherit;
font-weight: 400;
text-decoration: none;
@include breakpoint($tablet-breakpoint) {
cursor: text;
font-weight: 200;
pointer-events: none;
}
}
.footer-address__company-registration {
display: none;
@include breakpoint($tablet-breakpoint) {
display: block;
font-size: 0.8em;
line-height: 1.4em;
padding-top: 10px;
}
}
i.footer-address__map-icon {
padding-right: 10px;
@include breakpoint($tablet-breakpoint) {
padding-right: 3px;
}
}
i.footer-address__phone-icon {
padding-right: 8px;
@include breakpoint($tablet-breakpoint) {
display: none;
}
}
## Instruction:
Remove inherited font-weight. Prefer number value for line-height
## Code After:
.footer-address__city {
display: block;
color: inherit;
font-weight: 400;
padding: 15px 0 10px;
text-decoration: none;
&:after {
content: "›";
padding-left: 8px;
}
@include breakpoint($tablet-breakpoint) {
padding-bottom: 15px;
padding-top: 0;
&:after {
content: ""
}
}
}
.footer-address__postal-address {
display: none;
@include breakpoint($tablet-breakpoint) {
display: block;
padding-bottom: 10px;
}
}
.footer-address__phone-number {
color: inherit;
text-decoration: none;
@include breakpoint($tablet-breakpoint) {
cursor: text;
font-weight: 200;
pointer-events: none;
}
}
.footer-address__company-registration {
display: none;
@include breakpoint($tablet-breakpoint) {
display: block;
font-size: 0.8em;
line-height: 1.4;
padding-top: 10px;
}
}
i.footer-address__map-icon {
padding-right: 10px;
@include breakpoint($tablet-breakpoint) {
padding-right: 3px;
}
}
i.footer-address__phone-icon {
padding-right: 8px;
@include breakpoint($tablet-breakpoint) {
display: none;
}
}
| .footer-address__city {
display: block;
color: inherit;
font-weight: 400;
padding: 15px 0 10px;
text-decoration: none;
&:after {
content: "›";
padding-left: 8px;
}
@include breakpoint($tablet-breakpoint) {
padding-bottom: 15px;
padding-top: 0;
&:after {
content: ""
}
}
}
.footer-address__postal-address {
display: none;
@include breakpoint($tablet-breakpoint) {
display: block;
padding-bottom: 10px;
}
}
.footer-address__phone-number {
color: inherit;
- font-weight: 400;
text-decoration: none;
@include breakpoint($tablet-breakpoint) {
cursor: text;
font-weight: 200;
pointer-events: none;
}
}
.footer-address__company-registration {
display: none;
@include breakpoint($tablet-breakpoint) {
display: block;
font-size: 0.8em;
- line-height: 1.4em;
? --
+ line-height: 1.4;
padding-top: 10px;
}
}
i.footer-address__map-icon {
padding-right: 10px;
@include breakpoint($tablet-breakpoint) {
padding-right: 3px;
}
}
i.footer-address__phone-icon {
padding-right: 8px;
@include breakpoint($tablet-breakpoint) {
display: none;
}
} | 3 | 0.043478 | 1 | 2 |
eb60c3476d5ec0f1f58b04ec4352dbcdef6adb11 | easy-coding-standard.yaml | easy-coding-standard.yaml | imports:
- { resource: 'vendor/lmc/coding-standard/easy-coding-standard.yaml' }
parameters:
skip:
PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\ForbiddenFunctionsSniff:
- 'src-tests/bootstrap.php'
- 'src-tests/ConfigHelper.php'
- 'src-tests/ConfigProviderTest.php'
- 'src/bootstrap.php'
- 'src/Component/Legacy.php'
- 'src/Listener/TestStartLogListener.php'
- 'src/Listener/TestStatusListener.php'
- 'src/Test/AbstractTestCase.php'
- 'src/WebDriver/RemoteWebDriver.php'
PHP_CodeSniffer\Standards\Generic\Sniffs\Files\OneClassPerFileSniff.MultipleFound:
- 'src-tests/Process/Fixtures/InvalidTests/MultipleClassesInFileTest.php'
exclude_files:
- 'src-tests/coverage/*'
- 'src-tests/FunctionalTests/logs/coverage/*'
- 'src-tests/Utils/Annotations/Fixtures/*'
services:
PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff:
absoluteLineLimit: 120 # To enforce line length limit
| imports:
- { resource: 'vendor/lmc/coding-standard/easy-coding-standard.yaml' }
parameters:
skip:
PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\ForbiddenFunctionsSniff:
- 'src-tests/bootstrap.php'
- 'src-tests/ConfigHelper.php'
- 'src-tests/ConfigProviderTest.php'
- 'src/bootstrap.php'
- 'src/Component/Legacy.php'
- 'src/Listener/TestStartLogListener.php'
- 'src/Listener/TestStatusListener.php'
- 'src/Test/AbstractTestCase.php'
- 'src/WebDriver/RemoteWebDriver.php'
PHP_CodeSniffer\Standards\Generic\Sniffs\Files\OneClassPerFileSniff.MultipleFound:
- 'src-tests/Process/Fixtures/InvalidTests/MultipleClassesInFileTest.php'
exclude_files:
- 'src-tests/coverage/*'
- 'src-tests/FunctionalTests/logs/coverage/*'
- 'src-tests/Utils/Annotations/Fixtures/*'
services:
PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff:
absoluteLineLimit: 120 # To enforce line length limit
PhpCsFixer\Fixer\PhpUnit\PhpUnitExpectationFixer:
target: '5.6'
| Declare phpunit target to avoid false positive codestyle error | Declare phpunit target to avoid false positive codestyle error
| YAML | mit | lmc-eu/steward,OndraM/steward,OndraM/steward,lmc-eu/steward | yaml | ## Code Before:
imports:
- { resource: 'vendor/lmc/coding-standard/easy-coding-standard.yaml' }
parameters:
skip:
PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\ForbiddenFunctionsSniff:
- 'src-tests/bootstrap.php'
- 'src-tests/ConfigHelper.php'
- 'src-tests/ConfigProviderTest.php'
- 'src/bootstrap.php'
- 'src/Component/Legacy.php'
- 'src/Listener/TestStartLogListener.php'
- 'src/Listener/TestStatusListener.php'
- 'src/Test/AbstractTestCase.php'
- 'src/WebDriver/RemoteWebDriver.php'
PHP_CodeSniffer\Standards\Generic\Sniffs\Files\OneClassPerFileSniff.MultipleFound:
- 'src-tests/Process/Fixtures/InvalidTests/MultipleClassesInFileTest.php'
exclude_files:
- 'src-tests/coverage/*'
- 'src-tests/FunctionalTests/logs/coverage/*'
- 'src-tests/Utils/Annotations/Fixtures/*'
services:
PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff:
absoluteLineLimit: 120 # To enforce line length limit
## Instruction:
Declare phpunit target to avoid false positive codestyle error
## Code After:
imports:
- { resource: 'vendor/lmc/coding-standard/easy-coding-standard.yaml' }
parameters:
skip:
PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\ForbiddenFunctionsSniff:
- 'src-tests/bootstrap.php'
- 'src-tests/ConfigHelper.php'
- 'src-tests/ConfigProviderTest.php'
- 'src/bootstrap.php'
- 'src/Component/Legacy.php'
- 'src/Listener/TestStartLogListener.php'
- 'src/Listener/TestStatusListener.php'
- 'src/Test/AbstractTestCase.php'
- 'src/WebDriver/RemoteWebDriver.php'
PHP_CodeSniffer\Standards\Generic\Sniffs\Files\OneClassPerFileSniff.MultipleFound:
- 'src-tests/Process/Fixtures/InvalidTests/MultipleClassesInFileTest.php'
exclude_files:
- 'src-tests/coverage/*'
- 'src-tests/FunctionalTests/logs/coverage/*'
- 'src-tests/Utils/Annotations/Fixtures/*'
services:
PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff:
absoluteLineLimit: 120 # To enforce line length limit
PhpCsFixer\Fixer\PhpUnit\PhpUnitExpectationFixer:
target: '5.6'
| imports:
- { resource: 'vendor/lmc/coding-standard/easy-coding-standard.yaml' }
parameters:
skip:
PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\ForbiddenFunctionsSniff:
- 'src-tests/bootstrap.php'
- 'src-tests/ConfigHelper.php'
- 'src-tests/ConfigProviderTest.php'
- 'src/bootstrap.php'
- 'src/Component/Legacy.php'
- 'src/Listener/TestStartLogListener.php'
- 'src/Listener/TestStatusListener.php'
- 'src/Test/AbstractTestCase.php'
- 'src/WebDriver/RemoteWebDriver.php'
PHP_CodeSniffer\Standards\Generic\Sniffs\Files\OneClassPerFileSniff.MultipleFound:
- 'src-tests/Process/Fixtures/InvalidTests/MultipleClassesInFileTest.php'
exclude_files:
- 'src-tests/coverage/*'
- 'src-tests/FunctionalTests/logs/coverage/*'
- 'src-tests/Utils/Annotations/Fixtures/*'
services:
PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff:
absoluteLineLimit: 120 # To enforce line length limit
+ PhpCsFixer\Fixer\PhpUnit\PhpUnitExpectationFixer:
+ target: '5.6' | 2 | 0.08 | 2 | 0 |
163f01d5c313a2397372bcadd3d8e8e13a111e1e | _resources/meta.yml | _resources/meta.yml | kit:
name: "Qubell Selenium Grid"
link: https://github.com/qubell-bazaar/component-selenium-grid
applications:
- name: "Selenium Grid"
manifest: "https://raw.github.com/qubell-bazaar/component-selenium-grid/master/selenium-grid-manifest.yml"
provider:
name: "Qubell"
link: http://qubell.com
documentation:
overview: ""
| kit:
name: "Qubell Selenium Grid"
link: https://github.com/qubell-bazaar/component-selenium-grid
applications:
- name: "Selenium Grid"
manifest: "https://raw.github.com/qubell-bazaar/component-selenium-grid/master/component-selenium-grid.yml"
provider:
name: "Qubell"
link: http://qubell.com
documentation:
overview: ""
| Fix link to manifest | Fix link to manifest [ci skip] | YAML | apache-2.0 | qubell-bazaar/component-selenium-grid,qubell-bazaar/component-selenium-grid,jollyrojer/component-selenium-grid,qubell-bazaar/component-selenium-grid,jollyrojer/component-selenium-grid,jollyrojer/component-selenium-grid | yaml | ## Code Before:
kit:
name: "Qubell Selenium Grid"
link: https://github.com/qubell-bazaar/component-selenium-grid
applications:
- name: "Selenium Grid"
manifest: "https://raw.github.com/qubell-bazaar/component-selenium-grid/master/selenium-grid-manifest.yml"
provider:
name: "Qubell"
link: http://qubell.com
documentation:
overview: ""
## Instruction:
Fix link to manifest [ci skip]
## Code After:
kit:
name: "Qubell Selenium Grid"
link: https://github.com/qubell-bazaar/component-selenium-grid
applications:
- name: "Selenium Grid"
manifest: "https://raw.github.com/qubell-bazaar/component-selenium-grid/master/component-selenium-grid.yml"
provider:
name: "Qubell"
link: http://qubell.com
documentation:
overview: ""
| kit:
name: "Qubell Selenium Grid"
link: https://github.com/qubell-bazaar/component-selenium-grid
applications:
- name: "Selenium Grid"
- manifest: "https://raw.github.com/qubell-bazaar/component-selenium-grid/master/selenium-grid-manifest.yml"
? ---------
+ manifest: "https://raw.github.com/qubell-bazaar/component-selenium-grid/master/component-selenium-grid.yml"
? ++++++++++
provider:
name: "Qubell"
link: http://qubell.com
documentation:
overview: "" | 2 | 0.181818 | 1 | 1 |
a735cf90640899bc83a57f7b079b100f61f56e41 | setup.py | setup.py | from distutils.core import setup
from os.path import exists
setup(
name = "fsmonitor",
version = "0.1",
description = "Filesystem monitoring",
long_description=(open('README.rst').read() if exists('README.rst')
else ''),
author = "Luke McCarthy",
author_email = "luke@iogopro.co.uk",
licence="MIT",
url = "http://github.com/shaurz/fsmonitor",
install_requires=[
'pypiwin32',
],
packages = ["fsmonitor"],
)
| from distutils.core import setup
from os.path import exists
from platform import system
requires = []
if system == "Windows":
requires = ["pypiwin32"]
setup(
name = "fsmonitor",
version = "0.1",
description = "Filesystem monitoring",
long_description=(open('README.rst').read() if exists('README.rst')
else ''),
author = "Luke McCarthy",
author_email = "luke@iogopro.co.uk",
licence="MIT",
url = "http://github.com/shaurz/fsmonitor",
install_requires=requires,
packages = ["fsmonitor"],
)
| Add requires pywin32 only for Windows | Add requires pywin32 only for Windows
| Python | mit | shaurz/fsmonitor | python | ## Code Before:
from distutils.core import setup
from os.path import exists
setup(
name = "fsmonitor",
version = "0.1",
description = "Filesystem monitoring",
long_description=(open('README.rst').read() if exists('README.rst')
else ''),
author = "Luke McCarthy",
author_email = "luke@iogopro.co.uk",
licence="MIT",
url = "http://github.com/shaurz/fsmonitor",
install_requires=[
'pypiwin32',
],
packages = ["fsmonitor"],
)
## Instruction:
Add requires pywin32 only for Windows
## Code After:
from distutils.core import setup
from os.path import exists
from platform import system
requires = []
if system == "Windows":
requires = ["pypiwin32"]
setup(
name = "fsmonitor",
version = "0.1",
description = "Filesystem monitoring",
long_description=(open('README.rst').read() if exists('README.rst')
else ''),
author = "Luke McCarthy",
author_email = "luke@iogopro.co.uk",
licence="MIT",
url = "http://github.com/shaurz/fsmonitor",
install_requires=requires,
packages = ["fsmonitor"],
)
| from distutils.core import setup
from os.path import exists
+ from platform import system
+
+ requires = []
+ if system == "Windows":
+ requires = ["pypiwin32"]
setup(
name = "fsmonitor",
version = "0.1",
description = "Filesystem monitoring",
long_description=(open('README.rst').read() if exists('README.rst')
else ''),
author = "Luke McCarthy",
author_email = "luke@iogopro.co.uk",
licence="MIT",
url = "http://github.com/shaurz/fsmonitor",
- install_requires=[
? ^
+ install_requires=requires,
? ^^^^^^^^^
- 'pypiwin32',
- ],
packages = ["fsmonitor"],
) | 9 | 0.5 | 6 | 3 |
7ad60dd24f24f2d36e988d94495a53e4f32a83e1 | templates/footer.php | templates/footer.php | <nav>
<ul id="menu-footer" class="menu">
<li class="menu-all-government-blogs"><a href="https://www.blog.gov.uk">All GOV.UK blogs</a></li>
<li class="menu-all-government-blog-posts"><a href="https://www.blog.gov.uk/all-posts/">All GOV.UK blog posts</a></li>
<li class="menu-gov-uk"><a href="https://www.gov.uk">GOV.UK</a></li>
<li class="menu-all-departments"><a href="https://www.gov.uk/government/organisations">All departments</a></li>
<li class="menu-all-policies"><a href="https://www.gov.uk/government/policies">All policies</a></li>
<li class="menu-cookies"><a href="https://www.blog.gov.uk/cookies">Cookies</a></li>
</ul>
</nav>
| <nav>
<ul id="menu-footer" class="menu">
<li class="menu-all-government-blogs"><a href="https://www.blog.gov.uk">All GOV.UK blogs</a></li>
<li class="menu-all-government-blog-posts"><a href="https://www.blog.gov.uk/all-posts/">All GOV.UK blog posts</a></li>
<li class="menu-gov-uk"><a href="https://www.gov.uk">GOV.UK</a></li>
<li class="menu-all-departments"><a href="https://www.gov.uk/government/organisations">All departments</a></li>
<li class="menu-all-policies"><a href="https://www.gov.uk/government/policies">All policies</a></li>
<li class="menu-cookies"><a href="https://www.blog.gov.uk/cookies">Cookies</a></li>
<li class="menu-a11y"><a href="/accessibility-statement/">Accessibility statement</a></li>
</ul>
</nav>
| Add link to a11y statement | Add link to a11y statement
This is a legal requirement for the client.
Resolves: https://dxw.zendesk.com/agent/tickets/10049
Resolves: https://trello.com/c/SJFUZtxT
| PHP | mit | dxw/govuk-blogs,dxw/govuk-blogs,dxw/govuk-blogs | php | ## Code Before:
<nav>
<ul id="menu-footer" class="menu">
<li class="menu-all-government-blogs"><a href="https://www.blog.gov.uk">All GOV.UK blogs</a></li>
<li class="menu-all-government-blog-posts"><a href="https://www.blog.gov.uk/all-posts/">All GOV.UK blog posts</a></li>
<li class="menu-gov-uk"><a href="https://www.gov.uk">GOV.UK</a></li>
<li class="menu-all-departments"><a href="https://www.gov.uk/government/organisations">All departments</a></li>
<li class="menu-all-policies"><a href="https://www.gov.uk/government/policies">All policies</a></li>
<li class="menu-cookies"><a href="https://www.blog.gov.uk/cookies">Cookies</a></li>
</ul>
</nav>
## Instruction:
Add link to a11y statement
This is a legal requirement for the client.
Resolves: https://dxw.zendesk.com/agent/tickets/10049
Resolves: https://trello.com/c/SJFUZtxT
## Code After:
<nav>
<ul id="menu-footer" class="menu">
<li class="menu-all-government-blogs"><a href="https://www.blog.gov.uk">All GOV.UK blogs</a></li>
<li class="menu-all-government-blog-posts"><a href="https://www.blog.gov.uk/all-posts/">All GOV.UK blog posts</a></li>
<li class="menu-gov-uk"><a href="https://www.gov.uk">GOV.UK</a></li>
<li class="menu-all-departments"><a href="https://www.gov.uk/government/organisations">All departments</a></li>
<li class="menu-all-policies"><a href="https://www.gov.uk/government/policies">All policies</a></li>
<li class="menu-cookies"><a href="https://www.blog.gov.uk/cookies">Cookies</a></li>
<li class="menu-a11y"><a href="/accessibility-statement/">Accessibility statement</a></li>
</ul>
</nav>
| <nav>
<ul id="menu-footer" class="menu">
<li class="menu-all-government-blogs"><a href="https://www.blog.gov.uk">All GOV.UK blogs</a></li>
<li class="menu-all-government-blog-posts"><a href="https://www.blog.gov.uk/all-posts/">All GOV.UK blog posts</a></li>
<li class="menu-gov-uk"><a href="https://www.gov.uk">GOV.UK</a></li>
<li class="menu-all-departments"><a href="https://www.gov.uk/government/organisations">All departments</a></li>
<li class="menu-all-policies"><a href="https://www.gov.uk/government/policies">All policies</a></li>
<li class="menu-cookies"><a href="https://www.blog.gov.uk/cookies">Cookies</a></li>
+ <li class="menu-a11y"><a href="/accessibility-statement/">Accessibility statement</a></li>
</ul>
</nav> | 1 | 0.1 | 1 | 0 |
383f81ca1ab515ae4a490eec27ad43b4ce18a609 | src/SimplePanel.scss | src/SimplePanel.scss | .slate-simplepanel {
border-radius: 0 0 .25em .25em;
box-shadow: 0 .125em .25em rgba(black, (1/6));
overflow: hidden;
&.is-loading {
min-height: 150px;
}
.empty-text {
padding: 1.5em;
text-align: center;
}
}
.slate-simplepanel-header {
background-color: #999;
border-radius: .25em .25em 0 0;
color: $panel-header-color;
padding: .75em 1em;
.x-btn {
border: none;
}
}
.slate-simplepanel-title {
font-family: $heading-font;
font-size: 1.375em;
font-weight: normal;
line-height: 1;
padding-top: .125em;
-webkit-font-smoothing: antialiased;
small {
color: mix($base-color, $panel-header-color, 30%);
font-size: .675em;
margin-left: .25em;
text-transform: uppercase;
}
}
.slate-simplepanel-body {
padding: 0 1em;
} | .slate-simplepanel {
border-radius: 0 0 .25em .25em;
box-shadow: 0 .125em .25em rgba(black, (1/6));
overflow: hidden;
&.is-loading {
min-height: 150px;
}
.empty-text {
padding: 1.5em;
text-align: center;
}
}
.slate-simplepanel-header {
background-color: #999;
border-radius: .25em .25em 0 0;
color: $panel-header-color;
padding: .75em 1em;
.x-btn {
border: none;
}
}
.slate-simplepanel-title {
font-family: $heading-font;
font-size: 1.375em;
font-weight: normal;
line-height: 1;
padding-top: .25em;
text-shadow: 0 1px 1px rgba(black, .3);
-webkit-font-smoothing: antialiased;
small {
color: mix($base-color, $panel-header-color, 30%);
font-size: .675em;
font-weight: bold;
letter-spacing: .01em;
margin-left: .75em;
text-transform: uppercase;
}
}
.slate-simplepanel-body {
padding: 0 1em;
} | Make simplepanel titles a little nicer | Make simplepanel titles a little nicer
| SCSS | mit | SlateFoundation/slate,SlateFoundation/slate,SlateFoundation/slate,SlateFoundation/slate,SlateFoundation/slate | scss | ## Code Before:
.slate-simplepanel {
border-radius: 0 0 .25em .25em;
box-shadow: 0 .125em .25em rgba(black, (1/6));
overflow: hidden;
&.is-loading {
min-height: 150px;
}
.empty-text {
padding: 1.5em;
text-align: center;
}
}
.slate-simplepanel-header {
background-color: #999;
border-radius: .25em .25em 0 0;
color: $panel-header-color;
padding: .75em 1em;
.x-btn {
border: none;
}
}
.slate-simplepanel-title {
font-family: $heading-font;
font-size: 1.375em;
font-weight: normal;
line-height: 1;
padding-top: .125em;
-webkit-font-smoothing: antialiased;
small {
color: mix($base-color, $panel-header-color, 30%);
font-size: .675em;
margin-left: .25em;
text-transform: uppercase;
}
}
.slate-simplepanel-body {
padding: 0 1em;
}
## Instruction:
Make simplepanel titles a little nicer
## Code After:
.slate-simplepanel {
border-radius: 0 0 .25em .25em;
box-shadow: 0 .125em .25em rgba(black, (1/6));
overflow: hidden;
&.is-loading {
min-height: 150px;
}
.empty-text {
padding: 1.5em;
text-align: center;
}
}
.slate-simplepanel-header {
background-color: #999;
border-radius: .25em .25em 0 0;
color: $panel-header-color;
padding: .75em 1em;
.x-btn {
border: none;
}
}
.slate-simplepanel-title {
font-family: $heading-font;
font-size: 1.375em;
font-weight: normal;
line-height: 1;
padding-top: .25em;
text-shadow: 0 1px 1px rgba(black, .3);
-webkit-font-smoothing: antialiased;
small {
color: mix($base-color, $panel-header-color, 30%);
font-size: .675em;
font-weight: bold;
letter-spacing: .01em;
margin-left: .75em;
text-transform: uppercase;
}
}
.slate-simplepanel-body {
padding: 0 1em;
} | .slate-simplepanel {
border-radius: 0 0 .25em .25em;
box-shadow: 0 .125em .25em rgba(black, (1/6));
overflow: hidden;
&.is-loading {
min-height: 150px;
}
.empty-text {
padding: 1.5em;
text-align: center;
}
}
.slate-simplepanel-header {
background-color: #999;
border-radius: .25em .25em 0 0;
color: $panel-header-color;
padding: .75em 1em;
.x-btn {
border: none;
}
}
.slate-simplepanel-title {
font-family: $heading-font;
font-size: 1.375em;
font-weight: normal;
line-height: 1;
- padding-top: .125em;
? -
+ padding-top: .25em;
+ text-shadow: 0 1px 1px rgba(black, .3);
-webkit-font-smoothing: antialiased;
small {
color: mix($base-color, $panel-header-color, 30%);
font-size: .675em;
+ font-weight: bold;
+ letter-spacing: .01em;
- margin-left: .25em;
? ^
+ margin-left: .75em;
? ^
text-transform: uppercase;
}
}
.slate-simplepanel-body {
padding: 0 1em;
} | 7 | 0.155556 | 5 | 2 |
290075a3ab040d4b15155f5d2d29c2ecccdd07dc | packages/@sanity/form-builder/src/sanity/inputResolver/resolveReference.js | packages/@sanity/form-builder/src/sanity/inputResolver/resolveReference.js | import {ReferenceInput} from '../../index'
import {materializeReferences, referenceSearch, fetch} from '../data/fetch'
import {once} from 'lodash'
import {materializeForPreview, resolveRefType} from 'part:@sanity/base/preview'
const ReferenceBrowser = ReferenceInput.createBrowser({
fetch,
materializeReferences
})
export function materializeReference(id) {
return materializeReferences([id]).then(res => res[0])
}
function valueToString(value, type) {
return resolveRefType(value, type)
.then(refType => materializeForPreview(value, refType))
.then(res => res.title)
}
const ReferenceSearchableSelect = ReferenceInput.createSearchableSelect({
search: referenceSearch,
valueToString: valueToString
})
const ReferenceSelect = ReferenceInput.createSelect({
fetchAll: fetch,
materializeReferences
})
// eslint-disable-next-line no-console
const warnNoSearchYet = once(() => console.warn('Reference browser does not yet support search'))
export default function resolveReference(type) {
const options = type.options || {}
if (options.inputType === 'select') {
return options.searchable
? ReferenceSearchableSelect
: ReferenceSelect
}
if (options.inputType === 'browser') {
if (options.searchable) {
warnNoSearchYet()
}
return ReferenceBrowser
}
return ReferenceSearchableSelect
}
| import {ReferenceInput} from '../../index'
import {materializeReferences, referenceSearch, fetch} from '../data/fetch'
import {once} from 'lodash'
import {observeForPreview, resolveRefType} from 'part:@sanity/base/preview'
const ReferenceBrowser = ReferenceInput.createBrowser({
fetch,
materializeReferences
})
export function materializeReference(id) {
return materializeReferences([id]).then(res => res[0])
}
function observableToPromise(observable) {
return new Promise((resolve, reject) => {
const subscription = observable.subscribe({
next: val => {
subscription.unsubscribe()
resolve(val)
},
error: reject
})
})
}
function valueToString(value, type) {
return resolveRefType(value, type)
.then(refType => observableToPromise(observeForPreview(value, refType)))
.then(res => res.title)
}
const ReferenceSearchableSelect = ReferenceInput.createSearchableSelect({
search: referenceSearch,
valueToString: valueToString
})
const ReferenceSelect = ReferenceInput.createSelect({
fetchAll: fetch,
materializeReferences
})
// eslint-disable-next-line no-console
const warnNoSearchYet = once(() => console.warn('Reference browser does not yet support search'))
export default function resolveReference(type) {
const options = type.options || {}
if (options.inputType === 'select') {
return options.searchable
? ReferenceSearchableSelect
: ReferenceSelect
}
if (options.inputType === 'browser') {
if (options.searchable) {
warnNoSearchYet()
}
return ReferenceBrowser
}
return ReferenceSearchableSelect
}
| Fix broken references wrt previews | [form-builder] Fix broken references wrt previews
| JavaScript | mit | sanity-io/sanity,sanity-io/sanity,sanity-io/sanity,sanity-io/sanity | javascript | ## Code Before:
import {ReferenceInput} from '../../index'
import {materializeReferences, referenceSearch, fetch} from '../data/fetch'
import {once} from 'lodash'
import {materializeForPreview, resolveRefType} from 'part:@sanity/base/preview'
const ReferenceBrowser = ReferenceInput.createBrowser({
fetch,
materializeReferences
})
export function materializeReference(id) {
return materializeReferences([id]).then(res => res[0])
}
function valueToString(value, type) {
return resolveRefType(value, type)
.then(refType => materializeForPreview(value, refType))
.then(res => res.title)
}
const ReferenceSearchableSelect = ReferenceInput.createSearchableSelect({
search: referenceSearch,
valueToString: valueToString
})
const ReferenceSelect = ReferenceInput.createSelect({
fetchAll: fetch,
materializeReferences
})
// eslint-disable-next-line no-console
const warnNoSearchYet = once(() => console.warn('Reference browser does not yet support search'))
export default function resolveReference(type) {
const options = type.options || {}
if (options.inputType === 'select') {
return options.searchable
? ReferenceSearchableSelect
: ReferenceSelect
}
if (options.inputType === 'browser') {
if (options.searchable) {
warnNoSearchYet()
}
return ReferenceBrowser
}
return ReferenceSearchableSelect
}
## Instruction:
[form-builder] Fix broken references wrt previews
## Code After:
import {ReferenceInput} from '../../index'
import {materializeReferences, referenceSearch, fetch} from '../data/fetch'
import {once} from 'lodash'
import {observeForPreview, resolveRefType} from 'part:@sanity/base/preview'
const ReferenceBrowser = ReferenceInput.createBrowser({
fetch,
materializeReferences
})
export function materializeReference(id) {
return materializeReferences([id]).then(res => res[0])
}
function observableToPromise(observable) {
return new Promise((resolve, reject) => {
const subscription = observable.subscribe({
next: val => {
subscription.unsubscribe()
resolve(val)
},
error: reject
})
})
}
function valueToString(value, type) {
return resolveRefType(value, type)
.then(refType => observableToPromise(observeForPreview(value, refType)))
.then(res => res.title)
}
const ReferenceSearchableSelect = ReferenceInput.createSearchableSelect({
search: referenceSearch,
valueToString: valueToString
})
const ReferenceSelect = ReferenceInput.createSelect({
fetchAll: fetch,
materializeReferences
})
// eslint-disable-next-line no-console
const warnNoSearchYet = once(() => console.warn('Reference browser does not yet support search'))
export default function resolveReference(type) {
const options = type.options || {}
if (options.inputType === 'select') {
return options.searchable
? ReferenceSearchableSelect
: ReferenceSelect
}
if (options.inputType === 'browser') {
if (options.searchable) {
warnNoSearchYet()
}
return ReferenceBrowser
}
return ReferenceSearchableSelect
}
| import {ReferenceInput} from '../../index'
import {materializeReferences, referenceSearch, fetch} from '../data/fetch'
import {once} from 'lodash'
- import {materializeForPreview, resolveRefType} from 'part:@sanity/base/preview'
? ^^^ ^^^^^
+ import {observeForPreview, resolveRefType} from 'part:@sanity/base/preview'
? ^^^ ^
const ReferenceBrowser = ReferenceInput.createBrowser({
fetch,
materializeReferences
})
export function materializeReference(id) {
return materializeReferences([id]).then(res => res[0])
}
+ function observableToPromise(observable) {
+ return new Promise((resolve, reject) => {
+ const subscription = observable.subscribe({
+ next: val => {
+ subscription.unsubscribe()
+ resolve(val)
+ },
+ error: reject
+ })
+ })
+ }
function valueToString(value, type) {
return resolveRefType(value, type)
- .then(refType => materializeForPreview(value, refType))
? ^^^ ^^^^
+ .then(refType => observableToPromise(observeForPreview(value, refType)))
? ^^^ +++++++++++ ^^^^^^^^^ +
.then(res => res.title)
}
const ReferenceSearchableSelect = ReferenceInput.createSearchableSelect({
search: referenceSearch,
valueToString: valueToString
})
const ReferenceSelect = ReferenceInput.createSelect({
fetchAll: fetch,
materializeReferences
})
// eslint-disable-next-line no-console
const warnNoSearchYet = once(() => console.warn('Reference browser does not yet support search'))
export default function resolveReference(type) {
const options = type.options || {}
if (options.inputType === 'select') {
return options.searchable
? ReferenceSearchableSelect
: ReferenceSelect
}
if (options.inputType === 'browser') {
if (options.searchable) {
warnNoSearchYet()
}
return ReferenceBrowser
}
return ReferenceSearchableSelect
} | 15 | 0.288462 | 13 | 2 |
bdf8cd4b02531eac63e30564d0e1400903ecff9d | tests/glob.js | tests/glob.js | 'use strict';
var expect = require('chai').expect,
fs = require('fs'),
uncss = require('../lib/uncss');
describe('Using globbing patterns', function () {
it('should find both index pages in the directory and return the used CSS for both of them', function (done) {
this.timeout(25000);
uncss(['tests/glob/**/*.html'], function (err, output) {
expect(err).to.be.null;
expect(output).to.exist;
expect(output).to.contain('h1');
expect(output).to.contain('h2');
expect(output).not.to.contain('h3');
expect(output).not.to.contain('h4');
expect(output).not.to.contain('h5');
expect(output).not.to.contain('h6');
done();
});
});
});
| 'use strict';
var expect = require('chai').expect,
uncss = require('../lib/uncss');
describe('Using globbing patterns', function () {
it('should find both index pages in the directory and return the used CSS for both of them', function (done) {
this.timeout(25000);
uncss(['tests/glob/**/*.html'], function (err, output) {
expect(err).to.be.null;
expect(output).to.exist;
expect(output).to.contain('h1');
expect(output).to.contain('h2');
expect(output).not.to.contain('h3');
expect(output).not.to.contain('h4');
expect(output).not.to.contain('h5');
expect(output).not.to.contain('h6');
done();
});
});
});
| Remove fs from test dependencies. | Remove fs from test dependencies.
| JavaScript | mit | Renji/uncss,rafaelducati/uncss,webdev1001/uncss,cantyjeffrey/uncss,pingjiang/uncss,webdev1001/uncss,charaplessa/uncss,sdgdsffdsfff/uncss,TheNotary/uncss,joecritch/uncss,rafaelducati/uncss,joecritch/uncss,SteveGriffith/uncss,TheNotary/uncss,cantyjeffrey/uncss,Renji/uncss,sdgdsffdsfff/uncss,giakki/uncss,SteveGriffith/uncss,charaplessa/uncss,giakki/uncss,pingjiang/uncss | javascript | ## Code Before:
'use strict';
var expect = require('chai').expect,
fs = require('fs'),
uncss = require('../lib/uncss');
describe('Using globbing patterns', function () {
it('should find both index pages in the directory and return the used CSS for both of them', function (done) {
this.timeout(25000);
uncss(['tests/glob/**/*.html'], function (err, output) {
expect(err).to.be.null;
expect(output).to.exist;
expect(output).to.contain('h1');
expect(output).to.contain('h2');
expect(output).not.to.contain('h3');
expect(output).not.to.contain('h4');
expect(output).not.to.contain('h5');
expect(output).not.to.contain('h6');
done();
});
});
});
## Instruction:
Remove fs from test dependencies.
## Code After:
'use strict';
var expect = require('chai').expect,
uncss = require('../lib/uncss');
describe('Using globbing patterns', function () {
it('should find both index pages in the directory and return the used CSS for both of them', function (done) {
this.timeout(25000);
uncss(['tests/glob/**/*.html'], function (err, output) {
expect(err).to.be.null;
expect(output).to.exist;
expect(output).to.contain('h1');
expect(output).to.contain('h2');
expect(output).not.to.contain('h3');
expect(output).not.to.contain('h4');
expect(output).not.to.contain('h5');
expect(output).not.to.contain('h6');
done();
});
});
});
| 'use strict';
var expect = require('chai').expect,
- fs = require('fs'),
uncss = require('../lib/uncss');
describe('Using globbing patterns', function () {
it('should find both index pages in the directory and return the used CSS for both of them', function (done) {
this.timeout(25000);
uncss(['tests/glob/**/*.html'], function (err, output) {
expect(err).to.be.null;
expect(output).to.exist;
expect(output).to.contain('h1');
expect(output).to.contain('h2');
expect(output).not.to.contain('h3');
expect(output).not.to.contain('h4');
expect(output).not.to.contain('h5');
expect(output).not.to.contain('h6');
done();
});
});
}); | 1 | 0.041667 | 0 | 1 |
94baa9eadd05038a343bfd99f01493123f5a1526 | lib/history.zsh | lib/history.zsh | if [ -z "$HISTFILE" ]; then
HISTFILE=$HOME/.zsh_history
fi
HISTSIZE=10000
SAVEHIST=10000
## History wrapper
function omz_history {
# Delete the history file if `-c' argument provided.
# This won't affect the `history' command output until the next login.
if [[ "${@[(i)-c]}" -le $# ]]; then
echo -n >| "$HISTFILE"
echo >&2 History file deleted. Reload the session to see its effects.
else
fc $@ -l 1
fi
}
# Timestamp format
case $HIST_STAMPS in
"mm/dd/yyyy") alias history='omz_history -f' ;;
"dd.mm.yyyy") alias history='omz_history -E' ;;
"yyyy-mm-dd") alias history='omz_history -i' ;;
*) alias history='omz_history' ;;
esac
setopt append_history
setopt extended_history
setopt hist_expire_dups_first
setopt hist_ignore_dups # ignore duplication command history list
setopt hist_ignore_space
setopt hist_verify
setopt inc_append_history
setopt share_history # share command history data
| [ -z "$HISTFILE" ] && HISTFILE="$HOME/.zsh_history"
HISTSIZE=10000
SAVEHIST=10000
## History wrapper
function omz_history {
# Delete the history file if `-c' argument provided.
# This won't affect the `history' command output until the next login.
if [[ "${@[(i)-c]}" -le $# ]]; then
echo -n >| "$HISTFILE"
echo >&2 History file deleted. Reload the session to see its effects.
else
fc $@ -l 1
fi
}
# Timestamp format
case $HIST_STAMPS in
"mm/dd/yyyy") alias history='omz_history -f' ;;
"dd.mm.yyyy") alias history='omz_history -E' ;;
"yyyy-mm-dd") alias history='omz_history -i' ;;
*) alias history='omz_history' ;;
esac
setopt append_history
setopt extended_history
setopt hist_expire_dups_first
setopt hist_ignore_dups # ignore duplication command history list
setopt hist_ignore_space
setopt hist_verify
setopt inc_append_history
setopt share_history # share command history data
| Simplify `if' into oneliner, allow spaces in HISTFILE | Simplify `if' into oneliner, allow spaces in HISTFILE
| Shell | mit | adrianchen19888/oh-my-zsh,jdob/oh-my-zsh,apjanke/oh-my-zsh,chinaran/oh-my-zsh,thearthur/.oh-my-zsh,alexduros/oh-my-zsh,jplandrain/oh-my-zsh,kaethorn/oh-my-zsh,stansage/oh-my-zsh,macmantrl/oh-my-zsh,data219/oh-my-zsh,tonydeng/oh-my-zsh,macmantrl/oh-my-zsh,mroth23/oh-my-zsh,johnamiahford/oh-my-zsh,friederbluemle/oh-my-zsh,safx/oh-my-zsh,stuha/wbr-zsh,AlexSatrapa/oh-my-zsh,fdelacruz/oh-my-zsh,cmalard/oh-my-zsh,unphased/oh-my-zsh,mikeatkins/oh-my-zsh,bryteise/oh-my-zsh,adrianchen19888/oh-my-zsh,cmoore/oh-my-zsh,tompson/oh-my-zsh,stevenspasbo/oh-my-zsh,unphased/oh-my-zsh,nunogt/oh-my-zsh,data219/oh-my-zsh,spazm/oh-my-zsh,apjanke/oh-my-zsh,ornicar/oh-my-zsh,alienth/oh-my-zsh,alex-quiterio/my-zsh,grahame/oh-my-zsh,rxfork/oh-my-zsh,tompson/oh-my-zsh,rxfork/oh-my-zsh,jplandrain/oh-my-zsh,xiaogaozi/oh-my-zsh,nunogt/oh-my-zsh,Pance/oh-my-zsh,ttelford/oh-my-zsh,CoRfr/oh-my-zsh,rarescosma/oh-my-zsh,amilaperera/oh-my-zsh,monological/oh-my-zsh,erwinvaneijk/oh-my-zsh,grahame/oh-my-zsh,pietrushnic/oh-my-zsh,eyenx/omzsh,quixoten/oh-my-zsh,aaronbieber/oh-my-zsh,cristianstu/oh-my-zsh,maojj/oh-my-zsh,elliottt/oh-my-zsh,friederbluemle/oh-my-zsh,lucho-yankov/oh-my-zsh,mikeatkins/oh-my-zsh,justhsu/oh-my-zsh,apjanke/oh-my-zsh,alperyeg/oh-my-zsh,ShadowStar/oh-my-zsh,abiggs/oh-my-zsh,duikboot/oh-my-zsh,kasyaar/oh-my-zsh,erwinvaneijk/oh-my-zsh,genehack/oh-my-zsh,jplandrain/oh-my-zsh,matthewberryman/oh-my-zsh,miconof/oh-my-zsh,cmoore/oh-my-zsh,namdq/oh-my-zsh,lsv/oh-my-zsh,dekimsey/oh-my-zsh,tuxlife/oh-my-zsh,duikboot/oh-my-zsh,lsv/oh-my-zsh,brianarn/oh-my-zsh,Pance/oh-my-zsh,monological/oh-my-zsh,svein/oh-my-zsh,patrickshan/oh-my-zsh,mbologna/oh-my-zsh,moul/oh-my-zsh,lucho-yankov/oh-my-zsh,lstolowski/oh-my-zsh,alexduros/oh-my-zsh,justhsu/oh-my-zsh,genehack/oh-my-zsh,benofbrown/oh-my-zsh,honnix/oh-my-zsh,adrianchen19888/oh-my-zsh,eyenx/omzsh,jimrthy/oh-my-zsh,jlauinger/oh-my-zsh,lsv/oh-my-zsh,jdob/oh-my-zsh,duikboot/oh-my-zsh,jhannah/oh-my-zsh,tompson/oh-my-zsh,lululau/oh-my-zsh,btolsch/oh-my-zsh,mbologna/oh-my-zsh,jimrthy/oh-my-zsh,alex-quiterio/my-zsh,hoggarth/oh-my-zsh,johnamiahford/oh-my-zsh,grahame/oh-my-zsh,lesterchan/oh-my-zsh,kevunix/oh-my-zsh,adrianchen19888/oh-my-zsh,stansage/oh-my-zsh,benofbrown/oh-my-zsh,brianarn/oh-my-zsh,cjwirth/oh-my-zsh,cmalard/oh-my-zsh,gerardo/oh-my-zsh,dekimsey/oh-my-zsh,amilaperera/oh-my-zsh,ibatullin/oh-my-zsh,alexduros/oh-my-zsh,fdelacruz/oh-my-zsh,jhannah/oh-my-zsh,kevunix/oh-my-zsh,namdq/oh-my-zsh,genehack/oh-my-zsh,dpoggi/oh-my-zsh,jimrthy/oh-my-zsh,ryanneufeld/oh-my-zsh,lululau/oh-my-zsh,kasyaar/oh-my-zsh,fran-penedo/oh-my-zsh,btolsch/oh-my-zsh,twleung/oh-my-zsh,jdob/oh-my-zsh,ornicar/oh-my-zsh,sparticvs/oh-my-zsh,alexduros/oh-my-zsh,robbyrussell/oh-my-zsh,kaethorn/oh-my-zsh,leafty/oh-my-zsh,ShadowStar/oh-my-zsh,bhongy/oh-my-zsh,sankara/oh-my-zsh,fdelacruz/oh-my-zsh,yusiwen/oh-my-zsh,alienth/oh-my-zsh,lucho-yankov/oh-my-zsh,robbyrussell/oh-my-zsh,RavuAlHemio/oh-my-zsh,tuxlife/oh-my-zsh,bhongy/oh-my-zsh,alex-quiterio/my-zsh,NeoTheFox/oh-my-zsh,krafczyk/oh-my-zsh,monological/oh-my-zsh,NeoTheFox/oh-my-zsh,ttelford/oh-my-zsh,johnamiahford/oh-my-zsh,madhead/oh-my-zsh,NeoTheFox/oh-my-zsh,ibatullin/oh-my-zsh,apjanke/oh-my-zsh,CoRfr/oh-my-zsh,akaivola/oh-my-zsh,namdq/oh-my-zsh,justhsu/oh-my-zsh,friederbluemle/oh-my-zsh,Seinh/oh-my-zsh,jevinskie/oh-my-zsh,kancelott/oh-my-zsh,rarescosma/oh-my-zsh,ksaynice/oh-my-zsh,codingjester/oh-my-zsh,camillobruni/oh-my-zsh,miconof/oh-my-zsh,btolsch/oh-my-zsh,patrickshan/oh-my-zsh,mlapin/oh-my-zsh,RavuAlHemio/oh-my-zsh,gerardo/oh-my-zsh,camillobruni/oh-my-zsh,exhuma/oh-my-zsh,ohlol/oh-my-zsh,leafty/oh-my-zsh,fran-penedo/oh-my-zsh,akaivola/oh-my-zsh,monological/oh-my-zsh,kasyaar/zsh_config,amilaperera/oh-my-zsh,chinaran/oh-my-zsh,alex-quiterio/my-zsh,jameszhan/oh-my-zsh,crazycode/oh-my-zsh,andreychernih/oh-my-zsh,alienth/oh-my-zsh,cmalard/oh-my-zsh,drench/oh-my-zsh,svein/oh-my-zsh,drench/oh-my-zsh,jevinskie/oh-my-zsh,dpoggi/oh-my-zsh,genehack/oh-my-zsh,benofbrown/oh-my-zsh,stansage/oh-my-zsh,mzgol/oh-my-zsh,duikboot/oh-my-zsh,Seinh/oh-my-zsh,miconof/oh-my-zsh,ryanneufeld/oh-my-zsh,hoggarth/oh-my-zsh,rarescosma/oh-my-zsh,Seinh/oh-my-zsh,andreychernih/oh-my-zsh,twleung/oh-my-zsh,robbyrussell/oh-my-zsh,mroth23/oh-my-zsh,macmantrl/oh-my-zsh,Pance/oh-my-zsh,Pance/oh-my-zsh,upperbounds/oh-my-zsh,ornicar/oh-my-zsh,ksaynice/oh-my-zsh,fran-penedo/oh-my-zsh,fdelacruz/oh-my-zsh,safx/oh-my-zsh,benofbrown/oh-my-zsh,alienth/oh-my-zsh,codingjester/oh-my-zsh,kasyaar/oh-my-zsh,dekimsey/oh-my-zsh,amilaperera/oh-my-zsh,exhuma/oh-my-zsh,kaethorn/oh-my-zsh,maojj/oh-my-zsh,alperyeg/oh-my-zsh,kevunix/oh-my-zsh,ahmadassaf/oh-my-zsh,mroth23/oh-my-zsh,safx/oh-my-zsh,mbologna/oh-my-zsh,tompson/oh-my-zsh,cjwirth/oh-my-zsh,kancelott/oh-my-zsh,bryteise/oh-my-zsh,spazm/oh-my-zsh,crazycode/oh-my-zsh,fran-penedo/oh-my-zsh,Fisiu/oh-my-zsh,rovere/oh-my-zsh,AlexSatrapa/oh-my-zsh,jlauinger/oh-my-zsh,mlapin/oh-my-zsh,tonydeng/oh-my-zsh,jplandrain/oh-my-zsh,mzgol/oh-my-zsh,stansage/oh-my-zsh,eiginn/oh-my-zsh,moul/oh-my-zsh,kasyaar/zsh_config,lsv/oh-my-zsh,pietrushnic/oh-my-zsh,mzgol/oh-my-zsh,mrpatrick/oh-my-zsh,friederbluemle/oh-my-zsh,spazm/oh-my-zsh,NeoTheFox/oh-my-zsh,grahame/oh-my-zsh,rovere/oh-my-zsh,exhuma/oh-my-zsh,yusiwen/oh-my-zsh,mroth23/oh-my-zsh,btolsch/oh-my-zsh,thearthur/.oh-my-zsh,ornicar/oh-my-zsh,elliottt/oh-my-zsh,CromFr/crom-custom-oh-my-zsh,exhuma/oh-my-zsh,mrpatrick/oh-my-zsh,jimrthy/oh-my-zsh,cjwirth/oh-my-zsh,madhead/oh-my-zsh,mikeatkins/oh-my-zsh,krafczyk/oh-my-zsh,pietrushnic/oh-my-zsh,stevenspasbo/oh-my-zsh,twleung/oh-my-zsh,upperbounds/oh-my-zsh,xiaogaozi/oh-my-zsh,jlauinger/oh-my-zsh,jameszhan/oh-my-zsh,namdq/oh-my-zsh,twleung/oh-my-zsh,Fisiu/oh-my-zsh,lstolowski/oh-my-zsh,elliottt/oh-my-zsh,cristianstu/oh-my-zsh,mrpatrick/oh-my-zsh,lesterchan/oh-my-zsh,aaronbieber/oh-my-zsh,CromFr/crom-custom-oh-my-zsh,mrpatrick/oh-my-zsh,abiggs/oh-my-zsh,lsv/oh-my-zsh,cmalard/oh-my-zsh,CoRfr/oh-my-zsh,brianarn/oh-my-zsh,mbologna/oh-my-zsh,sankara/oh-my-zsh,Fisiu/oh-my-zsh,Seinh/oh-my-zsh,CoRfr/oh-my-zsh,sparticvs/oh-my-zsh,mzgol/oh-my-zsh,jdob/oh-my-zsh,honnix/oh-my-zsh,eiginn/oh-my-zsh,camillobruni/oh-my-zsh,akaivola/oh-my-zsh,justhsu/oh-my-zsh,kaethorn/oh-my-zsh,ksaynice/oh-my-zsh,dekimsey/oh-my-zsh,sparticvs/oh-my-zsh,cjwirth/oh-my-zsh,thearthur/.oh-my-zsh,akaivola/oh-my-zsh,elliottt/oh-my-zsh,matthewberryman/oh-my-zsh,quixoten/oh-my-zsh,miconof/oh-my-zsh,thearthur/.oh-my-zsh,ohlol/oh-my-zsh,brianarn/oh-my-zsh,ahmadassaf/oh-my-zsh,johnamiahford/oh-my-zsh,robbyrussell/oh-my-zsh,chinaran/oh-my-zsh,macmantrl/oh-my-zsh | shell | ## Code Before:
if [ -z "$HISTFILE" ]; then
HISTFILE=$HOME/.zsh_history
fi
HISTSIZE=10000
SAVEHIST=10000
## History wrapper
function omz_history {
# Delete the history file if `-c' argument provided.
# This won't affect the `history' command output until the next login.
if [[ "${@[(i)-c]}" -le $# ]]; then
echo -n >| "$HISTFILE"
echo >&2 History file deleted. Reload the session to see its effects.
else
fc $@ -l 1
fi
}
# Timestamp format
case $HIST_STAMPS in
"mm/dd/yyyy") alias history='omz_history -f' ;;
"dd.mm.yyyy") alias history='omz_history -E' ;;
"yyyy-mm-dd") alias history='omz_history -i' ;;
*) alias history='omz_history' ;;
esac
setopt append_history
setopt extended_history
setopt hist_expire_dups_first
setopt hist_ignore_dups # ignore duplication command history list
setopt hist_ignore_space
setopt hist_verify
setopt inc_append_history
setopt share_history # share command history data
## Instruction:
Simplify `if' into oneliner, allow spaces in HISTFILE
## Code After:
[ -z "$HISTFILE" ] && HISTFILE="$HOME/.zsh_history"
HISTSIZE=10000
SAVEHIST=10000
## History wrapper
function omz_history {
# Delete the history file if `-c' argument provided.
# This won't affect the `history' command output until the next login.
if [[ "${@[(i)-c]}" -le $# ]]; then
echo -n >| "$HISTFILE"
echo >&2 History file deleted. Reload the session to see its effects.
else
fc $@ -l 1
fi
}
# Timestamp format
case $HIST_STAMPS in
"mm/dd/yyyy") alias history='omz_history -f' ;;
"dd.mm.yyyy") alias history='omz_history -E' ;;
"yyyy-mm-dd") alias history='omz_history -i' ;;
*) alias history='omz_history' ;;
esac
setopt append_history
setopt extended_history
setopt hist_expire_dups_first
setopt hist_ignore_dups # ignore duplication command history list
setopt hist_ignore_space
setopt hist_verify
setopt inc_append_history
setopt share_history # share command history data
| - if [ -z "$HISTFILE" ]; then
- HISTFILE=$HOME/.zsh_history
+ [ -z "$HISTFILE" ] && HISTFILE="$HOME/.zsh_history"
? + ++ +++++++++++ ++++ + +
- fi
-
HISTSIZE=10000
SAVEHIST=10000
## History wrapper
function omz_history {
# Delete the history file if `-c' argument provided.
# This won't affect the `history' command output until the next login.
if [[ "${@[(i)-c]}" -le $# ]]; then
echo -n >| "$HISTFILE"
echo >&2 History file deleted. Reload the session to see its effects.
else
fc $@ -l 1
fi
}
# Timestamp format
case $HIST_STAMPS in
"mm/dd/yyyy") alias history='omz_history -f' ;;
"dd.mm.yyyy") alias history='omz_history -E' ;;
"yyyy-mm-dd") alias history='omz_history -i' ;;
*) alias history='omz_history' ;;
esac
setopt append_history
setopt extended_history
setopt hist_expire_dups_first
setopt hist_ignore_dups # ignore duplication command history list
setopt hist_ignore_space
setopt hist_verify
setopt inc_append_history
setopt share_history # share command history data | 5 | 0.142857 | 1 | 4 |
1a78a1e8a8b323fe34ef21e9b4cc8184379809f3 | src/JpegEnc/stdafx.h | src/JpegEnc/stdafx.h | // stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#include "targetver.h"
#include <stdio.h>
#include <tchar.h>
// TODO: reference additional headers your program requires here
| // stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#include "targetver.h"
#include <cassert>
| Remove unused headers and add cassert to PCH. | Remove unused headers and add cassert to PCH.
| C | bsd-3-clause | dwarfcrank/yolo-dangerzone,dwarfcrank/yolo-dangerzone | c | ## Code Before:
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#include "targetver.h"
#include <stdio.h>
#include <tchar.h>
// TODO: reference additional headers your program requires here
## Instruction:
Remove unused headers and add cassert to PCH.
## Code After:
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#include "targetver.h"
#include <cassert>
| // stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#include "targetver.h"
+ #include <cassert>
- #include <stdio.h>
- #include <tchar.h>
-
-
-
- // TODO: reference additional headers your program requires here | 7 | 0.466667 | 1 | 6 |
a9594a4bab9c4f1c49e0a2eda3374666249be38e | lib/effective_logging/email_logger.rb | lib/effective_logging/email_logger.rb | module EffectiveLogging
class EmailLogger
def self.delivering_email(message)
return unless message.present?
# collect a Hash of arguments used to invoke EffectiveLogger.success
logged_fields = { from: message.from.join(','), to: message.to, subject: message.subject }
# Add a log header to your mailer to pass some objects or additional things to EffectiveLogger
# mail(to: 'admin@example.com', subject: @post.title, log: { post: @post })
if message.header['log'].present?
# This is a bit sketchy, but gives access to the object in Rails 4.2 anyway
logged_fields.merge!(message.header['log'].instance_variable_get(:@value) || {})
# Get rid of the extra header, as it should not be set in the real mail message.
message.header['log'] = nil
end
body = (message.body.try(:parts) || []).find { |part| part.content_type.to_s.downcase.include?('text/html') }
logged_fields[:email] = "#{message.header}<hr>#{(body.presence || message.body)}"
(message.to || []).each do |to|
logged_fields[:to] = to
logged_fields[:associated] ||= (User.where(email: to).first rescue nil)
::EffectiveLogger.email("#{message.subject} - #{message.to.join(', ')}", logged_fields)
end
end
end
end
| module EffectiveLogging
class EmailLogger
def self.delivering_email(message)
return unless message.present?
# collect a Hash of arguments used to invoke EffectiveLogger.success
logged_fields = { from: message.from.join(','), to: message.to, subject: message.subject }
# Add a log header to your mailer to pass some objects or additional things to EffectiveLogger
# mail(to: 'admin@example.com', subject: @post.title, log: { post: @post })
if message.header['log'].present?
# This is a bit sketchy, but gives access to the object in Rails 4.2 anyway
logged_fields.merge!(message.header['log'].instance_variable_get(:@value) || {})
# Get rid of the extra header, as it should not be set in the real mail message.
message.header['log'] = nil
end
body = (message.body.try(:parts) || []).find { |part| part.content_type.to_s.downcase.include?('text/html') }
logged_fields[:email] = "#{message.header}<hr>#{(body.presence || message.body)}"
(message.to || []).each do |to|
user = (User.where(email: to).first rescue nil)
logged_fields[:to] = to
logged_fields[:associated] ||= user
logged_fields[:user] ||= user
::EffectiveLogger.email("#{message.subject} - #{message.to.join(', ')}", logged_fields)
end
end
end
end
| Set user and associated when logging emails | Set user and associated when logging emails
| Ruby | mit | code-and-effect/effective_logging,code-and-effect/effective_logging,code-and-effect/effective_logging | ruby | ## Code Before:
module EffectiveLogging
class EmailLogger
def self.delivering_email(message)
return unless message.present?
# collect a Hash of arguments used to invoke EffectiveLogger.success
logged_fields = { from: message.from.join(','), to: message.to, subject: message.subject }
# Add a log header to your mailer to pass some objects or additional things to EffectiveLogger
# mail(to: 'admin@example.com', subject: @post.title, log: { post: @post })
if message.header['log'].present?
# This is a bit sketchy, but gives access to the object in Rails 4.2 anyway
logged_fields.merge!(message.header['log'].instance_variable_get(:@value) || {})
# Get rid of the extra header, as it should not be set in the real mail message.
message.header['log'] = nil
end
body = (message.body.try(:parts) || []).find { |part| part.content_type.to_s.downcase.include?('text/html') }
logged_fields[:email] = "#{message.header}<hr>#{(body.presence || message.body)}"
(message.to || []).each do |to|
logged_fields[:to] = to
logged_fields[:associated] ||= (User.where(email: to).first rescue nil)
::EffectiveLogger.email("#{message.subject} - #{message.to.join(', ')}", logged_fields)
end
end
end
end
## Instruction:
Set user and associated when logging emails
## Code After:
module EffectiveLogging
class EmailLogger
def self.delivering_email(message)
return unless message.present?
# collect a Hash of arguments used to invoke EffectiveLogger.success
logged_fields = { from: message.from.join(','), to: message.to, subject: message.subject }
# Add a log header to your mailer to pass some objects or additional things to EffectiveLogger
# mail(to: 'admin@example.com', subject: @post.title, log: { post: @post })
if message.header['log'].present?
# This is a bit sketchy, but gives access to the object in Rails 4.2 anyway
logged_fields.merge!(message.header['log'].instance_variable_get(:@value) || {})
# Get rid of the extra header, as it should not be set in the real mail message.
message.header['log'] = nil
end
body = (message.body.try(:parts) || []).find { |part| part.content_type.to_s.downcase.include?('text/html') }
logged_fields[:email] = "#{message.header}<hr>#{(body.presence || message.body)}"
(message.to || []).each do |to|
user = (User.where(email: to).first rescue nil)
logged_fields[:to] = to
logged_fields[:associated] ||= user
logged_fields[:user] ||= user
::EffectiveLogger.email("#{message.subject} - #{message.to.join(', ')}", logged_fields)
end
end
end
end
| module EffectiveLogging
class EmailLogger
def self.delivering_email(message)
return unless message.present?
# collect a Hash of arguments used to invoke EffectiveLogger.success
logged_fields = { from: message.from.join(','), to: message.to, subject: message.subject }
# Add a log header to your mailer to pass some objects or additional things to EffectiveLogger
# mail(to: 'admin@example.com', subject: @post.title, log: { post: @post })
if message.header['log'].present?
# This is a bit sketchy, but gives access to the object in Rails 4.2 anyway
logged_fields.merge!(message.header['log'].instance_variable_get(:@value) || {})
# Get rid of the extra header, as it should not be set in the real mail message.
message.header['log'] = nil
end
body = (message.body.try(:parts) || []).find { |part| part.content_type.to_s.downcase.include?('text/html') }
logged_fields[:email] = "#{message.header}<hr>#{(body.presence || message.body)}"
(message.to || []).each do |to|
+ user = (User.where(email: to).first rescue nil)
+
logged_fields[:to] = to
- logged_fields[:associated] ||= (User.where(email: to).first rescue nil)
+ logged_fields[:associated] ||= user
+ logged_fields[:user] ||= user
::EffectiveLogger.email("#{message.subject} - #{message.to.join(', ')}", logged_fields)
end
end
end
end | 5 | 0.15625 | 4 | 1 |
80e3398a7aea29d604c4ed6f53423e7a82629d50 | espresso/src/main/java/com/elpassion/android/commons/espresso/matchers/TextInputEditTextHintMatcher.kt | espresso/src/main/java/com/elpassion/android/commons/espresso/matchers/TextInputEditTextHintMatcher.kt | package com.elpassion.android.commons.espresso.matchers
import android.support.design.widget.TextInputEditText
import android.support.design.widget.TextInputLayout
import android.support.test.espresso.matcher.BoundedMatcher
import android.view.View
import org.hamcrest.Description
class TextInputEditTextHintMatcher(private val hintStringId: Int) : BoundedMatcher<View, TextInputEditText>(TextInputEditText::class.java) {
override fun matchesSafely(view: TextInputEditText): Boolean {
val grandpa = view.parent?.parent
if (grandpa is TextInputLayout) {
return grandpa.hint == view.context.getString(hintStringId)
}
return false
}
override fun describeTo(description: Description) {
description.appendText("has hint text from string resource on TextInputLayout: $hintStringId")
}
} | package com.elpassion.android.commons.espresso.matchers
import android.support.annotation.StringRes
import android.support.design.widget.TextInputEditText
import android.support.design.widget.TextInputLayout
import android.support.test.espresso.matcher.BoundedMatcher
import android.view.View
import org.hamcrest.Description
class TextInputEditTextHintMatcher(@StringRes private val textId: Int) : BoundedMatcher<View, TextInputEditText>(TextInputEditText::class.java) {
override fun matchesSafely(view: TextInputEditText): Boolean {
val grandpa = view.parent?.parent
if (grandpa is TextInputLayout) {
return grandpa.hint == view.context.getString(textId)
}
return false
}
override fun describeTo(description: Description) {
description.appendText("has hint text from string resource on TextInputLayout: $textId")
}
} | Apply CR: apply consistent naming | Apply CR: apply consistent naming
| Kotlin | apache-2.0 | elpassion/android-commons,elpassion/android-commons,elpassion/android-commons | kotlin | ## Code Before:
package com.elpassion.android.commons.espresso.matchers
import android.support.design.widget.TextInputEditText
import android.support.design.widget.TextInputLayout
import android.support.test.espresso.matcher.BoundedMatcher
import android.view.View
import org.hamcrest.Description
class TextInputEditTextHintMatcher(private val hintStringId: Int) : BoundedMatcher<View, TextInputEditText>(TextInputEditText::class.java) {
override fun matchesSafely(view: TextInputEditText): Boolean {
val grandpa = view.parent?.parent
if (grandpa is TextInputLayout) {
return grandpa.hint == view.context.getString(hintStringId)
}
return false
}
override fun describeTo(description: Description) {
description.appendText("has hint text from string resource on TextInputLayout: $hintStringId")
}
}
## Instruction:
Apply CR: apply consistent naming
## Code After:
package com.elpassion.android.commons.espresso.matchers
import android.support.annotation.StringRes
import android.support.design.widget.TextInputEditText
import android.support.design.widget.TextInputLayout
import android.support.test.espresso.matcher.BoundedMatcher
import android.view.View
import org.hamcrest.Description
class TextInputEditTextHintMatcher(@StringRes private val textId: Int) : BoundedMatcher<View, TextInputEditText>(TextInputEditText::class.java) {
override fun matchesSafely(view: TextInputEditText): Boolean {
val grandpa = view.parent?.parent
if (grandpa is TextInputLayout) {
return grandpa.hint == view.context.getString(textId)
}
return false
}
override fun describeTo(description: Description) {
description.appendText("has hint text from string resource on TextInputLayout: $textId")
}
} | package com.elpassion.android.commons.espresso.matchers
+ import android.support.annotation.StringRes
import android.support.design.widget.TextInputEditText
import android.support.design.widget.TextInputLayout
import android.support.test.espresso.matcher.BoundedMatcher
import android.view.View
import org.hamcrest.Description
- class TextInputEditTextHintMatcher(private val hintStringId: Int) : BoundedMatcher<View, TextInputEditText>(TextInputEditText::class.java) {
? --- ^ ----
+ class TextInputEditTextHintMatcher(@StringRes private val textId: Int) : BoundedMatcher<View, TextInputEditText>(TextInputEditText::class.java) {
? +++++++++++ ^^
override fun matchesSafely(view: TextInputEditText): Boolean {
val grandpa = view.parent?.parent
if (grandpa is TextInputLayout) {
- return grandpa.hint == view.context.getString(hintStringId)
? --- ^ ----
+ return grandpa.hint == view.context.getString(textId)
? ^^
}
return false
}
override fun describeTo(description: Description) {
- description.appendText("has hint text from string resource on TextInputLayout: $hintStringId")
? --- ^ ----
+ description.appendText("has hint text from string resource on TextInputLayout: $textId")
? ^^
}
} | 7 | 0.318182 | 4 | 3 |
6ca15b8314e137f9839e47d31969a97293a48cd6 | Twig/Extension/MarkdownTwigExtension.php | Twig/Extension/MarkdownTwigExtension.php | <?php
namespace Knp\Bundle\MarkdownBundle\Twig\Extension;
use Knp\Bundle\MarkdownBundle\Helper\MarkdownHelper;
class MarkdownTwigExtension extends \Twig_Extension
{
protected $helper;
function __construct(MarkdownHelper $helper)
{
$this->helper = $helper;
}
public function getFilters()
{
return array(
'markdown' => new \Twig_Filter_Method($this, 'markdown', array('is_safe' => array('html'))),
);
}
public function markdown($text, $parser = null)
{
return $this->helper->transform($text, $parser);
}
public function getName()
{
return 'markdown';
}
}
| <?php
namespace Knp\Bundle\MarkdownBundle\Twig\Extension;
use Knp\Bundle\MarkdownBundle\Helper\MarkdownHelper;
class MarkdownTwigExtension extends \Twig_Extension
{
protected $helper;
public function __construct(MarkdownHelper $helper)
{
$this->helper = $helper;
}
public function getFilters()
{
return array(
return new \Twig_SimpleFilter('markdown', array($this, 'markdown'), array('is_safe' => array('html'))),
);
}
public function markdown($text, $parser = null)
{
return $this->helper->transform($text, $parser);
}
public function getName()
{
return 'markdown';
}
}
| Switch the Twig integration to use non-deprecated APIs | Switch the Twig integration to use non-deprecated APIs | PHP | mit | gencer/KnpMarkdownBundle,KnpLabs/KnpMarkdownBundle | php | ## Code Before:
<?php
namespace Knp\Bundle\MarkdownBundle\Twig\Extension;
use Knp\Bundle\MarkdownBundle\Helper\MarkdownHelper;
class MarkdownTwigExtension extends \Twig_Extension
{
protected $helper;
function __construct(MarkdownHelper $helper)
{
$this->helper = $helper;
}
public function getFilters()
{
return array(
'markdown' => new \Twig_Filter_Method($this, 'markdown', array('is_safe' => array('html'))),
);
}
public function markdown($text, $parser = null)
{
return $this->helper->transform($text, $parser);
}
public function getName()
{
return 'markdown';
}
}
## Instruction:
Switch the Twig integration to use non-deprecated APIs
## Code After:
<?php
namespace Knp\Bundle\MarkdownBundle\Twig\Extension;
use Knp\Bundle\MarkdownBundle\Helper\MarkdownHelper;
class MarkdownTwigExtension extends \Twig_Extension
{
protected $helper;
public function __construct(MarkdownHelper $helper)
{
$this->helper = $helper;
}
public function getFilters()
{
return array(
return new \Twig_SimpleFilter('markdown', array($this, 'markdown'), array('is_safe' => array('html'))),
);
}
public function markdown($text, $parser = null)
{
return $this->helper->transform($text, $parser);
}
public function getName()
{
return 'markdown';
}
}
| <?php
namespace Knp\Bundle\MarkdownBundle\Twig\Extension;
use Knp\Bundle\MarkdownBundle\Helper\MarkdownHelper;
class MarkdownTwigExtension extends \Twig_Extension
{
protected $helper;
- function __construct(MarkdownHelper $helper)
+ public function __construct(MarkdownHelper $helper)
? +++++++
{
$this->helper = $helper;
}
public function getFilters()
{
return array(
- 'markdown' => new \Twig_Filter_Method($this, 'markdown', array('is_safe' => array('html'))),
? --- ^^^^ ---- ^^^^^ ^
+ return new \Twig_SimpleFilter('markdown', array($this, 'markdown'), array('is_safe' => array('html'))),
? ^^^^ ++++++ ^^^^^^^ ^^^^^^^^^^ +
);
}
public function markdown($text, $parser = null)
{
return $this->helper->transform($text, $parser);
}
public function getName()
{
return 'markdown';
}
} | 4 | 0.125 | 2 | 2 |
938c3207b0943ce53e58e6268c9c3e97fd000f89 | src/main.rs | src/main.rs | use std::process::Command;
use std::os::unix::process::CommandExt;
fn main() {
Command::new("java")
.arg("-Xms512m")
.arg("-Xmx1536m")
.arg("-Xss2m")
.args(&["-jar", "/Users/dnw/.sbt/launchers/0.13.13/sbt-launch.jar"])
.arg("shell")
.exec();
}
| use std::process::Command;
use std::process::exit;
use std::os::unix::process::CommandExt;
fn main() {
let err = Command::new("java")
.arg("-Xms512m")
.arg("-Xmx1536m")
.arg("-Xss2m")
.args(&["-jar", "/Users/dnw/.sbt/launchers/0.13.13/sbt-launch.jar"])
.arg("shell")
.exec();
println!("error: {}", err);
if let Some(err) = err.raw_os_error() {
exit(err);
}
exit(-1)
}
| Handle failure to exec command | Handle failure to exec command
| Rust | apache-2.0 | dwijnand/sbtl,dwijnand/sbtl | rust | ## Code Before:
use std::process::Command;
use std::os::unix::process::CommandExt;
fn main() {
Command::new("java")
.arg("-Xms512m")
.arg("-Xmx1536m")
.arg("-Xss2m")
.args(&["-jar", "/Users/dnw/.sbt/launchers/0.13.13/sbt-launch.jar"])
.arg("shell")
.exec();
}
## Instruction:
Handle failure to exec command
## Code After:
use std::process::Command;
use std::process::exit;
use std::os::unix::process::CommandExt;
fn main() {
let err = Command::new("java")
.arg("-Xms512m")
.arg("-Xmx1536m")
.arg("-Xss2m")
.args(&["-jar", "/Users/dnw/.sbt/launchers/0.13.13/sbt-launch.jar"])
.arg("shell")
.exec();
println!("error: {}", err);
if let Some(err) = err.raw_os_error() {
exit(err);
}
exit(-1)
}
| use std::process::Command;
+ use std::process::exit;
use std::os::unix::process::CommandExt;
fn main() {
- Command::new("java")
+ let err = Command::new("java")
? ++++++++++
.arg("-Xms512m")
.arg("-Xmx1536m")
.arg("-Xss2m")
.args(&["-jar", "/Users/dnw/.sbt/launchers/0.13.13/sbt-launch.jar"])
.arg("shell")
.exec();
+ println!("error: {}", err);
+ if let Some(err) = err.raw_os_error() {
+ exit(err);
+ }
+ exit(-1)
} | 8 | 0.666667 | 7 | 1 |
81ba488c3a2d3f9336b8e278c7b1159c1bc2c2ff | public/ts/ConnectState.ts | public/ts/ConnectState.ts | module Scuffle {
export class ConnectState extends Phaser.State {
game : Game
create() {
var group = this.add.group()
group.alpha = 0
var text = this.add.text(this.world.centerX, this.world.centerY,
this.game.socket === undefined ? 'Connecting' : 'Reconnecting',
undefined, group)
text.anchor.setTo(0.5, 0.5)
text.font = 'Iceland'
text.fontSize = 60
text.fill = '#acf'
var tween = this.add.tween(group).to({ alpha: 1 }, 500, Phaser.Easing.Linear.None, true)
tween.onComplete.add(() => {
if(this.game.socket === undefined)
this.game.socket = io.connect('http://yellow.shockk.co.uk:1337')
this.game.socket.once('connect', () => {
var tween = this.add.tween(group).to({ alpha: 0 }, 500, Phaser.Easing.Linear.None, true)
tween.onComplete.add(() => this.game.state.start('Preload'))
})
this.game.socket.on('disconnect', () => this.game.state.start('Connect'))
})
}
}
}
| module Scuffle {
export class ConnectState extends Phaser.State {
game : Game
create() {
var group = this.add.group()
group.alpha = 0
var text = this.add.text(this.world.centerX, this.world.centerY,
this.game.socket === undefined ? 'Connecting' : 'Reconnecting',
undefined, group)
text.anchor.setTo(0.5, 0.5)
text.font = 'Iceland'
text.fontSize = 60
text.fill = '#acf'
var tween = this.add.tween(group).to({ alpha: 1 }, 500, Phaser.Easing.Linear.None, true)
tween.onComplete.add(() => {
if(this.game.socket === undefined)
this.game.socket = io.connect('http://yellow.shockk.co.uk:1337')
else
this.game.socket.removeAllListeners()
this.game.socket.once('connect', () => {
var tween = this.add.tween(group).to({ alpha: 0 }, 500, Phaser.Easing.Linear.None, true)
tween.onComplete.add(() => this.game.state.start('Preload'))
})
this.game.socket.once('disconnect', () => this.game.state.start('Connect'))
})
}
}
}
| Remove listeners on reconnection, only fire disconnect event once | Remove listeners on reconnection, only fire disconnect event once
| TypeScript | apache-2.0 | shockkolate/scuffle,shockkolate/scuffle,shockkolate/scuffle | typescript | ## Code Before:
module Scuffle {
export class ConnectState extends Phaser.State {
game : Game
create() {
var group = this.add.group()
group.alpha = 0
var text = this.add.text(this.world.centerX, this.world.centerY,
this.game.socket === undefined ? 'Connecting' : 'Reconnecting',
undefined, group)
text.anchor.setTo(0.5, 0.5)
text.font = 'Iceland'
text.fontSize = 60
text.fill = '#acf'
var tween = this.add.tween(group).to({ alpha: 1 }, 500, Phaser.Easing.Linear.None, true)
tween.onComplete.add(() => {
if(this.game.socket === undefined)
this.game.socket = io.connect('http://yellow.shockk.co.uk:1337')
this.game.socket.once('connect', () => {
var tween = this.add.tween(group).to({ alpha: 0 }, 500, Phaser.Easing.Linear.None, true)
tween.onComplete.add(() => this.game.state.start('Preload'))
})
this.game.socket.on('disconnect', () => this.game.state.start('Connect'))
})
}
}
}
## Instruction:
Remove listeners on reconnection, only fire disconnect event once
## Code After:
module Scuffle {
export class ConnectState extends Phaser.State {
game : Game
create() {
var group = this.add.group()
group.alpha = 0
var text = this.add.text(this.world.centerX, this.world.centerY,
this.game.socket === undefined ? 'Connecting' : 'Reconnecting',
undefined, group)
text.anchor.setTo(0.5, 0.5)
text.font = 'Iceland'
text.fontSize = 60
text.fill = '#acf'
var tween = this.add.tween(group).to({ alpha: 1 }, 500, Phaser.Easing.Linear.None, true)
tween.onComplete.add(() => {
if(this.game.socket === undefined)
this.game.socket = io.connect('http://yellow.shockk.co.uk:1337')
else
this.game.socket.removeAllListeners()
this.game.socket.once('connect', () => {
var tween = this.add.tween(group).to({ alpha: 0 }, 500, Phaser.Easing.Linear.None, true)
tween.onComplete.add(() => this.game.state.start('Preload'))
})
this.game.socket.once('disconnect', () => this.game.state.start('Connect'))
})
}
}
}
| module Scuffle {
export class ConnectState extends Phaser.State {
game : Game
create() {
var group = this.add.group()
group.alpha = 0
var text = this.add.text(this.world.centerX, this.world.centerY,
this.game.socket === undefined ? 'Connecting' : 'Reconnecting',
undefined, group)
text.anchor.setTo(0.5, 0.5)
text.font = 'Iceland'
text.fontSize = 60
text.fill = '#acf'
var tween = this.add.tween(group).to({ alpha: 1 }, 500, Phaser.Easing.Linear.None, true)
tween.onComplete.add(() => {
if(this.game.socket === undefined)
this.game.socket = io.connect('http://yellow.shockk.co.uk:1337')
+ else
+ this.game.socket.removeAllListeners()
this.game.socket.once('connect', () => {
var tween = this.add.tween(group).to({ alpha: 0 }, 500, Phaser.Easing.Linear.None, true)
tween.onComplete.add(() => this.game.state.start('Preload'))
})
- this.game.socket.on('disconnect', () => this.game.state.start('Connect'))
+ this.game.socket.once('disconnect', () => this.game.state.start('Connect'))
? ++
})
}
}
} | 4 | 0.133333 | 3 | 1 |
fcc8f763c1cd486da1a80176996a342245288d35 | src/libstate/engine/openssl/eng_ossl.cpp | src/libstate/engine/openssl/eng_ossl.cpp |
/**
* Look for an OpenSSL-suported stream cipher (ARC4)
*/
StreamCipher*
OpenSSL_Engine::find_stream_cipher(const std::string& algo_spec) const
{
SCAN_Name request(algo_spec);
if(request.algo_name() == "ARC4")
return new ARC4_OpenSSL(request.argument_as_u32bit(0, 0));
if(request.algo_name() == "RC4_drop")
return new ARC4_OpenSSL(768);
return 0;
}
| /**
OpenSSL Engine
(C) 2008 Jack Lloyd
*/
#include <botan/eng_ossl.h>
namespace Botan {
/**
* Look for an OpenSSL-suported stream cipher (ARC4)
*/
StreamCipher*
OpenSSL_Engine::find_stream_cipher(const std::string& algo_spec) const
{
SCAN_Name request(algo_spec);
if(request.algo_name() == "ARC4")
return new ARC4_OpenSSL(request.argument_as_u32bit(0, 0));
if(request.algo_name() == "RC4_drop")
return new ARC4_OpenSSL(768);
return 0;
}
}
| Fix include, add namespace and copyright | Fix include, add namespace and copyright
| C++ | bsd-2-clause | Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,webmaster128/botan,webmaster128/botan,webmaster128/botan,webmaster128/botan,randombit/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan | c++ | ## Code Before:
/**
* Look for an OpenSSL-suported stream cipher (ARC4)
*/
StreamCipher*
OpenSSL_Engine::find_stream_cipher(const std::string& algo_spec) const
{
SCAN_Name request(algo_spec);
if(request.algo_name() == "ARC4")
return new ARC4_OpenSSL(request.argument_as_u32bit(0, 0));
if(request.algo_name() == "RC4_drop")
return new ARC4_OpenSSL(768);
return 0;
}
## Instruction:
Fix include, add namespace and copyright
## Code After:
/**
OpenSSL Engine
(C) 2008 Jack Lloyd
*/
#include <botan/eng_ossl.h>
namespace Botan {
/**
* Look for an OpenSSL-suported stream cipher (ARC4)
*/
StreamCipher*
OpenSSL_Engine::find_stream_cipher(const std::string& algo_spec) const
{
SCAN_Name request(algo_spec);
if(request.algo_name() == "ARC4")
return new ARC4_OpenSSL(request.argument_as_u32bit(0, 0));
if(request.algo_name() == "RC4_drop")
return new ARC4_OpenSSL(768);
return 0;
}
}
| + /**
+ OpenSSL Engine
+ (C) 2008 Jack Lloyd
+ */
+
+ #include <botan/eng_ossl.h>
+
+ namespace Botan {
/**
* Look for an OpenSSL-suported stream cipher (ARC4)
*/
StreamCipher*
OpenSSL_Engine::find_stream_cipher(const std::string& algo_spec) const
{
SCAN_Name request(algo_spec);
if(request.algo_name() == "ARC4")
return new ARC4_OpenSSL(request.argument_as_u32bit(0, 0));
if(request.algo_name() == "RC4_drop")
return new ARC4_OpenSSL(768);
return 0;
}
+
+ } | 10 | 0.625 | 10 | 0 |
1404db367b331eae1dbb0f56804d1623745d0f52 | .travis.yml | .travis.yml | language: python
sudo: false
script: ./scripts/travis.sh
os:
- linux
python:
- 3.5
- 3.6
- 3.7
services:
- memcached
- redis-server
| language: python
sudo: false
script: ./scripts/travis.sh
os:
- linux
python:
- 3.5
- 3.6
# not supported by travis yet.
# - 3.7
services:
- memcached
- redis-server
| Remove (Unsupported) Python 3.7 From Travis | Remove (Unsupported) Python 3.7 From Travis
| YAML | bsd-3-clause | datafolklabs/cement,datafolklabs/cement,datafolklabs/cement | yaml | ## Code Before:
language: python
sudo: false
script: ./scripts/travis.sh
os:
- linux
python:
- 3.5
- 3.6
- 3.7
services:
- memcached
- redis-server
## Instruction:
Remove (Unsupported) Python 3.7 From Travis
## Code After:
language: python
sudo: false
script: ./scripts/travis.sh
os:
- linux
python:
- 3.5
- 3.6
# not supported by travis yet.
# - 3.7
services:
- memcached
- redis-server
| language: python
sudo: false
script: ./scripts/travis.sh
os:
- linux
python:
- 3.5
- 3.6
+ # not supported by travis yet.
- - 3.7
+ # - 3.7
? ++
services:
- memcached
- redis-server
| 3 | 0.230769 | 2 | 1 |
e74840fcd3b6204f3dd65f5151729a646aeefe3a | src/client/app/components/basket/basket.template.js | src/client/app/components/basket/basket.template.js | export class BasketTemplate {
static update(render, state, events) {
const headerClasses = "fw6 bb b--black-20 tl pb1 pr1 bg-white";
const trClasses = "pv1 pr1 bb b--black-20";
/* eslint-disable indent */
render`
<h2>Basket</h2>
<input id="assetsSearch" size="32" oninput="${events}" placeholder="What assets to be added?">
<table class="f7 mw8 pa2" cellpsacing="0">
<thead>
<th class="${headerClasses}">Symbol</th>
<th class="${headerClasses}">Description</th>
<th class="${headerClasses}">Type</th>
<th class="${headerClasses}">Market</th>
</thead>
<tbody onclick="${events}" >${state.assetsSearch.map(asset =>
`<tr>
<td id="assetSearch-${asset.symbol}"
class="${trClasses} pointer dim"
data-value='${escape(JSON.stringify(asset))}'
title="Click to add the asset">${asset.symbol}</td>
<td class="${trClasses}">${asset.name}</td>
<td class="${trClasses}">${asset.type}</td>
<td class="${trClasses}">${asset.exchDisp}</td>
</tr>`)
}</tbody>
</table>
`;
/* eslint-enable indent */
}
}
| import { Util } from "../../util.js";
export class BasketTemplate {
static update(render, state, events) {
const headerClasses = "fw6 bb b--black-20 tl pb1 pr1 bg-white";
const trClasses = "pv1 pr1 bb b--black-20";
/* eslint-disable indent */
render`
<h2>Basket</h2>
<input id="assetsSearch" size="32" oninput="${events}" placeholder="What assets to be added?">
<table style="${Util.show(state.assetsSearch.length)}" class="f7 mw8 pa2" cellpsacing="0">
<thead>
<th class="${headerClasses}">Symbol</th>
<th class="${headerClasses}">Description</th>
<th class="${headerClasses}">Type</th>
<th class="${headerClasses}">Market</th>
</thead>
<tbody onclick="${events}" >${state.assetsSearch.map(asset =>
`<tr>
<td id="assetSearch-${asset.symbol}"
class="${trClasses} pointer dim"
data-value='${escape(JSON.stringify(asset))}'
title="Click to add the asset">${asset.symbol}</td>
<td class="${trClasses}">${asset.name}</td>
<td class="${trClasses}">${asset.type}</td>
<td class="${trClasses}">${asset.exchDisp}</td>
</tr>`)
}</tbody>
</table>
`;
/* eslint-enable indent */
}
}
| Hide basket table if no search assets. | Hide basket table if no search assets.
| JavaScript | mit | albertosantini/node-conpa,albertosantini/node-conpa | javascript | ## Code Before:
export class BasketTemplate {
static update(render, state, events) {
const headerClasses = "fw6 bb b--black-20 tl pb1 pr1 bg-white";
const trClasses = "pv1 pr1 bb b--black-20";
/* eslint-disable indent */
render`
<h2>Basket</h2>
<input id="assetsSearch" size="32" oninput="${events}" placeholder="What assets to be added?">
<table class="f7 mw8 pa2" cellpsacing="0">
<thead>
<th class="${headerClasses}">Symbol</th>
<th class="${headerClasses}">Description</th>
<th class="${headerClasses}">Type</th>
<th class="${headerClasses}">Market</th>
</thead>
<tbody onclick="${events}" >${state.assetsSearch.map(asset =>
`<tr>
<td id="assetSearch-${asset.symbol}"
class="${trClasses} pointer dim"
data-value='${escape(JSON.stringify(asset))}'
title="Click to add the asset">${asset.symbol}</td>
<td class="${trClasses}">${asset.name}</td>
<td class="${trClasses}">${asset.type}</td>
<td class="${trClasses}">${asset.exchDisp}</td>
</tr>`)
}</tbody>
</table>
`;
/* eslint-enable indent */
}
}
## Instruction:
Hide basket table if no search assets.
## Code After:
import { Util } from "../../util.js";
export class BasketTemplate {
static update(render, state, events) {
const headerClasses = "fw6 bb b--black-20 tl pb1 pr1 bg-white";
const trClasses = "pv1 pr1 bb b--black-20";
/* eslint-disable indent */
render`
<h2>Basket</h2>
<input id="assetsSearch" size="32" oninput="${events}" placeholder="What assets to be added?">
<table style="${Util.show(state.assetsSearch.length)}" class="f7 mw8 pa2" cellpsacing="0">
<thead>
<th class="${headerClasses}">Symbol</th>
<th class="${headerClasses}">Description</th>
<th class="${headerClasses}">Type</th>
<th class="${headerClasses}">Market</th>
</thead>
<tbody onclick="${events}" >${state.assetsSearch.map(asset =>
`<tr>
<td id="assetSearch-${asset.symbol}"
class="${trClasses} pointer dim"
data-value='${escape(JSON.stringify(asset))}'
title="Click to add the asset">${asset.symbol}</td>
<td class="${trClasses}">${asset.name}</td>
<td class="${trClasses}">${asset.type}</td>
<td class="${trClasses}">${asset.exchDisp}</td>
</tr>`)
}</tbody>
</table>
`;
/* eslint-enable indent */
}
}
| + import { Util } from "../../util.js";
+
export class BasketTemplate {
static update(render, state, events) {
const headerClasses = "fw6 bb b--black-20 tl pb1 pr1 bg-white";
const trClasses = "pv1 pr1 bb b--black-20";
/* eslint-disable indent */
render`
<h2>Basket</h2>
<input id="assetsSearch" size="32" oninput="${events}" placeholder="What assets to be added?">
- <table class="f7 mw8 pa2" cellpsacing="0">
+ <table style="${Util.show(state.assetsSearch.length)}" class="f7 mw8 pa2" cellpsacing="0">
<thead>
<th class="${headerClasses}">Symbol</th>
<th class="${headerClasses}">Description</th>
<th class="${headerClasses}">Type</th>
<th class="${headerClasses}">Market</th>
</thead>
<tbody onclick="${events}" >${state.assetsSearch.map(asset =>
`<tr>
<td id="assetSearch-${asset.symbol}"
class="${trClasses} pointer dim"
data-value='${escape(JSON.stringify(asset))}'
title="Click to add the asset">${asset.symbol}</td>
<td class="${trClasses}">${asset.name}</td>
<td class="${trClasses}">${asset.type}</td>
<td class="${trClasses}">${asset.exchDisp}</td>
</tr>`)
}</tbody>
</table>
`;
/* eslint-enable indent */
}
} | 4 | 0.117647 | 3 | 1 |
16bd36fe6fdcbd267413eabe1997337165775f28 | taOonja/game/admin.py | taOonja/game/admin.py | from django.contrib import admin
# Register your models here.
| from django.contrib import admin
from game.models import *
class LocationAdmin(admin.ModelAdmin):
model = Location
admin.site.register(Location, LocationAdmin)
class DetailAdmin(admin.ModelAdmin):
model = Detail
admin.site.register(Detail, DetailAdmin)
| Add models to Admin Panel | Add models to Admin Panel
| Python | mit | Javid-Izadfar/TaOonja,Javid-Izadfar/TaOonja,Javid-Izadfar/TaOonja | python | ## Code Before:
from django.contrib import admin
# Register your models here.
## Instruction:
Add models to Admin Panel
## Code After:
from django.contrib import admin
from game.models import *
class LocationAdmin(admin.ModelAdmin):
model = Location
admin.site.register(Location, LocationAdmin)
class DetailAdmin(admin.ModelAdmin):
model = Detail
admin.site.register(Detail, DetailAdmin)
| from django.contrib import admin
+ from game.models import *
- # Register your models here.
+ class LocationAdmin(admin.ModelAdmin):
+ model = Location
+
+ admin.site.register(Location, LocationAdmin)
+
+ class DetailAdmin(admin.ModelAdmin):
+
+ model = Detail
+
+ admin.site.register(Detail, DetailAdmin) | 12 | 4 | 11 | 1 |
a8eae9102b9c233142aa8d629d36a28cb129b65f | src/css/_objects.content.scss | src/css/_objects.content.scss | /*------------------------------------*\
#CONTENT
\*------------------------------------*/
/* Wrappers for the page's content.
*
* `.content-wrapper` is the main class that will hold all the page's content,
* then you use `.text-content` inside of it to put the text at the desired
* width.
*
* This is allows images to extend out past the content when placed as children
* of `.content-wrapper`
*
* Usage:
<div class="content-wrapper">
<!-- This image will be a larger width than the paragraph in the below
section. -->
<img src="/img/sample.png">
<section class="text-content">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aperiam
culpa libero provident itaque cum porro explicabo facilis, quae quod
repudiandae alias voluptatum velit fuga molestias aliquid iure, eos
mollitia! Voluptatum.</p>
</section>
</div>
*/
.content-wrapper,
.text-content {
margin: 0 auto;
}
.content-wrapper {
width: 680px;
}
.text-content {
width: 580px;
}
| /*------------------------------------*\
#CONTENT
\*------------------------------------*/
/* Wrappers for the page's content.
*
* `.content-wrapper` is the main class that will hold all the page's content,
* then you use `.text-content` inside of it to put the text at the desired
* width.
*
* This is allows images to extend out past the content when placed as children
* of `.content-wrapper`
*
* Usage:
<div class="content-wrapper">
<!-- This image will be a larger width than the paragraph in the below
section. -->
<img src="/img/sample.png">
<section class="text-content">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aperiam
culpa libero provident itaque cum porro explicabo facilis, quae quod
repudiandae alias voluptatum velit fuga molestias aliquid iure, eos
mollitia! Voluptatum.</p>
</section>
</div>
*/
.content-wrapper,
.text-content {
margin: 0 auto;
}
.content-wrapper {
width: 680px;
@include media-query(palm) {
max-width: 100%;
padding: 0 $small-spacing-unit;
}
}
.text-content {
width: 580px;
@include media-query(palm) {
max-width: 100%;
}
}
| Add some media queries so things are presentable on mobile | Add some media queries so things are presentable on mobile
| SCSS | mit | vocksel/my-website,VoxelDavid/voxeldavid-website,vocksel/my-website,VoxelDavid/voxeldavid-website | scss | ## Code Before:
/*------------------------------------*\
#CONTENT
\*------------------------------------*/
/* Wrappers for the page's content.
*
* `.content-wrapper` is the main class that will hold all the page's content,
* then you use `.text-content` inside of it to put the text at the desired
* width.
*
* This is allows images to extend out past the content when placed as children
* of `.content-wrapper`
*
* Usage:
<div class="content-wrapper">
<!-- This image will be a larger width than the paragraph in the below
section. -->
<img src="/img/sample.png">
<section class="text-content">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aperiam
culpa libero provident itaque cum porro explicabo facilis, quae quod
repudiandae alias voluptatum velit fuga molestias aliquid iure, eos
mollitia! Voluptatum.</p>
</section>
</div>
*/
.content-wrapper,
.text-content {
margin: 0 auto;
}
.content-wrapper {
width: 680px;
}
.text-content {
width: 580px;
}
## Instruction:
Add some media queries so things are presentable on mobile
## Code After:
/*------------------------------------*\
#CONTENT
\*------------------------------------*/
/* Wrappers for the page's content.
*
* `.content-wrapper` is the main class that will hold all the page's content,
* then you use `.text-content` inside of it to put the text at the desired
* width.
*
* This is allows images to extend out past the content when placed as children
* of `.content-wrapper`
*
* Usage:
<div class="content-wrapper">
<!-- This image will be a larger width than the paragraph in the below
section. -->
<img src="/img/sample.png">
<section class="text-content">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aperiam
culpa libero provident itaque cum porro explicabo facilis, quae quod
repudiandae alias voluptatum velit fuga molestias aliquid iure, eos
mollitia! Voluptatum.</p>
</section>
</div>
*/
.content-wrapper,
.text-content {
margin: 0 auto;
}
.content-wrapper {
width: 680px;
@include media-query(palm) {
max-width: 100%;
padding: 0 $small-spacing-unit;
}
}
.text-content {
width: 580px;
@include media-query(palm) {
max-width: 100%;
}
}
| /*------------------------------------*\
#CONTENT
\*------------------------------------*/
/* Wrappers for the page's content.
*
* `.content-wrapper` is the main class that will hold all the page's content,
* then you use `.text-content` inside of it to put the text at the desired
* width.
*
* This is allows images to extend out past the content when placed as children
* of `.content-wrapper`
*
* Usage:
<div class="content-wrapper">
<!-- This image will be a larger width than the paragraph in the below
section. -->
<img src="/img/sample.png">
<section class="text-content">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aperiam
culpa libero provident itaque cum porro explicabo facilis, quae quod
repudiandae alias voluptatum velit fuga molestias aliquid iure, eos
mollitia! Voluptatum.</p>
</section>
</div>
*/
.content-wrapper,
.text-content {
margin: 0 auto;
}
.content-wrapper {
width: 680px;
+
+ @include media-query(palm) {
+ max-width: 100%;
+ padding: 0 $small-spacing-unit;
+ }
}
.text-content {
width: 580px;
+
+ @include media-query(palm) {
+ max-width: 100%;
+ }
} | 9 | 0.219512 | 9 | 0 |
6f9afe65bf5cc982de59ce4579755e37c8009447 | README.md | README.md | Kevin Bacon's favourite reposotory
==================================
How far is an actor from Kevin Bacon?
## Setup
1. Make sure leiningen is installed
2. `brew install datomic`
3. Copy .lein-env.example to .lein-env
4. Copy dev/transactor.example.properties to dev/transactor.properties
5. In another pane, run `datomic-transactor $PWD/dev/transactor.properties`
6. Start a repl with `lein repl`
7. Within the repl, run `(go)`
You can now visit http://localhost:3000 to see the web app.
You also now have an empty datomic database.
| Kevin Bacon's favourite reposotory
==================================
How far is an actor from Kevin Bacon?
## Setup
1. Make sure leiningen is installed
2. `brew install datomic`
3. Copy .lein-env.example to .lein-env
4. Copy dev/transactor.example.properties to dev/transactor.properties
5. In another pane, run `datomic-transactor $PWD/dev/transactor.properties`
6. Start a repl with `lein repl`
7. Within the repl, run `(go)`
You can now visit http://localhost:3000 to see the web app.
You also now have an empty datomic database.
## Import
1. After you've run `(go)` in a repl, run the following:
(->> (slurp "resources/sample.edn")
read-string
(d/transact (-> system :db :conn)))
| Add instructions for sample data import | Add instructions for sample data import
| Markdown | epl-1.0 | jgdavey/kevin | markdown | ## Code Before:
Kevin Bacon's favourite reposotory
==================================
How far is an actor from Kevin Bacon?
## Setup
1. Make sure leiningen is installed
2. `brew install datomic`
3. Copy .lein-env.example to .lein-env
4. Copy dev/transactor.example.properties to dev/transactor.properties
5. In another pane, run `datomic-transactor $PWD/dev/transactor.properties`
6. Start a repl with `lein repl`
7. Within the repl, run `(go)`
You can now visit http://localhost:3000 to see the web app.
You also now have an empty datomic database.
## Instruction:
Add instructions for sample data import
## Code After:
Kevin Bacon's favourite reposotory
==================================
How far is an actor from Kevin Bacon?
## Setup
1. Make sure leiningen is installed
2. `brew install datomic`
3. Copy .lein-env.example to .lein-env
4. Copy dev/transactor.example.properties to dev/transactor.properties
5. In another pane, run `datomic-transactor $PWD/dev/transactor.properties`
6. Start a repl with `lein repl`
7. Within the repl, run `(go)`
You can now visit http://localhost:3000 to see the web app.
You also now have an empty datomic database.
## Import
1. After you've run `(go)` in a repl, run the following:
(->> (slurp "resources/sample.edn")
read-string
(d/transact (-> system :db :conn)))
| Kevin Bacon's favourite reposotory
==================================
How far is an actor from Kevin Bacon?
## Setup
1. Make sure leiningen is installed
2. `brew install datomic`
3. Copy .lein-env.example to .lein-env
4. Copy dev/transactor.example.properties to dev/transactor.properties
5. In another pane, run `datomic-transactor $PWD/dev/transactor.properties`
6. Start a repl with `lein repl`
7. Within the repl, run `(go)`
You can now visit http://localhost:3000 to see the web app.
You also now have an empty datomic database.
+ ## Import
+
+ 1. After you've run `(go)` in a repl, run the following:
+
+ (->> (slurp "resources/sample.edn")
+ read-string
+ (d/transact (-> system :db :conn))) | 7 | 0.388889 | 7 | 0 |
894df59d7068a65d30feab78029b73119fa8ecc6 | themes/sitesprocket/templates/Includes/ClientMessages.ss | themes/sitesprocket/templates/Includes/ClientMessages.ss | <div id="messages">
<% control Messages %>
<div class="project_messages">
<div class="post">
<div class="<% if You %>you<% else %>admin<% end_if %>">
<div class="title">
<strong><% if You %><% _t('SSP.YOU','You') %><% else %>$Author.FirstName<% end_if %></strong> said on $Created.Format(m-d-Y) at $Created.Format(h:i a)
</div>
<div class="body">
<div class="notes">
$MessageText
</div>
<% if Attachments %>
<ul class="uploads">
<% control Attachments %>
<li><em>$Name</em> <% _t('SSP.ATTACHED','uploaded') %> (<a href="$URL">download</a>)</li>
<% end_control %>
</ul>
<% end_if %>
<% if PaymentOption %>
<div class="payment">
<% control PaymentOption %>
<% if Paid %>
Added $Description for $Cost.Nice
<% else %>
<a href="$PayLink">Add $Description for $Cost.Nice</a>
<% end_if %>
<% end_control %>
</div>
<% end_if %>
</div>
</div>
</div>
</div>
<% end_control %>
</div>
| <div id="messages">
<% control Messages %>
<div class="project_messages">
<div class="post">
<div class="<% if You %>you<% else %>admin<% end_if %>">
<div class="title">
<strong><% if You %><% _t('SSP.YOU','You') %><% else %>$Author.FirstName<% end_if %></strong> said on $Created.Format(m-d-Y) at $Created.Format(h:i a)
</div>
<div class="body">
<div class="notes">
$MessageText
</div>
<% if Attachments %>
<ul class="uploads">
<% control Attachments %>
<li><em>$Name</em> <% _t('SSP.ATTACHED','uploaded') %> <a href="$URL">« download</a></li>
<% end_control %>
</ul>
<% end_if %>
<% if PaymentOption %>
<div class="payment">
<% control PaymentOption %>
<% if Paid %>
Added $Description for $Cost.Nice
<% else %>
<a href="$PayLink">Add $Description for $Cost.Nice</a>
<% end_if %>
<% end_control %>
</div>
<% end_if %>
</div>
</div>
</div>
</div>
<% end_control %>
</div>
| FIX - added laquo for downloads | FIX - added laquo for downloads
| Scheme | bsd-3-clause | tbarho/SiteSprocket,tbarho/SiteSprocket,tbarho/SiteSprocket,tbarho/SiteSprocket | scheme | ## Code Before:
<div id="messages">
<% control Messages %>
<div class="project_messages">
<div class="post">
<div class="<% if You %>you<% else %>admin<% end_if %>">
<div class="title">
<strong><% if You %><% _t('SSP.YOU','You') %><% else %>$Author.FirstName<% end_if %></strong> said on $Created.Format(m-d-Y) at $Created.Format(h:i a)
</div>
<div class="body">
<div class="notes">
$MessageText
</div>
<% if Attachments %>
<ul class="uploads">
<% control Attachments %>
<li><em>$Name</em> <% _t('SSP.ATTACHED','uploaded') %> (<a href="$URL">download</a>)</li>
<% end_control %>
</ul>
<% end_if %>
<% if PaymentOption %>
<div class="payment">
<% control PaymentOption %>
<% if Paid %>
Added $Description for $Cost.Nice
<% else %>
<a href="$PayLink">Add $Description for $Cost.Nice</a>
<% end_if %>
<% end_control %>
</div>
<% end_if %>
</div>
</div>
</div>
</div>
<% end_control %>
</div>
## Instruction:
FIX - added laquo for downloads
## Code After:
<div id="messages">
<% control Messages %>
<div class="project_messages">
<div class="post">
<div class="<% if You %>you<% else %>admin<% end_if %>">
<div class="title">
<strong><% if You %><% _t('SSP.YOU','You') %><% else %>$Author.FirstName<% end_if %></strong> said on $Created.Format(m-d-Y) at $Created.Format(h:i a)
</div>
<div class="body">
<div class="notes">
$MessageText
</div>
<% if Attachments %>
<ul class="uploads">
<% control Attachments %>
<li><em>$Name</em> <% _t('SSP.ATTACHED','uploaded') %> <a href="$URL">« download</a></li>
<% end_control %>
</ul>
<% end_if %>
<% if PaymentOption %>
<div class="payment">
<% control PaymentOption %>
<% if Paid %>
Added $Description for $Cost.Nice
<% else %>
<a href="$PayLink">Add $Description for $Cost.Nice</a>
<% end_if %>
<% end_control %>
</div>
<% end_if %>
</div>
</div>
</div>
</div>
<% end_control %>
</div>
| <div id="messages">
<% control Messages %>
<div class="project_messages">
<div class="post">
<div class="<% if You %>you<% else %>admin<% end_if %>">
<div class="title">
<strong><% if You %><% _t('SSP.YOU','You') %><% else %>$Author.FirstName<% end_if %></strong> said on $Created.Format(m-d-Y) at $Created.Format(h:i a)
</div>
<div class="body">
<div class="notes">
$MessageText
</div>
<% if Attachments %>
<ul class="uploads">
<% control Attachments %>
- <li><em>$Name</em> <% _t('SSP.ATTACHED','uploaded') %> (<a href="$URL">download</a>)</li>
? - -
+ <li><em>$Name</em> <% _t('SSP.ATTACHED','uploaded') %> <a href="$URL">« download</a></li>
? ++++++++
<% end_control %>
</ul>
<% end_if %>
<% if PaymentOption %>
<div class="payment">
<% control PaymentOption %>
<% if Paid %>
Added $Description for $Cost.Nice
<% else %>
<a href="$PayLink">Add $Description for $Cost.Nice</a>
<% end_if %>
<% end_control %>
</div>
<% end_if %>
</div>
</div>
</div>
</div>
<% end_control %>
</div> | 2 | 0.05 | 1 | 1 |
b4261a4be29f128d0b0a73a6fda7a685939e2e8f | topcat.rb | topcat.rb | require 'formula'
class Topcat < Formula
homepage 'http://www.star.bris.ac.uk/~mbt/topcat/'
url 'https://downloads.sourceforge.net/project/hongpublicfiles/topcat/topcat-4.0-1.tar.gz'
sha1 '71ef9e3a6b749eb7baceb434e318a51da4ae669c'
def install
bin.install Dir['*']
end
end
| require 'formula'
class Topcat < Formula
homepage 'http://www.star.bris.ac.uk/~mbt/topcat/'
url 'https://downloads.sourceforge.net/project/hongpublicfiles/topcat/topcat-4.0-1.tar.gz'
sha1 '71ef9e3a6b749eb7baceb434e318a51da4ae669c'
def install
bin.install 'topcat'
(share+'java').install 'topcat-full.jar'
end
def caveats
<<-EOS.undent
The Java JAR files are installed to
#{share}/java
EOS
end
end
| Install jar files in share. | Install jar files in share.
| Ruby | bsd-2-clause | aeantipov/homebrew-science,ge11232002/homebrew-science,ahundt/homebrew-science,parcollet/homebrew-science,quantumsteve/homebrew-science,pmelsted/homebrew-science,heuermh/homebrew-science,dpo/homebrew-science,goxberry/homebrew-science,pditommaso/homebrew-science,philippbayer/homebrew-science,kozo2/homebrew-science,joshbode/homebrew-science,andrewjpage/homebrew-science,maplesond/homebrew-science,DabeDotCom/homebrew-science | ruby | ## Code Before:
require 'formula'
class Topcat < Formula
homepage 'http://www.star.bris.ac.uk/~mbt/topcat/'
url 'https://downloads.sourceforge.net/project/hongpublicfiles/topcat/topcat-4.0-1.tar.gz'
sha1 '71ef9e3a6b749eb7baceb434e318a51da4ae669c'
def install
bin.install Dir['*']
end
end
## Instruction:
Install jar files in share.
## Code After:
require 'formula'
class Topcat < Formula
homepage 'http://www.star.bris.ac.uk/~mbt/topcat/'
url 'https://downloads.sourceforge.net/project/hongpublicfiles/topcat/topcat-4.0-1.tar.gz'
sha1 '71ef9e3a6b749eb7baceb434e318a51da4ae669c'
def install
bin.install 'topcat'
(share+'java').install 'topcat-full.jar'
end
def caveats
<<-EOS.undent
The Java JAR files are installed to
#{share}/java
EOS
end
end
| require 'formula'
class Topcat < Formula
homepage 'http://www.star.bris.ac.uk/~mbt/topcat/'
url 'https://downloads.sourceforge.net/project/hongpublicfiles/topcat/topcat-4.0-1.tar.gz'
sha1 '71ef9e3a6b749eb7baceb434e318a51da4ae669c'
def install
- bin.install Dir['*']
? ---- ^ -
+ bin.install 'topcat'
? ^^^^^^
+ (share+'java').install 'topcat-full.jar'
+ end
+
+ def caveats
+ <<-EOS.undent
+ The Java JAR files are installed to
+ #{share}/java
+ EOS
end
end | 10 | 0.909091 | 9 | 1 |
058021756d88d5b5f68070e2307e734fda86938d | utils/src/main/java/fr/unice/polytech/al/trafficlight/utils/enums/TrafficLightId.java | utils/src/main/java/fr/unice/polytech/al/trafficlight/utils/enums/TrafficLightId.java | package fr.unice.polytech.al.trafficlight.utils.enums;
/**
* Created by nathael on 27/10/16.
*/
public class TrafficLightId {
private final String id;
public TrafficLightId(String id) {
this.id = id;
}
@Override
public boolean equals(Object obj) {
if(obj instanceof String)
return id.equals((String) obj);
else if (obj instanceof TrafficLightId) {
return id.equals(((TrafficLightId) obj).id);
}
else return false;
}
@Override
public String toString() {
return "TL:"+id;
}
}
| package fr.unice.polytech.al.trafficlight.utils.enums;
/**
* Created by nathael on 27/10/16.
*/
public class TrafficLightId {
private final String id;
public TrafficLightId(String id) {
this.id = id;
}
public String getId() {
return id;
}
@Override
public boolean equals(Object obj) {
if(obj instanceof String)
return id.equals((String) obj);
else if (obj instanceof TrafficLightId) {
return id.equals(((TrafficLightId) obj).id);
}
else return false;
}
@Override
public String toString() {
return "TL:"+id;
}
}
| Add a getter to the id | Add a getter to the id
| Java | mit | Lydwen/CentralTrafficLightManagement-SmartCity,Lydwen/CentralTrafficLightManagement-SmartCity | java | ## Code Before:
package fr.unice.polytech.al.trafficlight.utils.enums;
/**
* Created by nathael on 27/10/16.
*/
public class TrafficLightId {
private final String id;
public TrafficLightId(String id) {
this.id = id;
}
@Override
public boolean equals(Object obj) {
if(obj instanceof String)
return id.equals((String) obj);
else if (obj instanceof TrafficLightId) {
return id.equals(((TrafficLightId) obj).id);
}
else return false;
}
@Override
public String toString() {
return "TL:"+id;
}
}
## Instruction:
Add a getter to the id
## Code After:
package fr.unice.polytech.al.trafficlight.utils.enums;
/**
* Created by nathael on 27/10/16.
*/
public class TrafficLightId {
private final String id;
public TrafficLightId(String id) {
this.id = id;
}
public String getId() {
return id;
}
@Override
public boolean equals(Object obj) {
if(obj instanceof String)
return id.equals((String) obj);
else if (obj instanceof TrafficLightId) {
return id.equals(((TrafficLightId) obj).id);
}
else return false;
}
@Override
public String toString() {
return "TL:"+id;
}
}
| package fr.unice.polytech.al.trafficlight.utils.enums;
/**
* Created by nathael on 27/10/16.
*/
public class TrafficLightId {
private final String id;
public TrafficLightId(String id) {
this.id = id;
+ }
+
+ public String getId() {
+ return id;
}
@Override
public boolean equals(Object obj) {
if(obj instanceof String)
return id.equals((String) obj);
else if (obj instanceof TrafficLightId) {
return id.equals(((TrafficLightId) obj).id);
}
else return false;
}
@Override
public String toString() {
return "TL:"+id;
}
} | 4 | 0.148148 | 4 | 0 |
e4dfe1199f5f741807244451866893d798b812cf | src/Oro/Bundle/ApiBundle/Resources/config/oro/routing.yml | src/Oro/Bundle/ApiBundle/Resources/config/oro/routing.yml | oro_rest_api:
resource: Oro\Bundle\ApiBundle\Controller\RestApiController
type: rest
prefix: api/
| oro_rest_api:
resource: Oro\Bundle\ApiBundle\Controller\RestApiController
type: rest
prefix: api/
requirements:
version: latest|v(\d+(\.\d+)*)
defaults:
version: latest
| Create API Bundle. Fix options for REST API routes | BAP-9175: Create API Bundle. Fix options for REST API routes
| YAML | mit | ramunasd/platform,Djamy/platform,orocrm/platform,Djamy/platform,trustify/oroplatform,geoffroycochard/platform,trustify/oroplatform,geoffroycochard/platform,trustify/oroplatform,ramunasd/platform,orocrm/platform,orocrm/platform,geoffroycochard/platform,ramunasd/platform,Djamy/platform | yaml | ## Code Before:
oro_rest_api:
resource: Oro\Bundle\ApiBundle\Controller\RestApiController
type: rest
prefix: api/
## Instruction:
BAP-9175: Create API Bundle. Fix options for REST API routes
## Code After:
oro_rest_api:
resource: Oro\Bundle\ApiBundle\Controller\RestApiController
type: rest
prefix: api/
requirements:
version: latest|v(\d+(\.\d+)*)
defaults:
version: latest
| oro_rest_api:
resource: Oro\Bundle\ApiBundle\Controller\RestApiController
type: rest
prefix: api/
+ requirements:
+ version: latest|v(\d+(\.\d+)*)
+ defaults:
+ version: latest | 4 | 1 | 4 | 0 |
b752d8ae1a3cb49899b51413c181896834fadd50 | build-commons.sh | build-commons.sh |
oslist=(darwin windows linux freebsd)
for os in "${oslist[@]}"; do
[ "$os" = "windows" ] && suffix=".exe" || suffix=""
dirname="dist/$os"
filename="twhelp$suffix"
zipname="../twhelp-x64$os.zip"
(
GOARCH=amd64 GOOS="$os" go build -ldflags="-s -w" -o "$dirname/$filename" &&
cd "$dirname" &&
zip "$zipname" "$filename"
) &
done
wait
|
docker run --rm -it -v "$PWD":/_ -w /_ golang:1.7 bash -c '
go get -d ./...
oslist=(darwin windows linux freebsd)
for os in "${oslist[@]}"; do
[ "$os" = "windows" ] && suffix=".exe" || suffix=""
dirname="dist/$os"
filename="twhelp$suffix"
(GOARCH=amd64 GOOS="$os" go build -ldflags="-s -w" -o "$dirname/$filename") &
done
wait
' && {
oslist=(darwin windows linux freebsd)
for os in "${oslist[@]}"; do
[ "$os" = "windows" ] && suffix=".exe" || suffix=""
dirname="dist/$os"
filename="twhelp$suffix"
zipname="../twhelp-x64$os.zip"
(cd "$dirname" && zip "$zipname" "$filename") &
done
wait
}
| Update build script to use docker | Update build script to use docker
| Shell | mit | mpyw/twhelp,mpyw/twhelp-go,mpyw/twhelp-go,mpyw/twhelp | shell | ## Code Before:
oslist=(darwin windows linux freebsd)
for os in "${oslist[@]}"; do
[ "$os" = "windows" ] && suffix=".exe" || suffix=""
dirname="dist/$os"
filename="twhelp$suffix"
zipname="../twhelp-x64$os.zip"
(
GOARCH=amd64 GOOS="$os" go build -ldflags="-s -w" -o "$dirname/$filename" &&
cd "$dirname" &&
zip "$zipname" "$filename"
) &
done
wait
## Instruction:
Update build script to use docker
## Code After:
docker run --rm -it -v "$PWD":/_ -w /_ golang:1.7 bash -c '
go get -d ./...
oslist=(darwin windows linux freebsd)
for os in "${oslist[@]}"; do
[ "$os" = "windows" ] && suffix=".exe" || suffix=""
dirname="dist/$os"
filename="twhelp$suffix"
(GOARCH=amd64 GOOS="$os" go build -ldflags="-s -w" -o "$dirname/$filename") &
done
wait
' && {
oslist=(darwin windows linux freebsd)
for os in "${oslist[@]}"; do
[ "$os" = "windows" ] && suffix=".exe" || suffix=""
dirname="dist/$os"
filename="twhelp$suffix"
zipname="../twhelp-x64$os.zip"
(cd "$dirname" && zip "$zipname" "$filename") &
done
wait
}
|
+ docker run --rm -it -v "$PWD":/_ -w /_ golang:1.7 bash -c '
+
+ go get -d ./...
+
- oslist=(darwin windows linux freebsd)
+ oslist=(darwin windows linux freebsd)
? ++++
- for os in "${oslist[@]}"; do
+ for os in "${oslist[@]}"; do
? ++++
- [ "$os" = "windows" ] && suffix=".exe" || suffix=""
+ [ "$os" = "windows" ] && suffix=".exe" || suffix=""
? ++++
- dirname="dist/$os"
+ dirname="dist/$os"
? ++++
- filename="twhelp$suffix"
+ filename="twhelp$suffix"
? ++++
- zipname="../twhelp-x64$os.zip"
- (
- GOARCH=amd64 GOOS="$os" go build -ldflags="-s -w" -o "$dirname/$filename" &&
? -
+ (GOARCH=amd64 GOOS="$os" go build -ldflags="-s -w" -o "$dirname/$filename") &
? + +
- cd "$dirname" &&
+ done
+
+ wait
+
+ ' && {
+
+ oslist=(darwin windows linux freebsd)
+ for os in "${oslist[@]}"; do
+ [ "$os" = "windows" ] && suffix=".exe" || suffix=""
+ dirname="dist/$os"
+ filename="twhelp$suffix"
+ zipname="../twhelp-x64$os.zip"
- zip "$zipname" "$filename"
+ (cd "$dirname" && zip "$zipname" "$filename") &
? ++++++++++++++++++ +++
- ) &
- done
- wait
+ done
+
+ wait
+
+ } | 41 | 2.928571 | 28 | 13 |
71e2550c9bbc7044e44fc975de5346cfdca19e50 | subprojects/build-plugins/build-plugins.gradle.kts | subprojects/build-plugins/build-plugins.gradle.kts | import build.futureKotlin
plugins {
id("public-kotlin-dsl-module")
}
base {
archivesBaseName = "gradle-kotlin-dsl-build-plugins"
}
val processResources: ProcessResources by tasks
val writeKotlinDslProviderVersion by tasks.creating(WriteProperties::class) {
outputFile = processResources.destinationDir.resolve("${base.archivesBaseName}-versions.properties")
property("kotlin-dsl", version)
}
processResources.dependsOn(writeKotlinDslProviderVersion)
val writeTestKitPluginClasspath by tasks.creating {
val main by java.sourceSets
val outputDir = file("$buildDir/$name")
val testResources = file("src/test/resources")
inputs.files(main.runtimeClasspath)
inputs.dir(testResources)
outputs.dir(outputDir)
doLast {
outputDir.mkdirs()
file("$outputDir/plugin-classpath.txt").writeText(main.runtimeClasspath.plus(testResources).joinToString("\n"))
}
}
dependencies {
compileOnly(gradleApi())
compileOnly(project(":provider"))
implementation("com.thoughtworks.qdox:qdox:2.0-M8")
implementation(futureKotlin("gradle-plugin"))
testImplementation(project(":provider"))
testImplementation(project(":test-fixtures"))
testImplementation(files(writeTestKitPluginClasspath))
}
val customInstallation by rootProject.tasks
tasks {
"test" {
dependsOn(customInstallation)
}
}
| import build.*
plugins {
id("public-kotlin-dsl-module")
}
base {
archivesBaseName = "gradle-kotlin-dsl-build-plugins"
}
val processResources: ProcessResources by tasks
val writeKotlinDslProviderVersion by tasks.creating(WriteProperties::class) {
outputFile = processResources.destinationDir.resolve("${base.archivesBaseName}-versions.properties")
property("kotlin-dsl", version)
}
processResources.dependsOn(writeKotlinDslProviderVersion)
val writeTestKitPluginClasspath by tasks.creating {
val main by java.sourceSets
val outputDir = file("$buildDir/$name")
val testResources = file("src/test/resources")
inputs.files(main.runtimeClasspath)
inputs.dir(testResources)
outputs.dir(outputDir)
doLast {
outputDir.mkdirs()
file("$outputDir/plugin-classpath.txt").writeText(main.runtimeClasspath.plus(testResources).joinToString("\n"))
}
}
dependencies {
compileOnly(gradleApi())
compileOnly(project(":provider"))
implementation("com.thoughtworks.qdox:qdox:2.0-M8")
implementation(futureKotlin("gradle-plugin"))
testImplementation(project(":provider"))
testImplementation(project(":test-fixtures"))
testImplementation(files(writeTestKitPluginClasspath))
}
withParallelTests()
val customInstallation by rootProject.tasks
tasks {
"test" {
dependsOn(customInstallation)
}
}
| Allow :build-plugins tests to run in parallel | Allow :build-plugins tests to run in parallel
Signed-off-by: Paul Merlin <a027184a55211cd23e3f3094f1fdc728df5e0500@gradle.com>
| Kotlin | apache-2.0 | robinverduijn/gradle,robinverduijn/gradle,blindpirate/gradle,gradle/gradle,robinverduijn/gradle,blindpirate/gradle,blindpirate/gradle,blindpirate/gradle,robinverduijn/gradle,gradle/gradle,gradle/gradle,blindpirate/gradle,robinverduijn/gradle,gradle/gradle-script-kotlin,robinverduijn/gradle,robinverduijn/gradle,robinverduijn/gradle,blindpirate/gradle,gradle/gradle,blindpirate/gradle,gradle/gradle,gradle/gradle,robinverduijn/gradle,robinverduijn/gradle,gradle/gradle-script-kotlin,blindpirate/gradle,gradle/gradle,robinverduijn/gradle,gradle/gradle,blindpirate/gradle,gradle/gradle,gradle/gradle,blindpirate/gradle | kotlin | ## Code Before:
import build.futureKotlin
plugins {
id("public-kotlin-dsl-module")
}
base {
archivesBaseName = "gradle-kotlin-dsl-build-plugins"
}
val processResources: ProcessResources by tasks
val writeKotlinDslProviderVersion by tasks.creating(WriteProperties::class) {
outputFile = processResources.destinationDir.resolve("${base.archivesBaseName}-versions.properties")
property("kotlin-dsl", version)
}
processResources.dependsOn(writeKotlinDslProviderVersion)
val writeTestKitPluginClasspath by tasks.creating {
val main by java.sourceSets
val outputDir = file("$buildDir/$name")
val testResources = file("src/test/resources")
inputs.files(main.runtimeClasspath)
inputs.dir(testResources)
outputs.dir(outputDir)
doLast {
outputDir.mkdirs()
file("$outputDir/plugin-classpath.txt").writeText(main.runtimeClasspath.plus(testResources).joinToString("\n"))
}
}
dependencies {
compileOnly(gradleApi())
compileOnly(project(":provider"))
implementation("com.thoughtworks.qdox:qdox:2.0-M8")
implementation(futureKotlin("gradle-plugin"))
testImplementation(project(":provider"))
testImplementation(project(":test-fixtures"))
testImplementation(files(writeTestKitPluginClasspath))
}
val customInstallation by rootProject.tasks
tasks {
"test" {
dependsOn(customInstallation)
}
}
## Instruction:
Allow :build-plugins tests to run in parallel
Signed-off-by: Paul Merlin <a027184a55211cd23e3f3094f1fdc728df5e0500@gradle.com>
## Code After:
import build.*
plugins {
id("public-kotlin-dsl-module")
}
base {
archivesBaseName = "gradle-kotlin-dsl-build-plugins"
}
val processResources: ProcessResources by tasks
val writeKotlinDslProviderVersion by tasks.creating(WriteProperties::class) {
outputFile = processResources.destinationDir.resolve("${base.archivesBaseName}-versions.properties")
property("kotlin-dsl", version)
}
processResources.dependsOn(writeKotlinDslProviderVersion)
val writeTestKitPluginClasspath by tasks.creating {
val main by java.sourceSets
val outputDir = file("$buildDir/$name")
val testResources = file("src/test/resources")
inputs.files(main.runtimeClasspath)
inputs.dir(testResources)
outputs.dir(outputDir)
doLast {
outputDir.mkdirs()
file("$outputDir/plugin-classpath.txt").writeText(main.runtimeClasspath.plus(testResources).joinToString("\n"))
}
}
dependencies {
compileOnly(gradleApi())
compileOnly(project(":provider"))
implementation("com.thoughtworks.qdox:qdox:2.0-M8")
implementation(futureKotlin("gradle-plugin"))
testImplementation(project(":provider"))
testImplementation(project(":test-fixtures"))
testImplementation(files(writeTestKitPluginClasspath))
}
withParallelTests()
val customInstallation by rootProject.tasks
tasks {
"test" {
dependsOn(customInstallation)
}
}
| - import build.futureKotlin
+ import build.*
plugins {
id("public-kotlin-dsl-module")
}
base {
archivesBaseName = "gradle-kotlin-dsl-build-plugins"
}
val processResources: ProcessResources by tasks
val writeKotlinDslProviderVersion by tasks.creating(WriteProperties::class) {
outputFile = processResources.destinationDir.resolve("${base.archivesBaseName}-versions.properties")
property("kotlin-dsl", version)
}
processResources.dependsOn(writeKotlinDslProviderVersion)
val writeTestKitPluginClasspath by tasks.creating {
val main by java.sourceSets
val outputDir = file("$buildDir/$name")
val testResources = file("src/test/resources")
inputs.files(main.runtimeClasspath)
inputs.dir(testResources)
outputs.dir(outputDir)
doLast {
outputDir.mkdirs()
file("$outputDir/plugin-classpath.txt").writeText(main.runtimeClasspath.plus(testResources).joinToString("\n"))
}
}
dependencies {
compileOnly(gradleApi())
compileOnly(project(":provider"))
implementation("com.thoughtworks.qdox:qdox:2.0-M8")
implementation(futureKotlin("gradle-plugin"))
testImplementation(project(":provider"))
testImplementation(project(":test-fixtures"))
testImplementation(files(writeTestKitPluginClasspath))
}
+ withParallelTests()
+
val customInstallation by rootProject.tasks
tasks {
"test" {
dependsOn(customInstallation)
}
} | 4 | 0.075472 | 3 | 1 |
74532975917826a13a4b4d25abcacc84f72d169f | README.md | README.md | Python Flight Mechanics Engine
License: MIT (see `COPYING`).
## How to run the tests
Install in editable mode and call `py.test`:
$ pip install -e .
$ py.test
| Python Flight Mechanics Engine
License: MIT (see `COPYING`).
**If you want to know how PyFME works, how to collaborate or get our contact information, please visit our [wiki](https://github.com/AeroPython/PyFME/wiki)**
## How to run the tests
Install in editable mode and call `py.test`:
$ pip install -e .
$ py.test
| Update readme to include a link to the wiki | Update readme to include a link to the wiki | Markdown | mit | miqlar/PyFME,aeroaks/PyFME,Juanlu001/PyFME,JuanMatSa/PyFME,AlexS12/PyFME,AeroPython/PyFME,olrosales/PyFME | markdown | ## Code Before:
Python Flight Mechanics Engine
License: MIT (see `COPYING`).
## How to run the tests
Install in editable mode and call `py.test`:
$ pip install -e .
$ py.test
## Instruction:
Update readme to include a link to the wiki
## Code After:
Python Flight Mechanics Engine
License: MIT (see `COPYING`).
**If you want to know how PyFME works, how to collaborate or get our contact information, please visit our [wiki](https://github.com/AeroPython/PyFME/wiki)**
## How to run the tests
Install in editable mode and call `py.test`:
$ pip install -e .
$ py.test
| Python Flight Mechanics Engine
License: MIT (see `COPYING`).
+
+ **If you want to know how PyFME works, how to collaborate or get our contact information, please visit our [wiki](https://github.com/AeroPython/PyFME/wiki)**
## How to run the tests
Install in editable mode and call `py.test`:
$ pip install -e .
$ py.test
| 2 | 0.181818 | 2 | 0 |
4f3a536eb011900b40600c9e70ebe10dc4052e60 | .travis.yml | .travis.yml | language: node_js
node_js:
- "node"
branches:
only:
- master
| language: node_js
node_js:
- node
branches:
only:
- master
notifications:
slack:
secure: s0oc2e1NWqXhwsGtTQndL32Y222J01g0HuWS+BKRwDHxxSvgirhTxOrxDh89kpyukeUNrVg+bpW1lfBWvwcQXO/iuBgkHVgYd9mTwF0WaoOGaAmeY9yjprfN8EHwFyrc9VnCDqvLx34JHFdvGjW8fAuVNSjd53MnFu9U0//t+q5m8CqoMBFOsP/INHHxy2qfkt5xUsKNgvrBPe4OEFIdf2wGm1w0lHCzY6UuGiFAwyzl/YzkaRUysTfO39KOMkuwS1wQ/JoCmX3QywasHIhuQz3oCjN7OtZ5ISir1eK3SjXUxYIJ8ZzcUAGKOPOMsVogQvOMsYStUDNvcACp4deKGG1oZPXDhrEUCsFV+INOr3MT2OgzNM2cLDyPyU1SjI79zGJdzompDjhPd7nypjbQlllKsk4Ioa8PGQXzjlPIM6WNfpwkLXZFkRtVzZMuahypoK2ZOUPVppkb+w9xQ+hZ4pxuBSVWlM6UVLJCB9B90aVTWJ3E4iXNkwDhPMNweYpBJ51A10Qq8oNRU2oz06wyWcLTKuUFSAnYS7B0rLAjLSglYyTn4aCbomvdyy7Ppt/sFpIdBGdlAhYc8jg57tMQ4otUTmulPYqHsX2QSVMkDib1SeAyFqTjdksfFPO7AJ4tLxgkntwDtBIKfgGOBBvoSyQ27BQyQMmYpdNXDnUVhzg=
| Add slack integration for Travis | Add slack integration for Travis
| YAML | mit | pyr0tecnix/TasksManager | yaml | ## Code Before:
language: node_js
node_js:
- "node"
branches:
only:
- master
## Instruction:
Add slack integration for Travis
## Code After:
language: node_js
node_js:
- node
branches:
only:
- master
notifications:
slack:
secure: s0oc2e1NWqXhwsGtTQndL32Y222J01g0HuWS+BKRwDHxxSvgirhTxOrxDh89kpyukeUNrVg+bpW1lfBWvwcQXO/iuBgkHVgYd9mTwF0WaoOGaAmeY9yjprfN8EHwFyrc9VnCDqvLx34JHFdvGjW8fAuVNSjd53MnFu9U0//t+q5m8CqoMBFOsP/INHHxy2qfkt5xUsKNgvrBPe4OEFIdf2wGm1w0lHCzY6UuGiFAwyzl/YzkaRUysTfO39KOMkuwS1wQ/JoCmX3QywasHIhuQz3oCjN7OtZ5ISir1eK3SjXUxYIJ8ZzcUAGKOPOMsVogQvOMsYStUDNvcACp4deKGG1oZPXDhrEUCsFV+INOr3MT2OgzNM2cLDyPyU1SjI79zGJdzompDjhPd7nypjbQlllKsk4Ioa8PGQXzjlPIM6WNfpwkLXZFkRtVzZMuahypoK2ZOUPVppkb+w9xQ+hZ4pxuBSVWlM6UVLJCB9B90aVTWJ3E4iXNkwDhPMNweYpBJ51A10Qq8oNRU2oz06wyWcLTKuUFSAnYS7B0rLAjLSglYyTn4aCbomvdyy7Ppt/sFpIdBGdlAhYc8jg57tMQ4otUTmulPYqHsX2QSVMkDib1SeAyFqTjdksfFPO7AJ4tLxgkntwDtBIKfgGOBBvoSyQ27BQyQMmYpdNXDnUVhzg=
| language: node_js
node_js:
- - "node"
? -- - -
+ - node
-
branches:
only:
- - master
? --
+ - master
+ notifications:
+ slack:
+ secure: s0oc2e1NWqXhwsGtTQndL32Y222J01g0HuWS+BKRwDHxxSvgirhTxOrxDh89kpyukeUNrVg+bpW1lfBWvwcQXO/iuBgkHVgYd9mTwF0WaoOGaAmeY9yjprfN8EHwFyrc9VnCDqvLx34JHFdvGjW8fAuVNSjd53MnFu9U0//t+q5m8CqoMBFOsP/INHHxy2qfkt5xUsKNgvrBPe4OEFIdf2wGm1w0lHCzY6UuGiFAwyzl/YzkaRUysTfO39KOMkuwS1wQ/JoCmX3QywasHIhuQz3oCjN7OtZ5ISir1eK3SjXUxYIJ8ZzcUAGKOPOMsVogQvOMsYStUDNvcACp4deKGG1oZPXDhrEUCsFV+INOr3MT2OgzNM2cLDyPyU1SjI79zGJdzompDjhPd7nypjbQlllKsk4Ioa8PGQXzjlPIM6WNfpwkLXZFkRtVzZMuahypoK2ZOUPVppkb+w9xQ+hZ4pxuBSVWlM6UVLJCB9B90aVTWJ3E4iXNkwDhPMNweYpBJ51A10Qq8oNRU2oz06wyWcLTKuUFSAnYS7B0rLAjLSglYyTn4aCbomvdyy7Ppt/sFpIdBGdlAhYc8jg57tMQ4otUTmulPYqHsX2QSVMkDib1SeAyFqTjdksfFPO7AJ4tLxgkntwDtBIKfgGOBBvoSyQ27BQyQMmYpdNXDnUVhzg= | 8 | 1.142857 | 5 | 3 |
eb33d70bfda4857fbd76616cf3bf7fb7d7feec71 | spoj/00005/palin.py | spoj/00005/palin.py | def next_palindrome(k):
palin = list(k)
n = len(k)
mid = n // 2
# case 1: forward right
just_copy = False
for i in range(mid, n):
mirrored = n - 1 - i
if k[i] < k[mirrored]:
just_copy = True
if just_copy:
palin[i] = palin[mirrored]
# case 2: backward left
if not just_copy:
i = (n - 1) // 2
while i >= 0 and k[i] == '9':
i -= 1
if i >= 0:
palin[i] = str(int(k[i]) + 1)
for j in range(i + 1, mid):
palin[j] = '0'
for j in range(mid, n):
mirrored = n - 1 - j
palin[j] = palin[mirrored]
else:
# case 3: "99...9" -> "100..01"
palin = ['0'] * (n + 1)
palin[0] = palin[-1] = '1'
return ''.join(palin)
if __name__ == '__main__':
t = int(input())
for _ in range(t):
k = input()
print(next_palindrome(k))
| def next_palindrome(k):
palin = list(k)
n = len(k)
mid = n // 2
# case 1: forward right
just_copy = False
for i in range(mid, n):
mirrored = n - 1 - i
if k[i] < k[mirrored]:
just_copy = True
if just_copy:
palin[i] = palin[mirrored]
# case 2: backward left
if not just_copy:
i = (n - 1) // 2
while i >= 0 and k[i] == '9':
i -= 1
if i >= 0:
palin[i] = str(int(k[i]) + 1)
for j in range(i + 1, (n + 1) // 2):
palin[j] = '0'
for j in range((n + 1) // 2, n):
mirrored = n - 1 - j
palin[j] = palin[mirrored]
else:
# case 3: "99...9" -> "100..01"
palin = ['0'] * (n + 1)
palin[0] = palin[-1] = '1'
return ''.join(palin)
if __name__ == '__main__':
t = int(input())
for _ in range(t):
k = input()
print(next_palindrome(k))
| Fix bug in ranges (to middle) | Fix bug in ranges (to middle)
- in SPOJ palin
Signed-off-by: Karel Ha <70f8965fdfb04f1fc0e708a55d9e822c449f57d3@gmail.com>
| Python | mit | mathemage/CompetitiveProgramming,mathemage/CompetitiveProgramming,mathemage/CompetitiveProgramming,mathemage/CompetitiveProgramming,mathemage/CompetitiveProgramming,mathemage/CompetitiveProgramming | python | ## Code Before:
def next_palindrome(k):
palin = list(k)
n = len(k)
mid = n // 2
# case 1: forward right
just_copy = False
for i in range(mid, n):
mirrored = n - 1 - i
if k[i] < k[mirrored]:
just_copy = True
if just_copy:
palin[i] = palin[mirrored]
# case 2: backward left
if not just_copy:
i = (n - 1) // 2
while i >= 0 and k[i] == '9':
i -= 1
if i >= 0:
palin[i] = str(int(k[i]) + 1)
for j in range(i + 1, mid):
palin[j] = '0'
for j in range(mid, n):
mirrored = n - 1 - j
palin[j] = palin[mirrored]
else:
# case 3: "99...9" -> "100..01"
palin = ['0'] * (n + 1)
palin[0] = palin[-1] = '1'
return ''.join(palin)
if __name__ == '__main__':
t = int(input())
for _ in range(t):
k = input()
print(next_palindrome(k))
## Instruction:
Fix bug in ranges (to middle)
- in SPOJ palin
Signed-off-by: Karel Ha <70f8965fdfb04f1fc0e708a55d9e822c449f57d3@gmail.com>
## Code After:
def next_palindrome(k):
palin = list(k)
n = len(k)
mid = n // 2
# case 1: forward right
just_copy = False
for i in range(mid, n):
mirrored = n - 1 - i
if k[i] < k[mirrored]:
just_copy = True
if just_copy:
palin[i] = palin[mirrored]
# case 2: backward left
if not just_copy:
i = (n - 1) // 2
while i >= 0 and k[i] == '9':
i -= 1
if i >= 0:
palin[i] = str(int(k[i]) + 1)
for j in range(i + 1, (n + 1) // 2):
palin[j] = '0'
for j in range((n + 1) // 2, n):
mirrored = n - 1 - j
palin[j] = palin[mirrored]
else:
# case 3: "99...9" -> "100..01"
palin = ['0'] * (n + 1)
palin[0] = palin[-1] = '1'
return ''.join(palin)
if __name__ == '__main__':
t = int(input())
for _ in range(t):
k = input()
print(next_palindrome(k))
| def next_palindrome(k):
palin = list(k)
n = len(k)
mid = n // 2
# case 1: forward right
just_copy = False
for i in range(mid, n):
mirrored = n - 1 - i
if k[i] < k[mirrored]:
just_copy = True
if just_copy:
palin[i] = palin[mirrored]
# case 2: backward left
if not just_copy:
i = (n - 1) // 2
while i >= 0 and k[i] == '9':
i -= 1
if i >= 0:
palin[i] = str(int(k[i]) + 1)
- for j in range(i + 1, mid):
? ^^^
+ for j in range(i + 1, (n + 1) // 2):
? ^^^^^^^^^^^^
palin[j] = '0'
- for j in range(mid, n):
? ^^^
+ for j in range((n + 1) // 2, n):
? ^^^^^^^^^^^^
mirrored = n - 1 - j
palin[j] = palin[mirrored]
else:
# case 3: "99...9" -> "100..01"
palin = ['0'] * (n + 1)
palin[0] = palin[-1] = '1'
return ''.join(palin)
if __name__ == '__main__':
t = int(input())
for _ in range(t):
k = input()
print(next_palindrome(k)) | 4 | 0.102564 | 2 | 2 |
122f1d0e5599526d56aafa4d87fa558a6a44378e | src/data.json | src/data.json | {
"name": "Hack Club",
"title": "Hack Club: High school coding clubs",
"description": "Join the movement of high school coding clubs around the world: by the students, for the students.",
"url": "https://hackclub.com",
"api": "https://api.hackclub.com",
"twitter": "@starthackclub",
"img": "https://hackclub.com/social.png",
"stats": {
"percentage_of_us_high_schools": "1%",
"school_count": 200,
"state_count": 30,
"country_count": 13,
"approximate_members": "3K+"
}
}
| {
"name": "Hack Club",
"title": "Hack Club: High school computer science clubs",
"description": "Join the movement of high school coding clubs around the world: by the students, for the students.",
"url": "https://hackclub.com",
"api": "https://api.hackclub.com",
"twitter": "@starthackclub",
"img": "https://hackclub.com/social.png",
"stats": {
"percentage_of_us_high_schools": "1%",
"school_count": 200,
"state_count": 30,
"country_count": 13,
"approximate_members": "3K+"
}
}
| Change "coding" to "computer science" in our website title | Change "coding" to "computer science" in our website title | JSON | mit | hackclub/website,hackclub/website,hackclub/website | json | ## Code Before:
{
"name": "Hack Club",
"title": "Hack Club: High school coding clubs",
"description": "Join the movement of high school coding clubs around the world: by the students, for the students.",
"url": "https://hackclub.com",
"api": "https://api.hackclub.com",
"twitter": "@starthackclub",
"img": "https://hackclub.com/social.png",
"stats": {
"percentage_of_us_high_schools": "1%",
"school_count": 200,
"state_count": 30,
"country_count": 13,
"approximate_members": "3K+"
}
}
## Instruction:
Change "coding" to "computer science" in our website title
## Code After:
{
"name": "Hack Club",
"title": "Hack Club: High school computer science clubs",
"description": "Join the movement of high school coding clubs around the world: by the students, for the students.",
"url": "https://hackclub.com",
"api": "https://api.hackclub.com",
"twitter": "@starthackclub",
"img": "https://hackclub.com/social.png",
"stats": {
"percentage_of_us_high_schools": "1%",
"school_count": 200,
"state_count": 30,
"country_count": 13,
"approximate_members": "3K+"
}
}
| {
"name": "Hack Club",
- "title": "Hack Club: High school coding clubs",
? ^ ^
+ "title": "Hack Club: High school computer science clubs",
? ^^^^^^^^^ + ^^
"description": "Join the movement of high school coding clubs around the world: by the students, for the students.",
"url": "https://hackclub.com",
"api": "https://api.hackclub.com",
"twitter": "@starthackclub",
"img": "https://hackclub.com/social.png",
"stats": {
"percentage_of_us_high_schools": "1%",
"school_count": 200,
"state_count": 30,
"country_count": 13,
"approximate_members": "3K+"
}
} | 2 | 0.125 | 1 | 1 |
9cba7a3403e6ab53b6c9373c2cc9d55c78975f44 | source/about-me.html.erb | source/about-me.html.erb | ---
title: About Me
---
<h1><%= current_page.data.title %></h1>
<p>My name is Martin, and I'm a software developer and tester based in London.</p>
<p>I've been working in software development for over 8 years now since leaving the University of Birmingham in 2006 with a BSc in Physics and Astrophysics. My experience is primarily in the Microsoft technology stack with C# .NET, working on WCF and ASP.NET-based technologies alongside Microsoft SQL Server.</p>
<p>Besides technology, I'm a big fan of the cinema and like watching new films of many genres. I've been working on a self-imposed challenge of watching all of the films in the IMDb Top 250 for the last 6 years. The list is always moving which makes it tricky, but one day I'll get there!</p>
<div class="row text-center">
<img src="/images/Martin.png" alt="<%= blog_author %>" title="<%= blog_author %>" height="288" width="300" />
</div>
| ---
title: About Me
---
<h1><%= current_page.data.title %></h1>
<p>My name is Martin, and I'm a software developer and tester based in London.</p>
<p>I've been working in software development for over 8 years now since leaving the University of Birmingham in 2006 with a BSc in Physics and Astrophysics. My experience is primarily in the Microsoft technology stack with C# .NET, working on WCF and ASP.NET-based technologies alongside Microsoft SQL Server.</p>
<p>Besides technology, I'm a big fan of the cinema and like watching new films of many genres. I've been working on a self-imposed challenge of watching all of the films in the IMDb Top 250 for the last 6 years. The list is always moving which makes it tricky, but one day I'll get there!</p>
<p>Visit <a href="https://martincostello.com/" alt="martincostello.com" title="martincostello.com">martincostello.com</a>.</p>
<div class="row text-center">
<img src="/images/Martin.png" alt="<%= blog_author %>" title="<%= blog_author %>" height="288" width="300" />
</div>
| Add link to root website. | Add link to root website.
| HTML+ERB | mit | martincostello/blog,martincostello/blog,martincostello/blog | html+erb | ## Code Before:
---
title: About Me
---
<h1><%= current_page.data.title %></h1>
<p>My name is Martin, and I'm a software developer and tester based in London.</p>
<p>I've been working in software development for over 8 years now since leaving the University of Birmingham in 2006 with a BSc in Physics and Astrophysics. My experience is primarily in the Microsoft technology stack with C# .NET, working on WCF and ASP.NET-based technologies alongside Microsoft SQL Server.</p>
<p>Besides technology, I'm a big fan of the cinema and like watching new films of many genres. I've been working on a self-imposed challenge of watching all of the films in the IMDb Top 250 for the last 6 years. The list is always moving which makes it tricky, but one day I'll get there!</p>
<div class="row text-center">
<img src="/images/Martin.png" alt="<%= blog_author %>" title="<%= blog_author %>" height="288" width="300" />
</div>
## Instruction:
Add link to root website.
## Code After:
---
title: About Me
---
<h1><%= current_page.data.title %></h1>
<p>My name is Martin, and I'm a software developer and tester based in London.</p>
<p>I've been working in software development for over 8 years now since leaving the University of Birmingham in 2006 with a BSc in Physics and Astrophysics. My experience is primarily in the Microsoft technology stack with C# .NET, working on WCF and ASP.NET-based technologies alongside Microsoft SQL Server.</p>
<p>Besides technology, I'm a big fan of the cinema and like watching new films of many genres. I've been working on a self-imposed challenge of watching all of the films in the IMDb Top 250 for the last 6 years. The list is always moving which makes it tricky, but one day I'll get there!</p>
<p>Visit <a href="https://martincostello.com/" alt="martincostello.com" title="martincostello.com">martincostello.com</a>.</p>
<div class="row text-center">
<img src="/images/Martin.png" alt="<%= blog_author %>" title="<%= blog_author %>" height="288" width="300" />
</div>
| ---
title: About Me
---
<h1><%= current_page.data.title %></h1>
<p>My name is Martin, and I'm a software developer and tester based in London.</p>
<p>I've been working in software development for over 8 years now since leaving the University of Birmingham in 2006 with a BSc in Physics and Astrophysics. My experience is primarily in the Microsoft technology stack with C# .NET, working on WCF and ASP.NET-based technologies alongside Microsoft SQL Server.</p>
<p>Besides technology, I'm a big fan of the cinema and like watching new films of many genres. I've been working on a self-imposed challenge of watching all of the films in the IMDb Top 250 for the last 6 years. The list is always moving which makes it tricky, but one day I'll get there!</p>
+ <p>Visit <a href="https://martincostello.com/" alt="martincostello.com" title="martincostello.com">martincostello.com</a>.</p>
<div class="row text-center">
<img src="/images/Martin.png" alt="<%= blog_author %>" title="<%= blog_author %>" height="288" width="300" />
</div> | 1 | 0.090909 | 1 | 0 |
9c9d15722892cd7ad9a91d9555e78fe110bea780 | README.md | README.md | Small side project for public use - code generator with JavaScript.
Live and stable version at: [snipenator.com](http://snipenator.com)
| Small side project for public use - code generator with JavaScript.

Live and stable version at: [snipenator.com](http://snipenator.com)
| Update with the current screenshot. | Update with the current screenshot. | Markdown | mit | Stilyan-Kangalov/Snipenator,Stilyan-Kangalov/Snipenator,Stilyan-Kangalov/Snipenator | markdown | ## Code Before:
Small side project for public use - code generator with JavaScript.
Live and stable version at: [snipenator.com](http://snipenator.com)
## Instruction:
Update with the current screenshot.
## Code After:
Small side project for public use - code generator with JavaScript.

Live and stable version at: [snipenator.com](http://snipenator.com)
| Small side project for public use - code generator with JavaScript.
+ 
+
Live and stable version at: [snipenator.com](http://snipenator.com) | 2 | 0.666667 | 2 | 0 |
4f6915eb0ee67ea77a69ac7d4653279abb6e6bbd | data-init.js | data-init.js | 'use strict';
angular.module('ngAppInit', []).
provider('$init', function(
){
this.$get = function() {
return {};
};
}).
directive('ngAppInit', function(
$window,
$init
){
return {
compile: function() {
return {
pre: function(scope, element, attrs) {
angular.extend($init, $window.JSON.parse(attrs.ngAppInit));
}
};
}
};
});
| 'use strict';
angular.module('data-init', []).
provider('$init', function() {
this.$get = function(
$window
){
return $window.JSON.parse(document.querySelector('[ng-app]').dataset.init);
};
});
| Rewrite the logic without using directive | Rewrite the logic without using directive
| JavaScript | mit | gsklee/angular-init | javascript | ## Code Before:
'use strict';
angular.module('ngAppInit', []).
provider('$init', function(
){
this.$get = function() {
return {};
};
}).
directive('ngAppInit', function(
$window,
$init
){
return {
compile: function() {
return {
pre: function(scope, element, attrs) {
angular.extend($init, $window.JSON.parse(attrs.ngAppInit));
}
};
}
};
});
## Instruction:
Rewrite the logic without using directive
## Code After:
'use strict';
angular.module('data-init', []).
provider('$init', function() {
this.$get = function(
$window
){
return $window.JSON.parse(document.querySelector('[ng-app]').dataset.init);
};
});
| 'use strict';
- angular.module('ngAppInit', []).
? ^^^^^^
+ angular.module('data-init', []).
? ^^^^^^
- provider('$init', function(
+ provider('$init', function() {
? +++
- ){
- this.$get = function() {
? ---
+ this.$get = function(
- return {};
- };
- }).
-
- directive('ngAppInit', function(
- $window,
? -
+ $window
? ++
+ ){
+ return $window.JSON.parse(document.querySelector('[ng-app]').dataset.init);
- $init
- ){
- return {
- compile: function() {
- return {
- pre: function(scope, element, attrs) {
- angular.extend($init, $window.JSON.parse(attrs.ngAppInit));
- }
- };
- }
};
}); | 26 | 1.04 | 6 | 20 |
d4e71313ffe8122f491ceb482696ba14b743af56 | README.md | README.md |
Download zips of github repositories easily.
## Installation
Clone the repository and cd to it. Then do:
```
$ python setup.py install
```
## Usage
The point of `gitdl` is to quickly get something from GitHub.
### Download a repo with the best match
```
$ gitdl bootstrap
```
This will search for bootstrap, and find the best match and download the
zip for it.
### Download an exact repo
```
$ gitdl -e nvbn/thefuck
```
When `gitdl` is passed with `-e` it expects a {author}/{repo} format to
download the exact repo from GitHub.
### Search for a repo
```
$ gitdl search "intermediate python"
```
This will search GitHub and present the results in a tabular format.
## Development
### Testing
To run the tests:
```
$ py.test
```
To run the tests with coverage:
```
$ py.test --cov
```
|
Download zips of github repositories easily.
[](https://travis-ci.org/SanketDG/gitdl) [](https://coveralls.io/github/SanketDG/gitdl?branch=master)
## Installation
Clone the repository and cd to it. Then do:
```
$ python setup.py install
```
## Usage
The point of `gitdl` is to quickly get something from GitHub.
### Download a repo with the best match
```
$ gitdl bootstrap
```
This will search for bootstrap, and find the best match and download the
zip for it.
### Download an exact repo
```
$ gitdl -e nvbn/thefuck
```
When `gitdl` is passed with `-e` it expects a {author}/{repo} format to
download the exact repo from GitHub.
### Search for a repo
```
$ gitdl search "intermediate python"
```
This will search GitHub and present the results in a tabular format.
## Development
### Testing
To run the tests:
```
$ py.test
```
To run the tests with coverage:
```
$ py.test --cov
```
| Add CI badges for Travis and Coveralls | Add CI badges for Travis and Coveralls
| Markdown | mit | SanketDG/gitdl | markdown | ## Code Before:
Download zips of github repositories easily.
## Installation
Clone the repository and cd to it. Then do:
```
$ python setup.py install
```
## Usage
The point of `gitdl` is to quickly get something from GitHub.
### Download a repo with the best match
```
$ gitdl bootstrap
```
This will search for bootstrap, and find the best match and download the
zip for it.
### Download an exact repo
```
$ gitdl -e nvbn/thefuck
```
When `gitdl` is passed with `-e` it expects a {author}/{repo} format to
download the exact repo from GitHub.
### Search for a repo
```
$ gitdl search "intermediate python"
```
This will search GitHub and present the results in a tabular format.
## Development
### Testing
To run the tests:
```
$ py.test
```
To run the tests with coverage:
```
$ py.test --cov
```
## Instruction:
Add CI badges for Travis and Coveralls
## Code After:
Download zips of github repositories easily.
[](https://travis-ci.org/SanketDG/gitdl) [](https://coveralls.io/github/SanketDG/gitdl?branch=master)
## Installation
Clone the repository and cd to it. Then do:
```
$ python setup.py install
```
## Usage
The point of `gitdl` is to quickly get something from GitHub.
### Download a repo with the best match
```
$ gitdl bootstrap
```
This will search for bootstrap, and find the best match and download the
zip for it.
### Download an exact repo
```
$ gitdl -e nvbn/thefuck
```
When `gitdl` is passed with `-e` it expects a {author}/{repo} format to
download the exact repo from GitHub.
### Search for a repo
```
$ gitdl search "intermediate python"
```
This will search GitHub and present the results in a tabular format.
## Development
### Testing
To run the tests:
```
$ py.test
```
To run the tests with coverage:
```
$ py.test --cov
```
|
Download zips of github repositories easily.
+
+ [](https://travis-ci.org/SanketDG/gitdl) [](https://coveralls.io/github/SanketDG/gitdl?branch=master)
## Installation
Clone the repository and cd to it. Then do:
```
$ python setup.py install
```
## Usage
The point of `gitdl` is to quickly get something from GitHub.
### Download a repo with the best match
```
$ gitdl bootstrap
```
This will search for bootstrap, and find the best match and download the
zip for it.
### Download an exact repo
```
$ gitdl -e nvbn/thefuck
```
When `gitdl` is passed with `-e` it expects a {author}/{repo} format to
download the exact repo from GitHub.
### Search for a repo
```
$ gitdl search "intermediate python"
```
This will search GitHub and present the results in a tabular format.
## Development
### Testing
To run the tests:
```
$ py.test
```
To run the tests with coverage:
```
$ py.test --cov
``` | 2 | 0.036364 | 2 | 0 |
e67043d99fe79c525ad71a514dae4b7cb0370270 | test/powershell/Get-Culture.Tests.ps1 | test/powershell/Get-Culture.Tests.ps1 | Describe "Get-Culture DRT Unit Tests" -Tags DRT{
It "Should works proper with get-culture" {
$results = get-Culture
$results | Should Not BeNullOrEmpty
$results[0].GetType() | Should Be CultureInfo
$results[0].Name | Should Be $PSCulture
}
}
Describe "Get-Culture" {
It "Should return a type of CultureInfo for Get-Culture cmdlet" {
(Get-Culture).GetType() | Should Be CultureInfo
}
It "Should have $ culture variable be equivalent to (Get-Culture).Name" {
(Get-Culture).Name | Should Be $PsCulture
}
}
| Describe "Get-Culture DRT Unit Tests" -Tags DRT{
It "Should works proper with get-culture" {
$results = get-Culture
$results -is "System.Globalization.CultureInfo" | Should be $true
$results[0].Name | Should Be $PSCulture
}
}
Describe "Get-Culture" {
It "Should return a type of CultureInfo for Get-Culture cmdlet" {
(Get-Culture).GetType() | Should Be CultureInfo
}
It "Should have $ culture variable be equivalent to (Get-Culture).Name" {
(Get-Culture).Name | Should Be $PsCulture
}
}
| Fix the issue of CR fot Get-Culture | Fix the issue of CR fot Get-Culture
| PowerShell | mit | TravisEz13/PowerShell,TravisEz13/PowerShell,jsoref/PowerShell,jsoref/PowerShell,JamesWTruher/PowerShell-1,JamesWTruher/PowerShell-1,daxian-dbw/PowerShell,kmosher/PowerShell,PaulHigin/PowerShell,daxian-dbw/PowerShell,kmosher/PowerShell,bmanikm/PowerShell,daxian-dbw/PowerShell,KarolKaczmarek/PowerShell,JamesWTruher/PowerShell-1,bingbing8/PowerShell,PaulHigin/PowerShell,bingbing8/PowerShell,KarolKaczmarek/PowerShell,bmanikm/PowerShell,kmosher/PowerShell,jsoref/PowerShell,PaulHigin/PowerShell,kmosher/PowerShell,bmanikm/PowerShell,kmosher/PowerShell,bmanikm/PowerShell,PaulHigin/PowerShell,bingbing8/PowerShell,jsoref/PowerShell,KarolKaczmarek/PowerShell,jsoref/PowerShell,JamesWTruher/PowerShell-1,TravisEz13/PowerShell,KarolKaczmarek/PowerShell,bingbing8/PowerShell,bingbing8/PowerShell,bmanikm/PowerShell,TravisEz13/PowerShell,KarolKaczmarek/PowerShell,daxian-dbw/PowerShell | powershell | ## Code Before:
Describe "Get-Culture DRT Unit Tests" -Tags DRT{
It "Should works proper with get-culture" {
$results = get-Culture
$results | Should Not BeNullOrEmpty
$results[0].GetType() | Should Be CultureInfo
$results[0].Name | Should Be $PSCulture
}
}
Describe "Get-Culture" {
It "Should return a type of CultureInfo for Get-Culture cmdlet" {
(Get-Culture).GetType() | Should Be CultureInfo
}
It "Should have $ culture variable be equivalent to (Get-Culture).Name" {
(Get-Culture).Name | Should Be $PsCulture
}
}
## Instruction:
Fix the issue of CR fot Get-Culture
## Code After:
Describe "Get-Culture DRT Unit Tests" -Tags DRT{
It "Should works proper with get-culture" {
$results = get-Culture
$results -is "System.Globalization.CultureInfo" | Should be $true
$results[0].Name | Should Be $PSCulture
}
}
Describe "Get-Culture" {
It "Should return a type of CultureInfo for Get-Culture cmdlet" {
(Get-Culture).GetType() | Should Be CultureInfo
}
It "Should have $ culture variable be equivalent to (Get-Culture).Name" {
(Get-Culture).Name | Should Be $PsCulture
}
}
| Describe "Get-Culture DRT Unit Tests" -Tags DRT{
It "Should works proper with get-culture" {
$results = get-Culture
+ $results -is "System.Globalization.CultureInfo" | Should be $true
- $results | Should Not BeNullOrEmpty
- $results[0].GetType() | Should Be CultureInfo
$results[0].Name | Should Be $PSCulture
}
}
Describe "Get-Culture" {
It "Should return a type of CultureInfo for Get-Culture cmdlet" {
(Get-Culture).GetType() | Should Be CultureInfo
}
It "Should have $ culture variable be equivalent to (Get-Culture).Name" {
(Get-Culture).Name | Should Be $PsCulture
}
} | 3 | 0.12 | 1 | 2 |
01b603037504cff2f90793ba26c1cb72e8debfbf | package.json | package.json | {
"name": "react-server-status",
"version": "1.1.0",
"description": "A declarative way to set server status",
"main": "lib/index.js",
"browser": "lib/browser.js",
"scripts": {
"build": "babel src --out-dir lib",
"clean": "rimraf lib",
"test": "npm run lint",
"lint": "eslint .",
"check": "ncu",
"prepublish": "npm test && npm run clean && npm run build"
},
"repository": {
"type": "git",
"url": "https://github.com/vgno/react-server-status"
},
"author": "VG",
"license": "MIT",
"dependencies": {
"prop-types": "^15.5.8",
"react-side-effect": "~1.1.0"
},
"devDependencies": {
"babel": "~5.8.21",
"babel-eslint": "~4.1.1",
"eslint": "~1.10.1",
"eslint-config-vgno": "~5.0.0",
"eslint-plugin-react": "~3.10.0",
"npm-check-updates": "~2.5.1",
"rimraf": "~2.4.3"
},
"peerDependencies": {
"react": "^0.14.9 || ^15.3.0"
}
}
| {
"name": "react-server-status",
"version": "1.1.0",
"description": "A declarative way to set server status",
"main": "lib/index.js",
"browser": "lib/browser.js",
"scripts": {
"build": "babel src --out-dir lib",
"clean": "rimraf lib",
"test": "npm run lint",
"lint": "eslint .",
"check": "ncu",
"prepublish": "npm test && npm run clean && npm run build"
},
"repository": {
"type": "git",
"url": "https://github.com/vgno/react-server-status"
},
"author": "VG",
"license": "MIT",
"dependencies": {
"prop-types": "^15.5.8",
"react-side-effect": "~1.1.0"
},
"devDependencies": {
"babel": "~5.8.21",
"babel-eslint": "~4.1.1",
"eslint": "~1.10.1",
"eslint-config-vgno": "~5.0.0",
"eslint-plugin-react": "~3.10.0",
"npm-check-updates": "~2.5.1",
"rimraf": "~2.4.3"
},
"peerDependencies": {
"react": "^0.14.9 || ^15.3.0 || ^16.0.0"
}
}
| Update peer dependency to include react 16 | Update peer dependency to include react 16
React 16 is backward compatible. This will remove warnings when packages that depend on this npm install/yarn/etc. | JSON | mit | vgno/react-server-status | json | ## Code Before:
{
"name": "react-server-status",
"version": "1.1.0",
"description": "A declarative way to set server status",
"main": "lib/index.js",
"browser": "lib/browser.js",
"scripts": {
"build": "babel src --out-dir lib",
"clean": "rimraf lib",
"test": "npm run lint",
"lint": "eslint .",
"check": "ncu",
"prepublish": "npm test && npm run clean && npm run build"
},
"repository": {
"type": "git",
"url": "https://github.com/vgno/react-server-status"
},
"author": "VG",
"license": "MIT",
"dependencies": {
"prop-types": "^15.5.8",
"react-side-effect": "~1.1.0"
},
"devDependencies": {
"babel": "~5.8.21",
"babel-eslint": "~4.1.1",
"eslint": "~1.10.1",
"eslint-config-vgno": "~5.0.0",
"eslint-plugin-react": "~3.10.0",
"npm-check-updates": "~2.5.1",
"rimraf": "~2.4.3"
},
"peerDependencies": {
"react": "^0.14.9 || ^15.3.0"
}
}
## Instruction:
Update peer dependency to include react 16
React 16 is backward compatible. This will remove warnings when packages that depend on this npm install/yarn/etc.
## Code After:
{
"name": "react-server-status",
"version": "1.1.0",
"description": "A declarative way to set server status",
"main": "lib/index.js",
"browser": "lib/browser.js",
"scripts": {
"build": "babel src --out-dir lib",
"clean": "rimraf lib",
"test": "npm run lint",
"lint": "eslint .",
"check": "ncu",
"prepublish": "npm test && npm run clean && npm run build"
},
"repository": {
"type": "git",
"url": "https://github.com/vgno/react-server-status"
},
"author": "VG",
"license": "MIT",
"dependencies": {
"prop-types": "^15.5.8",
"react-side-effect": "~1.1.0"
},
"devDependencies": {
"babel": "~5.8.21",
"babel-eslint": "~4.1.1",
"eslint": "~1.10.1",
"eslint-config-vgno": "~5.0.0",
"eslint-plugin-react": "~3.10.0",
"npm-check-updates": "~2.5.1",
"rimraf": "~2.4.3"
},
"peerDependencies": {
"react": "^0.14.9 || ^15.3.0 || ^16.0.0"
}
}
| {
"name": "react-server-status",
"version": "1.1.0",
"description": "A declarative way to set server status",
"main": "lib/index.js",
"browser": "lib/browser.js",
"scripts": {
"build": "babel src --out-dir lib",
"clean": "rimraf lib",
"test": "npm run lint",
"lint": "eslint .",
"check": "ncu",
"prepublish": "npm test && npm run clean && npm run build"
},
"repository": {
"type": "git",
"url": "https://github.com/vgno/react-server-status"
},
"author": "VG",
"license": "MIT",
"dependencies": {
"prop-types": "^15.5.8",
"react-side-effect": "~1.1.0"
},
"devDependencies": {
"babel": "~5.8.21",
"babel-eslint": "~4.1.1",
"eslint": "~1.10.1",
"eslint-config-vgno": "~5.0.0",
"eslint-plugin-react": "~3.10.0",
"npm-check-updates": "~2.5.1",
"rimraf": "~2.4.3"
},
"peerDependencies": {
- "react": "^0.14.9 || ^15.3.0"
+ "react": "^0.14.9 || ^15.3.0 || ^16.0.0"
? +++++++++++
}
} | 2 | 0.054054 | 1 | 1 |
2b3f68ff311f1ad0175a0c741c48eb90ced08c1f | source/views/components/nav-buttons/styles.js | source/views/components/nav-buttons/styles.js | /**
* @flow
* A collection of common styles for navbar buttons
*/
import {StyleSheet, Platform} from 'react-native'
import * as c from '../colors'
export const commonStyles = StyleSheet.create({
button: {
flexDirection: 'row',
alignItems: 'center',
...Platform.select({
ios: {
paddingVertical: 11,
paddingHorizontal: 18,
},
android: {
paddingVertical: 15.5,
paddingHorizontal: 16,
},
}),
},
text: {
fontSize: 17,
color: c.white,
...Platform.select({
android: {
marginTop: 1,
},
}),
},
})
export const rightButtonStyles = StyleSheet.create({
button: {
flexDirection: 'row',
alignItems: 'center',
paddingLeft: 6,
...Platform.select({
ios: {
paddingRight: 16,
marginTop: 7,
},
android: {
paddingVertical: 16,
paddingRight: 16,
},
}),
},
icon: {
color: c.white,
...Platform.select({
ios: {
fontSize: 32,
},
android: {
fontSize: 24,
},
}),
},
})
| /**
* @flow
* A collection of common styles for navbar buttons
*/
import {StyleSheet, Platform} from 'react-native'
import * as c from '../colors'
export const commonStyles = StyleSheet.create({
button: {
flexDirection: 'row',
alignItems: 'center',
...Platform.select({
ios: {
paddingHorizontal: 18,
},
android: {
paddingVertical: 15.5,
paddingHorizontal: 16,
},
}),
},
text: {
fontSize: 17,
color: c.white,
...Platform.select({
android: {
marginTop: 1,
},
}),
},
})
export const rightButtonStyles = StyleSheet.create({
button: {
flexDirection: 'row',
alignItems: 'center',
paddingLeft: 6,
...Platform.select({
ios: {
paddingRight: 16,
marginTop: 7,
},
android: {
paddingVertical: 16,
paddingRight: 16,
},
}),
},
icon: {
color: c.white,
...Platform.select({
ios: {
fontSize: 32,
},
android: {
fontSize: 24,
},
}),
},
})
| Remove vertical padding from nav button style | Remove vertical padding from nav button style
| JavaScript | agpl-3.0 | StoDevX/AAO-React-Native,StoDevX/AAO-React-Native,carls-app/carls,carls-app/carls,StoDevX/AAO-React-Native,StoDevX/AAO-React-Native,carls-app/carls,carls-app/carls,StoDevX/AAO-React-Native,StoDevX/AAO-React-Native,carls-app/carls,StoDevX/AAO-React-Native,StoDevX/AAO-React-Native,StoDevX/AAO-React-Native,carls-app/carls,carls-app/carls | javascript | ## Code Before:
/**
* @flow
* A collection of common styles for navbar buttons
*/
import {StyleSheet, Platform} from 'react-native'
import * as c from '../colors'
export const commonStyles = StyleSheet.create({
button: {
flexDirection: 'row',
alignItems: 'center',
...Platform.select({
ios: {
paddingVertical: 11,
paddingHorizontal: 18,
},
android: {
paddingVertical: 15.5,
paddingHorizontal: 16,
},
}),
},
text: {
fontSize: 17,
color: c.white,
...Platform.select({
android: {
marginTop: 1,
},
}),
},
})
export const rightButtonStyles = StyleSheet.create({
button: {
flexDirection: 'row',
alignItems: 'center',
paddingLeft: 6,
...Platform.select({
ios: {
paddingRight: 16,
marginTop: 7,
},
android: {
paddingVertical: 16,
paddingRight: 16,
},
}),
},
icon: {
color: c.white,
...Platform.select({
ios: {
fontSize: 32,
},
android: {
fontSize: 24,
},
}),
},
})
## Instruction:
Remove vertical padding from nav button style
## Code After:
/**
* @flow
* A collection of common styles for navbar buttons
*/
import {StyleSheet, Platform} from 'react-native'
import * as c from '../colors'
export const commonStyles = StyleSheet.create({
button: {
flexDirection: 'row',
alignItems: 'center',
...Platform.select({
ios: {
paddingHorizontal: 18,
},
android: {
paddingVertical: 15.5,
paddingHorizontal: 16,
},
}),
},
text: {
fontSize: 17,
color: c.white,
...Platform.select({
android: {
marginTop: 1,
},
}),
},
})
export const rightButtonStyles = StyleSheet.create({
button: {
flexDirection: 'row',
alignItems: 'center',
paddingLeft: 6,
...Platform.select({
ios: {
paddingRight: 16,
marginTop: 7,
},
android: {
paddingVertical: 16,
paddingRight: 16,
},
}),
},
icon: {
color: c.white,
...Platform.select({
ios: {
fontSize: 32,
},
android: {
fontSize: 24,
},
}),
},
})
| /**
* @flow
* A collection of common styles for navbar buttons
*/
import {StyleSheet, Platform} from 'react-native'
import * as c from '../colors'
export const commonStyles = StyleSheet.create({
button: {
flexDirection: 'row',
alignItems: 'center',
...Platform.select({
ios: {
- paddingVertical: 11,
paddingHorizontal: 18,
},
android: {
paddingVertical: 15.5,
paddingHorizontal: 16,
},
}),
},
text: {
fontSize: 17,
color: c.white,
...Platform.select({
android: {
marginTop: 1,
},
}),
},
})
export const rightButtonStyles = StyleSheet.create({
button: {
flexDirection: 'row',
alignItems: 'center',
paddingLeft: 6,
...Platform.select({
ios: {
paddingRight: 16,
marginTop: 7,
},
android: {
paddingVertical: 16,
paddingRight: 16,
},
}),
},
icon: {
color: c.white,
...Platform.select({
ios: {
fontSize: 32,
},
android: {
fontSize: 24,
},
}),
},
}) | 1 | 0.016129 | 0 | 1 |
4ba453fb4d7bab25e5fdcc3f2294f0a53a987b41 | src/map/services/index.js | src/map/services/index.js | const mapBaseLayers = require('../../../public/static/map/map-base-layers.config.json')
async function fetchMap(resolver, query) {
const result = await fetch('http://localhost:8080/cms_search/graphql', {
method: 'post',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
query,
}),
})
const json = await result.json()
return json.data[resolver]
}
export function getMapBaseLayers() {
return mapBaseLayers
}
export async function getMapLayers() {
const query = `{ mapLayerSearch { results { id title url params layers external detailUrl detailItem detailIsShape noDetail authScope } } }`
const { results: mapLayerResults } = await fetchMap('mapLayerSearch', query)
return mapLayerResults
}
export async function getPanelLayers() {
const query = `{ mapCollectionSearch { results { id title mapLayers { id title legendItems { id title url params layers iconUrl imageRule notSelectable noDetail } authScope imageRule iconUrl url params layers detailUrl detailItem detailIsShape noDetail minZoom maxZoom } } } }`
const { results: mapPanelLayerResults } = await fetchMap('mapCollectionSearch', query)
return mapPanelLayerResults
}
| const mapBaseLayers = require('../../../public/static/map/map-base-layers.config.json')
async function fetchMap(resolver, query) {
const result = await fetch(process.env.GRAPHQL_ENDPOINT, {
method: 'post',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
query,
}),
})
const json = await result.json()
return json.data[resolver]
}
export function getMapBaseLayers() {
return mapBaseLayers
}
export async function getMapLayers() {
const query = `{ mapLayerSearch { results { id title url params layers external detailUrl detailItem detailIsShape noDetail authScope } } }`
const { results: mapLayerResults } = await fetchMap('mapLayerSearch', query)
return mapLayerResults
}
export async function getPanelLayers() {
const query = `{ mapCollectionSearch { results { id title mapLayers { id title legendItems { id title url params layers iconUrl imageRule notSelectable noDetail } authScope imageRule iconUrl url params layers detailUrl detailItem detailIsShape noDetail minZoom maxZoom } } } }`
const { results: mapPanelLayerResults } = await fetchMap('mapCollectionSearch', query)
return mapPanelLayerResults
}
| Use environment variable to fetch map information | Use environment variable to fetch map information
| JavaScript | mpl-2.0 | DatapuntAmsterdam/atlas,Amsterdam/atlas,DatapuntAmsterdam/atlas_prototype,DatapuntAmsterdam/atlas_prototype,Amsterdam/atlas,Amsterdam/atlas,DatapuntAmsterdam/atlas,DatapuntAmsterdam/atlas,Amsterdam/atlas | javascript | ## Code Before:
const mapBaseLayers = require('../../../public/static/map/map-base-layers.config.json')
async function fetchMap(resolver, query) {
const result = await fetch('http://localhost:8080/cms_search/graphql', {
method: 'post',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
query,
}),
})
const json = await result.json()
return json.data[resolver]
}
export function getMapBaseLayers() {
return mapBaseLayers
}
export async function getMapLayers() {
const query = `{ mapLayerSearch { results { id title url params layers external detailUrl detailItem detailIsShape noDetail authScope } } }`
const { results: mapLayerResults } = await fetchMap('mapLayerSearch', query)
return mapLayerResults
}
export async function getPanelLayers() {
const query = `{ mapCollectionSearch { results { id title mapLayers { id title legendItems { id title url params layers iconUrl imageRule notSelectable noDetail } authScope imageRule iconUrl url params layers detailUrl detailItem detailIsShape noDetail minZoom maxZoom } } } }`
const { results: mapPanelLayerResults } = await fetchMap('mapCollectionSearch', query)
return mapPanelLayerResults
}
## Instruction:
Use environment variable to fetch map information
## Code After:
const mapBaseLayers = require('../../../public/static/map/map-base-layers.config.json')
async function fetchMap(resolver, query) {
const result = await fetch(process.env.GRAPHQL_ENDPOINT, {
method: 'post',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
query,
}),
})
const json = await result.json()
return json.data[resolver]
}
export function getMapBaseLayers() {
return mapBaseLayers
}
export async function getMapLayers() {
const query = `{ mapLayerSearch { results { id title url params layers external detailUrl detailItem detailIsShape noDetail authScope } } }`
const { results: mapLayerResults } = await fetchMap('mapLayerSearch', query)
return mapLayerResults
}
export async function getPanelLayers() {
const query = `{ mapCollectionSearch { results { id title mapLayers { id title legendItems { id title url params layers iconUrl imageRule notSelectable noDetail } authScope imageRule iconUrl url params layers detailUrl detailItem detailIsShape noDetail minZoom maxZoom } } } }`
const { results: mapPanelLayerResults } = await fetchMap('mapCollectionSearch', query)
return mapPanelLayerResults
}
| const mapBaseLayers = require('../../../public/static/map/map-base-layers.config.json')
async function fetchMap(resolver, query) {
- const result = await fetch('http://localhost:8080/cms_search/graphql', {
+ const result = await fetch(process.env.GRAPHQL_ENDPOINT, {
method: 'post',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
query,
}),
})
const json = await result.json()
return json.data[resolver]
}
export function getMapBaseLayers() {
return mapBaseLayers
}
export async function getMapLayers() {
const query = `{ mapLayerSearch { results { id title url params layers external detailUrl detailItem detailIsShape noDetail authScope } } }`
const { results: mapLayerResults } = await fetchMap('mapLayerSearch', query)
return mapLayerResults
}
export async function getPanelLayers() {
const query = `{ mapCollectionSearch { results { id title mapLayers { id title legendItems { id title url params layers iconUrl imageRule notSelectable noDetail } authScope imageRule iconUrl url params layers detailUrl detailItem detailIsShape noDetail minZoom maxZoom } } } }`
const { results: mapPanelLayerResults } = await fetchMap('mapCollectionSearch', query)
return mapPanelLayerResults
} | 2 | 0.057143 | 1 | 1 |
fbb9c2bc6f29b059da09764b563441ae687aee47 | contentcuration/contentcuration/utils/asynccommand.py | contentcuration/contentcuration/utils/asynccommand.py | from abc import abstractmethod
from django.core.management.base import BaseCommand
class TaskCommand(BaseCommand):
def start_progress(self, *args, **options):
# TODO: needs implementation
pass
def update_progress(self, *args, **options):
# TODO: needs implementation
pass
@abstractmethod
def handle_async(self, *args, **options):
pass
| from abc import abstractmethod
from collections import namedtuple
from django.core.management.base import BaseCommand
from django.core.management.base import CommandError
Progress = namedtuple(
'Progress',
[
'progress',
'total',
'fraction',
]
)
class TaskCommand(BaseCommand):
def handle(self, *args, **options):
self.progresstracker = None
return self.handle_async(*args, **options)
def start_progress(self, total):
self.progresstracker = Progress(progress=0, total=total, fraction=0)
def update_progress(self, increment):
tracker = self.progresstracker
progress = tracker.progress + increment
if progress > tracker.total:
raise CommandError("Progress reaches over 100%.")
fraction = 1.0 * progress / tracker.total
updated_tracker = tracker._replace(progress=progress, fraction=fraction)
self.progresstracker = updated_tracker
@abstractmethod
def handle_async(self, *args, **options):
pass
| Add a progress tracker to the async task command | Add a progress tracker to the async task command
| Python | mit | DXCanas/content-curation,fle-internal/content-curation,DXCanas/content-curation,fle-internal/content-curation,DXCanas/content-curation,fle-internal/content-curation,fle-internal/content-curation,DXCanas/content-curation | python | ## Code Before:
from abc import abstractmethod
from django.core.management.base import BaseCommand
class TaskCommand(BaseCommand):
def start_progress(self, *args, **options):
# TODO: needs implementation
pass
def update_progress(self, *args, **options):
# TODO: needs implementation
pass
@abstractmethod
def handle_async(self, *args, **options):
pass
## Instruction:
Add a progress tracker to the async task command
## Code After:
from abc import abstractmethod
from collections import namedtuple
from django.core.management.base import BaseCommand
from django.core.management.base import CommandError
Progress = namedtuple(
'Progress',
[
'progress',
'total',
'fraction',
]
)
class TaskCommand(BaseCommand):
def handle(self, *args, **options):
self.progresstracker = None
return self.handle_async(*args, **options)
def start_progress(self, total):
self.progresstracker = Progress(progress=0, total=total, fraction=0)
def update_progress(self, increment):
tracker = self.progresstracker
progress = tracker.progress + increment
if progress > tracker.total:
raise CommandError("Progress reaches over 100%.")
fraction = 1.0 * progress / tracker.total
updated_tracker = tracker._replace(progress=progress, fraction=fraction)
self.progresstracker = updated_tracker
@abstractmethod
def handle_async(self, *args, **options):
pass
| from abc import abstractmethod
+ from collections import namedtuple
from django.core.management.base import BaseCommand
+ from django.core.management.base import CommandError
+
+ Progress = namedtuple(
+ 'Progress',
+ [
+ 'progress',
+ 'total',
+ 'fraction',
+ ]
+ )
class TaskCommand(BaseCommand):
- def start_progress(self, *args, **options):
? ^^ ^^^^^^^^ --
+ def handle(self, *args, **options):
? ^ ^^^
- # TODO: needs implementation
- pass
+ self.progresstracker = None
+ return self.handle_async(*args, **options)
+ def start_progress(self, total):
+ self.progresstracker = Progress(progress=0, total=total, fraction=0)
+
- def update_progress(self, *args, **options):
? ^^ ^^^^^^^^ ----
+ def update_progress(self, increment):
? ^^^ ^^^^
- # TODO: needs implementation
- pass
+ tracker = self.progresstracker
+ progress = tracker.progress + increment
+ if progress > tracker.total:
+ raise CommandError("Progress reaches over 100%.")
+
+ fraction = 1.0 * progress / tracker.total
+ updated_tracker = tracker._replace(progress=progress, fraction=fraction)
+ self.progresstracker = updated_tracker
@abstractmethod
def handle_async(self, *args, **options):
pass | 32 | 1.882353 | 26 | 6 |
fc983cf6d00bd296cc05b265c8218e52156d04ad | README.md | README.md |
A set of utility scripts that you can use to bind to keyboard shortcuts in order to manage
windows on any window manager.
## Current available commands
### x-window-move left
Snap a window to the left, rotating between 50%, 33% and 66% screen width
### x-window-move right
Snap a window to the right, rotating between 50%, 33% and 66% screen width
### x-window-move up
Snap a window to the top, giving it 50% screen height
### x-window-move down
Snap a window to the bottom, giving it 50% screen height
### x-window-move maximize
Maximize a window
### x-window-move minimize
Minimize a window
|
A set of utility scripts that you can use to bind to keyboard shortcuts in order to manage
windows on any window manager.
## Current available commands
### x-window-move left
Snap a window to the left, rotating between 50%, 33% and 66% screen width
### x-window-move right
Snap a window to the right, rotating between 50%, 33% and 66% screen width
### x-window-move up
Snap a window to the top, giving it 50% screen height
### x-window-move down
Snap a window to the bottom, giving it 50% screen height
### x-window-move maximize
Maximize a window
### x-window-move minimize
Minimize a window
## x-window-move right-screen
Moves a window to the display on the right (for multi-monitor setup)
## x-window-move left-screen
Moves a window to the display on the left (for multi-monitor setup)
| Add instructions for right and left screen | Add instructions for right and left screen
| Markdown | mit | marcel-valdez/x-window-shortcuts | markdown | ## Code Before:
A set of utility scripts that you can use to bind to keyboard shortcuts in order to manage
windows on any window manager.
## Current available commands
### x-window-move left
Snap a window to the left, rotating between 50%, 33% and 66% screen width
### x-window-move right
Snap a window to the right, rotating between 50%, 33% and 66% screen width
### x-window-move up
Snap a window to the top, giving it 50% screen height
### x-window-move down
Snap a window to the bottom, giving it 50% screen height
### x-window-move maximize
Maximize a window
### x-window-move minimize
Minimize a window
## Instruction:
Add instructions for right and left screen
## Code After:
A set of utility scripts that you can use to bind to keyboard shortcuts in order to manage
windows on any window manager.
## Current available commands
### x-window-move left
Snap a window to the left, rotating between 50%, 33% and 66% screen width
### x-window-move right
Snap a window to the right, rotating between 50%, 33% and 66% screen width
### x-window-move up
Snap a window to the top, giving it 50% screen height
### x-window-move down
Snap a window to the bottom, giving it 50% screen height
### x-window-move maximize
Maximize a window
### x-window-move minimize
Minimize a window
## x-window-move right-screen
Moves a window to the display on the right (for multi-monitor setup)
## x-window-move left-screen
Moves a window to the display on the left (for multi-monitor setup)
|
A set of utility scripts that you can use to bind to keyboard shortcuts in order to manage
windows on any window manager.
## Current available commands
### x-window-move left
Snap a window to the left, rotating between 50%, 33% and 66% screen width
### x-window-move right
Snap a window to the right, rotating between 50%, 33% and 66% screen width
### x-window-move up
Snap a window to the top, giving it 50% screen height
### x-window-move down
Snap a window to the bottom, giving it 50% screen height
### x-window-move maximize
Maximize a window
### x-window-move minimize
Minimize a window
+
+ ## x-window-move right-screen
+
+ Moves a window to the display on the right (for multi-monitor setup)
+
+ ## x-window-move left-screen
+
+ Moves a window to the display on the left (for multi-monitor setup) | 8 | 0.275862 | 8 | 0 |
f1ea452112c9a5750bca129d5c026728fa12a324 | src/themes/material/templates/body-cell-array-edit.tpl.html | src/themes/material/templates/body-cell-array-edit.tpl.html | <ng-template key='body-cell-array-edit.tpl.html' let-$cell let-$view="$view">
<div class="q-grid-editor q-grid-array">
<h2 class="md-title">Edit {{$cell.column.title}}</h2>
<div class="q-grid-array-view">
<md-chip-list>
<ng-template ngFor let-item [ngForOf]="$cell.value">
<md-chip selected="true">{{item}}</md-chip>
</ng-template>
</md-chip-list>
</div>
<div class="q-grid-actions">
<button md-button ng-click="$view.edit.cell.commit.execute($cell, $event)">Save</button>
<button md-button ng-click="$view.edit.cell.cancel.execute($cell, $event)">Cancel</button>
</div>
</div>
</ng-template> | <ng-template key='body-cell-array-edit.tpl.html' let-$cell let-$view="$view">
<div class="q-grid-editor q-grid-array">
<h2 class="md-title">Edit {{$cell.column.title}}</h2>
<div class="q-grid-array-view">
<md-chip-list>
<ng-template ngFor let-item [ngForOf]="$cell.value">
<md-chip selected="true">{{item}}</md-chip>
</ng-template>
</md-chip-list>
</div>
<md-input-container>
<input
mdInput
q-grid-focus
placeholder="Enter a {{$cell.column.title}}..."
[(ngModel)]="$view.edit.cell.value"
(blur)="$view.edit.cell.commit.execute($cell)">
</md-input-container>
<div class="q-grid-actions">
<button md-button ng-click="$view.edit.cell.commit.execute($cell, $event)">Save</button>
<button md-button ng-click="$view.edit.cell.cancel.execute($cell, $event)">Cancel</button>
</div>
</div>
</ng-template> | Add template for body cell array edit | Add template for body cell array edit
| HTML | mit | qgrid/ng2,azkurban/ng2,qgrid/ng2,azkurban/ng2,qgrid/ng2,azkurban/ng2 | html | ## Code Before:
<ng-template key='body-cell-array-edit.tpl.html' let-$cell let-$view="$view">
<div class="q-grid-editor q-grid-array">
<h2 class="md-title">Edit {{$cell.column.title}}</h2>
<div class="q-grid-array-view">
<md-chip-list>
<ng-template ngFor let-item [ngForOf]="$cell.value">
<md-chip selected="true">{{item}}</md-chip>
</ng-template>
</md-chip-list>
</div>
<div class="q-grid-actions">
<button md-button ng-click="$view.edit.cell.commit.execute($cell, $event)">Save</button>
<button md-button ng-click="$view.edit.cell.cancel.execute($cell, $event)">Cancel</button>
</div>
</div>
</ng-template>
## Instruction:
Add template for body cell array edit
## Code After:
<ng-template key='body-cell-array-edit.tpl.html' let-$cell let-$view="$view">
<div class="q-grid-editor q-grid-array">
<h2 class="md-title">Edit {{$cell.column.title}}</h2>
<div class="q-grid-array-view">
<md-chip-list>
<ng-template ngFor let-item [ngForOf]="$cell.value">
<md-chip selected="true">{{item}}</md-chip>
</ng-template>
</md-chip-list>
</div>
<md-input-container>
<input
mdInput
q-grid-focus
placeholder="Enter a {{$cell.column.title}}..."
[(ngModel)]="$view.edit.cell.value"
(blur)="$view.edit.cell.commit.execute($cell)">
</md-input-container>
<div class="q-grid-actions">
<button md-button ng-click="$view.edit.cell.commit.execute($cell, $event)">Save</button>
<button md-button ng-click="$view.edit.cell.cancel.execute($cell, $event)">Cancel</button>
</div>
</div>
</ng-template> | <ng-template key='body-cell-array-edit.tpl.html' let-$cell let-$view="$view">
<div class="q-grid-editor q-grid-array">
<h2 class="md-title">Edit {{$cell.column.title}}</h2>
<div class="q-grid-array-view">
<md-chip-list>
<ng-template ngFor let-item [ngForOf]="$cell.value">
<md-chip selected="true">{{item}}</md-chip>
</ng-template>
</md-chip-list>
</div>
+ <md-input-container>
+ <input
+ mdInput
+ q-grid-focus
+ placeholder="Enter a {{$cell.column.title}}..."
+ [(ngModel)]="$view.edit.cell.value"
+ (blur)="$view.edit.cell.commit.execute($cell)">
+ </md-input-container>
<div class="q-grid-actions">
<button md-button ng-click="$view.edit.cell.commit.execute($cell, $event)">Save</button>
<button md-button ng-click="$view.edit.cell.cancel.execute($cell, $event)">Cancel</button>
</div>
</div>
</ng-template> | 8 | 0.5 | 8 | 0 |
66a40f0af87113a1c9308321034637e3d258a091 | README.md | README.md |
An emulator for the TIS-100 written in Rust. The emulator currently implements the Simple Sandbox puzzle from the game.
## How to Run
|
An emulator for the TIS-100 written in Rust. The emulator currently implements the Simple Sandbox puzzle from the game.
## Usage
```
TIS-100 Sandbox Emulator
Usage:
tis-100 <save.txt>
```
| Add usage info to readme. | Add usage info to readme.
| Markdown | mit | rcolinray/tis-100-rs | markdown | ## Code Before:
An emulator for the TIS-100 written in Rust. The emulator currently implements the Simple Sandbox puzzle from the game.
## How to Run
## Instruction:
Add usage info to readme.
## Code After:
An emulator for the TIS-100 written in Rust. The emulator currently implements the Simple Sandbox puzzle from the game.
## Usage
```
TIS-100 Sandbox Emulator
Usage:
tis-100 <save.txt>
```
|
An emulator for the TIS-100 written in Rust. The emulator currently implements the Simple Sandbox puzzle from the game.
- ## How to Run
+ ## Usage
+ ```
+ TIS-100 Sandbox Emulator
+
+ Usage:
+ tis-100 <save.txt>
+ ```
+ | 9 | 1.8 | 8 | 1 |
afbfe545d84fb6037fd4791483bc61383a852f18 | tests/CacheTool/Console/ApplicationTest.php | tests/CacheTool/Console/ApplicationTest.php | <?php
namespace CacheTool\Console;
use CacheTool\Command\CommandTest;
class ApplicationTest extends CommandTest
{
public function testVersion()
{
$result = $this->runCommand('--version');
$this->assertStringStartsWith('CacheTool version @package_version@', $result);
}
}
| <?php
namespace CacheTool\Console;
use CacheTool\Command\CommandTest;
class ApplicationTest extends CommandTest
{
public function testVersion()
{
$result = $this->runCommand('--version');
$this->assertEquals("CacheTool version @package_version@\n", $result);
}
}
| Test entire string in application | Test entire string in application
| PHP | mit | continuousdemo/cachetool,gordalina/cachetool,oswaldderiemaecker/cachetool,oswaldderiemaecker/cachetool,continuousdemo/cachetool,gordalina/cachetool | php | ## Code Before:
<?php
namespace CacheTool\Console;
use CacheTool\Command\CommandTest;
class ApplicationTest extends CommandTest
{
public function testVersion()
{
$result = $this->runCommand('--version');
$this->assertStringStartsWith('CacheTool version @package_version@', $result);
}
}
## Instruction:
Test entire string in application
## Code After:
<?php
namespace CacheTool\Console;
use CacheTool\Command\CommandTest;
class ApplicationTest extends CommandTest
{
public function testVersion()
{
$result = $this->runCommand('--version');
$this->assertEquals("CacheTool version @package_version@\n", $result);
}
}
| <?php
namespace CacheTool\Console;
use CacheTool\Command\CommandTest;
class ApplicationTest extends CommandTest
{
public function testVersion()
{
$result = $this->runCommand('--version');
- $this->assertStringStartsWith('CacheTool version @package_version@', $result);
? ^^^^^^^^ ^^ ---- ^ ^
+ $this->assertEquals("CacheTool version @package_version@\n", $result);
? ^^^ ^ ^ ^^^
}
} | 2 | 0.142857 | 1 | 1 |
e578c90cc542d3cf825645fa9376796a1e7c31f9 | lib/cache.py | lib/cache.py | import functools
import logging
import redis
import config
# Default options
redis_opts = {
'host': 'localhost',
'port': 6379,
'db': 0,
'password': None
}
redis_conn = None
cache_prefix = None
def init():
global redis_conn, cache_prefix
cfg = config.load()
cache = cfg.cache
if not cache:
return
logging.info('Enabling storage cache on Redis')
if not isinstance(cache, dict):
cache = {}
for k, v in cache.iteritems():
redis_opts[k] = v
logging.info('Redis config: {0}'.format(redis_opts))
redis_conn = redis.StrictRedis(host=redis_opts['host'],
port=int(redis_opts['port']),
db=int(redis_opts['db']),
password=redis_opts['password'])
cache_prefix = 'cache_path:{0}'.format(cfg.get('storage_path', '/'))
def cache_key(key):
return cache_prefix + key
def put(f):
@functools.wraps(f)
def wrapper(*args):
content = args[-1]
key = args[-2]
key = cache_key(key)
redis_conn.set(key, content)
return f(*args)
if redis_conn is None:
return f
return wrapper
def get(f):
@functools.wraps(f)
def wrapper(*args):
key = args[-1]
key = cache_key(key)
content = redis_conn.get(key)
if content is not None:
return content
# Refresh cache
content = f(*args)
redis_conn.set(key, content)
return content
if redis_conn is None:
return f
return wrapper
def remove(f):
@functools.wraps(f)
def wrapper(*args):
key = args[-1]
key = cache_key(key)
redis_conn.delete(key)
return f(*args)
if redis_conn is None:
return f
return wrapper
init()
| import functools
import logging
import redis
import config
# Default options
redis_opts = {
'host': 'localhost',
'port': 6379,
'db': 0,
'password': None
}
redis_conn = None
cache_prefix = None
def init():
global redis_conn, cache_prefix
cfg = config.load()
cache = cfg.cache
if not cache:
return
logging.info('Enabling storage cache on Redis')
if not isinstance(cache, dict):
cache = {}
for k, v in cache.iteritems():
redis_opts[k] = v
logging.info('Redis config: {0}'.format(redis_opts))
redis_conn = redis.StrictRedis(host=redis_opts['host'],
port=int(redis_opts['port']),
db=int(redis_opts['db']),
password=redis_opts['password'])
cache_prefix = 'cache_path:{0}'.format(cfg.get('storage_path', '/'))
init()
| Remove unneeded lru specific helper methods | Remove unneeded lru specific helper methods
| Python | apache-2.0 | dalvikchen/docker-registry,atyenoria/docker-registry,atyenoria/docker-registry,ewindisch/docker-registry,docker/docker-registry,ken-saka/docker-registry,wakermahmud/docker-registry,Carrotzpc/docker-registry,kireal/docker-registry,ewindisch/docker-registry,yuriyf/docker-registry,whuwxl/docker-registry,Haitianisgood/docker-registry,GoogleCloudPlatform/docker-registry-driver-gcs,dedalusdev/docker-registry,cnh/docker-registry,HubSpot/docker-registry,yuriyf/docker-registry,deis/docker-registry,csrwng/docker-registry,wakermahmud/docker-registry,mdshuai/docker-registry,cnh/docker-registry,dalvikchen/docker-registry,dedalusdev/docker-registry,deis/docker-registry,alephcloud/docker-registry,depay/docker-registry,stormltf/docker-registry,docker/docker-registry,scrapinghub/docker-registry,pombredanne/docker-registry,depay/docker-registry,liggitt/docker-registry,atyenoria/docker-registry,dhiltgen/docker-registry,ken-saka/docker-registry,shipyard/docker-registry,stormltf/docker-registry,pombredanne/docker-registry,ActiveState/docker-registry,dhiltgen/docker-registry,nunogt/docker-registry,dalvikchen/docker-registry,HubSpot/docker-registry,andrew-plunk/docker-registry,shakamunyi/docker-registry,yuriyf/docker-registry,kireal/docker-registry,kireal/docker-registry,dhiltgen/docker-registry,mdshuai/docker-registry,HubSpot/docker-registry,fabianofranz/docker-registry,cnh/docker-registry,Haitianisgood/docker-registry,ptisserand/docker-registry,catalyst-zero/docker-registry,ken-saka/docker-registry,tangkun75/docker-registry,shakamunyi/docker-registry,mdshuai/docker-registry,GoogleCloudPlatform/docker-registry-driver-gcs,liggitt/docker-registry,dedalusdev/docker-registry,whuwxl/docker-registry,Carrotzpc/docker-registry,wakermahmud/docker-registry,deis/docker-registry,scrapinghub/docker-registry,hpcloud/docker-registry,ActiveState/docker-registry,viljaste/docker-registry-1,OnePaaS/docker-registry,OnePaaS/docker-registry,catalyst-zero/docker-registry,shakamunyi/docker-registry,hpcloud/docker-registry,tangkun75/docker-registry,csrwng/docker-registry,hpcloud/docker-registry,shipyard/docker-registry,mboersma/docker-registry,hex108/docker-registry,tangkun75/docker-registry,hex108/docker-registry,dine1987/Docker,Haitianisgood/docker-registry,fabianofranz/docker-registry,mboersma/docker-registry,Carrotzpc/docker-registry,ptisserand/docker-registry,nunogt/docker-registry,dine1987/Docker,ptisserand/docker-registry,docker/docker-registry,OnePaaS/docker-registry,andrew-plunk/docker-registry,scrapinghub/docker-registry,ActiveState/docker-registry,nunogt/docker-registry,mboersma/docker-registry,alephcloud/docker-registry,alephcloud/docker-registry,depay/docker-registry,csrwng/docker-registry,fabianofranz/docker-registry,shipyard/docker-registry,hex108/docker-registry,stormltf/docker-registry,whuwxl/docker-registry,viljaste/docker-registry-1,pombredanne/docker-registry,ewindisch/docker-registry,andrew-plunk/docker-registry,dine1987/Docker,viljaste/docker-registry-1,liggitt/docker-registry,catalyst-zero/docker-registry | python | ## Code Before:
import functools
import logging
import redis
import config
# Default options
redis_opts = {
'host': 'localhost',
'port': 6379,
'db': 0,
'password': None
}
redis_conn = None
cache_prefix = None
def init():
global redis_conn, cache_prefix
cfg = config.load()
cache = cfg.cache
if not cache:
return
logging.info('Enabling storage cache on Redis')
if not isinstance(cache, dict):
cache = {}
for k, v in cache.iteritems():
redis_opts[k] = v
logging.info('Redis config: {0}'.format(redis_opts))
redis_conn = redis.StrictRedis(host=redis_opts['host'],
port=int(redis_opts['port']),
db=int(redis_opts['db']),
password=redis_opts['password'])
cache_prefix = 'cache_path:{0}'.format(cfg.get('storage_path', '/'))
def cache_key(key):
return cache_prefix + key
def put(f):
@functools.wraps(f)
def wrapper(*args):
content = args[-1]
key = args[-2]
key = cache_key(key)
redis_conn.set(key, content)
return f(*args)
if redis_conn is None:
return f
return wrapper
def get(f):
@functools.wraps(f)
def wrapper(*args):
key = args[-1]
key = cache_key(key)
content = redis_conn.get(key)
if content is not None:
return content
# Refresh cache
content = f(*args)
redis_conn.set(key, content)
return content
if redis_conn is None:
return f
return wrapper
def remove(f):
@functools.wraps(f)
def wrapper(*args):
key = args[-1]
key = cache_key(key)
redis_conn.delete(key)
return f(*args)
if redis_conn is None:
return f
return wrapper
init()
## Instruction:
Remove unneeded lru specific helper methods
## Code After:
import functools
import logging
import redis
import config
# Default options
redis_opts = {
'host': 'localhost',
'port': 6379,
'db': 0,
'password': None
}
redis_conn = None
cache_prefix = None
def init():
global redis_conn, cache_prefix
cfg = config.load()
cache = cfg.cache
if not cache:
return
logging.info('Enabling storage cache on Redis')
if not isinstance(cache, dict):
cache = {}
for k, v in cache.iteritems():
redis_opts[k] = v
logging.info('Redis config: {0}'.format(redis_opts))
redis_conn = redis.StrictRedis(host=redis_opts['host'],
port=int(redis_opts['port']),
db=int(redis_opts['db']),
password=redis_opts['password'])
cache_prefix = 'cache_path:{0}'.format(cfg.get('storage_path', '/'))
init()
| import functools
import logging
import redis
import config
# Default options
redis_opts = {
'host': 'localhost',
'port': 6379,
'db': 0,
'password': None
}
redis_conn = None
cache_prefix = None
def init():
global redis_conn, cache_prefix
cfg = config.load()
cache = cfg.cache
if not cache:
return
logging.info('Enabling storage cache on Redis')
if not isinstance(cache, dict):
cache = {}
for k, v in cache.iteritems():
redis_opts[k] = v
logging.info('Redis config: {0}'.format(redis_opts))
redis_conn = redis.StrictRedis(host=redis_opts['host'],
port=int(redis_opts['port']),
db=int(redis_opts['db']),
password=redis_opts['password'])
cache_prefix = 'cache_path:{0}'.format(cfg.get('storage_path', '/'))
- def cache_key(key):
- return cache_prefix + key
-
-
- def put(f):
- @functools.wraps(f)
- def wrapper(*args):
- content = args[-1]
- key = args[-2]
- key = cache_key(key)
- redis_conn.set(key, content)
- return f(*args)
- if redis_conn is None:
- return f
- return wrapper
-
-
- def get(f):
- @functools.wraps(f)
- def wrapper(*args):
- key = args[-1]
- key = cache_key(key)
- content = redis_conn.get(key)
- if content is not None:
- return content
- # Refresh cache
- content = f(*args)
- redis_conn.set(key, content)
- return content
- if redis_conn is None:
- return f
- return wrapper
-
-
- def remove(f):
- @functools.wraps(f)
- def wrapper(*args):
- key = args[-1]
- key = cache_key(key)
- redis_conn.delete(key)
- return f(*args)
- if redis_conn is None:
- return f
- return wrapper
-
-
init() | 46 | 0.534884 | 0 | 46 |
048a65bb19412639c3abdaded8ad6d3d10e4033e | ext/narray_ffi_c/narray_ffi.c | ext/narray_ffi_c/narray_ffi.c |
VALUE na_address(VALUE self) {
struct NARRAY *ary;
void * ptr;
VALUE ret;
GetNArray(self,ary);
ptr = ary->ptr;
ret = ULL2NUM( (unsigned long long int) ptr);
return ret;
}
void Init_narray_ffi_c() {
ID id;
VALUE klass;
id = rb_intern("NArray");
klass = rb_const_get(rb_cObject, id);
rb_define_private_method(klass, "address", na_address, 0);
}
|
VALUE na_address(VALUE self) {
struct NARRAY *ary;
void * ptr;
VALUE ret;
GetNArray(self,ary);
ptr = ary->ptr;
ret = ULL2NUM( sizeof(ptr) == 4 ? (unsigned long long int) (unsigned long int) ptr : (unsigned long long int) ptr );
return ret;
}
void Init_narray_ffi_c() {
ID id;
VALUE klass;
id = rb_intern("NArray");
klass = rb_const_get(rb_cObject, id);
rb_define_private_method(klass, "address", na_address, 0);
}
| Fix nasty sign propagation bug on gcc and 32 bit architectures. | Fix nasty sign propagation bug on gcc and 32 bit architectures.
| C | bsd-2-clause | Nanosim-LIG/narray-ffi,Nanosim-LIG/narray-ffi | c | ## Code Before:
VALUE na_address(VALUE self) {
struct NARRAY *ary;
void * ptr;
VALUE ret;
GetNArray(self,ary);
ptr = ary->ptr;
ret = ULL2NUM( (unsigned long long int) ptr);
return ret;
}
void Init_narray_ffi_c() {
ID id;
VALUE klass;
id = rb_intern("NArray");
klass = rb_const_get(rb_cObject, id);
rb_define_private_method(klass, "address", na_address, 0);
}
## Instruction:
Fix nasty sign propagation bug on gcc and 32 bit architectures.
## Code After:
VALUE na_address(VALUE self) {
struct NARRAY *ary;
void * ptr;
VALUE ret;
GetNArray(self,ary);
ptr = ary->ptr;
ret = ULL2NUM( sizeof(ptr) == 4 ? (unsigned long long int) (unsigned long int) ptr : (unsigned long long int) ptr );
return ret;
}
void Init_narray_ffi_c() {
ID id;
VALUE klass;
id = rb_intern("NArray");
klass = rb_const_get(rb_cObject, id);
rb_define_private_method(klass, "address", na_address, 0);
}
|
VALUE na_address(VALUE self) {
struct NARRAY *ary;
void * ptr;
VALUE ret;
GetNArray(self,ary);
ptr = ary->ptr;
- ret = ULL2NUM( (unsigned long long int) ptr);
+ ret = ULL2NUM( sizeof(ptr) == 4 ? (unsigned long long int) (unsigned long int) ptr : (unsigned long long int) ptr );
return ret;
}
void Init_narray_ffi_c() {
ID id;
VALUE klass;
id = rb_intern("NArray");
klass = rb_const_get(rb_cObject, id);
rb_define_private_method(klass, "address", na_address, 0);
}
| 2 | 0.1 | 1 | 1 |
06bc9745e821a15a33d8dc52451248f96b99ed85 | brackets-notifications.css | brackets-notifications.css | {
position: absolute;
top: 5px;
right: 5px;
}
#notifications-container .simple-notification
{
background-color: #FFF;
width: 200px;
height: 75px;
}
| {
position: absolute;
top: 5px;
right: 5px;
z-index: 1;
}
#notifications-container .simple-notification
{
background-color: #FFF;
width: 200px;
height: 75px;
padding: 0px 10px;
}
| Make notifications actually visible, added padding | Make notifications actually visible, added padding
| CSS | mit | HalleyInteractive/brackets-notifications | css | ## Code Before:
{
position: absolute;
top: 5px;
right: 5px;
}
#notifications-container .simple-notification
{
background-color: #FFF;
width: 200px;
height: 75px;
}
## Instruction:
Make notifications actually visible, added padding
## Code After:
{
position: absolute;
top: 5px;
right: 5px;
z-index: 1;
}
#notifications-container .simple-notification
{
background-color: #FFF;
width: 200px;
height: 75px;
padding: 0px 10px;
}
| {
position: absolute;
top: 5px;
right: 5px;
+ z-index: 1;
}
#notifications-container .simple-notification
{
background-color: #FFF;
width: 200px;
height: 75px;
+ padding: 0px 10px;
} | 2 | 0.166667 | 2 | 0 |
198b12b992be72288fb63816e978b45d78680289 | src/test/resources/testng.xml | src/test/resources/testng.xml | <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="jenjin-io" verbose="1" >
<test name="io">
<packages>
<package name="com.jenjinstudios.io" />
</packages>
</test>
</suite>
| <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="jenjin-io" verbose="1" >
<test name="io">
<packages>
<package name="com.jenjinstudios.io" />
</packages>
</test>
<test name="serialization" verbose="1" >
<packages>
<package name="com.jenjinstudios.io.serialization"/>
</packages>
</test>
</suite>
| Add test for serialization package | Add test for serialization package
| XML | mit | floralvikings/jenjin-io | xml | ## Code Before:
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="jenjin-io" verbose="1" >
<test name="io">
<packages>
<package name="com.jenjinstudios.io" />
</packages>
</test>
</suite>
## Instruction:
Add test for serialization package
## Code After:
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="jenjin-io" verbose="1" >
<test name="io">
<packages>
<package name="com.jenjinstudios.io" />
</packages>
</test>
<test name="serialization" verbose="1" >
<packages>
<package name="com.jenjinstudios.io.serialization"/>
</packages>
</test>
</suite>
| <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="jenjin-io" verbose="1" >
<test name="io">
<packages>
<package name="com.jenjinstudios.io" />
</packages>
</test>
+ <test name="serialization" verbose="1" >
+ <packages>
+ <package name="com.jenjinstudios.io.serialization"/>
+ </packages>
+ </test>
</suite> | 5 | 0.555556 | 5 | 0 |
3ba758b9148a8cee78a271e7c9c5a8cef174b337 | app/views/ninetails/containers/_container.json.jbuilder | app/views/ninetails/containers/_container.json.jbuilder | json.container do
json.call container, :id
json.type container.type.demodulize
if container.try(:layout).present?
json.layout do
json.partial! "/ninetails/containers/container", container: container.layout
end
end
if container.try(:current_revision).present?
json.current_revision do
json.partial! "/ninetails/revisions/revision", revision: container.current_revision, container_type: container.class
end
else
json.current_revision({})
end
if container.try(:revision).present?
json.revision do
json.partial! "/ninetails/revisions/revision", revision: container.revision, container_type: container.class
end
else
json.revision({})
end
if container.errors.present?
json.errors container.errors
end
end
| json.container do
json.call container, :id
json.type container.type.demodulize
json.layout_id container.layout_id
if container.try(:layout).present?
json.layout do
json.partial! "/ninetails/containers/container", container: container.layout
end
end
if container.try(:current_revision).present?
json.current_revision do
json.partial! "/ninetails/revisions/revision", revision: container.current_revision, container_type: container.class
end
else
json.current_revision({})
end
if container.try(:revision).present?
json.revision do
json.partial! "/ninetails/revisions/revision", revision: container.revision, container_type: container.class
end
else
json.revision({})
end
if container.errors.present?
json.errors container.errors
end
end
| Include layout id in the page response | Include layout id in the page response
| Ruby | mit | iZettle/ninetails | ruby | ## Code Before:
json.container do
json.call container, :id
json.type container.type.demodulize
if container.try(:layout).present?
json.layout do
json.partial! "/ninetails/containers/container", container: container.layout
end
end
if container.try(:current_revision).present?
json.current_revision do
json.partial! "/ninetails/revisions/revision", revision: container.current_revision, container_type: container.class
end
else
json.current_revision({})
end
if container.try(:revision).present?
json.revision do
json.partial! "/ninetails/revisions/revision", revision: container.revision, container_type: container.class
end
else
json.revision({})
end
if container.errors.present?
json.errors container.errors
end
end
## Instruction:
Include layout id in the page response
## Code After:
json.container do
json.call container, :id
json.type container.type.demodulize
json.layout_id container.layout_id
if container.try(:layout).present?
json.layout do
json.partial! "/ninetails/containers/container", container: container.layout
end
end
if container.try(:current_revision).present?
json.current_revision do
json.partial! "/ninetails/revisions/revision", revision: container.current_revision, container_type: container.class
end
else
json.current_revision({})
end
if container.try(:revision).present?
json.revision do
json.partial! "/ninetails/revisions/revision", revision: container.revision, container_type: container.class
end
else
json.revision({})
end
if container.errors.present?
json.errors container.errors
end
end
| json.container do
json.call container, :id
json.type container.type.demodulize
+ json.layout_id container.layout_id
if container.try(:layout).present?
json.layout do
json.partial! "/ninetails/containers/container", container: container.layout
end
end
if container.try(:current_revision).present?
json.current_revision do
json.partial! "/ninetails/revisions/revision", revision: container.current_revision, container_type: container.class
end
else
json.current_revision({})
end
if container.try(:revision).present?
json.revision do
json.partial! "/ninetails/revisions/revision", revision: container.revision, container_type: container.class
end
else
json.revision({})
end
if container.errors.present?
json.errors container.errors
end
end | 1 | 0.033333 | 1 | 0 |
e61f0b7831dccc0b76399d4d600481d75087613d | src/main/java/com/bourke/glimmr/common/Keys.java | src/main/java/com/bourke/glimmr/common/Keys.java | package com.bourke.glimmr.common;
public class Keys {
public static final String API_KEY = "***REMOVED***";
public static final String API_SECRET = "***REMOVED***";
}
| package com.bourke.glimmr.common;
public class Keys {
public static final String API_KEY = "";
public static final String API_SECRET = "";
}
| Remove api keys for open sourcing | Remove api keys for open sourcing
| Java | apache-2.0 | brk3/glimmr,brk3/glimmr | java | ## Code Before:
package com.bourke.glimmr.common;
public class Keys {
public static final String API_KEY = "***REMOVED***";
public static final String API_SECRET = "***REMOVED***";
}
## Instruction:
Remove api keys for open sourcing
## Code After:
package com.bourke.glimmr.common;
public class Keys {
public static final String API_KEY = "";
public static final String API_SECRET = "";
}
| package com.bourke.glimmr.common;
public class Keys {
- public static final String API_KEY = "***REMOVED***";
? -------------
+ public static final String API_KEY = "";
- public static final String API_SECRET = "***REMOVED***";
? -------------
+ public static final String API_SECRET = "";
} | 4 | 0.571429 | 2 | 2 |
520bc03b42cc2a6c981b2392b06c5ebfa852bc53 | ElcodiProductCsvBundle.php | ElcodiProductCsvBundle.php | <?php
/*
* This file is part of the Elcodi package.
*
* Copyright (c) 2014-2015 Elcodi.com
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* Feel free to edit as you please, and have fun.
*
* @author Marc Morera <yuhu@mmoreram.com>
* @author Aldo Chiecchia <zimage@tiscali.it>
* @author Elcodi Team <tech@elcodi.com>
*/
namespace Elcodi\Plugin\ProductCsvBundle;
use Symfony\Component\Console\Application;
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Elcodi\Component\Plugin\Interfaces\PluginInterface;
use Elcodi\Plugin\ProductCsvBundle\DependencyInjection\ElcodiProductCsvExtension;
/**
* Class ElcodiProductCsvBundle
*
* @author Berny Cantos <be@rny.cc>
*/
class ElcodiProductCsvBundle extends Bundle implements PluginInterface
{
/**
* Returns the bundle's container extension.
*
* @return ExtensionInterface The container extension
*/
public function getContainerExtension()
{
return new ElcodiProductCsvExtension();
}
/**
* Register Commands.
*
* Disabled as commands are registered as services.
*
* @param Application $application An Application instance
*/
public function registerCommands(Application $application)
{
return null;
}
}
| <?php
/*
* This file is part of the Elcodi package.
*
* Copyright (c) 2014-2015 Elcodi.com
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* Feel free to edit as you please, and have fun.
*
* @author Marc Morera <yuhu@mmoreram.com>
* @author Aldo Chiecchia <zimage@tiscali.it>
* @author Elcodi Team <tech@elcodi.com>
*/
namespace Elcodi\Plugin\ProductCsvBundle;
use Symfony\Component\Console\Application;
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Elcodi\Component\Plugin\Interfaces\PluginInterface;
use Elcodi\Plugin\ProductCsvBundle\DependencyInjection\ElcodiProductCsvExtension;
/**
* Class ElcodiProductCsvBundle
*
* @author Berny Cantos <be@rny.cc>
*/
class ElcodiProductCsvBundle extends Bundle implements PluginInterface
{
/**
* Returns the bundle's container extension.
*
* @return ExtensionInterface The container extension
*/
public function getContainerExtension()
{
return new ElcodiProductCsvExtension();
}
/**
* Register Commands.
*
* Disabled as commands are registered as services.
*
* @param Application $application An Application instance
*
* @return null
*/
public function registerCommands(Application $application)
{
return null;
}
}
| Store + Shipping + Menus | Store + Shipping + Menus
* Using new Store feature from Elcodi
* Added Store management in Admin
* Changed all definitions that was depending on such implementation
* Removed under construction logic and tests
* Removed menu fixtures
* Defined them as dynamic content. Some of them are generated dinamically, and
some of them statically.
* Added neede menu builders in every Admin bundle
* Changed the way menu is loaded in Admin
* Removed dependency with Configuration and Configuration annotation, in order to use
new implementation.
* Removed configuration elements
* Removed all `elcodi_config` twig extension usage
* Moved custom shipping logic from elcodi/elcodi to elcodi-plugins/*
* Added full repo inside Plugin folder
* Using new Shipping engine
* Updated some code in order to be compatible with Sf2.7 deprecations
Ready for Elcodi Beta! Auu! Auu!
| PHP | mit | elcodi-plugins/ProductCsvBundle,elcodi-plugins/ProductCsvBundle | php | ## Code Before:
<?php
/*
* This file is part of the Elcodi package.
*
* Copyright (c) 2014-2015 Elcodi.com
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* Feel free to edit as you please, and have fun.
*
* @author Marc Morera <yuhu@mmoreram.com>
* @author Aldo Chiecchia <zimage@tiscali.it>
* @author Elcodi Team <tech@elcodi.com>
*/
namespace Elcodi\Plugin\ProductCsvBundle;
use Symfony\Component\Console\Application;
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Elcodi\Component\Plugin\Interfaces\PluginInterface;
use Elcodi\Plugin\ProductCsvBundle\DependencyInjection\ElcodiProductCsvExtension;
/**
* Class ElcodiProductCsvBundle
*
* @author Berny Cantos <be@rny.cc>
*/
class ElcodiProductCsvBundle extends Bundle implements PluginInterface
{
/**
* Returns the bundle's container extension.
*
* @return ExtensionInterface The container extension
*/
public function getContainerExtension()
{
return new ElcodiProductCsvExtension();
}
/**
* Register Commands.
*
* Disabled as commands are registered as services.
*
* @param Application $application An Application instance
*/
public function registerCommands(Application $application)
{
return null;
}
}
## Instruction:
Store + Shipping + Menus
* Using new Store feature from Elcodi
* Added Store management in Admin
* Changed all definitions that was depending on such implementation
* Removed under construction logic and tests
* Removed menu fixtures
* Defined them as dynamic content. Some of them are generated dinamically, and
some of them statically.
* Added neede menu builders in every Admin bundle
* Changed the way menu is loaded in Admin
* Removed dependency with Configuration and Configuration annotation, in order to use
new implementation.
* Removed configuration elements
* Removed all `elcodi_config` twig extension usage
* Moved custom shipping logic from elcodi/elcodi to elcodi-plugins/*
* Added full repo inside Plugin folder
* Using new Shipping engine
* Updated some code in order to be compatible with Sf2.7 deprecations
Ready for Elcodi Beta! Auu! Auu!
## Code After:
<?php
/*
* This file is part of the Elcodi package.
*
* Copyright (c) 2014-2015 Elcodi.com
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* Feel free to edit as you please, and have fun.
*
* @author Marc Morera <yuhu@mmoreram.com>
* @author Aldo Chiecchia <zimage@tiscali.it>
* @author Elcodi Team <tech@elcodi.com>
*/
namespace Elcodi\Plugin\ProductCsvBundle;
use Symfony\Component\Console\Application;
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Elcodi\Component\Plugin\Interfaces\PluginInterface;
use Elcodi\Plugin\ProductCsvBundle\DependencyInjection\ElcodiProductCsvExtension;
/**
* Class ElcodiProductCsvBundle
*
* @author Berny Cantos <be@rny.cc>
*/
class ElcodiProductCsvBundle extends Bundle implements PluginInterface
{
/**
* Returns the bundle's container extension.
*
* @return ExtensionInterface The container extension
*/
public function getContainerExtension()
{
return new ElcodiProductCsvExtension();
}
/**
* Register Commands.
*
* Disabled as commands are registered as services.
*
* @param Application $application An Application instance
*
* @return null
*/
public function registerCommands(Application $application)
{
return null;
}
}
| <?php
/*
* This file is part of the Elcodi package.
*
* Copyright (c) 2014-2015 Elcodi.com
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* Feel free to edit as you please, and have fun.
*
* @author Marc Morera <yuhu@mmoreram.com>
* @author Aldo Chiecchia <zimage@tiscali.it>
* @author Elcodi Team <tech@elcodi.com>
*/
namespace Elcodi\Plugin\ProductCsvBundle;
use Symfony\Component\Console\Application;
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Elcodi\Component\Plugin\Interfaces\PluginInterface;
use Elcodi\Plugin\ProductCsvBundle\DependencyInjection\ElcodiProductCsvExtension;
/**
* Class ElcodiProductCsvBundle
*
* @author Berny Cantos <be@rny.cc>
*/
class ElcodiProductCsvBundle extends Bundle implements PluginInterface
{
/**
* Returns the bundle's container extension.
*
* @return ExtensionInterface The container extension
*/
public function getContainerExtension()
{
return new ElcodiProductCsvExtension();
}
/**
* Register Commands.
*
* Disabled as commands are registered as services.
*
* @param Application $application An Application instance
+ *
+ * @return null
*/
public function registerCommands(Application $application)
{
return null;
}
} | 2 | 0.036364 | 2 | 0 |
d7f1d0838aa1ef3737521c56e5a19b39755763b3 | modules/projects/templates/quehambre/nginx.conf.erb | modules/projects/templates/quehambre/nginx.conf.erb | server {
access_log <%= scope.lookupvar "nginx::config::logdir" %>/<%= @name %>.access.log main;
listen 80;
root <%= @repo_dir %>/src;
server_name quehambre.dev quehambre.local www.quehambre.cl;
client_max_body_size 50M;
error_page 500 502 503 504 /50x.html;
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml|woff|ttf)$ {
access_log off;
expires 30d;
}
location / {
include <%= scope.lookupvar "nginx::config::configdir" %>/fastcgi_params;
keepalive_timeout 0;
fastcgi_pass unix:<%= scope.lookupvar "boxen::config::socketdir" %>/<%= @name %>;
fastcgi_param SCRIPT_FILENAME <%= @repo_dir %>/src/index.php;
}
}
| upstream php {
server unix:<%= scope.lookupvar "boxen::config::socketdir" %>/<%= @name %>;
}
server {
error_log <%= scope.lookupvar "nginx::config::logdir" %>/<%= @name %>.error.log notice;
access_log <%= scope.lookupvar "nginx::config::logdir" %>/<%= @name %>.access.log main;
listen 80;
root <%= @repo_dir %>/src;
server_name quehambre.dev quehambre.local www.quehambre.cl;
client_max_body_size 50M;
error_page 500 502 503 504 /50x.html;
index index.php;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
include <%= scope.lookupvar "nginx::config::configdir" %>/fastcgi_params;
fastcgi_pass php;
fastcgi_param SCRIPT_FILENAME <%= @repo_dir %>/src/index.php;
}
}
| Fix quehambre nginx template with codeigniter support | Fix quehambre nginx template with codeigniter support
| HTML+ERB | mit | platanus/our-boxen,platanus/our-boxen,platanus/our-boxen | html+erb | ## Code Before:
server {
access_log <%= scope.lookupvar "nginx::config::logdir" %>/<%= @name %>.access.log main;
listen 80;
root <%= @repo_dir %>/src;
server_name quehambre.dev quehambre.local www.quehambre.cl;
client_max_body_size 50M;
error_page 500 502 503 504 /50x.html;
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml|woff|ttf)$ {
access_log off;
expires 30d;
}
location / {
include <%= scope.lookupvar "nginx::config::configdir" %>/fastcgi_params;
keepalive_timeout 0;
fastcgi_pass unix:<%= scope.lookupvar "boxen::config::socketdir" %>/<%= @name %>;
fastcgi_param SCRIPT_FILENAME <%= @repo_dir %>/src/index.php;
}
}
## Instruction:
Fix quehambre nginx template with codeigniter support
## Code After:
upstream php {
server unix:<%= scope.lookupvar "boxen::config::socketdir" %>/<%= @name %>;
}
server {
error_log <%= scope.lookupvar "nginx::config::logdir" %>/<%= @name %>.error.log notice;
access_log <%= scope.lookupvar "nginx::config::logdir" %>/<%= @name %>.access.log main;
listen 80;
root <%= @repo_dir %>/src;
server_name quehambre.dev quehambre.local www.quehambre.cl;
client_max_body_size 50M;
error_page 500 502 503 504 /50x.html;
index index.php;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
include <%= scope.lookupvar "nginx::config::configdir" %>/fastcgi_params;
fastcgi_pass php;
fastcgi_param SCRIPT_FILENAME <%= @repo_dir %>/src/index.php;
}
}
| + upstream php {
+ server unix:<%= scope.lookupvar "boxen::config::socketdir" %>/<%= @name %>;
+ }
server {
+ error_log <%= scope.lookupvar "nginx::config::logdir" %>/<%= @name %>.error.log notice;
access_log <%= scope.lookupvar "nginx::config::logdir" %>/<%= @name %>.access.log main;
listen 80;
root <%= @repo_dir %>/src;
server_name quehambre.dev quehambre.local www.quehambre.cl;
client_max_body_size 50M;
error_page 500 502 503 504 /50x.html;
- location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml|woff|ttf)$ {
- access_log off;
- expires 30d;
+ index index.php;
+ location / {
+ try_files $uri $uri/ /index.php$is_args$args;
}
- location / {
+ location ~ \.php$ {
include <%= scope.lookupvar "nginx::config::configdir" %>/fastcgi_params;
+ fastcgi_pass php;
- keepalive_timeout 0;
- fastcgi_pass unix:<%= scope.lookupvar "boxen::config::socketdir" %>/<%= @name %>;
fastcgi_param SCRIPT_FILENAME <%= @repo_dir %>/src/index.php;
}
} | 15 | 0.681818 | 9 | 6 |
c7329c1c5347ca2f453c41aeb0f479edc4050187 | app/assets/javascripts/hyrax/browse_everything.js | app/assets/javascripts/hyrax/browse_everything.js | //= require jquery.treetable
//= require browse_everything/behavior
// Show the files in the queue
Blacklight.onLoad( function() {
// We need to check this because https://github.com/samvera/browse-everything/issues/169
if ($('#browse-btn').length > 0) {
$('#browse-btn').browseEverything()
.done(function(data) {
var evt = { isDefaultPrevented: function() { return false; } };
var files = $.map(data, function(d) { return { name: d.file_name, size: d.file_size, id: d.url } });
$.blueimp.fileupload.prototype.options.done.call($('#fileupload').fileupload(), evt, { result: { files: files }});
})
}
});
| //= require jquery.treetable
//= require browse_everything/behavior
// Show the files in the queue
function showBrowseEverythingFiles() {
// We need to check this because https://github.com/samvera/browse-everything/issues/169
if ($('#browse-btn').length > 0) {
$('#browse-btn').browseEverything()
.done(function(data) {
var evt = { isDefaultPrevented: function() { return false; } };
var files = $.map(data, function(d) { return { name: d.file_name, size: d.file_size, id: d.url } });
$.blueimp.fileupload.prototype.options.done.call($('#fileupload').fileupload(), evt, { result: { files: files }});
})
}
}
$(document).on('click', '#browse-btn', showBrowseEverythingFiles);
| Fix loading of browse-everything done event | Fix loading of browse-everything done event
Avoids situations where the prototype browseEverything() function has not been defined yet.
| JavaScript | apache-2.0 | samvera/hyrax,samvera/hyrax,samvera/hyrax,samvera/hyrax | javascript | ## Code Before:
//= require jquery.treetable
//= require browse_everything/behavior
// Show the files in the queue
Blacklight.onLoad( function() {
// We need to check this because https://github.com/samvera/browse-everything/issues/169
if ($('#browse-btn').length > 0) {
$('#browse-btn').browseEverything()
.done(function(data) {
var evt = { isDefaultPrevented: function() { return false; } };
var files = $.map(data, function(d) { return { name: d.file_name, size: d.file_size, id: d.url } });
$.blueimp.fileupload.prototype.options.done.call($('#fileupload').fileupload(), evt, { result: { files: files }});
})
}
});
## Instruction:
Fix loading of browse-everything done event
Avoids situations where the prototype browseEverything() function has not been defined yet.
## Code After:
//= require jquery.treetable
//= require browse_everything/behavior
// Show the files in the queue
function showBrowseEverythingFiles() {
// We need to check this because https://github.com/samvera/browse-everything/issues/169
if ($('#browse-btn').length > 0) {
$('#browse-btn').browseEverything()
.done(function(data) {
var evt = { isDefaultPrevented: function() { return false; } };
var files = $.map(data, function(d) { return { name: d.file_name, size: d.file_size, id: d.url } });
$.blueimp.fileupload.prototype.options.done.call($('#fileupload').fileupload(), evt, { result: { files: files }});
})
}
}
$(document).on('click', '#browse-btn', showBrowseEverythingFiles);
| //= require jquery.treetable
//= require browse_everything/behavior
// Show the files in the queue
- Blacklight.onLoad( function() {
+ function showBrowseEverythingFiles() {
// We need to check this because https://github.com/samvera/browse-everything/issues/169
if ($('#browse-btn').length > 0) {
$('#browse-btn').browseEverything()
.done(function(data) {
var evt = { isDefaultPrevented: function() { return false; } };
var files = $.map(data, function(d) { return { name: d.file_name, size: d.file_size, id: d.url } });
$.blueimp.fileupload.prototype.options.done.call($('#fileupload').fileupload(), evt, { result: { files: files }});
})
}
- });
+ }
+ $(document).on('click', '#browse-btn', showBrowseEverythingFiles);
+ | 6 | 0.4 | 4 | 2 |
e20244220c66655425c8d96a9122e11a2ba482dd | tests/paddleball/CMakeLists.txt | tests/paddleball/CMakeLists.txt | set(INC "${CMAKE_SOURCE_DIR}/include/SDL4Cpp")
link_libraries(${SDL_LIBRARY} "${PROJECT_BINARY_DIR}/src/${CMAKE_FIND_LIBRARY_PREFIXES}SDL4Cpp${CMAKE_SHARED_LIBRARY_SUFFIX}")
add_executable(paddleball
ball.cpp
computer.cpp
main.cpp
paddle.cpp
score.cpp)
set_property(TARGET paddleball APPEND PROPERTY COMPILE_FLAGS "-I${INC} -I${SDL_INCLUDE_DIR} ${MIXER_FLAGS} ${IMAGE_FLAGS}")
| set(INC "${CMAKE_SOURCE_DIR}/include/SDL4Cpp")
link_libraries(${SDL_LIBRARY} "${PROJECT_BINARY_DIR}/src/${CMAKE_FIND_LIBRARY_PREFIXES}SDL4Cpp${CMAKE_SHARED_LIBRARY_SUFFIX}")
add_executable(paddleball
ball.cpp
computer.cpp
main.cpp
paddle.cpp
score.cpp
ball.h
computer.h
paddle.h
score.h)
set_property(TARGET paddleball APPEND PROPERTY COMPILE_FLAGS "-I${INC} -I${SDL_INCLUDE_DIR} ${MIXER_FLAGS} ${IMAGE_FLAGS}")
| Include headers in add_executable since it might be nice to have them in say Code::Blocks projects. | Include headers in add_executable since it might be nice to have them in
say Code::Blocks projects.
Signed-off-by: Harley Laue <c8a0c029c1a7cee0af4c3de9665bbb05f63c8770@gmail.com>
| Text | lgpl-2.1 | losinggeneration/sdl4cpp,losinggeneration/sdl4cpp | text | ## Code Before:
set(INC "${CMAKE_SOURCE_DIR}/include/SDL4Cpp")
link_libraries(${SDL_LIBRARY} "${PROJECT_BINARY_DIR}/src/${CMAKE_FIND_LIBRARY_PREFIXES}SDL4Cpp${CMAKE_SHARED_LIBRARY_SUFFIX}")
add_executable(paddleball
ball.cpp
computer.cpp
main.cpp
paddle.cpp
score.cpp)
set_property(TARGET paddleball APPEND PROPERTY COMPILE_FLAGS "-I${INC} -I${SDL_INCLUDE_DIR} ${MIXER_FLAGS} ${IMAGE_FLAGS}")
## Instruction:
Include headers in add_executable since it might be nice to have them in
say Code::Blocks projects.
Signed-off-by: Harley Laue <c8a0c029c1a7cee0af4c3de9665bbb05f63c8770@gmail.com>
## Code After:
set(INC "${CMAKE_SOURCE_DIR}/include/SDL4Cpp")
link_libraries(${SDL_LIBRARY} "${PROJECT_BINARY_DIR}/src/${CMAKE_FIND_LIBRARY_PREFIXES}SDL4Cpp${CMAKE_SHARED_LIBRARY_SUFFIX}")
add_executable(paddleball
ball.cpp
computer.cpp
main.cpp
paddle.cpp
score.cpp
ball.h
computer.h
paddle.h
score.h)
set_property(TARGET paddleball APPEND PROPERTY COMPILE_FLAGS "-I${INC} -I${SDL_INCLUDE_DIR} ${MIXER_FLAGS} ${IMAGE_FLAGS}")
| set(INC "${CMAKE_SOURCE_DIR}/include/SDL4Cpp")
link_libraries(${SDL_LIBRARY} "${PROJECT_BINARY_DIR}/src/${CMAKE_FIND_LIBRARY_PREFIXES}SDL4Cpp${CMAKE_SHARED_LIBRARY_SUFFIX}")
add_executable(paddleball
ball.cpp
computer.cpp
main.cpp
paddle.cpp
- score.cpp)
? -
+ score.cpp
+ ball.h
+ computer.h
+ paddle.h
+ score.h)
set_property(TARGET paddleball APPEND PROPERTY COMPILE_FLAGS "-I${INC} -I${SDL_INCLUDE_DIR} ${MIXER_FLAGS} ${IMAGE_FLAGS}") | 6 | 0.545455 | 5 | 1 |
6e853e6d2eba890ddff29b71a21130e145c747fb | html/directives/validateBitcoinAddress.js | html/directives/validateBitcoinAddress.js | angular.module('app').directive("validateBitcoinAddress", function() {
return {
require: 'ngModel',
link: function(scope, ele, attrs, ctrl) {
ctrl.$parsers.unshift(function(value) {
// test and set the validity after update.
var valid = window.bitcoinAddress.validate(value);
ctrl.$setValidity('validateBitcoinAddress', valid);
// if it's valid, return the value to the model,
// otherwise return undefined.
return valid ? value : undefined;
});
ctrl.$formatters.unshift(function(value) {
// validate.
ctrl.$setValidity('validateBitcoinAddress', window.bitcoinAddress.validate(value));
// return the value or nothing will be written to the DOM.
return value;
});
}
};
});
| angular.module('app').directive("validateBitcoinAddress", function() {
return {
require: 'ngModel',
link: function(scope, ele, attrs, ctrl) {
ctrl.$parsers.unshift(function(value) {
var valid = window.bitcoinAddress.validate(value);
ctrl.$setValidity('validateBitcoinAddress', valid);
return valid ? value : undefined;
});
ctrl.$formatters.unshift(function(value) {
var valid = window.bitcoinAddress.validate(value);
ctrl.$setValidity('validateBitcoinAddress', valid);
return value;
});
}
};
});
| Clean up comments and validity check | Clean up comments and validity check
| JavaScript | mit | atsuyim/OpenBazaar,must-/OpenBazaar,must-/OpenBazaar,saltduck/OpenBazaar,NolanZhao/OpenBazaar,NolanZhao/OpenBazaar,tortxof/OpenBazaar,tortxof/OpenBazaar,must-/OpenBazaar,blakejakopovic/OpenBazaar,habibmasuro/OpenBazaar,bankonme/OpenBazaar,blakejakopovic/OpenBazaar,rllola/OpenBazaar,rllola/OpenBazaar,mirrax/OpenBazaar,blakejakopovic/OpenBazaar,saltduck/OpenBazaar,Renelvon/OpenBazaar,saltduck/OpenBazaar,bglassy/OpenBazaar,must-/OpenBazaar,atsuyim/OpenBazaar,NolanZhao/OpenBazaar,mirrax/OpenBazaar,Renelvon/OpenBazaar,mirrax/OpenBazaar,rllola/OpenBazaar,bankonme/OpenBazaar,blakejakopovic/OpenBazaar,saltduck/OpenBazaar,bankonme/OpenBazaar,mirrax/OpenBazaar,tortxof/OpenBazaar,matiasbastos/OpenBazaar,bglassy/OpenBazaar,Renelvon/OpenBazaar,bglassy/OpenBazaar,habibmasuro/OpenBazaar,habibmasuro/OpenBazaar,matiasbastos/OpenBazaar,rllola/OpenBazaar,Renelvon/OpenBazaar,bankonme/OpenBazaar,matiasbastos/OpenBazaar,NolanZhao/OpenBazaar,atsuyim/OpenBazaar,matiasbastos/OpenBazaar,atsuyim/OpenBazaar,tortxof/OpenBazaar,habibmasuro/OpenBazaar,bglassy/OpenBazaar | javascript | ## Code Before:
angular.module('app').directive("validateBitcoinAddress", function() {
return {
require: 'ngModel',
link: function(scope, ele, attrs, ctrl) {
ctrl.$parsers.unshift(function(value) {
// test and set the validity after update.
var valid = window.bitcoinAddress.validate(value);
ctrl.$setValidity('validateBitcoinAddress', valid);
// if it's valid, return the value to the model,
// otherwise return undefined.
return valid ? value : undefined;
});
ctrl.$formatters.unshift(function(value) {
// validate.
ctrl.$setValidity('validateBitcoinAddress', window.bitcoinAddress.validate(value));
// return the value or nothing will be written to the DOM.
return value;
});
}
};
});
## Instruction:
Clean up comments and validity check
## Code After:
angular.module('app').directive("validateBitcoinAddress", function() {
return {
require: 'ngModel',
link: function(scope, ele, attrs, ctrl) {
ctrl.$parsers.unshift(function(value) {
var valid = window.bitcoinAddress.validate(value);
ctrl.$setValidity('validateBitcoinAddress', valid);
return valid ? value : undefined;
});
ctrl.$formatters.unshift(function(value) {
var valid = window.bitcoinAddress.validate(value);
ctrl.$setValidity('validateBitcoinAddress', valid);
return value;
});
}
};
});
| angular.module('app').directive("validateBitcoinAddress", function() {
return {
require: 'ngModel',
link: function(scope, ele, attrs, ctrl) {
ctrl.$parsers.unshift(function(value) {
-
- // test and set the validity after update.
var valid = window.bitcoinAddress.validate(value);
ctrl.$setValidity('validateBitcoinAddress', valid);
-
- // if it's valid, return the value to the model,
- // otherwise return undefined.
return valid ? value : undefined;
});
ctrl.$formatters.unshift(function(value) {
- // validate.
+ var valid = window.bitcoinAddress.validate(value);
- ctrl.$setValidity('validateBitcoinAddress', window.bitcoinAddress.validate(value));
? ---------------------- ----------
+ ctrl.$setValidity('validateBitcoinAddress', valid);
-
- // return the value or nothing will be written to the DOM.
return value;
});
}
};
}); | 11 | 0.37931 | 2 | 9 |
b64f3f1aad835722a6de11299070803e90726e10 | app/views/entries/_entry.html.erb | app/views/entries/_entry.html.erb | <p><strong><%= link_to h(entry.title), entry.url %></strong> published <%= time_ago_in_words entry.published %> ago by <%= link_to h(entry.feed.user.name), entry.feed.user %></p> | <p><strong><%= link_to h(entry.title), entry.url %></strong> published<%= " #{time_ago_in_words entry.published} ago" if entry.published %> by <%= link_to h(entry.feed.user.name), entry.feed.user %></p> | Patch entries to handle nil publish dates | Patch entries to handle nil publish dates
| HTML+ERB | mit | jaimeiniesta/planetoid,jaimeiniesta/planetoid | html+erb | ## Code Before:
<p><strong><%= link_to h(entry.title), entry.url %></strong> published <%= time_ago_in_words entry.published %> ago by <%= link_to h(entry.feed.user.name), entry.feed.user %></p>
## Instruction:
Patch entries to handle nil publish dates
## Code After:
<p><strong><%= link_to h(entry.title), entry.url %></strong> published<%= " #{time_ago_in_words entry.published} ago" if entry.published %> by <%= link_to h(entry.feed.user.name), entry.feed.user %></p> | - <p><strong><%= link_to h(entry.title), entry.url %></strong> published <%= time_ago_in_words entry.published %> ago by <%= link_to h(entry.feed.user.name), entry.feed.user %></p>
? - ^^^
+ <p><strong><%= link_to h(entry.title), entry.url %></strong> published<%= " #{time_ago_in_words entry.published} ago" if entry.published %> by <%= link_to h(entry.feed.user.name), entry.feed.user %></p>
? ++++ ^ +++++++++++++++++++++++
| 2 | 2 | 1 | 1 |
367c54dec307f55f8f15a496b0e3b73f5cf0f68a | .config/dotnet-tools.json | .config/dotnet-tools.json | {
"version": 1,
"isRoot": true,
"tools": {
"cake.tool": {
"version": "0.37.0",
"commands": [
"dotnet-cake"
]
}
}
} | {
"version": 1,
"isRoot": true,
"tools": {
"cake.tool": {
"version": "0.38.2",
"commands": [
"dotnet-cake"
]
},
"minver-cli": {
"version": "2.3.0",
"commands": [
"minver"
]
}
}
} | Add minver tool. Bump Cake tool to 0.38.2 | Add minver tool. Bump Cake tool to 0.38.2
| JSON | mit | spectresystems/commandline | json | ## Code Before:
{
"version": 1,
"isRoot": true,
"tools": {
"cake.tool": {
"version": "0.37.0",
"commands": [
"dotnet-cake"
]
}
}
}
## Instruction:
Add minver tool. Bump Cake tool to 0.38.2
## Code After:
{
"version": 1,
"isRoot": true,
"tools": {
"cake.tool": {
"version": "0.38.2",
"commands": [
"dotnet-cake"
]
},
"minver-cli": {
"version": "2.3.0",
"commands": [
"minver"
]
}
}
} | {
"version": 1,
"isRoot": true,
"tools": {
"cake.tool": {
- "version": "0.37.0",
? ^ ^
+ "version": "0.38.2",
? ^ ^
"commands": [
"dotnet-cake"
+ ]
+ },
+ "minver-cli": {
+ "version": "2.3.0",
+ "commands": [
+ "minver"
]
}
}
} | 8 | 0.666667 | 7 | 1 |
edead63f66120a67780b627e74b511b54d39ec1b | .packit.yaml | .packit.yaml | upstream_package_name: python-nitrate
downstream_package_name: python-nitrate
specfile_path: python-nitrate.spec
synced_files: [python-nitrate.spec]
actions:
create-archive:
- make tarball
get-current-version:
- make version
jobs:
- job: copr_build
metadata:
targets:
- fedora-all
- epel-8
- epel-7
trigger: pull_request
| upstream_package_name: python-nitrate
downstream_package_name: python-nitrate
specfile_path: python-nitrate.spec
synced_files: [python-nitrate.spec]
actions:
create-archive:
- make tarball
get-current-version:
- make version
jobs:
- job: copr_build
metadata:
targets:
- fedora-all
- epel-8
- epel-7
trigger: pull_request
- job: copr_build
trigger: commit
metadata:
branch: master
targets:
- fedora-all
- epel-8
- epel-7
list_on_homepage: True
preserve_project: True
owner: psss
project: python-nitrate
| Enable copr builds on commits in the master branch | Enable copr builds on commits in the master branch
| YAML | lgpl-2.1 | psss/python-nitrate | yaml | ## Code Before:
upstream_package_name: python-nitrate
downstream_package_name: python-nitrate
specfile_path: python-nitrate.spec
synced_files: [python-nitrate.spec]
actions:
create-archive:
- make tarball
get-current-version:
- make version
jobs:
- job: copr_build
metadata:
targets:
- fedora-all
- epel-8
- epel-7
trigger: pull_request
## Instruction:
Enable copr builds on commits in the master branch
## Code After:
upstream_package_name: python-nitrate
downstream_package_name: python-nitrate
specfile_path: python-nitrate.spec
synced_files: [python-nitrate.spec]
actions:
create-archive:
- make tarball
get-current-version:
- make version
jobs:
- job: copr_build
metadata:
targets:
- fedora-all
- epel-8
- epel-7
trigger: pull_request
- job: copr_build
trigger: commit
metadata:
branch: master
targets:
- fedora-all
- epel-8
- epel-7
list_on_homepage: True
preserve_project: True
owner: psss
project: python-nitrate
| upstream_package_name: python-nitrate
downstream_package_name: python-nitrate
specfile_path: python-nitrate.spec
synced_files: [python-nitrate.spec]
actions:
create-archive:
- make tarball
get-current-version:
- make version
jobs:
- job: copr_build
metadata:
targets:
- fedora-all
- epel-8
- epel-7
trigger: pull_request
+
+ - job: copr_build
+ trigger: commit
+ metadata:
+ branch: master
+ targets:
+ - fedora-all
+ - epel-8
+ - epel-7
+ list_on_homepage: True
+ preserve_project: True
+ owner: psss
+ project: python-nitrate | 13 | 0.65 | 13 | 0 |
596199f9463eabab3ac638478efe7a7269d4b1bc | app/views/paywall/setpassword.html.erb | app/views/paywall/setpassword.html.erb | <div>
<form action="activate" method="post" role="form" style="margin-left: 40%;margin-top: 10%;">
<fieldset>
<input type="hidden" value="<%=@cred.id%>" name="id">
<div class="form-group">
<input class="form-control" style="width: 250px" type="password" id="password" name="password" placeholder="Password">
</div><br>
<div class="form-group">
<input class="form-control" style="width: 250px" type="password" id="confirm_password" name="password2" placeholder="Re Type Password">
</div><br>
<button style="margin-left: 175px" type="submit" class="btn btn-danger">
Set Password
</button>
</fieldset>
</form>
</div>
<script>
var password = document.getElementById("password")
, confirm_password = document.getElementById("confirm_password");
function validatePassword(){
if(password.value != confirm_password.value) {
confirm_password.setCustomValidity("Passwords Don't Match");
} else {
confirm_password.setCustomValidity('');
}
}
password.onchange = validatePassword;
confirm_password.onkeyup = validatePassword;
</script> | <div class="row">
<div class="col-sm-4 col-sm-offset-4">
<form action="activate" method="post" role="form">
<fieldset>
<input name="id" type="hidden" value="<%=@cred.id%>">
<div class="form-group">
<div class="row">
<div class="col-xs-6">
<input class="form-control" id="firstname" name="firstname" placeholder="First Name" type="text">
</div>
<div class="col-xs-6">
<input class="form-control" id="lastname" name="lastname" placeholder="Last Name" type="text">
</div>
</div>
</div>
<div class="form-group">
<input class="form-control" id="location" name="location" placeholder="Location" type="text">
</div>
<div class="form-group">
<input class="form-control" id="password" name="password" placeholder="Password" type="password">
</div>
<div class="form-group">
<input class="form-control" id="confirm_password" name="password2" placeholder="Re Type Password" type="password">
</div>
<button class="btn btn-danger" type="submit">
Set Password
</button>
</fieldset>
</form>
</div>
</div>
<script>
var password = document.getElementById("password");
var confirm_password = document.getElementById("confirm_password");
function validatePassword() {
if (password.value != confirm_password.value) {
confirm_password.setCustomValidity("Passwords Don't Match");
} else {
confirm_password.setCustomValidity('');
}
}
password.onchange = validatePassword;
confirm_password.onkeyup = validatePassword;
</script>
| Add more fields to the activation form | Add more fields to the activation form
| HTML+ERB | agpl-3.0 | payloadtech/mailpenny,payloadtech/mailpenny,payloadtech/mailpenny | html+erb | ## Code Before:
<div>
<form action="activate" method="post" role="form" style="margin-left: 40%;margin-top: 10%;">
<fieldset>
<input type="hidden" value="<%=@cred.id%>" name="id">
<div class="form-group">
<input class="form-control" style="width: 250px" type="password" id="password" name="password" placeholder="Password">
</div><br>
<div class="form-group">
<input class="form-control" style="width: 250px" type="password" id="confirm_password" name="password2" placeholder="Re Type Password">
</div><br>
<button style="margin-left: 175px" type="submit" class="btn btn-danger">
Set Password
</button>
</fieldset>
</form>
</div>
<script>
var password = document.getElementById("password")
, confirm_password = document.getElementById("confirm_password");
function validatePassword(){
if(password.value != confirm_password.value) {
confirm_password.setCustomValidity("Passwords Don't Match");
} else {
confirm_password.setCustomValidity('');
}
}
password.onchange = validatePassword;
confirm_password.onkeyup = validatePassword;
</script>
## Instruction:
Add more fields to the activation form
## Code After:
<div class="row">
<div class="col-sm-4 col-sm-offset-4">
<form action="activate" method="post" role="form">
<fieldset>
<input name="id" type="hidden" value="<%=@cred.id%>">
<div class="form-group">
<div class="row">
<div class="col-xs-6">
<input class="form-control" id="firstname" name="firstname" placeholder="First Name" type="text">
</div>
<div class="col-xs-6">
<input class="form-control" id="lastname" name="lastname" placeholder="Last Name" type="text">
</div>
</div>
</div>
<div class="form-group">
<input class="form-control" id="location" name="location" placeholder="Location" type="text">
</div>
<div class="form-group">
<input class="form-control" id="password" name="password" placeholder="Password" type="password">
</div>
<div class="form-group">
<input class="form-control" id="confirm_password" name="password2" placeholder="Re Type Password" type="password">
</div>
<button class="btn btn-danger" type="submit">
Set Password
</button>
</fieldset>
</form>
</div>
</div>
<script>
var password = document.getElementById("password");
var confirm_password = document.getElementById("confirm_password");
function validatePassword() {
if (password.value != confirm_password.value) {
confirm_password.setCustomValidity("Passwords Don't Match");
} else {
confirm_password.setCustomValidity('');
}
}
password.onchange = validatePassword;
confirm_password.onkeyup = validatePassword;
</script>
| - <div>
- <form action="activate" method="post" role="form" style="margin-left: 40%;margin-top: 10%;">
+ <div class="row">
+ <div class="col-sm-4 col-sm-offset-4">
+ <form action="activate" method="post" role="form">
- <fieldset>
+ <fieldset>
? ++
- <input type="hidden" value="<%=@cred.id%>" name="id">
? ----------
+ <input name="id" type="hidden" value="<%=@cred.id%>">
? ++ ++++++++++
- <div class="form-group">
+ <div class="form-group">
? ++++
- <input class="form-control" style="width: 250px" type="password" id="password" name="password" placeholder="Password">
- </div><br>
+ <div class="row">
+ <div class="col-xs-6">
+ <input class="form-control" id="firstname" name="firstname" placeholder="First Name" type="text">
+ </div>
+ <div class="col-xs-6">
+ <input class="form-control" id="lastname" name="lastname" placeholder="Last Name" type="text">
+ </div>
+ </div>
+ </div>
- <div class="form-group">
+ <div class="form-group">
? ++++
+ <input class="form-control" id="location" name="location" placeholder="Location" type="text">
+ </div>
+ <div class="form-group">
+ <input class="form-control" id="password" name="password" placeholder="Password" type="password">
+ </div>
+ <div class="form-group">
- <input class="form-control" style="width: 250px" type="password" id="confirm_password" name="password2" placeholder="Re Type Password">
? -------------------------------------
+ <input class="form-control" id="confirm_password" name="password2" placeholder="Re Type Password" type="password">
? ++++ ++++++++++++++++
- </div><br>
- <button style="margin-left: 175px" type="submit" class="btn btn-danger">
+ </div>
+ <button class="btn btn-danger" type="submit">
- Set Password
+ Set Password
? ++++
- </button>
+ </button>
? ++++
- </fieldset>
+ </fieldset>
? ++
- </form>
+ </form>
? ++
+ </div>
</div>
<script>
- var password = document.getElementById("password")
+ var password = document.getElementById("password");
? +
- , confirm_password = document.getElementById("confirm_password");
? ^^^^^
+ var confirm_password = document.getElementById("confirm_password");
? ^^^
- function validatePassword(){
+ function validatePassword() {
? +
- if(password.value != confirm_password.value) {
+ if (password.value != confirm_password.value) {
? +
confirm_password.setCustomValidity("Passwords Don't Match");
} else {
confirm_password.setCustomValidity('');
}
}
-
password.onchange = validatePassword;
confirm_password.onkeyup = validatePassword;
-
-
</script> | 56 | 1.69697 | 34 | 22 |
9d4cbb30fe3a8f9040cd29958ed47db3fb1a14ac | image-diff/diff.js | image-diff/diff.js | /*
Copyright 2018 Google LLC
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.
*/
const pixelmatch = require('pixelmatch');
const sharp = require('sharp');
function diff(oldImage, newImage, length, width, callback) {
const diffBuffer = Buffer.alloc(oldImage.length);
Promise.all([sharp(oldImage).toBuffer(), sharp(newImage).toBuffer()]).then(images => {
const diffPixelCount = pixelmatch(images[0], images[1], diffBuffer, length, width);
if (diffPixelCount === 0) return callback(null, false);
callback(null, diffPixelCount, diffBuffer);
});
}
module.exports = diff;
| /*
Copyright 2018 Google LLC
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.
*/
const pixelmatch = require('pixelmatch');
const sharp = require('sharp');
function diff(oldImage, newImage, length, width, callback) {
// Number of pixels that have to mismatch to consider the images different
const diffPixelThreshold = 100;
const diffBuffer = Buffer.alloc(oldImage.length);
Promise.all([sharp(oldImage).toBuffer(), sharp(newImage).toBuffer()]).then(images => {
const diffPixelCount = pixelmatch(images[0], images[1], diffBuffer, length, width, {
includeAA: true, // Ignore Anti-aliasing in diff
threshold: 0.3, // be less sensitive than default (0.1) to determine if a pixel has changed.
});
if (diffPixelCount === diffPixelThreshold) return callback(null, false);
callback(null, diffPixelCount, diffBuffer);
});
}
module.exports = diff;
| Increase threshold and ignore anti-aliasing when comparing images | Increase threshold and ignore anti-aliasing when comparing images
| JavaScript | apache-2.0 | GoogleCloudPlatform/nodejs-serverless-microservices-demo,GoogleCloudPlatform/nodejs-serverless-microservices-demo | javascript | ## Code Before:
/*
Copyright 2018 Google LLC
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.
*/
const pixelmatch = require('pixelmatch');
const sharp = require('sharp');
function diff(oldImage, newImage, length, width, callback) {
const diffBuffer = Buffer.alloc(oldImage.length);
Promise.all([sharp(oldImage).toBuffer(), sharp(newImage).toBuffer()]).then(images => {
const diffPixelCount = pixelmatch(images[0], images[1], diffBuffer, length, width);
if (diffPixelCount === 0) return callback(null, false);
callback(null, diffPixelCount, diffBuffer);
});
}
module.exports = diff;
## Instruction:
Increase threshold and ignore anti-aliasing when comparing images
## Code After:
/*
Copyright 2018 Google LLC
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.
*/
const pixelmatch = require('pixelmatch');
const sharp = require('sharp');
function diff(oldImage, newImage, length, width, callback) {
// Number of pixels that have to mismatch to consider the images different
const diffPixelThreshold = 100;
const diffBuffer = Buffer.alloc(oldImage.length);
Promise.all([sharp(oldImage).toBuffer(), sharp(newImage).toBuffer()]).then(images => {
const diffPixelCount = pixelmatch(images[0], images[1], diffBuffer, length, width, {
includeAA: true, // Ignore Anti-aliasing in diff
threshold: 0.3, // be less sensitive than default (0.1) to determine if a pixel has changed.
});
if (diffPixelCount === diffPixelThreshold) return callback(null, false);
callback(null, diffPixelCount, diffBuffer);
});
}
module.exports = diff;
| /*
Copyright 2018 Google LLC
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.
*/
const pixelmatch = require('pixelmatch');
const sharp = require('sharp');
function diff(oldImage, newImage, length, width, callback) {
+ // Number of pixels that have to mismatch to consider the images different
+ const diffPixelThreshold = 100;
+
const diffBuffer = Buffer.alloc(oldImage.length);
Promise.all([sharp(oldImage).toBuffer(), sharp(newImage).toBuffer()]).then(images => {
- const diffPixelCount = pixelmatch(images[0], images[1], diffBuffer, length, width);
? ^^
+ const diffPixelCount = pixelmatch(images[0], images[1], diffBuffer, length, width, {
? ^^^
+ includeAA: true, // Ignore Anti-aliasing in diff
+ threshold: 0.3, // be less sensitive than default (0.1) to determine if a pixel has changed.
+ });
- if (diffPixelCount === 0) return callback(null, false);
? ^
+ if (diffPixelCount === diffPixelThreshold) return callback(null, false);
? ^^^^^^^^^^^^^^^^^^
callback(null, diffPixelCount, diffBuffer);
});
}
module.exports = diff; | 10 | 0.357143 | 8 | 2 |
d0be9009da99ef8530a0d2927350663b3b89547a | pep8ify/pep8ify.py | pep8ify/pep8ify.py |
import sys
from lib2to3.main import main
try:
import pep8ify.fixes
except ImportError:
# if importing pep8ify fails, try to load from parent
# directory to support running without installation
import imp, os
if not hasattr(os, 'getuid') or os.getuid() != 0:
imp.load_module('pep8ify', *imp.find_module('pep8ify',
[os.path.dirname(os.path.dirname(__file__))]))
def _main():
sys.exit(main("pep8ify.fixes"))
if __name__ == '__main__':
_main()
|
from lib2to3.main import main
try:
import pep8ify.fixes
except ImportError:
# if importing pep8ify fails, try to load from parent
# directory to support running without installation
import imp, os
if not hasattr(os, 'getuid') or os.getuid() != 0:
imp.load_module('pep8ify', *imp.find_module('pep8ify',
[os.path.dirname(os.path.dirname(__file__))]))
def _main():
raise SystemExit(main("pep8ify.fixes"))
if __name__ == '__main__':
_main()
| Use `raise SystemExit` intead of `sys.exit`. | Clean-up: Use `raise SystemExit` intead of `sys.exit`.
| Python | apache-2.0 | spulec/pep8ify | python | ## Code Before:
import sys
from lib2to3.main import main
try:
import pep8ify.fixes
except ImportError:
# if importing pep8ify fails, try to load from parent
# directory to support running without installation
import imp, os
if not hasattr(os, 'getuid') or os.getuid() != 0:
imp.load_module('pep8ify', *imp.find_module('pep8ify',
[os.path.dirname(os.path.dirname(__file__))]))
def _main():
sys.exit(main("pep8ify.fixes"))
if __name__ == '__main__':
_main()
## Instruction:
Clean-up: Use `raise SystemExit` intead of `sys.exit`.
## Code After:
from lib2to3.main import main
try:
import pep8ify.fixes
except ImportError:
# if importing pep8ify fails, try to load from parent
# directory to support running without installation
import imp, os
if not hasattr(os, 'getuid') or os.getuid() != 0:
imp.load_module('pep8ify', *imp.find_module('pep8ify',
[os.path.dirname(os.path.dirname(__file__))]))
def _main():
raise SystemExit(main("pep8ify.fixes"))
if __name__ == '__main__':
_main()
| -
- import sys
from lib2to3.main import main
try:
import pep8ify.fixes
except ImportError:
# if importing pep8ify fails, try to load from parent
# directory to support running without installation
import imp, os
if not hasattr(os, 'getuid') or os.getuid() != 0:
imp.load_module('pep8ify', *imp.find_module('pep8ify',
[os.path.dirname(os.path.dirname(__file__))]))
def _main():
- sys.exit(main("pep8ify.fixes"))
? ^
+ raise SystemExit(main("pep8ify.fixes"))
? +++ +++ ^ ++
if __name__ == '__main__':
_main() | 4 | 0.190476 | 1 | 3 |
187c9d9f56fbb6531f9b396d6bace3880fa421ca | .travis.yml | .travis.yml | language: php
sudo: false
cache:
directories:
- $HOME/.composer/cache/files
- $HOME/symfony-bridge/.phpunit
php:
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- nightly
env:
global:
- SYMFONY_PHPUNIT_DIR="$HOME/symfony-bridge/.phpunit"
matrix:
include:
- php: 5.6
env: COMPOSER_FLAGS='--prefer-lowest --prefer-stable' SYMFONY_DEPRECATIONS_HELPER=weak
- php: 7.1
env: DEPENDENCIES=dev
- php: hhvm
dist: trusty
- php: 5.3
dist: precise
before_install:
- if [ "$DEPENDENCIES" = "dev" ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json; fi;
# force the PHPUnit version for PHP 7.2, until https://github.com/symfony/symfony/issues/23943 is resolved
- if [ "$TRAVIS_PHP_VERSION" = "nightly" ]; then export SYMFONY_PHPUNIT_VERSION="6.3"; fi;
install:
- composer update $COMPOSER_FLAGS
- ./vendor/bin/simple-phpunit install
script:
- php ./vendor/bin/simple-phpunit
| language: php
sudo: false
cache:
directories:
- $HOME/.composer/cache/files
- $HOME/symfony-bridge/.phpunit
php:
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- nightly
env:
global:
- SYMFONY_PHPUNIT_DIR="$HOME/symfony-bridge/.phpunit"
matrix:
include:
- php: 5.6
env: COMPOSER_FLAGS='--prefer-lowest --prefer-stable' SYMFONY_DEPRECATIONS_HELPER=weak
- php: 7.1
env: DEPENDENCIES=dev
- php: hhvm
dist: trusty
- php: 5.3
dist: precise
before_install:
- if [ "$DEPENDENCIES" = "dev" ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json; fi;
# force the PHPUnit version for PHP 7.2, until https://github.com/symfony/symfony/issues/23943 is resolved
- if [ "$TRAVIS_PHP_VERSION" = "nightly" ]; then export SYMFONY_PHPUNIT_VERSION="6.3"; fi;
install:
- composer update $COMPOSER_FLAGS
- ./vendor/bin/simple-phpunit install
script:
- composer validate --strict --no-check-lock
- php ./vendor/bin/simple-phpunit
| Add validation of the composer.json on Travis | Add validation of the composer.json on Travis
This prevents PRs breaking the validity of the composer.json, which would
then be rejected by Packagist.
The lock file is not validated, as it is not committed in the repo.
| YAML | mit | KnpLabs/KnpMenu | yaml | ## Code Before:
language: php
sudo: false
cache:
directories:
- $HOME/.composer/cache/files
- $HOME/symfony-bridge/.phpunit
php:
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- nightly
env:
global:
- SYMFONY_PHPUNIT_DIR="$HOME/symfony-bridge/.phpunit"
matrix:
include:
- php: 5.6
env: COMPOSER_FLAGS='--prefer-lowest --prefer-stable' SYMFONY_DEPRECATIONS_HELPER=weak
- php: 7.1
env: DEPENDENCIES=dev
- php: hhvm
dist: trusty
- php: 5.3
dist: precise
before_install:
- if [ "$DEPENDENCIES" = "dev" ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json; fi;
# force the PHPUnit version for PHP 7.2, until https://github.com/symfony/symfony/issues/23943 is resolved
- if [ "$TRAVIS_PHP_VERSION" = "nightly" ]; then export SYMFONY_PHPUNIT_VERSION="6.3"; fi;
install:
- composer update $COMPOSER_FLAGS
- ./vendor/bin/simple-phpunit install
script:
- php ./vendor/bin/simple-phpunit
## Instruction:
Add validation of the composer.json on Travis
This prevents PRs breaking the validity of the composer.json, which would
then be rejected by Packagist.
The lock file is not validated, as it is not committed in the repo.
## Code After:
language: php
sudo: false
cache:
directories:
- $HOME/.composer/cache/files
- $HOME/symfony-bridge/.phpunit
php:
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- nightly
env:
global:
- SYMFONY_PHPUNIT_DIR="$HOME/symfony-bridge/.phpunit"
matrix:
include:
- php: 5.6
env: COMPOSER_FLAGS='--prefer-lowest --prefer-stable' SYMFONY_DEPRECATIONS_HELPER=weak
- php: 7.1
env: DEPENDENCIES=dev
- php: hhvm
dist: trusty
- php: 5.3
dist: precise
before_install:
- if [ "$DEPENDENCIES" = "dev" ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json; fi;
# force the PHPUnit version for PHP 7.2, until https://github.com/symfony/symfony/issues/23943 is resolved
- if [ "$TRAVIS_PHP_VERSION" = "nightly" ]; then export SYMFONY_PHPUNIT_VERSION="6.3"; fi;
install:
- composer update $COMPOSER_FLAGS
- ./vendor/bin/simple-phpunit install
script:
- composer validate --strict --no-check-lock
- php ./vendor/bin/simple-phpunit
| language: php
sudo: false
cache:
directories:
- $HOME/.composer/cache/files
- $HOME/symfony-bridge/.phpunit
php:
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- nightly
env:
global:
- SYMFONY_PHPUNIT_DIR="$HOME/symfony-bridge/.phpunit"
matrix:
include:
- php: 5.6
env: COMPOSER_FLAGS='--prefer-lowest --prefer-stable' SYMFONY_DEPRECATIONS_HELPER=weak
- php: 7.1
env: DEPENDENCIES=dev
- php: hhvm
dist: trusty
- php: 5.3
dist: precise
before_install:
- if [ "$DEPENDENCIES" = "dev" ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json; fi;
# force the PHPUnit version for PHP 7.2, until https://github.com/symfony/symfony/issues/23943 is resolved
- if [ "$TRAVIS_PHP_VERSION" = "nightly" ]; then export SYMFONY_PHPUNIT_VERSION="6.3"; fi;
install:
- composer update $COMPOSER_FLAGS
- ./vendor/bin/simple-phpunit install
script:
+ - composer validate --strict --no-check-lock
- php ./vendor/bin/simple-phpunit | 1 | 0.023256 | 1 | 0 |
6289377a466669aab620d6849b51ea5988f0d180 | test/CMakeLists.txt | test/CMakeLists.txt | file(GLOB PluginParametersTest_SOURCES *.cpp)
add_executable(pluginparameterstest ${PluginParametersTest_SOURCES})
| file(GLOB PluginParametersTest_SOURCES *.cpp)
set(TinyThread_SOURCES ${CMAKE_SOURCE_DIR}/include/tinythread/source/tinythread.cpp)
add_executable(pluginparameterstest ${PluginParametersTest_SOURCES} ${TinyThread_SOURCES})
target_link_libraries(pluginparameterstest pthread)
| Add tinythread to test suite sources | Add tinythread to test suite sources
| Text | bsd-2-clause | teragonaudio/PluginParameters,alessandrostone/PluginParameters,teragonaudio/PluginParameters,alessandrostone/PluginParameters | text | ## Code Before:
file(GLOB PluginParametersTest_SOURCES *.cpp)
add_executable(pluginparameterstest ${PluginParametersTest_SOURCES})
## Instruction:
Add tinythread to test suite sources
## Code After:
file(GLOB PluginParametersTest_SOURCES *.cpp)
set(TinyThread_SOURCES ${CMAKE_SOURCE_DIR}/include/tinythread/source/tinythread.cpp)
add_executable(pluginparameterstest ${PluginParametersTest_SOURCES} ${TinyThread_SOURCES})
target_link_libraries(pluginparameterstest pthread)
| file(GLOB PluginParametersTest_SOURCES *.cpp)
+ set(TinyThread_SOURCES ${CMAKE_SOURCE_DIR}/include/tinythread/source/tinythread.cpp)
- add_executable(pluginparameterstest ${PluginParametersTest_SOURCES})
+ add_executable(pluginparameterstest ${PluginParametersTest_SOURCES} ${TinyThread_SOURCES})
? ++++++++++++++++++++++
+ target_link_libraries(pluginparameterstest pthread) | 4 | 2 | 3 | 1 |
ea6482019e8e85b5d88049d1c700b769d18d8d73 | templates/default/systemd/nginx.erb | templates/default/systemd/nginx.erb |
[Unit]
Description=The nginx HTTP and reverse proxy server for <%= @nginx_instance_name %>
After=network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
PIDFile=/run/<%= @nginx_instance_name %>.pid
ExecStartPre=/usr/sbin/nginx -t
ExecStart=/usr/sbin/nginx -c /etc/<%= @nginx_instance_name %>/nginx.conf
ExecReload=/bin/kill -s HUP $MAINPID
KillMode=process
KillSignal=SIGQUIT
TimeoutStopSec=5
PrivateTmp=true
[Install]
WantedBy=multi-user.target
|
[Unit]
Description=The nginx HTTP and reverse proxy server for <%= @nginx_instance_name %>
After=network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
PIDFile=/run/<%= @nginx_instance_name %>.pid
ExecStartPre=/usr/sbin/nginx -t -c /etc/<%= @nginx_instance_name %>/nginx.conf
ExecStart=/usr/sbin/nginx -c /etc/<%= @nginx_instance_name %>/nginx.conf
ExecReload=/bin/kill -s HUP $MAINPID
KillMode=process
KillSignal=SIGQUIT
TimeoutStopSec=5
PrivateTmp=true
[Install]
WantedBy=multi-user.target
| Add configuration parameter to systemd test command | Add configuration parameter to systemd test command
| HTML+ERB | apache-2.0 | ffuenf/nginx,ffuenf/nginx,ffuenf/nginx | html+erb | ## Code Before:
[Unit]
Description=The nginx HTTP and reverse proxy server for <%= @nginx_instance_name %>
After=network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
PIDFile=/run/<%= @nginx_instance_name %>.pid
ExecStartPre=/usr/sbin/nginx -t
ExecStart=/usr/sbin/nginx -c /etc/<%= @nginx_instance_name %>/nginx.conf
ExecReload=/bin/kill -s HUP $MAINPID
KillMode=process
KillSignal=SIGQUIT
TimeoutStopSec=5
PrivateTmp=true
[Install]
WantedBy=multi-user.target
## Instruction:
Add configuration parameter to systemd test command
## Code After:
[Unit]
Description=The nginx HTTP and reverse proxy server for <%= @nginx_instance_name %>
After=network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
PIDFile=/run/<%= @nginx_instance_name %>.pid
ExecStartPre=/usr/sbin/nginx -t -c /etc/<%= @nginx_instance_name %>/nginx.conf
ExecStart=/usr/sbin/nginx -c /etc/<%= @nginx_instance_name %>/nginx.conf
ExecReload=/bin/kill -s HUP $MAINPID
KillMode=process
KillSignal=SIGQUIT
TimeoutStopSec=5
PrivateTmp=true
[Install]
WantedBy=multi-user.target
|
[Unit]
Description=The nginx HTTP and reverse proxy server for <%= @nginx_instance_name %>
After=network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
PIDFile=/run/<%= @nginx_instance_name %>.pid
- ExecStartPre=/usr/sbin/nginx -t
+ ExecStartPre=/usr/sbin/nginx -t -c /etc/<%= @nginx_instance_name %>/nginx.conf
ExecStart=/usr/sbin/nginx -c /etc/<%= @nginx_instance_name %>/nginx.conf
ExecReload=/bin/kill -s HUP $MAINPID
KillMode=process
KillSignal=SIGQUIT
TimeoutStopSec=5
PrivateTmp=true
[Install]
WantedBy=multi-user.target | 2 | 0.111111 | 1 | 1 |
7babaa6def1a4bfe610d10644d3db9e6ef5b7a2a | app/views/ems_middleware/edit.html.haml | app/views/ems_middleware/edit.html.haml | = render :partial => 'shared/views/ems_common/form'
| = form_for(@ems,
:url => ems_middleware_path(@ems),
:method => :patch,
:html => {"ng-controller" => "emsCommonFormController",
"name" => "angularForm",
"ng-show" => "afterGet",
"update-url" => "#{ems_middleware_path(@ems)}",
"form-fields-url" => "/#{controller_name}/ems_middleware_form_fields/",
"novalidate" => true}) do |f|
%input{:type => 'hidden', :id => "form_id", :value => "##{f.options[:html][:id]}"}
%input{:type => 'hidden', :id => "button_name", :name => "button", :value => "save"}
%input{:type => 'hidden', :id => "cred_type", :name => "cred_type", :value => "default"}
= render :partial => "form"
:javascript
ManageIQ.angular.app.value('emsCommonFormId', '#{@ems.id || "new"}');
miq_bootstrap($('#form_id').val());
| Edit form for Middleware Provider | Edit form for Middleware Provider
| Haml | apache-2.0 | skateman/manageiq,aufi/manageiq,jrafanie/manageiq,NaNi-Z/manageiq,gmcculloug/manageiq,d-m-u/manageiq,agrare/manageiq,d-m-u/manageiq,NickLaMuro/manageiq,d-m-u/manageiq,mfeifer/manageiq,chessbyte/manageiq,mfeifer/manageiq,ManageIQ/manageiq,hstastna/manageiq,lpichler/manageiq,josejulio/manageiq,chessbyte/manageiq,andyvesel/manageiq,matobet/manageiq,hstastna/manageiq,agrare/manageiq,mkanoor/manageiq,ailisp/manageiq,syncrou/manageiq,mresti/manageiq,durandom/manageiq,mzazrivec/manageiq,pkomanek/manageiq,pkomanek/manageiq,pkomanek/manageiq,andyvesel/manageiq,pkomanek/manageiq,israel-hdez/manageiq,chessbyte/manageiq,juliancheal/manageiq,gmcculloug/manageiq,israel-hdez/manageiq,borod108/manageiq,tzumainn/manageiq,borod108/manageiq,gmcculloug/manageiq,mzazrivec/manageiq,ilackarms/manageiq,NickLaMuro/manageiq,matobet/manageiq,jntullo/manageiq,fbladilo/manageiq,josejulio/manageiq,matobet/manageiq,jntullo/manageiq,tinaafitz/manageiq,josejulio/manageiq,billfitzgerald0120/manageiq,tzumainn/manageiq,branic/manageiq,juliancheal/manageiq,syncrou/manageiq,fbladilo/manageiq,mkanoor/manageiq,branic/manageiq,jameswnl/manageiq,mkanoor/manageiq,tinaafitz/manageiq,djberg96/manageiq,jntullo/manageiq,ailisp/manageiq,branic/manageiq,syncrou/manageiq,durandom/manageiq,jrafanie/manageiq,NickLaMuro/manageiq,ManageIQ/manageiq,gerikis/manageiq,gerikis/manageiq,jvlcek/manageiq,branic/manageiq,romanblanco/manageiq,fbladilo/manageiq,tinaafitz/manageiq,matobet/manageiq,mzazrivec/manageiq,ailisp/manageiq,billfitzgerald0120/manageiq,yaacov/manageiq,durandom/manageiq,mfeifer/manageiq,agrare/manageiq,skateman/manageiq,jameswnl/manageiq,aufi/manageiq,lpichler/manageiq,kbrock/manageiq,NickLaMuro/manageiq,aufi/manageiq,ilackarms/manageiq,djberg96/manageiq,romanblanco/manageiq,NaNi-Z/manageiq,billfitzgerald0120/manageiq,jntullo/manageiq,gmcculloug/manageiq,josejulio/manageiq,billfitzgerald0120/manageiq,NaNi-Z/manageiq,hstastna/manageiq,israel-hdez/manageiq,andyvesel/manageiq,tinaafitz/manageiq,durandom/manageiq,fbladilo/manageiq,chessbyte/manageiq,djberg96/manageiq,d-m-u/manageiq,jvlcek/manageiq,mfeifer/manageiq,ilackarms/manageiq,agrare/manageiq,kbrock/manageiq,romanblanco/manageiq,aufi/manageiq,lpichler/manageiq,juliancheal/manageiq,mkanoor/manageiq,yaacov/manageiq,syncrou/manageiq,yaacov/manageiq,ailisp/manageiq,lpichler/manageiq,gerikis/manageiq,jameswnl/manageiq,gerikis/manageiq,tzumainn/manageiq,jameswnl/manageiq,juliancheal/manageiq,NaNi-Z/manageiq,mresti/manageiq,ManageIQ/manageiq,borod108/manageiq,skateman/manageiq,jrafanie/manageiq,ManageIQ/manageiq,tzumainn/manageiq,israel-hdez/manageiq,jvlcek/manageiq,jvlcek/manageiq,kbrock/manageiq,romanblanco/manageiq,hstastna/manageiq,mresti/manageiq,ilackarms/manageiq,djberg96/manageiq,andyvesel/manageiq,jrafanie/manageiq,skateman/manageiq,yaacov/manageiq,borod108/manageiq,mresti/manageiq,kbrock/manageiq,mzazrivec/manageiq | haml | ## Code Before:
= render :partial => 'shared/views/ems_common/form'
## Instruction:
Edit form for Middleware Provider
## Code After:
= form_for(@ems,
:url => ems_middleware_path(@ems),
:method => :patch,
:html => {"ng-controller" => "emsCommonFormController",
"name" => "angularForm",
"ng-show" => "afterGet",
"update-url" => "#{ems_middleware_path(@ems)}",
"form-fields-url" => "/#{controller_name}/ems_middleware_form_fields/",
"novalidate" => true}) do |f|
%input{:type => 'hidden', :id => "form_id", :value => "##{f.options[:html][:id]}"}
%input{:type => 'hidden', :id => "button_name", :name => "button", :value => "save"}
%input{:type => 'hidden', :id => "cred_type", :name => "cred_type", :value => "default"}
= render :partial => "form"
:javascript
ManageIQ.angular.app.value('emsCommonFormId', '#{@ems.id || "new"}');
miq_bootstrap($('#form_id').val());
| - = render :partial => 'shared/views/ems_common/form'
+ = form_for(@ems,
+ :url => ems_middleware_path(@ems),
+ :method => :patch,
+ :html => {"ng-controller" => "emsCommonFormController",
+ "name" => "angularForm",
+ "ng-show" => "afterGet",
+ "update-url" => "#{ems_middleware_path(@ems)}",
+ "form-fields-url" => "/#{controller_name}/ems_middleware_form_fields/",
+ "novalidate" => true}) do |f|
+ %input{:type => 'hidden', :id => "form_id", :value => "##{f.options[:html][:id]}"}
+ %input{:type => 'hidden', :id => "button_name", :name => "button", :value => "save"}
+ %input{:type => 'hidden', :id => "cred_type", :name => "cred_type", :value => "default"}
+ = render :partial => "form"
+
+ :javascript
+ ManageIQ.angular.app.value('emsCommonFormId', '#{@ems.id || "new"}');
+ miq_bootstrap($('#form_id').val()); | 18 | 18 | 17 | 1 |
f83d098d7809d47b2832b082bef619b142b5a3fd | bin/update.sh | bin/update.sh | PWD=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# Test version argument.
if [ -z "$1" ]; then
echo "A release version must be supplied (e.g. 7.0.1)."
exit 1
fi
# Remove previous src dir.
find src -depth 1 ! -iregex 'src/index.js' | xargs rm -rf
# Prepare a new branch for this update.
git checkout -b support/update-libphonenumber-${1//\./\-}
# Download the requested tagged release.
echo "Downloading release $1..."
curl -L -s https://github.com/googlei18n/libphonenumber/archive/libphonenumber-$1.tar.gz | tar -xf - --strip-components=4 -C $PWD/../src --include='*javascript/i18n/phonenumbers*'
# Apply custom patch to convert strings to proper errors.
echo "Applying patches..."
curl -L -s https://gist.githubusercontent.com/ruimarinho/d52c0cdde7e4fcd1d589da06b77ed954/raw/5576453b62d349d05c93573ab19d517914102ee6/error.patch | git apply
echo "Done!"
# Add the modified files to git.
git add $PWD/../src/
# Commit with the standard message.
git commit -m "Update libphonenumber@$1"
| PWD=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# Test version argument.
if [ -z "$1" ]; then
echo "A release version must be supplied (e.g. 7.0.1)."
exit 1
fi
# Remove previous src dir.
find src -depth 1 ! -iregex 'src/index.js' | xargs rm -rf
# Prepare a new branch for this update.
git checkout -b support/update-libphonenumber-${1//\./\-}
# Download the requested tagged release.
echo "Downloading release $1..."
curl -L -s https://github.com/googlei18n/libphonenumber/archive/libphonenumber-$1.tar.gz | tar -xf - --strip-components=4 -C $PWD/../src --include='*javascript/i18n/phonenumbers*'
# Apply custom patch to convert strings to proper errors.
echo "Applying patches..."
curl -L -s https://gist.githubusercontent.com/ruimarinho/d52c0cdde7e4fcd1d589da06b77ed954/raw/866c54a8f1dfc77b5a9e470a313fbed0c1ff6ff1/error.patch | git apply
echo "Done!"
# Add the modified files to git.
git add $PWD/../src/
# Commit with the standard message.
git commit -m "Update libphonenumber@$1"
| Remove trailing whitespace from patch | Remove trailing whitespace from patch
[skip ci]
| Shell | apache-2.0 | seegno/google-libphonenumber,seegno/google-libphonenumber,seegno/google-libphonenumber | shell | ## Code Before:
PWD=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# Test version argument.
if [ -z "$1" ]; then
echo "A release version must be supplied (e.g. 7.0.1)."
exit 1
fi
# Remove previous src dir.
find src -depth 1 ! -iregex 'src/index.js' | xargs rm -rf
# Prepare a new branch for this update.
git checkout -b support/update-libphonenumber-${1//\./\-}
# Download the requested tagged release.
echo "Downloading release $1..."
curl -L -s https://github.com/googlei18n/libphonenumber/archive/libphonenumber-$1.tar.gz | tar -xf - --strip-components=4 -C $PWD/../src --include='*javascript/i18n/phonenumbers*'
# Apply custom patch to convert strings to proper errors.
echo "Applying patches..."
curl -L -s https://gist.githubusercontent.com/ruimarinho/d52c0cdde7e4fcd1d589da06b77ed954/raw/5576453b62d349d05c93573ab19d517914102ee6/error.patch | git apply
echo "Done!"
# Add the modified files to git.
git add $PWD/../src/
# Commit with the standard message.
git commit -m "Update libphonenumber@$1"
## Instruction:
Remove trailing whitespace from patch
[skip ci]
## Code After:
PWD=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# Test version argument.
if [ -z "$1" ]; then
echo "A release version must be supplied (e.g. 7.0.1)."
exit 1
fi
# Remove previous src dir.
find src -depth 1 ! -iregex 'src/index.js' | xargs rm -rf
# Prepare a new branch for this update.
git checkout -b support/update-libphonenumber-${1//\./\-}
# Download the requested tagged release.
echo "Downloading release $1..."
curl -L -s https://github.com/googlei18n/libphonenumber/archive/libphonenumber-$1.tar.gz | tar -xf - --strip-components=4 -C $PWD/../src --include='*javascript/i18n/phonenumbers*'
# Apply custom patch to convert strings to proper errors.
echo "Applying patches..."
curl -L -s https://gist.githubusercontent.com/ruimarinho/d52c0cdde7e4fcd1d589da06b77ed954/raw/866c54a8f1dfc77b5a9e470a313fbed0c1ff6ff1/error.patch | git apply
echo "Done!"
# Add the modified files to git.
git add $PWD/../src/
# Commit with the standard message.
git commit -m "Update libphonenumber@$1"
| PWD=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# Test version argument.
if [ -z "$1" ]; then
echo "A release version must be supplied (e.g. 7.0.1)."
exit 1
fi
# Remove previous src dir.
find src -depth 1 ! -iregex 'src/index.js' | xargs rm -rf
# Prepare a new branch for this update.
git checkout -b support/update-libphonenumber-${1//\./\-}
# Download the requested tagged release.
echo "Downloading release $1..."
curl -L -s https://github.com/googlei18n/libphonenumber/archive/libphonenumber-$1.tar.gz | tar -xf - --strip-components=4 -C $PWD/../src --include='*javascript/i18n/phonenumbers*'
# Apply custom patch to convert strings to proper errors.
echo "Applying patches..."
- curl -L -s https://gist.githubusercontent.com/ruimarinho/d52c0cdde7e4fcd1d589da06b77ed954/raw/5576453b62d349d05c93573ab19d517914102ee6/error.patch | git apply
? ^^^ ^^^^^^ - ------- ^^^ ----------
+ curl -L -s https://gist.githubusercontent.com/ruimarinho/d52c0cdde7e4fcd1d589da06b77ed954/raw/866c54a8f1dfc77b5a9e470a313fbed0c1ff6ff1/error.patch | git apply
? ++++ +++++++++++ ++++ ^^ +++ ^ ^^^^^
echo "Done!"
# Add the modified files to git.
git add $PWD/../src/
# Commit with the standard message.
git commit -m "Update libphonenumber@$1" | 2 | 0.0625 | 1 | 1 |
405bfa4440c16607a99d18b76c3db1bc8c2d4f7c | lineman/app/components/thread_page/position_buttons_panel/position_buttons_panel.coffee | lineman/app/components/thread_page/position_buttons_panel/position_buttons_panel.coffee | angular.module('loomioApp').directive 'positionButtonsPanel', ->
scope: {proposal: '='}
restrict: 'E'
templateUrl: 'generated/components/thread_page/position_buttons_panel/position_buttons_panel.html'
replace: true
controller: ($scope, ModalService, VoteForm, CurrentUser, Records) ->
$scope.showPositionButtons = ->
CurrentUser.isMemberOf($scope.proposal.group()) and
$scope.proposal.isActive() and $scope.undecided()
$scope.undecided = ->
!($scope.proposal.lastVoteByUser(CurrentUser)?)
$scope.$on 'triggerVoteForm', (event, position) ->
myVote = $scope.proposal.lastVoteByUser(CurrentUser) or {}
$scope.select position, myVote.statement
$scope.select = (position) ->
ModalService.open(VoteForm, vote: -> Records.votes.build(proposalId: $scope.proposal.id, position: position))
| angular.module('loomioApp').directive 'positionButtonsPanel', ->
scope: {proposal: '='}
restrict: 'E'
templateUrl: 'generated/components/thread_page/position_buttons_panel/position_buttons_panel.html'
replace: true
controller: ($scope, ModalService, VoteForm, CurrentUser, Records, AbilityService) ->
$scope.showPositionButtons = ->
AbilityService.canVoteOn($scope.proposal) and $scope.undecided()
$scope.undecided = ->
!($scope.proposal.lastVoteByUser(CurrentUser)?)
$scope.$on 'triggerVoteForm', (event, position) ->
myVote = $scope.proposal.lastVoteByUser(CurrentUser) or {}
$scope.select position, myVote.statement
$scope.select = (position) ->
ModalService.open(VoteForm, vote: -> Records.votes.build(proposalId: $scope.proposal.id, position: position))
| Fix for position buttons panel | Fix for position buttons panel
| CoffeeScript | agpl-3.0 | FSFTN/Loomio,loomio/loomio,piratas-ar/loomio,loomio/loomio,FSFTN/Loomio,mhjb/loomio,piratas-ar/loomio,sicambria/loomio,FSFTN/Loomio,loomio/loomio,mhjb/loomio,mhjb/loomio,sicambria/loomio,loomio/loomio,sicambria/loomio,mhjb/loomio,FSFTN/Loomio,piratas-ar/loomio,piratas-ar/loomio,sicambria/loomio | coffeescript | ## Code Before:
angular.module('loomioApp').directive 'positionButtonsPanel', ->
scope: {proposal: '='}
restrict: 'E'
templateUrl: 'generated/components/thread_page/position_buttons_panel/position_buttons_panel.html'
replace: true
controller: ($scope, ModalService, VoteForm, CurrentUser, Records) ->
$scope.showPositionButtons = ->
CurrentUser.isMemberOf($scope.proposal.group()) and
$scope.proposal.isActive() and $scope.undecided()
$scope.undecided = ->
!($scope.proposal.lastVoteByUser(CurrentUser)?)
$scope.$on 'triggerVoteForm', (event, position) ->
myVote = $scope.proposal.lastVoteByUser(CurrentUser) or {}
$scope.select position, myVote.statement
$scope.select = (position) ->
ModalService.open(VoteForm, vote: -> Records.votes.build(proposalId: $scope.proposal.id, position: position))
## Instruction:
Fix for position buttons panel
## Code After:
angular.module('loomioApp').directive 'positionButtonsPanel', ->
scope: {proposal: '='}
restrict: 'E'
templateUrl: 'generated/components/thread_page/position_buttons_panel/position_buttons_panel.html'
replace: true
controller: ($scope, ModalService, VoteForm, CurrentUser, Records, AbilityService) ->
$scope.showPositionButtons = ->
AbilityService.canVoteOn($scope.proposal) and $scope.undecided()
$scope.undecided = ->
!($scope.proposal.lastVoteByUser(CurrentUser)?)
$scope.$on 'triggerVoteForm', (event, position) ->
myVote = $scope.proposal.lastVoteByUser(CurrentUser) or {}
$scope.select position, myVote.statement
$scope.select = (position) ->
ModalService.open(VoteForm, vote: -> Records.votes.build(proposalId: $scope.proposal.id, position: position))
| angular.module('loomioApp').directive 'positionButtonsPanel', ->
scope: {proposal: '='}
restrict: 'E'
templateUrl: 'generated/components/thread_page/position_buttons_panel/position_buttons_panel.html'
replace: true
- controller: ($scope, ModalService, VoteForm, CurrentUser, Records) ->
+ controller: ($scope, ModalService, VoteForm, CurrentUser, Records, AbilityService) ->
? ++++++++++++++++
$scope.showPositionButtons = ->
+ AbilityService.canVoteOn($scope.proposal) and $scope.undecided()
- CurrentUser.isMemberOf($scope.proposal.group()) and
- $scope.proposal.isActive() and $scope.undecided()
$scope.undecided = ->
!($scope.proposal.lastVoteByUser(CurrentUser)?)
$scope.$on 'triggerVoteForm', (event, position) ->
myVote = $scope.proposal.lastVoteByUser(CurrentUser) or {}
$scope.select position, myVote.statement
$scope.select = (position) ->
ModalService.open(VoteForm, vote: -> Records.votes.build(proposalId: $scope.proposal.id, position: position)) | 5 | 0.25 | 2 | 3 |
bc139bde774d3da2768a5fe6724952d6f92eef75 | client/views/new_battle.jade | client/views/new_battle.jade | p
strong Alt:
.alt-input.clearfix.hidden
.input-wrapper
input(type="text")
.buttons-wrapper
button.btn.add-button Add
button.btn.cancel-button Cancel
.alt-dropdown-section.dropdown
.select.select-alt(data-toggle="dropdown")
ul.dropdown-menu.alt-dropdown(role = "menu")
p
strong Format:
.dropdown
.select.select-format(data-toggle = "dropdown")
ul.dropdown-menu.format-dropdown(role = "menu")
li
a.select-format-dropdown-item(data-format="xy") Pokebank XY
li
a.select-format-dropdown-item(data-format="bw") Pokemon BW
p
strong Select a team:
.dropdown
.select.select-team(data-toggle = "dropdown")
strong Your team
ul.dropdown-menu.team-dropdown(role = "menu")
p
strong Clauses:
ul.challenge_clauses.well
for value, clause in window.Conditions
- var checked = (defaultClauses.indexOf(value) >= 0)
li
label
input(type = "checkbox", value = value, checked = checked)
| #{window.HumanizedConditions[clause]}
| p
strong Alternate Display Name:
.alt-input.clearfix.hidden
.input-wrapper
input(type="text")
.buttons-wrapper
button.btn.add-button Add
button.btn.cancel-button Cancel
.alt-dropdown-section.dropdown
.select.select-alt(data-toggle="dropdown")
ul.dropdown-menu.alt-dropdown(role = "menu")
p
strong Format:
.dropdown
.select.select-format(data-toggle = "dropdown")
ul.dropdown-menu.format-dropdown(role = "menu")
li
a.select-format-dropdown-item(data-format="xy") Pokebank XY
li
a.select-format-dropdown-item(data-format="bw") Pokemon BW
p
strong Select a team:
.dropdown
.select.select-team(data-toggle = "dropdown")
strong Your team
ul.dropdown-menu.team-dropdown(role = "menu")
p
strong Clauses:
ul.challenge_clauses.well
for value, clause in window.Conditions
- var checked = (defaultClauses.indexOf(value) >= 0)
li
label
input(type = "checkbox", value = value, checked = checked)
| #{window.HumanizedConditions[clause]}
| Copy change to Alternate Display Name | Client: Copy change to Alternate Display Name
| Jade | mit | sarenji/pokebattle-sim,sarenji/pokebattle-sim,sarenji/pokebattle-sim | jade | ## Code Before:
p
strong Alt:
.alt-input.clearfix.hidden
.input-wrapper
input(type="text")
.buttons-wrapper
button.btn.add-button Add
button.btn.cancel-button Cancel
.alt-dropdown-section.dropdown
.select.select-alt(data-toggle="dropdown")
ul.dropdown-menu.alt-dropdown(role = "menu")
p
strong Format:
.dropdown
.select.select-format(data-toggle = "dropdown")
ul.dropdown-menu.format-dropdown(role = "menu")
li
a.select-format-dropdown-item(data-format="xy") Pokebank XY
li
a.select-format-dropdown-item(data-format="bw") Pokemon BW
p
strong Select a team:
.dropdown
.select.select-team(data-toggle = "dropdown")
strong Your team
ul.dropdown-menu.team-dropdown(role = "menu")
p
strong Clauses:
ul.challenge_clauses.well
for value, clause in window.Conditions
- var checked = (defaultClauses.indexOf(value) >= 0)
li
label
input(type = "checkbox", value = value, checked = checked)
| #{window.HumanizedConditions[clause]}
## Instruction:
Client: Copy change to Alternate Display Name
## Code After:
p
strong Alternate Display Name:
.alt-input.clearfix.hidden
.input-wrapper
input(type="text")
.buttons-wrapper
button.btn.add-button Add
button.btn.cancel-button Cancel
.alt-dropdown-section.dropdown
.select.select-alt(data-toggle="dropdown")
ul.dropdown-menu.alt-dropdown(role = "menu")
p
strong Format:
.dropdown
.select.select-format(data-toggle = "dropdown")
ul.dropdown-menu.format-dropdown(role = "menu")
li
a.select-format-dropdown-item(data-format="xy") Pokebank XY
li
a.select-format-dropdown-item(data-format="bw") Pokemon BW
p
strong Select a team:
.dropdown
.select.select-team(data-toggle = "dropdown")
strong Your team
ul.dropdown-menu.team-dropdown(role = "menu")
p
strong Clauses:
ul.challenge_clauses.well
for value, clause in window.Conditions
- var checked = (defaultClauses.indexOf(value) >= 0)
li
label
input(type = "checkbox", value = value, checked = checked)
| #{window.HumanizedConditions[clause]}
| p
- strong Alt:
+ strong Alternate Display Name:
.alt-input.clearfix.hidden
.input-wrapper
input(type="text")
.buttons-wrapper
button.btn.add-button Add
button.btn.cancel-button Cancel
.alt-dropdown-section.dropdown
.select.select-alt(data-toggle="dropdown")
ul.dropdown-menu.alt-dropdown(role = "menu")
p
strong Format:
.dropdown
.select.select-format(data-toggle = "dropdown")
ul.dropdown-menu.format-dropdown(role = "menu")
li
a.select-format-dropdown-item(data-format="xy") Pokebank XY
li
a.select-format-dropdown-item(data-format="bw") Pokemon BW
p
strong Select a team:
.dropdown
.select.select-team(data-toggle = "dropdown")
strong Your team
ul.dropdown-menu.team-dropdown(role = "menu")
p
strong Clauses:
ul.challenge_clauses.well
for value, clause in window.Conditions
- var checked = (defaultClauses.indexOf(value) >= 0)
li
label
input(type = "checkbox", value = value, checked = checked)
| #{window.HumanizedConditions[clause]} | 2 | 0.052632 | 1 | 1 |
700a2f46efac1136206d218d0917c5f6ff0c5009 | android/pts-spp.txt | android/pts-spp.txt | PTS test results for SPP
PTS version: 5.2
Tested: 21-July-2014
Android version: 4.4.4
Results:
PASS test passed
FAIL test failed
INC test is inconclusive
N/A test is disabled due to PICS setup
-------------------------------------------------------------------------------
Test Name Result Notes
-------------------------------------------------------------------------------
TC_DevA_APP_BV_01_C PASS rctest -n -P <channel> <bdaddr>
Note: IUT should sdp query PTS in order to
check given channel for COM5
TC_DevB_APP_BV_02_C PASS haltest: socket listen BTSOCK_RFCOMM
<srvc_name> <uuid>
TC_APP_BV_03_C N/A Missing in PTS
PTS issue #12388
TC_APP_BV_04_C N/A Missing in PTS
TC_APP_BV_05_C N/A Missing in PTS
TC_APP_BV_06_C N/A Missing in PTS
-------------------------------------------------------------------------------
| PTS test results for SPP
PTS version: 5.2
Tested: 21-July-2014
Android version: 4.4.4
Results:
PASS test passed
FAIL test failed
INC test is inconclusive
N/A test is disabled due to PICS setup
-------------------------------------------------------------------------------
Test Name Result Notes
-------------------------------------------------------------------------------
TC_DevA_APP_BV_01_C PASS rctest -n -P <channel> <bdaddr>
Note: IUT should sdp query PTS in order to
check given channel for COM5
TC_DevB_APP_BV_02_C PASS haltest: socket listen BTSOCK_RFCOMM
<srvc_name> <uuid>
TC_APP_BV_03_C N/A Missing in PTS
PTS issue #12388
Note: tests BV_03 : BV_6 currently not supported
ETA: December 2014 (PTS 6.0)
TC_APP_BV_04_C N/A Missing in PTS
TC_APP_BV_05_C N/A Missing in PTS
TC_APP_BV_06_C N/A Missing in PTS
-------------------------------------------------------------------------------
| Update PTS tests for SPP | android/pts: Update PTS tests for SPP
| Text | lgpl-2.1 | silent-snowman/bluez,pstglia/external-bluetooth-bluez,ComputeCycles/bluez,ComputeCycles/bluez,pkarasev3/bluez,pkarasev3/bluez,mapfau/bluez,pstglia/external-bluetooth-bluez,silent-snowman/bluez,pkarasev3/bluez,silent-snowman/bluez,pstglia/external-bluetooth-bluez,pstglia/external-bluetooth-bluez,ComputeCycles/bluez,pkarasev3/bluez,mapfau/bluez,mapfau/bluez,silent-snowman/bluez,mapfau/bluez,ComputeCycles/bluez | text | ## Code Before:
PTS test results for SPP
PTS version: 5.2
Tested: 21-July-2014
Android version: 4.4.4
Results:
PASS test passed
FAIL test failed
INC test is inconclusive
N/A test is disabled due to PICS setup
-------------------------------------------------------------------------------
Test Name Result Notes
-------------------------------------------------------------------------------
TC_DevA_APP_BV_01_C PASS rctest -n -P <channel> <bdaddr>
Note: IUT should sdp query PTS in order to
check given channel for COM5
TC_DevB_APP_BV_02_C PASS haltest: socket listen BTSOCK_RFCOMM
<srvc_name> <uuid>
TC_APP_BV_03_C N/A Missing in PTS
PTS issue #12388
TC_APP_BV_04_C N/A Missing in PTS
TC_APP_BV_05_C N/A Missing in PTS
TC_APP_BV_06_C N/A Missing in PTS
-------------------------------------------------------------------------------
## Instruction:
android/pts: Update PTS tests for SPP
## Code After:
PTS test results for SPP
PTS version: 5.2
Tested: 21-July-2014
Android version: 4.4.4
Results:
PASS test passed
FAIL test failed
INC test is inconclusive
N/A test is disabled due to PICS setup
-------------------------------------------------------------------------------
Test Name Result Notes
-------------------------------------------------------------------------------
TC_DevA_APP_BV_01_C PASS rctest -n -P <channel> <bdaddr>
Note: IUT should sdp query PTS in order to
check given channel for COM5
TC_DevB_APP_BV_02_C PASS haltest: socket listen BTSOCK_RFCOMM
<srvc_name> <uuid>
TC_APP_BV_03_C N/A Missing in PTS
PTS issue #12388
Note: tests BV_03 : BV_6 currently not supported
ETA: December 2014 (PTS 6.0)
TC_APP_BV_04_C N/A Missing in PTS
TC_APP_BV_05_C N/A Missing in PTS
TC_APP_BV_06_C N/A Missing in PTS
-------------------------------------------------------------------------------
| PTS test results for SPP
PTS version: 5.2
Tested: 21-July-2014
Android version: 4.4.4
Results:
PASS test passed
FAIL test failed
INC test is inconclusive
N/A test is disabled due to PICS setup
-------------------------------------------------------------------------------
Test Name Result Notes
-------------------------------------------------------------------------------
TC_DevA_APP_BV_01_C PASS rctest -n -P <channel> <bdaddr>
Note: IUT should sdp query PTS in order to
check given channel for COM5
TC_DevB_APP_BV_02_C PASS haltest: socket listen BTSOCK_RFCOMM
<srvc_name> <uuid>
TC_APP_BV_03_C N/A Missing in PTS
PTS issue #12388
+ Note: tests BV_03 : BV_6 currently not supported
+ ETA: December 2014 (PTS 6.0)
TC_APP_BV_04_C N/A Missing in PTS
TC_APP_BV_05_C N/A Missing in PTS
TC_APP_BV_06_C N/A Missing in PTS
------------------------------------------------------------------------------- | 2 | 0.076923 | 2 | 0 |
53bc98950c2e5f6d4b5a464b73386707034d2a3b | app/src/main/java/de/christinecoenen/code/zapp/models/shows/PersistedMediathekShow.kt | app/src/main/java/de/christinecoenen/code/zapp/models/shows/PersistedMediathekShow.kt | package de.christinecoenen.code.zapp.models.shows
import androidx.room.Embedded
import androidx.room.Entity
import androidx.room.Index
import androidx.room.PrimaryKey
import org.joda.time.DateTime
@Entity(indices = [Index(value = ["apiId"], unique = true)])
data class PersistedMediathekShow(
@PrimaryKey(autoGenerate = true)
var id: Int = 0,
var createdAt: DateTime = DateTime.now(),
var downloadId: Int = 0,
var downloadedAt: DateTime? = null,
var downloadedVideoPath: String? = null,
var downloadStatus: DownloadStatus = DownloadStatus.NONE,
var downloadProgress: Int = 0,
var lastPlayedBackAt: DateTime? = null,
var playbackPosition: Long = 0,
var videoDuration: Long = 0,
@Embedded
var mediathekShow: MediathekShow = MediathekShow()
) {
val playBackPercent
get() = playbackPosition.toFloat() / videoDuration
}
| package de.christinecoenen.code.zapp.models.shows
import androidx.room.Embedded
import androidx.room.Entity
import androidx.room.Index
import androidx.room.PrimaryKey
import org.joda.time.DateTime
@Entity(indices = [Index(value = ["apiId"], unique = true)])
data class PersistedMediathekShow(
@PrimaryKey(autoGenerate = true)
var id: Int = 0,
var createdAt: DateTime = DateTime.now(),
var downloadId: Int = 0,
var downloadedAt: DateTime? = null,
var downloadedVideoPath: String? = null,
var downloadStatus: DownloadStatus = DownloadStatus.NONE,
var downloadProgress: Int = 0,
var lastPlayedBackAt: DateTime? = null,
var playbackPosition: Long = 0,
var videoDuration: Long = 0,
@Embedded
var mediathekShow: MediathekShow = MediathekShow()
) {
val playBackPercent
get() = (playbackPosition.toFloat() / videoDuration).let { if (it.isNaN()) 0f else it }
}
| Fix NaN error in downloads tab | Fix NaN error in downloads tab
| Kotlin | mit | cemrich/zapp | kotlin | ## Code Before:
package de.christinecoenen.code.zapp.models.shows
import androidx.room.Embedded
import androidx.room.Entity
import androidx.room.Index
import androidx.room.PrimaryKey
import org.joda.time.DateTime
@Entity(indices = [Index(value = ["apiId"], unique = true)])
data class PersistedMediathekShow(
@PrimaryKey(autoGenerate = true)
var id: Int = 0,
var createdAt: DateTime = DateTime.now(),
var downloadId: Int = 0,
var downloadedAt: DateTime? = null,
var downloadedVideoPath: String? = null,
var downloadStatus: DownloadStatus = DownloadStatus.NONE,
var downloadProgress: Int = 0,
var lastPlayedBackAt: DateTime? = null,
var playbackPosition: Long = 0,
var videoDuration: Long = 0,
@Embedded
var mediathekShow: MediathekShow = MediathekShow()
) {
val playBackPercent
get() = playbackPosition.toFloat() / videoDuration
}
## Instruction:
Fix NaN error in downloads tab
## Code After:
package de.christinecoenen.code.zapp.models.shows
import androidx.room.Embedded
import androidx.room.Entity
import androidx.room.Index
import androidx.room.PrimaryKey
import org.joda.time.DateTime
@Entity(indices = [Index(value = ["apiId"], unique = true)])
data class PersistedMediathekShow(
@PrimaryKey(autoGenerate = true)
var id: Int = 0,
var createdAt: DateTime = DateTime.now(),
var downloadId: Int = 0,
var downloadedAt: DateTime? = null,
var downloadedVideoPath: String? = null,
var downloadStatus: DownloadStatus = DownloadStatus.NONE,
var downloadProgress: Int = 0,
var lastPlayedBackAt: DateTime? = null,
var playbackPosition: Long = 0,
var videoDuration: Long = 0,
@Embedded
var mediathekShow: MediathekShow = MediathekShow()
) {
val playBackPercent
get() = (playbackPosition.toFloat() / videoDuration).let { if (it.isNaN()) 0f else it }
}
| package de.christinecoenen.code.zapp.models.shows
import androidx.room.Embedded
import androidx.room.Entity
import androidx.room.Index
import androidx.room.PrimaryKey
import org.joda.time.DateTime
@Entity(indices = [Index(value = ["apiId"], unique = true)])
data class PersistedMediathekShow(
@PrimaryKey(autoGenerate = true)
var id: Int = 0,
var createdAt: DateTime = DateTime.now(),
var downloadId: Int = 0,
var downloadedAt: DateTime? = null,
var downloadedVideoPath: String? = null,
var downloadStatus: DownloadStatus = DownloadStatus.NONE,
var downloadProgress: Int = 0,
var lastPlayedBackAt: DateTime? = null,
var playbackPosition: Long = 0,
var videoDuration: Long = 0,
@Embedded
var mediathekShow: MediathekShow = MediathekShow()
) {
val playBackPercent
- get() = playbackPosition.toFloat() / videoDuration
+ get() = (playbackPosition.toFloat() / videoDuration).let { if (it.isNaN()) 0f else it }
} | 2 | 0.04878 | 1 | 1 |
78233db6f015ecbe1e42399edfd2e3999654b4f2 | lib/sepa/banks/danske/danske_response.rb | lib/sepa/banks/danske/danske_response.rb | module Sepa
class DanskeResponse < Response
def bank_encryption_cert
@bank_encryption_cert ||= extract_cert(doc, 'BankEncryptionCert', DANSKE_PKI)
end
def bank_signing_cert
@bank_signing_cert ||= extract_cert(doc, 'BankSigningCert', DANSKE_PKI)
end
def bank_root_cert
@bank_root_cert ||= extract_cert(doc, 'BankRootCert', DANSKE_PKI)
end
def own_encryption_cert
@own_encryption_cert ||= extract_cert(doc, 'EncryptionCert', DANSKE_PKI)
end
def own_signing_cert
@own_signing_cert ||= extract_cert(doc, 'SigningCert', DANSKE_PKI)
end
def ca_certificate
@ca_certificate ||= extract_cert(doc, 'CACert', DANSKE_PKI)
end
end
end
| module Sepa
class DanskeResponse < Response
def bank_encryption_cert
@bank_encryption_cert ||= extract_cert(doc, 'BankEncryptionCert', DANSKE_PKI)
end
def bank_signing_cert
@bank_signing_cert ||= extract_cert(doc, 'BankSigningCert', DANSKE_PKI)
end
def bank_root_cert
@bank_root_cert ||= extract_cert(doc, 'BankRootCert', DANSKE_PKI)
end
def own_encryption_cert
@own_encryption_cert ||= extract_cert(doc, 'EncryptionCert', DANSKE_PKI)
end
def own_signing_cert
@own_signing_cert ||= extract_cert(doc, 'SigningCert', DANSKE_PKI)
end
def ca_certificate
@ca_certificate ||= extract_cert(doc, 'CACert', DANSKE_PKI)
end
private
def find_node_by_uri(uri)
node = doc.at("[xml|id='#{uri}']")
node.at('xmlns|Signature', xmlns: DSIG).remove
node
end
end
end
| Add find_node_by_uri to DanskeResponse since they use a slightly different method from identifying xml nodes | Add find_node_by_uri to DanskeResponse since they use a slightly different method from identifying xml nodes
| Ruby | mit | devlab-oy/sepa | ruby | ## Code Before:
module Sepa
class DanskeResponse < Response
def bank_encryption_cert
@bank_encryption_cert ||= extract_cert(doc, 'BankEncryptionCert', DANSKE_PKI)
end
def bank_signing_cert
@bank_signing_cert ||= extract_cert(doc, 'BankSigningCert', DANSKE_PKI)
end
def bank_root_cert
@bank_root_cert ||= extract_cert(doc, 'BankRootCert', DANSKE_PKI)
end
def own_encryption_cert
@own_encryption_cert ||= extract_cert(doc, 'EncryptionCert', DANSKE_PKI)
end
def own_signing_cert
@own_signing_cert ||= extract_cert(doc, 'SigningCert', DANSKE_PKI)
end
def ca_certificate
@ca_certificate ||= extract_cert(doc, 'CACert', DANSKE_PKI)
end
end
end
## Instruction:
Add find_node_by_uri to DanskeResponse since they use a slightly different method from identifying xml nodes
## Code After:
module Sepa
class DanskeResponse < Response
def bank_encryption_cert
@bank_encryption_cert ||= extract_cert(doc, 'BankEncryptionCert', DANSKE_PKI)
end
def bank_signing_cert
@bank_signing_cert ||= extract_cert(doc, 'BankSigningCert', DANSKE_PKI)
end
def bank_root_cert
@bank_root_cert ||= extract_cert(doc, 'BankRootCert', DANSKE_PKI)
end
def own_encryption_cert
@own_encryption_cert ||= extract_cert(doc, 'EncryptionCert', DANSKE_PKI)
end
def own_signing_cert
@own_signing_cert ||= extract_cert(doc, 'SigningCert', DANSKE_PKI)
end
def ca_certificate
@ca_certificate ||= extract_cert(doc, 'CACert', DANSKE_PKI)
end
private
def find_node_by_uri(uri)
node = doc.at("[xml|id='#{uri}']")
node.at('xmlns|Signature', xmlns: DSIG).remove
node
end
end
end
| module Sepa
class DanskeResponse < Response
def bank_encryption_cert
@bank_encryption_cert ||= extract_cert(doc, 'BankEncryptionCert', DANSKE_PKI)
end
def bank_signing_cert
@bank_signing_cert ||= extract_cert(doc, 'BankSigningCert', DANSKE_PKI)
end
def bank_root_cert
@bank_root_cert ||= extract_cert(doc, 'BankRootCert', DANSKE_PKI)
end
def own_encryption_cert
@own_encryption_cert ||= extract_cert(doc, 'EncryptionCert', DANSKE_PKI)
end
def own_signing_cert
@own_signing_cert ||= extract_cert(doc, 'SigningCert', DANSKE_PKI)
end
def ca_certificate
@ca_certificate ||= extract_cert(doc, 'CACert', DANSKE_PKI)
end
+ private
+
+ def find_node_by_uri(uri)
+ node = doc.at("[xml|id='#{uri}']")
+ node.at('xmlns|Signature', xmlns: DSIG).remove
+ node
+ end
+
end
end | 8 | 0.275862 | 8 | 0 |
a043b9a862caa721cf0ce65bdcee3518416aef26 | lib/generators/atlassian_jwt_authentication/templates/jwt_token.rb | lib/generators/atlassian_jwt_authentication/templates/jwt_token.rb | class JwtToken < ActiveRecord::Base
<% if database_name.present? %>
databases = YAML::load(IO.read('config/database_<%= database_name %>.yml'))
establish_connection databases[Rails.env]
<% end %>
has_many :jwt_users, dependent: :destroy
end | class JwtToken < ActiveRecord::Base
<% if database_name.present? %>
databases = YAML::load(IO.read('config/database_<%= database_name %>.yml'))
establish_connection databases[Rails.env]
<% end %>
has_many :jwt_users, dependent: :destroy
attr_accessible :addon_key, :client_key, :shared_secret, :product_type
end
| Add attr_accessible for JwtToken fields. | Add attr_accessible for JwtToken fields.
| Ruby | mit | MeisterLabs/atlassian-jwt-authentication,MeisterLabs/atlassian-jwt-authentication | ruby | ## Code Before:
class JwtToken < ActiveRecord::Base
<% if database_name.present? %>
databases = YAML::load(IO.read('config/database_<%= database_name %>.yml'))
establish_connection databases[Rails.env]
<% end %>
has_many :jwt_users, dependent: :destroy
end
## Instruction:
Add attr_accessible for JwtToken fields.
## Code After:
class JwtToken < ActiveRecord::Base
<% if database_name.present? %>
databases = YAML::load(IO.read('config/database_<%= database_name %>.yml'))
establish_connection databases[Rails.env]
<% end %>
has_many :jwt_users, dependent: :destroy
attr_accessible :addon_key, :client_key, :shared_secret, :product_type
end
| class JwtToken < ActiveRecord::Base
<% if database_name.present? %>
databases = YAML::load(IO.read('config/database_<%= database_name %>.yml'))
establish_connection databases[Rails.env]
<% end %>
has_many :jwt_users, dependent: :destroy
+
+ attr_accessible :addon_key, :client_key, :shared_secret, :product_type
end | 2 | 0.25 | 2 | 0 |
e69b86dc677dadb9d847549c30ebcf3f5090063b | Test/CMakeLists.txt | Test/CMakeLists.txt | cmake_minimum_required(VERSION 2.8.11)
project(sgetest)
# Library includes:
include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR})
# Test includes:
include_directories(../Source/Lib)
# Source Files (Any .cpp file under Test/ will be included.)
file(GLOB_RECURSE SOURCES *.cpp .)
# Builds: sgetest
add_executable(${PROJECT_NAME} ${SOURCES})
target_link_libraries(${PROJECT_NAME} gtest gtest_main pthread)
target_link_libraries(${PROJECT_NAME} SGECoreLib)
| cmake_minimum_required(VERSION 2.8.11)
project(sgetest)
# Library includes:
include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR})
# Test includes:
include_directories(../Source/Lib)
# Source Files (Any .cpp file under Test/ will be included.)
file(GLOB_RECURSE SOURCES *.cpp .)
# Convenience test command
add_custom_target(tests
DEPENDS ${PROJECT_NAME}
COMMAND ${PROJECT_NAME}
WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
# Builds: sgetest
add_executable(${PROJECT_NAME} ${SOURCES})
target_link_libraries(${PROJECT_NAME} gtest gtest_main pthread)
target_link_libraries(${PROJECT_NAME} SGECoreLib)
| Add convenient target to run tests | Add convenient target to run tests
| Text | bsd-3-clause | stuhacking/SGEngine-Cpp,stuhacking/SGEngine-Cpp,stuhacking/SGEngine-Cpp | text | ## Code Before:
cmake_minimum_required(VERSION 2.8.11)
project(sgetest)
# Library includes:
include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR})
# Test includes:
include_directories(../Source/Lib)
# Source Files (Any .cpp file under Test/ will be included.)
file(GLOB_RECURSE SOURCES *.cpp .)
# Builds: sgetest
add_executable(${PROJECT_NAME} ${SOURCES})
target_link_libraries(${PROJECT_NAME} gtest gtest_main pthread)
target_link_libraries(${PROJECT_NAME} SGECoreLib)
## Instruction:
Add convenient target to run tests
## Code After:
cmake_minimum_required(VERSION 2.8.11)
project(sgetest)
# Library includes:
include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR})
# Test includes:
include_directories(../Source/Lib)
# Source Files (Any .cpp file under Test/ will be included.)
file(GLOB_RECURSE SOURCES *.cpp .)
# Convenience test command
add_custom_target(tests
DEPENDS ${PROJECT_NAME}
COMMAND ${PROJECT_NAME}
WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
# Builds: sgetest
add_executable(${PROJECT_NAME} ${SOURCES})
target_link_libraries(${PROJECT_NAME} gtest gtest_main pthread)
target_link_libraries(${PROJECT_NAME} SGECoreLib)
| cmake_minimum_required(VERSION 2.8.11)
project(sgetest)
# Library includes:
include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR})
# Test includes:
include_directories(../Source/Lib)
# Source Files (Any .cpp file under Test/ will be included.)
file(GLOB_RECURSE SOURCES *.cpp .)
+ # Convenience test command
+ add_custom_target(tests
+ DEPENDS ${PROJECT_NAME}
+ COMMAND ${PROJECT_NAME}
+ WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
+
# Builds: sgetest
add_executable(${PROJECT_NAME} ${SOURCES})
target_link_libraries(${PROJECT_NAME} gtest gtest_main pthread)
target_link_libraries(${PROJECT_NAME} SGECoreLib) | 6 | 0.375 | 6 | 0 |
841ef3882528557830a39b6a995bf47510847d15 | README.rst | README.rst | ==============
MPI for Python
==============
Overview
--------
Welcome to MPI for Python. This package provides Python bindings for
the *Message Passing Interface* (`MPI <http://www.mpi-forum.org/>`_)
standard. It is implemented on top of the MPI-1/2/3 specification and
exposes an API which grounds on the standard MPI-2 C++ bindings.
Dependencies
------------
* `Python <http://www.python.org/>`_ 2.4 to 2.7 or 3.0 to 3.4, or a
recent `PyPy <http://pypy.org/>`_ release.
* A functional MPI 1.x/2.x/3.x implementation like `MPICH
<http://www.mpich.org/>`_ or `Open MPI <http://www.open-mpi.org/>`_
built with shared/dynamic libraries.
* To work with the in-development version, you need to install `Cython
<http://www.cython.org/>`_.
| ==============
MPI for Python
==============
[](https://travis-ci.org/mpi4py/mpi4py)
Overview
--------
Welcome to MPI for Python. This package provides Python bindings for
the *Message Passing Interface* (`MPI <http://www.mpi-forum.org/>`_)
standard. It is implemented on top of the MPI-1/2/3 specification and
exposes an API which grounds on the standard MPI-2 C++ bindings.
Dependencies
------------
* `Python <http://www.python.org/>`_ 2.4 to 2.7 or 3.0 to 3.4, or a
recent `PyPy <http://pypy.org/>`_ release.
* A functional MPI 1.x/2.x/3.x implementation like `MPICH
<http://www.mpich.org/>`_ or `Open MPI <http://www.open-mpi.org/>`_
built with shared/dynamic libraries.
* To work with the in-development version, you need to install `Cython
<http://www.cython.org/>`_.
| Add travis build status to readme | Add travis build status to readme
| reStructuredText | bsd-2-clause | pressel/mpi4py,pressel/mpi4py,mpi4py/mpi4py,pressel/mpi4py,mpi4py/mpi4py,mpi4py/mpi4py,pressel/mpi4py | restructuredtext | ## Code Before:
==============
MPI for Python
==============
Overview
--------
Welcome to MPI for Python. This package provides Python bindings for
the *Message Passing Interface* (`MPI <http://www.mpi-forum.org/>`_)
standard. It is implemented on top of the MPI-1/2/3 specification and
exposes an API which grounds on the standard MPI-2 C++ bindings.
Dependencies
------------
* `Python <http://www.python.org/>`_ 2.4 to 2.7 or 3.0 to 3.4, or a
recent `PyPy <http://pypy.org/>`_ release.
* A functional MPI 1.x/2.x/3.x implementation like `MPICH
<http://www.mpich.org/>`_ or `Open MPI <http://www.open-mpi.org/>`_
built with shared/dynamic libraries.
* To work with the in-development version, you need to install `Cython
<http://www.cython.org/>`_.
## Instruction:
Add travis build status to readme
## Code After:
==============
MPI for Python
==============
[](https://travis-ci.org/mpi4py/mpi4py)
Overview
--------
Welcome to MPI for Python. This package provides Python bindings for
the *Message Passing Interface* (`MPI <http://www.mpi-forum.org/>`_)
standard. It is implemented on top of the MPI-1/2/3 specification and
exposes an API which grounds on the standard MPI-2 C++ bindings.
Dependencies
------------
* `Python <http://www.python.org/>`_ 2.4 to 2.7 or 3.0 to 3.4, or a
recent `PyPy <http://pypy.org/>`_ release.
* A functional MPI 1.x/2.x/3.x implementation like `MPICH
<http://www.mpich.org/>`_ or `Open MPI <http://www.open-mpi.org/>`_
built with shared/dynamic libraries.
* To work with the in-development version, you need to install `Cython
<http://www.cython.org/>`_.
| ==============
MPI for Python
==============
+
+ [](https://travis-ci.org/mpi4py/mpi4py)
Overview
--------
Welcome to MPI for Python. This package provides Python bindings for
the *Message Passing Interface* (`MPI <http://www.mpi-forum.org/>`_)
standard. It is implemented on top of the MPI-1/2/3 specification and
exposes an API which grounds on the standard MPI-2 C++ bindings.
Dependencies
------------
* `Python <http://www.python.org/>`_ 2.4 to 2.7 or 3.0 to 3.4, or a
recent `PyPy <http://pypy.org/>`_ release.
* A functional MPI 1.x/2.x/3.x implementation like `MPICH
<http://www.mpich.org/>`_ or `Open MPI <http://www.open-mpi.org/>`_
built with shared/dynamic libraries.
* To work with the in-development version, you need to install `Cython
<http://www.cython.org/>`_. | 2 | 0.083333 | 2 | 0 |
c273a3dd7f0ae3d2b31c1dbc89ce1352d25945d2 | lib/active_record/turntable/active_record_ext/connection_handler_extension.rb | lib/active_record/turntable/active_record_ext/connection_handler_extension.rb | module ActiveRecord::Turntable
module ActiveRecordExt
module ConnectionHandlerExtension
extend ActiveSupport::Concern
included do
alias_method_chain :pool_for, :turntable
end
private
# @note Override not to establish_connection destroy existing connection pool proxy object
def pool_for_with_turntable(owner)
owner_to_pool.fetch(owner.name) {
if ancestor_pool = pool_from_any_process_for(owner)
if ancestor_pool.is_a?(ActiveRecord::Turntable::PoolProxy)
# Use same PoolProxy object
owner_to_pool[owner.name] = ancestor_pool
else
# A connection was established in an ancestor process that must have
# subsequently forked. We can't reuse the connection, but we can copy
# the specification and establish a new connection with it.
establish_connection owner, ancestor_pool.spec
end
else
owner_to_pool[owner.name] = nil
end
}
end
end
end
end
| module ActiveRecord::Turntable
module ActiveRecordExt
module ConnectionHandlerExtension
extend ActiveSupport::Concern
included do
alias_method_chain :pool_for, :turntable
end
private
# @note Override not to establish_connection destroy existing connection pool proxy object
def pool_for_with_turntable(owner)
owner_to_pool.fetch(owner.name) {
if ancestor_pool = pool_from_any_process_for(owner)
if ancestor_pool.is_a?(ActiveRecord::ConnectionAdapters::ConnectionPool)
# A connection was established in an ancestor process that must have
# subsequently forked. We can't reuse the connection, but we can copy
# the specification and establish a new connection with it.
establish_connection owner, ancestor_pool.spec
else
# Use same PoolProxy object
owner_to_pool[owner.name] = ancestor_pool
end
else
owner_to_pool[owner.name] = nil
end
}
end
end
end
end
| Fix not to destroy other database extension's connection proxy object | Fix not to destroy other database extension's connection proxy object
| Ruby | mit | drecom/activerecord-turntable,sue445/activerecord-turntable,if1live/activerecord-turntable,gussan/activerecord-turntable,monsterstrike/activerecord-turntable | ruby | ## Code Before:
module ActiveRecord::Turntable
module ActiveRecordExt
module ConnectionHandlerExtension
extend ActiveSupport::Concern
included do
alias_method_chain :pool_for, :turntable
end
private
# @note Override not to establish_connection destroy existing connection pool proxy object
def pool_for_with_turntable(owner)
owner_to_pool.fetch(owner.name) {
if ancestor_pool = pool_from_any_process_for(owner)
if ancestor_pool.is_a?(ActiveRecord::Turntable::PoolProxy)
# Use same PoolProxy object
owner_to_pool[owner.name] = ancestor_pool
else
# A connection was established in an ancestor process that must have
# subsequently forked. We can't reuse the connection, but we can copy
# the specification and establish a new connection with it.
establish_connection owner, ancestor_pool.spec
end
else
owner_to_pool[owner.name] = nil
end
}
end
end
end
end
## Instruction:
Fix not to destroy other database extension's connection proxy object
## Code After:
module ActiveRecord::Turntable
module ActiveRecordExt
module ConnectionHandlerExtension
extend ActiveSupport::Concern
included do
alias_method_chain :pool_for, :turntable
end
private
# @note Override not to establish_connection destroy existing connection pool proxy object
def pool_for_with_turntable(owner)
owner_to_pool.fetch(owner.name) {
if ancestor_pool = pool_from_any_process_for(owner)
if ancestor_pool.is_a?(ActiveRecord::ConnectionAdapters::ConnectionPool)
# A connection was established in an ancestor process that must have
# subsequently forked. We can't reuse the connection, but we can copy
# the specification and establish a new connection with it.
establish_connection owner, ancestor_pool.spec
else
# Use same PoolProxy object
owner_to_pool[owner.name] = ancestor_pool
end
else
owner_to_pool[owner.name] = nil
end
}
end
end
end
end
| module ActiveRecord::Turntable
module ActiveRecordExt
module ConnectionHandlerExtension
extend ActiveSupport::Concern
included do
alias_method_chain :pool_for, :turntable
end
private
# @note Override not to establish_connection destroy existing connection pool proxy object
def pool_for_with_turntable(owner)
owner_to_pool.fetch(owner.name) {
if ancestor_pool = pool_from_any_process_for(owner)
+ if ancestor_pool.is_a?(ActiveRecord::ConnectionAdapters::ConnectionPool)
- if ancestor_pool.is_a?(ActiveRecord::Turntable::PoolProxy)
- # Use same PoolProxy object
- owner_to_pool[owner.name] = ancestor_pool
- else
# A connection was established in an ancestor process that must have
# subsequently forked. We can't reuse the connection, but we can copy
# the specification and establish a new connection with it.
establish_connection owner, ancestor_pool.spec
+ else
+ # Use same PoolProxy object
+ owner_to_pool[owner.name] = ancestor_pool
end
else
owner_to_pool[owner.name] = nil
end
}
end
end
end
end | 8 | 0.25 | 4 | 4 |
bf33c3e92d8eb65a5351cd3455c4197a6fbf2b29 | requirements.txt | requirements.txt | numpy >= 1.7.0
scipy >= 0.9
matplotlib >= 1.1.0
sphinx
numpydoc >= 0.3
h5py >= 2.0.1
netCDF4 >= 1.0
gdal
pytz
xmltodict
| numpy >= 1.7.0
scipy >= 0.9
matplotlib >= 1.1.0
sphinx
numpydoc >= 0.3
h5py >= 2.0.1
netCDF4 >= 1.0
gdal
pytz
xmltodict
importlib
| FIX merge imports with default wradlib 2 | FIX merge imports with default wradlib 2
--HG--
branch : feature/eg/gabella_polar
| Text | mit | wradlib/wradlib,heistermann/wradlib,heistermann/wradlib,wradlib/wradlib,kmuehlbauer/wradlib,kmuehlbauer/wradlib | text | ## Code Before:
numpy >= 1.7.0
scipy >= 0.9
matplotlib >= 1.1.0
sphinx
numpydoc >= 0.3
h5py >= 2.0.1
netCDF4 >= 1.0
gdal
pytz
xmltodict
## Instruction:
FIX merge imports with default wradlib 2
--HG--
branch : feature/eg/gabella_polar
## Code After:
numpy >= 1.7.0
scipy >= 0.9
matplotlib >= 1.1.0
sphinx
numpydoc >= 0.3
h5py >= 2.0.1
netCDF4 >= 1.0
gdal
pytz
xmltodict
importlib
| numpy >= 1.7.0
scipy >= 0.9
matplotlib >= 1.1.0
sphinx
numpydoc >= 0.3
h5py >= 2.0.1
netCDF4 >= 1.0
gdal
pytz
xmltodict
+ importlib | 1 | 0.1 | 1 | 0 |
bc6caeabccf7de07c46d86edefa2583302b9c11f | pkgs/applications/networking/browsers/chromium/upstream-info.nix | pkgs/applications/networking/browsers/chromium/upstream-info.nix | {
beta = {
sha256 = "1lix5wzcwf666vsdbdzz071rynswlxg5414k3nsrmlxwxhyh6qi4";
sha256bin64 = "02cv9vc1l2nlwa4a0lc7cj9c9czrwp1jd8d024bq16a5fvmhl01l";
version = "54.0.2840.50";
};
dev = {
sha256 = "06kcymwi0wfir7w10g8viayk2h0b5a66dav76mlia4lm30p502kz";
sha256bin64 = "0mgamiffnnkaw8c68b5kyna84x7hlhrzmqfc36kzf434fmm8v5d6";
version = "55.0.2873.0";
};
stable = {
sha256 = "1hyw0z7dsfaxyy8b4mvnfjy5yj0160hzz9m0wj3vn9zvkfvmhan5";
sha256bin64 = "0n0px7yi94gdxq7p6pjqfdz04bnh3mcvbaccjaglj6h5p0jc8abq";
version = "53.0.2785.143";
};
}
| {
beta = {
sha256 = "0f6cqvhlg06lrf4bzaiwzm9yi3fi1dk5jrzvjcg7alw3mzrmh2wv";
sha256bin64 = "02cv9vc1l2nlwa4a0lc7cj9c9czrwp1jd8d024bq16a5fvmhl01l";
version = "54.0.2840.50";
};
dev = {
sha256 = "06kcymwi0wfir7w10g8viayk2h0b5a66dav76mlia4lm30p502kz";
sha256bin64 = "0mgamiffnnkaw8c68b5kyna84x7hlhrzmqfc36kzf434fmm8v5d6";
version = "55.0.2873.0";
};
stable = {
sha256 = "1hyw0z7dsfaxyy8b4mvnfjy5yj0160hzz9m0wj3vn9zvkfvmhan5";
sha256bin64 = "0n0px7yi94gdxq7p6pjqfdz04bnh3mcvbaccjaglj6h5p0jc8abq";
version = "53.0.2785.143";
};
}
| Fix wrong hash for beta channel | chromium: Fix wrong hash for beta channel
It seems that upstream has re-uploaded the tarball again (see
0c2683cc110659d57e36329585469d5d653a0817).
I've verified the new hash from two different hosts.
Signed-off-by: aszlig <ee1aa092358634f9c53f01b5a783726c9e21b35a@redmoonstudios.org>
| Nix | mit | SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs | nix | ## Code Before:
{
beta = {
sha256 = "1lix5wzcwf666vsdbdzz071rynswlxg5414k3nsrmlxwxhyh6qi4";
sha256bin64 = "02cv9vc1l2nlwa4a0lc7cj9c9czrwp1jd8d024bq16a5fvmhl01l";
version = "54.0.2840.50";
};
dev = {
sha256 = "06kcymwi0wfir7w10g8viayk2h0b5a66dav76mlia4lm30p502kz";
sha256bin64 = "0mgamiffnnkaw8c68b5kyna84x7hlhrzmqfc36kzf434fmm8v5d6";
version = "55.0.2873.0";
};
stable = {
sha256 = "1hyw0z7dsfaxyy8b4mvnfjy5yj0160hzz9m0wj3vn9zvkfvmhan5";
sha256bin64 = "0n0px7yi94gdxq7p6pjqfdz04bnh3mcvbaccjaglj6h5p0jc8abq";
version = "53.0.2785.143";
};
}
## Instruction:
chromium: Fix wrong hash for beta channel
It seems that upstream has re-uploaded the tarball again (see
0c2683cc110659d57e36329585469d5d653a0817).
I've verified the new hash from two different hosts.
Signed-off-by: aszlig <ee1aa092358634f9c53f01b5a783726c9e21b35a@redmoonstudios.org>
## Code After:
{
beta = {
sha256 = "0f6cqvhlg06lrf4bzaiwzm9yi3fi1dk5jrzvjcg7alw3mzrmh2wv";
sha256bin64 = "02cv9vc1l2nlwa4a0lc7cj9c9czrwp1jd8d024bq16a5fvmhl01l";
version = "54.0.2840.50";
};
dev = {
sha256 = "06kcymwi0wfir7w10g8viayk2h0b5a66dav76mlia4lm30p502kz";
sha256bin64 = "0mgamiffnnkaw8c68b5kyna84x7hlhrzmqfc36kzf434fmm8v5d6";
version = "55.0.2873.0";
};
stable = {
sha256 = "1hyw0z7dsfaxyy8b4mvnfjy5yj0160hzz9m0wj3vn9zvkfvmhan5";
sha256bin64 = "0n0px7yi94gdxq7p6pjqfdz04bnh3mcvbaccjaglj6h5p0jc8abq";
version = "53.0.2785.143";
};
}
| {
beta = {
- sha256 = "1lix5wzcwf666vsdbdzz071rynswlxg5414k3nsrmlxwxhyh6qi4";
+ sha256 = "0f6cqvhlg06lrf4bzaiwzm9yi3fi1dk5jrzvjcg7alw3mzrmh2wv";
sha256bin64 = "02cv9vc1l2nlwa4a0lc7cj9c9czrwp1jd8d024bq16a5fvmhl01l";
version = "54.0.2840.50";
};
dev = {
sha256 = "06kcymwi0wfir7w10g8viayk2h0b5a66dav76mlia4lm30p502kz";
sha256bin64 = "0mgamiffnnkaw8c68b5kyna84x7hlhrzmqfc36kzf434fmm8v5d6";
version = "55.0.2873.0";
};
stable = {
sha256 = "1hyw0z7dsfaxyy8b4mvnfjy5yj0160hzz9m0wj3vn9zvkfvmhan5";
sha256bin64 = "0n0px7yi94gdxq7p6pjqfdz04bnh3mcvbaccjaglj6h5p0jc8abq";
version = "53.0.2785.143";
};
} | 2 | 0.117647 | 1 | 1 |
7e9ae12a1d9c3a8699817f609e42c251ee08844c | docs/development.rst | docs/development.rst | Development
===========
Since latest release
--------------------
Version 0.1.0 (11 December 2017)
--------------------------------
Initial release | Development
===========
Since latest release
--------------------
Add vertical diffusion of mass between layers (2 March 2018)
Version 0.1.0 (11 December 2017)
--------------------------------
Initial release | Update changelog in docs with vert. diffusion | Update changelog in docs with vert. diffusion
| reStructuredText | mit | edoddridge/MIM,edoddridge/aronnax | restructuredtext | ## Code Before:
Development
===========
Since latest release
--------------------
Version 0.1.0 (11 December 2017)
--------------------------------
Initial release
## Instruction:
Update changelog in docs with vert. diffusion
## Code After:
Development
===========
Since latest release
--------------------
Add vertical diffusion of mass between layers (2 March 2018)
Version 0.1.0 (11 December 2017)
--------------------------------
Initial release | Development
===========
Since latest release
--------------------
+ Add vertical diffusion of mass between layers (2 March 2018)
+
Version 0.1.0 (11 December 2017)
--------------------------------
Initial release | 2 | 0.166667 | 2 | 0 |
55120115af98f6d2f0c09daecfa7e0587d597425 | gcsweb.k8s.io/service.yaml | gcsweb.k8s.io/service.yaml | apiVersion: v1
kind: Service
metadata:
name: gcsweb
namespace: gcsweb
labels:
app: gcsweb
spec:
selector:
app: gcsweb
type: NodePort
ports:
- name: http
port: 80
targetPort: 8080
| apiVersion: v1
kind: Service
metadata:
name: gcsweb
namespace: gcsweb
annotations:
cloud.google.com/neg: '{"ingress": true}'
spec:
selector:
app: gcsweb
type: ClusterIP
ports:
- name: http
port: 80
targetPort: 8080
| Convert gcsweb to VPC_native LB | Convert gcsweb to VPC_native LB
| YAML | apache-2.0 | kubernetes/k8s.io,kubernetes/k8s.io,kubernetes/k8s.io,kubernetes/k8s.io | yaml | ## Code Before:
apiVersion: v1
kind: Service
metadata:
name: gcsweb
namespace: gcsweb
labels:
app: gcsweb
spec:
selector:
app: gcsweb
type: NodePort
ports:
- name: http
port: 80
targetPort: 8080
## Instruction:
Convert gcsweb to VPC_native LB
## Code After:
apiVersion: v1
kind: Service
metadata:
name: gcsweb
namespace: gcsweb
annotations:
cloud.google.com/neg: '{"ingress": true}'
spec:
selector:
app: gcsweb
type: ClusterIP
ports:
- name: http
port: 80
targetPort: 8080
| apiVersion: v1
kind: Service
metadata:
name: gcsweb
namespace: gcsweb
- labels:
- app: gcsweb
+ annotations:
+ cloud.google.com/neg: '{"ingress": true}'
spec:
selector:
app: gcsweb
- type: NodePort
+ type: ClusterIP
ports:
- name: http
port: 80
targetPort: 8080 | 6 | 0.4 | 3 | 3 |
a7d2d81dffe6e598add5e159bd94e016eecec87a | SIGS/app/controllers/user_controller.rb | SIGS/app/controllers/user_controller.rb | class UserController < ApplicationController
before_action :logged_in?, except: [:new,:create,:user_params]
def new
@user = User.new
@user.build_department_assistant
@user.build_coordinator
@user.build_administrative_assistant
end
def show
@user = User.find(params[:id])
end
#Creating a new user
def create
@user = User.new(user_params)
if @user.save
flash[:notice] = 'Cadastro efetuado com sucesso!'
else
render :new
end
end
# Editing the user profile
def edit
@user = User.find(params[:id])
#if @user != current_user
#end
end
#Update User
def update
@user = User.find(params[:id])
if @user.update_attributes(user_params)
flash[:success] = t(:sucessful_profile_update)
# Mandar para Show do tipo de usuário
else
redirect_to user_edit_path
flash[:warning] = t(:error_profile_update)
end
end
private
def user_params
params[:user].permit(:name, :email, :password, :registration, :cpf, :active,
:coordinator_attributes => [:department_id,:course_id,:user_id],
:administrative_assistant_attributes => [:user_id,:user_id],
:department_assistant_attributes => [:department_id])
end
end
| class UserController < ApplicationController
before_action :logged_in?, except: [:new,:create,:user_params]
def new
@user = User.new
@user.build_department_assistant
@user.build_coordinator
@user.build_administrative_assistant
end
def show
@user = User.find(params[:id])
end
#Creating a new user
def create
@user = User.new(user_params)
if @user.save
flash[:notice] = 'Cadastro efetuado com sucesso!'
else
render :new
end
end
# Editing the user profile
def edit
@user = User.find(params[:id])
#if @user != current_user
#end
end
#Update User
def update
@user = User.find(params[:id])
if @user.update_attributes(user_params)
flash[:success] = t(:sucessful_profile_update)
# Mandar para Show do tipo de usuário
else
redirect_to user_edit_path
flash[:warning] = t(:error_profile_update)
end
end
def destroy
@user = User.find(params[:id])
@users = User.all
if @users.count > 1
@user.destroy
redirect_to root_path
else
redirect_to current_user
end
end
private
def user_params
params[:user].permit(:name, :email, :password, :registration, :cpf, :active,
:coordinator_attributes => [:department_id,:course_id,:user_id],
:administrative_assistant_attributes => [:user_id,:user_id],
:department_assistant_attributes => [:department_id])
end
end
| Add destroy method of User Controller | Add destroy method of User Controller
| Ruby | mit | fga-gpp-mds/2017.1-SIGS,fga-gpp-mds/2017.1-SIGS,fga-gpp-mds/2017.1-SIGS,fga-gpp-mds/2017.1-SIGS,fga-gpp-mds/2017.1-SIGS | ruby | ## Code Before:
class UserController < ApplicationController
before_action :logged_in?, except: [:new,:create,:user_params]
def new
@user = User.new
@user.build_department_assistant
@user.build_coordinator
@user.build_administrative_assistant
end
def show
@user = User.find(params[:id])
end
#Creating a new user
def create
@user = User.new(user_params)
if @user.save
flash[:notice] = 'Cadastro efetuado com sucesso!'
else
render :new
end
end
# Editing the user profile
def edit
@user = User.find(params[:id])
#if @user != current_user
#end
end
#Update User
def update
@user = User.find(params[:id])
if @user.update_attributes(user_params)
flash[:success] = t(:sucessful_profile_update)
# Mandar para Show do tipo de usuário
else
redirect_to user_edit_path
flash[:warning] = t(:error_profile_update)
end
end
private
def user_params
params[:user].permit(:name, :email, :password, :registration, :cpf, :active,
:coordinator_attributes => [:department_id,:course_id,:user_id],
:administrative_assistant_attributes => [:user_id,:user_id],
:department_assistant_attributes => [:department_id])
end
end
## Instruction:
Add destroy method of User Controller
## Code After:
class UserController < ApplicationController
before_action :logged_in?, except: [:new,:create,:user_params]
def new
@user = User.new
@user.build_department_assistant
@user.build_coordinator
@user.build_administrative_assistant
end
def show
@user = User.find(params[:id])
end
#Creating a new user
def create
@user = User.new(user_params)
if @user.save
flash[:notice] = 'Cadastro efetuado com sucesso!'
else
render :new
end
end
# Editing the user profile
def edit
@user = User.find(params[:id])
#if @user != current_user
#end
end
#Update User
def update
@user = User.find(params[:id])
if @user.update_attributes(user_params)
flash[:success] = t(:sucessful_profile_update)
# Mandar para Show do tipo de usuário
else
redirect_to user_edit_path
flash[:warning] = t(:error_profile_update)
end
end
def destroy
@user = User.find(params[:id])
@users = User.all
if @users.count > 1
@user.destroy
redirect_to root_path
else
redirect_to current_user
end
end
private
def user_params
params[:user].permit(:name, :email, :password, :registration, :cpf, :active,
:coordinator_attributes => [:department_id,:course_id,:user_id],
:administrative_assistant_attributes => [:user_id,:user_id],
:department_assistant_attributes => [:department_id])
end
end
| class UserController < ApplicationController
before_action :logged_in?, except: [:new,:create,:user_params]
def new
@user = User.new
@user.build_department_assistant
@user.build_coordinator
@user.build_administrative_assistant
end
def show
@user = User.find(params[:id])
end
#Creating a new user
def create
@user = User.new(user_params)
if @user.save
flash[:notice] = 'Cadastro efetuado com sucesso!'
else
render :new
end
end
# Editing the user profile
def edit
@user = User.find(params[:id])
#if @user != current_user
#end
end
#Update User
def update
@user = User.find(params[:id])
if @user.update_attributes(user_params)
flash[:success] = t(:sucessful_profile_update)
# Mandar para Show do tipo de usuário
else
redirect_to user_edit_path
flash[:warning] = t(:error_profile_update)
end
end
+ def destroy
+ @user = User.find(params[:id])
+
+ @users = User.all
+ if @users.count > 1
+ @user.destroy
+ redirect_to root_path
+ else
+ redirect_to current_user
+ end
+ end
+
private
def user_params
params[:user].permit(:name, :email, :password, :registration, :cpf, :active,
:coordinator_attributes => [:department_id,:course_id,:user_id],
:administrative_assistant_attributes => [:user_id,:user_id],
:department_assistant_attributes => [:department_id])
end
end | 12 | 0.235294 | 12 | 0 |
7278be28410c111280d4ccb566842419979843d3 | mla_game/apps/transcript/management/commands/fake_game_one_gameplay.py | mla_game/apps/transcript/management/commands/fake_game_one_gameplay.py | import random
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from mla_game.apps.accounts.models import Profile
from ...models import (
Transcript, TranscriptPhraseDownvote
)
class Command(BaseCommand):
help = 'Creates random votes for 5 phrases in a random transcript'
def handle(self, *args, **options):
users = User.objects.all()
transcript = Transcript.objects.random_transcript().first()
phrases = transcript.phrases.all()[:5]
for user in users:
profile = Profile.objects.get(user=user)
profile.considered_phrases.add(
*[phrase.pk for phrase in phrases]
)
for phrase in phrases:
for user in users:
if random.choice([True, False]):
TranscriptPhraseDownvote.objects.create(
transcript_phrase=phrase,
user=user
)
| import random
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from mla_game.apps.accounts.models import Profile
from ...models import (
Transcript, TranscriptPhraseDownvote
)
from ...tasks import update_transcript_stats
class Command(BaseCommand):
help = 'Creates random votes for 5 phrases in a random transcript'
def handle(self, *args, **options):
users = User.objects.all()
transcript = Transcript.objects.random_transcript(in_progress=False).first()
phrases = transcript.phrases.all()[:5]
for user in users:
profile = Profile.objects.get(user=user)
profile.considered_phrases.add(
*[phrase.pk for phrase in phrases]
)
for phrase in phrases:
for user in users:
if random.choice([True, False]):
TranscriptPhraseDownvote.objects.create(
transcript_phrase=phrase,
user=user
)
update_transcript_stats(transcript)
| Use an actually random transcript; update stats immediately | Use an actually random transcript; update stats immediately
| Python | mit | WGBH/FixIt,WGBH/FixIt,WGBH/FixIt | python | ## Code Before:
import random
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from mla_game.apps.accounts.models import Profile
from ...models import (
Transcript, TranscriptPhraseDownvote
)
class Command(BaseCommand):
help = 'Creates random votes for 5 phrases in a random transcript'
def handle(self, *args, **options):
users = User.objects.all()
transcript = Transcript.objects.random_transcript().first()
phrases = transcript.phrases.all()[:5]
for user in users:
profile = Profile.objects.get(user=user)
profile.considered_phrases.add(
*[phrase.pk for phrase in phrases]
)
for phrase in phrases:
for user in users:
if random.choice([True, False]):
TranscriptPhraseDownvote.objects.create(
transcript_phrase=phrase,
user=user
)
## Instruction:
Use an actually random transcript; update stats immediately
## Code After:
import random
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from mla_game.apps.accounts.models import Profile
from ...models import (
Transcript, TranscriptPhraseDownvote
)
from ...tasks import update_transcript_stats
class Command(BaseCommand):
help = 'Creates random votes for 5 phrases in a random transcript'
def handle(self, *args, **options):
users = User.objects.all()
transcript = Transcript.objects.random_transcript(in_progress=False).first()
phrases = transcript.phrases.all()[:5]
for user in users:
profile = Profile.objects.get(user=user)
profile.considered_phrases.add(
*[phrase.pk for phrase in phrases]
)
for phrase in phrases:
for user in users:
if random.choice([True, False]):
TranscriptPhraseDownvote.objects.create(
transcript_phrase=phrase,
user=user
)
update_transcript_stats(transcript)
| import random
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from mla_game.apps.accounts.models import Profile
from ...models import (
Transcript, TranscriptPhraseDownvote
)
+ from ...tasks import update_transcript_stats
class Command(BaseCommand):
help = 'Creates random votes for 5 phrases in a random transcript'
def handle(self, *args, **options):
users = User.objects.all()
- transcript = Transcript.objects.random_transcript().first()
+ transcript = Transcript.objects.random_transcript(in_progress=False).first()
? +++++++++++++++++
phrases = transcript.phrases.all()[:5]
for user in users:
profile = Profile.objects.get(user=user)
profile.considered_phrases.add(
*[phrase.pk for phrase in phrases]
)
for phrase in phrases:
for user in users:
if random.choice([True, False]):
TranscriptPhraseDownvote.objects.create(
transcript_phrase=phrase,
user=user
)
+ update_transcript_stats(transcript) | 4 | 0.129032 | 3 | 1 |
58042c081bff56641d05a265b43c13e6546f68f6 | gui/test/server_control/test_obmc_gui_virtual_media.robot | gui/test/server_control/test_obmc_gui_virtual_media.robot | *** Settings ***
Documentation Test OpenBMC GUI "Virtual Media" sub-menu of "Server control".
Resource ../../lib/resource.robot
Suite Setup Launch Browser And Login OpenBMC GUI
Suite Teardown Close Browser
Test Setup Test Setup Execution
*** Variables ***
${xpath_start_button} //*[@class='vm__upload-start']
${xpath_choose_file_button} //*[@class='vm__upload-choose-label']
*** Test Cases ***
Verify Existence Of All Sections In Virtaul Media Page
[Documentation] Verify existence of all sections in virtaul media page.
[Tags] Verify_Existence_Of_All_Sections_In_Virtaul_Media_Page
Page Should Contain Virtual media device
Verify Existence Of All Buttons In Virtaul Media Page
[Documentation] Verify existence of all buttons in virtual media page.
[Tags] Verify_Existence_Of_All_Buttons_In_Virtaul_Media_Page
Page Should Contain Element ${xpath_start_button}
Page Should Contain Element ${xpath_choose_file_button}
*** Keywords ***
Test Setup Execution
[Documentation] Do test case setup tasks.
Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
Click Element ${xpath_select_server_control}
Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
Click Element ${xpath_select_virtual_media}
Wait Until Page Contains Virtual media
| *** Settings ***
Documentation Test OpenBMC GUI "Virtual Media" sub-menu of "Server control".
Resource ../../lib/resource.robot
Suite Setup Launch Browser And Login OpenBMC GUI
Suite Teardown Close Browser
Test Setup Test Setup Execution
*** Variables ***
${xpath_start_button} //*[@class='vm__upload-start']
${xpath_choose_file_button} //*[@class='vm__upload-choose-label']
*** Test Cases ***
Verify Existence Of All Sections In Virtual Media Page
[Documentation] Verify existence of all sections in virtual media page.
[Tags] Verify_Existence_Of_All_Sections_In_Virtual_Media_Page
Page Should Contain Virtual media device
Verify Existence Of All Buttons In Virtual Media Page
[Documentation] Verify existence of all buttons in virtual media page.
[Tags] Verify_Existence_Of_All_Buttons_In_Virtual_Media_Page
Page Should Contain Element ${xpath_start_button}
Page Should Contain Element ${xpath_choose_file_button}
*** Keywords ***
Test Setup Execution
[Documentation] Do test case setup tasks.
Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
Click Element ${xpath_select_server_control}
Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
Click Element ${xpath_select_virtual_media}
Wait Until Page Contains Virtual media
| Fix typo in the code | Fix typo in the code
Change-Id: I6f3f58d3df1cdec4b9453daae68b573f64dc0a6c
Signed-off-by: George Keishing <bef0a9ecac45fb57611777c8270153994e13fd2e@in.ibm.com>
| RobotFramework | apache-2.0 | openbmc/openbmc-test-automation,openbmc/openbmc-test-automation | robotframework | ## Code Before:
*** Settings ***
Documentation Test OpenBMC GUI "Virtual Media" sub-menu of "Server control".
Resource ../../lib/resource.robot
Suite Setup Launch Browser And Login OpenBMC GUI
Suite Teardown Close Browser
Test Setup Test Setup Execution
*** Variables ***
${xpath_start_button} //*[@class='vm__upload-start']
${xpath_choose_file_button} //*[@class='vm__upload-choose-label']
*** Test Cases ***
Verify Existence Of All Sections In Virtaul Media Page
[Documentation] Verify existence of all sections in virtaul media page.
[Tags] Verify_Existence_Of_All_Sections_In_Virtaul_Media_Page
Page Should Contain Virtual media device
Verify Existence Of All Buttons In Virtaul Media Page
[Documentation] Verify existence of all buttons in virtual media page.
[Tags] Verify_Existence_Of_All_Buttons_In_Virtaul_Media_Page
Page Should Contain Element ${xpath_start_button}
Page Should Contain Element ${xpath_choose_file_button}
*** Keywords ***
Test Setup Execution
[Documentation] Do test case setup tasks.
Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
Click Element ${xpath_select_server_control}
Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
Click Element ${xpath_select_virtual_media}
Wait Until Page Contains Virtual media
## Instruction:
Fix typo in the code
Change-Id: I6f3f58d3df1cdec4b9453daae68b573f64dc0a6c
Signed-off-by: George Keishing <bef0a9ecac45fb57611777c8270153994e13fd2e@in.ibm.com>
## Code After:
*** Settings ***
Documentation Test OpenBMC GUI "Virtual Media" sub-menu of "Server control".
Resource ../../lib/resource.robot
Suite Setup Launch Browser And Login OpenBMC GUI
Suite Teardown Close Browser
Test Setup Test Setup Execution
*** Variables ***
${xpath_start_button} //*[@class='vm__upload-start']
${xpath_choose_file_button} //*[@class='vm__upload-choose-label']
*** Test Cases ***
Verify Existence Of All Sections In Virtual Media Page
[Documentation] Verify existence of all sections in virtual media page.
[Tags] Verify_Existence_Of_All_Sections_In_Virtual_Media_Page
Page Should Contain Virtual media device
Verify Existence Of All Buttons In Virtual Media Page
[Documentation] Verify existence of all buttons in virtual media page.
[Tags] Verify_Existence_Of_All_Buttons_In_Virtual_Media_Page
Page Should Contain Element ${xpath_start_button}
Page Should Contain Element ${xpath_choose_file_button}
*** Keywords ***
Test Setup Execution
[Documentation] Do test case setup tasks.
Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
Click Element ${xpath_select_server_control}
Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
Click Element ${xpath_select_virtual_media}
Wait Until Page Contains Virtual media
| *** Settings ***
Documentation Test OpenBMC GUI "Virtual Media" sub-menu of "Server control".
Resource ../../lib/resource.robot
Suite Setup Launch Browser And Login OpenBMC GUI
Suite Teardown Close Browser
Test Setup Test Setup Execution
*** Variables ***
${xpath_start_button} //*[@class='vm__upload-start']
${xpath_choose_file_button} //*[@class='vm__upload-choose-label']
*** Test Cases ***
- Verify Existence Of All Sections In Virtaul Media Page
? -
+ Verify Existence Of All Sections In Virtual Media Page
? +
- [Documentation] Verify existence of all sections in virtaul media page.
? -
+ [Documentation] Verify existence of all sections in virtual media page.
? +
- [Tags] Verify_Existence_Of_All_Sections_In_Virtaul_Media_Page
? -
+ [Tags] Verify_Existence_Of_All_Sections_In_Virtual_Media_Page
? +
Page Should Contain Virtual media device
- Verify Existence Of All Buttons In Virtaul Media Page
? -
+ Verify Existence Of All Buttons In Virtual Media Page
? +
[Documentation] Verify existence of all buttons in virtual media page.
- [Tags] Verify_Existence_Of_All_Buttons_In_Virtaul_Media_Page
? -
+ [Tags] Verify_Existence_Of_All_Buttons_In_Virtual_Media_Page
? +
Page Should Contain Element ${xpath_start_button}
Page Should Contain Element ${xpath_choose_file_button}
*** Keywords ***
Test Setup Execution
[Documentation] Do test case setup tasks.
Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
Click Element ${xpath_select_server_control}
Wait Until Page Does Not Contain Element ${xpath_refresh_circle}
Click Element ${xpath_select_virtual_media}
Wait Until Page Contains Virtual media | 10 | 0.227273 | 5 | 5 |
6e8ed853c5263f194789bb452f84bb874e69a254 | milton-caldav-demo/src/main/java/scratch/PrincipalsReport.java | milton-caldav-demo/src/main/java/scratch/PrincipalsReport.java | package scratch;
import com.ettrema.httpclient.ReportMethod;
import java.io.IOException;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.StringRequestEntity;
/**
*
* @author brad
*/
public class PrincipalsReport {
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws IOException {
HttpClient client = new HttpClient();
ReportMethod rm = new ReportMethod( "http://localhost:9080/webdav-caldav/principals");
rm.setRequestHeader( "depth", "0");
rm.setRequestEntity( new StringRequestEntity( "<x0:principal-search-property-set xmlns:x0=\"DAV:\"/>", "text/xml", "UTF-8"));
int result = client.executeMethod( rm );
System.out.println( "result: " + result );
String resp = rm.getResponseBodyAsString();
System.out.println( "response--" );
System.out.println( resp );
}
}
| package scratch;
import com.ettrema.httpclient.ReportMethod;
import java.io.IOException;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.StringRequestEntity;
/**
*
* @author brad
*/
public class PrincipalsReport {
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws IOException {
HttpClient client = new HttpClient();
ReportMethod rm = new ReportMethod( "http://localhost:9080/principals");
rm.setRequestHeader( "depth", "0");
rm.setRequestEntity( new StringRequestEntity( "<x0:principal-search-property-set xmlns:x0=\"DAV:\"/>", "text/xml", "UTF-8"));
int result = client.executeMethod( rm );
System.out.println( "result: " + result );
String resp = rm.getResponseBodyAsString();
System.out.println( "response--" );
System.out.println( resp );
}
}
| Change context to / to support OS X and Windows | Change context to / to support OS X and Windows
| Java | apache-2.0 | arkxu/milton2,arkxu/milton2,arkxu/milton2 | java | ## Code Before:
package scratch;
import com.ettrema.httpclient.ReportMethod;
import java.io.IOException;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.StringRequestEntity;
/**
*
* @author brad
*/
public class PrincipalsReport {
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws IOException {
HttpClient client = new HttpClient();
ReportMethod rm = new ReportMethod( "http://localhost:9080/webdav-caldav/principals");
rm.setRequestHeader( "depth", "0");
rm.setRequestEntity( new StringRequestEntity( "<x0:principal-search-property-set xmlns:x0=\"DAV:\"/>", "text/xml", "UTF-8"));
int result = client.executeMethod( rm );
System.out.println( "result: " + result );
String resp = rm.getResponseBodyAsString();
System.out.println( "response--" );
System.out.println( resp );
}
}
## Instruction:
Change context to / to support OS X and Windows
## Code After:
package scratch;
import com.ettrema.httpclient.ReportMethod;
import java.io.IOException;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.StringRequestEntity;
/**
*
* @author brad
*/
public class PrincipalsReport {
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws IOException {
HttpClient client = new HttpClient();
ReportMethod rm = new ReportMethod( "http://localhost:9080/principals");
rm.setRequestHeader( "depth", "0");
rm.setRequestEntity( new StringRequestEntity( "<x0:principal-search-property-set xmlns:x0=\"DAV:\"/>", "text/xml", "UTF-8"));
int result = client.executeMethod( rm );
System.out.println( "result: " + result );
String resp = rm.getResponseBodyAsString();
System.out.println( "response--" );
System.out.println( resp );
}
}
| package scratch;
import com.ettrema.httpclient.ReportMethod;
import java.io.IOException;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.StringRequestEntity;
/**
*
* @author brad
*/
public class PrincipalsReport {
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws IOException {
HttpClient client = new HttpClient();
- ReportMethod rm = new ReportMethod( "http://localhost:9080/webdav-caldav/principals");
? --------------
+ ReportMethod rm = new ReportMethod( "http://localhost:9080/principals");
rm.setRequestHeader( "depth", "0");
rm.setRequestEntity( new StringRequestEntity( "<x0:principal-search-property-set xmlns:x0=\"DAV:\"/>", "text/xml", "UTF-8"));
int result = client.executeMethod( rm );
System.out.println( "result: " + result );
String resp = rm.getResponseBodyAsString();
System.out.println( "response--" );
System.out.println( resp );
}
} | 2 | 0.068966 | 1 | 1 |
144b394a4567b4e985614a14cd0f7fd15501d4d9 | lib/wulin_master/components/grid/grid_columns.rb | lib/wulin_master/components/grid/grid_columns.rb | module WulinMaster
module GridColumns
extend ActiveSupport::Concern
included do
class_eval do
class << self
attr_reader :columns_pool
end
end
end
module ClassMethods
# Private - executed when class is subclassed
def initialize_columns
@columns_pool ||= [Column.new(:id, self, {:visible => false, :editable => false, :sortable => true})]
end
# Add a column
def column(name, options={})
@columns_pool += [Column.new(name, self, options)]
end
# Remove columns for exactly screens
def remove_columns(r_columns, scope={})
return unless scope[:screen].present?
r_columns = r_columns.map(&:to_s)
@columns_pool.each do |column|
if r_columns.include? column.name.to_s
column.options[:except] = scope[:screen]
end
end
end
# For the old caller, in some old code, there some call like: +grid_class.columns+
def columns
@columns_pool
end
end
# Instance Methods
# Returns columns
def columns
screen_name = params[:screen]
return self.class.columns_pool if screen_name.blank?
all_columns = self.class.columns_pool.dup
all_columns.select do |column|
column.valid_in_screen(screen_name)
end
end
end
end | module WulinMaster
module GridColumns
extend ActiveSupport::Concern
included do
class_eval do
class_attribute :columns_pool
end
end
module ClassMethods
# Private - executed when class is subclassed
def initialize_columns
self.columns_pool ||= [Column.new(:id, self, {:visible => false, :editable => false, :sortable => true})]
end
# Add a column
def column(name, options={})
self.columns_pool += [Column.new(name, self, options)]
end
# Remove columns for exactly screens
def remove_columns(r_columns, scope={})
return unless scope[:screen].present?
r_columns = r_columns.map(&:to_s)
self.columns_pool.each do |column|
if r_columns.include? column.name.to_s
column.options[:except] = scope[:screen]
end
end
end
# For the old caller, in some old code, there some call like: +grid_class.columns+
def columns
self.columns_pool
end
end
# Instance Methods
# Returns columns
def columns
screen_name = params[:screen]
return self.class.columns_pool if screen_name.blank?
all_columns = self.class.columns_pool.dup
all_columns.select do |column|
column.valid_in_screen(screen_name)
end
end
end
end | Revert "MISC - use attr_reader i/o class_attribute for columns_pool" | Revert "MISC - use attr_reader i/o class_attribute for columns_pool"
This reverts commit ead8c75abbfc1cd6adb66dee63d21e1ed66f8cd6.
| Ruby | mit | ekohe/wulin_master,ekohe/wulin_master,ekohe/wulin_master | ruby | ## Code Before:
module WulinMaster
module GridColumns
extend ActiveSupport::Concern
included do
class_eval do
class << self
attr_reader :columns_pool
end
end
end
module ClassMethods
# Private - executed when class is subclassed
def initialize_columns
@columns_pool ||= [Column.new(:id, self, {:visible => false, :editable => false, :sortable => true})]
end
# Add a column
def column(name, options={})
@columns_pool += [Column.new(name, self, options)]
end
# Remove columns for exactly screens
def remove_columns(r_columns, scope={})
return unless scope[:screen].present?
r_columns = r_columns.map(&:to_s)
@columns_pool.each do |column|
if r_columns.include? column.name.to_s
column.options[:except] = scope[:screen]
end
end
end
# For the old caller, in some old code, there some call like: +grid_class.columns+
def columns
@columns_pool
end
end
# Instance Methods
# Returns columns
def columns
screen_name = params[:screen]
return self.class.columns_pool if screen_name.blank?
all_columns = self.class.columns_pool.dup
all_columns.select do |column|
column.valid_in_screen(screen_name)
end
end
end
end
## Instruction:
Revert "MISC - use attr_reader i/o class_attribute for columns_pool"
This reverts commit ead8c75abbfc1cd6adb66dee63d21e1ed66f8cd6.
## Code After:
module WulinMaster
module GridColumns
extend ActiveSupport::Concern
included do
class_eval do
class_attribute :columns_pool
end
end
module ClassMethods
# Private - executed when class is subclassed
def initialize_columns
self.columns_pool ||= [Column.new(:id, self, {:visible => false, :editable => false, :sortable => true})]
end
# Add a column
def column(name, options={})
self.columns_pool += [Column.new(name, self, options)]
end
# Remove columns for exactly screens
def remove_columns(r_columns, scope={})
return unless scope[:screen].present?
r_columns = r_columns.map(&:to_s)
self.columns_pool.each do |column|
if r_columns.include? column.name.to_s
column.options[:except] = scope[:screen]
end
end
end
# For the old caller, in some old code, there some call like: +grid_class.columns+
def columns
self.columns_pool
end
end
# Instance Methods
# Returns columns
def columns
screen_name = params[:screen]
return self.class.columns_pool if screen_name.blank?
all_columns = self.class.columns_pool.dup
all_columns.select do |column|
column.valid_in_screen(screen_name)
end
end
end
end | module WulinMaster
module GridColumns
extend ActiveSupport::Concern
included do
class_eval do
- class << self
- attr_reader :columns_pool
? ^^ ^^ ----
+ class_attribute :columns_pool
? ^^^^^^ ^^^^
- end
end
end
module ClassMethods
# Private - executed when class is subclassed
def initialize_columns
- @columns_pool ||= [Column.new(:id, self, {:visible => false, :editable => false, :sortable => true})]
? ^
+ self.columns_pool ||= [Column.new(:id, self, {:visible => false, :editable => false, :sortable => true})]
? ^^^^^
end
# Add a column
def column(name, options={})
- @columns_pool += [Column.new(name, self, options)]
? ^
+ self.columns_pool += [Column.new(name, self, options)]
? ^^^^^
end
# Remove columns for exactly screens
def remove_columns(r_columns, scope={})
return unless scope[:screen].present?
r_columns = r_columns.map(&:to_s)
- @columns_pool.each do |column|
? ^
+ self.columns_pool.each do |column|
? ^^^^^
if r_columns.include? column.name.to_s
column.options[:except] = scope[:screen]
end
end
end
# For the old caller, in some old code, there some call like: +grid_class.columns+
def columns
- @columns_pool
? ^
+ self.columns_pool
? ^^^^^
end
end
# Instance Methods
# Returns columns
def columns
screen_name = params[:screen]
return self.class.columns_pool if screen_name.blank?
all_columns = self.class.columns_pool.dup
all_columns.select do |column|
column.valid_in_screen(screen_name)
end
end
end
end | 12 | 0.210526 | 5 | 7 |
9287d9dbb81769589d34b6f6360303ff1b2b753c | source/Pictus/reg_filter_mode_translator.cpp | source/Pictus/reg_filter_mode_translator.cpp |
namespace Reg {
namespace Internal {
boost::optional<FilterModeTranslator::external_type> FilterModeTranslator::get_value(internal_type const sval) {
if (sval.empty()) return boost::none;
if (sval == "Bilinear") {
return Filter::Mode::Bilinear;
}
if (sval == "Nearest") {
return Filter::Mode::NearestNeighbor;
}
if (sval == "Lanczos3") {
return Filter::Mode::Lanczos3;
}
switch (FromAString<int>(sval)) {
case 1:
return Filter::Mode::NearestNeighbor;
case 2:
return Filter::Mode::Bilinear;
case 3:
return Filter::Mode::Lanczos3;
}
return boost::none;
}
boost::optional<FilterModeTranslator::internal_type> FilterModeTranslator::put_value(external_type const& val) {
switch (val) {
case Filter::Mode::NearestNeighbor:
return "Nearest";
case Filter::Mode::Bilinear:
return "Bilinear";
case Filter::Mode::Lanczos3:
return "Lanczos3";
}
return boost::none;
}
}
} |
namespace Reg {
namespace Internal {
boost::optional<FilterModeTranslator::external_type> FilterModeTranslator::get_value(internal_type const sval) {
if (sval.empty()) return boost::none;
if (sval == "Bilinear") {
return Filter::Mode::Bilinear;
}
if (sval == "Nearest") {
return Filter::Mode::NearestNeighbor;
}
if (sval == "Lanczos3") {
return Filter::Mode::Lanczos3;
}
switch (FromAString<int>(sval)) {
case 1:
return Filter::Mode::NearestNeighbor;
case 2:
return Filter::Mode::Bilinear;
case 3:
return Filter::Mode::Lanczos3;
}
return boost::none;
}
boost::optional<FilterModeTranslator::internal_type> FilterModeTranslator::put_value(external_type const& val) {
switch (val) {
case Filter::Mode::NearestNeighbor:
return std::string("Nearest");
case Filter::Mode::Bilinear:
return std::string("Bilinear");
case Filter::Mode::Lanczos3:
return std::string("Lanczos3");
}
return boost::none;
}
}
} | Fix compile errors on Linux | Fix compile errors on Linux
| C++ | mit | poppeman/Pictus,poppeman/Pictus,poppeman/Pictus | c++ | ## Code Before:
namespace Reg {
namespace Internal {
boost::optional<FilterModeTranslator::external_type> FilterModeTranslator::get_value(internal_type const sval) {
if (sval.empty()) return boost::none;
if (sval == "Bilinear") {
return Filter::Mode::Bilinear;
}
if (sval == "Nearest") {
return Filter::Mode::NearestNeighbor;
}
if (sval == "Lanczos3") {
return Filter::Mode::Lanczos3;
}
switch (FromAString<int>(sval)) {
case 1:
return Filter::Mode::NearestNeighbor;
case 2:
return Filter::Mode::Bilinear;
case 3:
return Filter::Mode::Lanczos3;
}
return boost::none;
}
boost::optional<FilterModeTranslator::internal_type> FilterModeTranslator::put_value(external_type const& val) {
switch (val) {
case Filter::Mode::NearestNeighbor:
return "Nearest";
case Filter::Mode::Bilinear:
return "Bilinear";
case Filter::Mode::Lanczos3:
return "Lanczos3";
}
return boost::none;
}
}
}
## Instruction:
Fix compile errors on Linux
## Code After:
namespace Reg {
namespace Internal {
boost::optional<FilterModeTranslator::external_type> FilterModeTranslator::get_value(internal_type const sval) {
if (sval.empty()) return boost::none;
if (sval == "Bilinear") {
return Filter::Mode::Bilinear;
}
if (sval == "Nearest") {
return Filter::Mode::NearestNeighbor;
}
if (sval == "Lanczos3") {
return Filter::Mode::Lanczos3;
}
switch (FromAString<int>(sval)) {
case 1:
return Filter::Mode::NearestNeighbor;
case 2:
return Filter::Mode::Bilinear;
case 3:
return Filter::Mode::Lanczos3;
}
return boost::none;
}
boost::optional<FilterModeTranslator::internal_type> FilterModeTranslator::put_value(external_type const& val) {
switch (val) {
case Filter::Mode::NearestNeighbor:
return std::string("Nearest");
case Filter::Mode::Bilinear:
return std::string("Bilinear");
case Filter::Mode::Lanczos3:
return std::string("Lanczos3");
}
return boost::none;
}
}
} |
namespace Reg {
namespace Internal {
boost::optional<FilterModeTranslator::external_type> FilterModeTranslator::get_value(internal_type const sval) {
if (sval.empty()) return boost::none;
if (sval == "Bilinear") {
return Filter::Mode::Bilinear;
}
if (sval == "Nearest") {
return Filter::Mode::NearestNeighbor;
}
if (sval == "Lanczos3") {
return Filter::Mode::Lanczos3;
}
switch (FromAString<int>(sval)) {
case 1:
return Filter::Mode::NearestNeighbor;
case 2:
return Filter::Mode::Bilinear;
case 3:
return Filter::Mode::Lanczos3;
}
return boost::none;
}
boost::optional<FilterModeTranslator::internal_type> FilterModeTranslator::put_value(external_type const& val) {
switch (val) {
case Filter::Mode::NearestNeighbor:
- return "Nearest";
+ return std::string("Nearest");
? ++++++++++++ +
case Filter::Mode::Bilinear:
- return "Bilinear";
+ return std::string("Bilinear");
? ++++++++++++ +
case Filter::Mode::Lanczos3:
- return "Lanczos3";
+ return std::string("Lanczos3");
? ++++++++++++ +
}
return boost::none;
}
}
} | 6 | 0.146341 | 3 | 3 |
3353261d9036b691fe83b3f92598b25238b8abbc | recipes-kernel/linux/config/xilinx-common/bsp/xilinx/soc/drivers/xilinx.cfg | recipes-kernel/linux/config/xilinx-common/bsp/xilinx/soc/drivers/xilinx.cfg | CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_UARTLITE=y
CONFIG_SERIAL_UARTLITE_CONSOLE=y
# DMA
CONFIG_DMADEVICES=y
CONFIG_XILINX_VDMA=y
# Watchdog
CONFIG_WATCHDOG=y
CONFIG_XILINX_WATCHDOG=y
# Ethernet
CONFIG_XILINX_EMACLITE=y
CONFIG_XILINX_AXI_EMAC=y
# GPIO
CONFIG_GPIOLIB=y
CONFIG_OF_GPIO=y
CONFIG_GPIO_SYSFS=y
CONFIG_GPIO_XILINX=y
# I2C
CONFIG_I2C=y
CONFIG_I2C_XILINX=y
# SPI
CONFIG_SPI=y
CONFIG_SPI_XILINX=y
# Xilinx XADC
CONFIG_IIO=y
CONFIG_XILINX_XADC=y
# Xilinx AXI USB2 Device
CONFIG_USB_GADGET_XILINX=y
| CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_UARTLITE=y
CONFIG_SERIAL_UARTLITE_CONSOLE=y
CONFIG_SERIAL_OF_PLATFORM=y
# DMA
CONFIG_DMADEVICES=y
CONFIG_XILINX_VDMA=y
# Watchdog
CONFIG_WATCHDOG=y
CONFIG_XILINX_WATCHDOG=y
# Ethernet
CONFIG_XILINX_EMACLITE=y
CONFIG_XILINX_AXI_EMAC=y
# GPIO
CONFIG_GPIOLIB=y
CONFIG_OF_GPIO=y
CONFIG_GPIO_SYSFS=y
CONFIG_GPIO_XILINX=y
# I2C
CONFIG_I2C=y
CONFIG_I2C_XILINX=y
# SPI
CONFIG_SPI=y
CONFIG_SPI_XILINX=y
# Xilinx XADC
CONFIG_IIO=y
CONFIG_XILINX_XADC=y
# Xilinx AXI USB2 Device
CONFIG_USB_GADGET_XILINX=y
| Enable SERIAL_OF_PLATFORM to fix up dt parsing | linux/configs: Enable SERIAL_OF_PLATFORM to fix up dt parsing
SERIAL_OF_PLATFORM needs to be set in order for the serial 8250 driver
to parse and probe device tree configuration for 8250 nodes. This is
needed so that the uart 16550 instances are probed correctly.
Signed-off-by: Nathan Rossi <2e8aa918660411855c6d44d5bb2da677aa033255@nathanrossi.com>
| INI | mit | Xilinx/meta-xilinx,Xilinx/meta-xilinx,nathanrossi/meta-xilinx,Xilinx/meta-xilinx,nathanrossi/meta-xilinx,Xilinx/meta-xilinx,nathanrossi/meta-xilinx,Xilinx/meta-xilinx,nathanrossi/meta-xilinx,Xilinx/meta-xilinx | ini | ## Code Before:
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_UARTLITE=y
CONFIG_SERIAL_UARTLITE_CONSOLE=y
# DMA
CONFIG_DMADEVICES=y
CONFIG_XILINX_VDMA=y
# Watchdog
CONFIG_WATCHDOG=y
CONFIG_XILINX_WATCHDOG=y
# Ethernet
CONFIG_XILINX_EMACLITE=y
CONFIG_XILINX_AXI_EMAC=y
# GPIO
CONFIG_GPIOLIB=y
CONFIG_OF_GPIO=y
CONFIG_GPIO_SYSFS=y
CONFIG_GPIO_XILINX=y
# I2C
CONFIG_I2C=y
CONFIG_I2C_XILINX=y
# SPI
CONFIG_SPI=y
CONFIG_SPI_XILINX=y
# Xilinx XADC
CONFIG_IIO=y
CONFIG_XILINX_XADC=y
# Xilinx AXI USB2 Device
CONFIG_USB_GADGET_XILINX=y
## Instruction:
linux/configs: Enable SERIAL_OF_PLATFORM to fix up dt parsing
SERIAL_OF_PLATFORM needs to be set in order for the serial 8250 driver
to parse and probe device tree configuration for 8250 nodes. This is
needed so that the uart 16550 instances are probed correctly.
Signed-off-by: Nathan Rossi <2e8aa918660411855c6d44d5bb2da677aa033255@nathanrossi.com>
## Code After:
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_UARTLITE=y
CONFIG_SERIAL_UARTLITE_CONSOLE=y
CONFIG_SERIAL_OF_PLATFORM=y
# DMA
CONFIG_DMADEVICES=y
CONFIG_XILINX_VDMA=y
# Watchdog
CONFIG_WATCHDOG=y
CONFIG_XILINX_WATCHDOG=y
# Ethernet
CONFIG_XILINX_EMACLITE=y
CONFIG_XILINX_AXI_EMAC=y
# GPIO
CONFIG_GPIOLIB=y
CONFIG_OF_GPIO=y
CONFIG_GPIO_SYSFS=y
CONFIG_GPIO_XILINX=y
# I2C
CONFIG_I2C=y
CONFIG_I2C_XILINX=y
# SPI
CONFIG_SPI=y
CONFIG_SPI_XILINX=y
# Xilinx XADC
CONFIG_IIO=y
CONFIG_XILINX_XADC=y
# Xilinx AXI USB2 Device
CONFIG_USB_GADGET_XILINX=y
| CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_UARTLITE=y
CONFIG_SERIAL_UARTLITE_CONSOLE=y
+ CONFIG_SERIAL_OF_PLATFORM=y
# DMA
CONFIG_DMADEVICES=y
CONFIG_XILINX_VDMA=y
# Watchdog
CONFIG_WATCHDOG=y
CONFIG_XILINX_WATCHDOG=y
# Ethernet
CONFIG_XILINX_EMACLITE=y
CONFIG_XILINX_AXI_EMAC=y
# GPIO
CONFIG_GPIOLIB=y
CONFIG_OF_GPIO=y
CONFIG_GPIO_SYSFS=y
CONFIG_GPIO_XILINX=y
# I2C
CONFIG_I2C=y
CONFIG_I2C_XILINX=y
# SPI
CONFIG_SPI=y
CONFIG_SPI_XILINX=y
# Xilinx XADC
CONFIG_IIO=y
CONFIG_XILINX_XADC=y
# Xilinx AXI USB2 Device
CONFIG_USB_GADGET_XILINX=y
| 1 | 0.026316 | 1 | 0 |
8c51c80ac04935f4cc6ba5f531f826bf087b1d0e | php_cs.xml | php_cs.xml | <?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
<rule ref="./vendor/escapestudios/symfony2-coding-standard/Symfony/">
<exclude name="Symfony.Commenting"/>
<exclude name="Symfony.Functions.ScopeOrder"/>
<exclude name="Symfony.Commenting.License.Warning" />
</rule>
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
</ruleset>
| <?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
<rule ref="./vendor/escapestudios/symfony2-coding-standard/Symfony/">
<exclude name="Symfony.Commenting"/>
<exclude name="Symfony.Functions.ScopeOrder"/>
<exclude name="Symfony.Commenting.License.Warning" />
</rule>
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="Symfony.Files.AlphanumericFilename">
<exclude-pattern>*/src/logger/tombstone-function.php</exclude-pattern>
</rule>
<exclude-pattern>*/src/analyzer/Report/Html/Template/*</exclude-pattern>
</ruleset>
| Update PHP Code Sniffer config to ignore the reporting HTML template | Update PHP Code Sniffer config to ignore the reporting HTML template
| XML | mit | scheb/tombstone,scheb/tombstone,scheb/tombstone | xml | ## Code Before:
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
<rule ref="./vendor/escapestudios/symfony2-coding-standard/Symfony/">
<exclude name="Symfony.Commenting"/>
<exclude name="Symfony.Functions.ScopeOrder"/>
<exclude name="Symfony.Commenting.License.Warning" />
</rule>
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
</ruleset>
## Instruction:
Update PHP Code Sniffer config to ignore the reporting HTML template
## Code After:
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
<rule ref="./vendor/escapestudios/symfony2-coding-standard/Symfony/">
<exclude name="Symfony.Commenting"/>
<exclude name="Symfony.Functions.ScopeOrder"/>
<exclude name="Symfony.Commenting.License.Warning" />
</rule>
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="Symfony.Files.AlphanumericFilename">
<exclude-pattern>*/src/logger/tombstone-function.php</exclude-pattern>
</rule>
<exclude-pattern>*/src/analyzer/Report/Html/Template/*</exclude-pattern>
</ruleset>
| <?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
<rule ref="./vendor/escapestudios/symfony2-coding-standard/Symfony/">
<exclude name="Symfony.Commenting"/>
<exclude name="Symfony.Functions.ScopeOrder"/>
<exclude name="Symfony.Commenting.License.Warning" />
</rule>
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
+ <rule ref="Symfony.Files.AlphanumericFilename">
+ <exclude-pattern>*/src/logger/tombstone-function.php</exclude-pattern>
+ </rule>
+ <exclude-pattern>*/src/analyzer/Report/Html/Template/*</exclude-pattern>
</ruleset> | 4 | 0.363636 | 4 | 0 |
804ed81acbd6e6d03bb725f76deb1dd1ecce2b79 | app/views/spree/admin/shared/_calculator_fields.html.haml | app/views/spree/admin/shared/_calculator_fields.html.haml | %fieldset#calculator_fields.no-border-bottom
%legend{align: "center"}= t(:calculator)
#preference-settings
.row
.alpha.four.columns
= f.label(:calculator_type, t(:calculator), for: 'calc_type')
.omega.twelve.columns
= f.select(:calculator_type, @calculators.map { |c| [c.description, c.name] }, {}, {id: 'calc_type', class: 'select2 fullwidth'})
- if !@object.new_record?
.row
.calculator-settings
= f.fields_for :calculator do |calculator_form|
- preference_fields(@object.calculator, calculator_form).each do |field|
.alpha.four.columns
= field[:label]
.field.twelve.eight.columns
= field[:field]
- if @object.calculator.respond_to?(:preferences)
%span.calculator-settings-warning.info.warning= t(:calculator_settings_warning)
| %fieldset#calculator_fields.no-border-bottom
%legend{align: "center"}= t(:fees)
#preference-settings
.row
.alpha.four.columns
= f.label(:calculator_type, t(:calculator), for: 'calc_type')
.omega.twelve.columns
= f.select(:calculator_type, @calculators.map { |c| [c.description, c.name] }, {}, {id: 'calc_type', class: 'select2 fullwidth'})
- if !@object.new_record?
.row
.calculator-settings
= f.fields_for :calculator do |calculator_form|
- preference_fields(@object.calculator, calculator_form).each do |field|
.alpha.four.columns
= field[:label]
.field.twelve.eight.columns
= field[:field]
- if @object.calculator.respond_to?(:preferences)
%span.calculator-settings-warning.info.warning= t(:calculator_settings_warning)
| Change translation for calculator section from Calculator to Fees | Change translation for calculator section from Calculator to Fees
| Haml | agpl-3.0 | mkllnk/openfoodnetwork,mkllnk/openfoodnetwork,openfoodfoundation/openfoodnetwork,openfoodfoundation/openfoodnetwork,mkllnk/openfoodnetwork,openfoodfoundation/openfoodnetwork,mkllnk/openfoodnetwork,openfoodfoundation/openfoodnetwork | haml | ## Code Before:
%fieldset#calculator_fields.no-border-bottom
%legend{align: "center"}= t(:calculator)
#preference-settings
.row
.alpha.four.columns
= f.label(:calculator_type, t(:calculator), for: 'calc_type')
.omega.twelve.columns
= f.select(:calculator_type, @calculators.map { |c| [c.description, c.name] }, {}, {id: 'calc_type', class: 'select2 fullwidth'})
- if !@object.new_record?
.row
.calculator-settings
= f.fields_for :calculator do |calculator_form|
- preference_fields(@object.calculator, calculator_form).each do |field|
.alpha.four.columns
= field[:label]
.field.twelve.eight.columns
= field[:field]
- if @object.calculator.respond_to?(:preferences)
%span.calculator-settings-warning.info.warning= t(:calculator_settings_warning)
## Instruction:
Change translation for calculator section from Calculator to Fees
## Code After:
%fieldset#calculator_fields.no-border-bottom
%legend{align: "center"}= t(:fees)
#preference-settings
.row
.alpha.four.columns
= f.label(:calculator_type, t(:calculator), for: 'calc_type')
.omega.twelve.columns
= f.select(:calculator_type, @calculators.map { |c| [c.description, c.name] }, {}, {id: 'calc_type', class: 'select2 fullwidth'})
- if !@object.new_record?
.row
.calculator-settings
= f.fields_for :calculator do |calculator_form|
- preference_fields(@object.calculator, calculator_form).each do |field|
.alpha.four.columns
= field[:label]
.field.twelve.eight.columns
= field[:field]
- if @object.calculator.respond_to?(:preferences)
%span.calculator-settings-warning.info.warning= t(:calculator_settings_warning)
| %fieldset#calculator_fields.no-border-bottom
- %legend{align: "center"}= t(:calculator)
? ^^^^^^^^^^
+ %legend{align: "center"}= t(:fees)
? ^^^^
#preference-settings
.row
.alpha.four.columns
= f.label(:calculator_type, t(:calculator), for: 'calc_type')
.omega.twelve.columns
= f.select(:calculator_type, @calculators.map { |c| [c.description, c.name] }, {}, {id: 'calc_type', class: 'select2 fullwidth'})
- if !@object.new_record?
.row
.calculator-settings
= f.fields_for :calculator do |calculator_form|
- preference_fields(@object.calculator, calculator_form).each do |field|
.alpha.four.columns
= field[:label]
.field.twelve.eight.columns
= field[:field]
- if @object.calculator.respond_to?(:preferences)
%span.calculator-settings-warning.info.warning= t(:calculator_settings_warning) | 2 | 0.105263 | 1 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.