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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0b845f6beaec8f7ce8e4cd473ed50fe1202b5139 | seabird/qc.py | seabird/qc.py |
import logging
from cotede.qc import ProfileQC
from . import fCNV
from .exceptions import CNVError
class fProfileQC(ProfileQC):
""" Apply ProfileQC from CoTeDe straight from a file.
"""
def __init__(self, inputfile, cfg=None, saveauxiliary=True, verbose=True,
logger=None):
"""
"""
self.logger = logging.getLogger(logger or 'seabird.qc.fProfileQC')
self.name = 'fProfileQC'
try:
# Not the best way, but will work for now. I should pass
# the reference for the logger being used.
profile = fCNV(inputfile, logger=None)
except CNVError as e:
#self.attributes['filename'] = basename(inputfile)
logging.error(e.msg)
raise
super(fProfileQC, self).__init__(profile, cfg=cfg,
saveauxiliary=saveauxiliary, verbose=verbose,
logger=logger)
|
import logging
from os.path import basename
from cotede.qc import ProfileQC
from . import fCNV
from .exceptions import CNVError
class fProfileQC(ProfileQC):
""" Apply ProfileQC from CoTeDe straight from a file.
"""
def __init__(self, inputfile, cfg=None, saveauxiliary=True, verbose=True,
logger=None):
"""
"""
self.logger = logging.getLogger(logger or 'seabird.qc.fProfileQC')
self.name = 'fProfileQC'
try:
# Not the best way, but will work for now. I should pass
# the reference for the logger being used.
profile = fCNV(inputfile, logger=None)
except CNVError as e:
self.attributes['filename'] = basename(inputfile)
logging.error(e.msg)
raise
super(fProfileQC, self).__init__(profile, cfg=cfg,
saveauxiliary=saveauxiliary, verbose=verbose,
logger=logger)
| Add filename in attrs if fails to load it. | Add filename in attrs if fails to load it.
Filename in attrs helps to debug.
| Python | bsd-3-clause | castelao/seabird | python | ## Code Before:
import logging
from cotede.qc import ProfileQC
from . import fCNV
from .exceptions import CNVError
class fProfileQC(ProfileQC):
""" Apply ProfileQC from CoTeDe straight from a file.
"""
def __init__(self, inputfile, cfg=None, saveauxiliary=True, verbose=True,
logger=None):
"""
"""
self.logger = logging.getLogger(logger or 'seabird.qc.fProfileQC')
self.name = 'fProfileQC'
try:
# Not the best way, but will work for now. I should pass
# the reference for the logger being used.
profile = fCNV(inputfile, logger=None)
except CNVError as e:
#self.attributes['filename'] = basename(inputfile)
logging.error(e.msg)
raise
super(fProfileQC, self).__init__(profile, cfg=cfg,
saveauxiliary=saveauxiliary, verbose=verbose,
logger=logger)
## Instruction:
Add filename in attrs if fails to load it.
Filename in attrs helps to debug.
## Code After:
import logging
from os.path import basename
from cotede.qc import ProfileQC
from . import fCNV
from .exceptions import CNVError
class fProfileQC(ProfileQC):
""" Apply ProfileQC from CoTeDe straight from a file.
"""
def __init__(self, inputfile, cfg=None, saveauxiliary=True, verbose=True,
logger=None):
"""
"""
self.logger = logging.getLogger(logger or 'seabird.qc.fProfileQC')
self.name = 'fProfileQC'
try:
# Not the best way, but will work for now. I should pass
# the reference for the logger being used.
profile = fCNV(inputfile, logger=None)
except CNVError as e:
self.attributes['filename'] = basename(inputfile)
logging.error(e.msg)
raise
super(fProfileQC, self).__init__(profile, cfg=cfg,
saveauxiliary=saveauxiliary, verbose=verbose,
logger=logger)
|
import logging
+ from os.path import basename
from cotede.qc import ProfileQC
from . import fCNV
from .exceptions import CNVError
class fProfileQC(ProfileQC):
""" Apply ProfileQC from CoTeDe straight from a file.
"""
def __init__(self, inputfile, cfg=None, saveauxiliary=True, verbose=True,
logger=None):
"""
"""
self.logger = logging.getLogger(logger or 'seabird.qc.fProfileQC')
self.name = 'fProfileQC'
try:
# Not the best way, but will work for now. I should pass
# the reference for the logger being used.
profile = fCNV(inputfile, logger=None)
except CNVError as e:
- #self.attributes['filename'] = basename(inputfile)
? -
+ self.attributes['filename'] = basename(inputfile)
logging.error(e.msg)
raise
super(fProfileQC, self).__init__(profile, cfg=cfg,
saveauxiliary=saveauxiliary, verbose=verbose,
logger=logger) | 3 | 0.1 | 2 | 1 |
dd2c4e0290d32f360b0fb73281ffff45262c9357 | app/assets/javascripts/routes/application_route.coffee | app/assets/javascripts/routes/application_route.coffee | Pancakes.ApplicationRoute = Ember.Route.extend
renderTemplate: (controller, model) ->
@_super(controller, model)
@render 'study_locations',
into: 'application',
outlet: 'studyLocations',
controller: 'studyLocations'
setupController: (controller) ->
@_super(controller)
@controllerFor('studyLocations').setProperties
editable: false
available: Pancakes.StudyLocation.find()
redirect: ->
@transitionTo 'event_searches.new'
# vim:ts=2:sw=2:et:tw=78
| Pancakes.ApplicationRoute = Ember.Route.extend
renderTemplate: (controller, model) ->
@_super(controller, model)
@render 'study_locations',
into: 'application',
outlet: 'studyLocations',
controller: 'studyLocations'
setupController: (controller) ->
@_super(controller)
@controllerFor('studyLocations').setProperties
editable: false
available: Pancakes.StudyLocation.find()
# vim:ts=2:sw=2:et:tw=78
| Revert "Redirect / to /event_searches/new." | Revert "Redirect / to /event_searches/new."
This reverts commit 0de8612155705207d54facc388020df1ceb82141.
The scope of the hook is too broad; it applies to _every_ route below
the application route. A different approach is needed.
| CoffeeScript | mit | NUBIC/ncs_navigator_pancakes,NUBIC/ncs_navigator_pancakes,NUBIC/ncs_navigator_pancakes | coffeescript | ## Code Before:
Pancakes.ApplicationRoute = Ember.Route.extend
renderTemplate: (controller, model) ->
@_super(controller, model)
@render 'study_locations',
into: 'application',
outlet: 'studyLocations',
controller: 'studyLocations'
setupController: (controller) ->
@_super(controller)
@controllerFor('studyLocations').setProperties
editable: false
available: Pancakes.StudyLocation.find()
redirect: ->
@transitionTo 'event_searches.new'
# vim:ts=2:sw=2:et:tw=78
## Instruction:
Revert "Redirect / to /event_searches/new."
This reverts commit 0de8612155705207d54facc388020df1ceb82141.
The scope of the hook is too broad; it applies to _every_ route below
the application route. A different approach is needed.
## Code After:
Pancakes.ApplicationRoute = Ember.Route.extend
renderTemplate: (controller, model) ->
@_super(controller, model)
@render 'study_locations',
into: 'application',
outlet: 'studyLocations',
controller: 'studyLocations'
setupController: (controller) ->
@_super(controller)
@controllerFor('studyLocations').setProperties
editable: false
available: Pancakes.StudyLocation.find()
# vim:ts=2:sw=2:et:tw=78
| Pancakes.ApplicationRoute = Ember.Route.extend
renderTemplate: (controller, model) ->
@_super(controller, model)
@render 'study_locations',
into: 'application',
outlet: 'studyLocations',
controller: 'studyLocations'
setupController: (controller) ->
@_super(controller)
@controllerFor('studyLocations').setProperties
editable: false
available: Pancakes.StudyLocation.find()
- redirect: ->
- @transitionTo 'event_searches.new'
-
# vim:ts=2:sw=2:et:tw=78 | 3 | 0.15 | 0 | 3 |
dbb9792871d9b1d8f1678dbafeed760098547a28 | pdf_parser/pdf_types/compound_types.py | pdf_parser/pdf_types/compound_types.py | from .common import PdfType
class PdfArray(PdfType, list):
def __init__(self, *args, **kwargs):
PdfType.__init__(self)
list.__init__(self, *args, **kwargs)
class PdfDict(PdfType, dict):
def __init__(self, *args, **kwargs):
PdfType.__init__(self)
dict.__init__(self, *args, **kwargs) | from .common import PdfType
class PdfArray(PdfType, list):
def __init__(self, *args, **kwargs):
PdfType.__init__(self)
list.__init__(self, *args, **kwargs)
class PdfDict(PdfType, dict):
def __init__(self, *args, **kwargs):
PdfType.__init__(self)
dict.__init__(self, *args, **kwargs)
def __getattribute__(self, name):
try:
return self[name].parsed_object
except AttributeError:
return self[name]
except KeyError:
raise AttributeError('Object has no attribute "%s"'%name) | Add read-only attribute style access to PdfDict elements with object parsing. | Add read-only attribute style access to PdfDict elements with object parsing.
| Python | mit | ajmarks/gymnast,ajmarks/gymnast | python | ## Code Before:
from .common import PdfType
class PdfArray(PdfType, list):
def __init__(self, *args, **kwargs):
PdfType.__init__(self)
list.__init__(self, *args, **kwargs)
class PdfDict(PdfType, dict):
def __init__(self, *args, **kwargs):
PdfType.__init__(self)
dict.__init__(self, *args, **kwargs)
## Instruction:
Add read-only attribute style access to PdfDict elements with object parsing.
## Code After:
from .common import PdfType
class PdfArray(PdfType, list):
def __init__(self, *args, **kwargs):
PdfType.__init__(self)
list.__init__(self, *args, **kwargs)
class PdfDict(PdfType, dict):
def __init__(self, *args, **kwargs):
PdfType.__init__(self)
dict.__init__(self, *args, **kwargs)
def __getattribute__(self, name):
try:
return self[name].parsed_object
except AttributeError:
return self[name]
except KeyError:
raise AttributeError('Object has no attribute "%s"'%name) | from .common import PdfType
class PdfArray(PdfType, list):
def __init__(self, *args, **kwargs):
PdfType.__init__(self)
list.__init__(self, *args, **kwargs)
class PdfDict(PdfType, dict):
def __init__(self, *args, **kwargs):
PdfType.__init__(self)
dict.__init__(self, *args, **kwargs)
+
+ def __getattribute__(self, name):
+ try:
+ return self[name].parsed_object
+ except AttributeError:
+ return self[name]
+ except KeyError:
+ raise AttributeError('Object has no attribute "%s"'%name) | 8 | 0.727273 | 8 | 0 |
d04ca0f22c449df794c238e920fb83f3e431b6fe | src/components/TransactionalBehavior.php | src/components/TransactionalBehavior.php | <?php
namespace vr\core\components;
use Yii;
use yii\base\Action;
use yii\base\ActionFilter;
use yii\db\Exception;
use yii\db\Transaction;
/**
* Class TransactionalBehavior
* @package vr\core\components
*/
class TransactionalBehavior extends ActionFilter
{
/**
* @var string|null
*/
public ?string $isolationLevel = null;
/**
* @var Transaction|null
*/
private ?Transaction $_transaction = null;
/**
* @param Action $action
* @return bool
*/
public function beforeAction($action)
{
if (Yii::$app->get('db', false)) {
$this->_transaction = Yii::$app->db->transaction ?: Yii::$app->db->beginTransaction($this->isolationLevel);
}
return parent::beforeAction($action);
}
/**
* @param Action $action
* @param mixed $result
* @return mixed
* @throws Exception
*/
public function afterAction($action, $result)
{
if ($this->_transaction) {
$this->_transaction->commit();
}
return parent::afterAction($action, $result);
}
} | <?php
namespace vr\core\components;
use Yii;
use yii\base\Action;
use yii\base\ActionFilter;
use yii\base\InvalidConfigException;
use yii\db\Exception;
use yii\db\Transaction;
/**
* Class TransactionalBehavior
* @package vr\core\components
*/
class TransactionalBehavior extends ActionFilter
{
/**
* @var string|null
*/
public ?string $isolationLevel = null;
/**
* @var string|array
*/
public $db = 'db';
/**
* @var Transaction[]
*/
private array $_transactions = [];
/**
* @param Action $action
* @return bool
* @throws InvalidConfigException
*/
public function beforeAction($action): bool
{
$configs = is_array($this->db) ? $this->db : [$this->db];
foreach ($configs as $config) {
if (Yii::$app->get($config, false)) {
$this->_transactions[] = Yii::$app->get($config)->transaction ?: Yii::$app->get($config)->beginTransaction($this->isolationLevel);
}
}
return parent::beforeAction($action);
}
/**
* @param Action $action
* @param mixed $result
* @return mixed
* @throws Exception
*/
public function afterAction($action, $result)
{
if ($this->_transactions) {
foreach ($this->_transactions as $transaction)
$transaction->commit();
}
return parent::afterAction($action, $result);
}
} | Support few databases for transactional behavior | Support few databases for transactional behavior
| PHP | mit | voodoo-rocks/yii2-core,voodoo-mobile/yii2-core | php | ## Code Before:
<?php
namespace vr\core\components;
use Yii;
use yii\base\Action;
use yii\base\ActionFilter;
use yii\db\Exception;
use yii\db\Transaction;
/**
* Class TransactionalBehavior
* @package vr\core\components
*/
class TransactionalBehavior extends ActionFilter
{
/**
* @var string|null
*/
public ?string $isolationLevel = null;
/**
* @var Transaction|null
*/
private ?Transaction $_transaction = null;
/**
* @param Action $action
* @return bool
*/
public function beforeAction($action)
{
if (Yii::$app->get('db', false)) {
$this->_transaction = Yii::$app->db->transaction ?: Yii::$app->db->beginTransaction($this->isolationLevel);
}
return parent::beforeAction($action);
}
/**
* @param Action $action
* @param mixed $result
* @return mixed
* @throws Exception
*/
public function afterAction($action, $result)
{
if ($this->_transaction) {
$this->_transaction->commit();
}
return parent::afterAction($action, $result);
}
}
## Instruction:
Support few databases for transactional behavior
## Code After:
<?php
namespace vr\core\components;
use Yii;
use yii\base\Action;
use yii\base\ActionFilter;
use yii\base\InvalidConfigException;
use yii\db\Exception;
use yii\db\Transaction;
/**
* Class TransactionalBehavior
* @package vr\core\components
*/
class TransactionalBehavior extends ActionFilter
{
/**
* @var string|null
*/
public ?string $isolationLevel = null;
/**
* @var string|array
*/
public $db = 'db';
/**
* @var Transaction[]
*/
private array $_transactions = [];
/**
* @param Action $action
* @return bool
* @throws InvalidConfigException
*/
public function beforeAction($action): bool
{
$configs = is_array($this->db) ? $this->db : [$this->db];
foreach ($configs as $config) {
if (Yii::$app->get($config, false)) {
$this->_transactions[] = Yii::$app->get($config)->transaction ?: Yii::$app->get($config)->beginTransaction($this->isolationLevel);
}
}
return parent::beforeAction($action);
}
/**
* @param Action $action
* @param mixed $result
* @return mixed
* @throws Exception
*/
public function afterAction($action, $result)
{
if ($this->_transactions) {
foreach ($this->_transactions as $transaction)
$transaction->commit();
}
return parent::afterAction($action, $result);
}
} | <?php
namespace vr\core\components;
use Yii;
use yii\base\Action;
use yii\base\ActionFilter;
+ use yii\base\InvalidConfigException;
use yii\db\Exception;
use yii\db\Transaction;
/**
* Class TransactionalBehavior
* @package vr\core\components
*/
class TransactionalBehavior extends ActionFilter
{
/**
* @var string|null
*/
public ?string $isolationLevel = null;
/**
- * @var Transaction|null
+ * @var string|array
*/
+ public $db = 'db';
+
+ /**
+ * @var Transaction[]
+ */
- private ?Transaction $_transaction = null;
? ^^ ^^^^^^^^ ^^^^
+ private array $_transactions = [];
? ^^ ^ + ^^
/**
* @param Action $action
* @return bool
+ * @throws InvalidConfigException
*/
- public function beforeAction($action)
+ public function beforeAction($action): bool
? ++++++
{
+ $configs = is_array($this->db) ? $this->db : [$this->db];
+
+ foreach ($configs as $config) {
- if (Yii::$app->get('db', false)) {
? ^^^^
+ if (Yii::$app->get($config, false)) {
? ++++ ^^^^^^^
- $this->_transaction = Yii::$app->db->transaction ?: Yii::$app->db->beginTransaction($this->isolationLevel);
? ^^ ^^
+ $this->_transactions[] = Yii::$app->get($config)->transaction ?: Yii::$app->get($config)->beginTransaction($this->isolationLevel);
? ++++ +++ ^^^^^^^^^^^^ ^^^^^^^^^^^^
+ }
}
-
+
+
return parent::beforeAction($action);
}
/**
* @param Action $action
* @param mixed $result
* @return mixed
* @throws Exception
*/
public function afterAction($action, $result)
{
- if ($this->_transaction) {
+ if ($this->_transactions) {
? +
+ foreach ($this->_transactions as $transaction)
- $this->_transaction->commit();
? -------
+ $transaction->commit();
? ++++
}
return parent::afterAction($action, $result);
}
} | 29 | 0.517857 | 21 | 8 |
8fb87f2d5b6e93f8c0f75ad77185adf9978cbbbe | README.md | README.md | This repository contains all the code from the article Testing user interfaces with browser automation.
# Setup
Download the ZIP of this project (or do a git pull). If you don't have [Nightwatch](http://nightwatchjs.org/) installed, you can install it with
npm install nightwatch -g
To run the browser tests, navigate to this project in your Node console and run
nightwatch -t tests/[name-of-test]
where `[name-of-test]` can be `searchExample`, `BMICalculator`, or `asyncExample`.
# Contributing
Feel free to open an issue or add a pull request if you have any improvements to suggest. | This repository contains all the code from the article Testing user interfaces with browser automation.
# Setup
Download the ZIP of this project (or do a git pull). If you don't have [Nightwatch](http://nightwatchjs.org/) installed, you can install it with
npm install nightwatch -g
You'll need to [download the selenium server standalone jar file](http://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.0.jar) and place it in the `bin` folder.
To run the browser tests, navigate to this project in your Node console and run
nightwatch -t tests/[name-of-test]
where `[name-of-test]` can be `searchExample`, `BMICalculator`, or `asyncExample`.
# Contributing
Feel free to open an issue or add a pull request if you have any improvements to suggest. | Add download link to selenium jar | Add download link to selenium jar
| Markdown | unlicense | peterolson/Testing-user-interfaces-with-browser-automation,peterolson/Testing-user-interfaces-with-browser-automation | markdown | ## Code Before:
This repository contains all the code from the article Testing user interfaces with browser automation.
# Setup
Download the ZIP of this project (or do a git pull). If you don't have [Nightwatch](http://nightwatchjs.org/) installed, you can install it with
npm install nightwatch -g
To run the browser tests, navigate to this project in your Node console and run
nightwatch -t tests/[name-of-test]
where `[name-of-test]` can be `searchExample`, `BMICalculator`, or `asyncExample`.
# Contributing
Feel free to open an issue or add a pull request if you have any improvements to suggest.
## Instruction:
Add download link to selenium jar
## Code After:
This repository contains all the code from the article Testing user interfaces with browser automation.
# Setup
Download the ZIP of this project (or do a git pull). If you don't have [Nightwatch](http://nightwatchjs.org/) installed, you can install it with
npm install nightwatch -g
You'll need to [download the selenium server standalone jar file](http://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.0.jar) and place it in the `bin` folder.
To run the browser tests, navigate to this project in your Node console and run
nightwatch -t tests/[name-of-test]
where `[name-of-test]` can be `searchExample`, `BMICalculator`, or `asyncExample`.
# Contributing
Feel free to open an issue or add a pull request if you have any improvements to suggest. | This repository contains all the code from the article Testing user interfaces with browser automation.
# Setup
Download the ZIP of this project (or do a git pull). If you don't have [Nightwatch](http://nightwatchjs.org/) installed, you can install it with
npm install nightwatch -g
+
+ You'll need to [download the selenium server standalone jar file](http://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.0.jar) and place it in the `bin` folder.
To run the browser tests, navigate to this project in your Node console and run
nightwatch -t tests/[name-of-test]
where `[name-of-test]` can be `searchExample`, `BMICalculator`, or `asyncExample`.
# Contributing
Feel free to open an issue or add a pull request if you have any improvements to suggest. | 2 | 0.117647 | 2 | 0 |
4946cd67d00334b629d8ebc293e48ebb4838386e | .travis.yml | .travis.yml | language: python
cache: pip
python:
- 2.7
- 3.5
- 3.6
install:
- pip install tox-travis
- pip install .
script:
- ros-get -h
- tox
| sudo: false
dist: trusty
language: python
cache: pip
python:
- 2.7
- 3.5
- 3.6
install:
- pip install tox-travis
- pip install .
script:
- ros-get -h
- tox
| Switch to the container based Travis CI environment | Switch to the container based Travis CI environment
| YAML | mit | Rayman/ros-get,Rayman/ros-get | yaml | ## Code Before:
language: python
cache: pip
python:
- 2.7
- 3.5
- 3.6
install:
- pip install tox-travis
- pip install .
script:
- ros-get -h
- tox
## Instruction:
Switch to the container based Travis CI environment
## Code After:
sudo: false
dist: trusty
language: python
cache: pip
python:
- 2.7
- 3.5
- 3.6
install:
- pip install tox-travis
- pip install .
script:
- ros-get -h
- tox
| + sudo: false
+ dist: trusty
language: python
cache: pip
python:
- 2.7
- 3.5
- 3.6
install:
- pip install tox-travis
- pip install .
script:
- ros-get -h
- tox | 2 | 0.166667 | 2 | 0 |
8e4869c31c6fa34ad0838c85ab5c1839fd807ba9 | src/less/modules/doubtfire-logo.less | src/less/modules/doubtfire-logo.less | @doubtfire-color: #da532c;
h1.logo {
font-weight: lighter;
letter-spacing: -1px;
font-size: 4em;
small {
font-weight: lighter;
text-align: right;
font-size: 0.5em;
}
&.full.logo small {
display: block;
}
&.sup.logo small {
vertical-align: super;
margin-left: 0.5ex;
color: #999;
}
}
i.logo {
display: inline-block;
width: 1em;
height: 1em;
background-color: @doubtfire-color;
background-image: url('/assets/images/doubtfire-logo-person-white.svg');
background-size: 100%;
background-repeat: no-repeat;
background-position: center;
border-radius: 10%;
}
i.logo + h1.logo {
margin-left: 1ex;
display: inline-block;
}
a:hover > i.logo {
background-color: lighten(@doubtfire-color, 10%);
} | @doubtfire-color: #da532c;
.apply-logo-font-rendering {
-webkit-font-smoothing: antialiased;
letter-spacing: -1px;
font-weight: 300;
}
h1.logo {
.apply-logo-font-rendering;
font-size: 4em;
}
i.logo {
display: inline-block;
width: 1em;
height: 1em;
background-color: @doubtfire-color;
background-image: url('/assets/images/doubtfire-logo-person-white.svg');
background-size: 100%;
background-repeat: no-repeat;
background-position: center;
border-radius: 10%;
}
a:hover > i.logo {
background-color: lighten(@doubtfire-color, 10%);
}
.welcome-to-doubtfire {
margin-top: 6em;
margin-bottom: 3em;
h1, p {
.apply-logo-font-rendering;
}
p.lead {
color: #666;
}
i.logo {
width: 10em;
height: 10em;
}
}
| Improve looks of doubfire logo font rendering | LOOKS: Improve looks of doubfire logo font rendering
| Less | agpl-3.0 | final-year-project/doubtfire-web,doubtfire-lms/doubtfire-web,doubtfire-lms/doubtfire-web,doubtfire-lms/doubtfire-web,alexcu/doubtfire-web,doubtfire-lms/doubtfire-web,final-year-project/doubtfire-web,alexcu/doubtfire-web | less | ## Code Before:
@doubtfire-color: #da532c;
h1.logo {
font-weight: lighter;
letter-spacing: -1px;
font-size: 4em;
small {
font-weight: lighter;
text-align: right;
font-size: 0.5em;
}
&.full.logo small {
display: block;
}
&.sup.logo small {
vertical-align: super;
margin-left: 0.5ex;
color: #999;
}
}
i.logo {
display: inline-block;
width: 1em;
height: 1em;
background-color: @doubtfire-color;
background-image: url('/assets/images/doubtfire-logo-person-white.svg');
background-size: 100%;
background-repeat: no-repeat;
background-position: center;
border-radius: 10%;
}
i.logo + h1.logo {
margin-left: 1ex;
display: inline-block;
}
a:hover > i.logo {
background-color: lighten(@doubtfire-color, 10%);
}
## Instruction:
LOOKS: Improve looks of doubfire logo font rendering
## Code After:
@doubtfire-color: #da532c;
.apply-logo-font-rendering {
-webkit-font-smoothing: antialiased;
letter-spacing: -1px;
font-weight: 300;
}
h1.logo {
.apply-logo-font-rendering;
font-size: 4em;
}
i.logo {
display: inline-block;
width: 1em;
height: 1em;
background-color: @doubtfire-color;
background-image: url('/assets/images/doubtfire-logo-person-white.svg');
background-size: 100%;
background-repeat: no-repeat;
background-position: center;
border-radius: 10%;
}
a:hover > i.logo {
background-color: lighten(@doubtfire-color, 10%);
}
.welcome-to-doubtfire {
margin-top: 6em;
margin-bottom: 3em;
h1, p {
.apply-logo-font-rendering;
}
p.lead {
color: #666;
}
i.logo {
width: 10em;
height: 10em;
}
}
| @doubtfire-color: #da532c;
+ .apply-logo-font-rendering {
+ -webkit-font-smoothing: antialiased;
+ letter-spacing: -1px;
+ font-weight: 300;
+ }
+
h1.logo {
+ .apply-logo-font-rendering;
- font-weight: lighter;
- letter-spacing: -1px;
font-size: 4em;
- small {
- font-weight: lighter;
- text-align: right;
- font-size: 0.5em;
- }
- &.full.logo small {
- display: block;
- }
- &.sup.logo small {
- vertical-align: super;
- margin-left: 0.5ex;
- color: #999;
- }
}
i.logo {
display: inline-block;
width: 1em;
height: 1em;
background-color: @doubtfire-color;
background-image: url('/assets/images/doubtfire-logo-person-white.svg');
background-size: 100%;
background-repeat: no-repeat;
background-position: center;
border-radius: 10%;
}
- i.logo + h1.logo {
- margin-left: 1ex;
- display: inline-block;
- }
-
a:hover > i.logo {
background-color: lighten(@doubtfire-color, 10%);
}
+
+ .welcome-to-doubtfire {
+ margin-top: 6em;
+ margin-bottom: 3em;
+ h1, p {
+ .apply-logo-font-rendering;
+ }
+ p.lead {
+ color: #666;
+ }
+ i.logo {
+ width: 10em;
+ height: 10em;
+ }
+ } | 42 | 1.05 | 22 | 20 |
df46fac2b03b9a3924b77cdced34aca94c3d910e | README.md | README.md | A set of class that extends the functionality of FuelPHP without affecting the standard workflow when the application doesn't actually utilize Hybrid feature.
## Contributors
* Mior Muhammad Zaki
* Arif Azraai
## Documentation
Fuel Hybrid documentation is available at <http://codenitive.github.com/fuel-hybrid> and included on each download archive. | A set of class that extends the functionality of FuelPHP without affecting the standard workflow when the application doesn't actually utilize Hybrid feature.
## Contributors
* Mior Muhammad Zaki
* Arif Azraai
* Ignacio Muñoz Fernandez
## Documentation
Fuel Hybrid documentation is available at <http://codenitive.github.com/fuel-hybrid> and included on each download archive. | Add kavinsky to contributor list | Add kavinsky to contributor list
| Markdown | mit | codenitive/fuel-hybrid,codenitive/fuel-hybrid | markdown | ## Code Before:
A set of class that extends the functionality of FuelPHP without affecting the standard workflow when the application doesn't actually utilize Hybrid feature.
## Contributors
* Mior Muhammad Zaki
* Arif Azraai
## Documentation
Fuel Hybrid documentation is available at <http://codenitive.github.com/fuel-hybrid> and included on each download archive.
## Instruction:
Add kavinsky to contributor list
## Code After:
A set of class that extends the functionality of FuelPHP without affecting the standard workflow when the application doesn't actually utilize Hybrid feature.
## Contributors
* Mior Muhammad Zaki
* Arif Azraai
* Ignacio Muñoz Fernandez
## Documentation
Fuel Hybrid documentation is available at <http://codenitive.github.com/fuel-hybrid> and included on each download archive. | A set of class that extends the functionality of FuelPHP without affecting the standard workflow when the application doesn't actually utilize Hybrid feature.
## Contributors
* Mior Muhammad Zaki
* Arif Azraai
+ * Ignacio Muñoz Fernandez
## Documentation
Fuel Hybrid documentation is available at <http://codenitive.github.com/fuel-hybrid> and included on each download archive. | 1 | 0.1 | 1 | 0 |
37e8537c5d5aba2b9b090f47e4284e1ee9725973 | README.md | README.md | MYBATIS Data Mapper Framework
=============================
[](https://travis-ci.org/mybatis/mybatis-3)
[](https://maven-badges.herokuapp.com/maven-central/org.mybatis/mybatis)
[](http://www.apache.org/licenses/LICENSE-2.0)

The MyBatis data mapper framework makes it easier to use a relational database with object-oriented applications.
MyBatis couples objects with stored procedures or SQL statements using a XML descriptor or annotations.
Simplicity is the biggest advantage of the MyBatis data mapper over object relational mapping tools.
Essentials
----------
* [See the docs](http://mybatis.github.io/mybatis-3)
* [Download Latest](https://github.com/mybatis/mybatis-3/releases)
| MYBATIS Data Mapper Framework
=============================
[](https://travis-ci.org/mybatis/mybatis-3)
[](https://coveralls.io/github/mybatis/mybatis-3?branch=master)
[](https://www.versioneye.com/user/projects/56199c04a193340f320005d3)
[](https://maven-badges.herokuapp.com/maven-central/org.mybatis/mybatis)
[](http://www.apache.org/licenses/LICENSE-2.0)

The MyBatis data mapper framework makes it easier to use a relational database with object-oriented applications.
MyBatis couples objects with stored procedures or SQL statements using a XML descriptor or annotations.
Simplicity is the biggest advantage of the MyBatis data mapper over object relational mapping tools.
Essentials
----------
* [See the docs](http://mybatis.github.io/mybatis-3)
* [Download Latest](https://github.com/mybatis/mybatis-3/releases)
| Add coverage and dependency badges | [readme] Add coverage and dependency badges
| Markdown | apache-2.0 | harawata/mybatis-3,mybatis/mybatis-3,hazendaz/mybatis-3,lknny/mybatis-3,VioletLife/mybatis-3,nyer/mybatis-3,fromm0/mybatis-3,langlan/mybatis-3,fromm0/mybatis-3,nyer/mybatis-3,zhangwei5095/mybatis3-annotaion,VioletLife/mybatis-3,jackgao2016/mybatis-3_site,wuwen5/mybatis-3,harawata/mybatis-3,jackgao2016/mybatis-3_site,raupachz/mybatis-3 | markdown | ## Code Before:
MYBATIS Data Mapper Framework
=============================
[](https://travis-ci.org/mybatis/mybatis-3)
[](https://maven-badges.herokuapp.com/maven-central/org.mybatis/mybatis)
[](http://www.apache.org/licenses/LICENSE-2.0)

The MyBatis data mapper framework makes it easier to use a relational database with object-oriented applications.
MyBatis couples objects with stored procedures or SQL statements using a XML descriptor or annotations.
Simplicity is the biggest advantage of the MyBatis data mapper over object relational mapping tools.
Essentials
----------
* [See the docs](http://mybatis.github.io/mybatis-3)
* [Download Latest](https://github.com/mybatis/mybatis-3/releases)
## Instruction:
[readme] Add coverage and dependency badges
## Code After:
MYBATIS Data Mapper Framework
=============================
[](https://travis-ci.org/mybatis/mybatis-3)
[](https://coveralls.io/github/mybatis/mybatis-3?branch=master)
[](https://www.versioneye.com/user/projects/56199c04a193340f320005d3)
[](https://maven-badges.herokuapp.com/maven-central/org.mybatis/mybatis)
[](http://www.apache.org/licenses/LICENSE-2.0)

The MyBatis data mapper framework makes it easier to use a relational database with object-oriented applications.
MyBatis couples objects with stored procedures or SQL statements using a XML descriptor or annotations.
Simplicity is the biggest advantage of the MyBatis data mapper over object relational mapping tools.
Essentials
----------
* [See the docs](http://mybatis.github.io/mybatis-3)
* [Download Latest](https://github.com/mybatis/mybatis-3/releases)
| MYBATIS Data Mapper Framework
=============================
[](https://travis-ci.org/mybatis/mybatis-3)
+ [](https://coveralls.io/github/mybatis/mybatis-3?branch=master)
+ [](https://www.versioneye.com/user/projects/56199c04a193340f320005d3)
[](https://maven-badges.herokuapp.com/maven-central/org.mybatis/mybatis)
[](http://www.apache.org/licenses/LICENSE-2.0)

The MyBatis data mapper framework makes it easier to use a relational database with object-oriented applications.
MyBatis couples objects with stored procedures or SQL statements using a XML descriptor or annotations.
Simplicity is the biggest advantage of the MyBatis data mapper over object relational mapping tools.
Essentials
----------
* [See the docs](http://mybatis.github.io/mybatis-3)
* [Download Latest](https://github.com/mybatis/mybatis-3/releases) | 2 | 0.111111 | 2 | 0 |
2c140d48019e52bc03c4984d4b34c9df369501bf | packages/ff/fficxx.yaml | packages/ff/fficxx.yaml | homepage: ''
changelog-type: ''
hash: 8aadf5449302ecaca2772f5dfa1e8aedf72fe7a4760fec89a6ed6c17d440f666
test-bench-deps: {}
maintainer: Ian-Woo Kim <ianwookim@gmail.com>
synopsis: automatic C++ binding generation
changelog: ''
basic-deps:
either: -any
bytestring: -any
split: -any
Cabal: -any
base: ==4.*
unordered-containers: -any
text: -any
filepath: ! '>1'
process: -any
pureMD5: -any
data-default: -any
containers: -any
haskell-src-exts: -any
lens: ! '>3'
mtl: ! '>2'
hashable: -any
template: -any
transformers: ! '>=0.3'
errors: -any
template-haskell: -any
directory: -any
all-versions:
- '0.1'
- '0.1.0'
- '0.2'
- '0.2.1'
- '0.3'
- '0.3.1'
author: Ian-Woo Kim
latest: '0.3.1'
description-type: haddock
description: automatic C++ binding generation
license-name: BSD3
| homepage: ''
changelog-type: ''
hash: eb8f534a4b793998f391dce6705b08edb8d91f11e18f1dbff7045c41edec6456
test-bench-deps: {}
maintainer: Ian-Woo Kim <ianwookim@gmail.com>
synopsis: automatic C++ binding generation
changelog: ''
basic-deps:
either: -any
bytestring: -any
split: -any
Cabal: -any
base: ==4.*
unordered-containers: -any
text: -any
filepath: ! '>1'
process: -any
pureMD5: -any
data-default: -any
containers: -any
haskell-src-exts: ! '>=1.18'
lens: ! '>3'
mtl: ! '>2'
hashable: -any
template: -any
transformers: ! '>=0.3'
errors: -any
template-haskell: -any
directory: -any
all-versions:
- '0.1'
- '0.1.0'
- '0.2'
- '0.2.1'
- '0.3'
- '0.3.1'
- '0.4'
author: Ian-Woo Kim
latest: '0.4'
description-type: haddock
description: automatic C++ binding generation
license-name: BSD3
| Update from Hackage at 2018-06-24T19:20:56Z | Update from Hackage at 2018-06-24T19:20:56Z
| YAML | mit | commercialhaskell/all-cabal-metadata | yaml | ## Code Before:
homepage: ''
changelog-type: ''
hash: 8aadf5449302ecaca2772f5dfa1e8aedf72fe7a4760fec89a6ed6c17d440f666
test-bench-deps: {}
maintainer: Ian-Woo Kim <ianwookim@gmail.com>
synopsis: automatic C++ binding generation
changelog: ''
basic-deps:
either: -any
bytestring: -any
split: -any
Cabal: -any
base: ==4.*
unordered-containers: -any
text: -any
filepath: ! '>1'
process: -any
pureMD5: -any
data-default: -any
containers: -any
haskell-src-exts: -any
lens: ! '>3'
mtl: ! '>2'
hashable: -any
template: -any
transformers: ! '>=0.3'
errors: -any
template-haskell: -any
directory: -any
all-versions:
- '0.1'
- '0.1.0'
- '0.2'
- '0.2.1'
- '0.3'
- '0.3.1'
author: Ian-Woo Kim
latest: '0.3.1'
description-type: haddock
description: automatic C++ binding generation
license-name: BSD3
## Instruction:
Update from Hackage at 2018-06-24T19:20:56Z
## Code After:
homepage: ''
changelog-type: ''
hash: eb8f534a4b793998f391dce6705b08edb8d91f11e18f1dbff7045c41edec6456
test-bench-deps: {}
maintainer: Ian-Woo Kim <ianwookim@gmail.com>
synopsis: automatic C++ binding generation
changelog: ''
basic-deps:
either: -any
bytestring: -any
split: -any
Cabal: -any
base: ==4.*
unordered-containers: -any
text: -any
filepath: ! '>1'
process: -any
pureMD5: -any
data-default: -any
containers: -any
haskell-src-exts: ! '>=1.18'
lens: ! '>3'
mtl: ! '>2'
hashable: -any
template: -any
transformers: ! '>=0.3'
errors: -any
template-haskell: -any
directory: -any
all-versions:
- '0.1'
- '0.1.0'
- '0.2'
- '0.2.1'
- '0.3'
- '0.3.1'
- '0.4'
author: Ian-Woo Kim
latest: '0.4'
description-type: haddock
description: automatic C++ binding generation
license-name: BSD3
| homepage: ''
changelog-type: ''
- hash: 8aadf5449302ecaca2772f5dfa1e8aedf72fe7a4760fec89a6ed6c17d440f666
+ hash: eb8f534a4b793998f391dce6705b08edb8d91f11e18f1dbff7045c41edec6456
test-bench-deps: {}
maintainer: Ian-Woo Kim <ianwookim@gmail.com>
synopsis: automatic C++ binding generation
changelog: ''
basic-deps:
either: -any
bytestring: -any
split: -any
Cabal: -any
base: ==4.*
unordered-containers: -any
text: -any
filepath: ! '>1'
process: -any
pureMD5: -any
data-default: -any
containers: -any
- haskell-src-exts: -any
+ haskell-src-exts: ! '>=1.18'
lens: ! '>3'
mtl: ! '>2'
hashable: -any
template: -any
transformers: ! '>=0.3'
errors: -any
template-haskell: -any
directory: -any
all-versions:
- '0.1'
- '0.1.0'
- '0.2'
- '0.2.1'
- '0.3'
- '0.3.1'
+ - '0.4'
author: Ian-Woo Kim
- latest: '0.3.1'
? ^^^
+ latest: '0.4'
? ^
description-type: haddock
description: automatic C++ binding generation
license-name: BSD3 | 7 | 0.170732 | 4 | 3 |
db0921e0242d478d29115179b9da2ffcd3fa35fb | micromanager/resources/__init__.py | micromanager/resources/__init__.py | from .base import ResourceBase # noqa F401
from .bucket import Bucket # noqa F401
from .sql import SQLInstance # noqa F401
from .bigquery import BQDataset # noqa F401
class Resource():
@staticmethod
def factory(resource_data):
resource_kind_map = {
'storage#bucket': Bucket,
'bigquery#dataset': BQDataset,
'sql#instance': SQLInstance
}
kind = resource_data.get('resource_kind')
if not kind:
assert 0, 'Unrecognized resource'
if kind not in resource_kind_map:
assert 0, 'Unrecognized resource'
cls = resource_kind_map.get(kind)
return cls(resource_data)
| from .base import ResourceBase # noqa F401
from .bucket import Bucket # noqa F401
from .sql import SQLInstance # noqa F401
from .bigquery import BQDataset # noqa F401
class Resource():
@staticmethod
def factory(resource_data, **kargs):
resource_kind_map = {
'storage#bucket': Bucket,
'bigquery#dataset': BQDataset,
'sql#instance': SQLInstance
}
kind = resource_data.get('resource_kind')
if not kind:
assert 0, 'Unrecognized resource'
if kind not in resource_kind_map:
assert 0, 'Unrecognized resource'
cls = resource_kind_map.get(kind)
return cls(resource_data, **kargs)
| Allow kargs in resource factory | Allow kargs in resource factory
| Python | apache-2.0 | forseti-security/resource-policy-evaluation-library | python | ## Code Before:
from .base import ResourceBase # noqa F401
from .bucket import Bucket # noqa F401
from .sql import SQLInstance # noqa F401
from .bigquery import BQDataset # noqa F401
class Resource():
@staticmethod
def factory(resource_data):
resource_kind_map = {
'storage#bucket': Bucket,
'bigquery#dataset': BQDataset,
'sql#instance': SQLInstance
}
kind = resource_data.get('resource_kind')
if not kind:
assert 0, 'Unrecognized resource'
if kind not in resource_kind_map:
assert 0, 'Unrecognized resource'
cls = resource_kind_map.get(kind)
return cls(resource_data)
## Instruction:
Allow kargs in resource factory
## Code After:
from .base import ResourceBase # noqa F401
from .bucket import Bucket # noqa F401
from .sql import SQLInstance # noqa F401
from .bigquery import BQDataset # noqa F401
class Resource():
@staticmethod
def factory(resource_data, **kargs):
resource_kind_map = {
'storage#bucket': Bucket,
'bigquery#dataset': BQDataset,
'sql#instance': SQLInstance
}
kind = resource_data.get('resource_kind')
if not kind:
assert 0, 'Unrecognized resource'
if kind not in resource_kind_map:
assert 0, 'Unrecognized resource'
cls = resource_kind_map.get(kind)
return cls(resource_data, **kargs)
| from .base import ResourceBase # noqa F401
from .bucket import Bucket # noqa F401
from .sql import SQLInstance # noqa F401
from .bigquery import BQDataset # noqa F401
class Resource():
@staticmethod
- def factory(resource_data):
+ def factory(resource_data, **kargs):
? +++++++++
resource_kind_map = {
'storage#bucket': Bucket,
'bigquery#dataset': BQDataset,
'sql#instance': SQLInstance
}
kind = resource_data.get('resource_kind')
if not kind:
assert 0, 'Unrecognized resource'
if kind not in resource_kind_map:
assert 0, 'Unrecognized resource'
cls = resource_kind_map.get(kind)
- return cls(resource_data)
+ return cls(resource_data, **kargs)
? +++++++++
| 4 | 0.16 | 2 | 2 |
df5189eb4c73b9d6a6f2f2163e90c973771c1ca7 | init_db.sql | init_db.sql | DROP TABLE measurements;
CREATE TABLE measurements (
id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
time_stamp DATETIME,
stroom_dal FLOAT,
stroom_piek FLOAT,
stroom_current FLOAT,
gas FLOAT,
diff_stroom_dal FLOAT,
diff_stroom_piek FLOAT,
diff_gas FLOAT
);
| DROP TABLE measurements;
CREATE TABLE measurements (
id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
time_stamp DATETIME,
stroom_dal FLOAT,
stroom_piek FLOAT,
stroom_current FLOAT,
gas FLOAT,
diff_stroom_dal FLOAT,
diff_stroom_piek FLOAT,
diff_gas FLOAT
);
CREATE INDEX measurement_time_index ON measurements(time_stamp);
| Add index to measurements time_stamp. | Add index to measurements time_stamp.
| SQL | mit | lmeijvogel/meter-reader-api | sql | ## Code Before:
DROP TABLE measurements;
CREATE TABLE measurements (
id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
time_stamp DATETIME,
stroom_dal FLOAT,
stroom_piek FLOAT,
stroom_current FLOAT,
gas FLOAT,
diff_stroom_dal FLOAT,
diff_stroom_piek FLOAT,
diff_gas FLOAT
);
## Instruction:
Add index to measurements time_stamp.
## Code After:
DROP TABLE measurements;
CREATE TABLE measurements (
id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
time_stamp DATETIME,
stroom_dal FLOAT,
stroom_piek FLOAT,
stroom_current FLOAT,
gas FLOAT,
diff_stroom_dal FLOAT,
diff_stroom_piek FLOAT,
diff_gas FLOAT
);
CREATE INDEX measurement_time_index ON measurements(time_stamp);
| DROP TABLE measurements;
CREATE TABLE measurements (
id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
time_stamp DATETIME,
stroom_dal FLOAT,
stroom_piek FLOAT,
stroom_current FLOAT,
gas FLOAT,
diff_stroom_dal FLOAT,
diff_stroom_piek FLOAT,
diff_gas FLOAT
);
+
+ CREATE INDEX measurement_time_index ON measurements(time_stamp); | 2 | 0.142857 | 2 | 0 |
a2aa83a9daf56518f7d4b378985979535e9fa2ad | app.rb | app.rb | require 'sinatra'
require 'sinatra/activerecord'
require './config/environments'
require './models/user'
enable :sessions
get '/' do
erb :index
end
get '/login' do
erb :login
end
post '/login/submit' do
user = User.find_by(email: params["email"], password: params["password"])
if user.nil?
# loggin failed page
else
session[:id] = user.id
redirect '/home'
end
end
get '/user/register' do
erb :register, :locals=>{:message => nil}
end
# routes that need authorization
get '/home' do
if sesssion[:id].nil?
redirect '/login'
end
@user = User.find(session[:id])
if @user.nil?
redirect '/login'
else
erb :home
end
end
post '/user/register' do
@user = User.new(params[:user])
@existing = User.where("username = ?", params[:user][:username])
if @existing.count != 0
erb :register, :locals=>{:message =>
"Account already exists! Try a new username or log back in!"}
elsif @user.save
redirect '/user/register/success'
else
"Sorry, there was an error"
end
end
get '/user/register/success' do
erb :register_success
end
| require 'sinatra'
require 'sinatra/activerecord'
require './config/environments'
require './models/user'
enable :sessions
get '/' do
erb :index
end
get '/login' do
erb :login
end
post '/login/submit' do
user = User.find_by(email: params["email"], password: params["password"])
if user.nil?
# loggin failed page
else
session[:id] = user.id
redirect '/home'
end
end
get '/user/register' do
erb :register, :locals=>{:message => nil}
end
# routes that need authorization
get '/home' do
if sesssion[:id].nil?
redirect '/login'
end
@user = User.find(session[:id])
if @user.nil?
redirect '/login'
else
erb :home
end
end
post '/user/register' do
@user = User.new(params[:user])
@existing = User.where("username = ?", params[:user][:username])
if @existing.count != 0
erb :register, :locals=>{:message =>
"Account already exists! Try a new username or log back in!"}
elsif @user.save
redirect '/user/register/success'
else
"Sorry our server died..."
end
end
get '/user/register/success' do
erb :register_success
end
| Check if sync with codeship | Check if sync with codeship
| Ruby | mit | hprovenza/nanotwitter,hprovenza/nanotwitter | ruby | ## Code Before:
require 'sinatra'
require 'sinatra/activerecord'
require './config/environments'
require './models/user'
enable :sessions
get '/' do
erb :index
end
get '/login' do
erb :login
end
post '/login/submit' do
user = User.find_by(email: params["email"], password: params["password"])
if user.nil?
# loggin failed page
else
session[:id] = user.id
redirect '/home'
end
end
get '/user/register' do
erb :register, :locals=>{:message => nil}
end
# routes that need authorization
get '/home' do
if sesssion[:id].nil?
redirect '/login'
end
@user = User.find(session[:id])
if @user.nil?
redirect '/login'
else
erb :home
end
end
post '/user/register' do
@user = User.new(params[:user])
@existing = User.where("username = ?", params[:user][:username])
if @existing.count != 0
erb :register, :locals=>{:message =>
"Account already exists! Try a new username or log back in!"}
elsif @user.save
redirect '/user/register/success'
else
"Sorry, there was an error"
end
end
get '/user/register/success' do
erb :register_success
end
## Instruction:
Check if sync with codeship
## Code After:
require 'sinatra'
require 'sinatra/activerecord'
require './config/environments'
require './models/user'
enable :sessions
get '/' do
erb :index
end
get '/login' do
erb :login
end
post '/login/submit' do
user = User.find_by(email: params["email"], password: params["password"])
if user.nil?
# loggin failed page
else
session[:id] = user.id
redirect '/home'
end
end
get '/user/register' do
erb :register, :locals=>{:message => nil}
end
# routes that need authorization
get '/home' do
if sesssion[:id].nil?
redirect '/login'
end
@user = User.find(session[:id])
if @user.nil?
redirect '/login'
else
erb :home
end
end
post '/user/register' do
@user = User.new(params[:user])
@existing = User.where("username = ?", params[:user][:username])
if @existing.count != 0
erb :register, :locals=>{:message =>
"Account already exists! Try a new username or log back in!"}
elsif @user.save
redirect '/user/register/success'
else
"Sorry our server died..."
end
end
get '/user/register/success' do
erb :register_success
end
| require 'sinatra'
require 'sinatra/activerecord'
require './config/environments'
require './models/user'
enable :sessions
get '/' do
erb :index
end
get '/login' do
erb :login
end
post '/login/submit' do
user = User.find_by(email: params["email"], password: params["password"])
if user.nil?
# loggin failed page
else
session[:id] = user.id
redirect '/home'
end
end
get '/user/register' do
erb :register, :locals=>{:message => nil}
end
# routes that need authorization
get '/home' do
if sesssion[:id].nil?
redirect '/login'
end
@user = User.find(session[:id])
if @user.nil?
redirect '/login'
else
erb :home
end
end
post '/user/register' do
@user = User.new(params[:user])
@existing = User.where("username = ?", params[:user][:username])
if @existing.count != 0
erb :register, :locals=>{:message =>
"Account already exists! Try a new username or log back in!"}
elsif @user.save
redirect '/user/register/success'
else
- "Sorry, there was an error"
+ "Sorry our server died..."
end
end
get '/user/register/success' do
erb :register_success
end | 2 | 0.034483 | 1 | 1 |
37085765aed161446873f04e36ce9ea14715de5f | .github/workflows/openbsd.yaml | .github/workflows/openbsd.yaml | name: OpenBSD CI
on:
workflow_dispatch:
push:
branches:
- master
paths-ignore:
- '**.md'
- '**.yml'
- '**.yaml'
jobs:
# SSH into OpenBSD server and run test on OpenBSD 6.8 32-bit
# Configured to pull latest from oshi master branch
# To test on a PR, log into the openbsd server and create a new branch
testopenbsd:
runs-on: ubuntu-latest
name: Test JDK 8, openbsd
steps:
- name: Test in OpenBSD
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.OPENBSD_OSHI_DOMAIN }}
username: oshi
password: ${{ secrets.OPENBSD_OSHI_PW }}
port: 10060
script_stop: true
command_timeout: 15m
script: |
cd ~/git/oshi
git checkout master
doas git reset --hard HEAD~2
doas git pull
doas mvn clean
mvn test -B -Djacoco.skip=true
doas mvn test -B -Djacoco.skip=true
| name: OpenBSD CI
on:
workflow_dispatch:
push:
branches:
- master
paths-ignore:
- '**.md'
- '**.yml'
- '**.yaml'
jobs:
# SSH into OpenBSD server and run test on OpenBSD 6.8 32-bit
# Configured to pull latest from oshi master branch
# To test on a PR, log into the openbsd server and create a new branch
testopenbsd:
runs-on: ubuntu-latest
name: Test JDK 8, openbsd
steps:
- name: Test in OpenBSD
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.OPENBSD_OSHI_DOMAIN }}
username: oshi
password: ${{ secrets.OPENBSD_OSHI_PW }}
port: 10060
script_stop: true
command_timeout: 15m
script: |
cd ~/git/oshi
git checkout master
doas git reset --hard HEAD~2
doas git pull
doas mvn clean
doas chown -R oshi:oshi .
mvn test -B -Djacoco.skip=true
doas mvn test -B -Djacoco.skip=true | Make OpenBSD test robust to filesystem changes | Make OpenBSD test robust to filesystem changes | YAML | mit | dbwiddis/oshi,hazendaz/oshi | yaml | ## Code Before:
name: OpenBSD CI
on:
workflow_dispatch:
push:
branches:
- master
paths-ignore:
- '**.md'
- '**.yml'
- '**.yaml'
jobs:
# SSH into OpenBSD server and run test on OpenBSD 6.8 32-bit
# Configured to pull latest from oshi master branch
# To test on a PR, log into the openbsd server and create a new branch
testopenbsd:
runs-on: ubuntu-latest
name: Test JDK 8, openbsd
steps:
- name: Test in OpenBSD
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.OPENBSD_OSHI_DOMAIN }}
username: oshi
password: ${{ secrets.OPENBSD_OSHI_PW }}
port: 10060
script_stop: true
command_timeout: 15m
script: |
cd ~/git/oshi
git checkout master
doas git reset --hard HEAD~2
doas git pull
doas mvn clean
mvn test -B -Djacoco.skip=true
doas mvn test -B -Djacoco.skip=true
## Instruction:
Make OpenBSD test robust to filesystem changes
## Code After:
name: OpenBSD CI
on:
workflow_dispatch:
push:
branches:
- master
paths-ignore:
- '**.md'
- '**.yml'
- '**.yaml'
jobs:
# SSH into OpenBSD server and run test on OpenBSD 6.8 32-bit
# Configured to pull latest from oshi master branch
# To test on a PR, log into the openbsd server and create a new branch
testopenbsd:
runs-on: ubuntu-latest
name: Test JDK 8, openbsd
steps:
- name: Test in OpenBSD
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.OPENBSD_OSHI_DOMAIN }}
username: oshi
password: ${{ secrets.OPENBSD_OSHI_PW }}
port: 10060
script_stop: true
command_timeout: 15m
script: |
cd ~/git/oshi
git checkout master
doas git reset --hard HEAD~2
doas git pull
doas mvn clean
doas chown -R oshi:oshi .
mvn test -B -Djacoco.skip=true
doas mvn test -B -Djacoco.skip=true | name: OpenBSD CI
on:
workflow_dispatch:
push:
branches:
- master
paths-ignore:
- '**.md'
- '**.yml'
- '**.yaml'
jobs:
# SSH into OpenBSD server and run test on OpenBSD 6.8 32-bit
# Configured to pull latest from oshi master branch
# To test on a PR, log into the openbsd server and create a new branch
testopenbsd:
runs-on: ubuntu-latest
name: Test JDK 8, openbsd
steps:
- name: Test in OpenBSD
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.OPENBSD_OSHI_DOMAIN }}
username: oshi
password: ${{ secrets.OPENBSD_OSHI_PW }}
port: 10060
script_stop: true
command_timeout: 15m
script: |
cd ~/git/oshi
git checkout master
doas git reset --hard HEAD~2
doas git pull
doas mvn clean
+ doas chown -R oshi:oshi .
mvn test -B -Djacoco.skip=true
- doas mvn test -B -Djacoco.skip=true
+ doas mvn test -B -Djacoco.skip=true
? ++++++++++
- | 4 | 0.105263 | 2 | 2 |
55b020df6f492dfee9fa48d5ab8d590763ecbdb8 | app/views/objectives/_form.html.erb | app/views/objectives/_form.html.erb | <%= form_for @objective do |f| %>
<%= f.text_field :title %>
<%= f.text_area :description %>
<%= f.check_box :accomplished, label: "Cumplido" %>
<%= f.submit "Actualizar"%>
<% end %> | <%= form_for @objective do |f| %>
<%= f.text_field :title, label: "Título" %>
<%= f.text_area :description, label: "Description" %>
<%= f.check_box :accomplished, label: "Cumplido" %>
<%= f.submit "Actualizar"%>
<% end %> | Add spanish translations to objectives form | Add spanish translations to objectives form
| HTML+ERB | agpl-3.0 | rockandror/transparencia,psicobyte/transparencia,rockandror/transparencia,psicobyte/transparencia,AyuntamientoMadrid/transparencia,AyuntamientoMadrid/transparencia,AyuntamientoMadrid/transparencia,psicobyte/transparencia,AyuntamientoMadrid/transparencia,rockandror/transparencia | html+erb | ## Code Before:
<%= form_for @objective do |f| %>
<%= f.text_field :title %>
<%= f.text_area :description %>
<%= f.check_box :accomplished, label: "Cumplido" %>
<%= f.submit "Actualizar"%>
<% end %>
## Instruction:
Add spanish translations to objectives form
## Code After:
<%= form_for @objective do |f| %>
<%= f.text_field :title, label: "Título" %>
<%= f.text_area :description, label: "Description" %>
<%= f.check_box :accomplished, label: "Cumplido" %>
<%= f.submit "Actualizar"%>
<% end %> | <%= form_for @objective do |f| %>
- <%= f.text_field :title %>
+ <%= f.text_field :title, label: "Título" %>
? + +++++++++++++++
- <%= f.text_area :description %>
+ <%= f.text_area :description, label: "Description" %>
? ++++++++++++++++++++++
<%= f.check_box :accomplished, label: "Cumplido" %>
<%= f.submit "Actualizar"%>
<% end %> | 4 | 0.666667 | 2 | 2 |
221983e3504e417784676f4b23bde7baccaa269b | templates/umd.hbs | templates/umd.hbs | (function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module unless amdModuleId is set
define({{#if amdModuleId}}'{{amdModuleId}}', {{/if}}[{{{amdDependencies.wrapped}}}], function ({{{amdDependencies.normal}}}) {
return ({{#if objectToExport}}root['{{{objectToExport}}}'] = {{/if}}factory({{dependencies}}));
});
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory({{{cjsDependencies.wrapped}}});
} else {
{{#if globalAlias}}root['{{{globalAlias}}}'] = {{else}}{{#if objectToExport}}root['{{{objectToExport}}}'] = {{/if}}{{/if}}factory({{{globalDependencies.normal}}});
}
}(this, function ({{dependencies}}) {
{{{code}}}
{{#if objectToExport}}
return {{{objectToExport}}};
{{/if}}
}));
| (function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module unless amdModuleId is set
define({{#if amdModuleId}}'{{amdModuleId}}', {{/if}}[{{{amdDependencies.wrapped}}}], function ({{{amdDependencies.normal}}}) {
return ({{#if objectToExport}}root['{{{objectToExport}}}'] = {{/if}}factory({{{amdDependencies.normal}}}));
});
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory({{{cjsDependencies.wrapped}}});
} else {
{{#if globalAlias}}root['{{{globalAlias}}}'] = {{else}}{{#if objectToExport}}root['{{{objectToExport}}}'] = {{/if}}{{/if}}factory({{{globalDependencies.normal}}});
}
}(this, function ({{dependencies}}) {
{{{code}}}
{{#if objectToExport}}
return {{{objectToExport}}};
{{/if}}
}));
| Fix amd section of the default template | Fix amd section of the default template
Closes #12.
| Handlebars | mit | Download/libumd,bebraw/libumd,Download/libumd,bebraw/libumd | handlebars | ## Code Before:
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module unless amdModuleId is set
define({{#if amdModuleId}}'{{amdModuleId}}', {{/if}}[{{{amdDependencies.wrapped}}}], function ({{{amdDependencies.normal}}}) {
return ({{#if objectToExport}}root['{{{objectToExport}}}'] = {{/if}}factory({{dependencies}}));
});
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory({{{cjsDependencies.wrapped}}});
} else {
{{#if globalAlias}}root['{{{globalAlias}}}'] = {{else}}{{#if objectToExport}}root['{{{objectToExport}}}'] = {{/if}}{{/if}}factory({{{globalDependencies.normal}}});
}
}(this, function ({{dependencies}}) {
{{{code}}}
{{#if objectToExport}}
return {{{objectToExport}}};
{{/if}}
}));
## Instruction:
Fix amd section of the default template
Closes #12.
## Code After:
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module unless amdModuleId is set
define({{#if amdModuleId}}'{{amdModuleId}}', {{/if}}[{{{amdDependencies.wrapped}}}], function ({{{amdDependencies.normal}}}) {
return ({{#if objectToExport}}root['{{{objectToExport}}}'] = {{/if}}factory({{{amdDependencies.normal}}}));
});
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory({{{cjsDependencies.wrapped}}});
} else {
{{#if globalAlias}}root['{{{globalAlias}}}'] = {{else}}{{#if objectToExport}}root['{{{objectToExport}}}'] = {{/if}}{{/if}}factory({{{globalDependencies.normal}}});
}
}(this, function ({{dependencies}}) {
{{{code}}}
{{#if objectToExport}}
return {{{objectToExport}}};
{{/if}}
}));
| (function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module unless amdModuleId is set
define({{#if amdModuleId}}'{{amdModuleId}}', {{/if}}[{{{amdDependencies.wrapped}}}], function ({{{amdDependencies.normal}}}) {
- return ({{#if objectToExport}}root['{{{objectToExport}}}'] = {{/if}}factory({{dependencies}}));
+ return ({{#if objectToExport}}root['{{{objectToExport}}}'] = {{/if}}factory({{{amdDependencies.normal}}}));
? +++ + ++++++++
});
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory({{{cjsDependencies.wrapped}}});
} else {
{{#if globalAlias}}root['{{{globalAlias}}}'] = {{else}}{{#if objectToExport}}root['{{{objectToExport}}}'] = {{/if}}{{/if}}factory({{{globalDependencies.normal}}});
}
}(this, function ({{dependencies}}) {
{{{code}}}
{{#if objectToExport}}
return {{{objectToExport}}};
{{/if}}
})); | 2 | 0.090909 | 1 | 1 |
0954d1b9ed964dc6f225885fcbf7bc7214d324f9 | .travis.yml | .travis.yml | language: haskell
ghc:
- 7.6
- 7.8
sudo: false
cache:
directories:
- ~/.cabal
- ~/.ghc
script: ./allTests.sh
| language: haskell
ghc:
- 7.6
- 7.8
sudo: false
cache:
directories:
- ~/.cabal
- ~/.ghc
| Revert "Travis: run additional tests from allTests.sh (v2)" | Revert "Travis: run additional tests from allTests.sh (v2)"
This reverts commit cf6726f266bf003151c063803eece1c689204da2, because it
breaks testing on Travis - I'm developing a fix but it's not easy.
| YAML | bsd-3-clause | Toxaris/pts,Blaisorblade/pts | yaml | ## Code Before:
language: haskell
ghc:
- 7.6
- 7.8
sudo: false
cache:
directories:
- ~/.cabal
- ~/.ghc
script: ./allTests.sh
## Instruction:
Revert "Travis: run additional tests from allTests.sh (v2)"
This reverts commit cf6726f266bf003151c063803eece1c689204da2, because it
breaks testing on Travis - I'm developing a fix but it's not easy.
## Code After:
language: haskell
ghc:
- 7.6
- 7.8
sudo: false
cache:
directories:
- ~/.cabal
- ~/.ghc
| language: haskell
ghc:
- 7.6
- 7.8
sudo: false
cache:
directories:
- ~/.cabal
- ~/.ghc
- script: ./allTests.sh | 1 | 0.090909 | 0 | 1 |
9693c1ab1302d8c51f48829d6b7701b4ed580d44 | packages/machinomy/src/storage/postgresql/migrations/20180115082606-create-payment.ts | packages/machinomy/src/storage/postgresql/migrations/20180115082606-create-payment.ts | import { Base, CallbackFunction } from 'db-migrate-base'
import bigNumberColumn from './util/bigNumberColumn'
export function up (db: Base, callback: CallbackFunction) {
const createTableOptions = {
columns: {
channelId: {
type: 'string',
notNull: true,
foreignKey: {
name: 'tokens_channel_id_fk',
table: 'channel',
mapping: 'channelId',
rules: {
onDelete: 'CASCADE'
}
}
},
kind: 'string',
token: {
type: 'string',
notNull: true,
unique: true
},
sender: 'string',
receiver: 'string',
price: bigNumberColumn,
value: bigNumberColumn,
channelValue: bigNumberColumn,
v: 'int',
r: 'string',
s: 'string',
meta: 'string',
contractAddress: 'string'
},
ifNotExists: true
}
db.createTable('payment', createTableOptions, callback)
}
export function down (db: Base, callback: CallbackFunction) {
db.dropTable('payment', callback)
}
| import { Base, CallbackFunction } from 'db-migrate-base'
import bigNumberColumn from './util/bigNumberColumn'
export function up (db: Base, callback: CallbackFunction) {
const createTableOptions = {
columns: {
channelId: {
type: 'string',
notNull: true
},
kind: 'string',
token: {
type: 'string',
notNull: true,
unique: true
},
sender: 'string',
receiver: 'string',
price: bigNumberColumn,
value: bigNumberColumn,
channelValue: bigNumberColumn,
v: 'int',
r: 'string',
s: 'string',
meta: 'string',
contractAddress: 'string'
},
ifNotExists: true
}
db.createTable('payment', createTableOptions, callback)
}
export function down (db: Base, callback: CallbackFunction) {
db.dropTable('payment', callback)
}
| Remove one more constraint on db level | Remove one more constraint on db level
| TypeScript | apache-2.0 | machinomy/machinomy,machinomy/machinomy,machinomy/machinomy | typescript | ## Code Before:
import { Base, CallbackFunction } from 'db-migrate-base'
import bigNumberColumn from './util/bigNumberColumn'
export function up (db: Base, callback: CallbackFunction) {
const createTableOptions = {
columns: {
channelId: {
type: 'string',
notNull: true,
foreignKey: {
name: 'tokens_channel_id_fk',
table: 'channel',
mapping: 'channelId',
rules: {
onDelete: 'CASCADE'
}
}
},
kind: 'string',
token: {
type: 'string',
notNull: true,
unique: true
},
sender: 'string',
receiver: 'string',
price: bigNumberColumn,
value: bigNumberColumn,
channelValue: bigNumberColumn,
v: 'int',
r: 'string',
s: 'string',
meta: 'string',
contractAddress: 'string'
},
ifNotExists: true
}
db.createTable('payment', createTableOptions, callback)
}
export function down (db: Base, callback: CallbackFunction) {
db.dropTable('payment', callback)
}
## Instruction:
Remove one more constraint on db level
## Code After:
import { Base, CallbackFunction } from 'db-migrate-base'
import bigNumberColumn from './util/bigNumberColumn'
export function up (db: Base, callback: CallbackFunction) {
const createTableOptions = {
columns: {
channelId: {
type: 'string',
notNull: true
},
kind: 'string',
token: {
type: 'string',
notNull: true,
unique: true
},
sender: 'string',
receiver: 'string',
price: bigNumberColumn,
value: bigNumberColumn,
channelValue: bigNumberColumn,
v: 'int',
r: 'string',
s: 'string',
meta: 'string',
contractAddress: 'string'
},
ifNotExists: true
}
db.createTable('payment', createTableOptions, callback)
}
export function down (db: Base, callback: CallbackFunction) {
db.dropTable('payment', callback)
}
| import { Base, CallbackFunction } from 'db-migrate-base'
import bigNumberColumn from './util/bigNumberColumn'
export function up (db: Base, callback: CallbackFunction) {
const createTableOptions = {
columns: {
channelId: {
type: 'string',
- notNull: true,
? -
+ notNull: true
- foreignKey: {
- name: 'tokens_channel_id_fk',
- table: 'channel',
- mapping: 'channelId',
- rules: {
- onDelete: 'CASCADE'
- }
- }
},
kind: 'string',
token: {
type: 'string',
notNull: true,
unique: true
},
sender: 'string',
receiver: 'string',
price: bigNumberColumn,
value: bigNumberColumn,
channelValue: bigNumberColumn,
v: 'int',
r: 'string',
s: 'string',
meta: 'string',
contractAddress: 'string'
},
ifNotExists: true
}
db.createTable('payment', createTableOptions, callback)
}
export function down (db: Base, callback: CallbackFunction) {
db.dropTable('payment', callback)
} | 10 | 0.232558 | 1 | 9 |
06e366acb5c6cbb991a0e2aadc0e17e5fc7421be | app/views/welcome/index.html.erb | app/views/welcome/index.html.erb | <div>
<h1>Meal Time</h1>
<h2>We have lots of delicious options.</h2>
<div class="row">
<% [@western_item, @asian_item, @adventurous_item].each do |item| %>
<div class="col-md-4">
<strong>
Try this <span class="cuisine-name"><%= item.cuisine %></span> Item:<span class="item-name"><%= item.name %></span>
</strong>
<p>It comes from <strong><%= item.restaurant_name %></strong> at the smokin' hot price of <%= item.price %></p>
<p>Harry gives it a <%= item.harrys_choice ? "THUMBS UP" : "THUMBS DOWN" %></p>
<p><%= image_tag item.photo_path, :class => 'img-rounded' %></p>
</div>
<% end %>
</div>
</div> | <div>
<h1>Meal Time</h1>
<h2>We have lots of delicious options.</h2>
<div class="row">
<% [@western_item, @asian_item, @adventurous_item].each do |item| %>
<div class="col-md-4">
<strong>
Try this <span class="cuisine-name"><%= item.cuisine %></span> Item: <a href="/food_item/show/<%= item.id %>"><span class="item-name"><%= item.name %></span></a>
</strong>
<p>It comes from <strong><%= item.restaurant_name %></strong> at the smokin' hot price of <%= item.price %></p>
<p>Harry gives it a <%= item.harrys_choice ? "THUMBS UP" : "THUMBS DOWN" %></p>
<p><%= image_tag item.photo_path, :class => 'img-rounded' %></p>
</div>
<% end %>
</div>
</div> | Add link to show the detail page of food item | Add link to show the detail page of food item
| HTML+ERB | mit | wdi-hk-sep-2014/mealtime,wdi-hk-sep-2014/mealtime | html+erb | ## Code Before:
<div>
<h1>Meal Time</h1>
<h2>We have lots of delicious options.</h2>
<div class="row">
<% [@western_item, @asian_item, @adventurous_item].each do |item| %>
<div class="col-md-4">
<strong>
Try this <span class="cuisine-name"><%= item.cuisine %></span> Item:<span class="item-name"><%= item.name %></span>
</strong>
<p>It comes from <strong><%= item.restaurant_name %></strong> at the smokin' hot price of <%= item.price %></p>
<p>Harry gives it a <%= item.harrys_choice ? "THUMBS UP" : "THUMBS DOWN" %></p>
<p><%= image_tag item.photo_path, :class => 'img-rounded' %></p>
</div>
<% end %>
</div>
</div>
## Instruction:
Add link to show the detail page of food item
## Code After:
<div>
<h1>Meal Time</h1>
<h2>We have lots of delicious options.</h2>
<div class="row">
<% [@western_item, @asian_item, @adventurous_item].each do |item| %>
<div class="col-md-4">
<strong>
Try this <span class="cuisine-name"><%= item.cuisine %></span> Item: <a href="/food_item/show/<%= item.id %>"><span class="item-name"><%= item.name %></span></a>
</strong>
<p>It comes from <strong><%= item.restaurant_name %></strong> at the smokin' hot price of <%= item.price %></p>
<p>Harry gives it a <%= item.harrys_choice ? "THUMBS UP" : "THUMBS DOWN" %></p>
<p><%= image_tag item.photo_path, :class => 'img-rounded' %></p>
</div>
<% end %>
</div>
</div> | <div>
<h1>Meal Time</h1>
<h2>We have lots of delicious options.</h2>
<div class="row">
<% [@western_item, @asian_item, @adventurous_item].each do |item| %>
<div class="col-md-4">
<strong>
- Try this <span class="cuisine-name"><%= item.cuisine %></span> Item:<span class="item-name"><%= item.name %></span>
+ Try this <span class="cuisine-name"><%= item.cuisine %></span> Item: <a href="/food_item/show/<%= item.id %>"><span class="item-name"><%= item.name %></span></a>
? ++++++++++++++++++++++++++++++++++++++++++ ++++
</strong>
<p>It comes from <strong><%= item.restaurant_name %></strong> at the smokin' hot price of <%= item.price %></p>
<p>Harry gives it a <%= item.harrys_choice ? "THUMBS UP" : "THUMBS DOWN" %></p>
<p><%= image_tag item.photo_path, :class => 'img-rounded' %></p>
</div>
<% end %>
</div>
</div> | 2 | 0.117647 | 1 | 1 |
87a4980146c50b90d4f0104114e37f741a4ce0bc | app/controllers/answers_controller.rb | app/controllers/answers_controller.rb | class AnswersController < ApplicationController
def new
@answer = Answer.new
end
def create
@answer = Answer.create(params[:id])
@answer.question = @question
redirect_to '/questions/'
end
def edit
@answer = Answer.find(params[:id])
end
def show
@answer = Answer.find(params[:id])
end
private
def answer_params
params.require(:answer).permit(:body, :question_id)
end
end | class AnswersController < ApplicationController
def index
@answers = Answer.all
end
def new
@answer = Answer.new
@question = Question.find(params[:question_id])
end
def create
@question = find_question
@answer = @question.answers.build(answer_params)
if @answer.save
redirect_to question_path(@question)
else
render :action => 'new'
end
end
def edit
@answer = Answer.find(params[:id])
end
def show
@answer = Answer.find(params[:id])
end
def destroy
@answer = Answer.find(params[:id])
@answer.destroy
end
# def upvote
# @question = Question.find(params[:question_id])
# @answer = Answer.find(params[:id])
# @answer.upvote_from current_user
# redirect_to question_path(@question)
# end
# def downvote
# @question = Question.find(params[:question_id])
# @answer = Answer.find(params[:id])
# @answer.downvote_from current_user
# redirect_to question_path(@question)
# end
private
def answer_params
params.require(:answer).permit(:body, :question_id)
end
def find_question
params.each do |name, value|
if name =~ /(.+)_id$/
return $1.classify.constantize.find(value)
end
end
nil
end
end | Add create, index and destroy methods to answer model | Add create, index and destroy methods to answer model
| Ruby | mit | red-spotted-newts-2014/stacksonstacks,red-spotted-newts-2014/stacksonstacks,red-spotted-newts-2014/stacksonstacks | ruby | ## Code Before:
class AnswersController < ApplicationController
def new
@answer = Answer.new
end
def create
@answer = Answer.create(params[:id])
@answer.question = @question
redirect_to '/questions/'
end
def edit
@answer = Answer.find(params[:id])
end
def show
@answer = Answer.find(params[:id])
end
private
def answer_params
params.require(:answer).permit(:body, :question_id)
end
end
## Instruction:
Add create, index and destroy methods to answer model
## Code After:
class AnswersController < ApplicationController
def index
@answers = Answer.all
end
def new
@answer = Answer.new
@question = Question.find(params[:question_id])
end
def create
@question = find_question
@answer = @question.answers.build(answer_params)
if @answer.save
redirect_to question_path(@question)
else
render :action => 'new'
end
end
def edit
@answer = Answer.find(params[:id])
end
def show
@answer = Answer.find(params[:id])
end
def destroy
@answer = Answer.find(params[:id])
@answer.destroy
end
# def upvote
# @question = Question.find(params[:question_id])
# @answer = Answer.find(params[:id])
# @answer.upvote_from current_user
# redirect_to question_path(@question)
# end
# def downvote
# @question = Question.find(params[:question_id])
# @answer = Answer.find(params[:id])
# @answer.downvote_from current_user
# redirect_to question_path(@question)
# end
private
def answer_params
params.require(:answer).permit(:body, :question_id)
end
def find_question
params.each do |name, value|
if name =~ /(.+)_id$/
return $1.classify.constantize.find(value)
end
end
nil
end
end | class AnswersController < ApplicationController
+ def index
+ @answers = Answer.all
+ end
+
def new
@answer = Answer.new
+ @question = Question.find(params[:question_id])
end
def create
- @answer = Answer.create(params[:id])
- @answer.question = @question
? ------- ^
+ @question = find_question
? ^^^^^
- redirect_to '/questions/'
+ @answer = @question.answers.build(answer_params)
+ if @answer.save
+ redirect_to question_path(@question)
+ else
+ render :action => 'new'
+ end
end
def edit
@answer = Answer.find(params[:id])
end
def show
@answer = Answer.find(params[:id])
end
+ def destroy
+ @answer = Answer.find(params[:id])
+ @answer.destroy
+ end
+
+ # def upvote
+ # @question = Question.find(params[:question_id])
+ # @answer = Answer.find(params[:id])
+ # @answer.upvote_from current_user
+ # redirect_to question_path(@question)
+ # end
+
+ # def downvote
+ # @question = Question.find(params[:question_id])
+ # @answer = Answer.find(params[:id])
+ # @answer.downvote_from current_user
+ # redirect_to question_path(@question)
+ # end
+
private
def answer_params
params.require(:answer).permit(:body, :question_id)
end
+
+ def find_question
+ params.each do |name, value|
+ if name =~ /(.+)_id$/
+ return $1.classify.constantize.find(value)
+ end
+ end
+ nil
+ end
+
end | 44 | 1.76 | 41 | 3 |
58f31424ccb2eda5ee94514bd1305f1b814ab1de | estmator_project/est_client/urls.py | estmator_project/est_client/urls.py | from django.conf.urls import url
import views
urlpatterns = [
# urls begin with /client/
url(r'^$', views.client_view, name='api_client'), # not sure what the api urls are doing currently
url(
r'^form$',
views.client_form_view,
name='client_form'
),
url(
r'^form/edit$',
views.client_edit_form_view,
name='client_edit_form'
),
url(
r'^listform$',
views.client_list_form_view,
name='client_list_form'
)
]
| from django.conf.urls import url
import views
urlpatterns = [
# urls begin with /client/
url(r'^$', views.client_view, name='api_client'), # not sure what the api urls are doing currently
url(
r'^form$',
views.client_form_view,
name='client_form'
),
url(
r'^form/edit$',
views.client_edit_form_view,
name='client_edit_form'
),
url(
r'^listform$',
views.client_list_form_view,
name='client_list_form'
),
url(
r'^company/form$',
views.company_form_view,
name='company_form'
),
url(
r'^company/form/edit$',
views.company_edit_form_view,
name='company_edit_form'
),
url(
r'^company/listform$',
views.company_list_form_view,
name='company_list_form'
)
]
| Add simple company form routes | Add simple company form routes
| Python | mit | Estmator/EstmatorApp,Estmator/EstmatorApp,Estmator/EstmatorApp | python | ## Code Before:
from django.conf.urls import url
import views
urlpatterns = [
# urls begin with /client/
url(r'^$', views.client_view, name='api_client'), # not sure what the api urls are doing currently
url(
r'^form$',
views.client_form_view,
name='client_form'
),
url(
r'^form/edit$',
views.client_edit_form_view,
name='client_edit_form'
),
url(
r'^listform$',
views.client_list_form_view,
name='client_list_form'
)
]
## Instruction:
Add simple company form routes
## Code After:
from django.conf.urls import url
import views
urlpatterns = [
# urls begin with /client/
url(r'^$', views.client_view, name='api_client'), # not sure what the api urls are doing currently
url(
r'^form$',
views.client_form_view,
name='client_form'
),
url(
r'^form/edit$',
views.client_edit_form_view,
name='client_edit_form'
),
url(
r'^listform$',
views.client_list_form_view,
name='client_list_form'
),
url(
r'^company/form$',
views.company_form_view,
name='company_form'
),
url(
r'^company/form/edit$',
views.company_edit_form_view,
name='company_edit_form'
),
url(
r'^company/listform$',
views.company_list_form_view,
name='company_list_form'
)
]
| from django.conf.urls import url
import views
urlpatterns = [
# urls begin with /client/
url(r'^$', views.client_view, name='api_client'), # not sure what the api urls are doing currently
url(
r'^form$',
views.client_form_view,
name='client_form'
),
url(
r'^form/edit$',
views.client_edit_form_view,
name='client_edit_form'
),
url(
r'^listform$',
views.client_list_form_view,
name='client_list_form'
+ ),
+ url(
+ r'^company/form$',
+ views.company_form_view,
+ name='company_form'
+ ),
+ url(
+ r'^company/form/edit$',
+ views.company_edit_form_view,
+ name='company_edit_form'
+ ),
+ url(
+ r'^company/listform$',
+ views.company_list_form_view,
+ name='company_list_form'
)
] | 15 | 0.6 | 15 | 0 |
465d07ad21ee3bfdb5ad71c0d04ce0954aaeac43 | tasks/kernel_module_cleanup.yml | tasks/kernel_module_cleanup.yml | ---
- name: Remove ZFS modprobe configuration
file:
dest: /etc/modprobe.d/zfs.conf
state: absent
when: >
(pve_zfs_options is not defined) or
(pve_zfs_options is defined and not pve_zfs_options) or
(not pve_zfs_enabled)
- name: Disable loading of ZFS module on init
file:
dest: /etc/modules-load.d/zfs.conf
state: absent
when: not pve_zfs_enabled
| ---
- name: Remove ZFS modprobe configuration
file:
dest: /etc/modprobe.d/zfs.conf
state: absent
when: >
(pve_zfs_options is not defined) or
(pve_zfs_options is defined and not pve_zfs_options) or
(not pve_zfs_enabled)
- name: Disable loading of ZFS module on init
file:
dest: /etc/modules-load.d/zfs.conf
state: absent
when: not pve_zfs_enabled
- block:
- name: Re-enable nmi_watchdog via GRUB config
lineinfile:
dest: /etc/default/grub
line: 'GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX nmi_watchdog=0"'
state: absent
register: __pve_grub
- name: Update GRUB configuration
command: update-grub
register: __pve_grub_update
failed_when: ('error' in __pve_grub_update.stderr)
when: __pve_grub|changed
tags: skiponlxc
- name: Remove ipmi_watchdog modprobe configuration
file:
dest: /etc/modprobe.d/ipmi_watchdog.conf
state: absent
- name: Load softdog
modprobe:
name: softdog
- name: Set PVE HA Manager watchdog configuration back to default
copy:
content: "WATCHDOG_MODULE=softdog"
dest: /etc/default/pve-ha-manager
notify:
- restart watchdog-mux
when: pve_watchdog != 'ipmi'
| Add cleanup tasks for disabling IPMI watchdog | Add cleanup tasks for disabling IPMI watchdog
| YAML | mit | lae/ansible-role-proxmox,lae/ansible-role-proxmox | yaml | ## Code Before:
---
- name: Remove ZFS modprobe configuration
file:
dest: /etc/modprobe.d/zfs.conf
state: absent
when: >
(pve_zfs_options is not defined) or
(pve_zfs_options is defined and not pve_zfs_options) or
(not pve_zfs_enabled)
- name: Disable loading of ZFS module on init
file:
dest: /etc/modules-load.d/zfs.conf
state: absent
when: not pve_zfs_enabled
## Instruction:
Add cleanup tasks for disabling IPMI watchdog
## Code After:
---
- name: Remove ZFS modprobe configuration
file:
dest: /etc/modprobe.d/zfs.conf
state: absent
when: >
(pve_zfs_options is not defined) or
(pve_zfs_options is defined and not pve_zfs_options) or
(not pve_zfs_enabled)
- name: Disable loading of ZFS module on init
file:
dest: /etc/modules-load.d/zfs.conf
state: absent
when: not pve_zfs_enabled
- block:
- name: Re-enable nmi_watchdog via GRUB config
lineinfile:
dest: /etc/default/grub
line: 'GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX nmi_watchdog=0"'
state: absent
register: __pve_grub
- name: Update GRUB configuration
command: update-grub
register: __pve_grub_update
failed_when: ('error' in __pve_grub_update.stderr)
when: __pve_grub|changed
tags: skiponlxc
- name: Remove ipmi_watchdog modprobe configuration
file:
dest: /etc/modprobe.d/ipmi_watchdog.conf
state: absent
- name: Load softdog
modprobe:
name: softdog
- name: Set PVE HA Manager watchdog configuration back to default
copy:
content: "WATCHDOG_MODULE=softdog"
dest: /etc/default/pve-ha-manager
notify:
- restart watchdog-mux
when: pve_watchdog != 'ipmi'
| ---
- name: Remove ZFS modprobe configuration
file:
dest: /etc/modprobe.d/zfs.conf
state: absent
when: >
(pve_zfs_options is not defined) or
(pve_zfs_options is defined and not pve_zfs_options) or
(not pve_zfs_enabled)
- name: Disable loading of ZFS module on init
file:
dest: /etc/modules-load.d/zfs.conf
state: absent
when: not pve_zfs_enabled
+
+ - block:
+ - name: Re-enable nmi_watchdog via GRUB config
+ lineinfile:
+ dest: /etc/default/grub
+ line: 'GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX nmi_watchdog=0"'
+ state: absent
+ register: __pve_grub
+
+ - name: Update GRUB configuration
+ command: update-grub
+ register: __pve_grub_update
+ failed_when: ('error' in __pve_grub_update.stderr)
+ when: __pve_grub|changed
+ tags: skiponlxc
+
+ - name: Remove ipmi_watchdog modprobe configuration
+ file:
+ dest: /etc/modprobe.d/ipmi_watchdog.conf
+ state: absent
+
+ - name: Load softdog
+ modprobe:
+ name: softdog
+
+ - name: Set PVE HA Manager watchdog configuration back to default
+ copy:
+ content: "WATCHDOG_MODULE=softdog"
+ dest: /etc/default/pve-ha-manager
+ notify:
+ - restart watchdog-mux
+ when: pve_watchdog != 'ipmi' | 32 | 2.133333 | 32 | 0 |
71b893f201e72dd7dccca9e655ab39c1aea41894 | .github/workflows/macos_python.yml | .github/workflows/macos_python.yml | name: Python MacOS CI
on: [push, pull_request]
jobs:
# Building using the github runner environement directly.
cmake_make:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Check cmake
run: cmake --version
- name: Swig install
run: brew install swig
- name: Check swig
run: swig -version
- name: Configure
run: cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DBUILD_PYTHON=ON
- name: Build
run: cmake --build build --target all -v
- name: Test
run: cmake --build build --target test -v
- name: Install
run: cmake --build build --target install -v -- DESTDIR=install
cmake_xcode:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Check cmake
run: cmake --version
- name: Swig install
run: brew install swig
- name: Check swig
run: swig -version
- name: Configure
run: cmake -S. -Bbuild -G "Xcode" -DCMAKE_CONFIGURATION_TYPES=Release -DBUILD_PYTHON=ON
- name: Build
run: cmake --build build --config Release --target ALL_BUILD -v
- name: Test
run: cmake --build build --config Release --target RUN_TESTS -v
- name: Install
run: cmake --build build --config Release --target install -v -- DESTDIR=install
| name: Python MacOS CI
on: [push, pull_request]
jobs:
# Building using the github runner environement directly.
cmake_make:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Check cmake
run: cmake --version
- name: Swig install
run: brew install swig
- name: Check swig
run: swig -version
- name: Configure
run: cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DBUILD_PYTHON=ON
- name: Build
run: cmake --build build --target all -v
- name: Test
run: cmake --build build --target test -v
- name: Install
run: cmake --build build --target install -v -- DESTDIR=install
cmake_xcode:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Check cmake
run: cmake --version
- name: Swig install
run: brew install swig
- name: Check swig
run: swig -version
- name: Configure
run: cmake -S. -Bbuild -G "Xcode" -DCMAKE_CONFIGURATION_TYPES=Release -DBUILD_PYTHON=ON
- name: Build
run: cmake --build build --config Release --target ALL_BUILD -v
- name: Test
# note: can't use the target RUN_TESTS which seems to conflict with maven run command
#run: cmake --build build --config Release --target RUN_TESTS -v
run: cd build && ctest -C Release --verbose --extra-verbose --output-on-failure
- name: Install
run: cmake --build build --config Release --target install -v -- DESTDIR=install
| Fix python xcode test stage | ci(osx): Fix python xcode test stage
| YAML | apache-2.0 | or-tools/or-tools,google/or-tools,or-tools/or-tools,or-tools/or-tools,google/or-tools,google/or-tools,google/or-tools,or-tools/or-tools,google/or-tools,or-tools/or-tools,or-tools/or-tools,google/or-tools | yaml | ## Code Before:
name: Python MacOS CI
on: [push, pull_request]
jobs:
# Building using the github runner environement directly.
cmake_make:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Check cmake
run: cmake --version
- name: Swig install
run: brew install swig
- name: Check swig
run: swig -version
- name: Configure
run: cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DBUILD_PYTHON=ON
- name: Build
run: cmake --build build --target all -v
- name: Test
run: cmake --build build --target test -v
- name: Install
run: cmake --build build --target install -v -- DESTDIR=install
cmake_xcode:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Check cmake
run: cmake --version
- name: Swig install
run: brew install swig
- name: Check swig
run: swig -version
- name: Configure
run: cmake -S. -Bbuild -G "Xcode" -DCMAKE_CONFIGURATION_TYPES=Release -DBUILD_PYTHON=ON
- name: Build
run: cmake --build build --config Release --target ALL_BUILD -v
- name: Test
run: cmake --build build --config Release --target RUN_TESTS -v
- name: Install
run: cmake --build build --config Release --target install -v -- DESTDIR=install
## Instruction:
ci(osx): Fix python xcode test stage
## Code After:
name: Python MacOS CI
on: [push, pull_request]
jobs:
# Building using the github runner environement directly.
cmake_make:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Check cmake
run: cmake --version
- name: Swig install
run: brew install swig
- name: Check swig
run: swig -version
- name: Configure
run: cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DBUILD_PYTHON=ON
- name: Build
run: cmake --build build --target all -v
- name: Test
run: cmake --build build --target test -v
- name: Install
run: cmake --build build --target install -v -- DESTDIR=install
cmake_xcode:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Check cmake
run: cmake --version
- name: Swig install
run: brew install swig
- name: Check swig
run: swig -version
- name: Configure
run: cmake -S. -Bbuild -G "Xcode" -DCMAKE_CONFIGURATION_TYPES=Release -DBUILD_PYTHON=ON
- name: Build
run: cmake --build build --config Release --target ALL_BUILD -v
- name: Test
# note: can't use the target RUN_TESTS which seems to conflict with maven run command
#run: cmake --build build --config Release --target RUN_TESTS -v
run: cd build && ctest -C Release --verbose --extra-verbose --output-on-failure
- name: Install
run: cmake --build build --config Release --target install -v -- DESTDIR=install
| name: Python MacOS CI
on: [push, pull_request]
jobs:
# Building using the github runner environement directly.
cmake_make:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Check cmake
run: cmake --version
- name: Swig install
run: brew install swig
- name: Check swig
run: swig -version
- name: Configure
run: cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DBUILD_PYTHON=ON
- name: Build
run: cmake --build build --target all -v
- name: Test
run: cmake --build build --target test -v
- name: Install
run: cmake --build build --target install -v -- DESTDIR=install
cmake_xcode:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Check cmake
run: cmake --version
- name: Swig install
run: brew install swig
- name: Check swig
run: swig -version
- name: Configure
run: cmake -S. -Bbuild -G "Xcode" -DCMAKE_CONFIGURATION_TYPES=Release -DBUILD_PYTHON=ON
- name: Build
run: cmake --build build --config Release --target ALL_BUILD -v
- name: Test
+ # note: can't use the target RUN_TESTS which seems to conflict with maven run command
- run: cmake --build build --config Release --target RUN_TESTS -v
+ #run: cmake --build build --config Release --target RUN_TESTS -v
? +
+ run: cd build && ctest -C Release --verbose --extra-verbose --output-on-failure
- name: Install
run: cmake --build build --config Release --target install -v -- DESTDIR=install | 4 | 0.095238 | 3 | 1 |
223b0dd3ba63184336d615150c945bb52941c17a | packages/create-universal-package/lib/config/build-shared.js | packages/create-universal-package/lib/config/build-shared.js | const template = ({env, format, esEdition}) => `${env}.${format}.${esEdition}.js`;
const formats = ['es', 'cjs'];
module.exports = {
template,
formats,
};
| const template = ({env, format, esEdition}) => `${env}.${format}${esEdition ? `.${esEdition}` : ''}.js`;
const formats = ['es', 'cjs'];
module.exports = {
template,
formats,
};
| Fix output filepath in non-ES2015 bundles | Fix output filepath in non-ES2015 bundles
| JavaScript | mit | rtsao/create-universal-package,rtsao/create-universal-package | javascript | ## Code Before:
const template = ({env, format, esEdition}) => `${env}.${format}.${esEdition}.js`;
const formats = ['es', 'cjs'];
module.exports = {
template,
formats,
};
## Instruction:
Fix output filepath in non-ES2015 bundles
## Code After:
const template = ({env, format, esEdition}) => `${env}.${format}${esEdition ? `.${esEdition}` : ''}.js`;
const formats = ['es', 'cjs'];
module.exports = {
template,
formats,
};
| - const template = ({env, format, esEdition}) => `${env}.${format}.${esEdition}.js`;
+ const template = ({env, format, esEdition}) => `${env}.${format}${esEdition ? `.${esEdition}` : ''}.js`;
? +++++++++++++++ +++++++
const formats = ['es', 'cjs'];
module.exports = {
template,
formats,
}; | 2 | 0.285714 | 1 | 1 |
e843efb60aaa65225b85ab989e7020026e2575a8 | Endpoint/Method.swift | Endpoint/Method.swift | // Endpoint
// Written in 2016 by Nate Stedman <nate@natestedman.com>
//
// To the extent possible under law, the author(s) have dedicated all copyright and
// related and neighboring rights to this software to the public domain worldwide.
// This software is distributed without any warranty.
//
// You should have received a copy of the CC0 Public Domain Dedication along with
// this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
/// Enumerates the HTTP methods.
public enum Method: String
{
case Options = "OPTIONS"
case Get = "GET"
case Head = "HEAD"
case Post = "POST"
case Put = "PUT"
case Patch = "PATCH"
case Delete = "DELETE"
case Trace = "TRACE"
case Connect = "CONNECT"
}
| // Endpoint
// Written in 2016 by Nate Stedman <nate@natestedman.com>
//
// To the extent possible under law, the author(s) have dedicated all copyright and
// related and neighboring rights to this software to the public domain worldwide.
// This software is distributed without any warranty.
//
// You should have received a copy of the CC0 Public Domain Dedication along with
// this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
/// Enumerates the HTTP methods.
public enum Method: String
{
/// `OPTIONS`.
case Options = "OPTIONS"
/// `GET`.
case Get = "GET"
/// `HEAD`.
case Head = "HEAD"
/// `POST`.
case Post = "POST"
/// `PUT`.
case Put = "PUT"
/// `PATCH`.
case Patch = "PATCH"
/// `DELETE`.
case Delete = "DELETE"
/// `TRACE`.
case Trace = "TRACE"
/// `CONNECT`.
case Connect = "CONNECT"
}
| Add documentation to HTTP methods. | Add documentation to HTTP methods. | Swift | cc0-1.0 | natestedman/Endpoint | swift | ## Code Before:
// Endpoint
// Written in 2016 by Nate Stedman <nate@natestedman.com>
//
// To the extent possible under law, the author(s) have dedicated all copyright and
// related and neighboring rights to this software to the public domain worldwide.
// This software is distributed without any warranty.
//
// You should have received a copy of the CC0 Public Domain Dedication along with
// this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
/// Enumerates the HTTP methods.
public enum Method: String
{
case Options = "OPTIONS"
case Get = "GET"
case Head = "HEAD"
case Post = "POST"
case Put = "PUT"
case Patch = "PATCH"
case Delete = "DELETE"
case Trace = "TRACE"
case Connect = "CONNECT"
}
## Instruction:
Add documentation to HTTP methods.
## Code After:
// Endpoint
// Written in 2016 by Nate Stedman <nate@natestedman.com>
//
// To the extent possible under law, the author(s) have dedicated all copyright and
// related and neighboring rights to this software to the public domain worldwide.
// This software is distributed without any warranty.
//
// You should have received a copy of the CC0 Public Domain Dedication along with
// this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
/// Enumerates the HTTP methods.
public enum Method: String
{
/// `OPTIONS`.
case Options = "OPTIONS"
/// `GET`.
case Get = "GET"
/// `HEAD`.
case Head = "HEAD"
/// `POST`.
case Post = "POST"
/// `PUT`.
case Put = "PUT"
/// `PATCH`.
case Patch = "PATCH"
/// `DELETE`.
case Delete = "DELETE"
/// `TRACE`.
case Trace = "TRACE"
/// `CONNECT`.
case Connect = "CONNECT"
}
| // Endpoint
// Written in 2016 by Nate Stedman <nate@natestedman.com>
//
// To the extent possible under law, the author(s) have dedicated all copyright and
// related and neighboring rights to this software to the public domain worldwide.
// This software is distributed without any warranty.
//
// You should have received a copy of the CC0 Public Domain Dedication along with
// this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
/// Enumerates the HTTP methods.
public enum Method: String
{
+ /// `OPTIONS`.
case Options = "OPTIONS"
+
+ /// `GET`.
case Get = "GET"
+
+ /// `HEAD`.
case Head = "HEAD"
+
+ /// `POST`.
case Post = "POST"
+
+ /// `PUT`.
case Put = "PUT"
+
+ /// `PATCH`.
case Patch = "PATCH"
+
+ /// `DELETE`.
case Delete = "DELETE"
+
+ /// `TRACE`.
case Trace = "TRACE"
+
+ /// `CONNECT`.
case Connect = "CONNECT"
} | 17 | 0.73913 | 17 | 0 |
39288468182581ba94fc4b392c10309b252ea7b5 | dthm4kaiako/templates/poet/widgets/statistics-list-percentage.html | dthm4kaiako/templates/poet/widgets/statistics-list-percentage.html | <{%if po.percentage|floatformat == first_po.percentage|floatformat %}strong{% else %}small{% endif %}
class="{% if po.resource_target %}text-danger{% else %}text-success{% endif %}">
{{ po }} ({{ po.percentage|floatformat }}%)
</{%if po.percentage|floatformat == first_po.percentage|floatformat %}strong{% else %}small{% endif %}><br>
| {% if po %}
<{%if po.percentage|floatformat == first_po.percentage|floatformat %}strong{% else %}small{% endif %}
class="{% if po.resource_target %}text-danger{% else %}text-success{% endif %}">
{{ po }} ({{ po.percentage|floatformat }}%)
</{%if po.percentage|floatformat == first_po.percentage|floatformat %}strong{% else %}small{% endif %}><br>
{% endif %}
| Fix bug where empty PO data was shown | Fix bug where empty PO data was shown
| HTML | mit | uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers | html | ## Code Before:
<{%if po.percentage|floatformat == first_po.percentage|floatformat %}strong{% else %}small{% endif %}
class="{% if po.resource_target %}text-danger{% else %}text-success{% endif %}">
{{ po }} ({{ po.percentage|floatformat }}%)
</{%if po.percentage|floatformat == first_po.percentage|floatformat %}strong{% else %}small{% endif %}><br>
## Instruction:
Fix bug where empty PO data was shown
## Code After:
{% if po %}
<{%if po.percentage|floatformat == first_po.percentage|floatformat %}strong{% else %}small{% endif %}
class="{% if po.resource_target %}text-danger{% else %}text-success{% endif %}">
{{ po }} ({{ po.percentage|floatformat }}%)
</{%if po.percentage|floatformat == first_po.percentage|floatformat %}strong{% else %}small{% endif %}><br>
{% endif %}
| + {% if po %}
- <{%if po.percentage|floatformat == first_po.percentage|floatformat %}strong{% else %}small{% endif %}
+ <{%if po.percentage|floatformat == first_po.percentage|floatformat %}strong{% else %}small{% endif %}
? ++++
- class="{% if po.resource_target %}text-danger{% else %}text-success{% endif %}">
+ class="{% if po.resource_target %}text-danger{% else %}text-success{% endif %}">
? ++++
- {{ po }} ({{ po.percentage|floatformat }}%)
+ {{ po }} ({{ po.percentage|floatformat }}%)
? ++++
- </{%if po.percentage|floatformat == first_po.percentage|floatformat %}strong{% else %}small{% endif %}><br>
+ </{%if po.percentage|floatformat == first_po.percentage|floatformat %}strong{% else %}small{% endif %}><br>
? ++++
+ {% endif %} | 10 | 2.5 | 6 | 4 |
76b9548c383df12a4cb3e13fad15cb57202370fe | app/views/restaurants/index.html.haml | app/views/restaurants/index.html.haml | %h1.sign-in-heading Find A Restaurant
#map-canvas
.row
%ul.restaurants-listing
- @restaurants.each do |restaurant|
.one-restaurant
%li.restaurant{data: {latitude: restaurant.latitude, longitude: restaurant.longitude, name: restaurant.name, id: restaurant.id}}
.button.rest-index-button= link_to restaurant.name, restaurant_path(restaurant)
%ul
%li= number_to_phone(restaurant.phone)
%li= restaurant.address
= javascript_include_tag "https://maps.googleapis.com/maps/api/js?key=AIzaSyD-2wn8zNBeDOrvZe6jxSrQI34CAMqEcJI"
| %h1.sign-in-heading Find A Restaurant
#map-canvas
%noscript
:css
#map-canvas {display:none;}
#map-wrapper {height: 100px;}
.row
%ul.restaurants-listing
- @restaurants.each do |restaurant|
.one-restaurant
%li.restaurant{data: {latitude: restaurant.latitude, longitude: restaurant.longitude, name: restaurant.name, id: restaurant.id}}
.button.rest-index-button= link_to restaurant.name, restaurant_path(restaurant)
%ul
%li= number_to_phone(restaurant.phone)
%li= restaurant.address
= javascript_include_tag "https://maps.googleapis.com/maps/api/js?key=AIzaSyD-2wn8zNBeDOrvZe6jxSrQI34CAMqEcJI"
| Remove map without JS enabled | Remove map without JS enabled
| Haml | mit | mknicos/Hear-Me-Order,mknicos/Hear-Me-Order | haml | ## Code Before:
%h1.sign-in-heading Find A Restaurant
#map-canvas
.row
%ul.restaurants-listing
- @restaurants.each do |restaurant|
.one-restaurant
%li.restaurant{data: {latitude: restaurant.latitude, longitude: restaurant.longitude, name: restaurant.name, id: restaurant.id}}
.button.rest-index-button= link_to restaurant.name, restaurant_path(restaurant)
%ul
%li= number_to_phone(restaurant.phone)
%li= restaurant.address
= javascript_include_tag "https://maps.googleapis.com/maps/api/js?key=AIzaSyD-2wn8zNBeDOrvZe6jxSrQI34CAMqEcJI"
## Instruction:
Remove map without JS enabled
## Code After:
%h1.sign-in-heading Find A Restaurant
#map-canvas
%noscript
:css
#map-canvas {display:none;}
#map-wrapper {height: 100px;}
.row
%ul.restaurants-listing
- @restaurants.each do |restaurant|
.one-restaurant
%li.restaurant{data: {latitude: restaurant.latitude, longitude: restaurant.longitude, name: restaurant.name, id: restaurant.id}}
.button.rest-index-button= link_to restaurant.name, restaurant_path(restaurant)
%ul
%li= number_to_phone(restaurant.phone)
%li= restaurant.address
= javascript_include_tag "https://maps.googleapis.com/maps/api/js?key=AIzaSyD-2wn8zNBeDOrvZe6jxSrQI34CAMqEcJI"
| %h1.sign-in-heading Find A Restaurant
#map-canvas
+ %noscript
+ :css
+ #map-canvas {display:none;}
+ #map-wrapper {height: 100px;}
.row
%ul.restaurants-listing
- @restaurants.each do |restaurant|
.one-restaurant
%li.restaurant{data: {latitude: restaurant.latitude, longitude: restaurant.longitude, name: restaurant.name, id: restaurant.id}}
.button.rest-index-button= link_to restaurant.name, restaurant_path(restaurant)
%ul
%li= number_to_phone(restaurant.phone)
%li= restaurant.address
= javascript_include_tag "https://maps.googleapis.com/maps/api/js?key=AIzaSyD-2wn8zNBeDOrvZe6jxSrQI34CAMqEcJI" | 4 | 0.307692 | 4 | 0 |
e391b819af7494d2940677055721696c3e5bb330 | Belajar-Oauth2-Authorization-Server/src/main/java/com/rizki/mufrizal/belajar/oauth2/domain/UserRole.java | Belajar-Oauth2-Authorization-Server/src/main/java/com/rizki/mufrizal/belajar/oauth2/domain/UserRole.java | package com.rizki.mufrizal.belajar.oauth2.domain;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import java.io.Serializable;
@Entity
@Table(name = "tb_user_role",
indexes = {
@Index(columnList = "role", name = "role")
}
)
public class UserRole implements Serializable {
@Id
@GeneratedValue(generator = "system-uuid")
@GenericGenerator(name = "system-uuid", strategy = "uuid")
@Column(name = "idCustomerRole")
private String idCustomerRole;
@Column(name = "role", nullable = false, length = 10)
private String role = "ADMIN";
@JsonIgnore
@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.MERGE)
@JoinColumn(name = "email", nullable = false)
private User user;
public String getIdCustomerRole() {
return idCustomerRole;
}
public void setIdCustomerRole(String idCustomerRole) {
this.idCustomerRole = idCustomerRole;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
}
| package com.rizki.mufrizal.belajar.oauth2.domain;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import java.io.Serializable;
@Entity
@Table(name = "tb_user_role",
indexes = {
@Index(columnList = "role", name = "role")
}
)
public class UserRole implements Serializable {
@Id
@GeneratedValue(generator = "system-uuid")
@GenericGenerator(name = "system-uuid", strategy = "uuid")
@Column(name = "idCustomerRole")
private String idCustomerRole;
@Column(name = "role", nullable = false, length = 10)
private String role;
@JsonIgnore
@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.MERGE)
@JoinColumn(name = "email", nullable = false)
private User user;
public String getIdCustomerRole() {
return idCustomerRole;
}
public void setIdCustomerRole(String idCustomerRole) {
this.idCustomerRole = idCustomerRole;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
}
| Update Config User Role Domain | Update Config User Role Domain
| Java | apache-2.0 | RizkiMufrizal/Belajar-Oauth2,RizkiMufrizal/Belajar-Oauth2,RizkiMufrizal/Belajar-Oauth2 | java | ## Code Before:
package com.rizki.mufrizal.belajar.oauth2.domain;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import java.io.Serializable;
@Entity
@Table(name = "tb_user_role",
indexes = {
@Index(columnList = "role", name = "role")
}
)
public class UserRole implements Serializable {
@Id
@GeneratedValue(generator = "system-uuid")
@GenericGenerator(name = "system-uuid", strategy = "uuid")
@Column(name = "idCustomerRole")
private String idCustomerRole;
@Column(name = "role", nullable = false, length = 10)
private String role = "ADMIN";
@JsonIgnore
@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.MERGE)
@JoinColumn(name = "email", nullable = false)
private User user;
public String getIdCustomerRole() {
return idCustomerRole;
}
public void setIdCustomerRole(String idCustomerRole) {
this.idCustomerRole = idCustomerRole;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
}
## Instruction:
Update Config User Role Domain
## Code After:
package com.rizki.mufrizal.belajar.oauth2.domain;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import java.io.Serializable;
@Entity
@Table(name = "tb_user_role",
indexes = {
@Index(columnList = "role", name = "role")
}
)
public class UserRole implements Serializable {
@Id
@GeneratedValue(generator = "system-uuid")
@GenericGenerator(name = "system-uuid", strategy = "uuid")
@Column(name = "idCustomerRole")
private String idCustomerRole;
@Column(name = "role", nullable = false, length = 10)
private String role;
@JsonIgnore
@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.MERGE)
@JoinColumn(name = "email", nullable = false)
private User user;
public String getIdCustomerRole() {
return idCustomerRole;
}
public void setIdCustomerRole(String idCustomerRole) {
this.idCustomerRole = idCustomerRole;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
}
| package com.rizki.mufrizal.belajar.oauth2.domain;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import java.io.Serializable;
@Entity
@Table(name = "tb_user_role",
indexes = {
@Index(columnList = "role", name = "role")
}
)
public class UserRole implements Serializable {
@Id
@GeneratedValue(generator = "system-uuid")
@GenericGenerator(name = "system-uuid", strategy = "uuid")
@Column(name = "idCustomerRole")
private String idCustomerRole;
@Column(name = "role", nullable = false, length = 10)
- private String role = "ADMIN";
? ----------
+ private String role;
@JsonIgnore
@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.MERGE)
@JoinColumn(name = "email", nullable = false)
private User user;
public String getIdCustomerRole() {
return idCustomerRole;
}
public void setIdCustomerRole(String idCustomerRole) {
this.idCustomerRole = idCustomerRole;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
} | 2 | 0.037037 | 1 | 1 |
29297195973fe32135ca0af5201ecf083fbb13bc | .travis.yml | .travis.yml | script: "bundle exec rake neo4j:install[community-2.3.0] neo4j:start default --trace"
language: ruby
cache: bundler
sudo: false
rvm:
- 2.2.0
- 2.3.0
gemfile: travis.gemfile
env:
global:
- TRAVISCI=1
matrix:
- NEO4J_VERSION=6.0.9
- NEO4J_VERSION=7.0.11
| script: "bundle exec rake neo4j:install[community-2.3.0] neo4j:start default --trace"
language: ruby
cache: bundler
sudo: false
rvm:
- 2.2.0
- 2.3.0
gemfile: travis.gemfile
env:
global:
- TRAVISCI=1
matrix:
- NEO4J_VERSION=6.0.9
- NEO4J_VERSION=7.2.3
- NEO4J_VERSION=8.1.3
| Add latest versions of the neo4j gem | Add latest versions of the neo4j gem
| YAML | mit | sineed/neo4j-rspec | yaml | ## Code Before:
script: "bundle exec rake neo4j:install[community-2.3.0] neo4j:start default --trace"
language: ruby
cache: bundler
sudo: false
rvm:
- 2.2.0
- 2.3.0
gemfile: travis.gemfile
env:
global:
- TRAVISCI=1
matrix:
- NEO4J_VERSION=6.0.9
- NEO4J_VERSION=7.0.11
## Instruction:
Add latest versions of the neo4j gem
## Code After:
script: "bundle exec rake neo4j:install[community-2.3.0] neo4j:start default --trace"
language: ruby
cache: bundler
sudo: false
rvm:
- 2.2.0
- 2.3.0
gemfile: travis.gemfile
env:
global:
- TRAVISCI=1
matrix:
- NEO4J_VERSION=6.0.9
- NEO4J_VERSION=7.2.3
- NEO4J_VERSION=8.1.3
| script: "bundle exec rake neo4j:install[community-2.3.0] neo4j:start default --trace"
language: ruby
cache: bundler
sudo: false
rvm:
- 2.2.0
- 2.3.0
gemfile: travis.gemfile
env:
global:
- TRAVISCI=1
matrix:
- NEO4J_VERSION=6.0.9
- - NEO4J_VERSION=7.0.11
? ^ ^^
+ - NEO4J_VERSION=7.2.3
? ^ ^
+ - NEO4J_VERSION=8.1.3 | 3 | 0.214286 | 2 | 1 |
5c11eacde840820ed8e1aa877ff22da71f70b9db | app/controllers/sapi_user/sessions_controller.rb | app/controllers/sapi_user/sessions_controller.rb | class SapiUser::SessionsController < ::Devise::SessionsController
def new
@email = params[:user]
@autofocus_email = !@email.present?
super
end
end
| class SapiUser::SessionsController < ::Devise::SessionsController
before_action :is_authorised?, only: [:create]
def new
@email = params[:user]
@autofocus_email = !@email.present?
super
end
def is_authorised?
email = params[:sapi_user][:email]
user = Sapi::User.find_by_email(email)
if user && user.role != 'admin'
redirect_to new_sapi_user_session_path, flash: { alert: t('unauthorised') }
end
end
end
| Check authorisation for sapi user | Check authorisation for sapi user
| Ruby | mit | unepwcmc/trade_reporting_tool,unepwcmc/trade_reporting_tool,unepwcmc/trade_reporting_tool | ruby | ## Code Before:
class SapiUser::SessionsController < ::Devise::SessionsController
def new
@email = params[:user]
@autofocus_email = !@email.present?
super
end
end
## Instruction:
Check authorisation for sapi user
## Code After:
class SapiUser::SessionsController < ::Devise::SessionsController
before_action :is_authorised?, only: [:create]
def new
@email = params[:user]
@autofocus_email = !@email.present?
super
end
def is_authorised?
email = params[:sapi_user][:email]
user = Sapi::User.find_by_email(email)
if user && user.role != 'admin'
redirect_to new_sapi_user_session_path, flash: { alert: t('unauthorised') }
end
end
end
| class SapiUser::SessionsController < ::Devise::SessionsController
+ before_action :is_authorised?, only: [:create]
+
def new
@email = params[:user]
@autofocus_email = !@email.present?
super
end
+
+ def is_authorised?
+ email = params[:sapi_user][:email]
+ user = Sapi::User.find_by_email(email)
+ if user && user.role != 'admin'
+ redirect_to new_sapi_user_session_path, flash: { alert: t('unauthorised') }
+ end
+ end
end | 10 | 1.428571 | 10 | 0 |
de4cd1a6d79d33ba204da44bf5e324c4f48d1d0f | README.md | README.md | ISAAC
======================
ISAAC Object Chronicle Project
mvn clean deploy -DaltDeploymentRepository=serverId::default::http://artifactory.isaac.sh/artifactory/libs-snapshot
Release Notes
mvn jgitflow:release-start jgitflow:release-finish -DreleaseVersion=3.08 -DdevelopmentVersion=3.09-SNAPSHOT
To run HP Fortify scan on child projects (assuming Fortify application and license installed)
$ mvn -Dmaven.test.skip=true -Dfortify.sca.buildId={PROJECT_NAME} -Dfortify.sca.toplevel.artifactId=isaac-parent com.hpe.security.fortify.maven.plugin:sca-maven-plugin:clean
$ mvn -Dmaven.test.skip=true -Dfortify.sca.buildId={PROJECT_NAME} -Dfortify.sca.toplevel.artifactId=isaac-parent com.hpe.security.fortify.maven.plugin:sca-maven-plugin:translate
$ mvn -Dmaven.test.skip=true -Dfortify.sca.buildId={PROJECT_NAME} -Dfortify.sca.toplevel.artifactId=isaac-parent com.hpe.security.fortify.maven.plugin:sca-maven-plugin:scan
| ISAAC
======================
ISAAC Object Chronicle Project
To deploy, set a profile in your settings.xml with the repository you want to deploy to,
patterned after these entries:
<profile>
<id>release-deploy</id>
<properties>
<altDeploymentRepository>central::default::http://artifactory.isaac.sh/artifactory/libs-release-local</altDeploymentRepository>
</properties>
</profile>
<profile>
<id>snapshot-deploy</id>
<properties>
<altDeploymentRepository>central::default::http://artifactory.isaac.sh/artifactory/libs-snapshot-local</altDeploymentRepository>
</properties>
</profile>
mvn clean deploy -Psnapshot-deploy
Release Notes
mvn jgitflow:release-start jgitflow:release-finish -DreleaseVersion=3.08 -DdevelopmentVersion=3.09-SNAPSHOT
mvn jgitflow:release-start jgitflow:release-finish -Prelease-deploy | Update readme with deploy instructions. | Update readme with deploy instructions.
| Markdown | apache-2.0 | OSEHRA/ISAAC,OSEHRA/ISAAC,OSEHRA/ISAAC | markdown | ## Code Before:
ISAAC
======================
ISAAC Object Chronicle Project
mvn clean deploy -DaltDeploymentRepository=serverId::default::http://artifactory.isaac.sh/artifactory/libs-snapshot
Release Notes
mvn jgitflow:release-start jgitflow:release-finish -DreleaseVersion=3.08 -DdevelopmentVersion=3.09-SNAPSHOT
To run HP Fortify scan on child projects (assuming Fortify application and license installed)
$ mvn -Dmaven.test.skip=true -Dfortify.sca.buildId={PROJECT_NAME} -Dfortify.sca.toplevel.artifactId=isaac-parent com.hpe.security.fortify.maven.plugin:sca-maven-plugin:clean
$ mvn -Dmaven.test.skip=true -Dfortify.sca.buildId={PROJECT_NAME} -Dfortify.sca.toplevel.artifactId=isaac-parent com.hpe.security.fortify.maven.plugin:sca-maven-plugin:translate
$ mvn -Dmaven.test.skip=true -Dfortify.sca.buildId={PROJECT_NAME} -Dfortify.sca.toplevel.artifactId=isaac-parent com.hpe.security.fortify.maven.plugin:sca-maven-plugin:scan
## Instruction:
Update readme with deploy instructions.
## Code After:
ISAAC
======================
ISAAC Object Chronicle Project
To deploy, set a profile in your settings.xml with the repository you want to deploy to,
patterned after these entries:
<profile>
<id>release-deploy</id>
<properties>
<altDeploymentRepository>central::default::http://artifactory.isaac.sh/artifactory/libs-release-local</altDeploymentRepository>
</properties>
</profile>
<profile>
<id>snapshot-deploy</id>
<properties>
<altDeploymentRepository>central::default::http://artifactory.isaac.sh/artifactory/libs-snapshot-local</altDeploymentRepository>
</properties>
</profile>
mvn clean deploy -Psnapshot-deploy
Release Notes
mvn jgitflow:release-start jgitflow:release-finish -DreleaseVersion=3.08 -DdevelopmentVersion=3.09-SNAPSHOT
mvn jgitflow:release-start jgitflow:release-finish -Prelease-deploy | ISAAC
======================
ISAAC Object Chronicle Project
- mvn clean deploy -DaltDeploymentRepository=serverId::default::http://artifactory.isaac.sh/artifactory/libs-snapshot
+ To deploy, set a profile in your settings.xml with the repository you want to deploy to,
+ patterned after these entries:
+
+ <profile>
+ <id>release-deploy</id>
+ <properties>
+ <altDeploymentRepository>central::default::http://artifactory.isaac.sh/artifactory/libs-release-local</altDeploymentRepository>
+ </properties>
+ </profile>
+
+ <profile>
+ <id>snapshot-deploy</id>
+ <properties>
+ <altDeploymentRepository>central::default::http://artifactory.isaac.sh/artifactory/libs-snapshot-local</altDeploymentRepository>
+ </properties>
+ </profile>
+
+
+
+ mvn clean deploy -Psnapshot-deploy
Release Notes
mvn jgitflow:release-start jgitflow:release-finish -DreleaseVersion=3.08 -DdevelopmentVersion=3.09-SNAPSHOT
+ mvn jgitflow:release-start jgitflow:release-finish -Prelease-deploy
- To run HP Fortify scan on child projects (assuming Fortify application and license installed)
- $ mvn -Dmaven.test.skip=true -Dfortify.sca.buildId={PROJECT_NAME} -Dfortify.sca.toplevel.artifactId=isaac-parent com.hpe.security.fortify.maven.plugin:sca-maven-plugin:clean
- $ mvn -Dmaven.test.skip=true -Dfortify.sca.buildId={PROJECT_NAME} -Dfortify.sca.toplevel.artifactId=isaac-parent com.hpe.security.fortify.maven.plugin:sca-maven-plugin:translate
- $ mvn -Dmaven.test.skip=true -Dfortify.sca.buildId={PROJECT_NAME} -Dfortify.sca.toplevel.artifactId=isaac-parent com.hpe.security.fortify.maven.plugin:sca-maven-plugin:scan
-
-
- | 29 | 1.705882 | 21 | 8 |
2bad57e7d39efa06204dbed7dce8834c29d1ebcb | modules/govuk/templates/node/s_graphite/remove_old_whisper_data.erb | modules/govuk/templates/node/s_graphite/remove_old_whisper_data.erb |
WHISPER_DIR='<%= @graphite_path %>/storage/whisper'
for dir in $(ls $WHISPER_DIR); do
if [[ -z "$(find $WHISPER_DIR/$dir -mtime -14 )" && $? -eq 0 ]] ; then
if [[ ! -z $WHISPER_DIR && ! -z $dir ]] ; then
rm -fr $WHISPER_DIR/$dir;
fi
fi
done
|
whisper_dir='<%= @graphite_path %>/storage/whisper'
# Delete files which haven't been modified in over 2 years
find $whisper_dir -type f -mtime +730 -delete
<%- if scope.lookupvar('::aws_migration') %>
# Delete directories where none of the files inside have been modified in the
# last 14 days. This effectively removes stats about machines which no longer
# exist.
for dir in $whisper_dir/*; do
if [[ ! -z $dir && -z "$(find $dir -mtime -14)" && $? -eq 0 ]]; then
rm -rf $dir;
fi
done
<% end -%>
# Delete empty directories
find $whisper_dir -type d -empty -delete
| Improve script to remove old whisper data | Improve script to remove old whisper data
This documents the current behaviour and slightly refactors it
so it's easier to read.
It also automatically clears out data that hasn't been modified in
the last 2 years and removes any empty directories.
| HTML+ERB | mit | alphagov/govuk-puppet,alphagov/govuk-puppet,alphagov/govuk-puppet,alphagov/govuk-puppet,alphagov/govuk-puppet,alphagov/govuk-puppet | html+erb | ## Code Before:
WHISPER_DIR='<%= @graphite_path %>/storage/whisper'
for dir in $(ls $WHISPER_DIR); do
if [[ -z "$(find $WHISPER_DIR/$dir -mtime -14 )" && $? -eq 0 ]] ; then
if [[ ! -z $WHISPER_DIR && ! -z $dir ]] ; then
rm -fr $WHISPER_DIR/$dir;
fi
fi
done
## Instruction:
Improve script to remove old whisper data
This documents the current behaviour and slightly refactors it
so it's easier to read.
It also automatically clears out data that hasn't been modified in
the last 2 years and removes any empty directories.
## Code After:
whisper_dir='<%= @graphite_path %>/storage/whisper'
# Delete files which haven't been modified in over 2 years
find $whisper_dir -type f -mtime +730 -delete
<%- if scope.lookupvar('::aws_migration') %>
# Delete directories where none of the files inside have been modified in the
# last 14 days. This effectively removes stats about machines which no longer
# exist.
for dir in $whisper_dir/*; do
if [[ ! -z $dir && -z "$(find $dir -mtime -14)" && $? -eq 0 ]]; then
rm -rf $dir;
fi
done
<% end -%>
# Delete empty directories
find $whisper_dir -type d -empty -delete
|
- WHISPER_DIR='<%= @graphite_path %>/storage/whisper'
? ^^^^^^^ ^^^
+ whisper_dir='<%= @graphite_path %>/storage/whisper'
? ^^^^^^^ ^^^
- for dir in $(ls $WHISPER_DIR); do
+ # Delete files which haven't been modified in over 2 years
+ find $whisper_dir -type f -mtime +730 -delete
+
+ <%- if scope.lookupvar('::aws_migration') %>
+ # Delete directories where none of the files inside have been modified in the
+ # last 14 days. This effectively removes stats about machines which no longer
+ # exist.
+ for dir in $whisper_dir/*; do
- if [[ -z "$(find $WHISPER_DIR/$dir -mtime -14 )" && $? -eq 0 ]] ; then
? ------------- - -
+ if [[ ! -z $dir && -z "$(find $dir -mtime -14)" && $? -eq 0 ]]; then
? +++++++++++++
+ rm -rf $dir;
- if [[ ! -z $WHISPER_DIR && ! -z $dir ]] ; then
- rm -fr $WHISPER_DIR/$dir;
- fi
fi
done
+ <% end -%>
+
+ # Delete empty directories
+ find $whisper_dir -type d -empty -delete | 21 | 2.1 | 15 | 6 |
400f2c698546b519f5a72bdd1fabd09a54501fa0 | _posts/de/0100-01-01-status.md | _posts/de/0100-01-01-status.md | ---
layout: default
permalink: /en/status/
lang: en
title: Translation Status
nosearch: true
---
## Translation Status - All Languages
- [Spanish]({{site.baseurl}}/es/status/)
| ---
layout: default
permalink: /de/status/
lang: de
title: Stand der Übersetzungen
nosearch: true
---
## Stand der Übersetzungen - Alle Sprachen
- [Spanish]({{site.baseurl}}/es/status/)
| Add German translation for "en/status" | Add German translation for "en/status"
| Markdown | mit | althio/learnosm,Nick-Tallguy/Nick-Tallguy.github.io,osmlab/teachosm,jmarlena/learnosm,althio/learnosm,jmarlena/learnosm,althio/learnosm,furaidochikin/learnosm,jmarlena/learnosm-ux-staging-site,hotosm/learnosm,Anwaario/Nick-Tallguy.github.io,Nick-Tallguy/Nick-Tallguy.github.io,feyeandal/test,jmarlena/learnosm-ux-staging-site,jmarlena/learnosm,jmarlena/learnosm-ux-staging-site,hotosm/learnosm,Nick-Tallguy/Nick-Tallguy.github.io,feyeandal/test,furaidochikin/learnosm,furaidochikin/learnosm,althio/learnosm,furaidochikin/learnosm,Anwaario/Nick-Tallguy.github.io,hotosm/learnosm,hotosm/learnosm,jmarlena/learnosm,feyeandal/test,Anwaario/Nick-Tallguy.github.io,osmlab/teachosm,Nick-Tallguy/Nick-Tallguy.github.io,Nick-Tallguy/Nick-Tallguy.github.io,feyeandal/test,jmarlena/learnosm-ux-staging-site,Anwaario/Nick-Tallguy.github.io | markdown | ## Code Before:
---
layout: default
permalink: /en/status/
lang: en
title: Translation Status
nosearch: true
---
## Translation Status - All Languages
- [Spanish]({{site.baseurl}}/es/status/)
## Instruction:
Add German translation for "en/status"
## Code After:
---
layout: default
permalink: /de/status/
lang: de
title: Stand der Übersetzungen
nosearch: true
---
## Stand der Übersetzungen - Alle Sprachen
- [Spanish]({{site.baseurl}}/es/status/)
| ---
layout: default
- permalink: /en/status/
? -
+ permalink: /de/status/
? +
- lang: en
? -
+ lang: de
? +
- title: Translation Status
+ title: Stand der Übersetzungen
nosearch: true
---
- ## Translation Status - All Languages
+ ## Stand der Übersetzungen - Alle Sprachen
- [Spanish]({{site.baseurl}}/es/status/) | 8 | 0.727273 | 4 | 4 |
98393056b58aad966e66f61d67756ec5bae8a1c7 | Example/Tabman-Example/PresetAppearanceConfigs.swift | Example/Tabman-Example/PresetAppearanceConfigs.swift | //
// PresetAppearanceConfigs.swift
// Tabman-Example
//
// Created by Merrick Sapsford on 10/03/2017.
// Copyright © 2017 Merrick Sapsford. All rights reserved.
//
import Foundation
import Tabman
class PresetAppearanceConfigs: Any {
static func forStyle(_ style: TabmanBar.Style, currentAppearance: TabmanBar.Appearance?) -> TabmanBar.Appearance? {
let appearance = currentAppearance ?? TabmanBar.Appearance.defaultAppearance
var view: UIView? = UIView()
let defaultTintColor = view!.tintColor
view = nil
switch style {
case .buttonBar, .bar:
appearance.state.color = UIColor.white.withAlphaComponent(0.6)
appearance.state.selectedColor = UIColor.white
appearance.style.background = .blur(style: .light)
appearance.indicator.color = UIColor.white
appearance.layout.itemVerticalPadding = 16.0
case .blockTabBar:
appearance.state.color = UIColor.white.withAlphaComponent(0.6)
appearance.state.selectedColor = defaultTintColor
appearance.style.background = .solid(color: UIColor.white.withAlphaComponent(0.3))
appearance.indicator.color = UIColor.white.withAlphaComponent(0.8)
default:()
}
return appearance
}
}
| //
// PresetAppearanceConfigs.swift
// Tabman-Example
//
// Created by Merrick Sapsford on 10/03/2017.
// Copyright © 2017 Merrick Sapsford. All rights reserved.
//
import Foundation
import Tabman
class PresetAppearanceConfigs: Any {
static func forStyle(_ style: TabmanBar.Style, currentAppearance: TabmanBar.Appearance?) -> TabmanBar.Appearance? {
let appearance = currentAppearance ?? TabmanBar.Appearance.defaultAppearance
var view: UIView? = UIView()
let defaultTintColor = view!.tintColor
view = nil
switch style {
case .bar:
appearance.style.background = .solid(color: .black)
appearance.indicator.color = .white
appearance.indicator.lineWeight = .thick
case .buttonBar:
appearance.state.color = UIColor.white.withAlphaComponent(0.6)
appearance.state.selectedColor = UIColor.white
appearance.style.background = .blur(style: .light)
appearance.indicator.color = UIColor.white
appearance.layout.itemVerticalPadding = 16.0
case .blockTabBar:
appearance.state.color = UIColor.white.withAlphaComponent(0.6)
appearance.state.selectedColor = defaultTintColor
appearance.style.background = .solid(color: UIColor.white.withAlphaComponent(0.3))
appearance.indicator.color = UIColor.white.withAlphaComponent(0.8)
default:()
}
return appearance
}
}
| Add example appearance config for .bar | Add example appearance config for .bar
| Swift | mit | MidnightPulse/Tabman,uias/Tabman,uias/Tabman,uias/Tabman,MidnightPulse/Tabman | swift | ## Code Before:
//
// PresetAppearanceConfigs.swift
// Tabman-Example
//
// Created by Merrick Sapsford on 10/03/2017.
// Copyright © 2017 Merrick Sapsford. All rights reserved.
//
import Foundation
import Tabman
class PresetAppearanceConfigs: Any {
static func forStyle(_ style: TabmanBar.Style, currentAppearance: TabmanBar.Appearance?) -> TabmanBar.Appearance? {
let appearance = currentAppearance ?? TabmanBar.Appearance.defaultAppearance
var view: UIView? = UIView()
let defaultTintColor = view!.tintColor
view = nil
switch style {
case .buttonBar, .bar:
appearance.state.color = UIColor.white.withAlphaComponent(0.6)
appearance.state.selectedColor = UIColor.white
appearance.style.background = .blur(style: .light)
appearance.indicator.color = UIColor.white
appearance.layout.itemVerticalPadding = 16.0
case .blockTabBar:
appearance.state.color = UIColor.white.withAlphaComponent(0.6)
appearance.state.selectedColor = defaultTintColor
appearance.style.background = .solid(color: UIColor.white.withAlphaComponent(0.3))
appearance.indicator.color = UIColor.white.withAlphaComponent(0.8)
default:()
}
return appearance
}
}
## Instruction:
Add example appearance config for .bar
## Code After:
//
// PresetAppearanceConfigs.swift
// Tabman-Example
//
// Created by Merrick Sapsford on 10/03/2017.
// Copyright © 2017 Merrick Sapsford. All rights reserved.
//
import Foundation
import Tabman
class PresetAppearanceConfigs: Any {
static func forStyle(_ style: TabmanBar.Style, currentAppearance: TabmanBar.Appearance?) -> TabmanBar.Appearance? {
let appearance = currentAppearance ?? TabmanBar.Appearance.defaultAppearance
var view: UIView? = UIView()
let defaultTintColor = view!.tintColor
view = nil
switch style {
case .bar:
appearance.style.background = .solid(color: .black)
appearance.indicator.color = .white
appearance.indicator.lineWeight = .thick
case .buttonBar:
appearance.state.color = UIColor.white.withAlphaComponent(0.6)
appearance.state.selectedColor = UIColor.white
appearance.style.background = .blur(style: .light)
appearance.indicator.color = UIColor.white
appearance.layout.itemVerticalPadding = 16.0
case .blockTabBar:
appearance.state.color = UIColor.white.withAlphaComponent(0.6)
appearance.state.selectedColor = defaultTintColor
appearance.style.background = .solid(color: UIColor.white.withAlphaComponent(0.3))
appearance.indicator.color = UIColor.white.withAlphaComponent(0.8)
default:()
}
return appearance
}
}
| //
// PresetAppearanceConfigs.swift
// Tabman-Example
//
// Created by Merrick Sapsford on 10/03/2017.
// Copyright © 2017 Merrick Sapsford. All rights reserved.
//
import Foundation
import Tabman
class PresetAppearanceConfigs: Any {
static func forStyle(_ style: TabmanBar.Style, currentAppearance: TabmanBar.Appearance?) -> TabmanBar.Appearance? {
let appearance = currentAppearance ?? TabmanBar.Appearance.defaultAppearance
var view: UIView? = UIView()
let defaultTintColor = view!.tintColor
view = nil
switch style {
+ case .bar:
+ appearance.style.background = .solid(color: .black)
+ appearance.indicator.color = .white
+ appearance.indicator.lineWeight = .thick
+
- case .buttonBar, .bar:
? ------
+ case .buttonBar:
appearance.state.color = UIColor.white.withAlphaComponent(0.6)
appearance.state.selectedColor = UIColor.white
appearance.style.background = .blur(style: .light)
appearance.indicator.color = UIColor.white
appearance.layout.itemVerticalPadding = 16.0
case .blockTabBar:
appearance.state.color = UIColor.white.withAlphaComponent(0.6)
appearance.state.selectedColor = defaultTintColor
appearance.style.background = .solid(color: UIColor.white.withAlphaComponent(0.3))
appearance.indicator.color = UIColor.white.withAlphaComponent(0.8)
default:()
}
return appearance
}
} | 7 | 0.170732 | 6 | 1 |
916a4eaee33b5ec1433d377b7a6be7a73a9940a8 | .github/PULL_REQUEST_TEMPLATE.md | .github/PULL_REQUEST_TEMPLATE.md | <!--
HOW TO WRITE A GOOD PULL REQUEST? https://doc.traefik.io/traefik/contributing/submitting-pull-requests/
-->
### What does this PR do?
<!-- A brief description of the change being made with this pull request. -->
### Motivation
<!-- What inspired you to submit this pull request? -->
### More
- [ ] Yes, I updated the [chart version](https://github.com/traefik/traefik-helm-chart/blob/9b32ed1b414cc0be1ad46bcb335fcfc93ded06f3/traefik/Chart.yaml#L5)
### Additional Notes
<!-- Anything else we should know when reviewing? -->
| <!--
HOW TO WRITE A GOOD PULL REQUEST? https://doc.traefik.io/traefik/contributing/submitting-pull-requests/
-->
### What does this PR do?
<!-- A brief description of the change being made with this pull request. -->
### Motivation
<!-- What inspired you to submit this pull request? -->
### More
- [ ] Yes, I updated the tests accordingly
- [ ] Yes, I ran `make test` and all the tests passed
| Improve Pull Request template toward Code Quality | :memo: Improve Pull Request template toward Code Quality
| Markdown | apache-2.0 | traefik/traefik-helm-chart | markdown | ## Code Before:
<!--
HOW TO WRITE A GOOD PULL REQUEST? https://doc.traefik.io/traefik/contributing/submitting-pull-requests/
-->
### What does this PR do?
<!-- A brief description of the change being made with this pull request. -->
### Motivation
<!-- What inspired you to submit this pull request? -->
### More
- [ ] Yes, I updated the [chart version](https://github.com/traefik/traefik-helm-chart/blob/9b32ed1b414cc0be1ad46bcb335fcfc93ded06f3/traefik/Chart.yaml#L5)
### Additional Notes
<!-- Anything else we should know when reviewing? -->
## Instruction:
:memo: Improve Pull Request template toward Code Quality
## Code After:
<!--
HOW TO WRITE A GOOD PULL REQUEST? https://doc.traefik.io/traefik/contributing/submitting-pull-requests/
-->
### What does this PR do?
<!-- A brief description of the change being made with this pull request. -->
### Motivation
<!-- What inspired you to submit this pull request? -->
### More
- [ ] Yes, I updated the tests accordingly
- [ ] Yes, I ran `make test` and all the tests passed
| <!--
HOW TO WRITE A GOOD PULL REQUEST? https://doc.traefik.io/traefik/contributing/submitting-pull-requests/
-->
### What does this PR do?
<!-- A brief description of the change being made with this pull request. -->
### Motivation
<!-- What inspired you to submit this pull request? -->
### More
- - [ ] Yes, I updated the [chart version](https://github.com/traefik/traefik-helm-chart/blob/9b32ed1b414cc0be1ad46bcb335fcfc93ded06f3/traefik/Chart.yaml#L5)
+ - [ ] Yes, I updated the tests accordingly
+ - [ ] Yes, I ran `make test` and all the tests passed
- ### Additional Notes
-
- <!-- Anything else we should know when reviewing? --> | 6 | 0.26087 | 2 | 4 |
812141b9bb108b62b895c618155092acdf6a4a62 | Cargo.toml | Cargo.toml | [package]
name = "bcnotif"
version = "0.0.0"
authors = ["Acizza <jgit@tuta.io>"]
edition = "2018"
[dependencies]
anyhow = "~1.0.0"
dirs-next = "~1.0.0"
libc = "~0.2.0"
nix = "~0.17.0"
notify-rust = "~4.0.0"
num-traits = "~0.2.0"
num-derive = "~0.3.0"
once_cell = "~1.4.0"
parking_lot = "~0.11.0"
pico-args = { version = "~0.3.0", default-features = false }
serde = "~1.0.0"
serde_derive = "~1.0.0"
smallvec = "~1.4.0"
strum = "~0.18.0"
strum_macros = "~0.18.0"
thiserror = "~1.0.0"
toml = "~0.5.0"
ureq = "~1.2.0"
[dependencies.chrono]
version = "~0.4.0"
features = [ "serde" ]
[dependencies.diesel]
version = "~1.4.0"
default-features = false
features = [ "sqlite", "chrono" ]
[profile.release]
lto = true
codegen-units = 1 | [package]
name = "bcnotif"
version = "0.0.0"
authors = ["Acizza <jgit@tuta.io>"]
edition = "2018"
[dependencies]
anyhow = "~1.0.0"
dirs-next = "~1.0.0"
libc = "~0.2.0"
nix = "~0.17.0"
notify-rust = "~4.0.0"
num-traits = "~0.2.0"
num-derive = "~0.3.0"
once_cell = "~1.4.0"
parking_lot = "~0.11.0"
pico-args = { version = "~0.3.0", default-features = false }
serde = "~1.0.0"
serde_derive = "~1.0.0"
smallvec = "~1.4.0"
strum = "~0.18.0"
strum_macros = "~0.18.0"
thiserror = "~1.0.0"
toml = "~0.5.0"
ureq = "~1.2.0"
[dependencies.chrono]
version = "~0.4.0"
features = [ "serde" ]
[dependencies.diesel]
version = "~1.4.0"
default-features = false
features = [ "sqlite", "chrono" ]
[profile.release]
lto = true
codegen-units = 1
panic = "abort"
| Enable panic = "abort" for release builds | Enable panic = "abort" for release builds
This avoids having unwinding code getting built into the final binary. Has the potential to improve performance in some cases and reduce the final binary size.
No threads in the program panic if something fails, so this should not introduce any kind of crashing.
| TOML | agpl-3.0 | Acizza/bcnotif | toml | ## Code Before:
[package]
name = "bcnotif"
version = "0.0.0"
authors = ["Acizza <jgit@tuta.io>"]
edition = "2018"
[dependencies]
anyhow = "~1.0.0"
dirs-next = "~1.0.0"
libc = "~0.2.0"
nix = "~0.17.0"
notify-rust = "~4.0.0"
num-traits = "~0.2.0"
num-derive = "~0.3.0"
once_cell = "~1.4.0"
parking_lot = "~0.11.0"
pico-args = { version = "~0.3.0", default-features = false }
serde = "~1.0.0"
serde_derive = "~1.0.0"
smallvec = "~1.4.0"
strum = "~0.18.0"
strum_macros = "~0.18.0"
thiserror = "~1.0.0"
toml = "~0.5.0"
ureq = "~1.2.0"
[dependencies.chrono]
version = "~0.4.0"
features = [ "serde" ]
[dependencies.diesel]
version = "~1.4.0"
default-features = false
features = [ "sqlite", "chrono" ]
[profile.release]
lto = true
codegen-units = 1
## Instruction:
Enable panic = "abort" for release builds
This avoids having unwinding code getting built into the final binary. Has the potential to improve performance in some cases and reduce the final binary size.
No threads in the program panic if something fails, so this should not introduce any kind of crashing.
## Code After:
[package]
name = "bcnotif"
version = "0.0.0"
authors = ["Acizza <jgit@tuta.io>"]
edition = "2018"
[dependencies]
anyhow = "~1.0.0"
dirs-next = "~1.0.0"
libc = "~0.2.0"
nix = "~0.17.0"
notify-rust = "~4.0.0"
num-traits = "~0.2.0"
num-derive = "~0.3.0"
once_cell = "~1.4.0"
parking_lot = "~0.11.0"
pico-args = { version = "~0.3.0", default-features = false }
serde = "~1.0.0"
serde_derive = "~1.0.0"
smallvec = "~1.4.0"
strum = "~0.18.0"
strum_macros = "~0.18.0"
thiserror = "~1.0.0"
toml = "~0.5.0"
ureq = "~1.2.0"
[dependencies.chrono]
version = "~0.4.0"
features = [ "serde" ]
[dependencies.diesel]
version = "~1.4.0"
default-features = false
features = [ "sqlite", "chrono" ]
[profile.release]
lto = true
codegen-units = 1
panic = "abort"
| [package]
name = "bcnotif"
version = "0.0.0"
authors = ["Acizza <jgit@tuta.io>"]
edition = "2018"
[dependencies]
anyhow = "~1.0.0"
dirs-next = "~1.0.0"
libc = "~0.2.0"
nix = "~0.17.0"
notify-rust = "~4.0.0"
num-traits = "~0.2.0"
num-derive = "~0.3.0"
once_cell = "~1.4.0"
parking_lot = "~0.11.0"
pico-args = { version = "~0.3.0", default-features = false }
serde = "~1.0.0"
serde_derive = "~1.0.0"
smallvec = "~1.4.0"
strum = "~0.18.0"
strum_macros = "~0.18.0"
thiserror = "~1.0.0"
toml = "~0.5.0"
ureq = "~1.2.0"
[dependencies.chrono]
version = "~0.4.0"
features = [ "serde" ]
[dependencies.diesel]
version = "~1.4.0"
default-features = false
features = [ "sqlite", "chrono" ]
[profile.release]
lto = true
codegen-units = 1
+ panic = "abort" | 1 | 0.026316 | 1 | 0 |
4b614e1f59c958d76a68cacc03dd6e13652f9af6 | module/Guestbook/src/Guestbook/Controller/IndexController.php | module/Guestbook/src/Guestbook/Controller/IndexController.php | <?php
namespace Guestbook\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\Stdlib\ResponseInterface as Response;
use Zend\View\Model\ViewModel;
class IndexController extends AbstractActionController
{
public function indexAction()
{
$prg = $this->prg();
$entryForm = $this->getServiceLocator()->get('guestbook_entry_form');
$entryService = $this->getServiceLocator()->get('guestbook_entry_service');
if ($prg instanceof Response) {
return $prg;
} elseif ($prg !== false) {
$entry = $entryService->add($prg);
if ($entry) {
return $this->redirect()->toRoute('guestbook');
}
}
return new ViewModel(array(
'entryForm' => $entryForm,
'entries' => $entryService->findAll()
));
}
}
| <?php
namespace Guestbook\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
class IndexController extends AbstractActionController
{
public function indexAction()
{
$entryForm = $this->getServiceLocator()->get('guestbook_entry_form');
$entryService = $this->getServiceLocator()->get('guestbook_entry_service');
$request = $this->getRequest();
if ($request->isPost()) {
$data = $request->getPost()->toArray();
$entry = $entryService->add($data);
if ($entry) {
return $this->redirect()->toRoute('guestbook');
}
}
return new ViewModel(array(
'entryForm' => $entryForm,
'entries' => $entryService->findAll()
));
}
}
| Use post param in controller | Use post param in controller
| PHP | bsd-3-clause | Gab-Santini/guestbook,Gab-Santini/guestbook | php | ## Code Before:
<?php
namespace Guestbook\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\Stdlib\ResponseInterface as Response;
use Zend\View\Model\ViewModel;
class IndexController extends AbstractActionController
{
public function indexAction()
{
$prg = $this->prg();
$entryForm = $this->getServiceLocator()->get('guestbook_entry_form');
$entryService = $this->getServiceLocator()->get('guestbook_entry_service');
if ($prg instanceof Response) {
return $prg;
} elseif ($prg !== false) {
$entry = $entryService->add($prg);
if ($entry) {
return $this->redirect()->toRoute('guestbook');
}
}
return new ViewModel(array(
'entryForm' => $entryForm,
'entries' => $entryService->findAll()
));
}
}
## Instruction:
Use post param in controller
## Code After:
<?php
namespace Guestbook\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
class IndexController extends AbstractActionController
{
public function indexAction()
{
$entryForm = $this->getServiceLocator()->get('guestbook_entry_form');
$entryService = $this->getServiceLocator()->get('guestbook_entry_service');
$request = $this->getRequest();
if ($request->isPost()) {
$data = $request->getPost()->toArray();
$entry = $entryService->add($data);
if ($entry) {
return $this->redirect()->toRoute('guestbook');
}
}
return new ViewModel(array(
'entryForm' => $entryForm,
'entries' => $entryService->findAll()
));
}
}
| <?php
namespace Guestbook\Controller;
use Zend\Mvc\Controller\AbstractActionController;
- use Zend\Stdlib\ResponseInterface as Response;
use Zend\View\Model\ViewModel;
class IndexController extends AbstractActionController
{
public function indexAction()
{
- $prg = $this->prg();
+
$entryForm = $this->getServiceLocator()->get('guestbook_entry_form');
$entryService = $this->getServiceLocator()->get('guestbook_entry_service');
- if ($prg instanceof Response) {
- return $prg;
- } elseif ($prg !== false) {
+ $request = $this->getRequest();
+ if ($request->isPost()) {
+ $data = $request->getPost()->toArray();
- $entry = $entryService->add($prg);
? ^^^
+ $entry = $entryService->add($data);
? ^^^^
if ($entry) {
return $this->redirect()->toRoute('guestbook');
}
- }
+ }
? ++
return new ViewModel(array(
'entryForm' => $entryForm,
'entries' => $entryService->findAll()
));
}
} | 13 | 0.419355 | 6 | 7 |
1e0308d71876e11cc7850204f48067f602a89b5d | RELEASE.md | RELEASE.md |
- Change version in setup.py and troposphere/\_\_init\_\_.py
- Update CHANGELOG.md with changes made since last release
- Create a signed tag: ```git tag --sign -m "Release 1.1.1" 1.1.1```
- Create PyPI release: ```python setup.py sdist upload --sign```
- Push commits: ```git push```
- Push tag: ```git push --tags```
- Update github release page: https://github.com/cloudtools/troposphere/releases
|
- Change version in setup.py and troposphere/\_\_init\_\_.py
- Update CHANGELOG.md with changes made since last release
- Create a signed tag: ```git tag --sign -m "Release 1.1.1" 1.1.1```
- Create PyPI release: ```python setup.py sdist upload --sign```
- Push commits: ```git push```
- Push tag: ```git push --tags```
- Update github release page: https://github.com/cloudtools/troposphere/releases
# Helper to create CHANGELOG entries
git log --reverse --pretty=format:"%s" | tail -100 | sed 's/^/- /'
# Helper to list supported resources
grep -h 'resource_type = "AWS::' troposphere/* | sed 's/[ ]*resource_type = "'// | cut -f1-3 -d: | sort | uniq | sed 's/^/- /'
| Add some helper shell commands | Add some helper shell commands
| Markdown | bsd-2-clause | ikben/troposphere,ikben/troposphere,cloudtools/troposphere,johnctitus/troposphere,pas256/troposphere,johnctitus/troposphere,pas256/troposphere,cloudtools/troposphere | markdown | ## Code Before:
- Change version in setup.py and troposphere/\_\_init\_\_.py
- Update CHANGELOG.md with changes made since last release
- Create a signed tag: ```git tag --sign -m "Release 1.1.1" 1.1.1```
- Create PyPI release: ```python setup.py sdist upload --sign```
- Push commits: ```git push```
- Push tag: ```git push --tags```
- Update github release page: https://github.com/cloudtools/troposphere/releases
## Instruction:
Add some helper shell commands
## Code After:
- Change version in setup.py and troposphere/\_\_init\_\_.py
- Update CHANGELOG.md with changes made since last release
- Create a signed tag: ```git tag --sign -m "Release 1.1.1" 1.1.1```
- Create PyPI release: ```python setup.py sdist upload --sign```
- Push commits: ```git push```
- Push tag: ```git push --tags```
- Update github release page: https://github.com/cloudtools/troposphere/releases
# Helper to create CHANGELOG entries
git log --reverse --pretty=format:"%s" | tail -100 | sed 's/^/- /'
# Helper to list supported resources
grep -h 'resource_type = "AWS::' troposphere/* | sed 's/[ ]*resource_type = "'// | cut -f1-3 -d: | sort | uniq | sed 's/^/- /'
|
- Change version in setup.py and troposphere/\_\_init\_\_.py
- Update CHANGELOG.md with changes made since last release
- Create a signed tag: ```git tag --sign -m "Release 1.1.1" 1.1.1```
- Create PyPI release: ```python setup.py sdist upload --sign```
- Push commits: ```git push```
- Push tag: ```git push --tags```
- Update github release page: https://github.com/cloudtools/troposphere/releases
+
+
+ # Helper to create CHANGELOG entries
+ git log --reverse --pretty=format:"%s" | tail -100 | sed 's/^/- /'
+
+ # Helper to list supported resources
+ grep -h 'resource_type = "AWS::' troposphere/* | sed 's/[ ]*resource_type = "'// | cut -f1-3 -d: | sort | uniq | sed 's/^/- /' | 7 | 0.875 | 7 | 0 |
784e6840f3256a1456d3354c60dd2baea1bcb4b8 | .github/workflows/release.yml | .github/workflows/release.yml | name: Release
on:
push:
branches: [master,main]
tags: ["*"]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
with:
fetch-depth: 0
- uses: cachix/install-nix-action@v12
- name: Lint check
run: nix-shell --run 'sbt -Dsbt.supershell=false check'
- name: Publish ${{ github.ref }}
run: nix-shell --run 'sbt -Dsbt.supershell=false ci-release'
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
- name: Build website
run: nix-shell --run 'sbt docs/docusaurusCreateSite'
- name: Publish gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./website/build
force_orphan: true
| name: Release
on:
push:
branches: [master,main]
tags: ["*"]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
with:
fetch-depth: 0
- uses: cachix/install-nix-action@v12
- name: Lint check
run: nix-shell --run 'sbt -Dsbt.supershell=false check'
- name: Publish ${{ github.ref }}
run: nix-shell --run 'sbt -Dsbt.supershell=false ci-release'
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
- name: Build website
run: nix-shell --run 'sbt docs/docusaurusCreateSite'
- name: Publish gh-pages
run: nix-shell --run 'sbt -Dsbt.supershell=false sbt/docusaurusPublishGhpages'
env:
GIT_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
| Use mdoc plugin to deploy site to gh-pages | Use mdoc plugin to deploy site to gh-pages
| YAML | apache-2.0 | cirg-up/cilib | yaml | ## Code Before:
name: Release
on:
push:
branches: [master,main]
tags: ["*"]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
with:
fetch-depth: 0
- uses: cachix/install-nix-action@v12
- name: Lint check
run: nix-shell --run 'sbt -Dsbt.supershell=false check'
- name: Publish ${{ github.ref }}
run: nix-shell --run 'sbt -Dsbt.supershell=false ci-release'
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
- name: Build website
run: nix-shell --run 'sbt docs/docusaurusCreateSite'
- name: Publish gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./website/build
force_orphan: true
## Instruction:
Use mdoc plugin to deploy site to gh-pages
## Code After:
name: Release
on:
push:
branches: [master,main]
tags: ["*"]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
with:
fetch-depth: 0
- uses: cachix/install-nix-action@v12
- name: Lint check
run: nix-shell --run 'sbt -Dsbt.supershell=false check'
- name: Publish ${{ github.ref }}
run: nix-shell --run 'sbt -Dsbt.supershell=false ci-release'
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
- name: Build website
run: nix-shell --run 'sbt docs/docusaurusCreateSite'
- name: Publish gh-pages
run: nix-shell --run 'sbt -Dsbt.supershell=false sbt/docusaurusPublishGhpages'
env:
GIT_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
| name: Release
on:
push:
branches: [master,main]
tags: ["*"]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
with:
fetch-depth: 0
- uses: cachix/install-nix-action@v12
- name: Lint check
run: nix-shell --run 'sbt -Dsbt.supershell=false check'
- name: Publish ${{ github.ref }}
run: nix-shell --run 'sbt -Dsbt.supershell=false ci-release'
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
- name: Build website
run: nix-shell --run 'sbt docs/docusaurusCreateSite'
- name: Publish gh-pages
- uses: peaceiris/actions-gh-pages@v3
- with:
+ run: nix-shell --run 'sbt -Dsbt.supershell=false sbt/docusaurusPublishGhpages'
+ env:
- deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
? ^^^^^^ ^^^
+ GIT_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
? ^^^ ^^^^^^^^^^
- publish_dir: ./website/build
- force_orphan: true | 8 | 0.222222 | 3 | 5 |
6e553c5820fb776d7793495c5ad9a60dca8c97a3 | src/SilexSkel/Controller/IndexController.php | src/SilexSkel/Controller/IndexController.php | <?php
namespace SilexSkel\Controller;
use Silex\Application;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
/**
* @author Davi Marcondes Moreira (@devdrops) <davi.marcondes.moreira@gmail.com>
*/
class IndexController
{
public function indexAction(Request $request, Application $app)
{
return new Response("DONE");
}
}
| <?php
namespace SilexSkel\Controller;
use Silex\Application;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
/**
* @author Davi Marcondes Moreira (@devdrops) <davi.marcondes.moreira@gmail.com>
*/
class IndexController
{
public function indexAction(Request $request, Application $app)
{
return new Response("<h1>Silex Skeleton Index Page, yay!</h1>");
}
}
| Update on home page message. | Update on home page message.
| PHP | mit | devdrops/openshift-silex-application,devdrops/openshift-silex-application | php | ## Code Before:
<?php
namespace SilexSkel\Controller;
use Silex\Application;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
/**
* @author Davi Marcondes Moreira (@devdrops) <davi.marcondes.moreira@gmail.com>
*/
class IndexController
{
public function indexAction(Request $request, Application $app)
{
return new Response("DONE");
}
}
## Instruction:
Update on home page message.
## Code After:
<?php
namespace SilexSkel\Controller;
use Silex\Application;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
/**
* @author Davi Marcondes Moreira (@devdrops) <davi.marcondes.moreira@gmail.com>
*/
class IndexController
{
public function indexAction(Request $request, Application $app)
{
return new Response("<h1>Silex Skeleton Index Page, yay!</h1>");
}
}
| <?php
namespace SilexSkel\Controller;
use Silex\Application;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
/**
* @author Davi Marcondes Moreira (@devdrops) <davi.marcondes.moreira@gmail.com>
*/
class IndexController
{
public function indexAction(Request $request, Application $app)
{
- return new Response("DONE");
+ return new Response("<h1>Silex Skeleton Index Page, yay!</h1>");
}
} | 2 | 0.111111 | 1 | 1 |
3c456909837247db3671bf0c2d0776d7d731b858 | articles/guides/login/migrating-lock-v10-webapp.md | articles/guides/login/migrating-lock-v10-webapp.md | ---
title: Moving Web Applications using Lock to Centralized Login
description: Learn how to migrate from Web Applications using Lock to Centralized Login
toc: true
---
# Migrate Web Applications using Lock 10+ to Centralized Login
This document explains how to migrate Web Applications using Lock 10+ to centralized login. For other migration scenarios see [Migrating from Embedded to Centralized Login](/guides/login/migration-embedded-centralized).
When you use Lock in a Web Application, your code does basically this:
1. Initialize Lock using `responseType = 'code'`:
```js
var lock = new Auth0Lock('${account.clientId}', '${account.namespace}', {
auth: {
redirectUrl: '${account.callback}',
responseType: 'code',
params: {
scope: 'openid profile email'
}
}
});
```
2. Show Lock when a login is required:
```js
function login() {
lock.show();
}
```
<%= include('_includes/_centralized_webapp') %> | ---
title: Moving Web Applications using Lock to Centralized Login
description: Learn how to migrate from Web Applications using Lock to Centralized Login
toc: true
---
# Migrate Web Applications using Lock 10+ to Centralized Login
This document explains how to migrate Web Applications using [Lock 10+](/libraries/lock) to centralized login. For other migration scenarios see [Migrating from Embedded to Centralized Login](/guides/login/migration-embedded-centralized).
When you use Lock in a Web Application, your code does basically this:
1. Initialize Lock using `responseType = 'code'`:
```js
var lock = new Auth0Lock('${account.clientId}', '${account.namespace}', {
auth: {
redirectUrl: '${account.callback}',
responseType: 'code',
params: {
scope: 'openid profile email'
}
}
});
```
2. Show Lock when a login is required:
```js
function login() {
lock.show();
}
```
<%= include('_includes/_centralized_webapp') %>
| Add link to Lock doc | Add link to Lock doc | Markdown | mit | yvonnewilson/docs,jeffreylees/docs,auth0/docs,yvonnewilson/docs,auth0/docs,auth0/docs,yvonnewilson/docs,jeffreylees/docs,jeffreylees/docs | markdown | ## Code Before:
---
title: Moving Web Applications using Lock to Centralized Login
description: Learn how to migrate from Web Applications using Lock to Centralized Login
toc: true
---
# Migrate Web Applications using Lock 10+ to Centralized Login
This document explains how to migrate Web Applications using Lock 10+ to centralized login. For other migration scenarios see [Migrating from Embedded to Centralized Login](/guides/login/migration-embedded-centralized).
When you use Lock in a Web Application, your code does basically this:
1. Initialize Lock using `responseType = 'code'`:
```js
var lock = new Auth0Lock('${account.clientId}', '${account.namespace}', {
auth: {
redirectUrl: '${account.callback}',
responseType: 'code',
params: {
scope: 'openid profile email'
}
}
});
```
2. Show Lock when a login is required:
```js
function login() {
lock.show();
}
```
<%= include('_includes/_centralized_webapp') %>
## Instruction:
Add link to Lock doc
## Code After:
---
title: Moving Web Applications using Lock to Centralized Login
description: Learn how to migrate from Web Applications using Lock to Centralized Login
toc: true
---
# Migrate Web Applications using Lock 10+ to Centralized Login
This document explains how to migrate Web Applications using [Lock 10+](/libraries/lock) to centralized login. For other migration scenarios see [Migrating from Embedded to Centralized Login](/guides/login/migration-embedded-centralized).
When you use Lock in a Web Application, your code does basically this:
1. Initialize Lock using `responseType = 'code'`:
```js
var lock = new Auth0Lock('${account.clientId}', '${account.namespace}', {
auth: {
redirectUrl: '${account.callback}',
responseType: 'code',
params: {
scope: 'openid profile email'
}
}
});
```
2. Show Lock when a login is required:
```js
function login() {
lock.show();
}
```
<%= include('_includes/_centralized_webapp') %>
| ---
title: Moving Web Applications using Lock to Centralized Login
description: Learn how to migrate from Web Applications using Lock to Centralized Login
toc: true
---
# Migrate Web Applications using Lock 10+ to Centralized Login
- This document explains how to migrate Web Applications using Lock 10+ to centralized login. For other migration scenarios see [Migrating from Embedded to Centralized Login](/guides/login/migration-embedded-centralized).
+ This document explains how to migrate Web Applications using [Lock 10+](/libraries/lock) to centralized login. For other migration scenarios see [Migrating from Embedded to Centralized Login](/guides/login/migration-embedded-centralized).
? + ++++++++++++++++++
When you use Lock in a Web Application, your code does basically this:
1. Initialize Lock using `responseType = 'code'`:
```js
var lock = new Auth0Lock('${account.clientId}', '${account.namespace}', {
auth: {
redirectUrl: '${account.callback}',
responseType: 'code',
params: {
scope: 'openid profile email'
}
}
});
```
2. Show Lock when a login is required:
```js
function login() {
lock.show();
}
```
<%= include('_includes/_centralized_webapp') %> | 2 | 0.060606 | 1 | 1 |
56cde7a0a93a733e0f2958837f935b1446214168 | tests/test_artefacts.py | tests/test_artefacts.py | import pytest
from plumbium import artefacts
def test_NiiGzImage_basename():
img = artefacts.NiiGzImage('foo.nii.gz')
assert img.basename == 'foo'
def test_NiiGzImage_bad_extension():
with pytest.raises(ValueError):
img = artefacts.NiiGzImage('foo.nii.gx')
| import pytest
from plumbium import artefacts
def test_Artefact_basename():
img = artefacts.Artefact('foo.nii.gz', '.nii.gz')
assert img.basename == 'foo'
def test_Artefact_repr():
img = artefacts.Artefact('foo.nii.gz', '.nii.gz')
assert repr(img) == "Artefact('foo.nii.gz')"
def test_NiiGzImage_bad_extension():
with pytest.raises(ValueError):
img = artefacts.NiiGzImage('foo.nii.gx')
def test_TextFile_bad_extension():
with pytest.raises(ValueError):
img = artefacts.NiiGzImage('foo.txx')
| Improve test coverage of artefact module | Improve test coverage of artefact module
| Python | mit | jstutters/Plumbium | python | ## Code Before:
import pytest
from plumbium import artefacts
def test_NiiGzImage_basename():
img = artefacts.NiiGzImage('foo.nii.gz')
assert img.basename == 'foo'
def test_NiiGzImage_bad_extension():
with pytest.raises(ValueError):
img = artefacts.NiiGzImage('foo.nii.gx')
## Instruction:
Improve test coverage of artefact module
## Code After:
import pytest
from plumbium import artefacts
def test_Artefact_basename():
img = artefacts.Artefact('foo.nii.gz', '.nii.gz')
assert img.basename == 'foo'
def test_Artefact_repr():
img = artefacts.Artefact('foo.nii.gz', '.nii.gz')
assert repr(img) == "Artefact('foo.nii.gz')"
def test_NiiGzImage_bad_extension():
with pytest.raises(ValueError):
img = artefacts.NiiGzImage('foo.nii.gx')
def test_TextFile_bad_extension():
with pytest.raises(ValueError):
img = artefacts.NiiGzImage('foo.txx')
| import pytest
from plumbium import artefacts
- def test_NiiGzImage_basename():
- img = artefacts.NiiGzImage('foo.nii.gz')
+ def test_Artefact_basename():
+ img = artefacts.Artefact('foo.nii.gz', '.nii.gz')
assert img.basename == 'foo'
+
+
+ def test_Artefact_repr():
+ img = artefacts.Artefact('foo.nii.gz', '.nii.gz')
+ assert repr(img) == "Artefact('foo.nii.gz')"
def test_NiiGzImage_bad_extension():
with pytest.raises(ValueError):
img = artefacts.NiiGzImage('foo.nii.gx')
+
+
+ def test_TextFile_bad_extension():
+ with pytest.raises(ValueError):
+ img = artefacts.NiiGzImage('foo.txx') | 14 | 1.166667 | 12 | 2 |
32399374612786a7bafd9287a75f544b602d6452 | indico/modules/events/management/templates/delete_event.html | indico/modules/events/management/templates/delete_event.html | {% extends 'layout/base.html' %}
{% block title %}{% trans %}You are about to delete the whole event!{% endtrans %}{% endblock %}
{% block content %}
<form method="POST" class="i-form vertical js-form-confirm-delete">
<input type="hidden" name="csrf_token" value="{{ session.csrf_token }}">
<h2>{{ event.title }}</h2>
<div class="form-group danger-message-box large-icon">
<div class="message-text">
{% trans -%}
Please note that if you delete the event you will lose all the information contained in it.<br>
<strong>This operation is irreversible!</strong>
{%- endtrans %}
</div>
<div class="message-box-footer confirm-delete-block">
<input id="js-confirm-delete" type="checkbox">
<label for="js-confirm-delete">
{% trans %}I understand what this means. Please go ahead.{% endtrans %}
</label>
</div>
</div>
<div class="form-group form-group-footer">
<div class="form-field">
<button id="js-button-delete" class="i-button big danger right" disabled>
{% trans %}Delete event{% endtrans %}
</button>
<button id="js-button-close" class="i-button big right" data-button-back>
{% trans %}I've changed my mind!{% endtrans %}
</button>
</div>
</div>
</form>
<script>
$('#js-confirm-delete').on('change', function() {
$('#js-button-delete').prop('disabled', !this.checked);
});
</script>
{% endblock %}
| {% from 'confirmation_dialog.html' import confirmation_dialog %}
{% set confirmation_message %}
{% trans -%}
Please note that if you delete the event you will lose all the information contained in it.
This operation is irreversible!
{%- endtrans %}
{% endset %}
{% call confirmation_dialog('danger', message=confirmation_message, ok_text=_('Delete event')) %}
{% trans event_title=event.title %}
You are about to <strong>delete</strong> the whole event "<strong>{{ event_title }}</strong>"!
{% endtrans %}
{% endcall %}
| Use confirmation_dialog when deleting an Event | Use confirmation_dialog when deleting an Event
| HTML | mit | mvidalgarcia/indico,ThiefMaster/indico,OmeGak/indico,indico/indico,pferreir/indico,mic4ael/indico,OmeGak/indico,pferreir/indico,DirkHoffmann/indico,mvidalgarcia/indico,DirkHoffmann/indico,indico/indico,ThiefMaster/indico,mvidalgarcia/indico,OmeGak/indico,OmeGak/indico,pferreir/indico,DirkHoffmann/indico,DirkHoffmann/indico,mvidalgarcia/indico,indico/indico,pferreir/indico,ThiefMaster/indico,indico/indico,ThiefMaster/indico,mic4ael/indico,mic4ael/indico,mic4ael/indico | html | ## Code Before:
{% extends 'layout/base.html' %}
{% block title %}{% trans %}You are about to delete the whole event!{% endtrans %}{% endblock %}
{% block content %}
<form method="POST" class="i-form vertical js-form-confirm-delete">
<input type="hidden" name="csrf_token" value="{{ session.csrf_token }}">
<h2>{{ event.title }}</h2>
<div class="form-group danger-message-box large-icon">
<div class="message-text">
{% trans -%}
Please note that if you delete the event you will lose all the information contained in it.<br>
<strong>This operation is irreversible!</strong>
{%- endtrans %}
</div>
<div class="message-box-footer confirm-delete-block">
<input id="js-confirm-delete" type="checkbox">
<label for="js-confirm-delete">
{% trans %}I understand what this means. Please go ahead.{% endtrans %}
</label>
</div>
</div>
<div class="form-group form-group-footer">
<div class="form-field">
<button id="js-button-delete" class="i-button big danger right" disabled>
{% trans %}Delete event{% endtrans %}
</button>
<button id="js-button-close" class="i-button big right" data-button-back>
{% trans %}I've changed my mind!{% endtrans %}
</button>
</div>
</div>
</form>
<script>
$('#js-confirm-delete').on('change', function() {
$('#js-button-delete').prop('disabled', !this.checked);
});
</script>
{% endblock %}
## Instruction:
Use confirmation_dialog when deleting an Event
## Code After:
{% from 'confirmation_dialog.html' import confirmation_dialog %}
{% set confirmation_message %}
{% trans -%}
Please note that if you delete the event you will lose all the information contained in it.
This operation is irreversible!
{%- endtrans %}
{% endset %}
{% call confirmation_dialog('danger', message=confirmation_message, ok_text=_('Delete event')) %}
{% trans event_title=event.title %}
You are about to <strong>delete</strong> the whole event "<strong>{{ event_title }}</strong>"!
{% endtrans %}
{% endcall %}
| - {% extends 'layout/base.html' %}
+ {% from 'confirmation_dialog.html' import confirmation_dialog %}
- {% block title %}{% trans %}You are about to delete the whole event!{% endtrans %}{% endblock %}
+ {% set confirmation_message %}
+ {% trans -%}
+ Please note that if you delete the event you will lose all the information contained in it.
+ This operation is irreversible!
+ {%- endtrans %}
+ {% endset %}
+ {% call confirmation_dialog('danger', message=confirmation_message, ok_text=_('Delete event')) %}
+ {% trans event_title=event.title %}
+ You are about to <strong>delete</strong> the whole event "<strong>{{ event_title }}</strong>"!
+ {% endtrans %}
+ {% endcall %}
- {% block content %}
- <form method="POST" class="i-form vertical js-form-confirm-delete">
- <input type="hidden" name="csrf_token" value="{{ session.csrf_token }}">
- <h2>{{ event.title }}</h2>
- <div class="form-group danger-message-box large-icon">
- <div class="message-text">
- {% trans -%}
- Please note that if you delete the event you will lose all the information contained in it.<br>
- <strong>This operation is irreversible!</strong>
- {%- endtrans %}
- </div>
- <div class="message-box-footer confirm-delete-block">
- <input id="js-confirm-delete" type="checkbox">
- <label for="js-confirm-delete">
- {% trans %}I understand what this means. Please go ahead.{% endtrans %}
- </label>
- </div>
- </div>
- <div class="form-group form-group-footer">
- <div class="form-field">
- <button id="js-button-delete" class="i-button big danger right" disabled>
- {% trans %}Delete event{% endtrans %}
- </button>
- <button id="js-button-close" class="i-button big right" data-button-back>
- {% trans %}I've changed my mind!{% endtrans %}
- </button>
- </div>
- </div>
- </form>
-
- <script>
- $('#js-confirm-delete').on('change', function() {
- $('#js-button-delete').prop('disabled', !this.checked);
- });
- </script>
- {% endblock %} | 50 | 1.25 | 12 | 38 |
b8cdf9ea0d6363f4c1448dfb1fe1c6b98ee82995 | lib/dm-is-versioned.rb | lib/dm-is-versioned.rb | require 'rubygems'
require 'pathname'
gem 'dm-core', '~>0.9.10'
require 'dm-core'
require Pathname(__FILE__).dirname.expand_path / 'dm-is-versioned' / 'is' / 'versioned.rb'
# Include the plugin in Resource
module DataMapper
module Resource
module ClassMethods
include DataMapper::Is::Versioned
end # module ClassMethods
end # module Resource
end # module DataMapper
| require 'rubygems'
require 'pathname'
gem 'dm-core', '~>0.9.10'
require 'dm-core'
require Pathname(__FILE__).dirname.expand_path / 'dm-is-versioned' / 'is' / 'versioned.rb'
# Include the plugin in Resource
module DataMapper
module Model
include DataMapper::Is::Versioned
end # module Model
end # module DataMapper
| Change usage of DataMapper::Resource::ClassMethods to use Model | Change usage of DataMapper::Resource::ClassMethods to use Model
| Ruby | mit | datamapper/dm-is-versioned | ruby | ## Code Before:
require 'rubygems'
require 'pathname'
gem 'dm-core', '~>0.9.10'
require 'dm-core'
require Pathname(__FILE__).dirname.expand_path / 'dm-is-versioned' / 'is' / 'versioned.rb'
# Include the plugin in Resource
module DataMapper
module Resource
module ClassMethods
include DataMapper::Is::Versioned
end # module ClassMethods
end # module Resource
end # module DataMapper
## Instruction:
Change usage of DataMapper::Resource::ClassMethods to use Model
## Code After:
require 'rubygems'
require 'pathname'
gem 'dm-core', '~>0.9.10'
require 'dm-core'
require Pathname(__FILE__).dirname.expand_path / 'dm-is-versioned' / 'is' / 'versioned.rb'
# Include the plugin in Resource
module DataMapper
module Model
include DataMapper::Is::Versioned
end # module Model
end # module DataMapper
| require 'rubygems'
require 'pathname'
gem 'dm-core', '~>0.9.10'
require 'dm-core'
require Pathname(__FILE__).dirname.expand_path / 'dm-is-versioned' / 'is' / 'versioned.rb'
# Include the plugin in Resource
module DataMapper
+ module Model
- module Resource
- module ClassMethods
- include DataMapper::Is::Versioned
? --
+ include DataMapper::Is::Versioned
+ end # module Model
- end # module ClassMethods
- end # module Resource
end # module DataMapper | 8 | 0.5 | 3 | 5 |
536d59fe9192457699f0db766412de0a1816d36d | prototype/grain-properties.cfg | prototype/grain-properties.cfg | type,prop,value
join,size,10
join,shape,"ellipse"
join,color_default,"#FF7F50"
fork,size,10
fork,shape,"ellipse"
fork,color_default,"#2E8B57"
fragment,size,30
fragment,shape,"rectangle"
fragment,mult,10
fragment,bins,10
fragment,color_default,"#4682B4"
start,size,15
start,shape,"ellipse"
start,color,"#DEB887"
end,size,15
end,shape,"ellipse"
end,color,"#DEB887"
| type,prop,value
join,size,10
join,shape,"ellipse"
join,color,"#FF7F50"
fork,size,10
fork,shape,"ellipse"
fork,color,"#2E8B57"
fragment,size,30
fragment,shape,"rectangle"
fragment,mult,10
fragment,bins,10
fragment,color,"#4682B4"
start,size,15
start,shape,"ellipse"
start,color,"#DEB887"
end,size,15
end,shape,"ellipse"
end,color,"#DEB887"
| Rename property color_default to color | Rename property color_default to color
| INI | apache-2.0 | anamud/grain-graphs,anamud/grain-graphs | ini | ## Code Before:
type,prop,value
join,size,10
join,shape,"ellipse"
join,color_default,"#FF7F50"
fork,size,10
fork,shape,"ellipse"
fork,color_default,"#2E8B57"
fragment,size,30
fragment,shape,"rectangle"
fragment,mult,10
fragment,bins,10
fragment,color_default,"#4682B4"
start,size,15
start,shape,"ellipse"
start,color,"#DEB887"
end,size,15
end,shape,"ellipse"
end,color,"#DEB887"
## Instruction:
Rename property color_default to color
## Code After:
type,prop,value
join,size,10
join,shape,"ellipse"
join,color,"#FF7F50"
fork,size,10
fork,shape,"ellipse"
fork,color,"#2E8B57"
fragment,size,30
fragment,shape,"rectangle"
fragment,mult,10
fragment,bins,10
fragment,color,"#4682B4"
start,size,15
start,shape,"ellipse"
start,color,"#DEB887"
end,size,15
end,shape,"ellipse"
end,color,"#DEB887"
| type,prop,value
join,size,10
join,shape,"ellipse"
- join,color_default,"#FF7F50"
? --------
+ join,color,"#FF7F50"
fork,size,10
fork,shape,"ellipse"
- fork,color_default,"#2E8B57"
? --------
+ fork,color,"#2E8B57"
fragment,size,30
fragment,shape,"rectangle"
fragment,mult,10
fragment,bins,10
- fragment,color_default,"#4682B4"
? --------
+ fragment,color,"#4682B4"
start,size,15
start,shape,"ellipse"
start,color,"#DEB887"
end,size,15
end,shape,"ellipse"
end,color,"#DEB887" | 6 | 0.333333 | 3 | 3 |
4584a52b921839924396af1022ed4f447cf68485 | MAGPIE/sample-debs/src/main/java/ch/hevs/aislab/magpie/debs/retrofit/UserSvcApi.java | MAGPIE/sample-debs/src/main/java/ch/hevs/aislab/magpie/debs/retrofit/UserSvcApi.java | package ch.hevs.aislab.magpie.debs.retrofit;
import ch.hevs.aislab.magpie.debs.model.MobileClient;
import retrofit.http.Body;
import retrofit.http.POST;
public interface UserSvcApi {
String CLIENT_ID = "mobile";
String SERVICE_URL = "https://10.0.2.2:8443";
String TOKEN_PATH = "/oauth/token";
String USER_SVC = "/user";
String USER_GET_SVC = USER_SVC + "/getUser";
@POST(USER_GET_SVC)
MobileClient getUser(@Body String gcmToken);
}
| package ch.hevs.aislab.magpie.debs.retrofit;
import java.util.Collection;
import ch.hevs.aislab.magpie.debs.model.MobileClient;
import retrofit.http.Body;
import retrofit.http.GET;
import retrofit.http.POST;
import retrofit.http.Path;
public interface UserSvcApi {
String CLIENT_ID = "mobile";
String SERVICE_URL = "https://10.0.2.2:8443";
String TOKEN_PATH = "/oauth/token";
String USER_ID = "userId";
String USER_SVC = "/user";
String USER_GET_SVC = USER_SVC + "/getUser";
String USER_GET_CONTACTS_ACCEPTED_SVC = USER_SVC + "/{" + USER_ID + "}" + "/getContactsAccepted";
String USER_GET_CONTACTS_PENDING_SVC = USER_SVC + "/{" + USER_ID + "}" + "/getContactsPending";
@POST(USER_GET_SVC)
MobileClient getUser(@Body String gcmToken);
@GET(USER_GET_CONTACTS_ACCEPTED_SVC)
Collection<MobileClient> getContactsAccepted(@Path(USER_ID) long userId);
@GET(USER_GET_CONTACTS_PENDING_SVC)
public Collection<MobileClient> getContactsPending(@Path(USER_ID) long userId);
}
| Add methods to get contacts by their subscription status | Add methods to get contacts by their subscription status
| Java | bsd-3-clause | aislab-hevs/magpie | java | ## Code Before:
package ch.hevs.aislab.magpie.debs.retrofit;
import ch.hevs.aislab.magpie.debs.model.MobileClient;
import retrofit.http.Body;
import retrofit.http.POST;
public interface UserSvcApi {
String CLIENT_ID = "mobile";
String SERVICE_URL = "https://10.0.2.2:8443";
String TOKEN_PATH = "/oauth/token";
String USER_SVC = "/user";
String USER_GET_SVC = USER_SVC + "/getUser";
@POST(USER_GET_SVC)
MobileClient getUser(@Body String gcmToken);
}
## Instruction:
Add methods to get contacts by their subscription status
## Code After:
package ch.hevs.aislab.magpie.debs.retrofit;
import java.util.Collection;
import ch.hevs.aislab.magpie.debs.model.MobileClient;
import retrofit.http.Body;
import retrofit.http.GET;
import retrofit.http.POST;
import retrofit.http.Path;
public interface UserSvcApi {
String CLIENT_ID = "mobile";
String SERVICE_URL = "https://10.0.2.2:8443";
String TOKEN_PATH = "/oauth/token";
String USER_ID = "userId";
String USER_SVC = "/user";
String USER_GET_SVC = USER_SVC + "/getUser";
String USER_GET_CONTACTS_ACCEPTED_SVC = USER_SVC + "/{" + USER_ID + "}" + "/getContactsAccepted";
String USER_GET_CONTACTS_PENDING_SVC = USER_SVC + "/{" + USER_ID + "}" + "/getContactsPending";
@POST(USER_GET_SVC)
MobileClient getUser(@Body String gcmToken);
@GET(USER_GET_CONTACTS_ACCEPTED_SVC)
Collection<MobileClient> getContactsAccepted(@Path(USER_ID) long userId);
@GET(USER_GET_CONTACTS_PENDING_SVC)
public Collection<MobileClient> getContactsPending(@Path(USER_ID) long userId);
}
| package ch.hevs.aislab.magpie.debs.retrofit;
+ import java.util.Collection;
+
import ch.hevs.aislab.magpie.debs.model.MobileClient;
import retrofit.http.Body;
+ import retrofit.http.GET;
import retrofit.http.POST;
+ import retrofit.http.Path;
public interface UserSvcApi {
String CLIENT_ID = "mobile";
String SERVICE_URL = "https://10.0.2.2:8443";
String TOKEN_PATH = "/oauth/token";
+ String USER_ID = "userId";
+
String USER_SVC = "/user";
String USER_GET_SVC = USER_SVC + "/getUser";
+ String USER_GET_CONTACTS_ACCEPTED_SVC = USER_SVC + "/{" + USER_ID + "}" + "/getContactsAccepted";
+ String USER_GET_CONTACTS_PENDING_SVC = USER_SVC + "/{" + USER_ID + "}" + "/getContactsPending";
+
@POST(USER_GET_SVC)
MobileClient getUser(@Body String gcmToken);
+ @GET(USER_GET_CONTACTS_ACCEPTED_SVC)
+ Collection<MobileClient> getContactsAccepted(@Path(USER_ID) long userId);
+
+ @GET(USER_GET_CONTACTS_PENDING_SVC)
+ public Collection<MobileClient> getContactsPending(@Path(USER_ID) long userId);
+
} | 15 | 0.714286 | 15 | 0 |
4f4b55a311e947add06212b9808ced0f6786f047 | app/models/manageiq/providers/inventory/collector.rb | app/models/manageiq/providers/inventory/collector.rb | class ManageIQ::Providers::Inventory::Collector
attr_reader :manager, :target
include Vmdb::Logging
# @param manager [ManageIQ::Providers::BaseManager] A manager object
# @param refresh_target [Object] A refresh Target object
def initialize(manager, refresh_target)
@manager = manager
@target = refresh_target
end
def collect
# placeholder for sub-classes to be able to collect inventory before parsing
end
# @return [Config::Options] Options for the manager type
def options
@options ||= Settings.ems_refresh[manager.class.ems_type]
end
private
def references(collection, manager_ref: :ems_ref)
target.manager_refs_by_association&.dig(collection, manager_ref)&.to_a&.compact || []
end
def add_target!(association, manager_ref)
return if manager_ref.blank?
manager_ref = {:ems_ref => manager_ref} unless manager_ref.kind_of?(Hash)
target.add_target(:association => association, :manager_ref => manager_ref)
end
end
| class ManageIQ::Providers::Inventory::Collector
attr_reader :manager, :target
include Vmdb::Logging
# @param manager [ManageIQ::Providers::BaseManager] A manager object
# @param refresh_target [Object] A refresh Target object
def initialize(manager, refresh_target)
@manager = manager
@target = refresh_target
end
def collect
# placeholder for sub-classes to be able to collect inventory before parsing
end
# @return [Config::Options] Options for the manager type
def options
@options ||= Settings.ems_refresh[manager.class.ems_type]
end
private
def references(collection, manager_ref: :ems_ref)
target.manager_refs_by_association&.dig(collection, manager_ref)&.to_a&.compact || []
end
def add_target!(association, manager_ref, options = {})
return if manager_ref.blank?
manager_ref = {:ems_ref => manager_ref} unless manager_ref.kind_of?(Hash)
target.add_target(:association => association, :manager_ref => manager_ref, :options => options)
end
end
| Allow options passed to add_target! | Allow options passed to add_target!
| Ruby | apache-2.0 | agrare/manageiq,mzazrivec/manageiq,agrare/manageiq,kbrock/manageiq,kbrock/manageiq,agrare/manageiq,ManageIQ/manageiq,jrafanie/manageiq,ManageIQ/manageiq,mzazrivec/manageiq,jrafanie/manageiq,kbrock/manageiq,agrare/manageiq,mzazrivec/manageiq,jrafanie/manageiq,jrafanie/manageiq,ManageIQ/manageiq,ManageIQ/manageiq,mzazrivec/manageiq,kbrock/manageiq | ruby | ## Code Before:
class ManageIQ::Providers::Inventory::Collector
attr_reader :manager, :target
include Vmdb::Logging
# @param manager [ManageIQ::Providers::BaseManager] A manager object
# @param refresh_target [Object] A refresh Target object
def initialize(manager, refresh_target)
@manager = manager
@target = refresh_target
end
def collect
# placeholder for sub-classes to be able to collect inventory before parsing
end
# @return [Config::Options] Options for the manager type
def options
@options ||= Settings.ems_refresh[manager.class.ems_type]
end
private
def references(collection, manager_ref: :ems_ref)
target.manager_refs_by_association&.dig(collection, manager_ref)&.to_a&.compact || []
end
def add_target!(association, manager_ref)
return if manager_ref.blank?
manager_ref = {:ems_ref => manager_ref} unless manager_ref.kind_of?(Hash)
target.add_target(:association => association, :manager_ref => manager_ref)
end
end
## Instruction:
Allow options passed to add_target!
## Code After:
class ManageIQ::Providers::Inventory::Collector
attr_reader :manager, :target
include Vmdb::Logging
# @param manager [ManageIQ::Providers::BaseManager] A manager object
# @param refresh_target [Object] A refresh Target object
def initialize(manager, refresh_target)
@manager = manager
@target = refresh_target
end
def collect
# placeholder for sub-classes to be able to collect inventory before parsing
end
# @return [Config::Options] Options for the manager type
def options
@options ||= Settings.ems_refresh[manager.class.ems_type]
end
private
def references(collection, manager_ref: :ems_ref)
target.manager_refs_by_association&.dig(collection, manager_ref)&.to_a&.compact || []
end
def add_target!(association, manager_ref, options = {})
return if manager_ref.blank?
manager_ref = {:ems_ref => manager_ref} unless manager_ref.kind_of?(Hash)
target.add_target(:association => association, :manager_ref => manager_ref, :options => options)
end
end
| class ManageIQ::Providers::Inventory::Collector
attr_reader :manager, :target
include Vmdb::Logging
# @param manager [ManageIQ::Providers::BaseManager] A manager object
# @param refresh_target [Object] A refresh Target object
def initialize(manager, refresh_target)
@manager = manager
@target = refresh_target
end
def collect
# placeholder for sub-classes to be able to collect inventory before parsing
end
# @return [Config::Options] Options for the manager type
def options
@options ||= Settings.ems_refresh[manager.class.ems_type]
end
private
def references(collection, manager_ref: :ems_ref)
target.manager_refs_by_association&.dig(collection, manager_ref)&.to_a&.compact || []
end
- def add_target!(association, manager_ref)
+ def add_target!(association, manager_ref, options = {})
? ++++++++++++++
return if manager_ref.blank?
manager_ref = {:ems_ref => manager_ref} unless manager_ref.kind_of?(Hash)
- target.add_target(:association => association, :manager_ref => manager_ref)
+ target.add_target(:association => association, :manager_ref => manager_ref, :options => options)
? +++++++++++++++++++++
end
end | 4 | 0.117647 | 2 | 2 |
646fcae1757f98d48014675364c44d1277dbb629 | README.md | README.md |
> React components for Inky
## License
MIT © [Geoff Kimball](http://geoffkimball.com)
|
> React components for Inky
## Installation
```bash
npm install react-inky --save
```
## Documentation
- [Setup](docs/setup.md)
- [Differences from Inky](docs/differences.md)
## License
MIT © [Geoff Kimball](http://geoffkimball.com)
| Add links to docs pages to readme | Add links to docs pages to readme
| Markdown | mit | gakimball/react-inky | markdown | ## Code Before:
> React components for Inky
## License
MIT © [Geoff Kimball](http://geoffkimball.com)
## Instruction:
Add links to docs pages to readme
## Code After:
> React components for Inky
## Installation
```bash
npm install react-inky --save
```
## Documentation
- [Setup](docs/setup.md)
- [Differences from Inky](docs/differences.md)
## License
MIT © [Geoff Kimball](http://geoffkimball.com)
|
> React components for Inky
+
+ ## Installation
+
+ ```bash
+ npm install react-inky --save
+ ```
+
+ ## Documentation
+
+ - [Setup](docs/setup.md)
+ - [Differences from Inky](docs/differences.md)
## License
MIT © [Geoff Kimball](http://geoffkimball.com) | 11 | 1.833333 | 11 | 0 |
ac3df5ee25e1de01bfa9cfba42a4904298a02bb6 | genetic_ai_example.txt | genetic_ai_example.txt | ID: 76254
Name: Piece Strength Gene
B: 6.9785
K: -8.49304
N: 6.2039
P: 0.755957
Q: 16.1833
R: 10.4454
Name: Look Ahead Gene
Capturing Speculation Constant: 1.47793
Game Length Uncertainty: 0.283393
Mean Game Length: 37.4876
Speculation Constant: 0.748572
Name: Total Force Gene
Priority: 371.946
Name: Freedom to Move Gene
Priority: 11.1491
Name: Pawn Advancement Gene
Priority: 89.088
Name: Passed Pawn Gene
Priority: 107.345
Name: Opponent Pieces Targeted Gene
Priority: 76.6857
Name: Sphere of Influence Gene
King Target Factor: -0.170795
Legal Bonus: 1.05136
Priority: 295.55
Name: King Confinement Gene
Priority: 21.319
Name: King Protection Gene
Priority: 35.2985
Name: Castling Possible Gene
Kingside Preference: 0.370118
Priority: 31.5404
END
| ID: 45853
Name: Piece Strength Gene
B: 5.35669
K: -13.2519
N: 5.29991
P: -0.168969
Q: 14.085
R: 8.80838
Name: Look Ahead Gene
Capturing Speculation Constant: 1.47701
Game Length Uncertainty: 0.393517
Mean Game Length: 42.4527
Speculation Constant: 0.589726
Name: Priority Threshold Gene
Threshold: 21.3336
Name: Total Force Gene
Priority: 371.265
Name: Freedom to Move Gene
Priority: 21.8319
Name: Pawn Advancement Gene
Priority: 80.2544
Name: Passed Pawn Gene
Priority: 63.4206
Name: Opponent Pieces Targeted Gene
Priority: 81.8837
Name: Sphere of Influence Gene
King Target Factor: 0.227888
Legal Bonus: 0.630741
Priority: 135.042
Name: King Confinement Gene
Priority: 2.06073
Name: King Protection Gene
Priority: 34.2268
Name: Castling Possible Gene
Kingside Preference: 0.500015
Priority: 8.83229
END
| Update example AI with new genome | Update example AI with new genome
| Text | mit | MarkZH/Genetic_Chess,MarkZH/Genetic_Chess,MarkZH/Genetic_Chess,MarkZH/Genetic_Chess,MarkZH/Genetic_Chess | text | ## Code Before:
ID: 76254
Name: Piece Strength Gene
B: 6.9785
K: -8.49304
N: 6.2039
P: 0.755957
Q: 16.1833
R: 10.4454
Name: Look Ahead Gene
Capturing Speculation Constant: 1.47793
Game Length Uncertainty: 0.283393
Mean Game Length: 37.4876
Speculation Constant: 0.748572
Name: Total Force Gene
Priority: 371.946
Name: Freedom to Move Gene
Priority: 11.1491
Name: Pawn Advancement Gene
Priority: 89.088
Name: Passed Pawn Gene
Priority: 107.345
Name: Opponent Pieces Targeted Gene
Priority: 76.6857
Name: Sphere of Influence Gene
King Target Factor: -0.170795
Legal Bonus: 1.05136
Priority: 295.55
Name: King Confinement Gene
Priority: 21.319
Name: King Protection Gene
Priority: 35.2985
Name: Castling Possible Gene
Kingside Preference: 0.370118
Priority: 31.5404
END
## Instruction:
Update example AI with new genome
## Code After:
ID: 45853
Name: Piece Strength Gene
B: 5.35669
K: -13.2519
N: 5.29991
P: -0.168969
Q: 14.085
R: 8.80838
Name: Look Ahead Gene
Capturing Speculation Constant: 1.47701
Game Length Uncertainty: 0.393517
Mean Game Length: 42.4527
Speculation Constant: 0.589726
Name: Priority Threshold Gene
Threshold: 21.3336
Name: Total Force Gene
Priority: 371.265
Name: Freedom to Move Gene
Priority: 21.8319
Name: Pawn Advancement Gene
Priority: 80.2544
Name: Passed Pawn Gene
Priority: 63.4206
Name: Opponent Pieces Targeted Gene
Priority: 81.8837
Name: Sphere of Influence Gene
King Target Factor: 0.227888
Legal Bonus: 0.630741
Priority: 135.042
Name: King Confinement Gene
Priority: 2.06073
Name: King Protection Gene
Priority: 34.2268
Name: Castling Possible Gene
Kingside Preference: 0.500015
Priority: 8.83229
END
| - ID: 76254
+ ID: 45853
Name: Piece Strength Gene
- B: 6.9785
- K: -8.49304
- N: 6.2039
- P: 0.755957
- Q: 16.1833
- R: 10.4454
+ B: 5.35669
+ K: -13.2519
+ N: 5.29991
+ P: -0.168969
+ Q: 14.085
+ R: 8.80838
Name: Look Ahead Gene
- Capturing Speculation Constant: 1.47793
? ^^
+ Capturing Speculation Constant: 1.47701
? ^^
- Game Length Uncertainty: 0.283393
? ---
+ Game Length Uncertainty: 0.393517
? +++
- Mean Game Length: 37.4876
? ^^ ^ -
+ Mean Game Length: 42.4527
? ^^ ^^
- Speculation Constant: 0.748572
? ^^ ^
+ Speculation Constant: 0.589726
? ^ ^ +
+
+ Name: Priority Threshold Gene
+ Threshold: 21.3336
Name: Total Force Gene
- Priority: 371.946
? ^^
+ Priority: 371.265
? ^ +
Name: Freedom to Move Gene
- Priority: 11.1491
? ^ - -
+ Priority: 21.8319
? ^ ++
Name: Pawn Advancement Gene
- Priority: 89.088
+ Priority: 80.2544
Name: Passed Pawn Gene
- Priority: 107.345
+ Priority: 63.4206
Name: Opponent Pieces Targeted Gene
- Priority: 76.6857
+ Priority: 81.8837
Name: Sphere of Influence Gene
- King Target Factor: -0.170795
? - ^ ^^^^
+ King Target Factor: 0.227888
? ^^ ^^^
- Legal Bonus: 1.05136
- Priority: 295.55
+ Legal Bonus: 0.630741
+ Priority: 135.042
Name: King Confinement Gene
- Priority: 21.319
? - --
+ Priority: 2.06073
? ++++
Name: King Protection Gene
- Priority: 35.2985
? ^ ^ -
+ Priority: 34.2268
? ^ ^^
Name: Castling Possible Gene
- Kingside Preference: 0.370118
? ^^ ^^
+ Kingside Preference: 0.500015
? ^^^ ^
- Priority: 31.5404
+ Priority: 8.83229
END
| 49 | 1.020833 | 26 | 23 |
60a235952073dfc880eb3f1097f4be96cf565c4d | src/main/scala/tutorial/webapp/TutorialApp.scala | src/main/scala/tutorial/webapp/TutorialApp.scala | package tutorial.webapp
import scala.scalajs.js.JSApp
import org.scalajs.dom
import dom.document
import scala.scalajs.js.annotation.JSExport
import org.scalajs.jquery.jQuery
import org.denigma.codemirror.extensions.EditorConfig
import org.denigma.codemirror.CodeMirror
import org.scalajs.dom.raw.HTMLTextAreaElement
object TutorialApp extends JSApp {
val $ = jQuery
override def main(): Unit = {
$(setupUI _)
}
def setupUI(): Unit = {
$("#click-me-button").click(addClickedMessage _)
$("body").append("<p>Hello World</p>")
//val params = EditorConfig.mode("clike").lineNumbers(true)
//val elem = dom.document.getElementById("scala").asInstanceOf[HTMLTextAreaElement]
//val e = CodeMirror.fromTextArea(elem, params)
//e.getDoc().setValue("""println("Hello Scala")""")
}
def addClickedMessage(): Unit = {
$("body").append("<p>You clicked the button!</p>")
}
}
| package tutorial.webapp
import scala.scalajs.js.JSApp
import org.scalajs.dom
import dom.document
import scala.scalajs.js.annotation.JSExport
import org.scalajs.jquery.jQuery
import org.denigma.codemirror.extensions.EditorConfig
import org.denigma.codemirror.CodeMirror
import org.scalajs.dom.raw.HTMLTextAreaElement
object TutorialApp extends JSApp {
val $ = jQuery
override def main(): Unit = {
$(setupUI _)
}
def setupUI(): Unit = {
$("#click-me-button").click(addClickedMessage _)
$("body").append("<p>Hello World</p>")
val params = EditorConfig.mode("clike").lineNumbers(true)
println(s">>>>> params: $params")
val elem = dom.document.getElementById("scala").asInstanceOf[HTMLTextAreaElement]
println(s">>>>> elem: $elem")
val e = CodeMirror.fromTextArea(elem, params)
println(s">>>>> e: $e")
e.getDoc().setValue("""println("Hello Scala")""")
}
def addClickedMessage(): Unit = {
$("body").append("<p>You clicked the button!</p>")
}
}
| Add debugging output to CodeMirror creation | Add debugging output to CodeMirror creation
| Scala | unknown | sschaef/ide-research,sschaef/tooling-research,sschaef/scalajs-test,sschaef/amora,sschaef/amora | scala | ## Code Before:
package tutorial.webapp
import scala.scalajs.js.JSApp
import org.scalajs.dom
import dom.document
import scala.scalajs.js.annotation.JSExport
import org.scalajs.jquery.jQuery
import org.denigma.codemirror.extensions.EditorConfig
import org.denigma.codemirror.CodeMirror
import org.scalajs.dom.raw.HTMLTextAreaElement
object TutorialApp extends JSApp {
val $ = jQuery
override def main(): Unit = {
$(setupUI _)
}
def setupUI(): Unit = {
$("#click-me-button").click(addClickedMessage _)
$("body").append("<p>Hello World</p>")
//val params = EditorConfig.mode("clike").lineNumbers(true)
//val elem = dom.document.getElementById("scala").asInstanceOf[HTMLTextAreaElement]
//val e = CodeMirror.fromTextArea(elem, params)
//e.getDoc().setValue("""println("Hello Scala")""")
}
def addClickedMessage(): Unit = {
$("body").append("<p>You clicked the button!</p>")
}
}
## Instruction:
Add debugging output to CodeMirror creation
## Code After:
package tutorial.webapp
import scala.scalajs.js.JSApp
import org.scalajs.dom
import dom.document
import scala.scalajs.js.annotation.JSExport
import org.scalajs.jquery.jQuery
import org.denigma.codemirror.extensions.EditorConfig
import org.denigma.codemirror.CodeMirror
import org.scalajs.dom.raw.HTMLTextAreaElement
object TutorialApp extends JSApp {
val $ = jQuery
override def main(): Unit = {
$(setupUI _)
}
def setupUI(): Unit = {
$("#click-me-button").click(addClickedMessage _)
$("body").append("<p>Hello World</p>")
val params = EditorConfig.mode("clike").lineNumbers(true)
println(s">>>>> params: $params")
val elem = dom.document.getElementById("scala").asInstanceOf[HTMLTextAreaElement]
println(s">>>>> elem: $elem")
val e = CodeMirror.fromTextArea(elem, params)
println(s">>>>> e: $e")
e.getDoc().setValue("""println("Hello Scala")""")
}
def addClickedMessage(): Unit = {
$("body").append("<p>You clicked the button!</p>")
}
}
| package tutorial.webapp
import scala.scalajs.js.JSApp
import org.scalajs.dom
import dom.document
import scala.scalajs.js.annotation.JSExport
import org.scalajs.jquery.jQuery
import org.denigma.codemirror.extensions.EditorConfig
import org.denigma.codemirror.CodeMirror
import org.scalajs.dom.raw.HTMLTextAreaElement
object TutorialApp extends JSApp {
val $ = jQuery
override def main(): Unit = {
$(setupUI _)
}
def setupUI(): Unit = {
$("#click-me-button").click(addClickedMessage _)
$("body").append("<p>Hello World</p>")
- //val params = EditorConfig.mode("clike").lineNumbers(true)
? --
+ val params = EditorConfig.mode("clike").lineNumbers(true)
+ println(s">>>>> params: $params")
- //val elem = dom.document.getElementById("scala").asInstanceOf[HTMLTextAreaElement]
? --
+ val elem = dom.document.getElementById("scala").asInstanceOf[HTMLTextAreaElement]
+ println(s">>>>> elem: $elem")
- //val e = CodeMirror.fromTextArea(elem, params)
? --
+ val e = CodeMirror.fromTextArea(elem, params)
+ println(s">>>>> e: $e")
- //e.getDoc().setValue("""println("Hello Scala")""")
? --
+ e.getDoc().setValue("""println("Hello Scala")""")
}
def addClickedMessage(): Unit = {
$("body").append("<p>You clicked the button!</p>")
}
} | 11 | 0.354839 | 7 | 4 |
fd153571c14807ecd45a0e11a1af68577ba3ad15 | app/views/exploration/_empty_state_body.html.haml | app/views/exploration/_empty_state_body.html.haml | %article.c-results.js-hidden
%section.c-graphs
%h2.c-graphs--heading.sr-only Graphs
.js-graph.average-price.hidden
%h2.c-graph-heading
Average price<span></span>
= render partial: "graphs_key"
%svg
.js-graph.house-price-index.hidden
%h2.c-graph-heading
House price index<span></span>
= render partial: "graphs_key"
%svg
.js-graph.percentage-monthly-change.hidden
%h2.c-graph-heading
Percentage monthly change<span></span>
= render partial: "graphs_key"
%svg
.js-graph.percentage-annual-change.hidden
%h2.c-graph-heading
Percentage annual change<span></span>
= render partial: "graphs_key"
%svg
.js-graph.sales-volume.hidden
%h2.c-graph-heading
Total sales volume
%svg
%section.c-table
%h2.c-table--heading Data
%p
%button.c-change-table-view.c-action
%i.fa.fa-table
%span
Switch to compact table view
.c-results-table-container
%table#results-table.table.table-striped
| %article.c-results.js-hidden
%section.c-graphs
%h2.c-graphs--heading.sr-only Graphs
.js-graph.average-price.hidden
%h2.c-graph-heading
Average price<span></span>
= render partial: "graphs_key"
%svg
.js-graph.house-price-index.hidden
%h2.c-graph-heading
House price index<span></span>
= render partial: "graphs_key"
%svg
.js-graph.percentage-monthly-change.hidden
%h2.c-graph-heading
Percentage monthly change<span></span>
= render partial: "graphs_key"
%svg
.js-graph.percentage-annual-change.hidden
%h2.c-graph-heading
Percentage annual change<span></span>
= render partial: "graphs_key"
%svg
.js-graph.sales-volume.hidden
%h2.c-graph-heading
Total sales volume
%svg
%section.c-table
%h2.c-table--heading Data
%p
%button.c-change-table-view.c-action
%i.fa.fa-table
%span
Show multi-column table view
.c-results-table-container
%table#results-table.table.table-striped
| Change label for pivot table action | Change label for pivot table action
| Haml | mit | epimorphics/ukhpi,epimorphics/ukhpi,epimorphics/ukhpi,epimorphics/ukhpi | haml | ## Code Before:
%article.c-results.js-hidden
%section.c-graphs
%h2.c-graphs--heading.sr-only Graphs
.js-graph.average-price.hidden
%h2.c-graph-heading
Average price<span></span>
= render partial: "graphs_key"
%svg
.js-graph.house-price-index.hidden
%h2.c-graph-heading
House price index<span></span>
= render partial: "graphs_key"
%svg
.js-graph.percentage-monthly-change.hidden
%h2.c-graph-heading
Percentage monthly change<span></span>
= render partial: "graphs_key"
%svg
.js-graph.percentage-annual-change.hidden
%h2.c-graph-heading
Percentage annual change<span></span>
= render partial: "graphs_key"
%svg
.js-graph.sales-volume.hidden
%h2.c-graph-heading
Total sales volume
%svg
%section.c-table
%h2.c-table--heading Data
%p
%button.c-change-table-view.c-action
%i.fa.fa-table
%span
Switch to compact table view
.c-results-table-container
%table#results-table.table.table-striped
## Instruction:
Change label for pivot table action
## Code After:
%article.c-results.js-hidden
%section.c-graphs
%h2.c-graphs--heading.sr-only Graphs
.js-graph.average-price.hidden
%h2.c-graph-heading
Average price<span></span>
= render partial: "graphs_key"
%svg
.js-graph.house-price-index.hidden
%h2.c-graph-heading
House price index<span></span>
= render partial: "graphs_key"
%svg
.js-graph.percentage-monthly-change.hidden
%h2.c-graph-heading
Percentage monthly change<span></span>
= render partial: "graphs_key"
%svg
.js-graph.percentage-annual-change.hidden
%h2.c-graph-heading
Percentage annual change<span></span>
= render partial: "graphs_key"
%svg
.js-graph.sales-volume.hidden
%h2.c-graph-heading
Total sales volume
%svg
%section.c-table
%h2.c-table--heading Data
%p
%button.c-change-table-view.c-action
%i.fa.fa-table
%span
Show multi-column table view
.c-results-table-container
%table#results-table.table.table-striped
| %article.c-results.js-hidden
%section.c-graphs
%h2.c-graphs--heading.sr-only Graphs
.js-graph.average-price.hidden
%h2.c-graph-heading
Average price<span></span>
= render partial: "graphs_key"
%svg
.js-graph.house-price-index.hidden
%h2.c-graph-heading
House price index<span></span>
= render partial: "graphs_key"
%svg
.js-graph.percentage-monthly-change.hidden
%h2.c-graph-heading
Percentage monthly change<span></span>
= render partial: "graphs_key"
%svg
.js-graph.percentage-annual-change.hidden
%h2.c-graph-heading
Percentage annual change<span></span>
= render partial: "graphs_key"
%svg
.js-graph.sales-volume.hidden
%h2.c-graph-heading
Total sales volume
%svg
%section.c-table
%h2.c-table--heading Data
%p
%button.c-change-table-view.c-action
%i.fa.fa-table
%span
- Switch to compact table view
+ Show multi-column table view
.c-results-table-container
%table#results-table.table.table-striped | 2 | 0.045455 | 1 | 1 |
1cc81c92ac3f6b338687f302d834602c3c004a61 | website/docs/d/region.html.markdown | website/docs/d/region.html.markdown | ---
layout: "aws"
page_title: "AWS: aws_region"
sidebar_current: "docs-aws-datasource-region"
description: |-
Provides details about a specific service region
---
# Data Source: aws_region
`aws_region` provides details about a specific AWS region.
As well as validating a given region name this resource can be used to
discover the name of the region configured within the provider. The latter
can be useful in a child module which is inheriting an AWS provider
configuration from its parent module.
## Example Usage
The following example shows how the resource might be used to obtain
the name of the AWS region configured on the provider.
```hcl
data "aws_region" "current" {}
```
## Argument Reference
The arguments of this data source act as filters for querying the available
regions. The given filters must match exactly one region whose data will be
exported as attributes.
* `name` - (Optional) The full name of the region to select.
* `current` - (Optional) Set to `true` to match only the region configured
in the provider. Defaults to `true` if `endpoint` or `name` is not given.
* `endpoint` - (Optional) The EC2 endpoint of the region to select.
## Attributes Reference
The following attributes are exported:
* `name` - The name of the selected region.
* `current` - `true` if the selected region is the one configured on the
provider, or `false` otherwise.
* `endpoint` - The EC2 endpoint for the selected region.
| ---
layout: "aws"
page_title: "AWS: aws_region"
sidebar_current: "docs-aws-datasource-region"
description: |-
Provides details about a specific service region
---
# Data Source: aws_region
`aws_region` provides details about a specific AWS region.
As well as validating a given region name this resource can be used to
discover the name of the region configured within the provider. The latter
can be useful in a child module which is inheriting an AWS provider
configuration from its parent module.
## Example Usage
The following example shows how the resource might be used to obtain
the name of the AWS region configured on the provider.
```hcl
data "aws_region" "current" {}
```
## Argument Reference
The arguments of this data source act as filters for querying the available
regions. The given filters must match exactly one region whose data will be
exported as attributes.
* `name` - (Optional) The full name of the region to select.
* `endpoint` - (Optional) The EC2 endpoint of the region to select.
## Attributes Reference
The following attributes are exported:
* `name` - The name of the selected region.
* `current` - `true` if the selected region is the one configured on the
provider, or `false` otherwise.
* `endpoint` - The EC2 endpoint for the selected region.
| Remove now deprecated current argument | docs/data-source/aws_region: Remove now deprecated current argument
| Markdown | mpl-2.0 | nbaztec/terraform-provider-aws,Ninir/terraform-provider-aws,kjmkznr/terraform-provider-aws,kjmkznr/terraform-provider-aws,terraform-providers/terraform-provider-aws,kjmkznr/terraform-provider-aws,nbaztec/terraform-provider-aws,nbaztec/terraform-provider-aws,terraform-providers/terraform-provider-aws,Ninir/terraform-provider-aws,terraform-providers/terraform-provider-aws,terraform-providers/terraform-provider-aws,Ninir/terraform-provider-aws,nbaztec/terraform-provider-aws,kjmkznr/terraform-provider-aws,Ninir/terraform-provider-aws | markdown | ## Code Before:
---
layout: "aws"
page_title: "AWS: aws_region"
sidebar_current: "docs-aws-datasource-region"
description: |-
Provides details about a specific service region
---
# Data Source: aws_region
`aws_region` provides details about a specific AWS region.
As well as validating a given region name this resource can be used to
discover the name of the region configured within the provider. The latter
can be useful in a child module which is inheriting an AWS provider
configuration from its parent module.
## Example Usage
The following example shows how the resource might be used to obtain
the name of the AWS region configured on the provider.
```hcl
data "aws_region" "current" {}
```
## Argument Reference
The arguments of this data source act as filters for querying the available
regions. The given filters must match exactly one region whose data will be
exported as attributes.
* `name` - (Optional) The full name of the region to select.
* `current` - (Optional) Set to `true` to match only the region configured
in the provider. Defaults to `true` if `endpoint` or `name` is not given.
* `endpoint` - (Optional) The EC2 endpoint of the region to select.
## Attributes Reference
The following attributes are exported:
* `name` - The name of the selected region.
* `current` - `true` if the selected region is the one configured on the
provider, or `false` otherwise.
* `endpoint` - The EC2 endpoint for the selected region.
## Instruction:
docs/data-source/aws_region: Remove now deprecated current argument
## Code After:
---
layout: "aws"
page_title: "AWS: aws_region"
sidebar_current: "docs-aws-datasource-region"
description: |-
Provides details about a specific service region
---
# Data Source: aws_region
`aws_region` provides details about a specific AWS region.
As well as validating a given region name this resource can be used to
discover the name of the region configured within the provider. The latter
can be useful in a child module which is inheriting an AWS provider
configuration from its parent module.
## Example Usage
The following example shows how the resource might be used to obtain
the name of the AWS region configured on the provider.
```hcl
data "aws_region" "current" {}
```
## Argument Reference
The arguments of this data source act as filters for querying the available
regions. The given filters must match exactly one region whose data will be
exported as attributes.
* `name` - (Optional) The full name of the region to select.
* `endpoint` - (Optional) The EC2 endpoint of the region to select.
## Attributes Reference
The following attributes are exported:
* `name` - The name of the selected region.
* `current` - `true` if the selected region is the one configured on the
provider, or `false` otherwise.
* `endpoint` - The EC2 endpoint for the selected region.
| ---
layout: "aws"
page_title: "AWS: aws_region"
sidebar_current: "docs-aws-datasource-region"
description: |-
Provides details about a specific service region
---
# Data Source: aws_region
`aws_region` provides details about a specific AWS region.
As well as validating a given region name this resource can be used to
discover the name of the region configured within the provider. The latter
can be useful in a child module which is inheriting an AWS provider
configuration from its parent module.
## Example Usage
The following example shows how the resource might be used to obtain
the name of the AWS region configured on the provider.
```hcl
data "aws_region" "current" {}
```
## Argument Reference
The arguments of this data source act as filters for querying the available
regions. The given filters must match exactly one region whose data will be
exported as attributes.
* `name` - (Optional) The full name of the region to select.
- * `current` - (Optional) Set to `true` to match only the region configured
- in the provider. Defaults to `true` if `endpoint` or `name` is not given.
-
* `endpoint` - (Optional) The EC2 endpoint of the region to select.
## Attributes Reference
The following attributes are exported:
* `name` - The name of the selected region.
* `current` - `true` if the selected region is the one configured on the
provider, or `false` otherwise.
* `endpoint` - The EC2 endpoint for the selected region. | 3 | 0.061224 | 0 | 3 |
1dc0efd62ded78782841c0c8b5d9c41db6e25b40 | tox.ini | tox.ini | [tox]
envlist = py34,py35,lint
skip_missing_interpreters = True
[pytest]
pep8maxlinelength = 120
[testenv]
deps = -rrequirements-dev.txt
commands = py.test -s -v --cov-report term-missing --cov-report html --pep8 --cov foremast tests/
recreate = True
[testenv:lint]
deps = prospector[with_everything]
whitelist_externals = /usr/bin/find
commands = prospector -0 -W pyflakes --strictness veryhigh
| [tox]
envlist = py34,py35,lint
skip_missing_interpreters = True
[pytest]
pep8maxlinelength = 120
[testenv]
deps = -rrequirements-dev.txt
commands = py.test -s -v --cov-report term-missing --cov-report html --pep8 --cov foremast tests/
recreate = True
[testenv:lint]
deps = prospector[with_everything]
whitelist_externals = /usr/bin/find
commands = prospector -0 -I __init__.py --strictness veryhigh
| Enable pyflakes and disable checking of __init__.py | Enable pyflakes and disable checking of __init__.py
| INI | apache-2.0 | gogoair/foremast,gogoair/foremast | ini | ## Code Before:
[tox]
envlist = py34,py35,lint
skip_missing_interpreters = True
[pytest]
pep8maxlinelength = 120
[testenv]
deps = -rrequirements-dev.txt
commands = py.test -s -v --cov-report term-missing --cov-report html --pep8 --cov foremast tests/
recreate = True
[testenv:lint]
deps = prospector[with_everything]
whitelist_externals = /usr/bin/find
commands = prospector -0 -W pyflakes --strictness veryhigh
## Instruction:
Enable pyflakes and disable checking of __init__.py
## Code After:
[tox]
envlist = py34,py35,lint
skip_missing_interpreters = True
[pytest]
pep8maxlinelength = 120
[testenv]
deps = -rrequirements-dev.txt
commands = py.test -s -v --cov-report term-missing --cov-report html --pep8 --cov foremast tests/
recreate = True
[testenv:lint]
deps = prospector[with_everything]
whitelist_externals = /usr/bin/find
commands = prospector -0 -I __init__.py --strictness veryhigh
| [tox]
envlist = py34,py35,lint
skip_missing_interpreters = True
[pytest]
pep8maxlinelength = 120
[testenv]
deps = -rrequirements-dev.txt
commands = py.test -s -v --cov-report term-missing --cov-report html --pep8 --cov foremast tests/
recreate = True
[testenv:lint]
deps = prospector[with_everything]
whitelist_externals = /usr/bin/find
- commands = prospector -0 -W pyflakes --strictness veryhigh
? ^ ------
+ commands = prospector -0 -I __init__.py --strictness veryhigh
? ^ +++++++++
| 2 | 0.125 | 1 | 1 |
6c8f7e418d5509be54709d1f5ed870218c021e2f | build/oggm/meta.yaml | build/oggm/meta.yaml | package:
name: oggm
version: "0.0.1.201603091132"
source:
url: https://github.com/OGGM/oggm/tarball/8ff8646d4dd47a796540e2b912383251a4c57ee3
fn: oggm-8ff8646d4dd47a796540e2b912383251a4c57ee3.tar.gz
build:
number: 0
requirements:
build:
- python
- setuptools
- matplotlib
- numpy
- scipy
- pyproj
- pandas
- joblib
- netcdf4
- configobj
run:
- python
- matplotlib
- numpy
- scipy
- pyproj
- pandas
- joblib
- geopandas
- cleo
- motionless
- salem
- netcdf4
- configobj
test:
requires:
- nose
about:
home: https://github.com/fmaussion/salem
license: GPLv3+
summary: 'High-level tool for geoscientific data I/O and map projections'
| package:
name: oggm
version: "0.0.1.201603091154"
source:
url: https://github.com/OGGM/oggm/tarball/8ff8646d4dd47a796540e2b912383251a4c57ee3
fn: oggm-8ff8646d4dd47a796540e2b912383251a4c57ee3.tar.gz
build:
number: 0
requirements:
build:
- python
- setuptools
- matplotlib
- numpy
- scipy
- pyproj
- pandas
- joblib
- netcdf4
- configobj
run:
- python
- matplotlib
- numpy
- scipy
- pyproj
- pandas
- joblib
- geopandas
- cleo
- motionless
- salem
- netcdf4
- configobj
- krb5
test:
requires:
- nose
about:
home: https://github.com/fmaussion/salem
license: GPLv3+
summary: 'High-level tool for geoscientific data I/O and map projections'
| Add krb5 dep in an attempt to fix missing gdal library | Add krb5 dep in an attempt to fix missing gdal library
| YAML | mit | OGGM/OGGM-Anaconda | yaml | ## Code Before:
package:
name: oggm
version: "0.0.1.201603091132"
source:
url: https://github.com/OGGM/oggm/tarball/8ff8646d4dd47a796540e2b912383251a4c57ee3
fn: oggm-8ff8646d4dd47a796540e2b912383251a4c57ee3.tar.gz
build:
number: 0
requirements:
build:
- python
- setuptools
- matplotlib
- numpy
- scipy
- pyproj
- pandas
- joblib
- netcdf4
- configobj
run:
- python
- matplotlib
- numpy
- scipy
- pyproj
- pandas
- joblib
- geopandas
- cleo
- motionless
- salem
- netcdf4
- configobj
test:
requires:
- nose
about:
home: https://github.com/fmaussion/salem
license: GPLv3+
summary: 'High-level tool for geoscientific data I/O and map projections'
## Instruction:
Add krb5 dep in an attempt to fix missing gdal library
## Code After:
package:
name: oggm
version: "0.0.1.201603091154"
source:
url: https://github.com/OGGM/oggm/tarball/8ff8646d4dd47a796540e2b912383251a4c57ee3
fn: oggm-8ff8646d4dd47a796540e2b912383251a4c57ee3.tar.gz
build:
number: 0
requirements:
build:
- python
- setuptools
- matplotlib
- numpy
- scipy
- pyproj
- pandas
- joblib
- netcdf4
- configobj
run:
- python
- matplotlib
- numpy
- scipy
- pyproj
- pandas
- joblib
- geopandas
- cleo
- motionless
- salem
- netcdf4
- configobj
- krb5
test:
requires:
- nose
about:
home: https://github.com/fmaussion/salem
license: GPLv3+
summary: 'High-level tool for geoscientific data I/O and map projections'
| package:
name: oggm
- version: "0.0.1.201603091132"
? ^^
+ version: "0.0.1.201603091154"
? ^^
source:
url: https://github.com/OGGM/oggm/tarball/8ff8646d4dd47a796540e2b912383251a4c57ee3
fn: oggm-8ff8646d4dd47a796540e2b912383251a4c57ee3.tar.gz
build:
number: 0
requirements:
build:
- python
- setuptools
- matplotlib
- numpy
- scipy
- pyproj
- pandas
- joblib
- netcdf4
- configobj
run:
- python
- matplotlib
- numpy
- scipy
- pyproj
- pandas
- joblib
- geopandas
- cleo
- motionless
- salem
- netcdf4
- configobj
+ - krb5
test:
requires:
- nose
about:
home: https://github.com/fmaussion/salem
license: GPLv3+
summary: 'High-level tool for geoscientific data I/O and map projections' | 3 | 0.06383 | 2 | 1 |
17530c3d7eceb106a74066446404117158e8aa93 | iobuf/ibuf_readall.c | iobuf/ibuf_readall.c |
/** Read the remainder of the \c ibuf into the \c str. */
int ibuf_readall(ibuf* in, str* out)
{
for (;;) {
if (!str_catb(out,
in->io.buffer+in->io.bufstart,
in->io.buflen-in->io.bufstart))
return 0;
in->io.bufstart = in->io.buflen;
if (!ibuf_refill(in))
return ibuf_eof(in);
}
}
|
/** Read the remainder of the \c ibuf into the \c str. */
int ibuf_readall(ibuf* in, str* out)
{
if (ibuf_eof(in)) return 1;
if (ibuf_error(in)) return 0;
for (;;) {
if (!str_catb(out,
in->io.buffer+in->io.bufstart,
in->io.buflen-in->io.bufstart))
return 0;
in->io.bufstart = in->io.buflen;
if (!ibuf_refill(in))
return ibuf_eof(in);
}
}
| Make sure to do sanity checking before any of the reading. | Make sure to do sanity checking before any of the reading.
| C | lgpl-2.1 | bruceg/bglibs,bruceg/bglibs,bruceg/bglibs,bruceg/bglibs,bruceg/bglibs,bruceg/bglibs | c | ## Code Before:
/** Read the remainder of the \c ibuf into the \c str. */
int ibuf_readall(ibuf* in, str* out)
{
for (;;) {
if (!str_catb(out,
in->io.buffer+in->io.bufstart,
in->io.buflen-in->io.bufstart))
return 0;
in->io.bufstart = in->io.buflen;
if (!ibuf_refill(in))
return ibuf_eof(in);
}
}
## Instruction:
Make sure to do sanity checking before any of the reading.
## Code After:
/** Read the remainder of the \c ibuf into the \c str. */
int ibuf_readall(ibuf* in, str* out)
{
if (ibuf_eof(in)) return 1;
if (ibuf_error(in)) return 0;
for (;;) {
if (!str_catb(out,
in->io.buffer+in->io.bufstart,
in->io.buflen-in->io.bufstart))
return 0;
in->io.bufstart = in->io.buflen;
if (!ibuf_refill(in))
return ibuf_eof(in);
}
}
|
/** Read the remainder of the \c ibuf into the \c str. */
int ibuf_readall(ibuf* in, str* out)
{
+ if (ibuf_eof(in)) return 1;
+ if (ibuf_error(in)) return 0;
for (;;) {
if (!str_catb(out,
in->io.buffer+in->io.bufstart,
in->io.buflen-in->io.bufstart))
return 0;
in->io.bufstart = in->io.buflen;
if (!ibuf_refill(in))
return ibuf_eof(in);
}
} | 2 | 0.142857 | 2 | 0 |
44fe237ec5eecb8d0f496d05af9dc67fa11b44eb | TasksForCourseApply/3-DashInsert.md | TasksForCourseApply/3-DashInsert.md |
You have to implement DashInsert(num).
Insert dashes ('-') between each two odd numbers in num. Don't count zero as an odd number.
You can use any language you know.
Examples:
```
Input = 99946 Output = "9-9-946"
Input = 56730 Output = "567-30"
```
|
You have to implement a function with the following signature - `dashInsert(num)`
* The argument `num` is of type integer.
* The function should return a string
Insert dashes `'-'` between each two neighboring odd numbers in `num`.
Don't count zero as an odd number.
**You can use any language you know.**
Examples:
```python
dashInsert(99946)
"9-9-946"
dashInsert(56730)
"567-30"
```
| Reword & Refactor DashInsert task description | Reword & Refactor DashInsert task description | Markdown | mit | stoilov/Programming101,HackBulgaria/Programming101-2,stoilov/Programming101,stoilov/Programming101,stoilov/Programming101,stoilov/Programming101,stoilov/Programming101 | markdown | ## Code Before:
You have to implement DashInsert(num).
Insert dashes ('-') between each two odd numbers in num. Don't count zero as an odd number.
You can use any language you know.
Examples:
```
Input = 99946 Output = "9-9-946"
Input = 56730 Output = "567-30"
```
## Instruction:
Reword & Refactor DashInsert task description
## Code After:
You have to implement a function with the following signature - `dashInsert(num)`
* The argument `num` is of type integer.
* The function should return a string
Insert dashes `'-'` between each two neighboring odd numbers in `num`.
Don't count zero as an odd number.
**You can use any language you know.**
Examples:
```python
dashInsert(99946)
"9-9-946"
dashInsert(56730)
"567-30"
```
|
- You have to implement DashInsert(num).
+ You have to implement a function with the following signature - `dashInsert(num)`
- Insert dashes ('-') between each two odd numbers in num. Don't count zero as an odd number.
+ * The argument `num` is of type integer.
+ * The function should return a string
+
+
+ Insert dashes `'-'` between each two neighboring odd numbers in `num`.
+
+ Don't count zero as an odd number.
+
- You can use any language you know.
+ **You can use any language you know.**
? ++ ++
Examples:
+ ```python
+ dashInsert(99946)
+ "9-9-946"
+ dashInsert(56730)
+ "567-30"
```
- Input = 99946 Output = "9-9-946"
- Input = 56730 Output = "567-30"
- ``` | 21 | 1.75 | 15 | 6 |
686b208df549978b40b119d0ff47ea0655bc2b69 | .travis.yml | .travis.yml | language: erlang
before_script:
- export RIAK_TEST_NODE_1=`egrep '^\-s?name' /etc/riak/vm.args | awk '{print $2}'`
- export RIAK_TEST_COOKIE=`egrep '^-setcookie' /etc/riak/vm.args | awk '{print $2}'`
notifications:
webhooks: http://basho-engbot.herokuapp.com/travis?key=8f07584549e458d4c83728f3397ecbd4368e60a8
email: eng@basho.com
otp_release:
- R15B01
- R15B
- R14B04
- R14B03
| language: erlang
before_script:
- export RIAK_TEST_NODE_1=`egrep '^\-s?name' /etc/riak/vm.args | awk '{print $2}'`
- export RIAK_TEST_COOKIE=`egrep '^-setcookie' /etc/riak/vm.args | awk '{print $2}'`
notifications:
webhooks: http://basho-engbot.herokuapp.com/travis?key=8f07584549e458d4c83728f3397ecbd4368e60a8
email: eng@basho.com
otp_release:
- R16B02
- R16B01
- R15B03
- R15B02
- R15B01
| Remove pre-R15B01 Erlang OTP releases from the Travis config. We can't use them because they don't support -callback attributes in modules. | Remove pre-R15B01 Erlang OTP releases from the Travis config. We can't use them because they don't support -callback attributes in modules.
| YAML | apache-2.0 | SiftLogic/riak-erlang-client,groovenauts-erlang/riak-erlang-client,rhumbertgz/riak-erlang-client,pma/riak-erlang-client,esl/riak-erlang-client,jmayfield74/riak-erlang-client,linearregression/riak-erlang-client,GabrielNicolasAvellaneda/riak-erlang-client,paulperegud/riak-erlang-client,inaka/riak-erlang-client | yaml | ## Code Before:
language: erlang
before_script:
- export RIAK_TEST_NODE_1=`egrep '^\-s?name' /etc/riak/vm.args | awk '{print $2}'`
- export RIAK_TEST_COOKIE=`egrep '^-setcookie' /etc/riak/vm.args | awk '{print $2}'`
notifications:
webhooks: http://basho-engbot.herokuapp.com/travis?key=8f07584549e458d4c83728f3397ecbd4368e60a8
email: eng@basho.com
otp_release:
- R15B01
- R15B
- R14B04
- R14B03
## Instruction:
Remove pre-R15B01 Erlang OTP releases from the Travis config. We can't use them because they don't support -callback attributes in modules.
## Code After:
language: erlang
before_script:
- export RIAK_TEST_NODE_1=`egrep '^\-s?name' /etc/riak/vm.args | awk '{print $2}'`
- export RIAK_TEST_COOKIE=`egrep '^-setcookie' /etc/riak/vm.args | awk '{print $2}'`
notifications:
webhooks: http://basho-engbot.herokuapp.com/travis?key=8f07584549e458d4c83728f3397ecbd4368e60a8
email: eng@basho.com
otp_release:
- R16B02
- R16B01
- R15B03
- R15B02
- R15B01
| language: erlang
before_script:
- export RIAK_TEST_NODE_1=`egrep '^\-s?name' /etc/riak/vm.args | awk '{print $2}'`
- export RIAK_TEST_COOKIE=`egrep '^-setcookie' /etc/riak/vm.args | awk '{print $2}'`
notifications:
webhooks: http://basho-engbot.herokuapp.com/travis?key=8f07584549e458d4c83728f3397ecbd4368e60a8
email: eng@basho.com
otp_release:
+ - R16B02
+ - R16B01
+ - R15B03
+ - R15B02
- R15B01
- - R15B
- - R14B04
- - R14B03 | 7 | 0.583333 | 4 | 3 |
80400734f96c349c0af739407b9e974355e6cc1b | schema/scripts/40_relation/90_initialize_defaults.sql | schema/scripts/40_relation/90_initialize_defaults.sql | SET search_path = relation, pg_catalog;
INSERT INTO "type" (name) VALUES ('self');
| SET search_path = relation, pg_catalog;
INSERT INTO "type" (name) VALUES ('self');
-- Dummy relations to satisfy geospatial requirements
SELECT relation.define_reverse(
'HandoverRelation->Cell',
relation.define(
'Cell->HandoverRelation',
$$SELECT 0 as source_id, 0 as target_id WHERE false;$$
)
);
SELECT relation.define(
'real_handover',
$$SELECT 0 as source_id, 0 as target_id WHERE false;$$
);
| Define dummy relations for geospatial schema | Define dummy relations for geospatial schema
| SQL | agpl-3.0 | hendrikx-itc/minerva,hendrikx-itc/minerva | sql | ## Code Before:
SET search_path = relation, pg_catalog;
INSERT INTO "type" (name) VALUES ('self');
## Instruction:
Define dummy relations for geospatial schema
## Code After:
SET search_path = relation, pg_catalog;
INSERT INTO "type" (name) VALUES ('self');
-- Dummy relations to satisfy geospatial requirements
SELECT relation.define_reverse(
'HandoverRelation->Cell',
relation.define(
'Cell->HandoverRelation',
$$SELECT 0 as source_id, 0 as target_id WHERE false;$$
)
);
SELECT relation.define(
'real_handover',
$$SELECT 0 as source_id, 0 as target_id WHERE false;$$
);
| SET search_path = relation, pg_catalog;
INSERT INTO "type" (name) VALUES ('self');
+
+ -- Dummy relations to satisfy geospatial requirements
+ SELECT relation.define_reverse(
+ 'HandoverRelation->Cell',
+ relation.define(
+ 'Cell->HandoverRelation',
+ $$SELECT 0 as source_id, 0 as target_id WHERE false;$$
+ )
+ );
+
+ SELECT relation.define(
+ 'real_handover',
+ $$SELECT 0 as source_id, 0 as target_id WHERE false;$$
+ ); | 14 | 3.5 | 14 | 0 |
e0b05a4206e42772d444ff15891587998821cc99 | docs/toc-menu.json | docs/toc-menu.json | [
{ "title": "Overview",
"file": "{{ site.url }}/index.html" },
{ "title": "Download",
"file": "{{ site.url }}/start/download.html" },
{ "title": "Walkthrough",
"file": "{{ site.url }}/start/walkthrough/index.html" },
{ "title": "Guide",
"file": "{{ site.url }}/use/guide/index.html",
"children": {% readj ./use/guide/toc.json %} },
{ "title": "Examples",
"file": "{{ site.url }}/use/examples/index.html",
"children": {% readj ./use/examples/toc.json %} },
{ "title": "Contributing",
"file": "{{ site.url }}/dev/code/index.html",
"exclude": true,
"children": {% readj /dev/toc.json %} }
]
| [
{ "title": "Overview",
"file": "{{ site.url }}/index.html" },
{ "title": "Download",
"file": "{{ site.url }}/start/download.html" },
{ "title": "Getting Started",
"file": "{{ site.url }}/use/guide/quickstart/index.html" },
{ "title": "Walkthrough",
"file": "{{ site.url }}/start/walkthrough/index.html" },
{ "title": "User Guide",
"file": "{{ site.url }}/use/guide/index.html",
"children": {% readj ./use/guide/toc.json %} },
{ "title": "Examples",
"file": "{{ site.url }}/use/examples/index.html",
"children": {% readj ./use/examples/toc.json %} },
{ "title": "Contributing",
"file": "{{ site.url }}/dev/code/index.html",
"exclude": true,
"children": {% readj /dev/toc.json %} }
]
| Add Getting Started to the Top Menu. | Add Getting Started to the Top Menu.
| JSON | apache-2.0 | neykov/incubator-brooklyn,neykov/incubator-brooklyn,bmwshop/brooklyn,neykov/incubator-brooklyn,bmwshop/brooklyn,aledsage/legacy-brooklyn,bmwshop/brooklyn,andreaturli/legacy-brooklyn,aledsage/legacy-brooklyn,neykov/incubator-brooklyn,bmwshop/brooklyn,andreaturli/legacy-brooklyn,neykov/incubator-brooklyn,aledsage/legacy-brooklyn,andreaturli/legacy-brooklyn,bmwshop/brooklyn,andreaturli/legacy-brooklyn,bmwshop/brooklyn,aledsage/legacy-brooklyn,aledsage/legacy-brooklyn,andreaturli/legacy-brooklyn,aledsage/legacy-brooklyn,neykov/incubator-brooklyn,bmwshop/brooklyn,andreaturli/legacy-brooklyn,aledsage/legacy-brooklyn,andreaturli/legacy-brooklyn | json | ## Code Before:
[
{ "title": "Overview",
"file": "{{ site.url }}/index.html" },
{ "title": "Download",
"file": "{{ site.url }}/start/download.html" },
{ "title": "Walkthrough",
"file": "{{ site.url }}/start/walkthrough/index.html" },
{ "title": "Guide",
"file": "{{ site.url }}/use/guide/index.html",
"children": {% readj ./use/guide/toc.json %} },
{ "title": "Examples",
"file": "{{ site.url }}/use/examples/index.html",
"children": {% readj ./use/examples/toc.json %} },
{ "title": "Contributing",
"file": "{{ site.url }}/dev/code/index.html",
"exclude": true,
"children": {% readj /dev/toc.json %} }
]
## Instruction:
Add Getting Started to the Top Menu.
## Code After:
[
{ "title": "Overview",
"file": "{{ site.url }}/index.html" },
{ "title": "Download",
"file": "{{ site.url }}/start/download.html" },
{ "title": "Getting Started",
"file": "{{ site.url }}/use/guide/quickstart/index.html" },
{ "title": "Walkthrough",
"file": "{{ site.url }}/start/walkthrough/index.html" },
{ "title": "User Guide",
"file": "{{ site.url }}/use/guide/index.html",
"children": {% readj ./use/guide/toc.json %} },
{ "title": "Examples",
"file": "{{ site.url }}/use/examples/index.html",
"children": {% readj ./use/examples/toc.json %} },
{ "title": "Contributing",
"file": "{{ site.url }}/dev/code/index.html",
"exclude": true,
"children": {% readj /dev/toc.json %} }
]
| [
{ "title": "Overview",
"file": "{{ site.url }}/index.html" },
{ "title": "Download",
"file": "{{ site.url }}/start/download.html" },
+ { "title": "Getting Started",
+ "file": "{{ site.url }}/use/guide/quickstart/index.html" },
{ "title": "Walkthrough",
"file": "{{ site.url }}/start/walkthrough/index.html" },
- { "title": "Guide",
+ { "title": "User Guide",
? +++++
"file": "{{ site.url }}/use/guide/index.html",
"children": {% readj ./use/guide/toc.json %} },
{ "title": "Examples",
"file": "{{ site.url }}/use/examples/index.html",
"children": {% readj ./use/examples/toc.json %} },
{ "title": "Contributing",
"file": "{{ site.url }}/dev/code/index.html",
"exclude": true,
"children": {% readj /dev/toc.json %} }
] | 4 | 0.222222 | 3 | 1 |
221a6a948e9ccc854f886fa681ceae39aa751a52 | CPackConfig.cmake | CPackConfig.cmake | SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Andreas Grob <vilarion@illarion.org>")
set(CPACK_PACKAGE_VENDOR "Illarion e.V.")
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.txt")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}") | SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Andreas Grob <vilarion@illarion.org>")
set(CPACK_PACKAGE_VENDOR "Illarion e.V.")
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.txt")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
set(CPACK_PACKAGE_FILE_NAME "illarion")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-system1.67.0, libboost-graph1.67.0, libc6 (>= 2.14), libgcc1 (>= 1:3.0), liblua5.2-0, libluabind0.9.1d1, libpqxx-6.2 (>= 6.2), libstdc++6 (>= 6)")
| Add Debian dependencies to cpack config | Add Debian dependencies to cpack config
| CMake | agpl-3.0 | Illarion-eV/Illarion-Server,Illarion-eV/Illarion-Server,Illarion-eV/Illarion-Server | cmake | ## Code Before:
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Andreas Grob <vilarion@illarion.org>")
set(CPACK_PACKAGE_VENDOR "Illarion e.V.")
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.txt")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
## Instruction:
Add Debian dependencies to cpack config
## Code After:
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Andreas Grob <vilarion@illarion.org>")
set(CPACK_PACKAGE_VENDOR "Illarion e.V.")
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.txt")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
set(CPACK_PACKAGE_FILE_NAME "illarion")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-system1.67.0, libboost-graph1.67.0, libc6 (>= 2.14), libgcc1 (>= 1:3.0), liblua5.2-0, libluabind0.9.1d1, libpqxx-6.2 (>= 6.2), libstdc++6 (>= 6)")
| SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Andreas Grob <vilarion@illarion.org>")
set(CPACK_PACKAGE_VENDOR "Illarion e.V.")
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.txt")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
- set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
+ set(CPACK_PACKAGE_FILE_NAME "illarion")
+ set(CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-system1.67.0, libboost-graph1.67.0, libc6 (>= 2.14), libgcc1 (>= 1:3.0), liblua5.2-0, libluabind0.9.1d1, libpqxx-6.2 (>= 6.2), libstdc++6 (>= 6)") | 3 | 0.333333 | 2 | 1 |
899d713eb57e1fce0eb1293e4bdce8bab40dc3cb | packages/gatsby-link/src/index.js | packages/gatsby-link/src/index.js | import React from 'react'
import Link from 'react-router/lib/Link'
// Use createClass instead of ES6 class as Babel spews out a ton of code
// for polyfilling classes which there's no reason to pay for this.
// A function component would be ideal but we need componentDidMount.
const GatsbyLink = React.createClass({
propTypes: {
to: React.PropTypes.string.isRequired,
},
componentDidMount () {
// Only enable prefetching of Link resources in production and for browsers that
// don't support service workers *cough* Safari/IE *cough*.
if (process.env.NODE_ENV === `production` && !(`serviceWorker` in navigator)) {
const routes = window.gatsbyRootRoute
const { createMemoryHistory } = require(`history`)
const matchRoutes = require(`react-router/lib/matchRoutes`)
const getComponents = require(`react-router/lib/getComponents`)
const createLocation = createMemoryHistory().createLocation
if (typeof routes !== 'undefined') {
matchRoutes([routes], createLocation(this.props.to), (error, nextState) => {
getComponents(nextState, () => console.log(`loaded assets for ${this.props.to}`))
})
}
}
},
render () {
return <Link {...this.props} />
},
})
module.exports = GatsbyLink
| import React from 'react'
import Link from 'react-router/lib/Link'
let linkPrefix = ``
if (__PREFIX_LINKS__) {
linkPrefix = __LINK_PREFIX__
}
// Use createClass instead of ES6 class as Babel spews out a ton of code
// for polyfilling classes which there's no reason to pay for this.
// A function component would be ideal but we need componentDidMount.
const GatsbyLink = React.createClass({
propTypes: {
to: React.PropTypes.string.isRequired,
},
componentDidMount () {
// Only enable prefetching of Link resources in production and for browsers that
// don't support service workers *cough* Safari/IE *cough*.
if (process.env.NODE_ENV === `production` && !(`serviceWorker` in navigator)) {
const routes = window.gatsbyRootRoute
const { createMemoryHistory } = require(`history`)
const matchRoutes = require(`react-router/lib/matchRoutes`)
const getComponents = require(`react-router/lib/getComponents`)
const createLocation = createMemoryHistory().createLocation
if (typeof routes !== 'undefined') {
matchRoutes([routes], createLocation(this.props.to), (error, nextState) => {
getComponents(nextState, () => console.log(`loaded assets for ${this.props.to}`))
})
}
}
},
render () {
const to = linkPrefix + this.props.to
return <Link {...this.props} to={to} />
},
})
module.exports = GatsbyLink
| Add linkPrefix to links when activated | Add linkPrefix to links when activated
| JavaScript | mit | gatsbyjs/gatsby,0x80/gatsby,fabrictech/gatsby,chiedo/gatsby,0x80/gatsby,danielfarrell/gatsby,ChristopherBiscardi/gatsby,gatsbyjs/gatsby,fk/gatsby,okcoker/gatsby,gatsbyjs/gatsby,fk/gatsby,chiedo/gatsby,mickeyreiss/gatsby,mingaldrichgan/gatsby,mingaldrichgan/gatsby,0x80/gatsby,okcoker/gatsby,ChristopherBiscardi/gatsby,gatsbyjs/gatsby,Khaledgarbaya/gatsby,gatsbyjs/gatsby,gatsbyjs/gatsby,okcoker/gatsby,fk/gatsby,danielfarrell/gatsby,ChristopherBiscardi/gatsby,fabrictech/gatsby,Khaledgarbaya/gatsby,mingaldrichgan/gatsby,fabrictech/gatsby,danielfarrell/gatsby,Khaledgarbaya/gatsby,mickeyreiss/gatsby,chiedo/gatsby,mickeyreiss/gatsby,ChristopherBiscardi/gatsby | javascript | ## Code Before:
import React from 'react'
import Link from 'react-router/lib/Link'
// Use createClass instead of ES6 class as Babel spews out a ton of code
// for polyfilling classes which there's no reason to pay for this.
// A function component would be ideal but we need componentDidMount.
const GatsbyLink = React.createClass({
propTypes: {
to: React.PropTypes.string.isRequired,
},
componentDidMount () {
// Only enable prefetching of Link resources in production and for browsers that
// don't support service workers *cough* Safari/IE *cough*.
if (process.env.NODE_ENV === `production` && !(`serviceWorker` in navigator)) {
const routes = window.gatsbyRootRoute
const { createMemoryHistory } = require(`history`)
const matchRoutes = require(`react-router/lib/matchRoutes`)
const getComponents = require(`react-router/lib/getComponents`)
const createLocation = createMemoryHistory().createLocation
if (typeof routes !== 'undefined') {
matchRoutes([routes], createLocation(this.props.to), (error, nextState) => {
getComponents(nextState, () => console.log(`loaded assets for ${this.props.to}`))
})
}
}
},
render () {
return <Link {...this.props} />
},
})
module.exports = GatsbyLink
## Instruction:
Add linkPrefix to links when activated
## Code After:
import React from 'react'
import Link from 'react-router/lib/Link'
let linkPrefix = ``
if (__PREFIX_LINKS__) {
linkPrefix = __LINK_PREFIX__
}
// Use createClass instead of ES6 class as Babel spews out a ton of code
// for polyfilling classes which there's no reason to pay for this.
// A function component would be ideal but we need componentDidMount.
const GatsbyLink = React.createClass({
propTypes: {
to: React.PropTypes.string.isRequired,
},
componentDidMount () {
// Only enable prefetching of Link resources in production and for browsers that
// don't support service workers *cough* Safari/IE *cough*.
if (process.env.NODE_ENV === `production` && !(`serviceWorker` in navigator)) {
const routes = window.gatsbyRootRoute
const { createMemoryHistory } = require(`history`)
const matchRoutes = require(`react-router/lib/matchRoutes`)
const getComponents = require(`react-router/lib/getComponents`)
const createLocation = createMemoryHistory().createLocation
if (typeof routes !== 'undefined') {
matchRoutes([routes], createLocation(this.props.to), (error, nextState) => {
getComponents(nextState, () => console.log(`loaded assets for ${this.props.to}`))
})
}
}
},
render () {
const to = linkPrefix + this.props.to
return <Link {...this.props} to={to} />
},
})
module.exports = GatsbyLink
| import React from 'react'
import Link from 'react-router/lib/Link'
+
+ let linkPrefix = ``
+ if (__PREFIX_LINKS__) {
+ linkPrefix = __LINK_PREFIX__
+ }
// Use createClass instead of ES6 class as Babel spews out a ton of code
// for polyfilling classes which there's no reason to pay for this.
// A function component would be ideal but we need componentDidMount.
const GatsbyLink = React.createClass({
propTypes: {
to: React.PropTypes.string.isRequired,
},
componentDidMount () {
// Only enable prefetching of Link resources in production and for browsers that
// don't support service workers *cough* Safari/IE *cough*.
if (process.env.NODE_ENV === `production` && !(`serviceWorker` in navigator)) {
const routes = window.gatsbyRootRoute
const { createMemoryHistory } = require(`history`)
const matchRoutes = require(`react-router/lib/matchRoutes`)
const getComponents = require(`react-router/lib/getComponents`)
const createLocation = createMemoryHistory().createLocation
if (typeof routes !== 'undefined') {
matchRoutes([routes], createLocation(this.props.to), (error, nextState) => {
getComponents(nextState, () => console.log(`loaded assets for ${this.props.to}`))
})
}
}
},
render () {
+ const to = linkPrefix + this.props.to
- return <Link {...this.props} />
+ return <Link {...this.props} to={to} />
? ++++++++
},
})
module.exports = GatsbyLink | 8 | 0.222222 | 7 | 1 |
1d55fe7b1f4f3d70da6867ef7465ac44f8d2da38 | keyring/tests/backends/test_OS_X.py | keyring/tests/backends/test_OS_X.py | import sys
from ..test_backend import BackendBasicTests
from ..py30compat import unittest
from keyring.backends import OS_X
def is_osx_keychain_supported():
return sys.platform in ('mac','darwin')
@unittest.skipUnless(is_osx_keychain_supported(),
"Need OS X")
class OSXKeychainTestCase(BackendBasicTests, unittest.TestCase):
def init_keyring(self):
return OS_X.Keyring()
@unittest.expectedFailure
def test_delete_present(self):
"""Not implemented"""
super(OSXKeychainTestCase, self).test_delete_present()
class SecurityCommandTestCase(unittest.TestCase):
def test_SecurityCommand(self):
self.assertEqual(OS_X.SecurityCommand('get'), 'get-generic-password')
self.assertEqual(OS_X.SecurityCommand('set', 'internet'), 'set-internet-password')
| import sys
from ..test_backend import BackendBasicTests
from ..py30compat import unittest
from keyring.backends import OS_X
def is_osx_keychain_supported():
return sys.platform in ('mac','darwin')
@unittest.skipUnless(is_osx_keychain_supported(),
"Need OS X")
class OSXKeychainTestCase(BackendBasicTests, unittest.TestCase):
def init_keyring(self):
return OS_X.Keyring()
class SecurityCommandTestCase(unittest.TestCase):
def test_SecurityCommand(self):
self.assertEqual(OS_X.SecurityCommand('get'), 'get-generic-password')
self.assertEqual(OS_X.SecurityCommand('set', 'internet'), 'set-internet-password')
| Test passes on OS X | Test passes on OS X
| Python | mit | jaraco/keyring | python | ## Code Before:
import sys
from ..test_backend import BackendBasicTests
from ..py30compat import unittest
from keyring.backends import OS_X
def is_osx_keychain_supported():
return sys.platform in ('mac','darwin')
@unittest.skipUnless(is_osx_keychain_supported(),
"Need OS X")
class OSXKeychainTestCase(BackendBasicTests, unittest.TestCase):
def init_keyring(self):
return OS_X.Keyring()
@unittest.expectedFailure
def test_delete_present(self):
"""Not implemented"""
super(OSXKeychainTestCase, self).test_delete_present()
class SecurityCommandTestCase(unittest.TestCase):
def test_SecurityCommand(self):
self.assertEqual(OS_X.SecurityCommand('get'), 'get-generic-password')
self.assertEqual(OS_X.SecurityCommand('set', 'internet'), 'set-internet-password')
## Instruction:
Test passes on OS X
## Code After:
import sys
from ..test_backend import BackendBasicTests
from ..py30compat import unittest
from keyring.backends import OS_X
def is_osx_keychain_supported():
return sys.platform in ('mac','darwin')
@unittest.skipUnless(is_osx_keychain_supported(),
"Need OS X")
class OSXKeychainTestCase(BackendBasicTests, unittest.TestCase):
def init_keyring(self):
return OS_X.Keyring()
class SecurityCommandTestCase(unittest.TestCase):
def test_SecurityCommand(self):
self.assertEqual(OS_X.SecurityCommand('get'), 'get-generic-password')
self.assertEqual(OS_X.SecurityCommand('set', 'internet'), 'set-internet-password')
| import sys
from ..test_backend import BackendBasicTests
from ..py30compat import unittest
from keyring.backends import OS_X
def is_osx_keychain_supported():
return sys.platform in ('mac','darwin')
@unittest.skipUnless(is_osx_keychain_supported(),
"Need OS X")
class OSXKeychainTestCase(BackendBasicTests, unittest.TestCase):
def init_keyring(self):
return OS_X.Keyring()
- @unittest.expectedFailure
- def test_delete_present(self):
- """Not implemented"""
- super(OSXKeychainTestCase, self).test_delete_present()
-
class SecurityCommandTestCase(unittest.TestCase):
def test_SecurityCommand(self):
self.assertEqual(OS_X.SecurityCommand('get'), 'get-generic-password')
self.assertEqual(OS_X.SecurityCommand('set', 'internet'), 'set-internet-password') | 5 | 0.2 | 0 | 5 |
a62d454ed18fcbebb9c498bd945c4c1c03cc7fcb | lib/carrierwave/storage/cascade.rb | lib/carrierwave/storage/cascade.rb | module CarrierWave
module Storage
class Cascade < Abstract
attr_reader :primary_storage, :secondary_storage
def initialize(*args)
super(*args)
@primary_storage = get_storage(uploader.class.primary_storage).new(*args)
@secondary_storage = get_storage(uploader.class.secondary_storage).new(*args)
end
def store!(*args)
primary_storage.store!(*args)
end
def retrieve!(*args)
primary_file = primary_storage.retrieve!(*args)
if !primary_file.exists?
secondary_file = secondary_storage.retrieve!(*args)
return SecondaryFileProxy.new(uploader, secondary_file)
else
return primary_file
end
end
private
def get_storage(storage = nil)
storage.is_a?(Symbol) ? eval(uploader.storage_engines[storage]) : storage
end
class SecondaryFileProxy
attr_reader :real_file
def initialize(uploader, real_file)
@uploader = uploader
@real_file = real_file
end
def delete
if true === @uploader.allow_secondary_file_deletion
return real_file.delete
else
return true
end
end
def method_missing(*args, &block)
real_file.send(*args, &block)
end
def respond_to?(*args)
@real_file.respond_to?(*args)
end
end
end
end
end
| module CarrierWave
module Storage
class Cascade < Abstract
attr_reader :primary_storage, :secondary_storage
def initialize(*args)
super(*args)
@primary_storage = get_storage(uploader.class.primary_storage).new(*args)
@secondary_storage = get_storage(uploader.class.secondary_storage).new(*args)
end
def store!(*args)
primary_storage.store!(*args)
end
def retrieve!(*args)
primary_file = primary_storage.retrieve!(*args)
if !primary_file.exists?
secondary_file = secondary_storage.retrieve!(*args)
return SecondaryFileProxy.new(uploader, secondary_file)
else
return primary_file
end
end
private
def get_storage(storage = nil)
storage.is_a?(Symbol) ? eval(uploader.storage_engines[storage]) : storage
end
class SecondaryFileProxy
attr_reader :real_file
def initialize(uploader, real_file)
@uploader = uploader
@real_file = real_file
end
def delete
if true === @uploader.allow_secondary_file_deletion
return real_file.delete
else
return true
end
end
def method_missing(*args, &block)
real_file.send(*args, &block)
end
def respond_to?(*args)
@real_file.respond_to?(*args)
end
def method(*args)
real_file.send(:method, *args)
end
end
end
end
end
| Fix compatibility with newer carrierwave that calls the method method | Fix compatibility with newer carrierwave that calls the method method
| Ruby | mit | kjg/carrierwave-cascade | ruby | ## Code Before:
module CarrierWave
module Storage
class Cascade < Abstract
attr_reader :primary_storage, :secondary_storage
def initialize(*args)
super(*args)
@primary_storage = get_storage(uploader.class.primary_storage).new(*args)
@secondary_storage = get_storage(uploader.class.secondary_storage).new(*args)
end
def store!(*args)
primary_storage.store!(*args)
end
def retrieve!(*args)
primary_file = primary_storage.retrieve!(*args)
if !primary_file.exists?
secondary_file = secondary_storage.retrieve!(*args)
return SecondaryFileProxy.new(uploader, secondary_file)
else
return primary_file
end
end
private
def get_storage(storage = nil)
storage.is_a?(Symbol) ? eval(uploader.storage_engines[storage]) : storage
end
class SecondaryFileProxy
attr_reader :real_file
def initialize(uploader, real_file)
@uploader = uploader
@real_file = real_file
end
def delete
if true === @uploader.allow_secondary_file_deletion
return real_file.delete
else
return true
end
end
def method_missing(*args, &block)
real_file.send(*args, &block)
end
def respond_to?(*args)
@real_file.respond_to?(*args)
end
end
end
end
end
## Instruction:
Fix compatibility with newer carrierwave that calls the method method
## Code After:
module CarrierWave
module Storage
class Cascade < Abstract
attr_reader :primary_storage, :secondary_storage
def initialize(*args)
super(*args)
@primary_storage = get_storage(uploader.class.primary_storage).new(*args)
@secondary_storage = get_storage(uploader.class.secondary_storage).new(*args)
end
def store!(*args)
primary_storage.store!(*args)
end
def retrieve!(*args)
primary_file = primary_storage.retrieve!(*args)
if !primary_file.exists?
secondary_file = secondary_storage.retrieve!(*args)
return SecondaryFileProxy.new(uploader, secondary_file)
else
return primary_file
end
end
private
def get_storage(storage = nil)
storage.is_a?(Symbol) ? eval(uploader.storage_engines[storage]) : storage
end
class SecondaryFileProxy
attr_reader :real_file
def initialize(uploader, real_file)
@uploader = uploader
@real_file = real_file
end
def delete
if true === @uploader.allow_secondary_file_deletion
return real_file.delete
else
return true
end
end
def method_missing(*args, &block)
real_file.send(*args, &block)
end
def respond_to?(*args)
@real_file.respond_to?(*args)
end
def method(*args)
real_file.send(:method, *args)
end
end
end
end
end
| module CarrierWave
module Storage
class Cascade < Abstract
attr_reader :primary_storage, :secondary_storage
def initialize(*args)
super(*args)
@primary_storage = get_storage(uploader.class.primary_storage).new(*args)
@secondary_storage = get_storage(uploader.class.secondary_storage).new(*args)
end
def store!(*args)
primary_storage.store!(*args)
end
def retrieve!(*args)
primary_file = primary_storage.retrieve!(*args)
if !primary_file.exists?
secondary_file = secondary_storage.retrieve!(*args)
return SecondaryFileProxy.new(uploader, secondary_file)
else
return primary_file
end
end
private
def get_storage(storage = nil)
storage.is_a?(Symbol) ? eval(uploader.storage_engines[storage]) : storage
end
class SecondaryFileProxy
attr_reader :real_file
def initialize(uploader, real_file)
@uploader = uploader
@real_file = real_file
end
def delete
if true === @uploader.allow_secondary_file_deletion
return real_file.delete
else
return true
end
end
def method_missing(*args, &block)
real_file.send(*args, &block)
end
def respond_to?(*args)
@real_file.respond_to?(*args)
end
+
+ def method(*args)
+ real_file.send(:method, *args)
+ end
end
end
end
end | 4 | 0.064516 | 4 | 0 |
29f847ae3dae83f4ab24b8a9f1ecffc74d49d68c | xchainer/array_node.h | xchainer/array_node.h |
namespace xchainer {
class OpNode;
class ArrayNode {
public:
ArrayNode() = default;
const std::shared_ptr<OpNode>& next_node() { return next_node_; }
std::shared_ptr<const OpNode> next_node() const { return next_node_; }
void set_next_node(std::shared_ptr<OpNode> next_node) { next_node_ = std::move(next_node); }
const nonstd::optional<Array>& grad() const { return grad_; }
void set_grad(Array grad) { grad_.emplace(std::move(grad)); };
void ClearGrad() { grad_ = nonstd::nullopt; }
private:
std::shared_ptr<OpNode> next_node_;
nonstd::optional<Array> grad_;
};
} // xchainer
|
namespace xchainer {
class OpNode;
class ArrayNode {
public:
ArrayNode() = default;
const std::shared_ptr<OpNode>& next_node() { return next_node_; }
std::shared_ptr<const OpNode> next_node() const { return next_node_; }
void set_next_node(std::shared_ptr<OpNode> next_node) { next_node_ = std::move(next_node); }
const nonstd::optional<Array>& grad() const { return grad_; }
void set_grad(Array grad) { grad_.emplace(std::move(grad)); };
void ClearGrad() { grad_.reset(); }
private:
std::shared_ptr<OpNode> next_node_;
nonstd::optional<Array> grad_;
};
} // xchainer
| Use reset() to make optional empty | Use reset() to make optional empty
| C | mit | ktnyt/chainer,wkentaro/chainer,wkentaro/chainer,wkentaro/chainer,okuta/chainer,hvy/chainer,niboshi/chainer,niboshi/chainer,keisuke-umezawa/chainer,hvy/chainer,keisuke-umezawa/chainer,tkerola/chainer,jnishi/chainer,chainer/chainer,keisuke-umezawa/chainer,ktnyt/chainer,okuta/chainer,jnishi/chainer,chainer/chainer,jnishi/chainer,pfnet/chainer,wkentaro/chainer,okuta/chainer,ktnyt/chainer,hvy/chainer,keisuke-umezawa/chainer,jnishi/chainer,ktnyt/chainer,niboshi/chainer,okuta/chainer,chainer/chainer,hvy/chainer,chainer/chainer,niboshi/chainer | c | ## Code Before:
namespace xchainer {
class OpNode;
class ArrayNode {
public:
ArrayNode() = default;
const std::shared_ptr<OpNode>& next_node() { return next_node_; }
std::shared_ptr<const OpNode> next_node() const { return next_node_; }
void set_next_node(std::shared_ptr<OpNode> next_node) { next_node_ = std::move(next_node); }
const nonstd::optional<Array>& grad() const { return grad_; }
void set_grad(Array grad) { grad_.emplace(std::move(grad)); };
void ClearGrad() { grad_ = nonstd::nullopt; }
private:
std::shared_ptr<OpNode> next_node_;
nonstd::optional<Array> grad_;
};
} // xchainer
## Instruction:
Use reset() to make optional empty
## Code After:
namespace xchainer {
class OpNode;
class ArrayNode {
public:
ArrayNode() = default;
const std::shared_ptr<OpNode>& next_node() { return next_node_; }
std::shared_ptr<const OpNode> next_node() const { return next_node_; }
void set_next_node(std::shared_ptr<OpNode> next_node) { next_node_ = std::move(next_node); }
const nonstd::optional<Array>& grad() const { return grad_; }
void set_grad(Array grad) { grad_.emplace(std::move(grad)); };
void ClearGrad() { grad_.reset(); }
private:
std::shared_ptr<OpNode> next_node_;
nonstd::optional<Array> grad_;
};
} // xchainer
|
namespace xchainer {
class OpNode;
class ArrayNode {
public:
ArrayNode() = default;
const std::shared_ptr<OpNode>& next_node() { return next_node_; }
std::shared_ptr<const OpNode> next_node() const { return next_node_; }
void set_next_node(std::shared_ptr<OpNode> next_node) { next_node_ = std::move(next_node); }
const nonstd::optional<Array>& grad() const { return grad_; }
void set_grad(Array grad) { grad_.emplace(std::move(grad)); };
- void ClearGrad() { grad_ = nonstd::nullopt; }
? ^^^^^^ ^^^^^^^^^^
+ void ClearGrad() { grad_.reset(); }
? ^^^ + ^^
private:
std::shared_ptr<OpNode> next_node_;
nonstd::optional<Array> grad_;
};
} // xchainer | 2 | 0.076923 | 1 | 1 |
693f7c2b516523e9618d930c9c1c03fa1afe85fc | src/main/resources/application-dev.properties | src/main/resources/application-dev.properties | spring.datasource.url=jdbc:h2:mem:urlaubsverwaltung;DB_CLOSE_DELAY=-1
spring.datasource.username=dbUser
spring.datasource.password=
# H2 DATABASE ----------------------------------------------------------------------------------------------------------
# Should H2 web console should be enabled or not?
spring.h2.console.enabled=true
# VIEW -----------------------------------------------------------------------------------------------------------------
#server.jsp-servlet.init-parameters.development=true
# Cache period for the resources served by the resource handler, in seconds
#spring.resources.cache-period=0
# TEST DATA ------------------------------------------------------------------------------------------------------------
# Should test data be created on startup or not?
testdata.create=true
# AUTHENTICATION -------------------------------------------------------------------------------------------------------
# Choose one: default, ldap, activeDirectory
auth=default
# LOGGING --------------------------------------------------------------------------------------------------------------
logging.file=
| spring.datasource.url=jdbc:h2:mem:urlaubsverwaltung;DB_CLOSE_DELAY=-1
spring.datasource.username=dbUser
spring.datasource.password=
# H2 DATABASE ----------------------------------------------------------------------------------------------------------
# Should H2 web console should be enabled or not?
spring.h2.console.enabled=true
# VIEW -----------------------------------------------------------------------------------------------------------------
#server.jsp-servlet.init-parameters.development=true
# Cache period for the resources served by the resource handler, in seconds
#spring.resources.cache-period=0
# TEST DATA ------------------------------------------------------------------------------------------------------------
# Should test data be created on startup or not?
testdata.create=true
# AUTHENTICATION -------------------------------------------------------------------------------------------------------
# Choose one: default, ldap, activeDirectory
auth=default
# LOGGING --------------------------------------------------------------------------------------------------------------
logging.file=
# ACTUATOR -------------------------------------------------------------------------------------------------------------
management.health.mail.enabled=false
management.health.ldap.enabled=false
| Disable ldap/mail in health endpoint for dev profile | Disable ldap/mail in health endpoint for dev profile
| INI | apache-2.0 | synyx/urlaubsverwaltung,synyx/urlaubsverwaltung,synyx/urlaubsverwaltung,synyx/urlaubsverwaltung | ini | ## Code Before:
spring.datasource.url=jdbc:h2:mem:urlaubsverwaltung;DB_CLOSE_DELAY=-1
spring.datasource.username=dbUser
spring.datasource.password=
# H2 DATABASE ----------------------------------------------------------------------------------------------------------
# Should H2 web console should be enabled or not?
spring.h2.console.enabled=true
# VIEW -----------------------------------------------------------------------------------------------------------------
#server.jsp-servlet.init-parameters.development=true
# Cache period for the resources served by the resource handler, in seconds
#spring.resources.cache-period=0
# TEST DATA ------------------------------------------------------------------------------------------------------------
# Should test data be created on startup or not?
testdata.create=true
# AUTHENTICATION -------------------------------------------------------------------------------------------------------
# Choose one: default, ldap, activeDirectory
auth=default
# LOGGING --------------------------------------------------------------------------------------------------------------
logging.file=
## Instruction:
Disable ldap/mail in health endpoint for dev profile
## Code After:
spring.datasource.url=jdbc:h2:mem:urlaubsverwaltung;DB_CLOSE_DELAY=-1
spring.datasource.username=dbUser
spring.datasource.password=
# H2 DATABASE ----------------------------------------------------------------------------------------------------------
# Should H2 web console should be enabled or not?
spring.h2.console.enabled=true
# VIEW -----------------------------------------------------------------------------------------------------------------
#server.jsp-servlet.init-parameters.development=true
# Cache period for the resources served by the resource handler, in seconds
#spring.resources.cache-period=0
# TEST DATA ------------------------------------------------------------------------------------------------------------
# Should test data be created on startup or not?
testdata.create=true
# AUTHENTICATION -------------------------------------------------------------------------------------------------------
# Choose one: default, ldap, activeDirectory
auth=default
# LOGGING --------------------------------------------------------------------------------------------------------------
logging.file=
# ACTUATOR -------------------------------------------------------------------------------------------------------------
management.health.mail.enabled=false
management.health.ldap.enabled=false
| spring.datasource.url=jdbc:h2:mem:urlaubsverwaltung;DB_CLOSE_DELAY=-1
spring.datasource.username=dbUser
spring.datasource.password=
# H2 DATABASE ----------------------------------------------------------------------------------------------------------
# Should H2 web console should be enabled or not?
spring.h2.console.enabled=true
# VIEW -----------------------------------------------------------------------------------------------------------------
#server.jsp-servlet.init-parameters.development=true
# Cache period for the resources served by the resource handler, in seconds
#spring.resources.cache-period=0
# TEST DATA ------------------------------------------------------------------------------------------------------------
# Should test data be created on startup or not?
testdata.create=true
# AUTHENTICATION -------------------------------------------------------------------------------------------------------
# Choose one: default, ldap, activeDirectory
auth=default
# LOGGING --------------------------------------------------------------------------------------------------------------
logging.file=
+
+ # ACTUATOR -------------------------------------------------------------------------------------------------------------
+ management.health.mail.enabled=false
+ management.health.ldap.enabled=false | 4 | 0.173913 | 4 | 0 |
e002b8a6d6b9082f35ab1c9c4cfde8123497074f | appveyor.yml | appveyor.yml |
os: Visual Studio 2017
version: 0.7.0-build-0{build}
branches:
only:
- master
- dev
pull_requests:
do_not_increment_build_number: true
#---------------------------------#
# build configuration #
#---------------------------------#
build_script:
- powershell .\build.ps1 -Target Pack
after_build:
- "SET PATH=C:\\Python34;C:\\Python34\\Scripts;%PATH%"
- pip install codecov
- codecov -f coverage.xml
#---------------------------------#
# artifacts configuration #
#---------------------------------#
artifacts:
- path: 'build\*.nupkg'
- path: 'build\*.zip'
#---------------------------------#
# deployment configuration #
#---------------------------------#
deploy:
- provider: GitHub
auth_token:
secure: Hw+eMEw//BNM8ZZSQidchwbrj25XFKykj+NdQKXtXWEsHKZdXTWRZjfDjK6UZLxU
artifact: /.*\.zip/
draft: true
on:
appveyor_repo_tag: true
- provider: NuGet
api_key:
secure: kh5QkGdRphbEh7b8XEPZQ57zkMzwFIO2IAUBYvq15reCmczepmUZmGF0KIp0razF
on:
appveyor_repo_tag: true
|
os: Visual Studio 2017
version: 0.7.0-build-0{build}
branches:
only:
- master
- dev
pull_requests:
do_not_increment_build_number: true
#---------------------------------#
# build configuration #
#---------------------------------#
build_script:
- powershell .\build.ps1 -Target Pack
#---------------------------------#
# artifacts configuration #
#---------------------------------#
artifacts:
- path: 'build\*.nupkg'
- path: 'build\*.zip'
#---------------------------------#
# deployment configuration #
#---------------------------------#
deploy:
- provider: GitHub
auth_token:
secure: Hw+eMEw//BNM8ZZSQidchwbrj25XFKykj+NdQKXtXWEsHKZdXTWRZjfDjK6UZLxU
artifact: /.*\.zip/
draft: true
on:
appveyor_repo_tag: true
- provider: NuGet
api_key:
secure: kh5QkGdRphbEh7b8XEPZQ57zkMzwFIO2IAUBYvq15reCmczepmUZmGF0KIp0razF
on:
appveyor_repo_tag: true
| Remove codecov tool usage from AppVeyor builds | Remove codecov tool usage from AppVeyor builds
| YAML | mit | HangfireIO/Cronos | yaml | ## Code Before:
os: Visual Studio 2017
version: 0.7.0-build-0{build}
branches:
only:
- master
- dev
pull_requests:
do_not_increment_build_number: true
#---------------------------------#
# build configuration #
#---------------------------------#
build_script:
- powershell .\build.ps1 -Target Pack
after_build:
- "SET PATH=C:\\Python34;C:\\Python34\\Scripts;%PATH%"
- pip install codecov
- codecov -f coverage.xml
#---------------------------------#
# artifacts configuration #
#---------------------------------#
artifacts:
- path: 'build\*.nupkg'
- path: 'build\*.zip'
#---------------------------------#
# deployment configuration #
#---------------------------------#
deploy:
- provider: GitHub
auth_token:
secure: Hw+eMEw//BNM8ZZSQidchwbrj25XFKykj+NdQKXtXWEsHKZdXTWRZjfDjK6UZLxU
artifact: /.*\.zip/
draft: true
on:
appveyor_repo_tag: true
- provider: NuGet
api_key:
secure: kh5QkGdRphbEh7b8XEPZQ57zkMzwFIO2IAUBYvq15reCmczepmUZmGF0KIp0razF
on:
appveyor_repo_tag: true
## Instruction:
Remove codecov tool usage from AppVeyor builds
## Code After:
os: Visual Studio 2017
version: 0.7.0-build-0{build}
branches:
only:
- master
- dev
pull_requests:
do_not_increment_build_number: true
#---------------------------------#
# build configuration #
#---------------------------------#
build_script:
- powershell .\build.ps1 -Target Pack
#---------------------------------#
# artifacts configuration #
#---------------------------------#
artifacts:
- path: 'build\*.nupkg'
- path: 'build\*.zip'
#---------------------------------#
# deployment configuration #
#---------------------------------#
deploy:
- provider: GitHub
auth_token:
secure: Hw+eMEw//BNM8ZZSQidchwbrj25XFKykj+NdQKXtXWEsHKZdXTWRZjfDjK6UZLxU
artifact: /.*\.zip/
draft: true
on:
appveyor_repo_tag: true
- provider: NuGet
api_key:
secure: kh5QkGdRphbEh7b8XEPZQ57zkMzwFIO2IAUBYvq15reCmczepmUZmGF0KIp0razF
on:
appveyor_repo_tag: true
|
os: Visual Studio 2017
version: 0.7.0-build-0{build}
branches:
only:
- master
- dev
pull_requests:
do_not_increment_build_number: true
#---------------------------------#
# build configuration #
#---------------------------------#
build_script:
- powershell .\build.ps1 -Target Pack
-
- after_build:
- - "SET PATH=C:\\Python34;C:\\Python34\\Scripts;%PATH%"
- - pip install codecov
- - codecov -f coverage.xml
#---------------------------------#
# artifacts configuration #
#---------------------------------#
artifacts:
- path: 'build\*.nupkg'
- path: 'build\*.zip'
#---------------------------------#
# deployment configuration #
#---------------------------------#
deploy:
- provider: GitHub
auth_token:
secure: Hw+eMEw//BNM8ZZSQidchwbrj25XFKykj+NdQKXtXWEsHKZdXTWRZjfDjK6UZLxU
artifact: /.*\.zip/
draft: true
on:
appveyor_repo_tag: true
- provider: NuGet
api_key:
secure: kh5QkGdRphbEh7b8XEPZQ57zkMzwFIO2IAUBYvq15reCmczepmUZmGF0KIp0razF
on:
appveyor_repo_tag: true | 5 | 0.098039 | 0 | 5 |
13c8dc95c4ae297da39b3d133e2c07709a936074 | src/test/groovy/sdkman/cucumber/RunCukeTests.groovy | src/test/groovy/sdkman/cucumber/RunCukeTests.groovy | package sdkman.cucumber
import cucumber.api.junit.Cucumber
import org.junit.runner.RunWith
@RunWith(Cucumber)
@Cucumber.Options(
format=["pretty", "html:build/reports/cucumber"],
strict=true,
features=["src/test/cucumber"],
glue=["src/test/steps"],
tags=["~@manual", "~@review"]
)
class RunCukesTest {}
| package sdkman.cucumber
import cucumber.api.CucumberOptions
import cucumber.api.junit.Cucumber
import org.junit.runner.RunWith
@RunWith(Cucumber)
@CucumberOptions(
format=["pretty", "html:build/reports/cucumber"],
strict=true,
features=["src/test/cucumber"],
glue=["src/test/steps"],
tags=["~@manual", "~@review"]
)
class RunCukesTest {}
| Use new CucumberOptions annotations for Cukes test runner. | Use new CucumberOptions annotations for Cukes test runner.
| Groovy | apache-2.0 | skpal/sdkman-cli,shanman190/sdkman-cli,GsusRecovery/sdkman-cli,GsusRecovery/sdkman-cli,skpal/sdkman-cli,gvmtool/gvm-cli,sdkman/sdkman-cli,busches/gvm-cli,jbovet/gvm | groovy | ## Code Before:
package sdkman.cucumber
import cucumber.api.junit.Cucumber
import org.junit.runner.RunWith
@RunWith(Cucumber)
@Cucumber.Options(
format=["pretty", "html:build/reports/cucumber"],
strict=true,
features=["src/test/cucumber"],
glue=["src/test/steps"],
tags=["~@manual", "~@review"]
)
class RunCukesTest {}
## Instruction:
Use new CucumberOptions annotations for Cukes test runner.
## Code After:
package sdkman.cucumber
import cucumber.api.CucumberOptions
import cucumber.api.junit.Cucumber
import org.junit.runner.RunWith
@RunWith(Cucumber)
@CucumberOptions(
format=["pretty", "html:build/reports/cucumber"],
strict=true,
features=["src/test/cucumber"],
glue=["src/test/steps"],
tags=["~@manual", "~@review"]
)
class RunCukesTest {}
| package sdkman.cucumber
+ import cucumber.api.CucumberOptions
import cucumber.api.junit.Cucumber
import org.junit.runner.RunWith
@RunWith(Cucumber)
- @Cucumber.Options(
? -
+ @CucumberOptions(
format=["pretty", "html:build/reports/cucumber"],
strict=true,
features=["src/test/cucumber"],
glue=["src/test/steps"],
tags=["~@manual", "~@review"]
)
class RunCukesTest {} | 3 | 0.214286 | 2 | 1 |
3ed1ed8b3675bbd3369eae1583e6a293a00bf233 | test/test-all.js | test/test-all.js | "use strict";
exports["test filter"] = require("./filter")
exports["test map"] = require("./map")
exports["test take"] = require("./take")
exports["test take while"] = require("./take-while")
exports["test drop"] = require("./drop")
exports["test drop while"] = require("./drop-while")
exports["test into"] = require("./into")
exports["test concat"] = require("./concat")
exports["test flatten"] = require("./flatten")
exports["test signal"] = require("./signal")
exports["test hub"] = require("./hub")
exports["test queue"] = require("./queue")
exports["test buffer"] = require("./buffer")
exports["test zip"] = require("./zip")
if (module == require.main)
require("test").run(exports)
| "use strict";
exports["test filter"] = require("./filter")
exports["test map"] = require("./map")
exports["test take"] = require("./take")
exports["test take while"] = require("./take-while")
exports["test drop"] = require("./drop")
exports["test drop while"] = require("./drop-while")
exports["test into"] = require("./into")
exports["test concat"] = require("./concat")
exports["test flatten"] = require("./flatten")
exports["test signal"] = require("./signal")
exports["test hub"] = require("./hub")
exports["test queue"] = require("./queue")
exports["test buffer"] = require("./buffer")
exports["test zip"] = require("./zip")
exports["test delay"] = require("./delay")
if (module == require.main)
require("test").run(exports)
| Add delay test to the test index. | Add delay test to the test index. | JavaScript | mit | Gozala/reducers | javascript | ## Code Before:
"use strict";
exports["test filter"] = require("./filter")
exports["test map"] = require("./map")
exports["test take"] = require("./take")
exports["test take while"] = require("./take-while")
exports["test drop"] = require("./drop")
exports["test drop while"] = require("./drop-while")
exports["test into"] = require("./into")
exports["test concat"] = require("./concat")
exports["test flatten"] = require("./flatten")
exports["test signal"] = require("./signal")
exports["test hub"] = require("./hub")
exports["test queue"] = require("./queue")
exports["test buffer"] = require("./buffer")
exports["test zip"] = require("./zip")
if (module == require.main)
require("test").run(exports)
## Instruction:
Add delay test to the test index.
## Code After:
"use strict";
exports["test filter"] = require("./filter")
exports["test map"] = require("./map")
exports["test take"] = require("./take")
exports["test take while"] = require("./take-while")
exports["test drop"] = require("./drop")
exports["test drop while"] = require("./drop-while")
exports["test into"] = require("./into")
exports["test concat"] = require("./concat")
exports["test flatten"] = require("./flatten")
exports["test signal"] = require("./signal")
exports["test hub"] = require("./hub")
exports["test queue"] = require("./queue")
exports["test buffer"] = require("./buffer")
exports["test zip"] = require("./zip")
exports["test delay"] = require("./delay")
if (module == require.main)
require("test").run(exports)
| "use strict";
exports["test filter"] = require("./filter")
exports["test map"] = require("./map")
exports["test take"] = require("./take")
exports["test take while"] = require("./take-while")
exports["test drop"] = require("./drop")
exports["test drop while"] = require("./drop-while")
exports["test into"] = require("./into")
exports["test concat"] = require("./concat")
exports["test flatten"] = require("./flatten")
exports["test signal"] = require("./signal")
exports["test hub"] = require("./hub")
exports["test queue"] = require("./queue")
exports["test buffer"] = require("./buffer")
exports["test zip"] = require("./zip")
+ exports["test delay"] = require("./delay")
+
if (module == require.main)
require("test").run(exports) | 2 | 0.1 | 2 | 0 |
b72f0ed25750a29b5dc1cdd2790102d8351606f9 | pronto_feedback/feedback/views.py | pronto_feedback/feedback/views.py | import csv
from datetime import datetime
from django.shortcuts import render
from django.utils import timezone
from django.views.generic import TemplateView
from .forms import FeedbackUploadForm
from .models import Feedback
class FeedbackView(TemplateView):
template_name = 'index.html'
def get(self, request):
feedback = Feedback.objects.all()
form = FeedbackUploadForm()
return render(
request,
self.template_name,
{
'form': form,
'feedback': feedback
}
)
def save_feedback(self, data):
creation_date = datetime.strptime(
data[2],
'%m/%d/%Y %H:%M'
).replace(tzinfo=timezone.utc)
Feedback.objects.create(
fid=data[0],
creation_date=creation_date,
question_asked=data[4],
message=data[5]
)
def post(self, request):
feedback = Feedback.objects.all()
form = FeedbackUploadForm(request.POST, request.FILES)
if form.is_valid():
reader = csv.reader(request.FILES['file_upload'])
next(reader, None)
map(self.save_feedback, reader)
return render(
request,
self.template_name,
{
'form': form,
'feedback': feedback
}
)
| import csv
from datetime import datetime
from django.shortcuts import render
from django.utils import timezone
from django.views.generic import TemplateView
from .forms import FeedbackUploadForm
from .models import Feedback
class FeedbackView(TemplateView):
template_name = 'index.html'
def get(self, request):
feedback = Feedback.objects.all()
form = FeedbackUploadForm()
return render(
request,
self.template_name,
{
'form': form,
'feedback': feedback
}
)
def save_feedback(self, data):
creation_date = datetime.strptime(
data[2],
'%m/%d/%Y %H:%M'
).replace(tzinfo=timezone.utc)
Feedback.objects.create(
fid=data[0],
creation_date=creation_date,
question_asked=data[4],
message=data[5]
)
def post(self, request):
feedback = Feedback.objects.all()
form = FeedbackUploadForm(request.POST, request.FILES)
if form.is_valid():
reader = csv.reader(request.FILES['file_upload'])
reader.next()
map(self.save_feedback, reader)
return render(
request,
self.template_name,
{
'form': form,
'feedback': feedback
}
)
| Use next method of reader object | Use next method of reader object
| Python | mit | zkan/pronto-feedback,zkan/pronto-feedback | python | ## Code Before:
import csv
from datetime import datetime
from django.shortcuts import render
from django.utils import timezone
from django.views.generic import TemplateView
from .forms import FeedbackUploadForm
from .models import Feedback
class FeedbackView(TemplateView):
template_name = 'index.html'
def get(self, request):
feedback = Feedback.objects.all()
form = FeedbackUploadForm()
return render(
request,
self.template_name,
{
'form': form,
'feedback': feedback
}
)
def save_feedback(self, data):
creation_date = datetime.strptime(
data[2],
'%m/%d/%Y %H:%M'
).replace(tzinfo=timezone.utc)
Feedback.objects.create(
fid=data[0],
creation_date=creation_date,
question_asked=data[4],
message=data[5]
)
def post(self, request):
feedback = Feedback.objects.all()
form = FeedbackUploadForm(request.POST, request.FILES)
if form.is_valid():
reader = csv.reader(request.FILES['file_upload'])
next(reader, None)
map(self.save_feedback, reader)
return render(
request,
self.template_name,
{
'form': form,
'feedback': feedback
}
)
## Instruction:
Use next method of reader object
## Code After:
import csv
from datetime import datetime
from django.shortcuts import render
from django.utils import timezone
from django.views.generic import TemplateView
from .forms import FeedbackUploadForm
from .models import Feedback
class FeedbackView(TemplateView):
template_name = 'index.html'
def get(self, request):
feedback = Feedback.objects.all()
form = FeedbackUploadForm()
return render(
request,
self.template_name,
{
'form': form,
'feedback': feedback
}
)
def save_feedback(self, data):
creation_date = datetime.strptime(
data[2],
'%m/%d/%Y %H:%M'
).replace(tzinfo=timezone.utc)
Feedback.objects.create(
fid=data[0],
creation_date=creation_date,
question_asked=data[4],
message=data[5]
)
def post(self, request):
feedback = Feedback.objects.all()
form = FeedbackUploadForm(request.POST, request.FILES)
if form.is_valid():
reader = csv.reader(request.FILES['file_upload'])
reader.next()
map(self.save_feedback, reader)
return render(
request,
self.template_name,
{
'form': form,
'feedback': feedback
}
)
| import csv
from datetime import datetime
from django.shortcuts import render
from django.utils import timezone
from django.views.generic import TemplateView
from .forms import FeedbackUploadForm
from .models import Feedback
class FeedbackView(TemplateView):
template_name = 'index.html'
def get(self, request):
feedback = Feedback.objects.all()
form = FeedbackUploadForm()
return render(
request,
self.template_name,
{
'form': form,
'feedback': feedback
}
)
def save_feedback(self, data):
creation_date = datetime.strptime(
data[2],
'%m/%d/%Y %H:%M'
).replace(tzinfo=timezone.utc)
Feedback.objects.create(
fid=data[0],
creation_date=creation_date,
question_asked=data[4],
message=data[5]
)
def post(self, request):
feedback = Feedback.objects.all()
form = FeedbackUploadForm(request.POST, request.FILES)
if form.is_valid():
reader = csv.reader(request.FILES['file_upload'])
- next(reader, None)
? ----- ^^^^
+ reader.next()
? ^ +++
map(self.save_feedback, reader)
return render(
request,
self.template_name,
{
'form': form,
'feedback': feedback
}
) | 2 | 0.033898 | 1 | 1 |
fa6cb3e7a896270bc2a32a1f4f45b545096c2c80 | components/inquiry_questionnaire/views/specialist.coffee | components/inquiry_questionnaire/views/specialist.coffee | Q = require 'bluebird-q'
_ = require 'underscore'
StepView = require './step.coffee'
Form = require '../../form/index.coffee'
Representatives = require '../../../collections/representatives.coffee'
template = -> require('../templates/specialist.jade') arguments...
module.exports = class Specialist extends StepView
className: 'iq-loadable is-loading'
template: (data) ->
template _.extend data,
message: @inquiry.get('message')
representative: @representative
__events__:
'click button': 'serialize'
initialize: ->
@representatives = new Representatives
super
setup: ->
@__representatives__ = @representatives.fetch()
.then => (@representative = @representatives.first())?.fetch()
.then =>
@render().$el.removeClass 'is-loading'
serialize: (e) ->
e.preventDefault()
form = new Form model: @inquiry, $form: @$('form')
return unless form.isReady()
form.state 'loading'
@__serialize__ = Q.all [
@inquiry.save _.extend { contact_gallery: false }, form.data()
@user.save @inquiry.pick('name', 'email')
]
.then =>
@next()
, (e) ->
form.error null, e
| Q = require 'bluebird-q'
_ = require 'underscore'
StepView = require './step.coffee'
Form = require '../../form/index.coffee'
Representatives = require '../../../collections/representatives.coffee'
template = -> require('../templates/specialist.jade') arguments...
module.exports = class Specialist extends StepView
className: 'iq-loadable is-loading'
template: (data) ->
template _.extend data,
message: @inquiry.get('message')
representative: @representative
__events__:
'click button': 'serialize'
initialize: ->
@representatives = new Representatives
super
setup: ->
@__representatives__ = Q @representatives.fetch()
.then => Q (@representative = @representatives.first())?.fetch()
.finally => @done()
serialize: (e) ->
e.preventDefault()
form = new Form model: @inquiry, $form: @$('form')
return unless form.isReady()
form.state 'loading'
@__serialize__ = Q.all [
@inquiry.save _.extend { contact_gallery: false }, form.data()
@user.save @inquiry.pick('name', 'email')
]
.then =>
@next()
, (e) ->
form.error null, e
done: ->
@render().$el.removeClass 'is-loading'
| Make representative fetch more resilient to API errors (probably only relevant for staging) | Make representative fetch more resilient to API errors (probably only relevant for staging)
| CoffeeScript | mit | mzikherman/force,artsy/force,cavvia/force-1,xtina-starr/force,kanaabe/force,oxaudo/force,xtina-starr/force,anandaroop/force,eessex/force,kanaabe/force,mzikherman/force,cavvia/force-1,xtina-starr/force,dblock/force,damassi/force,oxaudo/force,artsy/force,erikdstock/force,izakp/force,yuki24/force,joeyAghion/force,izakp/force,dblock/force,oxaudo/force,damassi/force,cavvia/force-1,eessex/force,kanaabe/force,damassi/force,cavvia/force-1,damassi/force,oxaudo/force,izakp/force,xtina-starr/force,yuki24/force,dblock/force,erikdstock/force,kanaabe/force,erikdstock/force,joeyAghion/force,mzikherman/force,erikdstock/force,eessex/force,artsy/force-public,mzikherman/force,kanaabe/force,joeyAghion/force,anandaroop/force,artsy/force-public,izakp/force,eessex/force,anandaroop/force,yuki24/force,artsy/force,artsy/force,yuki24/force,anandaroop/force,joeyAghion/force | coffeescript | ## Code Before:
Q = require 'bluebird-q'
_ = require 'underscore'
StepView = require './step.coffee'
Form = require '../../form/index.coffee'
Representatives = require '../../../collections/representatives.coffee'
template = -> require('../templates/specialist.jade') arguments...
module.exports = class Specialist extends StepView
className: 'iq-loadable is-loading'
template: (data) ->
template _.extend data,
message: @inquiry.get('message')
representative: @representative
__events__:
'click button': 'serialize'
initialize: ->
@representatives = new Representatives
super
setup: ->
@__representatives__ = @representatives.fetch()
.then => (@representative = @representatives.first())?.fetch()
.then =>
@render().$el.removeClass 'is-loading'
serialize: (e) ->
e.preventDefault()
form = new Form model: @inquiry, $form: @$('form')
return unless form.isReady()
form.state 'loading'
@__serialize__ = Q.all [
@inquiry.save _.extend { contact_gallery: false }, form.data()
@user.save @inquiry.pick('name', 'email')
]
.then =>
@next()
, (e) ->
form.error null, e
## Instruction:
Make representative fetch more resilient to API errors (probably only relevant for staging)
## Code After:
Q = require 'bluebird-q'
_ = require 'underscore'
StepView = require './step.coffee'
Form = require '../../form/index.coffee'
Representatives = require '../../../collections/representatives.coffee'
template = -> require('../templates/specialist.jade') arguments...
module.exports = class Specialist extends StepView
className: 'iq-loadable is-loading'
template: (data) ->
template _.extend data,
message: @inquiry.get('message')
representative: @representative
__events__:
'click button': 'serialize'
initialize: ->
@representatives = new Representatives
super
setup: ->
@__representatives__ = Q @representatives.fetch()
.then => Q (@representative = @representatives.first())?.fetch()
.finally => @done()
serialize: (e) ->
e.preventDefault()
form = new Form model: @inquiry, $form: @$('form')
return unless form.isReady()
form.state 'loading'
@__serialize__ = Q.all [
@inquiry.save _.extend { contact_gallery: false }, form.data()
@user.save @inquiry.pick('name', 'email')
]
.then =>
@next()
, (e) ->
form.error null, e
done: ->
@render().$el.removeClass 'is-loading'
| Q = require 'bluebird-q'
_ = require 'underscore'
StepView = require './step.coffee'
Form = require '../../form/index.coffee'
Representatives = require '../../../collections/representatives.coffee'
template = -> require('../templates/specialist.jade') arguments...
module.exports = class Specialist extends StepView
className: 'iq-loadable is-loading'
template: (data) ->
template _.extend data,
message: @inquiry.get('message')
representative: @representative
__events__:
'click button': 'serialize'
initialize: ->
@representatives = new Representatives
super
setup: ->
- @__representatives__ = @representatives.fetch()
+ @__representatives__ = Q @representatives.fetch()
? ++
- .then => (@representative = @representatives.first())?.fetch()
+ .then => Q (@representative = @representatives.first())?.fetch()
? ++
- .then =>
- @render().$el.removeClass 'is-loading'
+ .finally => @done()
+
serialize: (e) ->
e.preventDefault()
form = new Form model: @inquiry, $form: @$('form')
return unless form.isReady()
form.state 'loading'
@__serialize__ = Q.all [
@inquiry.save _.extend { contact_gallery: false }, form.data()
@user.save @inquiry.pick('name', 'email')
]
.then =>
@next()
, (e) ->
form.error null, e
+
+ done: ->
+ @render().$el.removeClass 'is-loading' | 11 | 0.25 | 7 | 4 |
9d21fed99383e87056bba1d53306a9b5258ddf0e | .travis.yml | .travis.yml | language: python
before_script:
- sudo apt-get update -qq
- sudo apt-get install -qq bc tcsh libgmp10 libgmp-dev
script:
# Run the python tests.
- ./util/test_python.bash
# Test that the docs actually build.
- cd docs/ && make html
| language: python
script:
# Run the python tests.
- ./util/test_python.bash
# Test that the docs actually build.
- cd docs/ && make html
addons:
apt:
packages:
- bc
- tcsh
- libgmp10
- libgmp-dev
sudo: false
| Update Travis file for pyChapel to use new testing system. | Update Travis file for pyChapel to use new testing system.
Based on a similar change to the Chapel master.
| YAML | apache-2.0 | chapel-lang/pychapel,russel/pychapel,russel/pychapel,chapel-lang/pychapel,russel/pychapel,chapel-lang/pychapel | yaml | ## Code Before:
language: python
before_script:
- sudo apt-get update -qq
- sudo apt-get install -qq bc tcsh libgmp10 libgmp-dev
script:
# Run the python tests.
- ./util/test_python.bash
# Test that the docs actually build.
- cd docs/ && make html
## Instruction:
Update Travis file for pyChapel to use new testing system.
Based on a similar change to the Chapel master.
## Code After:
language: python
script:
# Run the python tests.
- ./util/test_python.bash
# Test that the docs actually build.
- cd docs/ && make html
addons:
apt:
packages:
- bc
- tcsh
- libgmp10
- libgmp-dev
sudo: false
| language: python
+
- before_script:
- - sudo apt-get update -qq
- - sudo apt-get install -qq bc tcsh libgmp10 libgmp-dev
script:
# Run the python tests.
- ./util/test_python.bash
# Test that the docs actually build.
- cd docs/ && make html
+
+ addons:
+ apt:
+ packages:
+ - bc
+ - tcsh
+ - libgmp10
+ - libgmp-dev
+ sudo: false | 13 | 1.444444 | 10 | 3 |
fcbea9422d55d79409bfcae4b93d275a7361f1d9 | syntax/paketdeps.vim | syntax/paketdeps.vim | if exists("b:current_syntax")
finish
endif
syntax case match
syntax match paketDepsKeyword /^redirects/
syntax match paketDepsKeyword /^source/
syntax match paketDepsKeyword /^nuget/
syntax match paketDepsKeyword /^github/
syntax match paketDepsSymbol />=/
syntax match paketDepsSymbol /:\_s/
syntax match paketDepsVersion /\d\.\d/
syntax match paketDepsOption /\<on\>/
" Source: https://gist.github.com/tobym/584909
syntax match paketDepsUrl /https\?:\/\/\(\w\+\(:\w\+\)\?@\)\?\([A-Za-z][-_0-9A-Za-z]*\.\)\{1,}\(\w\{2,}\.\?\)\{1,}\(:[0-9]\{1,5}\)\?\S*/
highlight link paketDepsKeyword Keyword
highlight link paketDepsSymbol Operator
highlight link paketDepsVersion Float
highlight link paketDepsOption Boolean
highlight link paketDepsUrl String
let b:current_syntax = "paketdeps"
| if exists("b:current_syntax")
finish
endif
syntax case match
syntax match paketDepsKeyword /^redirects/
syntax match paketDepsKeyword /^source/
syntax match paketDepsKeyword /^nuget/
syntax match paketDepsKeyword /^http/
syntax match paketDepsKeyword /^github/
syntax match paketDepsSymbol />=/
syntax match paketDepsSymbol /:\_s/
syntax match paketDepsVersion /\d\(\.\d\)\+/
syntax match paketDepsOption /\<on\>/
" Source: https://gist.github.com/tobym/584909
syntax match paketDepsUrl /https\?:\/\/\(\w\+\(:\w\+\)\?@\)\?\([A-Za-z][-_0-9A-Za-z]*\.\?\)\{1,}\(\w\{2,}\.\?\)\{1,}\(:[0-9]\{1,5}\)\?\S*/
highlight link paketDepsKeyword Keyword
highlight link paketDepsSymbol Operator
highlight link paketDepsVersion Float
highlight link paketDepsOption Boolean
highlight link paketDepsUrl String
let b:current_syntax = "paketdeps"
| Improve Paket dependencies syntax highlighting | Improve Paket dependencies syntax highlighting
| VimL | unlicense | Kazark/vim-kazarc | viml | ## Code Before:
if exists("b:current_syntax")
finish
endif
syntax case match
syntax match paketDepsKeyword /^redirects/
syntax match paketDepsKeyword /^source/
syntax match paketDepsKeyword /^nuget/
syntax match paketDepsKeyword /^github/
syntax match paketDepsSymbol />=/
syntax match paketDepsSymbol /:\_s/
syntax match paketDepsVersion /\d\.\d/
syntax match paketDepsOption /\<on\>/
" Source: https://gist.github.com/tobym/584909
syntax match paketDepsUrl /https\?:\/\/\(\w\+\(:\w\+\)\?@\)\?\([A-Za-z][-_0-9A-Za-z]*\.\)\{1,}\(\w\{2,}\.\?\)\{1,}\(:[0-9]\{1,5}\)\?\S*/
highlight link paketDepsKeyword Keyword
highlight link paketDepsSymbol Operator
highlight link paketDepsVersion Float
highlight link paketDepsOption Boolean
highlight link paketDepsUrl String
let b:current_syntax = "paketdeps"
## Instruction:
Improve Paket dependencies syntax highlighting
## Code After:
if exists("b:current_syntax")
finish
endif
syntax case match
syntax match paketDepsKeyword /^redirects/
syntax match paketDepsKeyword /^source/
syntax match paketDepsKeyword /^nuget/
syntax match paketDepsKeyword /^http/
syntax match paketDepsKeyword /^github/
syntax match paketDepsSymbol />=/
syntax match paketDepsSymbol /:\_s/
syntax match paketDepsVersion /\d\(\.\d\)\+/
syntax match paketDepsOption /\<on\>/
" Source: https://gist.github.com/tobym/584909
syntax match paketDepsUrl /https\?:\/\/\(\w\+\(:\w\+\)\?@\)\?\([A-Za-z][-_0-9A-Za-z]*\.\?\)\{1,}\(\w\{2,}\.\?\)\{1,}\(:[0-9]\{1,5}\)\?\S*/
highlight link paketDepsKeyword Keyword
highlight link paketDepsSymbol Operator
highlight link paketDepsVersion Float
highlight link paketDepsOption Boolean
highlight link paketDepsUrl String
let b:current_syntax = "paketdeps"
| if exists("b:current_syntax")
finish
endif
syntax case match
syntax match paketDepsKeyword /^redirects/
syntax match paketDepsKeyword /^source/
syntax match paketDepsKeyword /^nuget/
+ syntax match paketDepsKeyword /^http/
syntax match paketDepsKeyword /^github/
syntax match paketDepsSymbol />=/
syntax match paketDepsSymbol /:\_s/
- syntax match paketDepsVersion /\d\.\d/
+ syntax match paketDepsVersion /\d\(\.\d\)\+/
? ++ ++++
syntax match paketDepsOption /\<on\>/
" Source: https://gist.github.com/tobym/584909
- syntax match paketDepsUrl /https\?:\/\/\(\w\+\(:\w\+\)\?@\)\?\([A-Za-z][-_0-9A-Za-z]*\.\)\{1,}\(\w\{2,}\.\?\)\{1,}\(:[0-9]\{1,5}\)\?\S*/
+ syntax match paketDepsUrl /https\?:\/\/\(\w\+\(:\w\+\)\?@\)\?\([A-Za-z][-_0-9A-Za-z]*\.\?\)\{1,}\(\w\{2,}\.\?\)\{1,}\(:[0-9]\{1,5}\)\?\S*/
? ++
highlight link paketDepsKeyword Keyword
highlight link paketDepsSymbol Operator
highlight link paketDepsVersion Float
highlight link paketDepsOption Boolean
highlight link paketDepsUrl String
let b:current_syntax = "paketdeps" | 5 | 0.178571 | 3 | 2 |
eecaf5db54f29ab62d996bedd2cf9557f8907127 | ruby/001.rb | ruby/001.rb |
class FactorSum
attr_accessor :factors
@factors = []
@highest = 0
@sum = nil
class << self
def imperative
new(factors, highest, 'imperative')
end
def functional
new(factors, highest, 'functional')
end
def algebraic
new(factors, highest, 'algebraic')
end
end
def initizialize (factors = 3, highest = 1000, algorithm = 'imperative')
if factors.nil?
raise Error
elsif factors.respond_to?(:each)
factors.each do |factor|
@factors << factor
end
else
@factors << factors
end
if highest.nil?
raise Error
elsif higest.respond_to?(:each)
raise Error
else
@highest = highest
end
case algorithm
when 'imperative' then @sum = imperative_sum
when 'functional' then @sum = functional_sum
when 'algebraic' then @sum = algebraic_sum
else @sum = algebraic_sum
end
end
def imperative_sum
total = 0
end
def functional_sum
end
def algebraic_sum
end
private :new, :imperative_sum, :functional_sum, :algebraic_sum
end
|
class FactorSum
attr_accessor :factors
@factors = []
@highest = 0
@sum = nil
class << self
def imperative
new(factors, highest, 'imperative')
end
def functional
new(factors, highest, 'functional')
end
def algebraic
new(factors, highest, 'algebraic')
end
end
def initizialize (factors = 3, highest = 1000, algorithm = 'imperative')
if factors.nil?
raise Error
elsif factors.respond_to?(:each)
factors.each do |factor|
@factors << factor
end
else
@factors << factors
end
if highest.nil?
raise Error
elsif higest.respond_to?(:each)
raise Error
else
@highest = highest
end
case algorithm
when 'imperative' then @sum = imperative_sum
when 'functional' then @sum = functional_sum
when 'algebraic' then @sum = algebraic_sum
else @sum = algebraic_sum
end
end
def imperative_sum
total = 0
end
def functional_sum
require 'set'
three_set = Set.new (0..limit).step(3)
five_set = Set.new (0..limit).step(5)
three_set.merge(five_set).sum
end
def algebraic_sum
end
private :new, :imperative_sum, :functional_sum, :algebraic_sum
end
| Implement functional_sum for special case of 3 and 5 | Implement functional_sum for special case of 3 and 5
| Ruby | bsd-3-clause | gidj/euler,gidj/euler | ruby | ## Code Before:
class FactorSum
attr_accessor :factors
@factors = []
@highest = 0
@sum = nil
class << self
def imperative
new(factors, highest, 'imperative')
end
def functional
new(factors, highest, 'functional')
end
def algebraic
new(factors, highest, 'algebraic')
end
end
def initizialize (factors = 3, highest = 1000, algorithm = 'imperative')
if factors.nil?
raise Error
elsif factors.respond_to?(:each)
factors.each do |factor|
@factors << factor
end
else
@factors << factors
end
if highest.nil?
raise Error
elsif higest.respond_to?(:each)
raise Error
else
@highest = highest
end
case algorithm
when 'imperative' then @sum = imperative_sum
when 'functional' then @sum = functional_sum
when 'algebraic' then @sum = algebraic_sum
else @sum = algebraic_sum
end
end
def imperative_sum
total = 0
end
def functional_sum
end
def algebraic_sum
end
private :new, :imperative_sum, :functional_sum, :algebraic_sum
end
## Instruction:
Implement functional_sum for special case of 3 and 5
## Code After:
class FactorSum
attr_accessor :factors
@factors = []
@highest = 0
@sum = nil
class << self
def imperative
new(factors, highest, 'imperative')
end
def functional
new(factors, highest, 'functional')
end
def algebraic
new(factors, highest, 'algebraic')
end
end
def initizialize (factors = 3, highest = 1000, algorithm = 'imperative')
if factors.nil?
raise Error
elsif factors.respond_to?(:each)
factors.each do |factor|
@factors << factor
end
else
@factors << factors
end
if highest.nil?
raise Error
elsif higest.respond_to?(:each)
raise Error
else
@highest = highest
end
case algorithm
when 'imperative' then @sum = imperative_sum
when 'functional' then @sum = functional_sum
when 'algebraic' then @sum = algebraic_sum
else @sum = algebraic_sum
end
end
def imperative_sum
total = 0
end
def functional_sum
require 'set'
three_set = Set.new (0..limit).step(3)
five_set = Set.new (0..limit).step(5)
three_set.merge(five_set).sum
end
def algebraic_sum
end
private :new, :imperative_sum, :functional_sum, :algebraic_sum
end
|
class FactorSum
attr_accessor :factors
@factors = []
@highest = 0
@sum = nil
class << self
def imperative
new(factors, highest, 'imperative')
end
def functional
new(factors, highest, 'functional')
end
def algebraic
new(factors, highest, 'algebraic')
end
end
def initizialize (factors = 3, highest = 1000, algorithm = 'imperative')
if factors.nil?
raise Error
elsif factors.respond_to?(:each)
factors.each do |factor|
@factors << factor
end
else
@factors << factors
end
if highest.nil?
raise Error
elsif higest.respond_to?(:each)
raise Error
else
@highest = highest
end
case algorithm
when 'imperative' then @sum = imperative_sum
when 'functional' then @sum = functional_sum
when 'algebraic' then @sum = algebraic_sum
else @sum = algebraic_sum
end
end
def imperative_sum
total = 0
end
def functional_sum
+ require 'set'
+ three_set = Set.new (0..limit).step(3)
+ five_set = Set.new (0..limit).step(5)
+
+ three_set.merge(five_set).sum
end
def algebraic_sum
end
private :new, :imperative_sum, :functional_sum, :algebraic_sum
end | 5 | 0.083333 | 5 | 0 |
461457b0c33d4e2ea9c55b281d21c3e7ccf1fc95 | app/helpers/sessions_helper.rb | app/helpers/sessions_helper.rb | module SessionsHelper
def sign_in(user)
remember_token = User.new_remember_token
cookies.permanent[:remember_token] = remember_token
user.update_attribute(:remember_token, User.encrypt(remember_token))
self.current_user = user
end
def sign_out
current_user.update_attribute(:remember_token, User.encrypt(User.new_remember_token))
cookies.delete(:remember_token)
self.current_user = nil
end
def signed_in?
!current_user.nil?
end
def current_user=(user)
@current_user = user
end
def current_user
remember_token = User.encrypt(cookies[:remember_token])
@current_user ||= User.find_by_remember_token(remember_token)
end
def current_user?(user)
user == current_user
end
end | module SessionsHelper
def sign_in(user)
remember_token = User.new_remember_token
cookies.permanent[:remember_token] = remember_token
user.update_attribute(:remember_token, User.encrypt(remember_token))
self.current_user = user
end
def sign_out
session[:sc_id] = nil
current_user.update_attribute(:remember_token, User.encrypt(User.new_remember_token))
cookies.delete(:remember_token)
self.current_user = nil
end
def signed_in?
!current_user.nil?
end
def current_user=(user)
@current_user = user
end
def current_user
remember_token = User.encrypt(cookies[:remember_token])
@current_user ||= User.find_by_remember_token(remember_token)
end
def current_user?(user)
user == current_user
end
end | Update logout to clear soundcloud id from session | Update logout to clear soundcloud id from session
| Ruby | mit | sea-lions-2014/music-teacher,sea-lions-2014/music-teacher | ruby | ## Code Before:
module SessionsHelper
def sign_in(user)
remember_token = User.new_remember_token
cookies.permanent[:remember_token] = remember_token
user.update_attribute(:remember_token, User.encrypt(remember_token))
self.current_user = user
end
def sign_out
current_user.update_attribute(:remember_token, User.encrypt(User.new_remember_token))
cookies.delete(:remember_token)
self.current_user = nil
end
def signed_in?
!current_user.nil?
end
def current_user=(user)
@current_user = user
end
def current_user
remember_token = User.encrypt(cookies[:remember_token])
@current_user ||= User.find_by_remember_token(remember_token)
end
def current_user?(user)
user == current_user
end
end
## Instruction:
Update logout to clear soundcloud id from session
## Code After:
module SessionsHelper
def sign_in(user)
remember_token = User.new_remember_token
cookies.permanent[:remember_token] = remember_token
user.update_attribute(:remember_token, User.encrypt(remember_token))
self.current_user = user
end
def sign_out
session[:sc_id] = nil
current_user.update_attribute(:remember_token, User.encrypt(User.new_remember_token))
cookies.delete(:remember_token)
self.current_user = nil
end
def signed_in?
!current_user.nil?
end
def current_user=(user)
@current_user = user
end
def current_user
remember_token = User.encrypt(cookies[:remember_token])
@current_user ||= User.find_by_remember_token(remember_token)
end
def current_user?(user)
user == current_user
end
end | module SessionsHelper
def sign_in(user)
remember_token = User.new_remember_token
cookies.permanent[:remember_token] = remember_token
user.update_attribute(:remember_token, User.encrypt(remember_token))
self.current_user = user
end
def sign_out
+ session[:sc_id] = nil
current_user.update_attribute(:remember_token, User.encrypt(User.new_remember_token))
cookies.delete(:remember_token)
self.current_user = nil
end
def signed_in?
!current_user.nil?
end
def current_user=(user)
@current_user = user
end
def current_user
remember_token = User.encrypt(cookies[:remember_token])
@current_user ||= User.find_by_remember_token(remember_token)
end
def current_user?(user)
user == current_user
end
end | 1 | 0.03125 | 1 | 0 |
3ac68ab8a26a163fe5c387666af345c7c5240ac1 | app/views/results/student/_remark_request_form.html.erb | app/views/results/student/_remark_request_form.html.erb | <div id='remark_request_edit'>
<%= form_for submission,
url: { controller: 'results',
action: 'update_remark_request',
id: submission.id,
assignment_id: assignment.id },
html: { method: :get },
remote: true do |f| %>
<%= f.text_area :remark_request, cols: 50, rows: 5,
id: 'remark_request_text_area',
onkeydown: 'enableRemarkRequestButtons();' %>
<div>
<%= hidden_field_tag 'real_commit', 'Submit' %>
<%= f.submit t(:save_changes),
onclick: "jQuery('#real_commit').val('Save');",
disabled: true,
id: 'remark_request_save',
data: { disable_with: t('working') } %>
<%= f.submit t(:submit_request),
data: { disable_with: t('working') },
id: 'remark_request_submit',
confirm: t(:confirm_remark_submit) %>
</div>
<% end %>
</div>
| <div id='remark_request_edit'>
<%= form_for submission,
url: { controller: 'results',
action: 'update_remark_request',
id: submission.id,
assignment_id: assignment.id },
html: { method: :get },
remote: true do |f| %>
<%= f.text_area :remark_request, cols: 50, rows: 5,
id: 'remark_request_text_area',
onkeydown: 'enableRemarkRequestButtons();' %>
<div>
<%= hidden_field_tag 'real_commit', 'Submit' %>
<%=# f.submit t(:save_changes),
# onclick: "jQuery('#real_commit').val('Save');",
# disabled: true,
# id: 'remark_request_save',
# data: { disable_with: t('working') }
%>
<%= f.submit t(:submit_request),
data: { disable_with: t('working') },
id: 'remark_request_submit',
confirm: t(:confirm_remark_submit) %>
</div>
<% end %>
</div>
| Remove save button from remark request | Remove save button from remark request
| HTML+ERB | mit | MarkUsProject/Markus,Lysette/Markus,david-yz-liu/Markus,binuri/Markus,jeremygoh/Markus,ealonas/Markus,WilsonChiang/Markus,jeremygoh/Markus,melneubert/Markus,ealonas/Markus,david-yz-liu/Markus,wkwan/Markus,ealonas/Markus,benjaminvialle/Markus,Lysette/Markus,binuri/Markus,Lysette/Markus,binuri/Markus,wkwan/Markus,benjaminvialle/Markus,reidka/Markus,binuri/Markus,arkon/Markus,SoftwareDev/Markus,melneubert/Markus,SoftwareDev/Markus,Lysette/Markus,wkwan/Markus,WilsonChiang/Markus,ealonas/Markus,reidka/Markus,MarkUsProject/Markus,benjaminvialle/Markus,jeremygoh/Markus,benjaminvialle/Markus,wkwan/Markus,benjaminvialle/Markus,arkon/Markus,arkon/Markus,wkwan/Markus,WilsonChiang/Markus,Lysette/Markus,finnergizer/Markus,binuri/Markus,arkon/Markus,jeremygoh/Markus,david-yz-liu/Markus,WilsonChiang/Markus,melneubert/Markus,WilsonChiang/Markus,reidka/Markus,MarkUsProject/Markus,wkwan/Markus,melneubert/Markus,MarkUsProject/Markus,binuri/Markus,finnergizer/Markus,reidka/Markus,jeremygoh/Markus,reidka/Markus,MarkUsProject/Markus,benjaminvialle/Markus,WilsonChiang/Markus,jeremygoh/Markus,wkwan/Markus,melneubert/Markus,binuri/Markus,david-yz-liu/Markus,WilsonChiang/Markus,ealonas/Markus,WilsonChiang/Markus,wkwan/Markus,SoftwareDev/Markus,arkon/Markus,SoftwareDev/Markus,ealonas/Markus,ealonas/Markus,SoftwareDev/Markus,finnergizer/Markus,melneubert/Markus,david-yz-liu/Markus,Lysette/Markus,david-yz-liu/Markus,binuri/Markus,david-yz-liu/Markus,finnergizer/Markus,Lysette/Markus,melneubert/Markus,finnergizer/Markus,melneubert/Markus,finnergizer/Markus,MarkUsProject/Markus,MarkUsProject/Markus,binuri/Markus,WilsonChiang/Markus,jeremygoh/Markus,finnergizer/Markus,arkon/Markus,david-yz-liu/Markus,SoftwareDev/Markus,MarkUsProject/Markus,wkwan/Markus,reidka/Markus,finnergizer/Markus,ealonas/Markus,arkon/Markus,david-yz-liu/Markus,melneubert/Markus,SoftwareDev/Markus,reidka/Markus,benjaminvialle/Markus,ealonas/Markus,reidka/Markus,finnergizer/Markus,jeremygoh/Markus,arkon/Markus,reidka/Markus,arkon/Markus,jeremygoh/Markus | html+erb | ## Code Before:
<div id='remark_request_edit'>
<%= form_for submission,
url: { controller: 'results',
action: 'update_remark_request',
id: submission.id,
assignment_id: assignment.id },
html: { method: :get },
remote: true do |f| %>
<%= f.text_area :remark_request, cols: 50, rows: 5,
id: 'remark_request_text_area',
onkeydown: 'enableRemarkRequestButtons();' %>
<div>
<%= hidden_field_tag 'real_commit', 'Submit' %>
<%= f.submit t(:save_changes),
onclick: "jQuery('#real_commit').val('Save');",
disabled: true,
id: 'remark_request_save',
data: { disable_with: t('working') } %>
<%= f.submit t(:submit_request),
data: { disable_with: t('working') },
id: 'remark_request_submit',
confirm: t(:confirm_remark_submit) %>
</div>
<% end %>
</div>
## Instruction:
Remove save button from remark request
## Code After:
<div id='remark_request_edit'>
<%= form_for submission,
url: { controller: 'results',
action: 'update_remark_request',
id: submission.id,
assignment_id: assignment.id },
html: { method: :get },
remote: true do |f| %>
<%= f.text_area :remark_request, cols: 50, rows: 5,
id: 'remark_request_text_area',
onkeydown: 'enableRemarkRequestButtons();' %>
<div>
<%= hidden_field_tag 'real_commit', 'Submit' %>
<%=# f.submit t(:save_changes),
# onclick: "jQuery('#real_commit').val('Save');",
# disabled: true,
# id: 'remark_request_save',
# data: { disable_with: t('working') }
%>
<%= f.submit t(:submit_request),
data: { disable_with: t('working') },
id: 'remark_request_submit',
confirm: t(:confirm_remark_submit) %>
</div>
<% end %>
</div>
| <div id='remark_request_edit'>
<%= form_for submission,
url: { controller: 'results',
action: 'update_remark_request',
id: submission.id,
assignment_id: assignment.id },
html: { method: :get },
remote: true do |f| %>
<%= f.text_area :remark_request, cols: 50, rows: 5,
id: 'remark_request_text_area',
onkeydown: 'enableRemarkRequestButtons();' %>
<div>
<%= hidden_field_tag 'real_commit', 'Submit' %>
- <%= f.submit t(:save_changes),
+ <%=# f.submit t(:save_changes),
? +
- onclick: "jQuery('#real_commit').val('Save');",
+ # onclick: "jQuery('#real_commit').val('Save');",
? +
- disabled: true,
+ # disabled: true,
? +
- id: 'remark_request_save',
+ # id: 'remark_request_save',
? +
- data: { disable_with: t('working') } %>
? --
+ # data: { disable_with: t('working') }
? +
+ %>
<%= f.submit t(:submit_request),
data: { disable_with: t('working') },
id: 'remark_request_submit',
confirm: t(:confirm_remark_submit) %>
</div>
<% end %>
</div> | 11 | 0.423077 | 6 | 5 |
9246a44a065a046293492edeccafc376a9aa628f | src/utils.js | src/utils.js | import fs from "fs";
import InputStream from "./InputStream";
export function isGreyspace(string) {
if (string === "" ||
string === " " ||
string === "\n" ||
/^\s*$/.test(string)) {
return true;
}
if (string === undefined || string === null)
throw new Error("passed undefined or null to isGreyspace");
let stream = new InputStream(string);
// Consume shebang
stream.consume(/#!.*\n/);
while (!stream.atEnd()) {
let consumed = stream.consume(/\s+/) ||
stream.consume(/\/\/[^\n]*/) ||
stream.consume(/\/\*[\W\S]*?\*\//);
if (!consumed) return false;
}
return stream.atEnd();
}
export function log(...messages) {
let data = messages.join(" ") + "\n";
try {
fs.writeSync(3, data);
} catch (error) {
if (error.code === "EBADF") {
return;
} else {
throw error;
}
}
}
| import fs from "fs";
import InputStream from "./InputStream";
const whitespaceRe = /\s+/;
const shebangRe = /#!.*\n/;
const lineCommentRe = /\/\/[^\n]*/;
const blockCommentRe = /\/\*[\W\S]*?\*\//;
export function isGreyspace(string) {
if (string === "" ||
string === " " ||
string === "\n" ||
/^\s*$/.test(string)) {
return true;
}
if (string === undefined || string === null)
throw new Error("passed undefined or null to isGreyspace");
let stream = new InputStream(string);
// Consume shebang
stream.consume(shebangRe);
while (!stream.atEnd()) {
let consumed = stream.consume(whitespaceRe) ||
stream.consume(lineCommentRe) ||
stream.consume(blockCommentRe);
if (!consumed) return false;
}
return stream.atEnd();
}
export function parseGreyspace(string) {
if (string === undefined || string === null)
throw new Error("passed undefined or null to isGreyspace");
let parsedNodes = [];
let stream = new InputStream(string);
while (!stream.atEnd()) {
if (stream.consume(whitespaceRe)) {
parsedNodes.push({ type: "whitespace", value: stream.consumed });
} else if (stream.consume(lineCommentRe)) {
parsedNodes.push({ type: "lineComment", value: stream.consumed });
} else if (stream.consume(blockCommentRe)) {
parsedNodes.push({ type: "blockComment", value: stream.consumed });
} else if (stream.consume(shebangRe)) {
parsedNodes.push({ type: "shebang", value: stream.consumed });
} else {
// Takes care of assertion that string is greyspace
throw new Error("string is not greyspace");
}
}
return parsedNodes;
}
export function log(...messages) {
let data = messages.join(" ") + "\n";
try {
fs.writeSync(3, data);
} catch (error) {
if (error.code === "EBADF") {
return;
} else {
throw error;
}
}
}
| Create greyspace parser function to allow for splitting greyspace by type. | Create greyspace parser function to allow for splitting greyspace
by type.
| JavaScript | mit | Mark-Simulacrum/pretty-generator,Mark-Simulacrum/attractifier | javascript | ## Code Before:
import fs from "fs";
import InputStream from "./InputStream";
export function isGreyspace(string) {
if (string === "" ||
string === " " ||
string === "\n" ||
/^\s*$/.test(string)) {
return true;
}
if (string === undefined || string === null)
throw new Error("passed undefined or null to isGreyspace");
let stream = new InputStream(string);
// Consume shebang
stream.consume(/#!.*\n/);
while (!stream.atEnd()) {
let consumed = stream.consume(/\s+/) ||
stream.consume(/\/\/[^\n]*/) ||
stream.consume(/\/\*[\W\S]*?\*\//);
if (!consumed) return false;
}
return stream.atEnd();
}
export function log(...messages) {
let data = messages.join(" ") + "\n";
try {
fs.writeSync(3, data);
} catch (error) {
if (error.code === "EBADF") {
return;
} else {
throw error;
}
}
}
## Instruction:
Create greyspace parser function to allow for splitting greyspace
by type.
## Code After:
import fs from "fs";
import InputStream from "./InputStream";
const whitespaceRe = /\s+/;
const shebangRe = /#!.*\n/;
const lineCommentRe = /\/\/[^\n]*/;
const blockCommentRe = /\/\*[\W\S]*?\*\//;
export function isGreyspace(string) {
if (string === "" ||
string === " " ||
string === "\n" ||
/^\s*$/.test(string)) {
return true;
}
if (string === undefined || string === null)
throw new Error("passed undefined or null to isGreyspace");
let stream = new InputStream(string);
// Consume shebang
stream.consume(shebangRe);
while (!stream.atEnd()) {
let consumed = stream.consume(whitespaceRe) ||
stream.consume(lineCommentRe) ||
stream.consume(blockCommentRe);
if (!consumed) return false;
}
return stream.atEnd();
}
export function parseGreyspace(string) {
if (string === undefined || string === null)
throw new Error("passed undefined or null to isGreyspace");
let parsedNodes = [];
let stream = new InputStream(string);
while (!stream.atEnd()) {
if (stream.consume(whitespaceRe)) {
parsedNodes.push({ type: "whitespace", value: stream.consumed });
} else if (stream.consume(lineCommentRe)) {
parsedNodes.push({ type: "lineComment", value: stream.consumed });
} else if (stream.consume(blockCommentRe)) {
parsedNodes.push({ type: "blockComment", value: stream.consumed });
} else if (stream.consume(shebangRe)) {
parsedNodes.push({ type: "shebang", value: stream.consumed });
} else {
// Takes care of assertion that string is greyspace
throw new Error("string is not greyspace");
}
}
return parsedNodes;
}
export function log(...messages) {
let data = messages.join(" ") + "\n";
try {
fs.writeSync(3, data);
} catch (error) {
if (error.code === "EBADF") {
return;
} else {
throw error;
}
}
}
| import fs from "fs";
import InputStream from "./InputStream";
+
+ const whitespaceRe = /\s+/;
+ const shebangRe = /#!.*\n/;
+ const lineCommentRe = /\/\/[^\n]*/;
+ const blockCommentRe = /\/\*[\W\S]*?\*\//;
export function isGreyspace(string) {
if (string === "" ||
string === " " ||
string === "\n" ||
/^\s*$/.test(string)) {
return true;
}
if (string === undefined || string === null)
throw new Error("passed undefined or null to isGreyspace");
let stream = new InputStream(string);
// Consume shebang
- stream.consume(/#!.*\n/);
+ stream.consume(shebangRe);
while (!stream.atEnd()) {
- let consumed = stream.consume(/\s+/) ||
? ^^ ^^
+ let consumed = stream.consume(whitespaceRe) ||
? ^^^^^ ^^^^^^
- stream.consume(/\/\/[^\n]*/) ||
- stream.consume(/\/\*[\W\S]*?\*\//);
+ stream.consume(lineCommentRe) ||
+ stream.consume(blockCommentRe);
if (!consumed) return false;
}
return stream.atEnd();
+ }
+
+ export function parseGreyspace(string) {
+ if (string === undefined || string === null)
+ throw new Error("passed undefined or null to isGreyspace");
+
+ let parsedNodes = [];
+
+ let stream = new InputStream(string);
+
+ while (!stream.atEnd()) {
+ if (stream.consume(whitespaceRe)) {
+ parsedNodes.push({ type: "whitespace", value: stream.consumed });
+ } else if (stream.consume(lineCommentRe)) {
+ parsedNodes.push({ type: "lineComment", value: stream.consumed });
+ } else if (stream.consume(blockCommentRe)) {
+ parsedNodes.push({ type: "blockComment", value: stream.consumed });
+ } else if (stream.consume(shebangRe)) {
+ parsedNodes.push({ type: "shebang", value: stream.consumed });
+ } else {
+ // Takes care of assertion that string is greyspace
+ throw new Error("string is not greyspace");
+ }
+ }
+
+ return parsedNodes;
}
export function log(...messages) {
let data = messages.join(" ") + "\n";
try {
fs.writeSync(3, data);
} catch (error) {
if (error.code === "EBADF") {
return;
} else {
throw error;
}
}
} | 39 | 0.95122 | 35 | 4 |
b9f68712843ea3e4c029fd0fe915fab75aad2d84 | protocol/src/types/uuid.rs | protocol/src/types/uuid.rs | use {Parcel, Error, Settings};
use std::io::prelude::*;
use uuid::Uuid;
impl Parcel for Uuid
{
fn read(read: &mut Read,
settings: &Settings,
_: &mut hint::Hints)
-> Result<Self, Error> {
let bytes: Result<Vec<u8>, _> = read.bytes().take(16).collect();
let bytes = bytes?;
Ok(Uuid::from_bytes(&bytes)?)
}
fn write(&self, write: &mut Write) -> Result<(), Error> {
write.write(self.as_bytes())?;
Ok(())
}
}
| use {Parcel, Error, Settings};
use hint;
use std::io::prelude::*;
use uuid::Uuid;
impl Parcel for Uuid
{
const TYPE_NAME: &'static str = "Uuid";
fn read(read: &mut Read,
_: &Settings,
_: &mut hint::Hints)
-> Result<Self, Error> {
let bytes: Result<Vec<u8>, _> = read.bytes().take(16).collect();
let bytes = bytes?;
Ok(Uuid::from_bytes(&bytes)?)
}
fn write(&self, write: &mut Write,
_: &Settings) -> Result<(), Error> {
write.write(self.as_bytes())?;
Ok(())
}
}
| Fix the UUID Parcel implementation | Fix the UUID Parcel implementation
| Rust | mit | dylanmckay/protocol,dylanmckay/protocol | rust | ## Code Before:
use {Parcel, Error, Settings};
use std::io::prelude::*;
use uuid::Uuid;
impl Parcel for Uuid
{
fn read(read: &mut Read,
settings: &Settings,
_: &mut hint::Hints)
-> Result<Self, Error> {
let bytes: Result<Vec<u8>, _> = read.bytes().take(16).collect();
let bytes = bytes?;
Ok(Uuid::from_bytes(&bytes)?)
}
fn write(&self, write: &mut Write) -> Result<(), Error> {
write.write(self.as_bytes())?;
Ok(())
}
}
## Instruction:
Fix the UUID Parcel implementation
## Code After:
use {Parcel, Error, Settings};
use hint;
use std::io::prelude::*;
use uuid::Uuid;
impl Parcel for Uuid
{
const TYPE_NAME: &'static str = "Uuid";
fn read(read: &mut Read,
_: &Settings,
_: &mut hint::Hints)
-> Result<Self, Error> {
let bytes: Result<Vec<u8>, _> = read.bytes().take(16).collect();
let bytes = bytes?;
Ok(Uuid::from_bytes(&bytes)?)
}
fn write(&self, write: &mut Write,
_: &Settings) -> Result<(), Error> {
write.write(self.as_bytes())?;
Ok(())
}
}
| use {Parcel, Error, Settings};
+ use hint;
use std::io::prelude::*;
use uuid::Uuid;
impl Parcel for Uuid
{
+ const TYPE_NAME: &'static str = "Uuid";
+
fn read(read: &mut Read,
- settings: &Settings,
? ^^^^^^^^
+ _: &Settings,
? ^
_: &mut hint::Hints)
-> Result<Self, Error> {
let bytes: Result<Vec<u8>, _> = read.bytes().take(16).collect();
let bytes = bytes?;
Ok(Uuid::from_bytes(&bytes)?)
}
- fn write(&self, write: &mut Write) -> Result<(), Error> {
? -------------- ---------
+ fn write(&self, write: &mut Write,
+ _: &Settings) -> Result<(), Error> {
write.write(self.as_bytes())?;
Ok(())
}
}
| 8 | 0.347826 | 6 | 2 |
70f58979b17bb20282ac37daf298dbe0b506973f | setup.py | setup.py | from setuptools import setup
version = '0.14.dev0'
long_description = '\n\n'.join([
open('README.rst').read(),
open('CREDITS.rst').read(),
open('CHANGES.rst').read(),
])
install_requires = [
'Django',
'django-extensions',
'django-nose',
'requests',
'itsdangerous',
'south',
'mock',
],
tests_require = [
]
setup(name='lizard-auth-client',
version=version,
description="A client for lizard-auth-server",
long_description=long_description,
# Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers
classifiers=['Programming Language :: Python',
'Framework :: Django',
],
keywords=[],
author='Erik-Jan Vos, Remco Gerlich',
author_email='remco.gerlich@nelen-schuurmans.nl',
url='http://www.nelen-schuurmans.nl/',
license='MIT',
packages=['lizard_auth_client'],
include_package_data=True,
zip_safe=False,
install_requires=install_requires,
tests_require=tests_require,
extras_require={'test': tests_require},
entry_points={
'console_scripts': [
]},
)
| from setuptools import setup
version = '0.14.dev0'
long_description = '\n\n'.join([
open('README.rst').read(),
open('CREDITS.rst').read(),
open('CHANGES.rst').read(),
])
install_requires = [
'Django >= 1.4, < 1.7',
'django-extensions',
'django-nose',
'requests',
'itsdangerous',
'south',
'mock',
],
tests_require = [
]
setup(name='lizard-auth-client',
version=version,
description="A client for lizard-auth-server",
long_description=long_description,
# Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers
classifiers=['Programming Language :: Python',
'Framework :: Django',
],
keywords=[],
author='Erik-Jan Vos, Remco Gerlich',
author_email='remco.gerlich@nelen-schuurmans.nl',
url='http://www.nelen-schuurmans.nl/',
license='MIT',
packages=['lizard_auth_client'],
include_package_data=True,
zip_safe=False,
install_requires=install_requires,
tests_require=tests_require,
extras_require={'test': tests_require},
entry_points={
'console_scripts': [
]},
)
| Document that we don't support Django 1.7 yet | Document that we don't support Django 1.7 yet
| Python | mit | lizardsystem/lizard-auth-client,lizardsystem/lizard-auth-client,lizardsystem/lizard-auth-client | python | ## Code Before:
from setuptools import setup
version = '0.14.dev0'
long_description = '\n\n'.join([
open('README.rst').read(),
open('CREDITS.rst').read(),
open('CHANGES.rst').read(),
])
install_requires = [
'Django',
'django-extensions',
'django-nose',
'requests',
'itsdangerous',
'south',
'mock',
],
tests_require = [
]
setup(name='lizard-auth-client',
version=version,
description="A client for lizard-auth-server",
long_description=long_description,
# Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers
classifiers=['Programming Language :: Python',
'Framework :: Django',
],
keywords=[],
author='Erik-Jan Vos, Remco Gerlich',
author_email='remco.gerlich@nelen-schuurmans.nl',
url='http://www.nelen-schuurmans.nl/',
license='MIT',
packages=['lizard_auth_client'],
include_package_data=True,
zip_safe=False,
install_requires=install_requires,
tests_require=tests_require,
extras_require={'test': tests_require},
entry_points={
'console_scripts': [
]},
)
## Instruction:
Document that we don't support Django 1.7 yet
## Code After:
from setuptools import setup
version = '0.14.dev0'
long_description = '\n\n'.join([
open('README.rst').read(),
open('CREDITS.rst').read(),
open('CHANGES.rst').read(),
])
install_requires = [
'Django >= 1.4, < 1.7',
'django-extensions',
'django-nose',
'requests',
'itsdangerous',
'south',
'mock',
],
tests_require = [
]
setup(name='lizard-auth-client',
version=version,
description="A client for lizard-auth-server",
long_description=long_description,
# Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers
classifiers=['Programming Language :: Python',
'Framework :: Django',
],
keywords=[],
author='Erik-Jan Vos, Remco Gerlich',
author_email='remco.gerlich@nelen-schuurmans.nl',
url='http://www.nelen-schuurmans.nl/',
license='MIT',
packages=['lizard_auth_client'],
include_package_data=True,
zip_safe=False,
install_requires=install_requires,
tests_require=tests_require,
extras_require={'test': tests_require},
entry_points={
'console_scripts': [
]},
)
| from setuptools import setup
version = '0.14.dev0'
long_description = '\n\n'.join([
open('README.rst').read(),
open('CREDITS.rst').read(),
open('CHANGES.rst').read(),
])
install_requires = [
- 'Django',
+ 'Django >= 1.4, < 1.7',
'django-extensions',
'django-nose',
'requests',
'itsdangerous',
'south',
'mock',
],
tests_require = [
]
setup(name='lizard-auth-client',
version=version,
description="A client for lizard-auth-server",
long_description=long_description,
# Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers
classifiers=['Programming Language :: Python',
'Framework :: Django',
],
keywords=[],
author='Erik-Jan Vos, Remco Gerlich',
author_email='remco.gerlich@nelen-schuurmans.nl',
url='http://www.nelen-schuurmans.nl/',
license='MIT',
packages=['lizard_auth_client'],
include_package_data=True,
zip_safe=False,
install_requires=install_requires,
tests_require=tests_require,
extras_require={'test': tests_require},
entry_points={
'console_scripts': [
]},
) | 2 | 0.043478 | 1 | 1 |
b4944c0da657435444c52df87dd52ec51b5884fd | src/routes.js | src/routes.js | import React from 'react';
import { Router, Route, IndexRoute, browserHistory } from 'react-router';
import { syncHistoryWithStore } from 'react-router-redux';
import App from './components/App';
import BlogContainer from './containers/blog-container';
import PostEditorContainer from './containers/post-editor-container';
import Test from './components/Test';
import ScgSearchHelper from './components/scg-search-helper';
import Wedding from './components/wedding';
export default function getRouter(store) {
const history = syncHistoryWithStore(browserHistory, store);
return (
<Router history={history}>
<Route path="/" component={App}>
<IndexRoute component={BlogContainer} />
<Route path="test(/:number)" component={Test} />
<Route path="editor(/:postId)" component={PostEditorContainer} />
</Route>
<Route path="scg" component={ScgSearchHelper} />
<Route path="wedding" component={Wedding} />
</Router>
);
}
| import React from 'react';
import { Router, Route, IndexRoute, browserHistory } from 'react-router';
import { syncHistoryWithStore } from 'react-router-redux';
import App from './components/App';
import BlogContainer from './containers/blog-container';
import PostEditorContainer from './containers/post-editor-container';
import Test from './components/Test';
import ScgSearchHelper from './components/scg-search-helper';
import Wedding from './components/wedding';
export default function getRouter(store) {
const history = syncHistoryWithStore(browserHistory, store);
return (
<Router history={history}>
<Route path="/" component={Wedding} />
<Route path="blog" component={App}>
<IndexRoute component={BlogContainer} />
<Route path="test(/:number)" component={Test} />
<Route path="editor(/:postId)" component={PostEditorContainer} />
</Route>
<Route path="scg" component={ScgSearchHelper} />
</Router>
);
}
| Make wedding page home page. | Make wedding page home page.
| JavaScript | mit | nick-ng/nick-blog-frontend,nick-ng/nick-blog-frontend | javascript | ## Code Before:
import React from 'react';
import { Router, Route, IndexRoute, browserHistory } from 'react-router';
import { syncHistoryWithStore } from 'react-router-redux';
import App from './components/App';
import BlogContainer from './containers/blog-container';
import PostEditorContainer from './containers/post-editor-container';
import Test from './components/Test';
import ScgSearchHelper from './components/scg-search-helper';
import Wedding from './components/wedding';
export default function getRouter(store) {
const history = syncHistoryWithStore(browserHistory, store);
return (
<Router history={history}>
<Route path="/" component={App}>
<IndexRoute component={BlogContainer} />
<Route path="test(/:number)" component={Test} />
<Route path="editor(/:postId)" component={PostEditorContainer} />
</Route>
<Route path="scg" component={ScgSearchHelper} />
<Route path="wedding" component={Wedding} />
</Router>
);
}
## Instruction:
Make wedding page home page.
## Code After:
import React from 'react';
import { Router, Route, IndexRoute, browserHistory } from 'react-router';
import { syncHistoryWithStore } from 'react-router-redux';
import App from './components/App';
import BlogContainer from './containers/blog-container';
import PostEditorContainer from './containers/post-editor-container';
import Test from './components/Test';
import ScgSearchHelper from './components/scg-search-helper';
import Wedding from './components/wedding';
export default function getRouter(store) {
const history = syncHistoryWithStore(browserHistory, store);
return (
<Router history={history}>
<Route path="/" component={Wedding} />
<Route path="blog" component={App}>
<IndexRoute component={BlogContainer} />
<Route path="test(/:number)" component={Test} />
<Route path="editor(/:postId)" component={PostEditorContainer} />
</Route>
<Route path="scg" component={ScgSearchHelper} />
</Router>
);
}
| import React from 'react';
import { Router, Route, IndexRoute, browserHistory } from 'react-router';
import { syncHistoryWithStore } from 'react-router-redux';
import App from './components/App';
import BlogContainer from './containers/blog-container';
import PostEditorContainer from './containers/post-editor-container';
import Test from './components/Test';
import ScgSearchHelper from './components/scg-search-helper';
import Wedding from './components/wedding';
export default function getRouter(store) {
const history = syncHistoryWithStore(browserHistory, store);
return (
<Router history={history}>
+ <Route path="/" component={Wedding} />
- <Route path="/" component={App}>
? ^
+ <Route path="blog" component={App}>
? ^^^^
<IndexRoute component={BlogContainer} />
<Route path="test(/:number)" component={Test} />
<Route path="editor(/:postId)" component={PostEditorContainer} />
</Route>
<Route path="scg" component={ScgSearchHelper} />
- <Route path="wedding" component={Wedding} />
</Router>
);
} | 4 | 0.153846 | 2 | 2 |
4a12754d904abbb035c7365fb7508420b163eb0f | services/web/public/coffee/ide/editor/directives/toggleSwitch.coffee | services/web/public/coffee/ide/editor/directives/toggleSwitch.coffee | define [
"base"
], (App) ->
App.directive "toggleSwitch", () ->
restrict: "E"
scope:
description: "@"
labelFalse: "@"
labelTrue: "@"
ngModel: "="
template: """
<fieldset class="toggle-switch">
<legend class="sr-only">{{description}}</legend>
<input
type="radio"
name="editor-mode"
class="toggle-switch-input"
id="toggle-switch-false-{{$id}}"
ng-value="false"
ng-model="ngModel"
>
<label for="toggle-switch-false-{{$id}}" class="toggle-switch-label">{{labelFalse}}</label>
<input
type="radio"
class="toggle-switch-input"
name="editor-mode"
id="toggle-switch-true-{{$id}}"
ng-value="true"
ng-model="ngModel"
>
<label for="toggle-switch-true-{{$id}}" class="toggle-switch-label">{{labelTrue}}</label>
<span class="toggle-switch-selection"></span>
</fieldset>
"""
| define [
"base"
], (App) ->
App.directive "toggleSwitch", () ->
restrict: "E"
scope:
description: "@"
labelFalse: "@"
labelTrue: "@"
ngModel: "="
template: """
<fieldset class="toggle-switch">
<legend class="sr-only">{{description}}</legend>
<input
type="radio"
name="editor-mode"
class="toggle-switch-input"
id="toggle-switch-false-{{$id}}"
ng-value="false"
ng-model="ngModel"
>
<label for="toggle-switch-false-{{$id}}" class="toggle-switch-label">{{labelFalse}}</label>
<input
type="radio"
class="toggle-switch-input"
name="editor-mode"
id="toggle-switch-true-{{$id}}"
ng-value="true"
ng-model="ngModel"
>
<label for="toggle-switch-true-{{$id}}" class="toggle-switch-label">{{labelTrue}}</label>
<span class="toggle-switch-selection" aria-hidden="true"></span>
</fieldset>
"""
| Mark visible toggle switch as hidden from screen readers | Mark visible toggle switch as hidden from screen readers
| CoffeeScript | agpl-3.0 | sharelatex/sharelatex | coffeescript | ## Code Before:
define [
"base"
], (App) ->
App.directive "toggleSwitch", () ->
restrict: "E"
scope:
description: "@"
labelFalse: "@"
labelTrue: "@"
ngModel: "="
template: """
<fieldset class="toggle-switch">
<legend class="sr-only">{{description}}</legend>
<input
type="radio"
name="editor-mode"
class="toggle-switch-input"
id="toggle-switch-false-{{$id}}"
ng-value="false"
ng-model="ngModel"
>
<label for="toggle-switch-false-{{$id}}" class="toggle-switch-label">{{labelFalse}}</label>
<input
type="radio"
class="toggle-switch-input"
name="editor-mode"
id="toggle-switch-true-{{$id}}"
ng-value="true"
ng-model="ngModel"
>
<label for="toggle-switch-true-{{$id}}" class="toggle-switch-label">{{labelTrue}}</label>
<span class="toggle-switch-selection"></span>
</fieldset>
"""
## Instruction:
Mark visible toggle switch as hidden from screen readers
## Code After:
define [
"base"
], (App) ->
App.directive "toggleSwitch", () ->
restrict: "E"
scope:
description: "@"
labelFalse: "@"
labelTrue: "@"
ngModel: "="
template: """
<fieldset class="toggle-switch">
<legend class="sr-only">{{description}}</legend>
<input
type="radio"
name="editor-mode"
class="toggle-switch-input"
id="toggle-switch-false-{{$id}}"
ng-value="false"
ng-model="ngModel"
>
<label for="toggle-switch-false-{{$id}}" class="toggle-switch-label">{{labelFalse}}</label>
<input
type="radio"
class="toggle-switch-input"
name="editor-mode"
id="toggle-switch-true-{{$id}}"
ng-value="true"
ng-model="ngModel"
>
<label for="toggle-switch-true-{{$id}}" class="toggle-switch-label">{{labelTrue}}</label>
<span class="toggle-switch-selection" aria-hidden="true"></span>
</fieldset>
"""
| define [
"base"
], (App) ->
App.directive "toggleSwitch", () ->
restrict: "E"
scope:
description: "@"
labelFalse: "@"
labelTrue: "@"
ngModel: "="
template: """
<fieldset class="toggle-switch">
<legend class="sr-only">{{description}}</legend>
<input
type="radio"
name="editor-mode"
class="toggle-switch-input"
id="toggle-switch-false-{{$id}}"
ng-value="false"
ng-model="ngModel"
>
<label for="toggle-switch-false-{{$id}}" class="toggle-switch-label">{{labelFalse}}</label>
<input
type="radio"
class="toggle-switch-input"
name="editor-mode"
id="toggle-switch-true-{{$id}}"
ng-value="true"
ng-model="ngModel"
>
<label for="toggle-switch-true-{{$id}}" class="toggle-switch-label">{{labelTrue}}</label>
- <span class="toggle-switch-selection"></span>
+ <span class="toggle-switch-selection" aria-hidden="true"></span>
? +++++++++++++++++++
</fieldset>
""" | 2 | 0.054054 | 1 | 1 |
3b65e71015ecea61c7eb6ce86eaef7135486aadb | Source/sourcekitten/main.swift | Source/sourcekitten/main.swift | //
// main.swift
// SourceKitten
//
// Created by JP Simard on 2015-01-03.
// Copyright (c) 2015 SourceKitten. All rights reserved.
//
import Darwin
import Commandant
// `sourcekitd_set_notification_handler()` set the handler to be executed on main thread queue.
// So, we vacate main thread to `dispatch_main()`.
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) {
let registry = CommandRegistry<SourceKittenError>()
registry.register(CompleteCommand())
registry.register(DocCommand())
registry.register(SyntaxCommand())
registry.register(StructureCommand())
registry.register(VersionCommand())
let helpCommand = HelpCommand(registry: registry)
registry.register(helpCommand)
registry.main(defaultVerb: "help") { error in
fputs("\(error)\n", stderr)
}
}
dispatch_main()
| //
// main.swift
// SourceKitten
//
// Created by JP Simard on 2015-01-03.
// Copyright (c) 2015 SourceKitten. All rights reserved.
//
import Darwin
import Foundation
import Commandant
// `sourcekitd_set_notification_handler()` set the handler to be executed on main thread queue.
// So, we vacate main thread to `dispatch_main()`.
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) {
let registry = CommandRegistry<SourceKittenError>()
registry.register(CompleteCommand())
registry.register(DocCommand())
registry.register(SyntaxCommand())
registry.register(StructureCommand())
registry.register(VersionCommand())
let helpCommand = HelpCommand(registry: registry)
registry.register(helpCommand)
registry.main(defaultVerb: "help") { error in
fputs("\(error)\n", stderr)
}
}
dispatch_main()
| Fix build error on `make spm_test` | Fix build error on `make spm_test`
| Swift | mit | jpsim/SourceKitten,jpsim/SourceKitten,jpsim/SourceKitten,jpsim/SourceKitten,jpsim/SourceKitten | swift | ## Code Before:
//
// main.swift
// SourceKitten
//
// Created by JP Simard on 2015-01-03.
// Copyright (c) 2015 SourceKitten. All rights reserved.
//
import Darwin
import Commandant
// `sourcekitd_set_notification_handler()` set the handler to be executed on main thread queue.
// So, we vacate main thread to `dispatch_main()`.
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) {
let registry = CommandRegistry<SourceKittenError>()
registry.register(CompleteCommand())
registry.register(DocCommand())
registry.register(SyntaxCommand())
registry.register(StructureCommand())
registry.register(VersionCommand())
let helpCommand = HelpCommand(registry: registry)
registry.register(helpCommand)
registry.main(defaultVerb: "help") { error in
fputs("\(error)\n", stderr)
}
}
dispatch_main()
## Instruction:
Fix build error on `make spm_test`
## Code After:
//
// main.swift
// SourceKitten
//
// Created by JP Simard on 2015-01-03.
// Copyright (c) 2015 SourceKitten. All rights reserved.
//
import Darwin
import Foundation
import Commandant
// `sourcekitd_set_notification_handler()` set the handler to be executed on main thread queue.
// So, we vacate main thread to `dispatch_main()`.
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) {
let registry = CommandRegistry<SourceKittenError>()
registry.register(CompleteCommand())
registry.register(DocCommand())
registry.register(SyntaxCommand())
registry.register(StructureCommand())
registry.register(VersionCommand())
let helpCommand = HelpCommand(registry: registry)
registry.register(helpCommand)
registry.main(defaultVerb: "help") { error in
fputs("\(error)\n", stderr)
}
}
dispatch_main()
| //
// main.swift
// SourceKitten
//
// Created by JP Simard on 2015-01-03.
// Copyright (c) 2015 SourceKitten. All rights reserved.
//
import Darwin
+ import Foundation
import Commandant
// `sourcekitd_set_notification_handler()` set the handler to be executed on main thread queue.
// So, we vacate main thread to `dispatch_main()`.
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) {
let registry = CommandRegistry<SourceKittenError>()
registry.register(CompleteCommand())
registry.register(DocCommand())
registry.register(SyntaxCommand())
registry.register(StructureCommand())
registry.register(VersionCommand())
let helpCommand = HelpCommand(registry: registry)
registry.register(helpCommand)
registry.main(defaultVerb: "help") { error in
fputs("\(error)\n", stderr)
}
}
dispatch_main() | 1 | 0.033333 | 1 | 0 |
32a74aabbcfd74a878c44f32f0d02518e91746e8 | spec/search-model-spec.coffee | spec/search-model-spec.coffee | RootView = require 'root-view'
SearchModel = require 'search-in-buffer/lib/search-model'
describe 'SearchModel', ->
[goToLine, editor, subject, buffer] = []
beforeEach ->
window.rootView = new RootView
rootView.open('sample.js')
rootView.enableKeymap()
editor = rootView.getActiveView()
buffer = editor.activeEditSession.buffer
subject = new SearchModel()
describe "setPattern()", ->
it "kicks out an event", ->
subject.on 'change', spy = jasmine.createSpy()
subject.setPattern('items')
expect(spy).toHaveBeenCalled()
expect(spy.mostRecentCall.args[0]).toEqual subject
expect(spy.mostRecentCall.args[1]).toEqual regex: subject.regex
| RootView = require 'root-view'
SearchModel = require 'search-in-buffer/lib/search-model'
describe 'SearchModel', ->
[goToLine, editor, subject, buffer] = []
beforeEach ->
window.rootView = new RootView
rootView.open('sample.js')
rootView.enableKeymap()
editor = rootView.getActiveView()
buffer = editor.activeEditSession.buffer
subject = new SearchModel()
describe "setPattern()", ->
it "kicks out an event", ->
subject.on 'change', spy = jasmine.createSpy()
subject.setPattern('items')
expect(spy).toHaveBeenCalled()
expect(spy.mostRecentCall.args[0]).toEqual subject
expect(spy.mostRecentCall.args[1]).toEqual regex: subject.regex
describe "search() with options", ->
beforeEach ->
describe "regex option", ->
it 'returns regex matches when on', ->
subject.search('items.', regex: true)
expect(subject.regex.test('items;')).toEqual(true)
it 'returns only literal matches when off', ->
subject.search('items.', regex: false)
expect(subject.regex.test('items;')).toEqual(false)
| Add search with regex option tests to SearchModel spec | Add search with regex option tests to SearchModel spec | CoffeeScript | mit | atom/find-and-replace,harai/find-and-replace,trevdor/find-and-replace,bmperrea/find-and-replace | coffeescript | ## Code Before:
RootView = require 'root-view'
SearchModel = require 'search-in-buffer/lib/search-model'
describe 'SearchModel', ->
[goToLine, editor, subject, buffer] = []
beforeEach ->
window.rootView = new RootView
rootView.open('sample.js')
rootView.enableKeymap()
editor = rootView.getActiveView()
buffer = editor.activeEditSession.buffer
subject = new SearchModel()
describe "setPattern()", ->
it "kicks out an event", ->
subject.on 'change', spy = jasmine.createSpy()
subject.setPattern('items')
expect(spy).toHaveBeenCalled()
expect(spy.mostRecentCall.args[0]).toEqual subject
expect(spy.mostRecentCall.args[1]).toEqual regex: subject.regex
## Instruction:
Add search with regex option tests to SearchModel spec
## Code After:
RootView = require 'root-view'
SearchModel = require 'search-in-buffer/lib/search-model'
describe 'SearchModel', ->
[goToLine, editor, subject, buffer] = []
beforeEach ->
window.rootView = new RootView
rootView.open('sample.js')
rootView.enableKeymap()
editor = rootView.getActiveView()
buffer = editor.activeEditSession.buffer
subject = new SearchModel()
describe "setPattern()", ->
it "kicks out an event", ->
subject.on 'change', spy = jasmine.createSpy()
subject.setPattern('items')
expect(spy).toHaveBeenCalled()
expect(spy.mostRecentCall.args[0]).toEqual subject
expect(spy.mostRecentCall.args[1]).toEqual regex: subject.regex
describe "search() with options", ->
beforeEach ->
describe "regex option", ->
it 'returns regex matches when on', ->
subject.search('items.', regex: true)
expect(subject.regex.test('items;')).toEqual(true)
it 'returns only literal matches when off', ->
subject.search('items.', regex: false)
expect(subject.regex.test('items;')).toEqual(false)
| RootView = require 'root-view'
SearchModel = require 'search-in-buffer/lib/search-model'
describe 'SearchModel', ->
[goToLine, editor, subject, buffer] = []
beforeEach ->
window.rootView = new RootView
rootView.open('sample.js')
rootView.enableKeymap()
editor = rootView.getActiveView()
buffer = editor.activeEditSession.buffer
subject = new SearchModel()
describe "setPattern()", ->
it "kicks out an event", ->
subject.on 'change', spy = jasmine.createSpy()
subject.setPattern('items')
expect(spy).toHaveBeenCalled()
expect(spy.mostRecentCall.args[0]).toEqual subject
expect(spy.mostRecentCall.args[1]).toEqual regex: subject.regex
+
+ describe "search() with options", ->
+ beforeEach ->
+ describe "regex option", ->
+ it 'returns regex matches when on', ->
+ subject.search('items.', regex: true)
+ expect(subject.regex.test('items;')).toEqual(true)
+
+ it 'returns only literal matches when off', ->
+ subject.search('items.', regex: false)
+ expect(subject.regex.test('items;')).toEqual(false) | 11 | 0.5 | 11 | 0 |
d1d7bd0b054242f8d5941867b5f1990c2cc7fae4 | dist/utilities/_icon-font-replace.scss | dist/utilities/_icon-font-replace.scss | // Icon Font Replace
// =================
//
// This is used when we want to replace any text inside an icon font element
@mixin icon-font-replace($position: 'before', $size: inherit, $color: inherit, $width: 1em) {
@include hide-text();
position: relative;
display: inline-block;
width: $width;
font-size: $size;
&::#{$position} {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
display: block;
margin: 0;
color: $color;
font-size: inherit;
line-height: inherit;
text-align: center;
text-indent: 0;
}
}
| // Icon Font Replace
// =================
//
// This is used when we want to replace any text inside an icon font element
@mixin icon-font-replace($position: 'before', $width: 1em) {
@include hide-text();
position: relative;
display: inline-block;
width: $width;
&::#{$position} {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
display: block;
margin: 0;
font-size: inherit;
line-height: inherit;
text-align: center;
text-indent: 0;
}
}
| Remove size and color parameters from the replace mixin | Remove size and color parameters from the replace mixin
This is to be consistent with the changes to the icon-font() mixin
| SCSS | mit | mobify/spline,mobify/spline | scss | ## Code Before:
// Icon Font Replace
// =================
//
// This is used when we want to replace any text inside an icon font element
@mixin icon-font-replace($position: 'before', $size: inherit, $color: inherit, $width: 1em) {
@include hide-text();
position: relative;
display: inline-block;
width: $width;
font-size: $size;
&::#{$position} {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
display: block;
margin: 0;
color: $color;
font-size: inherit;
line-height: inherit;
text-align: center;
text-indent: 0;
}
}
## Instruction:
Remove size and color parameters from the replace mixin
This is to be consistent with the changes to the icon-font() mixin
## Code After:
// Icon Font Replace
// =================
//
// This is used when we want to replace any text inside an icon font element
@mixin icon-font-replace($position: 'before', $width: 1em) {
@include hide-text();
position: relative;
display: inline-block;
width: $width;
&::#{$position} {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
display: block;
margin: 0;
font-size: inherit;
line-height: inherit;
text-align: center;
text-indent: 0;
}
}
| // Icon Font Replace
// =================
//
// This is used when we want to replace any text inside an icon font element
- @mixin icon-font-replace($position: 'before', $size: inherit, $color: inherit, $width: 1em) {
? ---------------------------------
+ @mixin icon-font-replace($position: 'before', $width: 1em) {
@include hide-text();
position: relative;
display: inline-block;
width: $width;
-
- font-size: $size;
&::#{$position} {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
display: block;
margin: 0;
- color: $color;
font-size: inherit;
line-height: inherit;
text-align: center;
text-indent: 0;
}
} | 5 | 0.15625 | 1 | 4 |
5d646a3abfc6daba86a31b497b3e13cf90f57e95 | plugin/settings/functions.vim | plugin/settings/functions.vim | " from http://vimcasts.org/episodes/tidying-whitespace/
function! Preserve(command)
" Preparation: save last search, and cursor position.
let save_cursor = getpos('.')
let last_search = getreg('/')
" Do the business:
execute a:command
" Clean up: restore previous search history, and cursor position
call setpos('.', save_cursor)
call setreg('/', last_search)
endfunction
| " from http://vimcasts.org/episodes/tidying-whitespace/
function! Preserve(command)
" Preparation: save last search, and cursor position.
let save_cursor = getpos('.')
let last_search = getreg('/')
" Do the business:
execute a:command
" Clean up: restore previous search history, and cursor position
call setpos('.', save_cursor)
call setreg('/', last_search)
endfunction
" Convenient command to see the difference between the current buffer and the
" file it was loaded from, thus the changes you made.
" Only define it when not defined already.
if !exists(":DiffOrig")
command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
\ | wincmd p | diffthis
endif
| Add :DiffOrig function to show diff btw last save and current edits | Add :DiffOrig function to show diff btw last save and current edits
| VimL | apache-2.0 | dougireton/mirror_pond | viml | ## Code Before:
" from http://vimcasts.org/episodes/tidying-whitespace/
function! Preserve(command)
" Preparation: save last search, and cursor position.
let save_cursor = getpos('.')
let last_search = getreg('/')
" Do the business:
execute a:command
" Clean up: restore previous search history, and cursor position
call setpos('.', save_cursor)
call setreg('/', last_search)
endfunction
## Instruction:
Add :DiffOrig function to show diff btw last save and current edits
## Code After:
" from http://vimcasts.org/episodes/tidying-whitespace/
function! Preserve(command)
" Preparation: save last search, and cursor position.
let save_cursor = getpos('.')
let last_search = getreg('/')
" Do the business:
execute a:command
" Clean up: restore previous search history, and cursor position
call setpos('.', save_cursor)
call setreg('/', last_search)
endfunction
" Convenient command to see the difference between the current buffer and the
" file it was loaded from, thus the changes you made.
" Only define it when not defined already.
if !exists(":DiffOrig")
command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
\ | wincmd p | diffthis
endif
| " from http://vimcasts.org/episodes/tidying-whitespace/
function! Preserve(command)
" Preparation: save last search, and cursor position.
let save_cursor = getpos('.')
let last_search = getreg('/')
" Do the business:
execute a:command
" Clean up: restore previous search history, and cursor position
call setpos('.', save_cursor)
call setreg('/', last_search)
endfunction
+
+ " Convenient command to see the difference between the current buffer and the
+ " file it was loaded from, thus the changes you made.
+ " Only define it when not defined already.
+ if !exists(":DiffOrig")
+ command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
+ \ | wincmd p | diffthis
+ endif | 8 | 0.727273 | 8 | 0 |
487352b2044291e6f88abed30fc23cf161305d99 | app/webpack.config.js | app/webpack.config.js | module.exports = {
entry: "./app/App.jsx",
output: {
filename: "public/bundle.js"
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /node_modules|bower_components/,
loader: 'babel',
query: {
presets: ['react', 'es2015']
}
}
]
}
} | require('dotenv').config()
var webpack = require('webpack')
module.exports = {
plugins: [
new webpack.DefinePlugin({
'process.env': {
'GOOGLE_MAPS_API_KEY': JSON.stringify(process.env.GOOGLE_MAPS_API_KEY)
}
})
],
entry: "./app/App.jsx",
output: {
filename: "public/bundle.js"
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /node_modules|bower_components/,
loader: 'babel',
query: {
presets: ['react', 'es2015']
}
}
]
}
} | Add env files for bundle | Add env files for bundle
| JavaScript | mit | taodav/MicroSerfs,taodav/MicroSerfs | javascript | ## Code Before:
module.exports = {
entry: "./app/App.jsx",
output: {
filename: "public/bundle.js"
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /node_modules|bower_components/,
loader: 'babel',
query: {
presets: ['react', 'es2015']
}
}
]
}
}
## Instruction:
Add env files for bundle
## Code After:
require('dotenv').config()
var webpack = require('webpack')
module.exports = {
plugins: [
new webpack.DefinePlugin({
'process.env': {
'GOOGLE_MAPS_API_KEY': JSON.stringify(process.env.GOOGLE_MAPS_API_KEY)
}
})
],
entry: "./app/App.jsx",
output: {
filename: "public/bundle.js"
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /node_modules|bower_components/,
loader: 'babel',
query: {
presets: ['react', 'es2015']
}
}
]
}
} | + require('dotenv').config()
+ var webpack = require('webpack')
+
module.exports = {
+ plugins: [
+ new webpack.DefinePlugin({
+ 'process.env': {
+ 'GOOGLE_MAPS_API_KEY': JSON.stringify(process.env.GOOGLE_MAPS_API_KEY)
+ }
+ })
+ ],
entry: "./app/App.jsx",
output: {
filename: "public/bundle.js"
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /node_modules|bower_components/,
loader: 'babel',
query: {
presets: ['react', 'es2015']
}
}
]
}
} | 10 | 0.555556 | 10 | 0 |
25bd18d679c3e2c6ff76bcd4567f9f3b09a9b0dc | optgrouper.jquery.json | optgrouper.jquery.json | {
"name": "optgrouper",
"version": "0.1.0",
"title": "jquery.optgrouper",
"author": {
"name": "Andrew Duthie",
"email": "andrew@andrewduthie.com",
"url": "http://www.andrewduthie.com"
},
"licenses": [
{
"type": "MIT"
}
],
"dependencies": {
"jquery": ">=1.2.3"
},
"description": "Automatically group <option>'s into <optgroup>'s with data-optgroup attribute",
"keywords": [
"optgroup",
"select",
"dropdown"
],
"homepage": "http://aduth.github.com/jquery.optgrouper",
"demo": "http://aduth.github.com/jquery.optgrouper"
}
| {
"name": "Optgrouper",
"version": "0.1.0",
"title": "jquery.optgrouper",
"author": {
"name": "Andrew Duthie",
"email": "andrew@andrewduthie.com",
"url": "http://www.andrewduthie.com"
},
"licenses": [
{
"type": "MIT"
}
],
"dependencies": {
"jquery": ">=1.2.3"
},
"description": "Automatically group <option>'s into <optgroup>'s with data-optgroup attribute",
"keywords": [
"optgroup",
"select",
"dropdown"
],
"homepage": "http://aduth.github.com/jquery.optgrouper",
"demo": "http://aduth.github.com/jquery.optgrouper"
}
| Revert "Attempt to resolve jQuery manifest issues (mismatched name)" | Revert "Attempt to resolve jQuery manifest issues (mismatched name)"
This reverts commit 0d7ab4a6efb57c7ee3b90421a9c2ded892098eeb.
| JSON | mit | aduth/jquery.optgrouper | json | ## Code Before:
{
"name": "optgrouper",
"version": "0.1.0",
"title": "jquery.optgrouper",
"author": {
"name": "Andrew Duthie",
"email": "andrew@andrewduthie.com",
"url": "http://www.andrewduthie.com"
},
"licenses": [
{
"type": "MIT"
}
],
"dependencies": {
"jquery": ">=1.2.3"
},
"description": "Automatically group <option>'s into <optgroup>'s with data-optgroup attribute",
"keywords": [
"optgroup",
"select",
"dropdown"
],
"homepage": "http://aduth.github.com/jquery.optgrouper",
"demo": "http://aduth.github.com/jquery.optgrouper"
}
## Instruction:
Revert "Attempt to resolve jQuery manifest issues (mismatched name)"
This reverts commit 0d7ab4a6efb57c7ee3b90421a9c2ded892098eeb.
## Code After:
{
"name": "Optgrouper",
"version": "0.1.0",
"title": "jquery.optgrouper",
"author": {
"name": "Andrew Duthie",
"email": "andrew@andrewduthie.com",
"url": "http://www.andrewduthie.com"
},
"licenses": [
{
"type": "MIT"
}
],
"dependencies": {
"jquery": ">=1.2.3"
},
"description": "Automatically group <option>'s into <optgroup>'s with data-optgroup attribute",
"keywords": [
"optgroup",
"select",
"dropdown"
],
"homepage": "http://aduth.github.com/jquery.optgrouper",
"demo": "http://aduth.github.com/jquery.optgrouper"
}
| {
- "name": "optgrouper",
? ^
+ "name": "Optgrouper",
? ^
"version": "0.1.0",
"title": "jquery.optgrouper",
"author": {
"name": "Andrew Duthie",
"email": "andrew@andrewduthie.com",
"url": "http://www.andrewduthie.com"
},
"licenses": [
{
"type": "MIT"
}
],
"dependencies": {
"jquery": ">=1.2.3"
},
"description": "Automatically group <option>'s into <optgroup>'s with data-optgroup attribute",
"keywords": [
"optgroup",
"select",
"dropdown"
],
"homepage": "http://aduth.github.com/jquery.optgrouper",
"demo": "http://aduth.github.com/jquery.optgrouper"
} | 2 | 0.076923 | 1 | 1 |
229bd1056ac20fa5834cba569977a347395a709f | lib/model/GraphEntity.ts | lib/model/GraphEntity.ts | import {isPresent} from "../utils/core";
export type Persisted<T> = T & { id:string };
export type Peristable = { id?:string };
export function isPersisted<T extends Peristable>(entity:T | Persisted<T>):entity is Persisted<T> {
return isPresent(<any>entity.id);
}
export function assertPersisted<T extends Peristable>(entity:T | Persisted<T>) {
if (!isPersisted(entity)) {
throw new Error(`Expected entity to be persisted: ${entity}`);
}
} | import {isPresent} from "../utils/core";
export type Persisted<T> = T & { id:string };
export type PersistedAggregate<T> = {
[P in keyof T]: Persisted<T[P]>;
};
export type Peristable = { id?:string };
export function isPersisted<T extends Peristable>(entity:T | Persisted<T>):entity is Persisted<T> {
return isPresent(<any>entity.id);
}
export function assertPersisted<T extends Peristable>(entity:T | Persisted<T>) {
if (!isPersisted(entity)) {
throw new Error(`Expected entity to be persisted: ${entity}`);
}
} | Add mapped type for aggregate objects | Add mapped type for aggregate objects
| TypeScript | mit | robak86/neography | typescript | ## Code Before:
import {isPresent} from "../utils/core";
export type Persisted<T> = T & { id:string };
export type Peristable = { id?:string };
export function isPersisted<T extends Peristable>(entity:T | Persisted<T>):entity is Persisted<T> {
return isPresent(<any>entity.id);
}
export function assertPersisted<T extends Peristable>(entity:T | Persisted<T>) {
if (!isPersisted(entity)) {
throw new Error(`Expected entity to be persisted: ${entity}`);
}
}
## Instruction:
Add mapped type for aggregate objects
## Code After:
import {isPresent} from "../utils/core";
export type Persisted<T> = T & { id:string };
export type PersistedAggregate<T> = {
[P in keyof T]: Persisted<T[P]>;
};
export type Peristable = { id?:string };
export function isPersisted<T extends Peristable>(entity:T | Persisted<T>):entity is Persisted<T> {
return isPresent(<any>entity.id);
}
export function assertPersisted<T extends Peristable>(entity:T | Persisted<T>) {
if (!isPersisted(entity)) {
throw new Error(`Expected entity to be persisted: ${entity}`);
}
} | import {isPresent} from "../utils/core";
export type Persisted<T> = T & { id:string };
+ export type PersistedAggregate<T> = {
+ [P in keyof T]: Persisted<T[P]>;
+ };
+
+
export type Peristable = { id?:string };
export function isPersisted<T extends Peristable>(entity:T | Persisted<T>):entity is Persisted<T> {
return isPresent(<any>entity.id);
}
export function assertPersisted<T extends Peristable>(entity:T | Persisted<T>) {
if (!isPersisted(entity)) {
throw new Error(`Expected entity to be persisted: ${entity}`);
}
} | 5 | 0.357143 | 5 | 0 |
abae14bb97a9b13d644b827cb67ecb10980516c9 | README.md | README.md |
This repository contains docker images for basic hadoop cluster.
## Configuration
Configuration files are copied at the first time if not exists. So you can map a volume to /usr/hdp/hadoop/etc/hadoop and a minimal configuration (just eough to start the cluster with docker-compose) will be created.
*All* the hadoop configurations could be overridden with environment variables, with the form: ```CONFIG_FILE_NAME_CONFIG_NAME``` For example CORE_SITE_FS_DEFAULT_NAME=hdfs://xxx will generate a ```fs.default.name=hdfs://xxx``` entry to the core-site.xml, but *only at the first time, if config file doesn't exists```
## Running with docker compose
```
cd compose/yarn
docker-compose up -d
cd ../../compose/hdfs
docker-compose up -d
```
If you need you can scale up the datanode and nodemanagers:
```
sudo docker-compose scale datanode=2
```
|
This repository contains docker images for basic hadoop cluster.
## Configuration
Configuration files are copied at the first time if not exists. So you can map a volume to /usr/hdp/hadoop/etc/hadoop and a minimal configuration (just eough to start the cluster with docker-compose) will be created.
*All* the hadoop configurations could be overridden with environment variables, with the form: ```CONFIG_FILE_NAME_CONFIG_NAME``` For example CORE_SITE_FS_DEFAULT_NAME=hdfs://xxx will generate a ```fs.default.name=hdfs://xxx``` entry to the core-site.xml, but *only at the first time, if config file doesn't exists```
## Running with docker compose
For running the example compose files you need an external network with the name hadoop:
```
docker network create --driver=bridge hadoop
````
With the haddop network you can start the instances.
```
cd compose/yarn
docker-compose up -d
cd ../../compose/hdfs
docker-compose up -d
```
If you need you can scale up the datanode and nodemanagers:
```
sudo docker-compose scale datanode=2
```
| Add network creation to the readme. | Add network creation to the readme. | Markdown | apache-2.0 | flokkr/docker-hadoop,flokkr/docker-hadoop,elek/docker-bigdata-base,elek/docker-hadoop,elek/docker-bigdata-base | markdown | ## Code Before:
This repository contains docker images for basic hadoop cluster.
## Configuration
Configuration files are copied at the first time if not exists. So you can map a volume to /usr/hdp/hadoop/etc/hadoop and a minimal configuration (just eough to start the cluster with docker-compose) will be created.
*All* the hadoop configurations could be overridden with environment variables, with the form: ```CONFIG_FILE_NAME_CONFIG_NAME``` For example CORE_SITE_FS_DEFAULT_NAME=hdfs://xxx will generate a ```fs.default.name=hdfs://xxx``` entry to the core-site.xml, but *only at the first time, if config file doesn't exists```
## Running with docker compose
```
cd compose/yarn
docker-compose up -d
cd ../../compose/hdfs
docker-compose up -d
```
If you need you can scale up the datanode and nodemanagers:
```
sudo docker-compose scale datanode=2
```
## Instruction:
Add network creation to the readme.
## Code After:
This repository contains docker images for basic hadoop cluster.
## Configuration
Configuration files are copied at the first time if not exists. So you can map a volume to /usr/hdp/hadoop/etc/hadoop and a minimal configuration (just eough to start the cluster with docker-compose) will be created.
*All* the hadoop configurations could be overridden with environment variables, with the form: ```CONFIG_FILE_NAME_CONFIG_NAME``` For example CORE_SITE_FS_DEFAULT_NAME=hdfs://xxx will generate a ```fs.default.name=hdfs://xxx``` entry to the core-site.xml, but *only at the first time, if config file doesn't exists```
## Running with docker compose
For running the example compose files you need an external network with the name hadoop:
```
docker network create --driver=bridge hadoop
````
With the haddop network you can start the instances.
```
cd compose/yarn
docker-compose up -d
cd ../../compose/hdfs
docker-compose up -d
```
If you need you can scale up the datanode and nodemanagers:
```
sudo docker-compose scale datanode=2
```
|
This repository contains docker images for basic hadoop cluster.
## Configuration
Configuration files are copied at the first time if not exists. So you can map a volume to /usr/hdp/hadoop/etc/hadoop and a minimal configuration (just eough to start the cluster with docker-compose) will be created.
*All* the hadoop configurations could be overridden with environment variables, with the form: ```CONFIG_FILE_NAME_CONFIG_NAME``` For example CORE_SITE_FS_DEFAULT_NAME=hdfs://xxx will generate a ```fs.default.name=hdfs://xxx``` entry to the core-site.xml, but *only at the first time, if config file doesn't exists```
## Running with docker compose
+ For running the example compose files you need an external network with the name hadoop:
+
+ ```
+ docker network create --driver=bridge hadoop
+ ````
+
+ With the haddop network you can start the instances.
+
```
cd compose/yarn
docker-compose up -d
cd ../../compose/hdfs
docker-compose up -d
-
```
If you need you can scale up the datanode and nodemanagers:
```
sudo docker-compose scale datanode=2
``` | 9 | 0.36 | 8 | 1 |
56a1dee20eb9dccbd6fa274ecb535d4dd596a8f1 | app/models/notification.rb | app/models/notification.rb | class Notification < ApplicationRecord
belongs_to :notification_type
belongs_to :initiator, :class_name => User, :foreign_key => 'user_id'
belongs_to :subject, :polymorphic => true
belongs_to :cause, :polymorphic => true
has_many :notification_recipients, :dependent => :delete_all
has_many :recipients, :class_name => User, :through => :notification_recipients, :source => :user
accepts_nested_attributes_for :notification_recipients
before_create :set_notification_recipients
def type=(typ)
self.notification_type = NotificationType.find_by_name!(typ)
end
def to_h
{
:level => notification_type.level,
:created_at => created_at,
:text => notification_type.message,
:bindings => text_bindings
}
end
private
def set_notification_recipients
subscribers = notification_type.subscriber_ids(subject, initiator)
self.notification_recipients_attributes = subscribers.collect { |id| {:user_id => id } }
end
def text_bindings
h = {}
h[:initiator] = { :text => initiator.name } if initiator
h[:subject] = { :text => subject.name } if subject
h[:cause] = { :text => cause.name } if cause
h
end
end
| class Notification < ApplicationRecord
belongs_to :notification_type
belongs_to :initiator, :class_name => User, :foreign_key => 'user_id'
belongs_to :subject, :polymorphic => true
belongs_to :cause, :polymorphic => true
has_many :notification_recipients, :dependent => :delete_all
has_many :recipients, :class_name => User, :through => :notification_recipients, :source => :user
accepts_nested_attributes_for :notification_recipients
before_create :set_notification_recipients
def type=(typ)
self.notification_type = NotificationType.find_by_name!(typ)
end
def to_h
{
:level => notification_type.level,
:created_at => created_at,
:text => notification_type.message,
:bindings => text_bindings
}
end
private
def set_notification_recipients
subscribers = notification_type.subscriber_ids(subject, initiator)
self.notification_recipients_attributes = subscribers.collect { |id| {:user_id => id } }
end
def text_bindings
[:initiator, :subject, :cause].each_with_object({}) do |key, result|
value = public_send(key)
result[key] = { :text => value.name } if value
end
end
end
| Use loop to avoid code repetition | Use loop to avoid code repetition
| Ruby | apache-2.0 | lpichler/manageiq,skateman/manageiq,gmcculloug/manageiq,durandom/manageiq,syncrou/manageiq,mfeifer/manageiq,djberg96/manageiq,mfeifer/manageiq,skateman/manageiq,mresti/manageiq,jvlcek/manageiq,agrare/manageiq,yaacov/manageiq,gerikis/manageiq,hstastna/manageiq,mkanoor/manageiq,aufi/manageiq,skateman/manageiq,tinaafitz/manageiq,romanblanco/manageiq,ilackarms/manageiq,juliancheal/manageiq,chessbyte/manageiq,durandom/manageiq,tzumainn/manageiq,israel-hdez/manageiq,lpichler/manageiq,djberg96/manageiq,israel-hdez/manageiq,syncrou/manageiq,tzumainn/manageiq,NickLaMuro/manageiq,ailisp/manageiq,djberg96/manageiq,ailisp/manageiq,ilackarms/manageiq,djberg96/manageiq,juliancheal/manageiq,andyvesel/manageiq,matobet/manageiq,ManageIQ/manageiq,ManageIQ/manageiq,lpichler/manageiq,romaintb/manageiq,jntullo/manageiq,durandom/manageiq,ailisp/manageiq,pkomanek/manageiq,andyvesel/manageiq,NickLaMuro/manageiq,billfitzgerald0120/manageiq,agrare/manageiq,tinaafitz/manageiq,josejulio/manageiq,tzumainn/manageiq,NickLaMuro/manageiq,matobet/manageiq,jrafanie/manageiq,mzazrivec/manageiq,NaNi-Z/manageiq,pkomanek/manageiq,jrafanie/manageiq,romaintb/manageiq,gmcculloug/manageiq,mfeifer/manageiq,mresti/manageiq,NaNi-Z/manageiq,hstastna/manageiq,ManageIQ/manageiq,d-m-u/manageiq,gerikis/manageiq,israel-hdez/manageiq,NaNi-Z/manageiq,fbladilo/manageiq,aufi/manageiq,ilackarms/manageiq,agrare/manageiq,borod108/manageiq,yaacov/manageiq,pkomanek/manageiq,romaintb/manageiq,yaacov/manageiq,mfeifer/manageiq,romaintb/manageiq,chessbyte/manageiq,kbrock/manageiq,fbladilo/manageiq,matobet/manageiq,durandom/manageiq,branic/manageiq,gmcculloug/manageiq,pkomanek/manageiq,mresti/manageiq,lpichler/manageiq,mkanoor/manageiq,jameswnl/manageiq,NickLaMuro/manageiq,jameswnl/manageiq,mzazrivec/manageiq,jvlcek/manageiq,jvlcek/manageiq,yaacov/manageiq,mzazrivec/manageiq,jntullo/manageiq,gerikis/manageiq,d-m-u/manageiq,romanblanco/manageiq,hstastna/manageiq,kbrock/manageiq,billfitzgerald0120/manageiq,tzumainn/manageiq,mkanoor/manageiq,juliancheal/manageiq,billfitzgerald0120/manageiq,andyvesel/manageiq,romaintb/manageiq,ilackarms/manageiq,borod108/manageiq,d-m-u/manageiq,kbrock/manageiq,gerikis/manageiq,tinaafitz/manageiq,matobet/manageiq,hstastna/manageiq,syncrou/manageiq,d-m-u/manageiq,jameswnl/manageiq,branic/manageiq,andyvesel/manageiq,branic/manageiq,aufi/manageiq,fbladilo/manageiq,skateman/manageiq,mresti/manageiq,romanblanco/manageiq,jntullo/manageiq,juliancheal/manageiq,mzazrivec/manageiq,syncrou/manageiq,agrare/manageiq,borod108/manageiq,josejulio/manageiq,jrafanie/manageiq,jntullo/manageiq,kbrock/manageiq,josejulio/manageiq,josejulio/manageiq,branic/manageiq,jrafanie/manageiq,borod108/manageiq,fbladilo/manageiq,tinaafitz/manageiq,chessbyte/manageiq,mkanoor/manageiq,chessbyte/manageiq,jvlcek/manageiq,NaNi-Z/manageiq,romaintb/manageiq,billfitzgerald0120/manageiq,ailisp/manageiq,ManageIQ/manageiq,aufi/manageiq,israel-hdez/manageiq,jameswnl/manageiq,romanblanco/manageiq,gmcculloug/manageiq | ruby | ## Code Before:
class Notification < ApplicationRecord
belongs_to :notification_type
belongs_to :initiator, :class_name => User, :foreign_key => 'user_id'
belongs_to :subject, :polymorphic => true
belongs_to :cause, :polymorphic => true
has_many :notification_recipients, :dependent => :delete_all
has_many :recipients, :class_name => User, :through => :notification_recipients, :source => :user
accepts_nested_attributes_for :notification_recipients
before_create :set_notification_recipients
def type=(typ)
self.notification_type = NotificationType.find_by_name!(typ)
end
def to_h
{
:level => notification_type.level,
:created_at => created_at,
:text => notification_type.message,
:bindings => text_bindings
}
end
private
def set_notification_recipients
subscribers = notification_type.subscriber_ids(subject, initiator)
self.notification_recipients_attributes = subscribers.collect { |id| {:user_id => id } }
end
def text_bindings
h = {}
h[:initiator] = { :text => initiator.name } if initiator
h[:subject] = { :text => subject.name } if subject
h[:cause] = { :text => cause.name } if cause
h
end
end
## Instruction:
Use loop to avoid code repetition
## Code After:
class Notification < ApplicationRecord
belongs_to :notification_type
belongs_to :initiator, :class_name => User, :foreign_key => 'user_id'
belongs_to :subject, :polymorphic => true
belongs_to :cause, :polymorphic => true
has_many :notification_recipients, :dependent => :delete_all
has_many :recipients, :class_name => User, :through => :notification_recipients, :source => :user
accepts_nested_attributes_for :notification_recipients
before_create :set_notification_recipients
def type=(typ)
self.notification_type = NotificationType.find_by_name!(typ)
end
def to_h
{
:level => notification_type.level,
:created_at => created_at,
:text => notification_type.message,
:bindings => text_bindings
}
end
private
def set_notification_recipients
subscribers = notification_type.subscriber_ids(subject, initiator)
self.notification_recipients_attributes = subscribers.collect { |id| {:user_id => id } }
end
def text_bindings
[:initiator, :subject, :cause].each_with_object({}) do |key, result|
value = public_send(key)
result[key] = { :text => value.name } if value
end
end
end
| class Notification < ApplicationRecord
belongs_to :notification_type
belongs_to :initiator, :class_name => User, :foreign_key => 'user_id'
belongs_to :subject, :polymorphic => true
belongs_to :cause, :polymorphic => true
has_many :notification_recipients, :dependent => :delete_all
has_many :recipients, :class_name => User, :through => :notification_recipients, :source => :user
accepts_nested_attributes_for :notification_recipients
before_create :set_notification_recipients
def type=(typ)
self.notification_type = NotificationType.find_by_name!(typ)
end
def to_h
{
:level => notification_type.level,
:created_at => created_at,
:text => notification_type.message,
:bindings => text_bindings
}
end
private
def set_notification_recipients
subscribers = notification_type.subscriber_ids(subject, initiator)
self.notification_recipients_attributes = subscribers.collect { |id| {:user_id => id } }
end
def text_bindings
+ [:initiator, :subject, :cause].each_with_object({}) do |key, result|
+ value = public_send(key)
- h = {}
- h[:initiator] = { :text => initiator.name } if initiator
- h[:subject] = { :text => subject.name } if subject
- h[:cause] = { :text => cause.name } if cause
? ^ ^^^^^ ^ - ^ -
+ result[key] = { :text => value.name } if value
? ^^^^^^^^ ^ + ^ + ^ +
- h
+ end
end
end | 9 | 0.230769 | 4 | 5 |
38b4af0b3c1c6105d68ff453d86107758ef9d751 | preconditions.py | preconditions.py | class PreconditionError (TypeError):
pass
def preconditions(*precs):
def decorate(f):
def g(*a, **kw):
return f(*a, **kw)
return g
return decorate
| import inspect
class PreconditionError (TypeError):
pass
def preconditions(*precs):
precinfo = []
for p in precs:
spec = inspect.getargspec(p)
if spec.varargs or spec.keywords:
raise PreconditionError(
'Precondition {!r} must not accept * nor ** args.'.format(p))
i = -len(spec.defaults)
appargs, closureargs = spec.args[:i], spec.args[i:]
precinfo.append( (appargs, closureargs, p) )
def decorate(f):
def g(*a, **kw):
return f(*a, **kw)
return g
return decorate
| Implement two of the "early" InvalidPreconditionTests which can be checked prior to seeing the wrapping function. | Implement two of the "early" InvalidPreconditionTests which can be checked prior to seeing the wrapping function.
| Python | mit | nejucomo/preconditions | python | ## Code Before:
class PreconditionError (TypeError):
pass
def preconditions(*precs):
def decorate(f):
def g(*a, **kw):
return f(*a, **kw)
return g
return decorate
## Instruction:
Implement two of the "early" InvalidPreconditionTests which can be checked prior to seeing the wrapping function.
## Code After:
import inspect
class PreconditionError (TypeError):
pass
def preconditions(*precs):
precinfo = []
for p in precs:
spec = inspect.getargspec(p)
if spec.varargs or spec.keywords:
raise PreconditionError(
'Precondition {!r} must not accept * nor ** args.'.format(p))
i = -len(spec.defaults)
appargs, closureargs = spec.args[:i], spec.args[i:]
precinfo.append( (appargs, closureargs, p) )
def decorate(f):
def g(*a, **kw):
return f(*a, **kw)
return g
return decorate
| + import inspect
+
+
class PreconditionError (TypeError):
pass
def preconditions(*precs):
+
+ precinfo = []
+ for p in precs:
+ spec = inspect.getargspec(p)
+ if spec.varargs or spec.keywords:
+ raise PreconditionError(
+ 'Precondition {!r} must not accept * nor ** args.'.format(p))
+
+ i = -len(spec.defaults)
+ appargs, closureargs = spec.args[:i], spec.args[i:]
+ precinfo.append( (appargs, closureargs, p) )
+
def decorate(f):
def g(*a, **kw):
return f(*a, **kw)
return g
return decorate | 15 | 1.5 | 15 | 0 |
21b9dcd518871088086943f95bf39f068b30691f | docs/sources/commandline/command/run.rst | docs/sources/commandline/command/run.rst | ===========================================
``run`` -- Run a command in a new container
===========================================
::
Usage: docker run [OPTIONS] IMAGE COMMAND [ARG...]
Run a command in a new container
-a=map[]: Attach to stdin, stdout or stderr.
-d=false: Detached mode: leave the container running in the background
-e=[]: Set environment variables
-h="": Container host name
-i=false: Keep stdin open even if not attached
-m=0: Memory limit (in bytes)
-p=[]: Map a network port to the container
-t=false: Allocate a pseudo-tty
-u="": Username or UID
| ===========================================
``run`` -- Run a command in a new container
===========================================
::
Usage: docker run [OPTIONS] IMAGE COMMAND [ARG...]
Run a command in a new container
-a=map[]: Attach to stdin, stdout or stderr.
-d=false: Detached mode: leave the container running in the background
-e=[]: Set environment variables
-h="": Container host name
-i=false: Keep stdin open even if not attached
-m=0: Memory limit (in bytes)
-p=[]: Map a network port to the container
-t=false: Allocate a pseudo-tty
-u="": Username or UID
-d=[]: Set custom dns servers for the container
-v=[]: Creates a new volumes and mount it at the specified path. A container ID can be passed instead of a path in order to mount all volumes from the given container.
| Update docs for Command Run | Update docs for Command Run
| reStructuredText | apache-2.0 | aboch/docker,aditirajagopal/docker,xiaods/docker,gjaskiewicz/moby,LaynePeng/docker,sheavner/docker,coreos/docker,sallyom/docker,liu-rui/docker,geekylucas/docker,tomzhang/docker,hvnsweeting/docker,yuchangchun1/docker,troy0820/docker.github.io,LoeAple/docker,justincormack/docker,heartlock/docker,alekhas/docker,chiting/docker,Ajunboys/docker,supasate/docker,mgood/docker,maaquib/docker,tuxknight/docker,duglin/docker,itsnuwan/docker,justsml/docker,erikh/docker,krishnasrinivas/docker,hristozov/docker,myPublicGit/docker,scapewang/docker,xiekeyang/docker,AdamOssenford/docker-pi,fcrisciani/docker,stainboy/docker,Altiscale/docker,vyshaliOrg/docker,ecnahc515/docker,docker-zh/docker.github.io,ngorskig/docker,wtschreiter/docker,olleolleolle/docker,thaJeztah/docker.github.io,doodyparizada/docker,sfsmithcha/docker,johnstep/moby-moby,veggiemonk/docker,mruse/docker,vyshaliOrg/docker,ntrvic/docker,LaynePeng/docker,portworx/docker,Samurais/docker,kostickm/docker,chatenilesh/docker,gs11/docker,1dot75cm/docker,OrenKishon/docker,mike1729/docker,armbuild/docker,wagzhi/docker,ponsfrilus/docker,edx/docker,vdemeester/docker,askb/docker,tangkun75/docker,fangyuan930917/docker,jc-m/docker-medallia,prertik/docker,haveatry/docker,jwuwork/docker,NIWAHideyuki/docker,kdomanski/docker,paulczar/docker,Jimmy-Xu/hypercli,rhardih/docker,v47/docker,wangcan2014/docker,msabansal/docker,YuanZhewei/docker,nawawi/docker,arun-gupta/docker,wcwxyz/docker,pugnascotia/docker,dbonev/docker,summershrimp/docker,susan51531/docker,draghuram/docker,hristozov/docker,yoanisgil/docker,kojiromike/docker,leroy-chen/docker,kimh/docker,MarginC/docker,diogomonica/docker,bearstech/moby,nicolasmiller/docker,selvik/docker,imikushin/docker,cjlesiw/docker,basvdlei/docker,klshxsh/docker,alibaba/docker,dangwy/docker,sean-jc/docker,toli/docker,304471720/docker,ideaar/docker,yasiramin10p/moby,Morsicus/docker,crosbymichael/docker,hemanthkumarsa13/test,zelahi/docker,errodr/docker,solanolabs/docker,mtesselH/docker,jvanz/docker,srust/docker,YuPengZTE/docker,rickcuri/docker,adouang/docker,hbdrawn/docker,kiranmeduri/docker,peterlei/docker,bkeyoumarsi/docker,gunjan5/docker,tiw/docker,yuchangchun1/docker,iaintshine/docker,boite/docker,docker/docker.github.io,vincentwoo/docker,samuelkarp/docker,thieman/docker,ch3lo/docker,icaroseara/docker,linjk/docker,hallyn/docker,tomzhang/docker,circleci/docker,nghiant2710/docker,ferbe/docker,gaowenbin/docker,timwraight/docker,docteurklein/docker,dyema/docker,josemonsalve2/docker,achanda/docker,krishnasrinivas/docker,FollowMyDev/docker,gluwaile/docker,anshulr/docker,fangyuan930917/docker,dsheets/moby,darrenstahlmsft/moby,dave-tucker/docker,sterchelen/docker,tklauser/docker,raja-sami-10p/moby,wrouesnel/docker,euank/docker,xiaods/docker,Morgy93/docker,mtanlee/docker,duglin/docker,mkumatag/docker,justanshulsharma/docker,kingland/docker,basvdlei/docker,SFDMumbaiDockerHackathon/docker,endophage/docker,dbonev/docker,rajdeepd/docker,j-stew/git_sandbox,supasate/docker,LuisBosquez/docker.github.io,contiv/docker,HuKeping/docker,anweiss/docker.github.io,hvnsweeting/docker,mbanikazemi/docker,jacobxk/docker,shliujing/docker,gdi2290/docker,alibaba/docker,ydhydhjanson/docker,mchasal/docker,orih/docker,nickandrew/docker,youprofit/docker,paralin/docker,mahak/docker,seanmcdaniel/docker,dccurtis/docker,cnaize/docker,pragyasardana/Docker-cr-combined,Shopify/docker,hemanthkumarsa13/test,bobrik/docker,rhatdan/docker,klshxsh/docker,ottok/docker,chenchun/docker,PatrickLang/moby,zelahi/docker,hypriot/docker,ferbe/docker,s7v7nislands/docker,medallia/docker,mountkin/docker,timwraight/docker,aaronlehmann/docker,micahyoung/docker-archlinuxarm,inversion/docker,lyft/docker,alanmpitts/docker,balajibr/docker,xyliuke/docker,pgmcd/docker,gdevillele/docker.github.io,paralin/docker,mnuessler/docker,lifeeth/docker-arm,ggerman/docker,nghiant2710/test-docker,hvnsweeting/docker,huxingbang/docker,Ramzec/docker,mgood/docker,asridharan/docker,ygravrand/docker,Tenk42/docker,dsau/docker,zhangg/docker,KimTaehee/docker,aditirajagopal/docker,Ninir/docker,diogomonica/docker,Aegeaner/docker,devx/docker,linjk/docker,pwaller/docker,Shopify/docker,sergeyevstifeev/docker,shin-/docker.github.io,jagdeesh109/docker,docteurklein/docker,stefanschneider/docker,jimmyyan/docker,izarov/docker,darrenstahlmsft/docker,JeffBellegarde/docker,jrslv/docker,jzwlqx/denverdino.github.io,yuanzougaofei/docker,sunyuan3/docker,YHM07/docker,ankushagarwal/docker,wrouesnel/docker,catinthesky/docker,AkihiroSuda/docker,xiekeyang/docker,xiaojingchen/docker,wangcan2014/docker,gbarboza/docker,boite/docker,susan51531/docker,mavenugo/docker,sharifmamun/docker,dashengSun/docker,AtwoodCSB/Docker,michael-holzheu/docker,alena1108/docker,gunjan5/docker,tt/docker,j-bennet/docker,twaugh/docker,ktraghavendra/docker,ffoysal/docker,ibuildthecloud/docker,charleszheng44/moby,Chhunlong/docker,aneshas/docker,sharmasushant/docker,rhatdan/docker,asbjornenge/docker,swasd/baleno,madhanrm/docker,mikedanese/docker,willmtemple/docker,lauly/dr,qilong0/docker,makinacorpus/docker,femibyte/docker,mixja/docker,tophj-ibm/moby,sdurrheimer/docker,ripcurld0/moby,gospo/docker,jrjang/docker,304471720/docker,menglingwei/denverdino.github.io,rghv/docker,majst01/docker,ffoysal/docker,mc2014/docker,mauidev/docker,wenchma/docker,bbox-kula/docker,tophj-ibm/moby,sharidas/docker,sanimej/docker,anshulr/docker,yes-txh/docker,tsuna/docker,nickandrew/docker,jameszhan/docker,devmeyster/docker,mpatlasov/docker,Microsoft/docker,mheon/docker,iskradelta/docker,lifeeth/docker-arm,tbronchain/docker-1,huxingbang/docker,gzjim/docker,phiroict/docker,BWITS/docker,bq-xiao/docker,Ninir/docker,raharsha/docker,whuwxl/docker,ecnahc515/docker,l0rd/docker,vikstrous/docker,jhorwit2/docker,xnox/docker,micahyoung/docker-archlinuxarm,sanscontext/docker.github.io,mimoralea/docker,fmoliveira/docker,naveed-jamil-tenpearls/moby,mgireesh05/docker,sc4599/docker,ailispaw/docker,ZenikaOuest/docker,NERSC/docker,wcwxyz/docker,michelvocks/docker,abudulemusa/docker,jrslv/docker,luxas/docker,rabbitcount/docker,alex/docker,xiaozi0lei/docker,nicolasmiller/docker,xiaozi0lei/docker,BenHall/docker,vdemeester/docker,foobar2github/docker,thaJeztah/docker,ottok/docker,crquan/docker,kerneltime/docker,dongjiaqiang/docker,mimoralea/docker,ai-traders/docker,joaofnfernandes/docker.github.io,shaded-enmity/docker,abudulemusa/docker,endocode/docker,nalind/docker,BSWANG/denverdino.github.io,divya88ssn/docker,rillig/docker.github.io,sergeyevstifeev/docker,Shinzu/docker,dnephin/docker,mariusGundersen/docker,ClusterHQ/docker,ktraghavendra/docker,sheavner/docker,geekylucas/docker,shenxiaochen/docker,rootfs/docker,ajaymdesai/docker,newrelic-forks/docker,balajibr/docker,DarknessBeforeDawn/docker,tonymwinters/docker,errodr/docker,wesseljt/docker,projectatomic/docker,mohmost12/docker,yuanzougaofei/docker,maxamillion/docker,rsmoorthy/docker-1,eskaaren/docker,opreaadrian/docker,gospo/docker,jecarey/docker,brahmaroutu/docker,dit4c/docker,londoncalling/docker.github.io,lloydde/docker,yosifkit/docker,charleswhchan/docker,abudulemusa/docker,runcom/docker,smw/docker,jpetazzo/docker,duguhaotian/docker,lbthomsen/docker,pramodhkp/moby,docker/docker,terminalcloud/docker,1uptalent/docker,jamesodhunt/docker,cvallance/docker,unclejack/docker,ydhydhjanson/docker,jssnlw/docker,xuxinkun/docker,afein/docker,wdxxs2z/docker,amatsus/docker,vincentbernat/docker,gzjim/docker,cr7pt0gr4ph7/docker,himanshu0503/docker,0xfoo/docker,harche/docker,nf/docker,sequenceiq/docker,resin-io/docker,sanketsaurav/docker,deliangyang/docker,mc2014/docker,devx/docker,rghv/docker,porjo/docker,YujiOshima/docker,vmware/docker,dyema/docker,itsNikolay/docker,djs55/docker,roxyboy/docker,spinolacastro/docker,kolyshkin/moby,BWITS/docker,mahak/docker,stannie42/docker,michaelhuettermann/docker,vanpire110/docker,ajneu/docker,bonczj/moby-json-file-logger,liu-rui/docker,lsm5/docker,omni360/docker,mhrivnak/docker,tt/docker,insequent/docker,nghiant2710/docker,mikebrow/docker,clearlinux/docker,twosigma/docker-old,gnawux/docker,metalivedev/dockerclone,pmorie/docker,spinolacastro/docker,bpradipt/docker,crquan/docker,James0tang/docker,raja-sami-10p/moby,RepmujNetsik/docker,brianfoshee/docker,youprofit/docker,hariharan16s/docker_vlan,l0rd/docker,jacobxk/docker,stefanberger/docker,ABaldwinHunter/docker,afein/docker,v47/docker,pdevine/docker,rentongzhang/docker,foobar2github/docker,imkin/moby,matrix-stone/docker,icaroseara/docker,icaoweiwei/docker,Gobella/docker,gnailuy/docker,pradipd/moby,dongjoon-hyun/docker,ZenikaOuest/docker,abhinavdahiya/docker,hypriot/docker,jameszhan/docker,olleolleolle/docker,vegasbrianc/docker,gospo/docker,leroy-chen/docker,adusia/docker,tbonza/docker,liaoqingwei/docker,amatsus/docker,teotihuacanada/docker,shishir-a412ed/docker,alex-aizman/docker,ken-saka/docker,shubheksha/docker.github.io,mieciu/docker,unclejack/docker,rsampaio/docker,SvenDowideit/docker,l0rd/docker,mathewkoshy493/docker,ibuildthecloud/docker,aarondav/docker,aduermael/docker.github.io,ycaihua/docker,docker-zh/docker.github.io,stormltf/docker,aneshas/docker,buddhamagnet/docker,iaintshine/docker,sirxun/docker,maximkulkin/docker,tomzhang/docker,marineam/docker,nguyentm83/docker,selvik/docker,nghiant2710/test-docker,veggiemonk/docker,lifeeth/docker-arm,StevenLudwig/docker,anthonydahanne/docker,jingjidejuren/docker,minidoll/docker,rkazak/docker,tkopczynski/docker,justyntemme/docker,phiroict/docker,raharsha/docker,ktraghavendra/docker,sunxiang0918/docker,sharidas/docker,outcoldman/docker,chenrui2014/docker,ctrombley/docker,giorrrgio/docker,sidharthgoel/docker,lixiaobing1/docker,sdurrheimer/docker,jengeb/docker,danyalKhaliq10p/moby,jzwlqx/denverdino.github.io,BrianHicks/docker,x1022as/docker,swasd/baleno,hqhq/moby,shhsu/docker,ashahab-altiscale/docker,torfuzx/docker,gorcz/docker,j-mracek/docker,cpuguy83/docker,wulonghui/docker,docker-zh/docker.github.io,aishraj/docker,chatenilesh/docker,bonczj/moby-json-file-logger,sean-jc/docker,azurezk/docker,BWITS/docker,sheimi/docker,flavio/docker,aduermael/docker.github.io,bdwill/docker.github.io,mieciu/docker,goodwinos/docker,yoshiotu/docker,robhaswell/docker,josegonzalez/docker,stevvooe/docker,jwuwork/docker,denverdino/denverdino.github.io,ChanderG/docker,moypray/docker,zhangjianfnst/docker,noironetworks/docker,pgmcd/docker,anhzhi/docker,contiv/docker,deletoe/docker,cnbin/docker,alexisbellido/docker.github.io,Collinux/docker,SophiaGitHub/newGitHub,matthewvalimaki/docker,catinthesky/docker,bru7us/docker,springning/docker,sunxiang0918/docker,mikedougherty/docker,JohnyDays/docker,bq-xiao/docker,tutumcloud/docker,hacfi/docker,cpuguy83/docker,manoj0077/docker,SFDMumbaiDockerHackathon/docker,ailispaw/docker,OrenKishon/docker,LoeAple/docker,draghuram/docker,lsm5/docker,nawawi/docker,Test-Betta-Inc/psychic-barnacle,kimh/docker,srevereault/docker,gs11/docker,Ramzec/docker,scollier/docker,dezon/docker,estesp/docker,zhaoshengbo/docker,moxiegirl/docker,alex/docker,wangcy6/docker,sivabizruntime/dockerfile,slok/docker,bkeyoumarsi/docker,abiosoft/docker,moul/docker,webwurst/docker,andyxator/docker,akira-baruah/docker,lioryanko/docker,q384566678/docker,shishir-a412ed/docker,raychaser/docker,himanshu0503/docker,devmeyster/docker,KingEmet/docker,SvenDowideit/docker,ClusterHQ/docker-plugins,alexisbellido/docker.github.io,adusia/docker,anchal-agrawal/docker,SFDMumbaiDockerHackathon/docker,shubheksha/docker.github.io,originye/docker,wackyapples/docker,rickcuri/docker,hemanthkumarsa13/test,kirankbs/docker,coolljt0725/docker,lordzero0000/docker,brianfoshee/docker,MarginC/docker,matthiasr/docker,dinhxuanvu/docker,carolfh/docker,docker-zh/docker.github.io,noqcks/docker,kblin/docker-debian,nf/docker,jengeb/docker,dave-tucker/docker,labkode/docker,johnstep/docker.github.io,skatsuta/docker,lukaszraczylo/docker,sergeyevstifeev/docker,stainboy/docker,1dot75cm/docker,solganik/docker,shhsu/docker,djs55/docker,sidzan/docker,alekhas/docker,sidzan/docker,jlebon/docker,manchoz/docker,heartlock/docker,micahyoung/docker-archlinuxarm,gao-feng/docker,chrismckinnel/docker,JeffBellegarde/docker,janghwan/docker,opreaadrian/docker,dwcramer/docker,DoraALin/docker,toophy/docker,mj340522/docker,alex-aizman/docker,calavera/docker,sanimej/docker,dnascimento/docker,alfred-landrum/docker,unodba/docker-1,giorrrgio/docker,nakuljavali/docker,binario200/docker,boucher/docker,rentongzhang/docker,arneluehrs/docker,burakcakirel/docker,dmizelle/docker,DarknessBeforeDawn/docker,fmoliveira/docker,anhzhi/docker,mountkin/docker,hewei10/docker,menglingwei/denverdino.github.io,mattrobenolt/docker,twistlock/docker,ethernetdan/docker,marimokkori/docker,jimjag/docker,cloudflare/docker,rsampaio/docker,ckeyer/docker,yuanzougaofei/docker,jlebon/docker,gabrielhartmann/docker,euank/docker,Zenithar/docker,dezon/docker,BrianBland/docker,kkirsche/docker,Evalle/docker,yang1992/docker,seblu/docker,4is2cbetter/docker,mtrmac/docker,chiting/docker,jpetazzo/docker,BrianBland/docker,devmeyster/docker,mrjana/docker,justone/docker,circleci/docker,wenchma/docker,maximkulkin/docker,jagdeesh109/docker,ZJU-SEL/docker,moul/docker,lmesz/docker,tagomoris/docker,rremer/moby,dianping/docker,ColinHebert/docker,coreos/docker,BrianBland/docker,sharmasushant/docker,VishvajitP/docker,ChanderG/docker,euank/docker,dgageot/docker,fcrisciani/docker,BrianHicks/docker,vishh/docker,d23/docker,devx/docker,cvallance/docker,markprokoudine/docker,OnePaaS/docker,hustcat/docker,shuhuai007/docker,docker-zh/docker.github.io,umerazad/docker,fsoppelsa/docker,airandfingers/docker,MaxCy330/docker,ivansaracino/docker,ndeloof/docker,mssola/docker,songinfo/docker,rocknrollMarc/docker,KarthikNayak/docker,jlhawn/docker,ideaar/docker,armbuild/docker,liaoqingwei/docker,medallia/docker,mavenugo/docker,mikebrow/docker,kblin/docker,erikh/docker,azweb76/docker,liaoqingwei/docker,cjlesiw/docker,laijs/docker,ncdc/docker,cmehay/docker-1,umerazad/docker,majst01/docker,Microsoft/docker,qzio/docker,CrazyJvm/docker,rogaha/docker,nigelpoulton/docker,skatsuta/docker,keyan/docker,pramodhkp/moby,HackToday/docker,alekhas/docker,vijaykilari/docker,clearlinux/docker,shin-/docker.github.io,zmarouf/docker,andrewnguyen/docker,ethernetdan/docker,shin-/docker.github.io,LuisBosquez/docker.github.io,nakuljavali/docker,selvik/docker,xiekeyang/docker,jonahzheng/docker,WPH95/docker,mnuessler/docker,docker/docker.github.io,clintonskitson/docker,circleci/docker,reem/docker,JimGalasyn/docker.github.io,nathanleclaire/docker,VishvajitP/docker,pwaller/docker,gmanfunky/docker,sequenceiq/docker,aidanhs/docker,xuxinkun/docker,andersjanmyr/docker,robort/docker,mstanleyjones/docker,LaynePeng/docker,raharsha/docker,dmcgowan/docker,noqcks/docker,cstroe/docker,alena1108/docker,cjlesiw/docker,MaxCy330/docker,yp-engineering/docker,noqcks/docker,doodyparizada/docker,fangyuan930917/docker,errordeveloper/docker,NERSC/docker,dperny/docker,johnstep/docker.github.io,hustcat/docker,ripcurld0/moby,cyli/docker,mbanikazemi/docker,RepmujNetsik/docker,dianping/docker,jamesmarva/docker,anortef/docker,dsau/docker,rajurs/docker,glycerine/docker,icecrime/docker,xiaoshaozi52/docker,KumaranKamalanathan/docker,docker/docker.github.io,scapewang/docker,anoshf/docker,yoanisgil/docker,aboch/docker,renrujue/docker,OnePaaS/docker,sharifmamun/docker,Distrotech/docker,zhouxiaoxiaoxujian/docker,alexisbellido/docker.github.io,jonahzheng/docker,devonharvey/docker,sfsmithcha/docker,sreejithr/docker,cwandrews/docker,campoy/docker,rvesse/docker,dccurtis/docker,ai-traders/docker,josegonzalez/docker,vbatts/docker,kyle-wang/docker,wescravens/docker,sunyuan3/docker,AnselZhangGit/docker,jonathan-beard/docker,danix800/docker.github.io,willmtemple/docker,miminar/docker,pragyasardana/Docker-cr-combined,ycaihua/docker,VincentYu/docker,andrewnguyen/docker,NOX73/docker,cnbin/docker,Lanzafame/docker,labkode/docker,londoncalling/docker.github.io,deliangyang/docker,AtwoodCSB/Docker,LuisBosquez/docker.github.io,mathewkoshy493/docker,hallyn/docker,squaremo/docker,alexisbellido/docker.github.io,marineam/docker,caofangkun/docker-docker,alex/docker,Yhgenomics/docker,sequenceiq/docker,srust/docker,rwincewicz/docker,dave-tucker/docker,Akasurde/docker,majst01/docker,roxyboy/docker,Morgy93/docker,jamesodhunt/docker,mpatlasov/docker,cezarsa/docker,rhatdan/storage,outcoldman/docker,izarov/docker,anusha-ragunathan/docker,wzzrd/docker,xiaoshaozi52/docker,cyli/docker,jamesmarva/docker,justsml/docker,gnawux/docker,kvchampa/Docker,KarthikNayak/docker,haugene/docker,s7v7nislands/docker,dinhxuanvu/docker,renrujue/docker,bertyuan/docker,MabinGo/docker,porjo/docker,beealone/docker,joaofnfernandes/docker.github.io,WPH95/docker,pmalmgren/docker,DDCCOE/docker,LoeAple/docker,qudongfang/docker,eskaaren/docker,carlosvquezada/docker,j-bennet/docker,anoshf/docker,phiroict/docker,gluwaile/docker,tianon/docker,ideaar/docker,Syntaxide/docker,jthelin/docker,crquan/docker,webwurst/docker,docker/docker.github.io,kblin/docker-debian,springning/docker,Mokolea/docker,1HLtd/docker,gaobrian/docker,Shinzu/docker,xyliuke/docker,RepmujNetsik/docker,maxwell92/docker,edx/docker,nigelpoulton/docker,cjlesiw/docker,azweb76/docker,ZJU-SEL/docker,Mashimiao/docker,burakcakirel/docker,bru7us/docker,booyaa/docker,sharidas/docker,Gemini-Cain/docker,justsml/docker,caofangkun/docker-docker,zaxbbun/docker,prertik/docker,James0tang/docker,ivansaracino/docker,alfred-landrum/docker,zhuohual/docker,mapuri/docker,ypid/docker,chrisseto/docker,E312232595/docker,kvasdopil/docker,cyphar/docker,imkin/moby,Mashimiao/docker,jrjang/docker,dgageot/docker,samsabed/docker,xiaojingchen/docker,akira-baruah/docker,janghwan/docker,mgoelzer/docker,HideoYamauchi/docker,mike1729/docker,gigidwan/docker,arun-gupta/docker,torfuzx/docker,johnstep/docker.github.io,xuxinkun/docker,YanFeng-Adam/docker,nghiant2710/test-docker,thaJeztah/docker,devonharvey/docker,newrelic-forks/docker,ashahab-altiscale/docker,toolchainX/docker,micahyoung/docker-archlinuxarm,ngorskig/docker,LuisBosquez/docker.github.io,Syntaxide/docker,paulczar/docker,bluebreezecf/docker,yasker/docker,jefby/docker,kenken0926/docker,konstruktoid/docker-1,NERSC/docker,yasiramin10p/moby,xyliuke/docker,joaofnfernandes/docker.github.io,YanFeng-Adam/docker,awanke/docker,jimmyyan/docker,jimjag/docker,jwuwork/docker,mrjana/docker,Carrotzpc/docker,bru7us/docker,pyotr777/docker,Ajunboys/docker,metalivedev/dockerclone,paulczar/docker,naveed-jamil-tenpearls/moby,ClusterHQ/docker,minidoll/docker,YuanZhewei/docker,spf13/docker,rwincewicz/docker,samsabed/docker,laijs/moby,mtesselH/docker,Ajunboys/docker,kawamuray/docker,morninj/docker,HackToday/docker,unclejack/docker,LoeAple/docker,anweiss/docker.github.io,chiting/docker,Carrotzpc/docker,pradipd/moby,NERSC/docker,jmtd/docker,ckeyer/docker,Altiscale/docker,kolyshkin/moby,chrismckinnel/docker,josemonsalve2/docker,mixja/docker,zoomis/docker,jwhonce/docker,unodba/docker-1,kirankbs/docker,wlan0/docker,kiranmeduri/docker,yongtang/docker,projectatomic/docker,gigidwan/docker,carlanton/docker,AlligatorSinensis/docker,NathanMcCauley/docker,tangkun75/docker,rhatdan/storage,alex-aizman/docker,mudverma/docker,amatsus/docker,caofangkun/docker-docker,hewei10/docker,q384566678/docker,miminar/docker,icecrime/docker,ncdc/docker,tuxknight/docker,endocode/docker,jpetazzo/docker,Ye-Yong-Chi/docker,AtwoodCSB/Docker,Gemini-Cain/docker,carlye566/docker_eric,crquan/docker,yyljlyy/docker,cflannagan/docker,jloehel/docker,Chhunlong/docker,ItsVeryWindy/docker,ygravrand/docker,kickinz1/docker,dharmit/docker,nguyentm83/docker,gschaetz/moby,jzwlqx/denverdino.github.io,sirxun/docker,snailwalker/docker,vlajos/docker,rhatdan/docker,estesp/docker,moul/docker,vmware/docker,ottok/docker,nalind/docker,mieciu/docker,lloydde/docker,wenchma/docker,Morsicus/docker,alanmpitts/docker,TheBigBear/docker,menglingwei/denverdino.github.io,shuhuai007/docker,gnawux/docker,splunk/docker,SophiaGitHub/hello,mheon/docker,imeoer/hypercli,laijs/moby,bexelbie/docker,cr7pt0gr4ph7/docker,calavera/docker,ashahab-altiscale/docker,jloehel/docker,bearstech/moby,allencloud/docker,AkihiroSuda/docker,dmcgowan/docker,d23/docker,RichardScothern/docker,asbjornenge/docker,bfirsh/docker,whuwxl/docker,crawford/docker,rancher/docker,AkihiroSuda/docker,lbthomsen/docker,PatrickLang/moby,zaxbbun/docker,bearstech/moby,q384566678/docker,raghavtan/docker,abudulemusa/docker,waitingkuo/docker,fsoppelsa/docker,wagzhi/docker,troy0820/docker.github.io,ailispaw/docker,justyntemme/docker,dhiltgen/docker,pyotr777/docker,bdwill/docker.github.io,twistlock/docker,pyotr777/docker,tangkun75/docker,dianping/docker,zhuguihua/docker,dccurtis/docker,alex/docker,mgireesh05/docker,Lanzafame/docker,upmio/docker,bdwill/docker.github.io,gzjim/docker,medallia/docker,jonathanperret/docker,alibaba/docker,hbdrawn/docker,Kevin2030/docker,arnib/docker,bajh/docker,tpounds/docker,Morsicus/docker,chrismckinnel/docker,noironetworks/docker,prertik/docker,1yvT0s/docker,davinashreddy/docker,toolchainX/docker,SeMeKh/docker,bpradipt/docker,vijaykilari/docker,jc-m/docker-medallia,docker/docker.github.io,jongiddy/docker,srevereault/docker,yangdongsheng/docker,coolljt0725/docker,kerneltime/docker,mgood/docker,mikedanese/docker,dsau/docker,pwaller/docker,ycaihua/docker,NunoEdgarGub1/docker,vbatts/docker,ewindisch/docker,youprofit/docker,jameseggers/docker,bsmr-docker/docker,kkirsche/docker,ken-saka/docker,ethernetdan/docker,beatle/docker,lioryanko/docker,dmizelle/docker,tkopczynski/docker,kdomanski/docker,stormltf/docker,flythecircle/gotojourney,VishvajitP/docker,KarthikNayak/docker,dashengSun/docker,tsuna/docker,ken-saka/docker,kostickm/docker,cyli/docker,wrouesnel/docker,LuisBosquez/docker.github.io,RichardScothern/docker,slok/docker,cnaize/docker,sanjeo/docker,davinashreddy/docker,axsh/docker,lyft/docker,ponsfrilus/docker,robort/docker,YuPengZTE/docker,14rcole/docker,DoraALin/docker,BenHall/docker,nalind/docker,mariusGundersen/docker,mittalms/docker,rootfs/docker,bobrik/docker,fancyisbest/docker,lsm5/docker,4is2cbetter/docker,rbarlow/docker,thaJeztah/docker.github.io,vishh/docker,StevenLudwig/docker,NunoEdgarGub1/docker,ch3lo/docker,joeuo/docker.github.io,jc-m/docker,rancher/docker,euank/docker,ctmnz/docker,TheBigBear/docker,tpounds/docker,bq-xiao/docker,Lanzafame/docker,errodr/docker,carlye566/docker_eric,troy0820/docker.github.io,cc272309126/docker,pkdevbox/docker,4is2cbetter/docker,davinashreddy/docker,flavio/docker,gluwaile/docker,glennblock/docker,lauly/dr,d23/docker,bexelbie/docker,sheimi/docker,mapuri/docker,ntrvic/docker,bdwill/docker.github.io,alfred-landrum/docker,samuelkarp/docker,mittalms/docker,aishraj/docker,draghuram/docker,ycaihua/docker,hustcat/docker,achanda/docker,maxwell92/docker,charleswhchan/docker,fancyisbest/docker,moypray/docker,sanscontext/docker.github.io,ycaihua/docker,orih/docker,icecrime/docker,jingjidejuren/docker,ctmnz/docker,proppy/docker,ibuildthecloud/docker,majst01/docker,anortef/docker,kblin/docker-debian,flowlo/docker,merwok/docker,ntrvic/docker,cnaize/docker,duguhaotian/docker,rsmitty/docker,mj340522/docker,dit4c/docker,Jarema/docker,flowlo/docker,seanmcdaniel/docker,carolfh/docker,lizf-os/docker,jonathan-beard/docker,srust/docker,krisdages/docker,wtschreiter/docker,dharmit/docker,tutumcloud/docker,brianbirke/docker,NIWAHideyuki/docker,ewindisch/docker,afein/docker,jingjidejuren/docker,diogomonica/docker,kwk/docker,vishh/docker,andyxator/docker,nabeken/docker,mudverma/docker,lmesz/docker,tkopczynski/docker,phiroict/docker,michael-donat/docker,Kaffa-MY/docker,raychaser/docker,torfuzx/docker,ffoysal/docker,bogdangrigg/docker,Neverous/docker,summershrimp/docker,SophiaGitHub/newGitHub,axsh/docker,chenchun/docker,gao-feng/docker,mheon/docker,yosifkit/docker,cyphar/docker,dianping/docker,lizf-os/docker,HuKeping/docker,jloehel/docker,femibyte/docker,hemanthkumarsa13/test,nathanleclaire/docker,Gemini-Cain/docker,jpetazzo/docker,csfrancis/docker,binario200/docker,gdevillele/docker.github.io,abiosoft/docker,endocode/docker,NathanMcCauley/docker,asridharan/docker,darrenstahlmsft/docker,vmware/docker,thaJeztah/docker,menglingwei/denverdino.github.io,olleolleolle/docker,cflannagan/docker,anortef/docker,tsuna/docker,James0tang/docker,CodyGuo/docker,lizf-os/docker,mruse/docker,PatrickAuld/docker,maxamillion/docker,gmanfunky/docker,pramodhkp/moby,adusia/docker,MjAbuz/docker,toophy/docker,Jarema/docker,michael-holzheu/docker,doodyparizada/docker,robhaswell/docker,tklauser/docker,geekylucas/docker,ckeyer/docker,lioryanko/docker,Jarema/docker,endophage/docker,shot/docker,j-stew/git_sandbox,giorrrgio/docker,jongiddy/docker,rgl/docker,haveatry/docker,containers/storage,myPublicGit/docker,thomasfrancis1/docker,softprops/docker,jzwlqx/denverdino.github.io,PatrickAuld/docker,merwok/docker,AdamOssenford/docker-pi,docker/docker,SophiaGitHub/newGitHub,johnstep/docker.github.io,yyljlyy/docker,lukaszraczylo/docker,JeffBellegarde/docker,qilong0/docker,manchoz/docker,hypriot/docker,ajneu/docker,jjn2009/docker,mukgupta/docker,TrumanLing/docker,itsnuwan/docker,rhuss/docker,solanolabs/docker,sfsmithcha/docker,robhaswell/docker,kencochrane/docker,nf/docker,buddhamagnet/docker,hewei10/docker,doodyparizada/docker,yasker/docker,Test-Betta-Inc/psychic-barnacle,mc2014/docker,chrisseto/docker,vanloswang/docker,chavezom/docker,stevvooe/docker,SeMeKh/docker,stormltf/docker,Tenk42/docker,rillig/docker.github.io,ajaymdesai/docker,timwraight/docker,ecnahc515/docker,andersjanmyr/docker,balajibr/docker,veggiemonk/docker,mssola/docker,ClusterHQ/docker-plugins,webwurst/docker,anweiss/docker.github.io,charleszheng44/moby,bbox-kula/docker,resin-io/docker,CodyGuo/docker,upmio/docker,affo/docker,Mashimiao/docker,moxiegirl/docker,0xfoo/docker,beealone/docker,resin-io/docker,KingEmet/docker,mukgupta/docker,KimTaehee/docker,bajh/docker,paralin/docker,jimjag/docker,dongjiaqiang/docker,tiw/docker,yang1992/docker,gmanfunky/docker,wulonghui/docker,sivabizruntime/dockerfile,itsNikolay/docker,beni55/docker,moby/moby,nnordrum/docker,elancom/docker,ZJUshuaizhou/docker,pdevine/docker,jrjang/docker,kvchampa/Docker,samsabed/docker,remh/docker,sivabizruntime/dockerfile,flowlo/docker,hyperhq/hypercli,arun-gupta/docker,dnascimento/docker,rsampaio/docker,kickinz1/docker,sidharthgoel/docker,erikstmartin/docker,fsoppelsa/docker,portworx/docker,kyle-wang/docker,anthonydahanne/docker,gdi2290/docker,mieciu/docker,Aegeaner/docker,misterbisson/docker,arneluehrs/docker,roxyboy/docker,lixiaobing10051267/docker,axsh/docker,carlosvquezada/docker,deliangyang/docker,Collinux/docker,michelvocks/docker,sheimi/docker,kvasdopil/docker,minidoll/docker,NERSC/docker,krisdages/docker,denverdino/denverdino.github.io,dongjoon-hyun/docker,sanscontext/docker.github.io,guard163/docker,1dot75cm/docker,jjn2009/docker,ABaldwinHunter/docker,ctrombley/docker,menglingwei/denverdino.github.io,CrazyJvm/docker,rajurs/docker,josegonzalez/docker,BenHall/docker,endophage/docker,bobrik/docker,ngpestelos/docker,naveed-jamil-tenpearls/moby,mruse/docker,seblu/docker,lucasjo/docker,elancom/docker,EricPai/docker,gorcz/docker,chrisseto/docker,gs11/docker,konstruktoid/docker-upstream,splunk/docker,marineam/docker,remh/docker,icaoweiwei/docker,sheavner/docker,chenrui2014/docker,wescravens/docker,zhangjianfnst/docker,Mokolea/docker,Samurais/docker,seblu/docker,JohnyDays/docker,bleuchtang/docker,shishir-a412ed/docker,angryxlt/docker,dcbw/docker,x1022as/docker,janghwan/docker,kblin/docker,maxwell92/docker,elancom/docker,thaJeztah/docker.github.io,ivinpolosony/docker,supasate/docker,scotttlin/docker,terminalcloud/docker,kawamuray/docker,swasd/baleno,mtanlee/docker,dims/docker,lucasjo/docker,mariusGundersen/docker,Zenithar/docker,kunalkushwaha/docker,moul/docker,twaugh/docker,caofangkun/docker-docker,ggerman/docker,cpswan/docker,maaquib/docker,tonistiigi/docker,alex/docker,rickcuri/docker,denverdino/denverdino.github.io,chavezom/docker,gaowenbin/docker,tuxknight/docker,izarov/docker,liu-rui/docker,lixiaobing1/docker,jc-m/docker,boucher/docker,iaintshine/docker,docteurklein/docker,mpatlasov/docker,flythecircle/gotojourney,rohitkadam19/docker,0xfoo/docker,rentongzhang/docker,dyema/docker,slavau/docker,nnordrum/docker,nicolasmiller/docker,FollowMyDev/docker,aidanhs/docker,glennblock/docker,kostickm/docker,matrix-stone/docker,contiv/docker,bkeyoumarsi/docker,ctmnz/docker,manchoz/docker,runcom/docker,hyperhq/hypercli,qudongfang/docker,xiaojingchen/docker,KimTaehee/docker,stefanberger/docker,bsmr-docker/docker,joeuo/docker.github.io,jpopelka/docker,HideoYamauchi/docker,cpswan/docker,ch3lo/docker,reem/docker,alexisbellido/docker.github.io,MabinGo/docker,yes-txh/docker,affo/docker,originye/docker,campoy/docker,kiranmeduri/docker,gdevillele/docker.github.io,ibuildthecloud/docker,glycerine/docker,gbarboza/docker,stainboy/docker,jasonamyers/docker,johnstep/docker.github.io,pragyasardana/Docker-cr-combined,mudverma/docker,kvchampa/Docker,x1022as/docker,linjk/docker,Neverous/docker,thieman/docker,wdxxs2z/docker,LoeAple/docker,kimh/docker,slok/docker,miminar/docker,jlhawn/docker,sidharthgoel/docker,isubuz/docker,YuPengZTE/docker,jvanz/docker,gabrielhartmann/docker,awanke/docker,yongtang/docker,projectatomic/docker,mrfuxi/docker,sequenceiq/docker,SophiaGitHub/hello,eskaaren/docker,mohmost12/docker,outcoldman/docker,dims/docker,beni55/docker,thockin/docker,YujiOshima/docker,macat/docker,deletoe/docker,ivinpolosony/docker,ndeloof/docker,rohitkadam19/docker,laijs/moby,vbatts/docker,ItsVeryWindy/docker,errordeveloper/docker,304471720/docker,justincormack/docker,wtschreiter/docker,pugnascotia/docker,squaremo/docker,abiosoft/docker,lastgeniusleft2004/docker,mixja/docker,bpradipt/docker,raghavtan/docker,slavau/docker,mittalms/docker,LoHChina/docker,bobrik/docker,keyan/docker,LoHChina/docker,ChanderG/docker,micahyoung/docker-archlinuxarm,proppy/docker,zhangjianfnst/docker,pmalmgren/docker,camallen/docker,wzzrd/docker,anujbahuguna/docker,sc4599/docker,upmio/docker,roth1002/docker,erikh/docker,raja-sami-10p/moby,trebonian/docker,shot/docker,porjo/docker,runcom/docker,ggerman/docker,rogaha/docker,inversion/docker,justanshulsharma/docker,xiaods/docker,bluebreezecf/docker,oguzcanoguz/docker,LalatenduMohanty/docker,isubuz/docker,kathir2903/docker,srevereault/docker,unodba/docker-1,tmp6154/docker,wangcan2014/docker,MjAbuz/docker,SaiedKazemi/docker,BSWANG/denverdino.github.io,originye/docker,rkazak/docker,sterchelen/docker,wesseljt/docker,lixiaobing1/docker,mtesselH/docker,nakuljavali/docker,MjAbuz/docker,Microsoft/docker,orih/docker,tmp6154/docker,JMesser81/docker,msagheer/docker,mountkin/docker,jameseggers/docker,wcwxyz/docker,rillig/docker.github.io,kblin/docker,imeoer/hypercli,HackToday/docker,lastgeniusleft2004/docker,sanjeo/docker,manoj0077/docker,noxiouz/docker,1HLtd/docker,oguzcanoguz/docker,nabeken/docker,YanFeng-Adam/docker,himanshu0503/docker,sanscontext/docker.github.io,wagzhi/docker,cpuguy83/docker,darrenstahlmsft/moby,bleuchtang/docker,lifeeth/docker-arm,euank/docker,dongjiaqiang/docker,shakamunyi/docker,Ye-Yong-Chi/docker,AtwoodCSB/Docker,kojiromike/docker,justincormack/docker,yyljlyy/docker,Gobella/docker,makinacorpus/docker,mattrobenolt/docker,cezarsa/docker,aduermael/docker.github.io,mavenugo/docker,zoomis/docker,slavau/docker,franklyhuan/docker-1,franklyhuan/docker-1,splunk/docker,harche/docker,alecbenson/docker,allencloud/docker,ewindisch/docker,cstroe/docker,nnordrum/docker,ankushagarwal/docker,gorcz/docker,nabeken/docker,mbanikazemi/docker,susan51531/docker,cloudflare/docker,mathewkoshy493/docker,psquickitjayant/docker,gonkulator/docker,SaiedKazemi/docker,porjo/docker,shaded-enmity/docker,paralin/docker,omni360/docker,dmizelle/docker,yes-txh/docker,errordeveloper/docker,vishh/docker,konstruktoid/docker-upstream,psquickitjayant/docker,rsmitty/docker,hqhq/moby,vincentwoo/docker,lyndaoleary/docker,stannie42/docker,sanscontext/docker.github.io,keerthanabs1/docker,tonistiigi/docker,yasiramin10p/moby,misterbisson/docker,jvgogh/docker,NunoEdgarGub1/docker,imkin/moby,vlajos/docker,spf13/docker,rremer/moby,Ramzec/docker,clintonskitson/docker,Yhgenomics/docker,uestcfyl/docker,luxas/docker,azweb76/docker,chenchun/docker,thaJeztah/docker.github.io,insequent/docker,danix800/docker.github.io,HuKeping/docker,kunalkushwaha/docker,AdamOssenford/docker-pi,klshxsh/docker,sallyom/docker,kblin/docker-debian,rbarlow/docker,bearstech/moby,medallia/docker,femibyte/docker,anujbahuguna/docker,mrfuxi/docker,gschaetz/moby,stefanschneider/docker,proppy/docker,justone/docker,yosifkit/docker,jengeb/docker,ferbe/docker,Ramzec/docker,kblin/docker,lyndaoleary/docker,thockin/docker,Kevin2030/docker,sarnautov/moby,izaakschroeder/docker,rootfs/docker,wescravens/docker,ksasi/docker,madhanrm/docker,caofangkun/docker-docker,bleuchtang/docker,joeuo/docker.github.io,iskradelta/docker,dnephin/docker,NOX73/docker,hacfi/docker,achanda/docker,rickyzhang82/docker,vyshaliOrg/docker,rsmoorthy/docker-1,awanke/docker,zmarouf/docker,sevki/docker,solganik/docker,uestcfyl/docker,stannie42/docker,rbarlow/docker,clearlinux/docker,kickinz1/docker,crosbymichael/docker,tombee/docker,teotihuacanada/docker,tonymwinters/docker,vegasbrianc/docker,jpetazzo/docker,EricPai/docker,thomasfrancis1/docker,matrix-stone/docker,kojiromike/docker,shliujing/docker,shin-/docker.github.io,twaugh/docker,kyle-wang/docker,marimokkori/docker,ashahab-altiscale/docker,TrumanLing/docker,tophj-ibm/moby,anweiss/docker.github.io,aidanhs/docker,jwhonce/docker,jwhonce/docker,ivinpolosony/docker,mkumatag/docker,zhaoshengbo/docker,laijs/docker,nicholaskh/docker,tagomoris/docker,markprokoudine/docker,shliujing/docker,tophj-ibm/docker,lloydde/docker,mieciu/docker,rajdeepd/docker,metalivedev/dockerclone,dsheets/moby,lordzero0000/docker,Kevin2030/docker,inatatsu/docker,rwincewicz/docker,denverdino/docker.github.io,cwandrews/docker,YHM07/docker,vishh/docker,portworx/docker_v1.9.0,MaxCy330/docker,trebonian/docker,moxiegirl/docker,pecameron/docker,webwurst/docker,dsheets/moby,OnePaaS/docker,edx/docker,opreaadrian/docker,mnuessler/docker,gcuisinier/docker,mtrmac/docker,heartlock/docker,Mokolea/docker,charleswhchan/docker,kenken0926/docker,mgoelzer/docker,VincentYu/docker,coolljt0725/docker,vikstrous/docker,alecbenson/docker,calavera/docker,vdemeester/docker,charleszheng44/moby,ashahab-altiscale/docker,tonymwinters/docker,zaxbbun/docker,MarginC/docker,rogaha/docker,dangwy/docker,Gobella/docker,msabansal/docker,tiw/docker,hacpai/docker,DDCCOE/docker,ajaymdesai/docker,londoncalling/docker.github.io,gao-feng/docker,jacobxk/docker,lordzero0000/docker,NOX73/docker,kvasdopil/docker,hacpai/docker,sevki/docker,denverdino/denverdino.github.io,sidzan/docker,snailwalker/docker,OrenKishon/docker,KingEmet/docker,E312232595/docker,aaronlehmann/docker,docker/docker,kkirsche/docker,13W/docker,mchasal/docker,SvenDowideit/docker,wackyapples/docker,mikedougherty/docker,imikushin/docker,ngpestelos/docker,edx/docker,darrenstahlmsft/moby,seanmcdaniel/docker,ABaldwinHunter/docker,dnascimento/docker,mgireesh05/docker,isubuz/docker,jpopelka/docker,troy0820/docker.github.io,beatle/docker,carolfh/docker,ekuric/docker,catinthesky/docker,whuwxl/docker,vlajos/docker,JMesser81/docker,shaded-enmity/docker,gonkulator/docker,rghv/docker,mhrivnak/docker,thtanaka/docker,sharmasushant/docker,tombee/docker,jpopelka/docker,tiw/docker,jmtd/docker,kawamuray/docker,sanjeo/docker,kblin/docker,dharmit/docker,thomasfrancis1/docker,sreejithr/docker,lsxia/docker,elipiwas/DockerBirthday,omni360/docker,danyalKhaliq10p/moby,sarnautov/moby,jagdeesh109/docker,tbonza/docker,kerneltime/docker,scollier/docker,insequent/docker,dongjoon-hyun/docker,moypray/docker,toolchainX/docker,matthiasr/docker,vincentwoo/docker,inatatsu/docker,lyft/docker,Mokolea/docker,zhuguihua/docker,mohmost12/docker,pdevine/docker,airandfingers/docker,hemanthkumarsa13/test,gdi2290/docker,jlhawn/docker,azurezk/docker,glycerine/docker,solganik/docker,TrumanLing/docker,raghavtan/docker,tianon/docker,danix800/docker.github.io,majst01/docker,toli/docker,yummypeng/docker,cpuguy83/docker,Test-Betta-Inc/psychic-barnacle,moby/moby,edx/docker,scotttlin/docker,gonkulator/docker,lastgeniusleft2004/docker,manoj0077/docker,tombee/docker,thockin/docker,aaronlehmann/docker,mssola/docker,coolsvap/docker,samuelkarp/docker,dhiltgen/docker,yummypeng/docker,gjaskiewicz/moby,shubheksha/docker.github.io,waitingkuo/docker,shakamunyi/docker,aduermael/docker.github.io,yosifkit/docker,sunxiang0918/docker,goodwinos/docker,kblin/docker-debian,lsm5/docker,tt/docker,wzzrd/docker,duglin/docker,alex/docker,VincentYu/docker,fancyisbest/docker,SeMeKh/docker,gbarboza/docker,rremer/moby,basvdlei/docker,portworx/docker_v1.9.0,NIWAHideyuki/docker,jameszhan/docker,keyan/docker,ypid/docker,vincentbernat/docker,noxiouz/docker,jonahzheng/docker,carlye566/docker_eric,ncdc/docker,summershrimp/docker,ctrombley/docker,mtanlee/docker,DBCDK/docker,lucasjo/docker,gnailuy/docker,yoshiotu/docker,rogaha/docker,bertyuan/docker,JohnyDays/docker,nigelpoulton/docker,dnephin/docker,tagomoris/docker,Jimmy-Xu/hypercli,johnstep/moby-moby,LalatenduMohanty/docker,mtrmac/docker,adouang/docker,jc-m/docker,nawawi/docker,harche/docker,Morgy93/docker,icaroseara/docker,shiroyuki/docker,gnailuy/docker,arnib/docker,booyaa/docker,yp-engineering/docker,twistlock/docker,rhuss/docker,twosigma/docker-old,vegasbrianc/docker,POLJM242/docker,dperny/docker,allencloud/docker,foobar2github/docker,devonharvey/docker,xnox/docker,aneshas/docker,teotihuacanada/docker,edx/docker,FollowMyDev/docker,KumaranKamalanathan/docker,LoHChina/docker,bfirsh/docker,gschaetz/moby,hariharan16s/docker_vlan,POLJM242/docker,johnstep/moby-moby,YHM07/docker,jhorwit2/docker,andyxator/docker,makinacorpus/docker,msabansal/docker,keerthanabs1/docker,quaintcow/docker,RichardScothern/docker,qudongfang/docker,1uptalent/docker,itsnuwan/docker,squaremo/docker,kolyshkin/docker,lsxia/docker,cvallance/docker,ripcurld0/moby,nalind/docker,bdwill/docker.github.io,lsm5/docker,xiaoshaozi52/docker,ksasi/docker,askb/docker,dwcramer/docker,dangwy/docker,kencochrane/docker,rsmoorthy/docker-1,hacpai/docker,jvgogh/docker,denverdino/docker.github.io,crawford/docker,joaofnfernandes/docker.github.io,SaiedKazemi/docker,maaquib/docker,wlan0/docker,dit4c/docker,lsxia/docker,thaJeztah/docker.github.io,lixiaobing10051267/docker,jvanz/docker,chavezom/docker,JimGalasyn/docker.github.io,Evalle/docker,gcuisinier/docker,yp-engineering/docker,shin-/docker.github.io,denverdino/docker.github.io,robort/docker,myPublicGit/docker,glennblock/docker,kunalkushwaha/docker,alecbenson/docker,SophiaGitHub/hello,tklauser/docker,morninj/docker,mapuri/docker,haveatry/docker,j-stew/git_sandbox,zhuguihua/docker,ngpestelos/docker,oguzcanoguz/docker,bfirsh/docker,jonathanperret/docker,elipiwas/DockerBirthday,dinhxuanvu/docker,kwk/docker,DBCDK/docker,jvgogh/docker,itsNikolay/docker,tbronchain/docker-1,kirankbs/docker,ClusterHQ/docker,crawford/docker,imikushin/docker,anchal-agrawal/docker,porjo/docker,Tenk42/docker,hongbinz/docker,aarondav/docker,bexelbie/docker,beealone/docker,arnib/docker,hyperhq/hypercli,icaoweiwei/docker,13W/docker,NathanMcCauley/docker,stefanschneider/docker,kolyshkin/moby,cezarsa/docker,gdi2290/docker,tutumcloud/docker,gcuisinier/docker,cjlesiw/docker,fmoliveira/docker,tonistiigi/docker,Yhgenomics/docker,cc272309126/docker,londoncalling/docker.github.io,Chhunlong/docker,jordimassaguerpla/docker,londoncalling/docker.github.io,BSWANG/denverdino.github.io,springning/docker,dcbw/docker,hariharan16s/docker_vlan,haugene/docker,dperny/docker,dianping/docker,matthewvalimaki/docker,KumaranKamalanathan/docker,AtwoodCSB/Docker,macat/docker,ajneu/docker,asridharan/docker,huxingbang/docker,ai-traders/docker,xnox/docker,pugnascotia/docker,ashmo123/docker,vincentbernat/docker,wangcy6/docker,ClusterHQ/docker,cwandrews/docker,mgoelzer/docker,jjn2009/docker,ecnahc515/docker,rillig/docker.github.io,elipiwas/DockerBirthday,crosbymichael/docker,cnbin/docker,izaakschroeder/docker,gunjan5/docker,sanketsaurav/docker,kencochrane/docker,sallyom/docker,sc4599/docker,psquickitjayant/docker,krishnasrinivas/docker,merwok/docker,terminalcloud/docker,ygravrand/docker,andersjanmyr/docker,alena1108/docker,michaelhuettermann/docker,proppy/docker,JimGalasyn/docker.github.io,djs55/docker,danix800/docker.github.io,skatsuta/docker,dmcgowan/docker,1uptalent/docker,gabrielhartmann/docker,PatrickLang/moby,wangcy6/docker,sevki/docker,michael-holzheu/docker,rocknrollMarc/docker,YujiOshima/docker,ColinHebert/docker,cyphar/docker,kolyshkin/docker,dims/docker,fcrisciani/docker,kathir2903/docker,zhouxiaoxiaoxujian/docker,dwcramer/docker,booyaa/docker,nawawi/docker,13W/docker,maximkulkin/docker,containers/storage,dcbw/docker,wrouesnel/docker,deletoe/docker,wesseljt/docker,ypid/docker,CodyGuo/docker,umerazad/docker,TheBigBear/docker,softprops/docker,peterlei/docker,gnailuy/docker,mahak/docker,Ninir/docker,pkdevbox/docker,clintonskitson/docker,cezarsa/docker,justone/docker,shubheksha/docker.github.io,1uptalent/docker,tpounds/docker,kingland/docker,Jimmy-Xu/hypercli,thieman/docker,songinfo/docker,stevvooe/docker,yes-txh/docker,seblu/docker,wlan0/docker,cflannagan/docker,dgageot/docker,portworx/docker,zmarouf/docker,chenrui2014/docker,containers/storage,kenken0926/docker,softprops/docker,sharifmamun/docker,songinfo/docker,tophj-ibm/docker,shubheksha/docker.github.io,pkdevbox/docker,inversion/docker,ashmo123/docker,spf13/docker,goodwinos/docker,jrslv/docker,ndeloof/docker,calavera/docker,noironetworks/docker,solanolabs/docker,13W/docker,1yvT0s/docker,angryxlt/docker,nghiant2710/docker,Ye-Yong-Chi/docker,shakamunyi/docker,quaintcow/docker,leroy-chen/docker,shakamunyi/docker,estesp/docker,nicholaskh/docker,joeuo/docker.github.io,AlligatorSinensis/docker,sunyuan3/docker,seblu/docker,markprokoudine/docker,cezarsa/docker,cc272309126/docker,alanmpitts/docker,lyndaoleary/docker,proppy/docker,jecarey/docker,konstruktoid/docker-upstream,rickyzhang82/docker,chatenilesh/docker,msagheer/docker,Samurais/docker,qzio/docker,v47/docker,zhangg/docker,yoshiotu/docker,brahmaroutu/docker,lbthomsen/docker,izaakschroeder/docker,rhatdan/storage,JimGalasyn/docker.github.io,JimGalasyn/docker.github.io,coolsvap/docker,keerthanabs1/docker,Kaffa-MY/docker,jonathan-beard/docker,hallyn/docker,E312232595/docker,Altiscale/docker,jordimassaguerpla/docker,AnselZhangGit/docker,tmp6154/docker,anchal-agrawal/docker,smw/docker,shot/docker,kblin/docker-debian,pecameron/docker,sirxun/docker,yummypeng/docker,yongtang/docker,gaowenbin/docker,dyema/docker,ankushagarwal/docker,peterlei/docker,dezon/docker,darrenstahlmsft/docker,13W/docker,hongbinz/docker,newrelic-forks/docker,jmtd/docker,mukgupta/docker,jhorwit2/docker,remh/docker,rajurs/docker,hongbinz/docker,brianfoshee/docker,1HLtd/docker,sarnautov/moby,pradipd/moby,twosigma/docker-old,trebonian/docker,franklyhuan/docker-1,sequenceiq/docker,maxamillion/docker,ponsfrilus/docker,azurezk/docker,gdi2290/docker,Akasurde/docker,moby/moby,14rcole/docker,morninj/docker,joeuo/docker.github.io,Carrotzpc/docker,vanpire110/docker,boite/docker,duguhaotian/docker,jefby/docker,laijs/docker,Kaffa-MY/docker,toli/docker,vanloswang/docker,pmorie/docker,andrewnguyen/docker,AkihiroSuda/docker,gdevillele/docker.github.io,matthiasr/docker,erikstmartin/docker,krisdages/docker,binario200/docker,pecameron/docker,justyntemme/docker,tophj-ibm/docker,waitingkuo/docker,Shopify/docker,flavio/docker,beni55/docker,ivansaracino/docker,mstanleyjones/docker,snailwalker/docker,michael-donat/docker,mimoralea/docker,ItsVeryWindy/docker,brianbirke/docker,j-bennet/docker,denverdino/denverdino.github.io,hqhq/moby,campoy/docker,carlanton/docker,misterbisson/docker,tbronchain/docker-1,thaJeztah/docker,sean-jc/docker,scapewang/docker,camallen/docker,MabinGo/docker,gjaskiewicz/moby,webwurst/docker,rohitkadam19/docker,sterchelen/docker,toophy/docker,ClusterHQ/docker,beatle/docker,zhuohual/docker,rgl/docker,carlanton/docker,Distrotech/docker,hristozov/docker,carlosvquezada/docker,j-mracek/docker,zhangg/docker,sdurrheimer/docker,ydhydhjanson/docker,renrujue/docker,gigidwan/docker,zoomis/docker,asbjornenge/docker,mrjana/docker,thtanaka/docker,csfrancis/docker,micahhausler/docker,michelvocks/docker,jimjag/docker,danyalKhaliq10p/moby,matthewvalimaki/docker,burakcakirel/docker,anoshf/docker,camallen/docker,bertyuan/docker,abhinavdahiya/docker,ibuildthecloud/docker,flavio/docker,jamesodhunt/docker,joaofnfernandes/docker.github.io,brianbirke/docker,aarondav/docker,adouang/docker,coolsvap/docker,luxas/docker,mikedougherty/docker,DDCCOE/docker,CrazyJvm/docker,bogdangrigg/docker,WPH95/docker,BrianHicks/docker,trebonian/docker,roth1002/docker,inatatsu/docker,mhrivnak/docker,michaelhuettermann/docker,mchasal/docker,mahak/docker,mj340522/docker,kblin/docker,divya88ssn/docker,jasonamyers/docker,yasker/docker,zhaoshengbo/docker,vmware/docker,raychaser/docker,scotttlin/docker,jongiddy/docker,bluebreezecf/docker,denverdino/docker.github.io,iskradelta/docker,denverdino/docker.github.io,aboch/docker,konstruktoid/docker-1,gaobrian/docker,cr7pt0gr4ph7/docker,rvesse/docker,rsmitty/docker,wackyapples/docker,bonczj/moby-json-file-logger,mstanleyjones/docker,abhinavdahiya/docker,mikebrow/docker,quaintcow/docker,rvesse/docker,vmware/docker,rancher/docker,jimmyyan/docker,rocknrollMarc/docker,ZenikaOuest/docker,Syntaxide/docker,gdevillele/docker.github.io,jonathanperret/docker,justanshulsharma/docker,rajdeepd/docker,shhsu/docker,arneluehrs/docker,shiroyuki/docker,DBCDK/docker,labkode/docker,AnselZhangGit/docker,marimokkori/docker,konstruktoid/docker-upstream,ClusterHQ/docker-plugins,divya88ssn/docker,phiroict/docker,EricPai/docker,ZJUshuaizhou/docker,jthelin/docker,buddhamagnet/docker,hacfi/docker,lauly/dr,qilong0/docker,reem/docker,anusha-ragunathan/docker,boucher/docker,coreos/docker,bobrik/docker,wdxxs2z/docker,vijaykilari/docker,pgmcd/docker,airandfingers/docker,noxiouz/docker,hbdrawn/docker,yuchangchun1/docker,Akasurde/docker,shenxiaochen/docker,BSWANG/denverdino.github.io,JMesser81/docker,cstroe/docker,smw/docker,wrouesnel/docker,nicholaskh/docker,calavera/docker,yang1992/docker,rabbitcount/docker,uestcfyl/docker,spinolacastro/docker,cmehay/docker-1,csfrancis/docker,willmtemple/docker,josemonsalve2/docker,anhzhi/docker,micahhausler/docker,aditirajagopal/docker,anweiss/docker.github.io,lixiaobing10051267/docker,dyema/docker,cmehay/docker-1,shenxiaochen/docker,rhardih/docker,kingland/docker,Collinux/docker,guard163/docker,affo/docker,nickandrew/docker,kathir2903/docker,sanimej/docker,bbox-kula/docker,mike1729/docker,brahmaroutu/docker,lukaszraczylo/docker,dashengSun/docker,Evalle/docker,mattrobenolt/docker,yangdongsheng/docker,AlligatorSinensis/docker,mauidev/docker,Zenithar/docker,anshulr/docker,jamesmarva/docker,jzwlqx/denverdino.github.io,micahhausler/docker,mkumatag/docker,cloudflare/docker,anujbahuguna/docker,msagheer/docker,StevenLudwig/docker,sanketsaurav/docker,pmorie/docker,bajh/docker,michael-donat/docker,abudulemusa/docker,imeoer/hypercli,rkazak/docker,jssnlw/docker,guard163/docker,macat/docker,BSWANG/denverdino.github.io,xiaozi0lei/docker,wulonghui/docker,ZJUshuaizhou/docker,thtanaka/docker,roth1002/docker,kdomanski/docker,yoanisgil/docker,tutumcloud/docker,yes-txh/docker,rabbitcount/docker,vanloswang/docker,DarknessBeforeDawn/docker,jlebon/docker,jordimassaguerpla/docker,jssnlw/docker,Aegeaner/docker,erikstmartin/docker,crquan/docker,Shinzu/docker,HideoYamauchi/docker,moby/moby,DoraALin/docker,dhiltgen/docker,ColinHebert/docker,madhanrm/docker,ekuric/docker,1yvT0s/docker,konstruktoid/docker-1 | restructuredtext | ## Code Before:
===========================================
``run`` -- Run a command in a new container
===========================================
::
Usage: docker run [OPTIONS] IMAGE COMMAND [ARG...]
Run a command in a new container
-a=map[]: Attach to stdin, stdout or stderr.
-d=false: Detached mode: leave the container running in the background
-e=[]: Set environment variables
-h="": Container host name
-i=false: Keep stdin open even if not attached
-m=0: Memory limit (in bytes)
-p=[]: Map a network port to the container
-t=false: Allocate a pseudo-tty
-u="": Username or UID
## Instruction:
Update docs for Command Run
## Code After:
===========================================
``run`` -- Run a command in a new container
===========================================
::
Usage: docker run [OPTIONS] IMAGE COMMAND [ARG...]
Run a command in a new container
-a=map[]: Attach to stdin, stdout or stderr.
-d=false: Detached mode: leave the container running in the background
-e=[]: Set environment variables
-h="": Container host name
-i=false: Keep stdin open even if not attached
-m=0: Memory limit (in bytes)
-p=[]: Map a network port to the container
-t=false: Allocate a pseudo-tty
-u="": Username or UID
-d=[]: Set custom dns servers for the container
-v=[]: Creates a new volumes and mount it at the specified path. A container ID can be passed instead of a path in order to mount all volumes from the given container.
| ===========================================
``run`` -- Run a command in a new container
===========================================
::
Usage: docker run [OPTIONS] IMAGE COMMAND [ARG...]
Run a command in a new container
-a=map[]: Attach to stdin, stdout or stderr.
-d=false: Detached mode: leave the container running in the background
-e=[]: Set environment variables
-h="": Container host name
-i=false: Keep stdin open even if not attached
-m=0: Memory limit (in bytes)
-p=[]: Map a network port to the container
-t=false: Allocate a pseudo-tty
-u="": Username or UID
+ -d=[]: Set custom dns servers for the container
+ -v=[]: Creates a new volumes and mount it at the specified path. A container ID can be passed instead of a path in order to mount all volumes from the given container. | 2 | 0.105263 | 2 | 0 |
d31a9edbaff55e775e9f3232293a419ffb703835 | .travis.yml | .travis.yml | language: node_js
dist: trusty
sudo: required
cache:
directories:
- node_modules
services:
- postgresql
- mysql
node_js:
- '4'
- '6'
- '8'
before_install:
- sudo apt-get update
- wget https://raw.githubusercontent.com/Vincit/travis-oracledb-xe/master/accept_the_license_agreement_for_oracledb_xe_11g_and_install.sh
- bash ./accept_the_license_agreement_for_oracledb_xe_11g_and_install.sh
- npm install oracledb
before_script:
- psql -c 'create database bookshelf_test;' -U postgres
- mysql -e 'create database bookshelf_test;'
notifications:
email: false
env:
- CXX=g++-4.8 KNEX_TEST_TIMEOUT=60000 ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe ORACLE_SID=XE OCI_LIB_DIR=/u01/app/oracle/product/11.2.0/xe/lib LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/xe/lib
matrix:
fast_finish: true
addons:
apt:
packages:
- g++-4.8
- gcc-4.8
| language: node_js
dist: xenial
sudo: required
cache:
directories:
- node_modules
services:
- postgresql
- mysql
node_js:
- '4'
- '6'
- '8'
before_install:
- sudo apt-get update
- wget https://raw.githubusercontent.com/Vincit/travis-oracledb-xe/master/accept_the_license_agreement_for_oracledb_xe_11g_and_install.sh
- bash ./accept_the_license_agreement_for_oracledb_xe_11g_and_install.sh
- npm install oracledb
before_script:
- psql -c 'create database bookshelf_test;' -U postgres
- mysql -e 'create database bookshelf_test;'
notifications:
email: false
env:
- KNEX_TEST_TIMEOUT=60000 ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe ORACLE_SID=XE OCI_LIB_DIR=/u01/app/oracle/product/11.2.0/xe/lib LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/xe/lib
matrix:
fast_finish: true
| Update Travis image to Xenial (16.04) | Update Travis image to Xenial (16.04)
| YAML | mit | tgriesser/bookshelf,tgriesser/bookshelf,bookshelf/bookshelf,bookshelf/bookshelf | yaml | ## Code Before:
language: node_js
dist: trusty
sudo: required
cache:
directories:
- node_modules
services:
- postgresql
- mysql
node_js:
- '4'
- '6'
- '8'
before_install:
- sudo apt-get update
- wget https://raw.githubusercontent.com/Vincit/travis-oracledb-xe/master/accept_the_license_agreement_for_oracledb_xe_11g_and_install.sh
- bash ./accept_the_license_agreement_for_oracledb_xe_11g_and_install.sh
- npm install oracledb
before_script:
- psql -c 'create database bookshelf_test;' -U postgres
- mysql -e 'create database bookshelf_test;'
notifications:
email: false
env:
- CXX=g++-4.8 KNEX_TEST_TIMEOUT=60000 ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe ORACLE_SID=XE OCI_LIB_DIR=/u01/app/oracle/product/11.2.0/xe/lib LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/xe/lib
matrix:
fast_finish: true
addons:
apt:
packages:
- g++-4.8
- gcc-4.8
## Instruction:
Update Travis image to Xenial (16.04)
## Code After:
language: node_js
dist: xenial
sudo: required
cache:
directories:
- node_modules
services:
- postgresql
- mysql
node_js:
- '4'
- '6'
- '8'
before_install:
- sudo apt-get update
- wget https://raw.githubusercontent.com/Vincit/travis-oracledb-xe/master/accept_the_license_agreement_for_oracledb_xe_11g_and_install.sh
- bash ./accept_the_license_agreement_for_oracledb_xe_11g_and_install.sh
- npm install oracledb
before_script:
- psql -c 'create database bookshelf_test;' -U postgres
- mysql -e 'create database bookshelf_test;'
notifications:
email: false
env:
- KNEX_TEST_TIMEOUT=60000 ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe ORACLE_SID=XE OCI_LIB_DIR=/u01/app/oracle/product/11.2.0/xe/lib LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/xe/lib
matrix:
fast_finish: true
| language: node_js
- dist: trusty
+ dist: xenial
sudo: required
cache:
directories:
- node_modules
services:
- postgresql
- mysql
node_js:
- '4'
- '6'
- '8'
before_install:
- sudo apt-get update
- wget https://raw.githubusercontent.com/Vincit/travis-oracledb-xe/master/accept_the_license_agreement_for_oracledb_xe_11g_and_install.sh
- bash ./accept_the_license_agreement_for_oracledb_xe_11g_and_install.sh
- npm install oracledb
before_script:
- psql -c 'create database bookshelf_test;' -U postgres
- mysql -e 'create database bookshelf_test;'
notifications:
email: false
env:
- - CXX=g++-4.8 KNEX_TEST_TIMEOUT=60000 ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe ORACLE_SID=XE OCI_LIB_DIR=/u01/app/oracle/product/11.2.0/xe/lib LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/xe/lib
? ------------
+ - KNEX_TEST_TIMEOUT=60000 ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe ORACLE_SID=XE OCI_LIB_DIR=/u01/app/oracle/product/11.2.0/xe/lib LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/xe/lib
matrix:
fast_finish: true
-
- addons:
- apt:
- packages:
- - g++-4.8
- - gcc-4.8 | 10 | 0.243902 | 2 | 8 |
f8402c92977c87d0b84e88294090f69a1eb200ea | uchan/view/templates/board_view.html | uchan/view/templates/board_view.html | {% extends "base.html" %}
{% block content %}
<div class="board-header">
<h1>/{{ board.name }}/{% if full_name %} - {{ full_name }}{% endif %}</h1>
<div class="description">{{ description }}</div>
</div>
<br>
<hr class="content-divider">
{% if site_config.motd %}
<div class="motd">{{ site_config.motd }}</div>
<hr class="content-divider">
{% endif %}
{% block post_form_top %}{% endblock %}
{% block board_controls_top %}{% endblock %}
{% block board_view_content %}{% endblock %}
{% block board_controls_bottom %}{% endblock %}
{% block post_form_bottom %}{% endblock %}
{% endblock %}
{% block styles %}
{{ super() }}
{% assets "css_extra" %}<link rel="stylesheet" href="{{ ASSET_URL }}">{% endassets %}
{% endblock %}
{% block javascripts %}
<script>
window.pageDetails = {{ page_details|tojson|safe }};
</script>
{% assets "js_thread" %}
<script src="{{ ASSET_URL }}"></script>
{% endassets %}
{% assets "js_extra" %}
<script src="{{ ASSET_URL }}"></script>
{% endassets %}
{{ super() }}
{% endblock %}
| {% extends "base.html" %}
{% block content %}
<div class="board-header">
<h1>/{{ board.name }}/{% if full_name %} - {{ full_name }}{% endif %}</h1>
<div class="description">{{ description }}</div>
</div>
<br>
<hr class="content-divider">
{% if site_config.motd %}
<div class="motd">{{ site_config.motd|page_formatting }}</div>
<hr class="content-divider">
{% endif %}
{% block post_form_top %}{% endblock %}
{% block board_controls_top %}{% endblock %}
{% block board_view_content %}{% endblock %}
{% block board_controls_bottom %}{% endblock %}
{% block post_form_bottom %}{% endblock %}
{% endblock %}
{% block styles %}
{{ super() }}
{% assets "css_extra" %}<link rel="stylesheet" href="{{ ASSET_URL }}">{% endassets %}
{% endblock %}
{% block javascripts %}
<script>
window.pageDetails = {{ page_details|tojson|safe }};
</script>
{% assets "js_thread" %}
<script src="{{ ASSET_URL }}"></script>
{% endassets %}
{% assets "js_extra" %}
<script src="{{ ASSET_URL }}"></script>
{% endassets %}
{{ super() }}
{% endblock %}
| Add page formatting to motd. | Add page formatting to motd.
| HTML | mit | Floens/uchan,Floens/uchan,Floens/uchan,Floens/uchan,Floens/uchan | html | ## Code Before:
{% extends "base.html" %}
{% block content %}
<div class="board-header">
<h1>/{{ board.name }}/{% if full_name %} - {{ full_name }}{% endif %}</h1>
<div class="description">{{ description }}</div>
</div>
<br>
<hr class="content-divider">
{% if site_config.motd %}
<div class="motd">{{ site_config.motd }}</div>
<hr class="content-divider">
{% endif %}
{% block post_form_top %}{% endblock %}
{% block board_controls_top %}{% endblock %}
{% block board_view_content %}{% endblock %}
{% block board_controls_bottom %}{% endblock %}
{% block post_form_bottom %}{% endblock %}
{% endblock %}
{% block styles %}
{{ super() }}
{% assets "css_extra" %}<link rel="stylesheet" href="{{ ASSET_URL }}">{% endassets %}
{% endblock %}
{% block javascripts %}
<script>
window.pageDetails = {{ page_details|tojson|safe }};
</script>
{% assets "js_thread" %}
<script src="{{ ASSET_URL }}"></script>
{% endassets %}
{% assets "js_extra" %}
<script src="{{ ASSET_URL }}"></script>
{% endassets %}
{{ super() }}
{% endblock %}
## Instruction:
Add page formatting to motd.
## Code After:
{% extends "base.html" %}
{% block content %}
<div class="board-header">
<h1>/{{ board.name }}/{% if full_name %} - {{ full_name }}{% endif %}</h1>
<div class="description">{{ description }}</div>
</div>
<br>
<hr class="content-divider">
{% if site_config.motd %}
<div class="motd">{{ site_config.motd|page_formatting }}</div>
<hr class="content-divider">
{% endif %}
{% block post_form_top %}{% endblock %}
{% block board_controls_top %}{% endblock %}
{% block board_view_content %}{% endblock %}
{% block board_controls_bottom %}{% endblock %}
{% block post_form_bottom %}{% endblock %}
{% endblock %}
{% block styles %}
{{ super() }}
{% assets "css_extra" %}<link rel="stylesheet" href="{{ ASSET_URL }}">{% endassets %}
{% endblock %}
{% block javascripts %}
<script>
window.pageDetails = {{ page_details|tojson|safe }};
</script>
{% assets "js_thread" %}
<script src="{{ ASSET_URL }}"></script>
{% endassets %}
{% assets "js_extra" %}
<script src="{{ ASSET_URL }}"></script>
{% endassets %}
{{ super() }}
{% endblock %}
| {% extends "base.html" %}
{% block content %}
<div class="board-header">
<h1>/{{ board.name }}/{% if full_name %} - {{ full_name }}{% endif %}</h1>
<div class="description">{{ description }}</div>
</div>
<br>
<hr class="content-divider">
{% if site_config.motd %}
- <div class="motd">{{ site_config.motd }}</div>
+ <div class="motd">{{ site_config.motd|page_formatting }}</div>
? ++++++++++++++++
<hr class="content-divider">
{% endif %}
{% block post_form_top %}{% endblock %}
{% block board_controls_top %}{% endblock %}
{% block board_view_content %}{% endblock %}
{% block board_controls_bottom %}{% endblock %}
{% block post_form_bottom %}{% endblock %}
{% endblock %}
{% block styles %}
{{ super() }}
{% assets "css_extra" %}<link rel="stylesheet" href="{{ ASSET_URL }}">{% endassets %}
{% endblock %}
{% block javascripts %}
<script>
window.pageDetails = {{ page_details|tojson|safe }};
</script>
{% assets "js_thread" %}
<script src="{{ ASSET_URL }}"></script>
{% endassets %}
{% assets "js_extra" %}
<script src="{{ ASSET_URL }}"></script>
{% endassets %}
{{ super() }}
{% endblock %} | 2 | 0.042553 | 1 | 1 |
876750fbde952aaca5feae6709c9bf7bd7543003 | docs/cn/Theme.md | docs/cn/Theme.md |
Theme 是 Teaset 的组件样式定义对象, 用于定义 Teaset 组件的默认样式。
Teaset 提供的大部分组件均支持通过 style 属性定义样式, 可以通过代码修改 Teaset 组件的样式。基于 App 统一风格考虑, 建议通过重定义 Theme 对象的属性来修改 Teaset 组件的样式。
Teaset 提供 default 、 black 、 violet 三种配色方案, 默认值见[ThemeDefault.js](/themes/ThemeDefault.js)、[ThemeBlack.js](/themes/ThemeBlack.js)、[ThemeViolet.js](/themes/ThemeViolet.js), 可以自定义完整的配色方案, 也可使用上述一种方案并修改部分默认值。
建议在代码入口处设置 Theme 定义, 如果在 App 运行过程中修改 Theme 定义, 则需要重新加载已渲染的页面。
## Example
修改配色方案
```
import {Theme} from 'teaset';
Theme.set(Theme.themes.black);
```
修改部分默认值
```
import {Theme} from 'teaset';
Theme.set({
primaryColor: '#f55e5d',
backButtonTitle: '返回',
});
```
 
|
Theme 是 Teaset 的组件样式定义对象, 用于定义 Teaset 组件的默认样式。
Teaset 提供的大部分组件均支持通过 style 属性定义样式, 可以通过代码修改 Teaset 组件的样式。基于 App 统一风格考虑, 建议通过重定义 Theme 对象的属性来修改 Teaset 组件的样式。
Teaset 提供 default 、 black 、 violet 三种配色方案, 默认值见[ThemeDefault.js](/themes/ThemeDefault.js)、[ThemeBlack.js](/themes/ThemeBlack.js)、[ThemeViolet.js](/themes/ThemeViolet.js), 可以自定义完整的配色方案, 也可使用上述一种方案并修改部分默认值。
建议在代码入口处设置 Theme 定义, 如果在 App 运行过程中修改 Theme 定义, 则需要重新加载已渲染的页面。
## Example
修改配色方案
```
import {Theme} from 'teaset';
Theme.set(Theme.themes.black);
```
修改部分默认值
```
import {Theme} from 'teaset';
Theme.set({
primaryColor: '#f55e5d',
backButtonTitle: '返回',
});
```
## Screenshots
 
| Add black and violet theme | Add black and violet theme
| Markdown | mit | rilyu/teaset,rilyu/teaset,rilyu/teaset,rilyu/teaset | markdown | ## Code Before:
Theme 是 Teaset 的组件样式定义对象, 用于定义 Teaset 组件的默认样式。
Teaset 提供的大部分组件均支持通过 style 属性定义样式, 可以通过代码修改 Teaset 组件的样式。基于 App 统一风格考虑, 建议通过重定义 Theme 对象的属性来修改 Teaset 组件的样式。
Teaset 提供 default 、 black 、 violet 三种配色方案, 默认值见[ThemeDefault.js](/themes/ThemeDefault.js)、[ThemeBlack.js](/themes/ThemeBlack.js)、[ThemeViolet.js](/themes/ThemeViolet.js), 可以自定义完整的配色方案, 也可使用上述一种方案并修改部分默认值。
建议在代码入口处设置 Theme 定义, 如果在 App 运行过程中修改 Theme 定义, 则需要重新加载已渲染的页面。
## Example
修改配色方案
```
import {Theme} from 'teaset';
Theme.set(Theme.themes.black);
```
修改部分默认值
```
import {Theme} from 'teaset';
Theme.set({
primaryColor: '#f55e5d',
backButtonTitle: '返回',
});
```
 
## Instruction:
Add black and violet theme
## Code After:
Theme 是 Teaset 的组件样式定义对象, 用于定义 Teaset 组件的默认样式。
Teaset 提供的大部分组件均支持通过 style 属性定义样式, 可以通过代码修改 Teaset 组件的样式。基于 App 统一风格考虑, 建议通过重定义 Theme 对象的属性来修改 Teaset 组件的样式。
Teaset 提供 default 、 black 、 violet 三种配色方案, 默认值见[ThemeDefault.js](/themes/ThemeDefault.js)、[ThemeBlack.js](/themes/ThemeBlack.js)、[ThemeViolet.js](/themes/ThemeViolet.js), 可以自定义完整的配色方案, 也可使用上述一种方案并修改部分默认值。
建议在代码入口处设置 Theme 定义, 如果在 App 运行过程中修改 Theme 定义, 则需要重新加载已渲染的页面。
## Example
修改配色方案
```
import {Theme} from 'teaset';
Theme.set(Theme.themes.black);
```
修改部分默认值
```
import {Theme} from 'teaset';
Theme.set({
primaryColor: '#f55e5d',
backButtonTitle: '返回',
});
```
## Screenshots
 
|
Theme 是 Teaset 的组件样式定义对象, 用于定义 Teaset 组件的默认样式。
Teaset 提供的大部分组件均支持通过 style 属性定义样式, 可以通过代码修改 Teaset 组件的样式。基于 App 统一风格考虑, 建议通过重定义 Theme 对象的属性来修改 Teaset 组件的样式。
Teaset 提供 default 、 black 、 violet 三种配色方案, 默认值见[ThemeDefault.js](/themes/ThemeDefault.js)、[ThemeBlack.js](/themes/ThemeBlack.js)、[ThemeViolet.js](/themes/ThemeViolet.js), 可以自定义完整的配色方案, 也可使用上述一种方案并修改部分默认值。
建议在代码入口处设置 Theme 定义, 如果在 App 运行过程中修改 Theme 定义, 则需要重新加载已渲染的页面。
## Example
修改配色方案
```
import {Theme} from 'teaset';
Theme.set(Theme.themes.black);
```
修改部分默认值
```
import {Theme} from 'teaset';
Theme.set({
primaryColor: '#f55e5d',
backButtonTitle: '返回',
});
```
+
+ ## Screenshots
  | 2 | 0.068966 | 2 | 0 |
f515f61b49e2b9cd82a9f423eca720e932dc2aeb | src/reducers/ModulesReducer.js | src/reducers/ModulesReducer.js | /**
* mSupply Mobile
* Sustainable Solutions (NZ) Ltd. 2019
*/
import { UIDatabase } from '../database';
import { SETTINGS_KEYS } from '../settings';
import { SYNC_TRANSACTION_COMPLETE } from '../sync/constants';
/**
* Simple reducer managing the stores current modules state.
*
* State shape:
* {
* usingDashboard: [bool],
* usingDispensary: [bool],
* usingVaccines: [bool],
* usingModules: [bool],
* }
*/
const checkModule = key => UIDatabase.getSetting(key).toLowerCase() === 'true';
const modulesInitialState = () => {
const usingDashboard = checkModule(SETTINGS_KEYS.DASHBOARD_MODULE);
const usingDispensary = checkModule(SETTINGS_KEYS.DISPENSARY_MODULE);
const usingVaccines = checkModule(SETTINGS_KEYS.VACCINE_MODULE);
const usingModules = usingDashboard || usingDispensary || usingVaccines;
const modules = { usingDashboard, usingDispensary, usingVaccines, usingModules };
return { ...modules };
};
export const ModulesReducer = (state = modulesInitialState(), action) => {
const { type } = action;
switch (type) {
// After sync, refresh modules state
case SYNC_TRANSACTION_COMPLETE: {
return modulesInitialState();
}
default:
return state;
}
};
| /**
* mSupply Mobile
* Sustainable Solutions (NZ) Ltd. 2019
*/
import { UIDatabase } from '../database';
import { SETTINGS_KEYS } from '../settings';
import { SYNC_TRANSACTION_COMPLETE } from '../sync/constants';
/**
* Simple reducer managing the stores current modules state.
*/
const checkModule = key => UIDatabase.getSetting(key).toLowerCase() === 'true';
const initialState = () => {
const usingDashboard = checkModule(SETTINGS_KEYS.DASHBOARD_MODULE);
const usingDispensary = checkModule(SETTINGS_KEYS.DISPENSARY_MODULE);
const usingVaccines = checkModule(SETTINGS_KEYS.VACCINE_MODULE);
const usingPayments = checkModule(SETTINGS_KEYS.PAYMENT_MODULE);
const usingModules = usingDashboard || usingDispensary || usingVaccines || usingPayments;
const usingInsurance = UIDatabase.objects('InsuranceProvider').length > 0;
return {
usingPayments,
usingDashboard,
usingDispensary,
usingVaccines,
usingModules,
usingInsurance,
};
};
export const ModulesReducer = (state = initialState(), action) => {
const { type } = action;
switch (type) {
// After sync, refresh modules state
case SYNC_TRANSACTION_COMPLETE: {
return initialState();
}
default:
return state;
}
};
| Add payments and insurance to modules reducer | Add payments and insurance to modules reducer
| JavaScript | mit | sussol/mobile,sussol/mobile,sussol/mobile,sussol/mobile | javascript | ## Code Before:
/**
* mSupply Mobile
* Sustainable Solutions (NZ) Ltd. 2019
*/
import { UIDatabase } from '../database';
import { SETTINGS_KEYS } from '../settings';
import { SYNC_TRANSACTION_COMPLETE } from '../sync/constants';
/**
* Simple reducer managing the stores current modules state.
*
* State shape:
* {
* usingDashboard: [bool],
* usingDispensary: [bool],
* usingVaccines: [bool],
* usingModules: [bool],
* }
*/
const checkModule = key => UIDatabase.getSetting(key).toLowerCase() === 'true';
const modulesInitialState = () => {
const usingDashboard = checkModule(SETTINGS_KEYS.DASHBOARD_MODULE);
const usingDispensary = checkModule(SETTINGS_KEYS.DISPENSARY_MODULE);
const usingVaccines = checkModule(SETTINGS_KEYS.VACCINE_MODULE);
const usingModules = usingDashboard || usingDispensary || usingVaccines;
const modules = { usingDashboard, usingDispensary, usingVaccines, usingModules };
return { ...modules };
};
export const ModulesReducer = (state = modulesInitialState(), action) => {
const { type } = action;
switch (type) {
// After sync, refresh modules state
case SYNC_TRANSACTION_COMPLETE: {
return modulesInitialState();
}
default:
return state;
}
};
## Instruction:
Add payments and insurance to modules reducer
## Code After:
/**
* mSupply Mobile
* Sustainable Solutions (NZ) Ltd. 2019
*/
import { UIDatabase } from '../database';
import { SETTINGS_KEYS } from '../settings';
import { SYNC_TRANSACTION_COMPLETE } from '../sync/constants';
/**
* Simple reducer managing the stores current modules state.
*/
const checkModule = key => UIDatabase.getSetting(key).toLowerCase() === 'true';
const initialState = () => {
const usingDashboard = checkModule(SETTINGS_KEYS.DASHBOARD_MODULE);
const usingDispensary = checkModule(SETTINGS_KEYS.DISPENSARY_MODULE);
const usingVaccines = checkModule(SETTINGS_KEYS.VACCINE_MODULE);
const usingPayments = checkModule(SETTINGS_KEYS.PAYMENT_MODULE);
const usingModules = usingDashboard || usingDispensary || usingVaccines || usingPayments;
const usingInsurance = UIDatabase.objects('InsuranceProvider').length > 0;
return {
usingPayments,
usingDashboard,
usingDispensary,
usingVaccines,
usingModules,
usingInsurance,
};
};
export const ModulesReducer = (state = initialState(), action) => {
const { type } = action;
switch (type) {
// After sync, refresh modules state
case SYNC_TRANSACTION_COMPLETE: {
return initialState();
}
default:
return state;
}
};
| /**
* mSupply Mobile
* Sustainable Solutions (NZ) Ltd. 2019
*/
import { UIDatabase } from '../database';
import { SETTINGS_KEYS } from '../settings';
import { SYNC_TRANSACTION_COMPLETE } from '../sync/constants';
/**
* Simple reducer managing the stores current modules state.
- *
- * State shape:
- * {
- * usingDashboard: [bool],
- * usingDispensary: [bool],
- * usingVaccines: [bool],
- * usingModules: [bool],
- * }
*/
const checkModule = key => UIDatabase.getSetting(key).toLowerCase() === 'true';
- const modulesInitialState = () => {
? ^^^^^^^^
+ const initialState = () => {
? ^
const usingDashboard = checkModule(SETTINGS_KEYS.DASHBOARD_MODULE);
const usingDispensary = checkModule(SETTINGS_KEYS.DISPENSARY_MODULE);
const usingVaccines = checkModule(SETTINGS_KEYS.VACCINE_MODULE);
+ const usingPayments = checkModule(SETTINGS_KEYS.PAYMENT_MODULE);
- const usingModules = usingDashboard || usingDispensary || usingVaccines;
+ const usingModules = usingDashboard || usingDispensary || usingVaccines || usingPayments;
? +++++++++++++++++
- const modules = { usingDashboard, usingDispensary, usingVaccines, usingModules };
- return { ...modules };
+ const usingInsurance = UIDatabase.objects('InsuranceProvider').length > 0;
+
+ return {
+ usingPayments,
+ usingDashboard,
+ usingDispensary,
+ usingVaccines,
+ usingModules,
+ usingInsurance,
+ };
};
- export const ModulesReducer = (state = modulesInitialState(), action) => {
? ^^^^^^^^
+ export const ModulesReducer = (state = initialState(), action) => {
? ^
const { type } = action;
switch (type) {
// After sync, refresh modules state
case SYNC_TRANSACTION_COMPLETE: {
- return modulesInitialState();
? ^^^^^^^^
+ return initialState();
? ^
}
default:
return state;
}
}; | 29 | 0.644444 | 15 | 14 |
924691794efc59c6a13c0022cbbd55d476546aad | README.md | README.md | visible.event.js
================
Set of JavaScript function that provide ability to detect displayed/hidden of any element based on DOM Attribute Modified API.
| visible.event.js
==================================================
Set of JavaScript function that provide ability to detect displayed/hidden of any element based on DOM Attribute Modified API.
Reference Guides
--------------------------------------
http://jsbin.com/oVoDasu/1/ | Add example page on JSBin website. | Add example page on JSBin website.
| Markdown | mit | Soul-Master/visible.event.js | markdown | ## Code Before:
visible.event.js
================
Set of JavaScript function that provide ability to detect displayed/hidden of any element based on DOM Attribute Modified API.
## Instruction:
Add example page on JSBin website.
## Code After:
visible.event.js
==================================================
Set of JavaScript function that provide ability to detect displayed/hidden of any element based on DOM Attribute Modified API.
Reference Guides
--------------------------------------
http://jsbin.com/oVoDasu/1/ | visible.event.js
- ================
+ ==================================================
Set of JavaScript function that provide ability to detect displayed/hidden of any element based on DOM Attribute Modified API.
+
+ Reference Guides
+ --------------------------------------
+
+ http://jsbin.com/oVoDasu/1/ | 7 | 1.75 | 6 | 1 |
3c8fb79c665f708735e98a250ddf866216d9b660 | bedrock/base/templates/includes/head-meta.html | bedrock/base/templates/includes/head-meta.html | <link rel="canonical" hreflang="{{ LANG }}" href="{{ settings.CANONICAL_URL + '/' + LANG + canonical_path }}">
<link rel="alternate" hreflang="x-default" href="{{ canonical_path }}">
{% for code, label in translations|dictsort -%}
<link rel="alternate" hreflang="{{ code }}" href="{{ '/' + code + canonical_path }}" title="{{ label|safe }}">
{% endfor -%}
| <link rel="canonical" hreflang="{{ LANG }}" href="{{ settings.CANONICAL_URL + '/' + LANG + canonical_path }}">
<link rel="alternate" hreflang="x-default" href="{{ canonical_path }}">
{% if translations %}
{% for code, label in translations|dictsort -%}
<link rel="alternate" hreflang="{{ code }}" href="{{ '/' + code + canonical_path }}" title="{{ label|safe }}">
{% endfor -%}
{% endif %}
| Fix issue with undefined translations variable. | Fix issue with undefined translations variable.
If the view doesn't use RequestContext the `translations`
variable won't exist, and the `dictsort` filter will raise
and exception.
| HTML | mpl-2.0 | sylvestre/bedrock,Sancus/bedrock,kyoshino/bedrock,hoosteeno/bedrock,jgmize/bedrock,analytics-pros/mozilla-bedrock,sylvestre/bedrock,analytics-pros/mozilla-bedrock,TheoChevalier/bedrock,mahinthjoe/bedrock,schalkneethling/bedrock,dudepare/bedrock,jacshfr/mozilla-bedrock,Sancus/bedrock,mahinthjoe/bedrock,bensternthal/bedrock,amjadm61/bedrock,petabyte/bedrock,andreadelrio/bedrock,flodolo/bedrock,malena/bedrock,jgmize/bedrock,schalkneethling/bedrock,rishiloyola/bedrock,TheJJ100100/bedrock,gauthierm/bedrock,CSCI-462-01-2017/bedrock,TheoChevalier/bedrock,Jobava/bedrock,marcoscaceres/bedrock,l-hedgehog/bedrock,pascalchevrel/bedrock,mozilla/bedrock,jacshfr/mozilla-bedrock,jgmize/bedrock,gerv/bedrock,ericawright/bedrock,mmmavis/bedrock,Sancus/bedrock,elin-moco/bedrock,elin-moco/bedrock,davehunt/bedrock,malena/bedrock,mermi/bedrock,jpetto/bedrock,ckprice/bedrock,CSCI-462-01-2017/bedrock,SujaySKumar/bedrock,pmclanahan/bedrock,hoosteeno/bedrock,glogiotatidis/bedrock,sgarrity/bedrock,rishiloyola/bedrock,mmmavis/lightbeam-bedrock-website,pascalchevrel/bedrock,mmmavis/bedrock,elin-moco/bedrock,jacshfr/mozilla-bedrock,ericawright/bedrock,ckprice/bedrock,schalkneethling/bedrock,davehunt/bedrock,petabyte/bedrock,jacshfr/mozilla-bedrock,yglazko/bedrock,kyoshino/bedrock,sylvestre/bedrock,jpetto/bedrock,chirilo/bedrock,pascalchevrel/bedrock,glogiotatidis/bedrock,MichaelKohler/bedrock,pascalchevrel/bedrock,jacshfr/mozilla-bedrock,mozilla/bedrock,sgarrity/bedrock,craigcook/bedrock,alexgibson/bedrock,gauthierm/bedrock,sgarrity/bedrock,marcoscaceres/bedrock,TheoChevalier/bedrock,mkmelin/bedrock,craigcook/bedrock,malena/bedrock,mozilla/bedrock,Jobava/bedrock,ericawright/bedrock,mkmelin/bedrock,mozilla/bedrock,flodolo/bedrock,yglazko/bedrock,mmmavis/lightbeam-bedrock-website,flodolo/bedrock,amjadm61/bedrock,mermi/bedrock,davehunt/bedrock,analytics-pros/mozilla-bedrock,andreadelrio/bedrock,bensternthal/bedrock,marcoscaceres/bedrock,jpetto/bedrock,l-hedgehog/bedrock,kyoshino/bedrock,TheJJ100100/bedrock,petabyte/bedrock,CSCI-462-01-2017/bedrock,amjadm61/bedrock,sylvestre/bedrock,chirilo/bedrock,MichaelKohler/bedrock,rishiloyola/bedrock,dudepare/bedrock,alexgibson/bedrock,glogiotatidis/bedrock,Jobava/bedrock,gerv/bedrock,Sancus/bedrock,amjadm61/bedrock,dudepare/bedrock,mermi/bedrock,amjadm61/bedrock,MichaelKohler/bedrock,yglazko/bedrock,pmclanahan/bedrock,TheoChevalier/bedrock,schalkneethling/bedrock,SujaySKumar/bedrock,TheJJ100100/bedrock,gauthierm/bedrock,flodolo/bedrock,andreadelrio/bedrock,pmclanahan/bedrock,SujaySKumar/bedrock,alexgibson/bedrock,sgarrity/bedrock,mmmavis/bedrock,hoosteeno/bedrock,elin-moco/bedrock,pmclanahan/bedrock,bensternthal/bedrock,jgmize/bedrock,jpetto/bedrock,craigcook/bedrock,MichaelKohler/bedrock,mmmavis/lightbeam-bedrock-website,alexgibson/bedrock,Jobava/bedrock,ckprice/bedrock,ckprice/bedrock,davehunt/bedrock,malena/bedrock,rishiloyola/bedrock,craigcook/bedrock,CSCI-462-01-2017/bedrock,gerv/bedrock,gerv/bedrock,l-hedgehog/bedrock,SujaySKumar/bedrock,chirilo/bedrock,dudepare/bedrock,glogiotatidis/bedrock,analytics-pros/mozilla-bedrock,ericawright/bedrock,gauthierm/bedrock,andreadelrio/bedrock,petabyte/bedrock,mermi/bedrock,yglazko/bedrock,mkmelin/bedrock,hoosteeno/bedrock,chirilo/bedrock,l-hedgehog/bedrock,mmmavis/bedrock,marcoscaceres/bedrock,kyoshino/bedrock,mahinthjoe/bedrock,mkmelin/bedrock,TheJJ100100/bedrock,bensternthal/bedrock,mahinthjoe/bedrock | html | ## Code Before:
<link rel="canonical" hreflang="{{ LANG }}" href="{{ settings.CANONICAL_URL + '/' + LANG + canonical_path }}">
<link rel="alternate" hreflang="x-default" href="{{ canonical_path }}">
{% for code, label in translations|dictsort -%}
<link rel="alternate" hreflang="{{ code }}" href="{{ '/' + code + canonical_path }}" title="{{ label|safe }}">
{% endfor -%}
## Instruction:
Fix issue with undefined translations variable.
If the view doesn't use RequestContext the `translations`
variable won't exist, and the `dictsort` filter will raise
and exception.
## Code After:
<link rel="canonical" hreflang="{{ LANG }}" href="{{ settings.CANONICAL_URL + '/' + LANG + canonical_path }}">
<link rel="alternate" hreflang="x-default" href="{{ canonical_path }}">
{% if translations %}
{% for code, label in translations|dictsort -%}
<link rel="alternate" hreflang="{{ code }}" href="{{ '/' + code + canonical_path }}" title="{{ label|safe }}">
{% endfor -%}
{% endif %}
| <link rel="canonical" hreflang="{{ LANG }}" href="{{ settings.CANONICAL_URL + '/' + LANG + canonical_path }}">
<link rel="alternate" hreflang="x-default" href="{{ canonical_path }}">
+ {% if translations %}
- {% for code, label in translations|dictsort -%}
+ {% for code, label in translations|dictsort -%}
? ++
- <link rel="alternate" hreflang="{{ code }}" href="{{ '/' + code + canonical_path }}" title="{{ label|safe }}">
+ <link rel="alternate" hreflang="{{ code }}" href="{{ '/' + code + canonical_path }}" title="{{ label|safe }}">
? ++
- {% endfor -%}
+ {% endfor -%}
? ++
+ {% endif %} | 8 | 1.6 | 5 | 3 |
45438b520b24d7b6769737d3dd8cf3c23f87ef12 | src/applyMiddleware.js | src/applyMiddleware.js | import compose from './compose'
/**
* Creates a store enhancer that applies middleware to the dispatch method
* of the Redux store. This is handy for a variety of tasks, such as expressing
* asynchronous actions in a concise manner, or logging every action payload.
*
* See `redux-thunk` package as an example of the Redux middleware.
*
* Because middleware is potentially asynchronous, this should be the first
* store enhancer in the composition chain.
*
* Note that each middleware will be given the `dispatch` and `getState` functions
* as named arguments.
*
* @param {...Function} middlewares The middleware chain to be applied.
* @returns {Function} A store enhancer applying the middleware.
*/
export default function applyMiddleware(...middlewares) {
return (next) => (reducer, initialState) => {
var store = next(reducer, initialState)
var dispatch = store.dispatch
var chain = []
var middlewareAPI = {
getState: store.getState,
dispatch: (action) => dispatch(action)
}
chain = middlewares.map(middleware => middleware(middlewareAPI))
dispatch = compose(...chain)(store.dispatch)
return {
...store,
dispatch
}
}
}
| import compose from './compose'
/**
* Creates a store enhancer that applies middleware to the dispatch method
* of the Redux store. This is handy for a variety of tasks, such as expressing
* asynchronous actions in a concise manner, or logging every action payload.
*
* See `redux-thunk` package as an example of the Redux middleware.
*
* Because middleware is potentially asynchronous, this should be the first
* store enhancer in the composition chain.
*
* Note that each middleware will be given the `dispatch` and `getState` functions
* as named arguments.
*
* @param {...Function} middlewares The middleware chain to be applied.
* @returns {Function} A store enhancer applying the middleware.
*/
export default function applyMiddleware(...middlewares) {
return (createStore) => (reducer, initialState) => {
var store = createStore(reducer, initialState)
var dispatch = store.dispatch
var chain = []
var middlewareAPI = {
getState: store.getState,
dispatch: (action) => dispatch(action)
}
chain = middlewares.map(middleware => middleware(middlewareAPI))
dispatch = compose(...chain)(store.dispatch)
return {
...store,
dispatch
}
}
}
| Change next to createStore for better readability | Change next to createStore for better readability
| JavaScript | mit | joaomilho/redux,edge/redux,chentsulin/redux,leoasis/redux,naoishii/ohk2016C,CompuIves/redux,doerme/redux,ptkach/redux,joaomilho/redux,gaearon/redux,jas-chen/redux,lifeiscontent/redux,mikekidder/redux,splendido/redux,jas-chen/typed-redux,CompuIves/redux,paulkogel/redux,neighborhood999/redux,okmttdhr/redux-with-comment,mjw56/redux,tatsuhino/reactPractice,tatsuhino/reactPractice,splendido/redux,mjw56/redux,jas-chen/typed-redux,bvasko/redux,lifeiscontent/redux,joshwreford/idle-game,roth1002/redux,joshwreford/idle-game,bvasko/redux,ptkach/redux,roth1002/redux,keyanzhang/redux,Aweary/redux,tappleby/redux,Aweary/redux,tappleby/redux,tappleby/redux,jas-chen/redux,chentsulin/redux,gaearon/redux,javascriptjedi/redux-select,neighborhood999/redux,doerme/redux | javascript | ## Code Before:
import compose from './compose'
/**
* Creates a store enhancer that applies middleware to the dispatch method
* of the Redux store. This is handy for a variety of tasks, such as expressing
* asynchronous actions in a concise manner, or logging every action payload.
*
* See `redux-thunk` package as an example of the Redux middleware.
*
* Because middleware is potentially asynchronous, this should be the first
* store enhancer in the composition chain.
*
* Note that each middleware will be given the `dispatch` and `getState` functions
* as named arguments.
*
* @param {...Function} middlewares The middleware chain to be applied.
* @returns {Function} A store enhancer applying the middleware.
*/
export default function applyMiddleware(...middlewares) {
return (next) => (reducer, initialState) => {
var store = next(reducer, initialState)
var dispatch = store.dispatch
var chain = []
var middlewareAPI = {
getState: store.getState,
dispatch: (action) => dispatch(action)
}
chain = middlewares.map(middleware => middleware(middlewareAPI))
dispatch = compose(...chain)(store.dispatch)
return {
...store,
dispatch
}
}
}
## Instruction:
Change next to createStore for better readability
## Code After:
import compose from './compose'
/**
* Creates a store enhancer that applies middleware to the dispatch method
* of the Redux store. This is handy for a variety of tasks, such as expressing
* asynchronous actions in a concise manner, or logging every action payload.
*
* See `redux-thunk` package as an example of the Redux middleware.
*
* Because middleware is potentially asynchronous, this should be the first
* store enhancer in the composition chain.
*
* Note that each middleware will be given the `dispatch` and `getState` functions
* as named arguments.
*
* @param {...Function} middlewares The middleware chain to be applied.
* @returns {Function} A store enhancer applying the middleware.
*/
export default function applyMiddleware(...middlewares) {
return (createStore) => (reducer, initialState) => {
var store = createStore(reducer, initialState)
var dispatch = store.dispatch
var chain = []
var middlewareAPI = {
getState: store.getState,
dispatch: (action) => dispatch(action)
}
chain = middlewares.map(middleware => middleware(middlewareAPI))
dispatch = compose(...chain)(store.dispatch)
return {
...store,
dispatch
}
}
}
| import compose from './compose'
/**
* Creates a store enhancer that applies middleware to the dispatch method
* of the Redux store. This is handy for a variety of tasks, such as expressing
* asynchronous actions in a concise manner, or logging every action payload.
*
* See `redux-thunk` package as an example of the Redux middleware.
*
* Because middleware is potentially asynchronous, this should be the first
* store enhancer in the composition chain.
*
* Note that each middleware will be given the `dispatch` and `getState` functions
* as named arguments.
*
* @param {...Function} middlewares The middleware chain to be applied.
* @returns {Function} A store enhancer applying the middleware.
*/
export default function applyMiddleware(...middlewares) {
- return (next) => (reducer, initialState) => {
? ^ ^
+ return (createStore) => (reducer, initialState) => {
? ^^ ^ ++++++
- var store = next(reducer, initialState)
? ^ ^
+ var store = createStore(reducer, initialState)
? ^^ ^ ++++++
var dispatch = store.dispatch
var chain = []
var middlewareAPI = {
getState: store.getState,
dispatch: (action) => dispatch(action)
}
chain = middlewares.map(middleware => middleware(middlewareAPI))
dispatch = compose(...chain)(store.dispatch)
return {
...store,
dispatch
}
}
} | 4 | 0.108108 | 2 | 2 |
3b3a7ae7dccf634d015b91c743abf10db3f79b2b | test/integration/home_page_test.rb | test/integration/home_page_test.rb |
require "test_helper"
class HomePageTest < ActionDispatch::IntegrationTest
def setup
super
@path = root_path
end
def site
@site ||= sites(:madrid)
end
def faq_page
@faq_page ||= gobierto_cms_pages(:consultation_faq)
end
def privacy_page
@privacy_page ||= gobierto_cms_pages(:privacy)
end
def test_greeting_to_first_active_module
with_current_site(site) do
visit @path
assert has_content?("Participation")
end
end
def test_greeting_when_cms_is_main_module
site.configuration.home_page = "GobiertoCms"
site.configuration.home_page_item_id = faq_page.to_global_id
site.save!
with_current_site(site) do
visit @path
assert has_content?("Consultation page FAQ")
end
end
def test_privacy_page
with_current_site(site) do
visit @path
assert has_link?("By signing up you agree to the Privacy Policy")
privacy_page_link = find("a", text: "By signing up you agree to the Privacy Policy")
assert privacy_page_link[:href].include?(gobierto_cms_page_path(privacy_page.slug))
end
end
end
|
require "test_helper"
class HomePageTest < ActionDispatch::IntegrationTest
def setup
super
@path = root_path
end
def site
@site ||= sites(:madrid)
end
def faq_page
@faq_page ||= gobierto_cms_pages(:consultation_faq)
end
def privacy_page
@privacy_page ||= gobierto_cms_pages(:privacy)
end
def test_greeting_to_first_active_module
with_current_site(site) do
visit @path
assert has_content?("Participation")
end
end
def test_greeting_when_cms_is_main_module
site.configuration.home_page = "GobiertoCms"
site.configuration.home_page_item_id = faq_page.to_global_id
site.save!
with_current_site(site) do
visit @path
assert has_content?("Consultation page FAQ")
end
end
def test_privacy_page
with_current_site(site) do
visit @path
assert has_no_link?("By signing up you agree to the Privacy Policy")
end
end
end
| Change test of subscription box in footer layout | Change test of subscription box in footer layout
The test must be changed because bd2bc92a89 disables subscription box
| Ruby | agpl-3.0 | PopulateTools/gobierto-dev,PopulateTools/gobierto,PopulateTools/gobierto-dev,PopulateTools/gobierto,PopulateTools/gobierto-dev,PopulateTools/gobierto,PopulateTools/gobierto-dev,PopulateTools/gobierto | ruby | ## Code Before:
require "test_helper"
class HomePageTest < ActionDispatch::IntegrationTest
def setup
super
@path = root_path
end
def site
@site ||= sites(:madrid)
end
def faq_page
@faq_page ||= gobierto_cms_pages(:consultation_faq)
end
def privacy_page
@privacy_page ||= gobierto_cms_pages(:privacy)
end
def test_greeting_to_first_active_module
with_current_site(site) do
visit @path
assert has_content?("Participation")
end
end
def test_greeting_when_cms_is_main_module
site.configuration.home_page = "GobiertoCms"
site.configuration.home_page_item_id = faq_page.to_global_id
site.save!
with_current_site(site) do
visit @path
assert has_content?("Consultation page FAQ")
end
end
def test_privacy_page
with_current_site(site) do
visit @path
assert has_link?("By signing up you agree to the Privacy Policy")
privacy_page_link = find("a", text: "By signing up you agree to the Privacy Policy")
assert privacy_page_link[:href].include?(gobierto_cms_page_path(privacy_page.slug))
end
end
end
## Instruction:
Change test of subscription box in footer layout
The test must be changed because bd2bc92a89 disables subscription box
## Code After:
require "test_helper"
class HomePageTest < ActionDispatch::IntegrationTest
def setup
super
@path = root_path
end
def site
@site ||= sites(:madrid)
end
def faq_page
@faq_page ||= gobierto_cms_pages(:consultation_faq)
end
def privacy_page
@privacy_page ||= gobierto_cms_pages(:privacy)
end
def test_greeting_to_first_active_module
with_current_site(site) do
visit @path
assert has_content?("Participation")
end
end
def test_greeting_when_cms_is_main_module
site.configuration.home_page = "GobiertoCms"
site.configuration.home_page_item_id = faq_page.to_global_id
site.save!
with_current_site(site) do
visit @path
assert has_content?("Consultation page FAQ")
end
end
def test_privacy_page
with_current_site(site) do
visit @path
assert has_no_link?("By signing up you agree to the Privacy Policy")
end
end
end
|
require "test_helper"
class HomePageTest < ActionDispatch::IntegrationTest
def setup
super
@path = root_path
end
def site
@site ||= sites(:madrid)
end
def faq_page
@faq_page ||= gobierto_cms_pages(:consultation_faq)
end
def privacy_page
@privacy_page ||= gobierto_cms_pages(:privacy)
end
def test_greeting_to_first_active_module
with_current_site(site) do
visit @path
assert has_content?("Participation")
end
end
def test_greeting_when_cms_is_main_module
site.configuration.home_page = "GobiertoCms"
site.configuration.home_page_item_id = faq_page.to_global_id
site.save!
with_current_site(site) do
visit @path
assert has_content?("Consultation page FAQ")
end
end
def test_privacy_page
with_current_site(site) do
visit @path
- assert has_link?("By signing up you agree to the Privacy Policy")
+ assert has_no_link?("By signing up you agree to the Privacy Policy")
? +++
- privacy_page_link = find("a", text: "By signing up you agree to the Privacy Policy")
- assert privacy_page_link[:href].include?(gobierto_cms_page_path(privacy_page.slug))
end
end
end | 4 | 0.078431 | 1 | 3 |
d302d6f857657ada229f78d9fcd32f63753d9779 | client/components/boards/boardBody.jade | client/components/boards/boardBody.jade | template(name="board")
if isBoardReady.get
if currentBoard
if onlyShowCurrentCard
+cardDetails(currentCard)
else
+boardBody
else
//-- XXX We need a better error message in case the board has been archived
//-- +message(label="board-not-found")
| {{goHome}}
else
+spinner
template(name="boardBody")
.board-wrapper(class=currentBoard.colorClass)
+sidebar
.board-canvas.js-swimlanes.js-perfect-scrollbar(
class="{{#if Sidebar.isOpen}}is-sibling-sidebar-open{{/if}}"
class="{{#if MultiSelection.isActive}}is-multiselection-active{{/if}}"
class="{{#if draggingActive.get}}is-dragging-active{{/if}}")
if showOverlay.get
.board-overlay
if currentBoard.isTemplatesBoard
each currentBoard.swimlanes
+swimlane(this)
else if isViewSwimlanes
each currentBoard.swimlanes
+swimlane(this)
else if isViewLists
+listsGroup(currentBoard)
else if isViewCalendar
+calendarView
else
+listsGroup(currentBoard)
template(name="calendarView")
if isViewCalendar
.calendar-view.swimlane
if currentCard
+cardDetails(currentCard)
+fullcalendar(calendarOptions)
| template(name="board")
if isBoardReady.get
if currentBoard
if onlyShowCurrentCard
+cardDetails(currentCard)
else
+boardBody
else
//-- XXX We need a better error message in case the board has been archived
+message(label="board-not-found")
//-- | {{goHome}}
else
+spinner
template(name="boardBody")
.board-wrapper(class=currentBoard.colorClass)
+sidebar
.board-canvas.js-swimlanes.js-perfect-scrollbar(
class="{{#if Sidebar.isOpen}}is-sibling-sidebar-open{{/if}}"
class="{{#if MultiSelection.isActive}}is-multiselection-active{{/if}}"
class="{{#if draggingActive.get}}is-dragging-active{{/if}}")
if showOverlay.get
.board-overlay
if currentBoard.isTemplatesBoard
each currentBoard.swimlanes
+swimlane(this)
else if isViewSwimlanes
each currentBoard.swimlanes
+swimlane(this)
else if isViewLists
+listsGroup(currentBoard)
else if isViewCalendar
+calendarView
else
+listsGroup(currentBoard)
template(name="calendarView")
if isViewCalendar
.calendar-view.swimlane
if currentCard
+cardDetails(currentCard)
+fullcalendar(calendarOptions)
| Fix bug: When on board, clicking Admin Panel redirects to All Boards page, so it did require to click Admin Panel again. | Fix bug: When on board, clicking Admin Panel redirects to All Boards page,
so it did require to click Admin Panel again.
Thanks to xet7 !
| Jade | mit | wekan/wekan,GhassenRjab/wekan,wekan/wekan,wekan/wekan,GhassenRjab/wekan,wekan/wekan,wekan/wekan,GhassenRjab/wekan | jade | ## Code Before:
template(name="board")
if isBoardReady.get
if currentBoard
if onlyShowCurrentCard
+cardDetails(currentCard)
else
+boardBody
else
//-- XXX We need a better error message in case the board has been archived
//-- +message(label="board-not-found")
| {{goHome}}
else
+spinner
template(name="boardBody")
.board-wrapper(class=currentBoard.colorClass)
+sidebar
.board-canvas.js-swimlanes.js-perfect-scrollbar(
class="{{#if Sidebar.isOpen}}is-sibling-sidebar-open{{/if}}"
class="{{#if MultiSelection.isActive}}is-multiselection-active{{/if}}"
class="{{#if draggingActive.get}}is-dragging-active{{/if}}")
if showOverlay.get
.board-overlay
if currentBoard.isTemplatesBoard
each currentBoard.swimlanes
+swimlane(this)
else if isViewSwimlanes
each currentBoard.swimlanes
+swimlane(this)
else if isViewLists
+listsGroup(currentBoard)
else if isViewCalendar
+calendarView
else
+listsGroup(currentBoard)
template(name="calendarView")
if isViewCalendar
.calendar-view.swimlane
if currentCard
+cardDetails(currentCard)
+fullcalendar(calendarOptions)
## Instruction:
Fix bug: When on board, clicking Admin Panel redirects to All Boards page,
so it did require to click Admin Panel again.
Thanks to xet7 !
## Code After:
template(name="board")
if isBoardReady.get
if currentBoard
if onlyShowCurrentCard
+cardDetails(currentCard)
else
+boardBody
else
//-- XXX We need a better error message in case the board has been archived
+message(label="board-not-found")
//-- | {{goHome}}
else
+spinner
template(name="boardBody")
.board-wrapper(class=currentBoard.colorClass)
+sidebar
.board-canvas.js-swimlanes.js-perfect-scrollbar(
class="{{#if Sidebar.isOpen}}is-sibling-sidebar-open{{/if}}"
class="{{#if MultiSelection.isActive}}is-multiselection-active{{/if}}"
class="{{#if draggingActive.get}}is-dragging-active{{/if}}")
if showOverlay.get
.board-overlay
if currentBoard.isTemplatesBoard
each currentBoard.swimlanes
+swimlane(this)
else if isViewSwimlanes
each currentBoard.swimlanes
+swimlane(this)
else if isViewLists
+listsGroup(currentBoard)
else if isViewCalendar
+calendarView
else
+listsGroup(currentBoard)
template(name="calendarView")
if isViewCalendar
.calendar-view.swimlane
if currentCard
+cardDetails(currentCard)
+fullcalendar(calendarOptions)
| template(name="board")
if isBoardReady.get
if currentBoard
if onlyShowCurrentCard
+cardDetails(currentCard)
else
+boardBody
else
//-- XXX We need a better error message in case the board has been archived
- //-- +message(label="board-not-found")
? -----
+ +message(label="board-not-found")
- | {{goHome}}
+ //-- | {{goHome}}
? +++++
else
+spinner
template(name="boardBody")
.board-wrapper(class=currentBoard.colorClass)
+sidebar
.board-canvas.js-swimlanes.js-perfect-scrollbar(
class="{{#if Sidebar.isOpen}}is-sibling-sidebar-open{{/if}}"
class="{{#if MultiSelection.isActive}}is-multiselection-active{{/if}}"
class="{{#if draggingActive.get}}is-dragging-active{{/if}}")
if showOverlay.get
.board-overlay
if currentBoard.isTemplatesBoard
each currentBoard.swimlanes
+swimlane(this)
else if isViewSwimlanes
each currentBoard.swimlanes
+swimlane(this)
else if isViewLists
+listsGroup(currentBoard)
else if isViewCalendar
+calendarView
else
+listsGroup(currentBoard)
template(name="calendarView")
if isViewCalendar
.calendar-view.swimlane
if currentCard
+cardDetails(currentCard)
+fullcalendar(calendarOptions) | 4 | 0.095238 | 2 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.